posthog-js 1.428.2 → 1.428.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var t,e=["type"],i=["retriesPerformedSoFar"],r=["$set_once","$set"];function n(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 s(){return s=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},s.apply(null,arguments)}function o(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 a(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var s=t.apply(e,i);function a(t){o(s,r,n,a,l,"next",t)}function l(t){o(s,r,n,a,l,"throw",t)}a(void 0)})}}var l="u">typeof window?window:void 0,u="u">typeof globalThis?globalThis:l,h=null==u?void 0:u.navigator,d=null==u?void 0:u.document,v=null==u?void 0:u.location,c=null==u?void 0:u.fetch,f=null!=u&&u.XMLHttpRequest&&"withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:void 0,p=null==u?void 0:u.AbortController,g=null==u?void 0:u.CompressionStream,m=null==h?void 0:h.userAgent;function y(){return!(!l||!1===l.navigator.onLine)}var _="undefined"!=typeof globalThis?globalThis:l;_&&"undefined"==typeof self&&(_.self=_),_&&"undefined"==typeof File&&(_.File=function(){});var b=null!=l?l:{},w="$people_distinct_id",k="distinct_id",S="$device_id",x="$device_model",C="__alias",T="__cmpns",E="$fbc",M="$fbc_persistence",I="__timers",R="$autocapture_disabled_server_side",A="$heatmaps_enabled_server_side",P="$exception_capture_enabled_server_side",O="$error_tracking_suppression_rules",F="$error_tracking_capture_extension_exceptions",D="$web_vitals_enabled_server_side",L="$dead_clicks_enabled_server_side",N="$product_tours_enabled_server_side",q="$logs_capture_enabled_server_side",B="$web_vitals_allowed_metrics",j="$session_recording_remote_config",U="$session_recording_enabled_server_side",H="$replay_sample_rate",z="$replay_override_sampling",W="$replay_override_linked_flag",V="$replay_override_url_trigger",G="$replay_override_event_trigger",Z="$sesid",Q="$session_is_sampled",J="$session_past_minimum_duration",K="$session_recording_url_trigger_activated_session",Y="$session_recording_event_trigger_activated_session",X="$posthog_sr_group_event_trigger_",tt="$posthog_sr_group_url_trigger_",et="$posthog_sr_group_sampling_",it="$debug_first_full_snapshot_timestamp",rt="$sess_rec_flush_size",nt="$enabled_feature_flags",st="$active_feature_flags",ot="$early_access_features",at="$feature_flag_details",lt="$feature_flag_payloads",ut="$feature_flag_request_id",ht="$minimal_flag_called_events",dt="$override_feature_flags",vt="$override_feature_flag_payloads",ct="$stored_person_properties",ft="$stored_group_properties",pt="$groups",gt="$surveys",mt="$surveys_loaded_at",yt="$surveys_activated",_t="$surveys_activated_session",bt="$surveys_activated_timestamps",wt="ph_product_tours",kt="$product_tours_activated",St="$product_tours_activated_session",xt="$conversations_widget_session_id",Ct="$conversations_ticket_id",Tt="$conversations_widget_state",Et="$conversations_user_traits",Mt="$flag_call_reported",It="$flag_call_reported_session_id",Rt="$feature_flag_errors",At="$feature_flag_evaluated_at",Pt="$user_state",Ot="$client_session_props",Ft="$capture_rate_limit",$t="$initial_campaign_params",Dt="$initial_referrer_info",Lt="$initial_person_info",Nt="$epp",qt="$posthog_cookieless",Bt="$cookieless_mode",jt="$sdk_debug_extensions_init_method",Ut="$sdk_debug_extensions_init_time_ms",Ht="$sdk_debug_recording_script_not_loaded",zt="$sdk_debug_replay_event_trigger_status",Wt="$sdk_debug_replay_linked_flag_trigger_status",Vt="$sdk_debug_replay_matched_recording_trigger_groups",Gt="$sdk_debug_replay_pending_trigger_conditions",Zt="$sdk_debug_replay_remote_trigger_matching_config",Qt="$sdk_debug_replay_trigger_groups_count",Jt="$sdk_debug_replay_url_trigger_status",Kt="$sdk_debug_rrweb_attached",Yt="$sdk_debug_rrweb_start_attempted",Xt="$session_recording_start_reason",te="PostHog loadExternalDependency extension not found.",ee="anonymous",ie="identified",re="identified_only",ne="visibilitychange",se="beforeunload",oe="$pageview",ae="$pageleave",le="$identify",ue="$groupidentify",he=["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"],de=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return he.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function ve(t,e){return-1!==t.indexOf(e)}var ce=function(t){return t.trim()},fe=function(t){return t.replace(/^\$/,"")};function pe(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 ge=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}({}),me=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ye="min_length",_e="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"],we=["token"],ke=Object.prototype,Se=ke.hasOwnProperty,xe=ke.toString,Ce=Array.isArray||function(t){return"[object Array]"===xe.call(t)},Te=t=>"function"==typeof t,Ee=t=>t===Object(t)&&!Ce(t),Me=t=>{if(Ee(t)){for(var e in t)if(Se.call(t,e))return!1;return!0}return!1},Ie=t=>void 0===t,Re=t=>"[object String]"==xe.call(t),Ae=t=>Re(t)&&0===t.trim().length,Pe=t=>null===t,Oe=t=>Ie(t)||Pe(t),Fe=t=>"[object Number]"==xe.call(t)&&t==t,$e=t=>Fe(t)&&t>0,De=t=>"[object Boolean]"===xe.call(t),Le=t=>t instanceof FormData,Ne=t=>ve(be,t),qe=t=>ve(we,t);function Be(t){return null===t||"object"!=typeof t}function je(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Ue(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 We=[!0,"true",1,"1","yes"],Ve=t=>ve(We,t),Ge=[!1,"false",0,"0","no"];function Ze(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),Ze(null!=n?n:i,e,i,r))}var Qe=class{constructor(t){this.C={},this.I=t.I,this.R=Ze(t.bucketSize,0,100,t.A),this.O=Ze(t.refillRate,0,this.R,t.A),this.F=Ze(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",Ke="Android",Ye="Tablet",Xe="Android Tablet",ti="iPad",ei="Apple Watch",ii="Safari",ri="BlackBerry",ni="Samsung Internet",si="Chrome",oi="Chrome iOS",ai="Internet Explorer",li="Internet Explorer Mobile",ui="Opera",hi="Microsoft Edge",di="Firefox",vi="Firefox iOS",ci="Nintendo",fi="PlayStation",pi="Xbox",gi="Android Mobile",mi="Mobile Safari",yi="Windows",_i="Windows Phone",bi="Nokia",wi="Ouya",ki="Generic "+Je.toLowerCase(),Si="Generic "+Ye.toLowerCase(),xi="Konqueror",Ci="Oculus Browser",Ti="Vivaldi",Ei="Yandex",Mi="Whale",Ii="DuckDuckGo",Ri="Pale Moon",Ai="Waterfox",Pi="Brave",Oi="Claude",Fi="Codex",$i="ChatGPT",Di="Google Search App",Li=new RegExp("Version/(\\d+(\\.\\d+)?)"),Ni=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),qi=new RegExp(pi,"i"),Bi=new RegExp("PlayStation \\w+","i"),ji=new RegExp("Nintendo \\w+","i"),Ui=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?Pi:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&ve(t,"GSA/")?Di:ve(t," OPR/")&&ve(t,"Mini")?"Opera Mini":ve(t," OPR/")?ui:Ui.test(t)?ri:ve(t,"IEMobile")||ve(t,"WPDesktop")?li:ve(t,"OculusBrowser")?Ci:ve(t,"SamsungBrowser")?ni:ve(t,"Edge")||ve(t,"Edg/")?hi:ve(t,"Vivaldi/")?Ti:ve(t,"YaBrowser/")?Ei:ve(t,"Whale/")?Mi:ve(t,"DuckDuckGo/")||ve(t,"Ddg/")?Ii:ve(t,"Claude/")?Oi:ve(t,"Codex/")?Fi:ve(t,"ChatGPT/")?$i:ve(t,"FBIOS")?"Facebook Mobile":ve(t,"UCWEB")||ve(t,"UCBrowser")?"UC Browser":ve(t,"CriOS")?oi:ve(t,"CrMo")||ve(t,si)?si:ve(t,Ke)&&ve(t,ii)?gi:ve(t,"FxiOS")?vi:ve(t.toLowerCase(),xi.toLowerCase())?xi:ve(t,"Brave/")?Pi:((t,e)=>e&&ve(e,"Apple")||function(t){return ve(t,ii)&&!ve(t,si)&&!ve(t,Ke)}(t))(t,e)?ve(t,Je)?mi:ii:ve(t,"PaleMoon/")?Ri:ve(t,"Waterfox/")?Ai:ve(t,di)?di:ve(t,"MSIE")||ve(t,"Trident/")?ai:ve(t,"Gecko")?di:"")},Wi={[li]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[hi]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[si]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[oi]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ii]:[Li],[mi]:[Li],[ui]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[di]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[vi]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[xi]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ri]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Li],[gi]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ni]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[Ci]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Ti]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Ei]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Mi]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Pi]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Oi]:[Ni],[Fi]:[Ni],[$i]:[Ni],[Ii]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Ri]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ai]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Di]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[ai]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Vi=function(t,e,i,r){var n=Wi[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},Gi=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[pi,t&&t[1]||""]],[new RegExp(ci,"i"),[ci,""]],[new RegExp(fi,"i"),[fi,""]],[Ui,[ri,""]],[new RegExp(yi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[_i,""];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"),[yi,r]}return[yi,""]}],[/((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]?[Ke,[t[2],t[3],t[4]||"0"].join(".")]:[Ke,""]],[/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",""]]],Zi=function(t){for(var e=0;Gi.length>e;e++){var i=Gi[e],r=i[1],n=i[0].exec(t),s=n&&(Te(r)?r(n,t):r);if(s)return s}return["",""]},Qi=function(t){return ji.test(t)?ci:Bi.test(t)?fi:qi.test(t)?pi:new RegExp(wi,"i").test(t)?wi:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?_i:/iPad/.test(t)?ti:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ei:Ui.test(t)?ri:/(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)?Ke:Xe:new RegExp("(pda|Mobile)","i").test(t)?ki:new RegExp(Ye,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?Si:""},Ji=function(t,e){var i,r,n,s,o=Qi(t);return o===ti||o===Xe||"Kobo"===o||"Kindle Fire"===o||o===Si?Ye:o===ci||o===pi||o===fi||o===wi?"Console":o===ei?"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:Ye:"Desktop"},Ki=/\bFBAV\/(\d+(?:\.\d+)*)/i,Yi=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Ki],[/\bFBAN\/EMA\b/i,"Facebook Lite",Ki],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Ki],[/\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]",tr="[Unserializable]";function er(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 ir,rr,nr,sr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function or(t,e){return"string"==typeof(i=t)&&sr.test(i)?t:e();var i}function ar(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 lr(t){return t?t.split("#")[0]:t}function ur(t,e){var i=setTimeout(t,e);return null!=i&&i.unref&&(null==i||i.unref()),i}function hr(t,e,i){return dr.apply(this,arguments)}function dr(){return(dr=a(function*(t,e,i){var r;try{return yield Promise.race([t,new Promise((t,n)=>{r=ur(()=>{try{null==i||i(),t()}catch(t){n(t)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function vr(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return nr&&i.length===rr?nr:(rr=i.length,nr=i.reduce((i,r)=>{ir||(ir={});var n=ir[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,ir[r]=[l,u];break}}return i},{}))}}var cr=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 a(function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&Ce(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)),s({},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 a(function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i})()}convertToExceptionList(t,e){var i,r,n,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!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,s({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:vr(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 s({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}};function fr(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 pr=(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]},gr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,mr=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yr=/\((\S*)(?::(\d+))(?::(\d+))\)/,_r=(t,e)=>{var i=gr.exec(t);if(i)return fr(e,i[1],"?",+i[2],+i[3]);var r=mr.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=yr.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=pr(r[1]||"?",r[2]);return fr(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,wr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kr=(t,e)=>{var i=br.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=wr.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=pr(s,n);return fr(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Sr=/\(error: (.*)\)/;var xr=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Re(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")}},Cr=class{match(t){return Ue(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}},Tr=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 s({},r,{stack:null!==(i=this.Xi(t))&&void 0!==i?i:r.stack,synthetic:!0})}Ki(t){return Re(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(Re(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Er=/^(?:[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(Er);return r&&(e=r[1],i=r[2]),[e,i]}},Ir=["fatal","error","warning","log","info","debug"];function Rr(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 Ar=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 Re(e)&&!Ae(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: "+Rr(t)}isSeverityLevel(t){return Re(t)&&!Ae(t)&&Ir.indexOf(t)>=0}getStack(t){try{return Re(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Re(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(Ue(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},Pr=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: "+Rr(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},Or=class{match(t){return Be(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 Be(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}},$r="$message",Dr="$timestamp",Lr=new Set([$r,Dr]),Nr={enabled:!0,max_bytes:32768};function qr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Nr.enabled,max_bytes:jr(t.max_bytes,Nr.max_bytes)}:s({},Nr)}var Br=class{constructor(t){this.$n=[],this.Bn=0,this._n=qr(t)}setConfig(t){this._n=qr(t),this.Hn()}add(t){var e=function(t){var e;try{e=pe(t)}catch(t){return}try{var i=JSON.parse(e);if(!Ee(i))return;var r=i,n=r[$r],s=r[Dr];if(!Re(n)||0===n.trim().length)return;if(!Re(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 Ur=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 Wr,Vr=["$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"],Gr="NativeGzipValidationError",Zr=t=>t.length>=2&&31===t[0]&&139===t[1],Qr=(t,e)=>t===me.GZipJS||e===me.GZipJS||"gzip"===e,Jr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Kr=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Jr(t)||e===Gr},Yr=t=>{throw ar(Gr,"Native gzip produced invalid output: "+t)},Xr=function(){var t=a(function*(t,e){18>t.size&&Yr("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Zr(i)&&8===i[2]||Yr("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Wr)return Wr;Wr=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Wr[t]=e>>>0}return Wr})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Yr("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Yr("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function tn(t,e,i){return en.apply(this,arguments)}function en(){return en=a(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),o=s.write(r).then(()=>s.close()).catch(function(){var t=a(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,o]))[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}}),en.apply(this,arguments)}var rn={}.propertyIsEnumerable;function nn(t,e){try{return an(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function sn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,De(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:er(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?er(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return sn(a.call(t),e,i,r+1)}catch(t){}return Ce(t)?{arrayValue:{values:on(t,e,i,r+1)}}:{kvlistValue:{values:an(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:er(String(t))}}function on(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(Oe(a))continue;n.push(sn(a,e,i,r))}catch(t){n.push({stringValue:tr})}return t.length>o&&n.push({stringValue:Xi}),n}function an(t,e,i,r){var n=[];for(var s in t)if(rn.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(Pe(o)||Ie(o))continue;n.push({key:er(s),value:sn(o,e,i,r)})}catch(t){n.push({key:er(s),value:{stringValue:tr}})}}return n}function ln(t,e,i){return s({},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 un={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var hn={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}},dn=hn.info;function vn(t){try{return er(String(t))}catch(t){return tr}}function cn(t,e,i,r){var n,o=hn[t.level||"info"]||dn,a=o.text,l=o.number,u=(void 0===(n=Fe(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),h={};e.distinctId&&(h.posthogDistinctId=e.distinctId),e.sessionId&&(h.sessionId=e.sessionId),e.windowId&&(h["window.id"]=e.windowId),Oe(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Oe(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=s({},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=tr}Object.defineProperty(d,f,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:a,body:{stringValue:vn(t.body)},attributes:nn(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 fn(t,e,i){return ln(t,e,i)}function pn(t,e,i,r){return{resourceLogs:[{resource:{attributes:nn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var gn=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(ge.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:cn(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=Ce(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 a(function*(){if(!t._instance.isDisabled)return t.Gn||(t.Gn=t.fs().finally(()=>{t.Gn=null})),t.Gn})()}fs(){var t=this;return a(function*(){var e;t.us();var i=null!==(e=t._instance.getPersistedProperty(ge.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=pn(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(ge.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}ys(t){var e=this;return a(function*(){var i,r=Math.max(0,t-e.Zn),n=null!==(i=e._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(ge.LogsQueue,n.slice(r)),yield e.Wn()})()}ps(){return fn(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion())}cs(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(ge.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(ge.LogsQueue,i),this.ts>i.length?this.bs():this.hs()}}bs(t){void 0===t&&(t=this.rs),this._s||(this._s=ur(()=>{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(ge.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return a(function*(){e.us();var i=e.flush().catch(()=>{});void 0!==t?yield hr(i,t):yield i})()}flushWithTimeout(t){var e=this;return a(function*(){var i=e.flush();yield hr(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)}},mn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function yn(t){return String(t)+"000000"}function _n(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=a(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?s({},e.attributes):void 0,r=_n(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 n=this.Ss.get(r);if(!n){if(!this.As())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ss.set(r,n)}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(n,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(mn.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,mn)]+=1}}ds(t){var e=this._n.beforeSend;if(!e)return t;var i=Ce(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=ur(()=>{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 a(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 ln(t,e,i)}(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:nn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}$s(t){var e=yn(Date.now()),i=new Map;for(var r of t.values()){var n,o=_n(r.type,r.name,r.unit,void 0),a=i.get(o);a||(a=s({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=nn(null!==(n=r.attributes)&&void 0!==n?n:{},this.A),u=yn(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:mn})}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 wn(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var kn="0.8.2",Sn={DEBUG:!1,LIB_VERSION:kn,LIB_NAME:"browser-common",JS_SDK_VERSION:kn},xn=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];l&&(Sn.DEBUG||l.POSTHOG_DEBUG||i)&&!Ie(l.console)&&l.console&&("__rrweb_original__"in l.console[e]?l.console[e].__rrweb_original__:l.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)=>xn(t+" "+e,i)};return r},Cn=xn("[PostHog.js]"),Tn=Cn.createLogger;function En(t,e){Ce(t)&&t.forEach(e)}function Mn(t,e){if(!Oe(t))if(Ce(t))t.forEach(e);else if(Le(t))t.forEach((t,i)=>e(t,i));else for(var i in t)Se.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 Rn(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 An=function(t){try{return t()}catch(t){return}},Pn=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){Cn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Cn.critical(t)}}},On=function(t){var e={};return Mn(t,function(t,i){(Re(t)&&t.length>0||Fe(t))&&(e[i]=t)}),e};function Fn(t){var e=s({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var $n=["herokuapp.com","vercel.app","netlify.app"];function Dn(t){var e=null==t?void 0:t.hostname;if(!Re(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of $n)if(i===r)return!1;return!0}function Ln(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 Nn(t){return"ph_toolbar_internal"===t.name}var qn=["localhost","127.0.0.1"],Bn=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>Ue(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 pe(t)}},jn=t=>{var e=null==d?void 0:d.createElement("a");return Ie(e)?null:(e.href=t,e)},Un=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(!Ce(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){Cn.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("=");Ce(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},Wn=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Vn=(t,e)=>t>=e&&y(),Gn=(t,e,i,r)=>{if(0===t){if(y()){var n=e+1;return n===i&&r(),n}return e}return 0};function Zn(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Te(r))return e;try{var n=r(e);return Re(n)&&n?n:e}catch(t){return Cn.error("Error in get_current_url, falling back to window.location.href",t),e}}function Qn(t){var e,i=null==l||null==(e=l.location)?void 0:e.href;return Ie(i)?void 0:Zn(t,i)}function Jn(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Kn(t){return!!t&&1===t.nodeType}function Yn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Xn(t){return!!t&&3===t.nodeType}function ts(t){return!!t&&11===t.nodeType&&Kn(t.host)}function es(t){return t?ce(t).split(/\s+/):[]}function is(t,e){var i=Qn(e);return!!(i&&t&&t.some(t=>i.match(t)))}function rs(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 es(e)}function ns(t){return Oe(t)?null:ce(t).split(/(\s+)/).filter(t=>Rs(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ss(t){var e="";return ws(t)&&!ks(t)&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;Xn(t)&&t.textContent&&(e+=null!==(i=ns(t.textContent))&&void 0!==i?i:"")}),ce(e)}function os(t){var e;return Ie(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var as=["a","button","form","input","select","textarea","label"];function ls(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 us(t,e){if(Ie(e))return!0;var i,r=function(t){if(e.some(e=>ls(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function hs(t){var e=t.parentNode;return!(!e||!Kn(e))&&e}var ds=[".ph-no-autocapture","[data-ph-no-autocapture]"],vs=["next","previous","prev",">","<"],cs=[...vs,"+","-","−","–"],fs=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ps=[".ph-no-deadclick",".ph-no-capture"],gs=[".ph-no-rageclick",".ph-no-capture"],ms=["","text","search","email","password","url","tel","number"];function ys(t,e){if(!l||_s(t))return!1;var i,r,n,s,o;if(De(e)?(i=!!e&&gs,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:gs,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||!Kn(t))&&(!!Yn(t,"textarea")||(Yn(t,"input")?ve(ms,(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 a=bs(t,!1).targetElementList;return!function(t,e){if(!1===t||Ie(t))return!1;var i;if(!0===t)i=vs;else{if(!Ce(t))return!1;if(t.length>10)return Cn.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=>fs(e,t)||fs(r,t))})}(r,a.map(t=>{var e;return{safeText:ss(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!us(a,i)}var _s=t=>!t||Yn(t,"html")||!Kn(t),bs=(t,e)=>{if(!l||_s(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!Yn(n,"body");)if(ts(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=hs(n);if(!s)break;if(e||as.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var o=l.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function ws(t){for(var e=new Set,i=0,r=t;r.parentNode&&!Yn(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=rs(r);if(ve(n,"ph-sensitive")||ve(n,"ph-no-capture"))return!1}if(ve(rs(t),"ph-include"))return!0;var s=t.type||"";if(Re(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Re(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 ks(t){return!!(Yn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Yn(t,"select")||Yn(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Ss=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}))$"),xs=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Cs=[16,15,14,13],Ts=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Es=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 Rs(t,e){if(void 0===e&&(e=!0),Oe(t))return!1;if(Re(t)){if(t=ce(t),e?Ss.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(xs.lastIndex=0;e=xs.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Cs){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Ss.test(a)&&Is(a))return!0}}}return!1}(t))return!1;if(e?Ts.test(t):function(t){var e;for(Es.lastIndex=0;e=Es.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 As(t){var e=ss(t);return Rs(e=(e+" "+Ps(t)).trim())?e:""}function Ps(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=ss(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ps(t)).trim())}catch(t){Cn.error("[AutoCapture]",t)}}),e}function Os(t){return t.replace(/"|\\"/g,'\\"')}function Fs(t){var e=t.attr__class;if(e)return Ce(e)?e:es(e)}var $s=1e6;function Ds(t){var e;return Math.min($s,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Ls={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:$s,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},Ns=["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"],qs=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Bs=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],js=t=>{Oe(t)||Mn(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ns.includes(e)||Bs.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Us=["/s/","/e/","/i/"];function Hs(t,e,i,r){if(Oe(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Re(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function zs(t,e){if(Oe(t))return t;var i=t;return Rs(i,!1)||(i="[SessionRecording] "+e+" body redacted"),Mn(qs,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 Ws=new WeakSet,Vs="disabled",Gs="sampled",Zs="active",Qs="buffering",Js="paused",Ks="lazy_loading",Ys="rrweb_error",Xs="trigger_activated",to="trigger_pending",eo="trigger_disabled";function io(t,e,i,r,n,s){return 0===e?eo:(null==t?void 0:t.get_property(i?r+i:n))===s?Xs:to}function ro(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 no(t){return t.includes("trigger_activated")?Xs:t.includes("trigger_pending")?to:eo}function so(t){var e=new Set(t);switch(e.delete(eo),e.size){case 0:return eo;case 1:return Array.from(e)[0];default:return to}}var 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{constructor(t){this.j=t}triggerStatus(t){return so(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return so(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},lo=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Xs}stop(){}},uo=t=>"sessionRecording"in t,ho=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=(uo(t)?Ee(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(uo(t)?Ee(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){Cn.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){Cn.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return io(this._instance,this.B.length,this.V,tt,K,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=Qn(this._instance);if(!t)return!1;try{return ro(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=Qn(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=ro(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=Qn(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=ro(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===Xs,l=ro(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},vo=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({[Wt]:t}),t}triggerStatusNoSideEffects(){var t=to;return Oe(this.linkedFlag)&&(t=eo),this.linkedFlagSeen&&(t=Xs),t}onConfig(t,e){var i;if(this.linkedFlag=(uo(t)?Ee(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Oe(this.linkedFlag)&&!this.linkedFlagSeen){var r=Re(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Re(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(Ee(i)&&r in i){var o=i[r];s=De(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()}},co=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(uo(t)?Ee(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return io(this._instance,this.K.length,this.V,X,Y,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(){}},fo=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new ho(t,e.id),this.tt=new co(t,e.id),this.et=new vo(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 oo(s):new ao(s)}else this.rt=new lo}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===to).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?tt+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 po(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=!0===t.isSampled,i=new oo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Gs:"trigger_activated"===i?Zs:"trigger_pending"===i?Qs:!1===t.isSampled?Vs:Zs}function go(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=new ao([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==eo,r=De(t.isSampled);return i&&"trigger_pending"===e?Qs:i&&"trigger_disabled"===e||r&&!t.isSampled?Vs:!0===t.isSampled?Gs:Zs}function mo(){var t=[];return function(e,i){if(Ee(i)||Ce(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function yo(t){var e=JSON.stringify(t,mo());return e?new Blob([e]).size:0}function _o(t){if(Pe(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(Ce(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Ie(r)||Pe(r)?4:_o(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+_o(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 wo=Uint8Array,ko=Uint16Array,So=Uint32Array,xo=new wo([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]),Co=new wo([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]),To=new wo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Eo=function(t,e){for(var i=new ko(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new So(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=Eo(xo,2),Io=Mo[1];Mo[0][28]=258,Io[258]=28;for(var Ro=Eo(Co,0)[1],Ao=new ko(32768),Po=0;32768>Po;++Po){var Oo=(43690&Po)>>>1|(21845&Po)<<1;Ao[Po]=((65280&(Oo=(61680&(Oo=(52428&Oo)>>>2|(13107&Oo)<<2))>>>4|(3855&Oo)<<4))>>>8|(255&Oo)<<8)>>>1}var Fo=function(t,e,i){for(var r=t.length,n=0,s=new ko(e);r>n;++n)++s[t[n]-1];var o,a=new ko(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new ko(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Ao[d]>>>l]=u}else for(o=new ko(r),n=0;r>n;++n)o[n]=Ao[a[t[n]-1]++]>>>15-t[n];return o},$o=new wo(288);for(Po=0;144>Po;++Po)$o[Po]=8;for(Po=144;256>Po;++Po)$o[Po]=9;for(Po=256;280>Po;++Po)$o[Po]=7;for(Po=280;288>Po;++Po)$o[Po]=8;var Do=new wo(32);for(Po=0;32>Po;++Po)Do[Po]=5;var Lo=Fo($o,9,0),No=Fo(Do,5,0),qo=function(t){return(t/8|0)+(7&t&&1)},Bo=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof ko?ko:t instanceof So?So:wo)(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},Uo=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 wo(0),0];if(1==n){var o=new wo(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 ko(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 _=s[r].s;e>c[_]?p-=1<<e-c[_]++-1:++r}for(;r>=0&&p;--r){var b=s[r].s;c[b]==e&&(--c[b],++p)}f=e}return[new wo(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},Wo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new ko(++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]},Vo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Go=function(t,e,i){var r=i.length,n=qo(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)},Zo=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=Wo(v),y=m[0],_=m[1],b=Wo(p),w=b[0],k=b[1],S=new ko(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],E=C[1],M=19;M>4&&!T[To[M-1]];--M);var I,R,A,P,O=u+5<<3,F=Vo(n,$o)+Vo(s,Do)+o,D=Vo(n,v)+Vo(s,p)+o+14+3*M+Vo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(F>=O&&D>=O)return Go(e,h,t.subarray(l,l+u));if(jo(e,h,1+(F>D)),h+=2,F>D){I=Fo(v,c,0),R=v,A=Fo(p,g,0),P=p;var L=Fo(T,E,0);for(jo(e,h,_-257),jo(e,h+5,k-1),jo(e,h+10,M-4),h+=14,x=0;M>x;++x)jo(e,h+3*x,T[To[x]]);h+=3*M;for(var N=[y,w],q=0;2>q;++q){var B=N[q];for(x=0;B.length>x;++x)jo(e,h,L[j=31&B[x]]),h+=T[j],j>15&&(jo(e,h,B[x]>>>5&127),h+=B[x]>>>12)}}else I=Lo,R=$o,A=No,P=Do;for(x=0;a>x;++x)if(r[x]>255){var j;Uo(e,h,I[257+(j=r[x]>>>18&31)]),h+=R[j+257],j>7&&(jo(e,h,r[x]>>>23&31),h+=xo[j]);var U=31&r[x];Uo(e,h,A[U]),h+=P[U],U>3&&(Uo(e,h,r[x]>>>5&8191),h+=Co[U])}else Uo(e,h,I[r[x]]),h+=R[r[x]];return Uo(e,h,I[256]),h+R[256]},Qo=new So([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jo=new wo(0),Ko=function(){for(var t=new So(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Yo=function(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=Ko[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 wo(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=Go(l,u,t.subarray(h,d)):(l[h]=s,u=Go(l,u,t.subarray(h,o)))}else{for(var v=Qo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new ko(32768),m=new ko(p+1),y=Math.ceil(i/3),_=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<_)&p},w=new So(25e3),k=new ko(288),S=new ko(32),x=0,C=0,T=(h=0,0),E=0,M=0;o>h;++h){var I=b(h),R=32767&h,A=m[I];if(g[R]=A,m[I]=R,h>=E){var P=o-h;if((x>7e3||T>24576)&&P>423){u=Zo(t,l,0,w,k,S,C,T,M,h-M,u),T=x=C=0,M=h;for(var O=0;286>O;++O)k[O]=0;for(O=0;30>O;++O)S[O]=0}var F=2,D=0,L=f,N=R-A&32767;if(P>2&&I==b(h-N))for(var q=Math.min(c,P)-1,B=Math.min(32767,h),j=Math.min(258,P);B>=N&&--L&&R!=A;){if(t[h+F]==t[h+F-N]){for(var U=0;j>U&&t[h+U]==t[h+U-N];++U);if(U>F){if(F=U,D=N,U>q)break;var H=Math.min(N,U-2),z=0;for(O=0;H>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,A=W)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){w[T++]=268435456|Io[F]<<18|Ro[D];var G=31&Io[F],Z=31&Ro[D];C+=xo[G]+Co[Z],++k[257+G],++S[Z],E=h+F,++x}else w[T++]=t[h],++k[t[h]]}}u=Zo(t,l,s,w,k,S,C,T,M,h-M,u),s||(u=Go(l,u,Jo))}return Bo(a,0,r+qo(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&&Yo(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),Yo(u,h-8,i.d()),Yo(u,h-4,r),u}function ta(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new wo(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 wo(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Bo(r,0,n)}function ea(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 ia=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=_o(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 Qe({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:Cn}),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}};Sn.DEBUG=!1,Sn.LIB_VERSION="1.428.2",Sn.LIB_NAME="web";var ra=Sn,na=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(rt,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.Ct(rt);return Ee(e=i)&&Re(e.sessionId)&&Fe(e.size)&&i.sessionId===t?i.size:0}};function sa(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<Ze(100*e,0,100,Cn)}function oa(t){return"$survey_response_"+t}function aa(t,e){if(!e)return null;var i=t[oa(e)];return Ce(i)?[...i]:i}function la(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=aa(t,e.id);Ie(s)||(r[n]=s)}}),s({$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:aa(t,e.id)}})},t,r)}function ua(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 ha(t){return"string"==typeof t&&t.trim()?t.trim():null}function da(t){return t.toLowerCase()}function va(t,e,i){if(!t||!e)return null;var r=da(e),n=Object.keys(t).find(t=>da(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=>da(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var ca=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function fa(t,e,i){var r,n=va(t.translations,e,i),o=s({},t),a=!1;if(n){var l,u=null==(l=t.translations)?void 0:l[n];if(u)if(null==i||i.info("Applying survey-level translation for language: "+n),Ie(u.name)||(o.name=u.name,a=!0),o.appearance){var h=s({},o.appearance);for(var d of ca){var v=u[d];Ie(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return ca.some(e=>!Ie(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,n=va(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(r=t.translations)?void 0:r[n];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=s({},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 Ce(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?n:null,hasChanges:l}}(t,e,i)),f=c.map(t=>t.question),p=c.some(t=>t.hasChanges),g=null;return n||(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?n||g:null}}function pa(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function ga(t){var e;return pa(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var ma=(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}},ya=t=>t.toLowerCase(),_a={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=>ma(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!ma(e,t))),icontains:(t,e)=>e.map(ya).some(e=>t.map(ya).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(ya).every(e=>t.map(ya).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=_a[i.operator];return!!n&&n(i.values,[String(r)])})}function wa(t,e,i){return Bn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var ka=new Set(["is_not","not_icontains","not_regex"]);function Sa(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)||Pe(n))return ka.has(s);var o=_a[s];return!!o&&!Ie(t.value)&&!Pe(t.value)&&o(Ce(t.value)?t.value.map(String):[String(t.value)],Ce(n)?n.map(String):[String(n)])})}var xa=Tn("[SessionRecording]");function Ca(t,e){return e?t:"!"+t}function Ta(t,e){return t===e||t!=="!"+e&&null}var Ea=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=go}onRemoteConfig(t){this.At=Fe(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new oo([this.tt,this.Y]),this.Et=po):(this.Lt=new ao([this.tt,this.Y]),this.Et=go),this._instance.register_for_session({[Zt]: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&&Oe(this.Ot))return this.Ot=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){xa.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(Q),void(null==(r=this._instance.persistence)||r.unregister(H));var s=this._instance.get_property(Q),o=this._instance.get_property(H),a=Ta(s,t),l=Fe(o)&&o!==n,u=Ie(o)&&s===t,h=l||u||!De(a),d=h?sa(t,n):a;h&&(d?this.Tt("sampled"):xa.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Q]:Ca(t,d),[H]:Pe(o)&&s===t?null:n})}ensureSamplingDecision(t){Fe(this.At)&&(De(Ta(this._instance.get_property(Q),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Y),null==(e=this._instance.persistence)||e.unregister(K),null==(i=this._instance.persistence)||i.unregister(Q),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))===to}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===to).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({[Zt]:"v2_trigger_groups",[Qt]:t.triggerGroups.length}),this.Y.onConfig(t)):xa.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Vs;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if("trigger_activated"===o){var a=s.group.id,l=i.get(a);Ie(l)?Cn.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?Gs:r?Qs:Vs}({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)&&(Pe(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 xa.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(ct);s.some(e=>!e.properties||0===e.properties.length||Sa(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){xa.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=et+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(Ee(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&&De(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!De(l),g=p?sa(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(Q),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(tt+a),null==(o=this._instance.persistence)||o.unregister(et+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({[Vt]: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||Sa(i,e,this._instance.get_property(ct))}qt(t){var e=this;this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear();var i=function(t){var i=new fo(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(d){try{for(var e=t+"=",i=d.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}},Ra=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Aa=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ra],Pa="<masked>",Oa=["li_fat_id"];function Fa(t,e,i){if(!d)return{};var r,n=e?[...Ra,...i||[]]:[],s=$a(zn(d.URL,n,Pa),t);return In((r={},Mn(Oa,function(t){var e=Ia(t);r[t]=e||null}),r),s)}function $a(t,e){var i=Aa.concat(e||[]),r={};return Mn(i,function(e){var i=Hn(t,e);r[e]=i||null}),r}function Da(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(!Pe(e)){r.$search_engine=e;var n=d?Hn(d.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function La(){return navigator.language||navigator.userLanguage}var Na="$direct";function qa(){return(null==d?void 0:d.referrer)||Na}function Ba(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...Ra,...e||[]]:[],s=null==(r=i?lr(null==v?void 0:v.href):null==v?void 0:v.href)?void 0:r.substring(0,1e3);return{r:qa().substring(0,1e3),u:s?zn(s,n,Pa):void 0}}function ja(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?lr(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==Na?Na: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,$a(s))}return r&&In(o,Da(r)),o}function Ua(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Ha(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var za=1e5,Wa=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Va=[],Ga=()=>!1,Za="@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(" "),Qa="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(" "),Ka="Accommodation AdministrativeArea Country Place State".split(" "),Ya={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:Qa,publisher:Ja},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Va},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:Ka,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Va}},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(" "),Ya.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Ya.Event],[Ja,Ya.Organization],[Ka,Ya.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Ya.Product]];function tl(t,e){return Se.call(t,e)?t[e]:void 0}function el(t){var e=typeof t;return Pe(t)||"string"===e||"number"===e||"boolean"===e}function il(t){return el(t)||Ce(t)&&t.every(el)?t:void 0}function rl(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 nl(t){if(Se.call(Ya,t))return Ya[t];for(var e of Xa){var i=e[1];if(e[0].includes(t))return i}}function sl(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function ol(t,e,i,r){if(Ce(t)){var n=t.map(t=>ol(t,e,i,r)).filter(t=>!Ie(t));return n.length?n:void 0}return al(t,e,i,r)||void 0}function al(t,e,i,r){if(!Ee(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=tl(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:Ce(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&Wa.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!nl(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of Za){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?rl(tl(t,l),e):il(tl(t,l));Ie(u)||sl(a,l,u)}for(var h of o){var d=nl(h);for(var v of Object.keys(d)){var c=tl(t,v),f=d[v];if(!0===f){var p=il(c);Ie(p)||sl(a,v,p)}else{var g=ol(c,e,i,f);Ie(g)||sl(a,v,g)}}}var m=ol(tl(t,"@graph"),e,i);return Ie(m)||sl(a,"@graph",m),Object.keys(a).length?a:null}function ll(t,e,i){if(!Ee(t))return null;var r=tl(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var n=al(t,e,i);return n?s({"@context":"https://schema.org"},n):null}function ul(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function hl(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 dl(t,e,i){for(var r=t;r;){if(hl(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 vl(t){return ul(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(ul)}function cl(t){return Ie(t)?void 0:Math.round(t)}function fl(t){return Ee(t)?t.network_timing:t}var pl,gl,ml=Tn("[SessionRecording]"),yl=[1,2,3,4,5,6,7,12],_l=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function bl(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function wl(){var t;return null==(t=bl())?void 0:t.record}function kl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,mo())}}function Sl(t){return ea(Xo(ta(kl(t))),!0)}function xl(t){return Cl.apply(this,arguments)}function Cl(){return(Cl=a(function*(t){var e=yield tn(kl(t),ra.DEBUG,{rethrow:!0});return ea(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var Tl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,El=!1;function Ml(t){return Ce(t)&&0===t.length?pl=null!=pl?pl:Sl([]):Sl(t)}function Il(t){return Rl.apply(this,arguments)}function Rl(){return(Rl=a(function*(t){return Ce(t)&&0===t.length?pl||(gl=null!=gl?gl:xl([]).then(t=>(pl=t,t)).catch(t=>{throw pl=void 0,gl=void 0,t})):xl(t)})).apply(this,arguments)}function Al(t){return Tl&&!El&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Pl(t){return{event:t,size:_o(t)}}function Ol(t,e){return s({},t,{data:e,cv:"2024-10"})}function Fl(t,e){return s({},t,{cv:"2024-10",data:s({},t.data,e)})}function $l(t){try{if(2===t.type)return Pl(Ol(t,Sl(t.data)));if(3===t.type&&0===t.data.source)return Pl(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 Pl(Fl(t,{adds:t.data.adds?Sl(t.data.adds):void 0,removes:t.data.removes?Sl(t.data.removes):void 0}))}catch(t){ml.error("could not compress event - will use uncompressed event",t)}return{event:t,size:yo(t)}}function Dl(){return Dl=a(function*(t){try{if(2===t.type)return Pl(Ol(t,yield xl(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 Pl(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?xl(t.data.adds):void 0,t.data.removes?xl(t.data.removes):void 0]);return Pl(Fl(t,{adds:i[0],removes:i[1]}))}}catch(e){return Kr(e)&&(El=!0),ml.error("could not compress event asynchronously - trying synchronous compression",e),$l(t)}return{event:t,size:yo(t)}}),Dl.apply(this,arguments)}function Ll(t,e){return 5===t.type&&t.data.tag===e}function Nl(t){return Ll(t,"sessionIdle")}function ql(t){return Ll(t,"$session_ending")}function Bl(t){return Ll(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 Ta(this._instance.get_property(Q),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(it),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!!Pe(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!=d&&d.visibilityState&&("visible"===d.visibilityState&&(this.je=!0),this.Dt("window "+d.visibilityState,{}))},this.je=null==e||e;var i=this.Ht.checkAndGetSessionAndWindowId(),r=i.windowId;this.Bt=i.sessionId,this.Ie=r,this.et=new vo(this._instance),this.Y=new ho(this._instance),this.tt=new co(this._instance),this.Pe=this.Ue(),this.Ht.sessionTimeoutMs>this.$t||ml.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 na(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(!Oe(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,ml.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 Ze(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Tn("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:Ze(h,0,12,Tn("canvas recording fps"),4),quality:Ze(d,0,1,Tn("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=fl(this._instance.config.capture_performance),l=fl(null==r?void 0:r.capturePerformance),u=!!(De(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 n=null==(e=b.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ye&&Te(n))if(!qn.includes(v.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Te(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(n(((t,e,i)=>{var r,n={payloadSizeLimitBytes:Ls.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ls.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ls.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=Ds(n),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&&Us.some(t=>0===o.indexOf(t))))return t}})((js((r=e).requestHeaders),js(r.responseHeaders),r),t.api_host,i));var r},d=Te(t.session_recording.maskNetworkRequestFn);return d&&Te(t.session_recording.maskCapturedNetworkRequestFn)&&Cn.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:s({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Te(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 Oe(n)&&r?(Ws.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)),s({},Ls,n,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ye,o)))}else ml.info("NetworkCapture not started because we are on localhost.");return i}er(t){return this._instance.config.disable_capture_url_hashes?lr(t):t}rr(t,e){void 0===e&&(e=!1);var i=e?lr(t):this.er(t),r=this._instance.config.mask_personal_data_properties?[...Ra,...this._instance.config.custom_personal_data_properties||[]]:[];return this.ir(zn(i,r,Pa))}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}):ml.warn("could not emit queued rrweb event.",e,t),!1}}Dt(t,e){return this.nr(_l(()=>wl().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=wl();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||!l)return;var t=new URL(l.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(_l(()=>wl().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),ml.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"}),ml.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?K:Y;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=Ee(t)?t:JSON.parse(t)}catch(t){return void ml.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 ml.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(it),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 Ea(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(W,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(W)}),this.kr(G,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(G)}),this.kr(V,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(V)}),this.Vt.makeSamplingDecisions(this.sessionId),this.Sr(),this.ue||(Ln(l,"beforeunload",this.qe),Ln(l,"pagehide",this.ze),Ln(l,"offline",this.We),Ln(l,"online",this.Ve),Ln(d,"visibilitychange",this.Ze),!this.xe&&Te(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&Te(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)})}):Te(this.Ht.on)||ml.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Oe(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){ml.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.Tt(t||"recording_initialized"))}else ml.info("remote config must be stored in persistence before recording can start")}Cr(){var t,e,i,r,n,s;null==l||l.removeEventListener("beforeunload",this.qe),null==l||l.removeEventListener("pagehide",this.ze),null==l||l.removeEventListener("offline",this.We),null==l||l.removeEventListener("online",this.Ve),null==d||d.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(),ml.info("stopped"))}).catch(()=>{this._e=!1,this.Lr(),this.Cr(),ml.info("stopped")}),!0}stop(){if(this.Tr(),this.Le)this.He();else if(this.Ar())return;this.$e(),this.Ue(),this.Lr(),this.Cr(),ml.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,ml.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(),ml.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,ml.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||ml.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,ml.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=yo(t.event);if(t.compressionEnabled)try{var r=$l(t.event);e=r.event,i=r.size}catch(t){ml.error("could not process queued compression event - will use uncompressed event",t)}try{this.Ur(t,e,i)}catch(t){ml.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 o=function(){var i=a(function*(){try{if(s.processed)return;var i,r;try{var o=e?Al(t)?yield function(t){return Dl.apply(this,arguments)}(t):$l(t):{event:t,size:yo(t)};i=o.event,r=o.size}catch(e){ml.error("could not process queued compression event - will use uncompressed event",e),i=t,r=yo(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(o):o()}onRRwebEmit(t){var e,i,r,n,s,o,a,l,u;if(this._instance.sessionManager&&(this.dr(),t&&Ee(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({[it]: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&&Ee(e)&&6===e.type&&Ee(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 ql(t)?t.data.payload:null}(g),y=function(t){return Bl(t)?t.data.payload:null}(g),_=function(t){return Nl(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=_&&_.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 b=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==_?void 0:_.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==_?void 0:_.windowId)&&void 0!==o?o:this.Ie;if(!0!==this.Yt||function(t){return Nl(t)||ql(t)||Bl(t)}(g)){2===g.type&&(this.te=0),_&&(g.timestamp=_.lastActivityTimestamp+_.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&&Al(g))this.Wr(g,S,b,w);else{var x=S?$l(g):{event:g,size:yo(g)};this.Nr(g,x.event,x.size,b,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}):Vs}log(t,e){var i;void 0===e&&(e="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.It(),this.mr(),this.Tt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Q]: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==l||null==(t=l.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)&&!ql(t)&&!Bl(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({[Gt]:[]}),void(this.Yr=void 0);var e=this.Kr();if(0===e.length)return Ie(this.Yr)||this._instance.register_for_session({[Gt]:[]}),void(this.Yr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Yr&&(this.Yr=r,this._instance.register_for_session({[Gt]:e}),ml.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:ra.LIB_NAME,$lib_version:ra.LIB_VERSION,$snapshot_host:s})}catch(t){ml.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}),ml.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Dt("$recording_started",s({reason:t},e))}ei(t){var e;return 3===t.type&&-1!==yl.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:cl(null==(i=this.Or)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:cl(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:cl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:cl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:cl(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,[Kt]:!!this.Gt,[Yt]:this.le}}Sr(){var t;if(!this.Gt){this.le=!0;var e,i,r,n,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},a=this._instance.config.session_recording;for(var u of Object.entries(a||{})){var h=u[0],v=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=s({password:!0},v);else if("sampling"===h){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[h]=v}!0===(null==a?void 0:a.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=s({},o.slimDOMOptions,{script:!0})),this.Ke&&this.Ke.enabled&&(o.recordCanvas=!0,o.sampling=s({},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 Te(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(Te(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.fe||(this.fe=!0,ml.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!==(n=this.Ge.maskAllElementAttributes)&&void 0!==n&&n),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ve||(this.ve=!0,ml.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=wl();if(p){this.Rr=null!==(t=this.Rr)&&void 0!==t?t:new ia(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";ml.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(s({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,ml.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Gt)return this.ue=!0,void ml.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==a?void 0:a.captureJsonLd)&&d&&null!=l&&l.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")?Ga:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!dl(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 dl(t,e.blockClass,e.blockSelector)||dl(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e){if(void 0===e&&(e=Ga),!t||t.length>za)return null;try{var i=JSON.parse(t),r={remainingNodes:2048,exceeded:!1},n=Ce(i)?i.map(t=>ll(t,e,r)):ll(i,e,r);if(r.exceeded||Pe(n)||Ce(n)&&(!n.length||n.some(Pe)))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(Pe(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 vl(t))a(e)};for(var i of t)if("childList"===i.type)ul(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&ul(r)&&a(r)}else"attributes"===i.type&&ul(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()&&vl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(d,l.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=De(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 ml.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Dt(t,e)}},Ul=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}({}),Wl=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Vl=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Gl=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}({}),Zl=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 Ql(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:[]},Kl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Yl={};function Xl(t){if(Yl[t])return Yl[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 Kl?Kl[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 Yl[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 Ql(t,"AppleWebKit")&&!Ql(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Yl[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var tu={};function eu(t,e,i){var r,n=t+"."+String(i);if(tu[n])return tu[n].call(e);var s=Xl(t),o=null===(r=Object.getOwnPropertyDescriptor(s,i))||void 0===r?void 0:r.get;return o?(tu[n]=o,o.call(e)):e[i]}var iu={};function ru(t,e,i){var r=t+"."+String(i);if(iu[r])return iu[r].bind(e);var n=Xl(t)[i];return"function"!=typeof n?e[i]:(iu[r]=n,n.bind(e))}function nu(){return Xl("MutationObserver").constructor}function su(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 ou={childNodes:t=>eu("Node",t,"childNodes"),parentNode:t=>eu("Node",t,"parentNode"),parentElement:t=>eu("Node",t,"parentElement"),textContent:t=>eu("Node",t,"textContent"),contains:(t,e)=>ru("Node",t,"contains")(e),getRootNode:t=>ru("Node",t,"getRootNode")(),host:t=>t&&"host"in t?eu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?eu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>ru("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>ru("Element",t,"querySelectorAll")(e),mutationObserver:nu,patch:su};function au(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var lu=0;function uu(){lu+=1}function hu(){return lu}function du(t,e){return(e!==lu||t>6e4)&&!0}var vu=0,cu=0,fu=0,pu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},gu=null,mu=null,yu=[],_u=0,bu=0,wu={slowestBatchMs:0},ku={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Su(t){(vu+=1)>1||(pu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},yu=[],_u=0,mu=(t=>t&&t>0?t:null)(t),cu=au(),fu=lu)}function xu(){return 0===vu?gu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(vu-=1)>0?pu:(pu.durationMs=au()-cu,pu.deferredStylesheetCount=_u,ku.deferredCount+=_u,mu=null,du(pu.durationMs,fu)?pu:gu=pu)}function Cu(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+=Cu(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+=Cu(l,e,i+1))}}}catch(t){}}return r}function Tu(t){if(0!==vu){var e=Cu(t,null,0);pu.cssRuleCount+=e,bu>0&&(pu.nonDeferrableCssRuleCount+=e)}}function Eu(t){bu+=1;try{return t()}finally{bu-=1}}function Mu(t){vu>0&&(pu.stylesheetMs+=t)}function Iu(t){if(0===vu||null===mu)return!1;var e=pu.cssRuleCount-pu.nonDeferrableCssRuleCount;return e>=mu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Cu(e,i,0)}catch(t){return 0}}(t)>mu}function Ru(){ku.failedCount+=1}function Au(t){t>0&&(ku.abandonedCount+=t)}function Pu(t){return Pu="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},Pu(t)}function Ou(t,e,i){return(e=function(t){var e=function(t){if("object"!=Pu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Pu(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pu(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 $u(t){var e=t&&"host"in t&&"mode"in t&&ou.host(t)||null;return Boolean(e&&"shadowRoot"in e&&ou.shadowRoot(e)===t)}function Du(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Lu(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 Nu(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 qu=0;function Bu(t){var e=0===qu,i=e?au():0;qu+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Tu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Lu(Array.from(r,t=>ju(t,n)).join(""))}catch(t){return null}finally{qu-=1,e&&Mu(au()-i)}}function ju(t,e){if(Hu(t)){var i;try{i=Bu(t.styleSheet)||Nu(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return sh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return zu(t)&&t.selectorText.includes(":")&&(n=Uu(n)),e?sh(n,e):n}function Uu(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Hu(t){return"styleSheet"in t}function zu(t){return"selectorText"in t}var Wu=/^-?[A-Za-z_][\w-]*$/,Vu=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Gu(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||Nu(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=sh(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&&!Wu.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]?Wu.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Vu.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?sh(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=Uu(s)),t.parts.push(t.sheetHref?sh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Tu(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;Tu(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=au(),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?Uu(h):h}else u=Lu(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Mu(au()-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 Zu=class{constructor(){Ou(this,"idNodeMap",new Map),Ou(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=ou.shadowRoot(t);i&&this.removeNodeFromMap(i),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Qu(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Ju(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Ju(t){return t.toLowerCase()}var Ku=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 Yu(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&&Ku.has(Ju(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Xu="__rrweb_original__";function th(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ju(e):null}catch(t){return null}}var eh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ih=/^(?:[a-z+]+:)?\/\//i,rh=/^www\..*/i,nh=/^(data:)([^,]*),(.*)/i;function sh(t,e){return(t||"").replace(eh,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(ih.test(l)||rh.test(l))return"url("+u+l+u+")";if(nh.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 oh,ah,lh=new Map,uh=1,hh=new RegExp("[^a-z0-9-_:]");function dh(){return uh++}var vh=/^[^ \t\n\r\u000c]+/,ch=/^[, \t\n\r\u000c]+/,fh=new WeakMap;function ph(t,e){return e&&""!==e.trim()?gh(t,e):e}function gh(t,e){var i=fh.get(t);if(i||(i=t.createElement("a"),fh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function mh(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 yh(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=ph(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=lh.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(lh.size>=10){var u=lh.keys().next().value;void 0!==u&&lh.delete(u)}return lh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),mh(u,s)}if("image"===e)return mh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=ph(t,r);return"image"===e&&h.startsWith("data:")?mh(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(ch),e.length>i;){var s=r(vh);if(","===s.slice(-1))s=ph(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=ph(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?sh(r,gh(t)):"object"===e&&"data"===i?ph(t,r):r:ph(t,r)}function _h(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(ou.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&bh(ou.parentNode(t),e,i)}function wh(t,e,i,r){var n;if(Fu(t)){if(!ou.childNodes(n=t).length)return!1}else{if(null===ou.parentElement(t))return!1;n=ou.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 kh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Sh=new Map;function xh(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Ch(t){return null==t?"":t.toLowerCase()}var Th=!1,Eh=!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,_=e.slimDOMOptions,b=e.dataURLOptions,w=void 0===b?{}:b,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,E=e.onSerialize,M=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,A=e.onIframeListenerRegistered,P=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,F=void 0===O?5e3:O,D=e.keepIframeSrcFn,L=void 0===D?()=>!1:D,N=e.newlyAddedElement,q=void 0!==N&&N,B=e.depth,j=void 0===B?0:B,U=e.maxDepth,H=void 0===U?50:U,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(j>=H)return Eh=!0,Th||(Th=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+H+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=wh(t,o,a,void 0===z)),vu>0&&(pu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,_=e.keepIframeSrcFn,b=e.newlyAddedElement,w=void 0!==b&&b,k=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Zl.Document,childNodes:[],compatMode:t.compatMode}:{type:Zl.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Zl.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,_=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),b=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ju(t.tagName);return hh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];_h(b,C.name)||(k[C.name]=yh(i,b,Ju(C.name),C.value,t,d))}if("link"===b&&r&&!_){var T=t.sheet;if(!T){var E=function(t){return t.href}(t);E&&!(T=xh(i,E))&&E.includes(".css")&&(T=xh(i,window.location.origin+"/"+E.replace(window.location.href,"")))}var M=null;T&&(Iu(T)?vu>0&&(yu.push(t),_u+=1):M=Bu(T)),M&&(delete k.rel,delete k.href,k._cssText=M)}if("style"===b&&t.sheet&&!(t.innerText||ou.textContent(t)||"").trim().length){var I=Eu(()=>Bu(t.sheet));I&&(k._cssText=I)}if("input"===b||"textarea"===b||"select"===b){var R=t.value,A=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&R?k.value=Qu({element:t,type:th(t),tagName:b,value:R,maskInputOptions:s,maskInputFn:o}):A&&(k.checked=A)}if("option"===b&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===b&&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"===b&&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),O=i.createElement("canvas");O.width=t.width,O.height=t.height,P!==O.toDataURL(d.type,d.quality)&&(k.rr_dataURL=P)}var F,D,L=!1;if("img"===b&&v){oh||(oh=i.createElement("canvas"),ah=oh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",B=N.crossOrigin,j=(e,i)=>L?Yu({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,U=()=>{kh(N,"load",U);try{oh.width=N.naturalWidth,oh.height=N.naturalHeight,ah.drawImage(N,0,0);var t=oh.toDataURL(d.type,d.quality);k.rr_dataURL=j("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?U():N.addEventListener("load",U));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(B?k.crossOrigin=j("crossOrigin",B):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?U():N.addEventListener("load",U)}if("audio"===b||"video"===b){var H=k;H.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),H.rr_mediaCurrentTime=t.currentTime,H.rr_mediaPlaybackRate=t.playbackRate,H.rr_mediaMuted=t.muted,H.rr_mediaLoop=t.loop,H.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),_){var z,W,V,G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null===(z=i.defaultView)||void 0===z?void 0:z.getComputedStyle(t);k={class:k.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((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"),Y&&(k.rr_position=Y.position||"static",w.add("rr_position"),Y.transform&&"none"!==Y.transform&&(k.rr_transform=Y.transform,w.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(k.rr_display=Y.display,w.add("rr_display")))}if("iframe"!==b||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(var X of Object.entries(k)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(k[tt]=Yu({element:t,name:tt,value:et,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(tt)}))}L=!0;try{customElements.get(b)&&(F=!0)}catch(t){}return{type:Zl.Element,tagName:b,attributes:k,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:_,rootId:y,isCustom:F}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:_,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i=e.needsMask,r=e.maskTextFn,n=e.rootId,s=ou.parentNode(t),o=s&&s.tagName,a=ou.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=Bu(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=sh(a,gh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,ou.parentElement(t)):a.replace(/[\S]/g,"*")),{type:Zl.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:Zl.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:Zl.Comment,textContent:ou.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,keepIframeSrcFn: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===Zl.Comment)return!0;if(t.type===Zl.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&&(Ch(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ch(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ch(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Ch(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Ch(t.attributes.property).match(/^(og|twitter|fb):/)||Ch(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ch(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ch(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(Ch(t.attributes.name))||Ch(t.attributes.property).match(/^article:/)||Ch(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(Ch(t.attributes.name)))return!0}}return!1}(Z,_)||!V&&Z.type===Zl.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:dh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),-2===G)return null;E&&E(t);var J=!u;if(Q.type===Zl.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=ou.shadowRoot(t);K&&Du(K)&&(Q.isShadowHost=!0)}if((Q.type===Zl.Document||Q.type===Zl.Element)&&J){_.headWhitespace&&Q.type===Zl.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:j+1,maxDepth:H};if(Q.type===Zl.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(ou.childNodes(t))){var tt=Mh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(Fu(t)&&(et=ou.shadowRoot(t)))for(var it of Array.from(ou.childNodes(et))){var rt=Mh(it,Y);rt&&(Du(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=ou.parentNode(t);if(nt&&$u(nt)&&Du(nt)&&(Q.isShadow=!0),Q.type===Zl.Element&&"iframe"===Q.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),kh(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?kh(t,"load",o):(a=!0,kh(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),kh(t,"load",o)}}return t.addEventListener("load",o),()=>{kh(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&M){var i=Mh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:j+1,maxDepth:H});i&&M(t,i)}},R);null==A||A(t,st)}return Q.type===Zl.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!Sh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,b=()=>{if(!g){g=!0;try{(()=>{if(P){var e=Mh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:j,maxDepth:H});e&&P(t,e)}})()}finally{Sh.delete(e),v.abort()}}},k=setTimeout(b,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",b,{signal:v.signal,once:!0}),Sh.set(e,v)}}}(t,0,F),Q}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 Rh=class t{constructor(){Ou(this,"parentElement",null),Ou(this,"parentNode",null),Ou(this,"ownerDocument",void 0),Ou(this,"firstChild",null),Ou(this,"lastChild",null),Ou(this,"previousSibling",null),Ou(this,"nextSibling",null),Ou(this,"ELEMENT_NODE",1),Ou(this,"TEXT_NODE",3),Ou(this,"nodeType",void 0),Ou(this,"nodeName",void 0),Ou(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 Ah(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Ph(i,t,e,r)}function Ph(t,e,i,r){Oh(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function Oh(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.",$h={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 Dh(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 Lh(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)}}}),()=>Lh(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&($h=new Proxy($h,{get(t,e,i){return"map"===e&&console.error(Fh),Reflect.get(t,e,i)}}));var Nh=Date.now;function qh(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=ou.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=ou.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 Bh(){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 Uh(t){return t?t.nodeType===t.ELEMENT_NODE?t:ou.parentElement(t):null}function Hh(t,e,i,r){if(!t)return!1;var n=Uh(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 Wh(t,e){if($u(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=ou.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Wh(r,e))}function Vh(t){return Boolean(t.changedTouches)}function Gh(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Zh(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Qh(t){return!!t&&(t instanceof Rh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(ou.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Nh=()=>(new Date).getTime());var Jh=class{constructor(){Ou(this,"id",1),Ou(this,"styleIDMap",new WeakMap),Ou(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 Kh(t){var e,i=null;return"getRootNode"in t&&(null===(e=ou.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ou.host(ou.getRootNode(t))&&(i=ou.host(ou.getRootNode(t))),i}function Yh(t){var e=t.ownerDocument;return!!e&&(ou.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Kh(i);)i=e;return i}(t);return ou.contains(e,i)}(t))}function Xh(t){return"__ln"in t}var td,ed=class{constructor(){Ou(this,"length",0),Ou(this,"head",null),Ou(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--)}},id=(t,e)=>t+"@"+e,rd=class{constructor(){Ou(this,"frozen",!1),Ou(this,"locked",!1),Ou(this,"texts",[]),Ou(this,"attributes",[]),Ou(this,"attributeMap",new WeakMap),Ou(this,"generatedAttributes",new WeakMap),Ou(this,"removes",[]),Ou(this,"mapRemoves",[]),Ou(this,"movedMap",{}),Ou(this,"addedSet",new Set),Ou(this,"movedSet",new Set),Ou(this,"droppedSet",new Set),Ou(this,"removesSubTreeCache",new Set),Ou(this,"mutationCb",void 0),Ou(this,"blockClass",void 0),Ou(this,"blockSelector",void 0),Ou(this,"maskTextClass",void 0),Ou(this,"maskTextSelector",void 0),Ou(this,"inlineStylesheet",void 0),Ou(this,"maskInputOptions",void 0),Ou(this,"maskTextFn",void 0),Ou(this,"maskInputFn",void 0),Ou(this,"maskAllElementAttributes",void 0),Ou(this,"maskAttributeFn",void 0),Ou(this,"keepIframeSrcFn",void 0),Ou(this,"recordCanvas",void 0),Ou(this,"canvasMaskingConfigured",void 0),Ou(this,"inlineImages",void 0),Ou(this,"slimDOMOptions",void 0),Ou(this,"dataURLOptions",void 0),Ou(this,"doc",void 0),Ou(this,"mirror",void 0),Ou(this,"iframeManager",void 0),Ou(this,"stylesheetManager",void 0),Ou(this,"shadowDomManager",void 0),Ou(this,"canvasManager",void 0),Ou(this,"processedNodeManager",void 0),Ou(this,"unattachedDoc",void 0),Ou(this,"canvasManagerReleased",!1),Ou(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Ou(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=au(),r=hu();try{this.processBufferedMutations()}finally{t=au()-i,e=r,vu>0||du(t,null!=e?e:lu)||t>wu.slowestBatchMs&&(wu.slowestBatchMs=t)}}}),Ou(this,"processBufferedMutations",()=>{for(var t=[],e=new Set,i=new ed,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=ou.parentNode(n);if(s&&Yh(n)&&"TEXTAREA"!==s.tagName&&!this.isBlockedAtEmission(s)){var o=$u(s)?this.mirror.getId(Kh(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=>{Gh(t,this.mirror)&&this.iframeManager.addIframe(t),Zh(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Qh(t)&&!Hh(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(ou.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)sd(this.removesSubTreeCache,s)&&!this.movedSet.has(ou.parentNode(s))||n(s);for(var o of this.addedSet)od(this.droppedSet,o)||sd(this.removesSubTreeCache,o)?od(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(ou.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(ou.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=ou.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=ou.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=ou.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]=Yu({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)}),Ou(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Ou(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(ou.childNodes(t),t=>ou.textContent(t)||"").join("");e.attributes.value=Qu({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:th(t),value:i,maskInputFn:this.maskInputFn})}),Ou(this,"processMutation",t=>{if(!zh(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=ou.textContent(t.target);Hh(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:wh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Uh(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=th(l);a=Qu({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"),!_h(r.tagName,o)){var v,c=yh(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 _ of Array.from(f.style))""===p.getPropertyValue(_)&&(h.styleDiff[_]=!1)}else if("open"===o&&"DIALOG"===r.tagName){h.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(t.target);b||this.generatedAttributes.set(t.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(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=$u(t.target)?this.mirror.getId(ou.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)?(nd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Wh(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[id(i,r)]?nd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!$u(t.target)||!Du(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),ou.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))})}}),Ou(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[id(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Hh(t,this.blockClass,this.blockSelector,!1)||(ou.childNodes(t).forEach(t=>this.genAdds(t)),Qh(t)&&ou.childNodes(ou.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?ou.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?ou.host(r):null}return!1}};function nd(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),ou.childNodes(r).forEach(t=>i.push(t))}}function sd(t,e,i){return 0!==t.size&&function(t,e){var i=ou.parentNode(e);return!!i&&t.has(i)}(t,e)}function od(t,e){if(0===t.size)return!1;for(var i=ou.parentNode(e);i;){if(t.has(i))return!0;i=ou.parentNode(i)}return!1}var ad=function(t,e){return void 0===e&&(e="rrweb"),td?function(){try{return t(...arguments)}catch(t){if(td&&!0===td(t,e))return;throw t}}:t},ld=[];function ud(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 hd(t,e){var i,r=new rd;r.init(t);try{i=new(nu())(ad(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),ld.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function dd(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=ud(t);if(o&&!Hh(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=qh(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=[Ah("scroll",ad(Dh(ad(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(Ah("scrollend",ad(l),i)),()=>u.forEach(t=>t())}function vd(t,e){for(var i=ld.length-1;i>=0;i--){var r=ld[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),ld.splice(i,1))}}}var cd=["INPUT","TEXTAREA","SELECT"],fd=new WeakMap;function pd(t){return function t(e,i){if(_d("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||_d("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||_d("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||_d("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 gd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function md(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:ou.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}}),ad(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function yd(t,e){void 0===e&&(e={});var i,r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var o=[],a=ad(()=>{if(r){r.destroy(),r.reset();var e=ld.indexOf(r);-1!==e&&ld.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),o.forEach(t=>t())});try{if(t.recordDOM){var l=hd(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=Dh(ad(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=ad(Dh(ad(t=>{var e=ud(t),i=Vh(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=Nh()),l.push({x:r,y:o,id:n.getId(e),timeOffset:Nh()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Hl.Drag:t instanceof MouseEvent?Hl.MouseMove:Hl.TouchMove)}),o,{trailing:!1})),d=[Ah("mousemove",h,r),Ah("touchmove",h,r),Ah("drag",h,r)];return ad(()=>{d.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=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=ud(i);if(!Hh(a,n,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Wl.Mouse;break;case"touch":l=Wl.Touch;break;case"pen":l=Wl.Pen}l===Wl.Touch&&(zl[t]===zl.MouseDown?u="TouchStart":zl[t]===zl.MouseUp&&(u="TouchEnd"))}else Vh(i)&&(l=Wl.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Wl.Touch||u.startsWith("Mouse")&&l===Wl.Mouse)&&(l=null)):zl[t]===zl.Click&&(l=h,h=null);var d=Vh(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;ad(e)(s({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(Ah(a,l,i))}),ad(()=>{u.forEach(t=>t())})}(t)),o.push(dd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Ah("resize",ad(Dh(ad(()=>{var t=Bh(),e=jh();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),r)}(t,{win:n})),o.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=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=ud(t),r=t.isTrusted,s=i.defaultView;if(!e||!s||e instanceof s.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=ou.parentElement(e)),e&&v&&cd.indexOf(v)>=0&&!Hh(e,n,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=th(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Qu({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 n=fd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){fd.set(t,i);var o=r.getId(t);ad(e)(s({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>Ah(t,ad(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=>Lh(t[0],t[1],{set(){ad(v)({target:this,isTrusted:!1})}},!1,p))),ad(()=>{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=ad(t=>Dh(ad(s=>{var o=ud(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=[Ah("play",a(Gl.Play),o),Ah("pause",a(Gl.Pause),o),Ah("seeked",a(Gl.Seeked),o),Ah("volumechange",a(Gl.VolumeChange),o),Ah("ratechange",a(Gl.RateChange),o)];return ad(()=>{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()}}}(n);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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=gd(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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=gd(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:ad((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=gd(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=Bu(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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=gd(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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=gd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...pd(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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=gd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...pd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),ad(()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach(t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule})})}(t,{win:n,mutationQueue:u})),o.push(md(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:ad((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=gd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=pd(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:ad((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=gd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=pd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),ad(()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u})}(t,{win:n,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=su(i.fonts,"add",function(t){return function(i){return setTimeout(ad(()=>{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),ad(()=>{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=ad(()=>{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(),Ah("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?su(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,n,h.options))}catch(t){try{a()}catch(t){}throw t}return a}function _d(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 wd=class{constructor(t){Ou(this,"generateIdFn",void 0),Ou(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Ou(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}},kd=class{constructor(t){Ou(this,"iframes",new WeakMap),Ou(this,"crossOriginIframeMap",new WeakMap),Ou(this,"crossOriginIframeMirror",new wd(dh)),Ou(this,"crossOriginIframeStyleMirror",void 0),Ou(this,"crossOriginIframeRootIdMap",new WeakMap),Ou(this,"mirror",void 0),Ou(this,"mutationCb",void 0),Ou(this,"wrappedEmit",void 0),Ou(this,"loadListener",void 0),Ou(this,"pageHideListener",void 0),Ou(this,"stylesheetManager",void 0),Ou(this,"recordCrossOriginIframes",void 0),Ou(this,"messageHandler",void 0),Ou(this,"nestedIframeListeners",new Map),Ou(this,"attachedWindows",new WeakMap),Ou(this,"attachedDocuments",new WeakMap),Ou(this,"attachedIframes",new Map),Ou(this,"loadListenerDisposers",new WeakMap),Ou(this,"iframeElementsById",new Map),Ou(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wd(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=>Oh(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{Ph(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);Oh(()=>{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)})}Oh(()=>{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 Ul.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:Ul.IncrementalSnapshot,data:{source:Hl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ul.Meta:case Ul.Load:case Ul.DomContentLoaded:return!1;case Ul.Plugin:return e;case Ul.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Ul.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===Zl.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&&(Ph(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Ph(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=>{Oh(()=>this.mirror.removeNodeFromMap(t))}),Oh(()=>vd(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&&Ph(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Ph(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}},Sd=class{constructor(t){Ou(this,"shadowDoms",new WeakSet),Ou(this,"mutationCb",void 0),Ou(this,"scrollCb",void 0),Ou(this,"bypassOptions",void 0),Ou(this,"mirror",void 0),Ou(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(Du(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null===(r=ou.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=hd(s({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=ld.indexOf(l);-1!==t&&ld.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:dd(s({},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(ou.host(t))),this.restoreHandlers.push({doc:n,handler:md({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:su(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=ou.shadowRoot(this);return s&&Yh(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}},xd="skip-frame";function Cd(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 Td="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ed="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Md=0;64>Md;Md++)Ed[Td.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+=Td[i[e]>>2],n+=Td[(3&i[e])<<4|i[e+1]>>4],n+=Td[(15&i[e+1])<<2|i[e+2]>>6],n+=Td[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},Rd=new Map,Ad=(t,e,i)=>{if(t&&(Fd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Rd.get(t);return i||Rd.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 Pd(t,e,i,r){return t instanceof Array?t.map(t=>Pd(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:[Pd(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:[Pd(t.data,e,i,r),t.width,t.height]}:Fd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ad(t,e,i)}:t}var Od=(t,e,i,r)=>t.map(t=>Pd(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]))},$d=["webgl","webgl2"];function Dd(t){return"nodeType"in t}function Ld(t,e,i,r){var n=[];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 su(r.prototype,"configure",function(r){return function(n){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||Dd(o)&&Hh(o,e,i,!0))return r.call(this,n);Dd(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&&n?s({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}})}(t,e,i);o&&n.push(o)}var a=su(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&&$d.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}});n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(t=>t())}}function Nd(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=su(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(Ad(d,s,this),this.canvas&&"tagName"in this.canvas&&!Hh(this.canvas,r,n,!0)){var v={type:e,property:l,args:Od(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=Lh(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 qd='(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',Bd="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",qd],{type:"text/javascript;charset=utf-8"});function jd(t){var e;try{if(!(e=Bd&&(self.URL||self.webkitURL).createObjectURL(Bd)))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(qd),{name:null==t?void 0:t.name})}}var Ud,Hd,zd,Wd=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){Ou(this,"pendingCanvasMutations",new Map),Ou(this,"rafStamps",{latestId:0,invokeId:null}),Ou(this,"mirror",void 0),Ou(this,"mutationCb",void 0),Ou(this,"resetObservers",void 0),Ou(this,"frozen",!1),Ou(this,"locked",!1),Ou(this,"rafIdTimestamp",null),Ou(this,"rafIdFlush",null),Ou(this,"refCount",0),Ou(this,"torndown",!1),Ou(this,"resetFrameDedup",null),Ou(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 o,l="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=Ld(e,i,r,!0),h=new Map;try{o=new jd}catch(t){return}var d=!1;o.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.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:Vl["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=a(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,a=t.getContext(t.__context);if(null==a||null===(i=a.isContextLost)||void 0===i?void 0:i.call(a))return void h.set(e,!1);!1===(null==a||null===(r=a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.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 xd}if(void 0!==o){if(!Array.isArray(o)||!o.every(Cd))return xd;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});o.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=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ld(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=su(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=Od(l,e,this,n);t(this.canvas,{type:Vl["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=Lh(e.CanvasRenderingContext2D.prototype,o,{set(e){Hh(this.canvas,i,r,!0)||t(this.canvas,{type:Vl["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(...Nd(e.WebGLRenderingContext.prototype,Vl.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Nd(e.WebGL2RenderingContext.prototype,Vl.WebGL2,t,i,r,e,n)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,i){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==i){var s=r.map(t=>n(t,e));this.mutationCb({id:i,type:r[0].type,commands:s}),this.pendingCanvasMutations.delete(t)}}}},Vd=class{constructor(t){var e;Ou(this,"trackedLinkElements",new WeakSet),Ou(this,"pendingDeferredSheets",new Set),Ou(this,"mutationCb",void 0),Ou(this,"adoptedStyleSheetCb",void 0),Ou(this,"maskAllElementAttributes",void 0),Ou(this,"maskAttributeFn",void 0),Ou(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=Gu(r))}catch(t){}if(!i||!r)return Ru(),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=au(),d=hu(),v=!0;try{if(s)return a=!0,Ru(),!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?(Ru(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Ru(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),du(l=au()-h,null!=(u=d)?u:lu)||(ku.totalMs+=l,l>ku.slowestSliceMs&&(ku.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:Yu({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=au();try{Eu(()=>{try{var e=t.rules||t.cssRules;e&&Tu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:ju(e,t.href),index:i}))})})}finally{Mu(au()-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(),Sh.forEach(t=>t.abort()),Sh.clear()}trackStylesheetInLinkElement(t){}},Gd=class{constructor(){Ou(this,"nodeMap",new WeakMap),Ou(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(){}},Zd=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Qd,Jd=document.createElement("iframe");document.body.appendChild(Jd),Array.from=(null===(Qd=Jd.contentWindow)||void 0===Qd?void 0:Qd.Array.from)||Array.from,document.body.removeChild(Jd)}}catch(t){console.debug("Unable to override Array.from",t)}var Kd=new Zu,Yd=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 tv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=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,_=i.inlineStylesheet,b=void 0===_||_,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,E=i.maskAllElementAttributes,M=void 0!==E&&E,I=i.maskAttributeFn,R=i.hooks,A=i.packFn,P=i.sampling,O=void 0===P?{}:P,F=i.dataURLOptions,D=void 0===F?{}:F,L=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,B=i.recordDOM,j=void 0===B||B,U=i.recordCanvas,H=void 0!==U&&U,z=i.recordCrossOriginIframes,W=void 0!==z&&z,V=i.recordAfter,G=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=i.userTriggeredOnInput,Q=void 0!==Z&&Z,J=i.collectFonts,K=void 0!==J&&J,Y=i.inlineImages,X=void 0!==Y&&Y,tt=i.plugins,et=i.keepIframeSrcFn,it=void 0===et?()=>!1:et,rt=i.ignoreCSSAttributes,nt=void 0===rt?new Set([]):rt,st=i.attributeFilter;td=i.errorHandler;var ot=s({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===O.mousemove&&(O.mousemove=q),Kd.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};Ud=(t,e)=>{var i,s=t;if(s.timestamp=Nh(),!(null===(i=ld[0])||void 0===i?void 0:i.isFrozen())||s.type===Ul.FullSnapshot||s.type===Ul.IncrementalSnapshot&&Yd.has(s.data.source)||ld.forEach(t=>t.unfreeze()),at)null==r||r(gt(s),e);else if(lt){var a={type:"rrweb",event:gt(s),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(s.type===Ul.FullSnapshot)ut=s,ft=0;else if(s.type===Ul.IncrementalSnapshot){if(s.data.source===Hl.Mutation&&s.data.isAttachIframe)return;ft++,(o&&ft>=o||n&&s.timestamp-ut.timestamp>n)&&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 n=Kd.getNode(r.node.id);n&&"IFRAME"===n.nodeName&&i.add(n)}t.removes.forEach(t=>{var r=t.id;if(!e||!e.has(r)){var n=wt.getIframeElementById(r);n&&i.has(n)?wt.forgetIframeId(r):(null==vt||vt(r),wt.removeIframeById(r))}}),null==ct||ct(),wt.cleanupDetachedIframes()}Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Mutation},t)})},yt=t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Scroll},t)}),_t=t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.CanvasMutation},t)}),bt=new Vd({mutationCb:mt,adoptedStyleSheetCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.AdoptedStyleSheet},t)}),maskAllElementAttributes:M,maskAttributeFn:I}),wt=new kd({mirror:Kd,mutationCb:mt,stylesheetManager:bt,recordCrossOriginIframes:W,wrappedEmit:Ud});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Kd,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Gd,xt=null==N?void 0:N.configured;zd=new Wd({recordCanvas:H,mutationCb:_t,win:window,blockClass:l,blockSelector:h,mirror:Kd,sampling:O.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new Sd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,sampling:O,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:bt,canvasManager:zd,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Kd});Hd=function(t){if(void 0===t&&(t=!1),j){Su(w);try{Ud({type:Ul.Meta,data:{href:window.location.href,width:jh(),height:Bh()}},t),null==e||e.cancel(),e=void 0,bt.reset(),Ct.init(),ld.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Zu:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,_=i.canvasMaskingConfigured,b=i.maskAllInputs,w=void 0!==b&&b,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,E=i.slimDOM,M=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,A=i.onIframeLoad,P=i.iframeLoadTimeout,O=i.onIframeListenerRegistered,F=i.onStylesheetLoad,D=i.stylesheetLoadTimeout,L=i.keepIframeSrcFn,N=void 0===L?()=>!1:L,q=i.maxDepth,B=i.inlineStylesheetBudgetRules,j=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,U=Ih(void 0!==E&&E);Su(B);try{return Mh(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:j,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:U,dataURLOptions:M,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:_,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:P,onIframeListenerRegistered:O,onStylesheetLoad:F,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{xu()}}(document,{mirror:Kd,blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,slimDOM:dt,dataURLOptions:ot,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){Gh(t,Kd)&&wt.addIframe(t),Zh(t,Kd)&&bt.trackLinkElement(t),Qh(t)&&Ct.addShadowRoot(ou.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){bt.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=yu,yu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(Ud({type:Ul.FullSnapshot,data:{node:r,initialOffset:qh(window)}},t),ld.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&&Oh(()=>{o=e.beginDeferredLinkInlining(i,Kd.getId(i))})},u=()=>{if(o){var t=o,e=!0;Oh(()=>{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,Au(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);Au(v),null==o||o.discard(),o=null}i()}}}}(i,bt,()=>{e===n&&(e=void 0)});e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,Kd.getId(document))}finally{xu()}var s}};try{var Tt=[];for(var Et of(Tt.push(Ah("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(Ah(Et,uu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{Oh(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=Kd.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var Mt=t=>{var e;return ad(yd)({mutationCb:mt,mousemoveCb:(t,e)=>Ud({type:Ul.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.ViewportResize},t)}),inputCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Input},t)}),mediaInteractionCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.MediaInteraction},t)}),styleSheetRuleCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.StyleSheetRule},t)}),styleDeclarationCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.StyleDeclaration},t)}),canvasMutationCb:_t,fontCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Font},t)}),selectionCb(t){Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Selection},t)})},customElementCb(t){Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.CustomElement},t)})},blockClass:l,ignoreClass:v,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:b,sampling:O,recordDOM:j,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:M,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:h,slimDOMOptions:dt,dataURLOptions:ot,mirror:Kd,iframeManager:wt,stylesheetManager:bt,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=>Ud({type:Ul.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Kd.getId(t),i=Mt(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}}),wt.addPageHideListener(t=>{var e=Kd.getId(t);null==vt||vt(e),vd(t)});var It=-1,Rt=t=>Ud({type:Ul.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?Kd.getId(s):-1;o!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{Hd();var t=Mt(document);"function"==typeof t&&Tt.push(t),Tt.push(Ah("fullscreenchange",At)),Tt.push(Ah("webkitfullscreenchange",At)),Tt.push(Ah("mozfullscreenchange",At)),Tt.push(Ah("MSFullscreenChange",At)),Zd=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(Ah("DOMContentLoaded",()=>{Ud({type:Ul.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(Ah("load",()=>{Ud({type:Ul.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach(t=>Oh(t)),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Kd.reset(),Zd=!1,td=void 0}}catch(t){console.warn(t)}}function ev(t){return ev="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},ev(t)}function iv(t,e,i){return(e=function(t){var e=function(t){if("object"!=ev(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=ev(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ev(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}tv.addCustomEvent=(t,e)=>{if(!Zd)throw new Error("please add custom event after start recording");Ud({type:Ul.Custom,data:{tag:t,payload:e}})},tv.freezePage=()=>{ld.forEach(t=>t.freeze())},tv.takeFullSnapshot=t=>{if(!Zd)throw new Error("please take full snapshot after start recording");Hd(t)},tv.mirror=Kd,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var rv=class{constructor(t){iv(this,"fileName",void 0),iv(this,"functionName",void 0),iv(this,"lineNumber",void 0),iv(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}},nv=/(^|@)\S+:\d+/,sv=/^\s*at .*(\S+:\d+|\(native\))/m,ov=/^(eval@)?(\[native code])?$/,av={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(sv)?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(sv)},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 rv({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(ov)},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 rv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new rv({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 rv({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 rv({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(nv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new rv({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function lv(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 uv(t){return Array.isArray(t)}function hv(t){return"object"==typeof t&&null!==t&&!uv(t)}function dv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(hv(t[i])&&dv(t[i],e-1))return!0;return!1}function vv(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(hv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||hv(o)&&dv(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]=uv(u)?lv(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 cv={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 fv(t,e,i){var r,n=i?Object.assign({},cv,i):cv,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:av.parse(e.error).map(t=>t.toString()),payload:[vv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[vv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[vv("Uncaught (in promise)",n.stringifyOptions),vv(e.reason,n.stringifyOptions)]),t({level:"error",trace:av.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=av.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>vv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[vv("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 pv=t=>({name:"rrweb/console@1",observer:fv,options:t}),gv=()=>{},mv=t=>{var e;if(Te(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function yv(t,e,i){try{if(!(e in t))return gv;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 Te(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=mv(i);s;){if(s.next===n)return void(s.next=r.next);s=mv(i=s.next)}else t[e]=r.next}}catch(t){return gv}}function _v(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var bv=Tn("[Recorder]"),wv=t=>"navigation"===t.entryType,kv=t=>"resource"===t.entryType;function Sv(t,e){return!!e&&(De(e)||e[t])}function xv(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 Cv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Tv(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:!!xv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Cv))return!1;if(De(i))return!0;if(Ce(i))return n(i);var s=i[e];return De(s)?s:n(s)}function Ev(t,e,i,r,n,s){return Mv.apply(this,arguments)}function Mv(){return Mv=a(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=>kv(t)&&t.initiatorType===e&&(Ie(r)||t.startTime>=r)&&(Ie(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),Ev(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(Oe(e))return null;var n=_v(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Re(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(Le(e))return Un(e);if(Ee(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 Rv=t=>!Pe(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Av(t){var e=t.entry,i=t.method,r=t.status,n=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=[s({},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:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:o})];if(Rv(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 Pv=["video/","audio/"];function Ov(t){return Ee(t)&&Te(t.getReader)&&Te(t.tee)}var Fv="[SessionReplay] Timeout while trying to read body",$v="[SessionReplay] Failed to read body";function Dv(t){return $v+": "+t}function Lv(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Nv(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(Dv(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e($v)}})}(t);var i=Ds(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(Lv(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($v)}var u=a.body;if(Ov(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o($v)}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(Lv(e));d+=a.byteLength,h.push(a)}t()}},t=>o(Dv(t)))}()}else try{a.text().then(t=>o(t),t=>o(Dv(t)))}catch(t){o($v)}})}(t,i)}function qv(){return qv=a(function*(t){var e=t.r,i=t.options,r=_v(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):Nv(e,i)}),qv.apply(this,arguments)}function Bv(){return Bv=a(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=Pv.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=_v(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Pe(r)?Nv(e,i):Promise.resolve(r)}),Bv.apply(this,arguments)}var jv=null;function Uv(t,e,i){if(!("performance"in e))return()=>{};if(jv)return bv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},Ls,i):Ls,n=e=>{var i=[],n=!1;e.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=r.maskRequestFn(t);e||(n=!s||(t=>!!t&&Ws.has(t))(s)),s&&i.push(s)}}),i.length>0&&t(s({},e,{requests:i}))},o=function(t,e,i){i.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>wv(t)||kv(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>Av({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=>wv(t)||kv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Av({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()}}(n,e,r),l=()=>{},u=()=>{};return(r.recordHeaders||r.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Sv("request",i.recordHeaders),n=Sv("response",i.recordHeaders),s=yv(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=>(Tv({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 _=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",_),d.removeEventListener("abort",_),d.removeEventListener("timeout",_)},b=()=>{if(d.readyState===d.DONE){_(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)}),n&&(p.responseHeaders=r),Tv({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=Iv({body:d.response,options:i,url:a})),Ev(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:Av({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",b),d.addEventListener("error",_),d.addEventListener("abort",_),d.addEventListener("timeout",_)}catch(t){bv.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)});return()=>{s()}}(n,e,r),u=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Sv("request",i.recordHeaders),n=Sv("response",i.recordHeaders),s=yv(e,"fetch",s=>function(){var o=a(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),!Ov(null==a?void 0:a.body)&&Tv({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return qv.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=xv(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),Tv({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return Bv.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{Ev(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:Av({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 o.apply(this,arguments)}}());return()=>{s()}}(n,e,r)),jv=()=>{o(),l(),u(),jv=null}}var Hv,zv,Wv,Vv,Gv,Zv,Qv,Jv,Kv,Yv,Xv,tc,ec,ic,rc,nc=t=>({name:"rrweb/network@1",observer:Uv,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:pv,getRecordNetworkPlugin:nc},b.__PosthogExtensions__.rrweb={record:tv,version:"v2",wasMaxDepthReached:()=>Eh,resetMaxDepthState(){Eh=!1,Th=!1},getLastSnapshotCost:()=>gu,getMutationCost:()=>s({},wu),resetSnapshotCostState(){vu=0,cu=0,fu=0,lu=0,pu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},gu=null,mu=null,yu=[],_u=0,bu=0,wu={slowestBatchMs:0},ku={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:tv,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:pv},b.getRecordNetworkPlugin=nc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new jl(t,e);var sc,oc,ac,lc,uc={},hc=[],dc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vc=Array.isArray;function cc(t,e){for(var i in e)t[i]=e[i];return t}function fc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function pc(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 gc(t,o,r,n,null)}function gc(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?++Wv:n,__i:-1,__u:0};return null==n&&null!=zv.vnode&&zv.vnode(s),s}function mc(t){return t.children}function yc(t,e){this.props=t,this.context=e}function _c(t,e){if(null==e)return t.__?_c(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?_c(t):null}function bc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=cc({},e);s.__v=e.__v+1,zv.vnode&&zv.vnode(s),Rc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?_c(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Pc(r,s,n),e.__e=e.__=null,s.__e!=i&&wc(s)}}function wc(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}),wc(t)}function kc(t){(!t.__d&&(t.__d=!0)&&Vv.push(t)&&!Sc.__r++||Gv!=zv.debounceRendering)&&((Gv=zv.debounceRendering)||Zv)(Sc)}function Sc(){try{for(var t,e=1;Vv.length;)Vv.length>e&&Vv.sort(Qv),t=Vv.shift(),e=Vv.length,bc(t)}finally{Vv.length=Sc.__r=0}}function xc(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||hc,_=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]=gc(null,o,null,null,null):vc(o)?o=t.__k[s]=gc(mc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=gc(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=Tc(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=_c(a)),$c(a,a));return r}(i,e,y,l,_),d=0;_>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||uc,c.__i=d,g=Rc(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=Cc(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 Cc(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=Cc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=_c(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Tc(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 Ec(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||dc.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||Ec(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Ec(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[Yv]=r[Yv]:(i[Yv]=tc,t.addEventListener(e,s?ic:ec,s)):t.removeEventListener(e,s?ic:ec,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[Kv])e[Kv]=tc++;else if(i[Yv]>e[Kv])return;return i(zv.event?zv.event(e):e)}}}function Rc(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,_=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],b=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(_?e.__c=v=new C(y,b):(e.__c=v=new yc(y,b),v.constructor=C,v.render=Dc),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),_&&null==v.__s&&(v.__s=v.state),_&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=cc({},v.__s)),cc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)_&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),_&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(_&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,b),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,b)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(t){t&&(t.__=e)}),hc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,b),_&&null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(f,p,g)})}if(v.context=b,v.props=y,v.__P=t,v.__e=!1,w=zv.__r,k=0,_)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),hc.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=cc(cc({},r),v.getChildContext())),_&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===mc&&null==h.key?Oc(h.props.children):h,a=xc(t,vc(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--;)fc(s[x]);Ac(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Ac(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||uc,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=""),xc("template"==e.type?t.content:t,vc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&_c(i,0),a,l),null!=s)for(u=s.length;u--;)fc(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 Ac(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Ac))}function Pc(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 Oc(t){return"object"!=typeof t||null==t||t.__b>0?t:vc(t)?t.map(Oc):void 0!==t.constructor?null:cc({},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 $c(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]&&$c(r[n],e,i||"function"!=typeof t.type);i||fc(t.__e),t.__c=t.__=t.__e=void 0}function Dc(t,e,i){return this.constructor(t,i)}function Lc(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=[],Rc(e,t=(!r&&i||e).__k=pc(mc,null,[t]),n||uc,uc,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),Pc(s,t,o),t.props.children=null}Hv=hc.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}},Wv=0,yc.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=cc({},this.state);"function"==typeof t&&(t=t(cc({},i),this.props)),t&&cc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),kc(this))},yc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),kc(this))},yc.prototype.render=mc,Vv=[],Zv="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qv=function(t,e){return t.__v.__b-e.__v.__b},Sc.__r=0,Jv=Math.random().toString(8),Kv="__d"+Jv,Yv="__a"+Jv,Xv=/(PointerCapture)$|Capture$/i,tc=0,ec=Ic(!1),ic=Ic(!0),rc=0;var Nc=0,qc=[],Bc=zv,jc=Bc.__b,Uc=Bc.__r,Hc=Bc.diffed,zc=Bc.__c,Wc=Bc.unmount,Vc=Bc.__;function Gc(t,e){Bc.__h&&Bc.__h(oc,t,Nc||e),Nc=0;var i=oc.__H||(oc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Zc(t){return Nc=1,function(t,e){var i=Gc(sc++,2);if(i.t=t,!i.__c&&(i.__=[of(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=oc,!oc.__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};oc.__f=!0;var n=oc.shouldComponentUpdate,s=oc.componentWillUpdate;oc.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)},oc.shouldComponentUpdate=r}return i.__N||i.__}(of,t)}function Qc(t,e){var i=Gc(sc++,3);!Bc.__s&&sf(i.__H,e)&&(i.__=t,i.u=e,oc.__H.__h.push(i))}function Jc(t){return Nc=5,Kc(function(){return{current:t}},[])}function Kc(t,e){var i=Gc(sc++,7);return sf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Yc(t){var e,i=oc.context[t.__c],r=Gc(sc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(oc)),i.props.value):t.__}function Xc(){for(var t;t=qc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(rf),e.__h.some(nf),e.__h=[]}catch(i){e.__h=[],Bc.__e(i,t.__v)}}}Bc.__b=function(t){oc=null,jc&&jc(t)},Bc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Vc&&Vc(t,e)},Bc.__r=function(t){Uc&&Uc(t),sc=0;var e=(oc=t.__c).__H;e&&(ac===oc?(e.__h=[],oc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Xc(),sc=0)),ac=oc},Bc.diffed=function(t){Hc&&Hc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==qc.push(e)&&lc===Bc.requestAnimationFrame||((lc=Bc.requestAnimationFrame)||ef)(Xc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),ac=oc=null},Bc.__c=function(t,e){e.some(function(t){try{t.__h.some(rf),t.__h=t.__h.filter(function(t){return!t.__||nf(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Bc.__e(i,t.__v)}}),zc&&zc(t,e)},Bc.unmount=function(t){Wc&&Wc(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{rf(t)}catch(t){e=t}}),i.__H=void 0,e&&Bc.__e(e,i.__v))};var tf="function"==typeof requestAnimationFrame;function ef(t){var e,i=function(){clearTimeout(r),tf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);tf&&(e=requestAnimationFrame(i))}function rf(t){var e=oc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),oc=e}function nf(t){var e=oc;t.__c=t.__(),oc=e}function sf(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function of(t,e){return"function"==typeof e?e(t):e}var af={GZipJS:"gzip-js",Base64:"base64"},lf={Activation:"events",Cancellation:"cancelEvents"},uf={Button:"button",Tab:"tab",Selector:"selector"},hf={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},df={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},vf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},cf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},ff={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},pf={Once:"once",Recurring:"recurring",Always:"always"},gf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},mf={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},yf={Popover:"popover",Inline:"inline"};function _f(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Te(i.then)&&i.then(void 0,()=>{})}}}}var bf=Tn("[Surveys]");function wf(t){return!(!t.start_date||t.end_date)}function kf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Sf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),xf=t=>Sf("seenSurvey_",t),Cf=t=>{try{var e=xf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){bf.error("Failed to persist survey seen state",t)}},Tf=[vf.Popover,vf.Widget,vf.API],Ef={ignoreConditions:!1,ignoreDelay:!1,displayType:yf.Popover},Mf="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 If=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}},Rf=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 If.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 Of}},Af=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};l&&!Ie(l.crypto)&&crypto.getRandomValues&&(Af=t=>crypto.getRandomValues(t));var Pf,Of=class{nextUint32(){return this.Pe.length>this.ai||(Af(this.Pe),this.ai=0),this.Pe[this.ai++]}constructor(){this.Pe=new Uint32Array(8),this.ai=1/0}},Ff=()=>$f().toString(),$f=()=>(Pf||(Pf=new Rf)).generate(),Df="",Lf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Nf=null,qf={si(){if(!Pe(Nf))return Nf;if(Nf=!1,d)try{var t="__ph_cookie_support_"+Ff();qf.ui(t,"xyz"),Nf='"xyz"'===Ia(t),qf.hi(t)}catch(t){Nf=!1}return Nf},ci(t){Cn.error("cookieStore error: "+t)},li:Ia,di(t){var e;try{e=JSON.parse(qf.li(t))||{}}catch(t){}return e},ui(t,e,i,r,n){if(!d)return!1;try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=d),Df)return Df;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_"+Ff();!Df&&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",Df=s)}return Df}(t);if(!i){var r=(t=>{var e=t.match(Lf);return e?e[0]:""})(t);r!==i&&Cn.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(d.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&&Cn.warn("cookieStore warning: large cookie, len="+u.length),d.cookie=u,!0}catch(t){return!1}},hi(t,e){if(null!=d&&d.cookie)try{qf.ui(t,"",-1,e)}catch(t){return}}},Bf=null,jf={si(){if(!Pe(Bf))return Bf;var t=!0;if(Ie(l))t=!1;else try{var e="__mplssupport__";jf.ui(e,"xyz"),'"xyz"'!==jf.li(e)&&(t=!1),jf.hi(e)}catch(e){t=!1}return t||Cn.error("localStorage unsupported; falling back to cookie store"),Bf=t,t},ci(t){Cn.error("localStorage error: "+t)},li(t){try{return null==l?void 0:l.localStorage.getItem(t)}catch(t){jf.ci(t)}return null},di(t){try{return JSON.parse(jf.li(t))||{}}catch(t){}return null},ui(t,e){try{return null==l||l.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){jf.ci(t)}return!1},hi(t){try{null==l||l.localStorage.removeItem(t)}catch(t){jf.ci(t)}}},Uf=[ct,st,nt,at,lt,ut,At,Rt,Mt],Hf=[S,k,Z,Q,Nt,Lt,M,Pt],zf=t=>t+"_cpm",Wf=["__proto__","constructor","prototype"],Vf=t=>{if(!Ee(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Wf.indexOf(i)&&(e[i]=t[i])}),e},Gf=function(t,e){void 0===e&&(e=[]);var i={};return[...Hf,...e].forEach(e=>{var r=t[e];Ie(r)||Pe(r)||""===r||(i[e]=r)}),i},Zf=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var n=t.charCodeAt(r);e=33*e^n,i=Math.imul(i^n,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},Qf=(t,e)=>({p:e,f:Zf(JSON.stringify(t))}),Jf=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=qf.di(zf(t)),r=(null==i?void 0:i.f)===Zf(e)&&Ce(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Kf=(t,e)=>e+"|"+(qf.li(zf(t))||""),Yf={},Xf={si:()=>!0,ci(t){Cn.error("memoryStorage error: "+t)},li:t=>t in Yf?Yf[t]:null,di:t=>t in Yf?Yf[t]:null,ui:(t,e)=>(Yf[t]=e,!0),hi(t){delete Yf[t]}},tp=null,ep={si(){if(!Pe(tp))return tp;if(tp=!0,Ie(l))tp=!1;else try{var t="__support__";ep.ui(t,"xyz"),'"xyz"'!==ep.li(t)&&(tp=!1),ep.hi(t)}catch(t){tp=!1}return tp},ci(t){Cn.error("sessionStorage error: ",t)},li(t){try{return null==l?void 0:l.sessionStorage.getItem(t)}catch(t){ep.ci(t)}return null},di(t){try{return JSON.parse(ep.li(t))||null}catch(t){}return null},ui(t,e){try{return null==l||l.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){ep.ci(t)}return!1},hi(t){try{null==l||l.sessionStorage.removeItem(t)}catch(t){ep.ci(t)}}},ip=Tn("[Stylesheet Loader]"),rp=l,np=d,sp="#020617",op={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:hf.Right,widgetType:uf.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:sp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},ap=[hf.Center,hf.Left,hf.Right];function lp(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 up(t){var e;void 0===t&&(t=op.backgroundColor),"#"===t[0]&&(e=lp(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=lp(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 hp=(t,e,i)=>{var r=Ip(t),n=np.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var o=np.createElement("div");((t,e,i)=>{var r=s({},op,i),n=t.style,o=!ap.includes(r.position)||e===vf.Widget&&(null==i?void 0:i.widgetType)===uf.Tab;n.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(r.fontFamily)),n.setProperty("--ph-survey-box-padding",r.boxPadding),n.setProperty("--ph-survey-max-width",r.maxWidth),n.setProperty("--ph-survey-z-index",r.zIndex),n.setProperty("--ph-survey-border-color",r.borderColor),o?(n.setProperty("--ph-survey-border-radius",r.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",r.backgroundColor),n.setProperty("--ph-survey-box-shadow",r.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||up(r.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",up(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||up(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",up(r.widgetColor)),n.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"),n.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||up(l);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),n.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",r.outlineColor)})(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 Te(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(ip.error("prepare_external_dependency_stylesheet returned null"),null)})(np,':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||np.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},dp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage,u=t.questionSnapshots;n?(Cf(i),n.capture(gf.SENT,s({[mf.SURVEY_NAME]:i.name,[mf.SURVEY_ID]:i.id,[mf.SURVEY_ITERATION]:i.current_iteration,[mf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[mf.SURVEY_SUBMISSION_ID]:r,[mf.SURVEY_COMPLETED]:o},l&&{[mf.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},la(e,i,u),a,{$set:{[ua(i,"responded")]:!0}})),o&&(rp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Mp(i),n.reloadFeatureFlags())):bf.error("[survey sent] event not captured, PostHog instance not found.")},vp=(t,e,i)=>{return s({[mf.SURVEY_NAME]:t.name,[mf.SURVEY_ID]:t.id,[mf.SURVEY_ITERATION]:t.current_iteration,[mf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[mf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Oe(t)))},(null==e?void 0:e.surveyLanguage)&&{[mf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[mf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},la(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},cp=(t,e,i,r)=>{if(e){if(!i){var n=Tp(t),o=n?n.surveyLanguage:r;e.capture(gf.DISMISSED,s({},vp(t,n,e),o&&{[mf.SURVEY_LANGUAGE]:o},{$set:{[ua(t,"dismissed")]:!0}})),Mp(t),Cf(t),rp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else bf.error("[survey dismissed] event not captured, PostHog instance not found.")},fp=(t,e)=>{if(e){var i=(t=>Sf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Tp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(gf.ABANDONED,vp(t,r,e),{transport:"sendBeacon"})}}else bf.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),gp=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,mp=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},yp=(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?gp(t.questions,pp(t.questions)):t.questions},_p=t=>ga(t)||Ep(t),bp=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,kc(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"+rc++,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}),wp=()=>Yc(bp),kp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=cc({},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),gc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Sp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=Qn(e);return!!s&&_a[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var xp=t=>Sf("inProgressSurvey_",t),Cp=(t,e)=>{try{localStorage.setItem(xp(t),JSON.stringify(e))}catch(t){bf.error("Error setting in-progress survey state in localStorage",t)}},Tp=t=>{try{var e=localStorage.getItem(xp(t));if(e)return JSON.parse(e)}catch(t){bf.error("Error getting in-progress survey state from localStorage",t)}return null},Ep=t=>{var e=Tp(t);return!Oe(null==e?void 0:e.surveySubmissionId)},Mp=t=>{try{localStorage.removeItem(xp(t))}catch(t){bf.error("Error clearing in-progress survey state from localStorage",t)}};function Ip(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Rp(t,e,i){if(void 0===e&&(e=hf.Right),t===vf.ExternalSurvey)return{};switch(e){case hf.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case hf.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case hf.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case hf.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case hf.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case hf.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case hf.Left:return{left:"30px"};case hf.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===vf.Widget&&i===uf.Tab?"60px":"30px"}}}var Ap=0;function Pp(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:--Ap,__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 Op=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),Fp=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),$p=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),Dp=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),Lp=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),Np=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Pp("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"})}),qp=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Pp("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"})}),Bp=Pp("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Pp("g",{"clip-path":"url(#clip0_2415_6911)",children:[Pp("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Pp("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Pp("g",{mask:"url(#mask0_2415_6911)",children:[Pp("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"}),Pp("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"}),Pp("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"}),Pp("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"}),Pp("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"}),Pp("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"})]})]}),Pp("defs",{children:Pp("clipPath",{id:"clip0_2415_6911",children:Pp("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function jp(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return Pp("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Bp]})}function Up(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,u=t.canGoBack,h=t.onBack,d=Yc(bp).isPreviewMode,v=!!u&&!!h,c=!a&&Pp("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==l||l.open(s)),d?null==o||o():n()},children:e});return Pp("div",{className:"bottom-section",children:[v?Pp("div",{className:"form-buttons form-buttons-with-back",children:[Pp("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&Pp(jp,{urlParams:{utm_source:"survey-footer"}})]})}function Hp(t){var e=t.question,i=t.forceDisableHtml;return Pp("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Pp(e.type===cf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&kp({component:pc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function zp(t){var e,i,r;return Pp("button",{className:"form-cancel",onClick:t.onClick,disabled:Yc(bp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,Pp("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:[Pp("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Pp("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 Wp=l;function Vp(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Yc(bp).isPopup;return Qc(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ln(Wp,"keydown",t),()=>{Wp.removeEventListener("keydown",t)}},[o]),Pp("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Pp(zp,{onClick:()=>o()}),Pp("h3",{className:"thank-you-message-header",children:e}),i&&kp({component:pc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&Pp(Up,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function Gp(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Yc(bp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return Pp("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Pp(zp,{onClick:()=>u()}),e&&Pp("h3",{className:"intro-screen-header",children:e}),i&&kp({component:pc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Pp(Up,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var Zp=t=>Ce(t)&&t.every(t=>Re(t));function Qp(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=wp().isPreviewMode,d=Jc(null),v=Zc(()=>Re(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Qc(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=Kc(()=>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 ye:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case _e:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional),[c,e.validation,e.optional]),y=wn(e.validation,ye),_=wn(e.validation,_e),b=Kc(()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,_),[y,_]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return Pp(mc,{children:[Pp("div",{className:"question-container",children:[Pp(Hp,{question:e,forceDisableHtml:i,htmlFor:g}),Pp("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:_,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),b&&Pp("div",{className:"validation-hint",children:b})]}),Pp(Up,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Jp(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Pp(mc,{children:[Pp("div",{className:"question-container",children:Pp(Hp,{question:e,forceDisableHtml:t.forceDisableHtml})}),Pp(Up,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Kp(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Zc(()=>Fe(l)?l:Ce(l)&&l.length>0&&Fe(parseInt(l[0]))?parseInt(l[0]):Re(l)&&Fe(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=wp().isPreviewMode,y=t=>m?a(t):o(t);return Pp(mc,{children:[Pp("div",{className:"question-container",children:[Pp(Hp,{question:i,forceDisableHtml:r}),Pp("div",{className:"rating-section",children:[Pp("div",{className:"rating-options",children:["emoji"===i.display&&Pp("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=rg[i.scale])?void 0:e.map((t,e)=>Pp("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&&Pp("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:ng(i.scale).map((t,e)=>Pp(Yp,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&Pp("div",{className:"rating-text",children:[Pp("div",{children:i.lowerBoundLabel}),Pp("div",{children:i.upperBoundLabel})]})]})]}),Pp(Up,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Pe(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Yp(t){var e=t.num,i=t.setActiveNumber;return Pp("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 Xp(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Jc(null),v=Kc(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=gp(e,pp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Zc(()=>((t,e)=>Re(t)||Zp(t)?t:e===cf.SingleChoice?null:[])(l,e.type)),f=c[0],p=c[1],g=Zc(()=>((t,e)=>{if(Re(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Zp(t)){var i=t.find(t=>!e.includes(t));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v)),m=g[0],y=g[1],_=wp().isPreviewMode,b=e.type===cf.SingleChoice,w=e.type===cf.MultipleChoice,k=e.skipSubmitButton&&b&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y(t=>s({},t,{isSelected:i,inputValue:i?t.inputValue:""})),b&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=d.current)?void 0:t.focus()},75))}if(b)return p(t),y(t=>s({},t,{isSelected:!1,inputValue:""})),void(k&&(o(t),_&&a(t)));w&&Ce(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y(t=>s({},t,{inputValue:e})),b&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y(t=>s({},t,{isSelected:!1,inputValue:""})),b&&p(null))},T=()=>!(e.optional||!Pe(f)&&(!Ce(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?Ce(f)&&(_?a([...f,m.inputValue]):o([...f,m.inputValue])):_?a(f):o(f)};return Pp(mc,{children:[Pp("div",{className:"question-container",children:[Pp(Hp,{question:e,forceDisableHtml:i}),Pp("fieldset",{className:"multiple-choice-options limit-height",children:[Pp("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:b?f===t:Ce(f)&&f.includes(t);return Pp("label",{className:n?"choice-option-open":"",children:[Pp("div",{className:"response-choice",children:[Pp("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),Pp("span",{children:n?t+":":t})]}),n&&Pp("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)})]})]}),Pp(Up,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var tg=[1,2,3,4,5],eg=[1,2,3,4,5,6,7],ig=[0,1,2,3,4,5,6,7,8,9,10],rg={2:[Np,qp],3:[$p,Fp,Op],5:[Dp,$p,Fp,Op,Lp]};function ng(t){switch(t){case 5:default:return tg;case 7:return eg;case 10:return ig}}var sg=Tn("[Surveys]");function og(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?ff.End:s;if(n.branching.type===ff.End)return ff.End;if(n.branching.type===ff.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===ff.ResponseBased){if(n.type===cf.SingleChoice){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===ff.End?ff.End:s}}else if(n.type===cf.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===ff.End?ff.End:s}}return s}return sg.warn("Falling back to next question index due to unexpected branching type"),s}var ag=Tn("[SurveyTranslations]");function lg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=ha(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?ha(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=ha(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:Te(t.get_property)?t.get_property(ct):void 0,locale:La()},ag)}(e);if(!i)return ag.info("No user language detected"),{survey:t,language:null};var r=fa(t,i,ag);return{survey:r.survey,language:r.matchedKey}}var ug=l,hg=d,dg="ph:show_survey_widget",vg="PHWidgetSurveyClickListener";function cg(t,e){try{var i=t.getBoundingClientRect(),r=ug.innerHeight,n=ug.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:op.zIndex}}catch(t){return bf.warn("Failed to calculate trigger position:",t),null}}var fg=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(gt);if(t)for(var e of t)Ep(e)&&fp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,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,_=!(!y||0>=Object.keys(y).length)&&e.Ii(p,y,m,f);if(!_||null!=(n=p.appearance)&&n.displayThankYouMessage){e.Ri(p);var b={};if((null==(o=p.appearance)?void 0:o.position)===hf.NextToTrigger&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=hg.querySelector(p.appearance.widgetSelector);k&&(b=cg(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||op.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=hp(p,e._posthog).shadow;e.gi.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Ai,properties:m,style:b,isSurveyCompleted:_,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Si=C,0>=S)return e.bi=!0,Lc(Pp(_g,s({},C)),x);var T=()=>{if(!e.Ei(p))return bf.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),n=r.survey,o=r.language;e.yi=o;var a=e.Mi(n,i),l=s({},C,{survey:a,surveyLanguage:o});e.Si=l,Lc(Pp(_g,s({},l,{survey:s({},a,{appearance:s({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},E=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,M=Fe(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*S-M);if(0>=I)return T();var R=ug.setTimeout(()=>{e.fi.delete(p.id),T()},I);e.fi.set(p.id,R)}},this.Li=t=>{var e=this.xi(t),i=e.survey,r=e.language,n=hp(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.gi.set(s,s.host),o&&Lc(Pp(wg,{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(vg),this.pi.delete(t),bf.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=hg.querySelector(Ip(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ni=(t,e)=>{var i=hg.querySelector(e),r=this.pi.get(t.id);if(i){if(this.Li(t),r){if(i===r.element)return;bf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Oi(t.id)}if(!i.hasAttribute(vg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===hf.NextToTrigger?cg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||op.maxWidth)):{};ug.dispatchEvent(new CustomEvent(dg,{detail:{surveyId:t.id,position:n}}))};Ln(i,"click",n),i.setAttribute(vg,"true"),this.pi.set(t.id,{element:i,listener:n,survey:t}),bf.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=hp(i,this._posthog).shadow;this.gi.set(n,n.host),Lc(Pp(_g,{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)),Lc(Pp(_g,{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===vf.Popover||t.type===vf.Widget),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===vf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===uf.Tab)return void e.Li(t);(null==(r=t.appearance)?void 0:r.widgetType)===uf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Ni(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Pe(e.Bi)&&t.type===vf.Popover&&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=>{Pe(this.Bi)||bf.error("Survey "+this.Bi+" already in focus. Cannot add survey "+t.id+"."),this.Bi=t.id},this.Ai=t=>{this.Bi!==t.id&&bf.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(),Ln(ug,"languagechange",this.wi),this.ki=t.onFeatureFlags(()=>this.Hi())}Hi(){var t;if(!Pe(this.Bi)){var e=null==(t=this._posthog.get_property(gt))?void 0:t.find(t=>t.id===this.Bi);if(e){var i=this.xi(e),r=i.survey,n=i.language;if(n!==this.yi&&(this.yi=n,this.bi)){var o=this.Mi(r,this.Ci),a=hp(o,this._posthog).shadow;Lc(Pp(_g,s({},this.Si,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Ai,surveyLanguage:n})),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?s({},t,{appearance:s({},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)&&(bf.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&&(ug.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)=>{Lc(null,e),null==t||t.remove()}),this.gi.clear(),this.Bi=null}ji(t){return t.sort((t,e)=>{var i,r,n=Ep(t),s=Ep(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===pf.Always,a=e.schedule===pf.Always;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})}xi(t){return lg(t,this._posthog)}qi(t,e,i){if(this.mi.has(t.id))return!1;var r=function(){var t={},e=!1,i=ug.location.search.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:e};for(var r of i.split("&")){var n=r.split("="),s=n[0],o=n[1];if(s&&!Ie(o)){var a=decodeURIComponent(s),l=decodeURIComponent(o);if("auto_submit"!==a||"true"!==l){var u=a.match(/^q(\d+)$/);if(u){var h=parseInt(u[1],10);t[h]||(t[h]=[]),t[h].push(l)}}else e=!0}}return{params:t,autoSubmit:e}}().params;if(0===Object.keys(r).length)return!1;bf.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)&&dp({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])]=Ce(o)?o.map(String):[String(o)]}bf.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=oa(t.id);try{switch(t.type){case cf.SingleChoice:if(!t.choices||0===t.choices.length)return void Cn.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 Cn.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case cf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Cn.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 Cn.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&Cn.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case cf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Cn.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Cn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Cn.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return bf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Ff(),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=oa(l.id);Ie(i[u])||(n[u]=i[u])}s.push(r);var h=og(t,r,l.id?i[oa(l.id)]:null);if(h===ff.End)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 Cp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:mp(t.questions),visitedIndices:l,surveyLanguage:i}),bf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return bf.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||Sp(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!m)return!1;var s=Ji(m,{userAgentDataPlatform:null==h||null==(i=h.userAgentData)?void 0:i.platform,maxTouchPoints:null==h?void 0:h.maxTouchPoints,screenWidth:null==l||null==(r=l.screen)?void 0:r.width,screenHeight:null==l||null==(n=l.screen)?void 0:n.height,devicePixelRatio:null==l?void 0:l.devicePixelRatio});return _a[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==np||!np.querySelector(t.conditions.selector))}(t)}Gi(t){var e;return _p(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(!wf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Tf.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,jf.li("lastSeenSurveyDate"))?(t=>!!jf.li(xf(t))&&!_p(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!pa(t)&&!kf(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=hg.querySelector(Ip(t,!0));null!=e&&e.shadowRoot&&(Lc(null,e.shadowRoot),this.gi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){bf.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(hg&&ug){var i,r=new fg(t);if(t.config.disable_surveys_automatic_display)return bf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return bf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ie(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Ie(i)||(clearInterval(i),i=void 0)};n();var o=()=>{hg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ln(hg,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),hg.removeEventListener("visibilitychange",o)}),r}}function gg(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;Qc(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===vf.Widget,s=Sp(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===uf.Tab&&i;if(!s)return bf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(bf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ln(ug,"popstate",i),Ln(ug,"hashchange",i);var s=ug.history.pushState,l=ug.history.replaceState;return ug.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()},ug.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()},()=>{ug.removeEventListener("popstate",i),ug.removeEventListener("hashchange",i),ug.history.pushState=s,ug.history.replaceState=l}}},[o,e,r,n,a])}var mg=200;function yg(t){switch(void 0===t&&(t=df.Right),t){case df.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case df.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case df.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function _g(t){var e,i,r,n,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,_=t.previewPageIndex,b=t.removeSurveyFromFocus,w=void 0===b?()=>{}:b,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,E=void 0===T?()=>{}:T,M=t.onPopupSurveyDismissed,I=void 0===M?()=>{}:M,R=t.onCloseConfirmationMessage,A=void 0===R?()=>{}:R,P=t.properties,O=t.isSurveyCompleted,F=t.skipShownEvent,D=t.surveyLanguage,L=Jc(null),N=Number.isInteger(_),q=function(t,e,i,r,n,o,a,l,u){var h=Zc(r||0===i||t.type===vf.ExternalSurvey),d=h[0],v=h[1],c=Zc(!1),f=c[0],p=c[1],g=Jc(!1),m=()=>{var e=()=>{o&&n(t),v(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+mg+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Qc(()=>{if(e){if(!r){var n,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&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},a=()=>{if(Sp(t,e)){v(!0),ug.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(gf.SHOWN,s({[mf.SURVEY_NAME]:t.name,[mf.SURVEY_ID]:t.id,[mf.SURVEY_ITERATION]:t.current_iteration,[mf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[mf.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Ln(ug,"PHSurveyClosed",y),Ln(ug,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Ie(h)&&a(),()=>{Ie(h)||clearTimeout(h),Ie(n)||clearTimeout(n),ug.removeEventListener("PHSurveyClosed",y),ug.removeEventListener("PHSurveySent",o)}}}else bf.error("usePopupVisibility hook called without a PostHog instance.")},[]),gg({survey:t,removeSurveyFromFocus:n,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,F,D),B=q.isPopupVisible,j=q.hidePopupWithAnimation,U=q.isSurveySent||_===f.questions.length||!0===O,H=Zc(!1),z=H[0],W=H[1],V=Kc(()=>!!Tp(f),[f]),G=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(r=f.appearance)&&r.introScreenDescription),Z=N?-1===_:!(null==(n=f.appearance)||!n.displayIntroScreen)&&G&&!z&&!V,Q=Kc(()=>{var t,e=(null==(t=Tp(f))?void 0:t.surveySubmissionId)||Ff();return{isPreviewMode:N,previewPageIndex:_,onPopupSurveyDismissed(){D?cp(f,g,N,D):cp(f,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:E,posthog:g,properties:P,surveyLanguage:D}},[N,_,S,g,f,I,C,E,P,D]);return B?Pp(bp.Provider,{value:Q,children:Pp("div",{className:"ph-survey",style:s({},Rp(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:U?Pp(Vp,{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||op,onClose(){j(),A()}}):Z?Pp(Gp,{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||op,onStart:()=>W(!0)}):Pp(bg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function bg(t){var e,i,r=t.survey,n=t.forceDisableHtml,o=t.posthog,a=Kc(()=>{var t=Tp(r);if(!t)return null;var e=Fe(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Mp(r),null)},[r]),l=Zc(()=>(null!=a&&a.responses&&bf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=Yc(bp),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,_=d.properties,b=d.surveyLanguage,w=Zc(()=>{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=Zc(()=>{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],E=Zc(()=>{var t,e;return null!==(t=null==(e=Tp(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),M=E[0],I=E[1],R=Kc(()=>mp(yp(r,a)),[r.id,a]),A=Kc(()=>{if(!R||new Set(R).size!==R.length)return yp(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]);Qc(()=>{!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),O=A.at(k);return O?Pp("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Pp(zp,{onClick(){c()}}),Pp("div",{className:"survey-box","data-question-index":k,children:kg({question:O,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||op,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(o)if(n){var a=oa(n),l=s({},u,{[a]:e});h(l);var d=A[i],v=null!=d&&d.id?s({},M,{[d.id]:d.question}):M;I(v);var c=og(r,i,e),f=c===ff.End,p=[...C,i];if(f||(T(p),S(c),Cp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:c,questionOrder:mp(A),visitedIndices:p,surveyLanguage:b,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=>oa(t)));dp({responses:Object.fromEntries(Object.entries(l).filter(t=>g.has(t[0]))),survey:r,surveySubmissionId:m,isSurveyCompleted:f,posthog:o,properties:_,surveyLanguage:b,questionSnapshots:v})}}else bf.error("onNextButtonClick called without a questionId.");else bf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:O.id}),onPreviewSubmit:p,initialValue:O.id?u[oa(O.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),Cp(r,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:mp(A),visitedIndices:e,surveyLanguage:b,questionSnapshots:M})}}})})]}):null}function wg(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Zc(!0),f=c[0],p=c[1],g=Zc(!1),m=g[0],y=g[1],_=Zc({}),b=_[0],w=_[1],k=Jc(void 0),S=()=>{y(!m)};if(Qc(()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(bf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Ln(ug,dg,e),()=>{Ie(k.current)||(clearTimeout(k.current),k.current=void 0),ug.removeEventListener(dg,e)}}}else bf.error("FeedbackWidget called without a PostHog instance.")},[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),gg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==pf.Always&&p(!1),Ie(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return Pp(mc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Pp("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===df.Top?"widget-tab-top":""),onClick:S,disabled:d,style:yg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Pp(_g,{posthog:h,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var kg=t=>{var e=t.question,i=t.displayQuestionIndex,r=t.onSubmit,n=t.onPreviewSubmit,o={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case cf.Open:return pc(Qp,s({},o,{question:e,key:e.id}));case cf.Link:return pc(Jp,s({},o,{question:e,key:e.id}));case cf.Rating:return pc(Kp,s({},o,{question:e,key:e.id}));case cf.SingleChoice:case cf.MultipleChoice:return pc(Xp,s({},o,{question:e,key:e.id}));default:return bf.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=pg,b.extendPostHogWithSurveys=pg;var Sg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},xg=1e4,Cg=(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),Tg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Cg(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 Cg(e,JSON.stringify(t.slice(0,n)),i)},Eg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Mg=(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}},Ig=(t,e,i)=>{if(!i.truncated)if(Ee(t)){if(i.seen.has(t))return void Mg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(Ig(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Mg(e,t,i)},Rg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Eg(t))return!n||Cg(e,"null",i);if(Pe(t)||(t=>{try{return Fe(t)||De(t)}catch(t){return!1}})(t))return Cg(e,JSON.stringify(t),i);if("string"==typeof t)return Tg(t,e,i);if(!Ee(t)&&!Ce(t))return Cg(e,JSON.stringify(t),i);if(r.has(t))return Tg("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Te(o))return Rg(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return Tg(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return Cg(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 Rg(l,e,i,r,n,s)}if(Ce(t)){if(!Cg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Cg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Rg(d,e,i,r,!0))return!1}return Cg(e,"]",i)}if(!Cg(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{Ig(f,c,s)}catch(t){}if(Eg(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(!Cg(e,p,i))return!1;var _=e.length,b=Rg(f,e,i,r,!1),w=i.truncated;if(e.length!==_){if(v=!1,!b)return!1}else if(e.length=g,i.remaining=m,i.truncated=b?y:w,!b)return!1}}}catch(t){}return Cg(e,"}",i)},Ag=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Ee(t[0])?{result:{},keysRemaining:50,sizeRemaining:xg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Cg(i," ",r))&&Rg(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)||{}}},Pg={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Og=t=>"canCapture"in t,Fg=t=>Og(t)?t.canCapture?t.getExtension(Mf):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},n=!1,o=function(t){var o=b.console[t];i.push(yv(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&&!n&&h){var d=Fg(h);if(d){n=!0,o=!0;var v=Ag(l,xg),c=v.body,f=v.attributes,p=s({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(Og(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;Te(n)&&n.call(e,i)}})(h,d,{level:Pg[t],body:c,attributes:s({"log.source":"console."+t},p,f)})}}}catch(t){}finally{o&&(n=!1),i.apply(b.console,l)}})(i);return a.__rrweb_original__=Sg(o),a}))};for(var a of Object.keys(Pg))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=Fg(t);if(i)for(var r of e)try{var n=Ag(r.args,xg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:Pg[r.level],body:n.body,attributes:s({"log.source":"console."+r.level,host:b.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var $g=t=>Ue(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),Dg=Tn("[Error tracking]"),Lg="webkit-masked-url:",Ng=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Lg],qg=["__firefox__","__gCrWeb"];function Bg(){return new cr([new xr,new Fr,new Tr,new Cr,new Pr,new Ar,new Mr,new Or],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];return function(e,r){void 0===r&&(r=0);for(var n=[],o=e.split("\n"),a=r;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Sr.test(l)?l.replace(Sr,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){n.push(d);break}}if(n.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 s({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(n)}}("web:javascript",_r,kr))}var jg=Tn("[ExceptionAutocapture]"),Ug=Bg(),Hg=(t,e)=>{try{return t()}catch(t){return e}},zg=(t,e)=>Hg(()=>t(e()),void 0),Wg=t=>Hg(()=>Te(t)&&Te(t.call),!1),Vg=(t,e)=>Hg(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),Gg=(t,e,i)=>{Hg(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),Hg(()=>{t[e]=i},void 0)},Zg=t=>{var e=l;e||jg.info("window not available, cannot wrap onerror");var i=Hg(()=>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 zg(t,()=>Ug.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Re(e)&&Re(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}})),!!Wg(i)&&null!==(e=i(...n))&&void 0!==e&&e},Vg(e,"onerror"),()=>Gg(e,"onerror",i)},Qg=function(t,e){void 0===e&&(e=!1);var i=l;i||jg.info("window not available, cannot wrap onUnhandledRejection");var r=Hg(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return zg(t,()=>Ug.buildFromUnknown(i,{mechanism:{handled:!1}})),Wg(r)?null!==(n=r(i))&&void 0!==n&&n:e},Vg(i,"onunhandledrejection"),()=>Gg(i,"onunhandledrejection",r)},Jg={wrapOnError:Zg,wrapUnhandledRejection:Qg,wrapConsoleError(t){var e=console;e||jg.info("console not available, cannot wrap console.error");var i=Hg(()=>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];zg(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return Ug.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Wg(i)&&i(...r)},Vg(e,"error"),()=>Gg(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=Jg,b.posthogErrorWrappingFunctions=Jg;var Kg=(t,e)=>{if(Te(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Pe(i)&&"object"==typeof i&&Ce(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){jg.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){jg.error("Failed to capture exception for a legacy client",t)}};Zg(t=>{r.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),Qg(n,!0)}};b.extendPostHogWithExceptionAutoCapture=Kg,b.extendPostHogWithExceptionAutocapture=Kg;var Yg="X-POSTHOG-SESSION-ID",Xg="X-POSTHOG-WINDOW-ID",tm="X-POSTHOG-DISTINCT-ID",em=[Yg,Xg,tm],im=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],rm=(t,e)=>({}.hasOwnProperty.call(t,e)),nm=t=>"object"==typeof t&&!Pe(t)||Te(t),sm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),om=t=>{try{var e;return sm(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==l||null==(e=l.location)?void 0:e.href).toString()}catch(t){return}},am=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(Ce(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Yg,a.sessionId),n.set(Xg,l),o=!0}var u=(t=>Te(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(tm,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var lm={_patchFetch:(t,e,i)=>yv(l,"fetch",r=>function(n,o){var a=arguments.length>1?[n,o]:[n],l=a;try{var u=om(n);if(u)if(sm(n)){var h=new Request(n,o);am(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(nm(o)?o.headers:void 0);if(am(t,e,i,u,d)){var v=((t,e)=>{if(Ie(t)||Pe(t))return{headers:e};if(nm(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)=>rm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>rm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),im.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&&im.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var n=Reflect.getOwnPropertyDescriptor(i,e);return n?s({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);v&&(l=[n,v])}}}catch(t){l=a}return r.apply(this,l)}),_patchXHR:(t,e,i)=>yv(l.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=om(s);d&&am(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return em.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=lm,b.postHogTracingHeadersPatchFns=lm,"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 um=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)}}},hm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},dm=t=>{if("loading"===document.readyState)return"loading";var e=hm();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"},vm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},cm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[vm(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},fm=new WeakMap;function pm(t,e){var i=fm.get(e);return i||fm.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var gm,mm=-1,ym=()=>mm,_m=t=>{addEventListener("pageshow",e=>{e.persisted&&(mm=e.timeStamp,t(e))},!0)},bm=(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))}},wm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},km=()=>{var t,e;return null!==(t=null==(e=hm())?void 0:e.activationStart)&&void 0!==t?t:0},Sm=-1,xm=new Set,Cm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Tm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of xm)e();isFinite(Sm)||(Sm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Tm,!0))}},Em=function(t){if(void 0===t&&(t=!1),t&&(Sm=1/0),0>Sm){var e,i,r=km();Sm=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:Cm(),addEventListener("visibilitychange",Tm,!0),addEventListener("prerenderingchange",Tm,!0),_m(()=>{setTimeout(()=>{Sm=Cm()})})}return{get firstHiddenTime(){return Sm},onHidden(t){xm.add(t)}}},Mm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=hm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>ym()?a&&(document.prerendering||km()>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}},Im=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var n=new PerformanceObserver(t=>{queueMicrotask(()=>{var i=t.getEntries();r.length>1&&i.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(i)})});for(var o of r)n.observe(s({type:o,buffered:!0},i));return n}}catch(t){}},Rm=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},Am=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Pm=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Om=class{constructor(){this.u=void 0}},Fm=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},$m=[1800,3e3],Dm=function(t,e){void 0===e&&(e={});var i=Rm(e);Fm(()=>{var r,n=pm(e,Om),s=Em(),o=Mm("FCP"),a=Im(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-km(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=bm(t,o,$m,e.reportAllChanges),_m(i=>{o=Mm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ym()),r=bm(t,o,$m,e.reportAllChanges),wm(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Im(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&Am(n.u,i),o=Mm("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=bm(t,o,$m,e.reportAllChanges))(!0)})},e)})},Lm=[.1,.25],Nm=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],qm=function(t,e){void 0===e&&(e={});var i=pm(e=Object.assign({},e),um),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Nm(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:cm(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=Em();Dm(Pm(()=>{var r,n=Mm("CLS",0),s=pm(e,um),o=(i,o,a,l,u)=>{n=Mm("CLS",0,i,o,a,l,u),s.o=0,r=bm(t,n,Lm,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"];Rm(e)&&h.push("soft-navigation");var d=Im(h,u);d&&(r=bm(t,n,Lm,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),_m(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,ym()),wm(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=Nm(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:dm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},Bm=function(t,e){void 0===e&&(e={});var i=pm(e=Object.assign({},e),Om);Rm(e)&&(i.u=new Map),Dm(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:dm(ym())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=hm(),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:dm(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)},jm=0,Um=1/0,Hm=0,zm=t=>{for(var e of t)e.interactionId&&(Um=Math.min(Um,e.interactionId),Hm=Math.max(Hm,e.interactionId),jm=Hm?(Hm-Um)/7+1:0)},Wm=()=>{var t;return gm?jm:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Vm=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return Wm()-this.h}D(){this.h=Wm(),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)}}}},Gm=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Pm(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Zm=[200,500],Qm=function(t,e){void 0===e&&(e={});var i=pm(e=Object.assign({},e),Vm),r=[],n=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(Gm(d),u=!0)},d=()=>{var t=new Set(i.v.map(t=>a.get(t.entries[0]))),e=n.length-10;n=n.filter((i,r)=>r>=e||t.has(i));var s=new Set;for(var l of n)for(var h of v(l.startTime,l.processingEnd))s.add(h);r=r.filter(t=>t.startTime>o||s.has(t)),u=!1};i.m=t=>{var i,r=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var s=n.length-1;s>=0;s--){var l=n[s];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&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:cm(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};Im(["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=Em();Fm(()=>{var r;"interactionCount"in performance||gm||(gm=Im(["event"],zm,{durationThreshold:0}));var n,o=Mm("INP"),a=pm(e,Vm),l=(i,r,s,l,u)=>{a.D(),o=Mm("INP",-1,i,r,s,l,u),n=bm(t,o,Zm,e.reportAllChanges)},u=()=>{var t=a.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,n())},h=t=>{u(),n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Gm(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&n(!0)})},v=["event","first-input"];Rm(e)&&v.push("soft-navigation");var c=Im(v,d,s({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=bm(t,o,Zm,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),_m(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ym())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:dm(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:dm(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)},Jm=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],Km=50,Ym=[];Im(["resource"],t=>{for(var e of t)Ym.push(e),Ym.length>Km&&Ym.shift()});var Xm=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(Km=e.resourceBufferSize);var i=pm(e,Jm),r=new WeakMap;Rm(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:cm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Rm(e);Fm(()=>{var n,s=Em(),o=Mm("LCP"),a=pm(e,Jm),l=(r,a,l,u,h)=>{o=Mm("LCP",-1,r,a,l,u,h),n=bm(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Em(!0))},u=t=>{a.u&&t.navigationId&&Am(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-km(),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=Im(d,h);if(v){n=bm(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Gm(()=>{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});_m(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ym()),n=bm(t,o,$,e.reportAllChanges),wm(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})}(e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n,o,a,l,u,h,d=t.entries.at(-1),v=d.url&&(Ym.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!==(n=null==(o=h=hm())?void 0:o.activationStart)&&void 0!==n?n: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=s({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))},e)},ty=-1,ey=()=>ty,iy=t=>{addEventListener("pageshow",e=>{e.persisted&&(ty=e.timeStamp,t(e))},!0)},ry=(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))}},ny=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},sy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},oy=()=>{var t,e;return null!==(t=null==(e=sy())?void 0:e.activationStart)&&void 0!==t?t:0},ay=-1,ly=new Set,uy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,hy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of ly)e();isFinite(ay)||(ay="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",hy,!0))}},dy=function(t){if(void 0===t&&(t=!1),t&&(ay=1/0),0>ay){var e,i,r=oy();ay=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:uy(),addEventListener("visibilitychange",hy,!0),addEventListener("prerenderingchange",hy,!0),iy(()=>{setTimeout(()=>{ay=uy()})})}return{get firstHiddenTime(){return ay},onHidden(t){ly.add(t)}}},vy=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>ey()?a&&(document.prerendering||oy()>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}},cy=new WeakMap;function fy(t,e){var i=cy.get(e);return i||cy.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var py,gy=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)}}},my=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var n=new PerformanceObserver(t=>{queueMicrotask(()=>{var i=t.getEntries();r.length>1&&i.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(i)})});for(var o of r)n.observe(s({type:o,buffered:!0},i));return n}}catch(t){}},yy=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},_y=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},by=t=>{var e=!1;return()=>{e||(t(),e=!0)}},wy=class{constructor(){this.l=void 0}},ky=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Sy=[1800,3e3],xy=function(t,e){void 0===e&&(e={});var i=yy(e);ky(()=>{var r,n=fy(e,wy),s=dy(),o=vy("FCP"),a=my(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-oy(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=ry(t,o,Sy,e.reportAllChanges),iy(i=>{o=vy("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ey()),r=ry(t,o,Sy,e.reportAllChanges),ny(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&my(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&_y(n.l,i),o=vy("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=ry(t,o,Sy,e.reportAllChanges))(!0)})},e)})},Cy=[.1,.25],Ty=function(t,e){void 0===e&&(e={});var i=dy();xy(by(()=>{var r,n=vy("CLS",0),s=fy(e,gy),o=(i,o,a,l,u)=>{n=vy("CLS",0,i,o,a,l,u),s.i=0,r=ry(t,n,Cy,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"];yy(e)&&h.push("soft-navigation");var d=my(h,u);d&&(r=ry(t,n,Cy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),iy(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,ey()),ny(r)}),setTimeout(r))}))},Ey=0,My=1/0,Iy=0,Ry=t=>{for(var e of t)e.interactionId&&(My=Math.min(My,e.interactionId),Iy=Math.max(Iy,e.interactionId),Ey=Iy?(Iy-My)/7+1:0)},Ay=()=>{var t;return py?Ey:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Py=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Ay()-this.u}M(){this.u=Ay(),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)}}}},Oy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=by(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Fy=[200,500],$y=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=dy();ky(()=>{var r;"interactionCount"in performance||py||(py=my(["event"],Ry,{durationThreshold:0}));var n,o=vy("INP"),a=fy(e,Py),l=(i,r,s,l,u)=>{a.M(),o=vy("INP",-1,i,r,s,l,u),n=ry(t,o,Fy,e.reportAllChanges)},u=()=>{var t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,n())},h=t=>{u(),n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Oy(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&n(!0)})},v=["event","first-input"];yy(e)&&v.push("soft-navigation");var c=my(v,d,s({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=ry(t,o,Fy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),iy(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ey())}))})}},Dy=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},Ly=[2500,4e3],Ny=function(t,e){void 0===e&&(e={});var i=!1,r=yy(e);ky(()=>{var n,s=dy(),o=vy("LCP"),a=fy(e,Dy),l=(r,a,l,u,h)=>{o=vy("LCP",-1,r,a,l,u,h),n=ry(t,o,Ly,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=dy(!0))},u=t=>{a.l&&t.navigationId&&_y(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-oy(),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=my(d,h);if(v){n=ry(t,o,Ly,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Oy(()=>{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});iy(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ey()),n=ry(t,o,Ly,e.reportAllChanges),ny(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},qy={onLCP:Xm,onCLS:qm,onFCP:Bm,onINP:Qm,withoutAttribution:{onLCP:Ny,onCLS:Ty,onFCP:xy,onINP:$y}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=qy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=qy,b.postHogWebVitalsCallbacks=qy;var By={onLCP:Ny,onCLS:Ty,onFCP:xy,onINP:$y};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=By,b.__PosthogExtensions__.postHogWebVitalsCallbacks=By,b.postHogWebVitalsCallbacks=By,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>By;var jy={onLCP:Xm,onCLS:qm,onFCP:Bm,onINP:Qm,withoutAttribution:{onLCP:Ny,onCLS:Ty,onFCP:xy,onINP:$y}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=jy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=jy,b.postHogWebVitalsCallbacks=jy;var Uy={onLCP:Ny,onCLS:Ty,onFCP:xy,onINP:$y};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Uy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Uy,b.postHogWebVitalsCallbacks=Uy,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Uy;var Hy=class{constructor(t){this.disabled=!1===t;var e=Ee(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}},zy="$copy_autocapture",Wy=Tn("[AutoCapture]");function Vy(t,e){return e.length>t?e.slice(0,t)+"...":e}function Gy(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Kn(e));return e}function Zy(t,e){var i,r,n=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!Kn(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!Yn(f,"body")&&1e3>v.length;)if(ts(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!Kn(f.parentNode))break;if(c.has(f.parentNode))break;c.add(f.parentNode),v.push(f.parentNode),f=f.parentNode}var g="click"===n.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?v.findIndex(t=>Yn(t,"button")||Yn(t,"a")):-1;g>0&&(a=a||v.slice(0,g+1).some(t=>!ws(t)||ks(t)));var m,y,_,b=[],w={},k=!1,S=!1;if(Mn(v,t=>{var e=ws(t);if(Yn(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Rs(i))&&(d?lr(i):i)}ve(rs(t),"ph-no-capture")&&(S=!0),b.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};as.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?Vy(1024,As(t)):Vy(1024,ss(t)));var a=rs(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),Mn(t.attributes,function(i){var s;if((!ks(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Rs(i.value)&&(!Re(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=es(a).join(" ")),o["attr__"+i.name]=Vy(1024,"href"===i.name&&n?lr(a):a)}});for(var l=1,u=1,h=t;h=Gy(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,u,d)),Mn(function(t){if(!ws(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&&Rs(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],b.splice(0,g)),a||(b[0].$el_text=Yn(t,"a")||Yn(t,"button")?As(t):ss(t)),k){var x,C;b[0].attr__href=k;var T=null==(x=jn(k))?void 0:x.host,E=null==l||null==(C=l.location)?void 0:C.host;T&&E&&T!==E&&(m=k)}return{props:In((y=n.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:b},{$elements_chain:(_=b,Ce(_)?function(t){return t.map(t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var o=s({},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 Rn(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[Os(t[0].toString())]=Os(e.toString())}),(r+=":")+Rn(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 Rn(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>r.attributes[t[0]]=t[1]),r})}(_)):"")},null!=(i=b[0])&&i.$el_text?{$el_text:null==(r=b[0])?void 0:r.$el_text}:{},m&&"click"===n.type?{$external_click_url:m}:{},w),target:t}}var Qy=class{Ds(){this.Ls=void 0,clearTimeout(this.Ns),this.Ns=void 0}qs(t){var e;if(!ws(t))return!0;for(var i,r=null!==(e=this.js().css_selector_ignorelist)&&void 0!==e?e:ds,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=rs(t);if(ve(e,"ph-no-capture")||ve(e,"ph-sensitive")||ks(t)||r.some(e=>ls(t,e)))return{v:!0};var i=s.parentNode;s=ts(i)?i.host:i&&Kn(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=os(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&Kn(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=os(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&&(Yn(r,"html")||Yn(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.js().css_selector_ignorelist)&&void 0!==n?n:ds;return[r,null==d?void 0:d.documentElement,null==d?void 0:d.body].some(t=>{if(!t)return!1;var e=rs(t);return ve(e,"ph-no-capture")||ve(e,"ph-sensitive")||!ws(t)||ks(t)||s.some(e=>ls(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 Hy(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(l&&d){var t=this.io=t=>{t=t||(null==l?void 0:l.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(Pe(e))return;this.ro(t,"$autocapture",e)}catch(t){Wy.error("Failed to capture event",t)}};if(Ln(l,"blur",t),Ln(d,"submit",t,{capture:!0}),Ln(d,"change",t,{capture:!0}),Ln(d,"click",t,{capture:!0}),Mn(["pointerdown","pointermove","pointerup","pointercancel"],e=>{Ln(d,e,t,{capture:!0})}),this.js().capture_copied_text){var e=this.no=t=>{t=t||(null==l?void 0:l.event);try{this.ro(t,zy)}catch(t){Wy.error("Failed to capture clipboard event",t)}};Ln(d,"copy",e,{capture:!0}),Ln(d,"cut",e,{capture:!0}),Ln(d,"paste",e,{capture:!0})}}}else Wy.info("Disabling Automatic Event Collection because this browser is not supported")}Ys(){this.Ds(),this.io&&(null==l||l.removeEventListener("blur",this.io),Mn(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==d||d.removeEventListener(t,this.io,!0)}),null==d||d.removeEventListener("submit",this.io,!0),null==d||d.removeEventListener("change",this.io,!0),null==d||d.removeEventListener("click",this.io,!0),this.io=void 0),this.no&&(null==d||d.removeEventListener("copy",this.no,!0),null==d||d.removeEventListener("cut",this.no,!0),null==d||d.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;De(r)&&(null==(i=this.Hs)||i.kv.set(R,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==d||null==(n=d.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||ve(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(R),r=this.Vs,n=this.js(),s=n.remoteRequestsDisabled&&!this.Gs;if(Pe(r)&&!De(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||os(t);Xn(r)&&(r=r.parentNode||null);var n,o=this.Ks();"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&o.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&ys(r,o.rageclick)&&this.ro(t,"$rageclick",i);var a=e===zy,u=a?s({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!l||_s(t))return!1;if(null!=i&&i.url_allowlist&&!is(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&is(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var a=i.dom_event_allowlist;if(a&&!a.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(!us(d,null==i?void 0:i.css_selector_allowlist))return!1;if(us(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:ds))return!1;try{var v=l.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&&(as.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,u,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var h,d=Zy(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===zy){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==l||null==(p=l.getSelection())?void 0:p.toString(),y=ns(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=>Wy.error("Failed to capture event",t)),!0}}else this.Ds()}isBrowserSupported(){return Te(null==d?void 0:d.querySelectorAll)}},Jy={};function Ky(t,e){var i=os(t);return i?s({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Yy(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Xy(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var t_="canvas,video,audio,embed,object";function e_(t,e){return Fe(t)&&t>=e}function i_(t){return t>=0&&1e3>t?t:void 0}function r_(t,e){return e?i_(t-e):void 0}var n_=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=Ky(t,{type:"click"});Pe(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==d||null==d.elementsFromPoint?void 0:d.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some(t=>null==t.matches?void 0:t.matches(t_)))return;var h=Ky(r,{type:"swipe",swipeDirection:Yy(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Pe(h)||this.sn(h)||this.un(h),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=Jy[t];if(i)return i;var r=e[t];if((t=>Te(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==l||!l.Zone))return Jy[t]=r.bind(e);var n=e.document;if(n&&Te(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var a,u,h=s.contentWindow;h&&h[t]&&(r=h[t],"MutationObserver"===t&&function(t){return ve(t,"AppleWebKit")&&!ve(t,"Chrome")}(null!==(a=null==(u=e.navigator)?void 0:u.userAgent)&&void 0!==a?a:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){Cn.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&&Te(r)?Jy[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==d||d.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(){Ln(b,"click",this.an)}un(t){t.visibilityChangedDelayMs=r_(t.timestamp,this.fn),t.focusChangedDelayMs=r_(t.timestamp,this.mn),this.rn.push(t)}ln(){this.rn.length&&Ie(this.Dn)&&(this.Dn=b.setTimeout(()=>{this.Pn()},1e3))}Mn(){Ln(b,"scroll",this.hn,{capture:!0})}Tn(){Ln(b,"selectionchange",this.dn)}In(){Ln(d,"visibilitychange",this.Ze)}Rn(){Ln(b,"blur",this.gn),Ln(b,"focus",this.gn)}pn(t,e){this.rn.forEach(i=>{var r=i_(e-i.timestamp);Fe(r)&&(Ie(i[t])||i[t]>r)&&(i[t]=r)})}En(){Ln(b,"touchstart",this.yn,{capture:!0,passive:!0}),Ln(b,"touchend",this.kn,{capture:!0,passive:!0}),Ln(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==d||!d.querySelector(t_))),!!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))&&!Yn(t.node,"html")&&Kn(t.node)&&function(t,e){var i;if(!l||_s(t))return!1;var r=De(e)?ps:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ps;return!us(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,!(!l||_s(i))&&bs(i,!1).targetElementList.some(t=>Yn(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=e_(e.scrollDelayMs,this._n.scroll_threshold_ms),n=e_(e.selectionChangedDelayMs,this._n.selection_change_threshold_ms),s=e_(e.mutationDelayMs,this._n.mutation_threshold_ms),o=e_(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=Xy(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=Xy(t);this.instance.capture(i,s({},e,Zy(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 n_(t,e);var s_=Tn("[ExternalScriptsLoader]"),o_=t=>{var e=null==d?void 0:d.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]},a_=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return s_.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=o_(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(!d)return i("document not found");if(o_(e))return a_(t,e,i);var r=d.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)d.head.appendChild(r);else{var n,s=d.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):d.body.appendChild(r)}};null!=d&&d.body?s():null==d||d.addEventListener("DOMContentLoaded",s)},l_={},u_=(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=l_[n];if("fallback"===r&&s){if(o_(s))return void a_(t,s,i);delete l_[n]}a_(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=u_(t,e);l_[n]=a;var l=o_(n);null==l||null==(o=l.parentNode)||o.removeChild(l),a_(t,a,i)}else i(void 0,s)}:i)}else a_(t,u_(t,e),i)}else a_(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{a_(t,t.requestRouter.endpointFor("api",e),i)};var h_=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 Ve(t)?1:ve(Ge,t)?0:-1}get ao(){var t=this._n.opt_out_capturing_persistence_type,e="localStorage"===t?jf:qf,i=e.si()?e:Xf;if(!this.uo||this.uo!==i){this.uo=i;var r="localStorage"===t?qf:jf;r.li(this.lo)&&(this.uo.li(this.lo)||this.optInOut(Ve(r.li(this.lo))),r.hi(this.lo,this._n.cross_subdomain_cookie))}return this.uo}so(){return!!this._n.respect_dnt&&[null==h?void 0:h.doNotTrack,null==h?void 0:h.msDoNotTrack,b.doNotTrack,null==h?void 0:h.globalPrivacyControl].some(t=>Ve(t))}},d_=Tn("[Dead Clicks]"),v_=()=>!0,c_=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(L)),r=t.instance.config.capture_dead_clicks;return De(r)?r:!!Ee(r)||i},f_=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({[L]: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?d_.error("failed to load script",e):t()})}vo(){var t;if(d){if(!this.ho&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Ee(this.instance.config.capture_dead_clicks)?s({},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(d),d_.info("starting...")}}else d_.error("`document` not found. Cannot start.")}stop(){this.ho&&(this.ho.stop(),this.ho=void 0,d_.info("stopping..."))}},p_=Tn("[SegmentIntegration]");function g_(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()||Ff();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(Pt,ie)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&Te(s.then)?s.then(n):n(s)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||p_.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()||(p_.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(p_.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,oe)},identify(t){return i(t,le)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{p_.error("Failed to register the Segment integration",t),e()})},i)}var m_="posthog-js";function y_(t,e){var i=void 0===e?{}:e,r=i.organization,n=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=>s({},t,{stacktrace:t.stacktrace?s({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>s({},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&&n&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),h&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}var __=class{constructor(t,e,i,r,n,s){this.name=m_,this.setupOnce=function(o){o(y_(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},b_=class{constructor(t){this.co=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Cn.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==l?void 0:l.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?Ze(o/s,0,1,Cn):1,v=s>1?Ze(a/s,0,1,Cn):1,c=l>1?Ze(u/l,0,1,Cn):1,f=l>1?Ze(h/l,0,1,Cn):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}},w_=["flags","surveys"],k_={[w]:{exposure:"hidden"},[C]:{exposure:"hidden"},[T]:{exposure:"hidden"},[I]:{exposure:"hidden"},[M]:{exposure:"hidden"},[R]:{exposure:"event"},[A]:{exposure:"hidden"},[q]:{exposure:"hidden"},[P]:{exposure:"event"},[O]:{exposure:"hidden"},[F]:{exposure:"event"},[D]:{exposure:"event"},[L]:{exposure:"event"},[N]:{exposure:"hidden"},[B]:{exposure:"event"},[j]:{exposure:"hidden"},[U]:{exposure:"hidden"},[Z]:{exposure:"hidden"},[Q]:{exposure:"event"},[H]:{exposure:"event",shouldSkipFromEventProperties:t=>Pe(t)},[J]:{exposure:"event"},[K]:{exposure:"event"},[Y]:{exposure:"event"},[it]:{exposure:"event"},[rt]:{exposure:"hidden"},[nt]:{exposure:"hidden",storageGroup:"flags"},[st]:{exposure:"hidden",storageGroup:"flags"},[ot]:{exposure:"hidden"},[at]:{exposure:"hidden",storageGroup:"flags"},[lt]:{exposure:"hidden",storageGroup:"flags"},[ut]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ht]:{exposure:"hidden",storageGroup:"flags"},[dt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ct]:{exposure:"hidden"},[ft]:{exposure:"hidden"},[gt]:{exposure:"hidden",storageGroup:"surveys"},[mt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[yt]:{exposure:"event"},[_t]:{exposure:"hidden"},[bt]:{exposure:"hidden"},[wt]:{exposure:"hidden"},[kt]:{exposure:"hidden"},[St]:{exposure:"hidden"},[xt]:{exposure:"event"},[Ct]:{exposure:"event"},[Tt]:{exposure:"event"},[Et]:{exposure:"event"},[Mt]:{exposure:"hidden"},[It]:{exposure:"hidden"},[pt]:{exposure:"event"},[Rt]:{exposure:"hidden"},[At]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Pt]:{exposure:"hidden"},[Ot]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},[$t]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},[Lt]:{exposure:"hidden"},[Nt]:{exposure:"hidden"},[z]:{exposure:"event"},[W]:{exposure:"event"},[V]:{exposure:"event"},[G]:{exposure:"event"},[jt]:{exposure:"event"},[Ut]:{exposure:"event"},[Ht]:{exposure:"event"},[zt]:{exposure:"event"},[Wt]:{exposure:"event"},[Vt]:{exposure:"event"},[Gt]:{exposure:"event"},[Zt]:{exposure:"event"},[Qt]:{exposure:"event"},[Jt]:{exposure:"event"},[Xt]:{exposure:"event"}},S_=[[X,{exposure:"hidden"}],[tt,{exposure:"hidden"}],[et,{exposure:"hidden"}]],x_=t=>{var e=k_[t];if(e)return e;for(var i of S_){var r=i[1];if(0===t.indexOf(i[0]))return r}},C_={flags:At,surveys:mt},T_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],E_=t=>t+"_cookie_identity_change_pending",M_=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},I_="main",R_=[nt,st,at,lt,ut,At,ht,ct],A_=t=>-1!==R_.indexOf(t),P_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},O_=t=>{if(!t)return{};var e=JSON.parse(t);return Ee(e)?e:{}},F_=(t,e)=>{Mn(t,(i,r)=>{var n=x_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},$_=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&&Cn.info("Persistence loaded",t.persistence,s({},this.props)),this.update_config(t,t,e),this.save(),l){var r=()=>this.flush();Ln(l,"beforeunload",r,{capture:!1}),Ln(l,"pagehide",r,{capture:!1}),this.Lo=t=>{if(this._o&&(!t.storageArea||t.storageArea===(null==l?void 0:l.localStorage))&&t.key)if(t.key!==this.Fo){if(this.ko){var e=w_.find(e=>t.key===this.No(e));e&&this.qo(t.key,e)}}else this.qo(t.key,I_)},Ln(l,"storage",this.Lo)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Co.get(e);if(A_(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&&l&&(l.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=jf.li(t),Pe(n)){var s=this.Ho(e);return s.storageValue=null,e!==I_&&(s.persisted=!1),!1}r=O_(n)}catch(t){return!1}var o=e===I_?r:jf.di(this.Fo);if(o&&this.zo(o))return!1;var a=this.Uo(r,e,i);return e===I_&&this.ko&&!P_(this.Wo().main,r)||this.Vo(r,e,!0,n),a}zo(t){var e=this.props[k],i=t[k];return!Ie(e)&&!Ie(i)&&e!==i}Vo(t,e,i,r){var n=this.Ho(e);n.storageValue=r,e!==I_&&(n.persisted=i);try{n.fingerprint=this.Go(t,e)}catch(t){n.fingerprint=void 0}}Uo(t,e,i){var r=!1;return R_.forEach(i=>{var n,s=null==(n=x_(i))?void 0:n.storageGroup;if(!(e===I_&&this.ko&&s||e!==I_&&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&&P_(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=jf.li(this.Fo),i=this.Ho(I_),r=!1,n=!1;if(e!==i.storageValue)if(Pe(e))i.storageValue=null;else{if(t=O_(e),this.Io=!this.Mo&&this.zo(t),this.Io)return!1;n=this.Uo(t,I_,!1),!this.ko||P_(this.Wo().main,t)?this.Vo(t,I_,!0,e):i.storageValue=e,r=!0}return this.ko&&w_.forEach(e=>{var i=jf.li(this.No(e)),s=this.Ho(e),o=t||{},a=r&&R_.some(t=>{var i;return(null==(i=x_(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Pe(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.Uo(o,e,!1)||n));var l=O_(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=x_(t);null!=i&&i.volatile||(this.Ho((this.ko?null==i?void 0:i.storageGroup:void 0)||I_).fingerprint=void 0,this.Xo(t))}Yo(){R_.forEach(t=>this.Co.set(t,!0))}Do(){if(this._o)try{var t=jf.li(this.Fo),e=O_(t);this.Ho(I_).storageValue=t,R_.forEach(t=>{var i,r=this.ko?null==(i=x_(t))?void 0:i.storageGroup:void 0,n=r?jf.li(this.No(r)):null;if(r){var s=this.Ho(r);s.storageValue=n,s.persisted=!Pe(n)}var o=r&&!Pe(n)?O_(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(Ce(e)?e:[]),n=new Set(Ce(this.props[t])?this.props[t]:[]);return i.forEach(t=>n.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=Ee(e)?s({},e):{},a=Ee(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(A_(t)){var r=this.Co.get(t);if(!0!==r){var n=e;if(this._o)try{var s,o=this.ko?null==(s=x_(t))?void 0:s.storageGroup:void 0,a=o?this.No(o):this.Fo;n=O_(jf.li(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Ie(e)&&!Ce(e)||!Ie(n)&&!Ce(n)||!Ce(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(!Ee(i))return void(P_(n,i)?this.Co.delete(t):this.jo(t,!0));if(!Ie(e)&&!Ee(e)||Ie(e)&&Me(i)&&Ie(n))return void this.jo(t,!0);var v=Ee(e)?e:{},c=Ee(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&P_(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&P_(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=Gf(t,this._n.cookie_persisted_properties||[]),i=Qf(e,this._n.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=qf.li(this.Fo)||void 0;n&&Kf(this.Fo,n)===r&&(this.ra=r,this.na=n)}catch(t){}else try{var s=qf.li(this.Fo)||void 0;this.ra=s?Kf(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=qf.li(this.Fo)||void 0}catch(t){}if(!i||i===this.na)return!1;var r,n=Kf(this.Fo,i);try{r=Vf(JSON.parse(i))}catch(t){return!1}if((qf.li(this.Fo)||void 0)!==i)return!1;this.ra=n,this.na=i;var s=Jf(this.Fo,i),o=[...Hf,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Ie(e)||Pe(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[k],d=u[Pt],v=In({},u);[...Hf,...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===Hf.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=In(v,r),R_.forEach(t=>{var e=t in this.props;t in u===e&&P_(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(Pt,ee);var c=this.props[k],f=this.props[Pt];return!l||c===h&&f===d||(this.Mo=!0,this.So=!0,ep.ui(E_(this.Fo),!0),this.Qo(ct),this.Qo(st),this.Qo(nt),this.Qo(at),this.Qo(lt),this.Qo(ut),this.Qo(At),this.Qo(Rt),this.Qo(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Ie(h)||c===h)||(F_(this.props,r),this.Qo(ft)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.Qo(C)),!0}consumeCookieIdentityChange(){var t=E_(this.Fo),e=this.So||!!ep.li(t);return this.So=!1,e&&ep.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[I_],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===T_.indexOf(t.persistence.toLowerCase())&&(Cn.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=[...Hf,...t];return s({},jf,{di(t){try{var r,n={};try{r=qf.li(t)||void 0,n=r?Vf(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(jf.li(t)||"{}");if(e){var a=Jf(t,r),l=[...Hf,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Pe(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[k],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===Hf.indexOf(t)||!1!==e&&0!==e)&&delete o[t]}}),!h||"$user_state"in n||"$user_state"in o||(o[Pt]=ee),!h||("distinct_id"in u?u[k]:o[k])===v&&("$user_state"in u?u[Pt]:o[Pt])===c||(Uf.forEach(t=>delete o[t]),"identified"===u.$user_state&&"distinct_id"in u?o.$user_id=u[k]:delete o.$user_id,"identified"!==u.$user_state&&(delete o[pt],delete o[ft]),delete o.__alias)}s=In(o,u)}else s=In(n,o);return jf.ui(t,s),s}catch(t){}return null},ui(i,r,n,s,o,a){var l=jf.ui(i,r,void 0,void 0,a);try{var u=Gf(r,t);if(Object.keys(u).length){if(e){var h=zf(i),d=Qf(u,t);if(qf.ui(h,d,n,s,o,a),qf.li(h)!==JSON.stringify(d)){qf.hi(h,s);var v=Gf(r);return qf.ui(i,v,n,s,o,a),l}}qf.ui(i,u,n,s,o,a)}}catch(t){jf.ci(t)}return l},hi(t,e){try{null==l||l.localStorage.removeItem(t),qf.hi(t,e),qf.hi(zf(t),e)}catch(t){jf.ci(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,n=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&jf.si()?(e=jf,n=!0):"localstorage+cookie"===o&&i.si()?(e=i,n=!0,r=!0):"sessionstorage"===o&&ep.si()?e=ep:"memory"===o?e=Xf:"cookie"===o&&qf.si()?(e=qf,r=!0):i.si()?(e=i,n=!0,r=!0):qf.si()?(e=qf,r=!0):e=Xf,this._o=n,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=x_(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?jf.di(this.Fo):null,r={};if(e)try{Mn(r=Vf(qf.di(this.Fo)),(t,e)=>{(Ie(t)||Pe(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[k],l=null!==(s=null==i?void 0:i.$user_state)&&void 0!==s?s:"anonymous",u=n[k],h=null!==(o=n.$user_state)&&void 0!==o?o:"anonymous";if(u!==a||h!==l){this.So=!0,ep.ui(E_(this.Fo),!0);var d=In({},this.props);Uf.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Ie(a)||u===a)||(F_(d,r),delete d[ft]),this.props=d;var v=new Set;Uf.forEach(t=>{var e,i=null==(e=x_(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};Mn(this.props,(i,r)=>{var n;(null==(n=x_(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Me(e)?(jf.hi(this.No(t)),this.bo[t]={}):jf.ui(this.No(t),e)&&(this.bo[t]={persisted:!0,fingerprint:this.Go(e,t)})})}}ep.li(E_(this.Fo))&&(this.So=!0)}}da(){for(var t of w_){var e=jf.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=x_(e))?void 0:i.storageGroup)===t})}ca(t,e){var i=C_[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=x_(t))?void 0:e.storageGroup:void 0,r=i?jf.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&&Cn.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,I_);"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,I_);"written"===n&&this.ia(i),"failed"!==n&&(this.Mo=!1,this.Eo=!1,R_.forEach(t=>{var e;null!=(e=x_(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 R_.forEach(i=>{var r;(null==(r=x_(i))?void 0:r.storageGroup)===e&&t.Co.delete(i)}),1;var s=t.pa(jf,t.No(e),n,e);"failed"!==s&&R_.forEach(i=>{var r=x_(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.Co.delete(i)})};for(var o of w_)if(s(o))continue}Wo(){var t={},e={flags:{},surveys:{}};return Mn(this.props,(i,r)=>{var n,s=null==(n=x_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}Go(t,e){if(e===I_)return JSON.stringify(t)+"|"+this.ga+"|"+this.ma+"|"+this.ya;var i={};return Mn(t,(t,e)=>{var r;i[e]=null!=(r=x_(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}pa(t,e,i,r){var n,s=this.Ho(r);if(r!==I_&&!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!==I_&&(s.persisted=!0),Ie(n)||(s.fingerprint=n),this._o&&(s.storageValue=jf.li(e)),"written"):(this._n.debug&&Cn.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 w_)jf.hi(this.No(r));i?delete this.bo[I_]:this.bo={},this.ra=void 0,this.na=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Ee(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(Ee(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||Ee(e)||Ce(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==d?void 0:d.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(On(e));return i&&this.register(e),this.Po=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==d?void 0:d.referrer)?Da(t):{})}update_referrer_info(){var t;this.register_once({$referrer:qa(),$referring_domain:null!=d&&d.referrer&&(null==(t=jn(d.referrer))?void 0:t.host)||Na},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=Ba(this._n.mask_personal_data_properties,this._n.custom_personal_data_properties,this._n.disable_capture_url_hashes);this.register_once({[Lt]:this.wo?{r:M_(t.r),u:t.u?M_(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};Mn([Dt,$t],e=>{var i=this.props[e];i&&Mn(i,function(e,i){t["$initial_"+fe(i)]=e})});var e=this.props[Lt];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_"+fe(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,n=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every((t,e)=>t===r[e])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),o=r||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!i,u=!!this.Bo&&!l;l||this.sa(e,u),this._n=t,!l&&(r||n||a)&&(this.ra=void 0,this.na=void 0,this.sa(s({},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[I_],this.ua()))}finally{this.To=!1,c&&this.ha()}}_a(){var t=this.props[Lt];if(this.wo&&Ee(t)&&"string"==typeof t.r){var e=M_(t.r),i="string"==typeof t.u?M_(t.u):t.u;e===t.r&&i===t.u||this.Jo(Lt,s({},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||P_(n,e)||(this.Eo=!0),this.ta(t,n,e),null!=(r=x_(t))&&r.volatile||this.Xo(t))}Qo(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(A_(t)&&this.jo(t,!0),"$fbc_persistence"===t&&(this.Eo=!0),this.Xo(t))}Xo(t){var e,i=null==(e=x_(t))?void 0:e.storageGroup;i&&(this.Ho(i).dirty=!0)}Ho(t){return this.bo[t]||(this.bo[t]={})}},D_={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},L_={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},N_={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},q_=Tn("[RateLimiter]"),B_=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=>{q_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void q_.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!Ce(e)||!e.includes(t)}Sa(){var t;if(this.ka("$current_url")&&this.ka("$pathname")&&null!=v&&v.pathname)return""+(null!==(t=v.origin)&&void 0!==t?t:"")+v.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}},j_=Tn("[RemoteConfig]"),U_=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 j_.info("Using preloaded remote config",this.remoteConfig),void this.Ta(this.remoteConfig);if(this._instance.Ma())return void j_.warn("Remote config is disabled. Falling back to local config.");this.xa(t=>{if(!t)return j_.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){j_.error("Error loading remote config",t),this.Ta()}}Ta(t,e){!t&&e&&(0===e.statusCode?e.error||j_.warn("Failed to fetch remote config from PostHog."):j_.error("Failed to fetch remote config from PostHog."));try{this._instance.Ta(t?{ok:!0,config:t}:{ok:!1})}catch(t){j_.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){j_.error("Error loading feature flags",t)}}},H_=["fatal","error","warning","log","info","debug"],z_=!!f||!!c,W_="text/plain",V_=!1,G_=(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:"")},Z_=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),o=n[0],a=n[1],l=s({},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=Un(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},Q_=t=>{if(t.Ia)return t.Ia;var e=t.data,i=t.compression;if(e){if(i===af.GZipJS){var r=Xo(ta(Bn(e)),{mtime:0});return{contentType:W_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===af.Base64){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Bn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(Bn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=Bn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},J_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:Z_(t.url,{compression:af.Base64}),encodedBody:Q_(s({},t,{compression:af.Base64,Ia:void 0}))}:{url:G_(t.url,"compression"),encodedBody:Q_(s({},t,{compression:void 0,Ia:void 0}))};try{e=Q_(t)}catch(e){if(Qr(t.compression,Hn(t.url,"compression")))return Cn.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Qr(t.compression,Hn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Zr(new Uint8Array(i)):ArrayBuffer.isView(i)&&Zr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(V_=!0,r()):{url:t.url,encodedBody:e}},K_=t=>{try{return J_(t)}catch(e){return Cn.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Y_=function(){var t=a(function*(t){var e=yield tn(Bn(t.data),ra.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return s({},t,{Ia:{contentType:W_,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),X_=/Failed to fetch|NetworkError|Load failed/i,tb=t=>"TypeError"===(null==t?void 0:t.name)&&X_.test((null==t?void 0:t.message)||""),eb=t=>{var e=K_(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},o=n.contentType,a=n.body,l=n.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(p){var v=new p;h={signal:v.signal,timeout:setTimeout(()=>{var e;d=!0,v.abort(ar("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var f=e=>{d&&"AbortError"===(null==e?void 0:e.name)||tb(e)?Cn.warn(e):Cn.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;c(i,s({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){Cn.error(t)}null==t.callback||t.callback(r)})).catch(f).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),f(t)}}},ib=t=>{try{var e,i=J_(t),r=i.url,n=i.encodedBody,o=null!=n?n:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(h.sendBeacon(r,u))return;var d=Ce(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Ce(d)&&d.length>1&&(null!=l?l:0)>16384){var v=Math.ceil(d.length/2),c=e=>Ce(t.data)?e:s({},t.data,{batch:e});return ib(s({},t,{data:c(d.slice(0,v))})),void ib(s({},t,{data:c(d.slice(v))}))}Cn.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),eb(s({},t,{Ea:!0}))}catch(t){Cn.warn("Beacon send failed",t)}},rb=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return Z_(i===af.GZipJS?G_(t,"compression"):t,s({},n?{[n]:Date.now().toString()}:{},i===af.GZipJS?{}:{compression:i}))},nb=[];c&&nb.push({transport:"fetch",method:eb}),f&&nb.push({transport:"XHR",method(t){var e=K_(t);if(e){var i=new f,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!=h&&h.sendBeacon&&nb.push({transport:"sendBeacon",method:ib});var sb=class{constructor(t,e){this.Ra=!0,this.Aa=[],this.Pa=Ze((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,Cn.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(s({},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&&Ce(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){Cn.error(t)}}Da(){clearTimeout(this.Oa),this.Oa=void 0}La(){var t={};return Mn(this.Aa,e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;Ie(t[n])&&(t[n]=s({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)}),this.Aa=[],t}},ob=class{constructor(t){this._instance=t,this.qa=!1,this.ja=3e3,this.Aa=[],this.Aa=[],this.Ba=!0,!Ie(l)&&"onLine"in l.navigator&&(this.Ba=l.navigator.onLine,this.Ha=()=>{this.Ba=!0,this.za()},this.Ua=()=>{this.Ba=!1},Ln(l,"online",this.Ha),Ln(l,"offline",this.Ua))}get length(){return this.Aa.length}retriableRequest(t){var e=t.retriesPerformedSoFar,r=n(t,i);$e(e)&&(r.url=Z_(r.url,{retry_count:e})),this._instance._send_request(s({},r,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.cs(s({retriesPerformedSoFar:e},r));0===t.statusCode&&Cn.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==r.callback||r.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)"),Cn.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(l)||(this.Ha&&(l.removeEventListener("online",this.Ha),this.Ha=void 0),this.Ua&&(l.removeEventListener("offline",this.Ua),this.Ua=void 0)),this.Aa)){var e=t.requestOptions;try{this._instance._send_request(s({},e,{transport:"sendBeacon"}))}catch(t){Cn.error(t)}}this.Aa=[]}},ab=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(){Ln(l,"scroll",this.Ga,{capture:!0}),Ln(l,"scrollend",this.Ga,{capture:!0}),Ln(l,"resize",this.Ga)}scrollElement(){var t;if(!this.Ja)return null==l||null==(t=l.document)?void 0:t.documentElement;for(var e of Ce(this.Ja)?this.Ja:[this.Ja]){var i,r=null==l||null==(i=l.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 l?"y"===t?l.scrollY||l.pageYOffset||(null==(e=l.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:l.scrollX||l.pageXOffset||(null==(i=l.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Qa("y")}scrollX(){return this.Qa("x")}},lb=t=>Ba(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),ub=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({[Ot]:i})}},this._instance=t,this.tl=e,this.Ya=i,this.Xa=r||lb,this.tl.onSessionId(this.Te)}Ka(){return this.Ya.props[Ot]}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(On(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+fe(i)]=e}),t}},hb=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={}}},db=Tn("[SessionId]"),vb=864e5,cb=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 hb,this.ll=(t,e)=>!(!$e(t)||!$e(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||Ff,this.dl=i||Ff;var n=this._n.persistence_name||this._n.token;if(this._sessionTimeoutMs=1e3*Ze(this._n.session_idle_timeout_seconds||1800,60,36e3,db.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=ep.di(this.cl),o=ep.di(this.fl);s&&!o?this.Ie=s:ep.hi(this.cl),ep.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&&ep.si()}ml(t){t!==this.Ie&&(this.Ie=t,this.pl()&&ep.ui(this.cl,t))}yl(){return this.Ie?this.Ie:this.pl()?ep.di(this.cl):null}bl(t){var e=this.rl;return!Pe(e)&&!Pe(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({[Z]:[e,t,i]}))}wl(){var t,e=null==(t=this._n)?void 0:t.persistence_save_debounce_ms;return $e(e)&&e>0}kl(){this.wl()?this.Ya.refreshKey(Z):(this.Ya.flush(),this.Ya.load())}Sl(){var t;if(!Pe(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({[Z]:[this._sessionActivityTimestamp,null!==(t=this.Bt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ya.flush())}}Cl(){var t=this.xl()[0],e=$e(t)?t:0,i=$e(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[Z];return Ce(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 db.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void db.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&&l&&(l.removeEventListener(se,this.ol,{capture:!1}),this.ol=void 0),this.sl=[]}gl(){this.ol=()=>{this.Sl(),this.pl()&&ep.hi(this.fl)},Ln(l,se,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(Pe(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>vb),p=c?f:$e(u)&&Math.abs(r-u)>vb,g=!1,m=h,y=!l||!!c,_=l,b=!y&&!t&&this.ll(r,d);if(b){(b=this.Tl(r))||db.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.xl();l=w[1],u=w[2]}if(y||b||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.hl(),v=this.dl(),db.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.ul=void 0,g=!0}else v||(v=this.dl(),g=!0),(m=m||l!==_)&&(db.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=$e(d)&&t&&!p?d:r,x=$e(u)?u:(new Date).getTime();this.ml(v),this._l(l,S,x),t||this.vl();var C={noSessionId:y,activityTimeout:b,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))}},fb=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&de(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>de(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function pb(){return pb=a(function*(){var t=null==h?void 0:h.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return Re(i)&&i.length>0?i:void 0}catch(t){return void Cn.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),pb.apply(this,arguments)}var gb="custom",mb="i.posthog.com",yb=/^\/static\//,_b=["/s/","/e/","/i/"],bb=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("."+mb,".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":gb),this.Il[this.apiHost]}El(t){if(yb.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&&_b.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===gb)return this.Al(t,e,this.apiHost+e);var r=mb+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)}}},wb=Tn("[PostHog ExternalIntegrations]"),kb={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Sb=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 wb.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(kb[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()}}},xb=class{constructor(t,e){this.A=t,this.Hs=e,this.Fl=new Map,this.Js=!1}add(t){var e=this;return a(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&&Te(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)}}},Cb=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)}},Tb="extensionsRemoteConfig",Eb=class{constructor(t){this.instance=t,this.Js=!1,this.A=Cn,this.$l=t.Dl,this.kv=new Cb(t),this.onEvent=t=>_f(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 _f(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.Ll.on(Tb,e);return this.$l&&e(this.$l),_f(i)},this.Nl=new xb(Cn.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(S);return"string"==typeof t?t:void 0}get library(){return{name:ra.LIB_NAME,version:ra.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 a(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 _f(this.instance.ql(t))}handleRemoteConfig(t){this.Js||(this.$l=t,this.instance.Ll.emit(Tb,t))}sendRequest(t,e){var i=this;return a(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?Z_(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?me.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())}},Mb={},Ib=0,Rb=()=>{},Ab='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Pb="Surveys module not available",Ob="sanitize_properties is deprecated. Use before_send instead",Fb="Invalid value for property_denylist config: ",$b=/^[A-Za-z0-9_-]{1,400}$/,Db=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Lb=["token","distinct_id",Bt],Nb="posthog",qb=!z_&&-1===(null==m?void 0:m.indexOf("MSIE"))&&-1===(null==m?void 0:m.indexOf("Mozilla")),Bb=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},jb=t=>{var e;return s({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Dn(null==d?void 0:d.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Rb,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:v&&Re(null==v?void 0:v.search)&&-1!==v.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==l||null==(e=l.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){Cn.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:re,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Rb},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:cs,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:Bb(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))},Ub=[["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"]],Hb=t=>{var e={};for(var i of Ub){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),Re(o)&&Ie(t.asset_host)&&(s.asset_host=o)),Ce(t.property_blacklist)&&(Ie(t.property_denylist)?s.property_denylist=t.property_blacklist:Ce(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Cn.error(Fb+t.property_denylist)),s},zb=class{constructor(){this.__forceAllowLocalhost=!1}get jl(){return this.__forceAllowLocalhost}set jl(t){Cn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Wb=(t=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(Ff());this.register({distinct_id:i,$device_id:i}),t.set_property(Pt,ee)}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 zb,this.Ql=!1,this.version=ra.LIB_VERSION,this.Kl=new Set,this.Xl="",this.Ll=new hb,this.Fl=[],this.Yl=[],this.Vl=!1,this.Wl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=jb(),this.SentryIntegration=__,this.sentryIntegration=t=>function(t,e){var i=y_(t,e);return{name:m_,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 ab(this),this.pageViewManager=new b_(this),this.rateLimiter=new B_(this),this.requestRouter=new bb(this),this.consent=new h_(this),this.externalIntegrations=new Sb(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=Re(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Re(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>Cn.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==Nb){var n,s=null!==(n=Mb[r])&&void 0!==n?n:new t;return s._init(e,i,r),Mb[r]=s,Mb[Nb][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,n,o;void 0===e&&(e={});var a,u=Re(t)?t.trim():"";if(!u)return Cn.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==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=jb(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=jb(e.defaults),d=Hb(e),v=In({},h,d,{name:i,token:u});Ee(h.rageclick)&&Ee(d.rageclick)&&(v.rageclick=In({},h.rageclick,d.rageclick)),Ee(h.session_recording)&&Ee(d.session_recording)&&(v.session_recording=In({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&Cn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:af.GZipJS;var c=this.Zl();if(this.persistence=new $_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new $_(s({},this.config,{persistence:"sessionStorage"}),c,!1),this.Xl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&ep.si()){var f=ep.di(this.Xl);Ce(f)&&f.forEach(t=>{Re(t)&&this.Kl.add(t)})}else ep.hi(this.Xl);var p=s({},this.persistence.props),g=s({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.au=new sb(t=>this.lu(t),this.config.request_queue_config),this.uu=new ob(this),this.__request_queue=[];var m=this.zl();m||(this.sessionManager=new cb(this),this.sessionPropsManager=new ub(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?(Cn.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.vu(m)},0)):(Cn.info("Initializing extensions synchronously"),this.vu(m)),ra.DEBUG=ra.DEBUG||this.config.debug,ra.DEBUG&&Cn.info("Starting in debug mode",{this:this,config:e,thisC:s({},this.config),p:p,s:g}),!this.config.identity_distinct_id||null!=(r=e.bootstrap)&&r.distinctID||(e.bootstrap=s({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(n=e.bootstrap)?void 0:n.distinctID;if(this.Vl=!!y&&!Ae(y),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var _=e.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(Pt);if(e.bootstrap.isIdentifiedID&&null!=b&&b!==_&&"anonymous"===w)this.identify(_);else if(e.bootstrap.isIdentifiedID&&null!=b&&b!==_&&"identified"===w)Cn.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(Ff()),S=e.bootstrap.isIdentifiedID?k:_;this.persistence.set_property(Pt,e.bootstrap.isIdentifiedID?ie:ee),this.register({distinct_id:_,$device_id:S})}}if(m)this.register_once({distinct_id:qt,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(Ff());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(Pt,ee)}return Ln(l,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?g_(this,()=>this.cu()):this.cu(),Te(this.config._onCapture)&&this.config._onCapture!==Rb&&(Cn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&Cn.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 pb.apply(this,arguments)}().then(t=>{t&&this.register({[x]:t})}).catch(Rb),this}fu(t){var e=t;return Re(e.name)&&Te(e.setup)}pu(t,e){this.fu(t)?e.push(()=>{this.gu().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{Cn.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)),Te(this.featureFlags.onReloading)&&Te(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,n,o,a,l,u,h=performance.now(),d=s({},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!==(n=this.logs)&&void 0!==n?n: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,c_)),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){Cn.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",[Ut]:r}),this.config.__preview_deferred_init_extensions&&Cn.info("PostHog extensions initialized ("+r+"ms)")}Ta(t){var e;if(!d||!d.body)return Cn.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=ve(r.supportedCompression,af.GZipJS)?af.GZipJS:ve(r.supportedCompression,af.Base64)?af.Base64:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.iu?this.iu:re}),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){Cn.critical("`loaded` function failed",t)}if(this.wu(),this.config.internal_or_test_user_hostname&&null!=v&&v.hostname){var t=v.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 U_(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()&&En(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(ae),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.au)||r.unload(),null==(n=this.uu)||n.unload()):this.xu()&&this.capture(ae,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?qb?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=s({},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,n=s({},t);n.timeout=n.timeout||6e4;var o,a,l,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Ie(n.compression)&&n.data&&(n.compression=af.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(Ce(o=n.data)?o:[o]).map(t=>s({},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"===n.timestampMode&&(n.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),Ce(t)?t.map(t=>s({},t,{sent_at:e})):s({},t,{sent_at:e})}(n.data))),n.url=rb(n.url,n.method,n.compression,n.timestampMode);var v=nb.filter(t=>!n.disableTransport||!t.transport||!n.disableTransport.includes(t.transport)),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,t=>t.transport===d))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var f=t=>{try{c(t)}catch(t){tb(t)?Cn.warn(t):Cn.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===af.GZipJS&&g&&"undefined"!=typeof Promise&&!V_?Y_(n).then(t=>{f(t)}).catch(e=>{if(Jr(e))return V_=!0,void f(s({},n,{compression:void 0,url:rb(t.url,t.method,void 0,t.timestampMode)}));Kr(e)&&(V_=!0),f(n)}):c(n)})(s({},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){Ib++;try{var e,i=[],r=[],n=[];En(t,t=>{if(t)if(Ce(e=t[0]))n.push(t);else if(Te(t))try{t.call(this)}catch(e){Cn.error("Error executing queued PostHog call",t,e)}else Ce(t)&&"alias"===e?i.push(t):Ce(t)&&-1!==e.indexOf("capture")&&Te(this[e])?n.push(t):r.push(t)});var s=function(t,e){En(t,function(t){try{if(Ce(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){Cn.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{Ib--}}push(e){if(Ib>0&&Ce(e)&&Re(e[0])){var i=t.prototype[e[0]];Te(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 Re(e)&&Db.test(e)?{value:e,delivered:!1}:Ee(e)&&Re(e.value)&&Db.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 Re(e)&&Db.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(Re(t)&&$b.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,n,o,a,l,u,h,d,v,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.au){if(this.is_capturing())if(!Ie(t)&&Re(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&&!Re(null==e?void 0:e.$current_url)&&(Cn.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||Cn.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,_=or(null==i?void 0:i.uuid,Ff),b={uuid:_,event:t,properties:this.calculateEventProperties(t,e||{},y,_)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&f&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),p&&(b.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens);var w="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(b.$set=null==i?void 0:i.$set);var k=Ee(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[E]:null==k?void 0:k[E],T=Ce(null==e?void 0:e.$unset)?e.$unset:[],M=(null==i?void 0:i.$unset)||[],I=-1!==T.indexOf("$fbc")||-1!==M.indexOf("$fbc"),R=this.Tu(null==(n=g)?void 0:n.fbclid,C,x,I);R&&!0===b.properties.$process_person_profile&&R.pending&&!x&&!w&&(b.$set=s({[E]:R.value},b.$set));var A=null==i?void 0:i.$unset;A&&(b.$unset=A);var P=w?void 0:this.Eu(null==i?void 0:i.$set_once,t!==ue,t===le);if(P&&(b.$set_once=P),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,d=b,v=t=>Re(t)?t.slice(0,h):t,c=new Set,b=function t(e,i){if(e!==Object(e))return v?v(e):e;if(!c.has(e)){var r;if(c.add(e),Ce(e))r=[],En(e,e=>{r.push(t(e))});else{var n={};Mn(Ue(e)?Fn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),b.timestamp=y,Ie(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=m),w&&(b.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return Vr.forEach(r),e.forEach(r),i}(b.properties,Lb)),t===gf.DISMISSED||t===gf.SENT){var O=null==e?void 0:e[mf.SURVEY_ID],F=null==e?void 0:e[mf.SURVEY_ITERATION];Cf({id:O,current_iteration:F}),b.$set=s({},b.$set,{[ua({id:O,current_iteration:F},t===gf.SENT?"responded":"dismissed")]:!0})}else t===gf.SHOWN&&(b.$set=s({},b.$set,{[mf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===L_.SHOWN){var D=null==e?void 0:e[N_.TOUR_TYPE];D&&(b.$set=s({},b.$set,{[N_.TOUR_LAST_SEEN_DATE+"/"+D]:(new Date).toISOString()}))}var L=s({},b.properties.$set,b.$set);if(Me(L)||this.setPersonPropertiesForFlags(L),!Oe(this.config.before_send)){var N=this.ds(b);if(!N)return;(b=N).uuid=or(b.uuid,Ff)}var q=null!==(o=null==(a=b.$set)?void 0:a.$fbc)&&void 0!==o?o:Ee(null==(l=b.properties)?void 0:l.$set)?b.properties.$set.$fbc:void 0,B=null!=R&&R.pending&&q===R.value?R.value:void 0;this.Ll.emit("eventCaptured",b);var j=null!==(u=null==i?void 0:i._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),U=s({method:"POST",url:j,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(j)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},B?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.Mu(B)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||B?this.lu(U):this.au.enqueue(U),b}Cn.critical("This capture call is ignored due to client rate limiting.")}}else Cn.error("No event name provided to posthog.capture")}else Cn.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 Eb(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,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;this.persistence.syncCookieProperties(),this.Ru();var o=n?void 0:this.persistence.remove_event_timer(t),a=s({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.zl()&&(a[Bt]=!0),"$snapshot"===t){var u=s({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!Re(a.distinct_id)&&!Fe(a.distinct_id)||Ae(a.distinct_id))&&Cn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var h,c=function(t,e,i,r){var n,s,o,a;if(void 0===r&&(r=!1),!m)return{};var u,h=t?[...Ra,...e||[]]:[],d=Zi(m),c=d[0],f=d[1],p=function(t){for(var e=0;Yi.length>e;e++){var i,r=Yi[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["",""]}(m),g=p[0],y=p[1],_=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},b={};Ie(i)||(b.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==l||null==(o=l.screen)?void 0:o.width,C=null==l||null==(a=l.screen)?void 0:a.height,T=null==l?void 0:l.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 E,M=In(On({$os:c,$os_version:f,$browser:zi(m,navigator.vendor,_,b),$webview_app:g,$webview_app_version:y,$device:Qi(m),$device_type:Ji(m,w),$timezone:Ua(),$timezone_offset:Ha()}),{$current_url:zn(r?lr(null==v?void 0:v.href):null==v?void 0:v.href,h,Pa),$host:null==v?void 0:v.host,$pathname:null==v?void 0:v.pathname,$raw_user_agent:m.length>1e3?m.substring(0,997)+"...":m,$browser_version:Vi(m,navigator.vendor,_,b),$browser_language:La(),$browser_language_prefix:(E=La(),"string"==typeof E?E.split("-")[0]:void 0),$screen_height:null==l?void 0:l.screen.height,$screen_width:null==l?void 0:l.screen.width,$viewport_height:null==l?void 0:l.innerHeight,$viewport_width:null==l?void 0:l.innerWidth,$lib:Sn.LIB_NAME,$lib_version:Sn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Sn.SDK_DIST_CHANNEL&&(M.$sdk_dist_channel=Sn.SDK_DIST_CHANNEL),M}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime(),!0),p=f.windowId;a.$session_id=f.sessionId,a.$window_id=p}this.sessionPropsManager&&In(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&In(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(g=this.uu)?void 0:g.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===gb&&(a.$lib_custom_api_host=this.config.api_host),h="$pageview"!==t||n?"$pageleave"!==t||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),a=In(a,h),"$pageview"===t&&d&&(a.title=d.title),!Ie(o)){var y=i.getTime()-o;a.$duration=parseFloat((y/1e3).toFixed(3))}m&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),b=this.sessionPersistence.properties(),w=a.$groups,k=_.$groups;Ee(w)&&!Me(w)&&(a.$groups=s({},Ee(k)?k:{},w)),Mn(["$referrer","$referring_domain"],t=>{t in _&&delete b[t]});var S={};if(this.Yl.length>0)for(var x of this.Yl.slice())try{In(S,x())}catch(t){Cn.error("Failed to produce browser extension event properties",t)}(a=In({},c,_,b,s({},S,a))).$is_identified=this._isIdentified(),Ce(this.config.property_denylist)?Mn(this.config.property_denylist,function(t){delete a[t]}):Cn.error(Fb+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(Cn.error(Ob),a=C(a,t));var T=this.Pu();return a.$process_person_profile=T,T&&!n&&this.Fu("_calculate_event_properties"),a}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&&(Cn.error(Ob),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||!ep.si())ep.hi(this.Xl);else{var e=[];this.Kl.forEach(t=>e.push(t)),e.length>0?ep.ui(this.Xl,e):ep.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:Pb}),()=>{})}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:Pb})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Pb})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Ef),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:Pb}}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:Pb})}$u(t){return!t||Ae(t)?(Cn.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(Cn.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())||(Cn.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 Cn.uninitializedWarning("posthog.identify");if(Fe(t)&&(t=t.toString(),Cn.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(C),this.register({distinct_id:t}));var u=(this.persistence.get_property("$user_state")||"anonymous")===ee,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(Pt,ie),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.aa(),this.capture(le,c,{$set:e||{},$set_once:i||{}}),this.ru=wa(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(d){this.persistence.set_property(Pt,ie);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=wa(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=wa(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):Cn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(Ce(t)?t:[t]).filter(t=>Re(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 n=this.getGroups(),o=n[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:s({},n,{[t]:e})}),(o||i)&&this.Pu()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(ue,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}else Cn.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=De(t)?t:null==t?void 0:t.resetDeviceID,i=De(t)||null==t?void 0:t.bootstrap;this.Du(e,!1,i)}Du(t,e,i){var r,n,o,a;if(void 0===e&&(e=!1),Cn.info("reset"),!this.__loaded)return Cn.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.su)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.Ma());var u=this.get_property(S),h=this.get_property(x),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,k,C,T,E,M,I;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==(_=this.featureFlags)||_.reset(),null==(b=this.conversations)||b.reset(),null==(w=this.logs)||w.reset(),null==(k=this.metrics)||k.reset(),null==(C=this.persistence)||C.set_property(Pt,ee),null==(T=this.sessionManager)||T.resetSessionId(),this.ru=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:qt,$device_id:null},"");else{var R=this.config.get_device_id(Ff());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Ie(h)||this.register({[x]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.zl()||(null==(I=this.persistence)||I.set_property(Pt,i.isIdentifiedID?ie:ee),this.register({distinct_id:i.distinctID})),null==(E=this.featureFlags)||E.initialize(),!(Ie(l)||null!=(M=this.sessionManager)&&M.setBootstrapSessionId(l,!0))){var A=s({},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 a(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){Cn.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else Cn.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")?(Cn.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(C,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Cn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=s({},this.config);if(Ee(t)){var i,r,n,o,a,l,u,h,d,v,c,f,p;In(this.config,Hb(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 $_(s({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.nu(this.config.debug);De(m)&&(this.config.debug=m),De(this.config.debug)&&(this.config.debug?(ra.DEBUG=!0,jf.si()&&jf.ui("ph_debug",!0),Cn.info("set_config",{config:t,oldConfig:e,newConfig:s({},this.config)})):(ra.DEBUG=!1,jf.si()&&jf.hi("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ma()),null==(n=this.exceptionObserver)||n.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&&g_(this,Rb,!1)}}_overrideSDKInfo(t,e){ra.LIB_NAME=t,ra.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(s({},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:Nb;return e!==Nb&&(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?(Cn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ul(),this.Ou(Nt,!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 cb(this),this.pageViewManager=new b_(this),this.persistence&&(this.sessionPropsManager=new ub(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 Cn.warn(Ab)}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:qt,$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 Cn.warn(Ab)}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 h?fb(h,this.config.custom_blocked_useragents):void 0}ku(){d&&("visible"===d.visibilityState?this.tu||(this.tu=!0,this.capture(oe,{title:d.title},{send_instantly:!0}),this.eu&&(d.removeEventListener(ne,this.eu),this.eu=null)):this.eu||(this.eu=this.ku.bind(this),Ln(d,ne,this.eu)))}debug(t){!1===t?(null==l||l.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==l||l.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?(Cn.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&&!Oe(t[e]),o=i in t&&!Oe(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,Cn)}ds(t){var e;if(Oe(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(qe),r=Ce(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Oe(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Ne(t.event)?Cn.warn(o+". This can cause unexpected behavior."):Cn.info(o),null}n.properties&&!Me(n.properties)||Cn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Cn.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Oe(n.properties[a]))return Cn.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=De(t)&&!t,i=jf.si()&&"true"===jf.li("ph_debug");return!e&&(!!i||t)}},t.__defaultExtensionClasses={},t.qu=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),t);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Pn(t.prototype[e[i]])}(Wb,["identify"]);var Vb=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Ee(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}},Gb=Tn("[ExceptionAutocapture]"),Zb=Tn("[TracingHeaders]"),Qb=Tn("[Web Vitals]"),Jb=9e5,Kb=["CLS","FCP","INP","LCP"],Yb=["INP","LCP"],Xb=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],tw=Tn("[SessionRecording]"),ew=Tn("[Heatmaps]");function iw(t){return Ee(t)&&"clientX"in t&&"clientY"in t&&Fe(t.clientX)&&Fe(t.clientY)}var rw=Tn("[Product Tours]"),nw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(N))},sw=Tn("[SiteApps]"),ow="Error while initializing PostHog app with config id ",aw=(t,e)=>null!=t&&t.then?t.then(e):e(t),lw="SDK is not enabled or survey functionality is not yet loaded",uw="Disabled. Not loading surveys.",hw=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 bf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Oe(e))return bf.warn("Flags not loaded yet. Not loading surveys.");this.Gu=De(e)?e:e.length>0,bf.info("flags response received, isSurveysEnabled: "+this.Gu),this.loadIfEnabled()}}}setup(t){if(!this.Js)return this.Zu=t,aw(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)bf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)bf.info(uw);else if(t.cookielessMode&&this.Us.isOptedOut())bf.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(te),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 bf.error("PostHog Extensions not found.")}}}Ju(t,e){this.Js||(this._surveyManager=t(e),this._surveyEventReceiver=this.Us.createEventReceiver(),bf.info("Surveys loaded successfully"),this.Ku({isLoaded:!0}))}Qu(t,e){bf.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 bf.info(uw),t([]);var n=r.kv.get(gt);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=>bf.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 bf.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=>bf.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(lw)}))}th(t,e){var i;if(this.Js)return{surveys:[],context:{isLoaded:!1,error:lw}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?bf.error(n):e.error||bf.warn(n),this.Wu=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Wu=null;var s=e.json.surveys||[],o=s.filter(t=>wf(t)&&(pa(t)||kf(t)));return o.length>0&&(null==(i=this._surveyEventReceiver)||i.register(o)),t.kv.set({[gt]:s,[mt]: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(mt);return Fe(i)&&Date.now()-i>3e5}ih(){return Fe(this.Wu)&&3e5>Date.now()-this.Wu}markSurveyAsSeen(t,e){var i;Cf({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){bf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Oe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);bf.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(Oe(this._surveyManager))return{eligible:!1,reason:lw};var e="string"==typeof t?this.rh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}sh(t){if(Oe(this._surveyManager))return{eligible:!1,reason:lw};var e="string"==typeof t?this.rh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Oe(this._surveyManager))return bf.warn("init was not called"),{visible:!1,disabledReason:lw};var e=this.sh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Oe(this._surveyManager)?(bf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:lw})):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(Oe(this._surveyManager))bf.warn("init was not called");else{var n="string"==typeof t?this.rh(t):t;if(null!=n&&n.id)if(Tf.includes(n.type)){var s=null==d?void 0:d.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){bf.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.Vu.delete(o),this.Js||(bf.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),bf.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.Vu.add(o)}else this._surveyManager.renderSurvey(n,s,i);else bf.warn("Survey element not found")}else bf.warn("Surveys of type "+n.type+" cannot be rendered in the app");else bf.warn("Survey not found")}}displaySurvey(t,e){var i;if(Oe(this._surveyManager))bf.warn("init was not called");else{var r=this.rh(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=s({},r,{appearance:s({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==yf.Popover&&e.initialResponses&&bf.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 bf.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==yf.Inline?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else bf.warn("Survey not found")}}cancelPendingSurvey(t){Oe(this._surveyManager)?bf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function dw(t,e,i){if(Oe(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 vw=class{constructor(t){this._instance=t,this.oh=new Set,this.ah=new Set,this.uh=new hb,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 hb}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(!dw(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=>dw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&dw((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=>dw(t.text,e.text,e.text_matching||"exact")||dw(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;!Oe(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=>dw(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=Ce(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)}},cw=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.Activation?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 vw(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.Activation),a=this.$h(t,lf.Cancellation);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.Cancellation);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.Activation);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(s({},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}},fw=class extends cw{constructor(t){super(t)}sd(){return yt}od(){return _t}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 gf.SHOWN}Lh(t){var e;null==(e=this._instance)||e.getSurveys(t)}Zh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}zh(){return bf}Xh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}ad(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[_t]:t})}ld(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(_t)}ud(){return!1}Uh(t,e){var i;return this.Lh(t=>{i=t.find(t=>t.id===e)}),!i||ga(i)?t===gf.SHOWN?"consume":"ignore":t===gf.SHOWN?"persist":t===gf.DISMISSED||t===gf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},pw=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)}},gw=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 fw(this._instance)}},mw=null!=l&&l.location?Wn(l.location.hash,"__posthog")||Wn(location.hash,"state"):null,yw="_postHogToolbarParams",_w=Tn("[Toolbar]"),bw=Tn("[FeatureFlags]"),ww=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:Ce(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.vd||(bw.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)||Ce(t.flag_keys)||bw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.fd}},kw=Tn("[FeatureFlags]"),Sw=Tn("[FeatureFlags]",{debugEnabled:!0}),xw="\" failed. Feature flags didn't load in time.",Cw="connection_error",Tw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Ew=t=>{var e={};for(var i of Rn(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Mw="Refusing to render web experiment since the viewer is a likely bot",Iw={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ma(e,t),not_regex:(t,e)=>!ma(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Rw=Tn("[Conversations]"),Aw="Conversations not available yet.";function Pw(t,e){var i,r,n,o,a,l,u,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!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,f=Ie(c)?Math.max(v,2048):Math.max(v,c),p=s({},function(){var t="",e="";try{var i=null==h?void 0:h.userAgent;if(i){var r=Zi(i);t=r[0],e=r[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(un,t)?un[t]:t}(t);return s({},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!==(u=null==p?void 0:p["deployment.environment"])&&void 0!==u?u: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 Ow=["debug","log","warn","error","info"],Fw="console",$w="__posthogHandledLogsRequestError",Dw=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[$w]=!0,i},Lw=t=>!!t&&"object"==typeof t&&!0===t[$w],Nw={featureFlags:class{constructor(t){this.name="featureFlags",this.pd=!1,this.featureFlagEventHandlers=[],this.A=kw,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||!d||"hidden"===d.visibilityState||Date.now()-(null!==(t=this.Rd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Ad())},this.Ze=()=>{"visible"===(null==d?void 0:d.visibilityState)&&this.Id()},"get"in t?this.Us=t:(this._instance=t,this.Pd=new ww(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]"),aw(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 l&&Ln(l,"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&&d&&!Ie(t)&&t>0?t:void 0;e!==this.Ed&&(this.Bd(),Ie(e)||(this.Ed=e,this.Ad(),null!=d&&d.addEventListener&&Ln(d,ne,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==d||null==d.removeEventListener||d.removeEventListener(ne,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==l||l.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&&!Ce(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={[st]:f,[nt]:f,[lt]:p};for(var m of(t.$feature_flag_details&&(g[at]=f),[ut,At,ht]))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[st,lt,ut,dt]){var i=this.Wd(e);Ie(i)||(t[e]=i)}this.gd=t;var r=s({},t),n=this.Wd(nt);if(n)for(var o of Object.entries(n))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(At);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,n,o=null!=i&&i.merge&&null!==(r=this.Wd("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Wd("$feature_flag_payloads"))&&void 0!==n?n:{},l=s({},o,t),u=s({},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(at),e=this.Wd(dt),i=this.Wd(vt);if(!i&&!e)return t||{};var r=In({},t||{});for(var n of[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])]){var o,a,l=r[n],u=null==e?void 0:e[n],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[n],c=s({},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=s({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[n]=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:Ur(e[i])}})}getFlagVariants(){var t=this.Wd(nt),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 flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.pd=!0),i}getFlagPayloads(){var t=this.Wd(lt),e=this.Wd(vt);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:s({},e.initialPersonProperties,this.Wd("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Wd(ft),timezone:Ua()};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 n=this.Xd();Ie(n)||(i.flag_keys=n);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({[Rt]:[Cw]}),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?Cw:"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({[Rt]: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 Vn(this.Td,3)}iv(t){this.Td=Gn(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+xw)}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(),n=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,E;Ce(d[t])?d[t].push(l):d[t]=[l],this.ui(s({[Mt]:d},i?{[It]:i}:{}));var M=this.getFeatureFlagDetails(t),I=[...null!==(p=this.Wd("$feature_flag_errors"))&&void 0!==p?p:[]];Ie(o)&&I.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==(_=this._n.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.xd};Ie(null==M||null==(b=M.metadata)?void 0:b.has_experiment)||(R.$feature_flag_has_experiment=M.metadata.has_experiment),Ie(null==M||null==(w=M.metadata)?void 0:w.version)||(R.$feature_flag_version=M.metadata.version);var A=null!==(k=null==M||null==(S=M.reason)?void 0:S.description)&&void 0!==k?k:null==M||null==(x=M.reason)?void 0:x.code;A&&(R.$feature_flag_reason=A),null!=M&&null!=(C=M.metadata)&&C.id&&(R.$feature_flag_id=M.metadata.id),Ie(null==M?void 0:M.original_variant)&&Ie(null==M?void 0:M.original_enabled)||(R.$feature_flag_original_response=Ie(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(T=M.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==M||null==(E=M.metadata)?void 0:E.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.rv(R)}else i&&this.ui({[Mt]:d,[It]:i});if(n)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Ur(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+xw)}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 a(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+xw),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,n,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===o&&(o=kw);var a=((t,e)=>{var i=t.flags;return i?s({},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(Ce(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{[st]:u,[nt]:c,[ht]:!1}}var p=u,g=h,m=l;if(null!=n&&n.partialResponse){var y=Object.keys(p),_=g||{};p=s({},e,p),g=s({},i,_),y.forEach(t=>{var e;t in _||null==(e=g)||delete e[t]}),m=s({},r,m)}else if(t.errorsWhileComputingFlags)if(l){var b=new Set(Object.keys(l).filter(t=>{var e;return!(null!=(e=l[t])&&e.failed)}));p=s({},e,Object.fromEntries(Object.entries(p).filter(t=>b.has(t[0]))));var w=Object.fromEntries(Object.entries(g||{}).filter(t=>b.has(t[0])));g=s({},i,w),b.forEach(t=>{var e;t in w||null==(e=g)||delete e[t]}),m=s({},r,Object.fromEntries(Object.entries(m||{}).filter(t=>b.has(t[0]))))}else p=s({},e,p),g=s({},i,g),m=s({},r,m);return s({[st]:Object.keys(Ew(p)),[nt]:p||{},[lt]:g||{},[at]:m||{},[ht]:!0===t.minimalFlagCalledEvents},d?{[ut]:d}:{},v?{[At]:v}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(r)if(!1===(null==i?void 0:i.persist)){var n=!Ie(this.Hs.kv.get(nt));this.Vd=r,n||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([dt,vt]),this.jd(),void Sw.info("All overrides cleared");if(Ce(t))return this.ui({[dt]:Tw(t)}),this.jd(),void Sw.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[dt]=Ce(n)?Tw(n):n),s&&(r[vt]=s),Object.keys(r).length&&this.ui(r),!1===n&&!1===s?this.hi([dt,vt]):!1===n?this.hi(dt):!1===s&&this.hi(vt),this.jd(),!1===n?Sw.info("Flag overrides cleared"):n&&Sw.info("Flag overrides set",{flags:n}),void(!1===s?Sw.info("Payload overrides cleared"):s&&Sw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ui({[dt]:t}),this.jd(),void Sw.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,n=(this.Wd("$early_access_features")||[]).find(e=>e.flagKey===t),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};n&&(a.$early_access_feature_name=n.name),i&&(a.$feature_enrollment_stage=i);var l=s({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[st]:[t],[nt]:[t],[ct]:Object.keys(o)}),this.ui({[st]:Object.keys(Ew(l)),[nt]:l,[ct]:s({},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(ot);!r||e?this.av(t,i):t(r)}av(t,e){var i=this;return a(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({[ot]: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),n=null==t?void 0:t.$set_once,o={};if(n)for(var a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(o[a]=n[a]));this.ui({[ct]:s({},i,o,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=s({},this.Wd("$stored_person_properties")||{});t.forEach(t=>{delete i[t]}),this.ui({[ct]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.hi(ct),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Wd("$stored_group_properties")||{},r=s({},i);for(var n of Object.keys(t))r[n]=s({},i[n],t[n]);this.ui({[ft]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Wd("$stored_group_properties")||{};this.ui({[ft]:s({},e,{[t]:{}})})}else this.hi(ft)}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}}},qw={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=Vs,this.dv=void 0,this.vv=!1,this.je=(()=>{var t;if(null==d||!d.visibilityState||"visible"===d.visibilityState)return!0;var e=null==l||null==(t=l.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==d?void 0:d.visibilityState)&&(this.je=!0,null==(t=this.uv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw tw.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!=d&&d.addEventListener&&Ln(d,"visibilitychange",this.Ze)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.vv=!0,null==d||null==d.removeEventListener||d.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 l&&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),tw.info("starting")):(this.hv=Vs,this.stopRecording())}}gv(t){var e,i;if(this.pv)if("awaiting_config"!==this.hv&&"missing_config"!==this.hv&&(this.hv=Ks),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}),tw.error("could not load recorder",e)):void this.mv(t);this.hv=Vs})}}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(Q),null==(e=this.Ya)||e.unregister(H)}_v(t,e){if(Oe(t))return null;var i,r=Fe(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(tw.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,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=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!=n?n:o;Oe(a)&&this.bv();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register({[j]:s({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:s({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})})};n(),null==(e=this.dv)||e.call(this),this.dv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.wv(e),void this.fv()):(this.wv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.hv&&(this.hv="missing_config",tw.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):tw.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 tw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Oe(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 tw.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",tw.info("persisted remote config is stale, requesting fresh config before starting"),void new U_(this._instance).load()}this.hv=Ks,null==(i=(r=this.uv).setDocumentWasEverVisible)||i.call(r,this.je),this.uv.start(t)}else this.hv=Vs}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({[W]:!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?V:G]:!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()}}},Bw={autocapture:class extends Qy{constructor(t){super(new Vb(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&&(Cn.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,Cn.info("History API monitoring stopped")}monitorHistoryChanges(){l&&l.history&&(this.Rv("pushState"),this.Rv("replaceState"),this.Av(),this.Mv()&&this.Pv())}Rv(t){var e;if(l&&(null==(e=l.history[t])||!e.__posthog_wrapped__)){var i=this;yv(l.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Fv(t)})}}Cv(){var t=null==l?void 0:l.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}:Ee(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(oe,{navigation_type:t}),this.xv=e}catch(e){Cn.error("Error capturing "+t+" pageview",e)}}Av(){if(!this.Iv){var t=()=>{this.Fv("popstate")};Ln(l,"popstate",t),this.Iv=()=>{l&&l.removeEventListener("popstate",t)}}}Pv(){if(!this.Ev){var t=()=>{this.Fv("hashchange")};Ln(l,"hashchange",t),this.Ev=()=>{l&&l.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[A]),this.rageclicks=new Hy(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ee(this._n.capture_heatmaps)&&this._n.capture_heatmaps.flush_interval_milliseconds&&(t=this._n.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Oe(this._n.capture_heatmaps)?Oe(this._n.enable_heatmaps)?this.$v:this._n.enable_heatmaps:!1!==this._n.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ws)return;ew.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({[A]:i}),this.$v=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Pe;return this.Pe=void 0,t}qv(t){iw(t.originalEvent)&&this.an(t.originalEvent,"deadclick")}Ze(){this.Dv&&clearInterval(this.Dv),this.Dv="visible"===(null==d?void 0:d.visibilityState)?setInterval(this.za.bind(this),this.flushIntervalMilliseconds):null}Lv(){l&&d&&(this.jv=this.za.bind(this),Ln(l,se,this.jv),this.Bv=t=>this.an(t||(null==l?void 0:l.event)),Ln(d,"click",this.Bv,{capture:!0}),this.Hv=t=>this.zv(t||(null==l?void 0:l.event)),Ln(d,"mousemove",this.Hv,{capture:!0}),this.Uv=new f_(this.instance,v_,this.qv.bind(this)),this.Uv.startIfEnabledOrStop(),this.Wv=this.Ze.bind(this),Ln(d,ne,this.Wv),this.Ws=!0)}Nv(){var t;l&&d&&(this.jv&&l.removeEventListener(se,this.jv),this.Bv&&d.removeEventListener("click",this.Bv,{capture:!0}),this.Hv&&d.removeEventListener("mousemove",this.Hv,{capture:!0}),this.Wv&&d.removeEventListener(ne,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&&Kn(r)&&!Yn(r,"body");){if(r===i)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:l)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(ve(e,n))return!0;r=hs(r)}return!1}(os(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)&&iw(t)){var r=this.Gv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&ys(os(t),this.instance.config.rageclick)&&this.Is(s({},r,{type:"rageclick"})),this.Is(r)}}zv(t){!Jn(t.target)&&iw(t)&&(clearTimeout(this.Vv),this.Vv=setTimeout(()=>{this.Is(this.Gv(t,"mousemove"))},500))}Is(t){if(l){var e=this._n.disable_capture_url_hashes?lr(l.location.href):l.location.href,i=this._n.custom_personal_data_properties,r=zn(e,this._n.mask_personal_data_properties?[...Ra,...i||[]]:[],Pa);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:f_,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",s({$current_url:this.Pe.url},this.Pe.metrics.reduce((t,e)=>s({},t,{["$web_vitals_"+e.name+"_event"]:s({},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},Oe(null==t?void 0:t.name)||Oe(null==t?void 0:t.value))Qb.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Kv(i);if(!Ie(r)){var n=Fe(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Xv||this.Xv>t.value){this.Pe.navigationKey!==n&&(this.Zv(),this.Jv=setTimeout(this.Zv,this.flushToCaptureTimeoutMs)),Ie(this.Pe.navigationKey)&&(this.Pe.navigationKey=n,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=s({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Ee(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of Xb){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 Qb.error("Ignoring metric with value >= "+this.Xv,t)}}},this.Yv=()=>{if(!this.Ws){var t,e,i,r,n=!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;n=!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=n&&this.attributionMetrics.indexOf("INP")>-1?s({},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 Qb.error("web vitals callbacks not loaded - not starting")}},this.$v=!(null==(e=this._instance.persistence)||!e.props[D]),this.startIfEnabled()}get ec(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Ee(this.ec)?null==(t=this.ec)?void 0:t.web_vitals_allowed_metrics:void 0;return Oe(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||Kb:i}get flushToCaptureTimeoutMs(){return(Ee(this.ec)?this.ec.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Ee(this.ec)?this.ec.web_vitals_attribution:void 0;return De(t)?t?Kb:[]:Ce(t)?t:Yb}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=Ee(this.ec)?this.ec.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get Xv(){var t=Ee(this.ec)&&Fe(this.ec.__web_vitals_max_value)?this.ec.__web_vitals_max_value:Jb;return t>0&&6e4>=t?Jb:t}get isEnabled(){var t=null==v?void 0:v.protocol;if("http:"!==t&&"https:"!==t)return Qb.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ee(this.ec)?this.ec.web_vitals:De(this.ec)?this.ec:void 0;return De(e)?e:this.$v}startIfEnabled(){this.isEnabled&&!this.Ws&&(Qb.info("enabled, starting..."),this.do(this.Yv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Ee(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ee(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[D]:i}),this._instance.persistence.register({[B]: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?Qb.error("failed to load script",e):t()})}Kv(t){var e=t||(null==l?void 0:l.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?lr(e):e,r=this._instance.config.custom_personal_data_properties;return zn(i,this._instance.config.mask_personal_data_properties?[...Ra,...r||[]]:[],Pa)}Qb.error("Could not determine current URL")}}},jw={exceptionObserver:class{constructor(t){var e;this.Yv=()=>{var t;if(l&&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){Gb.error("failed to start",t),this.oc()}}},this._instance=t,this.ac=!(null==(e=this._instance.persistence)||!e.props[P]),this.wt=new Qe(s({},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:Gb})),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 Ee(t)?e=s({},e,t):(Ie(t)?this.ac:t)&&(e=s({},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?(Gb.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 Gb.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({[P]: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 Gb.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=Bg(),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=qr(this.vc()),this.cc=new Br(this.dc)}onConfigChange(){this.dc=qr(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({[O]: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(!Re(t)||0===t.trim().length)return void Dg.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)=>Lr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.gc(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&Dg.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.cc.add(s({[$r]:t,[Dr]:(new Date).toISOString()},r))}catch(t){Dg.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 Dg.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 Dg.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 Dg.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 Dg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.dc.enabled&&Oe(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 $g(t)||Dg.error("Failed to capture exception event. Dropping this exception.",t),void this.cc.clear()}}catch(t){return void($g(t)||Dg.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:s({},t,{$exception_steps:e})}catch(e){return Dg.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}bc(t){this.dc.enabled&&this.cc.add({[$r]:t,[Dr]:(new Date).toISOString()})}gc(t){return Ee(t)?s({},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 Re(i)&&i.length>0&&t.$exception_types.push(i),Re(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=_a[t.operator],r=e[t.key];if(!i||!r)return!1;var n=Ce(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 Dg.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&&Ng.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(Lg)})||t.some(t=>{var e=t.value;return Re(e)&&e.includes("isolatedAPI.contexts.topHostname")})&&!e.some(t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(Lg))}))}wc(t){return t.some(t=>{var e=t.value;return Re(e)&&qg.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!Oe(t)&&Ce(t)}}},Uw=s({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({[N]:!!e.productTours}),!nw(this._instance))return!this.xc&&Oe(null==(i=this.Ya)?void 0:i.props.ph_product_tours)||rw.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&&nw(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?rw.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),!Ce(this.Cc)||e){var i=this.Ya;if(i){var r=i.props[wt];if(Ce(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(nw(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||rw.warn(n):rw.error(n),void t([],{isLoaded:!1,error:n})}var s=Ce(e.json.product_tours)?e.json.product_tours:[];this.Cc=s,i&&i.register({[wt]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Cc,{isLoaded:!0})}getActiveProductTours(t){Oe(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(wt)}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)}}},Nw),Hw={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,i,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:s({},n(t,r),{properties:s({},t.properties,m?{$set:s({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},m)}:{},g?{$set_once:s({},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)||(sw.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)||(sw.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==d?void 0:d.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 h=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),h.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=>!Pe(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=()=>{h.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&&(sw.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,sw.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){sw.error(ow+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){sw.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){sw.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 sw.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 sw.error(ow+e,t)})};for(var a of s.siteApps)o()}else sw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},zw={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 Zb.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 Ce(t)?(Ce(this.jc)?this.jc.splice(0,this.jc.length,...t):this.jc=[...t],t.length>0?this.jc:void 0):(Ce(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()}}},Ww=s({surveys:class extends hw{constructor(t){var e;super(new gw(t),(e=t,{get projectToken(){return e.config.token},kv:new pw(e)})),this._instance=t}Yu(t,e){var i=e.query?Z_(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})})}}},Nw),Vw={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),Nn(this.instance.config))return!1;if(!l||!d)return!1;t=null!=t?t:l.location,i=null!=i?i:l.history;try{if(!e){try{l.localStorage.setItem("test","test"),l.localStorage.removeItem("test")}catch(t){return!1}e=null==l?void 0:l.localStorage}var r,n=mw||Wn(t.hash,"__posthog")||Wn(t.hash,"state"),s=n?An(()=>JSON.parse(atob(decodeURIComponent(n))))||An(()=>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(yw)||"{}")).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;!Oe(e)&&Te(e)?e(t,this.instance):_w.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==d||!d.getElementById("__POSTHOG_TOOLBAR__"));if(!l||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=s({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(l.localStorage.setItem(yw,JSON.stringify(s({},r,{source:void 0}))),2===this.Uc())this.Wc(r);else if(0===this.Uc()){var n;this.zc(1),null==(n=b.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return _w.error("[Toolbar] Failed to load",t),void this.zc(0);this.zc(2),this.Wc(r)}),Ln(l,"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)}}},Gw=s({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);Re(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(Mw);else if(!this._n.disable_web_experiments){if(Oe(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!Oe(e.conditions)&&t.Xc(e,i)&&t.Yc(e)}static Xc(e,i){var r;if(Oe(e.conditions)||Oe(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=Zn(i,n.href);return null==(s=e.conditions)||!s.url||Iw[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==l?void 0:l.location}static Yc(t){var e;if(Oe(t.conditions)||Oe(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];Cn.info("[WebExperiments] "+t,i)}Jc(e,i,r){this._is_bot()?t.Gc(Mw):"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 h&&this._instance?fb(h,this._n.custom_blocked_useragents):void 0}}},Nw),Zw=s({},Nw,qw,Bw,jw,Uw,Hw,Ww,zw,Vw,Gw,{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;Oe(e)||(De(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||Nn(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(te);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 Rw.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,Rw.info("Conversations loaded successfully")}catch(t){this.sf("Error completing conversations initialization",t)}else Rw.error("Cannot complete initialization: remote config is null")}sf(t,e){Rw.error(t,e),this._conversationsManager=null,this.ef=!1,this.if=!0}show(){this._conversationsManager?this._conversationsManager.show():Rw.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.tf&&!Pe(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Nn(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?Oe(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 a(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(Rw.warn(Aw),null)})()}getMessages(t,e){var i=this;return a(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(Rw.warn(Aw),null)})()}markAsRead(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Rw.warn(Aw),null)})()}getTickets(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Rw.warn(Aw),null)})()}requestRestoreLink(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Rw.warn(Aw),null)})()}restoreFromToken(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Rw.warn(Aw),null)})()}restoreFromUrlToken(){var t=this;return a(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Rw.warn(Aw),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=Mf,this.af=!1,this.lf=!1,this.uf=!1,this.A=Tn("[logs]"),this.hf=s({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(Lw)||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),l&&Ln(l,"online",this.gf)}bf(t,e,i,r){var n,s=Pw(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new gn(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},Fw);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==l||l.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;Oe(r)?this.Ff():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[q]:!!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[q])}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=Pw(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Sg(b.console[t])}catch(t){return 0}if(!r)return 0;e.cf.push(yv(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 Ow)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){Lw(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(te),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===ge.LogsQueue?t():void 0,setPersistedProperty(t,i){t===ge.LogsQueue&&e(null!=i?i:[])},gs:t=>this.gs(t),getLibraryId:()=>ra.LIB_NAME,getLibraryVersion:()=>ra.LIB_VERSION}}gs(t){return new Promise(e=>{if(Vn(this.Td,3))e({kind:"fatal",error:Dw(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:Dw(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:Dw(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=Gn(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,ra.LIB_NAME,t=>{this.Aa=t}),this.df.length>0&&this.Hf(t,this.df,this.Mf,Fw,t=>{this.df=t})}Hf(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=pn(s,fn(i,ra.LIB_NAME,ra.LIB_VERSION),r,ra.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,Oe(n)||(e.sessionStartTimestamp=n),Oe(s)||(e.lastActivityTimestamp=s)}if(null!=b&&null!=(t=b.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?lr(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=Tn("[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:()=>ra.LIB_NAME,getLibraryVersion:()=>ra.LIB_VERSION}}Fs(t,e){return new Promise(i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(o),i(t))},o=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(s({method:"POST",url:this.zf(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e,i=t.statusCode;n(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)}}});Wb.__defaultExtensionClasses=s({},Zw);var Qw=function(){ra.SDK_DIST_CHANNEL="npm";var t=Mb[Nb]=new Wb;return function(){function t(){t.done||(t.done=!0,qb=!1,Mn(Mb,function(t){t._dom_loaded()}))}null!=d&&d.addEventListener?"complete"===d.readyState?t():Ln(d,"DOMContentLoaded",t,{capture:!1}):l&&Cn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}(),Jw=Qw;export{af as Compression,D_ as DEFAULT_PRODUCT_TOUR_APPEARANCE,yf as DisplaySurveyType,Wb as PostHog,L_ as ProductTourEventName,N_ as ProductTourEventProperties,gf as SurveyEventName,mf as SurveyEventProperties,lf as SurveyEventType,hf as SurveyPosition,ff as SurveyQuestionBranchingType,cf as SurveyQuestionType,pf as SurveySchedule,df as SurveyTabPosition,vf as SurveyType,uf as SurveyWidgetType,Jw as default,Qw as posthog,H_ as severityLevels};
1
+ var t,e=["type"],i=["retriesPerformedSoFar"],r=["$set_once","$set"];function n(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 s(){return s=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},s.apply(null,arguments)}function o(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 a(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var s=t.apply(e,i);function a(t){o(s,r,n,a,l,"next",t)}function l(t){o(s,r,n,a,l,"throw",t)}a(void 0)})}}var l="u">typeof window?window:void 0,u="u">typeof globalThis?globalThis:l,h=null==u?void 0:u.navigator,d=null==u?void 0:u.document,v=null==u?void 0:u.location,c=null==u?void 0:u.fetch,f=null!=u&&u.XMLHttpRequest&&"withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:void 0,p=null==u?void 0:u.AbortController,g=null==u?void 0:u.CompressionStream,m=null==h?void 0:h.userAgent;function y(){return!(!l||!1===l.navigator.onLine)}var _="undefined"!=typeof globalThis?globalThis:l;_&&"undefined"==typeof self&&(_.self=_),_&&"undefined"==typeof File&&(_.File=function(){});var b=null!=l?l:{},w="$people_distinct_id",k="distinct_id",S="$device_id",x="$device_model",C="__alias",T="__cmpns",E="$fbc",M="$fbc_persistence",I="__timers",R="$autocapture_disabled_server_side",A="$heatmaps_enabled_server_side",P="$exception_capture_enabled_server_side",O="$error_tracking_suppression_rules",F="$error_tracking_capture_extension_exceptions",D="$web_vitals_enabled_server_side",L="$dead_clicks_enabled_server_side",N="$product_tours_enabled_server_side",q="$logs_capture_enabled_server_side",B="$web_vitals_allowed_metrics",j="$session_recording_remote_config",U="$session_recording_enabled_server_side",H="$replay_sample_rate",z="$replay_override_sampling",W="$replay_override_linked_flag",V="$replay_override_url_trigger",G="$replay_override_event_trigger",Z="$sesid",Q="$session_is_sampled",J="$session_past_minimum_duration",K="$session_recording_url_trigger_activated_session",Y="$session_recording_event_trigger_activated_session",X="$posthog_sr_group_event_trigger_",tt="$posthog_sr_group_url_trigger_",et="$posthog_sr_group_sampling_",it="$debug_first_full_snapshot_timestamp",rt="$sess_rec_flush_size",nt="$enabled_feature_flags",st="$active_feature_flags",ot="$early_access_features",at="$feature_flag_details",lt="$feature_flag_payloads",ut="$feature_flag_request_id",ht="$minimal_flag_called_events",dt="$override_feature_flags",vt="$override_feature_flag_payloads",ct="$stored_person_properties",ft="$stored_group_properties",pt="$groups",gt="$surveys",mt="$surveys_loaded_at",yt="$surveys_activated",_t="$surveys_activated_session",bt="$surveys_activated_timestamps",wt="ph_product_tours",kt="$product_tours_activated",St="$product_tours_activated_session",xt="$conversations_widget_session_id",Ct="$conversations_ticket_id",Tt="$conversations_widget_state",Et="$conversations_user_traits",Mt="$flag_call_reported",It="$flag_call_reported_session_id",Rt="$feature_flag_errors",At="$feature_flag_evaluated_at",Pt="$user_state",Ot="$client_session_props",Ft="$capture_rate_limit",$t="$initial_campaign_params",Dt="$initial_referrer_info",Lt="$initial_person_info",Nt="$epp",qt="$posthog_cookieless",Bt="$cookieless_mode",jt="$sdk_debug_extensions_init_method",Ut="$sdk_debug_extensions_init_time_ms",Ht="$sdk_debug_recording_script_not_loaded",zt="$sdk_debug_replay_event_trigger_status",Wt="$sdk_debug_replay_linked_flag_trigger_status",Vt="$sdk_debug_replay_matched_recording_trigger_groups",Gt="$sdk_debug_replay_pending_trigger_conditions",Zt="$sdk_debug_replay_remote_trigger_matching_config",Qt="$sdk_debug_replay_trigger_groups_count",Jt="$sdk_debug_replay_url_trigger_status",Kt="$sdk_debug_rrweb_attached",Yt="$sdk_debug_rrweb_start_attempted",Xt="$session_recording_start_reason",te="PostHog loadExternalDependency extension not found.",ee="anonymous",ie="identified",re="identified_only",ne="visibilitychange",se="beforeunload",oe="$pageview",ae="$pageleave",le="$identify",ue="$groupidentify",he=["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"],de=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return he.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function ve(t,e){return-1!==t.indexOf(e)}var ce=function(t){return t.trim()},fe=function(t){return t.replace(/^\$/,"")};function pe(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 ge=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}({}),me=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ye="min_length",_e="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"],we=["token"],ke=Object.prototype,Se=ke.hasOwnProperty,xe=ke.toString,Ce=Array.isArray||function(t){return"[object Array]"===xe.call(t)},Te=t=>"function"==typeof t,Ee=t=>t===Object(t)&&!Ce(t),Me=t=>{if(Ee(t)){for(var e in t)if(Se.call(t,e))return!1;return!0}return!1},Ie=t=>void 0===t,Re=t=>"[object String]"==xe.call(t),Ae=t=>Re(t)&&0===t.trim().length,Pe=t=>null===t,Oe=t=>Ie(t)||Pe(t),Fe=t=>"[object Number]"==xe.call(t)&&t==t,$e=t=>Fe(t)&&t>0,De=t=>"[object Boolean]"===xe.call(t),Le=t=>t instanceof FormData,Ne=t=>ve(be,t),qe=t=>ve(we,t);function Be(t){return null===t||"object"!=typeof t}function je(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Ue(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 We=[!0,"true",1,"1","yes"],Ve=t=>ve(We,t),Ge=[!1,"false",0,"0","no"];function Ze(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),Ze(null!=n?n:i,e,i,r))}var Qe=class{constructor(t){this.C={},this.I=t.I,this.R=Ze(t.bucketSize,0,100,t.A),this.O=Ze(t.refillRate,0,this.R,t.A),this.F=Ze(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",Ke="Android",Ye="Tablet",Xe="Android Tablet",ti="iPad",ei="Apple Watch",ii="Safari",ri="BlackBerry",ni="Samsung Internet",si="Chrome",oi="Chrome iOS",ai="Internet Explorer",li="Internet Explorer Mobile",ui="Opera",hi="Microsoft Edge",di="Firefox",vi="Firefox iOS",ci="Nintendo",fi="PlayStation",pi="Xbox",gi="Android Mobile",mi="Mobile Safari",yi="Windows",_i="Windows Phone",bi="Nokia",wi="Ouya",ki="Generic "+Je.toLowerCase(),Si="Generic "+Ye.toLowerCase(),xi="Konqueror",Ci="Oculus Browser",Ti="Vivaldi",Ei="Yandex",Mi="Whale",Ii="DuckDuckGo",Ri="Pale Moon",Ai="Waterfox",Pi="Brave",Oi="Claude",Fi="Codex",$i="ChatGPT",Di="Google Search App",Li=new RegExp("Version/(\\d+(\\.\\d+)?)"),Ni=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),qi=new RegExp(pi,"i"),Bi=new RegExp("PlayStation \\w+","i"),ji=new RegExp("Nintendo \\w+","i"),Ui=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?Pi:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&ve(t,"GSA/")?Di:ve(t," OPR/")&&ve(t,"Mini")?"Opera Mini":ve(t," OPR/")?ui:Ui.test(t)?ri:ve(t,"IEMobile")||ve(t,"WPDesktop")?li:ve(t,"OculusBrowser")?Ci:ve(t,"SamsungBrowser")?ni:ve(t,"Edge")||ve(t,"Edg/")?hi:ve(t,"Vivaldi/")?Ti:ve(t,"YaBrowser/")?Ei:ve(t,"Whale/")?Mi:ve(t,"DuckDuckGo/")||ve(t,"Ddg/")?Ii:ve(t,"Claude/")?Oi:ve(t,"Codex/")?Fi:ve(t,"ChatGPT/")?$i:ve(t,"FBIOS")?"Facebook Mobile":ve(t,"UCWEB")||ve(t,"UCBrowser")?"UC Browser":ve(t,"CriOS")?oi:ve(t,"CrMo")||ve(t,si)?si:ve(t,Ke)&&ve(t,ii)?gi:ve(t,"FxiOS")?vi:ve(t.toLowerCase(),xi.toLowerCase())?xi:ve(t,"Brave/")?Pi:((t,e)=>e&&ve(e,"Apple")||function(t){return ve(t,ii)&&!ve(t,si)&&!ve(t,Ke)}(t))(t,e)?ve(t,Je)?mi:ii:ve(t,"PaleMoon/")?Ri:ve(t,"Waterfox/")?Ai:ve(t,di)?di:ve(t,"MSIE")||ve(t,"Trident/")?ai:ve(t,"Gecko")?di:"")},Wi={[li]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[hi]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[si]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[oi]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ii]:[Li],[mi]:[Li],[ui]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[di]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[vi]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[xi]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ri]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Li],[gi]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ni]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[Ci]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Ti]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Ei]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Mi]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Pi]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Oi]:[Ni],[Fi]:[Ni],[$i]:[Ni],[Ii]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Ri]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ai]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Di]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[ai]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Vi=function(t,e,i,r){var n=Wi[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},Gi=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[pi,t&&t[1]||""]],[new RegExp(ci,"i"),[ci,""]],[new RegExp(fi,"i"),[fi,""]],[Ui,[ri,""]],[new RegExp(yi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[_i,""];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"),[yi,r]}return[yi,""]}],[/((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]?[Ke,[t[2],t[3],t[4]||"0"].join(".")]:[Ke,""]],[/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",""]]],Zi=function(t){for(var e=0;Gi.length>e;e++){var i=Gi[e],r=i[1],n=i[0].exec(t),s=n&&(Te(r)?r(n,t):r);if(s)return s}return["",""]},Qi=function(t){return ji.test(t)?ci:Bi.test(t)?fi:qi.test(t)?pi:new RegExp(wi,"i").test(t)?wi:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?_i:/iPad/.test(t)?ti:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ei:Ui.test(t)?ri:/(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)?Ke:Xe:new RegExp("(pda|Mobile)","i").test(t)?ki:new RegExp(Ye,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?Si:""},Ji=function(t,e){var i,r,n,s,o=Qi(t);return o===ti||o===Xe||"Kobo"===o||"Kindle Fire"===o||o===Si?Ye:o===ci||o===pi||o===fi||o===wi?"Console":o===ei?"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:Ye:"Desktop"},Ki=/\bFBAV\/(\d+(?:\.\d+)*)/i,Yi=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Ki],[/\bFBAN\/EMA\b/i,"Facebook Lite",Ki],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Ki],[/\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]",tr="[Unserializable]";function er(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 ir,rr,nr,sr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function or(t,e){return"string"==typeof(i=t)&&sr.test(i)?t:e();var i}function ar(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 lr(t){return t?t.split("#")[0]:t}function ur(t,e){var i=setTimeout(t,e);return null!=i&&i.unref&&(null==i||i.unref()),i}function hr(t,e,i){return dr.apply(this,arguments)}function dr(){return(dr=a(function*(t,e,i){var r;try{return yield Promise.race([t,new Promise((t,n)=>{r=ur(()=>{try{null==i||i(),t()}catch(t){n(t)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function vr(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return nr&&i.length===rr?nr:(rr=i.length,nr=i.reduce((i,r)=>{ir||(ir={});var n=ir[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,ir[r]=[l,u];break}}return i},{}))}}var cr=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 a(function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&Ce(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)),s({},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 a(function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i})()}convertToExceptionList(t,e){var i,r,n,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!==(n=t.synthetic)&&void 0!==n&&n}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,s({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:vr(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 s({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}};function fr(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 pr=(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]},gr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,mr=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yr=/\((\S*)(?::(\d+))(?::(\d+))\)/,_r=(t,e)=>{var i=gr.exec(t);if(i)return fr(e,i[1],"?",+i[2],+i[3]);var r=mr.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=yr.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=pr(r[1]||"?",r[2]);return fr(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,wr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kr=(t,e)=>{var i=br.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=wr.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=pr(s,n);return fr(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Sr=/\(error: (.*)\)/;var xr=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Re(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")}},Cr=class{match(t){return Ue(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}},Tr=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 s({},r,{stack:null!==(i=this.Xi(t))&&void 0!==i?i:r.stack,synthetic:!0})}Ki(t){return Re(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(Re(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Er=/^(?:[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(Er);return r&&(e=r[1],i=r[2]),[e,i]}},Ir=["fatal","error","warning","log","info","debug"];function Rr(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 Ar=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 Re(e)&&!Ae(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: "+Rr(t)}isSeverityLevel(t){return Re(t)&&!Ae(t)&&Ir.indexOf(t)>=0}getStack(t){try{return Re(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Re(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(Ue(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},Pr=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: "+Rr(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},Or=class{match(t){return Be(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 Be(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}},$r="$message",Dr="$timestamp",Lr=new Set([$r,Dr]),Nr={enabled:!0,max_bytes:32768};function qr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Nr.enabled,max_bytes:jr(t.max_bytes,Nr.max_bytes)}:s({},Nr)}var Br=class{constructor(t){this.$n=[],this.Bn=0,this._n=qr(t)}setConfig(t){this._n=qr(t),this.Hn()}add(t){var e=function(t){var e;try{e=pe(t)}catch(t){return}try{var i=JSON.parse(e);if(!Ee(i))return;var r=i,n=r[$r],s=r[Dr];if(!Re(n)||0===n.trim().length)return;if(!Re(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 Ur=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 Wr,Vr=["$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"],Gr="NativeGzipValidationError",Zr=t=>t.length>=2&&31===t[0]&&139===t[1],Qr=(t,e)=>t===me.GZipJS||e===me.GZipJS||"gzip"===e,Jr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Kr=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Jr(t)||e===Gr},Yr=t=>{throw ar(Gr,"Native gzip produced invalid output: "+t)},Xr=function(){var t=a(function*(t,e){18>t.size&&Yr("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Zr(i)&&8===i[2]||Yr("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Wr)return Wr;Wr=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Wr[t]=e>>>0}return Wr})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Yr("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Yr("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function tn(t,e,i){return en.apply(this,arguments)}function en(){return en=a(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),s=n.writable.getWriter(),o=s.write(r).then(()=>s.close()).catch(function(){var t=a(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,o]))[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}}),en.apply(this,arguments)}var rn={}.propertyIsEnumerable;function nn(t,e){try{return an(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function sn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,De(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:er(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?er(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return sn(a.call(t),e,i,r+1)}catch(t){}return Ce(t)?{arrayValue:{values:on(t,e,i,r+1)}}:{kvlistValue:{values:an(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:er(String(t))}}function on(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(Oe(a))continue;n.push(sn(a,e,i,r))}catch(t){n.push({stringValue:tr})}return t.length>o&&n.push({stringValue:Xi}),n}function an(t,e,i,r){var n=[];for(var s in t)if(rn.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(Pe(o)||Ie(o))continue;n.push({key:er(s),value:sn(o,e,i,r)})}catch(t){n.push({key:er(s),value:{stringValue:tr}})}}return n}function ln(t,e,i){return s({},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 un={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var hn={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}},dn=hn.info;function vn(t){try{return er(String(t))}catch(t){return tr}}function cn(t,e,i,r){var n,o=hn[t.level||"info"]||dn,a=o.text,l=o.number,u=(void 0===(n=Fe(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),h={};e.distinctId&&(h.posthogDistinctId=e.distinctId),e.sessionId&&(h.sessionId=e.sessionId),e.windowId&&(h["window.id"]=e.windowId),Oe(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Oe(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=s({},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=tr}Object.defineProperty(d,f,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:a,body:{stringValue:vn(t.body)},attributes:nn(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 fn(t,e,i){return ln(t,e,i)}function pn(t,e,i,r){return{resourceLogs:[{resource:{attributes:nn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var gn=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(ge.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:cn(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=Ce(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 a(function*(){if(!t._instance.isDisabled)return t.Gn||(t.Gn=t.fs().finally(()=>{t.Gn=null})),t.Gn})()}fs(){var t=this;return a(function*(){var e;t.us();var i=null!==(e=t._instance.getPersistedProperty(ge.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=pn(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(ge.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}ys(t){var e=this;return a(function*(){var i,r=Math.max(0,t-e.Zn),n=null!==(i=e._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(ge.LogsQueue,n.slice(r)),yield e.Wn()})()}ps(){return fn(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion())}cs(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(ge.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(ge.LogsQueue,i),this.ts>i.length?this.bs():this.hs()}}bs(t){void 0===t&&(t=this.rs),this._s||(this._s=ur(()=>{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(ge.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return a(function*(){e.us();var i=e.flush().catch(()=>{});void 0!==t?yield hr(i,t):yield i})()}flushWithTimeout(t){var e=this;return a(function*(){var i=e.flush();yield hr(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)}},mn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function yn(t){return String(t)+"000000"}function _n(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=a(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?s({},e.attributes):void 0,r=_n(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 n=this.Ss.get(r);if(!n){if(!this.As())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Ss.set(r,n)}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(n,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(mn.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,mn)]+=1}}ds(t){var e=this._n.beforeSend;if(!e)return t;var i=Ce(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=ur(()=>{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 a(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 ln(t,e,i)}(this._n,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:nn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}$s(t){var e=yn(Date.now()),i=new Map;for(var r of t.values()){var n,o=_n(r.type,r.name,r.unit,void 0),a=i.get(o);a||(a=s({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=nn(null!==(n=r.attributes)&&void 0!==n?n:{},this.A),u=yn(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:mn})}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 wn(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var kn="0.8.2",Sn={DEBUG:!1,LIB_VERSION:kn,LIB_NAME:"browser-common",JS_SDK_VERSION:kn},xn=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];l&&(Sn.DEBUG||l.POSTHOG_DEBUG||i)&&!Ie(l.console)&&l.console&&("__rrweb_original__"in l.console[e]?l.console[e].__rrweb_original__:l.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)=>xn(t+" "+e,i)};return r},Cn=xn("[PostHog.js]"),Tn=Cn.createLogger;function En(t,e){Ce(t)&&t.forEach(e)}function Mn(t,e){if(!Oe(t))if(Ce(t))t.forEach(e);else if(Le(t))t.forEach((t,i)=>e(t,i));else for(var i in t)Se.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 Rn(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 An=function(t){try{return t()}catch(t){return}},Pn=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){Cn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Cn.critical(t)}}},On=function(t){var e={};return Mn(t,function(t,i){(Re(t)&&t.length>0||Fe(t))&&(e[i]=t)}),e};function Fn(t){var e=s({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var $n=["herokuapp.com","vercel.app","netlify.app"];function Dn(t){var e=null==t?void 0:t.hostname;if(!Re(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of $n)if(i===r)return!1;return!0}function Ln(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 Nn(t){return"ph_toolbar_internal"===t.name}var qn=["localhost","127.0.0.1"],Bn=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>Ue(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 pe(t)}},jn=t=>{var e=null==d?void 0:d.createElement("a");return Ie(e)?null:(e.href=t,e)},Un=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(!Ce(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){Cn.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("=");Ce(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},Wn=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Vn=(t,e)=>t>=e&&y(),Gn=(t,e,i,r)=>{if(0===t){if(y()){var n=e+1;return n===i&&r(),n}return e}return 0};function Zn(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Te(r))return e;try{var n=r(e);return Re(n)&&n?n:e}catch(t){return Cn.error("Error in get_current_url, falling back to window.location.href",t),e}}function Qn(t){var e,i=null==l||null==(e=l.location)?void 0:e.href;return Ie(i)?void 0:Zn(t,i)}function Jn(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Kn(t){return!!t&&1===t.nodeType}function Yn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Xn(t){return!!t&&3===t.nodeType}function ts(t){return!!t&&11===t.nodeType&&Kn(t.host)}function es(t){return t?ce(t).split(/\s+/):[]}function is(t,e){var i=Qn(e);return!!(i&&t&&t.some(t=>i.match(t)))}function rs(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 es(e)}function ns(t){return Oe(t)?null:ce(t).split(/(\s+)/).filter(t=>Rs(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ss(t){var e="";return ws(t)&&!ks(t)&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;Xn(t)&&t.textContent&&(e+=null!==(i=ns(t.textContent))&&void 0!==i?i:"")}),ce(e)}function os(t){var e;return Ie(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var as=["a","button","form","input","select","textarea","label"];function ls(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 us(t,e){if(Ie(e))return!0;var i,r=function(t){if(e.some(e=>ls(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function hs(t){var e=t.parentNode;return!(!e||!Kn(e))&&e}var ds=[".ph-no-autocapture","[data-ph-no-autocapture]"],vs=["next","previous","prev",">","<"],cs=[...vs,"+","-","−","–"],fs=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ps=[".ph-no-deadclick",".ph-no-capture"],gs=[".ph-no-rageclick",".ph-no-capture"],ms=["","text","search","email","password","url","tel","number"];function ys(t,e){if(!l||_s(t))return!1;var i,r,n,s,o;if(De(e)?(i=!!e&&gs,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:gs,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||!Kn(t))&&(!!Yn(t,"textarea")||(Yn(t,"input")?ve(ms,(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 a=bs(t,!1).targetElementList;return!function(t,e){if(!1===t||Ie(t))return!1;var i;if(!0===t)i=vs;else{if(!Ce(t))return!1;if(t.length>10)return Cn.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=>fs(e,t)||fs(r,t))})}(r,a.map(t=>{var e;return{safeText:ss(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!us(a,i)}var _s=t=>!t||Yn(t,"html")||!Kn(t),bs=(t,e)=>{if(!l||_s(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!Yn(n,"body");)if(ts(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=hs(n);if(!s)break;if(e||as.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var o=l.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function ws(t){for(var e=new Set,i=0,r=t;r.parentNode&&!Yn(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=rs(r);if(ve(n,"ph-sensitive")||ve(n,"ph-no-capture"))return!1}if(ve(rs(t),"ph-include"))return!0;var s=t.type||"";if(Re(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Re(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 ks(t){return!!(Yn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Yn(t,"select")||Yn(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Ss=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}))$"),xs=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Cs=[16,15,14,13],Ts=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Es=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 Rs(t,e){if(void 0===e&&(e=!0),Oe(t))return!1;if(Re(t)){if(t=ce(t),e?Ss.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(xs.lastIndex=0;e=xs.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Cs){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Ss.test(a)&&Is(a))return!0}}}return!1}(t))return!1;if(e?Ts.test(t):function(t){var e;for(Es.lastIndex=0;e=Es.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 As(t){var e=ss(t);return Rs(e=(e+" "+Ps(t)).trim())?e:""}function Ps(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=ss(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ps(t)).trim())}catch(t){Cn.error("[AutoCapture]",t)}}),e}function Os(t){return t.replace(/"|\\"/g,'\\"')}function Fs(t){var e=t.attr__class;if(e)return Ce(e)?e:es(e)}var $s=1e6;function Ds(t){var e;return Math.min($s,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Ls={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:$s,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},Ns=["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"],qs=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Bs=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],js=t=>{Oe(t)||Mn(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ns.includes(e)||Bs.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Us=["/s/","/e/","/i/"];function Hs(t,e,i,r){if(Oe(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Re(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function zs(t,e){if(Oe(t))return t;var i=t;return Rs(i,!1)||(i="[SessionRecording] "+e+" body redacted"),Mn(qs,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 Ws=new WeakSet,Vs="disabled",Gs="sampled",Zs="active",Qs="buffering",Js="paused",Ks="lazy_loading",Ys="rrweb_error",Xs="trigger_activated",to="trigger_pending",eo="trigger_disabled";function io(t,e,i,r,n,s){return 0===e?eo:(null==t?void 0:t.get_property(i?r+i:n))===s?Xs:to}function ro(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 no(t){return t.includes("trigger_activated")?Xs:t.includes("trigger_pending")?to:eo}function so(t){var e=new Set(t);switch(e.delete(eo),e.size){case 0:return eo;case 1:return Array.from(e)[0];default:return to}}var 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{constructor(t){this.j=t}triggerStatus(t){return so(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return so(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},lo=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Xs}stop(){}},uo=t=>"sessionRecording"in t,ho=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=(uo(t)?Ee(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(uo(t)?Ee(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){Cn.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){Cn.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return io(this._instance,this.B.length,this.V,tt,K,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=Qn(this._instance);if(!t)return!1;try{return ro(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=Qn(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=ro(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=Qn(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=ro(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===Xs,l=ro(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},vo=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({[Wt]:t}),t}triggerStatusNoSideEffects(){var t=to;return Oe(this.linkedFlag)&&(t=eo),this.linkedFlagSeen&&(t=Xs),t}onConfig(t,e){var i;if(this.linkedFlag=(uo(t)?Ee(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Oe(this.linkedFlag)&&!this.linkedFlagSeen){var r=Re(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Re(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(Ee(i)&&r in i){var o=i[r];s=De(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()}},co=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(uo(t)?Ee(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return io(this._instance,this.K.length,this.V,X,Y,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(){}},fo=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new ho(t,e.id),this.tt=new co(t,e.id),this.et=new vo(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 oo(s):new ao(s)}else this.rt=new lo}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===to).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?tt+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 po(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=!0===t.isSampled,i=new oo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Gs:"trigger_activated"===i?Zs:"trigger_pending"===i?Qs:!1===t.isSampled?Vs:Zs}function go(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=new ao([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==eo,r=De(t.isSampled);return i&&"trigger_pending"===e?Qs:i&&"trigger_disabled"===e||r&&!t.isSampled?Vs:!0===t.isSampled?Gs:Zs}function mo(){var t=[];return function(e,i){if(Ee(i)||Ce(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function yo(t){var e=JSON.stringify(t,mo());return e?new Blob([e]).size:0}function _o(t){if(Pe(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(Ce(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Ie(r)||Pe(r)?4:_o(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+_o(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 wo=Uint8Array,ko=Uint16Array,So=Uint32Array,xo=new wo([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]),Co=new wo([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]),To=new wo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Eo=function(t,e){for(var i=new ko(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new So(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=Eo(xo,2),Io=Mo[1];Mo[0][28]=258,Io[258]=28;for(var Ro=Eo(Co,0)[1],Ao=new ko(32768),Po=0;32768>Po;++Po){var Oo=(43690&Po)>>>1|(21845&Po)<<1;Ao[Po]=((65280&(Oo=(61680&(Oo=(52428&Oo)>>>2|(13107&Oo)<<2))>>>4|(3855&Oo)<<4))>>>8|(255&Oo)<<8)>>>1}var Fo=function(t,e,i){for(var r=t.length,n=0,s=new ko(e);r>n;++n)++s[t[n]-1];var o,a=new ko(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new ko(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Ao[d]>>>l]=u}else for(o=new ko(r),n=0;r>n;++n)o[n]=Ao[a[t[n]-1]++]>>>15-t[n];return o},$o=new wo(288);for(Po=0;144>Po;++Po)$o[Po]=8;for(Po=144;256>Po;++Po)$o[Po]=9;for(Po=256;280>Po;++Po)$o[Po]=7;for(Po=280;288>Po;++Po)$o[Po]=8;var Do=new wo(32);for(Po=0;32>Po;++Po)Do[Po]=5;var Lo=Fo($o,9,0),No=Fo(Do,5,0),qo=function(t){return(t/8|0)+(7&t&&1)},Bo=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof ko?ko:t instanceof So?So:wo)(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},Uo=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 wo(0),0];if(1==n){var o=new wo(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 ko(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 _=s[r].s;e>c[_]?p-=1<<e-c[_]++-1:++r}for(;r>=0&&p;--r){var b=s[r].s;c[b]==e&&(--c[b],++p)}f=e}return[new wo(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},Wo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new ko(++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]},Vo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Go=function(t,e,i){var r=i.length,n=qo(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)},Zo=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=Wo(v),y=m[0],_=m[1],b=Wo(p),w=b[0],k=b[1],S=new ko(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],E=C[1],M=19;M>4&&!T[To[M-1]];--M);var I,R,A,P,O=u+5<<3,F=Vo(n,$o)+Vo(s,Do)+o,D=Vo(n,v)+Vo(s,p)+o+14+3*M+Vo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(F>=O&&D>=O)return Go(e,h,t.subarray(l,l+u));if(jo(e,h,1+(F>D)),h+=2,F>D){I=Fo(v,c,0),R=v,A=Fo(p,g,0),P=p;var L=Fo(T,E,0);for(jo(e,h,_-257),jo(e,h+5,k-1),jo(e,h+10,M-4),h+=14,x=0;M>x;++x)jo(e,h+3*x,T[To[x]]);h+=3*M;for(var N=[y,w],q=0;2>q;++q){var B=N[q];for(x=0;B.length>x;++x)jo(e,h,L[j=31&B[x]]),h+=T[j],j>15&&(jo(e,h,B[x]>>>5&127),h+=B[x]>>>12)}}else I=Lo,R=$o,A=No,P=Do;for(x=0;a>x;++x)if(r[x]>255){var j;Uo(e,h,I[257+(j=r[x]>>>18&31)]),h+=R[j+257],j>7&&(jo(e,h,r[x]>>>23&31),h+=xo[j]);var U=31&r[x];Uo(e,h,A[U]),h+=P[U],U>3&&(Uo(e,h,r[x]>>>5&8191),h+=Co[U])}else Uo(e,h,I[r[x]]),h+=R[r[x]];return Uo(e,h,I[256]),h+R[256]},Qo=new So([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jo=new wo(0),Ko=function(){for(var t=new So(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Yo=function(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=Ko[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 wo(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=Go(l,u,t.subarray(h,d)):(l[h]=s,u=Go(l,u,t.subarray(h,o)))}else{for(var v=Qo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new ko(32768),m=new ko(p+1),y=Math.ceil(i/3),_=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<_)&p},w=new So(25e3),k=new ko(288),S=new ko(32),x=0,C=0,T=(h=0,0),E=0,M=0;o>h;++h){var I=b(h),R=32767&h,A=m[I];if(g[R]=A,m[I]=R,h>=E){var P=o-h;if((x>7e3||T>24576)&&P>423){u=Zo(t,l,0,w,k,S,C,T,M,h-M,u),T=x=C=0,M=h;for(var O=0;286>O;++O)k[O]=0;for(O=0;30>O;++O)S[O]=0}var F=2,D=0,L=f,N=R-A&32767;if(P>2&&I==b(h-N))for(var q=Math.min(c,P)-1,B=Math.min(32767,h),j=Math.min(258,P);B>=N&&--L&&R!=A;){if(t[h+F]==t[h+F-N]){for(var U=0;j>U&&t[h+U]==t[h+U-N];++U);if(U>F){if(F=U,D=N,U>q)break;var H=Math.min(N,U-2),z=0;for(O=0;H>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,A=W)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){w[T++]=268435456|Io[F]<<18|Ro[D];var G=31&Io[F],Z=31&Ro[D];C+=xo[G]+Co[Z],++k[257+G],++S[Z],E=h+F,++x}else w[T++]=t[h],++k[t[h]]}}u=Zo(t,l,s,w,k,S,C,T,M,h-M,u),s||(u=Go(l,u,Jo))}return Bo(a,0,r+qo(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&&Yo(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),Yo(u,h-8,i.d()),Yo(u,h-4,r),u}function ta(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new wo(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 wo(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);128>l||e?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return Bo(r,0,n)}function ea(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 ia=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=_o(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 Qe({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:Cn}),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}};Sn.DEBUG=!1,Sn.LIB_VERSION="1.428.3",Sn.LIB_NAME="web";var ra=Sn,na=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(rt,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.Ct(rt);return Ee(e=i)&&Re(e.sessionId)&&Fe(e.size)&&i.sessionId===t?i.size:0}};function sa(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<Ze(100*e,0,100,Cn)}function oa(t){return"$survey_response_"+t}function aa(t,e){if(!e)return null;var i=t[oa(e)];return Ce(i)?[...i]:i}function la(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=aa(t,e.id);Ie(s)||(r[n]=s)}}),s({$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:aa(t,e.id)}})},t,r)}function ua(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 ha(t){return"string"==typeof t&&t.trim()?t.trim():null}function da(t){return t.toLowerCase()}function va(t,e,i){if(!t||!e)return null;var r=da(e),n=Object.keys(t).find(t=>da(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=>da(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var ca=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function fa(t,e,i){var r,n=va(t.translations,e,i),o=s({},t),a=!1;if(n){var l,u=null==(l=t.translations)?void 0:l[n];if(u)if(null==i||i.info("Applying survey-level translation for language: "+n),Ie(u.name)||(o.name=u.name,a=!0),o.appearance){var h=s({},o.appearance);for(var d of ca){var v=u[d];Ie(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return ca.some(e=>!Ie(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,n=va(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(r=t.translations)?void 0:r[n];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=s({},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 Ce(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?n:null,hasChanges:l}}(t,e,i)),f=c.map(t=>t.question),p=c.some(t=>t.hasChanges),g=null;return n||(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?n||g:null}}function pa(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function ga(t){var e;return pa(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var ma=(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}},ya=t=>t.toLowerCase(),_a={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=>ma(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!ma(e,t))),icontains:(t,e)=>e.map(ya).some(e=>t.map(ya).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(ya).every(e=>t.map(ya).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=_a[i.operator];return!!n&&n(i.values,[String(r)])})}function wa(t,e,i){return Bn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var ka=new Set(["is_not","not_icontains","not_regex"]);function Sa(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)||Pe(n))return ka.has(s);var o=_a[s];return!!o&&!Ie(t.value)&&!Pe(t.value)&&o(Ce(t.value)?t.value.map(String):[String(t.value)],Ce(n)?n.map(String):[String(n)])})}var xa=Tn("[SessionRecording]");function Ca(t,e){return e?t:"!"+t}function Ta(t,e){return t===e||t!=="!"+e&&null}var Ea=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=go}onRemoteConfig(t){this.At=Fe(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new oo([this.tt,this.Y]),this.Et=po):(this.Lt=new ao([this.tt,this.Y]),this.Et=go),this._instance.register_for_session({[Zt]: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&&Oe(this.Ot))return this.Ot=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){xa.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(Q),void(null==(r=this._instance.persistence)||r.unregister(H));var s=this._instance.get_property(Q),o=this._instance.get_property(H),a=Ta(s,t),l=Fe(o)&&o!==n,u=Ie(o)&&s===t,h=l||u||!De(a),d=h?sa(t,n):a;h&&(d?this.Tt("sampled"):xa.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Q]:Ca(t,d),[H]:Pe(o)&&s===t?null:n})}ensureSamplingDecision(t){Fe(this.At)&&(De(Ta(this._instance.get_property(Q),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Y),null==(e=this._instance.persistence)||e.unregister(K),null==(i=this._instance.persistence)||i.unregister(Q),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))===to}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===to).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({[Zt]:"v2_trigger_groups",[Qt]:t.triggerGroups.length}),this.Y.onConfig(t)):xa.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Vs;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if("trigger_activated"===o){var a=s.group.id,l=i.get(a);Ie(l)?Cn.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?Gs:r?Qs:Vs}({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)&&(Pe(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 xa.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(ct);s.some(e=>!e.properties||0===e.properties.length||Sa(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){xa.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=et+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(Ee(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&&De(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!De(l),g=p?sa(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(Q),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(tt+a),null==(o=this._instance.persistence)||o.unregister(et+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({[Vt]: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||Sa(i,e,this._instance.get_property(ct))}qt(t){var e=this;this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear();var i=function(t){var i=new fo(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(d){try{for(var e=t+"=",i=d.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}},Ra=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Aa=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ra],Pa="<masked>",Oa=["li_fat_id"];function Fa(t,e,i){if(!d)return{};var r,n=e?[...Ra,...i||[]]:[],s=$a(zn(d.URL,n,Pa),t);return In((r={},Mn(Oa,function(t){var e=Ia(t);r[t]=e||null}),r),s)}function $a(t,e){var i=Aa.concat(e||[]),r={};return Mn(i,function(e){var i=Hn(t,e);r[e]=i||null}),r}function Da(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(!Pe(e)){r.$search_engine=e;var n=d?Hn(d.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function La(){return navigator.language||navigator.userLanguage}var Na="$direct";function qa(){return(null==d?void 0:d.referrer)||Na}function Ba(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...Ra,...e||[]]:[],s=null==(r=i?lr(null==v?void 0:v.href):null==v?void 0:v.href)?void 0:r.substring(0,1e3);return{r:qa().substring(0,1e3),u:s?zn(s,n,Pa):void 0}}function ja(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?lr(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==Na?Na: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,$a(s))}return r&&In(o,Da(r)),o}function Ua(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Ha(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var za=1e5,Wa=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Va=[],Ga=()=>!1,Za="@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(" "),Qa="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(" "),Ka="Accommodation AdministrativeArea Country Place State".split(" "),Ya={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:Qa,publisher:Ja},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Va},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:Ka,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Va}},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(" "),Ya.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Ya.Event],[Ja,Ya.Organization],[Ka,Ya.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Ya.Product]];function tl(t,e){return Se.call(t,e)?t[e]:void 0}function el(t){var e=typeof t;return Pe(t)||"string"===e||"number"===e||"boolean"===e}function il(t){return el(t)||Ce(t)&&t.every(el)?t:void 0}function rl(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 nl(t){if(Se.call(Ya,t))return Ya[t];for(var e of Xa){var i=e[1];if(e[0].includes(t))return i}}function sl(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function ol(t,e,i,r){if(Ce(t)){var n=t.map(t=>ol(t,e,i,r)).filter(t=>!Ie(t));return n.length?n:void 0}return al(t,e,i,r)||void 0}function al(t,e,i,r){if(!Ee(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=tl(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:Ce(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&Wa.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!nl(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of Za){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?rl(tl(t,l),e):il(tl(t,l));Ie(u)||sl(a,l,u)}for(var h of o){var d=nl(h);for(var v of Object.keys(d)){var c=tl(t,v),f=d[v];if(!0===f){var p=il(c);Ie(p)||sl(a,v,p)}else{var g=ol(c,e,i,f);Ie(g)||sl(a,v,g)}}}var m=ol(tl(t,"@graph"),e,i);return Ie(m)||sl(a,"@graph",m),Object.keys(a).length?a:null}function ll(t,e,i){if(!Ee(t))return null;var r=tl(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var n=al(t,e,i);return n?s({"@context":"https://schema.org"},n):null}function ul(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function hl(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 dl(t,e,i){for(var r=t;r;){if(hl(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 vl(t){return ul(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(ul)}function cl(t){return Ie(t)?void 0:Math.round(t)}function fl(t){return Ee(t)?t.network_timing:t}var pl,gl,ml=Tn("[SessionRecording]"),yl=[1,2,3,4,5,6,7,12],_l=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function bl(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function wl(){var t;return null==(t=bl())?void 0:t.record}function kl(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,mo())}}function Sl(t){return ea(Xo(ta(kl(t))),!0)}function xl(t){return Cl.apply(this,arguments)}function Cl(){return(Cl=a(function*(t){var e=yield tn(kl(t),ra.DEBUG,{rethrow:!0});return ea(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var Tl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,El=!1;function Ml(t){return Ce(t)&&0===t.length?pl=null!=pl?pl:Sl([]):Sl(t)}function Il(t){return Rl.apply(this,arguments)}function Rl(){return(Rl=a(function*(t){return Ce(t)&&0===t.length?pl||(gl=null!=gl?gl:xl([]).then(t=>(pl=t,t)).catch(t=>{throw pl=void 0,gl=void 0,t})):xl(t)})).apply(this,arguments)}function Al(t){return Tl&&!El&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Pl(t){return{event:t,size:_o(t)}}function Ol(t,e){return s({},t,{data:e,cv:"2024-10"})}function Fl(t,e){return s({},t,{cv:"2024-10",data:s({},t.data,e)})}function $l(t){try{if(2===t.type)return Pl(Ol(t,Sl(t.data)));if(3===t.type&&0===t.data.source)return Pl(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 Pl(Fl(t,{adds:t.data.adds?Sl(t.data.adds):void 0,removes:t.data.removes?Sl(t.data.removes):void 0}))}catch(t){ml.error("could not compress event - will use uncompressed event",t)}return{event:t,size:yo(t)}}function Dl(){return Dl=a(function*(t){try{if(2===t.type)return Pl(Ol(t,yield xl(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 Pl(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?xl(t.data.adds):void 0,t.data.removes?xl(t.data.removes):void 0]);return Pl(Fl(t,{adds:i[0],removes:i[1]}))}}catch(e){return Kr(e)&&(El=!0),ml.error("could not compress event asynchronously - trying synchronous compression",e),$l(t)}return{event:t,size:yo(t)}}),Dl.apply(this,arguments)}function Ll(t,e){return 5===t.type&&t.data.tag===e}function Nl(t){return Ll(t,"sessionIdle")}function ql(t){return Ll(t,"$session_ending")}function Bl(t){return Ll(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 Ta(this._instance.get_property(Q),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(it),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!!Pe(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!=d&&d.visibilityState&&("visible"===d.visibilityState&&(this.je=!0),this.Dt("window "+d.visibilityState,{}))},this.je=null==e||e;var i=this.Ht.checkAndGetSessionAndWindowId(),r=i.windowId;this.Bt=i.sessionId,this.Ie=r,this.et=new vo(this._instance),this.Y=new ho(this._instance),this.tt=new co(this._instance),this.Pe=this.Ue(),this.Ht.sessionTimeoutMs>this.$t||ml.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 na(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(!Oe(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,ml.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 Ze(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Tn("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:Ze(h,0,12,Tn("canvas recording fps"),4),quality:Ze(d,0,1,Tn("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=fl(this._instance.config.capture_performance),l=fl(null==r?void 0:r.capturePerformance),u=!!(De(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 n=null==(e=b.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.Ye&&Te(n))if(!qn.includes(v.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Te(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(n(((t,e,i)=>{var r,n={payloadSizeLimitBytes:Ls.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ls.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ls.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=Ds(n),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&&Us.some(t=>0===o.indexOf(t))))return t}})((js((r=e).requestHeaders),js(r.responseHeaders),r),t.api_host,i));var r},d=Te(t.session_recording.maskNetworkRequestFn);return d&&Te(t.session_recording.maskCapturedNetworkRequestFn)&&Cn.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:s({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Te(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 Oe(n)&&r?(Ws.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)),s({},Ls,n,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ye,o)))}else ml.info("NetworkCapture not started because we are on localhost.");return i}er(t){return this._instance.config.disable_capture_url_hashes?lr(t):t}rr(t,e){void 0===e&&(e=!1);var i=e?lr(t):this.er(t),r=this._instance.config.mask_personal_data_properties?[...Ra,...this._instance.config.custom_personal_data_properties||[]]:[];return this.ir(zn(i,r,Pa))}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}):ml.warn("could not emit queued rrweb event.",e,t),!1}}Dt(t,e){return this.nr(_l(()=>wl().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=wl();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||!l)return;var t=new URL(l.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(_l(()=>wl().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),ml.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"}),ml.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?K:Y;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=Ee(t)?t:JSON.parse(t)}catch(t){return void ml.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 ml.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(it),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 Ea(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(W,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(W)}),this.kr(G,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(G)}),this.kr(V,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(V)}),this.Vt.makeSamplingDecisions(this.sessionId),this.Sr(),this.ue||(Ln(l,"beforeunload",this.qe),Ln(l,"pagehide",this.ze),Ln(l,"offline",this.We),Ln(l,"online",this.Ve),Ln(d,"visibilitychange",this.Ze),!this.xe&&Te(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&Te(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)})}):Te(this.Ht.on)||ml.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Oe(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){ml.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.Tt(t||"recording_initialized"))}else ml.info("remote config must be stored in persistence before recording can start")}Cr(){var t,e,i,r,n,s;null==l||l.removeEventListener("beforeunload",this.qe),null==l||l.removeEventListener("pagehide",this.ze),null==l||l.removeEventListener("offline",this.We),null==l||l.removeEventListener("online",this.Ve),null==d||d.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(),ml.info("stopped"))}).catch(()=>{this._e=!1,this.Lr(),this.Cr(),ml.info("stopped")}),!0}stop(){if(this.Tr(),this.Le)this.He();else if(this.Ar())return;this.$e(),this.Ue(),this.Lr(),this.Cr(),ml.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,ml.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(),ml.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,ml.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||ml.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,ml.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=yo(t.event);if(t.compressionEnabled)try{var r=$l(t.event);e=r.event,i=r.size}catch(t){ml.error("could not process queued compression event - will use uncompressed event",t)}try{this.Ur(t,e,i)}catch(t){ml.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 o=function(){var i=a(function*(){try{if(s.processed)return;var i,r;try{var o=e?Al(t)?yield function(t){return Dl.apply(this,arguments)}(t):$l(t):{event:t,size:yo(t)};i=o.event,r=o.size}catch(e){ml.error("could not process queued compression event - will use uncompressed event",e),i=t,r=yo(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(o):o()}onRRwebEmit(t){var e,i,r,n,s,o,a,l,u;if(this._instance.sessionManager&&(this.dr(),t&&Ee(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({[it]: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&&Ee(e)&&6===e.type&&Ee(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 ql(t)?t.data.payload:null}(g),y=function(t){return Bl(t)?t.data.payload:null}(g),_=function(t){return Nl(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=_&&_.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 b=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==_?void 0:_.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==_?void 0:_.windowId)&&void 0!==o?o:this.Ie;if(!0!==this.Yt||function(t){return Nl(t)||ql(t)||Bl(t)}(g)){2===g.type&&(this.te=0),_&&(g.timestamp=_.lastActivityTimestamp+_.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&&Al(g))this.Wr(g,S,b,w);else{var x=S?$l(g):{event:g,size:yo(g)};this.Nr(g,x.event,x.size,b,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}):Vs}log(t,e){var i;void 0===e&&(e="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.It(),this.mr(),this.Tt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Q]: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==l||null==(t=l.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)&&!ql(t)&&!Bl(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({[Gt]:[]}),void(this.Yr=void 0);var e=this.Kr();if(0===e.length)return Ie(this.Yr)||this._instance.register_for_session({[Gt]:[]}),void(this.Yr=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.Yr&&(this.Yr=r,this._instance.register_for_session({[Gt]:e}),ml.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:ra.LIB_NAME,$lib_version:ra.LIB_VERSION,$snapshot_host:s})}catch(t){ml.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}),ml.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Dt("$recording_started",s({reason:t},e))}ei(t){var e;return 3===t.type&&-1!==yl.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:cl(null==(i=this.Or)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:cl(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:cl(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:cl(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:cl(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,[Kt]:!!this.Gt,[Yt]:this.le}}Sr(){var t;if(!this.Gt){this.le=!0;var e,i,r,n,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},a=this._instance.config.session_recording;for(var u of Object.entries(a||{})){var h=u[0],v=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=s({password:!0},v);else if("sampling"===h){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[h]=v}!0===(null==a?void 0:a.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=s({},o.slimDOMOptions,{script:!0})),this.Ke&&this.Ke.enabled&&(o.recordCanvas=!0,o.sampling=s({},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 Te(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(Te(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.fe||(this.fe=!0,ml.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!==(n=this.Ge.maskAllElementAttributes)&&void 0!==n&&n),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.ve||(this.ve=!0,ml.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=wl();if(p){this.Rr=null!==(t=this.Rr)&&void 0!==t?t:new ia(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";ml.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(s({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,ml.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.Gt)return this.ue=!0,void ml.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==a?void 0:a.captureJsonLd)&&d&&null!=l&&l.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")?Ga:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!dl(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 dl(t,e.blockClass,e.blockSelector)||dl(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e){if(void 0===e&&(e=Ga),!t||t.length>za)return null;try{var i=JSON.parse(t),r={remainingNodes:2048,exceeded:!1},n=Ce(i)?i.map(t=>ll(t,e,r)):ll(i,e,r);if(r.exceeded||Pe(n)||Ce(n)&&(!n.length||n.some(Pe)))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(Pe(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 vl(t))a(e)};for(var i of t)if("childList"===i.type)ul(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&ul(r)&&a(r)}else"attributes"===i.type&&ul(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()&&vl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(d,l.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=De(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 ml.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Dt(t,e)}},Ul=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}({}),Wl=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Vl=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Gl=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}({}),Zl=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 Ql(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:[]},Kl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Yl={};function Xl(t){if(Yl[t])return Yl[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 Kl?Kl[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 Yl[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 Ql(t,"AppleWebKit")&&!Ql(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Yl[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var tu={};function eu(t,e,i){var r,n=t+"."+String(i);if(tu[n])return tu[n].call(e);var s=Xl(t),o=null===(r=Object.getOwnPropertyDescriptor(s,i))||void 0===r?void 0:r.get;return o?(tu[n]=o,o.call(e)):e[i]}var iu={};function ru(t,e,i){var r=t+"."+String(i);if(iu[r])return iu[r].bind(e);var n=Xl(t)[i];return"function"!=typeof n?e[i]:(iu[r]=n,n.bind(e))}function nu(){return Xl("MutationObserver").constructor}function su(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 ou={childNodes:t=>eu("Node",t,"childNodes"),parentNode:t=>eu("Node",t,"parentNode"),parentElement:t=>eu("Node",t,"parentElement"),textContent:t=>eu("Node",t,"textContent"),contains:(t,e)=>ru("Node",t,"contains")(e),getRootNode:t=>ru("Node",t,"getRootNode")(),host:t=>t&&"host"in t?eu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?eu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>ru("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>ru("Element",t,"querySelectorAll")(e),mutationObserver:nu,patch:su};function au(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var lu=0;function uu(){lu+=1}function hu(){return lu}function du(t,e){return(e!==lu||t>6e4)&&!0}var vu=0,cu=0,fu=0,pu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},gu=null,mu=null,yu=[],_u=0,bu=0,wu={slowestBatchMs:0},ku={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Su(t){(vu+=1)>1||(pu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},yu=[],_u=0,mu=(t=>t&&t>0?t:null)(t),cu=au(),fu=lu)}function xu(){return 0===vu?gu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(vu-=1)>0?pu:(pu.durationMs=au()-cu,pu.deferredStylesheetCount=_u,ku.deferredCount+=_u,mu=null,du(pu.durationMs,fu)?pu:gu=pu)}function Cu(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+=Cu(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+=Cu(l,e,i+1))}}}catch(t){}}return r}function Tu(t){if(0!==vu){var e=Cu(t,null,0);pu.cssRuleCount+=e,bu>0&&(pu.nonDeferrableCssRuleCount+=e)}}function Eu(t){bu+=1;try{return t()}finally{bu-=1}}function Mu(t){vu>0&&(pu.stylesheetMs+=t)}function Iu(t){if(0===vu||null===mu)return!1;var e=pu.cssRuleCount-pu.nonDeferrableCssRuleCount;return e>=mu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Cu(e,i,0)}catch(t){return 0}}(t)>mu}function Ru(){ku.failedCount+=1}function Au(t){t>0&&(ku.abandonedCount+=t)}function Pu(t){return Pu="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},Pu(t)}function Ou(t,e,i){return(e=function(t){var e=function(t){if("object"!=Pu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Pu(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pu(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 $u(t){var e=t&&"host"in t&&"mode"in t&&ou.host(t)||null;return Boolean(e&&"shadowRoot"in e&&ou.shadowRoot(e)===t)}function Du(t){return"[object ShadowRoot]"==={}.toString.call(t)}function Lu(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 Nu(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 qu=0;function Bu(t){var e=0===qu,i=e?au():0;qu+=1;try{var r=t.rules||t.cssRules;if(!r)return null;Tu(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),Lu(Array.from(r,t=>ju(t,n)).join(""))}catch(t){return null}finally{qu-=1,e&&Mu(au()-i)}}function ju(t,e){if(Hu(t)){var i;try{i=Bu(t.styleSheet)||Nu(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return sh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return zu(t)&&t.selectorText.includes(":")&&(n=Uu(n)),e?sh(n,e):n}function Uu(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function Hu(t){return"styleSheet"in t}function zu(t){return"selectorText"in t}var Wu=/^-?[A-Za-z_][\w-]*$/,Vu=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Gu(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||Nu(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=sh(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&&!Wu.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]?Wu.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Vu.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?sh(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=Uu(s)),t.parts.push(t.sheetHref?sh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;Tu(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;Tu(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=au(),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?Uu(h):h}else u=Lu(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{Mu(au()-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 Zu=class{constructor(){Ou(this,"idNodeMap",new Map),Ou(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=ou.shadowRoot(t);i&&this.removeNodeFromMap(i),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Qu(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Ju(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Ju(t){return t.toLowerCase()}var Ku=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 Yu(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&&Ku.has(Ju(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Xu="__rrweb_original__";function th(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ju(e):null}catch(t){return null}}var eh=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ih=/^(?:[a-z+]+:)?\/\//i,rh=/^www\..*/i,nh=/^(data:)([^,]*),(.*)/i;function sh(t,e){return(t||"").replace(eh,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(ih.test(l)||rh.test(l))return"url("+u+l+u+")";if(nh.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 oh,ah,lh=new Map,uh=1,hh=new RegExp("[^a-z0-9-_:]");function dh(){return uh++}var vh=/^[^ \t\n\r\u000c]+/,ch=/^[, \t\n\r\u000c]+/,fh=new WeakMap;function ph(t,e){return e&&""!==e.trim()?gh(t,e):e}function gh(t,e){var i=fh.get(t);if(i||(i=t.createElement("a"),fh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function mh(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 yh(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=ph(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=lh.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(lh.size>=10){var u=lh.keys().next().value;void 0!==u&&lh.delete(u)}return lh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),mh(u,s)}if("image"===e)return mh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=ph(t,r);return"image"===e&&h.startsWith("data:")?mh(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(ch),e.length>i;){var s=r(vh);if(","===s.slice(-1))s=ph(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=ph(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?sh(r,gh(t)):"object"===e&&"data"===i?ph(t,r):r:ph(t,r)}function _h(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(ou.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&bh(ou.parentNode(t),e,i)}function wh(t,e,i,r){var n;if(Fu(t)){if(!ou.childNodes(n=t).length)return!1}else{if(null===ou.parentElement(t))return!1;n=ou.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 kh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Sh=new Map;function xh(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Ch(t){return null==t?"":t.toLowerCase()}var Th=!1,Eh=!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,_=e.slimDOMOptions,b=e.dataURLOptions,w=void 0===b?{}:b,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,E=e.onSerialize,M=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,A=e.onIframeListenerRegistered,P=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,F=void 0===O?5e3:O,D=e.keepIframeSrcFn,L=void 0===D?()=>!1:D,N=e.newlyAddedElement,q=void 0!==N&&N,B=e.depth,j=void 0===B?0:B,U=e.maxDepth,H=void 0===U?50:U,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(j>=H)return Eh=!0,Th||(Th=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+H+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=wh(t,o,a,void 0===z)),vu>0&&(pu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.maskAllElementAttributes,v=void 0!==d&&d,c=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,_=e.keepIframeSrcFn,b=e.newlyAddedElement,w=void 0!==b&&b,k=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Zl.Document,childNodes:[],compatMode:t.compatMode}:{type:Zl.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Zl.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,_=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),b=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ju(t.tagName);return hh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];_h(b,C.name)||(k[C.name]=yh(i,b,Ju(C.name),C.value,t,d))}if("link"===b&&r&&!_){var T=t.sheet;if(!T){var E=function(t){return t.href}(t);E&&!(T=xh(i,E))&&E.includes(".css")&&(T=xh(i,window.location.origin+"/"+E.replace(window.location.href,"")))}var M=null;T&&(Iu(T)?vu>0&&(yu.push(t),_u+=1):M=Bu(T)),M&&(delete k.rel,delete k.href,k._cssText=M)}if("style"===b&&t.sheet&&!(t.innerText||ou.textContent(t)||"").trim().length){var I=Eu(()=>Bu(t.sheet));I&&(k._cssText=I)}if("input"===b||"textarea"===b||"select"===b){var R=t.value,A=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&R?k.value=Qu({element:t,type:th(t),tagName:b,value:R,maskInputOptions:s,maskInputFn:o}):A&&(k.checked=A)}if("option"===b&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===b&&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"===b&&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),O=i.createElement("canvas");O.width=t.width,O.height=t.height,P!==O.toDataURL(d.type,d.quality)&&(k.rr_dataURL=P)}var F,D,L=!1;if("img"===b&&v){oh||(oh=i.createElement("canvas"),ah=oh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",B=N.crossOrigin,j=(e,i)=>L?Yu({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,U=()=>{kh(N,"load",U);try{oh.width=N.naturalWidth,oh.height=N.naturalHeight,ah.drawImage(N,0,0);var t=oh.toDataURL(d.type,d.quality);k.rr_dataURL=j("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?U():N.addEventListener("load",U));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(B?k.crossOrigin=j("crossOrigin",B):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?U():N.addEventListener("load",U)}if("audio"===b||"video"===b){var H=k;H.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),H.rr_mediaCurrentTime=t.currentTime,H.rr_mediaPlaybackRate=t.playbackRate,H.rr_mediaMuted=t.muted,H.rr_mediaLoop=t.loop,H.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),_){var z,W,V,G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null===(z=i.defaultView)||void 0===z?void 0:z.getComputedStyle(t);k={class:k.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((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"),Y&&(k.rr_position=Y.position||"static",w.add("rr_position"),Y.transform&&"none"!==Y.transform&&(k.rr_transform=Y.transform,w.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(k.rr_display=Y.display,w.add("rr_display")))}if("iframe"!==b||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(var X of Object.entries(k)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(k[tt]=Yu({element:t,name:tt,value:et,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(tt)}))}L=!0;try{customElements.get(b)&&(F=!0)}catch(t){}return{type:Zl.Element,tagName:b,attributes:k,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:_,rootId:y,isCustom:F}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:_,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i=e.needsMask,r=e.maskTextFn,n=e.rootId,s=ou.parentNode(t),o=s&&s.tagName,a=ou.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=Bu(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=sh(a,gh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,ou.parentElement(t)):a.replace(/[\S]/g,"*")),{type:Zl.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:Zl.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:Zl.Comment,textContent:ou.textContent(t)||"",rootId:k};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,keepIframeSrcFn: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===Zl.Comment)return!0;if(t.type===Zl.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&&(Ch(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ch(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ch(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Ch(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Ch(t.attributes.property).match(/^(og|twitter|fb):/)||Ch(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ch(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ch(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(Ch(t.attributes.name))||Ch(t.attributes.property).match(/^article:/)||Ch(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(Ch(t.attributes.name)))return!0}}return!1}(Z,_)||!V&&Z.type===Zl.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:dh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),-2===G)return null;E&&E(t);var J=!u;if(Q.type===Zl.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=ou.shadowRoot(t);K&&Du(K)&&(Q.isShadowHost=!0)}if((Q.type===Zl.Document||Q.type===Zl.Element)&&J){_.headWhitespace&&Q.type===Zl.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:j+1,maxDepth:H};if(Q.type===Zl.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(ou.childNodes(t))){var tt=Mh(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(Fu(t)&&(et=ou.shadowRoot(t)))for(var it of Array.from(ou.childNodes(et))){var rt=Mh(it,Y);rt&&(Du(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=ou.parentNode(t);if(nt&&$u(nt)&&Du(nt)&&(Q.isShadow=!0),Q.type===Zl.Element&&"iframe"===Q.tagName){var st=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),kh(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?kh(t,"load",o):(a=!0,kh(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),kh(t,"load",o)}}return t.addEventListener("load",o),()=>{kh(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&M){var i=Mh(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:j+1,maxDepth:H});i&&M(t,i)}},R);null==A||A(t,st)}return Q.type===Zl.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!Sh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,b=()=>{if(!g){g=!0;try{(()=>{if(P){var e=Mh(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:j,maxDepth:H});e&&P(t,e)}})()}finally{Sh.delete(e),v.abort()}}},k=setTimeout(b,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",b,{signal:v.signal,once:!0}),Sh.set(e,v)}}}(t,0,F),Q}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 Rh=class t{constructor(){Ou(this,"parentElement",null),Ou(this,"parentNode",null),Ou(this,"ownerDocument",void 0),Ou(this,"firstChild",null),Ou(this,"lastChild",null),Ou(this,"previousSibling",null),Ou(this,"nextSibling",null),Ou(this,"ELEMENT_NODE",1),Ou(this,"TEXT_NODE",3),Ou(this,"nodeType",void 0),Ou(this,"nodeName",void 0),Ou(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 Ah(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>Ph(i,t,e,r)}function Ph(t,e,i,r){Oh(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function Oh(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.",$h={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 Dh(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 Lh(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)}}}),()=>Lh(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&($h=new Proxy($h,{get(t,e,i){return"map"===e&&console.error(Fh),Reflect.get(t,e,i)}}));var Nh=Date.now;function qh(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=ou.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=ou.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 Bh(){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 Uh(t){return t?t.nodeType===t.ELEMENT_NODE?t:ou.parentElement(t):null}function Hh(t,e,i,r){if(!t)return!1;var n=Uh(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 Wh(t,e){if($u(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=ou.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Wh(r,e))}function Vh(t){return Boolean(t.changedTouches)}function Gh(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Zh(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Qh(t){return!!t&&(t instanceof Rh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(ou.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Nh=()=>(new Date).getTime());var Jh=class{constructor(){Ou(this,"id",1),Ou(this,"styleIDMap",new WeakMap),Ou(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 Kh(t){var e,i=null;return"getRootNode"in t&&(null===(e=ou.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ou.host(ou.getRootNode(t))&&(i=ou.host(ou.getRootNode(t))),i}function Yh(t){var e=t.ownerDocument;return!!e&&(ou.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Kh(i);)i=e;return i}(t);return ou.contains(e,i)}(t))}function Xh(t){return"__ln"in t}var td,ed=class{constructor(){Ou(this,"length",0),Ou(this,"head",null),Ou(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--)}},id=(t,e)=>t+"@"+e,rd=class{constructor(){Ou(this,"frozen",!1),Ou(this,"locked",!1),Ou(this,"texts",[]),Ou(this,"attributes",[]),Ou(this,"attributeMap",new WeakMap),Ou(this,"generatedAttributes",new WeakMap),Ou(this,"removes",[]),Ou(this,"mapRemoves",[]),Ou(this,"movedMap",{}),Ou(this,"addedSet",new Set),Ou(this,"movedSet",new Set),Ou(this,"droppedSet",new Set),Ou(this,"removesSubTreeCache",new Set),Ou(this,"mutationCb",void 0),Ou(this,"blockClass",void 0),Ou(this,"blockSelector",void 0),Ou(this,"maskTextClass",void 0),Ou(this,"maskTextSelector",void 0),Ou(this,"inlineStylesheet",void 0),Ou(this,"maskInputOptions",void 0),Ou(this,"maskTextFn",void 0),Ou(this,"maskInputFn",void 0),Ou(this,"maskAllElementAttributes",void 0),Ou(this,"maskAttributeFn",void 0),Ou(this,"keepIframeSrcFn",void 0),Ou(this,"recordCanvas",void 0),Ou(this,"canvasMaskingConfigured",void 0),Ou(this,"inlineImages",void 0),Ou(this,"slimDOMOptions",void 0),Ou(this,"dataURLOptions",void 0),Ou(this,"doc",void 0),Ou(this,"mirror",void 0),Ou(this,"iframeManager",void 0),Ou(this,"stylesheetManager",void 0),Ou(this,"shadowDomManager",void 0),Ou(this,"canvasManager",void 0),Ou(this,"processedNodeManager",void 0),Ou(this,"unattachedDoc",void 0),Ou(this,"canvasManagerReleased",!1),Ou(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),Ou(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=au(),r=hu();try{this.processBufferedMutations()}finally{t=au()-i,e=r,vu>0||du(t,null!=e?e:lu)||t>wu.slowestBatchMs&&(wu.slowestBatchMs=t)}}}),Ou(this,"processBufferedMutations",()=>{for(var t=[],e=new Set,i=new ed,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=ou.parentNode(n);if(s&&Yh(n)&&"TEXTAREA"!==s.tagName&&!this.isBlockedAtEmission(s)){var o=$u(s)?this.mirror.getId(Kh(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=>{Gh(t,this.mirror)&&this.iframeManager.addIframe(t),Zh(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Qh(t)&&!Hh(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(ou.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)sd(this.removesSubTreeCache,s)&&!this.movedSet.has(ou.parentNode(s))||n(s);for(var o of this.addedSet)od(this.droppedSet,o)||sd(this.removesSubTreeCache,o)?od(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(ou.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(ou.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=ou.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=ou.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=ou.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]=Yu({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)}),Ou(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),Ou(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(ou.childNodes(t),t=>ou.textContent(t)||"").join("");e.attributes.value=Qu({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:th(t),value:i,maskInputFn:this.maskInputFn})}),Ou(this,"processMutation",t=>{if(!zh(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=ou.textContent(t.target);Hh(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:wh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Uh(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=th(l);a=Qu({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"),!_h(r.tagName,o)){var v,c=yh(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 _ of Array.from(f.style))""===p.getPropertyValue(_)&&(h.styleDiff[_]=!1)}else if("open"===o&&"DIALOG"===r.tagName){h.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(t.target);b||this.generatedAttributes.set(t.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(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=$u(t.target)?this.mirror.getId(ou.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)?(nd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Wh(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[id(i,r)]?nd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!$u(t.target)||!Du(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),ou.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))})}}),Ou(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[id(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Hh(t,this.blockClass,this.blockSelector,!1)||(ou.childNodes(t).forEach(t=>this.genAdds(t)),Qh(t)&&ou.childNodes(ou.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?ou.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?ou.host(r):null}return!1}};function nd(t,e){for(var i=[e];i.length;){var r=i.pop();t.delete(r),ou.childNodes(r).forEach(t=>i.push(t))}}function sd(t,e,i){return 0!==t.size&&function(t,e){var i=ou.parentNode(e);return!!i&&t.has(i)}(t,e)}function od(t,e){if(0===t.size)return!1;for(var i=ou.parentNode(e);i;){if(t.has(i))return!0;i=ou.parentNode(i)}return!1}var ad=function(t,e){return void 0===e&&(e="rrweb"),td?function(){try{return t(...arguments)}catch(t){if(td&&!0===td(t,e))return;throw t}}:t},ld=[];function ud(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 hd(t,e){var i,r=new rd;r.init(t);try{i=new(nu())(ad(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),ld.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function dd(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=ud(t);if(o&&!Hh(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=qh(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=[Ah("scroll",ad(Dh(ad(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(Ah("scrollend",ad(l),i)),()=>u.forEach(t=>t())}function vd(t,e){for(var i=ld.length-1;i>=0;i--){var r=ld[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),ld.splice(i,1))}}}var cd=["INPUT","TEXTAREA","SELECT"],fd=new WeakMap;function pd(t){return function t(e,i){if(_d("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||_d("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||_d("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||_d("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 gd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function md(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:ou.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}}),ad(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function yd(t,e){void 0===e&&(e={});var i,r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var o=[],a=ad(()=>{if(r){r.destroy(),r.reset();var e=ld.indexOf(r);-1!==e&&ld.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),o.forEach(t=>t())});try{if(t.recordDOM){var l=hd(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=Dh(ad(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=ad(Dh(ad(t=>{var e=ud(t),i=Vh(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=Nh()),l.push({x:r,y:o,id:n.getId(e),timeOffset:Nh()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Hl.Drag:t instanceof MouseEvent?Hl.MouseMove:Hl.TouchMove)}),o,{trailing:!1})),d=[Ah("mousemove",h,r),Ah("touchmove",h,r),Ah("drag",h,r)];return ad(()=>{d.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=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=ud(i);if(!Hh(a,n,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Wl.Mouse;break;case"touch":l=Wl.Touch;break;case"pen":l=Wl.Pen}l===Wl.Touch&&(zl[t]===zl.MouseDown?u="TouchStart":zl[t]===zl.MouseUp&&(u="TouchEnd"))}else Vh(i)&&(l=Wl.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Wl.Touch||u.startsWith("Mouse")&&l===Wl.Mouse)&&(l=null)):zl[t]===zl.Click&&(l=h,h=null);var d=Vh(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;ad(e)(s({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(Ah(a,l,i))}),ad(()=>{u.forEach(t=>t())})}(t)),o.push(dd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Ah("resize",ad(Dh(ad(()=>{var t=Bh(),e=jh();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),r)}(t,{win:n})),o.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=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=ud(t),r=t.isTrusted,s=i.defaultView;if(!e||!s||e instanceof s.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=ou.parentElement(e)),e&&v&&cd.indexOf(v)>=0&&!Hh(e,n,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=th(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Qu({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 n=fd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){fd.set(t,i);var o=r.getId(t);ad(e)(s({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>Ah(t,ad(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=>Lh(t[0],t[1],{set(){ad(v)({target:this,isTrusted:!1})}},!1,p))),ad(()=>{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=ad(t=>Dh(ad(s=>{var o=ud(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=[Ah("play",a(Gl.Play),o),Ah("pause",a(Gl.Pause),o),Ah("seeked",a(Gl.Seeked),o),Ah("volumechange",a(Gl.VolumeChange),o),Ah("ratechange",a(Gl.RateChange),o)];return ad(()=>{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()}}}(n);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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=gd(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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=gd(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:ad((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=gd(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=Bu(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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=gd(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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=gd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...pd(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:ad((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=gd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...pd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),ad(()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=h,l&&(s.CSSStyleSheet.prototype.replace=l),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach(t=>{var e=t[0],i=t[1];i.prototype.insertRule=v[e].insertRule,i.prototype.deleteRule=v[e].deleteRule})})}(t,{win:n,mutationQueue:u})),o.push(md(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:ad((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=gd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=pd(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:ad((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=gd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=pd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),ad(()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u})}(t,{win:n,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=su(i.fonts,"add",function(t){return function(i){return setTimeout(ad(()=>{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),ad(()=>{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=ad(()=>{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(),Ah("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?su(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,n,h.options))}catch(t){try{a()}catch(t){}throw t}return a}function _d(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 wd=class{constructor(t){Ou(this,"generateIdFn",void 0),Ou(this,"iframeRemoteIdToLocalIdMap",new WeakMap),Ou(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}},kd=class{constructor(t){Ou(this,"iframes",new WeakMap),Ou(this,"crossOriginIframeMap",new WeakMap),Ou(this,"crossOriginIframeMirror",new wd(dh)),Ou(this,"crossOriginIframeStyleMirror",void 0),Ou(this,"crossOriginIframeRootIdMap",new WeakMap),Ou(this,"mirror",void 0),Ou(this,"mutationCb",void 0),Ou(this,"wrappedEmit",void 0),Ou(this,"loadListener",void 0),Ou(this,"pageHideListener",void 0),Ou(this,"stylesheetManager",void 0),Ou(this,"recordCrossOriginIframes",void 0),Ou(this,"messageHandler",void 0),Ou(this,"nestedIframeListeners",new Map),Ou(this,"attachedWindows",new WeakMap),Ou(this,"attachedDocuments",new WeakMap),Ou(this,"attachedIframes",new Map),Ou(this,"loadListenerDisposers",new WeakMap),Ou(this,"iframeElementsById",new Map),Ou(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wd(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=>Oh(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{Ph(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);Oh(()=>{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)})}Oh(()=>{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 Ul.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:Ul.IncrementalSnapshot,data:{source:Hl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ul.Meta:case Ul.Load:case Ul.DomContentLoaded:return!1;case Ul.Plugin:return e;case Ul.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Ul.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===Zl.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&&(Ph(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(Ph(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=>{Oh(()=>this.mirror.removeNodeFromMap(t))}),Oh(()=>vd(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&&Ph(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Ph(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}},Sd=class{constructor(t){Ou(this,"shadowDoms",new WeakSet),Ou(this,"mutationCb",void 0),Ou(this,"scrollCb",void 0),Ou(this,"bypassOptions",void 0),Ou(this,"mirror",void 0),Ou(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(Du(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null===(r=ou.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=hd(s({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=ld.indexOf(l);-1!==t&&ld.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:dd(s({},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(ou.host(t))),this.restoreHandlers.push({doc:n,handler:md({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:su(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=ou.shadowRoot(this);return s&&Yh(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}},xd="skip-frame";function Cd(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 Td="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ed="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Md=0;64>Md;Md++)Ed[Td.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+=Td[i[e]>>2],n+=Td[(3&i[e])<<4|i[e+1]>>4],n+=Td[(15&i[e+1])<<2|i[e+2]>>6],n+=Td[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},Rd=new Map,Ad=(t,e,i)=>{if(t&&(Fd(t,e)||"object"==typeof t)){var r=function(t,e){var i=Rd.get(t);return i||Rd.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 Pd(t,e,i,r){return t instanceof Array?t.map(t=>Pd(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:[Pd(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:[Pd(t.data,e,i,r),t.width,t.height]}:Fd(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ad(t,e,i)}:t}var Od=(t,e,i,r)=>t.map(t=>Pd(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]))},$d=["webgl","webgl2"];function Dd(t){return"nodeType"in t}function Ld(t,e,i,r){var n=[];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 su(r.prototype,"configure",function(r){return function(n){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||Dd(o)&&Hh(o,e,i,!0))return r.call(this,n);Dd(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&&n?s({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}})}(t,e,i);o&&n.push(o)}var a=su(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&&$d.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}});n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(t=>t())}}function Nd(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=su(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(Ad(d,s,this),this.canvas&&"tagName"in this.canvas&&!Hh(this.canvas,r,n,!0)){var v={type:e,property:l,args:Od(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=Lh(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 qd='(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',Bd="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",qd],{type:"text/javascript;charset=utf-8"});function jd(t){var e;try{if(!(e=Bd&&(self.URL||self.webkitURL).createObjectURL(Bd)))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(qd),{name:null==t?void 0:t.name})}}var Ud,Hd,zd,Wd=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){Ou(this,"pendingCanvasMutations",new Map),Ou(this,"rafStamps",{latestId:0,invokeId:null}),Ou(this,"mirror",void 0),Ou(this,"mutationCb",void 0),Ou(this,"resetObservers",void 0),Ou(this,"frozen",!1),Ou(this,"locked",!1),Ou(this,"rafIdTimestamp",null),Ou(this,"rafIdFlush",null),Ou(this,"refCount",0),Ou(this,"torndown",!1),Ou(this,"resetFrameDedup",null),Ou(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 o,l="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=Ld(e,i,r,!0),h=new Map;try{o=new jd}catch(t){return}var d=!1;o.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.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:Vl["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=a(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,a=t.getContext(t.__context);if(null==a||null===(i=a.isContextLost)||void 0===i?void 0:i.call(a))return void h.set(e,!1);!1===(null==a||null===(r=a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.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 xd}if(void 0!==o){if(!Array.isArray(o)||!o.every(Cd))return xd;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});o.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=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ld(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=su(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=Od(l,e,this,n);t(this.canvas,{type:Vl["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=Lh(e.CanvasRenderingContext2D.prototype,o,{set(e){Hh(this.canvas,i,r,!0)||t(this.canvas,{type:Vl["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(...Nd(e.WebGLRenderingContext.prototype,Vl.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Nd(e.WebGL2RenderingContext.prototype,Vl.WebGL2,t,i,r,e,n)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,i){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==i){var s=r.map(t=>n(t,e));this.mutationCb({id:i,type:r[0].type,commands:s}),this.pendingCanvasMutations.delete(t)}}}},Vd=class{constructor(t){var e;Ou(this,"trackedLinkElements",new WeakSet),Ou(this,"pendingDeferredSheets",new Set),Ou(this,"mutationCb",void 0),Ou(this,"adoptedStyleSheetCb",void 0),Ou(this,"maskAllElementAttributes",void 0),Ou(this,"maskAttributeFn",void 0),Ou(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=Gu(r))}catch(t){}if(!i||!r)return Ru(),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=au(),d=hu(),v=!0;try{if(s)return a=!0,Ru(),!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?(Ru(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(Ru(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),du(l=au()-h,null!=(u=d)?u:lu)||(ku.totalMs+=l,l>ku.slowestSliceMs&&(ku.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:Yu({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=au();try{Eu(()=>{try{var e=t.rules||t.cssRules;e&&Tu(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:ju(e,t.href),index:i}))})})}finally{Mu(au()-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(),Sh.forEach(t=>t.abort()),Sh.clear()}trackStylesheetInLinkElement(t){}},Gd=class{constructor(){Ou(this,"nodeMap",new WeakMap),Ou(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(){}},Zd=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Qd,Jd=document.createElement("iframe");document.body.appendChild(Jd),Array.from=(null===(Qd=Jd.contentWindow)||void 0===Qd?void 0:Qd.Array.from)||Array.from,document.body.removeChild(Jd)}}catch(t){console.debug("Unable to override Array.from",t)}var Kd=new Zu,Yd=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 tv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=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,_=i.inlineStylesheet,b=void 0===_||_,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,E=i.maskAllElementAttributes,M=void 0!==E&&E,I=i.maskAttributeFn,R=i.hooks,A=i.packFn,P=i.sampling,O=void 0===P?{}:P,F=i.dataURLOptions,D=void 0===F?{}:F,L=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,B=i.recordDOM,j=void 0===B||B,U=i.recordCanvas,H=void 0!==U&&U,z=i.recordCrossOriginIframes,W=void 0!==z&&z,V=i.recordAfter,G=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,Z=i.userTriggeredOnInput,Q=void 0!==Z&&Z,J=i.collectFonts,K=void 0!==J&&J,Y=i.inlineImages,X=void 0!==Y&&Y,tt=i.plugins,et=i.keepIframeSrcFn,it=void 0===et?()=>!1:et,rt=i.ignoreCSSAttributes,nt=void 0===rt?new Set([]):rt,st=i.attributeFilter;td=i.errorHandler;var ot=s({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===O.mousemove&&(O.mousemove=q),Kd.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};Ud=(t,e)=>{var i,s=t;if(s.timestamp=Nh(),!(null===(i=ld[0])||void 0===i?void 0:i.isFrozen())||s.type===Ul.FullSnapshot||s.type===Ul.IncrementalSnapshot&&Yd.has(s.data.source)||ld.forEach(t=>t.unfreeze()),at)null==r||r(gt(s),e);else if(lt){var a={type:"rrweb",event:gt(s),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(s.type===Ul.FullSnapshot)ut=s,ft=0;else if(s.type===Ul.IncrementalSnapshot){if(s.data.source===Hl.Mutation&&s.data.isAttachIframe)return;ft++,(o&&ft>=o||n&&s.timestamp-ut.timestamp>n)&&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 n=Kd.getNode(r.node.id);n&&"IFRAME"===n.nodeName&&i.add(n)}t.removes.forEach(t=>{var r=t.id;if(!e||!e.has(r)){var n=wt.getIframeElementById(r);n&&i.has(n)?wt.forgetIframeId(r):(null==vt||vt(r),wt.removeIframeById(r))}}),null==ct||ct(),wt.cleanupDetachedIframes()}Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Mutation},t)})},yt=t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Scroll},t)}),_t=t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.CanvasMutation},t)}),bt=new Vd({mutationCb:mt,adoptedStyleSheetCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.AdoptedStyleSheet},t)}),maskAllElementAttributes:M,maskAttributeFn:I}),wt=new kd({mirror:Kd,mutationCb:mt,stylesheetManager:bt,recordCrossOriginIframes:W,wrappedEmit:Ud});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Kd,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Gd,xt=null==N?void 0:N.configured;zd=new Wd({recordCanvas:H,mutationCb:_t,win:window,blockClass:l,blockSelector:h,mirror:Kd,sampling:O.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new Sd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,sampling:O,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:bt,canvasManager:zd,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Kd});Hd=function(t){if(void 0===t&&(t=!1),j){Su(w);try{Ud({type:Ul.Meta,data:{href:window.location.href,width:jh(),height:Bh()}},t),null==e||e.cancel(),e=void 0,bt.reset(),Ct.init(),ld.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Zu:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,u=i.maskTextClass,h=void 0===u?"rr-mask":u,d=i.maskTextSelector,v=void 0===d?null:d,c=i.inlineStylesheet,f=void 0===c||c,p=i.inlineImages,g=void 0!==p&&p,m=i.recordCanvas,y=void 0!==m&&m,_=i.canvasMaskingConfigured,b=i.maskAllInputs,w=void 0!==b&&b,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,E=i.slimDOM,M=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,A=i.onIframeLoad,P=i.iframeLoadTimeout,O=i.onIframeListenerRegistered,F=i.onStylesheetLoad,D=i.stylesheetLoadTimeout,L=i.keepIframeSrcFn,N=void 0===L?()=>!1:L,q=i.maxDepth,B=i.inlineStylesheetBudgetRules,j=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===w?{password:!0}:w,U=Ih(void 0!==E&&E);Su(B);try{return Mh(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:j,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:U,dataURLOptions:M,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:_,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:P,onIframeListenerRegistered:O,onStylesheetLoad:F,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{xu()}}(document,{mirror:Kd,blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,slimDOM:dt,dataURLOptions:ot,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){Gh(t,Kd)&&wt.addIframe(t),Zh(t,Kd)&&bt.trackLinkElement(t),Qh(t)&&Ct.addShadowRoot(ou.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){bt.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=yu,yu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(Ud({type:Ul.FullSnapshot,data:{node:r,initialOffset:qh(window)}},t),ld.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&&Oh(()=>{o=e.beginDeferredLinkInlining(i,Kd.getId(i))})},u=()=>{if(o){var t=o,e=!0;Oh(()=>{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,Au(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);Au(v),null==o||o.discard(),o=null}i()}}}}(i,bt,()=>{e===n&&(e=void 0)});e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,Kd.getId(document))}finally{xu()}var s}};try{var Tt=[];for(var Et of(Tt.push(Ah("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(Ah(Et,uu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{Oh(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=Kd.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==vt||vt(e)}catch(t){null==vt||vt(e)}else null==vt||vt(e)}};var Mt=t=>{var e;return ad(yd)({mutationCb:mt,mousemoveCb:(t,e)=>Ud({type:Ul.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.ViewportResize},t)}),inputCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Input},t)}),mediaInteractionCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.MediaInteraction},t)}),styleSheetRuleCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.StyleSheetRule},t)}),styleDeclarationCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.StyleDeclaration},t)}),canvasMutationCb:_t,fontCb:t=>Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Font},t)}),selectionCb(t){Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.Selection},t)})},customElementCb(t){Ud({type:Ul.IncrementalSnapshot,data:s({source:Hl.CustomElement},t)})},blockClass:l,ignoreClass:v,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:b,sampling:O,recordDOM:j,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:M,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:h,slimDOMOptions:dt,dataURLOptions:ot,mirror:Kd,iframeManager:wt,stylesheetManager:bt,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=>Ud({type:Ul.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Kd.getId(t),i=Mt(t.contentDocument);if("function"==typeof i&&(Tt.push(i),-1!==e)){var r=pt.get(e);r||pt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}}),wt.addPageHideListener(t=>{var e=Kd.getId(t);null==vt||vt(e),vd(t)});var It=-1,Rt=t=>Ud({type:Ul.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?Kd.getId(s):-1;o!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{Hd();var t=Mt(document);"function"==typeof t&&Tt.push(t),Tt.push(Ah("fullscreenchange",At)),Tt.push(Ah("webkitfullscreenchange",At)),Tt.push(Ah("mozfullscreenchange",At)),Tt.push(Ah("MSFullscreenChange",At)),Zd=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(Ah("DOMContentLoaded",()=>{Ud({type:Ul.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(Ah("load",()=>{Ud({type:Ul.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,Tt.forEach(t=>Oh(t)),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Kd.reset(),Zd=!1,td=void 0}}catch(t){console.warn(t)}}function ev(t){return ev="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},ev(t)}function iv(t,e,i){return(e=function(t){var e=function(t){if("object"!=ev(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=ev(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ev(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}tv.addCustomEvent=(t,e)=>{if(!Zd)throw new Error("please add custom event after start recording");Ud({type:Ul.Custom,data:{tag:t,payload:e}})},tv.freezePage=()=>{ld.forEach(t=>t.freeze())},tv.takeFullSnapshot=t=>{if(!Zd)throw new Error("please take full snapshot after start recording");Hd(t)},tv.mirror=Kd,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var rv=class{constructor(t){iv(this,"fileName",void 0),iv(this,"functionName",void 0),iv(this,"lineNumber",void 0),iv(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}},nv=/(^|@)\S+:\d+/,sv=/^\s*at .*(\S+:\d+|\(native\))/m,ov=/^(eval@)?(\[native code])?$/,av={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(sv)?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(sv)},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 rv({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(ov)},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 rv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new rv({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 rv({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 rv({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(nv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new rv({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function lv(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 uv(t){return Array.isArray(t)}function hv(t){return"object"==typeof t&&null!==t&&!uv(t)}function dv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(hv(t[i])&&dv(t[i],e-1))return!0;return!1}function vv(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(hv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||hv(o)&&dv(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]=uv(u)?lv(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 cv={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 fv(t,e,i){var r,n=i?Object.assign({},cv,i):cv,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:av.parse(e.error).map(t=>t.toString()),payload:[vv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[vv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[vv("Uncaught (in promise)",n.stringifyOptions),vv(e.reason,n.stringifyOptions)]),t({level:"error",trace:av.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=av.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>vv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[vv("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 pv=t=>({name:"rrweb/console@1",observer:fv,options:t}),gv=()=>{},mv=t=>{var e;if(Te(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function yv(t,e,i){try{if(!(e in t))return gv;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 Te(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=mv(i);s;){if(s.next===n)return void(s.next=r.next);s=mv(i=s.next)}else t[e]=r.next}}catch(t){return gv}}function _v(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var bv=Tn("[Recorder]"),wv=t=>"navigation"===t.entryType,kv=t=>"resource"===t.entryType;function Sv(t,e){return!!e&&(De(e)||e[t])}function xv(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 Cv=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Tv(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:!!xv(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Cv))return!1;if(De(i))return!0;if(Ce(i))return n(i);var s=i[e];return De(s)?s:n(s)}function Ev(t,e,i,r,n,s){return Mv.apply(this,arguments)}function Mv(){return Mv=a(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=>kv(t)&&t.initiatorType===e&&(Ie(r)||t.startTime>=r)&&(Ie(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),Ev(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(Oe(e))return null;var n=_v(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Re(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(Le(e))return Un(e);if(Ee(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 Rv=t=>!Pe(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Av(t){var e=t.entry,i=t.method,r=t.status,n=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=[s({},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:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:o})];if(Rv(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 Pv=["video/","audio/"];function Ov(t){return Ee(t)&&Te(t.getReader)&&Te(t.tee)}var Fv="[SessionReplay] Timeout while trying to read body",$v="[SessionReplay] Failed to read body";function Dv(t){return $v+": "+t}function Lv(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function Nv(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(Dv(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e($v)}})}(t);var i=Ds(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(Lv(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($v)}var u=a.body;if(Ov(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o($v)}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(Lv(e));d+=a.byteLength,h.push(a)}t()}},t=>o(Dv(t)))}()}else try{a.text().then(t=>o(t),t=>o(Dv(t)))}catch(t){o($v)}})}(t,i)}function qv(){return qv=a(function*(t){var e=t.r,i=t.options,r=_v(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):Nv(e,i)}),qv.apply(this,arguments)}function Bv(){return Bv=a(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=Pv.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=_v(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Pe(r)?Nv(e,i):Promise.resolve(r)}),Bv.apply(this,arguments)}var jv=null;function Uv(t,e,i){if(!("performance"in e))return()=>{};if(jv)return bv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},Ls,i):Ls,n=e=>{var i=[],n=!1;e.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!n){var s=r.maskRequestFn(t);e||(n=!s||(t=>!!t&&Ws.has(t))(s)),s&&i.push(s)}}),i.length>0&&t(s({},e,{requests:i}))},o=function(t,e,i){i.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>wv(t)||kv(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>Av({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=>wv(t)||kv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Av({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()}}(n,e,r),l=()=>{},u=()=>{};return(r.recordHeaders||r.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Sv("request",i.recordHeaders),n=Sv("response",i.recordHeaders),s=yv(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=>(Tv({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 _=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",_),d.removeEventListener("abort",_),d.removeEventListener("timeout",_)},b=()=>{if(d.readyState===d.DONE){_(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)}),n&&(p.responseHeaders=r),Tv({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=Iv({body:d.response,options:i,url:a})),Ev(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:Av({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",b),d.addEventListener("error",_),d.addEventListener("abort",_),d.addEventListener("timeout",_)}catch(t){bv.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)});return()=>{s()}}(n,e,r),u=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Sv("request",i.recordHeaders),n=Sv("response",i.recordHeaders),s=yv(e,"fetch",s=>function(){var o=a(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),!Ov(null==a?void 0:a.body)&&Tv({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return qv.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=xv(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),Tv({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return Bv.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{Ev(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:Av({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 o.apply(this,arguments)}}());return()=>{s()}}(n,e,r)),jv=()=>{o(),l(),u(),jv=null}}var Hv,zv,Wv,Vv,Gv,Zv,Qv,Jv,Kv,Yv,Xv,tc,ec,ic,rc,nc=t=>({name:"rrweb/network@1",observer:Uv,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:pv,getRecordNetworkPlugin:nc},b.__PosthogExtensions__.rrweb={record:tv,version:"v2",wasMaxDepthReached:()=>Eh,resetMaxDepthState(){Eh=!1,Th=!1},getLastSnapshotCost:()=>gu,getMutationCost:()=>s({},wu),resetSnapshotCostState(){vu=0,cu=0,fu=0,lu=0,pu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},gu=null,mu=null,yu=[],_u=0,bu=0,wu={slowestBatchMs:0},ku={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:tv,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:pv},b.getRecordNetworkPlugin=nc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new jl(t,e);var sc,oc,ac,lc,uc={},hc=[],dc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vc=Array.isArray;function cc(t,e){for(var i in e)t[i]=e[i];return t}function fc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function pc(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 gc(t,o,r,n,null)}function gc(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?++Wv:n,__i:-1,__u:0};return null==n&&null!=zv.vnode&&zv.vnode(s),s}function mc(t){return t.children}function yc(t,e){this.props=t,this.context=e}function _c(t,e){if(null==e)return t.__?_c(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?_c(t):null}function bc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=cc({},e);s.__v=e.__v+1,zv.vnode&&zv.vnode(s),Rc(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?_c(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,Pc(r,s,n),e.__e=e.__=null,s.__e!=i&&wc(s)}}function wc(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}),wc(t)}function kc(t){(!t.__d&&(t.__d=!0)&&Vv.push(t)&&!Sc.__r++||Gv!=zv.debounceRendering)&&((Gv=zv.debounceRendering)||Zv)(Sc)}function Sc(){try{for(var t,e=1;Vv.length;)Vv.length>e&&Vv.sort(Qv),t=Vv.shift(),e=Vv.length,bc(t)}finally{Vv.length=Sc.__r=0}}function xc(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||hc,_=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]=gc(null,o,null,null,null):vc(o)?o=t.__k[s]=gc(mc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=gc(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=Tc(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=_c(a)),$c(a,a));return r}(i,e,y,l,_),d=0;_>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||uc,c.__i=d,g=Rc(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=Cc(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 Cc(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=Cc(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=_c(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Tc(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 Ec(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||dc.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||Ec(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||Ec(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[Yv]=r[Yv]:(i[Yv]=tc,t.addEventListener(e,s?ic:ec,s)):t.removeEventListener(e,s?ic:ec,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[Kv])e[Kv]=tc++;else if(i[Yv]>e[Kv])return;return i(zv.event?zv.event(e):e)}}}function Rc(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,_=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],b=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(_?e.__c=v=new C(y,b):(e.__c=v=new yc(y,b),v.constructor=C,v.render=Dc),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),_&&null==v.__s&&(v.__s=v.state),_&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=cc({},v.__s)),cc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)_&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),_&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(_&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,b),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,b)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some(function(t){t&&(t.__=e)}),hc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,b),_&&null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(f,p,g)})}if(v.context=b,v.props=y,v.__P=t,v.__e=!1,w=zv.__r,k=0,_)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),hc.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=cc(cc({},r),v.getChildContext())),_&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===mc&&null==h.key?Oc(h.props.children):h,a=xc(t,vc(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--;)fc(s[x]);Ac(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||Ac(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||uc,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=""),xc("template"==e.type?t.content:t,vc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&_c(i,0),a,l),null!=s)for(u=s.length;u--;)fc(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 Ac(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Ac))}function Pc(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 Oc(t){return"object"!=typeof t||null==t||t.__b>0?t:vc(t)?t.map(Oc):void 0!==t.constructor?null:cc({},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 $c(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]&&$c(r[n],e,i||"function"!=typeof t.type);i||fc(t.__e),t.__c=t.__=t.__e=void 0}function Dc(t,e,i){return this.constructor(t,i)}function Lc(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=[],Rc(e,t=(!r&&i||e).__k=pc(mc,null,[t]),n||uc,uc,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),Pc(s,t,o),t.props.children=null}Hv=hc.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}},Wv=0,yc.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=cc({},this.state);"function"==typeof t&&(t=t(cc({},i),this.props)),t&&cc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),kc(this))},yc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),kc(this))},yc.prototype.render=mc,Vv=[],Zv="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qv=function(t,e){return t.__v.__b-e.__v.__b},Sc.__r=0,Jv=Math.random().toString(8),Kv="__d"+Jv,Yv="__a"+Jv,Xv=/(PointerCapture)$|Capture$/i,tc=0,ec=Ic(!1),ic=Ic(!0),rc=0;var Nc=0,qc=[],Bc=zv,jc=Bc.__b,Uc=Bc.__r,Hc=Bc.diffed,zc=Bc.__c,Wc=Bc.unmount,Vc=Bc.__;function Gc(t,e){Bc.__h&&Bc.__h(oc,t,Nc||e),Nc=0;var i=oc.__H||(oc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Zc(t){return Nc=1,function(t,e){var i=Gc(sc++,2);if(i.t=t,!i.__c&&(i.__=[of(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=oc,!oc.__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};oc.__f=!0;var n=oc.shouldComponentUpdate,s=oc.componentWillUpdate;oc.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)},oc.shouldComponentUpdate=r}return i.__N||i.__}(of,t)}function Qc(t,e){var i=Gc(sc++,3);!Bc.__s&&sf(i.__H,e)&&(i.__=t,i.u=e,oc.__H.__h.push(i))}function Jc(t){return Nc=5,Kc(function(){return{current:t}},[])}function Kc(t,e){var i=Gc(sc++,7);return sf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Yc(t){var e,i=oc.context[t.__c],r=Gc(sc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(oc)),i.props.value):t.__}function Xc(){for(var t;t=qc.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(rf),e.__h.some(nf),e.__h=[]}catch(i){e.__h=[],Bc.__e(i,t.__v)}}}Bc.__b=function(t){oc=null,jc&&jc(t)},Bc.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Vc&&Vc(t,e)},Bc.__r=function(t){Uc&&Uc(t),sc=0;var e=(oc=t.__c).__H;e&&(ac===oc?(e.__h=[],oc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Xc(),sc=0)),ac=oc},Bc.diffed=function(t){Hc&&Hc(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==qc.push(e)&&lc===Bc.requestAnimationFrame||((lc=Bc.requestAnimationFrame)||ef)(Xc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),ac=oc=null},Bc.__c=function(t,e){e.some(function(t){try{t.__h.some(rf),t.__h=t.__h.filter(function(t){return!t.__||nf(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],Bc.__e(i,t.__v)}}),zc&&zc(t,e)},Bc.unmount=function(t){Wc&&Wc(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{rf(t)}catch(t){e=t}}),i.__H=void 0,e&&Bc.__e(e,i.__v))};var tf="function"==typeof requestAnimationFrame;function ef(t){var e,i=function(){clearTimeout(r),tf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);tf&&(e=requestAnimationFrame(i))}function rf(t){var e=oc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),oc=e}function nf(t){var e=oc;t.__c=t.__(),oc=e}function sf(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function of(t,e){return"function"==typeof e?e(t):e}var af={GZipJS:"gzip-js",Base64:"base64"},lf={Activation:"events",Cancellation:"cancelEvents"},uf={Button:"button",Tab:"tab",Selector:"selector"},hf={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},df={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},vf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},cf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},ff={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},pf={Once:"once",Recurring:"recurring",Always:"always"},gf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},mf={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},yf={Popover:"popover",Inline:"inline"};function _f(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Te(i.then)&&i.then(void 0,()=>{})}}}}var bf=Tn("[Surveys]");function wf(t){return!(!t.start_date||t.end_date)}function kf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Sf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),xf=t=>Sf("seenSurvey_",t),Cf=t=>{try{var e=xf(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){bf.error("Failed to persist survey seen state",t)}},Tf=[vf.Popover,vf.Widget,vf.API],Ef={ignoreConditions:!1,ignoreDelay:!1,displayType:yf.Popover},Mf="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 If=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}},Rf=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 If.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 Of}},Af=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};l&&!Ie(l.crypto)&&crypto.getRandomValues&&(Af=t=>crypto.getRandomValues(t));var Pf,Of=class{nextUint32(){return this.Pe.length>this.ai||(Af(this.Pe),this.ai=0),this.Pe[this.ai++]}constructor(){this.Pe=new Uint32Array(8),this.ai=1/0}},Ff=()=>$f().toString(),$f=()=>(Pf||(Pf=new Rf)).generate(),Df="",Lf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Nf=null,qf={si(){if(!Pe(Nf))return Nf;if(Nf=!1,d)try{var t="__ph_cookie_support_"+Ff();qf.ui(t,"xyz"),Nf='"xyz"'===Ia(t),qf.hi(t)}catch(t){Nf=!1}return Nf},ci(t){Cn.error("cookieStore error: "+t)},li:Ia,di(t){var e;try{e=JSON.parse(qf.li(t))||{}}catch(t){}return e},ui(t,e,i,r,n){if(!d)return!1;try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=d),Df)return Df;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_"+Ff();!Df&&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",Df=s)}return Df}(t);if(!i){var r=(t=>{var e=t.match(Lf);return e?e[0]:""})(t);r!==i&&Cn.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(d.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&&Cn.warn("cookieStore warning: large cookie, len="+u.length),d.cookie=u,!0}catch(t){return!1}},hi(t,e){if(null!=d&&d.cookie)try{qf.ui(t,"",-1,e)}catch(t){return}}},Bf=null,jf={si(){if(!Pe(Bf))return Bf;var t=!0;if(Ie(l))t=!1;else try{var e="__mplssupport__";jf.ui(e,"xyz"),'"xyz"'!==jf.li(e)&&(t=!1),jf.hi(e)}catch(e){t=!1}return t||Cn.error("localStorage unsupported; falling back to cookie store"),Bf=t,t},ci(t){Cn.error("localStorage error: "+t)},li(t){try{return null==l?void 0:l.localStorage.getItem(t)}catch(t){jf.ci(t)}return null},di(t){try{return JSON.parse(jf.li(t))||{}}catch(t){}return null},ui(t,e){try{return null==l||l.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){jf.ci(t)}return!1},hi(t){try{null==l||l.localStorage.removeItem(t)}catch(t){jf.ci(t)}}},Uf=[ct,st,nt,at,lt,ut,At,Rt,Mt],Hf=[S,k,Z,Q,Nt,Lt,M,Pt],zf=t=>t+"_cpm",Wf=["__proto__","constructor","prototype"],Vf=t=>{if(!Ee(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Wf.indexOf(i)&&(e[i]=t[i])}),e},Gf=function(t,e){void 0===e&&(e=[]);var i={};return[...Hf,...e].forEach(e=>{var r=t[e];Ie(r)||Pe(r)||""===r||(i[e]=r)}),i},Zf=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var n=t.charCodeAt(r);e=33*e^n,i=Math.imul(i^n,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},Qf=(t,e)=>({p:e,f:Zf(JSON.stringify(t))}),Jf=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=qf.di(zf(t)),r=(null==i?void 0:i.f)===Zf(e)&&Ce(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Kf=(t,e)=>e+"|"+(qf.li(zf(t))||""),Yf={},Xf={si:()=>!0,ci(t){Cn.error("memoryStorage error: "+t)},li:t=>t in Yf?Yf[t]:null,di:t=>t in Yf?Yf[t]:null,ui:(t,e)=>(Yf[t]=e,!0),hi(t){delete Yf[t]}},tp=null,ep={si(){if(!Pe(tp))return tp;if(tp=!0,Ie(l))tp=!1;else try{var t="__support__";ep.ui(t,"xyz"),'"xyz"'!==ep.li(t)&&(tp=!1),ep.hi(t)}catch(t){tp=!1}return tp},ci(t){Cn.error("sessionStorage error: ",t)},li(t){try{return null==l?void 0:l.sessionStorage.getItem(t)}catch(t){ep.ci(t)}return null},di(t){try{return JSON.parse(ep.li(t))||null}catch(t){}return null},ui(t,e){try{return null==l||l.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){ep.ci(t)}return!1},hi(t){try{null==l||l.sessionStorage.removeItem(t)}catch(t){ep.ci(t)}}},ip=Tn("[Stylesheet Loader]"),rp=l,np=d,sp="#020617",op={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:hf.Right,widgetType:uf.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:sp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},ap=[hf.Center,hf.Left,hf.Right];function lp(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 up(t){var e;void 0===t&&(t=op.backgroundColor),"#"===t[0]&&(e=lp(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=lp(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 hp=(t,e,i)=>{var r=Ip(t),n=np.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var o=np.createElement("div");((t,e,i)=>{var r=s({},op,i),n=t.style,o=!ap.includes(r.position)||e===vf.Widget&&(null==i?void 0:i.widgetType)===uf.Tab;n.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(r.fontFamily)),n.setProperty("--ph-survey-box-padding",r.boxPadding),n.setProperty("--ph-survey-max-width",r.maxWidth),n.setProperty("--ph-survey-z-index",r.zIndex),n.setProperty("--ph-survey-border-color",r.borderColor),o?(n.setProperty("--ph-survey-border-radius",r.borderRadius),n.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(n.setProperty("--ph-survey-border-bottom","none"),n.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),n.setProperty("--ph-survey-background-color",r.backgroundColor),n.setProperty("--ph-survey-box-shadow",r.boxShadow),n.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),n.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),n.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||up(r.submitButtonColor)),n.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),n.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),n.setProperty("--ph-survey-rating-active-text-color",up(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||up(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",up(r.widgetColor)),n.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"),n.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||up(l);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),n.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),n.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),n.setProperty("--ph-survey-outline-color",r.outlineColor)})(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 Te(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(ip.error("prepare_external_dependency_stylesheet returned null"),null)})(np,':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||np.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},dp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage,u=t.questionSnapshots;n?(Cf(i),n.capture(gf.SENT,s({[mf.SURVEY_NAME]:i.name,[mf.SURVEY_ID]:i.id,[mf.SURVEY_ITERATION]:i.current_iteration,[mf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[mf.SURVEY_SUBMISSION_ID]:r,[mf.SURVEY_COMPLETED]:o},l&&{[mf.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},la(e,i,u),a,{$set:{[ua(i,"responded")]:!0}})),o&&(rp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Mp(i),n.reloadFeatureFlags())):bf.error("[survey sent] event not captured, PostHog instance not found.")},vp=(t,e,i)=>{return s({[mf.SURVEY_NAME]:t.name,[mf.SURVEY_ID]:t.id,[mf.SURVEY_ITERATION]:t.current_iteration,[mf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[mf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Oe(t)))},(null==e?void 0:e.surveyLanguage)&&{[mf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[mf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},la(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},cp=(t,e,i,r)=>{if(e){if(!i){var n=Tp(t),o=n?n.surveyLanguage:r;e.capture(gf.DISMISSED,s({},vp(t,n,e),o&&{[mf.SURVEY_LANGUAGE]:o},{$set:{[ua(t,"dismissed")]:!0}})),Mp(t),Cf(t),rp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else bf.error("[survey dismissed] event not captured, PostHog instance not found.")},fp=(t,e)=>{if(e){var i=(t=>Sf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Tp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(gf.ABANDONED,vp(t,r,e),{transport:"sendBeacon"})}}else bf.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),gp=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,mp=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},yp=(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?gp(t.questions,pp(t.questions)):t.questions},_p=t=>ga(t)||Ep(t),bp=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,kc(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"+rc++,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}),wp=()=>Yc(bp),kp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=cc({},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),gc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Sp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=Qn(e);return!!s&&_a[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var xp=t=>Sf("inProgressSurvey_",t),Cp=(t,e)=>{try{localStorage.setItem(xp(t),JSON.stringify(e))}catch(t){bf.error("Error setting in-progress survey state in localStorage",t)}},Tp=t=>{try{var e=localStorage.getItem(xp(t));if(e)return JSON.parse(e)}catch(t){bf.error("Error getting in-progress survey state from localStorage",t)}return null},Ep=t=>{var e=Tp(t);return!Oe(null==e?void 0:e.surveySubmissionId)},Mp=t=>{try{localStorage.removeItem(xp(t))}catch(t){bf.error("Error clearing in-progress survey state from localStorage",t)}};function Ip(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Rp(t,e,i){if(void 0===e&&(e=hf.Right),t===vf.ExternalSurvey)return{};switch(e){case hf.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case hf.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case hf.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case hf.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case hf.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case hf.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case hf.Left:return{left:"30px"};case hf.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===vf.Widget&&i===uf.Tab?"60px":"30px"}}}var Ap=0;function Pp(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:--Ap,__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 Op=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),Fp=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),$p=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),Dp=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),Lp=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pp("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"})}),Np=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Pp("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"})}),qp=Pp("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Pp("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"})}),Bp=Pp("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Pp("g",{"clip-path":"url(#clip0_2415_6911)",children:[Pp("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Pp("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Pp("g",{mask:"url(#mask0_2415_6911)",children:[Pp("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"}),Pp("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"}),Pp("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"}),Pp("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"}),Pp("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"}),Pp("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"})]})]}),Pp("defs",{children:Pp("clipPath",{id:"clip0_2415_6911",children:Pp("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function jp(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return Pp("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Bp]})}function Up(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,u=t.canGoBack,h=t.onBack,d=Yc(bp).isPreviewMode,v=!!u&&!!h,c=!a&&Pp("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==l||l.open(s)),d?null==o||o():n()},children:e});return Pp("div",{className:"bottom-section",children:[v?Pp("div",{className:"form-buttons form-buttons-with-back",children:[Pp("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&Pp(jp,{urlParams:{utm_source:"survey-footer"}})]})}function Hp(t){var e=t.question,i=t.forceDisableHtml;return Pp("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Pp(e.type===cf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&kp({component:pc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function zp(t){var e,i,r;return Pp("button",{className:"form-cancel",onClick:t.onClick,disabled:Yc(bp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,Pp("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:[Pp("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Pp("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 Wp=l;function Vp(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Yc(bp).isPopup;return Qc(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ln(Wp,"keydown",t),()=>{Wp.removeEventListener("keydown",t)}},[o]),Pp("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Pp(zp,{onClick:()=>o()}),Pp("h3",{className:"thank-you-message-header",children:e}),i&&kp({component:pc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&Pp(Up,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function Gp(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Yc(bp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return Pp("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Pp(zp,{onClick:()=>u()}),e&&Pp("h3",{className:"intro-screen-header",children:e}),i&&kp({component:pc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Pp(Up,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var Zp=t=>Ce(t)&&t.every(t=>Re(t));function Qp(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=wp().isPreviewMode,d=Jc(null),v=Zc(()=>Re(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Qc(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=Kc(()=>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 ye:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case _e:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional),[c,e.validation,e.optional]),y=wn(e.validation,ye),_=wn(e.validation,_e),b=Kc(()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,_),[y,_]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return Pp(mc,{children:[Pp("div",{className:"question-container",children:[Pp(Hp,{question:e,forceDisableHtml:i,htmlFor:g}),Pp("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:_,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?k():w())},value:c}),b&&Pp("div",{className:"validation-hint",children:b})]}),Pp(Up,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Jp(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Pp(mc,{children:[Pp("div",{className:"question-container",children:Pp(Hp,{question:e,forceDisableHtml:t.forceDisableHtml})}),Pp(Up,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Kp(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Zc(()=>Fe(l)?l:Ce(l)&&l.length>0&&Fe(parseInt(l[0]))?parseInt(l[0]):Re(l)&&Fe(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=wp().isPreviewMode,y=t=>m?a(t):o(t);return Pp(mc,{children:[Pp("div",{className:"question-container",children:[Pp(Hp,{question:i,forceDisableHtml:r}),Pp("div",{className:"rating-section",children:[Pp("div",{className:"rating-options",children:["emoji"===i.display&&Pp("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=rg[i.scale])?void 0:e.map((t,e)=>Pp("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&&Pp("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:ng(i.scale).map((t,e)=>Pp(Yp,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&Pp("div",{className:"rating-text",children:[Pp("div",{children:i.lowerBoundLabel}),Pp("div",{children:i.upperBoundLabel})]})]})]}),Pp(Up,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Pe(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function Yp(t){var e=t.num,i=t.setActiveNumber;return Pp("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 Xp(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Jc(null),v=Kc(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=gp(e,pp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Zc(()=>((t,e)=>Re(t)||Zp(t)?t:e===cf.SingleChoice?null:[])(l,e.type)),f=c[0],p=c[1],g=Zc(()=>((t,e)=>{if(Re(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Zp(t)){var i=t.find(t=>!e.includes(t));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v)),m=g[0],y=g[1],_=wp().isPreviewMode,b=e.type===cf.SingleChoice,w=e.type===cf.MultipleChoice,k=e.skipSubmitButton&&b&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y(t=>s({},t,{isSelected:i,inputValue:i?t.inputValue:""})),b&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=d.current)?void 0:t.focus()},75))}if(b)return p(t),y(t=>s({},t,{isSelected:!1,inputValue:""})),void(k&&(o(t),_&&a(t)));w&&Ce(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y(t=>s({},t,{inputValue:e})),b&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y(t=>s({},t,{isSelected:!1,inputValue:""})),b&&p(null))},T=()=>!(e.optional||!Pe(f)&&(!Ce(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?Ce(f)&&(_?a([...f,m.inputValue]):o([...f,m.inputValue])):_?a(f):o(f)};return Pp(mc,{children:[Pp("div",{className:"question-container",children:[Pp(Hp,{question:e,forceDisableHtml:i}),Pp("fieldset",{className:"multiple-choice-options limit-height",children:[Pp("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:b?f===t:Ce(f)&&f.includes(t);return Pp("label",{className:n?"choice-option-open":"",children:[Pp("div",{className:"response-choice",children:[Pp("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),Pp("span",{children:n?t+":":t})]}),n&&Pp("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)})]})]}),Pp(Up,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var tg=[1,2,3,4,5],eg=[1,2,3,4,5,6,7],ig=[0,1,2,3,4,5,6,7,8,9,10],rg={2:[Np,qp],3:[$p,Fp,Op],5:[Dp,$p,Fp,Op,Lp]};function ng(t){switch(t){case 5:default:return tg;case 7:return eg;case 10:return ig}}var sg=Tn("[Surveys]");function og(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?ff.End:s;if(n.branching.type===ff.End)return ff.End;if(n.branching.type===ff.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===ff.ResponseBased){if(n.type===cf.SingleChoice){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===ff.End?ff.End:s}}else if(n.type===cf.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===ff.End?ff.End:s}}return s}return sg.warn("Falling back to next question index due to unexpected branching type"),s}var ag=Tn("[SurveyTranslations]");function lg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=ha(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?ha(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=ha(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:Te(t.get_property)?t.get_property(ct):void 0,locale:La()},ag)}(e);if(!i)return ag.info("No user language detected"),{survey:t,language:null};var r=fa(t,i,ag);return{survey:r.survey,language:r.matchedKey}}var ug=l,hg=d,dg="ph:show_survey_widget",vg="PHWidgetSurveyClickListener";function cg(t,e){try{var i=t.getBoundingClientRect(),r=ug.innerHeight,n=ug.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:op.zIndex}}catch(t){return bf.warn("Failed to calculate trigger position:",t),null}}var fg=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(gt);if(t)for(var e of t)Ep(e)&&fp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,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,_=!(!y||0>=Object.keys(y).length)&&e.Ii(p,y,m,f);if(!_||null!=(n=p.appearance)&&n.displayThankYouMessage){e.Ri(p);var b={};if((null==(o=p.appearance)?void 0:o.position)===hf.NextToTrigger&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=hg.querySelector(p.appearance.widgetSelector);k&&(b=cg(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||op.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=hp(p,e._posthog).shadow;e.gi.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Ai,properties:m,style:b,isSurveyCompleted:_,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Si=C,0>=S)return e.bi=!0,Lc(Pp(_g,s({},C)),x);var T=()=>{if(!e.Ei(p))return bf.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),n=r.survey,o=r.language;e.yi=o;var a=e.Mi(n,i),l=s({},C,{survey:a,surveyLanguage:o});e.Si=l,Lc(Pp(_g,s({},l,{survey:s({},a,{appearance:s({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},E=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,M=Fe(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*S-M);if(0>=I)return T();var R=ug.setTimeout(()=>{e.fi.delete(p.id),T()},I);e.fi.set(p.id,R)}},this.Li=t=>{var e=this.xi(t),i=e.survey,r=e.language,n=hp(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.gi.set(s,s.host),o&&Lc(Pp(wg,{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(vg),this.pi.delete(t),bf.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=hg.querySelector(Ip(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ni=(t,e)=>{var i=hg.querySelector(e),r=this.pi.get(t.id);if(i){if(this.Li(t),r){if(i===r.element)return;bf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Oi(t.id)}if(!i.hasAttribute(vg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===hf.NextToTrigger?cg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||op.maxWidth)):{};ug.dispatchEvent(new CustomEvent(dg,{detail:{surveyId:t.id,position:n}}))};Ln(i,"click",n),i.setAttribute(vg,"true"),this.pi.set(t.id,{element:i,listener:n,survey:t}),bf.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=hp(i,this._posthog).shadow;this.gi.set(n,n.host),Lc(Pp(_g,{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)),Lc(Pp(_g,{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===vf.Popover||t.type===vf.Widget),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===vf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===uf.Tab)return void e.Li(t);(null==(r=t.appearance)?void 0:r.widgetType)===uf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Ni(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Pe(e.Bi)&&t.type===vf.Popover&&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=>{Pe(this.Bi)||bf.error("Survey "+this.Bi+" already in focus. Cannot add survey "+t.id+"."),this.Bi=t.id},this.Ai=t=>{this.Bi!==t.id&&bf.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(),Ln(ug,"languagechange",this.wi),this.ki=t.onFeatureFlags(()=>this.Hi())}Hi(){var t;if(!Pe(this.Bi)){var e=null==(t=this._posthog.get_property(gt))?void 0:t.find(t=>t.id===this.Bi);if(e){var i=this.xi(e),r=i.survey,n=i.language;if(n!==this.yi&&(this.yi=n,this.bi)){var o=this.Mi(r,this.Ci),a=hp(o,this._posthog).shadow;Lc(Pp(_g,s({},this.Si,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Ai,surveyLanguage:n})),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?s({},t,{appearance:s({},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)&&(bf.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&&(ug.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)=>{Lc(null,e),null==t||t.remove()}),this.gi.clear(),this.Bi=null}ji(t){return t.sort((t,e)=>{var i,r,n=Ep(t),s=Ep(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===pf.Always,a=e.schedule===pf.Always;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})}xi(t){return lg(t,this._posthog)}qi(t,e,i){if(this.mi.has(t.id))return!1;var r=function(){var t={},e=!1,i=ug.location.search.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:e};for(var r of i.split("&")){var n=r.split("="),s=n[0],o=n[1];if(s&&!Ie(o)){var a=decodeURIComponent(s),l=decodeURIComponent(o);if("auto_submit"!==a||"true"!==l){var u=a.match(/^q(\d+)$/);if(u){var h=parseInt(u[1],10);t[h]||(t[h]=[]),t[h].push(l)}}else e=!0}}return{params:t,autoSubmit:e}}().params;if(0===Object.keys(r).length)return!1;bf.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)&&dp({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])]=Ce(o)?o.map(String):[String(o)]}bf.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=oa(t.id);try{switch(t.type){case cf.SingleChoice:if(!t.choices||0===t.choices.length)return void Cn.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 Cn.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case cf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Cn.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 Cn.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&Cn.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case cf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Cn.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Cn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Cn.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return bf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Ff(),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=oa(l.id);Ie(i[u])||(n[u]=i[u])}s.push(r);var h=og(t,r,l.id?i[oa(l.id)]:null);if(h===ff.End)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 Cp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:mp(t.questions),visitedIndices:l,surveyLanguage:i}),bf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return bf.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||Sp(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!m)return!1;var s=Ji(m,{userAgentDataPlatform:null==h||null==(i=h.userAgentData)?void 0:i.platform,maxTouchPoints:null==h?void 0:h.maxTouchPoints,screenWidth:null==l||null==(r=l.screen)?void 0:r.width,screenHeight:null==l||null==(n=l.screen)?void 0:n.height,devicePixelRatio:null==l?void 0:l.devicePixelRatio});return _a[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==np||!np.querySelector(t.conditions.selector))}(t)}Gi(t){var e;return _p(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(!wf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Tf.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,jf.li("lastSeenSurveyDate"))?(t=>!!jf.li(xf(t))&&!_p(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!pa(t)&&!kf(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=hg.querySelector(Ip(t,!0));null!=e&&e.shadowRoot&&(Lc(null,e.shadowRoot),this.gi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){bf.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(hg&&ug){var i,r=new fg(t);if(t.config.disable_surveys_automatic_display)return bf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return bf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ie(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Ie(i)||(clearInterval(i),i=void 0)};n();var o=()=>{hg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ln(hg,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),hg.removeEventListener("visibilitychange",o)}),r}}function gg(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;Qc(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===vf.Widget,s=Sp(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===uf.Tab&&i;if(!s)return bf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(bf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ln(ug,"popstate",i),Ln(ug,"hashchange",i);var s=ug.history.pushState,l=ug.history.replaceState;return ug.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()},ug.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()},()=>{ug.removeEventListener("popstate",i),ug.removeEventListener("hashchange",i),ug.history.pushState=s,ug.history.replaceState=l}}},[o,e,r,n,a])}var mg=200;function yg(t){switch(void 0===t&&(t=df.Right),t){case df.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case df.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case df.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function _g(t){var e,i,r,n,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,_=t.previewPageIndex,b=t.removeSurveyFromFocus,w=void 0===b?()=>{}:b,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,E=void 0===T?()=>{}:T,M=t.onPopupSurveyDismissed,I=void 0===M?()=>{}:M,R=t.onCloseConfirmationMessage,A=void 0===R?()=>{}:R,P=t.properties,O=t.isSurveyCompleted,F=t.skipShownEvent,D=t.surveyLanguage,L=Jc(null),N=Number.isInteger(_),q=function(t,e,i,r,n,o,a,l,u){var h=Zc(r||0===i||t.type===vf.ExternalSurvey),d=h[0],v=h[1],c=Zc(!1),f=c[0],p=c[1],g=Jc(!1),m=()=>{var e=()=>{o&&n(t),v(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+mg+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Qc(()=>{if(e){if(!r){var n,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&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},a=()=>{if(Sp(t,e)){v(!0),ug.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(gf.SHOWN,s({[mf.SURVEY_NAME]:t.name,[mf.SURVEY_ID]:t.id,[mf.SURVEY_ITERATION]:t.current_iteration,[mf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[mf.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Ln(ug,"PHSurveyClosed",y),Ln(ug,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Ie(h)&&a(),()=>{Ie(h)||clearTimeout(h),Ie(n)||clearTimeout(n),ug.removeEventListener("PHSurveyClosed",y),ug.removeEventListener("PHSurveySent",o)}}}else bf.error("usePopupVisibility hook called without a PostHog instance.")},[]),gg({survey:t,removeSurveyFromFocus:n,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,F,D),B=q.isPopupVisible,j=q.hidePopupWithAnimation,U=q.isSurveySent||_===f.questions.length||!0===O,H=Zc(!1),z=H[0],W=H[1],V=Kc(()=>!!Tp(f),[f]),G=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(r=f.appearance)&&r.introScreenDescription),Z=N?-1===_:!(null==(n=f.appearance)||!n.displayIntroScreen)&&G&&!z&&!V,Q=Kc(()=>{var t,e=(null==(t=Tp(f))?void 0:t.surveySubmissionId)||Ff();return{isPreviewMode:N,previewPageIndex:_,onPopupSurveyDismissed(){D?cp(f,g,N,D):cp(f,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:E,posthog:g,properties:P,surveyLanguage:D}},[N,_,S,g,f,I,C,E,P,D]);return B?Pp(bp.Provider,{value:Q,children:Pp("div",{className:"ph-survey",style:s({},Rp(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:U?Pp(Vp,{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||op,onClose(){j(),A()}}):Z?Pp(Gp,{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||op,onStart:()=>W(!0)}):Pp(bg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function bg(t){var e,i,r=t.survey,n=t.forceDisableHtml,o=t.posthog,a=Kc(()=>{var t=Tp(r);if(!t)return null;var e=Fe(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Mp(r),null)},[r]),l=Zc(()=>(null!=a&&a.responses&&bf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=Yc(bp),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,_=d.properties,b=d.surveyLanguage,w=Zc(()=>{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=Zc(()=>{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],E=Zc(()=>{var t,e;return null!==(t=null==(e=Tp(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),M=E[0],I=E[1],R=Kc(()=>mp(yp(r,a)),[r.id,a]),A=Kc(()=>{if(!R||new Set(R).size!==R.length)return yp(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]);Qc(()=>{!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),O=A.at(k);return O?Pp("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Pp(zp,{onClick(){c()}}),Pp("div",{className:"survey-box","data-question-index":k,children:kg({question:O,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||op,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(o)if(n){var a=oa(n),l=s({},u,{[a]:e});h(l);var d=A[i],v=null!=d&&d.id?s({},M,{[d.id]:d.question}):M;I(v);var c=og(r,i,e),f=c===ff.End,p=[...C,i];if(f||(T(p),S(c),Cp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:c,questionOrder:mp(A),visitedIndices:p,surveyLanguage:b,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=>oa(t)));dp({responses:Object.fromEntries(Object.entries(l).filter(t=>g.has(t[0]))),survey:r,surveySubmissionId:m,isSurveyCompleted:f,posthog:o,properties:_,surveyLanguage:b,questionSnapshots:v})}}else bf.error("onNextButtonClick called without a questionId.");else bf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:O.id}),onPreviewSubmit:p,initialValue:O.id?u[oa(O.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),Cp(r,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:mp(A),visitedIndices:e,surveyLanguage:b,questionSnapshots:M})}}})})]}):null}function wg(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Zc(!0),f=c[0],p=c[1],g=Zc(!1),m=g[0],y=g[1],_=Zc({}),b=_[0],w=_[1],k=Jc(void 0),S=()=>{y(!m)};if(Qc(()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(bf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Ln(ug,dg,e),()=>{Ie(k.current)||(clearTimeout(k.current),k.current=void 0),ug.removeEventListener(dg,e)}}}else bf.error("FeedbackWidget called without a PostHog instance.")},[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),gg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==pf.Always&&p(!1),Ie(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return Pp(mc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Pp("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===df.Top?"widget-tab-top":""),onClick:S,disabled:d,style:yg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Pp(_g,{posthog:h,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var kg=t=>{var e=t.question,i=t.displayQuestionIndex,r=t.onSubmit,n=t.onPreviewSubmit,o={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case cf.Open:return pc(Qp,s({},o,{question:e,key:e.id}));case cf.Link:return pc(Jp,s({},o,{question:e,key:e.id}));case cf.Rating:return pc(Kp,s({},o,{question:e,key:e.id}));case cf.SingleChoice:case cf.MultipleChoice:return pc(Xp,s({},o,{question:e,key:e.id}));default:return bf.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=pg,b.extendPostHogWithSurveys=pg;var Sg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},xg=1e4,Cg=(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),Tg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Cg(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 Cg(e,JSON.stringify(t.slice(0,n)),i)},Eg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Mg=(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}},Ig=(t,e,i)=>{if(!i.truncated)if(Ee(t)){if(i.seen.has(t))return void Mg(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(Ig(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Mg(e,t,i)},Rg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Eg(t))return!n||Cg(e,"null",i);if(Pe(t)||(t=>{try{return Fe(t)||De(t)}catch(t){return!1}})(t))return Cg(e,JSON.stringify(t),i);if("string"==typeof t)return Tg(t,e,i);if(!Ee(t)&&!Ce(t))return Cg(e,JSON.stringify(t),i);if(r.has(t))return Tg("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Te(o))return Rg(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return Tg(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return Cg(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 Rg(l,e,i,r,n,s)}if(Ce(t)){if(!Cg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Cg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Rg(d,e,i,r,!0))return!1}return Cg(e,"]",i)}if(!Cg(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{Ig(f,c,s)}catch(t){}if(Eg(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(!Cg(e,p,i))return!1;var _=e.length,b=Rg(f,e,i,r,!1),w=i.truncated;if(e.length!==_){if(v=!1,!b)return!1}else if(e.length=g,i.remaining=m,i.truncated=b?y:w,!b)return!1}}}catch(t){}return Cg(e,"}",i)},Ag=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Ee(t[0])?{result:{},keysRemaining:50,sizeRemaining:xg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Cg(i," ",r))&&Rg(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)||{}}},Pg={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Og=t=>"canCapture"in t,Fg=t=>Og(t)?t.canCapture?t.getExtension(Mf):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},n=!1,o=function(t){var o=b.console[t];i.push(yv(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&&!n&&h){var d=Fg(h);if(d){n=!0,o=!0;var v=Ag(l,xg),c=v.body,f=v.attributes,p=s({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(Og(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;Te(n)&&n.call(e,i)}})(h,d,{level:Pg[t],body:c,attributes:s({"log.source":"console."+t},p,f)})}}}catch(t){}finally{o&&(n=!1),i.apply(b.console,l)}})(i);return a.__rrweb_original__=Sg(o),a}))};for(var a of Object.keys(Pg))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=Fg(t);if(i)for(var r of e)try{var n=Ag(r.args,xg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:Pg[r.level],body:n.body,attributes:s({"log.source":"console."+r.level,host:b.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var $g=t=>Ue(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),Dg=Tn("[Error tracking]"),Lg="webkit-masked-url:",Ng=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Lg],qg=["__firefox__","__gCrWeb"];function Bg(){return new cr([new xr,new Fr,new Tr,new Cr,new Pr,new Ar,new Mr,new Or],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];return function(e,r){void 0===r&&(r=0);for(var n=[],o=e.split("\n"),a=r;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Sr.test(l)?l.replace(Sr,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){n.push(d);break}}if(n.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 s({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(n)}}("web:javascript",_r,kr))}var jg=Tn("[ExceptionAutocapture]"),Ug=Bg(),Hg=(t,e)=>{try{return t()}catch(t){return e}},zg=(t,e)=>Hg(()=>t(e()),void 0),Wg=t=>Hg(()=>Te(t)&&Te(t.call),!1),Vg=(t,e)=>Hg(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),Gg=(t,e,i)=>{Hg(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),Hg(()=>{t[e]=i},void 0)},Zg=t=>{var e=l;e||jg.info("window not available, cannot wrap onerror");var i=Hg(()=>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 zg(t,()=>Ug.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Re(e)&&Re(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}})),!!Wg(i)&&null!==(e=i(...n))&&void 0!==e&&e},Vg(e,"onerror"),()=>Gg(e,"onerror",i)},Qg=function(t,e){void 0===e&&(e=!1);var i=l;i||jg.info("window not available, cannot wrap onUnhandledRejection");var r=Hg(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return zg(t,()=>Ug.buildFromUnknown(i,{mechanism:{handled:!1}})),Wg(r)?null!==(n=r(i))&&void 0!==n&&n:e},Vg(i,"onunhandledrejection"),()=>Gg(i,"onunhandledrejection",r)},Jg={wrapOnError:Zg,wrapUnhandledRejection:Qg,wrapConsoleError(t){var e=console;e||jg.info("console not available, cannot wrap console.error");var i=Hg(()=>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];zg(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return Ug.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Wg(i)&&i(...r)},Vg(e,"error"),()=>Gg(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=Jg,b.posthogErrorWrappingFunctions=Jg;var Kg=(t,e)=>{if(Te(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Pe(i)&&"object"==typeof i&&Ce(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){jg.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){jg.error("Failed to capture exception for a legacy client",t)}};Zg(t=>{r.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),Qg(n,!0)}};b.extendPostHogWithExceptionAutoCapture=Kg,b.extendPostHogWithExceptionAutocapture=Kg;var Yg="X-POSTHOG-SESSION-ID",Xg="X-POSTHOG-WINDOW-ID",tm="X-POSTHOG-DISTINCT-ID",em=[Yg,Xg,tm],im=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],rm=(t,e)=>({}.hasOwnProperty.call(t,e)),nm=t=>"object"==typeof t&&!Pe(t)||Te(t),sm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),om=t=>{try{var e;return sm(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==l||null==(e=l.location)?void 0:e.href).toString()}catch(t){return}},am=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(Ce(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Yg,a.sessionId),n.set(Xg,l),o=!0}var u=(t=>Te(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(tm,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var lm={_patchFetch:(t,e,i)=>yv(l,"fetch",r=>function(n,o){var a=arguments.length>1?[n,o]:[n],l=a;try{var u=om(n);if(u)if(sm(n)){var h=new Request(n,o);am(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(nm(o)?o.headers:void 0);if(am(t,e,i,u,d)){var v=((t,e)=>{if(Ie(t)||Pe(t))return{headers:e};if(nm(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)=>rm(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>rm(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),im.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&&im.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var n=Reflect.getOwnPropertyDescriptor(i,e);return n?s({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);v&&(l=[n,v])}}}catch(t){l=a}return r.apply(this,l)}),_patchXHR:(t,e,i)=>yv(l.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=om(s);d&&am(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return em.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=lm,b.postHogTracingHeadersPatchFns=lm,"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 um=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)}}},hm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},dm=t=>{if("loading"===document.readyState)return"loading";var e=hm();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"},vm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},cm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[vm(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},fm=new WeakMap;function pm(t,e){var i=fm.get(e);return i||fm.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var gm,mm=-1,ym=()=>mm,_m=t=>{addEventListener("pageshow",e=>{e.persisted&&(mm=e.timeStamp,t(e))},!0)},bm=(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))}},wm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},km=()=>{var t,e;return null!==(t=null==(e=hm())?void 0:e.activationStart)&&void 0!==t?t:0},Sm=-1,xm=new Set,Cm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Tm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of xm)e();isFinite(Sm)||(Sm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Tm,!0))}},Em=function(t){if(void 0===t&&(t=!1),t&&(Sm=1/0),0>Sm){var e,i,r=km();Sm=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:Cm(),addEventListener("visibilitychange",Tm,!0),addEventListener("prerenderingchange",Tm,!0),_m(()=>{setTimeout(()=>{Sm=Cm()})})}return{get firstHiddenTime(){return Sm},onHidden(t){xm.add(t)}}},Mm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=hm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>ym()?a&&(document.prerendering||km()>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}},Im=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var n=new PerformanceObserver(t=>{queueMicrotask(()=>{var i=t.getEntries();r.length>1&&i.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(i)})});for(var o of r)n.observe(s({type:o,buffered:!0},i));return n}}catch(t){}},Rm=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},Am=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Pm=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Om=class{constructor(){this.u=void 0}},Fm=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},$m=[1800,3e3],Dm=function(t,e){void 0===e&&(e={});var i=Rm(e);Fm(()=>{var r,n=pm(e,Om),s=Em(),o=Mm("FCP"),a=Im(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-km(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=bm(t,o,$m,e.reportAllChanges),_m(i=>{o=Mm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ym()),r=bm(t,o,$m,e.reportAllChanges),wm(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Im(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&Am(n.u,i),o=Mm("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=bm(t,o,$m,e.reportAllChanges))(!0)})},e)})},Lm=[.1,.25],Nm=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],qm=function(t,e){void 0===e&&(e={});var i=pm(e=Object.assign({},e),um),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Nm(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:cm(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=Em();Dm(Pm(()=>{var r,n=Mm("CLS",0),s=pm(e,um),o=(i,o,a,l,u)=>{n=Mm("CLS",0,i,o,a,l,u),s.o=0,r=bm(t,n,Lm,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"];Rm(e)&&h.push("soft-navigation");var d=Im(h,u);d&&(r=bm(t,n,Lm,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),_m(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,ym()),wm(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=Nm(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:dm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},Bm=function(t,e){void 0===e&&(e={});var i=pm(e=Object.assign({},e),Om);Rm(e)&&(i.u=new Map),Dm(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:dm(ym())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=hm(),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:dm(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)},jm=0,Um=1/0,Hm=0,zm=t=>{for(var e of t)e.interactionId&&(Um=Math.min(Um,e.interactionId),Hm=Math.max(Hm,e.interactionId),jm=Hm?(Hm-Um)/7+1:0)},Wm=()=>{var t;return gm?jm:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Vm=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return Wm()-this.h}D(){this.h=Wm(),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)}}}},Gm=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Pm(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Zm=[200,500],Qm=function(t,e){void 0===e&&(e={});var i=pm(e=Object.assign({},e),Vm),r=[],n=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(Gm(d),u=!0)},d=()=>{var t=new Set(i.v.map(t=>a.get(t.entries[0]))),e=n.length-10;n=n.filter((i,r)=>r>=e||t.has(i));var s=new Set;for(var l of n)for(var h of v(l.startTime,l.processingEnd))s.add(h);r=r.filter(t=>t.startTime>o||s.has(t)),u=!1};i.m=t=>{var i,r=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var s=n.length-1;s>=0;s--){var l=n[s];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),t.interactionId&&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:cm(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};Im(["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=Em();Fm(()=>{var r;"interactionCount"in performance||gm||(gm=Im(["event"],zm,{durationThreshold:0}));var n,o=Mm("INP"),a=pm(e,Vm),l=(i,r,s,l,u)=>{a.D(),o=Mm("INP",-1,i,r,s,l,u),n=bm(t,o,Zm,e.reportAllChanges)},u=()=>{var t=a.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,n())},h=t=>{u(),n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Gm(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&n(!0)})},v=["event","first-input"];Rm(e)&&v.push("soft-navigation");var c=Im(v,d,s({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=bm(t,o,Zm,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),_m(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ym())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:dm(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:dm(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)},Jm=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],Km=50,Ym=[];Im(["resource"],t=>{for(var e of t)Ym.push(e),Ym.length>Km&&Ym.shift()});var Xm=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(Km=e.resourceBufferSize);var i=pm(e,Jm),r=new WeakMap;Rm(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:cm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Rm(e);Fm(()=>{var n,s=Em(),o=Mm("LCP"),a=pm(e,Jm),l=(r,a,l,u,h)=>{o=Mm("LCP",-1,r,a,l,u,h),n=bm(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Em(!0))},u=t=>{a.u&&t.navigationId&&Am(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-km(),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=Im(d,h);if(v){n=bm(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Gm(()=>{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});_m(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ym()),n=bm(t,o,$,e.reportAllChanges),wm(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})}(e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n,o,a,l,u,h,d=t.entries.at(-1),v=d.url&&(Ym.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!==(n=null==(o=h=hm())?void 0:o.activationStart)&&void 0!==n?n: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=s({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))},e)},ty=-1,ey=()=>ty,iy=t=>{addEventListener("pageshow",e=>{e.persisted&&(ty=e.timeStamp,t(e))},!0)},ry=(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))}},ny=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},sy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},oy=()=>{var t,e;return null!==(t=null==(e=sy())?void 0:e.activationStart)&&void 0!==t?t:0},ay=-1,ly=new Set,uy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,hy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of ly)e();isFinite(ay)||(ay="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",hy,!0))}},dy=function(t){if(void 0===t&&(t=!1),t&&(ay=1/0),0>ay){var e,i,r=oy();ay=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:uy(),addEventListener("visibilitychange",hy,!0),addEventListener("prerenderingchange",hy,!0),iy(()=>{setTimeout(()=>{ay=uy()})})}return{get firstHiddenTime(){return ay},onHidden(t){ly.add(t)}}},vy=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>ey()?a&&(document.prerendering||oy()>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}},cy=new WeakMap;function fy(t,e){var i=cy.get(e);return i||cy.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var py,gy=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)}}},my=function(t,e,i){void 0===i&&(i={});try{var r=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(r.length>0){var n=new PerformanceObserver(t=>{queueMicrotask(()=>{var i=t.getEntries();r.length>1&&i.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),e(i)})});for(var o of r)n.observe(s({type:o,buffered:!0},i));return n}}catch(t){}},yy=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},_y=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},by=t=>{var e=!1;return()=>{e||(t(),e=!0)}},wy=class{constructor(){this.l=void 0}},ky=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Sy=[1800,3e3],xy=function(t,e){void 0===e&&(e={});var i=yy(e);ky(()=>{var r,n=fy(e,wy),s=dy(),o=vy("FCP"),a=my(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-oy(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=ry(t,o,Sy,e.reportAllChanges),iy(i=>{o=vy("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ey()),r=ry(t,o,Sy,e.reportAllChanges),ny(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&my(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&_y(n.l,i),o=vy("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=ry(t,o,Sy,e.reportAllChanges))(!0)})},e)})},Cy=[.1,.25],Ty=function(t,e){void 0===e&&(e={});var i=dy();xy(by(()=>{var r,n=vy("CLS",0),s=fy(e,gy),o=(i,o,a,l,u)=>{n=vy("CLS",0,i,o,a,l,u),s.i=0,r=ry(t,n,Cy,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"];yy(e)&&h.push("soft-navigation");var d=my(h,u);d&&(r=ry(t,n,Cy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),iy(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,ey()),ny(r)}),setTimeout(r))}))},Ey=0,My=1/0,Iy=0,Ry=t=>{for(var e of t)e.interactionId&&(My=Math.min(My,e.interactionId),Iy=Math.max(Iy,e.interactionId),Ey=Iy?(Iy-My)/7+1:0)},Ay=()=>{var t;return py?Ey:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Py=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Ay()-this.u}M(){this.u=Ay(),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)}}}},Oy=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=by(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Fy=[200,500],$y=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=dy();ky(()=>{var r;"interactionCount"in performance||py||(py=my(["event"],Ry,{durationThreshold:0}));var n,o=vy("INP"),a=fy(e,Py),l=(i,r,s,l,u)=>{a.M(),o=vy("INP",-1,i,r,s,l,u),n=ry(t,o,Fy,e.reportAllChanges)},u=()=>{var t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,n())},h=t=>{u(),n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Oy(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&n(!0)})},v=["event","first-input"];yy(e)&&v.push("soft-navigation");var c=my(v,d,s({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=ry(t,o,Fy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),iy(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ey())}))})}},Dy=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},Ly=[2500,4e3],Ny=function(t,e){void 0===e&&(e={});var i=!1,r=yy(e);ky(()=>{var n,s=dy(),o=vy("LCP"),a=fy(e,Dy),l=(r,a,l,u,h)=>{o=vy("LCP",-1,r,a,l,u,h),n=ry(t,o,Ly,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=dy(!0))},u=t=>{a.l&&t.navigationId&&_y(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-oy(),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=my(d,h);if(v){n=ry(t,o,Ly,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Oy(()=>{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});iy(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ey()),n=ry(t,o,Ly,e.reportAllChanges),ny(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},qy={onLCP:Xm,onCLS:qm,onFCP:Bm,onINP:Qm,withoutAttribution:{onLCP:Ny,onCLS:Ty,onFCP:xy,onINP:$y}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=qy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=qy,b.postHogWebVitalsCallbacks=qy;var By={onLCP:Ny,onCLS:Ty,onFCP:xy,onINP:$y};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=By,b.__PosthogExtensions__.postHogWebVitalsCallbacks=By,b.postHogWebVitalsCallbacks=By,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>By;var jy={onLCP:Xm,onCLS:qm,onFCP:Bm,onINP:Qm,withoutAttribution:{onLCP:Ny,onCLS:Ty,onFCP:xy,onINP:$y}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=jy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=jy,b.postHogWebVitalsCallbacks=jy;var Uy={onLCP:Ny,onCLS:Ty,onFCP:xy,onINP:$y};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Uy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Uy,b.postHogWebVitalsCallbacks=Uy,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Uy;var Hy=class{constructor(t){this.disabled=!1===t;var e=Ee(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}},zy="$copy_autocapture",Wy=Tn("[AutoCapture]");function Vy(t,e){return e.length>t?e.slice(0,t)+"...":e}function Gy(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Kn(e));return e}function Zy(t,e){var i,r,n=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!Kn(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!Yn(f,"body")&&1e3>v.length;)if(ts(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!Kn(f.parentNode))break;if(c.has(f.parentNode))break;c.add(f.parentNode),v.push(f.parentNode),f=f.parentNode}var g="click"===n.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?v.findIndex(t=>Yn(t,"button")||Yn(t,"a")):-1;g>0&&(a=a||v.slice(0,g+1).some(t=>!ws(t)||ks(t)));var m,y,_,b=[],w={},k=!1,S=!1;if(Mn(v,t=>{var e=ws(t);if(Yn(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Rs(i))&&(d?lr(i):i)}ve(rs(t),"ph-no-capture")&&(S=!0),b.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};as.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?Vy(1024,As(t)):Vy(1024,ss(t)));var a=rs(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),Mn(t.attributes,function(i){var s;if((!ks(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Rs(i.value)&&(!Re(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=es(a).join(" ")),o["attr__"+i.name]=Vy(1024,"href"===i.name&&n?lr(a):a)}});for(var l=1,u=1,h=t;h=Gy(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,u,d)),Mn(function(t){if(!ws(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&&Rs(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],b.splice(0,g)),a||(b[0].$el_text=Yn(t,"a")||Yn(t,"button")?As(t):ss(t)),k){var x,C;b[0].attr__href=k;var T=null==(x=jn(k))?void 0:x.host,E=null==l||null==(C=l.location)?void 0:C.host;T&&E&&T!==E&&(m=k)}return{props:In((y=n.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:b},{$elements_chain:(_=b,Ce(_)?function(t){return t.map(t=>{var e,i,r="";if(t.tag_name&&(r+=t.tag_name),t.attr_class)for(var n of(t.attr_class.sort(),t.attr_class))r+="."+n.replace(/"/g,"");var o=s({},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 Rn(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[Os(t[0].toString())]=Os(e.toString())}),(r+=":")+Rn(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 Rn(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>r.attributes[t[0]]=t[1]),r})}(_)):"")},null!=(i=b[0])&&i.$el_text?{$el_text:null==(r=b[0])?void 0:r.$el_text}:{},m&&"click"===n.type?{$external_click_url:m}:{},w),target:t}}var Qy=class{Ds(){this.Ls=void 0,clearTimeout(this.Ns),this.Ns=void 0}qs(t){var e;if(!ws(t))return!0;for(var i,r=null!==(e=this.js().css_selector_ignorelist)&&void 0!==e?e:ds,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=rs(t);if(ve(e,"ph-no-capture")||ve(e,"ph-sensitive")||ks(t)||r.some(e=>ls(t,e)))return{v:!0};var i=s.parentNode;s=ts(i)?i.host:i&&Kn(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=os(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&Kn(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=os(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&&(Yn(r,"html")||Yn(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.js().css_selector_ignorelist)&&void 0!==n?n:ds;return[r,null==d?void 0:d.documentElement,null==d?void 0:d.body].some(t=>{if(!t)return!1;var e=rs(t);return ve(e,"ph-no-capture")||ve(e,"ph-sensitive")||!ws(t)||ks(t)||s.some(e=>ls(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 Hy(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(l&&d){var t=this.io=t=>{t=t||(null==l?void 0:l.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(Pe(e))return;this.ro(t,"$autocapture",e)}catch(t){Wy.error("Failed to capture event",t)}};if(Ln(l,"blur",t),Ln(d,"submit",t,{capture:!0}),Ln(d,"change",t,{capture:!0}),Ln(d,"click",t,{capture:!0}),Mn(["pointerdown","pointermove","pointerup","pointercancel"],e=>{Ln(d,e,t,{capture:!0})}),this.js().capture_copied_text){var e=this.no=t=>{t=t||(null==l?void 0:l.event);try{this.ro(t,zy)}catch(t){Wy.error("Failed to capture clipboard event",t)}};Ln(d,"copy",e,{capture:!0}),Ln(d,"cut",e,{capture:!0}),Ln(d,"paste",e,{capture:!0})}}}else Wy.info("Disabling Automatic Event Collection because this browser is not supported")}Ys(){this.Ds(),this.io&&(null==l||l.removeEventListener("blur",this.io),Mn(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==d||d.removeEventListener(t,this.io,!0)}),null==d||d.removeEventListener("submit",this.io,!0),null==d||d.removeEventListener("change",this.io,!0),null==d||d.removeEventListener("click",this.io,!0),this.io=void 0),this.no&&(null==d||d.removeEventListener("copy",this.no,!0),null==d||d.removeEventListener("cut",this.no,!0),null==d||d.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;De(r)&&(null==(i=this.Hs)||i.kv.set(R,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==d||null==(n=d.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||ve(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(R),r=this.Vs,n=this.js();if(!n.remoteRequestsDisabled&&!this.Gs)return!1;var s=n.remoteRequestsDisabled&&!this.Gs;if(Pe(r)&&!De(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||os(t);Xn(r)&&(r=r.parentNode||null);var n,o=this.Ks();"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&o.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&ys(r,o.rageclick)&&this.ro(t,"$rageclick",i);var a=e===zy,u=a?s({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!l||_s(t))return!1;if(null!=i&&i.url_allowlist&&!is(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&is(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var a=i.dom_event_allowlist;if(a&&!a.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(!us(d,null==i?void 0:i.css_selector_allowlist))return!1;if(us(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:ds))return!1;try{var v=l.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&&(as.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,u,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var h,d=Zy(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===zy){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==l||null==(p=l.getSelection())?void 0:p.toString(),y=ns(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=>Wy.error("Failed to capture event",t)),!0}}else this.Ds()}isBrowserSupported(){return Te(null==d?void 0:d.querySelectorAll)}},Jy={};function Ky(t,e){var i=os(t);return i?s({node:i,originalEvent:t,timestamp:Date.now()},e):null}function Yy(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function Xy(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var t_="canvas,video,audio,embed,object";function e_(t,e){return Fe(t)&&t>=e}function i_(t){return t>=0&&1e3>t?t:void 0}function r_(t,e){return e?i_(t-e):void 0}var n_=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=Ky(t,{type:"click"});Pe(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==d||null==d.elementsFromPoint?void 0:d.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some(t=>null==t.matches?void 0:t.matches(t_)))return;var h=Ky(r,{type:"swipe",swipeDirection:Yy(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Pe(h)||this.sn(h)||this.un(h),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=Jy[t];if(i)return i;var r=e[t];if((t=>Te(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==l||!l.Zone))return Jy[t]=r.bind(e);var n=e.document;if(n&&Te(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var a,u,h=s.contentWindow;h&&h[t]&&(r=h[t],"MutationObserver"===t&&function(t){return ve(t,"AppleWebKit")&&!ve(t,"Chrome")}(null!==(a=null==(u=e.navigator)?void 0:u.userAgent)&&void 0!==a?a:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){Cn.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&&Te(r)?Jy[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==d||d.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(){Ln(b,"click",this.an)}un(t){t.visibilityChangedDelayMs=r_(t.timestamp,this.fn),t.focusChangedDelayMs=r_(t.timestamp,this.mn),this.rn.push(t)}ln(){this.rn.length&&Ie(this.Dn)&&(this.Dn=b.setTimeout(()=>{this.Pn()},1e3))}Mn(){Ln(b,"scroll",this.hn,{capture:!0})}Tn(){Ln(b,"selectionchange",this.dn)}In(){Ln(d,"visibilitychange",this.Ze)}Rn(){Ln(b,"blur",this.gn),Ln(b,"focus",this.gn)}pn(t,e){this.rn.forEach(i=>{var r=i_(e-i.timestamp);Fe(r)&&(Ie(i[t])||i[t]>r)&&(i[t]=r)})}En(){Ln(b,"touchstart",this.yn,{capture:!0,passive:!0}),Ln(b,"touchend",this.kn,{capture:!0,passive:!0}),Ln(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==d||!d.querySelector(t_))),!!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))&&!Yn(t.node,"html")&&Kn(t.node)&&function(t,e){var i;if(!l||_s(t))return!1;var r=De(e)?ps:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ps;return!us(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,!(!l||_s(i))&&bs(i,!1).targetElementList.some(t=>Yn(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=e_(e.scrollDelayMs,this._n.scroll_threshold_ms),n=e_(e.selectionChangedDelayMs,this._n.selection_change_threshold_ms),s=e_(e.mutationDelayMs,this._n.mutation_threshold_ms),o=e_(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=Xy(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=Xy(t);this.instance.capture(i,s({},e,Zy(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 n_(t,e);var s_=Tn("[ExternalScriptsLoader]"),o_=t=>{var e=null==d?void 0:d.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]},a_=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return s_.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=o_(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(!d)return i("document not found");if(o_(e))return a_(t,e,i);var r=d.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)d.head.appendChild(r);else{var n,s=d.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):d.body.appendChild(r)}};null!=d&&d.body?s():null==d||d.addEventListener("DOMContentLoaded",s)},l_={},u_=(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=l_[n];if("fallback"===r&&s){if(o_(s))return void a_(t,s,i);delete l_[n]}a_(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=u_(t,e);l_[n]=a;var l=o_(n);null==l||null==(o=l.parentNode)||o.removeChild(l),a_(t,a,i)}else i(void 0,s)}:i)}else a_(t,u_(t,e),i)}else a_(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{a_(t,t.requestRouter.endpointFor("api",e),i)};var h_=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 Ve(t)?1:ve(Ge,t)?0:-1}get ao(){var t=this._n.opt_out_capturing_persistence_type,e="localStorage"===t?jf:qf,i=e.si()?e:Xf;if(!this.uo||this.uo!==i){this.uo=i;var r="localStorage"===t?qf:jf;r.li(this.lo)&&(this.uo.li(this.lo)||this.optInOut(Ve(r.li(this.lo))),r.hi(this.lo,this._n.cross_subdomain_cookie))}return this.uo}so(){return!!this._n.respect_dnt&&[null==h?void 0:h.doNotTrack,null==h?void 0:h.msDoNotTrack,b.doNotTrack,null==h?void 0:h.globalPrivacyControl].some(t=>Ve(t))}},d_=Tn("[Dead Clicks]"),v_=()=>!0,c_=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(L)),r=t.instance.config.capture_dead_clicks;return De(r)?r:!!Ee(r)||i},f_=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({[L]: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?d_.error("failed to load script",e):t()})}vo(){var t;if(d){if(!this.ho&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Ee(this.instance.config.capture_dead_clicks)?s({},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(d),d_.info("starting...")}}else d_.error("`document` not found. Cannot start.")}stop(){this.ho&&(this.ho.stop(),this.ho=void 0,d_.info("stopping..."))}},p_=Tn("[SegmentIntegration]");function g_(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()||Ff();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(Pt,ie)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&Te(s.then)?s.then(n):n(s)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||p_.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()||(p_.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(p_.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,oe)},identify(t){return i(t,le)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{p_.error("Failed to register the Segment integration",t),e()})},i)}var m_="posthog-js";function y_(t,e){var i=void 0===e?{}:e,r=i.organization,n=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=>s({},t,{stacktrace:t.stacktrace?s({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>s({},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&&n&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),h&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}var __=class{constructor(t,e,i,r,n,s){this.name=m_,this.setupOnce=function(o){o(y_(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},b_=class{constructor(t){this.co=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Cn.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==l?void 0:l.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?Ze(o/s,0,1,Cn):1,v=s>1?Ze(a/s,0,1,Cn):1,c=l>1?Ze(u/l,0,1,Cn):1,f=l>1?Ze(h/l,0,1,Cn):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}},w_=["flags","surveys"],k_={[w]:{exposure:"hidden"},[C]:{exposure:"hidden"},[T]:{exposure:"hidden"},[I]:{exposure:"hidden"},[M]:{exposure:"hidden"},[R]:{exposure:"event"},[A]:{exposure:"hidden"},[q]:{exposure:"hidden"},[P]:{exposure:"event"},[O]:{exposure:"hidden"},[F]:{exposure:"event"},[D]:{exposure:"event"},[L]:{exposure:"event"},[N]:{exposure:"hidden"},[B]:{exposure:"event"},[j]:{exposure:"hidden"},[U]:{exposure:"hidden"},[Z]:{exposure:"hidden"},[Q]:{exposure:"event"},[H]:{exposure:"event",shouldSkipFromEventProperties:t=>Pe(t)},[J]:{exposure:"event"},[K]:{exposure:"event"},[Y]:{exposure:"event"},[it]:{exposure:"event"},[rt]:{exposure:"hidden"},[nt]:{exposure:"hidden",storageGroup:"flags"},[st]:{exposure:"hidden",storageGroup:"flags"},[ot]:{exposure:"hidden"},[at]:{exposure:"hidden",storageGroup:"flags"},[lt]:{exposure:"hidden",storageGroup:"flags"},[ut]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ht]:{exposure:"hidden",storageGroup:"flags"},[dt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ct]:{exposure:"hidden"},[ft]:{exposure:"hidden"},[gt]:{exposure:"hidden",storageGroup:"surveys"},[mt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[yt]:{exposure:"event"},[_t]:{exposure:"hidden"},[bt]:{exposure:"hidden"},[wt]:{exposure:"hidden"},[kt]:{exposure:"hidden"},[St]:{exposure:"hidden"},[xt]:{exposure:"event"},[Ct]:{exposure:"event"},[Tt]:{exposure:"event"},[Et]:{exposure:"event"},[Mt]:{exposure:"hidden"},[It]:{exposure:"hidden"},[pt]:{exposure:"event"},[Rt]:{exposure:"hidden"},[At]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Pt]:{exposure:"hidden"},[Ot]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},[$t]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},[Lt]:{exposure:"hidden"},[Nt]:{exposure:"hidden"},[z]:{exposure:"event"},[W]:{exposure:"event"},[V]:{exposure:"event"},[G]:{exposure:"event"},[jt]:{exposure:"event"},[Ut]:{exposure:"event"},[Ht]:{exposure:"event"},[zt]:{exposure:"event"},[Wt]:{exposure:"event"},[Vt]:{exposure:"event"},[Gt]:{exposure:"event"},[Zt]:{exposure:"event"},[Qt]:{exposure:"event"},[Jt]:{exposure:"event"},[Xt]:{exposure:"event"}},S_=[[X,{exposure:"hidden"}],[tt,{exposure:"hidden"}],[et,{exposure:"hidden"}]],x_=t=>{var e=k_[t];if(e)return e;for(var i of S_){var r=i[1];if(0===t.indexOf(i[0]))return r}},C_={flags:At,surveys:mt},T_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],E_=t=>t+"_cookie_identity_change_pending",M_=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},I_="main",R_=[nt,st,at,lt,ut,At,ht,ct],A_=t=>-1!==R_.indexOf(t),P_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},O_=t=>{if(!t)return{};var e=JSON.parse(t);return Ee(e)?e:{}},F_=(t,e)=>{Mn(t,(i,r)=>{var n=x_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},$_=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&&Cn.info("Persistence loaded",t.persistence,s({},this.props)),this.update_config(t,t,e),this.save(),l){var r=()=>this.flush();Ln(l,"beforeunload",r,{capture:!1}),Ln(l,"pagehide",r,{capture:!1}),this.Lo=t=>{if(this._o&&(!t.storageArea||t.storageArea===(null==l?void 0:l.localStorage))&&t.key)if(t.key!==this.Fo){if(this.ko){var e=w_.find(e=>t.key===this.No(e));e&&this.qo(t.key,e)}}else this.qo(t.key,I_)},Ln(l,"storage",this.Lo)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Co.get(e);if(A_(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&&l&&(l.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=jf.li(t),Pe(n)){var s=this.Ho(e);return s.storageValue=null,e!==I_&&(s.persisted=!1),!1}r=O_(n)}catch(t){return!1}var o=e===I_?r:jf.di(this.Fo);if(o&&this.zo(o))return!1;var a=this.Uo(r,e,i);return e===I_&&this.ko&&!P_(this.Wo().main,r)||this.Vo(r,e,!0,n),a}zo(t){var e=this.props[k],i=t[k];return!Ie(e)&&!Ie(i)&&e!==i}Vo(t,e,i,r){var n=this.Ho(e);n.storageValue=r,e!==I_&&(n.persisted=i);try{n.fingerprint=this.Go(t,e)}catch(t){n.fingerprint=void 0}}Uo(t,e,i){var r=!1;return R_.forEach(i=>{var n,s=null==(n=x_(i))?void 0:n.storageGroup;if(!(e===I_&&this.ko&&s||e!==I_&&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&&P_(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=jf.li(this.Fo),i=this.Ho(I_),r=!1,n=!1;if(e!==i.storageValue)if(Pe(e))i.storageValue=null;else{if(t=O_(e),this.Io=!this.Mo&&this.zo(t),this.Io)return!1;n=this.Uo(t,I_,!1),!this.ko||P_(this.Wo().main,t)?this.Vo(t,I_,!0,e):i.storageValue=e,r=!0}return this.ko&&w_.forEach(e=>{var i=jf.li(this.No(e)),s=this.Ho(e),o=t||{},a=r&&R_.some(t=>{var i;return(null==(i=x_(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Pe(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.Uo(o,e,!1)||n));var l=O_(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=x_(t);null!=i&&i.volatile||(this.Ho((this.ko?null==i?void 0:i.storageGroup:void 0)||I_).fingerprint=void 0,this.Xo(t))}Yo(){R_.forEach(t=>this.Co.set(t,!0))}Do(){if(this._o)try{var t=jf.li(this.Fo),e=O_(t);this.Ho(I_).storageValue=t,R_.forEach(t=>{var i,r=this.ko?null==(i=x_(t))?void 0:i.storageGroup:void 0,n=r?jf.li(this.No(r)):null;if(r){var s=this.Ho(r);s.storageValue=n,s.persisted=!Pe(n)}var o=r&&!Pe(n)?O_(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(Ce(e)?e:[]),n=new Set(Ce(this.props[t])?this.props[t]:[]);return i.forEach(t=>n.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=Ee(e)?s({},e):{},a=Ee(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(A_(t)){var r=this.Co.get(t);if(!0!==r){var n=e;if(this._o)try{var s,o=this.ko?null==(s=x_(t))?void 0:s.storageGroup:void 0,a=o?this.No(o):this.Fo;n=O_(jf.li(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Ie(e)&&!Ce(e)||!Ie(n)&&!Ce(n)||!Ce(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(!Ee(i))return void(P_(n,i)?this.Co.delete(t):this.jo(t,!0));if(!Ie(e)&&!Ee(e)||Ie(e)&&Me(i)&&Ie(n))return void this.jo(t,!0);var v=Ee(e)?e:{},c=Ee(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&P_(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&P_(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=Gf(t,this._n.cookie_persisted_properties||[]),i=Qf(e,this._n.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=qf.li(this.Fo)||void 0;n&&Kf(this.Fo,n)===r&&(this.ra=r,this.na=n)}catch(t){}else try{var s=qf.li(this.Fo)||void 0;this.ra=s?Kf(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=qf.li(this.Fo)||void 0}catch(t){}if(!i||i===this.na)return!1;var r,n=Kf(this.Fo,i);try{r=Vf(JSON.parse(i))}catch(t){return!1}if((qf.li(this.Fo)||void 0)!==i)return!1;this.ra=n,this.na=i;var s=Jf(this.Fo,i),o=[...Hf,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Ie(e)||Pe(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[k],d=u[Pt],v=In({},u);[...Hf,...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===Hf.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=In(v,r),R_.forEach(t=>{var e=t in this.props;t in u===e&&P_(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(Pt,ee);var c=this.props[k],f=this.props[Pt];return!l||c===h&&f===d||(this.Mo=!0,this.So=!0,ep.ui(E_(this.Fo),!0),this.Qo(ct),this.Qo(st),this.Qo(nt),this.Qo(at),this.Qo(lt),this.Qo(ut),this.Qo(At),this.Qo(Rt),this.Qo(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Ie(h)||c===h)||(F_(this.props,r),this.Qo(ft)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.Qo(C)),!0}consumeCookieIdentityChange(){var t=E_(this.Fo),e=this.So||!!ep.li(t);return this.So=!1,e&&ep.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[I_],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===T_.indexOf(t.persistence.toLowerCase())&&(Cn.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=[...Hf,...t];return s({},jf,{di(t){try{var r,n={};try{r=qf.li(t)||void 0,n=r?Vf(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(jf.li(t)||"{}");if(e){var a=Jf(t,r),l=[...Hf,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Pe(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[k],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===Hf.indexOf(t)||!1!==e&&0!==e)&&delete o[t]}}),!h||"$user_state"in n||"$user_state"in o||(o[Pt]=ee),!h||("distinct_id"in u?u[k]:o[k])===v&&("$user_state"in u?u[Pt]:o[Pt])===c||(Uf.forEach(t=>delete o[t]),"identified"===u.$user_state&&"distinct_id"in u?o.$user_id=u[k]:delete o.$user_id,"identified"!==u.$user_state&&(delete o[pt],delete o[ft]),delete o.__alias)}s=In(o,u)}else s=In(n,o);return jf.ui(t,s),s}catch(t){}return null},ui(i,r,n,s,o,a){var l=jf.ui(i,r,void 0,void 0,a);try{var u=Gf(r,t);if(Object.keys(u).length){if(e){var h=zf(i),d=Qf(u,t);if(qf.ui(h,d,n,s,o,a),qf.li(h)!==JSON.stringify(d)){qf.hi(h,s);var v=Gf(r);return qf.ui(i,v,n,s,o,a),l}}qf.ui(i,u,n,s,o,a)}}catch(t){jf.ci(t)}return l},hi(t,e){try{null==l||l.localStorage.removeItem(t),qf.hi(t,e),qf.hi(zf(t),e)}catch(t){jf.ci(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,n=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&jf.si()?(e=jf,n=!0):"localstorage+cookie"===o&&i.si()?(e=i,n=!0,r=!0):"sessionstorage"===o&&ep.si()?e=ep:"memory"===o?e=Xf:"cookie"===o&&qf.si()?(e=qf,r=!0):i.si()?(e=i,n=!0,r=!0):qf.si()?(e=qf,r=!0):e=Xf,this._o=n,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=x_(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?jf.di(this.Fo):null,r={};if(e)try{Mn(r=Vf(qf.di(this.Fo)),(t,e)=>{(Ie(t)||Pe(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[k],l=null!==(s=null==i?void 0:i.$user_state)&&void 0!==s?s:"anonymous",u=n[k],h=null!==(o=n.$user_state)&&void 0!==o?o:"anonymous";if(u!==a||h!==l){this.So=!0,ep.ui(E_(this.Fo),!0);var d=In({},this.props);Uf.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Ie(a)||u===a)||(F_(d,r),delete d[ft]),this.props=d;var v=new Set;Uf.forEach(t=>{var e,i=null==(e=x_(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};Mn(this.props,(i,r)=>{var n;(null==(n=x_(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Me(e)?(jf.hi(this.No(t)),this.bo[t]={}):jf.ui(this.No(t),e)&&(this.bo[t]={persisted:!0,fingerprint:this.Go(e,t)})})}}ep.li(E_(this.Fo))&&(this.So=!0)}}da(){for(var t of w_){var e=jf.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=x_(e))?void 0:i.storageGroup)===t})}ca(t,e){var i=C_[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=x_(t))?void 0:e.storageGroup:void 0,r=i?jf.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&&Cn.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,I_);"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,I_);"written"===n&&this.ia(i),"failed"!==n&&(this.Mo=!1,this.Eo=!1,R_.forEach(t=>{var e;null!=(e=x_(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 R_.forEach(i=>{var r;(null==(r=x_(i))?void 0:r.storageGroup)===e&&t.Co.delete(i)}),1;var s=t.pa(jf,t.No(e),n,e);"failed"!==s&&R_.forEach(i=>{var r=x_(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.Co.delete(i)})};for(var o of w_)if(s(o))continue}Wo(){var t={},e={flags:{},surveys:{}};return Mn(this.props,(i,r)=>{var n,s=null==(n=x_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}Go(t,e){if(e===I_)return JSON.stringify(t)+"|"+this.ga+"|"+this.ma+"|"+this.ya;var i={};return Mn(t,(t,e)=>{var r;i[e]=null!=(r=x_(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}pa(t,e,i,r){var n,s=this.Ho(r);if(r!==I_&&!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!==I_&&(s.persisted=!0),Ie(n)||(s.fingerprint=n),this._o&&(s.storageValue=jf.li(e)),"written"):(this._n.debug&&Cn.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 w_)jf.hi(this.No(r));i?delete this.bo[I_]:this.bo={},this.ra=void 0,this.na=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Ee(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(Ee(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||Ee(e)||Ce(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==d?void 0:d.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(On(e));return i&&this.register(e),this.Po=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==d?void 0:d.referrer)?Da(t):{})}update_referrer_info(){var t;this.register_once({$referrer:qa(),$referring_domain:null!=d&&d.referrer&&(null==(t=jn(d.referrer))?void 0:t.host)||Na},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=Ba(this._n.mask_personal_data_properties,this._n.custom_personal_data_properties,this._n.disable_capture_url_hashes);this.register_once({[Lt]:this.wo?{r:M_(t.r),u:t.u?M_(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};Mn([Dt,$t],e=>{var i=this.props[e];i&&Mn(i,function(e,i){t["$initial_"+fe(i)]=e})});var e=this.props[Lt];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_"+fe(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,n=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every((t,e)=>t===r[e])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),o=r||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!i,u=!!this.Bo&&!l;l||this.sa(e,u),this._n=t,!l&&(r||n||a)&&(this.ra=void 0,this.na=void 0,this.sa(s({},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[I_],this.ua()))}finally{this.To=!1,c&&this.ha()}}_a(){var t=this.props[Lt];if(this.wo&&Ee(t)&&"string"==typeof t.r){var e=M_(t.r),i="string"==typeof t.u?M_(t.u):t.u;e===t.r&&i===t.u||this.Jo(Lt,s({},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||P_(n,e)||(this.Eo=!0),this.ta(t,n,e),null!=(r=x_(t))&&r.volatile||this.Xo(t))}Qo(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(A_(t)&&this.jo(t,!0),"$fbc_persistence"===t&&(this.Eo=!0),this.Xo(t))}Xo(t){var e,i=null==(e=x_(t))?void 0:e.storageGroup;i&&(this.Ho(i).dirty=!0)}Ho(t){return this.bo[t]||(this.bo[t]={})}},D_={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},L_={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},N_={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},q_=Tn("[RateLimiter]"),B_=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=>{q_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void q_.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!Ce(e)||!e.includes(t)}Sa(){var t;if(this.ka("$current_url")&&this.ka("$pathname")&&null!=v&&v.pathname)return""+(null!==(t=v.origin)&&void 0!==t?t:"")+v.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}},j_=Tn("[RemoteConfig]"),U_=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 j_.info("Using preloaded remote config",this.remoteConfig),void this.Ta(this.remoteConfig);if(this._instance.Ma())return void j_.warn("Remote config is disabled. Falling back to local config.");this.xa(t=>{if(!t)return j_.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){j_.error("Error loading remote config",t),this.Ta()}}Ta(t,e){!t&&e&&(0===e.statusCode?e.error||j_.warn("Failed to fetch remote config from PostHog."):j_.error("Failed to fetch remote config from PostHog."));try{this._instance.Ta(t?{ok:!0,config:t}:{ok:!1})}catch(t){j_.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){j_.error("Error loading feature flags",t)}}},H_=["fatal","error","warning","log","info","debug"],z_=!!f||!!c,W_="text/plain",V_=!1,G_=(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:"")},Z_=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),o=n[0],a=n[1],l=s({},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=Un(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},Q_=t=>{if(t.Ia)return t.Ia;var e=t.data,i=t.compression;if(e){if(i===af.GZipJS){var r=Xo(ta(Bn(e)),{mtime:0});return{contentType:W_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===af.Base64){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Bn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(Bn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=Bn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},J_=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:Z_(t.url,{compression:af.Base64}),encodedBody:Q_(s({},t,{compression:af.Base64,Ia:void 0}))}:{url:G_(t.url,"compression"),encodedBody:Q_(s({},t,{compression:void 0,Ia:void 0}))};try{e=Q_(t)}catch(e){if(Qr(t.compression,Hn(t.url,"compression")))return Cn.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Qr(t.compression,Hn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Zr(new Uint8Array(i)):ArrayBuffer.isView(i)&&Zr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(V_=!0,r()):{url:t.url,encodedBody:e}},K_=t=>{try{return J_(t)}catch(e){return Cn.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Y_=function(){var t=a(function*(t){var e=yield tn(Bn(t.data),ra.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return s({},t,{Ia:{contentType:W_,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),X_=/Failed to fetch|NetworkError|Load failed/i,tb=t=>"TypeError"===(null==t?void 0:t.name)&&X_.test((null==t?void 0:t.message)||""),eb=t=>{var e=K_(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},o=n.contentType,a=n.body,l=n.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(p){var v=new p;h={signal:v.signal,timeout:setTimeout(()=>{var e;d=!0,v.abort(ar("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var f=e=>{d&&"AbortError"===(null==e?void 0:e.name)||tb(e)?Cn.warn(e):Cn.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;c(i,s({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){Cn.error(t)}null==t.callback||t.callback(r)})).catch(f).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),f(t)}}},ib=t=>{try{var e,i=J_(t),r=i.url,n=i.encodedBody,o=null!=n?n:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(h.sendBeacon(r,u))return;var d=Ce(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Ce(d)&&d.length>1&&(null!=l?l:0)>16384){var v=Math.ceil(d.length/2),c=e=>Ce(t.data)?e:s({},t.data,{batch:e});return ib(s({},t,{data:c(d.slice(0,v))})),void ib(s({},t,{data:c(d.slice(v))}))}Cn.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),eb(s({},t,{Ea:!0}))}catch(t){Cn.warn("Beacon send failed",t)}},rb=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return Z_(i===af.GZipJS?G_(t,"compression"):t,s({},n?{[n]:Date.now().toString()}:{},i===af.GZipJS?{}:{compression:i}))},nb=[];c&&nb.push({transport:"fetch",method:eb}),f&&nb.push({transport:"XHR",method(t){var e=K_(t);if(e){var i=new f,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!=h&&h.sendBeacon&&nb.push({transport:"sendBeacon",method:ib});var sb=class{constructor(t,e){this.Ra=!0,this.Aa=[],this.Pa=Ze((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,Cn.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(s({},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&&Ce(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){Cn.error(t)}}Da(){clearTimeout(this.Oa),this.Oa=void 0}La(){var t={};return Mn(this.Aa,e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;Ie(t[n])&&(t[n]=s({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)}),this.Aa=[],t}},ob=class{constructor(t){this._instance=t,this.qa=!1,this.ja=3e3,this.Aa=[],this.Aa=[],this.Ba=!0,!Ie(l)&&"onLine"in l.navigator&&(this.Ba=l.navigator.onLine,this.Ha=()=>{this.Ba=!0,this.za()},this.Ua=()=>{this.Ba=!1},Ln(l,"online",this.Ha),Ln(l,"offline",this.Ua))}get length(){return this.Aa.length}retriableRequest(t){var e=t.retriesPerformedSoFar,r=n(t,i);$e(e)&&(r.url=Z_(r.url,{retry_count:e})),this._instance._send_request(s({},r,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.cs(s({retriesPerformedSoFar:e},r));0===t.statusCode&&Cn.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==r.callback||r.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)"),Cn.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(l)||(this.Ha&&(l.removeEventListener("online",this.Ha),this.Ha=void 0),this.Ua&&(l.removeEventListener("offline",this.Ua),this.Ua=void 0)),this.Aa)){var e=t.requestOptions;try{this._instance._send_request(s({},e,{transport:"sendBeacon"}))}catch(t){Cn.error(t)}}this.Aa=[]}},ab=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(){Ln(l,"scroll",this.Ga,{capture:!0}),Ln(l,"scrollend",this.Ga,{capture:!0}),Ln(l,"resize",this.Ga)}scrollElement(){var t;if(!this.Ja)return null==l||null==(t=l.document)?void 0:t.documentElement;for(var e of Ce(this.Ja)?this.Ja:[this.Ja]){var i,r=null==l||null==(i=l.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 l?"y"===t?l.scrollY||l.pageYOffset||(null==(e=l.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:l.scrollX||l.pageXOffset||(null==(i=l.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Qa("y")}scrollX(){return this.Qa("x")}},lb=t=>Ba(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),ub=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({[Ot]:i})}},this._instance=t,this.tl=e,this.Ya=i,this.Xa=r||lb,this.tl.onSessionId(this.Te)}Ka(){return this.Ya.props[Ot]}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(On(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+fe(i)]=e}),t}},hb=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={}}},db=Tn("[SessionId]"),vb=864e5,cb=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 hb,this.ll=(t,e)=>!(!$e(t)||!$e(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||Ff,this.dl=i||Ff;var n=this._n.persistence_name||this._n.token;if(this._sessionTimeoutMs=1e3*Ze(this._n.session_idle_timeout_seconds||1800,60,36e3,db.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=ep.di(this.cl),o=ep.di(this.fl);s&&!o?this.Ie=s:ep.hi(this.cl),ep.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&&ep.si()}ml(t){t!==this.Ie&&(this.Ie=t,this.pl()&&ep.ui(this.cl,t))}yl(){return this.Ie?this.Ie:this.pl()?ep.di(this.cl):null}bl(t){var e=this.rl;return!Pe(e)&&!Pe(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({[Z]:[e,t,i]}))}wl(){var t,e=null==(t=this._n)?void 0:t.persistence_save_debounce_ms;return $e(e)&&e>0}kl(){this.wl()?this.Ya.refreshKey(Z):(this.Ya.flush(),this.Ya.load())}Sl(){var t;if(!Pe(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({[Z]:[this._sessionActivityTimestamp,null!==(t=this.Bt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ya.flush())}}Cl(){var t=this.xl()[0],e=$e(t)?t:0,i=$e(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[Z];return Ce(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 db.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void db.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&&l&&(l.removeEventListener(se,this.ol,{capture:!1}),this.ol=void 0),this.sl=[]}gl(){this.ol=()=>{this.Sl(),this.pl()&&ep.hi(this.fl)},Ln(l,se,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(Pe(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>vb),p=c?f:$e(u)&&Math.abs(r-u)>vb,g=!1,m=h,y=!l||!!c,_=l,b=!y&&!t&&this.ll(r,d);if(b){(b=this.Tl(r))||db.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.xl();l=w[1],u=w[2]}if(y||b||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.hl(),v=this.dl(),db.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.ul=void 0,g=!0}else v||(v=this.dl(),g=!0),(m=m||l!==_)&&(db.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=$e(d)&&t&&!p?d:r,x=$e(u)?u:(new Date).getTime();this.ml(v),this._l(l,S,x),t||this.vl();var C={noSessionId:y,activityTimeout:b,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))}},fb=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&de(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>de(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function pb(){return pb=a(function*(){var t=null==h?void 0:h.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return Re(i)&&i.length>0?i:void 0}catch(t){return void Cn.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),pb.apply(this,arguments)}var gb="custom",mb="i.posthog.com",yb=/^\/static\//,_b=["/s/","/e/","/i/"],bb=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("."+mb,".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":gb),this.Il[this.apiHost]}El(t){if(yb.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&&_b.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===gb)return this.Al(t,e,this.apiHost+e);var r=mb+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)}}},wb=Tn("[PostHog ExternalIntegrations]"),kb={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Sb=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 wb.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(kb[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()}}},xb=class{constructor(t,e){this.A=t,this.Hs=e,this.Fl=new Map,this.Js=!1}add(t){var e=this;return a(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&&Te(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)}}},Cb=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)}},Tb="extensionsRemoteConfig",Eb=class{constructor(t){this.instance=t,this.Js=!1,this.A=Cn,this.$l=t.Dl,this.kv=new Cb(t),this.onEvent=t=>_f(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 _f(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.Ll.on(Tb,e);return this.$l&&e(this.$l),_f(i)},this.Nl=new xb(Cn.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(S);return"string"==typeof t?t:void 0}get library(){return{name:ra.LIB_NAME,version:ra.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 a(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 _f(this.instance.ql(t))}handleRemoteConfig(t){this.Js||(this.$l=t,this.instance.Ll.emit(Tb,t))}sendRequest(t,e){var i=this;return a(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?Z_(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?me.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())}},Mb={},Ib=0,Rb=()=>{},Ab='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Pb="Surveys module not available",Ob="sanitize_properties is deprecated. Use before_send instead",Fb="Invalid value for property_denylist config: ",$b=/^[A-Za-z0-9_-]{1,400}$/,Db=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Lb=["token","distinct_id",Bt],Nb="posthog",qb=!z_&&-1===(null==m?void 0:m.indexOf("MSIE"))&&-1===(null==m?void 0:m.indexOf("Mozilla")),Bb=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},jb=t=>{var e;return s({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Dn(null==d?void 0:d.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Rb,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:v&&Re(null==v?void 0:v.search)&&-1!==v.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==l||null==(e=l.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){Cn.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:re,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Rb},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:cs,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:Bb(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))},Ub=[["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"]],Hb=t=>{var e={};for(var i of Ub){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),Re(o)&&Ie(t.asset_host)&&(s.asset_host=o)),Ce(t.property_blacklist)&&(Ie(t.property_denylist)?s.property_denylist=t.property_blacklist:Ce(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Cn.error(Fb+t.property_denylist)),s},zb=class{constructor(){this.__forceAllowLocalhost=!1}get jl(){return this.__forceAllowLocalhost}set jl(t){Cn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Wb=(t=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(Ff());this.register({distinct_id:i,$device_id:i}),t.set_property(Pt,ee)}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 zb,this.Ql=!1,this.version=ra.LIB_VERSION,this.Kl=new Set,this.Xl="",this.Ll=new hb,this.Fl=[],this.Yl=[],this.Vl=!1,this.Wl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=jb(),this.SentryIntegration=__,this.sentryIntegration=t=>function(t,e){var i=y_(t,e);return{name:m_,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 ab(this),this.pageViewManager=new b_(this),this.rateLimiter=new B_(this),this.requestRouter=new bb(this),this.consent=new h_(this),this.externalIntegrations=new Sb(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=Re(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Re(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>Cn.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==Nb){var n,s=null!==(n=Mb[r])&&void 0!==n?n:new t;return s._init(e,i,r),Mb[r]=s,Mb[Nb][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,n,o;void 0===e&&(e={});var a,u=Re(t)?t.trim():"";if(!u)return Cn.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==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=jb(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=jb(e.defaults),d=Hb(e),v=In({},h,d,{name:i,token:u});Ee(h.rageclick)&&Ee(d.rageclick)&&(v.rageclick=In({},h.rageclick,d.rageclick)),Ee(h.session_recording)&&Ee(d.session_recording)&&(v.session_recording=In({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&Cn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:af.GZipJS;var c=this.Zl();if(this.persistence=new $_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new $_(s({},this.config,{persistence:"sessionStorage"}),c,!1),this.Xl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&ep.si()){var f=ep.di(this.Xl);Ce(f)&&f.forEach(t=>{Re(t)&&this.Kl.add(t)})}else ep.hi(this.Xl);var p=s({},this.persistence.props),g=s({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.au=new sb(t=>this.lu(t),this.config.request_queue_config),this.uu=new ob(this),this.__request_queue=[];var m=this.zl();m||(this.sessionManager=new cb(this),this.sessionPropsManager=new ub(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?(Cn.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.vu(m)},0)):(Cn.info("Initializing extensions synchronously"),this.vu(m)),ra.DEBUG=ra.DEBUG||this.config.debug,ra.DEBUG&&Cn.info("Starting in debug mode",{this:this,config:e,thisC:s({},this.config),p:p,s:g}),!this.config.identity_distinct_id||null!=(r=e.bootstrap)&&r.distinctID||(e.bootstrap=s({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(n=e.bootstrap)?void 0:n.distinctID;if(this.Vl=!!y&&!Ae(y),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var _=e.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(Pt);if(e.bootstrap.isIdentifiedID&&null!=b&&b!==_&&"anonymous"===w)this.identify(_);else if(e.bootstrap.isIdentifiedID&&null!=b&&b!==_&&"identified"===w)Cn.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(Ff()),S=e.bootstrap.isIdentifiedID?k:_;this.persistence.set_property(Pt,e.bootstrap.isIdentifiedID?ie:ee),this.register({distinct_id:_,$device_id:S})}}if(m)this.register_once({distinct_id:qt,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(Ff());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(Pt,ee)}return Ln(l,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?g_(this,()=>this.cu()):this.cu(),Te(this.config._onCapture)&&this.config._onCapture!==Rb&&(Cn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&Cn.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 pb.apply(this,arguments)}().then(t=>{t&&this.register({[x]:t})}).catch(Rb),this}fu(t){var e=t;return Re(e.name)&&Te(e.setup)}pu(t,e){this.fu(t)?e.push(()=>{this.gu().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{Cn.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)),Te(this.featureFlags.onReloading)&&Te(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,n,o,a,l,u,h=performance.now(),d=s({},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!==(n=this.logs)&&void 0!==n?n: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,c_)),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){Cn.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",[Ut]:r}),this.config.__preview_deferred_init_extensions&&Cn.info("PostHog extensions initialized ("+r+"ms)")}Ta(t){var e;if(!d||!d.body)return Cn.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=ve(r.supportedCompression,af.GZipJS)?af.GZipJS:ve(r.supportedCompression,af.Base64)?af.Base64:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.iu?this.iu:re}),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){Cn.critical("`loaded` function failed",t)}if(this.wu(),this.config.internal_or_test_user_hostname&&null!=v&&v.hostname){var t=v.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 U_(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()&&En(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(ae),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.au)||r.unload(),null==(n=this.uu)||n.unload()):this.xu()&&this.capture(ae,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?qb?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=s({},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,n=s({},t);n.timeout=n.timeout||6e4;var o,a,l,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Ie(n.compression)&&n.data&&(n.compression=af.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(Ce(o=n.data)?o:[o]).map(t=>s({},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"===n.timestampMode&&(n.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),Ce(t)?t.map(t=>s({},t,{sent_at:e})):s({},t,{sent_at:e})}(n.data))),n.url=rb(n.url,n.method,n.compression,n.timestampMode);var v=nb.filter(t=>!n.disableTransport||!t.transport||!n.disableTransport.includes(t.transport)),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,t=>t.transport===d))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var f=t=>{try{c(t)}catch(t){tb(t)?Cn.warn(t):Cn.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===af.GZipJS&&g&&"undefined"!=typeof Promise&&!V_?Y_(n).then(t=>{f(t)}).catch(e=>{if(Jr(e))return V_=!0,void f(s({},n,{compression:void 0,url:rb(t.url,t.method,void 0,t.timestampMode)}));Kr(e)&&(V_=!0),f(n)}):c(n)})(s({},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){Ib++;try{var e,i=[],r=[],n=[];En(t,t=>{if(t)if(Ce(e=t[0]))n.push(t);else if(Te(t))try{t.call(this)}catch(e){Cn.error("Error executing queued PostHog call",t,e)}else Ce(t)&&"alias"===e?i.push(t):Ce(t)&&-1!==e.indexOf("capture")&&Te(this[e])?n.push(t):r.push(t)});var s=function(t,e){En(t,function(t){try{if(Ce(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){Cn.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{Ib--}}push(e){if(Ib>0&&Ce(e)&&Re(e[0])){var i=t.prototype[e[0]];Te(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 Re(e)&&Db.test(e)?{value:e,delivered:!1}:Ee(e)&&Re(e.value)&&Db.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 Re(e)&&Db.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(Re(t)&&$b.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,n,o,a,l,u,h,d,v,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.au){if(this.is_capturing())if(!Ie(t)&&Re(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&&!Re(null==e?void 0:e.$current_url)&&(Cn.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||Cn.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,_=or(null==i?void 0:i.uuid,Ff),b={uuid:_,event:t,properties:this.calculateEventProperties(t,e||{},y,_)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&f&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),p&&(b.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens);var w="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(b.$set=null==i?void 0:i.$set);var k=Ee(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[E]:null==k?void 0:k[E],T=Ce(null==e?void 0:e.$unset)?e.$unset:[],M=(null==i?void 0:i.$unset)||[],I=-1!==T.indexOf("$fbc")||-1!==M.indexOf("$fbc"),R=this.Tu(null==(n=g)?void 0:n.fbclid,C,x,I);R&&!0===b.properties.$process_person_profile&&R.pending&&!x&&!w&&(b.$set=s({[E]:R.value},b.$set));var A=null==i?void 0:i.$unset;A&&(b.$unset=A);var P=w?void 0:this.Eu(null==i?void 0:i.$set_once,t!==ue,t===le);if(P&&(b.$set_once=P),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,d=b,v=t=>Re(t)?t.slice(0,h):t,c=new Set,b=function t(e,i){if(e!==Object(e))return v?v(e):e;if(!c.has(e)){var r;if(c.add(e),Ce(e))r=[],En(e,e=>{r.push(t(e))});else{var n={};Mn(Ue(e)?Fn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),b.timestamp=y,Ie(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=m),w&&(b.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return Vr.forEach(r),e.forEach(r),i}(b.properties,Lb)),t===gf.DISMISSED||t===gf.SENT){var O=null==e?void 0:e[mf.SURVEY_ID],F=null==e?void 0:e[mf.SURVEY_ITERATION];Cf({id:O,current_iteration:F}),b.$set=s({},b.$set,{[ua({id:O,current_iteration:F},t===gf.SENT?"responded":"dismissed")]:!0})}else t===gf.SHOWN&&(b.$set=s({},b.$set,{[mf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===L_.SHOWN){var D=null==e?void 0:e[N_.TOUR_TYPE];D&&(b.$set=s({},b.$set,{[N_.TOUR_LAST_SEEN_DATE+"/"+D]:(new Date).toISOString()}))}var L=s({},b.properties.$set,b.$set);if(Me(L)||this.setPersonPropertiesForFlags(L),!Oe(this.config.before_send)){var N=this.ds(b);if(!N)return;(b=N).uuid=or(b.uuid,Ff)}var q=null!==(o=null==(a=b.$set)?void 0:a.$fbc)&&void 0!==o?o:Ee(null==(l=b.properties)?void 0:l.$set)?b.properties.$set.$fbc:void 0,B=null!=R&&R.pending&&q===R.value?R.value:void 0;this.Ll.emit("eventCaptured",b);var j=null!==(u=null==i?void 0:i._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),U=s({method:"POST",url:j,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(j)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},B?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.Mu(B)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||B?this.lu(U):this.au.enqueue(U),b}Cn.critical("This capture call is ignored due to client rate limiting.")}}else Cn.error("No event name provided to posthog.capture")}else Cn.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 Eb(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,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;this.persistence.syncCookieProperties(),this.Ru();var o=n?void 0:this.persistence.remove_event_timer(t),a=s({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.zl()&&(a[Bt]=!0),"$snapshot"===t){var u=s({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!Re(a.distinct_id)&&!Fe(a.distinct_id)||Ae(a.distinct_id))&&Cn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var h,c=function(t,e,i,r){var n,s,o,a;if(void 0===r&&(r=!1),!m)return{};var u,h=t?[...Ra,...e||[]]:[],d=Zi(m),c=d[0],f=d[1],p=function(t){for(var e=0;Yi.length>e;e++){var i,r=Yi[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["",""]}(m),g=p[0],y=p[1],_=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},b={};Ie(i)||(b.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==l||null==(o=l.screen)?void 0:o.width,C=null==l||null==(a=l.screen)?void 0:a.height,T=null==l?void 0:l.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 E,M=In(On({$os:c,$os_version:f,$browser:zi(m,navigator.vendor,_,b),$webview_app:g,$webview_app_version:y,$device:Qi(m),$device_type:Ji(m,w),$timezone:Ua(),$timezone_offset:Ha()}),{$current_url:zn(r?lr(null==v?void 0:v.href):null==v?void 0:v.href,h,Pa),$host:null==v?void 0:v.host,$pathname:null==v?void 0:v.pathname,$raw_user_agent:m.length>1e3?m.substring(0,997)+"...":m,$browser_version:Vi(m,navigator.vendor,_,b),$browser_language:La(),$browser_language_prefix:(E=La(),"string"==typeof E?E.split("-")[0]:void 0),$screen_height:null==l?void 0:l.screen.height,$screen_width:null==l?void 0:l.screen.width,$viewport_height:null==l?void 0:l.innerHeight,$viewport_width:null==l?void 0:l.innerWidth,$lib:Sn.LIB_NAME,$lib_version:Sn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Sn.SDK_DIST_CHANNEL&&(M.$sdk_dist_channel=Sn.SDK_DIST_CHANNEL),M}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime(),!0),p=f.windowId;a.$session_id=f.sessionId,a.$window_id=p}this.sessionPropsManager&&In(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&In(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(g=this.uu)?void 0:g.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===gb&&(a.$lib_custom_api_host=this.config.api_host),h="$pageview"!==t||n?"$pageleave"!==t||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),a=In(a,h),"$pageview"===t&&d&&(a.title=d.title),!Ie(o)){var y=i.getTime()-o;a.$duration=parseFloat((y/1e3).toFixed(3))}m&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),b=this.sessionPersistence.properties(),w=a.$groups,k=_.$groups;Ee(w)&&!Me(w)&&(a.$groups=s({},Ee(k)?k:{},w)),Mn(["$referrer","$referring_domain"],t=>{t in _&&delete b[t]});var S={};if(this.Yl.length>0)for(var x of this.Yl.slice())try{In(S,x())}catch(t){Cn.error("Failed to produce browser extension event properties",t)}(a=In({},c,_,b,s({},S,a))).$is_identified=this._isIdentified(),Ce(this.config.property_denylist)?Mn(this.config.property_denylist,function(t){delete a[t]}):Cn.error(Fb+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(Cn.error(Ob),a=C(a,t));var T=this.Pu();return a.$process_person_profile=T,T&&!n&&this.Fu("_calculate_event_properties"),a}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&&(Cn.error(Ob),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||!ep.si())ep.hi(this.Xl);else{var e=[];this.Kl.forEach(t=>e.push(t)),e.length>0?ep.ui(this.Xl,e):ep.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:Pb}),()=>{})}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:Pb})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Pb})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Ef),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:Pb}}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:Pb})}$u(t){return!t||Ae(t)?(Cn.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(Cn.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())||(Cn.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 Cn.uninitializedWarning("posthog.identify");if(Fe(t)&&(t=t.toString(),Cn.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(C),this.register({distinct_id:t}));var u=(this.persistence.get_property("$user_state")||"anonymous")===ee,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(Pt,ie),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.aa(),this.capture(le,c,{$set:e||{},$set_once:i||{}}),this.ru=wa(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(d){this.persistence.set_property(Pt,ie);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=wa(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=wa(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):Cn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(Ce(t)?t:[t]).filter(t=>Re(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 n=this.getGroups(),o=n[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:s({},n,{[t]:e})}),(o||i)&&this.Pu()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(ue,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}else Cn.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=De(t)?t:null==t?void 0:t.resetDeviceID,i=De(t)||null==t?void 0:t.bootstrap;this.Du(e,!1,i)}Du(t,e,i){var r,n,o,a;if(void 0===e&&(e=!1),Cn.info("reset"),!this.__loaded)return Cn.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.su)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.Ma());var u=this.get_property(S),h=this.get_property(x),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,k,C,T,E,M,I;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==(_=this.featureFlags)||_.reset(),null==(b=this.conversations)||b.reset(),null==(w=this.logs)||w.reset(),null==(k=this.metrics)||k.reset(),null==(C=this.persistence)||C.set_property(Pt,ee),null==(T=this.sessionManager)||T.resetSessionId(),this.ru=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:qt,$device_id:null},"");else{var R=this.config.get_device_id(Ff());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Ie(h)||this.register({[x]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.zl()||(null==(I=this.persistence)||I.set_property(Pt,i.isIdentifiedID?ie:ee),this.register({distinct_id:i.distinctID})),null==(E=this.featureFlags)||E.initialize(),!(Ie(l)||null!=(M=this.sessionManager)&&M.setBootstrapSessionId(l,!0))){var A=s({},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 a(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){Cn.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else Cn.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")?(Cn.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(C,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Cn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=s({},this.config);if(Ee(t)){var i,r,n,o,a,l,u,h,d,v,c,f,p;In(this.config,Hb(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 $_(s({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.nu(this.config.debug);De(m)&&(this.config.debug=m),De(this.config.debug)&&(this.config.debug?(ra.DEBUG=!0,jf.si()&&jf.ui("ph_debug",!0),Cn.info("set_config",{config:t,oldConfig:e,newConfig:s({},this.config)})):(ra.DEBUG=!1,jf.si()&&jf.hi("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Ma()),null==(n=this.exceptionObserver)||n.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&&g_(this,Rb,!1)}}_overrideSDKInfo(t,e){ra.LIB_NAME=t,ra.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(s({},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:Nb;return e!==Nb&&(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?(Cn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ul(),this.Ou(Nt,!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 cb(this),this.pageViewManager=new b_(this),this.persistence&&(this.sessionPropsManager=new ub(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 Cn.warn(Ab)}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:qt,$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 Cn.warn(Ab)}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 h?fb(h,this.config.custom_blocked_useragents):void 0}ku(){d&&("visible"===d.visibilityState?this.tu||(this.tu=!0,this.capture(oe,{title:d.title},{send_instantly:!0}),this.eu&&(d.removeEventListener(ne,this.eu),this.eu=null)):this.eu||(this.eu=this.ku.bind(this),Ln(d,ne,this.eu)))}debug(t){!1===t?(null==l||l.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==l||l.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?(Cn.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&&!Oe(t[e]),o=i in t&&!Oe(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,Cn)}ds(t){var e;if(Oe(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(qe),r=Ce(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Oe(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Ne(t.event)?Cn.warn(o+". This can cause unexpected behavior."):Cn.info(o),null}n.properties&&!Me(n.properties)||Cn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Cn.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Oe(n.properties[a]))return Cn.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=De(t)&&!t,i=jf.si()&&"true"===jf.li("ph_debug");return!e&&(!!i||t)}},t.__defaultExtensionClasses={},t.qu=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),t);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Pn(t.prototype[e[i]])}(Wb,["identify"]);var Vb=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Ee(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}},Gb=Tn("[ExceptionAutocapture]"),Zb=Tn("[TracingHeaders]"),Qb=Tn("[Web Vitals]"),Jb=9e5,Kb=["CLS","FCP","INP","LCP"],Yb=["INP","LCP"],Xb=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],tw=Tn("[SessionRecording]"),ew=Tn("[Heatmaps]");function iw(t){return Ee(t)&&"clientX"in t&&"clientY"in t&&Fe(t.clientX)&&Fe(t.clientY)}var rw=Tn("[Product Tours]"),nw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(N))},sw=Tn("[SiteApps]"),ow="Error while initializing PostHog app with config id ",aw=(t,e)=>null!=t&&t.then?t.then(e):e(t),lw="SDK is not enabled or survey functionality is not yet loaded",uw="Disabled. Not loading surveys.",hw=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 bf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Oe(e))return bf.warn("Flags not loaded yet. Not loading surveys.");this.Gu=De(e)?e:e.length>0,bf.info("flags response received, isSurveysEnabled: "+this.Gu),this.loadIfEnabled()}}}setup(t){if(!this.Js)return this.Zu=t,aw(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)bf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)bf.info(uw);else if(t.cookielessMode&&this.Us.isOptedOut())bf.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(te),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 bf.error("PostHog Extensions not found.")}}}Ju(t,e){this.Js||(this._surveyManager=t(e),this._surveyEventReceiver=this.Us.createEventReceiver(),bf.info("Surveys loaded successfully"),this.Ku({isLoaded:!0}))}Qu(t,e){bf.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 bf.info(uw),t([]);var n=r.kv.get(gt);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=>bf.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 bf.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=>bf.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(lw)}))}th(t,e){var i;if(this.Js)return{surveys:[],context:{isLoaded:!1,error:lw}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?bf.error(n):e.error||bf.warn(n),this.Wu=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Wu=null;var s=e.json.surveys||[],o=s.filter(t=>wf(t)&&(pa(t)||kf(t)));return o.length>0&&(null==(i=this._surveyEventReceiver)||i.register(o)),t.kv.set({[gt]:s,[mt]: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(mt);return Fe(i)&&Date.now()-i>3e5}ih(){return Fe(this.Wu)&&3e5>Date.now()-this.Wu}markSurveyAsSeen(t,e){var i;Cf({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){bf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Oe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);bf.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(Oe(this._surveyManager))return{eligible:!1,reason:lw};var e="string"==typeof t?this.rh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}sh(t){if(Oe(this._surveyManager))return{eligible:!1,reason:lw};var e="string"==typeof t?this.rh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Oe(this._surveyManager))return bf.warn("init was not called"),{visible:!1,disabledReason:lw};var e=this.sh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Oe(this._surveyManager)?(bf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:lw})):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(Oe(this._surveyManager))bf.warn("init was not called");else{var n="string"==typeof t?this.rh(t):t;if(null!=n&&n.id)if(Tf.includes(n.type)){var s=null==d?void 0:d.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){bf.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.Vu.delete(o),this.Js||(bf.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),bf.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.Vu.add(o)}else this._surveyManager.renderSurvey(n,s,i);else bf.warn("Survey element not found")}else bf.warn("Surveys of type "+n.type+" cannot be rendered in the app");else bf.warn("Survey not found")}}displaySurvey(t,e){var i;if(Oe(this._surveyManager))bf.warn("init was not called");else{var r=this.rh(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=s({},r,{appearance:s({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==yf.Popover&&e.initialResponses&&bf.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 bf.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==yf.Inline?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else bf.warn("Survey not found")}}cancelPendingSurvey(t){Oe(this._surveyManager)?bf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function dw(t,e,i){if(Oe(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 vw=class{constructor(t){this._instance=t,this.oh=new Set,this.ah=new Set,this.uh=new hb,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 hb}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(!dw(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=>dw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&dw((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=>dw(t.text,e.text,e.text_matching||"exact")||dw(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;!Oe(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=>dw(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=Ce(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)}},cw=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.Activation?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 vw(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.Activation),a=this.$h(t,lf.Cancellation);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.Cancellation);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.Activation);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(s({},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}},fw=class extends cw{constructor(t){super(t)}sd(){return yt}od(){return _t}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 gf.SHOWN}Lh(t){var e;null==(e=this._instance)||e.getSurveys(t)}Zh(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}zh(){return bf}Xh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}ad(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[_t]:t})}ld(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(_t)}ud(){return!1}Uh(t,e){var i;return this.Lh(t=>{i=t.find(t=>t.id===e)}),!i||ga(i)?t===gf.SHOWN?"consume":"ignore":t===gf.SHOWN?"persist":t===gf.DISMISSED||t===gf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},pw=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)}},gw=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 fw(this._instance)}},mw=null!=l&&l.location?Wn(l.location.hash,"__posthog")||Wn(location.hash,"state"):null,yw="_postHogToolbarParams",_w=Tn("[Toolbar]"),bw=Tn("[FeatureFlags]"),ww=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:Ce(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.vd||(bw.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)||Ce(t.flag_keys)||bw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.fd}},kw=Tn("[FeatureFlags]"),Sw=Tn("[FeatureFlags]",{debugEnabled:!0}),xw="\" failed. Feature flags didn't load in time.",Cw="connection_error",Tw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Ew=t=>{var e={};for(var i of Rn(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Mw="Refusing to render web experiment since the viewer is a likely bot",Iw={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>ma(e,t),not_regex:(t,e)=>!ma(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Rw=Tn("[Conversations]"),Aw="Conversations not available yet.";function Pw(t,e){var i,r,n,o,a,l,u,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!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,f=Ie(c)?Math.max(v,2048):Math.max(v,c),p=s({},function(){var t="",e="";try{var i=null==h?void 0:h.userAgent;if(i){var r=Zi(i);t=r[0],e=r[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(un,t)?un[t]:t}(t);return s({},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!==(u=null==p?void 0:p["deployment.environment"])&&void 0!==u?u: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 Ow=["debug","log","warn","error","info"],Fw="console",$w="__posthogHandledLogsRequestError",Dw=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[$w]=!0,i},Lw=t=>!!t&&"object"==typeof t&&!0===t[$w],Nw={featureFlags:class{constructor(t){this.name="featureFlags",this.pd=!1,this.featureFlagEventHandlers=[],this.A=kw,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||!d||"hidden"===d.visibilityState||Date.now()-(null!==(t=this.Rd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.Ad())},this.Ze=()=>{"visible"===(null==d?void 0:d.visibilityState)&&this.Id()},"get"in t?this.Us=t:(this._instance=t,this.Pd=new ww(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]"),aw(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 l&&Ln(l,"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&&d&&!Ie(t)&&t>0?t:void 0;e!==this.Ed&&(this.Bd(),Ie(e)||(this.Ed=e,this.Ad(),null!=d&&d.addEventListener&&Ln(d,ne,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==d||null==d.removeEventListener||d.removeEventListener(ne,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==l||l.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&&!Ce(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={[st]:f,[nt]:f,[lt]:p};for(var m of(t.$feature_flag_details&&(g[at]=f),[ut,At,ht]))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[st,lt,ut,dt]){var i=this.Wd(e);Ie(i)||(t[e]=i)}this.gd=t;var r=s({},t),n=this.Wd(nt);if(n)for(var o of Object.entries(n))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(At);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,n,o=null!=i&&i.merge&&null!==(r=this.Wd("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Wd("$feature_flag_payloads"))&&void 0!==n?n:{},l=s({},o,t),u=s({},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(at),e=this.Wd(dt),i=this.Wd(vt);if(!i&&!e)return t||{};var r=In({},t||{});for(var n of[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])]){var o,a,l=r[n],u=null==e?void 0:e[n],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[n],c=s({},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=s({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[n]=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:Ur(e[i])}})}getFlagVariants(){var t=this.Wd(nt),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 flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.pd=!0),i}getFlagPayloads(){var t=this.Wd(lt),e=this.Wd(vt);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:s({},e.initialPersonProperties,this.Wd("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Wd(ft),timezone:Ua()};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 n=this.Xd();Ie(n)||(i.flag_keys=n);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({[Rt]:[Cw]}),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?Cw:"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({[Rt]: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 Vn(this.Td,3)}iv(t){this.Td=Gn(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+xw)}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(),n=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,E;Ce(d[t])?d[t].push(l):d[t]=[l],this.ui(s({[Mt]:d},i?{[It]:i}:{}));var M=this.getFeatureFlagDetails(t),I=[...null!==(p=this.Wd("$feature_flag_errors"))&&void 0!==p?p:[]];Ie(o)&&I.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==(_=this._n.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.xd};Ie(null==M||null==(b=M.metadata)?void 0:b.has_experiment)||(R.$feature_flag_has_experiment=M.metadata.has_experiment),Ie(null==M||null==(w=M.metadata)?void 0:w.version)||(R.$feature_flag_version=M.metadata.version);var A=null!==(k=null==M||null==(S=M.reason)?void 0:S.description)&&void 0!==k?k:null==M||null==(x=M.reason)?void 0:x.code;A&&(R.$feature_flag_reason=A),null!=M&&null!=(C=M.metadata)&&C.id&&(R.$feature_flag_id=M.metadata.id),Ie(null==M?void 0:M.original_variant)&&Ie(null==M?void 0:M.original_enabled)||(R.$feature_flag_original_response=Ie(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(T=M.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==M||null==(E=M.metadata)?void 0:E.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.rv(R)}else i&&this.ui({[Mt]:d,[It]:i});if(n)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Ur(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+xw)}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 a(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+xw),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,n,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===o&&(o=kw);var a=((t,e)=>{var i=t.flags;return i?s({},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(Ce(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{[st]:u,[nt]:c,[ht]:!1}}var p=u,g=h,m=l;if(null!=n&&n.partialResponse){var y=Object.keys(p),_=g||{};p=s({},e,p),g=s({},i,_),y.forEach(t=>{var e;t in _||null==(e=g)||delete e[t]}),m=s({},r,m)}else if(t.errorsWhileComputingFlags)if(l){var b=new Set(Object.keys(l).filter(t=>{var e;return!(null!=(e=l[t])&&e.failed)}));p=s({},e,Object.fromEntries(Object.entries(p).filter(t=>b.has(t[0]))));var w=Object.fromEntries(Object.entries(g||{}).filter(t=>b.has(t[0])));g=s({},i,w),b.forEach(t=>{var e;t in w||null==(e=g)||delete e[t]}),m=s({},r,Object.fromEntries(Object.entries(m||{}).filter(t=>b.has(t[0]))))}else p=s({},e,p),g=s({},i,g),m=s({},r,m);return s({[st]:Object.keys(Ew(p)),[nt]:p||{},[lt]:g||{},[at]:m||{},[ht]:!0===t.minimalFlagCalledEvents},d?{[ut]:d}:{},v?{[At]:v}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(r)if(!1===(null==i?void 0:i.persist)){var n=!Ie(this.Hs.kv.get(nt));this.Vd=r,n||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([dt,vt]),this.jd(),void Sw.info("All overrides cleared");if(Ce(t))return this.ui({[dt]:Tw(t)}),this.jd(),void Sw.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[dt]=Ce(n)?Tw(n):n),s&&(r[vt]=s),Object.keys(r).length&&this.ui(r),!1===n&&!1===s?this.hi([dt,vt]):!1===n?this.hi(dt):!1===s&&this.hi(vt),this.jd(),!1===n?Sw.info("Flag overrides cleared"):n&&Sw.info("Flag overrides set",{flags:n}),void(!1===s?Sw.info("Payload overrides cleared"):s&&Sw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.ui({[dt]:t}),this.jd(),void Sw.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,n=(this.Wd("$early_access_features")||[]).find(e=>e.flagKey===t),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};n&&(a.$early_access_feature_name=n.name),i&&(a.$feature_enrollment_stage=i);var l=s({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[st]:[t],[nt]:[t],[ct]:Object.keys(o)}),this.ui({[st]:Object.keys(Ew(l)),[nt]:l,[ct]:s({},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(ot);!r||e?this.av(t,i):t(r)}av(t,e){var i=this;return a(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({[ot]: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),n=null==t?void 0:t.$set_once,o={};if(n)for(var a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(o[a]=n[a]));this.ui({[ct]:s({},i,o,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=s({},this.Wd("$stored_person_properties")||{});t.forEach(t=>{delete i[t]}),this.ui({[ct]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.hi(ct),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Wd("$stored_group_properties")||{},r=s({},i);for(var n of Object.keys(t))r[n]=s({},i[n],t[n]);this.ui({[ft]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Wd("$stored_group_properties")||{};this.ui({[ft]:s({},e,{[t]:{}})})}else this.hi(ft)}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}}},qw={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=Vs,this.dv=void 0,this.vv=!1,this.je=(()=>{var t;if(null==d||!d.visibilityState||"visible"===d.visibilityState)return!0;var e=null==l||null==(t=l.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==d?void 0:d.visibilityState)&&(this.je=!0,null==(t=this.uv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw tw.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!=d&&d.addEventListener&&Ln(d,"visibilitychange",this.Ze)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.vv=!0,null==d||null==d.removeEventListener||d.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 l&&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),tw.info("starting")):(this.hv=Vs,this.stopRecording())}}gv(t){var e,i;if(this.pv)if("awaiting_config"!==this.hv&&"missing_config"!==this.hv&&(this.hv=Ks),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}),tw.error("could not load recorder",e)):void this.mv(t);this.hv=Vs})}}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(Q),null==(e=this.Ya)||e.unregister(H)}_v(t,e){if(Oe(t))return null;var i,r=Fe(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(tw.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,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=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!=n?n:o;Oe(a)&&this.bv();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register({[j]:s({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:s({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})})};n(),null==(e=this.dv)||e.call(this),this.dv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(n)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.wv(e),void this.fv()):(this.wv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.hv&&(this.hv="missing_config",tw.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):tw.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 tw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Oe(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 tw.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",tw.info("persisted remote config is stale, requesting fresh config before starting"),void new U_(this._instance).load()}this.hv=Ks,null==(i=(r=this.uv).setDocumentWasEverVisible)||i.call(r,this.je),this.uv.start(t)}else this.hv=Vs}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({[W]:!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?V:G]:!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()}}},Bw={autocapture:class extends Qy{constructor(t){super(new Vb(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&&(Cn.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,Cn.info("History API monitoring stopped")}monitorHistoryChanges(){l&&l.history&&(this.Rv("pushState"),this.Rv("replaceState"),this.Av(),this.Mv()&&this.Pv())}Rv(t){var e;if(l&&(null==(e=l.history[t])||!e.__posthog_wrapped__)){var i=this;yv(l.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Fv(t)})}}Cv(){var t=null==l?void 0:l.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}:Ee(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(oe,{navigation_type:t}),this.xv=e}catch(e){Cn.error("Error capturing "+t+" pageview",e)}}Av(){if(!this.Iv){var t=()=>{this.Fv("popstate")};Ln(l,"popstate",t),this.Iv=()=>{l&&l.removeEventListener("popstate",t)}}}Pv(){if(!this.Ev){var t=()=>{this.Fv("hashchange")};Ln(l,"hashchange",t),this.Ev=()=>{l&&l.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[A]),this.rageclicks=new Hy(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ee(this._n.capture_heatmaps)&&this._n.capture_heatmaps.flush_interval_milliseconds&&(t=this._n.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Oe(this._n.capture_heatmaps)?Oe(this._n.enable_heatmaps)?this.$v:this._n.enable_heatmaps:!1!==this._n.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ws)return;ew.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({[A]:i}),this.$v=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Pe;return this.Pe=void 0,t}qv(t){iw(t.originalEvent)&&this.an(t.originalEvent,"deadclick")}Ze(){this.Dv&&clearInterval(this.Dv),this.Dv="visible"===(null==d?void 0:d.visibilityState)?setInterval(this.za.bind(this),this.flushIntervalMilliseconds):null}Lv(){l&&d&&(this.jv=this.za.bind(this),Ln(l,se,this.jv),this.Bv=t=>this.an(t||(null==l?void 0:l.event)),Ln(d,"click",this.Bv,{capture:!0}),this.Hv=t=>this.zv(t||(null==l?void 0:l.event)),Ln(d,"mousemove",this.Hv,{capture:!0}),this.Uv=new f_(this.instance,v_,this.qv.bind(this)),this.Uv.startIfEnabledOrStop(),this.Wv=this.Ze.bind(this),Ln(d,ne,this.Wv),this.Ws=!0)}Nv(){var t;l&&d&&(this.jv&&l.removeEventListener(se,this.jv),this.Bv&&d.removeEventListener("click",this.Bv,{capture:!0}),this.Hv&&d.removeEventListener("mousemove",this.Hv,{capture:!0}),this.Wv&&d.removeEventListener(ne,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&&Kn(r)&&!Yn(r,"body");){if(r===i)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:l)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(ve(e,n))return!0;r=hs(r)}return!1}(os(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)&&iw(t)){var r=this.Gv(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&ys(os(t),this.instance.config.rageclick)&&this.Is(s({},r,{type:"rageclick"})),this.Is(r)}}zv(t){!Jn(t.target)&&iw(t)&&(clearTimeout(this.Vv),this.Vv=setTimeout(()=>{this.Is(this.Gv(t,"mousemove"))},500))}Is(t){if(l){var e=this._n.disable_capture_url_hashes?lr(l.location.href):l.location.href,i=this._n.custom_personal_data_properties,r=zn(e,this._n.mask_personal_data_properties?[...Ra,...i||[]]:[],Pa);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:f_,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",s({$current_url:this.Pe.url},this.Pe.metrics.reduce((t,e)=>s({},t,{["$web_vitals_"+e.name+"_event"]:s({},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},Oe(null==t?void 0:t.name)||Oe(null==t?void 0:t.value))Qb.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.Kv(i);if(!Ie(r)){var n=Fe(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.Xv||this.Xv>t.value){this.Pe.navigationKey!==n&&(this.Zv(),this.Jv=setTimeout(this.Zv,this.flushToCaptureTimeoutMs)),Ie(this.Pe.navigationKey)&&(this.Pe.navigationKey=n,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=s({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Ee(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of Xb){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 Qb.error("Ignoring metric with value >= "+this.Xv,t)}}},this.Yv=()=>{if(!this.Ws){var t,e,i,r,n=!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;n=!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=n&&this.attributionMetrics.indexOf("INP")>-1?s({},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 Qb.error("web vitals callbacks not loaded - not starting")}},this.$v=!(null==(e=this._instance.persistence)||!e.props[D]),this.startIfEnabled()}get ec(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Ee(this.ec)?null==(t=this.ec)?void 0:t.web_vitals_allowed_metrics:void 0;return Oe(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||Kb:i}get flushToCaptureTimeoutMs(){return(Ee(this.ec)?this.ec.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Ee(this.ec)?this.ec.web_vitals_attribution:void 0;return De(t)?t?Kb:[]:Ce(t)?t:Yb}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=Ee(this.ec)?this.ec.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get Xv(){var t=Ee(this.ec)&&Fe(this.ec.__web_vitals_max_value)?this.ec.__web_vitals_max_value:Jb;return t>0&&6e4>=t?Jb:t}get isEnabled(){var t=null==v?void 0:v.protocol;if("http:"!==t&&"https:"!==t)return Qb.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ee(this.ec)?this.ec.web_vitals:De(this.ec)?this.ec:void 0;return De(e)?e:this.$v}startIfEnabled(){this.isEnabled&&!this.Ws&&(Qb.info("enabled, starting..."),this.do(this.Yv))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Ee(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ee(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[D]:i}),this._instance.persistence.register({[B]: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?Qb.error("failed to load script",e):t()})}Kv(t){var e=t||(null==l?void 0:l.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?lr(e):e,r=this._instance.config.custom_personal_data_properties;return zn(i,this._instance.config.mask_personal_data_properties?[...Ra,...r||[]]:[],Pa)}Qb.error("Could not determine current URL")}}},jw={exceptionObserver:class{constructor(t){var e;this.Yv=()=>{var t;if(l&&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){Gb.error("failed to start",t),this.oc()}}},this._instance=t,this.ac=!(null==(e=this._instance.persistence)||!e.props[P]),this.wt=new Qe(s({},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:Gb})),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 Ee(t)?e=s({},e,t):(Ie(t)?this.ac:t)&&(e=s({},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?(Gb.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 Gb.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({[P]: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 Gb.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=Bg(),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=qr(this.vc()),this.cc=new Br(this.dc)}onConfigChange(){this.dc=qr(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({[O]: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(!Re(t)||0===t.trim().length)return void Dg.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)=>Lr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.gc(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&Dg.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.cc.add(s({[$r]:t,[Dr]:(new Date).toISOString()},r))}catch(t){Dg.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 Dg.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 Dg.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 Dg.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 Dg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.dc.enabled&&Oe(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 $g(t)||Dg.error("Failed to capture exception event. Dropping this exception.",t),void this.cc.clear()}}catch(t){return void($g(t)||Dg.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:s({},t,{$exception_steps:e})}catch(e){return Dg.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}bc(t){this.dc.enabled&&this.cc.add({[$r]:t,[Dr]:(new Date).toISOString()})}gc(t){return Ee(t)?s({},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 Re(i)&&i.length>0&&t.$exception_types.push(i),Re(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=_a[t.operator],r=e[t.key];if(!i||!r)return!1;var n=Ce(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 Dg.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&&Ng.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(Lg)})||t.some(t=>{var e=t.value;return Re(e)&&e.includes("isolatedAPI.contexts.topHostname")})&&!e.some(t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(Lg))}))}wc(t){return t.some(t=>{var e=t.value;return Re(e)&&qg.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!Oe(t)&&Ce(t)}}},Uw=s({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({[N]:!!e.productTours}),!nw(this._instance))return!this.xc&&Oe(null==(i=this.Ya)?void 0:i.props.ph_product_tours)||rw.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&&nw(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?rw.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),!Ce(this.Cc)||e){var i=this.Ya;if(i){var r=i.props[wt];if(Ce(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(nw(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||rw.warn(n):rw.error(n),void t([],{isLoaded:!1,error:n})}var s=Ce(e.json.product_tours)?e.json.product_tours:[];this.Cc=s,i&&i.register({[wt]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Cc,{isLoaded:!0})}getActiveProductTours(t){Oe(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(wt)}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)}}},Nw),Hw={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,i,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:s({},n(t,r),{properties:s({},t.properties,m?{$set:s({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},m)}:{},g?{$set_once:s({},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)||(sw.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)||(sw.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==d?void 0:d.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 h=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),h.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=>!Pe(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=()=>{h.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&&(sw.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,sw.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){sw.error(ow+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){sw.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){sw.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 sw.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 sw.error(ow+e,t)})};for(var a of s.siteApps)o()}else sw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},zw={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 Zb.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 Ce(t)?(Ce(this.jc)?this.jc.splice(0,this.jc.length,...t):this.jc=[...t],t.length>0?this.jc:void 0):(Ce(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()}}},Ww=s({surveys:class extends hw{constructor(t){var e;super(new gw(t),(e=t,{get projectToken(){return e.config.token},kv:new pw(e)})),this._instance=t}Yu(t,e){var i=e.query?Z_(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})})}}},Nw),Vw={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),Nn(this.instance.config))return!1;if(!l||!d)return!1;t=null!=t?t:l.location,i=null!=i?i:l.history;try{if(!e){try{l.localStorage.setItem("test","test"),l.localStorage.removeItem("test")}catch(t){return!1}e=null==l?void 0:l.localStorage}var r,n=mw||Wn(t.hash,"__posthog")||Wn(t.hash,"state"),s=n?An(()=>JSON.parse(atob(decodeURIComponent(n))))||An(()=>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(yw)||"{}")).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;!Oe(e)&&Te(e)?e(t,this.instance):_w.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==d||!d.getElementById("__POSTHOG_TOOLBAR__"));if(!l||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=s({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(l.localStorage.setItem(yw,JSON.stringify(s({},r,{source:void 0}))),2===this.Uc())this.Wc(r);else if(0===this.Uc()){var n;this.zc(1),null==(n=b.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return _w.error("[Toolbar] Failed to load",t),void this.zc(0);this.zc(2),this.Wc(r)}),Ln(l,"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)}}},Gw=s({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);Re(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(Mw);else if(!this._n.disable_web_experiments){if(Oe(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!Oe(e.conditions)&&t.Xc(e,i)&&t.Yc(e)}static Xc(e,i){var r;if(Oe(e.conditions)||Oe(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=Zn(i,n.href);return null==(s=e.conditions)||!s.url||Iw[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==l?void 0:l.location}static Yc(t){var e;if(Oe(t.conditions)||Oe(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];Cn.info("[WebExperiments] "+t,i)}Jc(e,i,r){this._is_bot()?t.Gc(Mw):"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 h&&this._instance?fb(h,this._n.custom_blocked_useragents):void 0}}},Nw),Zw=s({},Nw,qw,Bw,jw,Uw,Hw,Ww,zw,Vw,Gw,{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;Oe(e)||(De(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||Nn(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(te);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 Rw.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,Rw.info("Conversations loaded successfully")}catch(t){this.sf("Error completing conversations initialization",t)}else Rw.error("Cannot complete initialization: remote config is null")}sf(t,e){Rw.error(t,e),this._conversationsManager=null,this.ef=!1,this.if=!0}show(){this._conversationsManager?this._conversationsManager.show():Rw.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.tf&&!Pe(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Nn(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?Oe(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 a(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(Rw.warn(Aw),null)})()}getMessages(t,e){var i=this;return a(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(Rw.warn(Aw),null)})()}markAsRead(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Rw.warn(Aw),null)})()}getTickets(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Rw.warn(Aw),null)})()}requestRestoreLink(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Rw.warn(Aw),null)})()}restoreFromToken(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Rw.warn(Aw),null)})()}restoreFromUrlToken(){var t=this;return a(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Rw.warn(Aw),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=Mf,this.af=!1,this.lf=!1,this.uf=!1,this.A=Tn("[logs]"),this.hf=s({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(Lw)||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),l&&Ln(l,"online",this.gf)}bf(t,e,i,r){var n,s=Pw(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new gn(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},Fw);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==l||l.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;Oe(r)?this.Ff():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[q]:!!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[q])}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=Pw(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Sg(b.console[t])}catch(t){return 0}if(!r)return 0;e.cf.push(yv(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 Ow)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){Lw(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(te),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===ge.LogsQueue?t():void 0,setPersistedProperty(t,i){t===ge.LogsQueue&&e(null!=i?i:[])},gs:t=>this.gs(t),getLibraryId:()=>ra.LIB_NAME,getLibraryVersion:()=>ra.LIB_VERSION}}gs(t){return new Promise(e=>{if(Vn(this.Td,3))e({kind:"fatal",error:Dw(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:Dw(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:Dw(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=Gn(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,ra.LIB_NAME,t=>{this.Aa=t}),this.df.length>0&&this.Hf(t,this.df,this.Mf,Fw,t=>{this.df=t})}Hf(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=pn(s,fn(i,ra.LIB_NAME,ra.LIB_VERSION),r,ra.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,Oe(n)||(e.sessionStartTimestamp=n),Oe(s)||(e.lastActivityTimestamp=s)}if(null!=b&&null!=(t=b.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?lr(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=Tn("[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:()=>ra.LIB_NAME,getLibraryVersion:()=>ra.LIB_VERSION}}Fs(t,e){return new Promise(i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(o),i(t))},o=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(s({method:"POST",url:this.zf(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e,i=t.statusCode;n(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)}}});Wb.__defaultExtensionClasses=s({},Zw);var Qw=function(){ra.SDK_DIST_CHANNEL="npm";var t=Mb[Nb]=new Wb;return function(){function t(){t.done||(t.done=!0,qb=!1,Mn(Mb,function(t){t._dom_loaded()}))}null!=d&&d.addEventListener?"complete"===d.readyState?t():Ln(d,"DOMContentLoaded",t,{capture:!1}):l&&Cn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}(),Jw=Qw;export{af as Compression,D_ as DEFAULT_PRODUCT_TOUR_APPEARANCE,yf as DisplaySurveyType,Wb as PostHog,L_ as ProductTourEventName,N_ as ProductTourEventProperties,gf as SurveyEventName,mf as SurveyEventProperties,lf as SurveyEventType,hf as SurveyPosition,ff as SurveyQuestionBranchingType,cf as SurveyQuestionType,pf as SurveySchedule,df as SurveyTabPosition,vf as SurveyType,uf as SurveyWidgetType,Jw as default,Qw as posthog,H_ as severityLevels};
2
2
  //# sourceMappingURL=module.full.js.map