PageSourceSearch

https://www.stylemepretty.com/_next/static/chunks/9da6db1e-f1c780ae8be90fdd.js

js stylemepretty.com collected 2026-10-02 03:09:36 UTC 167,998 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0edeb-30ec-7840-80fa-101cd38da01f")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8229],{72341:(e,t,i)=>{i.d(t,{Ay:()=>nA});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.257.1"},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()},S=function(e){return e.replace(/^\$/,"")},x=Array.isArray,k=Object.prototype,I=k.hasOwnProperty,$=k.toString,F=x||function(e){return"[object Array]"===$.call(e)},C=e=>"function"==typeof e,P=e=>e===Object(e)&&!F(e),R=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),A=e=>O(e)&&0===e.trim().length,M=e=>null===e,L=e=>T(e)||M(e),D=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=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=Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("log",...i)},warn:function(){for(var e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("warn",...i)},error:function(){for(var e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];t.t("error",...i)},critical:function(){for(var t=arguments.length,i=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,U=H("[ExternalScriptsLoader]"),z=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return U.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}).apply(null,arguments)}function W(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;"remote-config"===t&&(s="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5));var r=e.requestRouter.endpointFor("assets",s);z(e,r,i)},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);z(e,s,i)};var V={};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)===V)return}}}function J(e,t,i){if(!L(e)){if(F(e))return Y(e,t,i);if(e instanceof FormData){for(var s of e.entries())if(t.call(i,s[1],s[0])===V)return}else for(var r in e)if(I.call(e,r)&&t.call(i,e[r],r)===V)return}}var K=function(e){for(var t=arguments.length,i=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=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=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=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)}}},et=function(e){var t={};return J(e,function(e,i){(O(e)&&e.length>0||D(e))&&(t[i]=e)}),t},ei=["herokuapp.com","vercel.app","netlify.app"];function es(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function er(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 en="$people_distinct_id",eo="__alias",ea="__timers",el="$autocapture_disabled_server_side",ec="$heatmaps_enabled_server_side",eu="$exception_capture_enabled_server_side",eh="$error_tracking_suppression_rules",ed="$web_vitals_enabled_server_side",ep="$dead_clicks_enabled_server_side",eg="$web_vitals_allowed_metrics",e_="$session_recording_enabled_server_side",ev="$console_log_recording_enabled_server_side",ef="$session_recording_network_payload_capture",em="$session_recording_masking",ey="$session_recording_canvas_recording",eb="$replay_sample_rate",ew="$replay_minimum_duration",eE="$replay_script_config",eS="$sesid",ex="$session_is_sampled",ek="$session_recording_url_trigger_activated_session",eI="$session_recording_event_trigger_activated_session",e$="$enabled_feature_flags",eF="$early_access_features",eC="$feature_flag_details",eP="$stored_person_properties",eR="$stored_group_properties",eT="$surveys",eO="$surveys_activated",eA="$flag_call_reported",eM="$user_state",eL="$client_session_props",eD="$capture_rate_limit",eN="$initial_campaign_params",eq="$initial_referrer_info",ej="$initial_person_info",eB="$epp",eH="__POSTHOG_TOOLBAR__",eU="$posthog_cookieless",ez=[en,eo,"__cmpns",ea,e_,ec,eS,e$,eh,eM,eF,eC,eR,eP,eT,eA,eL,eD,eN,eq,eB,ej];function eG(e){return e instanceof Element&&(e.id===eH||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function eW(e){return!!e&&1===e.nodeType}function eV(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}
1function eY(e){return!!e&&3===e.nodeType}function eJ(e){return!!e&&11===e.nodeType}function eK(e){return e?E(e).split(/\s+/):[]}function eZ(e){var t=null==s?void 0:s.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function eX(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 eK(t)}function eQ(e){return L(e)?null:E(e).split(/(\s+)/).filter(e=>ti(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function e0(e){var t="";return e5(e)&&!e6(e)&&e.childNodes&&e.childNodes.length&&J(e.childNodes,function(e){var i;eY(e)&&e.textContent&&(t+=null!=(i=eQ(e.textContent))?i:"")}),E(t)}function e1(e){var t;return T(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var e2=["a","button","form","input","select","textarea","label"];function e3(e){var t=e.parentNode;return!(!t||!eW(t))&&t}function e5(e){for(var t=e;t.parentNode&&!eV(t,"body");t=t.parentNode){var i=eX(t);if(w(i,"ph-sensitive")||w(i,"ph-no-capture"))return!1}if(w(eX(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 e6(e){return!!(eV(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||eV(e,"select")||eV(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var e4="(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})",e8=RegExp("^(?:"+e4+")$"),e7=new RegExp(e4),e9="\\d{3}-?\\d{2}-?\\d{4}",te=RegExp("^("+e9+")$"),tt=RegExp("("+e9+")");function ti(e,t){return void 0===t&&(t=!0),!(L(e)||O(e)&&(e=E(e),(t?e8:e7).test((e||"").replace(/[- ]/g,""))||(t?te:tt).test(e)))&&!0}function ts(e){var t=e0(e);return ti(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&J(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=e0(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){B.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function tr(e){return e.replace(/"|\\"/g,'\\"')}class tn{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 to=["localhost","127.0.0.1"],ta=e=>{var t=null==c?void 0:c.createElement("a");return T(t)?null:(t.href=e,t)},tl=function(e,t){void 0===t&&(t="&");var i,s,r=[];return J(e,function(e,t){T(e)||T(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)},tc=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," ")},tu=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},th=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},td=H("[AutoCapture]");function tp(e,t){return t.length>e?t.slice(0,e)+"...":t}class tg{constructor(e){this.i=!1,this.o=null,this.rageclicks=new tn,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}
1$(){if(this.isBrowserSupported()){if(s&&c){var e=e=>{e=e||(null==s?void 0:s.event);try{this.k(e)}catch(e){td.error("Failed to capture event",e)}};if(er(c,"submit",e,{capture:!0}),er(c,"change",e,{capture:!0}),er(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)};er(c,"copy",t,{capture:!0}),er(c,"cut",t,{capture:!0})}}}else td.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({[el]:!!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[el];if(M(this.o)&&!N(i)&&!this.instance.I())return!1;var s=null!=(t=this.o)?t:!!i;return!!this.instance.config.autocapture&&!s}k(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=e1(e);eY(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){if(void 0===i&&(i=void 0),!s||!e||eV(e,"html")||!eW(e)||null!=(o=i)&&o.url_allowlist&&!eZ(i.url_allowlist)||null!=(a=i)&&a.url_ignorelist&&eZ(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var o,a,l,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&&!eV(p,"body");)if(eJ(p.parentNode))h.push(p.parentNode.host),p=p.parentNode.host;else{if(!(d=e3(p)))break;if(r||e2.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)||!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&&(e2.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.S,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){for(var i,r,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!eV(h,"body");)eJ(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=e5(e);"a"===e.tagName.toLowerCase()&&(_=e.getAttribute("href"),_=t&&_&&ti(_)&&_),w(eX(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};e2.indexOf(r)>-1&&!i&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?n.$el_text=tp(1024,ts(e)):n.$el_text=tp(1024,e0(e)));var o=eX(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),J(e.attributes,function(i){var r;if((!e6(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&ti(i.value)&&(!O(r=i.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var o=i.value;"class"===i.name&&(o=eK(o).join(" ")),n["attr__"+i.name]=tp(1024,o)}});for(var a=1,l=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!eW(t));return t}(c);)a++,c.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l)),K(g,function(e){if(!e5(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&&ti(s)&&(t[i]=s)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(a||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=ts(e):p[0].$el_text=e0(e)),_){p[0].attr__href=_;
1var f,m,y=null==(f=ta(_))?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:p.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?F(t)?t:eK(t):void 0,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 r.attributes[t]=i}),r}).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)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?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)}).forEach(e=>{var[t,i]=e;return o[tr(t.toString())]=tr(i.toString())}),s+=":",s+=X(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},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)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString: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=eQ(null==s||null==(c=s.get
vendor: 4,686 bytes, line 1
1Selection())?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 C(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 D(e)&&isFinite(e)&&Math.floor(e)===e});var t_="0123456789abcdef";class tv{constructor(e){if(this.bytes=e,16!==e.length)throw 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>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,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 tv(r)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+t_.charAt(this.bytes[t]>>>4)+t_.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new tv(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 tf{constructor(){this.P=0,this.R=0,this.T=new tb}generate(){var e=this.generateOrAbort();if(T(e)){this.P=0;var t=this.generateOrAbort();if(T(t))throw 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.M();else{if(!(e+1e4>this.P))return;this.R++,this.R>0x3ffffffffff&&(this.P++,this.M())}return tv.fromFieldsV7(this.P,Math.trunc(this.R/0x40000000),0x3fffffff&this.R,this.T.nextUint32())}M(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}}var tm,ty=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw 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&&(ty=e=>crypto.getRandomValues(e));class tb{constructor(){this.C=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.C.length&&(ty(this.C),this.F=0),this.C[this.F++]}}var tw=()=>tE().toString(),tE=()=>(tm||(tm=new tf)).generate(),tS="",tx=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,tk={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}},L:function(e){var t;try{t=JSON.parse(tk.D(e))||{}}catch(e){}return t},j: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),tS)return tS;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+tw();!tS&&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",tS=n)}return tS}(e);if(!i){var s,r=(s=e.match(tx))?s[0]:"";r!==i&&B.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(c.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+24*i*36e5),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){try{tk.j(e,"",-1,t)}catch(e){return}}},tI=null,t$={O:function(){if(!M(tI))return tI;var e=!0;if(T(s))e=!1;else try{var t="__mplssupport__";t$.j(t,"xyz"),'"xyz"'!==t$.D(t)&&(e=!1),t$.N(t)}catch(t){e=!1}return e||B.error("localStorage unsupported; falling back to cookie store"),tI=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){t$.A(e)}return null},L:function(e){try{return JSON.parse(t$.D(e))||{}}catch(e){}return null},j:function(e,t){try{null==s||s.localStorage.setItem(e,JSON.stringify(t))}catch(e){t$.A(e)}},N:function(e){try{null==s||s.localStorage.removeItem(e)}catch(e){t$.A(e)}}},tF=["distinct_id",eS,ex,eB,ej],tC=G({},t$,{L:function(e){try{var t={};try{t=tk.L(e)||{}}catch(e){}var i=K(t,JSON.parse(t$.D(e)||"{}"));return t$.j(e,i),i}catch(e){}return null},j:function(e,t,i,s,r,n){try{t$.j(e,t,void 0,void 0,n);var o={};
1tF.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&tk.j(e,o,i,s,r,n)}catch(e){t$.A(e)}},N:function(e,t){try{null==s||s.localStorage.removeItem(e),tk.N(e,t)}catch(e){t$.A(e)}}}),tP={},tR={O:function(){return!0},A:function(e){B.error("memoryStorage error: "+e)},D:function(e){return tP[e]||null},L:function(e){return tP[e]||null},j:function(e,t){tP[e]=t},N:function(e){delete tP[e]}},tT=null,tO={O:function(){if(!M(tT))return tT;if(tT=!0,T(s))tT=!1;else try{var e="__support__";tO.j(e,"xyz"),'"xyz"'!==tO.D(e)&&(tT=!1),tO.N(e)}catch(e){tT=!1}return tT},A:function(e){B.error("sessionStorage error: ",e)},D:function(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){tO.A(e)}return null},L:function(e){try{return JSON.parse(tO.D(e))||null}catch(e){}return null},j:function(e,t){try{null==s||s.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){tO.A(e)}},N:function(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){tO.A(e)}}},tA=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class tM{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.U()?tA.DENIED:this.q}isOptedOut(){return this.consent===tA.DENIED||this.consent===tA.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.B.j(this.H,+!!e,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}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get q(){var e=this.B.D(this.H);return"1"===e?tA.GRANTED:"0"===e?tA.DENIED:tA.PENDING}get B(){if(!this.W){var e=this.S.opt_out_capturing_persistence_type;this.W="localStorage"===e?t$:tk;var t="localStorage"===e?tk:t$;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&&!!es([null==l?void 0:l.doNotTrack,null==l?void 0:l.msDoNotTrack,_.doNotTrack],e=>w([!0,1,"1","yes"],e))}}var tL=H("[Dead Clicks]"),tD=()=>!0,tN=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(ep)),s=e.instance.config.capture_dead_clicks;return N(s)?s:i};class tq{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({[ep]: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?tL.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),tL.info("starting...")}}else tL.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,tL.info("stopping..."))}}function tj(e,t,i,s,r){return t>i&&(B.warn("min cannot be greater than max."),t=i),D(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),tj(r||i,t,i,s))}class tB{constructor(e){this.K={},this.Y=()=>{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))?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=tj(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=tj(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=tj(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.Y()},this.st)}}var tH=H("[ExceptionAutocapture]");class tU{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){tH.error("failed to start",e),this.ht()}}},this._instance=e,this.dt=!(null==(t=this._instance.persistence)||!t.props[eu]),this.S=this.vt(),this.ct=new tB({refillRate:null!=(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?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&&(tH.info("enabled"),this.J(this.nt))}J(e){var t,i;
1null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return tH.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,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[eu]:this.dt}),this.startIfEnabled()}captureException(e){e.$exception_personURL=this._instance.requestRouter.endpointFor("ui")+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var t,i=null!=(t=e.$exception_list[0].type)?t:"Exception";this.ct.consumeRateLimit(i)?tH.info("Skipping exception capture because of client rate limiting.",{exception:e.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(e)}}function tz(e){return!T(Event)&&tG(e,Event)}function tG(e,t){try{return e instanceof t}catch(e){return!1}}function tW(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return tG(e,Error)}}function tV(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function tY(e){return tV(e,"DOMError")}var tJ=/\(error: (.*)\)/;function tK(e,t,i,s){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return T(i)||(r.lineno=i),T(s)||(r.colno=s),r}var tZ,tX,tQ,t0=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,t1=/^\s*
1at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,t2=/\((\S*)(?::(\d+))(?::(\d+))\)/,t3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,t5=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,t6=function(){for(var e=arguments.length,t=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=tJ.test(o)?o.replace(tJ,"$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}}}if(!i.length)return[];var u=Array.from(i);return u.reverse(),u.slice(0,50).map(e=>{var t;return G({},e,{filename:e.filename||((t=u)[t.length-1]||{}).filename,function:e.function||"?"})})}}([30,e=>{var t=t0.exec(e);if(t){var[,i,s,r]=t;return tK(i,"?",+s,+r)}var n=t1.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var o=t2.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}var[a,l]=t4(n[1]||"?",n[2]);return tK(l,a,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{var t=t3.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=t5.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]||"?";return[r,s]=t4(r,s),tK(s,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),t4=(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]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},t8=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function t7(e,t){void 0===t&&(t=0);var i=e.stacktrace||e.stack||"",s=e&&t9.test(e.message)?1:0;try{var r,n,o=(r=t6(i,s),n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var i=Object.keys(t);return tQ&&i.length===tX||(tX=i.length,tQ=i.reduce((i,s)=>{tZ||(tZ={});var r=tZ[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,tZ[s]=[l,c];break}}return i},{})),tQ}(t6),r.forEach(e=>{e.filename&&(e.chunk_id=n[e.filename])}),r);return o.slice(0,o.length-t)}catch(e){}return[]}var t9=/Minified React error #\d+;/i;function ie(e,t){return{$exception_list:function e(t,i){var s,r,n,o,a,l,c,u,h=(s=t,r=i,l=t7(s),c=null==(o=null==r?void 0:r.handled)||o,u=null!=(a=null==r?void 0:r.synthetic)&&a,{type:null!=r&&r.overrideExceptionType?r.overrideExceptionType:s.name,value:(n=s.message).error&&"string"==typeof n.error.message?String(n.error.message):String(n),stacktrace:{frames:l,type:"raw"},mechanism:{handled:c,synthetic:u}});return t.cause&&tW(t.cause)&&t.cause!==t?[h,...e(t.cause,{handled:null==i?void 0:i.handled,synthetic:null==i?void 0:i.synthetic})]:[h]}(e,t),$exception_level:"error"}}function it(e,t){var i,s,r,n=null==(i=null==t?void 0:t.handled)||i,o=null==(s=null==t?void 0:t.synthetic)||s,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!=(r=null==t?void 0:t.defaultExceptionType)?r:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:n,synthetic:o}};if(null!=t&&t.syntheticException){var l=t7(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function ii(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return C(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}class is{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.gt&&this.gt(),this.gt=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__||ii(s.history,"pushState",e=>function(t,s,r){e.call(this,t,s,r),i._t("pushState")}),null!=(t=s.history.replaceState)&&t.__posthog_wrapped__||ii(s.history,"replaceState",e=>function(t,s,r){e.call(this,t,s,r),i._t("replaceState")}),this.bt()}}_t(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)}}
1bt(){if(!this.gt){var e=()=>{this._t("popstate")};er(s,"popstate",e),this.gt=()=>{s&&s.removeEventListener("popstate",e)}}}}function ir(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}var io=(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))(io||{}),ia=(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))(ia||{}),il="[SessionRecording]",ic="redacted",iu={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"]},ih=["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"],id=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],ip=["/s/","/e/","/i/"];function ig(e,t,i,s){if(L(e))return e;var r=(null==t?void 0:t["content-length"])||new Blob([e]).size;return O(r)&&(r=parseInt(r)),r>i?il+" "+s+" body too large to record ("+r+" bytes)":e}function i_(e,t){if(L(e))return e;var i=e;return ti(i,!1)||(i=il+" "+t+" body "+ic),J(id,e=>{var s,r;null!=(s=i)&&s.length&&-1!==(null==(r=i)?void 0:r.indexOf(e))&&(i=il+" "+t+" body "+ic+" as might contain: "+e)}),i}class iv{constructor(e,t){var i,s;void 0===t&&(t={}),this.yt={},this.wt=e=>{if(!this.yt[e]){this.yt[e]=!0;var t,i,s=this.St(e);null==(t=(i=this.rt).onBlockedNode)||t.call(i,e,s)}},this.$t=e=>{var t=this.St(e);if("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.kt=e=>{var t,i,s,r,n,o,a,l;return(null!=(t=null==(i=e.removes)?void 0:i.length)?t:0)+(null!=(s=null==(r=e.attributes)?void 0:r.length)?s:0)+(null!=(n=null==(o=e.texts)?void 0:o.length)?n:0)+(null!=(a=null==(l=e.adds)?void 0:l.length)?a:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,i=this.kt(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var[t]=this.$t(e.id);return!this.ct.consumeRateLimit(t)&&e}));var s=this.kt(t);return 0!==s||i===s?e:void 0},this._rrweb=e,this.rt=t,this.ct=new tB({bucketSize:null!=(i=this.rt.bucketSize)?i:100,refillRate:null!=(s=this.rt.refillRate)?s:10,refillInterval:1e3,et:this.wt})}}var im=Uint8Array,iy=Uint16Array,ib=Uint32Array,iw=new im([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]),iE=new im([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]),iS=new im([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ix=function(e,t){for(var i=new iy(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var r=new ib(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]},ik=ix(iw,2),iI=ik[0],i$=ik[1];iI[28]=258,i$[258]=28;for(var iF=ix(iE,0)[1],iC=new iy(32768),iP=0;iP<32768;++iP){var iR=(43690&iP)>>>1|(21845&iP)<<1;iR=(61680&(iR=(52428&iR)>>>2|(13107&iR)<<2))>>>4|(3855&iR)<<4,iC[iP]=((65280&iR)>>>8|(255&iR)<<8)>>>1}var iT=function(e,t,i){for(var s=e.length,r=0,n=new iy(t);r<s;++r)++n[e[r]-1];var o,a=new iy(t);for(r=0;r<t;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new iy(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[iC[h]>>>l]=c}else for(o=new iy(s),r=0;r<s;++r)o[r]=iC[a[e[r]-1]++]>>>15-e[r];return o},iO=new im(288);for(iP=0;iP<144;++iP)iO[iP]=8;for(iP=144;iP<256;++iP)iO[iP]=9;for(iP=256;iP<280;++iP)iO[iP]=7;for(iP=280;iP<288;++iP)iO[iP]=8;var iA=new im(32);for(iP=0;iP<32;++iP)iA[iP]=5;var iM=iT(iO,9,0),iL=iT(iA,5,0),iD=function(e){return(e/8|0)+(7&e&&1)},iN=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof iy?iy:e instanceof ib?ib:im)(i-t);return s.set(e.subarray(t,i)),s},iq=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},ij=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},iB=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new im(0),0];if(1==r){var o=new im(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 iy(d+1),g=iH(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 im(p),g]},iH=function(e,t,i){return -1==e.s?Math.max(iH(e.l,t,i+1),iH(e.r,t,i+1)):t[e.s]=i},iU=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new iy(++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]},iz=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},iG=function(e,t,i){var s=i.length,r=iD(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)},iW=function(e,t,i,s,r,n,o,a,l,c,u){iq(t,u++,i),++r[256];for(var h=iB(r,15),d=h[0],p=h[1],g=iB(n,15),_=g[0],v=g[1],f=iU(d),m=f[0],y=f[1],b=iU(_),w=b[0],E=b[1],S=new iy(19),x=0;x<m.length;++x)S[31&m[x]]++;for(x=0;x<w.length;++x)S[31&w[x]]++;for(var k=iB(S,7),I=k[0],$=k[1],F=19;F>4&&!I[iS[F-1]];--F);var C,P,R,T,O=c+5<<3,A=iz(r,iO)+iz(n,iA)+o,M=iz(r,d)+iz(n,_)+o+14+3*F+iz(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(O<=A&&O<=M)return iG(t,u,e.subarray(l,l+c));if(iq(t,u,1+(M<A)),u+=2,M<A){C=iT(d,p,0),P=d,R=iT(_,v,0),T=_;var L=iT(I,$,0);for(iq(t,u,y-257),iq(t,u+5,E-1),iq(t,u+10,F-4),u+=14,x=0;x<F;++x)iq(t,u+3*x,I[iS[x]]);u+=3*F;for(var D=[m,w],N=0;N<2;++N){var q=D[N];for(x=0;x<q.length;++x){var j=31&q[x];iq(t,u,L[j]),u+=I[j],j>15&&(iq(t,u,q[x]>>>5&127),u+=q[x]>>>12)}}}else C=iM,P=iO,R=iL,T=iA;for(x=0;x<a;++x)if(s[x]>255){ij(t,u,C[(j=s[x]>>>18&31)+257]),u+=P[j+257],j>7&&(iq(t,u,s[x]>>>23&31),u+=iw[j]);var B=31&s[x];ij(t,u,R[B]),u+=T[B],B>3&&(ij(t,u,s[x]>>>5&8191),u+=iE[B])}else ij(t,u,C[s[x]]),u+=P[s[x]];return ij(t,u,C[256]),u+P[256]},iV=new ib([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),iY=function(){for(var e=new ib(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),iJ=function(){var e=0xffffffff;return{p:function(t){for(var i=e,s=0;s<t.length;++s)i=iY[255&i^t[s]]^i>>>8;e=i},d:function(){return 0xffffffff^e}}},iK=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},iZ=function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&iK(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)}};function iX(e,t){void 0===t&&(t={});var i,s,r,n=iJ(),o=e.length;n.p(e);var a=(s=t,r=10+((i=t).filename&&i.filename.length+1||0),function(e,t,i,s,r,n){var o=e.length,a=new im(s+o+5*(1+Math.floor(o/7e3))+8),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=iG(l,c,e.subarray(u,h)):(l[u]=n,c=iG(l,c,e.subarray(u,o)))}else{for(var d=iV[t-1],p=d>>>13,g=8191&d,_=(1<<i)-1,v=new iy(32768),f=new iy(_+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 ib(25e3),E=new iy(288),S=new iy(32),x=0,k=0,I=(u=0,0),$=0,F=0;u<o;
1++u){var C=b(u),P=32767&u,R=f[C];if(v[P]=R,f[C]=P,$<=u){var T=o-u;if((x>7e3||I>24576)&&T>423){c=iW(e,l,0,w,E,S,k,I,F,u-F,c),I=x=k=0,F=u;for(var O=0;O<286;++O)E[O]=0;for(O=0;O<30;++O)S[O]=0}var A=2,M=0,L=g,D=P-R&32767;if(T>2&&C==b(u-D))for(var N=Math.min(p,T)-1,q=Math.min(32767,u),j=Math.min(258,T);D<=q&&--L&&P!=R;){if(e[u+A]==e[u+A-D]){for(var B=0;B<j&&e[u+B]==e[u+B-D];++B);if(B>A){if(A=B,M=D,B>N)break;var H=Math.min(D,B-2),U=0;for(O=0;O<H;++O){var z=u-D+O+32768&32767,G=z-v[z]+32768&32767;G>U&&(U=G,R=z)}}}D+=(P=R)-(R=v[P])+32768&32767}if(M){w[I++]=0x10000000|i$[A]<<18|iF[M];var W=31&i$[A],V=31&iF[M];k+=iw[W]+iE[V],++E[257+W],++S[V],$=u+A,++x}else w[I++]=e[u],++E[e[u]]}}c=iW(e,l,n,w,E,S,k,I,F,u-F,c)}return iN(a,0,s+iD(c)+r)}(e,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+s.mem,r,8,!0)),l=a.length;return iZ(a,t),iK(a,l-8,n.d()),iK(a,l-4,o),a}function iQ(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new im(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 im(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):(l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return iN(s,0,r)}var i0="disabled",i1="sampled",i2="active",i3="buffering",i5="paused",i6="trigger",i4=i6+"_activated",i8=i6+"_pending",i7=i6+"_"+i0;function i9(e,t){return t.some(t=>"regex"===t.matching&&new RegExp(t.url).test(e))}class se{constructor(e){this.xt=e}triggerStatus(e){var t=this.xt.map(t=>t.triggerStatus(e));return t.includes(i4)?i4:t.includes(i8)?i8:i7}stop(){this.xt.forEach(e=>e.stop())}}class st{constructor(e){this.xt=e}triggerStatus(e){var t=new Set;for(var i of this.xt)t.add(i.triggerStatus(e));switch(t.delete(i7),t.size){case 0:return i7;case 1:return Array.from(t)[0];default:return i8}}stop(){this.xt.forEach(e=>e.stop())}}class si{triggerStatus(){return i8}stop(){}}class ss{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?i7:(null==(t=this._instance)?void 0:t.get_property(ek))===e?i4:i8}triggerStatus(e){var t=this.Pt(e),i=t===i4?i4:t===i8?i8:i7;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=i9(r,this.It);n&&o||(o&&!n?e():!o&&n&&t(),i9(r,this.Et)&&i("url"))}}stop(){}}class sr{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=e}triggerStatus(){var e=i8;return L(this.linkedFlag)&&(e=i7),this.linkedFlagSeen&&(e=i4),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,!L(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 sn{constructor(e){this.Tt=[],this._instance=e}onRemoteConfig(e){var t;this.Tt=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]}Mt(e){var t;return 0===this.Tt.length?i7:(null==(t=this._instance)?void 0:t.get_property(eI))===e?i4:i8}triggerStatus(e){var t=this.Mt(e),i=t===i4?i4:t===i8?i8:i7;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:i}),i}stop(){}}function so(e){return e.isRecordingEnabled?i3:i0}function sa(e){if(!e.receivedFlags)return i3;if(!e.isRecordingEnabled)return i0;if(e.urlTriggerMatching.urlBlocked)return i5;var t=!0===e.isSampled,i=new se([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?i1:i===i4?i2:i===i8?i3:!1===e.isSampled?i0:i2}function sl(e){if(!e.receivedFlags)return i3;if(!e.isRecordingEnabled)return i0;if(e.urlTriggerMatching.urlBlocked)return i5;var t=new st([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),i=t!==i7,s=N(e.isSampled);return i&&t===i8?i3:i&&t===i7||s&&!e.isSampled?i0:!0===e.isSampled?i1:i2}var sc="[SessionRecording]",su=H(sc);function sh(){var e;return null==_||null==(e=_.__PosthogExtensions__)||null==(e=e.rrweb)?void 0:e.record}var sd=[ia.MouseMove,ia.MouseInteraction,ia.Scroll,ia.ViewportResize,ia.Input,ia.TouchMove,ia.MediaInteraction,ia.Drag],sp=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function sg(e){return function(e,t){for(var i="",s=0;s<e.length;){var r=e[s++];r<128||t?i+=String.fromCharCode(r):r<224?i+=String.fromCharCode((31&r)<<6|63&e[s++]):r<240?i+=String.fromCharCode((1
15&r)<<12|(63&e[s++])<<6|63&e[s++]):i+=String.fromCharCode(55296|(r=((15&r)<<18|(63&e[s++])<<12|(63&e[s++])<<6|63&e[s++])-65536)>>10,56320|1023&r)}return i}(iX(iQ(JSON.stringify(e))),!0)}function s_(e){return e.type===io.Custom&&"sessionIdle"===e.data.tag}class sv{get sessionId(){return this.Ct}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 Error(sc+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var e,t;return this.Lt.triggerStatus(this.sessionId)===i8?6e4:null!=(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)?e:3e5}get jt(){var e=this._instance.get_property(ex);return N(e)?e:null}get Nt(){var e,t,i=null==(e=this.C)?void 0:e.data[(null==(t=this.C)?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(e_),t=!this._instance.config.disable_session_recording;return s&&e&&t}get Ut(){var e=!!this._instance.get_property(ev),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(ey),l=null!=(e=null!=(t=null==o?void 0:o.recordCanvas)?t:null==a?void 0:a.enabled)&&e,c=null!=(i=null!=(s=null==o?void 0:o.canvasFps)?s:null==a?void 0:a.fps)?i:4,u=null!=(r=null!=(n=null==o?void 0:o.canvasQuality)?n:null==a?void 0:a.quality)?r:.4;if("string"==typeof u){var h=parseFloat(u);u=isNaN(h)?.4:h}return{enabled:l,fps:tj(c,0,12,"canvas recording fps",4),quality:tj(u,0,1,"canvas recording quality",.4)}}get Bt(){var e,t,i=this._instance.get_property(ef),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(em),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)?s:null==o?void 0:o.maskAllInputs,c=null!=(r=null==a?void 0:a.maskTextSelector)?r:null==o?void 0:o.maskTextSelector,u=null!=(n=null==a?void 0:a.blockSelector)?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(eb);return D(e)?e:null}get Gt(){var e=this._instance.get_property(ew);return D(e)?e:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.jt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):i3}constructor(e){if(this.Vt=so,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.Lt=new si,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 su.error("started without valid sessionManager"),Error(sc+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw Error(sc+" cannot be used with __preview_experimental_cookieless_mode.");this.Xt=new sr(this._instance),this.Kt=new ss(this._instance),this.Yt=new sn(this._instance);var{sessionId:t,windowId:i}=this.At.checkAndGetSessionAndWindowId();this.Ct=t,this.fi=i,this.C=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&su.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as i
1dle")}startIfEnabledOrStop(e){this.zt?(this.gi(e),er(s,"beforeunload",this.oi),er(s,"offline",this.li),er(s,"online",this.hi),er(s,"visibilitychange",this.di),this.mi(),this.bi(),L(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){su.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(eI),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(ek))}))):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(),su.info("stopped"))}Si(){var e;null==(e=this._instance.persistence)||e.unregister(ex)}$i(e){var t,i=this.Ct!==e,s=this.Wt;if(D(s)){var r=this.jt,n=i||!N(r),o=n?function(e){for(var t=0,i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i)|0;return Math.abs(t)}(e)%100<tj(100*s,0,100):r;n&&(o?this.ki(i1):su.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({[ex]:o})}else this.Si()}onRemoteConfig(e){var t,i,s,r;this.ui("$remote_config_received",e),this.xi(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=sa,this.Lt=new se([this.Yt,this.Kt])):(this.Vt=sl,this.Lt=new st([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.ki("linked_flag_matched",{flag:e,variant:t})}),this.Jt=!0,this.startIfEnabledOrStop()}mi(){D(this.Wt)&&L(this.si)&&(this.si=this.At.onSessionId(e=>{this.$i(e)}))}xi(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=L(h)?null:parseFloat(h);L(d)&&this.Si();var p=null==(s=e.sessionRecording)?void 0:s.minimumDurationMilliseconds;i.register({[e_]:!!e.sessionRecording,[ev]:null==(r=e.sessionRecording)?void 0:r.consoleLogRecordingEnabled,[ef]:G({capturePerformance:e.capturePerformance},null==(n=e.sessionRecording)?void 0:n.networkPayloadCapture),[em]:null==(o=e.sessionRecording)?void 0:o.masking,[ey]:{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},[eb]:d,[ew]:T(p)?null:p,[eE]: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){if(!T(Object.assign)&&!T(Array.from)&&!(this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var t;(this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),sh())?this.Ei():null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.Ii,e=>{if(e)return su.error("could not load recorder",e);this.Ei()}),su.info("starting"),this.status===i2&&this.ki(e||"recording_initialized")}}get Ii(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property(eE))?void 0:e.script)||"recorder"}Pi(e){var t;return 3===e.type&&-1!==sd.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.C.data.length,bufferSize:this.C.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.Ct!==n,a=this.fi!==r;this.fi=r,this.Ct=n,o||a?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this.Ti()}}Mi(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}):su.warn("could not emit queued rrweb event.",t,e),!1}}ui(e,t){return this.Mi(sp(()=>sh().addCustomEvent(e,t)))}Ci(){return this.Mi(sp(()=>sh().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};for(var[n,o]of Object.entries(this._instance.config.session_recording||{}))n in r&&("maskInputOptions"===n?r.maskInputOptions=G({password:!0},o):r[n]=o);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)||t,r.maskTextSelector=null!=(i=this.Ht.maskTextSelector)?i:void 0,r.blockSelector=null!=(s=this.Ht.blockSelector)?s:void 0);var a=sh();if(a){this.Fi=null!=(e=this.Fi)?e:new iv(a,{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";su.info(i,{node:t}),this.log(sc+" "+i,"warn")}});var l=this.Oi();this.ci=a(G({emit:e=>{this.onRRwebEmit(e)},plugins:l},r)),this.ti=Date.now(),this.Zt=N(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:r,activePlugins:l.map(e=>null==e?void 0:e.name)}),this.ui("$posthog_config",{config:this._instance.config})}else su.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.Ci()},e))}}Oi(){var e,t,i,s,r,n,o,a,l,c,u,h,d,p=[],g=null==(h=_.__PosthogExtensions__)||null==(h=h.rrwebPlugins)?void 0:h.getRecordConsolePlugin;g&&this.Ut&&p.push(g());var v=null==(d=_.__PosthogExtensions__)||null==(d=d.rrwebPlugins)?void 0:d.getRecordNetworkPlugin;return this.Bt&&C(v)&&(!to.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?p.push(v((e=this._instance.config,t=this.Bt,r={payloadSizeLimitBytes:iu.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...iu.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...iu.payloadHostDenyList]},n=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,a=!1!==e.capture_performance&&t.recordPerformance,s=Math.min(1e6,null!=(i=r.payloadSizeLimitBytes)?i:1e6),l=e=>(null!=e&&e.requestBody&&(e.requestBody=ig(e.requestBody,e.requestHeaders,s,"Request")),null!=e&&e.responseBody&&(e.responseBody=ig(e.responseBody,e.responseHeaders,s,"Response")),e),c=t=>{var i;return l(((e,t)=>{var i,s=ta(e.name),r=0===t.indexOf("http")?null==(i=ta(t))?void 0:i.pathname:t;"/"===r&&(r="");var n=null==s?void 0:s.pathname.replace(r||"","");if(!(s&&n&&ip.some(e=>0===n.indexOf(e))))return e})((L(i=t.requestHeaders)||J(Object.keys(null!=i?i:{}),e=>{ih.includes(e.toLowerCase())&&(i[e]=ic)}),t),e.api_host))},(u=C(e.session_recording.maskNetworkRequestFn))&&C(e.session_recording.maskCapturedNetworkRequestFn)&&B.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),u&&(e.session_recording.maskCapturedNetworkRequestFn=t=>{var i=e.session_recording.maskNetworkRequestFn({url:t.name});return G({},t,{name:null==i?void 0:i.url})}),r.maskRequestFn=C(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var i,s=c(t);return s&&null!=(i=null==e.session_recording.maskCapturedNetworkRequestFn?void 0:e.session_recording.maskCapturedNetworkRequestFn(s))?i:void 0}:e=>(function(e){if(!T(e))return e.requestBody=i_(e.requestBody,"Request"),e.responseBody=i_(e.responseBody,"Response"),e})(c(e)),G({},iu,r,{recordHeaders:n,recordBody:o,recordPerformance:a,recordInitialRequests:a})))):su.info("NetworkCapture not started because we are on localhost.")),p}onRRwebEmit(e){var t;if(this.Ai(),e&&P(e)){if(e.type===io.Meta){var i=this.yi(e.data.href);if(this.Di=i,!i)return;e.data.href=i}else this.Li();if(this.Kt.checkUrlTriggerConditions(()=>this.ji(),()=>this.Ni(),e=>this.zi(e)),!this.Kt.urlBlocked||e.type===io.Custom&&"recording paused"===e.data.tag){e.type===io.FullSnapshot&&this.Ti(),e.type===io.FullSnapshot&&this.Jt&&this.Lt.triggerStatus(this.sessionId)===i8&&this.pi();var s=this.Fi?this.Fi.throttleMutations(e):e;if(s){var r=function(e){if(e&&P(e)&&6===e.type&&P(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],i=0;i<e.data.payload.payload.length;i++)e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?t.push(e.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[i]);return e.data.payload.payload=t,e}return e}(s);if(this.Ri(r),!0!==this.Zt||s_(r)){if(s_(r)){var n=r.data.payload;n&&(r.timestamp=n.lastActivityTimestamp+n.threshold)}var o=null==(t=this._instance.config.session_recording.compress_events)||t?function(e){if(1024>ir(e))return e;try{if(e.type===io.FullSnapshot)return G({},e,{data:sg(e.data),cv:"2024-10"});if(e.type===io.IncrementalSnapshot&&e.data.source===ia.Mutation)return G({},e,{cv:"2024-10",data:G({},e.data,{texts:sg(e.data.texts),attributes:sg(e.data.attributes),removes:sg(e.data.removes),adds:sg(e.data.adds)})});if(e.type===io.IncrementalSnapshot&&e.data.source===ia.StyleSheetRule)return G({},e,{cv:"2024-10",data:G({},e.data,{adds:e.data.adds?sg(e.data.adds):void 0,removes:e.data.removes?sg(e.data.removes):void 0})})}catch(e){su.error("could not compress event - will use uncompressed event",e)}return e}
1(r):r,a={$snapshot_bytes:ir(o),$snapshot_data:o,$session_id:this.Ct,$window_id:this.fi};this.status!==i0?this.Ui(a):this.pi()}}}}}Li(){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.Mi(e)})}}yi(e){var t=this._instance.config.session_recording;if(t.maskNetworkRequestFn){var i,s={url:e};return null==(i=s=t.maskNetworkRequestFn(s))?void 0:i.url}return e}pi(){return this.C={size:0,data:[],sessionId:this.Ct,windowId:this.fi},this.C}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var e=this.Gt,t=this.Nt,i=D(t)&&t>=0,s=D(e)&&i&&t<e;return this.status===i3||this.status===i5||this.status===i0||s?(this.qi=setTimeout(()=>{this.ai()},2e3),this.C):(this.C.data.length>0&&(function e(t,i){if(void 0===i&&(i=6606028.8),t.size>=i&&t.data.length>1){var s=Math.floor(t.data.length/2),r=t.data.slice(0,s),n=t.data.slice(s);return[e({size:ir(r),data:r,sessionId:t.sessionId,windowId:t.windowId}),e({size:ir(n),data:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(e=>e)}return[t]})(this.C).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.C)?void 0:t.data.length)||0);!this.Zt&&(this.C.size+e.$snapshot_bytes+i>943718.4||this.C.sessionId!==this.Ct)&&(this.C=this.ai()),this.C.size+=e.$snapshot_bytes,this.C.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.Lt.triggerStatus(this.sessionId)===i8&&(null==(t=this._instance)||null==(t=t.persistence)||t.register({["url"===e?ek:eI]:this.Ct}),this.ai(),this.ki(e+"_trigger_matched"))}ji(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),su.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Ci(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),su.info("recording resumed"))}bi(){0!==this.Yt.Tt.length&&L(this.ni)&&(this.ni=this._instance.on("eventCaptured",e=>{try{this.Yt.Tt.includes(e.event)&&this.zi("event")}catch(e){su.error("Could not activate event trigger",e)}}))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Ci(),this.ki("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[ex]:!0}),this.Ci(),this.ki("sampling_overridden")}overrideTrigger(e){this.zi(e)}ki(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),su.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.C.data.length,$sdk_debug_replay_internal_buffer_size:this.C.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:e}}}var sf=H("[SegmentIntegration]"),sm="posthog-js";function sy(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"]}=void 0===t?{}:t;return t=>{if(!("*"===n||n.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var o,a,l,c,u,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 sb{constructor(e,t,i,s,r){this.name=sm,this.setupOnce=function(n){n(sy(e,{organization:t,projectId:i,prefix:s,severityAllowList:r}))}}}var sw=null!=s&&s.location?th(s.location.hash,"__posthog")||th(location.hash,"state"):null,sE="_postHogToolbarParam
1s",sS=H("[Toolbar]"),sx=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(sx||{});class sk{constructor(e){this.instance=e}Hi(e){_.ph_toolbar_state=e}Wi(){var e;return null!=(e=_.ph_toolbar_state)?e:sx.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=sw||th(e.hash,"__posthog")||th(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(sE)||"{}")).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;!L(t)&&C(t)?t(e,this.instance):sS.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==c||!c.getElementById(eH));if(!s||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=G({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(s.localStorage.setItem(sE,JSON.stringify(G({},n,{source:void 0}))),this.Wi()===sx.LOADED)?this.Gi(n):this.Wi()===sx.UNINITIALIZED&&(this.Hi(sx.LOADING),null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return sS.error("[Toolbar] Failed to load",e),void this.Hi(sx.UNINITIALIZED);this.Hi(sx.LOADED),this.Gi(n)}),er(s,"turbolinks:load",()=>{this.Hi(sx.UNINITIALIZED),this.loadToolbar(n)})),!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 sI=H("[TracingHeaders]");class s${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.get_distinct_id(),this._instance.sessionManager)),T(this.Ki)&&(null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(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 sI.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 sF=H("[Web Vitals]");class sC{constructor(e){var t;this.Yi=!1,this.i=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),0!==this.C.metrics.length&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((e,t)=>G({},e,{["$web_vitals_"+t.name+"_event"]:G({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.C={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))sF.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.te();T(s)||(L(null==e?void 0:e.name)||L(null==e?void 0:e.value)?sF.error("Invalid metric received",e):this.ie&&e.value>=this.ie?sF.error("Ignoring metric with value >= "+this.ie,e):(this.C.url!==s&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),T(this.C.url)&&(this.C.url=s),this.C.firstMetricTimestamp=T(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.C.metrics.push(G({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.C.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):sF.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Yi=!(null==(t=this._instance.persistence)||!t.props[ed]),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[eg])||["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)&&D(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return sF.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&&(sF.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({[ed]:t}),this._instance.persistence.register({[eg]: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?sF.error("failed to load script",t):e()})}te(){var e=s?s.location.href:void 0;return e||sF.error("Could not determine current URL"),e}}var sP=H("[Heatmaps]");function sR(e){return P(e)&&"clientX"in e&&"clientY"in e&&D(e.clientX)&&D(e.clientY)}class sT{constructor(e){var t;this.rageclicks=new tn,this.Yi=!1,this.i=!1,this.ee=null,this.instance=e,this.Yi=!(null==(t=this.instance.persistence)||!t.props[ec])}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)this.i||(sP.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds));else{var e,t;clearInterval(null!=(e=this.ee)?e:void 0),null==(t=this.ne)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ec]:t}),this.Yi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}oe(e){this.ae(e.originalEvent,"deadclick")}
1re(){s&&c&&(er(s,"beforeunload",this.se.bind(this)),er(c,"click",e=>this.ae(e||(null==s?void 0:s.event)),{capture:!0}),er(c,"mousemove",e=>this.le(e||(null==s?void 0:s.event)),{capture:!0}),this.ne=new tq(this.instance,tD,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&&eW(r)&&!eV(r,"body")&&r!==i;){if(w(t,null==s?void 0:s.getComputedStyle(r).position))return!0;r=e3(r)}return!1}(e1(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"),!eG(e.target)&&sR(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){!eG(e.target)&&sR(e)&&(clearTimeout(this.de),this.de=setTimeout(()=>{this.he(this.ue(e,"mousemove"))},500))}he(e){if(s){var t=s.location.href;this.C=this.C||{},this.C[t]||(this.C[t]=[]),this.C[t].push(e)}}se(){this.C&&!R(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class sO{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)?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:tj(o/n,0,1),d=n<=1?1:tj(a/n,0,1),p=l<=1?1:tj(c/l,0,1),g=l<=1?1:tj(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 sA=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),M(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=r+1)}return i>t&&(n+=e.substring(t,e.length)),n},sM=!!d||!!h,sL="text/plain",sD=(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=tl(r);return i+"?"+(n=n?(s?s+"&":"")+n:s)},sN=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),sq=e=>{var{data:t,compression:i}=e;if(t){if(i===y.GZipJS){var s=new Blob([iX(iQ(sN(t)),{mtime:0})],{type:sL});return{contentType:sL,body:s,estimatedSize:s.size}}if(i===y.Base64){var r=(e=>"data="+encodeURIComponent("string"==typeof e?e:sN(e)))(function(e){var t,i,s,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=sA(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}(sN(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var n=sN(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},sj=[];h&&sj.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:r,estimatedSize:n}=null!=(t=sq(e))?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&&52428.8>(n||0),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&&sj.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=sq(e))?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};
1if(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&&sj.push({transport:"sendBeacon",method:e=>{var t=sD(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!=(i=sq(e))?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;l.sendBeacon(t,n)}catch(e){}}});var sB=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 sH(e,t,i){return sN({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var sU={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=>sB(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!sB(t,e))),icontains:(e,t)=>t.map(sz).some(t=>e.map(sz).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(sz).every(t=>e.map(sz).every(e=>!t.includes(e)))},sz=e=>e.toLowerCase(),sG=H("[Error tracking]");class sW{constructor(e){var t,i;this.fe=[],this._instance=e,this.fe=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(eh))?t:[]}onRemoteConfig(e){var t,i,s=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[];this.fe=s,this._instance.persistence&&this._instance.persistence.register({[eh]:this.fe})}sendExceptionEvent(e){if(!this.pe(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});sG.info("Skipping exception capture because a suppression rule matched")}pe(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=sU[e.operator],r=F(e.value)?e.value:[e.value],n=null!=(t=i[e.key])?t:[];return r.length>0&&s(r,n)});return"OR"===e.type?t.some(Boolean):t.every(Boolean)})}}var sV="Mobile",sY="Android",sJ="Tablet",sK=sY+" "+sJ,sZ="iPad",sX="Apple",sQ=sX+" Watch",s0="Safari",s1="BlackBerry",s2="Samsung",s3=s2+"Browser",s5=s2+" Internet",s6="Chrome",s4=s6+" OS",s8=s6+" iOS",s7="Internet Explorer",s9=s7+" "+sV,re="Opera",rt=re+" Mini",ri="Edge",rs="Microsoft "+ri,rr="Firefox",rn=rr+" iOS",ro="Nintendo",ra="PlayStation",rl="Xbox",rc=sY+" "+sV,ru=sV+" "+s0,rh="Windows",rd=rh+" Phone",rp="Nokia",rg="Ouya",r_="Generic",rv=r_+" "+sV.toLowerCase(),rf=r_+" "+sJ.toLowerCase(),rm="Konqueror",ry="(\\d+(\\.\\d+)?)",rb=RegExp("Version/"+ry),rw=RegExp(rl,"i"),rE=RegExp(ra+" \\w+","i"),rS=RegExp(ro+" \\w+","i"),rx=RegExp(s1+"|PlayBook|BB10","i"),rk={"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"},rI=function(e,t){let i;return t=t||"",w(e," OPR/")&&w(e,"Mini")?rt:w(e," OPR/")?re:rx.test(e)?s1:w(e,"IE"+sV)||w(e,"WPDesktop")?s9:w(e,s3)?s5:w(e,ri)||w(e,"Edg/")?rs:w(e,"FBIOS")?"Facebook "+sV:w(e,"UCWEB")||w(e,"UCBrowser")?"UC Browser":w(e,"CriOS")?s8:w(e,"CrMo")||w(e,s6)?s6:w(e,sY)&&w(e,s0)?rc:w(e,"FxiOS")?rn:w(e.toLowerCase(),rm.toLowerCase())?rm:(i=t)&&w(i,sX)||w(e,s0)&&!w(e,s6)&&!w(e,sY)?w(e,sV)?ru:s0:w(e,rr)?rr:w(e,"MSIE")||w(e,"Trident/")?s7:w(e,"Gecko")?rr:""},r$={[s9]:[RegExp("rv:"+ry)],[rs]:[RegExp(ri+"?\\/"+ry)],[s6]:[RegExp("("+s6+"|CrMo)\\/"+ry)],[s8]:[RegExp("CriOS\\/"+ry)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+ry)],[s0]:[rb],[ru]:[rb],[re]:[RegExp("(Opera|OPR)\\/"+ry)],[rr]:[RegExp(rr+"\\/"+ry)],[rn]:[RegExp("FxiOS\\/"+ry)],[rm]:[RegExp("Konqueror[:/]?"+ry,"i")],[s1]:[RegExp(s1+" "+ry),rb],[rc]:[RegExp("android\\s"+ry,"i")],[s5]:[RegExp(s3+"\\/"+ry)],[s7]:[RegExp("(rv:|MSIE )"+ry)],Mozilla:[RegExp("rv:"+ry)]},rF=function(e,t){var i=r$[rI(e,t)];if(T(i))return null;for(var s=0;s<i.length;s++){var r=i[s],n=e.match(r);if(n)return parseFloat(n[n.length-2])}return null},rC=[[RegExp(rl+"; "+rl+" (.*?)[);]","i"),e=>[rl,e&&e[1]||""]],[RegExp(ro,"i"),[ro,""]],[RegExp(ra,"i"),[ra,""]],[rx,[s1,""]],[RegExp(rh,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[rd,""];if(new RegExp(sV).test(t)&&!/IEMobile\b/.test(t))return[rh+" "+sV,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=rk[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[rh,s]}return[rh,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(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]}],[RegExp("("+sY+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+sY+")","i"),e=>e&&e[2]?[sY,[e[2],e[3],e[4]||"0"].join(".")]:[sY,""]],[/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/,[s4,""]],[/Linux|debian/i,["Linux",""]]],rP=function(e){return rS.test(e)?ro:rE.test(e)?ra:rw.test(e)?rl:RegExp(rg,"i").test(e)?rg:RegExp("("+rd+"|WPDesktop)","i").test(e)?rd:/iPad/.test(e)?sZ:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?sQ:rx.test(e)?s1:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(rp,"i").test(e)?rp:/(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(sV).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)?sY:sK:sY:RegExp("(pda|"+sV+")","i").test(e)?rv:RegExp(sJ,"i").test(e)&&!RegExp(sJ+" pc","i").test(e)?rf:""},rR="https?://(.*)",rT=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rO=Z(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rT),rA="<masked>",rM=["li_fat_id"];function rL(e,t,i){if(!c)return{};var s,r=t?Z([],rT,i||[]):[],n=rD(tu(c.URL,r,rA),e);return K((s={},J(rM,function(e){var t=tk.D(e);s[e]=t||null}),s),n)}function rD(e,t){var i=rO.concat(t||[]),s={};return J(i,function(t){var i=tc(e,t);s[t]=i||null}),s}function rN(e){var t=e?0===e.search(rR+"google.([^/?]*)")?"google":0===e.search(rR+"bing.com")?"bing":0===e.search(rR+"yahoo.com")?"yahoo":0===e.search(rR+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!M(t)){i.$search_engine=t;var s=c?tc(c.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rq(){return navigator.language||navigator.userLanguage}function rj(){return(null==c?void 0:c.referrer)||"$direct"}function rB(e,t){var i=e?Z([],rT,t||[]):[],s=null==u?void 0:u.href.substring(0,1e3);return{r:rj().substring(0,1e3),u:s?tu(s,i,rA):void 0}}function rH(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=ta(i))?void 0:t.host};
1if(s){r.$current_url=s;var n=ta(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname,K(r,rD(s))}return i&&K(r,rN(i)),r}function rU(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rz=H("[FeatureFlags]"),rG="$active_feature_flags",rW="$override_feature_flags",rV="$feature_flag_payloads",rY="$override_feature_flag_payloads",rJ="$feature_flag_request_id",rK=e=>{var t={};for(var[i,s]of X(e||{}))s&&(t[i]=s);return t},rZ=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class rX{constructor(e){this.ge=!1,this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this._instance=e,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.we=!0;else{var e=!this.$e&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ke({disableFlags:e})}}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(eC),t=this._instance.get_property(rW),i=this._instance.get_property(rY);if(!i&&!t)return e||{};var s=K({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=s[r],l=null==t?void 0:t[r],c=T(l)?null!=(n=null==a?void 0:a.enabled)&&n:!!l,u=T(l)?a.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[r],d=G({},a,{enabled:c,variant:c?null!=u?u:null==a?void 0:a.variant:void 0});c!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),u!==(null==a?void 0:a.variant)&&(d.original_variant=null==a?void 0:a.variant),h&&(d.metadata=G({},null==a?void 0:a.metadata,{payload:h,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),s[r]=d}return this.ge||(rz.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ge=!0),s}getFlagVariants(){var e=this._instance.get_property(e$),t=this._instance.get_property(rW);
1if(!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.ge||(rz.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ge=!0),i}getFlagPayloads(){var e=this._instance.get_property(rV),t=this._instance.get_property(rY);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.ge||(rz.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ge=!0),i}reloadFeatureFlags(){this.be||this._instance.config.advanced_disable_feature_flags||this.$e||(this.$e=setTimeout(()=>{this.ke()},5))}xe(){clearTimeout(this.$e),this.$e=void 0}ensureFlagsLoaded(){this._e||this.me||this.$e||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.be=e}ke(e){var t;if(this.xe(),!this._instance.I())if(this.me)this.ye=!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(eP)||{}),group_properties:this._instance.get_property(eR)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var s=this._instance.config.__preview_remote_config,r=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",n=this._instance.requestRouter.endpointFor("api",(s?"/flags/?v=2":"/flags/?v=2&config=true")+r);s&&(i.timezone=rU()),this.me=!0,this._instance.Ee({method:"POST",url:n,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,n=!0;200===e.statusCode&&(this.ye||(this.$anon_distinct_id=void 0),n=!1),this.me=!1,this.we||(this.we=!0,this._instance.Ie(null!=(r=e.json)?r:{})),(!i.disable_flags||this.ye)&&((this.Se=!n,e.json&&null!=(s=e.json.quotaLimited)&&s.includes(rZ.FeatureFlags))?rz.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(i.disable_flags||this.receivedFeatureFlags(null!=(t=e.json)?t:{},n),this.ye&&(this.ye=!1,this.ke())))}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this._e||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,r=this._instance.get_property(rJ)||void 0,n=this._instance.get_property(eA)||{};if((t.send_event||!("send_event"in t))&&(!(e in n)||!n[e].includes(s))){F(n[e])?n[e].push(s):n[e]=[s],null==(l=this._instance.persistence)||l.register({[eA]:n});var o=this.getFeatureFlagDetails(e),a={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_bootstrapped_response:(null==(c=this._instance.config.bootstrap)||null==(c=c.featureFlags)?void 0:c[e])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[e])||null,$used_bootstrap_value:!this.Se};T(null==o||null==(h=o.metadata)?void 0:h.version)||(a.$feature_flag_version=o.metadata.version);var l,c,u,h,d,p,g,_,v,f,m=null!=(d=null==o||null==(p=o.reason)?void 0:p.description)?d:null==o||null==(g=o.reason)?void 0:g.code;m&&(a.$feature_flag_reason=m),null!=o&&null!=(_=o.metadata)&&_.id&&(a.$feature_flag_id=o.metadata.id),T(null==o?void 0:o.original_variant)&&T(null==o?void 0:o.original_enabled)||(a.$feature_flag_original_response=T(o.original_variant)?o.original_enabled:o.original_variant),null!=o&&null!=(v=o.metadata)&&v.original_payload&&(a.$feature_flag_original_payload=null==o||null==(f=o.metadata)?void 0:f.original_payload),this._instance.capture("$feature_flag_called",a)}return i}rz.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.Ee({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._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);rz.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._e=!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,o=((n=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(n).map(e=>{var t;return[e,null!=(t=n[e].variant)?t:n[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(n).filter(e=>n[e].enabled).filter(e=>{var t;return null==(t=n[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))):rz.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),a=o.flags,l=o.featureFlags,c=o.featureFlagPayloads;if(l){var u=e.requestId;if(F(l)){rz.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var d=0;d<l.length;d++)h[l[d]]=!0;t&&t.register({[rG]:l,[e$]:h})}else{var p=l,g=c,_=a;e.errorsWhileComputingFlags&&(p=G({},i,p),g=G({},s,g),_=G({},r,_)),t&&t.register(G({[rG]:Object.keys(rK(p)),[e$]:p||{},[rV]:g||{},[eC]:_||{}},u?{[rJ]:u}:{}))}}}(e,this._instance.persistence,i,s,r),this.Pe(t)}}override(e,t){void 0===t&&(t=!1),rz.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return rz.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(rW),this._instance.persistence.unregister(rY),void this.Pe();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.ge=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(rW);else if(e.flags)if(F(e.flags)){for(var i={},s=0;s<e.flags.length;s++)i[e.flags[s]]=!0;this._instance.persistence.register({[rW]:i})}else this._instance.persistence.register({[rW]:e.flags})}return"payloads"in e&&(!1===e.payloads?this._instance.persistence.unregister(rY):e.payloads&&this._instance.persistence.register({[rY]:e.payloads})),void this.Pe()}this.Pe()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._e){var{flags:t,flagVariants:i}=this.Re();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,s=(this._instance.get_property(eF)||[]).find(t=>t.flagKey===e),r={["$feature_enrollment/"+e]:t},n={$feature_flag:e,$feature_enrollment:t,$set:r};s&&(n.$early_access_feature_name=s.name),this._instance.capture("$feature_enrollment_update",n),this.setPersonPropertiesForFlags(r,!1);var o=G({},this.getFlagVariants(),{[e]:t});null==(i=this._instance.persistence)||i.register({[rG]:Object.keys(rK(o)),[e$]:o}),this.Pe()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(eF),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+r),method:"GET",callback:t=>{var i;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.register({[eF]:s}),e(s)}}})}Re(){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),{})}}Pe(e){var{flags:t,flagVariants:i}=this.Re();this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(eP)||{};this._instance.register({[eP]:G({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(eP)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(eR)||{};
vendor: 4,199 bytes, line 1
10!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=G({},i[t],e[t]),delete e[t]}),this._instance.register({[eR]:G({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(eR)||{};this._instance.register({[eR]:G({},t,{[e]:{}})})}else this._instance.unregister(eR)}reset(){this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this.$anon_distinct_id=void 0,this.xe(),this.ge=!1}}var rQ=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class r0{constructor(e,t){this.S=e,this.props={},this.Te=!1,this.Me=(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.Ce(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.Fe}Ce(e){-1===rQ.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&&t$.O()?t$:"localstorage+cookie"===t&&tC.O()?tC:"sessionstorage"===t&&tO.O()?tO:"memory"===t?tR:"cookie"===t?tk:tC.O()?tC:tk}properties(){var e={};return J(this.props,function(t,i){if(i===e$&&P(t))for(var s,r=Object.keys(t),n=0;n<r.length;n++)e["$feature/"+r[n]]=t[r[n]];else s=!1,(M(ez)?s:a&&ez.indexOf===a?-1!=ez.indexOf(i):(J(ez,function(e){if(s||(s=e===i))return V}),s))||(e[i]=t)}),e}load(){if(!this.Fe){var e=this.B.L(this.Me);e&&(this.props=K({},e))}}save(){this.Fe||this.B.j(this.Me,this.props,this.Oe,this.Ae,this.De,this.S.debug)}remove(){this.B.N(this.Me,!1),this.B.N(this.Me,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(P(e)){T(t)&&(t="None"),this.Oe=T(i)?this.Le: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.Oe=T(t)?this.Le: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.Te){var e=rL(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);R(et(e))||this.register(e),this.Te=!0}}update_search_keyword(){var e;this.register((e=null==c?void 0:c.referrer)?rN(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rj(),$referring_domain:null!=c&&c.referrer&&(null==(e=ta(c.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[eN]||this.props[eq]||this.register_once({[ej]:rB(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};J([eq,eN],t=>{var i=this.props[t];i&&J(i,function(t,i){e["$initial_"+S(i)]=t})});var t,i,s=this.props[ej];return s&&K(e,(t=rH(s),i={},J(t,function(e,t){i["$initial_"+S(t)]=e}),i)),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.Le=this.Oe=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.Ce(e),r=this.props;this.clear(),this.B=s,this.props=r,this.save()}}set_disabled(e){this.Fe=e,this.Fe?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ae&&(this.Ae=e,this.remove(),this.save())}set_secure(e){e!==this.De&&(this.De=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[ea]||{};i[e]=t,this.props[ea]=i,this.save()}remove_event_timer(e){var t=(this.props[ea]||{})[e];return T(t)||(delete this.props[ea][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class r1{constructor(){this.je={},this.je={}}on(e,t){return this.je[e]||(this.je[e]=[]),this.je[e].push(t),()=>{this.je[e]=this.je[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.je[e]||[])i(t);for(var s of this.je["*"]||[])s(e,t)}}class r2{constructor(e){this.Ne=new r1,this.ze=(e,t)=>
1this.Ue(e,t)&&this.qe(e,t)&&this.Be(e,t),this.Ue=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.He=new Set,this.We=new Set}init(){var e,t;T(null==(e=this._instance)?void 0:e.Ge)||null==(t=this._instance)||t.Ge((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!T(null==(t=this._instance)?void 0:t.Ge)&&(e.forEach(e=>{var t,i;null==(t=this.We)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.He)||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.He.has(e)||this.He.has(null==t?void 0:t.event))&&this.We&&(null==(i=this.We)?void 0:i.size)>0&&this.We.forEach(e=>{this.Je(t,e)&&this.Ne.emit("actionCaptured",e.name)})}Ve(e){this.onAction("actionCaptured",t=>e(t))}Je(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.ze(e,i))return!0;return!1}onAction(e,t){return this.Ne.on(e,t)}qe(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||!r2.Ke(s,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static Ke(e,t,i){switch(i){case"regex":return!!s&&sB(e,t);case"exact":return t===e;case"contains":return sB(e,r2.Ye(t).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static Ye(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Be(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.Xe(e).some(e=>!(null!=t&&t.href&&!r2.Ke(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&&!r2.Ke(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!r2.Ke(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||!s.includes(null==t?void 0:t.selector))return!1}return!0}Xe(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}var r3=H("[Surveys]"),r5="seenSurvey_";class r6{constructor(e){this._instance=e,this.Qe=new Map,this.Ze=new Map}register(e){var t;T(null==(t=this._instance)?void 0:t.Ge)||(this.tr(e),this.ir(e))}ir(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.er&&(this.er=new r2(this._instance),this.er.init(),this.er.Ve(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.er)||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.Ze.get(t.name);i&&i.push(e.id),this.Ze.set(t.name,i||[e.id])}}))}))}tr(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.Ge((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.Qe.get(t.name);i&&i.push(e.id),this.Qe.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,s=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[eO])||[];if("survey shown"===e&&t&&s.length>0){r3.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:s});var r,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.rr(s))}}else this.Qe.has(e)&&(r3.info("survey event matched, updating activated surveys",{event:e,surveys:this.Qe.get(e)}),this.rr(s.concat(this.Qe.get(e)||[])))}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[eO])||[];this.Ze.has(e)&&this.rr(i.concat(this.Ze.get(e)||[]))}rr(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[eO]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[eO])||[]}getEventToSurveys(){return this.Qe}sr(){return this.er}}class r4{constructor(e){this.nr=void 0,this.ar=null,this.lr=!1,this.ur=!1,this.hr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(L(t))return r3.warn("Flags not loaded yet. Not loading surveys.");var i=F(t);this.nr=i?t.length>0:t,r3.info("flags response received, isSurveysEnabled: "+this.nr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(r5)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}
1e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this.ar)if(this.ur)r3.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)r3.info("Disabled. Not loading surveys.");else{var e=null==_?void 0:_.__PosthogExtensions__;if(e){var t=this.nr;if(!T(t)){this.ur=!0;try{var i=e.generateSurveys;if(i)return void this.dr(i,t);var s=e.loadExternalDependency;if(!s)return void this.vr("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.vr("Could not load surveys script",i):this.dr(e.generateSurveys,t)})}catch(e){throw this.vr("Error initializing surveys",e),e}finally{this.ur=!1}}}else r3.error("PostHog Extensions not found.")}}dr(e,t){this.ar=e(this._instance,t),this._surveyEventReceiver=new r6(this._instance),r3.info("Surveys loaded successfully"),this.cr({isLoaded:!0})}vr(e,t){r3.error(e,t),this.cr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.hr.push(e),this.ar&&this.cr({isLoaded:!0}),()=>{this.hr=this.hr.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return r3.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(eT);if(i&&!t)return e(i,{isLoaded:!0});if(this.lr)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.lr=!0,this._instance.Ee({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=>{this.lr=!1;var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return r3.error(s),e([],{isLoaded:!1,error:s})}var r,n,o=t.json.surveys||[],a=o.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),null==(r=this._instance.persistence)||r.register({[eT]:o}),e(o,{isLoaded:!0})}})}catch(e){throw this.lr=!1,e}}cr(e){for(var t of this.hr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(e){r3.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!L(this.ar))return this.ar.getActiveMatchingSurveys(e,t);r3.warn("init was not called")}pr(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}gr(e){if(L(this.ar))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.pr(e):e;return t?this.ar.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(L(this.ar))return r3.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 L(this.ar)?(r3.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))?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(L(this.ar))r3.warn("init was not called");else{var i=this.pr(e),s=null==c?void 0:c.querySelector(t);i?s?this.ar.renderSurvey(i,s):r3.warn("Survey element not found"):r3.warn("Survey not found")}}}(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"}({}),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}({}),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"}({});var r8=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),r7=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_
1START_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}({}),r9=H("[RateLimiter]");class ne{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=>{r9.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void r9.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){void 0===e&&(e=!1);var t,i,s,r=(new Date).getTime(),n=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(eD))?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(eD,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var nt=H("[RemoteConfig]");class ni{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}_r(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(nt.error("PostHog Extensions not found. Cannot load remote config."),e())}mr(e){this._instance.Ee({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 nt.info("Using preloaded remote config",this.remoteConfig),void this.Ie(this.remoteConfig);if(this._instance.I())return void nt.warn("Remote config is disabled. Falling back to local config.");this._r(e=>{if(!e)return nt.info("No config found after loading remote JS config. Falling back to JSON."),void this.mr(e=>{this.Ie(e)});this.Ie(e)})}catch(e){nt.error("Error loading remote config",e)}}Ie(e){e?this._instance.config.__preview_remote_config?(this._instance.Ie(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):nt.info("__preview_remote_config is disabled. Logging config instead",e):nt.error("Failed to fetch remote config from PostHog.")}}class ns{constructor(e,t){this.br=!0,this.yr=[],this.wr=tj((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,"flush interval",3e3),this.Sr=e}enqueue(e){this.yr.push(e),this.$r||this.kr()}unload(){this.Er();var e=Object.values(this.yr.length>0?this.Ir():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Sr(G({},e,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.kr()}kr(){var e=this;this.br||(this.$r=setTimeout(()=>{if(this.Er(),this.yr.length>0){var t=this.Ir();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&F(s.data)&&J(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Sr(s)}()}},this.wr))}Er(){clearTimeout(this.$r),this.$r=void 0}Ir(){var e={};return J(this.yr,t=>{var i,s=(t?t.batchKey:null)||t.url;T(e[s])&&(e[s]=G({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.yr=[],e}}var nr=["retriesPerformedSoFar"];class nn{constructor(e){this.Pr=!1,this.Rr=3e3,this.yr=[],this._instance=e,this.yr=[],this.Tr=!0,!T(s)&&"onLine"in s.navigator&&(this.Tr=s.navigator.onLine,er(s,"online",()=>{this.Tr=!0,this.se()}),er(s,"offline",()=>{this.Tr=!1}))}get length(){return this.yr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=W(e,nr);D(t)&&t>0&&(i.url=sD(i.url,{retry_count:t})),this._instance.Ee(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,i,s,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=(s=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,r)))-t/2),Math.ceil(i+s)),o=Date.now()+n;this.yr.push({retryAt:o,requestOptions:e});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),B.warn(a),this.Pr||(this.Pr=!0,this.Cr())}Cr(){this.Fr&&clearTimeout(this.Fr),this.Fr=setTimeout(()=>{this.Tr&&this.yr.length>0&&this.se(),this.Cr()},this.Rr)}se(){var e=Date.now(),t=[],i=this.yr.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.yr=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Fr&&(clearTimeout(this.Fr),this.Fr=void 0),this.yr))try{this._instance.Ee(G({},e,{transport:"sendBeacon"}))}catch(e){B.error(e)}this.yr=[]}}class no{constructor(e){this.Or=()=>{this.Ar||(this.Ar={});var e,t,i,s,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.Ar.lastScrollY=Math.ceil(n),this.Ar.maxScrollY=Math.max(n,null!=(e=this.Ar.maxScrollY)?e:0),this.Ar.maxScrollHeight=Math.max(o,null!=(t=this.Ar.maxScrollHeight)?t:0),this.Ar.last
1ContentY=a,this.Ar.maxContentY=Math.max(a,null!=(i=this.Ar.maxContentY)?i:0),this.Ar.maxContentHeight=Math.max(l,null!=(s=this.Ar.maxContentHeight)?s:0)},this._instance=e}getContext(){return this.Ar}resetContext(){var e=this.Ar;return setTimeout(this.Or,0),e}startMeasuringScrollPosition(){er(s,"scroll",this.Or,{capture:!0}),er(s,"scrollend",this.Or,{capture:!0}),er(s,"resize",this.Or)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==s?void 0:s.document.documentElement;for(var e of F(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var t=null==s?void 0:s.document.querySelector(e);if(t)return t}}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 na=e=>rB(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class nl{constructor(e,t,i,s){this.Dr=e=>{var t=this.Lr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.jr(this._instance)};this.Nr.register({[eL]:i})}},this._instance=e,this.zr=t,this.Nr=i,this.jr=s||na,this.zr.onSessionId(this.Dr)}Lr(){return this.Nr.props[eL]}getSetOnceProps(){var e,t=null==(e=this.Lr())?void 0:e.props;return t?"r"in t?rH(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(et(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+S(i)]=t}),e}}var nc=H("[SessionId]");class nu{constructor(e,t,i){if(this.Ur=[],!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.Nr=e.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qr=t||tw,this.Br=i||tw;var s,r=this.S.persistence_name||this.S.token,n=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*tj(n,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hr(),this.Wr="ph_"+r+"_window_id",this.Gr="ph_"+r+"_primary_window_exists",this.Jr()){var o=tO.L(this.Wr),a=tO.L(this.Gr);o&&!a?this.fi=o:tO.N(this.Wr),tO.j(this.Gr,!0)}if(null!=(s=this.S.bootstrap)&&s.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Vr(this.S.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){nc.error("Invalid sessionID in bootstrap",e)}this.Kr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return T(this.Ur)&&(this.Ur=[]),this.Ur.push(e),this.Ct&&e(this.Ct,this.fi),()=>{this.Ur=this.Ur.filter(t=>t!==e)}}Jr(){return"memory"!==this.S.persistence&&!this.Nr.Fe&&tO.O()}Yr(e){e!==this.fi&&(this.fi=e,this.Jr()&&tO.j(this.Wr,e))}Xr(){return this.fi?this.fi:this.Jr()?tO.L(this.Wr):null}Vr(e,t,i){e===this.Ct&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Ct=e,this.Nr.register({[eS]:[t,e,i]}))}Qr(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var e=this.Nr.props[eS];return F(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Vr(null,null,null)}Kr(){er(s,"beforeunload",()=>{this.Jr()&&tO.N(this.Gr)},{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.S.__preview_experimental_cookieless_mode)throw Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var i=t||(new Date).getTime(),[s,r,n]=this.Qr(),o=this.Xr(),a=D(n)&&n>0&&Math.abs(i-n)>864e5,l=!1,c=!r,u=!e&&Math.abs(i-s)>this.sessionTimeoutMs;c||u||a?(r=this.qr(),o=this.Br(),nc.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.Br(),l=!0);var h=0===s||!e||a?i:s,d=0===n?(new Date).getTime():n;return this.Yr(o),this.Vr(r,h,d),e||this.Hr(),l&&this.Ur.forEach(e
vendor: 6,235 bytes, line 1
1=>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}}Hr(){clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var nh=["$set_once","$set"],nd=H("[SiteApps]");class np{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var i=this.globalsForEvent(t);this.ts.push(i),this.ts.length>1e3&&(this.ts=this.ts.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.Ge(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,o,a,l={},c=this._instance.get_property("$groups")||[];for(var[u,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:h};var{$set_once:d,$set:p}=e;return{event:G({},W(e,nh),{properties:G({},e.properties,p?{$set:G({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:G({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?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.ts.length&&(nd.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach(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.rs)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,nd.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){nd.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){nd.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ss(){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)}ns(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){nd.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.ss(),void this._instance.on("eventCaptured",e=>this.ns(e))):void nd.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.rs)||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 nd.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else nd.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var ng=["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","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"],n_=function(e,t){if(!e)return!1;var i=e.toLowerCase();return ng.concat(t||[]).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},nv=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&n_(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>n_(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},nf=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),nm="i.posthog.com";class ny{constructor(e){this.os={},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("."+nm,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.os[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=nf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=nf.EU:this.os[this.apiHost]=nf.CUSTOM),this.os[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===nf.CUSTOM)return this.apiHost+t;var i=nm+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var nb={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&&sB(t.href,e),not_regex:(e,t)=>!!s&&!sB(t.href,e),exact:(e,t)=>
1t.href===e,is_not:(e,t)=>t.href!==e};class nw{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{nw.ls("retrieved web experiments from the server"),t.us=new Map,e.forEach(e=>{if(e.feature_flag_key){t.us&&(nw.ls("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.us)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);O(s)&&e.variants[s]&&t.hs(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];nw.ds(n)&&t.hs(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())nw.ls("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(L(this.us))return this.us=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nw.ls("applying feature flags",e),e.forEach(e=>{var t;if(this.us&&null!=(t=this.us)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.us)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.hs(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=nw.getWindowLocation();if(null!=e&&e.search){var t=tc(null==e?void 0:e.search,"__experiment_id"),i=tc(null==e?void 0:e.search,"__experiment_variant");t&&i&&(nw.ls("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.vs(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.Ee({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}vs(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(nw.ls("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.hs(s[0].name,t,s[0].variants[t].transforms))}static ds(e){return!L(e.conditions)&&nw.cs(e)&&nw.fs(e)}static cs(e){if(L(e.conditions)||L(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,r,n=nw.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||nb[null!=(s=null==(r=e.conditions)?void 0:r.urlMatchType)?s:"icontains"](e.conditions.url,n))}
1static getWindowLocation(){return null==s?void 0:s.location}static fs(e){if(L(e.conditions)||L(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rL();if(t.utm_source){var i,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)==t.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)==t.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)==t.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)==t.utm_term;return h&&p&&g&&d}return!1}static ls(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];B.info("[WebExperiments] "+e,i)}hs(e,t,i){this._is_bot()?nw.ls("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){nw.ls("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):nw.ls("Control variants leave the page unmodified.")}_is_bot(){return l&&this._instance?nv(l,this._instance.config.custom_blocked_useragents):void 0}}var nE=H("[PostHog ExternalIntegrations]"),nS={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nx{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 nE.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=_.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.J(nS[e],()=>{var i;null==(i=_.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=_.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=_.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}}var nk={},nI=()=>{},n$="posthog",nF=!sM&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),nC=e=>{var t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!O(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of ei)if(i===s)return!1;return!0}(null==c?void 0:c.location),persistence:"localStorage+cookie",persistence_name:"",loaded:nI,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",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_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:3e3},error_tracking:{},_onCapture:nI}},nP=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 nR{constructor(){this.__forceAllowLocalhost=!1}get ps(){return this.__forceAllowLocalhost}set ps(e){B.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nT{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new nR,this.gs=!1,this.version=v.LIB_VERSION,this._s=new r1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nC(),this.SentryIntegration=sb,this.sentryIntegration=e=>(function(e,t){var i=sy(e,t);return{name:sm,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bs=!1,this.ys=null,this.ws=null,this.Ss=null,this.featureFlags=new rX(this),this.toolbar=new sk(this),this.scrollManager=new no(this),this.pageViewManager=new sO(this),this.surveys=new r4(this),this.experiments=new nw(this),this.exceptions=new sW(this),this.rateLimiter=new ne(this),this.requestRouter=new ny(this),this.consent=new tM(this),this.externalIntegrations=new nx(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!==n$){var s,r=null!=(s=nk[i])?s:new nT;return r._init(e,t,i),nk[i]=r,nk[n$][i]=r,r}return this._init(e,t,i)}_init(e,t,i){if(void 0===t&&(t={}),T(e)||A(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.$s=t,this.ks=[],t.person_profiles&&(this.ws=t.person_profiles),this.set_config(K({},nC(t.defaults),nP(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 r=this.xs();this.persistence=new r0(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r0(G({},this.config,{persistence:"sessionStorage"}),r);var n=G({},this.persistence.props),o=G({},this.sessionPersistence.props);if(this.register({$initialization_time:(new Date).toISOString()}),this.Es=new ns(e=>this.Is(e),this.config.request_queue_config),this.Ps=new nn(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new nu(this),this.sessionPropsManager=new nl(this,this.sessionManager,this.persistence)),new s$(this).startIfEnabledOrStop(),this.siteApps=new np(this),null==(a=this.siteApps)||a.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new sv(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new tg(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new sT(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new sC(this),this.exceptionObserver=new tU(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new tq(this,tN),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new is(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:n,s:o}
vendor: 4,572 bytes, line 1
1),void 0!==(null==(l=t.bootstrap)?void 0:l.distinctID)){var a,l,c,u,h=this.config.get_device_id(tw()),d=null!=(c=t.bootstrap)&&c.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(eM,null!=(u=t.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.Rs()){var p,g,_=Object.keys((null==(p=t.bootstrap)?void 0:p.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},{}),f=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlagPayloads)||{}).filter(e=>_[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:_,featureFlagPayloads:f})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:eU,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(tw());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(eM,"anonymous")}return er(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()||tw();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(eM,"identified")),t()},r=i.user();"then"in r&&C(r.then)?r.then(e=>s(e)):s(r)}(e,()=>{var s;i.register((Promise&&Promise.resolve||sf.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(sf.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(sf.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},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,"$pageview"),identify:e=>s(e,"$identify"),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Ts()):this.Ts(),C(this.config._onCapture)&&this.config._onCapture!==nI&&(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}Ie(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.Ie(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.ws?this.ws:"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)}Ts(){try{this.config.loaded(this)}catch(e){B.critical("`loaded` function failed",e)}this.Ms(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Cs()},1),new ni(this).load(),this.featureFlags.flags()}Ms(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this.Es)||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||Y(this.__request_queue,e=>this.Is(e)),this.__request_queue=[],this.Ms()}_handle_unload(){var e,t;this.config.request_batching?(this.Fs()&&this.capture("$pageleave"),null==(e=this.Es)||e.unload(),null==(t=this.Ps)||t.unload()):this.Fs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}
1Ee(e){this.__loaded&&(nF?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=sD(e.url,{ip:+!!this.config.ip}),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,(e=>{var t,i,s,r=G({},e);r.timeout=r.timeout||6e4,r.url=sD(r.url,{_:(new Date).getTime().toString(),ver:v.LIB_VERSION,compression:r.compression});var n=null!=(t=r.transport)?t:"fetch",o=null!=(i=null==(s=es(sj,e=>e.transport===n))?void 0:s.method)?i:sj[0].method;if(!o)throw 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)}}))))}Is(e){this.Ps?this.Ps.retriableRequest(e):this.Ee(e)}_execute_array(e){var t,i=[],s=[],r=[];Y(e,e=>{e&&(F(t=e[0])?r.push(e):C(e)?e.call(this):F(e)&&"alias"===t?i.push(e):F(e)&&-1!==t.indexOf("capture")&&C(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)}Rs(){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.Es){if(!this.consent.isOptedOut())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=tw(),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,h=this.Os(null==i?void 0:i.$set_once);if(h&&(l.$set_once=h),(d=l,p=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,g=e=>O(e)&&!M(p)?e.slice(0,p):e,_=new Set,l=function e(t,i){var s;return t!==Object(t)?g?g(t,i):t:_.has(t)?void 0:(_.add(t),F(t)?(s=[],Y(t,t=>{s.push(e(t))})):(s={},J(t,(t,i)=>{_.has(t)||(s[i]=e(t,i))})),s)}(d)).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===r8.DISMISSED||e===r8.SENT){var d,p,g,_,v,f,m,y=null==t?void 0:t[r7.SURVEY_ID],b=null==t?void 0:t[r7.SURVEY_ITERATION];localStorage.setItem((u=""+r5+(c={id:y,current_iteration:b}).id,c.current_iteration&&c.current_iteration>0&&(u=""+r5+c.id+"_"+c.current_iteration),u),"true"),l.$set=G({},l.$set,{[(v={id:y,current_iteration:b},m="$survey_"+(f=e===r8.SENT?"responded":"dismissed")+"/"+v.id,v.current_iteration&&v.current_iteration>0&&(m="$survey_"+f+"/"+v.id+"/"+v.current_iteration),m)]:!0})}var w=G({},l.properties.$set,l.$set);if(R(w)||this.setPersonPropertiesForFlags(w),!L(this.config.before_send)){var E=this.As(l);if(!E)return;l=E}this._s.emit("eventCaptured",l);var S={method:"POST",url:null!=(s=null==i?void 0:i._url)?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.Is(S):this.Es.enqueue(S),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")}Ge(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o,a=n?void 0:this.persistence.remove_event_timer(e),l=G({},t);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(l.$cookieless_mode=!0),"$snapshot"===e){var h=G({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=h.distinct_id,(!O(l.distinct_id)&&!D(l.distinct_id)||A(l.distinct_id))&&B.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,p=function(e,t){if(!g)return{};var i,r,n=e?Z([],rT,t||[]):[],[o,a]=function(e){for(var t=0;t<rC.length;t++){var[i,s]=rC[t],r=i.exec(e),n=r&&(C(s)?s(r,e):s);if(n)return n}return["",""]}(g);return K(et({$os:o,$os_version:a,$browser:rI(g,navigator.vendor),$device:rP(g),$device_type:(r=rP(g))===sZ||r===sK||"Kobo"===r||"Kindle Fire"===r||r===rf?sJ:r===ro||r===rl||r===ra||r===rg?"Console":r===sQ?"Wearable":r?sV:"Desktop",$timezone:rU(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:tu(null==u?void 0:u.href,n,rA),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:g.length>
11e3?g.substring(0,997)+"...":g,$browser_version:rF(g,navigator.vendor),$browser_language:rq(),$browser_language_prefix:"string"==typeof(i=rq())?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})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:_,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());l.$session_id=_,l.$window_id=f}this.sessionPropsManager&&K(l,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&K(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(o=this.Ps)?void 0:o.length}catch(e){l.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nf.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),d="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),l=K(l,d),"$pageview"===e&&c&&(l.title=c.title),!T(a)){var m=i.getTime()-a;l.$duration=parseFloat((m/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=K({},p,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),F(this.config.property_denylist)?J(this.config.property_denylist,function(e){delete l[e]}):B.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(B.error("sanitize_properties is deprecated. Use before_send instead"),l=y(l,e));var b=this.Ds();return l.$process_person_profile=b,b&&!n&&this.Ls("_calculate_event_properties"),l}Os(e){if(!this.persistence||!this.Ds()||this.gs)return e;var t,i=K({},this.persistence.get_initial_props(),(null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(B.error("sanitize_properties is deprecated. Use before_send instead"),i=s(i,"$set_once")),this.gs=!0,R(i)?void 0:i}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)}js(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){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._s.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))?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(D(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 n
1ot a hardcoded string.');else if(e!==eU){if(this.Ls("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(eo)&&(this.unregister(eo),this.register({distinct_id:e}));var r="anonymous"===(this.persistence.get_property(eM)||"anonymous");e!==s&&r?(this.persistence.set_property(eM,"identified"),this.setPersonPropertiesForFlags(G({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Ss=sH(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(eA))}}else B.critical('The string "'+eU+'" 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.Ls("posthog.setPersonProperties")){var i=sH(this.get_distinct_id(),e,t);this.Ss!==i?(this.setPersonPropertiesForFlags(G({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ss=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.Ls("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.Ls("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(B.info("reset"),!this.__loaded)return B.uninitializedWarning("posthog.reset");var t,i,s,r,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(eM,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.Ss=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:eU,$device_id:null},"");else{var o=this.config.get_device_id(tw());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)?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)?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(en)?(B.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ls("posthog.alias")?(T(t)&&(t=this.get_distinct_id()),e!==t?(this.js(eo,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)){K(this.config,nP(e));var i,s,r,n,o,a=this.xs();null==(i=this.persistence)||i.update_config(this.config,t,a),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r0(G({},this.config,{persistence:"sessionStorage"}),a),t$.O()&&"true"===t$.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.Ns(),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=Error("PostHog syntheticException");return this.exceptions.sendExceptionEvent(G({},function(e,t){var{error:i,event:s}=e,r={$exception_list:[]},n=i||s;if(tY(n)||tV(n,"DOMException")){if("stack"in n)r=ie(n,t);else{var o=n.name||(tY(n)?"DOMError":"DOMException"),a=n.message?o+": "+n.message:o;r=it(a,G({},t,{overrideExceptionType:tY(n)?"DOMError":"DOMException",defaultExceptionMessage:a}))}return"code"in n&&(r.$exception_DOMException_code=""+n.code),r}if(tV(n,"ErrorEvent")&&n.error)return ie(n.error,t);if(tW(n))return ie(n,t);if(tV(n,"Object")||tz(n))return function(e,t){var i,s,r,n=null==(s=null==t?void 0:t.handled)||s,o=null==(r=null==t?void 0:t.synthetic)||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:tz(e)?e.constructor.name:"Error",value:"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),mechanism:{handled:n,synthetic:o}};if(null!=t&&t.syntheticException){var l=t7(null==t?void 0:t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:O(i=e.level)&&!A(i)&&b.indexOf(i)>=0?e.level:"error"}}(n,t);if(T(i)&&O(s)){var l="Error",c=s,u=s.match(t8);return u&&(l=u[1],c=u[2]),it(c,G({},t,{overrideExceptionType:l,defaultExceptionMessage:c}))}return it(n,t)}(e instanceof Error?{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)?e:n$;return t!==n$&&(t=n$+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(eM))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(eM))}Ds(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&R(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[eo])&&(null==(t=this.persistence)||null==(t=t.props)||!t[eB]))}Fs(){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.Ds()||this.Ls("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ls(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.js(eB,!0),!0)}xs(){var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default;return this.config.disable_persistence||e&&!!t}Ns(){var e,t,i,s,r=this.xs();return(null==(e=this.persistence)?void 0:e.Fe)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Fe)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.Ns(),(T(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(t=null==e?void 0:e.captureEventName)?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Cs()}opt_out_capturing(){this.consent.optInOut(!1),this.Ns()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Ns()}_is_bot(){return l?nv(l,this.config.custom_blocked_useragents):void 0}Cs(){c&&("visible"===c.visibilityState?this.bs||(this.bs=!0,this.capture("$pageview",{title:c.title},{send_instantly:!0}),this.ys&&(c.removeEventListener("visibilitychange",this.ys),this.ys=null)):this.ys||(this.ys=this.Cs.bind(this),er(c,"visibilitychange",this.ys)))}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=this.$s||{};return"advanced_disable_flags"in r?!!r.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):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!T(r[e]),s=t in r&&!T(r[t]),i?r[e]:!!s&&(B&&B.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}As(e){if(L(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(L(i=s(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&&!R(i.properties)||B.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;
vendor: 757 bytes, lines 1-2
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]])}(nT,["identify"]);var nO,nA=(nO=nk[n$]=new nT,function(){function e(){e.done||(e.done=!0,nF=!1,J(nk,function(e){e._dom_loaded()}))}null!=c&&c.addEventListener?"complete"===c.readyState?e():er(c,"DOMContentLoaded",e,{capture:!1}):s&&B.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),nO)}}]);
2//# chunkId=01a0edeb-30ec-7840-80fa-101cd38da01f

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.