1"use strict";(self.webpackChunklib=self.webpackChunklib||[]).push([[5476],{55476:(e,t,i)=>{i.d(t,{Ay:()=>Yo});var s="undefined"!=typeof window?window:void 0,r="undefined"!=typeof globalThis?globalThis:s,n=Array.prototype,o=n.forEach,a=n.indexOf,l=null==r?void 0:r.navigator,c=null==r?void 0:r.document,u=null==r?void 0:r.location,h=null==r?void 0:r.fetch,d=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,p=null==r?void 0:r.AbortController,g=null==l?void 0:l.userAgent,_=null!=s?s:{},v={DEBUG:!1,LIB_VERSION:"1.260.2"},f="$copy_autocapture",m=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],y=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),b=["fatal","error","warning","log","info","debug"];function w(e,t){return-1!==e.indexOf(t)}var E=function(e){return e.trim()},k=function(e){return e.replace(/^\$/,"")},S=Array.isArray,x=Object.prototype,I=x.hasOwnProperty,$=x.toString,F=S||function(e){return"[object Array]"===$.call(e)},R=e=>"function"==typeof e,P=e=>e===Object(e)&&!F(e),M=e=>{if(P(e)){for(var t in e)if(I.call(e,t))return!1;return!0}return!1},T=e=>void 0===e,O=e=>"[object String]"==$.call(e),C=e=>O(e)&&0===e.trim().length,A=e=>null===e,D=e=>T(e)||A(e),L=e=>"[object Number]"==$.call(e),N=e=>"[object Boolean]"===$.call(e),q=e=>w(m,e),j=e=>{var t={t:function(t){if(s&&(v.DEBUG||_.POSTHOG_DEBUG)&&!T(s.console)&&s.console){for(var i=("__rrweb_original__"in s.console[t]?s.console[t].__rrweb_original__:s.console[t]),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];i(e,...n)}},info:function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("log",...i)},warn:function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("warn",...i)},error:function(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling "+e)},createLogger:t=>j(e+" "+t)};return t},B=j("[PostHog.js]"),H=B.createLogger,z=H("[ExternalScriptsLoader]"),U=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return z.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==c?void 0:c.querySelectorAll("script");if(s)for(var r=0;r<s.length;r++)if(s[r].src===t)return i();var n=()=>{if(!c)return i("document not found");var s=c.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>i(void 0,e),s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");var r,n=c.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):c.body.appendChild(s)};null!=c&&c.body?n():null==c||c.addEventListener("DOMContentLoaded",n)};function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},G.apply(null,arguments)}function V(e,t){if(null==e)return{};var i={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var s="/static/"+t+".js?v="+e.version;if("remote-config"===t&&(s="/array/"+e.config.token+"/config.js"),"toolbar"===t){var r=3e5;s=s+"&t="+Math.floor(Date.now()/r)*r}var n=e.requestRouter.endpointFor("assets",s);U(e,n,i)},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);U(e,s,i)};var W={};function Y(e,t,i){if(F(e))if(o&&e.forEach===o)e.forEach(t,i);else if("length"in e&&e.length===+e.length)for(var s=0,r=e.length;s<r;s++)if(s in e&&t.call(i,e[s],s)===W)return}function J(e,t,i){if(!D(e)){if(F(e))return Y(e,t,i);if((e=>e instanceof FormData)(e)){for(var s of e.entries())if(t.call(i,s[1],s[0])===W)return}else for(var r in e)if(I.call(e,r)&&t.call(i,e[r],r)===W)return}}var K=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Y(i,(function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])})),e},Z=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Y(i,(function(t){Y(t,(function(t){e.push(t)}))})),e};function X(e){for(var t=Object.keys(e),i=t.length,s=new Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var Q=function(e){try{return e()}catch(e){return}},ee=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){B.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),B.critical(e)}}},te=function(e){var t={};return J(e,(function(e,i){(O(e)&&e.length>0||L(e))&&(t[i]=e)})),t};var ie=["herokuapp.com","vercel.app","netlify.app"];function se(e){var t=null==e?void 0:e.hostname;
vendor: 4,800 bytes, line 1
1if(!O(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of ie)if(i===s)return!1;return!0}function re(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function ne(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}var oe="$people_distinct_id",ae="__alias",le="__timers",ce="$autocapture_disabled_server_side",ue="$heatmaps_enabled_server_side",he="$exception_capture_enabled_server_side",de="$error_tracking_suppression_rules",pe="$error_tracking_capture_extension_exceptions",ge="$web_vitals_enabled_server_side",_e="$dead_clicks_enabled_server_side",ve="$web_vitals_allowed_metrics",fe="$session_recording_enabled_server_side",me="$console_log_recording_enabled_server_side",ye="$session_recording_network_payload_capture",be="$session_recording_masking",we="$session_recording_canvas_recording",Ee="$replay_sample_rate",ke="$replay_minimum_duration",Se="$replay_script_config",xe="$sesid",Ie="$session_is_sampled",$e="$session_recording_url_trigger_activated_session",Fe="$session_recording_event_trigger_activated_session",Re="$enabled_feature_flags",Pe="$early_access_features",Me="$feature_flag_details",Te="$stored_person_properties",Oe="$stored_group_properties",Ce="$surveys",Ae="$surveys_activated",De="$flag_call_reported",Le="$user_state",Ne="$client_session_props",qe="$capture_rate_limit",je="$initial_campaign_params",Be="$initial_referrer_info",He="$initial_person_info",ze="$epp",Ue="__POSTHOG_TOOLBAR__",Ge="$posthog_cookieless",Ve=[oe,ae,"__cmpns",le,fe,ue,xe,Re,de,Le,Pe,Me,Oe,Te,Ce,De,Ne,qe,je,Be,ze,He];function We(e){return e instanceof Element&&(e.id===Ue||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Ye(e){return!!e&&1===e.nodeType}function Je(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ke(e){return!!e&&3===e.nodeType}function Ze(e){return!!e&&11===e.nodeType}function Xe(e){return e?E(e).split(/\s+/):[]}function Qe(e){var t=null==s?void 0:s.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function et(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Xe(t)}function tt(e){return D(e)?null:E(e).split(/(\s+)/).filter((e=>gt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function it(e){var t="";return ot(e)&&!at(e)&&e.childNodes&&e.childNodes.length&&J(e.childNodes,(function(e){var i;Ke(e)&&e.textContent&&(t+=null!==(i=tt(e.textContent))&&void 0!==i?i:"")})),E(t)}function st(e){return T(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var rt=["a","button","form","input","select","textarea","label"];function nt(e){var t=e.parentNode;return!(!t||!Ye(t))&&t}function ot(e){for(var t=e;t.parentNode&&!Je(t,"body");t=t.parentNode){var i=et(t);if(w(i,"ph-sensitive")||w(i,"ph-no-capture"))return!1}if(w(et(e),"ph-include"))return!0;var s=e.type||"";if(O(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!O(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function at(e){return!!(Je(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Je(e,"select")||Je(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var lt="(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})",ct=new RegExp("^(?:"+lt+")$"),ut=new RegExp(lt),ht="\\d{3}-?\\d{2}-?\\d{4}",dt=new RegExp("^("+ht+")$"),pt=new RegExp("("+ht+")");function gt(e,t){if(void 0===t&&(t=!0),D(e))return!1;if(O(e)){if(e=E(e),(t?ct:ut).test((e||"").replace(/[- ]/g,"")))return!1;if((t?dt:pt).test(e))return!1}return!0}function _t(e){var t=it(e);return gt(t=(t+" "+vt(e)).trim())?t:""}function vt(e){var t="";return e&&e.childNodes&&e.childNodes.length&&J(e.childNodes,(function(e){var i;if(e&&"span"===(null==(i=e.tagName)?void 0:i.toLowerCase()))try{var s=it(e);t=(t+" "+s).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+vt(e)).trim())}catch(e){B.error("[AutoCapture]",e)}})),t}function ft(e){return function(e){var t=e.map((e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=G({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return X(n).sort(((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}
1)).forEach((e=>{var[t,i]=e;return o[mt(t.toString())]=mt(i.toString())})),(s+=":")+X(o).map((e=>{var[t,i]=e;return t+'="'+i+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,i,s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:yt(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return X(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,i]=e;return s.attributes[t]=i})),s}))}(e))}function mt(e){return e.replace(/"|\\"/g,'\\"')}function yt(e){var t=e.attr__class;return t?F(t)?t:Xe(t):void 0}class bt{constructor(){this.clicks=[]}isRageClick(e,t,i){var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<30&&i-s.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var wt=["localhost","127.0.0.1"],Et=e=>{var t=null==c?void 0:c.createElement("a");return T(t)?null:(t.href=e,t)},kt=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!F(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){B.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},St=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[0]||"",n=s[1],o=r.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");F(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},xt=function(e,t){var i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},It=H("[AutoCapture]");function $t(e,t){return t.length>e?t.slice(0,e)+"...":t}function Ft(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Ye(t));return t}function Rt(e,t){for(var i,r,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!Je(h,"body");)Ze(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],g={},_=!1,v=!1;if(J(u,(e=>{var t=ot(e);"a"===e.tagName.toLowerCase()&&(_=e.getAttribute("href"),_=t&&_&>(_)&&_),w(et(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};rt.indexOf(r)>-1&&!i&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?n.$el_text=$t(1024,_t(e)):n.$el_text=$t(1024,it(e)));var o=et(e);o.length>0&&(n.classes=o.filter((function(e){return""!==e}))),J(e.attributes,(function(i){var r;if((!at(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&>(i.value)&&(r=i.name,!O(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var o=i.value;"class"===i.name&&(o=Xe(o).join(" ")),n["attr__"+i.name]=$t(1024,o)}}));for(var a=1,l=1,c=e;c=Ft(c);)a++,c.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l));var i=function(e){if(!ot(e))return{};var t={};return J(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&>(s)&&(t[i]=s)}})),t}(e);K(g,i)}
1)),v)return{props:{},explicitNoCapture:v};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=_t(e):p[0].$el_text=it(e)),_){var f,m;p[0].attr__href=_;var y=null==(f=Et(_))?void 0:f.host,b=null==s||null==(m=s.location)?void 0:m.host;y&&b&&y!==b&&(d=_)}return{props:K({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:ft(p)},null!=(i=p[0])&&i.$el_text?{$el_text:null==(r=p[0])?void 0:r.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}class Pt{constructor(e){this.i=!1,this.o=null,this.rageclicks=new bt,this.h=!1,this.instance=e,this.m=null}get S(){var e,t,i=P(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map((e=>new RegExp(e))),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),i}$(){if(this.isBrowserSupported()){if(s&&c){var e=e=>{e=e||(null==s?void 0:s.event);try{this.k(e)}catch(e){It.error("Failed to capture event",e)}};if(ne(c,"submit",e,{capture:!0}),ne(c,"change",e,{capture:!0}),ne(c,"click",e,{capture:!0}),this.S.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event),this.k(e,f)};ne(c,"copy",t,{capture:!0}),ne(c,"cut",t,{capture:!0})}}}else It.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.h=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ce]:!!e.autocapture_opt_out}),this.o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.m=e}getElementSelectors(e){var t,i=[];return null==(t=this.m)||t.forEach((t=>{var s=null==c?void 0:c.querySelectorAll(t);null==s||s.forEach((s=>{e===s&&i.push(t)}))})),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[ce],s=this.o;if(A(s)&&!N(i)&&!this.instance.I())return!1;var r=null!==(t=this.o)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!r}k(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=st(e);Ke(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.k(e,"$rageclick");var n=t===f;if(r&&function(e,t,i,r,n){var o,a,l;if(void 0===i&&(i=void 0),!s||!e||Je(e,"html")||!Ye(e))return!1;if(null!=(o=i)&&o.url_allowlist&&!Qe(i.url_allowlist))return!1;if(null!=(a=i)&&a.url_ignorelist&&Qe(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var c=i.dom_event_allowlist;if(c&&!c.some((e=>t.type===e)))return!1}for(var u=!1,h=[e],d=!0,p=e;p.parentNode&&!Je(p,"body");)if(Ze(p.parentNode))h.push(p.parentNode.host),p=p.parentNode.host;else{if(!(d=nt(p)))break;if(r||rt.indexOf(d.tagName.toLowerCase())>-1)u=!0;else{var g=s.getComputedStyle(d);g&&"pointer"===g.getPropertyValue("cursor")&&(u=!0)}h.push(d),p=d}if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(T(i))return!0;var s,r=function(e){if(i.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(h,i))return!1;if(!function(e,t){var i=null==t?void 0:t.css_selector_allowlist;if(T(i))return!0;var s,r=function(e){if(i.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(h,i))return!1;var _=s.getComputedStyle(e);if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return u?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(rt.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.S,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=Rt(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsC
vendor: 4,156 bytes, line 1
1hainAsString:this.h});if(a)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),t===f){var c,u=tt(null==s||null==(c=s.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return R(null==c?void 0:c.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return L(e)&&isFinite(e)&&Math.floor(e)===e});var Mt="0123456789abcdef";class Tt{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>1073741823||s>4294967295)throw new RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/Math.pow(2,40),r[1]=e/Math.pow(2,32),r[2]=e/Math.pow(2,24),r[3]=e/Math.pow(2,16),r[4]=e/Math.pow(2,8),r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new Tt(r)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Mt.charAt(this.bytes[t]>>>4)+Mt.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Tt(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class Ot{constructor(){this.P=0,this.R=0,this.T=new Dt}generate(){var e=this.generateOrAbort();if(T(e)){this.P=0;var t=this.generateOrAbort();if(T(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.C();else{if(!(e+1e4>this.P))return;this.R++,this.R>4398046511103&&(this.P++,this.C())}return Tt.fromFieldsV7(this.P,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.T.nextUint32())}C(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}}var Ct,At=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};s&&!T(s.crypto)&&crypto.getRandomValues&&(At=e=>crypto.getRandomValues(e));class Dt{constructor(){this.M=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.M.length&&(At(this.M),this.F=0),this.M[this.F++]}}var Lt=()=>Nt().toString(),Nt=()=>(Ct||(Ct=new Ot)).generate(),qt="",jt=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Bt={O:()=>!!c,A:function(e){B.error("cookieStore error: "+e)},D:function(e){if(c){try{for(var t=e+"=",i=c.cookie.split(";").filter((e=>e.length)),s=0;s<i.length;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},j:function(e){var t;try{t=JSON.parse(Bt.D(e))||{}}catch(e){}return t},L:function(e,t,i,s,r){if(c)try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=c),qt)return qt;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+Lt();!qt&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",qt=n)}return qt}(e);if(!i){var s=(e=>{var t=e.match(jt);return t?t[0]:""})(e);s!==i&&B.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(c.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+24*i*60*60*1e3),n="; expires="+l.toUTCString()}r&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&B.warn("cookieStore warning: large cookie, len="+u.length),c.cookie=u,u}catch(e){return}},N:function(e,t){if(null!=c&&c.cookie)try{Bt.L(e,"",-1,t)}catch(e){return}}},Ht=null,zt={O:function(){if(!A(Ht))return Ht;var e=!0;if(T(s))e=!1;
1else try{var t="__mplssupport__";zt.L(t,"xyz"),'"xyz"'!==zt.D(t)&&(e=!1),zt.N(t)}catch(t){e=!1}return e||B.error("localStorage unsupported; falling back to cookie store"),Ht=e,e},A:function(e){B.error("localStorage error: "+e)},D:function(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){zt.A(e)}return null},j:function(e){try{return JSON.parse(zt.D(e))||{}}catch(e){}return null},L:function(e,t){try{null==s||s.localStorage.setItem(e,JSON.stringify(t))}catch(e){zt.A(e)}},N:function(e){try{null==s||s.localStorage.removeItem(e)}catch(e){zt.A(e)}}},Ut=["distinct_id",xe,Ie,ze,He],Gt=G({},zt,{j:function(e){try{var t={};try{t=Bt.j(e)||{}}catch(e){}var i=K(t,JSON.parse(zt.D(e)||"{}"));return zt.L(e,i),i}catch(e){}return null},L:function(e,t,i,s,r,n){try{zt.L(e,t,void 0,void 0,n);var o={};Ut.forEach((e=>{t[e]&&(o[e]=t[e])})),Object.keys(o).length&&Bt.L(e,o,i,s,r,n)}catch(e){zt.A(e)}},N:function(e,t){try{null==s||s.localStorage.removeItem(e),Bt.N(e,t)}catch(e){zt.A(e)}}}),Vt={},Wt={O:function(){return!0},A:function(e){B.error("memoryStorage error: "+e)},D:function(e){return Vt[e]||null},j:function(e){return Vt[e]||null},L:function(e,t){Vt[e]=t},N:function(e){delete Vt[e]}},Yt=null,Jt={O:function(){if(!A(Yt))return Yt;if(Yt=!0,T(s))Yt=!1;else try{var e="__support__";Jt.L(e,"xyz"),'"xyz"'!==Jt.D(e)&&(Yt=!1),Jt.N(e)}catch(e){Yt=!1}return Yt},A:function(e){B.error("sessionStorage error: ",e)},D:function(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){Jt.A(e)}return null},j:function(e){try{return JSON.parse(Jt.D(e))||null}catch(e){}return null},L:function(e,t){try{null==s||s.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Jt.A(e)}},N:function(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){Jt.A(e)}}},Kt=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class Zt{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.U()?Kt.DENIED:this.q}isOptedOut(){return"always"===this.S.cookieless_mode||this.consent===Kt.DENIED||this.consent===Kt.PENDING&&(this.S.opt_out_capturing_by_default||"on_reject"===this.S.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Kt.DENIED}optInOut(e){this.B.L(this.H,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.B.N(this.H,this.S.cross_subdomain_cookie)}get H(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get q(){var e=this.B.D(this.H);return"1"===e?Kt.GRANTED:"0"===e?Kt.DENIED:Kt.PENDING}get B(){if(!this.W){var e=this.S.opt_out_capturing_persistence_type;this.W="localStorage"===e?zt:Bt;var t="localStorage"===e?Bt:zt;t.D(this.H)&&(this.W.D(this.H)||this.optInOut("1"===t.D(this.H)),t.N(this.H,this.S.cross_subdomain_cookie))}return this.W}U(){return!!this.S.respect_dnt&&!!re([null==l?void 0:l.doNotTrack,null==l?void 0:l.msDoNotTrack,_.doNotTrack],(e=>w([!0,1,"1","yes"],e)))}}var Xt=H("[Dead Clicks]"),Qt=()=>!0,ei=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(_e)),s=e.instance.config.capture_dead_clicks;return N(s)?s:i};class ti{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[_e]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.J((()=>{this.V()}))}J(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Xt.error("failed to load script",t):e()}))}V(){var e;if(c){if(!this.G&&null!=(e=_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=P(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.G=_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.G.start(c),Xt.info("starting...")}}else Xt.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,Xt.info("stopping..."))}}function ii(e,t,i,s,r){return t>i&&(B.warn("min cannot be greater than max."),t=i),L(e)?e>i?(s&&B.warn(s+" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(s&&B.warn(s+" cannot be less than min: "+t+". Using min value instead."),t):e:(s&&B.warn(s+" must be a number. using max or fallback. max: "+i+", fallback: "+r),ii(r||i,t,i,s))}class si{constructor(e){this.K={},this.Y=()=>
1{Object.keys(this.K).forEach((e=>{var t=this.X(e)+this.Z;t>=this.tt?delete this.K[e]:this.it(e,t)}))},this.X=e=>this.K[String(e)],this.it=(e,t)=>{this.K[String(e)]=t},this.consumeRateLimit=e=>{var t,i=null!==(t=this.X(e))&&void 0!==t?t:this.tt;if(0===(i=Math.max(i-1,0)))return!0;this.it(e,i);var s,r=0===i;return r&&(null==(s=this.et)||s.call(this,e)),r},this.rt=e,this.et=this.rt.et,this.tt=ii(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=ii(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=ii(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval((()=>{this.Y()}),this.st)}}var ri=H("[ExceptionAutocapture]");class ni{constructor(e){var t,i,r;this.nt=()=>{var e;if(s&&this.isEnabled&&null!=(e=_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ot&&this.S.capture_unhandled_errors&&(this.ot=t(this.captureException.bind(this))),!this.lt&&this.S.capture_unhandled_rejections&&(this.lt=i(this.captureException.bind(this))),!this.ut&&this.S.capture_console_errors&&(this.ut=r(this.captureException.bind(this)))}catch(e){ri.error("failed to start",e),this.ht()}}},this._instance=e,this.dt=!(null==(t=this._instance.persistence)||!t.props[he]),this.S=this.vt(),this.ct=new si({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4}),this.startIfEnabled()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return P(e)?t=G({},t,e):(T(e)?this.dt:e)&&(t=G({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(ri.info("enabled"),this.J(this.nt))}J(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return ri.error("failed to load script",t);e()}))}ht(){var e,t,i;null==(e=this.ot)||e.call(this),this.ot=void 0,null==(t=this.lt)||t.call(this),this.lt=void 0,null==(i=this.ut)||i.call(this),this.ut=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.dt=!!t||!1,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[he]:this.dt}),this.startIfEnabled()}captureException(e){var t,i=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=i+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var s=null!==(t=e.$exception_list[0].type)&&void 0!==t?t:"Exception";this.ct.consumeRateLimit(s)?ri.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}}function oi(e){return!T(Event)&&ai(e,Event)}function ai(e,t){try{return e instanceof t}catch(e){return!1}}function li(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return ai(e,Error)}}function ci(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function ui(e){return ci(e,"DOMError")}var hi=/\(error: (.*)\)/,di="?";function pi(e,t,i,s){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?di:t,in_app:!0};return T(i)||(r.lineno=i),T(s)||(r.colno=s),r}var gi=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_i=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,vi=/\((\S*)(?::(\d+))(?::(\d+))\)/,fi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,mi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,yi=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var s=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e,t){void 0===t&&(t=0);for(var i=[],r=e.split("\n"),n=t;n<r.length;n++){var o=r[n];if(!(o.length>1024)){var a=hi.test(o)?o.replace(hi,"$1"):o;if(!a.match(/\S*Error: /)){for(var l of s){var c=l(a);if(c){i.push(c);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>G({},e,{filename:e.filename||bi(t).filename,function:e.function||di})))}(i)}}([30,e=>{var t=gi.exec(e);if(t){var[,i,s,r]=t;return pi(i,di,+s,+r)}var n=_i.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var o=vi.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}var[a,l]=Si(n[1]||di,n[2]);return pi(l,a,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{var t=fi.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=mi.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}var s=t[3],r=t[1]||di;return[r,s]=Si(r,s),pi(s,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]);function bi(e){return e[e.length-1]||{}}var wi,Ei,ki,Si=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:di,i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},xi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Ii(e,t){void 0===t&&(t=0);var i=e.stacktrace||e.stack||"",s=function(e){return e&&$i.test(e.message)?1:0}(e);try{var r=yi,n=function(e,t){var i=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var i=Object.keys(t);return ki&&i.length===Ei||(Ei=i.length,ki=i.reduce(((i,s)=>{wi||(wi={});var r=wi[s];if(r)i[r[0]]=r[1];else for(var n=e(s),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,c=t[s];if(l&&c){i[l]=c,wi[s]=[l,c];break}}return i}),{})),ki}(t);return e.forEach((e=>{e.filename&&(e.chunk_id=i[e.filename])})),e}(r(i,s),r);return n.slice(0,n.length-t)}catch(e){}return[]}var $i=/Minified React error #\d+;/i;function Fi(e,t){var i=function(e,t){var i,s,r=Ii(e),n=null===(i=null==t?void 0:t.handled)||void 0===i||i,o=null!==(s=null==t?void 0:t.synthetic)&&void 0!==s&&s;return{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;return t.error&&"string"==typeof t.error.message?String(t.error.message):String(t)}(e),stacktrace:{frames:r,type:"raw"},mechanism:{handled:n,synthetic:o}}}(e,t);return e.cause&&li(e.cause)&&e.cause!==e?[i,...Fi(e.cause,{handled:null==t?void 0:t.handled,synthetic:null==t?void 0:t.synthetic})]:[i]}function Ri(e,t){return{$exception_list:Fi(e,t),$exception_level:"error"}}function Pi(e,t){var i,s,r,n=null===(i=null==t?void 0:t.handled)||void 0===i||i,o=null===(s=null==t?void 0:t.synthetic)||void 0===s||s,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:n,synthetic:o}};if(null!=t&&t.syntheticException){var l=Ii(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Mi(e){return O(e)&&!C(e)&&b.indexOf(e)>=0}function Ti(e,t){var{error:i,event:s}=e,r={$exception_list:[]},n=i||s;if(ui(n)||function(e){return ci(e,"DOMException")}(n)){var o=n;if(function(e){return"stack"in e}(n))r=Ri(n,t);else{var a=o.name||(ui(o)?"DOMError":"DOMException"),l=o.message?a+": "+o.message:a;r=Pi(l,G({},t,{overrideExceptionType:ui(o)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in o&&(r.$exception_DOMException_code=""+o.code),r}if(function(e){return ci(e,"ErrorEvent")}(n)&&n.error)return Ri(n.error,t);if(li(n))return Ri(n,t);if(function(e){return ci(e,"Object")}(n)||oi(n))return function(e,t){var i,s,r=null===(i=null==t?void 0:t.handled)||void 0===i||i,n=null===(s=null==t?void 0:t.synthetic)||void 0===s||s,o=null!=t&&t.overrideExceptionType?t.overrideExceptionType:oi(e)?e.constructor.name:"Error",a="Non-Error 'exception' captured with keys: "+function(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");
1if(!(r.length>t))return s===i.length||r.length<=t?r:r.slice(0,t)+"..."}return""}(e),l={type:o,value:a,mechanism:{handled:r,synthetic:n}};if(null!=t&&t.syntheticException){var c=Ii(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Mi(e.level)?e.level:"error"}}(n,t);if(T(i)&&O(s)){var c="Error",u=s,h=s.match(xi);return h&&(c=h[1],u=h[2]),Pi(u,G({},t,{overrideExceptionType:c,defaultExceptionMessage:u}))}return Pi(n,t)}function Oi(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return R(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}class Ci{constructor(e){var t;this._instance=e,this.ft=(null==s||null==(t=s.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(B.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._t&&this._t(),this._t=void 0,B.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(s&&s.history){var i=this;null!=(e=s.history.pushState)&&e.__posthog_wrapped__||Oi(s.history,"pushState",(e=>function(t,s,r){e.call(this,t,s,r),i.gt("pushState")})),null!=(t=s.history.replaceState)&&t.__posthog_wrapped__||Oi(s.history,"replaceState",(e=>function(t,s,r){e.call(this,t,s,r),i.gt("replaceState")})),this.bt()}}gt(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this.ft&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ft=i}catch(t){B.error("Error capturing "+e+" pageview",t)}}bt(){if(!this._t){var e=()=>{this.gt("popstate")};ne(s,"popstate",e),this._t=()=>{s&&s.removeEventListener("popstate",e)}}}}function Ai(e){var t,i;return(null==(t=JSON.stringify(e,(i=[],function(e,t){if(P(t)){for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(t)?"[Circular]":(i.push(t),t)}return t})))?void 0:t.length)||0}function Di(e,t){if(void 0===t&&(t=6606028.8),e.size>=t&&e.data.length>1){var i=Math.floor(e.data.length/2),s=e.data.slice(0,i),r=e.data.slice(i);return[Di({size:Ai(s),data:s,sessionId:e.sessionId,windowId:e.windowId}),Di({size:Ai(r),data:r,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var Li=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Li||{}),Ni=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Ni||{}),qi="[SessionRecording]",ji="redacted",Bi={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Hi=["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"],zi=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Ui=["/s/","/e/","/i/"];function Gi(e,t,i,s){if(D(e))return e;var r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return O(r)&&(r=parseInt(r)),r>i?qi+" "+s+" body too large to record ("+r+" bytes)":e}function Vi(e,t){if(D(e))return e;var i=e;return gt(i,!1)||(i=qi+" "+t+" body "+ji),J(zi,(e=>{var s,r;null!=(s=i)&&s.length&&-1!==(null==(r=i)?void 0:r.indexOf(e))&&(i=qi+" "+t+" body "+ji+" as might contain: "+e)})),i}class Wi{constructor(e,t){var i,s;void 0===t&&(t={}),this.yt={},this.wt=e=>{if(!this.yt[e]){var t,i;this.yt[e]=!0;var s=this.St(e);null==(t=(i=this.rt).onBlockedNode)||t.call(i,e,s)}},this.$t=e=>{var t=this.St(e);
vendor: 4,983 bytes, line 1
1if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var i=t.closest("svg");if(i)return[this._rrweb.mirror.getId(i),i]}return[e,t]},this.St=e=>this._rrweb.mirror.getNode(e),this.xt=e=>{var t,i,s,r,n,o,a,l;return(null!==(t=null==(i=e.removes)?void 0:i.length)&&void 0!==t?t:0)+(null!==(s=null==(r=e.attributes)?void 0:r.length)&&void 0!==s?s:0)+(null!==(n=null==(o=e.texts)?void 0:o.length)&&void 0!==n?n:0)+(null!==(a=null==(l=e.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,i=this.xt(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var[t]=this.$t(e.id);return!this.ct.consumeRateLimit(t)&&e})));var s=this.xt(t);return 0!==s||i===s?e:void 0},this._rrweb=e,this.rt=t,this.ct=new si({bucketSize:null!==(i=this.rt.bucketSize)&&void 0!==i?i:100,refillRate:null!==(s=this.rt.refillRate)&&void 0!==s?s:10,refillInterval:1e3,et:this.wt})}}var Yi=Uint8Array,Ji=Uint16Array,Ki=Uint32Array,Zi=new Yi([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]),Xi=new Yi([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]),Qi=new Yi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),es=function(e,t){for(var i=new Ji(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var r=new Ki(i[30]);for(s=1;s<30;++s)for(var n=i[s];n<i[s+1];++n)r[n]=n-i[s]<<5|s;return[i,r]},ts=es(Zi,2),is=ts[0],ss=ts[1];is[28]=258,ss[258]=28;for(var rs=es(Xi,0)[1],ns=new Ji(32768),os=0;os<32768;++os){var as=(43690&os)>>>1|(21845&os)<<1;as=(61680&(as=(52428&as)>>>2|(13107&as)<<2))>>>4|(3855&as)<<4,ns[os]=((65280&as)>>>8|(255&as)<<8)>>>1}var ls=function(e,t,i){for(var s=e.length,r=0,n=new Ji(t);r<s;++r)++n[e[r]-1];var o,a=new Ji(t);for(r=0;r<t;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new Ji(1<<t);var l=15-t;for(r=0;r<s;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],h=a[e[r]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)o[ns[h]>>>l]=c}else for(o=new Ji(s),r=0;r<s;++r)o[r]=ns[a[e[r]-1]++]>>>15-e[r];return o},cs=new Yi(288);for(os=0;os<144;++os)cs[os]=8;for(os=144;os<256;++os)cs[os]=9;for(os=256;os<280;++os)cs[os]=7;for(os=280;os<288;++os)cs[os]=8;var us=new Yi(32);for(os=0;os<32;++os)us[os]=5;var hs=ls(cs,9,0),ds=ls(us,5,0),ps=function(e){return(e/8|0)+(7&e&&1)},gs=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof Ji?Ji:e instanceof Ki?Ki:Yi)(i-t);return s.set(e.subarray(t,i)),s},_s=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},vs=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},fs=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new Yi(0),0];if(1==r){var o=new Yi(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(e,t){return e.f-t.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;s<r;++s)n[s].s>d&&(d=n[s].s);var p=new Ji(d+1),g=ms(i[u-1],p,0);if(g>t){s=0;var _=0,v=g-t,f=1<<v;for(n.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));s<r;++s){var m=n[s].s;if(!(p[m]>t))break;_+=f-(1<<g-p[m]),p[m]=t}for(_>>>=v;_>0;){var y=n[s].s;p[y]<t?_-=1<<t-p[y]++-1:++s}for(;s>=0&&_;--s){var b=n[s].s;p[b]==t&&(--p[b],++_)}g=t}return[new Yi(p),g]},ms=function(e,t,i){return-1==e.s?Math.max(ms(e.l,t,i+1),ms(e.r,t,i+1)):t[e.s]=i},ys=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Ji(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},bs=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},ws=function(e,t,i){var s=i.length,r=ps(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;n<s;++n)e[r+n+4]=i[n];return 8*(r+4+s)},Es=function(e,t,i,s,r,n,o,a,l,c,u){_s(t,u++,i),++r[256];for(var h=fs(r,15),d=h[0],p=h[1],g=fs(n,15),_=g[0],v=g[1],f=ys(d),m=f[0],y=f[1],b=ys(_),w=b[0],E=b[1],k=new Ji(19),S=0;S<m.length;++S)k[31&m[S]]++;for(S=0;S<w.length;++S)k[31&w[S]]++;for(var x=fs(k,7),I=x[0],$=x[1],F=19;F>4&&!I[Qi[F-1]];--F);var R,P,M,T,O=c+5<<3,C=bs(r,cs)+bs(n,us)+o,A=bs(r,d)+bs(n,_)+o+14+3*F+bs(k,I)+(2*k[16]+3*k[17]+7*k[18]);if(O<=C&&O<=A)return ws(t,u,e.subarray(l,l+c));if(_s(t,u,1+(A<C)),u+=2,A<C){R=ls(d,p,0),P=d,M=ls(_,v,0),T=_;var D=ls(I,$,0);for(_s(t,u,y-257),_s(t,u+5,E-1),_s(t,u+10,F-4),u+=14,S=0;S<F;++S)_s(t,u+3*S,I[Qi[S]]);u+=3*F;for(var L=[m,w],N=0;N<2;++N){var q=L[N];for(S=0;S<q.length;++S){var j=31&q[S];_s(t,u,D[j]),u+=I[j],j>15&&(_s(t,u,q[S]>>>5&127),u+=q[S]>>>12)}}}else R=hs,P=cs,M=ds,T=us;for(S=0;S<a;++S)if(s[S]>255){j=s[S]>>>18&31,vs(t,u,R[j+257]),u+=P[j+257],j>7&&(_s(t,u,s[S]>>>23&31),u+=Zi[j]);var B=31&s[S];vs(t,u,M[B]),u+=T[B],B>3&&(vs(t,u,s[S]>>>5&8191),u+=Xi[B])}else vs(t,u,R[s[S]]),u+=P[s[S]];return vs(t,u,R[256]),u+P[256]}
1,ks=new Ki([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ss=function(){for(var e=new Ki(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),xs=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function Is(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=Ss[255&i^t[s]]^i>>>8;e=i},d:function(){return 4294967295^e}}}(),s=e.length;i.p(e);var r=function(e,t,i,s,r){return function(e,t,i,s,r,n){var o=e.length,a=new Yi(s+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(s,a.length-r),c=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var h=u+65535;h<o?c=ws(l,c,e.subarray(u,h)):(l[u]=n,c=ws(l,c,e.subarray(u,o)))}else{for(var d=ks[t-1],p=d>>>13,g=8191&d,_=(1<<i)-1,v=new Ji(32768),f=new Ji(_+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new Ki(25e3),E=new Ji(288),k=new Ji(32),S=0,x=0,I=(u=0,0),$=0,F=0;u<o;++u){var R=b(u),P=32767&u,M=f[R];if(v[P]=M,f[R]=P,$<=u){var T=o-u;if((S>7e3||I>24576)&&T>423){c=Es(e,l,0,w,E,k,x,I,F,u-F,c),I=S=x=0,F=u;for(var O=0;O<286;++O)E[O]=0;for(O=0;O<30;++O)k[O]=0}var C=2,A=0,D=g,L=P-M&32767;if(T>2&&R==b(u-L))for(var N=Math.min(p,T)-1,q=Math.min(32767,u),j=Math.min(258,T);L<=q&&--D&&P!=M;){if(e[u+C]==e[u+C-L]){for(var B=0;B<j&&e[u+B]==e[u+B-L];++B);if(B>C){if(C=B,A=L,B>N)break;var H=Math.min(L,B-2),z=0;for(O=0;O<H;++O){var U=u-L+O+32768&32767,G=U-v[U]+32768&32767;G>z&&(z=G,M=U)}}}L+=(P=M)-(M=v[P])+32768&32767}if(A){w[I++]=268435456|ss[C]<<18|rs[A];var V=31&ss[C],W=31&rs[A];x+=Zi[V]+Xi[W],++E[257+V],++k[W],$=u+C,++S}else w[I++]=e[u],++E[e[u]]}}c=Es(e,l,n,w,E,k,x,I,F,u-F,c)}return gs(a,0,s+ps(c)+r)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,i,s,!r)}(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),n=r.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&xs(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;s<=i.length;++s)e[s+10]=i.charCodeAt(s)}}(r,t),xs(r,n-8,i.d()),xs(r,n-4,s),r}function $s(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new Yi(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},o=0;o<i;++o){if(r+5>s.length){var a=new Yi(r+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);l<128||t?n(l):l<2048?(n(192|l>>>6),n(128|63&l)):l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63),n(128|l>>>6&63),n(128|63&l)):(n(224|l>>>12),n(128|l>>>6&63),n(128|63&l))}return gs(s,0,r)}var Fs="disabled",Rs="sampled",Ps="active",Ms="buffering",Ts="paused",Os="trigger",Cs=Os+"_activated",As=Os+"_pending",Ds=Os+"_"+Fs;function Ls(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class Ns{constructor(e){this.kt=e}triggerStatus(e){var t=this.kt.map((t=>t.triggerStatus(e)));return t.includes(Cs)?Cs:t.includes(As)?As:Ds}stop(){this.kt.forEach((e=>e.stop()))}}class qs{constructor(e){this.kt=e}triggerStatus(e){var t=new Set;for(var i of this.kt)t.add(i.triggerStatus(e));switch(t.delete(Ds),t.size){case 0:return Ds;case 1:return Array.from(t)[0];default:return As}}stop(){this.kt.forEach((e=>e.stop()))}}class js{triggerStatus(){return As}stop(){}}class Bs{constructor(e){this.Et=[],this.It=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,i;this.Et=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this.It=(null==(i=e.sessionRecording)?void 0:i.urlBlocklist)||[]}Pt(e){var t;return 0===this.Et.length?Ds:(null==(t=this._instance)?void 0:t.get_property($e))===e?Cs:As}triggerStatus(e){var t=this.Pt(e),i=t===Cs?Cs:t===As?As:Ds;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:i}),i}checkUrlTriggerConditions(e,t,i){if(void 0!==s&&s.location.href){var r=s.location.href,n=this.urlBlocked,o=Ls(r,this.It);n&&o||(o&&!n?e():!o&&n&&t(),Ls(r,this.Et)&&i("url"))}}stop(){}}class Hs{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=e}triggerStatus(){var e=As;return D(this.linkedFlag)&&(e=Ds),this.linkedFlagSeen&&(e=Cs),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var i;if(this.linkedFlag=(null==(i=e.sessionRecording)?void 0:i.linkedFlag)||null,!D(this.linkedFlag)&&!this.linkedFlagSeen){var s=O(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,r=O(this.linkedFlag)?null:this.linkedFlag.variant;this.Rt=this._instance.onFeatureFlags(((e,i)=>{var n=!1;if(P(i)&&s in i){var o=i[s];n=N(o)?!0===o:r?o===r:!!o}this.linkedFlagSeen=n,n&&t(s,r)}))}}stop(){this.Rt()}}class zs{constructor(e){this.Tt=[],this._instance=e}onRemoteConfig(e){var t;this.Tt=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]}Ct(e){var t;return 0===this.Tt.length?Ds:(null==(t=this._instance)?void 0:t.get_property(Fe))===e?Cs:As}triggerStatus(e){var t=this.Ct(e),i=t===Cs?Cs:t===As?As:Ds;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:i}),i}stop(){}}function Us(e){return e.isRecordingEnabled?Ms:Fs}function Gs(e){if(!e.receivedFlags)return Ms;if(!e.isRecordingEnabled)return Fs;if(e.urlTriggerMatching.urlBlocked)return Ts;var t=!0===e.isSampled,i=new Ns([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Rs:i===Cs?Ps:i===As?Ms:!1===e.isSampled?Fs:Ps}function Vs(e){if(!e.receivedFlags)return Ms;if(!e.isRecordingEnabled)return Fs;if(e.urlTriggerMatching.urlBlocked)return Ts;var t=new qs([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),i=t!==Ds,s=N(e.isSampled);return i&&t===As?Ms:i&&t===Ds||s&&!e.isSampled?Fs:!0===e.isSampled?Rs:Ps}var Ws="[SessionRecording]",Ys=H(Ws);function Js(){var e;return null==_||null==(e=_.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}var Ks=[Ni.MouseMove,Ni.MouseInteraction,Ni.Scroll,Ni.ViewportResize,Ni.Input,Ni.TouchMove,Ni.MediaInteraction,Ni.Drag],Zs=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Xs(e){return function(e){for(var t="",i=0;i<e.length;){var s=e[i++];t+=String.fromCharCode(s)}return t}(Is($s(JSON.stringify(e))))}function Qs(e){return e.type===Li.Custom&&"sessionIdle"===e.data.tag}class er{get sessionId(){return this.Mt}get Ft(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get At(){if(!this._instance.sessionManager)throw new Error(Ws+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var e,t;return this.jt.triggerStatus(this.sessionId)===As?6e4:null!==(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:3e5}get Lt(){var e=this._instance.get_property(Ie);return N(e)?e:null}get Nt(){var e,t,i=null==(e=this.M)?void 0:e.data[(null==(t=this.M)?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.At.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get zt(){var e=!!this._instance.get_property(fe),t=!this._instance.config.disable_session_recording;return s&&e&&t}get Ut(){var e=!!this._instance.get_property(me),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}get qt(){var e,t,i,s,r,n,o=this._instance.config.session_recording.captureCanvas,a=this._instance.get_property(we),l=null!==(e=null!==(t=null==o?void 0:o.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(i=null!==(s=null==o?void 0:o.canvasFps)&&void 0!==s?s:null==a?void 0:a.fps)&&void 0!==i?i:4,u=null!==(r=null!==(n=null==o?void 0:o.canvasQuality)&&void 0!==n?n:null==a?void 0:a.quality)&&void 0!==r?r:.4;if("string"==typeof u){var h=parseFloat(u);u=isNaN(h)?.4:h}return{enabled:l,fps:ii(c,0,12,"canvas recording fps",4),quality:ii(u,0,1,"canvas recording quality",.4)}}get Bt(){var e,t,i=this._instance.get_property(ye),s={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(t=this._instance.config.session_recording)?void 0:t.recordBody},r=(null==s?void 0:s.recordHeaders)||(null==i?void 0:i.recordHeaders),n=(null==s?void 0:s.recordBody)||(null==i?void 0:i.recordBody),o=P(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,a=!!(N(o)?o:null==i?void 0:i.capturePerformance);return r||n||a?{recordHeaders:r,recordBody:n,recordPerformance:a}:void 0}get Ht(){var e,t,i,s,r,n,o=this._instance.get_property(be),a={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(t=this._instance.config.session_recording)?void 0:t.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},l=null!==(s=null==a?void 0:a.maskAllInputs)&&void 0!==s?s:null==o?void 0:o.maskAllInputs,c=null!==(r=null==a?void 0:a.maskTextSelector)&&void 0!==r?r:null==o?void 0:o.maskTextSelector,u=null!==(n=null==a?void 0:a.blockSelector)&&void 0!==n?n:null==o?void 0:o.blockSelector;return T(l)&&T(c)&&T(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get Wt(){var e=this._instance.get_property(Ee);return L(e)?e:null}get Gt(){var e=this._instance.get_property(ke);return L(e)?e:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.Lt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):Ms}constructor(e){if(this.Vt=Us,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.jt=ne
1w js,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this.ni=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.oi=()=>{this.ai()},this.li=()=>{this.ui("browser offline",{})},this.hi=()=>{this.ui("browser online",{})},this.di=()=>{if(null!=c&&c.visibilityState){var e="window "+c.visibilityState;this.ui(e,{})}},this._instance=e,this.Ot=!1,this.vi="/s/",this.ci=void 0,this.Jt=!1,!this._instance.sessionManager)throw Ys.error("started without valid sessionManager"),new Error(Ws+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Ws+' cannot be used with cookieless_mode="always"');this.Xt=new Hs(this._instance),this.Kt=new Bs(this._instance),this.Yt=new zs(this._instance);var{sessionId:t,windowId:i}=this.At.checkAndGetSessionAndWindowId();this.Mt=t,this.fi=i,this.M=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&Ys.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.zt?(this.gi(e),ne(s,"beforeunload",this.oi),ne(s,"offline",this.li),ne(s,"online",this.hi),ne(s,"visibilitychange",this.di),this.mi(),this.bi(),D(this.ii)&&(this.ii=this._instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.yi(null==e?void 0:e.properties.$current_url):"";if(!t)return;this.ui("$pageview",{href:t})}}catch(e){Ys.error("Could not add $pageview to rrweb session",e)}}))),this.ei||(this.ei=this.At.onSessionId(((e,t,i)=>{var s,r;i&&(this.ui("$session_id_change",{sessionId:e,windowId:t,changeReason:i}),null==(s=this._instance)||null==(s=s.persistence)||s.unregister(Fe),null==(r=this._instance)||null==(r=r.persistence)||r.unregister($e))})))):this.stopRecording()}stopRecording(){var e,t,i,r;this.Ot&&this.ci&&(this.ci(),this.ci=void 0,this.Ot=!1,null==s||s.removeEventListener("beforeunload",this.oi),null==s||s.removeEventListener("offline",this.li),null==s||s.removeEventListener("online",this.hi),null==s||s.removeEventListener("visibilitychange",this.di),this.pi(),clearInterval(this.wi),null==(e=this.ii)||e.call(this),this.ii=void 0,null==(t=this.ni)||t.call(this),this.ni=void 0,null==(i=this.ei)||i.call(this),this.ei=void 0,null==(r=this.si)||r.call(this),this.si=void 0,this.Yt.stop(),this.Kt.stop(),this.Xt.stop(),Ys.info("stopped"))}Si(){var e;null==(e=this._instance.persistence)||e.unregister(Ie)}$i(e){var t,i=this.Mt!==e,s=this.Wt;if(L(s)){var r=this.Lt,n=i||!N(r),o=n?function(e,t){return function(e){for(var t=0,i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;return Math.abs(t)}(e)%100<ii(100*t,0,100)}(e,s):r;n&&(o?this.xi(Rs):Ys.warn("Sample rate ("+s+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ui("samplingDecisionMade",{sampleRate:s,isSampled:o})),null==(t=this._instance.persistence)||t.register({[Ie]:o})}else this.Si()}onRemoteConfig(e){var t,i,s,r;this.ui("$remote_config_received",e),this.ki(e),null!=(t=e.sessionRecording)&&t.endpoint&&(this.vi=null==(r=e.sessionRecording)?void 0:r.endpoint),this.mi(),"any"===(null==(i=e.sessionRecording)?void 0:i.triggerMatchType)?(this.Vt=Gs,this.jt=new Ns([this.Yt,this.Kt])):(this.Vt=Vs,this.jt=new qs([this.Yt,this.Kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(s=e.sessionRecording)?void 0:s.triggerMatchType}),this.Kt.onRemoteConfig(e),this.Yt.onRemoteConfig(e),this.Xt.onRemoteConfig(e,((e,t)=>{this.xi("linked_flag_matched",{flag:e,variant:t})})),this.Jt=!0,this.startIfEnabledOrStop()}mi(){L(this.Wt)&&D(this.si)&&(this.si=this.At.onSessionId((e=>{this.$i(e)})))}ki(e){if(this._instance.persistence){var t,i=this._instance.persistence,s=()=>{var t,s,r,n,o,a,l,c,u,h=null==(t=e.sessionRecording)?void 0:t.sampleRate,d=D(h)?null:parseFloat(h);D(d)&&this.Si();var p=null==(s=e.sessionRecording)?void 0:s.minimumDurationMilliseconds;i.register({[fe]:!!e.sessionRecording,[me]:null==(r=e.sessionRecording)?void 0:r.consoleLogRecordingEnabled,[ye]:G({capturePerformance:e.capturePerformance},null==(n=e.sessionRecording)?void 0:n.networkPayloadCapture),[be]:null==(o=e.sessionRecording)?void 0:o.masking,[we]:{enabled:null==(a=e.sessionRecording)?void 0:a.recordCanvas,fps:null==(l=e.sessionRecording)?void 0:l.canvasFps,quality:null==(c=e.sessionRecording)?void 0:c.canvasQuality},[Ee]:d,[ke]:T(p)?null:p,[Se]:null==(u=e.sessionRecording)?void 0:u.scriptConfig})};s(),null==(t=this.ri)||t.call(this),this.ri=this.At.onSessionId(s)}}log(e,t){var i;void 0===t&&(t="log"),null==(i=this._instance.sessionRecording)||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}gi(e){var t;T(Object.assign)||T(Array.from)||(this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())||(this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),Js()?this.Ei():null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.Ii,(e=>{if(e)return Ys.error("could not load recorder",e);this.Ei()})),Ys.info("starting"),this.status===Ps&&this.xi(e||"recording_initialized"))}get Ii(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(Se))?void 0:e.script)||"recorder"}Pi(e){var t;return 3===e.type&&-1!==Ks.indexOf(null==(t=e.data)?void 0:t.source)}Ri(e){var t=this.Pi(e);t||this.Zt||e.timestamp-this.ti>this.Ft&&(this.Zt=!0,clearInterval(this.wi),this.ui("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.ti,threshold:this.Ft,bufferLength:this.M.data.length,bufferSize:this.M.size}),this.ai());var i=!1;if(t&&(this.ti=e.timestamp,this.Zt)){var s="unknown"===this.Zt;this.Zt=!1,s||(this.ui("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)}if(!this.Zt){var{windowId:r,sessionId:n}=this.At.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.Mt!==n,a=this.fi!==r;this.fi=r,this.Mt=n,o||a?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this.Ti()}}Ci(e){try{return e.rrwebMethod(),!0}catch(t){return this.Qt.length<10?this.Qt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Ys.warn("could not emit queued rrweb event.",t,e),!1}}ui(e,t){return this.Ci(Zs((()=>Js().addCustomEvent(e,t))))}Mi(){return this.Ci(Zs((()=>Js().takeFullSnapshot())))}Ei(){var e,t,i,s,r={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,slimDOMOptions:{}
1,collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},n=this._instance.config.session_recording;for(var[o,a]of Object.entries(n||{}))o in r&&("maskInputOptions"===o?r.maskInputOptions=G({password:!0},a):r[o]=a);this.qt&&this.qt.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.qt.fps},r.dataURLOptions={type:"image/webp",quality:this.qt.quality}),this.Ht&&(r.maskAllInputs=null===(t=this.Ht.maskAllInputs)||void 0===t||t,r.maskTextSelector=null!==(i=this.Ht.maskTextSelector)&&void 0!==i?i:void 0,r.blockSelector=null!==(s=this.Ht.blockSelector)&&void 0!==s?s:void 0);var l=Js();if(l){this.Fi=null!==(e=this.Fi)&&void 0!==e?e:new Wi(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(e,t)=>{var i="Too many mutations on node '"+e+"'. Rate limiting. This could be due to SVG animations or something similar";Ys.info(i,{node:t}),this.log(Ws+" "+i,"warn")}});var c=this.Oi();this.ci=l(G({emit:e=>{this.onRRwebEmit(e)},plugins:c},r)),this.ti=Date.now(),this.Zt=N(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:r,activePlugins:c.map((e=>null==e?void 0:e.name))}),this.ui("$posthog_config",{config:this._instance.config})}else Ys.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ti(){if(this.wi&&clearInterval(this.wi),!0!==this.Zt){var e=this.Dt;e&&(this.wi=setInterval((()=>{this.Mi()}),e))}}Oi(){var e,t,i=[],s=null==(e=_.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordConsolePlugin;s&&this.Ut&&i.push(s());var r=null==(t=_.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordNetworkPlugin;return this.Bt&&R(r)&&(!wt.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(r(((e,t)=>{var i,s,r,n={payloadSizeLimitBytes:Bi.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Bi.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Bi.payloadHostDenyList]},o=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,l=!1!==e.capture_performance&&t.recordPerformance,c=(i=n,r=Math.min(1e6,null!==(s=i.payloadSizeLimitBytes)&&void 0!==s?s:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=Gi(e.requestBody,e.requestHeaders,r,"Request")),null!=e&&e.responseBody&&(e.responseBody=Gi(e.responseBody,e.responseHeaders,r,"Response")),e)),u=t=>{return c(((e,t)=>{var i,s=Et(e.name),r=0===t.indexOf("http")?null==(i=Et(t))?void 0:i.pathname:t;"/"===r&&(r="");var n=null==s?void 0:s.pathname.replace(r||"","");if(!(s&&n&&Ui.some((e=>0===n.indexOf(e)))))return e})((s=(i=t).requestHeaders,D(s)||J(Object.keys(null!=s?s:{}),(e=>{Hi.includes(e.toLowerCase())&&(s[e]=ji)})),i),e.api_host));var i,s},h=R(e.session_recording.maskNetworkRequestFn);return h&&R(e.session_recording.maskCapturedNetworkRequestFn)&&B.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var i=e.session_recording.maskNetworkRequestFn({url:t.name});return G({},t,{name:null==i?void 0:i.url})}),n.maskRequestFn=R(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var i,s=u(t);return s&&null!==(i=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(s))&&void 0!==i?i:void 0}:e=>function(e){if(!T(e))return e.requestBody=Vi(e.requestBody,"Request"),e.responseBody=Vi(e.responseBody,"Response"),e}(u(e)),G({},Bi,n,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})})(this._instance.config,this.Bt))):Ys.info("NetworkCapture not started because we are on localhost.")),i}onRRwebEmit(e){var t;if(this.Ai(),e&&P(e)){if(e.type===Li.Meta){var i=this.yi(e.data.href);if(this.Di=i,!i)return;e.data.href=i}else this.ji();if(this.Kt.checkUrlTriggerConditions((()=>this.Li()),(()=>this.Ni()),(e=>this.zi(e))),!this.Kt.urlBlocked||(s=e).type===Li.Custom&&"recording paused"===s.data.tag){var s;e.type===Li.FullSnapshot&&this.Ti(),e.type===Li.FullSnapshot&&this.Jt&&this.jt.triggerStatus(this.sessionId)===As&&this.pi();var r=this.Fi?this.Fi.throttleMutations(e):e;if(r){var n=function(e){var t=e;if(t&&P(t)&&6===t.type&&P(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var i=[],s=0;s<t.data.payload.payload.length;s++)t.data.payload.payload[s]&&t.data.payload.payload[s].length>2e3?i.push(t.data.payload.payload[s].slice(0,2e3)+"...[truncated]"):i.push(t.data.payload.payload[s]);return t.data.payload.payload=i,e}return e}(r);if(this.Ri(n),!0!==this.Zt||Qs(n)){if(Qs(n)){var o=n.data.payload;if(o){var a=o.lastActivityTimestamp,l=o.threshold;n.timestamp=a+l}}var c=null===(t=this._instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(Ai(e)<1024)return e;try{if(e.type===Li.FullSnapshot)return G({},e,{data:Xs(e.data),cv:"2024-10"});if(e.type===Li.IncrementalSnapshot&&e.data.source===Ni.Mutation)return G({},e,{cv:"2024-10",data:G({},e.data,{texts:Xs(e.data.texts),attributes:Xs(e.data.attributes),removes:Xs(e.data.removes),adds:Xs(e.data.adds)})});if(e.type===Li.IncrementalSnapshot&&e.data.source===Ni.StyleSheetRule)return G({},e,{cv:"2024-10",data:G({},e.data,{adds:e.data.adds?Xs(e.data.adds):void 0,removes:e.data.removes?Xs(e.data.removes):void 0})})}catch(e){Ys.error("could not compress event - will use uncompressed event",e)}return e}(n):n,u={$snapshot_bytes:Ai(c),$snapshot_data:c,$session_id:this.Mt,$window_id:this.fi};this.status!==Fs?this.Ui(u):this.pi()}}}}}ji(){if(!this._instance.config.capture_pageview&&s){var e=this.yi(s.location.href);this.Di!==e&&(this.ui("$url_changed",{href:e}),this.Di=e)}}Ai(){if(this.Qt.length){var e=[...this.Qt];this.Qt=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this.Ci(e)}))}}yi(e){var t=this._instance.config.session_recording;
1if(t.maskNetworkRequestFn){var i,s={url:e};return null==(i=s=t.maskNetworkRequestFn(s))?void 0:i.url}return e}pi(){return this.M={size:0,data:[],sessionId:this.Mt,windowId:this.fi},this.M}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var e=this.Gt,t=this.Nt,i=L(t)&&t>=0,s=L(e)&&i&&t<e;return this.status===Ms||this.status===Ts||this.status===Fs||s?(this.qi=setTimeout((()=>{this.ai()}),2e3),this.M):(this.M.data.length>0&&Di(this.M).forEach((e=>{this.Bi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:v.LIB_VERSION})})),this.pi())}Ui(e){var t,i=2+((null==(t=this.M)?void 0:t.data.length)||0);!this.Zt&&(this.M.size+e.$snapshot_bytes+i>943718.4||this.M.sessionId!==this.Mt)&&(this.M=this.ai()),this.M.size+=e.$snapshot_bytes,this.M.data.push(e.$snapshot_data),this.qi||this.Zt||(this.qi=setTimeout((()=>{this.ai()}),2e3))}Bi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.vi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(e){var t;this.jt.triggerStatus(this.sessionId)===As&&(null==(t=this._instance)||null==(t=t.persistence)||t.register({["url"===e?$e:Fe]:this.Mt}),this.ai(),this.xi(e+"_trigger_matched"))}Li(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),Ys.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Mi(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),Ys.info("recording resumed"))}bi(){0!==this.Yt.Tt.length&&D(this.ni)&&(this.ni=this._instance.on("eventCaptured",(e=>{try{this.Yt.Tt.includes(e.event)&&this.zi("event")}catch(e){Ys.error("Could not activate event trigger",e)}})))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Mi(),this.xi("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[Ie]:!0}),this.Mi(),this.xi("sampling_overridden")}overrideTrigger(e){this.zi(e)}xi(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),Ys.info(e.replace("_"," "),t),w(["recording_initialized","session_id_changed"],e)||this.ui(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.At.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.M.data.length,$sdk_debug_replay_internal_buffer_size:this.M.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}}var tr=H("[SegmentIntegration]");var ir="posthog-js";function sr(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"]}=void 0===t?{}:t;return t=>{var o,a,l,c,u;if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var d=(null==(o=t.exception)?void 0:o.values)||[],p=d.map((e=>G({},e,{stacktrace:e.stacktrace?G({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>G({},e,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(a=d[0])?void 0:a.value)||t.message,$exception_type:null==(l=d[0])?void 0:l.type,$exception_personURL:h,$exception_level:t.level,$exception_list:p,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=d[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(u=d[0])?void 0:u.type,$sentry_tags:t.tags};return i&&s&&(g.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),e.exceptions.sendExceptionEvent(g),t}}class rr{constructor(e,t,i,s,r){this.name=ir,this.setupOnce=function(n){n(sr(e,{organization:t,projectId:i,prefix:s,severityAllowList:r}))}}}var nr=null!=s&&s.location?xt(s.location.hash,"__posthog")||xt(location.hash,"state"):null,or="_postHogToolbarParams",ar=H("[Toolbar]"),lr=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(lr||{});class cr{constructor(e){this.instance=e}Hi(e){_.ph_toolbar_state=e}Wi(){var e;return null!==(e=_.ph_toolbar_state)&&void 0!==e?e:lr.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),!s||!c)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=nr||xt(e.hash,"__posthog")||xt(e.hash,"state"),o=n?Q((()=>JSON.parse(atob(decodeURIComponent(n)))))||Q((()=>JSON.parse(decodeURIComponent(n)))):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(or)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}Gi(e){var t=_.ph_load_toolbar||_.ph_load_editor;!D(t)&&R(t)?t(e,this.instance):ar.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==c||!c.getElementById(Ue));if(!s||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=G({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(s.localStorage.setItem(or,JSON.stringify(G({},r,{source:void 0}))),this.Wi()===lr.LOADED)this.Gi(r);else if(this.Wi()===lr.UNINITIALIZED){var n;this.Hi(lr.LOADING),null==(n=_.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return ar.error("[Toolbar] Failed to load",e),void this.Hi(lr.
vendor: 5,118 bytes, line 1
1UNINITIALIZED);this.Hi(lr.LOADED),this.Gi(r)})),ne(s,"turbolinks:load",(()=>{this.Hi(lr.UNINITIALIZED),this.loadToolbar(r)}))}return!0}Ji(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var ur=H("[TracingHeaders]");class hr{constructor(e){this.Vi=void 0,this.Ki=void 0,this.nt=()=>{var e,t;T(this.Vi)&&(null==(e=_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),T(this.Ki)&&(null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}J(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return ur.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.J(this.nt):(null==(e=this.Vi)||e.call(this),null==(t=this.Ki)||t.call(this),this.Vi=void 0,this.Ki=void 0)}}var dr=H("[Web Vitals]"),pr=9e5;class gr{constructor(e){var t;this.Yi=!1,this.i=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce(((e,t)=>G({},e,{["$web_vitals_"+t.name+"_event"]:G({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Zi=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(T(i))dr.error("Could not read session ID. Dropping metrics!");else{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.te();T(s)||(D(null==e?void 0:e.name)||D(null==e?void 0:e.value)?dr.error("Invalid metric received",e):this.ie&&e.value>=this.ie?dr.error("Ignoring metric with value >= "+this.ie,e):(this.M.url!==s&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),T(this.M.url)&&(this.M.url=s),this.M.firstMetricTimestamp=T(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.M.metrics.push(G({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.M.metrics.length===this.allowedMetrics.length&&this.Xi()))}},this.nt=()=>{var e,t,i,s,r=_.__PosthogExtensions__;T(r)||T(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Zi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Zi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Zi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Zi.bind(this)),this.i=!0):dr.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Yi=!(null==(t=this._instance.persistence)||!t.props[ge]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=P(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return T(i)?(null==(t=this._instance.persistence)?void 0:t.props[ve])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(P(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get ie(){var e=P(this._instance.config.capture_performance)&&L(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:pr;return 0<e&&e<=6e4?pr:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return dr.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=P(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:N(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return N(t)?t:this.Yi}startIfEnabled(){this.isEnabled&&!this.i&&(dr.info("enabled, starting..."),this.J(this.nt))}onRemoteConfig(e){var t=P(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=P(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ge]:t}),this._instance.persistence.register({[ve]:i})),this.Yi=t,this.startIfEnabled()}J(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",(t=>{t?dr.error("failed to load script",t):e()}))}te(){var e=s?s.location.href:void 0;return e||dr.error("Could not determine current URL"),e}}var _r=H("[Heatmaps]");function vr(e){return P(e)&&"clientX"in e&&"clientY"in e&&L(e.clientX)&&L(e.clientY)}
1class fr{constructor(e){var t;this.rageclicks=new bt,this.Yi=!1,this.i=!1,this.ee=null,this.instance=e,this.Yi=!(null==(t=this.instance.persistence)||!t.props[ue])}get flushIntervalMilliseconds(){var e=5e3;return P(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return T(this.instance.config.capture_heatmaps)?T(this.instance.config.enable_heatmaps)?this.Yi:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.i)return;_r.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this.ee)&&void 0!==e?e:void 0),null==(t=this.ne)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ue]:t}),this.Yi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}oe(e){this.ae(e.originalEvent,"deadclick")}re(){s&&c&&(ne(s,"beforeunload",this.se.bind(this)),ne(c,"click",(e=>this.ae(e||(null==s?void 0:s.event))),{capture:!0}),ne(c,"mousemove",(e=>this.le(e||(null==s?void 0:s.event))),{capture:!0}),this.ne=new ti(this.instance,Qt,this.oe.bind(this)),this.ne.startIfEnabled(),this.i=!0)}ue(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var r=e;r&&Ye(r)&&!Je(r,"body");){if(r===i)return!1;if(w(t,null==s?void 0:s.getComputedStyle(r).position))return!0;r=nt(r)}return!1}(st(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}ae(e,t){var i;if(void 0===t&&(t="click"),!We(e.target)&&vr(e)){var s=this.ue(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.he(G({},s,{type:"rageclick"})),this.he(s)}}le(e){!We(e.target)&&vr(e)&&(clearTimeout(this.de),this.de=setTimeout((()=>{this.he(this.ue(e,"mousemove"))}),500))}he(e){if(s){var t=s.location.href;this.M=this.M||{},this.M[t]||(this.M[t]=[]),this.M[t].push(e)}}se(){this.M&&!M(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class mr{constructor(e){this._instance=e}doPageView(e,t){var i,r=this.ve(e,t);return this.ce={pathname:null!==(i=null==s?void 0:s.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ve(e,null==(t=this.ce)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ce)?void 0:e.pageViewId}}ve(e,t){var i=this.ce;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=r;if(!(T(n)||T(o)||T(a)||T(l)||T(c)||T(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:ii(o/n,0,1),d=n<=1?1:ii(a/n,0,1),p=l<=1?1:ii(c/l,0,1),g=l<=1?1:ii(u/l,0,1);s=K(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var yr=!!d||!!h,br="text/plain",wr=(e,t)=>{var[i,s]=e.split("?"),r=G({},t);null==s||s.split("&").forEach((e=>{var[t]=e.split("=");delete r[t]}));var n=function(e,t){var i,s;void 0===t&&(t="&");var r=[];return J(e,(function(e,t){T(e)||T(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)})),r.join(t)}(r);return i+"?"+(n?(s?s+"&":"")+n:s)},Er=(e,t)=>
1JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),kr=e=>{var{data:t,compression:i}=e;if(t){if(i===y.GZipJS){var s=Is($s(Er(t)),{mtime:0}),r=new Blob([s],{type:br});return{contentType:br,body:r,estimatedSize:r.size}}if(i===y.Base64){var n=function(e){var t,i,s,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=function(e){var t,i,s,r,n="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++){var o=e.charCodeAt(r),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),A(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=r+1)}return i>t&&(n+=e.substring(t,e.length)),n}(e);do{t=(n=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=n>>12&63,s=n>>6&63,r=63&n,u[l++]=o.charAt(t)+o.charAt(i)+o.charAt(s)+o.charAt(r)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(Er(t)),o=(e=>"data="+encodeURIComponent("string"==typeof e?e:Er(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Er(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Sr=[];h&&Sr.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:r,estimatedSize:n}=null!==(t=kr(e))&&void 0!==t?t:{},o=new Headers;J(e.headers,(function(e,t){o.append(t,e)})),s&&o.append("Content-Type",s);var a=e.url,l=null;if(p){var c=new p;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}h(a,G({method:(null==e?void 0:e.method)||"GET",headers:o,keepalive:"POST"===e.method&&(n||0)<52428.8,body:r,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then((t=>t.text().then((i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){B.error(e)}null==e.callback||e.callback(s)})))).catch((t=>{B.error(t),null==e.callback||e.callback({statusCode:0,text:t})})).finally((()=>l?clearTimeout(l.timeout):null))}}),d&&Sr.push({transport:"XHR",method:e=>{var t,i=new d;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=null!==(t=kr(e))&&void 0!==t?t:{};J(e.headers,(function(e,t){i.setRequestHeader(t,e)})),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),i.withCredentials=!0,i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(r)}}),null!=l&&l.sendBeacon&&Sr.push({transport:"sendBeacon",method:e=>{var t=wr(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!==(i=kr(e))&&void 0!==i?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;l.sendBeacon(t,n)}catch(e){}}});var xr=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Ir(e,t,i){return Er({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var $r={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>xr(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!xr(t,e))))),icontains:(e,t)=>t.map(Fr).some((t=>e.map(Fr).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Fr).every((t=>e.map(Fr).every((e=>!t.includes(e)))))},Fr=e=>e.toLowerCase(),Rr=H("[Error tracking]");class Pr{constructor(e){var t,i;this.fe=[],this._instance=e,this.fe=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(de))&&void 0!==t?t:[]}onRemoteConfig(e){var t,i,s,r=null!==(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.fe=r,this._instance.persistence&&this._instance.persistence.register({[de]:this.fe,[pe]:n})}get pe(){var e,t=!!this._instance.get_property(pe),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}sendExceptionEvent(e){if(this._e(e))Rr.info("Skipping exception capture because a suppression rule matched");else{if(this.pe||!this.ge(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});Rr.info("Skipping exception capture because it was thrown by an extension")}}_e(e){var t=e.$exception_list;if(!t||!F(t)||0===t.length)return!1;var i=t.reduce(((e,t)=>{var{type:i,value:s}=t;return O(i)&&i.length>0&&e.$exception_types.push(i),O(s)&&s.length>0&&e.$exception_values.push(s),e}),{$exception_types:[],$exception_values:[]});return this.fe.some((e=>{var t=e.values.map((e=>{var t,s=$r[e.operator],r=F(e.value)?e.value:[e.value],n=null!==(t=i[e.key])&&void 0!==t?t:[];return r.length>0&&s(r,n)}
vendor: 13,151 bytes, line 1
1));return"OR"===e.type?t.some(Boolean):t.every(Boolean)}))}ge(e){var t=e.$exception_list;return!(!t||!F(t))&&t.flatMap((e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}}var Mr="Mobile",Tr="iOS",Or="Android",Cr="Tablet",Ar=Or+" "+Cr,Dr="iPad",Lr="Apple",Nr=Lr+" Watch",qr="Safari",jr="BlackBerry",Br="Samsung",Hr=Br+"Browser",zr=Br+" Internet",Ur="Chrome",Gr=Ur+" OS",Vr=Ur+" "+Tr,Wr="Internet Explorer",Yr=Wr+" "+Mr,Jr="Opera",Kr=Jr+" Mini",Zr="Edge",Xr="Microsoft "+Zr,Qr="Firefox",en=Qr+" "+Tr,tn="Nintendo",sn="PlayStation",rn="Xbox",nn=Or+" "+Mr,on=Mr+" "+qr,an="Windows",ln=an+" Phone",cn="Nokia",un="Ouya",hn="Generic",dn=hn+" "+Mr.toLowerCase(),pn=hn+" "+Cr.toLowerCase(),gn="Konqueror",_n="(\\d+(\\.\\d+)?)",vn=new RegExp("Version/"+_n),fn=new RegExp(rn,"i"),mn=new RegExp(sn+" \\w+","i"),yn=new RegExp(tn+" \\w+","i"),bn=new RegExp(jr+"|PlayBook|BB10","i"),wn={"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"},En=function(e,t){return t=t||"",w(e," OPR/")&&w(e,"Mini")?Kr:w(e," OPR/")?Jr:bn.test(e)?jr:w(e,"IE"+Mr)||w(e,"WPDesktop")?Yr:w(e,Hr)?zr:w(e,Zr)||w(e,"Edg/")?Xr:w(e,"FBIOS")?"Facebook "+Mr:w(e,"UCWEB")||w(e,"UCBrowser")?"UC Browser":w(e,"CriOS")?Vr:w(e,"CrMo")||w(e,Ur)?Ur:w(e,Or)&&w(e,qr)?nn:w(e,"FxiOS")?en:w(e.toLowerCase(),gn.toLowerCase())?gn:((e,t)=>t&&w(t,Lr)||function(e){return w(e,qr)&&!w(e,Ur)&&!w(e,Or)}(e))(e,t)?w(e,Mr)?on:qr:w(e,Qr)?Qr:w(e,"MSIE")||w(e,"Trident/")?Wr:w(e,"Gecko")?Qr:""},kn={[Yr]:[new RegExp("rv:"+_n)],[Xr]:[new RegExp(Zr+"?\\/"+_n)],[Ur]:[new RegExp("("+Ur+"|CrMo)\\/"+_n)],[Vr]:[new RegExp("CriOS\\/"+_n)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+_n)],[qr]:[vn],[on]:[vn],[Jr]:[new RegExp("(Opera|OPR)\\/"+_n)],[Qr]:[new RegExp(Qr+"\\/"+_n)],[en]:[new RegExp("FxiOS\\/"+_n)],[gn]:[new RegExp("Konqueror[:/]?"+_n,"i")],[jr]:[new RegExp(jr+" "+_n),vn],[nn]:[new RegExp("android\\s"+_n,"i")],[zr]:[new RegExp(Hr+"\\/"+_n)],[Wr]:[new RegExp("(rv:|MSIE )"+_n)],Mozilla:[new RegExp("rv:"+_n)]},Sn=function(e,t){var i=En(e,t),s=kn[i];if(T(s))return null;for(var r=0;r<s.length;r++){var n=s[r],o=e.match(n);if(o)return parseFloat(o[o.length-2])}return null},xn=[[new RegExp(rn+"; "+rn+" (.*?)[);]","i"),e=>[rn,e&&e[1]||""]],[new RegExp(tn,"i"),[tn,""]],[new RegExp(sn,"i"),[sn,""]],[bn,[jr,""]],[new RegExp(an,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ln,""];if(new RegExp(Mr).test(t)&&!/IEMobile\b/.test(t))return[an+" "+Mr,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=i[1],r=wn[s]||"";return/arm/i.test(t)&&(r="RT"),[an,r]}return[an,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Tr,t.join(".")]}return[Tr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=T(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Or+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Or+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Or,t.join(".")]}return[Or,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Gr,""]],[/Linux|debian/i,["Linux",""]]],In=function(e){return yn.test(e)?tn:mn.test(e)?sn:fn.test(e)?rn:new RegExp(un,"i").test(e)?un:new RegExp("("+ln+"|WPDesktop)","i").test(e)?ln:/iPad/.test(e)?Dr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Nr:bn.test(e)?jr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(cn,"i").test(e)?cn:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Mr).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Or:Ar:Or:new RegExp("(pda|"+Mr+")","i").test(e)?dn:new RegExp(Cr,"i").test(e)&&!new RegExp(Cr+" pc","i").test(e)?pn:""},$n="https?://(.*)",Fn=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Rn=Z(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Fn),Pn="<masked>",Mn=["li_fat_id"];function Tn(e,t,i){if(!c)return{};var s,r=t?Z([],Fn,i||[]):[],n=On(St(c.URL,r,Pn),e),o=(s={},J(Mn,(function(e){var t=Bt.D(e);s[e]=t||null})),s);return K(o,n)}function On(e,t){var i=Rn.concat(t||[]),s={};return J(i,(function(t){var i=kt(e,t);s[t]=i||null})),s}function Cn(e){var t=function(e){return e?0===e.search($n+"google.([^/?]*)")?"google":0===e.search($n+"bing.com")?"bing":0===e.search($n+"yahoo.com")?"yahoo":0===e.search($n+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",s={};if(!A(t)){s.$search_engine=t;var r=c?kt(c.referrer,i):"";r.length&&(s.ph_keyword=r)}return s}function An(){return navigator.language||navigator.userLanguage}function Dn(){return(null==c?void 0:c.referrer)||"$direct"}function Ln(e,t){var i=e?Z([],Fn,t||[]):[],s=null==u?void 0:u.href.substring(0,1e3);return{r:Dn().substring(0,1e3),u:s?St(s,i,Pn):void 0}}function Nn(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=Et(i))?void 0:t.host};if(s){r.$current_url=s;var n=Et(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname;var o=On(s);K(r,o)}if(i){var a=Cn(i);K(r,a)}return r}function qn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function jn(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function Bn(e,t){if(!g)return{};var i,r,n,o=e?Z([],Fn,t||[]):[],[a,l]=function(e){for(var t=0;t<xn.length;t++){var[i,s]=xn[t],r=i.exec(e),n=r&&(R(s)?s(r,e):s);if(n)return n}return["",""]}(g);return K(te({$os:a,$os_version:l,$browser:En(g,navigator.vendor),$device:In(g),$device_type:(r=g,n=In(r),n===Dr||n===Ar||"Kobo"===n||"Kindle Fire"===n||n===pn?Cr:n===tn||n===rn||n===sn||n===un?"Console":n===Nr?"Wearable":n?Mr:"Desktop"),$timezone:qn(),$timezone_offset:jn()}),{$current_url:St(null==u?void 0:u.href,o,Pn),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:Sn(g,navigator.vendor),$browser_language:An(),$browser_language_prefix:(i=An(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:"web",$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Hn=H("[FeatureFlags]"),zn="$active_feature_flags",Un="$override_feature_flags",Gn="$feature_flag_payloads",Vn="$override_feature_flag_payloads",Wn="$feature_flag_request_id",Yn=e=>{var t={};for(var[i,s]of X(e||{}))s&&(t[i]=s);return t},Jn=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class Kn{constructor(e){this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.$e=!0;else{var e=!this.ke&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Ee({disableFlags:e})}}get hasLoadedFlags(){return this.be}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Me),t=this._instance.get_property(Un),i=this._instance.get_property(Vn);if(!i&&!t)return e||{};var s=K({},e||{}),r=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var n of r){var o,a,l=s[n],c=null==t?void 0:t[n],u=T(c)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!c,h=T(c)?l.variant:"string"==typeof c?c:void 0,d=null==i?void 0:i[n],p=G({},l,{enabled:u,variant:u?null!=h?h:null==l?void 0:l.variant:void 0});u!==(null==l?void 0:l.enabled)&&(p.original_enabled=null==l?void 0:l.enabled),h!==(null==l?void 0:l.variant)&&(p.original_variant=null==l?void 0:l.variant),d&&(p.metadata=G({},null==l?void 0:l.metadata,{payload:d,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),s[n]=p}return this.me||(Hn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.me=!0),s}getFlagVariants(){var e=this._instance.get_property(Re),t=this._instance.get_property(Un);if(!t)return e||{};for(var i=K({},e),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.me||(Hn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.me=!0),i}getFlagPayloads(){var e=this._instance.get_property(Gn),t=this._instance.get_property(Vn);if(!t)return e||{};for(var i=K({},e||{}),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.me||(Hn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.me=!0),i}reloadFeatureFlags(){this.we||this._instance.config.advanced_disable_feature_flags||this.ke||(this.ke=setTimeout((()=>{this.Ee()}),5))}Ie(){clearTimeout(this.ke),this.ke=void 0}ensureFlagsLoaded(){this.be||this.ye||this.ke||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.we=e}Ee(e){var t;if(this.Ie(),!this._instance.I())if(this.ye)this.Se=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:G({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Te)||{}),group_properties:this._instance.get_property(Oe)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var s=this._instance.config.__preview_remote_config,r=s?"/flags/?v=2":"/flags/?v=2&config=true",n=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("api",r+n);s&&(i.timezone=qn()),this.ye=!0,this._instance.Pe({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:y.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,s,r=!0;if(200===e.statusCode&&(this.Se||(this.$anon_distinct_id=void 0),r=!1),this.ye=!1,this.$e||(this.$e=!0,this._instance.Re(null!==(s=e.json)&&void 0!==s?s:{})),!i.disable_flags||this.Se)if(this.xe=!r,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(Jn.FeatureFlags))Hn.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.");else{var n;i.disable_flags||this.receivedFeatureFlags(null!==(n=e.json)&&void 0!==n?n:{},r),this.Se&&(this.Se=!1,this.Ee())}}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.be||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,r=this._instance.get_property(Wn)||void 0,n=this._instance.get_property(De)||{};if((t.send_event||!("send_event"in t))&&(!(e in n)||!n[e].includes(s))){var o,a,l,c,u,h,d,p,g;F(n[e])?n[e].push(s):n[e]=[s],null==(o=this._instance.persistence)||o.register({[De]:n});var _=this.getFeatureFlagDetails(e),v={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_bootstrapped_response:(null==(a=this._instance.config.bootstrap)||null==(a=a.featureFlags)?void 0:a[e])||null,$feature_flag_bootstrapped_payload:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlagPayloads)?void 0:l[e])||null,$used_bootstrap_value:!this.xe};T(null==_||null==(c=_.metadata)?void 0:c.version)||(v.$feature_flag_version=_.metadata.version);var f,m=null!==(u=null==_||null==(h=_.reason)?void 0:h.description)&&void 0!==u?u:null==_||null==(d=_.reason)?void 0:d.code;m&&(v.$feature_flag_reason=m),null!=_&&null!=(p=_.metadata)&&p.id&&(v.$feature_flag_id=_.metadata.id),T(null==_?void 0:_.original_variant)&&T(null==_?void 0:_.original_enabled)||(v.$feature_flag_original_response=T(_.original_variant)?_.original_enabled:_.original_variant),null!=_&&null!=(g=_.metadata)&&g.original_payload&&(v.$feature_flag_original_payload=null==_||null==(f=_.metadata)?void 0:f.original_payload),this._instance.capture("$feature_flag_called",v)}return i}Hn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token;this._instance.Pe({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:i}
1,compression:this._instance.config.disable_compression?void 0:y.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.be||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Hn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this._instance.persistence){this.be=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),r=this.getFlagsWithDetails();!function(e,t,i,s,r){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var n=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var i;return[e,null!==(i=t[e].variant)&&void 0!==i?i:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var i;return null==(i=t[e].metadata)?void 0:i.payload})).map((e=>{var i;return[e,null==(i=t[e].metadata)?void 0:i.payload]})))):Hn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),o=n.flags,a=n.featureFlags,l=n.featureFlagPayloads;if(a){var c=e.requestId;if(F(a)){Hn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var u={};if(a)for(var h=0;h<a.length;h++)u[a[h]]=!0;t&&t.register({[zn]:a,[Re]:u})}else{var d=a,p=l,g=o;e.errorsWhileComputingFlags&&(d=G({},i,d),p=G({},s,p),g=G({},r,g)),t&&t.register(G({[zn]:Object.keys(Yn(d)),[Re]:d||{},[Gn]:p||{},[Me]:g||{}},c?{[Wn]:c}:{}))}}}(e,this._instance.persistence,i,s,r),this.Te(t)}}override(e,t){void 0===t&&(t=!1),Hn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Hn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(Un),this._instance.persistence.unregister(Vn),void this.Te();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,i=e;if(this.me=Boolean(null!==(t=i.suppressWarning)&&void 0!==t&&t),"flags"in i)if(!1===i.flags)this._instance.persistence.unregister(Un);else if(i.flags)if(F(i.flags)){for(var s={},r=0;r<i.flags.length;r++)s[i.flags[r]]=!0;this._instance.persistence.register({[Un]:s})}else this._instance.persistence.register({[Un]:i.flags});return"payloads"in i&&(!1===i.payloads?this._instance.persistence.unregister(Vn):i.payloads&&this._instance.persistence.register({[Vn]:i.payloads})),void this.Te()}this.Te()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.be){var{flags:t,flagVariants:i}=this.Ce();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this._instance.get_property(Pe)||[]).find((t=>t.flagKey===e)),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(o.$early_access_feature_name=r.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=G({},this.getFlagVariants(),{[e]:t});null==(s=this._instance.persistence)||s.register({[zn]:Object.keys(Yn(a)),[Re]:a}),this.Te()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(Pe),r=i?"&"+i.map((e=>"stage="+e)).join("&"):"";if(s&&!t)return e(s);this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(Pe),null==(s=this._instance.persistence)||s.register({[Pe]:r}),e(r)}}})}Ce(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,i)=>(e[i]=t[i],e)),{})}}Te(e){var{flags:t,flagVariants:i}=this.Ce();
1this.featureFlagEventHandlers.forEach((s=>s(t,i,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Te)||{};this._instance.register({[Te]:G({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Te)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Oe)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=G({},i[t],e[t]),delete e[t]})),this._instance.register({[Oe]:G({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Oe)||{};this._instance.register({[Oe]:G({},t,{[e]:{}})})}else this._instance.unregister(Oe)}reset(){this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$e=!1,this.xe=!1,this.$anon_distinct_id=void 0,this.Ie(),this.me=!1}}var Zn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Xn{constructor(e,t){this.S=e,this.props={},this.Me=!1,this.Fe=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.B=this.Oe(e),this.load(),e.debug&&B.info("Persistence loaded",e.persistence,G({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Ae}Oe(e){-1===Zn.indexOf(e.persistence.toLowerCase())&&(B.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&zt.O()?zt:"localstorage+cookie"===t&&Gt.O()?Gt:"sessionstorage"===t&&Jt.O()?Jt:"memory"===t?Wt:"cookie"===t?Bt:Gt.O()?Gt:Bt}properties(){var e={};return J(this.props,(function(t,i){if(i===Re&&P(t))for(var s=Object.keys(t),r=0;r<s.length;r++)e["$feature/"+s[r]]=t[s[r]];else o=i,l=!1,(A(n=Ve)?l:a&&n.indexOf===a?-1!=n.indexOf(o):(J(n,(function(e){if(l||(l=e===o))return W})),l))||(e[i]=t);var n,o,l})),e}load(){if(!this.Ae){var e=this.B.j(this.Fe);e&&(this.props=K({},e))}}save(){this.Ae||this.B.L(this.Fe,this.props,this.De,this.je,this.Le,this.S.debug)}remove(){this.B.N(this.Fe,!1),this.B.N(this.Fe,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(P(e)){T(t)&&(t="None"),this.De=T(i)?this.Ne:i;var s=!1;if(J(e,((e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,s=!0)})),s)return this.save(),!0}return!1}register(e,t){if(P(e)){this.De=T(t)?this.Ne:t;var i=!1;if(J(e,((t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.props[s]=t,i=!0)})),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Me){var e=Tn(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);M(te(e))||this.register(e),this.Me=!0}}update_search_keyword(){var e;this.register((e=null==c?void 0:c.referrer)?Cn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Dn(),$referring_domain:null!=c&&c.referrer&&(null==(e=Et(c.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[je]||this.props[Be]||this.register_once({[He]:Ln(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};J([Be,je],(t=>{var i=this.props[t];i&&J(i,(function(t,i){e["$initial_"+k(i)]=t}))}));var t,i,s=this.props[He];if(s){var r=(t=Nn(s),i={},J(t,(function(e,t){i["$initial_"+k(t)]=e})),i);K(e,r)}return e}safe_merge(e){return J(this.props,(function(t,i){i in e||(e[i]=t)})),e}update_config(e,t,i){if(this.Ne=this.De=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var s=this.Oe(e),r=this.props;this.clear(),this.B=s,this.props=r,this.save()}}set_disabled(e){this.Ae=e,this.Ae?this.remove():this.save()}set_cross_subdomain(e){e!==this.je&&(this.je=e,this.remove(),this.save())}set_secure(e){e!==this.Le&&(this.Le=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[le]||{};i[e]=t,this.props[le]=i,this.save()}remove_event_timer(e){var t=(this.props[le]||{})[e];return T(t)||(delete this.props[le][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class Qn{constructor(){this.ze={},this.ze={}}on(e,t){return this.ze[e]||(this.ze[e]=[]),this.ze[e].push(t),()=>{this.ze[e]=this.ze[e].filter((e=>e!==t))}}emit(e,t){for(var i of this.ze[e]||[])i(t);for(var s of this.ze["*"]||[])s(e,t)}}class eo{constructor(e){this.Ue=new Qn,this.qe=(e,t)=>
1this.Be(e,t)&&this.He(e,t)&&this.We(e,t),this.Be=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Ge=new Set,this.Je=new Set}init(){var e,t;T(null==(e=this._instance)?void 0:e.Ve)||(null==(t=this._instance)||t.Ve(((e,t)=>{this.on(e,t)})))}register(e){var t,i;if(!T(null==(t=this._instance)?void 0:t.Ve)&&(e.forEach((e=>{var t,i;null==(t=this.Je)||t.add(e),null==(i=e.steps)||i.forEach((e=>{var t;null==(t=this.Ge)||t.add((null==e?void 0:e.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)}))})),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Ge.has(e)||this.Ge.has(null==t?void 0:t.event))&&this.Je&&(null==(i=this.Je)?void 0:i.size)>0&&this.Je.forEach((e=>{this.Ke(t,e)&&this.Ue.emit("actionCaptured",e.name)}))}Ye(e){this.onAction("actionCaptured",(t=>e(t)))}Ke(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.qe(e,i))return!0;return!1}onAction(e,t){return this.Ue.on(e,t)}He(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s)return!1;if(!eo.Xe(s,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static Xe(e,t,i){switch(i){case"regex":return!!s&&xr(e,t);case"exact":return t===e;case"contains":var r=eo.Qe(t).replace(/_/g,".").replace(/%/g,".*");return xr(e,r);default:return!1}}static Qe(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}We(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.Ze(e).some((e=>!(null!=t&&t.href&&!eo.Xe(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact")||null!=t&&t.tag_name&&e.tag_name!==(null==t?void 0:t.tag_name)||null!=t&&t.text&&!eo.Xe(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!eo.Xe(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")))))return!1;if(null!=t&&t.selector){var i,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(!s)return!1;if(!s.includes(null==t?void 0:t.selector))return!1}return!0}Ze(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})({}),function(e){e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}({});var to=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),io=(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}({}),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}({}),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}({}),function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({})),so=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),ro=H("[Surveys]"),no="seenSurvey_",oo=(e,t)=>{var i="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(i="$survey_"+t+"/"+e.id+"/"+e.current_iteration),i},ao=e=>{var t=""+no+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+no+e.id+"_"+e.current_iteration),t},lo=[to.Popover,to.Widget,to.API];class co{constructor(e){this._instance=e,this.tr=new Map,this.ir=new Map}register(e){var t;T(null==(t=this._instance)?void 0:t.Ve)||(this.er(e),this.rr(e))}rr(e){var t=e.filter((e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0}));0!==t.length&&(null==this.sr&&(this.sr=new eo(this._instance),this.sr.init(
1),this.sr.Ye((e=>{this.onAction(e)}))),t.forEach((e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.sr)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach((t=>{if(t&&t.name){var i=this.ir.get(t.name);i&&i.push(e.id),this.ir.set(t.name,i||[e.id])}})))})))}er(e){var t;0!==e.filter((e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})).length&&(null==(t=this._instance)||t.Ve(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach((t=>{if(t&&t.name){var i=this.tr.get(t.name);i&&i.push(e.id),this.tr.set(t.name,i||[e.id])}}))})))}onEvent(e,t){var i,s=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[Ae])||[];if("survey shown"===e&&t&&s.length>0){var r;ro.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:s});var n=null==t||null==(r=t.properties)?void 0:r.$survey_id;if(n){var o=s.indexOf(n);o>=0&&(s.splice(o,1),this.nr(s))}}else this.tr.has(e)&&(ro.info("survey event matched, updating activated surveys",{event:e,surveys:this.tr.get(e)}),this.nr(s.concat(this.tr.get(e)||[])))}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[Ae])||[];this.ir.has(e)&&this.nr(i.concat(this.ir.get(e)||[]))}nr(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[Ae]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[Ae])||[]}getEventToSurveys(){return this.tr}ar(){return this.sr}}class uo{constructor(e){this.lr=void 0,this._surveyManager=null,this.ur=!1,this.hr=!1,this.dr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(D(t))return ro.warn("Flags not loaded yet. Not loading surveys.");var i=F(t);this.lr=i?t.length>0:t,ro.info("flags response received, isSurveysEnabled: "+this.lr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(no)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.hr)ro.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ro.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode)ro.info("Not loading surveys in cookieless mode.");else{var e=null==_?void 0:_.__PosthogExtensions__;if(e){if(!T(this.lr)||this._instance.config.advanced_enable_surveys){var t=this.lr||this._instance.config.advanced_enable_surveys;this.hr=!0;try{var i=e.generateSurveys;if(i)return void this.vr(i,t);var s=e.loadExternalDependency;if(!s)return void this.cr("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",(i=>{i||!e.generateSurveys?this.cr("Could not load surveys script",i):this.vr(e.generateSurveys,t)}))}catch(e){throw this.cr("Error initializing surveys",e),e}finally{this.hr=!1}}}else ro.error("PostHog Extensions not found.")}}vr(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new co(this._instance),ro.info("Surveys loaded successfully"),this.pr({isLoaded:!0})}cr(e,t){ro.error(e,t),this.pr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.dr.push(e),this._surveyManager&&this.pr({isLoaded:!0}),()=>{this.dr=this.dr.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return ro.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Ce);if(i&&!t)return e(i,{isLoaded:!0});if(this.ur)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.ur=!0,this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var i;this.ur=!1;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;return ro.error(r),e([],{isLoaded:!1,error:r})}var n,o=t.json.surveys||[],a=o.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e))));return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),null==(i=this._instance.persistence)||i.register({[Ce]:o}),e(o,{isLoaded:!0})}})}catch(e){throw this.ur=!1,e}}pr(e){for(var t of this.dr)try{if(!e.isLoaded)return t([],e);
1this.getSurveys(t)}catch(e){ro.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!D(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);ro.warn("init was not called")}_r(e){var t=null;return this.getSurveys((i=>{var s;t=null!==(s=i.find((t=>t.id===e)))&&void 0!==s?s:null})),t}gr(e){if(D(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this._r(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(D(this._surveyManager))return ro.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return D(this._surveyManager)?(ro.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((t=>{var s,r=null!==(s=t.find((t=>t.id===e)))&&void 0!==s?s:null;if(r){var n=this.gr(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t){if(D(this._surveyManager))ro.warn("init was not called");else{var i=this._r(e);if(i)if(lo.includes(i.type)){var s=null==c?void 0:c.querySelector(t);s?this._surveyManager.renderSurvey(i,s):ro.warn("Survey element not found")}else ro.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ro.warn("Survey not found")}}}var ho=H("[RateLimiter]");class po{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{ho.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void ho.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=e.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,s;void 0===e&&(e=!1);var r=(new Date).getTime(),n=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(qe))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:r};n.tokens+=(r-n.last)/1e3*this.captureEventsPerSecond,n.last=r,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var o=n.tokens<1;return o||e||(n.tokens=Math.max(0,n.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(s=this.instance.persistence)||s.set_property(qe,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var go=H("[RemoteConfig]");class _o{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}mr(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(go.error("PostHog Extensions not found. Cannot load remote config."),e())}br(e){this._instance.Pe({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return go.info("Using preloaded remote config",this.remoteConfig),void this.Re(this.remoteConfig);if(this._instance.I())return void go.warn("Remote config is disabled. Falling back to local config.");this.mr((e=>{if(!e)return go.info("No config found after loading remote JS config. Falling back to JSON."),void this.br((e=>{this.Re(e)}));this.Re(e)}))}catch(e){go.error("Error loading remote config",e)}}Re(e){e?this._instance.config.__preview_remote_config?(this._instance.Re(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):go.info("__preview_remote_config is disabled. Logging config instead",e):go.error("Failed to fetch remote config from PostHog.")}}var vo=3e3;class fo{constructor(e,t){this.yr=!0,this.wr=[],this.Sr=ii((null==t?void 0:t.flush_interval_ms)||vo,250,5e3,"flush interval",vo),this.$r=e}enqueue(e){this.wr.push(e),this.kr||this.Er()}unload(){this.Ir();var e=this.wr.length>0?this.Pr():{},t=Object.values(e);[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))].map((e=>{this.$r(G({},e,{transport:"sendBeacon"}))}))}enable(){this.yr=!1,this.Er()}Er(){var e=this;this.yr||(this.kr=setTimeout((()=>
1{if(this.Ir(),this.wr.length>0){var t=this.Pr(),i=function(){var i=t[s],r=(new Date).getTime();i.data&&F(i.data)&&J(i.data,(e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp})),e.$r(i)};for(var s in t)i()}}),this.Sr))}Ir(){clearTimeout(this.kr),this.kr=void 0}Pr(){var e={};return J(this.wr,(t=>{var i,s=t,r=(s?s.batchKey:null)||s.url;T(e[r])&&(e[r]=G({},s,{data:[]})),null==(i=e[r].data)||i.push(s.data)})),this.wr=[],e}}var mo=["retriesPerformedSoFar"];class yo{constructor(e){this.Rr=!1,this.Tr=3e3,this.wr=[],this._instance=e,this.wr=[],this.Cr=!0,!T(s)&&"onLine"in s.navigator&&(this.Cr=s.navigator.onLine,ne(s,"online",(()=>{this.Cr=!0,this.se()})),ne(s,"offline",(()=>{this.Cr=!1})))}get length(){return this.wr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=V(e,mo);L(t)&&t>0&&(i.url=wr(i.url,{retry_count:t})),this._instance.Pe(G({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.Mr(G({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}Mr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,s=Math.min(18e5,t),r=(Math.random()-.5)*(s-i);return Math.ceil(s+r)}(t),s=Date.now()+i;this.wr.push({retryAt:s,requestOptions:e});var r="Enqueued failed request for retry in "+i;navigator.onLine||(r+=" (Browser is offline)"),B.warn(r),this.Rr||(this.Rr=!0,this.Fr())}Fr(){this.Or&&clearTimeout(this.Or),this.Or=setTimeout((()=>{this.Cr&&this.wr.length>0&&this.se(),this.Fr()}),this.Tr)}se(){var e=Date.now(),t=[],i=this.wr.filter((i=>i.retryAt<e||(t.push(i),!1)));if(this.wr=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Or&&(clearTimeout(this.Or),this.Or=void 0),this.wr))try{this._instance.Pe(G({},e,{transport:"sendBeacon"}))}catch(e){B.error(e)}this.wr=[]}}class bo{constructor(e){this.Ar=()=>{var e,t,i,s;this.Dr||(this.Dr={});var r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Dr.lastScrollY=Math.ceil(n),this.Dr.maxScrollY=Math.max(n,null!==(e=this.Dr.maxScrollY)&&void 0!==e?e:0),this.Dr.maxScrollHeight=Math.max(o,null!==(t=this.Dr.maxScrollHeight)&&void 0!==t?t:0),this.Dr.lastContentY=a,this.Dr.maxContentY=Math.max(a,null!==(i=this.Dr.maxContentY)&&void 0!==i?i:0),this.Dr.maxContentHeight=Math.max(l,null!==(s=this.Dr.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}getContext(){return this.Dr}resetContext(){var e=this.Dr;return setTimeout(this.Ar,0),e}startMeasuringScrollPosition(){ne(s,"scroll",this.Ar,{capture:!0}),ne(s,"scrollend",this.Ar,{capture:!0}),ne(s,"resize",this.Ar)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==s?void 0:s.document.documentElement;var e=F(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=null==s?void 0:s.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return s&&(s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return s&&(s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft)||0}}var wo=e=>Ln(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class Eo{constructor(e,t,i,s){this.jr=e=>{var t=this.Lr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Nr(this._instance)};this.zr.register({[Ne]:i})}},this._instance=e,this.Ur=t,this.zr=i,this.Nr=s||wo,this.Ur.onSessionId(this.jr)}Lr(){return this.zr.props[Ne]}getSetOnceProps(){var e,t=null==(e=this.Lr())?void 0:e.props;return t?"r"in t?Nn(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return J(te(this.getSetOnceProps()),((t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+k(i)]=t})),e}}var ko=H("[SessionId]");class So{constructor(e,t,i){var s;if(this.qr=[],this.Br=(e,t)=>
vendor: 4,614 bytes, line 1
1Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.S=e.config,this.zr=e.persistence,this.fi=void 0,this.Mt=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Hr=t||Lt,this.Wr=i||Lt;var r=this.S.persistence_name||this.S.token,n=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ii(n,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Gr(),this.Jr="ph_"+r+"_window_id",this.Vr="ph_"+r+"_primary_window_exists",this.Kr()){var o=Jt.j(this.Jr),a=Jt.j(this.Vr);o&&!a?this.fi=o:Jt.N(this.Jr),Jt.L(this.Vr,!0)}if(null!=(s=this.S.bootstrap)&&s.sessionID)try{var l=(()=>{var e=this.S.bootstrap.sessionID.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)})();this.Yr(this.S.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){ko.error("Invalid sessionID in bootstrap",e)}this.Xr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return T(this.qr)&&(this.qr=[]),this.qr.push(e),this.Mt&&e(this.Mt,this.fi),()=>{this.qr=this.qr.filter((t=>t!==e))}}Kr(){return"memory"!==this.S.persistence&&!this.zr.Ae&&Jt.O()}Qr(e){e!==this.fi&&(this.fi=e,this.Kr()&&Jt.L(this.Jr,e))}Zr(){return this.fi?this.fi:this.Kr()?Jt.j(this.Jr):null}Yr(e,t,i){e===this.Mt&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Mt=e,this.zr.register({[xe]:[t,e,i]}))}ts(){if(this.Mt&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Mt,this._sessionStartTimestamp];var e=this.zr.props[xe];return F(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Yr(null,null,null)}Xr(){ne(s,"beforeunload",(()=>{this.Kr()&&Jt.N(this.Vr)}),{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.S.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[s,r,n]=this.ts(),o=this.Zr(),a=L(n)&&n>0&&Math.abs(i-n)>864e5,l=!1,c=!r,u=!e&&this.Br(i,s);c||u||a?(r=this.Hr(),o=this.Wr(),ko.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.Wr(),l=!0);var h=0===s||!e||a?i:s,d=0===n?(new Date).getTime():n;return this.Qr(o),this.Yr(r,h,d),e||this.Gr(),l&&this.qr.forEach((e=>e(r,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0))),{sessionId:r,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:s}}Gr(){clearTimeout(this.es),this.es=setTimeout((()=>{var[e]=this.ts();this.Br((new Date).getTime(),e)&&this.resetSessionId()}),1.1*this.sessionTimeoutMs)}}var xo=["$set_once","$set"],Io=H("[SiteApps]");class $o{constructor(e){this._instance=e,this.rs=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ss(e,t){if(t){var i=this.globalsForEvent(t);this.rs.push(i),this.rs.length>1e3&&(this.rs=this.rs.slice(10))}}get siteAppLoaders(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ve(this.ss.bind(this));this.ns=()=>{e(),this.rs=[],this.ns=void 0}}}globalsForEvent(e){var t,i,s,r,n,o,a;if(!e)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[h,d]of Object.entries(u))l[h]={id:c[h],type:h,properties:d};var{$set_once:p,$set:g}=e;return{event:G({},V(e,xo),{properties:G({},e.properties,g?{$set:G({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:G({},null!==(s=null==(r=e.properties)?void 0:r.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.rs.length&&(Io.info("Processing "+this.rs.length+" events for site app with id "+e.id),this.rs.forEac
1h((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&(null==(i=this.ns)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,Io.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{r(e)}});n&&(t.processEvent=n),s=!0}catch(t){Io.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){Io.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}os(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ls(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){Io.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.os(),void this._instance.on("eventCaptured",(e=>this.ls(e)))):void Io.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.ns)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;_["__$$ph_site_app_"+e]=r._instance,null==(t=_.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,a,(t=>{if(t)return Io.error("Error while initializing PostHog app with config id "+e,t)}))};for(var{id:o,url:a}of e.siteApps)n(o)}else Io.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Fo=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Ro=function(e,t){if(!e)return!1;var i=e.toLowerCase();return Fo.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)}))},Po=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&Ro(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some((e=>Ro(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},Mo=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),To="i.posthog.com";class Oo{constructor(e){this.us={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+To,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.us[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.us[this.apiHost]=Mo.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.us[this.apiHost]=Mo.EU:this.us[this.apiHost]=Mo.CUSTOM),this.us[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if(this.region===Mo.CUSTOM)return this.apiHost+t;var i=To+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Co={icontains:(e,t)=>!!s&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!s&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!s&&xr(t.href,e),not_regex:(e,t)=>!!s&&!xr(t.href,e),exact:(e,t)=>
1t.href===e,is_not:(e,t)=>t.href!==e};class Ao{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{Ao.hs("retrieved web experiments from the server"),t.ds=new Map,e.forEach((e=>{if(e.feature_flag_key){var i;t.ds&&(Ao.hs("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.ds)||i.set(e.feature_flag_key,e));var s=t._instance.getFeatureFlag(e.feature_flag_key);O(s)&&e.variants[s]&&t.vs(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];Ao.cs(n)&&t.vs(e.name,r,n.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())Ao.hs("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(D(this.ds))return this.ds=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ao.hs("applying feature flags",e),e.forEach((e=>{var t;if(this.ds&&null!=(t=this.ds)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.ds)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.vs(r.name,s,r.variants[s].transforms)}}))}}previewWebExperiment(){var e=Ao.getWindowLocation();if(null!=e&&e.search){var t=kt(null==e?void 0:e.search,"__experiment_id"),i=kt(null==e?void 0:e.search,"__experiment_variant");t&&i&&(Ao.hs("previewing web experiments "+t+" && "+i),this.getWebExperiments((e=>{this.fs(parseInt(t),i,e)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance.Pe({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var i=t.json.experiments||[];return e(i)}})}fs(e,t,i){var s=i.filter((t=>t.id===e));s&&s.length>0&&(Ao.hs("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.vs(s[0].name,t,s[0].variants[t].transforms))}static cs(e){return!D(e.conditions)&&Ao.ps(e)&&Ao._s(e)}static ps(e){var t;if(D(e.conditions)||D(null==(t=e.conditions)?void 0:t.url))return!0;var i,s,r,n=Ao.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||Co[null!==(s=null==(r=e.conditions)?void 0:r.urlMatchType)&&void 0!==s?s:"icontains"](e.conditions.url,n))}
1static getWindowLocation(){return null==s?void 0:s.location}static _s(e){var t;if(D(e.conditions)||D(null==(t=e.conditions)?void 0:t.utm))return!0;var i=Tn();if(i.utm_source){var s,r,n,o,a,l,c,u,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==i.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,g=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==i.utm_term;return h&&p&&g&&d}return!1}static hs(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];B.info("[WebExperiments] "+e,i)}vs(e,t,i){this._is_bot()?Ao.hs("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach((i=>{if(i.selector){var s;Ao.hs("applying transform of variant "+t+" for experiment "+e+" ",i);var r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach((e=>{var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)}))}})):Ao.hs("Control variants leave the page unmodified.")}_is_bot(){return l&&this._instance?Po(l,this._instance.config.custom_blocked_useragents):void 0}}var Do=H("[PostHog ExternalIntegrations]"),Lo={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class No{constructor(e){this._instance=e}J(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,(e=>{if(e)return Do.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var i,r,n;!s||null!=(i=_.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[t]||e.J(Lo[t],(()=>{var i;null==(i=_.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[t])||i.start(e._instance)})),!s&&null!=(r=_.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]&&(null==(n=_.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[t])||n.stop())};for(var[i,s]of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;t(i)}}}var qo={},jo=()=>{},Bo="posthog",Ho=!yr&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),zo=e=>{var t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:se(null==c?void 0:c.location),persistence:"localStorage+cookie",persistence_name:"",loaded:jo,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==e||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",debug:u&&O(null==u?void 0:u.search)&&-1!==u.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;B.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:vo},error_tracking:{},_onCapture:jo}},Uo=e=>{var t={};T(e.process_person)||(t.person_profiles=e.process_person),T(e.xhr_headers)||(t.request_headers=e.x
1hr_headers),T(e.cookie_name)||(t.persistence_name=e.cookie_name),T(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),T(e.store_google)||(t.save_campaign_params=e.store_google),T(e.verbose)||(t.debug=e.verbose);var i=K({},t,e);return F(e.property_blacklist)&&(T(e.property_denylist)?i.property_denylist=e.property_blacklist:F(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:B.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class Go{constructor(){this.__forceAllowLocalhost=!1}get gs(){return this.__forceAllowLocalhost}set gs(e){B.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Vo{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new Go,this.bs=!1,this.version=v.LIB_VERSION,this.ys=new Qn,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zo(),this.SentryIntegration=rr,this.sentryIntegration=e=>function(e,t){var i=sr(e,t);return{name:ir,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ws=!1,this.Ss=null,this.$s=null,this.xs=null,this.featureFlags=new Kn(this),this.toolbar=new cr(this),this.scrollManager=new bo(this),this.pageViewManager=new mr(this),this.surveys=new uo(this),this.experiments=new Ao(this),this.exceptions=new Pr(this),this.rateLimiter=new po(this),this.requestRouter=new Oo(this),this.consent=new Zt(this),this.externalIntegrations=new No(this),this.people={set:(e,t,i)=>{var s=O(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=O(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",(e=>B.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,i){if(i&&i!==Bo){var s,r=null!==(s=qo[i])&&void 0!==s?s:new Vo;return r._init(e,t,i),qo[i]=r,qo[Bo][i]=r,r}return this._init(e,t,i)}_init(e,t,i){var r,n;if(void 0===t&&(t={}),T(e)||C(e))return B.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 B.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.ks=t,this.Es=[],t.person_profiles&&(this.$s=t.person_profiles),this.set_config(K({},zo(t.defaults),Uo(t),{name:i,token:e})),this.config.on_xhr_error&&B.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:y.GZipJS;var o=this.Is();this.persistence=new Xn(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Xn(G({},this.config,{persistence:"sessionStorage"}),o);var a=G({},this.persistence.props),l=G({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ps=new fo((e=>this.Rs(e)),this.config.request_queue_config),this.Ts=new yo(this),this.__request_queue=[];var c="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(c||(this.sessionManager=new So(this),this.sessionPropsManager=new Eo(this,this.sessionManager,this.persistence)),new hr(this).startIfEnabledOrStop(),this.siteApps=new $o(this),null==(r=this.siteApps)||r.init(),c||(this.sessionRecording=new er(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Pt(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new fr(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new gr(this),this.exceptionObserver=new ni(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new ti(this,ei),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Ci(this),this.historyAutocapture.startIfEnabled(),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&B.info("Starting in debug mode",{this:this,config:t,thisC:G({},this.config),p:a,s:l}
1),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var u,h,d=this.config.get_device_id(Lt()),p=null!=(u=t.bootstrap)&&u.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(Le,null!=(h=t.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:p})}if(this.Cs()){var g,_,f=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlags)||{}).filter((e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])})).reduce(((e,i)=>{var s;return e[i]=(null==(s=t.bootstrap)||null==(s=s.featureFlags)?void 0:s[i])||!1,e}),{}),m=Object.keys((null==(_=t.bootstrap)?void 0:_.featureFlagPayloads)||{}).filter((e=>f[e])).reduce(((e,i)=>{var s,r;return null!=(s=t.bootstrap)&&null!=(s=s.featureFlagPayloads)&&s[i]&&(e[i]=null==(r=t.bootstrap)||null==(r=r.featureFlagPayloads)?void 0:r[i]),e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:f,featureFlagPayloads:m})}if(c)this.register_once({distinct_id:Ge,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(Lt());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Le,"anonymous")}return ne(s,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||Lt();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(Le,"identified")),t()},r=i.user();"then"in r&&R(r.then)?r.then((e=>s(e))):s(r)}(e,(()=>{i.register((e=>{Promise&&Promise.resolve||tr.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(tr.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(tr.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this.Ms())):this.Ms(),R(this.config._onCapture)&&this.config._onCapture!==jo&&(B.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&B.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}Re(e){var t,i,s,r,n,o,a,l;if(!c||!c.body)return B.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Re(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=w(e.supportedCompression,y.GZipJS)?y.GZipJS:w(e.supportedCompression,y.Base64)?y.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.$s?this.$s:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(s=this.sessionRecording)||s.onRemoteConfig(e),null==(r=this.autocapture)||r.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(o=this.webVitalsAutocapture)||o.onRemoteConfig(e),null==(a=this.exceptionObserver)||a.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(e)}Ms(){try{this.config.loaded(this)}catch(e){B.critical("`loaded` function failed",e)}this.Fs(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this.Os()}),1),new _o(this).load(),this.featureFlags.flags()}Fs(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Ps)||e.enable())}_dom_loaded(){this.is_capturing()&&Y(this.__request_queue,(e=>this.Rs(e))),this.__request_queue=[],this.Fs()}_handle_unload(){var e,t;this.config.request_batching?(this.As()&&this.capture("$pageleave"),null==(e=this.Ps)||e.unload(),null==(t=this.Ts)||t.unload()):this.As()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Pe(e){this.__loaded&&(Ho?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=wr(e.url,{ip:this.config.ip?1:0}),e.headers=G({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(e=>{var t,i,s,r=G({},e);r.timeout=r.timeout||6e4,r.url=wr(r.url,{_:(new Date).getTime().toString(),ver:v.LIB_VERSION,compression:r.compression});var n=null!==(t=r.transport)&&void 0!==t?t:"fetch",o=null!==(i=null==(s=re(Sr,(e=>e.transport===n)))?void 0:s.method)&&void 0!==i?i:Sr[0].method;if(!o)throw new Error("No available transport method");o(r)})(G({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(s=this.config).on_request_error)||i.call(s,t)),null==e.callback||e.callback(t)}}))))}Rs(e){this.Ts?this.Ts.retriableRequest(e):this.Pe(e)}_execute_array(e){var t,i=[],s=[],r=[];Y(e,(e=>{e&&(t=e[0],F(t)?r.push(e):R(e)?e.call(this):F(e)&&"alias"===t?i.push(e):F(e)&&-1!==t.indexOf("capture")&&R(this[t])?r.push(e):s.push(e))}));var n=function(e,t){Y(e,(function(e){if(F(e[0])){var i=t;J(e,(function(e){i=i[e[0]].apply(i,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};n(i,this),n(s,this),n(r,this)}Cs(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ps){if(this.is_capturing())if(!T(e)&&O(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var r=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==r||!r.isRateLimited){null!=t&&t.$current_url&&!O(null==t?void 0:t.$current_url)&&(B.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var n=new Date,o=(null==i?void 0:i.timestamp)||n,a=Lt(),l={uuid:a,event:e,properties:this.calculateEventProperties(e,t||{},o,a)};r&&(l.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),(null==i?void 0:i.$set)&&(l.$set=null==i?void 0:i.$set);var c,u=this.Ds(null==i?void 0:i.$set_once);if(u&&(l.$set_once=u),(l=function(e,t){return i=e,s=e=>O(e)&&!A(t)?e.slice(0,t):e,r=new Set,function e(t,i){return t!==Object(t)?s?s(t):t:r.has(t)?void 0:(r.add(t),F(t)?(n=[],Y(t,(t=>{n.push(e(t))}))):(n={},J(t,((t,i)=>{r.has(t)||(n[i]=e(t,i))}))),n);var n}(i);var i,s,r}(l,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=o,T(null==i?void 0:i.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=n),e===io.DISMISSED||e===io.SENT){var h=null==t?void 0:t[so.SURVEY_ID],d=null==t?void 0:t[so.SURVEY_ITERATION];c={id:h,current_iteration:d},localStorage.getItem(ao(c))||localStorage.setItem(ao(c),"true"),l.$set=G({},l.$set,{[oo({id:h,current_iteration:d},e===io.SENT?"responded":"dismissed")]:!0})}var p=G({},l.properties.$set,l.$set);if(M(p)||this.setPersonPropertiesForFlags(p),!D(this.config.before_send)){var g=this.js(l);if(!g)return;l=g}this.ys.emit("eventCaptured",l);var _={method:"POST",url:null!==(s=null==i?void 0:i._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Rs(_):this.Ps.enqueue(_),l}B.critical("This capture call is ignored due to client rate limiting.")}}else B.error("No event name provided to posthog.capture")}else B.uninitializedWarning("posthog.capture")}Ve(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,s,r){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var n=r?void 0:this.persistence.remove_event_timer(e),o=G({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),"$snapshot"===e){var a=G({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!O(o.distinct_id)&&!L(o.distinct_id)||C(o.distinct_id))&&B.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var l,u=Bn(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime());o.$session_id=h,o.$window_id=d}this.sessionPropsManager&&K(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&K(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(p=this.Ts)?void 0:p.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Mo.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),l="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewM
vendor: 14,058 bytes, line 1
1anager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=K(o,l),"$pageview"===e&&c&&(o.title=c.title),!T(n)){var _=i.getTime()-n;o.$duration=parseFloat((_/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=K({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),F(this.config.property_denylist)?J(this.config.property_denylist,(function(e){delete o[e]})):B.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var v=this.config.sanitize_properties;v&&(B.error("sanitize_properties is deprecated. Use before_send instead"),o=v(o,e));var f=this.Ls();return o.$process_person_profile=f,f&&!r&&this.Ns("_calculate_event_properties"),o}Ds(e){var t;if(!this.persistence||!this.Ls())return e;if(this.bs)return e;var i=this.persistence.get_initial_props(),s=null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps(),r=K({},i,s||{},e||{}),n=this.config.sanitize_properties;return n&&(B.error("sanitize_properties is deprecated. Use before_send instead"),r=n(r,"$set_once")),this.bs=!0,M(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}zs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.ys.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return B.uninitializedWarning("posthog.identify");if(L(e)&&(e=e.toString(),B.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))B.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Ge){if(this.Ns("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var r=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:r},"")}e!==s&&e!==this.get_property(ae)&&(this.unregister(ae),this.register({distinct_id:e}));var n="anonymous"===(this.persistence.get_property(Le)||"anonymous");e!==s&&n?(this.persistence.set_property(Le,"identified"),this.setPersonPropertiesForFlags(G({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.xs=Ir(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(De))}}else B.critical('The string "'+Ge+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else B.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ns("posthog.setPersonProperties")){var i=Ir(this.get_distinct_id(),e,t);this.xs!==i?(this.setPersonPropertiesForFlags(G({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.xs=i):B.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Ns("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:G({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else B.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Ns("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,r;if(B.info("reset"),!this.__loaded)return B.uninitializedWarning("posthog.reset");var n=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(s=this.persistence)||s.set_property(Le,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.xs=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Ge,$device_id:null},"");else{var o=this.config.get_device_id(Lt());this.register_once({distinct_id:o,$device_id:e?o:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(oe)?(B.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ns("posthog.alias")?(T(t)&&(t=this.get_distinct_id()),e!==t?(this.zs(ae,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(B.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=G({},this.config);if(P(e)){var i,s,r,n,o;K(this.config,Uo(e));var a=this.Is();null==(i=this.persistence)||i.update_config(this.config,t,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Xn(G({},this.config,{persistence:"sessionStorage"}),a),zt.O()&&"true"===zt.D("ph_debug")&&(this.config.debug=!0),this.config.debug&&(v.DEBUG=!0,B.info("set_config",{config:e,oldConfig:t,newConfig:G({},this.config)})),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(r=this.autocapture)||r.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.Us(),null==(o=this.externalIntegrations)||o.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(G({},Ti((e=>e instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:i}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Bo;return t!==Bo&&(t=Bo+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(Le))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(Le))}Ls(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&M(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[ae])&&(null==(t=this.persistence)||null==(t=t.props)||!t[ze]))}As(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Ls()||this.Ns("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ns(e){return"never"===this.config.person_profiles?(B.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zs(ze,!0),!0)}Is(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}Us(){var e,t,i,s,r=this.Is();return(null==(e=this.persistence)?void 0:e.Ae)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Ae)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),this.sessionManager=new So(this),this.persistence&&(this.sessionPropsManager=new Eo(this,this.sessionManager,this.persistence)),this.sessionRecording=new er(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Us(),(T(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Os()):B.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Us(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Ge,$device_id:null}),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,this.Os())):B.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Us()}_is_bot(){return l?Po(l,this.config.custom_blocked_useragents):void 0}Os(){c&&("visible"===c.visibilityState?this.ws||(this.ws=!0,this.capture("$pageview",{title:c.title},{send_instantly:!0}),this.Ss&&(c.removeEventListener("visibilitychange",this.Ss),this.Ss=null)):this.Ss||(this.Ss=this.Os.bind(this),ne(c,"visibilitychange",this.Ss)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==s||s.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var e,t,i,s,r,n,o=this.ks||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(B.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):(i="advanced_disable_decide",s=B,r=(t="advanced_disable_flags")in(e=o)&&!T(e[t]),n=i in e&&!T(e[i]),r?e[t]:!!n&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]))}js(e){if(D(this.config.before_send))return e;var t=F(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(i=s(i),D(i)){var r="Event '"+e.event+"' was rejected in beforeSend function";return q(e.event)?B.warn(r+". This can cause unexpected behavior."):B.info(r),null}i.properties&&!M(i.properties)||B.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;
1return null==(e=this.pageViewManager.ce)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}}!function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=ee(e.prototype[t[i]])}(Vo,["identify"]);var Wo,Yo=(Wo=qo[Bo]=new Vo,function(){function e(){e.done||(e.done=!0,Ho=!1,J(qo,(function(e){e._dom_loaded()})))}null!=c&&c.addEventListener?"complete"===c.readyState?e():ne(c,"DOMContentLoaded",e,{capture:!1}):s&&B.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Wo)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.