PageSourceSearch

https://www.pixio.tech/_next/static/chunks/9da6db1e-6a8e48e7dd839d5e.js

js pixio.tech collected 2026-09-25 22:37:49 UTC 162,560 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8229],{8576:(e,t,i)=>{i.d(t,{Ay:()=>nC});var s,r="undefined"!=typeof window?window:void 0,n="undefined"!=typeof globalThis?globalThis:r,o=Array.prototype,a=o.forEach,l=o.indexOf,c=null==n?void 0:n.navigator,u=null==n?void 0:n.document,h=null==n?void 0:n.location,d=null==n?void 0:n.fetch,p=null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest?n.XMLHttpRequest:void 0,g=null==n?void 0:n.AbortController,_=null==c?void 0:c.userAgent,v=null!=r?r:{},f={DEBUG:!1,LIB_VERSION:"1.239.1"},m="$copy_autocapture",y=["$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"];!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(s||(s={}));var b=["fatal","error","warning","log","info","debug"];function w(e,t){return -1!==e.indexOf(t)}var k=function(e){return e.trim()},E=function(e){return e.replace(/^\$/,"")},x=Array.isArray,S=Object.prototype,$=S.hasOwnProperty,F=S.toString,I=x||function(e){return"[object Array]"===F.call(e)},P=e=>"function"==typeof e,R=e=>e===Object(e)&&!I(e),M=e=>{if(R(e)){for(var t in e)if($.call(e,t))return!1;return!0}return!1},C=e=>void 0===e,O=e=>"[object String]"==F.call(e),T=e=>O(e)&&0===e.trim().length,A=e=>null===e,L=e=>C(e)||A(e),D=e=>"[object Number]"==F.call(e),N=e=>"[object Boolean]"===F.call(e),q=e=>e instanceof FormData,j=e=>w(y,e),H=e=>{var t={t:function(t){if(r&&(f.DEBUG||v.POSTHOG_DEBUG)&&!C(r.console)&&r.console){for(var i=("__rrweb_original__"in r.console[t])?r.console[t].__rrweb_original__:r.console[t],s=arguments.length,n=Array(s>1?s-1:0),o=1;o<s;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=>H(e+" "+t)};return t},B=H("[PostHog.js]"),z=B.createLogger,U=z("[ExternalScriptsLoader]"),G=(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==u?void 0:u.querySelectorAll("script");if(s){for(var r=0;r<s.length;r++)if(s[r].src===t)return i()}var n=()=>{if(!u)return i("document not found");var s=u.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=u.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):u.body.appendChild(s)};null!=u&&u.body?n():null==u||u.addEventListener("DOMContentLoaded",n)};function W(){return(W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e}).apply(this,arguments)}function V(e,t){if(null==e)return{};var i,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)i=n[s],t.indexOf(i)>=0||(r[i]=e[i]);return r}v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__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);G(e,r,i)},v.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);G(e,s,i)};var Y={};function K(e,t,i){if(I(e)){if(a&&e.forEach===a)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)===Y)return}}}function J(e,t,i){if(!L(e)){if(I(e))return K(e,t,i);if(q(e)){for(var s of e.entries())if(t.call(i,s[1],s[0])===Y)return}else for(var r in e)if($.call(e,r)&&t.call(i,e[r],r)===Y)return}}var X=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 K(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 K(i,function(t){K(t,function(t){e.push(t)})}),e};function Q(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var ee=function(e){try{return e()}catch(e){return}},et=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)}}},ei=function(e){var t={};return J(e,function(e,i){(O(e)&&e.length>0||D(e))&&(t[i]=e)}),t},es=["herokuapp.com","vercel.app","netlify.app"];function er(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function en(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}
1var eo="$people_distinct_id",ea="__alias",el="__timers",ec="$autocapture_disabled_server_side",eu="$heatmaps_enabled_server_side",eh="$exception_capture_enabled_server_side",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",ek="$replay_script_config",eE="$sesid",ex="$session_is_sampled",eS="$session_recording_url_trigger_activated_session",e$="$session_recording_event_trigger_activated_session",eF="$enabled_feature_flags",eI="$early_access_features",eP="$feature_flag_details",eR="$stored_person_properties",eM="$stored_group_properties",eC="$surveys",eO="$surveys_activated",eT="$flag_call_reported",eA="$user_state",eL="$client_session_props",eD="$capture_rate_limit",eN="$initial_campaign_params",eq="$initial_referrer_info",ej="$initial_person_info",eH="$epp",eB="__POSTHOG_TOOLBAR__",ez="$posthog_cookieless",eU=[eo,ea,"__cmpns",el,e_,eu,eE,eF,eA,eI,eP,eM,eR,eC,eT,eL,eD,eN,eq,eH];function eG(e){return e instanceof Element&&(e.id===eB||!(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()}function eY(e){return!!e&&3===e.nodeType}function eK(e){return!!e&&11===e.nodeType}function eJ(e){return e?k(e).split(/\s+/):[]}function eX(e){var t=null==r?void 0:r.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function eZ(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 eJ(t)}function eQ(e){return L(e)?null:k(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))&&void 0!==i?i:"")}),k(t)}function e1(e){var t;return C(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=eZ(t);if(w(i,"ph-sensitive")||w(i,"ph-no-capture"))return!1}if(w(eZ(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 e8="(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})",e4=RegExp("^(?:"+e8+")$"),e7=new RegExp(e8),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=k(e),(t?e4:e7).test((e||"").replace(/[- ]/g,""))||(t?te:tt).test(e)))}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==u?void 0:u.createElement("a");return C(t)?null:(t.href=e,t)},tl=function(e,t){void 0===t&&(t="&");var i,s,r=[];return J(e,function(e,t){C(e)||C(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(!I(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("=");I(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=z("[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=R(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(r&&u){var e=e=>{e=e||(null==r?void 0:r.event);try{this.k(e)}catch(e){td.error("Failed to capture event",e)}};if(en(u,"submit",e,{capture:!0}),en(u,"change",e,{capture:!0}),en(u,"click",e,{capture:!0}),this.S.capture_copied_text){var t=e=>{e=e||(null==r?void 0:r.event),this.k(e,m)};en(u,"copy",t,{capture:!0}),en(u,"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({[ec]:!!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==u?void 0:u.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[ec];if(A(this.o)&&!N(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=null!==(t=this.o)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!s}k(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=e1(e);eY(s)&&(s=s.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===m;if(s&&function(e,t,i,s,n){if(void 0===i&&(i=void 0),!r||!e||eV(e,"html")||!eW(e)||null!=(o=i)&&o.url_allowlist&&!eX(i.url_allowlist)||null!=(a=i)&&a.url_ignorelist&&eX(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(eK(p.parentNode))h.push(p.parentNode.host),p=p.parentNode.host;else{if(!(d=e3(p)))break;if(s||e2.indexOf(d.tagName.toLowerCase())>-1)u=!0;else{var g=r.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(C(i))return!0;var s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var r of e){var n=s(r);if("object"==typeof n)return n.v}return!1}(h,i)||!function(e,t){var i=null==t?void 0:t.css_selector_allowlist;if(C(i))return!0;var s=function(e){if(i.some(t=>e.matches(t)))return{v:!0}};for(var r of e){var n=s(r);if("object"==typeof n)return n.v}return!1}(h,i))return!1;var _=r.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"))}}(s,e,this.S,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){for(var i,s,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!eV(h,"body");)eK(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(eZ(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=eZ(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=eJ(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)),X(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==r||null==(m=r.location)?void 0:m.host;y&&b&&y!==b&&(d=_)}return{props:X({$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)?I(t)?t:eJ(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Q(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=W({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return Q(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+=Q(n).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=p[0])&&i.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}(s,{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(s);if(l&&l.length>0&&(o.$element_selectors=l),t===m){var c,u=eQ(null==r||null==(c=r.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return P(null==u?void 0:u.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.I=0,this.P=0,this.R=new tb}generate(){var e=this.generateOrAbort();if(C(e)){this.I=0;var t=this.generateOrAbort();if(C(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.T();else{if(!(e+1e4>this.I))return;this.P++,this.P>0x3ffffffffff&&(this.I++,this.T())}return tv.fromFieldsV7(this.I,Math.trunc(this.P/0x40000000),0x3fffffff&this.P,this.R.nextUint32())}T(){this.P=1024*this.R.nextUint32()+(1023&this.R.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};r&&!C(r.crypto)&&crypto.getRandomValues&&(ty=e=>crypto.getRandomValues(e));class tb{constructor(){this.M=new Uint32Array(8),this.C=1/0}nextUint32(){return this.C>=this.M.length&&(ty(this.M),this.C=0),this.M[this.C++]}}var tw,tk=()=>tE().toString(),tE=()=>(tm||(tm=new tf)).generate(),tx="",tS=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,t$={O:()=>!!u,F:function(e){B.error("cookieStore error: "+e)},A:function(e){if(u){try{for(var t=e+"=",i=u.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}},D:function(e){var t;try{t=JSON.parse(t$.A(e))||{}}catch(e){}return t},j:function(e,t,i,s,r){if(u)try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=u),tx)return tx;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+tk(),n=RegExp("(^|;)\\s*"+r+"=1");!tx&&s--;){var o=i.slice(s).join("."),a=r+"=1;domain=."+o;t.cookie=a,n.test(t.cookie)&&(t.cookie=a+";expires=Thu, 01 Jan 1970 00:00:00 GMT",tx=o)}return tx}(e);if(!i){var s,r=(s=e.match(tS))?s[0]:"";r!==i&&B.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(u.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+24*i*36e5),n="; expires="+l.toUTCString()}r&&(o="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&B.warn("cookieStore warning: large cookie, len="+c.length),u.cookie=c,c}catch(e){return}},L:function(e,t){try{t$.j(e,"",-1,t)}catch(e){return}}},tF=null,tI={O:function(){if(!A(tF))return tF;var e=!0;if(C(r))e=!1;
1else try{var t="__mplssupport__";tI.j(t,"xyz"),'"xyz"'!==tI.A(t)&&(e=!1),tI.L(t)}catch(t){e=!1}return e||B.error("localStorage unsupported; falling back to cookie store"),tF=e,e},F:function(e){B.error("localStorage error: "+e)},A:function(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){tI.F(e)}return null},D:function(e){try{return JSON.parse(tI.A(e))||{}}catch(e){}return null},j:function(e,t){try{null==r||r.localStorage.setItem(e,JSON.stringify(t))}catch(e){tI.F(e)}},L:function(e){try{null==r||r.localStorage.removeItem(e)}catch(e){tI.F(e)}}},tP=["distinct_id",eE,ex,eH,ej],tR=W({},tI,{D:function(e){try{var t={};try{t=t$.D(e)||{}}catch(e){}var i=X(t,JSON.parse(tI.A(e)||"{}"));return tI.j(e,i),i}catch(e){}return null},j:function(e,t,i,s,r,n){try{tI.j(e,t,void 0,void 0,n);var o={};tP.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&t$.j(e,o,i,s,r,n)}catch(e){tI.F(e)}},L:function(e,t){try{null==r||r.localStorage.removeItem(e),t$.L(e,t)}catch(e){tI.F(e)}}}),tM={},tC={O:function(){return!0},F:function(e){B.error("memoryStorage error: "+e)},A:function(e){return tM[e]||null},D:function(e){return tM[e]||null},j:function(e,t){tM[e]=t},L:function(e){delete tM[e]}},tO=null,tT={O:function(){if(!A(tO))return tO;if(tO=!0,C(r))tO=!1;else try{var e="__support__";tT.j(e,"xyz"),'"xyz"'!==tT.A(e)&&(tO=!1),tT.L(e)}catch(e){tO=!1}return tO},F:function(e){B.error("sessionStorage error: ",e)},A:function(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){tT.F(e)}return null},D:function(e){try{return JSON.parse(tT.A(e))||null}catch(e){}return null},j:function(e,t){try{null==r||r.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){tT.F(e)}},L:function(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){tT.F(e)}}};!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(tw||(tw={}));class tA{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.N()?tw.DENIED:this.U}isOptedOut(){return this.consent===tw.DENIED||this.consent===tw.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.q.j(this.B,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.q.L(this.B,this.S.cross_subdomain_cookie)}get B(){var{token:e,opt_out_capturing_cookie_prefix:t}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get U(){var e=this.q.A(this.B);return"1"===e?tw.GRANTED:"0"===e?tw.DENIED:tw.PENDING}get q(){if(!this.H){var e=this.S.opt_out_capturing_persistence_type;this.H="localStorage"===e?tI:t$;var t="localStorage"===e?t$:tI;t.A(this.B)&&(this.H.A(this.B)||this.optInOut("1"===t.A(this.B)),t.L(this.B,this.S.cross_subdomain_cookie))}return this.H}N(){return!!this.S.respect_dnt&&!!er([null==c?void 0:c.doNotTrack,null==c?void 0:c.msDoNotTrack,v.doNotTrack],e=>w([!0,1,"1","yes"],e))}}var tL=z("[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.W}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.G(()=>{this.J()})}G(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?tL.error("failed to load script",t):e()})}J(){var e;if(u){if(!this.W&&null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=R(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.W=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.W.start(u),tL.info("starting...")}}else tL.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,tL.info("stopping..."))}}var tj=z("[ExceptionAutocapture]");class tH{constructor(e){var t;this.V=()=>{var e;if(r&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.K&&this.config.capture_unhandled_errors&&(this.K=t(this.captureException.bind(this))),!this.Y&&this.config.capture_unhandled_rejections&&(this.Y=i(this.captureException.bind(this))),!this.X&&this.config.capture_console_errors&&(this.X=s(this.captureException.bind(this)))}catch(e){tj.error("failed to start",e),this.Z()}}},this.instance=e,this.remoteEnabled=!(null==(t=this.instance.persistence)||!t.props[eh]),this.config=this.tt(),this.startIfEnabled()}tt(){var e=this.instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return R(e)?t=W({},t,e):(C(e)?this.remoteEnabled:e)&&(t=W({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.config.capture_console_errors||this.config.capture_unhandled_errors||this.config.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(tj.info("enabled"),this.G(this.V))}
1G(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"exception-autocapture",t=>{if(t)return tj.error("failed to load script",t);e()})}Z(){var e,t,i;null==(e=this.K)||e.call(this),this.K=void 0,null==(t=this.Y)||t.call(this),this.Y=void 0,null==(i=this.X)||i.call(this),this.X=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t,this.config=this.tt(),this.instance.persistence&&this.instance.persistence.register({[eh]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL=t+"/project/"+this.instance.config.token+"/person/"+this.instance.get_distinct_id(),this.instance.exceptions.sendExceptionEvent(e)}}function tB(e){return!C(Event)&&tz(e,Event)}function tz(e,t){try{return e instanceof t}catch(e){return!1}}function tU(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return tz(e,Error)}}function tG(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function tW(e){return tG(e,"DOMError")}var tV=/\(error: (.*)\)/;function tY(e,t,i,s){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return C(i)||(r.lineno=i),C(s)||(r.colno=s),r}var tK,tJ,tX,tZ=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tQ=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,t0=/\((\S*)(?::(\d+))(?::(\d+))\)/,t1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,t2=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,t3=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=tV.test(o)?o.replace(tV,"$1"):o;if(!a.match(/\S*Error: /)){for(var l of s){var c=l(a);if(c){i.push(c);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>W({},e,{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(i)}}([30,e=>{var t=tZ.exec(e);if(t){var[,i,s,r]=t;return tY(i,"?",+s,+r)}var n=tQ.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var o=t0.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}var[a,l]=t5(n[1]||"?",n[2]);return tY(l,a,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,e=>{var t=t1.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=t2.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]=t5(r,s),tY(s,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),t5=(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]},t6=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function t8(e,t){void 0===t&&(t=0);var i=e.stacktrace||e.stack||"",s=e&&t4.test(e.message)?1:0;try{var r,n,o=(r=t3(i,s),n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var i=Object.keys(t);return tX&&i.length===tJ||(tJ=i.length,tX=i.reduce((i,s)=>{tK||(tK={});var r=tK[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,tK[s]=[l,c];break}}return i},{})),tX}(t3),r.forEach(e=>{e.filename&&(e.chunk_id=n[e.filename])}),r);return o.slice(0,o.length-t)}catch(e){}return[]}var t4=/Minified React error #\d+;/i;function t7(e,t){return{$exception_list:function e(t,i){var s,r,n,o,a,l,c=(o=t8(t),a=null===(r=null==i?void 0:i.handled)||void 0===r||r,l=null!==(n=null==i?void 0:i.synthetic)&&void 0!==n&&n,{type:null!=i&&i.overrideExceptionType?i.overrideExceptionType:t.name,value:(s=t.message).error&&"string"==typeof s.error.message?String(s.error.message):String(s),stacktrace:{frames:o,type:"raw"},mechanism:{handled:a,synthetic:l}});return t.cause&&tU(t.cause)&&t.cause!==t?[c,...e(t.cause,{handled:null==i?void 0:i.handled,synthetic:null==i?void 0:i.synthetic})]:[c]}(e,t),$exception_level:"error"}}function t9(e,t){var i,s,r,n=null===(i=null==t?void 0:t.handled)||void 0===i||i,o=null===(s=null==t?void 0:t.synthetic)||void 0===s||s,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:n,synthetic:o}};if(null!=t&&t.syntheticException){var l=t8(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function ie(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return P(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}class it{constructor(e){var t;this._instance=e,this.it=(null==r||null==(t=r.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.et&&this.et(),this.et=void 0,B.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(r&&r.history){var i=this;null!=(e=r.history.pushState)&&e.__posthog_wrapped__||ie(r.history,"pushState",e=>function(t,s,r){e.call(this,t,s,r),i.rt("pushState")}),null!=(t=r.history.replaceState)&&t.__posthog_wrapped__||ie(r.history,"replaceState",e=>function(t,s,r){e.call(this,t,s,r),i.rt("replaceState")}),this.st()}}rt(e){try{var t,i=null==r||null==(t=r.location)?void 0:t.pathname;if(!i)return;i!==this.it&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.it=i}catch(t){B.error("Error capturing "+e+" pageview",t)}}st(){if(!this.et){var e=()=>{this.rt("popstate")};en(r,"popstate",e),this.et=()=>{r&&r.removeEventListener("popstate",e)}}}}function ii(e){var t,i;return(null==(t=JSON.stringify(e,(i=[],function(e,t){if(R(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 is=(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))(is||{}),ir=(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))(ir||{}),io="[SessionRecording]",ia="redacted",il={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"]},ic=["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"],iu=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],ih=["/s/","/e/","/i/"];function id(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?io+" "+s+" body too large to record ("+r+" bytes)":e}function ip(e,t){if(L(e))return e;var i=e;return ti(i,!1)||(i=io+" "+t+" body "+ia),J(iu,e=>{var s,r;null!=(s=i)&&s.length&&-1!==(null==(r=i)?void 0:r.indexOf(e))&&(i=io+" "+t+" body "+ia+" as might contain: "+e)}),i}var ig=(e,t)=>
1{var i,s,r={payloadSizeLimitBytes:il.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...il.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...il.payloadHostDenyList]},n=!1!==e.session_recording.recordHeaders&&t.recordHeaders,o=!1!==e.session_recording.recordBody&&t.recordBody,a=!1!==e.capture_performance&&t.recordPerformance,l=(s=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=id(e.requestBody,e.requestHeaders,s,"Request")),null!=e&&e.responseBody&&(e.responseBody=id(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&&ih.some(e=>0===n.indexOf(e))))return e})((L(i=t.requestHeaders)||J(Object.keys(null!=i?i:{}),e=>{ic.includes(e.toLowerCase())&&(i[e]=ia)}),t),e.api_host))},u=P(e.session_recording.maskNetworkRequestFn);return u&&P(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 W({},t,{name:null==i?void 0:i.url})}),r.maskRequestFn=P(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))&&void 0!==i?i:void 0}:e=>(function(e){if(!C(e))return e.requestBody=ip(e.requestBody,"Request"),e.responseBody=ip(e.responseBody,"Response"),e})(c(e)),W({},il,r,{recordHeaders:n,recordBody:o,recordPerformance:a,recordInitialRequests:a})};function i_(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),i_(r||i,t,i,s))}class iv{constructor(e,t){var i,s;void 0===t&&(t={}),this.nt=100,this.ot=10,this.lt={},this.ht={},this.ut=()=>{Object.keys(this.lt).forEach(e=>{this.lt[e]=this.lt[e]+this.ot,this.lt[e]>=this.nt&&delete this.lt[e]})},this.dt=e=>{var t=this._rrweb.mirror.getNode(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.vt=e=>{var t,i,s,r,n,o,a,l;return(null!==(t=null==(i=e.removes)?void 0:i.length)&&void 0!==t?t:0)+(null!==(s=null==(r=e.attributes)?void 0:r.length)&&void 0!==s?s:0)+(null!==(n=null==(o=e.texts)?void 0:o.length)&&void 0!==n?n:0)+(null!==(a=null==(l=e.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,i=this.vt(t);t.attributes&&(t.attributes=t.attributes.filter(e=>{var t,i,s,[r,n]=this.dt(e.id);return 0!==this.lt[r]&&(this.lt[r]=null!==(t=this.lt[r])&&void 0!==t?t:this.nt,this.lt[r]=Math.max(this.lt[r]-1,0),0===this.lt[r]&&(this.ht[r]||(this.ht[r]=!0,null==(i=(s=this.ct).onBlockedNode)||i.call(s,r,n))),e)}));var s=this.vt(t);return 0!==s||i===s?e:void 0},this._rrweb=e,this.ct=t,this.ot=i_(null!==(i=this.ct.refillRate)&&void 0!==i?i:this.ot,0,100,"mutation throttling refill rate"),this.nt=i_(null!==(s=this.ct.bucketSize)&&void 0!==s?s:this.nt,0,100,"mutation throttling bucket size"),setInterval(()=>{this.ut()},1e3)}}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]),ik=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]),iE=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]},iS=ix(iw,2),i$=iS[0],iF=iS[1];i$[28]=258,iF[258]=28;
vendor: 4,804 bytes, line 1
1for(var iI=ix(ik,0)[1],iP=new iy(32768),iR=0;iR<32768;++iR){var iM=(43690&iR)>>>1|(21845&iR)<<1;iM=(61680&(iM=(52428&iM)>>>2|(13107&iM)<<2))>>>4|(3855&iM)<<4,iP[iR]=((65280&iM)>>>8|(255&iM)<<8)>>>1}var iC=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[iP[h]>>>l]=c}else for(o=new iy(s),r=0;r<s;++r)o[r]=iP[a[e[r]-1]++]>>>15-e[r];return o},iO=new im(288);for(iR=0;iR<144;++iR)iO[iR]=8;for(iR=144;iR<256;++iR)iO[iR]=9;for(iR=256;iR<280;++iR)iO[iR]=7;for(iR=280;iR<288;++iR)iO[iR]=8;var iT=new im(32);for(iR=0;iR<32;++iR)iT[iR]=5;var iA=iC(iO,9,0),iL=iC(iT,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},iH=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=iB(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]},iB=function(e,t,i){return -1==e.s?Math.max(iB(e.l,t,i+1),iB(e.r,t,i+1)):t[e.s]=i},iz=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]},iU=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=iH(r,15),d=h[0],p=h[1],g=iH(n,15),_=g[0],v=g[1],f=iz(d),m=f[0],y=f[1],b=iz(_),w=b[0],k=b[1],E=new iy(19),x=0;x<m.length;++x)E[31&m[x]]++;for(x=0;x<w.length;++x)E[31&w[x]]++;for(var S=iH(E,7),$=S[0],F=S[1],I=19;I>4&&!$[iE[I-1]];--I);var P,R,M,C,O=c+5<<3,T=iU(r,iO)+iU(n,iT)+o,A=iU(r,d)+iU(n,_)+o+14+3*I+iU(E,$)+(2*E[16]+3*E[17]+7*E[18]);if(O<=T&&O<=A)return iG(t,u,e.subarray(l,l+c));if(iq(t,u,1+(A<T)),u+=2,A<T){P=iC(d,p,0),R=d,M=iC(_,v,0),C=_;var L=iC($,F,0);for(iq(t,u,y-257),iq(t,u+5,k-1),iq(t,u+10,I-4),u+=14,x=0;x<I;++x)iq(t,u+3*x,$[iE[x]]);u+=3*I;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+=$[j],j>15&&(iq(t,u,q[x]>>>5&127),u+=q[x]>>>12)}}}else P=iA,R=iO,M=iL,C=iT;for(x=0;x<a;++x)if(s[x]>255){ij(t,u,P[(j=s[x]>>>18&31)+257]),u+=R[j+257],j>7&&(iq(t,u,s[x]>>>23&31),u+=iw[j]);var H=31&s[x];ij(t,u,M[H]),u+=C[H],H>3&&(ij(t,u,s[x]>>>5&8191),u+=ik[H])}else ij(t,u,P[s[x]]),u+=R[s[x]];return ij(t,u,P[256]),u+R[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}(),iK=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}}},iJ=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},iX=function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&iJ(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 iZ(e,t){void 0===t&&(t={});var i,s,r,n=iK(),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-8),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),k=new iy(288),E=new iy(32),x=0,S=0,$=(u=0,0),F=0,I=0;u<o;++u){var P=b(u),R=32767&u,M=f[P];
1if(v[R]=M,f[P]=R,F<=u){var C=o-u;if((x>7e3||$>24576)&&C>423){c=iW(e,l,0,w,k,E,S,$,I,u-I,c),$=x=S=0,I=u;for(var O=0;O<286;++O)k[O]=0;for(O=0;O<30;++O)E[O]=0}var T=2,A=0,L=g,D=R-M&32767;if(C>2&&P==b(u-D))for(var N=Math.min(p,C)-1,q=Math.min(32767,u),j=Math.min(258,C);D<=q&&--L&&R!=M;){if(e[u+T]==e[u+T-D]){for(var H=0;H<j&&e[u+H]==e[u+H-D];++H);if(H>T){if(T=H,A=D,H>N)break;var B=Math.min(D,H-2),z=0;for(O=0;O<B;++O){var U=u-D+O+32768&32767,G=U-v[U]+32768&32767;G>z&&(z=G,M=U)}}}D+=(R=M)-(M=v[R])+32768&32767}if(A){w[$++]=0x10000000|iF[T]<<18|iI[A];var W=31&iF[T],V=31&iI[A];S+=iw[W]+ik[V],++k[257+W],++E[V],F=u+T,++x}else w[$++]=e[u],++k[e[u]]}}c=iW(e,l,n,w,k,E,S,$,I,u-I,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 iX(a,t),iJ(a,l-8,n.d()),iJ(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",i8=i6+"_activated",i4=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.ft=e}triggerStatus(e){var t=this.ft.map(t=>t.triggerStatus(e));return t.includes(i8)?i8:t.includes(i4)?i4:i7}stop(){this.ft.forEach(e=>e.stop())}}class st{constructor(e){this.ft=e}triggerStatus(e){var t=new Set;for(var i of this.ft)t.add(i.triggerStatus(e));switch(t.delete(i7),t.size){case 0:return i7;case 1:return Array.from(t)[0];default:return i4}}stop(){this.ft.forEach(e=>e.stop())}}class si{triggerStatus(){return i4}stop(){}}class ss{constructor(e){this.gt=[],this._t=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,i;this.gt=(null==(t=e.sessionRecording)?void 0:t.urlTriggers)||[],this._t=(null==(i=e.sessionRecording)?void 0:i.urlBlocklist)||[]}bt(e){var t;return 0===this.gt.length?i7:(null==(t=this._instance)?void 0:t.get_property(eS))===e?i8:i4}triggerStatus(e){var t=this.bt(e),i=t===i8?i8:t===i4?i4:i7;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:i}),i}checkUrlTriggerConditions(e,t,i){if(void 0!==r&&r.location.href){var s=r.location.href,n=this.urlBlocked,o=i9(s,this._t);n&&o||(o&&!n?e():!o&&n&&t(),i9(s,this.gt)&&i("url"))}}stop(){}}class sr{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.wt=()=>{},this._instance=e}triggerStatus(){var e=i4;return L(this.linkedFlag)&&(e=i7),this.linkedFlagSeen&&(e=i8),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.wt=this._instance.onFeatureFlags((e,i)=>{var n=R(i)&&s in i,o=r?i[s]===r:n;o&&t(s,r),this.linkedFlagSeen=o})}}stop(){this.wt()}}class sn{constructor(e){this.yt=[],this._instance=e}onRemoteConfig(e){var t;this.yt=(null==(t=e.sessionRecording)?void 0:t.eventTriggers)||[]}St(e){var t;return 0===this.yt.length?i7:(null==(t=this._instance)?void 0:t.get_property(e$))===e?i8:i4}triggerStatus(e){var t=this.St(e),i=t===i8?i8:t===i4?i4: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.receivedDecide)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===i8?i2:i===i4?i3:!1===e.isSampled?i0:i2}function sl(e){if(!e.receivedDecide)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===i4?i3:i&&t===i7||s&&!e.isSampled?i0:!0===e.isSampled?i1:i2}var sc="[SessionRecording]",su=z(sc);function sh(){var e,t;return null==v||null==(e=v.__PosthogExtensions__)||null==(t=e.rrweb)?void 0:t.record}var sd=[ir.MouseMove,ir.MouseInteraction,ir.Scroll,ir.ViewportResize,ir.Input,ir.TouchMove,ir.MediaInteraction,ir.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}(iZ(iQ(JSON.stringify(e))),!0)}function s_(e){return e.type===is.Custom&&"sessionIdle"===e.data.tag}class sv{get sessionId(){return this.$t}get kt(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.xt}get Et(){if(!this._instance.sessionManager)throw Error(sc+" must be started with a valid sessionManager.");return this._instance.sessionManager}get It(){var e,t;return this.Pt.triggerStatus(this.sessionId)===i4?6e4:null!==(e=null==(t=this._instance.config.session_recording)?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:3e5}get Rt(){var e=this._instance.get_property(ex);return N(e)?e:null}get Tt(){var e,t,i=null==(e=this.M)?void 0:e.data[(null==(t=this.M)?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.Et.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get Mt(){var e=!!this._instance.get_property(e_),t=!this._instance.config.disable_session_recording;return r&&e&&t}get Ct(){var e=!!this._instance.get_property(ev),t=this._instance.config.enable_recording_console_log;return null!=t?t:e}get Ot(){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)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(i=null!==(s=null==o?void 0:o.canvasFps)&&void 0!==s?s:null==a?void 0:a.fps)&&void 0!==i?i:4,u=null!==(r=null!==(n=null==o?void 0:o.canvasQuality)&&void 0!==n?n:null==a?void 0:a.quality)&&void 0!==r?r:.4;if("string"==typeof u){var h=parseFloat(u);u=isNaN(h)?.4:h}return{enabled:l,fps:i_(c,0,12,"canvas recording fps",4),quality:i_(u,0,1,"canvas recording quality",.4)}}get Ft(){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=R(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 At(){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)&&void 0!==s?s:null==o?void 0:o.maskAllInputs,c=null!==(r=null==a?void 0:a.maskTextSelector)&&void 0!==r?r:null==o?void 0:o.maskTextSelector,u=null!==(n=null==a?void 0:a.blockSelector)&&void 0!==n?n:null==o?void 0:o.blockSelector;return C(l)&&C(c)&&C(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get Dt(){var e=this._instance.get_property(eb);return D(e)?e:null}get jt(){var e=this._instance.get_property(ew);return D(e)?e:null}get status(){return this.Lt?this.Nt({receivedDecide:this.Lt,isRecordingEnabled:this.Mt,isSampled:this.Rt,urlTriggerMatching:this.zt,eventTriggerMatching:this.Ut,linkedFlagMatching:this.qt,sessionId:this.sessionId}):i3}constructor(e){if(this.Nt=so,this.Lt=!1,this.Bt=[],this.Ht="unknown",this.Wt=Date.now(),this.Pt=new si,this.Gt=void 0,this.Jt=void 0,this.Vt=void 0,this.Kt=void 0,this.Yt=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.Xt=()=>{this.Qt()},this.Zt=()=>{this.ti("browser offline",{})},this.ii=()=>{this.ti("browser online",{})},this.ei=()=>
1{if(null!=u&&u.visibilityState){var e="window "+u.visibilityState;this.ti(e,{})}},this._instance=e,this.xt=!1,this.ri="/s/",this.si=void 0,this.Lt=!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.qt=new sr(this._instance),this.zt=new ss(this._instance),this.Ut=new sn(this._instance);var{sessionId:t,windowId:i}=this.Et.checkAndGetSessionAndWindowId();this.$t=t,this.ni=i,this.M=this.oi(),this.kt>=this.Et.sessionTimeoutMs&&su.warn("session_idle_threshold_ms ("+this.kt+") is greater than the session timeout ("+this.Et.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.Mt?(this.ai(e),en(r,"beforeunload",this.Xt),en(r,"offline",this.Zt),en(r,"online",this.ii),en(r,"visibilitychange",this.ei),this.li(),this.hi(),L(this.Gt)&&(this.Gt=this._instance.on("eventCaptured",e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this.ui(null==e?void 0:e.properties.$current_url):"";if(!t)return;this.ti("$pageview",{href:t})}}catch(e){su.error("Could not add $pageview to rrweb session",e)}})),this.Jt||(this.Jt=this.Et.onSessionId((e,t,i)=>{var s,r,n,o;i&&(this.ti("$session_id_change",{sessionId:e,windowId:t,changeReason:i}),null==(s=this._instance)||null==(r=s.persistence)||r.unregister(e$),null==(n=this._instance)||null==(o=n.persistence)||o.unregister(eS))}))):this.stopRecording()}stopRecording(){var e,t,i,s;this.xt&&this.si&&(this.si(),this.si=void 0,this.xt=!1,null==r||r.removeEventListener("beforeunload",this.Xt),null==r||r.removeEventListener("offline",this.Zt),null==r||r.removeEventListener("online",this.ii),null==r||r.removeEventListener("visibilitychange",this.ei),this.oi(),clearInterval(this.di),null==(e=this.Gt)||e.call(this),this.Gt=void 0,null==(t=this.Yt)||t.call(this),this.Yt=void 0,null==(i=this.Jt)||i.call(this),this.Jt=void 0,null==(s=this.Kt)||s.call(this),this.Kt=void 0,this.Ut.stop(),this.zt.stop(),this.qt.stop(),su.info("stopped"))}vi(){var e;null==(e=this._instance.persistence)||e.unregister(ex)}ci(e){var t,i=this.$t!==e,s=this.Dt;if(D(s)){var r=this.Rt,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<i_(100*s,0,100):r;n&&(o?this.fi(i1):su.warn("Sample rate ("+s+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ti("samplingDecisionMade",{sampleRate:s,isSampled:o})),null==(t=this._instance.persistence)||t.register({[ex]:o})}else this.vi()}onRemoteConfig(e){var t,i,s,r;this.ti("$remote_config_received",e),this.pi(e),null!=(t=e.sessionRecording)&&t.endpoint&&(this.ri=null==(r=e.sessionRecording)?void 0:r.endpoint),this.li(),"any"===(null==(i=e.sessionRecording)?void 0:i.triggerMatchType)?(this.Nt=sa,this.Pt=new se([this.Ut,this.zt])):(this.Nt=sl,this.Pt=new st([this.Ut,this.zt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==(s=e.sessionRecording)?void 0:s.triggerMatchType}),this.zt.onRemoteConfig(e),this.Ut.onRemoteConfig(e),this.qt.onRemoteConfig(e,(e,t)=>{this.fi("linked_flag_matched",{flag:e,variant:t})}),this.Lt=!0,this.startIfEnabledOrStop()}li(){D(this.Dt)&&L(this.Kt)&&(this.Kt=this.Et.onSessionId(e=>{this.ci(e)}))}pi(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.vi();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]:W({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]:C(p)?null:p,[ek]:null==(u=e.sessionRecording)?void 0:u.scriptConfig})};s(),null==(t=this.Vt)||t.call(this),this.Vt=this.Et.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()})}ai(e){if(!C(Object.assign)&&!C(Array.from)&&!(this.xt||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var t;(this.xt=!0,this.Et.checkAndGetSessionAndWindowId(),sh())?this.gi():null==(t=v.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,this.mi,e=>{if(e)return su.error("could not load recorder",e);this.gi()}),su.info("starting"),this.status===i2&&this.fi(e||"recording_initialized")}}get mi(){var e,t,i;return(null==(e=this._instance)||null==(t=e.persistence)||null==(i=t.get_property(ek))?void 0:i.script)||"recorder"}bi(e){var t;return 3===e.type&&-1!==sd.indexOf(null==(t=e.data)?void 0:t.source)}wi(e){var t=this.bi(e);t||this.Ht||e.timestamp-this.Wt>this.kt&&(this.Ht=!0,clearInterval(this.di),this.ti("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.Wt,threshold:this.kt,bufferLength:this.M.data.length,bufferSize:this.M.size}),this.Qt());var i=!1;if(t&&(this.Wt=e.timestamp,this.Ht)){var s="unknown"===this.Ht;this.Ht=!1,s||(this.ti("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)}if(!this.Ht){var{windowId:r,sessionId:n}=this.Et.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.$t!==n,a=this.ni!==r;
1this.ni=r,this.$t=n,o||a?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this.yi()}}Si(e){try{return e.rrwebMethod(),!0}catch(t){return this.Bt.length<10?this.Bt.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):su.warn("could not emit queued rrweb event.",t,e),!1}}ti(e,t){return this.Si(sp(()=>sh().addCustomEvent(e,t)))}$i(){return this.Si(sp(()=>sh().takeFullSnapshot()))}gi(){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:{},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=W({password:!0},o):r[n]=o);this.Ot&&this.Ot.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.Ot.fps},r.dataURLOptions={type:"image/webp",quality:this.Ot.quality}),this.At&&(r.maskAllInputs=null===(t=this.At.maskAllInputs)||void 0===t||t,r.maskTextSelector=null!==(i=this.At.maskTextSelector)&&void 0!==i?i:void 0,r.blockSelector=null!==(s=this.At.blockSelector)&&void 0!==s?s:void 0);var a=sh();if(a){this.ki=null!==(e=this.ki)&&void 0!==e?e:new iv(a,{refillRate:this._instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this._instance.config.session_recording.__mutationRateLimiterBucketSize,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.xi();this.si=a(W({emit:e=>{this.onRRwebEmit(e)},plugins:l},r)),this.Wt=Date.now(),this.Ht=N(this.Ht)?this.Ht:"unknown",this.ti("$session_options",{sessionRecordingOptions:r,activePlugins:l.map(e=>null==e?void 0:e.name)}),this.ti("$posthog_config",{config:this._instance.config})}else su.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}yi(){if(this.di&&clearInterval(this.di),!0!==this.Ht){var e=this.It;e&&(this.di=setInterval(()=>{this.$i()},e))}}xi(){var e,t,i,s,r=[],n=null==(e=v.__PosthogExtensions__)||null==(t=e.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Ct&&r.push(n());var o=null==(i=v.__PosthogExtensions__)||null==(s=i.rrwebPlugins)?void 0:s.getRecordNetworkPlugin;return this.Ft&&P(o)&&(!to.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(o(ig(this._instance.config,this.Ft))):su.info("NetworkCapture not started because we are on localhost.")),r}onRRwebEmit(e){var t;if(this.Ei(),e&&R(e)){if(e.type===is.Meta){var i=this.ui(e.data.href);if(this.Ii=i,!i)return;e.data.href=i}else this.Pi();if(this.zt.checkUrlTriggerConditions(()=>this.Ri(),()=>this.Ti(),e=>this.Mi(e)),!this.zt.urlBlocked||e.type===is.Custom&&"recording paused"===e.data.tag){e.type===is.FullSnapshot&&this.yi(),e.type===is.FullSnapshot&&this.Lt&&this.Pt.triggerStatus(this.sessionId)===i4&&this.oi();var s=this.ki?this.ki.throttleMutations(e):e;if(s){var r=function(e){if(e&&R(e)&&6===e.type&&R(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.wi(r),!0!==this.Ht||s_(r)){if(s_(r)){var n=r.data.payload;if(n){var o=n.lastActivityTimestamp,a=n.threshold;r.timestamp=o+a}}var l=null===(t=this._instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(1024>ii(e))return e;try{if(e.type===is.FullSnapshot)return W({},e,{data:sg(e.data),cv:"2024-10"});if(e.type===is.IncrementalSnapshot&&e.data.source===ir.Mutation)return W({},e,{cv:"2024-10",data:W({},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===is.IncrementalSnapshot&&e.data.source===ir.StyleSheetRule)return W({},e,{cv:"2024-10",data:W({},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}(r):r,c={$snapshot_bytes:ii(l),$snapshot_data:l,$session_id:this.$t,$window_id:this.ni};this.status!==i0?this.Ci(c):this.oi()}}}}}Pi(){if(!this._instance.config.capture_pageview&&r){var e=this.ui(r.location.href);this.Ii!==e&&(this.ti("$url_changed",{href:e}),this.Ii=e)}}Ei(){if(this.Bt.length){var e=[...this.Bt];
1this.Bt=[],e.forEach(e=>{Date.now()-e.enqueuedAt<=2e3&&this.Si(e)})}}ui(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}oi(){return this.M={size:0,data:[],sessionId:this.$t,windowId:this.ni},this.M}Qt(){this.Oi&&(clearTimeout(this.Oi),this.Oi=void 0);var e=this.jt,t=this.Tt,i=D(t)&&t>=0,s=D(e)&&i&&t<e;return this.status===i3||this.status===i5||this.status===i0||s?(this.Oi=setTimeout(()=>{this.Qt()},2e3),this.M):(this.M.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:ii(r),data:r,sessionId:t.sessionId,windowId:t.windowId}),e({size:ii(n),data:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(e=>e)}return[t]})(this.M).forEach(e=>{this.Fi({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:f.LIB_VERSION})}),this.oi())}Ci(e){var t,i=2+((null==(t=this.M)?void 0:t.data.length)||0);!this.Ht&&(this.M.size+e.$snapshot_bytes+i>943718.4||this.M.sessionId!==this.$t)&&(this.M=this.Qt()),this.M.size+=e.$snapshot_bytes,this.M.data.push(e.$snapshot_data),this.Oi||this.Ht||(this.Oi=setTimeout(()=>{this.Qt()},2e3))}Fi(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.ri),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}Mi(e){var t,i;this.Pt.triggerStatus(this.sessionId)===i4&&(null==(t=this._instance)||null==(i=t.persistence)||i.register({["url"===e?eS:e$]:this.$t}),this.Qt(),this.fi(e+"_trigger_matched"))}Ri(){this.zt.urlBlocked||(this.zt.urlBlocked=!0,clearInterval(this.di),su.info("recording paused due to URL blocker"),this.ti("recording paused",{reason:"url blocker"}))}Ti(){this.zt.urlBlocked&&(this.zt.urlBlocked=!1,this.$i(),this.yi(),this.ti("recording resumed",{reason:"left blocked url"}),su.info("recording resumed"))}hi(){0!==this.Ut.yt.length&&L(this.Yt)&&(this.Yt=this._instance.on("eventCaptured",e=>{try{this.Ut.yt.includes(e.event)&&this.Mi("event")}catch(e){su.error("Could not activate event trigger",e)}}))}overrideLinkedFlag(){this.qt.linkedFlagSeen=!0,this.$i(),this.fi("linked_flag_overridden")}overrideSampling(){var e;null==(e=this._instance.persistence)||e.register({[ex]:!0}),this.$i(),this.fi("sampling_overridden")}overrideTrigger(e){this.Mi(e)}fi(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.ti(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.Et.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.M.data.length,$sdk_debug_replay_internal_buffer_size:this.M.size,$sdk_debug_current_session_duration:this.Tt,$sdk_debug_session_start:e}}}var sf=z("[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=>W({},e,{stacktrace:e.stacktrace?W({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>W({},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,sk=null!=r&&r.location?th(r.location.hash,"__posthog")||th(location.hash,"state"):null,sE="_postHogToolbarParam
1s",sx=z("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(sw||(sw={}));class sS{constructor(e){this.instance=e}Di(e){v.ph_toolbar_state=e}ji(){var e;return null!==(e=v.ph_toolbar_state)&&void 0!==e?e:sw.UNINITIALIZED}maybeLoadToolbar(e,t,i){var s,n;if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),!r||!u)return!1;e=null!==(s=e)&&void 0!==s?s:r.location,i=null!==(n=i)&&void 0!==n?n:r.history;try{if(!t){try{r.localStorage.setItem("test","test"),r.localStorage.removeItem("test")}catch(e){return!1}t=null==r?void 0:r.localStorage}var o,a=sk||th(e.hash,"__posthog")||th(e.hash,"state"),l=a?ee(()=>JSON.parse(atob(decodeURIComponent(a))))||ee(()=>JSON.parse(decodeURIComponent(a))):null;return l&&"ph_authorize"===l.action?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?e.hash=l.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((o=JSON.parse(t.getItem(sE)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}Li(e){var t=v.ph_load_toolbar||v.ph_load_editor;!L(t)&&P(t)?t(e,this.instance):sx.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==u||!u.getElementById(eB));if(!r||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=W({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(r.localStorage.setItem(sE,JSON.stringify(W({},n,{source:void 0}))),this.ji()===sw.LOADED)?this.Li(n):this.ji()===sw.UNINITIALIZED&&(this.Di(sw.LOADING),null==(t=v.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return sx.error("[Toolbar] Failed to load",e),void this.Di(sw.UNINITIALIZED);this.Di(sw.LOADED),this.Li(n)}),en(r,"turbolinks:load",()=>{this.Di(sw.UNINITIALIZED),this.loadToolbar(n)})),!0}Ni(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 s$=z("[TracingHeaders]");class sF{constructor(e){this.zi=void 0,this.Ui=void 0,this.V=()=>{var e,t,i,s;C(this.zi)&&(null==(e=v.__PosthogExtensions__)||null==(t=e.tracingHeadersPatchFns)||t._patchXHR(this._instance.sessionManager)),C(this.Ui)&&(null==(i=v.__PosthogExtensions__)||null==(s=i.tracingHeadersPatchFns)||s._patchFetch(this._instance.sessionManager))},this._instance=e}G(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return s$.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.G(this.V):(null==(e=this.zi)||e.call(this),null==(t=this.Ui)||t.call(this),this.zi=void 0,this.Ui=void 0)}}var sI=z("[Web Vitals]");class sP{constructor(e){var t;this.qi=!1,this.i=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Bi=()=>{clearTimeout(this.Hi),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce((e,t)=>W({},e,{["$web_vitals_"+t.name+"_event"]:W({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Wi=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(C(i))sI.error("Could not read session ID. Dropping metrics!");else{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Gi();C(s)||(L(null==e?void 0:e.name)||L(null==e?void 0:e.value)?sI.error("Invalid metric received",e):this.Ji&&e.value>=this.Ji?sI.error("Ignoring metric with value >= "+this.Ji,e):(this.M.url!==s&&(this.Bi(),this.Hi=setTimeout(this.Bi,this.flushToCaptureTimeoutMs)),C(this.M.url)&&(this.M.url=s),this.M.firstMetricTimestamp=C(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.M.metrics.push(W({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.M.metrics.length===this.allowedMetrics.length&&this.Bi()))}},this.V=()=>{var e,t,i,s,r=v.__PosthogExtensions__;C(r)||C(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Wi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Wi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Wi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Wi.bind(this)),this.i=!0):sI.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.qi=!(null==(t=this._instance.persistence)||!t.props[ed]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=R(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return C(i)?(null==(t=this._instance.persistence)?void 0:t.props[eg])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(R(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Ji(){var e=R(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==h?void 0:h.protocol;if("http:"!==e&&"https:"!==e)return sI.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=R(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.qi}startIfEnabled(){this.isEnabled&&!this.i&&(sI.info("enabled, starting..."),this.G(this.V))}onRemoteConfig(e){var t=R(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=R(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.qi=t,this.startIfEnabled()}G(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",t=>{t?sI.error("failed to load script",t):e()})}Gi(){var e=r?r.location.href:void 0;return e||sI.error("Could not determine current URL"),e}}var sR=z("[Heatmaps]");function sM(e){return R(e)&&"clientX"in e&&"clientY"in e&&D(e.clientX)&&D(e.clientY)}class sC{constructor(e){var t;this.rageclicks=new tn,this.qi=!1,this.i=!1,this.Vi=null,this.instance=e,this.qi=!(null==(t=this.instance.persistence)||!t.props[eu])}get flushIntervalMilliseconds(){var e=5e3;return R(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 C(this.instance.config.capture_heatmaps)?C(this.instance.config.enable_heatmaps)?this.qi:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.i||(sR.info("starting..."),this.Ki(),this.Vi=setInterval(this.Yi.bind(this),this.flushIntervalMilliseconds));else{var e,t;clearInterval(null!==(e=this.Vi)&&void 0!==e?e:void 0),null==(t=this.Xi)||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[eu]:t}),this.qi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}Qi(e){this.Zi(e.originalEvent,"deadclick")}Ki(){r&&u&&(en(r,"beforeunload",this.Yi.bind(this)),en(u,"click",e=>this.Zi(e||(null==r?void 0:r.event)),{capture:!0}),en(u,"mousemove",e=>this.te(e||(null==r?void 0:r.event)),{capture:!0}),this.Xi=new tq(this.instance,tD,this.Qi.bind(this)),this.Xi.startIfEnabled(),this.i=!0)}ie(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var s=e;s&&eW(s)&&!eV(s,"body")&&s!==i;){if(w(t,null==r?void 0:r.getComputedStyle(s).position))return!0;s=e3(s)}return!1}(e1(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:s),y:e.clientY+(o?0:i),target_fixed:o,type:t}}Zi(e,t){var i;if(void 0===t&&(t="click"),!eG(e.target)&&sM(e)){var s=this.ie(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.ee(W({}
1,s,{type:"rageclick"})),this.ee(s)}}te(e){!eG(e.target)&&sM(e)&&(clearTimeout(this.re),this.re=setTimeout(()=>{this.ee(this.ie(e,"mousemove"))},500))}ee(e){if(r){var t=r.location.href;this.M=this.M||{},this.M[t]||(this.M[t]=[]),this.M[t].push(e)}}Yi(){this.M&&!M(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class sO{constructor(e){this._instance=e}doPageView(e,t){var i,s=this.se(e,t);return this.ne={pathname:null!==(i=null==r?void 0:r.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.se(e,null==(t=this.ne)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ne)?void 0:e.pageViewId}}se(e,t){var i=this.ne;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(!(C(n)||C(o)||C(a)||C(l)||C(c)||C(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:i_(o/n,0,1),d=n<=1?1:i_(a/n,0,1),p=l<=1?1:i_(c/l,0,1),g=l<=1?1:i_(u/l,0,1);s=X(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}}class sT{constructor(e){this._instance=e}sendExceptionEvent(e){this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var sA="Mobile",sL="Android",sD="Tablet",sN=sL+" "+sD,sq="iPad",sj="Apple",sH=sj+" Watch",sB="Safari",sz="BlackBerry",sU="Samsung",sG=sU+"Browser",sW=sU+" Internet",sV="Chrome",sY=sV+" OS",sK=sV+" iOS",sJ="Internet Explorer",sX=sJ+" "+sA,sZ="Opera",sQ=sZ+" Mini",s0="Edge",s1="Microsoft "+s0,s2="Firefox",s3=s2+" iOS",s5="Nintendo",s6="PlayStation",s8="Xbox",s4=sL+" "+sA,s7=sA+" "+sB,s9="Windows",re=s9+" Phone",rt="Nokia",ri="Ouya",rs="Generic",rr=rs+" "+sA.toLowerCase(),rn=rs+" "+sD.toLowerCase(),ro="Konqueror",ra="(\\d+(\\.\\d+)?)",rl=RegExp("Version/"+ra),rc=RegExp(s8,"i"),ru=RegExp(s6+" \\w+","i"),rh=RegExp(s5+" \\w+","i"),rd=RegExp(sz+"|PlayBook|BB10","i"),rp={"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"},rg=(e,t)=>t&&w(t,sj)||function(e){return w(e,sB)&&!w(e,sV)&&!w(e,sL)}(e),r_=function(e,t){return t=t||"",w(e," OPR/")&&w(e,"Mini")?sQ:w(e," OPR/")?sZ:rd.test(e)?sz:w(e,"IE"+sA)||w(e,"WPDesktop")?sX:w(e,sG)?sW:w(e,s0)||w(e,"Edg/")?s1:w(e,"FBIOS")?"Facebook "+sA:w(e,"UCWEB")||w(e,"UCBrowser")?"UC Browser":w(e,"CriOS")?sK:w(e,"CrMo")||w(e,sV)?sV:w(e,sL)&&w(e,sB)?s4:w(e,"FxiOS")?s3:w(e.toLowerCase(),ro.toLowerCase())?ro:rg(e,t)?w(e,sA)?s7:sB:w(e,s2)?s2:w(e,"MSIE")||w(e,"Trident/")?sJ:w(e,"Gecko")?s2:""},rv={[sX]:[RegExp("rv:"+ra)],[s1]:[RegExp(s0+"?\\/"+ra)],[sV]:[RegExp("("+sV+"|CrMo)\\/"+ra)],[sK]:[RegExp("CriOS\\/"+ra)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+ra)],[sB]:[rl],[s7]:[rl],[sZ]:[RegExp("(Opera|OPR)\\/"+ra)],[s2]:[RegExp(s2+"\\/"+ra)],[s3]:[RegExp("FxiOS\\/"+ra)],[ro]:[RegExp("Konqueror[:/]?"+ra,"i")],[sz]:[RegExp(sz+" "+ra),rl],[s4]:[RegExp("android\\s"+ra,"i")],[sW]:[RegExp(sG+"\\/"+ra)],[sJ]:[RegExp("(rv:|MSIE )"+ra)],Mozilla:[RegExp("rv:"+ra)]},rf=function(e,t){var i=rv[r_(e,t)];if(C(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},rm=[[RegExp(s8+"; "+s8+" (.*?)[);]","i"),e=>[s8,e&&e[1]||""]],[RegExp(s5,"i"),[s5,""]],[RegExp(s6,"i"),[s6,""]],[rd,[sz,""]],[RegExp(s9,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[re,""];if(new RegExp(sA).test(t)&&!/IEMobile\b/.test(t))return[s9+" "+sA,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=rp[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[s9,s]}return[s9,""]}],[/((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=C(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+sL+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+sL+")","i"),e=>e&&e[2]?[sL,[e[2],e[3],e[4]||"0"].join(".")]:[sL,""]],[/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/,[sY,""]],[/Linux|debian/i,["Linux",""]]],ry=function(e){return rh.test(e)?s5:ru.test(e)?s6:rc.test(e)?s8:Reg
1Exp(ri,"i").test(e)?ri:RegExp("("+re+"|WPDesktop)","i").test(e)?re:/iPad/.test(e)?sq:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?sH:rd.test(e)?sz:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(rt,"i").test(e)?rt:/(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(sA).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)?sL:sN:sL:RegExp("(pda|"+sA+")","i").test(e)?rr:RegExp(sD,"i").test(e)&&!RegExp(sD+" pc","i").test(e)?rn:""},rb="https?://(.*)",rw=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rk=Z(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rw),rE="<masked>";function rx(e,t,i){if(!u)return{};var s=t?Z([],rw,i||[]):[];return rS(tu(u.URL,s,rE),e)}function rS(e,t){var i=rk.concat(t||[]),s={};return J(i,function(t){var i=tc(e,t);s[t]=i||null}),s}function r$(e){var t=e?0===e.search(rb+"google.([^/?]*)")?"google":0===e.search(rb+"bing.com")?"bing":0===e.search(rb+"yahoo.com")?"yahoo":0===e.search(rb+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!A(t)){i.$search_engine=t;var s=u?tc(u.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rF(){return navigator.language||navigator.userLanguage}function rI(){return(null==u?void 0:u.referrer)||"$direct"}function rP(e,t){var i=e?Z([],rw,t||[]):[],s=null==h?void 0:h.href.substring(0,1e3);return{r:rI().substring(0,1e3),u:s?tu(s,i,rE):void 0}}function rR(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};if(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,X(r,rS(s))}return i&&X(r,r$(i)),r}function rM(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rC,rO=z("[FeatureFlags]"),rT="$active_feature_flags",rA="$override_feature_flags",rL="$feature_flag_payloads",rD="$override_feature_flag_payloads",rN="$feature_flag_request_id",rq=e=>{var t={};for(var[i,s]of Q(e||{}))s&&(t[i]=s);return t},rj=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(e=>{var i;return[e,null!==(i=t[e].variant)&&void 0!==i?i:t[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(e=>t[e].enabled).filter(e=>{var i;return null==(i=t[e].metadata)?void 0:i.payload}).map(e=>{var i;return[e,null==(i=t[e].metadata)?void 0:i.payload]}))):rO.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};!function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"}(rC||(rC={}));class rH{constructor(e){this.oe=!1,this.ae=!1,this.le=!1,this.he=!1,this.ue=!1,this.de=!1,this.ve=!1,this._instance=e,this.featureFlagEventHandlers=[]}decide(){if(this._instance.config.__preview_remote_config)this.de=!0;else{var e=!this.ce&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.fe({disableFlags:e})}}get hasLoadedFlags(){return this.ae}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(eP),t=this._instance.get_property(rA),i=this._instance.get_property(rD);if(!i&&!t)return e||{};var s=X({},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=C(l)?null!==(n=null==a?void 0:a.enabled)&&void 0!==n&&n:!!l,u=C(l)?a.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[r],d=W({},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=W({},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.oe||(rO.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.oe=!0),s}getFlagVariants(){var e=this._instance.get_property(eF),t=this._instance.get_property(rA);
1if(!t)return e||{};for(var i=X({},e),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.oe||(rO.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.oe=!0),i}getFlagPayloads(){var e=this._instance.get_property(rL),t=this._instance.get_property(rD);if(!t)return e||{};for(var i=X({},e||{}),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.oe||(rO.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.oe=!0),i}reloadFeatureFlags(){this.he||this._instance.config.advanced_disable_feature_flags||this.ce||(this.ce=setTimeout(()=>{this.fe()},5))}pe(){clearTimeout(this.ce),this.ce=void 0}ensureFlagsLoaded(){this.ae||this.le||this.ce||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.he=e}fe(e){var t;if(this.pe(),!this._instance.config.advanced_disable_decide){if(this.le)this.ue=!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:W({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(eR)||{}),group_properties:this._instance.get_property(eM)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var r=this._instance.config.__preview_flags_v2&&this._instance.config.__preview_remote_config;r&&(i.timezone=rM()),this.le=!0,this._instance.ge({method:"POST",url:this._instance.requestRouter.endpointFor("api",r?"/flags/?v=2":"/decide/?v=4"),data:i,compression:this._instance.config.disable_compression?void 0:s.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,s,r,n=!0;200===e.statusCode&&(this.ue||(this.$anon_distinct_id=void 0),n=!1),this.le=!1,this.de||(this.de=!0,this._instance._e(null!==(r=e.json)&&void 0!==r?r:{})),i.disable_flags&&!this.ue||(this.ve=!n,e.json&&null!=(t=e.json.quotaLimited)&&t.includes(rC.FeatureFlags)?rO.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."):(this.receivedFeatureFlags(null!==(s=e.json)&&void 0!==s?s:{},n),this.ue&&(this.ue=!1,this.fe())))}})}}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.ae||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,r=this._instance.get_property(rN)||void 0,n=this._instance.get_property(eT)||{};if((t.send_event||!("send_event"in t))&&(!(e in n)||!n[e].includes(s))){I(n[e])?n[e].push(s):n[e]=[s],null==(l=this._instance.persistence)||l.register({[eT]: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==(u=c.featureFlags)?void 0:u[e])||null,$feature_flag_bootstrapped_payload:(null==(h=this._instance.config.bootstrap)||null==(d=h.featureFlagPayloads)?void 0:d[e])||null,$used_bootstrap_value:!this.ve};C(null==o||null==(p=o.metadata)?void 0:p.version)||(a.$feature_flag_version=o.metadata.version);var l,c,u,h,d,p,g,_,v,f,m,y,b=null!==(g=null==o||null==(_=o.reason)?void 0:_.description)&&void 0!==g?g:null==o||null==(v=o.reason)?void 0:v.code;b&&(a.$feature_flag_reason=b),null!=o&&null!=(f=o.metadata)&&f.id&&(a.$feature_flag_id=o.metadata.id),C(null==o?void 0:o.original_variant)&&C(null==o?void 0:o.original_enabled)||(a.$feature_flag_original_response=C(o.original_variant)?o.original_enabled:o.original_variant),null!=o&&null!=(m=o.metadata)&&m.original_payload&&(a.$feature_flag_original_payload=null==o||null==(y=o.metadata)?void 0:y.original_payload),this._instance.capture("$feature_flag_called",a)}return i}rO.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.ge({method:"POST",url:this._instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this._instance.get_distinct_id(),token:i}
1,compression:this._instance.config.disable_compression?void 0:s.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.ae||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);rO.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.ae=!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=rj(e),o=n.flags,a=n.featureFlags,l=n.featureFlagPayloads;if(a){var c=e.requestId;if(I(a)){rO.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var u={};if(a)for(var h=0;h<a.length;h++)u[a[h]]=!0;t&&t.register({[rT]:a,[eF]:u})}else{var d=a,p=l,g=o;e.errorsWhileComputingFlags&&(d=W({},i,d),p=W({},s,p),g=W({},r,g)),t&&t.register(W({[rT]:Object.keys(rq(d)),[eF]:d||{},[rL]:p||{},[eP]:g||{}},c?{[rN]:c}:{}))}}}(e,this._instance.persistence,i,s,r),this.me(t)}}override(e,t){void 0===t&&(t=!1),rO.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return rO.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(rA),this._instance.persistence.unregister(rD),void this.me();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.oe=!!(null!==(t=e.suppressWarning)&&void 0!==t&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(rA);else if(e.flags){if(I(e.flags)){for(var i={},s=0;s<e.flags.length;s++)i[e.flags[s]]=!0;this._instance.persistence.register({[rA]:i})}else this._instance.persistence.register({[rA]:e.flags})}}return"payloads"in e&&(!1===e.payloads?this._instance.persistence.unregister(rD):e.payloads&&this._instance.persistence.register({[rD]:e.payloads})),void this.me()}this.me()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ae){var{flags:t,flagVariants:i}=this.be();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,s=(this._instance.get_property(eI)||[]).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=W({},this.getFlagVariants(),{[e]:t});null==(i=this._instance.persistence)||i.register({[rT]:Object.keys(rq(o)),[eF]:o}),this.me()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(eI),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance.ge({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({[eI]:s}),e(s)}}})}be(){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),{})}}me(e){var{flags:t,flagVariants:i}=this.be();this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(eR)||{};this._instance.register({[eR]:W({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(eR)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(eM)||{};
10!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=W({},i[t],e[t]),delete e[t]}),this._instance.register({[eM]:W({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(eM)||{};this._instance.register({[eM]:W({},t,{[e]:{}})})}else this._instance.unregister(eM)}}var rB=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class rz{constructor(e){this.S=e,this.props={},this.we=!1,this.ye=(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.q=this.Se(e),this.load(),e.debug&&B.info("Persistence loaded",e.persistence,W({},this.props)),this.update_config(e,e),this.save()}Se(e){-1===rB.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&&tI.O()?tI:"localstorage+cookie"===t&&tR.O()?tR:"sessionstorage"===t&&tT.O()?tT:"memory"===t?tC:"cookie"===t?t$:tR.O()?tR:t$}properties(){var e={};return J(this.props,function(t,i){if(i===eF&&R(t))for(var s,r=Object.keys(t),n=0;n<r.length;n++)e["$feature/"+r[n]]=t[r[n]];else s=!1,(A(eU)?s:l&&eU.indexOf===l?-1!=eU.indexOf(i):(J(eU,function(e){if(s||(s=e===i))return Y}),s))||(e[i]=t)}),e}load(){if(!this.$e){var e=this.q.D(this.ye);e&&(this.props=X({},e))}}save(){this.$e||this.q.j(this.ye,this.props,this.ke,this.xe,this.Ee,this.S.debug)}remove(){this.q.L(this.ye,!1),this.q.L(this.ye,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(R(e)){C(t)&&(t="None"),this.ke=C(i)?this.Ie: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(R(e)){this.ke=C(t)?this.Ie: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.we){var e=rx(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);M(ei(e))||this.register(e),this.we=!0}}update_search_keyword(){var e;this.register((e=null==u?void 0:u.referrer)?r$(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rI(),$referring_domain:null!=u&&u.referrer&&(null==(e=ta(u.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[eN]||this.props[eq]||this.register_once({[ej]:rP(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_"+E(i)]=t})});var t,i,s=this.props[ej];return s&&X(e,(t=rR(s),i={},J(t,function(e,t){i["$initial_"+E(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){if(this.Ie=this.ke=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.Se(e),s=this.props;this.clear(),this.q=i,this.props=s,this.save()}}set_disabled(e){this.$e=e,this.$e?this.remove():this.save()}set_cross_subdomain(e){e!==this.xe&&(this.xe=e,this.remove(),this.save())}set_secure(e){e!==this.Ee&&(this.Ee=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[el]||{};i[e]=t,this.props[el]=i,this.save()}remove_event_timer(e){var t=(this.props[el]||{})[e];return C(t)||(delete this.props[el][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class rU{constructor(){this.Pe={},this.Pe={}}on(e,t){return this.Pe[e]||(this.Pe[e]=[]),this.Pe[e].push(t),()=>{this.Pe[e]=this.Pe[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Pe[e]||[])i(t);for(var s of this.Pe["*"]||[])s(e,t)}}var rG=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}};class rW{constructor(e){this.Re=new rU,this.Te=(e,t)=>
1this.Me(e,t)&&this.Ce(e,t)&&this.Oe(e,t),this.Me=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Fe=new Set,this.Ae=new Set}init(){var e,t;C(null==(e=this._instance)?void 0:e.De)||null==(t=this._instance)||t.De((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!C(null==(t=this._instance)?void 0:t.De)&&(e.forEach(e=>{var t,i;null==(t=this.Ae)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Fe)||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.Fe.has(e)||this.Fe.has(null==t?void 0:t.event))&&this.Ae&&(null==(i=this.Ae)?void 0:i.size)>0&&this.Ae.forEach(e=>{this.je(t,e)&&this.Re.emit("actionCaptured",e.name)})}Le(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.Te(e,i))return!0;return!1}onAction(e,t){return this.Re.on(e,t)}Ce(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||!rW.Ne(s,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static Ne(e,t,i){switch(i){case"regex":return!!r&&rG(e,t);case"exact":return t===e;case"contains":return rG(e,rW.ze(t).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static ze(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Oe(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.Ue(e).some(e=>!(null!=t&&t.href&&!rW.Ne(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&&!rW.Ne(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!rW.Ne(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}Ue(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}var rV=z("[Surveys]");class rY{constructor(e){this._instance=e,this.qe=new Map,this.Be=new Map}register(e){var t;C(null==(t=this._instance)?void 0:t.De)||(this.He(e),this.We(e))}We(e){var t=e.filter(e=>{var t,i,s,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(s=i.actions)||null==(r=s.values)?void 0:r.length)>0});0!==t.length&&(null==this.Ge&&(this.Ge=new rW(this._instance),this.Ge.init(),this.Ge.Le(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n,o,a,l,c,u;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(s=i.actions)&&s.values&&(null==(r=e.conditions)||null==(n=r.actions)||null==(o=n.values)?void 0:o.length)>0&&(null==(a=this.Ge)||a.register(e.conditions.actions.values),null==(l=e.conditions)||null==(c=l.actions)||null==(u=c.values)||u.forEach(t=>{if(t&&t.name){var i=this.Be.get(t.name);i&&i.push(e.id),this.Be.set(t.name,i||[e.id])}}))}))}He(e){var t;0!==e.filter(e=>{var t,i,s,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(s=i.events)||null==(r=s.values)?void 0:r.length)>0}).length&&(null==(t=this._instance)||t.De((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t,i,s;null==(t=e.conditions)||null==(i=t.events)||null==(s=i.values)||s.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,r=(null==(i=this._instance)||null==(s=i.persistence)?void 0:s.props[eO])||[];if("survey shown"===e&&t&&r.length>0){rV.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:r});var n,o=null==t||null==(n=t.properties)?void 0:n.$survey_id;if(o){var a=r.indexOf(o);a>=0&&(r.splice(a,1),this.Je(r))}}else this.qe.has(e)&&(rV.info("survey event matched, updating activated surveys",{event:e,surveys:this.qe.get(e)}),this.Je(r.concat(this.qe.get(e)||[])))}onAction(e){var t,i,s=(null==(t=this._instance)||null==(i=t.persistence)?void 0:i.props[eO])||[];this.Be.has(e)&&this.Je(s.concat(this.Be.get(e)||[]))}Je(e){var t,i;null==(t=this._instance)||null==(i=t.persistence)||i.register({[eO]:[...new Set(e)]})}getSurveys(){var e,t;return(null==(e=this._instance)||null==(t=e.persistence)?void 0:t.props[eO])||[]}getEventToSurveys(){return this.qe}Ve(){return this.Ge}}class rK{constructor(e){this.Ke=null,this.Ye=!1,this.Xe=!1,this.Qe=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(L(t))return rV.warn("Decide not loaded yet. Not loading surveys.");var i=I(t);this.Ze=i?t.length>0:t,rV.info("decide response received, hasSurveys: "+this.Ze),this.Ze&&this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);null!=i&&i.startsWith("seenSurvey_")&&e.push(i)}
1e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this.Ke){if(this.Xe)rV.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)rV.info("Disabled. Not loading surveys.");else if(this.Ze){var e=null==v?void 0:v.__PosthogExtensions__;if(e){this.Xe=!0;try{var t=e.generateSurveys;if(t)return void this.tr(t);var i=e.loadExternalDependency;if(!i)return void this.ir("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",t=>{t||!e.generateSurveys?this.ir("Could not load surveys script",t):this.tr(e.generateSurveys)})}catch(e){throw this.ir("Error initializing surveys",e),e}finally{this.Xe=!1}}else rV.error("PostHog Extensions not found.")}else rV.info("No surveys to load.")}}tr(e){this.Ke=e(this._instance),this._surveyEventReceiver=new rY(this._instance),rV.info("Surveys loaded successfully"),this.er({isLoaded:!0})}ir(e,t){rV.error(e,t),this.er({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Qe.push(e),this.Ke&&this.er({isLoaded:!0}),()=>{this.Qe=this.Qe.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return rV.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(eC);if(i&&!t)return e(i,{isLoaded:!0});if(this.Ye)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ye=!0,this._instance.ge({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.Ye=!1;var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return rV.error(s),e([],{isLoaded:!1,error:s})}var r,n,o=t.json.surveys||[],a=o.filter(e=>{var t,i,s,r,n,o;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(i=t.events)||null==(s=i.values)||!s.length)||!(null==(r=e.conditions)||null==(n=r.actions)||null==(o=n.values)||!o.length))});return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),null==(r=this._instance.persistence)||r.register({[eC]:o}),e(o,{isLoaded:!0})}})}catch(e){throw this.Ye=!1,e}}er(e){for(var t of this.Qe)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(e){rV.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!L(this.Ke))return this.Ke.getActiveMatchingSurveys(e,t);rV.warn("init was not called")}rr(e){var t=null;return this.getSurveys(i=>{var s;t=null!==(s=i.find(t=>t.id===e))&&void 0!==s?s:null}),t}sr(e){if(L(this.Ke))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.rr(e):e;return t?this.Ke.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(!L(this.Ke))return rV.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.sr(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return L(this.Ke)?(rV.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!==(s=t.find(t=>t.id===e))&&void 0!==s?s:null;if(r){var n=this.sr(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(L(this.Ke))rV.warn("init was not called");else{var i=this.rr(e),s=null==u?void 0:u.querySelector(t);i?s?this.Ke.renderSurvey(i,s):rV.warn("Survey element not found"):rV.warn("Survey not found")}}}var rJ=z("[RateLimiter]");class rX{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=>{rJ.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rJ.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))&&void 0!==t?t:{tokens:this.captureEventsBurstLimit,last:r};n.tokens+=(r-n.last)/1e3*this.captureEventsPerSecond,n.last=r,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var o=n.tokens<1;return o||e||(n.tokens=Math.max(0,n.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(s=this.instance.persistence)||s.set_property(eD,n),{isRateLimited:o,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rZ=z("[RemoteConfig]");class rQ{constructor(e){this._instance=e}get remoteConfig(){var e,t;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(t=e[this._instance.config.token])?void 0:t.config}nr(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(rZ.error("PostHog Extensions not found. Cannot load remote config."),e())}ar(e){this._instance.ge({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 rZ.info("Using preloaded remote config",this.remoteConfig),void this._e(this.remoteConfig);if(this._instance.config.advanced_disable_decide)return void rZ.warn("Remote config is disabled. Falling back to local config.");this.nr(e=>{if(!e)return rZ.info("No config found after loading remote JS config. Falling back to JSON."),void this.ar(e=>{this._e(e)}
1);this._e(e)})}catch(e){rZ.error("Error loading remote config",e)}}_e(e){e?this._instance.config.__preview_remote_config?(this._instance._e(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):rZ.info("__preview_remote_config is disabled. Logging config instead",e):rZ.error("Failed to fetch remote config from PostHog.")}}var r0=function(e){var t,i,s,r,n="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++){var o=e.charCodeAt(r),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),A(a)||(i>t&&(n+=e.substring(t,i)),n+=a,t=i=r+1)}return i>t&&(n+=e.substring(t,e.length)),n},r1=!!p||!!d,r2="text/plain",r3=(e,t)=>{var[i,s]=e.split("?"),r=W({},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)},r5=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),r6=e=>{var{data:t,compression:i}=e;if(t){if(i===s.GZipJS){var r=new Blob([iZ(iQ(r5(t)),{mtime:0})],{type:r2});return{contentType:r2,body:r,estimatedSize:r.size}}if(i===s.Base64){var n=(e=>"data="+encodeURIComponent("string"==typeof e?e:r5(e)))(function(e){var t,i,s,r,n,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=r0(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}(r5(t)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=r5(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},r8=[];d&&r8.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:r,estimatedSize:n}=null!==(t=r6(e))&&void 0!==t?t:{},o=new Headers;J(e.headers,function(e,t){o.append(t,e)}),s&&o.append("Content-Type",s);var a=e.url,l=null;if(g){var c=new g;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}d(a,W({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)}}),p&&r8.push({transport:"XHR",method:e=>{var t,i=new p;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=null!==(t=r6(e))&&void 0!==t?t:{};J(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),i.withCredentials=!0,i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(r)}}),null!=c&&c.sendBeacon&&r8.push({transport:"sendBeacon",method:e=>{var t=r3(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!==(i=r6(e))&&void 0!==i?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;c.sendBeacon(t,n)}catch(e){}}});class r4{constructor(e,t){this.lr=!0,this.hr=[],this.ur=i_((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,"flush interval",3e3),this.dr=e}enqueue(e){this.hr.push(e),this.vr||this.cr()}unload(){this.pr();var e=Object.values(this.hr.length>0?this.gr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.dr(W({},e,{transport:"sendBeacon"}))})}enable(){this.lr=!1,this.cr()}cr(){var e=this;this.lr||(this.vr=setTimeout(()=>{if(this.pr(),this.hr.length>0){var t=this.gr();for(var i in t)!function(i){var s=t[i],r=(new Date).getTime();s.data&&I(s.data)&&J(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.dr(s)}(i)}},this.ur))}pr(){clearTimeout(this.vr),this.vr=void 0}gr(){var e={};return J(this.hr,t=>{var i,s=(t?t.batchKey:null)||t.url;C(e[s])&&(e[s]=W({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.hr=[],e}}var r7=["retriesPerformedSoFar"];class r9{constructor(e){this._r=!1,this.mr=3e3,this.hr=[],this._instance=e,this.hr=[],this.br=!0,!C(r)&&"onLine"in r.navigator&&(this.br=r.navigator.onLine,en(r,"online",()=>{this.br=!0,this.Yi()}),en(r,"offline",()=>{this.br=!1}))}get length(){return this.hr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=V(e,r7);D(t)&&t>0&&(i.url=r3(i.url,{retry_count:t})),this._instance.ge(W({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.wr(W({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}wr(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.hr.push({retryAt:o,requestOptions:e});var a="Enqueued failed request for retry in "+n;navigator.onLine||(a+=" (Browser is offline)"),B.warn(a),this._r||(this._r=!0,this.yr())}yr(){this.Sr&&clearTimeout(this.Sr),this.Sr=setTimeout(()=>{this.br&&this.hr.length>0&&this.Yi(),this.yr()},this.mr)}Yi(){var e=Date.now(),t=[],i=this.hr.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.hr=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Sr&&(clearTimeout(this.Sr),this.Sr=void 0),this.hr))try{this._instance.ge(W({},e,{transport:"sendBeacon"}))}catch(e){B.error(e)}this.hr=[]}}class ne{constructor(e){this.$r=()=>{this.kr||(this.kr={});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.kr.lastScrollY=Math.ceil(n),this.kr.maxScrollY=Math.max(n,null!==(e=this.kr.maxScrollY)&&void 0!==e?e:0),this.kr.maxScrollHeight=Math.max(o,null!==(t=this.kr.maxScrollHeight)&&void 0!==t?t:0),this.kr.lastContentY=a,this.kr.maxContentY=Math.max(a,null!==(i=this.kr.maxContentY)&&void 0!==i?i:0),this.kr.maxContentHeight=Math.max(l,null!==(s=this.kr.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}getContext(){return this.kr}resetContext(){var e=this.kr;return setTimeout(this.$r,0),e}startMeasuringScrollPosition(){en(r,"scroll",this.$r,{capture:!0}),en(r,"scrollend",this.$r,{capture:!0}),en(r,"resize",this.$r)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==r?void 0:r.document.documentElement;for(var e of I(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var t=null==r?void 0:r.document.querySelector(e);
1if(t)return t}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return r&&(r.scrollY||r.pageYOffset||r.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return r&&(r.scrollX||r.pageXOffset||r.document.documentElement.scrollLeft)||0}}var nt=e=>rP(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class ni{constructor(e,t,i,s){this.Er=e=>{var t=this.Ir();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Pr(this._instance)};this.Rr.register({[eL]:i})}},this._instance=e,this.Tr=t,this.Rr=i,this.Pr=s||nt,this.Tr.onSessionId(this.Er)}Ir(){return this.Rr.props[eL]}getSetOnceProps(){var e,t=null==(e=this.Ir())?void 0:e.props;return t?"r"in t?rR(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(ei(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+E(i)]=t}),e}}var ns=z("[SessionId]");class nr{constructor(e,t,i){if(this.Mr=[],!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.Rr=e.persistence,this.ni=void 0,this.$t=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Cr=t||tk,this.Or=i||tk;var s,r=this.S.persistence_name||this.S.token,n=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*i_(n,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Fr(),this.Ar="ph_"+r+"_window_id",this.Dr="ph_"+r+"_primary_window_exists",this.jr()){var o=tT.D(this.Ar),a=tT.D(this.Dr);o&&!a?this.ni=o:tT.L(this.Ar),tT.j(this.Dr,!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.Lr(this.S.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){ns.error("Invalid sessionID in bootstrap",e)}this.Nr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return C(this.Mr)&&(this.Mr=[]),this.Mr.push(e),this.$t&&e(this.$t,this.ni),()=>{this.Mr=this.Mr.filter(t=>t!==e)}}jr(){return"memory"!==this.S.persistence&&!this.Rr.$e&&tT.O()}zr(e){e!==this.ni&&(this.ni=e,this.jr()&&tT.j(this.Ar,e))}Ur(){return this.ni?this.ni:this.jr()?tT.D(this.Ar):null}Lr(e,t,i){e===this.$t&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.$t=e,this.Rr.register({[eE]:[t,e,i]}))}qr(){if(this.$t&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.$t,this._sessionStartTimestamp];var e=this.Rr.props[eE];return I(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Lr(null,null,null)}Nr(){en(r,"beforeunload",()=>{this.jr()&&tT.L(this.Dr)},{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.Ur(),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.Cr(),o=this.Or(),ns.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),n=i,l=!0):o||(o=this.Or(),l=!0);var h=0===s||!e||a?i:s,d=0===n?(new Date).getTime():n;return this.zr(o),this.Lr(r,h,d),e||this.Fr(),l&&this.Mr.forEach(e=>e(r,o,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0)),{sessionId:r,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:s}}Fr(){clearTimeout(this.Br),this.Br=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var nn=["$set_once","$set"],no=z("[SiteApps]");class na{constructor(e){this._instance=e,this.Hr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Wr(e,t){if(t){var i=this.globalsForEvent(t);this.Hr.push(i),this.Hr.length>1e3&&(this.Hr=this.Hr.slice(10))}}get siteAppLoaders(){var e,t;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(t=e[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var e=this._instance.De(this.Wr.bind(this));this.Gr=()=>{e(),this.Hr=[],this.Gr=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:W({},V(e,nn),{properties:W({},e.properties,p?{$set:W({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},p)}:{},d?{$set_once:W({},null!==(s=null==(r=e.properties)?void 0:r.$set_once)&&void 0!==s?s:{},d)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.Hr.length&&(no.info("Processing "+this.Hr.length+" events for site app with id "+e.id),this.Hr.forEach(e
vendor: 4,509 bytes, line 1
1=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Gr)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,no.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){no.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){no.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Jr(){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)}Vr(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){no.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.Jr(),void this._instance.on("eventCaptured",e=>this.Vr(e))):void no.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Gr)||i.call(this),null!=(s=e.siteApps)&&s.length){if(this.isEnabled){var n=function(e,t){var i;v["__$$ph_site_app_"+e]=r._instance,null==(i=v.__PosthogExtensions__)||null==i.loadSiteApp||i.loadSiteApp(r._instance,t,t=>{if(t)return no.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o,a)}else no.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}var nl,nc=["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","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","googleweblight","mediapartners-google","storebot-google","bytespider"],nu=function(e,t){if(!e)return!1;var i=e.toLowerCase();return nc.concat(t||[]).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},nh=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&nu(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>nu(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function nd(e,t,i){return r5({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(nl||(nl={}));var np="i.posthog.com";class ng{constructor(e){this.Kr={},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("."+np,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Kr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Kr[this.apiHost]=nl.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Kr[this.apiHost]=nl.EU:this.Kr[this.apiHost]=nl.CUSTOM),this.Kr[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===nl.CUSTOM)return this.apiHost+t;var i=np+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var n_={icontains:(e,t)=>!!r&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!r&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!r&&rG(t.href,e),not_regex:(e,t)=>!!r&&!rG(t.href,e),exact:(e,t)=>
1t.href===e,is_not:(e,t)=>t.href!==e};class nv{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{nv.Yr("retrieved web experiments from the server"),t.Xr=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Xr&&(nv.Yr("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Xr)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);O(s)&&e.variants[s]&&t.Qr(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];nv.Zr(n)&&t.Qr(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())nv.Yr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(L(this.Xr))return this.Xr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();nv.Yr("applying feature flags",e),e.forEach(e=>{var t;if(this.Xr&&null!=(t=this.Xr)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Xr)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Qr(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=nv.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&&(nv.Yr("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.ts(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.ge({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([])})}ts(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(nv.Yr("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Qr(s[0].name,t,s[0].variants[t].transforms))}static Zr(e){return!L(e.conditions)&&nv.es(e)&&nv.rs(e)}static es(e){if(L(e.conditions)||L(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,r,n=nv.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||n_[null!==(s=null==(r=e.conditions)?void 0:r.urlMatchType)&&void 0!==s?s:"icontains"](e.conditions.url,n))}
1static getWindowLocation(){return null==r?void 0:r.location}static rs(e){if(L(e.conditions)||L(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rx();if(t.utm_source){var i,s,r,n,o,a,l,c,u,h,d,p,g,_,v,f,m,y=null==(s=e.conditions)||null==(r=s.utm)||!r.utm_campaign||(null==(n=e.conditions)||null==(o=n.utm)?void 0:o.utm_campaign)==t.utm_campaign,b=null==(a=e.conditions)||null==(l=a.utm)||!l.utm_source||(null==(c=e.conditions)||null==(u=c.utm)?void 0:u.utm_source)==t.utm_source,w=null==(h=e.conditions)||null==(d=h.utm)||!d.utm_medium||(null==(p=e.conditions)||null==(g=p.utm)?void 0:g.utm_medium)==t.utm_medium,k=null==(_=e.conditions)||null==(v=_.utm)||!v.utm_term||(null==(f=e.conditions)||null==(m=f.utm)?void 0:m.utm_term)==t.utm_term;return y&&w&&k&&b}return!1}static Yr(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)}Qr(e,t,i){this._is_bot()?nv.Yr("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){nv.Yr("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)})}}):nv.Yr("Control variants leave the page unmodified.")}_is_bot(){return c&&this._instance?nh(c,this._instance.config.custom_blocked_useragents):void 0}}var nf={},nm=()=>{},ny="posthog",nb=!r1&&-1===(null==_?void 0:_.indexOf("MSIE"))&&-1===(null==_?void 0:_.indexOf("Mozilla")),nw=()=>{var e;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 es)if(i===s)return!1;return!0}(null==u?void 0:u.location),persistence:"localStorage+cookie",persistence_name:"",loaded:nm,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:h&&O(null==h?void 0:h.search)&&-1!==h.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(e=r.location)?void 0:e.protocol),ip:!0,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_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!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},_onCapture:nm}},nk=e=>{var t={};C(e.process_person)||(t.person_profiles=e.process_person),C(e.xhr_headers)||(t.request_headers=e.xhr_headers),C(e.cookie_name)||(t.persistence_name=e.cookie_name),C(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),C(e.store_google)||(t.save_campaign_params=e.store_google),C(e.verbose)||(t.debug=e.verbose);var i=X({},t,e);return I(e.property_blacklist)&&(C(e.property_denylist)?i.property_denylist=e.property_blacklist:I(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 nE{constructor(){this.__forceAllowLocalhost=!1}get ss(){return this.__forceAllowLocalhost}set ss(e){B.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nx{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new nE,this.ns=!1,this.version=f.LIB_VERSION,this.os=new rU,this.config=nw(),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.ls=!1,this.hs=null,this.us=null,this.ds=null,this.featureFlags=new rH(this),this.toolbar=ne
1w sS(this),this.scrollManager=new ne(this),this.pageViewManager=new sO(this),this.surveys=new rK(this),this.experiments=new nv(this),this.exceptions=new sT(this),this.rateLimiter=new rX(this),this.requestRouter=new ng(this),this.consent=new tA(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!==ny){var s,r=null!==(s=nf[i])&&void 0!==s?s:new nx;return r._init(e,t,i),nf[i]=r,nf[ny][i]=r,r}return this._init(e,t,i)}_init(e,t,i){if(void 0===t&&(t={}),C(e)||T(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.vs=[],t.person_profiles&&(this.us=t.person_profiles),this.set_config(X({},nw(),nk(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:s.GZipJS,this.persistence=new rz(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rz(W({},this.config,{persistence:"sessionStorage"}));var n=W({},this.persistence.props),o=W({},this.sessionPersistence.props);if(this.cs=new r4(e=>this.fs(e),this.config.request_queue_config),this.ps=new r9(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new nr(this),this.sessionPropsManager=new ni(this,this.sessionManager,this.persistence)),new sF(this).startIfEnabledOrStop(),this.siteApps=new na(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 sC(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new sP(this),this.exceptionObserver=new tH(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new tq(this,tN),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new it(this),this.historyAutocapture.startIfEnabled(),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&B.info("Starting in debug mode",{this:this,config:t,thisC:W({},this.config),p:n,s:o}),this.gs(),void 0!==(null==(l=t.bootstrap)?void 0:l.distinctID)){var a,l,c,u,h=this.config.get_device_id(tk()),d=null!=(c=t.bootstrap)&&c.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(eA,null!=(u=t.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this._s()){var p,g,_=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var i,s;return!(null==(i=t.bootstrap)||null==(s=i.featureFlags)||!s[e])}).reduce((e,i)=>{var s,r;return e[i]=(null==(s=t.bootstrap)||null==(r=s.featureFlags)?void 0:r[i])||!1,e},{}),v=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlagPayloads)||{}).filter(e=>_[e]).reduce((e,i)=>{var s,r,n,o;return null!=(s=t.bootstrap)&&null!=(r=s.featureFlagPayloads)&&r[i]&&(e[i]=null==(n=t.bootstrap)||null==(o=n.featureFlagPayloads)?void 0:o[i]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:v})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:ez,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(tk());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(eA,"anonymous")}return en(r,"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()||tk();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(eA,"identified")),t()},r=i.user();"then"in r&&P(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)
1);var s,r=e.Ai(i,null!==(s=t.event.properties)&&void 0!==s?s:{},new Date);return t.event.properties=Object.assign({},r,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.bs()):this.bs(),P(this.config._onCapture)&&this.config._onCapture!==nm&&(B.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this}_e(e){var t,i,r,n,o,a,l,c;if(!u||!u.body)return B.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._e(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=w(e.supportedCompression,s.GZipJS)?s.GZipJS:w(e.supportedCompression,s.Base64)?s.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.us?this.us:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(o=this.heatmaps)||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(l=this.exceptionObserver)||l.onRemoteConfig(e),null==(c=this.deadClicksAutocapture)||c.onRemoteConfig(e)}bs(){try{this.config.loaded(this)}catch(e){B.critical("`loaded` function failed",e)}this.ws(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.ys()},1),new rQ(this).load(),this.featureFlags.decide()}ws(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null==(e=this.cs)||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||K(this.__request_queue,e=>this.fs(e)),this.__request_queue=[],this.ws()}_handle_unload(){var e,t;this.config.request_batching?(this.Ss()&&this.capture("$pageleave"),null==(e=this.cs)||e.unload(),null==(t=this.ps)||t.unload()):this.Ss()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ge(e){this.__loaded&&(nb?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=r3(e.url,{ip:this.config.ip?1:0}),e.headers=W({},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=W({},e);r.timeout=r.timeout||6e4,r.url=r3(r.url,{_:(new Date).getTime().toString(),ver:f.LIB_VERSION,compression:r.compression});var n=null!==(t=r.transport)&&void 0!==t?t:"fetch",o=null!==(i=null==(s=er(r8,e=>e.transport===n))?void 0:s.method)&&void 0!==i?i:r8[0].method;if(!o)throw Error("No available transport method");o(r)})(W({},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)}}))))}fs(e){this.ps?this.ps.retriableRequest(e):this.ge(e)}_execute_array(e){var t,i=[],s=[],r=[];K(e,e=>{e&&(I(t=e[0])?r.push(e):P(e)?e.call(this):I(e)&&"alias"===t?i.push(e):I(e)&&-1!==t.indexOf("capture")&&P(this[t])?r.push(e):s.push(e))});var n=function(e,t){K(e,function(e){if(I(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)}_s(){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.cs){if(!this.consent.isOptedOut()){if(!C(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,o,a,l,c=new Date,u=(null==i?void 0:i.timestamp)||c,h=tk(),d={uuid:h,event:e,properties:this.Ai(e,t||{},u,h)};r&&(d.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),(null==i?void 0:i.$set)&&(d.$set=null==i?void 0:i.$set);var p=this.$s(null==i?void 0:i.$set_once);p&&(d.$set_once=p),(n=d,o=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,a=e=>O(e)&&!A(o)?e.slice(0,o):e,l=new Set,d=function e(t,i){var s;return t!==Object(t)?a?a(t,i):t:l.has(t)?void 0:(l.add(t),I(t)?(s=[],K(t,t=>{s.push(e(t))})):(s={},J(t,(t,i)=>{l.has(t)||(s[i]=e(t,i))}
1)),s)}(n)).timestamp=u,C(null==i?void 0:i.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=c);var g=W({},d.properties.$set,d.$set);if(M(g)||this.setPersonPropertiesForFlags(g),!L(this.config.before_send)){var _=this.ks(d);if(!_)return;d=_}this.os.emit("eventCaptured",d);var v={method:"POST",url:null!==(s=null==i?void 0:i._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,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.fs(v):this.cs.enqueue(v),d}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")}De(e){return this.on("eventCaptured",t=>e(t.event,t))}Ai(e,t,i,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var n,o=this.persistence.remove_event_timer(e),a=W({},t);if(a.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=W({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!O(a.distinct_id)&&!D(a.distinct_id)||T(a.distinct_id))&&B.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,d=function(e,t){if(!_)return{};var i,s,n=e?Z([],rw,t||[]):[],[o,a]=function(e){for(var t=0;t<rm.length;t++){var[i,s]=rm[t],r=i.exec(e),n=r&&(P(s)?s(r,e):s);if(n)return n}return["",""]}(_);return X(ei({$os:o,$os_version:a,$browser:r_(_,navigator.vendor),$device:ry(_),$device_type:(s=ry(_))===sq||s===sN||"Kobo"===s||"Kindle Fire"===s||s===rn?sD:s===s5||s===s8||s===s6||s===ri?"Console":s===sH?"Wearable":s?sA:"Desktop",$timezone:rM(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:tu(null==h?void 0:h.href,n,rE),$host:null==h?void 0:h.host,$pathname:null==h?void 0:h.pathname,$raw_user_agent:_.length>1e3?_.substring(0,997)+"...":_,$browser_version:rf(_,navigator.vendor),$browser_language:rF(),$browser_language_prefix:"string"==typeof(i=rF())?i.split("-")[0]:void 0,$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHeight,$viewport_width:null==r?void 0:r.innerWidth,$lib:"web",$lib_version:f.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:p,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId();a.$session_id=p,a.$window_id=g}this.sessionPropsManager&&X(a,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&X(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(n=this.ps)?void 0:n.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nl.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c="$pageview"===e?this.pageViewManager.doPageView(i,s):"$pageleave"===e?this.pageViewManager.doPageLeave(i):this.pageViewManager.doEvent(),a=X(a,c),"$pageview"===e&&u&&(a.title=u.title),!C(o)){var v=i.getTime()-o;a.$duration=parseFloat((v/1e3).toFixed(3))}_&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=X({},d,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),I(this.config.property_denylist)?J(this.config.property_denylist,function(e){delete a[e]}):B.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(B.error("sanitize_properties is deprecated. Use before_send instead"),a=m(a,e));var y=this.xs();return a.$process_person_profile=y,y&&this.Es("_calculate_event_properties"),a}$s(e){if(!this.persistence||!this.xs()||this.ns)return e;var t,i=X({},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.ns=!0,M(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)}Is(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.os.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return B.uninitializedWarning("posthog.identify");if(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(this.Es("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(ea)&&(this.unregister(ea),this.register({distinct_id:e}));var r="anonymous"===(this.persistence.get_property(eA)||"anonymous");e!==s&&r?(this.persistence.set_property(eA,"identified"),this.setPersonPropertiesForFlags(W({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.ds=nd(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(eT))}}else B.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Es("posthog.setPersonProperties")){var i=nd(this.get_distinct_id(),e,t);this.ds!==i?(this.setPersonPropertiesForFlags(W({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.ds=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.Es("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:W({},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.Es("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(),null==(s=this.persistence)||s.set_property(eA,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.ds=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:ez,$device_id:null},"");else{var o=this.config.get_device_id(tk());this.register_once({distinct_id:o,$device_id:e?o:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(eo)?(B.critical("Attempting to create alias for existing People user - aborting."),-2):this.Es("posthog.alias")?(C(t)&&(t=this.get_distinct_id()),e!==t?(this.Is(ea,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,i,s,r,n=W({},this.config);R(e)&&(X(this.config,nk(e)),null==(t=this.persistence)||t.update_config(this.config,n),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rz(W({},this.config,{persistence:"sessionStorage"})),tI.O()&&"true"===tI.A("ph_debug")&&(this.config.debug=!0),this.config.debug&&(f.DEBUG=!0,B.info("set_config",JSON.stringify({config:e,oldConfig:n,newConfig:W({},this.config)},null,2))),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(r=this.heatmaps)||r.startIfEnabled(),this.surveys.loadIfEnabled(),this.gs())}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");this.exceptions.sendExceptionEvent(W({},function(e,t){var{error:i,event:s}=e,r={$exception_list:[]},n=i||s;if(tW(n)||tG(n,"DOMException")){if("stack"in n)r=t7(n,t);else{var o=n.name||(tW(n)?"DOMError":"DOMException"),a=n.message?o+": "+n.message:o;r=t9(a,W({},t,{overrideExceptionType:tW(n)?"DOMError":"DOMException",defaultExceptionMessage:a}))}return"code"in n&&(r.$exception_DOMException_code=""+n.code),r}if(tG(n,"ErrorEvent")&&n.error)return t7(n.error,t);if(tU(n))return t7(n,t);if(tG(n,"Object")||tB(n))return function(e,t){var i,s,r,n=null===(s=null==t?void 0:t.handled)||void 0===s||s,o=null===(r=null==t?void 0:t.synthetic)||void 0===r||r,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:tB(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=t8(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)&&!T(i)&&b.indexOf(i)>=0?e.level:"error"}}(n,t);if(C(i)&&O(s)){var l="Error",c=s,u=s.match(t6);return u&&(l=u[1],c=u[2]),t9(c,W({},t,{overrideExceptionType:l,defaultExceptionMessage:c}))}return t9(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)&&void 0!==e?e:ny;return t!==ny&&(t=ny+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(eA))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(eA))}xs(){var e,t,i,s;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&M(this.getGroups())&&(null==(e=this.persistence)||null==(t=e.props)||!t[ea])&&(null==(i=this.persistence)||null==(s=i.props)||!s[eH]))}Ss(){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.xs()||this.Es("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Es(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.Is(eH,!0),!0)}gs(){var e,t,i,s,r=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default,o=this.config.disable_persistence||r&&!!n;(null==(e=this.persistence)?void 0:e.$e)!==o&&(null==(i=this.persistence)||i.set_disabled(o)),(null==(t=this.sessionPersistence)?void 0:t.$e)!==o&&(null==(s=this.sessionPersistence)||s.set_disabled(o))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.gs(),(C(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.ys()}opt_out_capturing(){this.consent.optInOut(!1),this.gs()}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.gs()}_is_bot(){return c?nh(c,this.config.custom_blocked_useragents):void 0}ys(){u&&("visible"===u.visibilityState?this.ls||(this.ls=!0,this.capture("$pageview",{title:u.title},{send_instantly:!0}),this.hs&&(u.removeEventListener("visibilitychange",this.hs),this.hs=null)):this.hs||(this.hs=this.ys.bind(this),en(u,"visibilitychange",this.hs)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==r||r.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}))}ks(e){if(L(this.config.before_send))return e;var t=I(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 j(e.event)?B.warn(r+". This can cause unexpected behavior."):B.info(r),null}i.properties&&!M(i.properties)||B.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.ne)?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]]=et(e.prototype[t[i]])}(nx,["identify"]),function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}(nS||(nS={})),function(e){e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}(n$||(n$={})),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(nF||(nF={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(nI||(nI={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(nP||(nP={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(nR||(nR={}));var nS,n$,nF,nI,nP,nR,nM,nC=(nM=nf[ny]=new nx,function(){function e(){e.done||(e.done=!0,nb=!1,J(nf,function(e){e._dom_loaded()}))}null!=u&&u.addEventListener?"complete"===u.readyState?e():en(u,"DOMContentLoaded",e,{capture:!1}):r&&B.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),nM)}}]);

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.