import{a as us}from"/_feather/build/_shared/chunk-OMWS35UX.js";import{a as si}from"/_feather/build/_shared/chunk-7GEREZ56.js";import{b as as,z as ri}from"/_feather/build/_shared/chunk-YBOC6XNN.js";import{d as Et}from"/_feather/build/_shared/chunk-6FRSWQKX.js";var ot=function(e){window.__fathomClientQueue=window.__fathomClientQueue||[],window.__fathomClientQueue.push(e)},ls=function(){window.__fathomClientQueue=window.__fathomClientQueue||[],window.__fathomClientQueue.forEach(function(e){switch(e.type){case"trackPageview":cs(e.opts);return;case"trackGoal":ds(e.code,e.cents);return;case"enableTrackingForMe":fs();return;case"blockTrackingForMe":hs();return;case"setSite":ps(e.id);return}}),window.__fathomClientQueue=[]},oi=function(e){var t=/(https?)(?=:|\/|$)/;e.forEach(function(i){t.exec(i)!==null&&console.warn("The include domain ".concat(i," might fail to work as intended as it begins with a transfer protocol (http://, https://). Consider removing the protocol portion of the string."))})},ai=function(e,t){var i=document.createElement("script"),r=document.getElementsByTagName("script")[0]||document.querySelector("body");i.id="fathom-script",i.async=!0,i.setAttribute("data-site",e),i.src=t&&t.url?t.url:"https://cdn.usefathom.com/script.js",t&&(t.auto!==void 0&&i.setAttribute("data-auto","".concat(t.auto)),t.honorDNT!==void 0&&i.setAttribute("data-honor-dnt","".concat(t.honorDNT)),t.canonical!==void 0&&i.setAttribute("data-canonical","".concat(t.canonical)),t.includedDomains&&(oi(t.includedDomains),i.setAttribute("data-included-domains",t.includedDomains.join(","))),t.excludedDomains&&(oi(t.excludedDomains),i.setAttribute("data-excluded-domains",t.excludedDomains.join(","))),t.spa&&i.setAttribute("data-spa",t.spa)),i.onload=ls,r.parentNode.insertBefore(i,r)},cs=function(e){window.fathom?e?window.fathom.trackPageview(e):window.fathom.trackPageview():ot({type:"trackPageview",opts:e})},ds=function(e,t){window.fathom?window.fathom.trackGoal(e,t):ot({type:"trackGoal",code:e,cents:t})},hs=function(){window.fathom?window.fathom.blockTrackingForMe():ot({type:"blockTrackingForMe"})},fs=function(){window.fathom?window.fathom.enableTrackingForMe():ot({type:"enableTrackingForMe"})};var ps=function(e){window.fathom?window.fathom.setSite(e):ot({type:"setSite",id:e})};function ui(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function b(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ui(Object(t),!0).forEach(function(i){v(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ui(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function yt(n){return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(n)}function x(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function li(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function C(n,e,t){return e&&li(n.prototype,e),t&&li(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function v(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _s(n,e){if(n==null)return{};var t,i,r=function(o,a){if(o==null)return{};var u,c,d={},l=Object.keys(o);for(c=0;c<l.length;c++)u=l[c],a.indexOf(u)>=0||(d[u]=o[u]);return d}(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Y(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,i){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,o,a=[],u=!0,c=!1;try{for(r=r.call(t);!(u=(s=r.next()).done)&&(a.push(s.value),!i||a.length!==i);u=!0);}catch(d){c=!0,o=d}finally{try{u||r.return==null||r.return()}finally{if(c)throw o}}return a}}(n,e)||Un(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function je(n){return function(e){if(Array.isArray(e))return pn(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||Un(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Un(n,e){if(n){if(typeof n=="string")return pn(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?pn(n,e):void 0}}function pn(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function he(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Un(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(u){throw u},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var u=t.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}var ve={DEBUG:!1,LIB_VERSION:"1.143.0"},vs=Array.isArray,sr=Object.prototype,or=sr.hasOwnProperty,Jt=sr.toString,H=vs||function(n){return Jt.call(n)==="[object Array]"},ce=function(n){return typeof n=="function"},X=function(n){return n===Object(n)&&!H(n)},en=function(n){if(X(n)){for(var e in n)if(or.call(n,e))return!1;return!0}return!1},S=function(n){return n===void 0},z=function(n){return Jt.call(n)=="[object String]"},ci=function(n){return z(n)&&n.trim().length===0},Re=function(n){return n===null},de=function(n){return S(n)||Re(n)},ue=function(n){return Jt.call(n)=="[object Number]"},Je=function(n){return Jt.call(n)==="[object Boolean]"},gs=function(n){return n instanceof FormData},p=typeof window<"u"?window:void 0,ee=typeof globalThis<"u"?globalThis:p,ar=Array.prototype,di=ar.forEach,hi=ar.indexOf,Ee=ee?.navigator,w=ee?.document,Z=ee?.location,_n=ee?.fetch,vn=ee!=null&&ee.XMLHttpRequest&&"withCredentials"in new ee.XMLHttpRequest?ee.XMLHttpRequest:void 0,fi=ee?.AbortController,N=Ee?.userAgent,q=p??{},pi="[PostHog.js]",m={_log:function(n){if(p&&(ve.DEBUG||q.POSTHOG_DEBUG)&&!S(p.console)&&p.console){for(var e=("__rrweb_original__"in p.console[n])?p.console[n].__rrweb_original__:p.console[n],t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.apply(void 0,[pi].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];m._log.apply(m,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];m._log.apply(m,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];m._log.apply(m,["error"].concat(e))},critical:function(){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];(n=console).error.apply(n,[pi].concat(t))},uninitializedWarning:function(n){m.error("You must initialize PostHog before calling ".concat(n))}},Nt={},Xt=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Ze(n,e,t){if(H(n)){if(di&&n.forEach===di)n.forEach(e,t);else if("length"in n&&n.length===+n.length){for(var i=0,r=n.length;i<r;i++)if(i in n&&e.call(t,n[i],i)===Nt)return}}}function T(n,e,t){if(!de(n)){if(H(n))return Ze(n,e,t);if(gs(n)){var i,r=he(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===Nt)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(or.call(n,o)&&e.call(t,n[o],o)===Nt)return}}var J=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Ze(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function I(n,e){return n.indexOf(e)!==-1}function Ot(n){for(var e=Object.keys(n),t=e.length,i=new Array(t);t--;)i[t]=[e[t],n[e[t]]];return i}var ur=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},_i=function(n){try{return n()}catch{return}},ms=function(n){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.apply(this,t)}catch(r){m.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),m.critical(r)}}},gn=function(n){var e={};return T(n,function(t,i){z(t)&&t.length>0&&(e[i]=t)}),e},mn=function(n){return n.replace(/^\$/,"")};function ys(n,e){return t=n,i=function(s){return z(s)&&!Re(e)?s.slice(0,e):s},r=new Set,function s(o,a){return o!==Object(o)?i?i(o,a):o:r.has(o)?void 0:(r.add(o),H(o)?(u=[],Ze(o,function(c){u.push(s(c))})):(u={},T(o,function(c,d){r.has(c)||(u[d]=s(c,d))})),u);var u}(t);var t,i,r}var le,bs=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`)).length,r=0;r<i;r++){var o=n.charCodeAt(r),a=null;o<128?t++: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),Re(a)||(t>e&&(s+=n.substring(e,t)),s+=a,e=t=r+1)}return t>e&&(s+=n.substring(e,n.length)),s},Se=function(){function n(e){return e&&(e.preventDefault=n.preventDefault,e.stopPropagation=n.stopPropagation),e}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,r,s){if(e)if(e.addEventListener&&!r)e.addEventListener(t,i,!!s);else{var o="on"+t,a=e[o];e[o]=function(u,c,d){return function(l){if(l=l||n(p?.event)){var f,h=!0;ce(d)&&(f=d(l));var g=c.call(u,l);return f!==!1&&g!==!1||(h=!1),h}}}(e,i,a)}else m.error("No valid element provided to register_event")}}();function lr(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return n[t]}(function(n){n.GZipJS="gzip-js",n.Base64="base64"})(le||(le={}));var cr="$people_distinct_id",dt="__alias",ht="__timers",vi="$autocapture_disabled_server_side",yn="$heatmaps_enabled_server_side",gi="$exception_capture_enabled_server_side",mi="$web_vitals_enabled_server_side",bn="$session_recording_enabled_server_side",yi="$console_log_recording_enabled_server_side",bi="$session_recording_network_payload_capture",ki="$session_recording_canvas_recording",wi="$replay_sample_rate",Si="$replay_minimum_duration",Lt="$sesid",pt="$session_is_sampled",Xe="$enabled_feature_flags",kn="$early_access_features",Ke="$stored_person_properties",$e="$stored_group_properties",wn="$surveys",tn="$surveys_activated",qt="$flag_call_reported",ke="$user_state",Sn="$client_session_props",En="$capture_rate_limit",Fn="$initial_campaign_params",Rn="$initial_referrer_info",Ei="$initial_person_info",Bt="$epp",In="__POSTHOG_TOOLBAR__",ks=[cr,dt,"__cmpns",ht,bn,yn,Lt,Xe,ke,kn,$e,Ke,wn,qt,Sn,En,Fn,Rn,Bt],nn="$active_feature_flags",Ft="$override_feature_flags",Fi="$feature_flag_payloads",Ri=function(n){var e,t={},i=he(Ot(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Y(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},ws=function(){function n(e){x(this,n),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return C(n,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Xe),t=this.instance.get_property(Ft);if(!t)return e||{};for(var i=J({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(m.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Fi)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,i=this.instance.get_property(Ke),r=this.instance.get_property($e),s={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:s,compression:this.instance.config.disable_compression?void 0:le.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(o){var a;e.setReloadingPaused(!1);var u=!0;o.statusCode===200&&(e.$anon_distinct_id=void 0,u=!1),e.receivedFeatureFlags((a=o.json)!==null&&a!==void 0?a:{},u),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,r=this.getFlagVariants()[e],s="".concat(r),o=this.instance.get_property(qt)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(H(o[e])?o[e].push(s):o[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(v({},qt,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}m.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);m.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads();(function(s,o){var a,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},d=s.featureFlags,l=s.featureFlagPayloads;if(d)if(H(d)){var f,h={};if(d)for(var g=0;g<d.length;g++)h[d[g]]=!0;o&&o.register((v(f={},nn,d),v(f,Xe,h),f))}else{var _=d,y=l;s.errorsWhileComputingFlags&&(_=b(b({},u),_),y=b(b({},c),y)),o&&o.register((v(a={},nn,Object.keys(Ri(_))),v(a,Xe,_||{}),v(a,Fi,y||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return m.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(Ft);else if(H(e)){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;this.instance.persistence.register(v({},Ft,t))}else this.instance.persistence.register(v({},Ft,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),r=i.flags,s=i.flagVariants;e(r,s)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var i,r,s=v({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=b(b({},this.getFlagVariants()),{},v({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((v(r={},nn,Object.keys(Ri(o))),v(r,Xe,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(kn);if(r&&!i)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(s){var o;if(s.json){var a=s.json.earlyAccessFeatures;return(o=t.instance.persistence)===null||o===void 0||o.register(v({},kn,a)),e(a)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(i){return t[i]}),flagVariants:Object.keys(t).filter(function(i){return t[i]}).reduce(function(i,r){return i[r]=t[r],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),i=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(s){return s(i,r,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Ke)||{};this.instance.register(v({},Ke,b(b({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Ke)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property($e)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=b(b({},i[r]),e[r]),delete e[r]}),this.instance.register(v({},$e,b(b({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property($e)||{};this.instance.register(v({},$e,b(b({},t),{},v({},e,{}))))}else this.instance.unregister($e)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return ue(n)&&isFinite(n)&&Math.floor(n)===n});var Ii="0123456789abcdef",Ss=function(){function n(e){if(x(this,n),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return C(n,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Ii.charAt(this.bytes[t]>>>4)+Ii.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new n(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new n(s)}}]),n}(),Es=function(){function n(){x(this,n),v(this,"timestamp",0),v(this,"counter",0),v(this,"random",new Fs)}return C(n,[{key:"generate",value:function(){var e=this.generateOrAbort();if(S(e)){this.timestamp=0;var t=this.generateOrAbort();if(S(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Ss.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),n}(),dr=function(n){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<n.length;e++)n[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return n};p&&!S(p.crypto)&&crypto.getRandomValues&&(dr=function(n){return crypto.getRandomValues(n)});var Pi,Fs=function(){function n(){x(this,n),v(this,"buffer",new Uint32Array(8)),v(this,"cursor",1/0)}return C(n,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(dr(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),Me=function(){return Rs().toString()},Rs=function(){return(Pi||(Pi=new Es)).generate()},Is="Thu, 01 Jan 1970 00:00:00 GMT",at="",Ps=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function xs(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;if(at)return at;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),u="dmn_chk_"+Me(),c=new RegExp("(^|;)\\s*"+u+"=1");!at&&a--;){var d=o.slice(a).join("."),l=u+"=1;domain=."+d;s.cookie=l,c.test(s.cookie)&&(s.cookie=l+";expires="+Is,at=d)}return at}(n);if(!t){var i=function(r){var s=r.match(Ps);return s?s[0]:""}(n);i!==t&&m.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var W,Fe={is_supported:function(){return!!w},error:function(n){m.error("cookieStore error: "+n)},get:function(n){if(w){try{for(var e=n+"=",t=w.cookie.split(";").filter(function(s){return s.length}),i=0;i<t.length;i++){for(var r=t[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},parse:function(n){var e;try{e=JSON.parse(Fe.get(n))||{}}catch{}return e},set:function(n,e,t,i,r){if(w)try{var s="",o="",a=xs(w.location.hostname,i);if(t){var u=new Date;u.setTime(u.getTime()+24*t*60*60*1e3),s="; expires="+u.toUTCString()}r&&(o="; secure");var c=n+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&m.warn("cookieStore warning: large cookie, len="+c.length),w.cookie=c,c}catch{return}},remove:function(n,e){try{Fe.set(n,"",-1,e)}catch{return}}},rn=null,B={is_supported:function(){if(!Re(rn))return rn;var n=!0;if(S(p))n=!1;else try{var e="__mplssupport__";B.set(e,"xyz"),B.get(e)!=='"xyz"'&&(n=!1),B.remove(e)}catch{n=!1}return n||m.error("localStorage unsupported; falling back to cookie store"),rn=n,n},error:function(n){m.error("localStorage error: "+n)},get:function(n){try{return p?.localStorage.getItem(n)}catch(e){B.error(e)}return null},parse:function(n){try{return JSON.parse(B.get(n))||{}}catch{}return null},set:function(n,e){try{p?.localStorage.setItem(n,JSON.stringify(e))}catch(t){B.error(t)}},remove:function(n){try{p?.localStorage.removeItem(n)}catch(e){B.error(e)}}},Cs=["distinct_id",Lt,pt,Bt],Rt=b(b({},B),{},{parse:function(n){try{var e={};try{e=Fe.parse(n)||{}}catch{}var t=J(e,JSON.parse(B.get(n)||"{}"));return B.set(n,t),t}catch{}return null},set:function(n,e,t,i,r){try{B.set(n,e);var s={};Cs.forEach(function(o){e[o]&&(s[o]=e[o])}),Object.keys(s).length&&Fe.set(n,s,t,i,r)}catch(o){B.error(o)}},remove:function(n,e){try{p?.localStorage.removeItem(n),Fe.remove(n,e)}catch(t){B.error(t)}}}),It={},Ts={is_supported:function(){return!0},error:function(n){m.error("memoryStorage error: "+n)},get:function(n){return It[n]||null},parse:function(n){return It[n]||null},set:function(n,e){It[n]=e},remove:function(n){delete It[n]}},Be=null,G={is_supported:function(){if(!Re(Be))return Be;if(Be=!0,S(p))Be=!1;else try{var n="__support__";G.set(n,"xyz"),G.get(n)!=='"xyz"'&&(Be=!1),G.remove(n)}catch{Be=!1}return Be},error:function(n){m.error("sessionStorage error: ",n)},get:function(n){try{return p?.sessionStorage.getItem(n)}catch(e){G.error(e)}return null},parse:function(n){try{return JSON.parse(G.get(n))||null}catch{}return null},set:function(n,e){try{p?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){G.error(t)}},remove:function(n){try{p?.sessionStorage.removeItem(n)}catch(e){G.error(e)}}},$s=["localhost","127.0.0.1"],_t=function(n){var e=w?.createElement("a");return S(e)?null:(e.href=n,e)},xi=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},Os=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return T(n,function(s,o){S(s)||S(o)||o==="undefined"||(e=encodeURIComponent(function(a){return a instanceof File}(s)?s.name:s.toString()),t=encodeURIComponent(o),r[r.length]=t+"="+e)}),r.join(i)},Ci=function(n,e){for(var t,i=((n.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===e){t=s;break}}if(!H(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{m.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ht=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},oe="Mobile",Ut="iOS",ge="Android",bt="Tablet",hr=ge+" "+bt,fr="iPad",pr="Apple",_r=pr+" Watch",kt="Safari",it="BlackBerry",vr="Samsung",gr=vr+"Browser",mr=vr+" Internet",Ae="Chrome",Ms=Ae+" OS",yr=Ae+" "+Ut,jn="Internet Explorer",br=jn+" "+oe,Wn="Opera",Ds=Wn+" Mini",Gn="Edge",kr="Microsoft "+Gn,et="Firefox",wr=et+" "+Ut,wt="Nintendo",St="PlayStation",tt="Xbox",Sr=ge+" "+oe,Er=oe+" "+kt,ft="Windows",Pn=ft+" Phone",Ti="Nokia",xn="Ouya",Fr="Generic",As=Fr+" "+oe.toLowerCase(),Rr=Fr+" "+bt.toLowerCase(),Cn="Konqueror",Q="(\\d+(\\.\\d+)?)",sn=new RegExp("Version/"+Q),Ns=new RegExp(tt,"i"),Ls=new RegExp(St+" \\w+","i"),qs=new RegExp(wt+" \\w+","i"),zn=new RegExp(it+"|PlayBook|BB10","i"),Bs={"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"},Hs=function(n,e){return e&&I(e,pr)||function(t){return I(t,kt)&&!I(t,Ae)&&!I(t,ge)}(n)},$i=function(n,e){return e=e||"",I(n," OPR/")&&I(n,"Mini")?Ds:I(n," OPR/")?Wn:zn.test(n)?it:I(n,"IE"+oe)||I(n,"WPDesktop")?br:I(n,gr)?mr:I(n,Gn)||I(n,"Edg/")?kr:I(n,"FBIOS")?"Facebook "+oe:I(n,"UCWEB")||I(n,"UCBrowser")?"UC Browser":I(n,"CriOS")?yr:I(n,"CrMo")?Ae:I(n,ge)&&I(n,kt)?Sr:I(n,Ae)?Ae:I(n,"FxiOS")?wr:I(n.toLowerCase(),Cn.toLowerCase())?Cn:Hs(n,e)?I(n,oe)?Er:kt:I(n,et)?et:I(n,"MSIE")||I(n,"Trident/")?jn:I(n,"Gecko")?et:""},Us=(v(W={},br,[new RegExp("rv:"+Q)]),v(W,kr,[new RegExp(Gn+"?\\/"+Q)]),v(W,Ae,[new RegExp("("+Ae+"|CrMo)\\/"+Q)]),v(W,yr,[new RegExp("CriOS\\/"+Q)]),v(W,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Q)]),v(W,kt,[sn]),v(W,Er,[sn]),v(W,Wn,[new RegExp("(Opera|OPR)\\/"+Q)]),v(W,et,[new RegExp(et+"\\/"+Q)]),v(W,wr,[new RegExp("FxiOS\\/"+Q)]),v(W,Cn,[new RegExp("Konqueror[:/]?"+Q,"i")]),v(W,it,[new RegExp(it+" "+Q),sn]),v(W,Sr,[new RegExp("android\\s"+Q,"i")]),v(W,mr,[new RegExp(gr+"\\/"+Q)]),v(W,jn,[new RegExp("(rv:|MSIE )"+Q)]),v(W,"Mozilla",[new RegExp("rv:"+Q)]),W),Oi=[[new RegExp(tt+"; "+tt+" (.*?)[);]","i"),function(n){return[tt,n&&n[1]||""]}],[new RegExp(wt,"i"),[wt,""]],[new RegExp(St,"i"),[St,""]],[zn,[it,""]],[new RegExp(ft,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[Pn,""];if(new RegExp(oe).test(e)&&!/IEMobile\b/.test(e))return[ft+" "+oe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=Bs[i]||"";return/arm/i.test(e)&&(r="RT"),[ft,r]}return[ft,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[Ut,e.join(".")]}return[Ut,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=S(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+ge+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ge+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[ge,e.join(".")]}return[ge,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(n){var e=["Mac OS X",""];if(n&&n[1]){var t=[n[1],n[2],n[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ms,""]],[/Linux|debian/i,["Linux",""]]],Mi=function(n){return qs.test(n)?wt:Ls.test(n)?St:Ns.test(n)?tt:new RegExp(xn,"i").test(n)?xn:new RegExp("("+Pn+"|WPDesktop)","i").test(n)?Pn:/iPad/.test(n)?fr:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?_r:zn.test(n)?it:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(Ti,"i").test(n)?Ti:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(n)||/(kf[a-z]+)( bui|\)).+silk\//i.test(n)?"Kindle Fire":/(Android|ZTE)/i.test(n)?!new RegExp(oe).test(n)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(n)?/pixel[\daxl ]{1,6}/i.test(n)&&!/pixel c/i.test(n)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(n)||/lmy47v/i.test(n)&&!/QTAQZ3/i.test(n)?ge:hr:ge:new RegExp("(pda|"+oe+")","i").test(n)?As:new RegExp(bt,"i").test(n)&&!new RegExp(bt+" pc","i").test(n)?Rr:""},Pt="https?://(.*)",js=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"],U={campaignParams:function(n){return w?this._campaignParamsFromUrl(w.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=js.concat(e||[]),i={};return T(t,function(r){var s=Ci(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(Pt+"google.([^/?]*)")===0?"google":n.search(Pt+"bing.com")===0?"bing":n.search(Pt+"yahoo.com")===0?"yahoo":n.search(Pt+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=U._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!Re(e)){i.$search_engine=e;var r=w?Ci(w.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=w?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:$i,browserVersion:function(n,e){var t=$i(n,e),i=Us[t];if(S(i))return null;for(var r=0;r<i.length;r++){var s=i[r],o=n.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(n){for(var e=0;e<Oi.length;e++){var t=Y(Oi[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(ce(r)?r(s,n):r);if(o)return o}return["",""]},device:Mi,deviceType:function(n){var e=Mi(n);return e===fr||e===hr||e==="Kobo"||e==="Kindle Fire"||e===Rr?bt:e===wt||e===tt||e===St||e===xn?"Console":e===_r?"Wearable":e?oe:"Desktop"},referrer:function(){return w?.referrer||"$direct"},referringDomain:function(){var n;return w!=null&&w.referrer&&((n=_t(w.referrer))===null||n===void 0?void 0:n.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:Z?.href}},initialPersonPropsFromInfo:function(n){var e,t=n.r,i=n.u,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=_t(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=_t(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,T(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+mn(a)]=o})}return t&&T(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+mn(a)]=o}),r},properties:function(){if(!N)return{};var n=Y(U.os(N),2),e=n[0],t=n[1];return J(gn({$os:e,$os_version:t,$browser:U.browser(N,navigator.vendor),$device:U.device(N),$device_type:U.deviceType(N)}),{$current_url:Z?.href,$host:Z?.host,$pathname:Z?.pathname,$raw_user_agent:N.length>1e3?N.substring(0,997)+"...":N,$browser_version:U.browserVersion(N,navigator.vendor),$browser_language:U.browserLanguage(),$screen_height:p?.screen.height,$screen_width:p?.screen.width,$viewport_height:p?.innerHeight,$viewport_width:p?.innerWidth,$lib:"web",$lib_version:ve.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:ur()/1e3})},people_properties:function(){if(!N)return{};var n=Y(U.os(N),2),e=n[0],t=n[1];return J(gn({$os:e,$os_version:t,$browser:U.browser(N,navigator.vendor)}),{$browser_version:U.browserVersion(N,navigator.vendor)})}},Ws=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],on=function(){function n(e){x(this,n),this.config=e,this.props={},this.campaign_params_saved=!1,this.name=function(t){var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"}(e),this.storage=this.buildStorage(e),this.load(),this.update_config(e,e),this.save()}return C(n,[{key:"buildStorage",value:function(e){Ws.indexOf(e.persistence.toLowerCase())===-1&&(m.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&B.is_supported()?B:t==="localstorage+cookie"&&Rt.is_supported()?Rt:t==="sessionstorage"&&G.is_supported()?G:t==="memory"?Ts:t==="cookie"?Fe:Rt.is_supported()?Rt:Fe}},{key:"properties",value:function(){var e={};return T(this.props,function(t,i){if(i===Xe&&X(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/".concat(r[s])]=t[r[s]];else a=i,u=!1,(Re(o=ks)?u:hi&&o.indexOf===hi?o.indexOf(a)!=-1:(T(o,function(c){if(u||(u=c===a))return Nt}),u))||(e[i]=t);var o,a,u}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=J({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,i){var r=this;if(X(e)){S(t)&&(t="None"),this.expire_days=S(i)?this.default_expiry:i;var s=!1;if(T(e,function(o,a){r.props.hasOwnProperty(a)&&r.props[a]!==t||(r.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var i=this;if(X(e)){this.expire_days=S(t)?this.default_expiry:t;var r=!1;if(T(e,function(s,o){e.hasOwnProperty(o)&&i.props[o]!==s&&(i.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(U.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(U.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(U.referrerInfo())}},{key:"set_initial_person_info",value:function(){this.props[Fn]||this.props[Rn]||this.register_once(v({},Ei,U.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return gn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};T([Rn,Fn],function(s){var o=e.props[s];o&&T(o,function(a,u){t["$initial_"+mn(u)]=a})});var i=this.props[Ei];if(i){var r=U.initialPersonPropsFromInfo(i);J(t,r)}return t}},{key:"safe_merge",value:function(e){return T(this.props,function(t,i){i in e||(e[i]=t)}),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=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.buildStorage(e),r=this.props;this.clear(),this.storage=i,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var i=this.props[ht]||{};i[e]=t,this.props[ht]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ht]||{})[e];return S(t)||(delete this.props[ht][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),n}(),Gs=2,zs=4,Mt=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(Mt||{}),be=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(be||{});function Vn(n){return n?Xt(n).split(/\s+/):[]}function jt(n){var e="";switch(yt(n.className)){case"string":e=n.className;break;case"object":e=("baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return Vn(e)}function Ir(n){return de(n)?null:Xt(n).split(/(\s+)/).filter(function(e){return nt(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Wt(n){var e="";return $n(n)&&!Tr(n)&&n.childNodes&&n.childNodes.length&&T(n.childNodes,function(t){var i;Pr(t)&&t.textContent&&(e+=(i=Ir(t.textContent))!==null&&i!==void 0?i:"")}),Xt(e)}function Qn(n){return!!n&&n.nodeType===1}function Ne(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function Pr(n){return!!n&&n.nodeType===3}function xr(n){return!!n&&n.nodeType===11}var Tn=["a","button","form","input","select","textarea","label"];function Cr(n){var e=n.parentNode;return!(!e||!Qn(e))&&e}function Vs(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!p||!n||Ne(n,"html")||!Qn(n))return!1;if(t!=null&&t.url_allowlist){var s=p.location.href,o=t.url_allowlist;if(o&&!o.some(function(_){return s.match(_)}))return!1}if(t!=null&&t.dom_event_allowlist){var a=t.dom_event_allowlist;if(a&&!a.some(function(_){return e.type===_}))return!1}for(var u=!1,c=[n],d=!0,l=n;l.parentNode&&!Ne(l,"body");)if(xr(l.parentNode))c.push(l.parentNode.host),l=l.parentNode.host;else{if(!(d=Cr(l)))break;if(i||Tn.indexOf(d.tagName.toLowerCase())>-1)u=!0;else{var f=p.getComputedStyle(d);f&&f.getPropertyValue("cursor")==="pointer"&&(u=!0)}c.push(d),l=d}if(!function(_,y){var k=y?.element_allowlist;if(S(k))return!0;var E,R=he(_);try{var O=function(){var M=E.value;if(k.some(function(A){return M.tagName.toLowerCase()===A}))return{v:!0}};for(R.s();!(E=R.n()).done;){var P=O();if(yt(P)==="object")return P.v}}catch(M){R.e(M)}finally{R.f()}return!1}(c,t)||!function(_,y){var k=y?.css_selector_allowlist;if(S(k))return!0;var E,R=he(_);try{var O=function(){var M=E.value;if(k.some(function(A){return M.matches(A)}))return{v:!0}};for(R.s();!(E=R.n()).done;){var P=O();if(yt(P)==="object")return P.v}}catch(M){R.e(M)}finally{R.f()}return!1}(c,t))return!1;var h=p.getComputedStyle(n);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=n.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Tn.indexOf(g)>-1||n.getAttribute("contenteditable")==="true")}}function $n(n){for(var e=n;e.parentNode&&!Ne(e,"body");e=e.parentNode){var t=jt(e);if(I(t,"ph-sensitive")||I(t,"ph-no-capture"))return!1}if(I(jt(n),"ph-include"))return!0;var i=n.type||"";if(z(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(z(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 Tr(n){return!!(Ne(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||Ne(n,"select")||Ne(n,"textarea")||n.getAttribute("contenteditable")==="true")}var $r="(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})",Qs=new RegExp("^(?:".concat($r,")$")),Ys=new RegExp($r),Or="\\d{3}-?\\d{2}-?\\d{4}",Js=new RegExp("^(".concat(Or,")$")),Xs=new RegExp("(".concat(Or,")"));function nt(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(de(n)||z(n)&&(n=Xt(n),(e?Qs:Ys).test((n||"").replace(/[- ]/g,""))||(e?Js:Xs).test(n)))}function Di(n){var e=Wt(n);return nt(e="".concat(e," ").concat(Mr(n)).trim())?e:""}function Mr(n){var e="";return n&&n.childNodes&&n.childNodes.length&&T(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=Wt(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(Mr(t)).trim())}catch(s){m.error(s)}}),e}function Ks(n){return function(e){var t=e.map(function(i){var r,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class){i.attr_class.sort();var a,u=he(i.attr_class);try{for(u.s();!(a=u.n()).done;){var c=a.value;o+=".".concat(c.replace(/"/g,""))}}catch(f){u.e(f)}finally{u.f()}}var d=b(b(b(b({},i.text?{text:i.text}:{}),{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),l={};return Ot(d).sort(function(f,h){var g=Y(f,1)[0],_=Y(h,1)[0];return g.localeCompare(_)}).forEach(function(f){var h=Y(f,2),g=h[0],_=h[1];return l[Ai(g.toString())]=Ai(_.toString())}),o+=":",o+=Ot(d).map(function(f){var h=Y(f,2),g=h[0],_=h[1];return"".concat(g,'="').concat(_,'"')}).join("")});return t.join(";")}(function(e){return e.map(function(t){var i,r,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:Zs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Ot(t).filter(function(o){return Y(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Y(o,2),u=a[0],c=a[1];return s.attributes[u]=c}),s})}(n))}function Ai(n){return n.replace(/"|\\"/g,'\\"')}function Zs(n){var e=n.attr__class;return e?H(e)?e:Vn(e):void 0}var On="[SessionRecording]",Mn="redacted",an={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(n){return n},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},eo=["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"],to=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],no=["/s/","/e/","/i/"];function Ni(n,e,t,i){if(de(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return z(r)&&(r=parseInt(r)),r>t?On+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function Li(n,e){if(de(n))return n;var t=n;return nt(t,!1)||(t=On+" "+e+" body "+Mn),T(to,function(i){var r,s;(r=t)!==null&&r!==void 0&&r.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=On+" "+e+" body "+Mn+" as might contain: "+i)}),t}var io=function(n,e){var t,i,r,s={payloadSizeLimitBytes:an.payloadSizeLimitBytes,performanceEntryTypeToObserve:je(an.performanceEntryTypeToObserve)},o=n.session_recording.recordHeaders!==!1&&e.recordHeaders,a=n.session_recording.recordBody!==!1&&e.recordBody,u=n.capture_performance!==!1&&e.recordPerformance,c=(t=s,r=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(f){return f!=null&&f.requestBody&&(f.requestBody=Ni(f.requestBody,f.requestHeaders,r,"Request")),f!=null&&f.responseBody&&(f.responseBody=Ni(f.responseBody,f.responseHeaders,r,"Response")),f}),d=function(f){return c(function(_){var y=_t(_.name);if(!(y&&y.pathname&&no.some(function(k){return y.pathname.indexOf(k)===0})))return _}((g=(h=f).requestHeaders,de(g)||T(Object.keys(g??{}),function(_){eo.includes(_.toLowerCase())&&(g[_]=Mn)}),h)));var h,g},l=ce(n.session_recording.maskNetworkRequestFn);return l&&ce(n.session_recording.maskCapturedNetworkRequestFn)&&m.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),l&&(n.session_recording.maskCapturedNetworkRequestFn=function(f){var h=n.session_recording.maskNetworkRequestFn({url:f.name});return b(b({},f),{},{name:h?.url})}),s.maskRequestFn=ce(n.session_recording.maskCapturedNetworkRequestFn)?function(f){var h,g,_,y=d(f);return y&&(h=(g=(_=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(_,y))!==null&&h!==void 0?h:void 0}:function(f){return function(h){if(!S(h))return h.requestBody=Li(h.requestBody,"Request"),h.responseBody=Li(h.responseBody,"Response"),h}(d(f))},b(b(b({},an),s),{},{recordHeaders:o,recordBody:a,recordPerformance:u,recordInitialRequests:u})},ro=C(function n(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};x(this,n),v(this,"bucketSize",100),v(this,"refillRate",10),v(this,"mutationBuckets",{}),v(this,"loggedTracker",{}),v(this,"refillBuckets",function(){Object.keys(r.mutationBuckets).forEach(function(o){r.mutationBuckets[o]=r.mutationBuckets[o]+r.refillRate,r.mutationBuckets[o]>=r.bucketSize&&delete r.mutationBuckets[o]})}),v(this,"getNodeOrRelevantParent",function(o){var a=r.rrweb.mirror.getNode(o);if(a?.nodeName!=="svg"&&a instanceof Element){var u=a.closest("svg");if(u)return[r.rrweb.mirror.getId(u),u]}return[o,a]}),v(this,"numberOfChanges",function(o){var a,u,c,d,l,f,h,g;return((a=(u=o.removes)===null||u===void 0?void 0:u.length)!==null&&a!==void 0?a:0)+((c=(d=o.attributes)===null||d===void 0?void 0:d.length)!==null&&c!==void 0?c:0)+((l=(f=o.texts)===null||f===void 0?void 0:f.length)!==null&&l!==void 0?l:0)+((h=(g=o.adds)===null||g===void 0?void 0:g.length)!==null&&h!==void 0?h:0)}),v(this,"throttleMutations",function(o){if(o.type!==3||o.data.source!==0)return o;var a=o.data,u=r.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(d){var l,f,h,g=Y(r.getNodeOrRelevantParent(d.id),2),_=g[0],y=g[1];return r.mutationBuckets[_]===0?!1:(r.mutationBuckets[_]=(l=r.mutationBuckets[_])!==null&&l!==void 0?l:r.bucketSize,r.mutationBuckets[_]=Math.max(r.mutationBuckets[_]-1,0),r.mutationBuckets[_]===0&&(r.loggedTracker[_]||(r.loggedTracker[_]=!0,(f=(h=r.options).onBlockedNode)===null||f===void 0||f.call(h,_,y))),d)}));var c=r.numberOfChanges(a);return c!==0||u===c?o:void 0}),this.rrweb=e,this.options=s,this.refillRate=(t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){r.refillBuckets()},1e3)}),so=3e5,oo=[be.MouseMove,be.MouseInteraction,be.Scroll,be.ViewportResize,be.Input,be.TouchMove,be.MediaInteraction,be.Drag],qi=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},se="[SessionRecording]";function ao(n){return JSON.stringify(n,(e=[],function(t,i){if(X(i)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(i)?"[Circular]":(e.push(i),i)}return i})).length;var e}var we,uo=function(){function n(e){var t=this;if(x(this,n),v(this,"queuedRRWebEvents",[]),v(this,"isIdle",!1),v(this,"_linkedFlagSeen",!1),v(this,"_lastActivityTimestamp",Date.now()),v(this,"_linkedFlag",null),v(this,"_forceAllowLocalhostNetworkCapture",!1),v(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,p?.addEventListener("beforeunload",function(){t._flushBuffer()}),p?.addEventListener("offline",function(){t._tryAddCustomEvent("browser offline",{})}),p?.addEventListener("online",function(){t._tryAddCustomEvent("browser online",{})}),p?.addEventListener("visibilitychange",function(){if(w!=null&&w.visibilityState){var o="window "+w.visibilityState;t._tryAddCustomEvent(o,{})}}),!this.instance.sessionManager)throw m.error(se+" started without valid sessionManager"),new Error(se+" started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,s=i.windowId;this.sessionId=r,this.windowId=s,this.buffer=this.clearBuffer(),this._setupSampling()}return C(n,[{key:"rrwebRecord",get:function(){var e;return q==null||(e=q.rrweb)===null||e===void 0?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(se+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.full_snapshot_interval_millis)||so}},{key:"isSampled",get:function(){var e=this.instance.get_property(pt);return Je(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,i=(e=this.buffer)===null||e===void 0?void 0:e.data[((t=this.buffer)===null||t===void 0?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(bn),t=!this.instance.config.disable_session_recording;return p&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(yi),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(ki);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,i=this.instance.get_property(bi),r={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordBody},s=r?.recordHeaders||i?.recordHeaders,o=r?.recordBody||i?.recordBody,a=X(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,u=!!(Je(a)?a:i?.capturePerformance);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(wi);return ue(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(Si);return ue(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?de(this._linkedFlag)||this._linkedFlagSeen?Je(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),m.info(se+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,m.info(se+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(ue(r)){var s,o=this.isSampled,a=i||!Je(o);a?s=Math.random()<r:s=o,!s&&a&&m.warn(se+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),(t=this.instance.persistence)===null||t===void 0||t.register(v({},pt,s))}else{var u;(u=this.instance.persistence)===null||u===void 0||u.register(v({},pt,null))}}},{key:"afterDecideResponse",value:function(e){var t,i,r,s=this;if(this._persistDecideResponse(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(i=e.sessionRecording)!==null&&i!==void 0&&i.endpoint&&(this._endpoint=(r=e.sessionRecording)===null||r===void 0?void 0:r.endpoint),this._setupSampling(),!de(this._linkedFlag)){var o=z(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=z(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(u,c){var d=X(c)&&o in c,l=a?c[o]===a:d;if(l){var f={linkedFlag:o,linkedVariant:a},h="linked flag matched";m.info(se+" "+h,f),s._tryAddCustomEvent(h,f)}s._linkedFlagSeen=l})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;ue(this.sampleRate)&&Re(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(t){e.makeSamplingDecision(t)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var t=this.instance.persistence,i=function(){var r,s,o,a,u,c,d,l,f=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate,h=de(f)?null:parseFloat(f),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((v(l={},bn,!!e.sessionRecording),v(l,yi,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),v(l,bi,b({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),v(l,ki,{enabled:(u=e.sessionRecording)===null||u===void 0?void 0:u.recordCanvas,fps:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasFps,quality:(d=e.sessionRecording)===null||d===void 0?void 0:d.canvasQuality}),v(l,wi,h),v(l,Si,S(g)?null:g),l))};i(),this.sessionManager.onSessionId(i)}}},{key:"log",value:function(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:ur()})}},{key:"_startCapture",value:function(){var e=this;S(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(ve.LIB_VERSION),function(t){if(t)return m.error(se+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&oo.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=r.windowId,o=r.sessionId,a=this.sessionId!==o,u=this.windowId!==s;this.windowId=s,this.sessionId=o,(i||[Gs,zs].indexOf(e.type)===-1&&(u||a||S(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):m.warn(se+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(qi(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(qi(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording,s=0,o=Object.entries(r||{});s<o.length;s++){var a=Y(o[s],2),u=a[0],c=a[1];u in i&&(i[u]=c)}if(this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new ro(this.rrwebRecord,{onBlockedNode:function(l,f){var h="Too many mutations on node '".concat(l,"'. Rate limiting. This could be due to SVG animations or something similar");m.info(h,{node:f}),t.log(se+" "+h,"warn")}});var d=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(b({emit:function(l){t.onRRwebEmit(l)},plugins:d},i)),this.instance._addCaptureHook(function(l){try{if(l==="$pageview"){var f=p?t._maskUrl(p.location.href):"";if(!f)return;t._tryAddCustomEvent("$pageview",{href:f}),t._tryTakeFullSnapshot()}}catch(h){m.error("Could not add $pageview to rrweb session",h)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:d.map(function(l){return l?.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else m.error(se+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return q.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(q.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&ce(q.getRecordNetworkPlugin)&&(!$s.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(q.getRecordNetworkPlugin(io(this.instance.config,this.networkPayloadCapture))):m.info(se+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&X(e)){if(e.type===Mt.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Mt.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var u=a;if(u&&X(u)&&u.type===6&&X(u.data)&&u.data.plugin==="rrweb/console@1"){u.data.payload.payload.length>10&&(u.data.payload.payload=u.data.payload.payload.slice(0,10),u.data.payload.payload.push("...[truncated]"));for(var c=[],d=0;d<u.data.payload.payload.length;d++)u.data.payload.payload[d]&&u.data.payload.payload[d].length>2e3?c.push(u.data.payload.payload[d].slice(0,2e3)+"...[truncated]"):c.push(u.data.payload.payload[d]);return u.data.payload.payload=c,a}return a}(i),s=ao(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Mt.Custom){var o={$snapshot_bytes:s,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&p){var e=this._maskUrl(p.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=je(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(i){Date.now()-i.enqueuedAt<=2e3&&e._tryRRWebMethod(i)})}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,r={url:e};return(i=r=t.maskNetworkRequestFn(r))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=ue(i)&&i>=0,s=ue(t)&&r&&i<t;return this.status==="buffering"||s?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,i=this,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),n}(),lo=function(){function n(e){x(this,n),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return C(n,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ke),group_properties:this.instance.get_property($e),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:le.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(i){return e.parseDecideResponse(i.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var i=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},i),i)m.error("Failed to fetch feature flags from PostHog.");else{if(!w||!w.body)return m.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var r,s=he(e.siteApps);try{var o=function(){var a=r.value,u=a.id,c=a.url,d=t.instance.requestRouter.endpointFor("api",c);q["__$$ph_site_app_".concat(u)]=t.instance,t.instance.requestRouter.loadScript(d,function(l){l&&m.error("Error while initializing PostHog app with config id ".concat(u),l)})};for(s.s();!(r=s.n()).done;)o()}catch(a){s.e(a)}finally{s.f()}}else e.siteApps.length>0&&m.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),co=p!=null&&p.location?Ht(p.location.hash,"__posthog")||Ht(location.hash,"state"):null,Bi="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(we||(we={}));var ho=function(){function n(e){x(this,n),this.instance=e}return C(n,[{key:"setToolbarState",value:function(e){q.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=q.ph_toolbar_state)!==null&&e!==void 0?e:we.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!p||!w)return!1;i=(e=i)!==null&&e!==void 0?e:p.location,s=(t=s)!==null&&t!==void 0?t:p.history;try{if(!r){try{p.localStorage.setItem("test","test"),p.localStorage.removeItem("test")}catch{return!1}r=p?.localStorage}var o,a=co||Ht(i.hash,"__posthog")||Ht(i.hash,"state"),u=a?_i(function(){return JSON.parse(atob(decodeURIComponent(a)))})||_i(function(){return JSON.parse(decodeURIComponent(a))}):null;return u&&u.action==="ph_authorize"?((o=u).source="url",o&&Object.keys(o).length>0&&(u.desiredHash?i.hash=u.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(r.getItem(Bi)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(e){(q.ph_load_toolbar||q.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(w==null||!w.getElementById(In));if(!p||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=b(b({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(p.localStorage.setItem(Bi,JSON.stringify(b(b({},s),{},{source:void 0}))),this.getToolbarState()===we.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===we.UNINITIALIZED){this.setToolbarState(we.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(a),function(u){if(u)return m.error("Failed to load toolbar",u),void t.setToolbarState(we.UNINITIALIZED);t.setToolbarState(we.LOADED),t._callLoadToolbar(s)}),Se(p,"turbolinks:load",function(){t.setToolbarState(we.UNINITIALIZED),t.loadToolbar(s)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}}]),n}(),fo=function(){function n(e){x(this,n),v(this,"isPaused",!0),v(this,"queue",[]),v(this,"flushTimeoutMs",3e3),this.sendRequest=e}return C(n,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},i=Object.values(t),r=[].concat(je(i.filter(function(s){return s.url.indexOf("/e")===0})),je(i.filter(function(s){return s.url.indexOf("/e")!==0})));r.map(function(s){e.sendRequest(b(b({},s),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),i=function(s){var o=t[s],a=new Date().getTime();o.data&&H(o.data)&&T(o.data,function(u){u.offset=Math.abs(u.timestamp-a),delete u.timestamp}),e.sendRequest(o)};for(var r in t)i(r)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return T(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;S(e[s])&&(e[s]=b(b({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),ne=Uint8Array,K=Uint16Array,rt=Uint32Array,Yn=new ne([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]),Jn=new ne([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]),Hi=new ne([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dr=function(n,e){for(var t=new K(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new rt(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},Ar=Dr(Yn,2),po=Ar[0],Dn=Ar[1];po[28]=258,Dn[258]=28;for(An=Dr(Jn,0)[1],Gt=new K(32768),$=0;$<32768;++$)Te=(43690&$)>>>1|(21845&$)<<1,Te=(61680&(Te=(52428&Te)>>>2|(13107&Te)<<2))>>>4|(3855&Te)<<4,Gt[$]=((65280&Te)>>>8|(255&Te)<<8)>>>1;var Te,An,Gt,$,vt=function(n,e,t){for(var i=n.length,r=0,s=new K(e);r<i;++r)++s[n[r]-1];var o,a=new K(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new K(1<<e);var u=15-e;for(r=0;r<i;++r)if(n[r])for(var c=r<<4|n[r],d=e-n[r],l=a[n[r]-1]++<<d,f=l|(1<<d)-1;l<=f;++l)o[Gt[l]>>>u]=c}else for(o=new K(i),r=0;r<i;++r)o[r]=Gt[a[n[r]-1]++]>>>15-n[r];return o},We=new ne(288);for($=0;$<144;++$)We[$]=8;for($=144;$<256;++$)We[$]=9;for($=256;$<280;++$)We[$]=7;for($=280;$<288;++$)We[$]=8;var zt=new ne(32);for($=0;$<32;++$)zt[$]=5;var _o=vt(We,9,0),vo=vt(zt,5,0),Nr=function(n){return(n/8>>0)+(7&n&&1)},Lr=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof K?K:n instanceof rt?rt:ne)(t-e);return i.set(n.subarray(e,t)),i},ye=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8},ut=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8,n[i+2]|=t>>>16},un=function(n,e){for(var t=[],i=0;i<n.length;++i)n[i]&&t.push({s:i,f:n[i]});var r=t.length,s=t.slice();if(!r)return[new ne(0),0];if(r==1){var o=new ne(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(P,M){return P.f-M.f}),t.push({s:-1,f:25001});var a=t[0],u=t[1],c=0,d=1,l=2;for(t[0]={s:-1,f:a.f+u.f,l:a,r:u};d!=r-1;)a=t[t[c].f<t[l].f?c++:l++],u=t[c!=d&&t[c].f<t[l].f?c++:l++],t[d++]={s:-1,f:a.f+u.f,l:a,r:u};var f=s[0].s;for(i=1;i<r;++i)s[i].s>f&&(f=s[i].s);var h=new K(f+1),g=go(t[d-1],h,0);if(g>e){i=0;var _=0,y=g-e,k=1<<y;for(s.sort(function(P,M){return h[M.s]-h[P.s]||P.f-M.f});i<r;++i){var E=s[i].s;if(!(h[E]>e))break;_+=k-(1<<g-h[E]),h[E]=e}for(_>>>=y;_>0;){var R=s[i].s;h[R]<e?_-=1<<e-h[R]++-1:++i}for(;i>=0&&_;--i){var O=s[i].s;h[O]==e&&(--h[O],++_)}g=e}return[new ne(h),g]},go=function n(e,t,i){return e.s==-1?Math.max(n(e.l,t,i+1),n(e.r,t,i+1)):t[e.s]=i},Ui=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new K(++e),i=0,r=n[0],s=1,o=function(u){t[i++]=u},a=1;a<=e;++a)if(n[a]==r&&a!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=n[a]}return[t.subarray(0,i),e]},lt=function(n,e){for(var t=0,i=0;i<e.length;++i)t+=n[i]*e[i];return t},Dt=function(n,e,t){var i=t.length,r=Nr(e+2);n[r]=255&i,n[r+1]=i>>>8,n[r+2]=255^n[r],n[r+3]=255^n[r+1];for(var s=0;s<i;++s)n[r+s+4]=t[s];return 8*(r+4+i)},ji=function(n,e,t,i,r,s,o,a,u,c,d){ye(e,d++,t),++r[256];for(var l=un(r,15),f=l[0],h=l[1],g=un(s,15),_=g[0],y=g[1],k=Ui(f),E=k[0],R=k[1],O=Ui(_),P=O[0],M=O[1],A=new K(19),F=0;F<E.length;++F)A[31&E[F]]++;for(F=0;F<P.length;++F)A[31&P[F]]++;for(var L=un(A,7),j=L[0],Le=L[1],ie=19;ie>4&&!j[Hi[ie-1]];--ie);var me,fe,pe,ze,Ie=c+5<<3,qe=lt(r,We)+lt(s,zt)+o,_e=lt(r,f)+lt(s,_)+o+14+3*ie+lt(A,j)+(2*A[16]+3*A[17]+7*A[18]);if(Ie<=qe&&Ie<=_e)return Dt(e,d,n.subarray(u,u+c));if(ye(e,d,1+(_e<qe)),d+=2,_e<qe){me=vt(f,h,0),fe=f,pe=vt(_,y,0),ze=_;var Pe=vt(j,Le,0);for(ye(e,d,R-257),ye(e,d+5,M-1),ye(e,d+10,ie-4),d+=14,F=0;F<ie;++F)ye(e,d+3*F,j[Hi[F]]);d+=3*ie;for(var Ve=[E,P],V=0;V<2;++V){var re=Ve[V];for(F=0;F<re.length;++F){var te=31&re[F];ye(e,d,Pe[te]),d+=j[te],te>15&&(ye(e,d,re[F]>>>5&127),d+=re[F]>>>12)}}}else me=_o,fe=We,pe=vo,ze=zt;for(F=0;F<a;++F)if(i[F]>255){te=i[F]>>>18&31,ut(e,d,me[te+257]),d+=fe[te+257],te>7&&(ye(e,d,i[F]>>>23&31),d+=Yn[te]);var Qe=31&i[F];ut(e,d,pe[Qe]),d+=ze[Qe],Qe>3&&(ut(e,d,i[F]>>>5&8191),d+=Jn[Qe])}else ut(e,d,me[i[F]]),d+=fe[i[F]];return ut(e,d,me[256]),d+fe[256]},mo=new rt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),yo=new ne(0),bo=function(){for(var n=new rt(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),ko=function(n,e,t,i,r){return function(s,o,a,u,c,d){var l=s.length,f=new ne(u+l+5*(1+Math.floor(l/7e3))+c),h=f.subarray(u,f.length-c),g=0;if(!o||l<8)for(var _=0;_<=l;_+=65535){var y=_+65535;y<l?g=Dt(h,g,s.subarray(_,y)):(h[_]=d,g=Dt(h,g,s.subarray(_,l)))}else{for(var k=mo[o-1],E=k>>>13,R=8191&k,O=(1<<a)-1,P=new K(32768),M=new K(O+1),A=Math.ceil(a/3),F=2*A,L=function(Zt){return(s[Zt]^s[Zt+1]<<A^s[Zt+2]<<F)&O},j=new rt(25e3),Le=new K(288),ie=new K(32),me=0,fe=0,pe=(_=0,0),ze=0,Ie=0;_<l;++_){var qe=L(_),_e=32767&_,Pe=M[qe];if(P[_e]=Pe,M[qe]=_e,ze<=_){var Ve=l-_;if((me>7e3||pe>24576)&&Ve>423){g=ji(s,h,0,j,Le,ie,fe,pe,Ie,_-Ie,g),pe=me=fe=0,Ie=_;for(var V=0;V<286;++V)Le[V]=0;for(V=0;V<30;++V)ie[V]=0}var re=2,te=0,Qe=R,xe=_e-Pe&32767;if(Ve>2&&qe==L(_-xe))for(var is=Math.min(E,Ve)-1,rs=Math.min(32767,_),ss=Math.min(258,Ve);xe<=rs&&--Qe&&_e!=Pe;){if(s[_+re]==s[_+re-xe]){for(var Ce=0;Ce<ss&&s[_+Ce]==s[_+Ce-xe];++Ce);if(Ce>re){if(re=Ce,te=xe,Ce>is)break;var os=Math.min(xe,Ce-2),ei=0;for(V=0;V<os;++V){var Kt=_-xe+V+32768&32767,ti=Kt-P[Kt]+32768&32767;ti>ei&&(ei=ti,Pe=Kt)}}}xe+=(_e=Pe)-(Pe=P[_e])+32768&32767}if(te){j[pe++]=268435456|Dn[re]<<18|An[te];var ni=31&Dn[re],ii=31&An[te];fe+=Yn[ni]+Jn[ii],++Le[257+ni],++ie[ii],ze=_+re,++me}else j[pe++]=s[_],++Le[s[_]]}}g=ji(s,h,d,j,Le,ie,fe,pe,Ie,_-Ie,g),d||(g=Dt(h,g,yo))}return Lr(f,0,u+Nr(g)+c)}(n,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+e.mem,t,i,!r)},ln=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function wo(n,e){e===void 0&&(e={});var t=function(){var o=4294967295;return{p:function(a){for(var u=o,c=0;c<a.length;++c)u=bo[255&u^a[c]]^u>>>8;o=u},d:function(){return 4294967295^o}}}(),i=n.length;t.p(n);var r=ko(n,e,function(o){return 10+(o.filename&&o.filename.length+1||0)}(e),8),s=r.length;return function(o,a){var u=a.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=a.level<2?4:a.level==9?2:0,o[9]=3,a.mtime!=0&&ln(o,4,Math.floor(new Date(a.mtime||Date.now())/1e3)),u){o[3]=8;for(var c=0;c<=u.length;++c)o[c+10]=u.charCodeAt(c)}}(r,e),ln(r,s-8,t.d()),ln(r,s-4,i),r}var So=!!vn||!!_n,Wi="text/plain",Vt=function(n,e){var t=Y(n.split("?"),2),i=t[0],r=t[1],s=b({},e);r?.split("&").forEach(function(a){var u=Y(a.split("="),1)[0];delete s[u]});var o=Os(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},Eo=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},cn=function(n){var e=n.data,t=n.compression;if(e){if(t===le.GZipJS){var i=wo(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var u=new ne(s.length+(s.length>>>1)),c=0,d=function(g){u[c++]=g},l=0;l<a;++l){if(c+5>u.length){var f=new ne(c+8+(a-l<<1));f.set(u),u=f}var h=s.charCodeAt(l);h<128||o?d(h):h<2048?(d(192|h>>>6),d(128|63&h)):h>55295&&h<57344?(d(240|(h=65536+(1047552&h)|1023&s.charCodeAt(++l))>>>18),d(128|h>>>12&63),d(128|h>>>6&63),d(128|63&h)):(d(224|h>>>12),d(128|h>>>6&63),d(128|63&h))}return Lr(u,0,c)}(JSON.stringify(e)),{mtime:0});return{contentType:Wi,body:new Blob([i],{type:Wi})}}if(t===le.Base64){var r=function(s){var o,a,u,c,d,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,h=0,g="",_=[];if(!s)return s;s=bs(s);do o=(d=s.charCodeAt(f++)<<16|s.charCodeAt(f++)<<8|s.charCodeAt(f++))>>18&63,a=d>>12&63,u=d>>6&63,c=63&d,_[h++]=l.charAt(o)+l.charAt(a)+l.charAt(u)+l.charAt(c);while(f<s.length);switch(g=_.join(""),s.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g}(JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:Eo(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},gt=[];vn&&gt.push({transport:"XHR",method:function(n){var e,t=new vn;t.open(n.method||"GET",n.url,!0);var i=(e=cn(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;T(n.headers,function(o,a){t.setRequestHeader(a,o)}),r&&t.setRequestHeader("Content-Type",r),n.timeout&&(t.timeout=n.timeout),t.withCredentials=!0,t.onreadystatechange=function(){if(t.readyState===4){var o,a={statusCode:t.status,text:t.responseText};if(t.status===200)try{a.json=JSON.parse(t.responseText)}catch{}(o=n.callback)===null||o===void 0||o.call(n,a)}},t.send(s)}}),_n&&gt.push({transport:"fetch",method:function(n){var e,t,i=(e=cn(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;T(o,function(d,l){o.append(l,d)}),r&&o.append("Content-Type",r);var a=n.url,u=null;if(fi){var c=new fi;u={signal:c.signal,timeout:setTimeout(function(){return c.abort()},n.timeout)}}_n(a,{method:n?.method||"GET",headers:o,keepalive:n.method==="POST",body:s,signal:(t=u)===null||t===void 0?void 0:t.signal}).then(function(d){return d.text().then(function(l){var f,h={statusCode:d.status,text:l};if(d.status===200)try{h.json=JSON.parse(l)}catch(g){m.error(g)}(f=n.callback)===null||f===void 0||f.call(n,h)})}).catch(function(d){var l;m.error(d),(l=n.callback)===null||l===void 0||l.call(n,{statusCode:0,text:d})}).finally(function(){return u?clearTimeout(u.timeout):null})}}),Ee!=null&&Ee.sendBeacon&&gt.push({transport:"sendBeacon",method:function(n){var e=Vt(n.url,{beacon:"1"});try{var t,i=(t=cn(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;Ee.sendBeacon(e,o)}catch{}}});var Fo=["retriesPerformedSoFar"],Ue,Ro=function(){function n(e){var t=this;x(this,n),v(this,"isPolling",!1),v(this,"pollIntervalMs",3e3),v(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!S(p)&&"onLine"in p.navigator&&(this.areWeOnline=p.navigator.onLine,p.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),p.addEventListener("offline",function(){t.areWeOnline=!1}))}return C(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=_s(e,Fo);ue(i)&&i>0&&(r.url=Vt(r.url,{retry_count:i})),this.instance._send_request(b(b({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(b({retriesPerformedSoFar:i},r)):(o=r.callback)===null||o===void 0||o.call(r,s)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var a=3e3*Math.pow(2,o),u=a/2,c=Math.min(18e5,a),d=(Math.random()-.5)*(c-u);return Math.ceil(c+d)}(t),r=Date.now()+i;this.queue.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),m.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],i=this.queue.filter(function(a){return a.retryAt<e||(t.push(a),!1)});if(this.queue=t,i.length>0){var r,s=he(i);try{for(s.s();!(r=s.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(a){s.e(a)}finally{s.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=he(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(b(b({},i),{},{transport:"sendBeacon"}))}catch(r){m.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),xt=1800,Io=function(){function n(e,t,i,r){var s;x(this,n),v(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||Me,this._windowIdGenerator=r||Me;var o=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||xt;if(ue(a)?a>xt?m.warn("session_idle_timeout_seconds cannot be  greater than 30 minutes. Using 30 minutes instead."):a<60&&m.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(m.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=xt),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),xt),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=G.parse(this._window_id_storage_key),c=G.parse(this._primary_window_exists_storage_key);u&&!c?this._windowId=u:G.remove(this._window_id_storage_key),G.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var d=function(l){var f=l.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),d)}catch(l){m.error("Invalid sessionID in bootstrap",l)}this._listenToReloadWindow()}return C(n,[{key:"onSessionId",value:function(e){var t=this;return S(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&G.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&G.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?G.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(v({},Lt,[t,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Lt];return H(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;p?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&G.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),i=Y(this._getSessionId(),3),r=i[0],s=i[1],o=i[2],a=this._getWindowId(),u=o&&o>0&&Math.abs(t-o)>864e5,c=!1,d=!s,l=!e&&Math.abs(t-r)>this._sessionTimeoutMs;d||l||u?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),m.info("[SessionId] new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:d,activityTimeout:l,sessionPastMaximumLength:u}}),o=t,c=!0):a||(a=this._windowIdGenerator(),c=!0);var f=r===0||!e||u?t:r,h=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,f,h),c&&this._sessionIdChangedHandlers.forEach(function(g){return g(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:h}}}]),n}();(function(n){n.US="us",n.EU="eu",n.CUSTOM="custom"})(Ue||(Ue={}));var Gi="i.posthog.com",Po=function(){function n(e){x(this,n),v(this,"_regionCache",{}),this.instance=e}return C(n,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Ue.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Ue.EU:this._regionCache[this.apiHost]=Ue.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t&&(t=t[0]==="/"?t:"/".concat(t)),e==="ui")return(this.uiHost||this.apiHost.replace(".".concat(Gi),".posthog.com"))+t;if(this.region===Ue.CUSTOM)return this.apiHost+t;var i=Gi+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},{key:"loadScript",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return m.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var i=e[0]==="/"?this.endpointFor("assets",e):e,r=function(){if(!w)return t("document not found");var s=w.createElement("script");s.type="text/javascript",s.src=i,s.onload=function(u){return t(void 0,u)},s.onerror=function(u){return t(u)};var o,a=w.querySelectorAll("body > script");a.length>0?(o=a[0].parentNode)===null||o===void 0||o.insertBefore(s,a[0]):w.body.appendChild(s)};w!=null&&w.body?r():w?.addEventListener("DOMContentLoaded",r)}}]),n}(),qr="posthog-js";function Br(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.organization,i=e.projectId,r=e.prefix,s=e.severityAllowList,o=s===void 0?["error"]:s;return function(a){var u,c,d,l,f;if(!(o==="*"||o.includes(a.level))||!n.__loaded)return a;a.tags||(a.tags={});var h=n.requestRouter.endpointFor("ui","/project/".concat(n.config.token,"/person/").concat(n.get_distinct_id()));a.tags["PostHog Person URL"]=h,n.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=n.get_session_replay_url({withTimestamp:!0}));var g=((u=a.exception)===null||u===void 0?void 0:u.values)||[],_={$exception_message:((c=g[0])===null||c===void 0?void 0:c.value)||a.message,$exception_type:(d=g[0])===null||d===void 0?void 0:d.type,$exception_personURL:h,$exception_level:a.level,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((l=g[0])===null||l===void 0?void 0:l.value)||a.message,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:a.tags,$level:a.level};return t&&i&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.capture("$exception",_),a}}var xo=C(function n(e,t,i,r,s){x(this,n),this.name=qr,this.setupOnce=function(o){o(Br(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function Co(n,e){var t=n.config.segment;if(!t)return e();(function(i,r){var s=i.config.segment;if(!s)return r();var o=function(u){var c=function(){return u.anonymousId()||Me()};i.config.get_device_id=c,u.id()&&(i.register({distinct_id:u.id(),$device_id:c()}),i.persistence.set_property(ke,"identified")),r()},a=s.user();"then"in a&&ce(a.then)?a.then(function(u){return o(u)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||m.warn("This browser does not have Promise support, and can not use the segment integration");var r=function(s,o){var a;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||i.reset(),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(i.register({distinct_id:s.event.userId}),i.reloadFeatureFlags());var u=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{});return s.event.properties=Object.assign({},u,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(s){return r(s,s.event.event)},page:function(s){return r(s,"$pageview")},identify:function(s){return r(s,"$identify")},screen:function(s){return r(s,"$screen")}}}(n)).then(function(){e()})})}var zi,Qt,ae,To=function(){function n(e){x(this,n),this._instance=e}return C(n,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=(e=p?.location.pathname)!==null&&e!==void 0?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var i=t.maxScrollHeight,r=t.lastScrollY,s=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,u=t.maxContentY;return S(i)||S(r)||S(s)||S(o)||S(a)||S(u)?{}:(i=Math.ceil(i),r=Math.ceil(r),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:i<=1?1:Ct(r/i,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:i<=1?1:Ct(s/i,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Ct(a/o,0,1),$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:o<=1?1:Ct(u/o,0,1)})}}]),n}();function Ct(n,e,t){return Math.max(e,Math.min(n,t))}(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(zi||(zi={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(Qt||(Qt={})),function(n){n.NextQuestion="next_question",n.End="end",n.ResponseBased="response_based",n.SpecificQuestion="specific_question"}(ae||(ae={}));var Nn=function(){function n(e){x(this,n),this.persistence=e,this.eventRegistry=new Map}return C(n,[{key:"register",value:function(e){var t=this;e.forEach(function(i){var r,s,o,a,u;(r=i.conditions)!==null&&r!==void 0&&r.events&&(s=i.conditions)!==null&&s!==void 0&&(o=s.events)!==null&&o!==void 0&&o.values&&((a=i.conditions)===null||a===void 0?void 0:a.events.values.length)>0&&t.eventRegistry.set(i.id,(u=i.conditions)===null||u===void 0?void 0:u.events.values.map(function(c){return c.name}))})}},{key:"on",value:function(e,t){var i,r=[],s=((i=this.persistence)===null||i===void 0?void 0:i.props[tn])||[];if(n.SURVEY_SHOWN_EVENT_NAME==e&&t&&s.length>0){var o,a=t==null||(o=t.properties)===null||o===void 0?void 0:o.$survey_id;if(a){var u=s.indexOf(a);u>=0&&s.splice(u,1)}}else this.eventRegistry.forEach(function(d,l){d.includes(e)&&r.push(l)});var c=s.concat(r);this._saveSurveysToStorage(c)}},{key:"getSurveys",value:function(){var e,t=(e=this.persistence)===null||e===void 0?void 0:e.props[tn];return t||[]}},{key:"getEventRegistry",value:function(){return this.eventRegistry}},{key:"_saveSurveysToStorage",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.register(v({},tn,je(new Set(e))))}}]),n}();v(Nn,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Hr,D,Ur,He,Vi,jr,Ln,Wr,qn={},Gr=[],$o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xn=Array.isArray;function De(n,e){for(var t in e)n[t]=e[t];return n}function zr(n){var e=n.parentNode;e&&e.removeChild(n)}function dn(n,e,t,i,r){var s={type:n,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++Ur,__i:-1,__u:0};return r==null&&D.vnode!=null&&D.vnode(s),s}function Kn(n){return n.children}function At(n,e){this.props=n,this.context=e}function st(n,e){if(e==null)return n.__?st(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?st(n):null}function Vr(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return Vr(n)}}function Bn(n){(!n.__d&&(n.__d=!0)&&He.push(n)&&!Yt.__r++||Vi!==D.debounceRendering)&&((Vi=D.debounceRendering)||jr)(Yt)}function Yt(){var n,e,t,i,r,s,o,a,u;for(He.sort(Ln);n=He.shift();)n.__d&&(e=He.length,i=void 0,s=(r=(t=n).__v).__e,a=[],u=[],(o=t.__P)&&((i=De({},r)).__v=r.__v+1,D.vnode&&D.vnode(i),Jr(o,i,r,t.__n,o.ownerSVGElement!==void 0,32&r.__u?[s]:null,a,s??st(r),!!(32&r.__u),u),i.__.__k[i.__i]=i,Do(a,i,u),i.__e!=s&&Vr(i)),He.length>e&&He.sort(Ln));Yt.__r=0}function Qr(n,e,t,i,r,s,o,a,u,c,d){var l,f,h,g,_,y=i&&i.__k||Gr,k=e.length;for(t.__d=u,Oo(t,e,y),u=t.__d,l=0;l<k;l++)(h=t.__k[l])!=null&&typeof h!="boolean"&&typeof h!="function"&&(f=h.__i===-1?qn:y[h.__i]||qn,h.__i=l,Jr(n,h,f,r,s,o,a,u,c,d),g=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&Zn(f.ref,null,h),d.push(h.ref,h.__c||g,h)),_==null&&g!=null&&(_=g),65536&h.__u||f.__k===h.__k?u=Yr(h,u,n):typeof h.type=="function"&&h.__d!==void 0?u=h.__d:g&&(u=g.nextSibling),h.__d=void 0,h.__u&=-196609);t.__d=u,t.__e=_}function Oo(n,e,t){var i,r,s,o,a,u=e.length,c=t.length,d=c,l=0;for(n.__k=[],i=0;i<u;i++)(r=n.__k[i]=(r=e[i])==null||typeof r=="boolean"||typeof r=="function"?null:typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?dn(null,r,null,null,r):Xn(r)?dn(Kn,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?dn(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=n,r.__b=n.__b+1,a=Mo(r,t,o=i+l,d),r.__i=a,s=null,a!==-1&&(d--,(s=t[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&l--,typeof r.type!="function"&&(r.__u|=65536)):a!==o&&(a===o+1?l++:a>o?d>u-o?l+=a-o:l--:l=a<o&&a==o-1?a-o:0,a!==i+l&&(r.__u|=65536))):(s=t[i])&&s.key==null&&s.__e&&(s.__e==n.__d&&(n.__d=st(s)),Hn(s,s,!1),t[i]=null,d--);if(d)for(i=0;i<c;i++)(s=t[i])!=null&&(131072&s.__u)==0&&(s.__e==n.__d&&(n.__d=st(s)),Hn(s,s))}function Yr(n,e,t){var i,r;if(typeof n.type=="function"){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,e=Yr(i[r],e,t));return e}return n.__e!=e&&(t.insertBefore(n.__e,e||null),e=n.__e),e&&e.nextSibling}function Mo(n,e,t,i){var r=n.key,s=n.type,o=t-1,a=t+1,u=e[t];if(u===null||u&&r==u.key&&s===u.type)return t;if(i>(u!=null&&(131072&u.__u)==0?1:0))for(;o>=0||a<e.length;){if(o>=0){if((u=e[o])&&(131072&u.__u)==0&&r==u.key&&s===u.type)return o;o--}if(a<e.length){if((u=e[a])&&(131072&u.__u)==0&&r==u.key&&s===u.type)return a;a++}}return-1}function Qi(n,e,t){e[0]==="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||$o.test(e)?t:t+"px"}function Tt(n,e,t,i,r){var s;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof i=="string"&&(n.style.cssText=i=""),i)for(e in i)t&&e in t||Qi(n.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||Qi(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in n?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+s]=t,t?i?t.u=i.u:(t.u=Date.now(),n.addEventListener(e,s?Ji:Yi,s)):n.removeEventListener(e,s?Ji:Yi,s);else{if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?n.removeAttribute(e):n.setAttribute(e,t))}}function Yi(n){var e=this.l[n.type+!1];if(n.t){if(n.t<=e.u)return}else n.t=Date.now();return e(D.event?D.event(n):n)}function Ji(n){return this.l[n.type+!0](D.event?D.event(n):n)}function Jr(n,e,t,i,r,s,o,a,u,c){var d,l,f,h,g,_,y,k,E,R,O,P,M,A,F,L=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(u=!!(32&t.__u),s=[a=e.__e=t.__e]),(d=D.__b)&&d(e);e:if(typeof L=="function")try{if(k=e.props,E=(d=L.contextType)&&i[d.__c],R=d?E?E.props.value:d.__:i,t.__c?y=(l=e.__c=t.__c).__=l.__E:("prototype"in L&&L.prototype.render?e.__c=l=new L(k,R):(e.__c=l=new At(k,R),l.constructor=L,l.render=No),E&&E.sub(l),l.props=k,l.state||(l.state={}),l.context=R,l.__n=i,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),L.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=De({},l.__s)),De(l.__s,L.getDerivedStateFromProps(k,l.__s))),h=l.props,g=l.state,l.__v=e,f)L.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(L.getDerivedStateFromProps==null&&k!==h&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(k,R),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(k,l.__s,R)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(l.props=k,l.state=l.__s,l.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(j){j&&(j.__=e)}),O=0;O<l._sb.length;O++)l.__h.push(l._sb[O]);l._sb=[],l.__h.length&&o.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(k,l.__s,R),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(h,g,_)})}if(l.context=R,l.props=k,l.__P=n,l.__e=!1,P=D.__r,M=0,"prototype"in L&&L.prototype.render){for(l.state=l.__s,l.__d=!1,P&&P(e),d=l.render(l.props,l.state,l.context),A=0;A<l._sb.length;A++)l.__h.push(l._sb[A]);l._sb=[]}else do l.__d=!1,P&&P(e),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++M<25);l.state=l.__s,l.getChildContext!=null&&(i=De(De({},i),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(_=l.getSnapshotBeforeUpdate(h,g)),Qr(n,Xn(F=d!=null&&d.type===Kn&&d.key==null?d.props.children:d)?F:[F],e,t,i,r,s,o,a,u,c),l.base=e.__e,e.__u&=-161,l.__h.length&&o.push(l),y&&(l.__E=l.__=null)}catch(j){e.__v=null,u||s!=null?(e.__e=a,e.__u|=u?160:32,s[s.indexOf(a)]=null):(e.__e=t.__e,e.__k=t.__k),D.__e(j,e,t)}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Ao(t.__e,e,t,i,r,s,o,u,c);(d=D.diffed)&&d(e)}function Do(n,e,t){e.__d=void 0;for(var i=0;i<t.length;i++)Zn(t[i],t[++i],t[++i]);D.__c&&D.__c(e,n),n.some(function(r){try{n=r.__h,r.__h=[],n.some(function(s){s.call(r)})}catch(s){D.__e(s,r.__v)}})}function Ao(n,e,t,i,r,s,o,a,u){var c,d,l,f,h,g,_,y=t.props,k=e.props,E=e.type;if(E==="svg"&&(r=!0),s!=null){for(c=0;c<s.length;c++)if((h=s[c])&&"setAttribute"in h==!!E&&(E?h.localName===E:h.nodeType===3)){n=h,s[c]=null;break}}if(n==null){if(E===null)return document.createTextNode(k);n=r?document.createElementNS("http://www.w3.org/2000/svg",E):document.createElement(E,k.is&&k),s=null,a=!1}if(E===null)y===k||a&&n.data===k||(n.data=k);else{if(s=s&&Hr.call(n.childNodes),y=t.props||qn,!a&&s!=null)for(y={},c=0;c<n.attributes.length;c++)y[(h=n.attributes[c]).name]=h.value;for(c in y)h=y[c],c=="children"||(c=="dangerouslySetInnerHTML"?l=h:c==="key"||c in k||Tt(n,c,null,h,r));for(c in k)h=k[c],c=="children"?f=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?g=h:c=="checked"?_=h:c==="key"||a&&typeof h!="function"||y[c]===h||Tt(n,c,h,y[c],r);if(d)a||l&&(d.__html===l.__html||d.__html===n.innerHTML)||(n.innerHTML=d.__html),e.__k=[];else if(l&&(n.innerHTML=""),Qr(n,Xn(f)?f:[f],e,t,i,r&&E!=="foreignObject",s,o,s?s[0]:t.__k&&st(t,0),a,u),s!=null)for(c=s.length;c--;)s[c]!=null&&zr(s[c]);a||(c="value",g!==void 0&&(g!==n[c]||E==="progress"&&!g||E==="option"&&g!==y[c])&&Tt(n,c,g,y[c],!1),c="checked",_!==void 0&&_!==n[c]&&Tt(n,c,_,y[c],!1))}return n}function Zn(n,e,t){try{typeof n=="function"?n(e):n.current=e}catch(i){D.__e(i,t)}}function Hn(n,e,t){var i,r;if(D.unmount&&D.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||Zn(i,null,e)),(i=n.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){D.__e(s,e)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&Hn(i[r],e,t||typeof n.type!="function");t||n.__e==null||zr(n.__e),n.__=n.__e=n.__d=void 0}function No(n,e,t){return this.constructor(n,t)}Hr=Gr.slice,D={__e:function(n,e,t,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(n)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(n,i||{}),o=r.__d),o)return r.__E=r}catch(a){n=a}throw n}},Ur=0,At.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=De({},this.state),typeof n=="function"&&(n=n(De({},t),this.props)),n&&De(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),Bn(this))},At.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),Bn(this))},At.prototype.render=Kn,He=[],jr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ln=function(n,e){return n.__v.__b-e.__v.__b},Yt.__r=0,Wr=0;var Xi=function(n){var e,t,i,r,s,o;return((e=n.conditions)===null||e===void 0||(t=e.events)===null||t===void 0||(i=t.values)===null||i===void 0?void 0:i.length)!=null&&((r=n.conditions)===null||r===void 0||(s=r.events)===null||s===void 0||(o=s.values)===null||o===void 0?void 0:o.length)>0};(function(n,e){var t={__c:e="__cC"+Wr++,__:n,Consumer:function(i,r){return i.children(r)},Provider:function(i){var r,s;return this.getChildContext||(r=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&r.some(function(a){a.__e=!0,Bn(a)})},this.sub=function(o){r.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){r.splice(r.indexOf(o),1),a&&a.call(o)}}),i.children}};t.Provider.__=t.Consumer.contextType=t})({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:function(){}});var Lo={icontains:function(n){return!!p&&p.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!p&&p.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!p&&xi(p.location.href,n)},not_regex:function(n){return!!p&&!xi(p.location.href,n)},exact:function(n){return p?.location.href===n},is_not:function(n){return p?.location.href!==n}},qo=function(){function n(e){x(this,n),this.instance=e,this._surveyEventReceiver=null}return C(n,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=q?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Nn(this.instance.persistence)),this.instance.requestRouter.loadScript("/static/surveys.js",function(i){if(i)return m.error("Could not load surveys script",i);q.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Nn(this.instance.persistence));var r=this.instance.get_property(wn);if(r&&!i)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(s){var o;if(s.statusCode!==200||!s.json)return e([]);var a=s.json.surveys||[],u=a.filter(function(d){var l,f,h,g,_,y;return((l=d.conditions)===null||l===void 0?void 0:l.events)&&((f=d.conditions)===null||f===void 0||(h=f.events)===null||h===void 0?void 0:h.values)&&((g=d.conditions)===null||g===void 0||(_=g.events)===null||_===void 0||(y=_.values)===null||y===void 0?void 0:y.length)>0});if(u.length>0&&!S(t.instance._addCaptureHook)){var c;(c=t._surveyEventReceiver)===null||c===void 0||c.register(u),t.instance._addCaptureHook(function(d,l){var f;(f=t._surveyEventReceiver)===null||f===void 0||f.on(d,l)})}return(o=t.instance.persistence)===null||o===void 0||o.register(v({},wn,a)),e(a)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(r){var s,o=r.filter(function(c){return!(!c.start_date||c.end_date)}).filter(function(c){var d,l,f,h;if(!c.conditions)return!0;var g=(d=c.conditions)===null||d===void 0||!d.url||Lo[(l=(f=c.conditions)===null||f===void 0?void 0:f.urlMatchType)!==null&&l!==void 0?l:"icontains"](c.conditions.url),_=(h=c.conditions)===null||h===void 0||!h.selector||w?.querySelector(c.conditions.selector);return g&&_}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),u=o.filter(function(c){if(!c.linked_flag_key&&!c.targeting_flag_key&&!c.internal_targeting_flag_key)return!0;var d=!c.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(c.linked_flag_key),l=!c.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(c.targeting_flag_key),f=!Xi(c)||a?.includes(c.id),h=function(_){var y,k;return!((y=_.conditions)===null||y===void 0||(k=y.events)===null||k===void 0||!k.repeatedActivation||!Xi(_))}(c),g=!(c.internal_targeting_flag_key&&!h)||t.instance.featureFlags.isFeatureEnabled(c.internal_targeting_flag_key);return d&&l&&g&&f});return e(u)},i)}},{key:"getNextSurveyStep",value:function(e,t,i){var r,s=e.questions[t],o=t+1;if((r=s.branching)===null||r===void 0||!r.type)return t===e.questions.length-1?ae.End:o;if(s.branching.type===ae.End)return ae.End;if(s.branching.type===ae.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===ae.ResponseBased){if(s.type===Qt.SingleChoice){var a,u,c=s.choices.indexOf("".concat(i));if((a=s.branching)!==null&&a!==void 0&&(u=a.responseValues)!==null&&u!==void 0&&u.hasOwnProperty(c)){var d=s.branching.responseValues[c];return Number.isInteger(d)?d:d===ae.End?ae.End:o}}else if(s.type===Qt.Rating){var l,f;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(_,y){if(y===3){if(_<1||_>3)throw new Error("The response must be in range 1-3");return _===1?"negative":_===2?"neutral":"positive"}if(y===5){if(_<1||_>5)throw new Error("The response must be in range 1-5");return _<=2?"negative":_===3?"neutral":"positive"}if(y===10){if(_<0||_>10)throw new Error("The response must be in range 0-10");return _<=6?"detractors":_<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 10")}(i,s.scale);if((l=s.branching)!==null&&l!==void 0&&(f=l.responseValues)!==null&&f!==void 0&&f.hasOwnProperty(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===ae.End?ae.End:o}}return o}return console.warn("Falling back to next question index due to unexpected branching type"),o}}]),n}(),Bo=function(){function n(e){var t,i,r=this;x(this,n),v(this,"serverLimits",{}),v(this,"lastEventRateLimited",!1),v(this,"checkForLimiting",function(s){var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(function(a){m.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void m.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:o})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)===null||i===void 0?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return C(n,[{key:"clientRateLimitContext",value:function(){var e,t,i,r=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(En))!==null&&e!==void 0?e:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(i=this.instance.persistence)===null||i===void 0||i.set_property(En,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}]),n}(),Ho=function(){return b({initialPathName:Z?.pathname||"",referringDomain:U.referringDomain()},U.campaignParams())},Uo=function(){function n(e,t,i){var r=this;x(this,n),v(this,"_onSessionIdCallback",function(s){var o=r._getStoredProps();if(!o||o.sessionId!==s){var a={sessionId:s,props:r._sessionSourceParamGenerator()};r._persistence.register(v({},Sn,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||Ho,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return C(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[Sn]}},{key:"getSessionProps",value:function(){var e,t=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),n}(),jo=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Ki=function(n,e){if(!n)return!1;var t=n.toLowerCase();return jo.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},Xr=function(){function n(){x(this,n),this.clicks=[]}return C(n,[{key:"isRageClick",value:function(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}]),n}();function Zi(n){var e;return n.id===In||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+In))}var Wo=function(){function n(e){var t;x(this,n),v(this,"rageclicks",new Xr),v(this,"_enabledServerSide",!1),v(this,"_initialized",!1),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[yn])}return C(n,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(m.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return S(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(v({},yn,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;p&&w&&(Se(w,"click",function(t){return e._onClick(t||p?.event)},!1,!0),Se(w,"mousemove",function(t){return e._onMouseMove(t||p?.event)},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(a,u,c){for(var d=a;d&&!Ne(d,"body");){if(d===c)return!1;if(I(u,p?.getComputedStyle(d).position))return!0;d=Cr(d)}return!1}(e.target,["fixed","sticky"],s);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t;if(!Zi(e.target)){var i=this._getProperties(e,"click");(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(b(b({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;Zi(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(p){var t=p.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),n}(),Go=function(){function n(e){var t=this;x(this,n),v(this,"_updateScrollData",function(){var i,r,s,o;t.context||(t.context={});var a=t.scrollElement(),u=t.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=u+(a?.clientHeight||0),l=a?.scrollHeight||0;t.context.lastScrollY=Math.ceil(u),t.context.maxScrollY=Math.max(u,(i=t.context.maxScrollY)!==null&&i!==void 0?i:0),t.context.maxScrollHeight=Math.max(c,(r=t.context.maxScrollHeight)!==null&&r!==void 0?r:0),t.context.lastContentY=d,t.context.maxContentY=Math.max(d,(s=t.context.maxContentY)!==null&&s!==void 0?s:0),t.context.maxContentHeight=Math.max(l,(o=t.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=e}return C(n,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){p?.addEventListener("scroll",this._updateScrollData,!0),p?.addEventListener("scrollend",this._updateScrollData,!0),p?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return p?.document.documentElement;var e,t=he(H(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var i=e.value,r=p?.document.querySelector(i);if(r)return r}}catch(s){t.e(s)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return p&&(p.scrollY||p.pageYOffset||p.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return p&&(p.scrollX||p.pageXOffset||p.document.documentElement.scrollLeft)||0}}]),n}(),zo=function(){function n(){x(this,n),v(this,"events",{}),this.events={}}return C(n,[{key:"on",value:function(e,t){var i=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){i.events[e]=i.events[e].filter(function(r){return r!==t})}}},{key:"emit",value:function(e,t){var i,r=he(this.events[e]||[]);try{for(r.s();!(i=r.n()).done;)(0,i.value)(t)}catch(a){r.e(a)}finally{r.f()}var s,o=he(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),hn="$copy_autocapture";function fn(n,e){return e.length>n?e.slice(0,n)+"...":e}var Oe,Vo=function(){function n(e){x(this,n),v(this,"_initialized",!1),v(this,"_isDisabledServerSide",null),v(this,"rageclicks",new Xr),v(this,"_elementsChainAsString",!1),this.instance=e}return C(n,[{key:"config",get:function(){var e,t=X(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(e=t.url_allowlist)===null||e===void 0?void 0:e.map(function(i){return new RegExp(i)}),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(p&&w){var t=function(r){r=r||p?.event;try{e._captureEvent(r)}catch(s){m.error("Failed to capture event",s)}},i=function(r){r=r||p?.event,e._captureEvent(r,hn)};Se(w,"submit",t,!1,!0),Se(w,"change",t,!1,!0),Se(w,"click",t,!1,!0),this.config.capture_copied_text&&(Se(w,"copy",i,!1,!0),Se(w,"cut",i,!1,!0))}}else m.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(v({},vi,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[vi],r=this._isDisabledServerSide;if(Re(r)&&!Je(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!s}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Qn(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!$n(e))return{};var t={};return T(e.attributes,function(i){if(i.name&&i.name.indexOf("data-ph-capture-attribute")===0){var r=i.name.replace("data-ph-capture-attribute-",""),s=i.value;r&&s&&nt(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};Tn.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=fn(1024,Di(e)):o.$el_text=fn(1024,Wt(e)));var a=jt(e);a.length>0&&(o.classes=a.filter(function(f){return f!==""}));var u=(r=this.config)===null||r===void 0?void 0:r.element_attribute_ignorelist;T(e.attributes,function(f){var h;if((!Tr(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(u==null||!u.includes(f.name))&&!t&&nt(f.value)&&(h=f.name,!z(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=Vn(g).join(" ")),o["attr__"+f.name]=fn(1024,g)}});for(var c=1,d=1,l=e;l=this._previousElementSibling(l);)c++,l.tagName===e.tagName&&d++;return o.nth_child=c,o.nth_of_type=d,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return S(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,s=this._getEventTarget(e);Pr(s)&&(s=s.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var o=i===hn;if(s&&Vs(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,u,c=[s],d=s;d.parentNode&&!Ne(d,"body");)xr(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var l,f,h=[],g={},_=!1;if(T(c,function(F){var L=$n(F);F.tagName.toLowerCase()==="a"&&(l=F.getAttribute("href"),l=L&&nt(l)&&l),I(jt(F),"ph-no-capture")&&(_=!0),h.push(t._getPropertiesFromElement(F,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var j=t._getAugmentPropertiesFromElement(F);J(g,j)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?h[0].$el_text=Di(s):h[0].$el_text=Wt(s)),l){var y,k;h[0].attr__href=l;var E=(y=_t(l))===null||y===void 0?void 0:y.host,R=p==null||(k=p.location)===null||k===void 0?void 0:k.host;E&&R&&E!==R&&(f=l)}if(_)return!1;var O=J(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:Ks(h)}:{$elements:h},(a=h[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(u=h[0])===null||u===void 0?void 0:u.$el_text}:{},f&&e.type==="click"?{$external_click_url:f}:{},g);if(i===hn){var P,M=Ir(p==null||(P=p.getSelection())===null||P===void 0?void 0:P.toString()),A=e.type||"clipboard";if(!M)return!1;O.$selected_content=M,O.$copy_type=A}return this.instance.capture(i,O),!0}}}},{key:"isBrowserSupported",value:function(){return ce(w?.querySelectorAll)}}]),n}(),Qo=function(){function n(e){var t=this;x(this,n),v(this,"_restoreXHRPatch",void 0),v(this,"_restoreFetchPatch",void 0),v(this,"_startCapturing",function(){S(t._restoreXHRPatch)&&q.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),S(t._restoreFetchPatch)&&q.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return C(n,[{key:"_loadScript",value:function(e){q.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(ve.LIB_VERSION),function(t){t&&m.error("[TRACING-HEADERS] failed to load script",t),e()})}},{key:"startIfEnabledOrStop",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((e=this._restoreXHRPatch)===null||e===void 0||e.call(this),(t=this._restoreFetchPatch)===null||t===void 0||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),n}();(function(n){n[n.PENDING=-1]="PENDING",n[n.DENIED=0]="DENIED",n[n.GRANTED=1]="GRANTED"})(Oe||(Oe={}));var Yo=function(){function n(e){x(this,n),this.instance=e}return C(n,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Oe.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Oe.DENIED||this.consent===Oe.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return e==="1"?Oe.GRANTED:e==="0"?Oe.DENIED:Oe.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?B:Fe;var t=e==="localStorage"?Fe:B;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(t.get(this.storageKey)==="1"),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!lr([Ee?.doNotTrack,Ee?.msDoNotTrack,q.doNotTrack],function(e){return I([!0,1,"1","yes"],e)})}}]),n}(),er="/e/",$t="[Exception Capture]",Jo=function(){function n(e){var t,i=this;x(this,n),v(this,"_endpoint",er),v(this,"originalOnUnhandledRejectionHandler",void 0),v(this,"startCapturing",function(){var r;if(p&&i.isEnabled&&!i.hasHandlers&&((r=p.onerror)===null||r===void 0||!r.__POSTHOG_INSTRUMENTED__)){var s=p.posthogErrorWrappingFunctions.wrapOnError,o=p.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(s&&o)try{i.unwrapOnError=s(i.captureException.bind(i)),i.unwrapUnhandledRejection=o(i.captureException.bind(i))}catch(a){m.error($t+" failed to start",a),i.stopCapturing()}else m.error($t+" failed to load error wrapping functions - cannot start")}}),this.instance=e,this.remoteEnabled=!((t=this.instance.persistence)===null||t===void 0||!t.props[gi]),this.startIfEnabled()}return C(n,[{key:"isEnabled",get:function(){var e;return(e=this.remoteEnabled)!==null&&e!==void 0&&e}},{key:"isCapturing",get:function(){var e;return!(p==null||(e=p.onerror)===null||e===void 0||!e.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(m.info($t+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js?v=".concat(ve.LIB_VERSION)),function(t){t&&m.error($t+" failed to load script",t),e()})}},{key:"stopCapturing",value:function(){var e,t;(e=this.unwrapOnError)===null||e===void 0||e.call(this),(t=this.unwrapUnhandledRejection)===null||t===void 0||t.call(this)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this._endpoint=X(t)&&t.endpoint||er,this.instance.persistence&&(this.instance.persistence.register(v({},gi,this.remoteEnabled)),this.instance.persistence.register(v({},"$exception_capture_endpoint",this._endpoint))),this.startIfEnabled()}},{key:"captureException",value:function(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.sendExceptionEvent(e)}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0,_url:this._endpoint})}}]),n}(),ct="[Web Vitals]",Xo=function(){function n(e){var t,i=this;x(this,n),v(this,"_enabledServerSide",!1),v(this,"_initialized",!1),v(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),v(this,"_flushToCapture",function(){clearTimeout(i._delayedFlushTimer),i.buffer.metrics.length!==0&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce(function(r,s){var o;return b(b({},r),{},(v(o={},"$web_vitals_".concat(s.name,"_event"),b({},s)),v(o,"$web_vitals_".concat(s.name,"_value"),s.value),o))},{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),v(this,"_addToBuffer",function(r){var s,o=(s=i.instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0);if(S(o))m.error(ct+"Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{};var a=i._currentURL();S(a)||(de(r?.name)||de(r?.value)?m.error(ct+"Invalid metric received",r):(i.buffer.url!==a&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,8e3)),S(i.buffer.url)&&(i.buffer.url=a),i.buffer.firstMetricTimestamp=S(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,i.buffer.metrics.push(b(b({},r),{},{$current_url:a,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),i.buffer.metrics.length===4&&i._flushToCapture()))}}),v(this,"_startCapturing",function(){var r=q.postHogWebVitalsCallbacks,s=r.onLCP,o=r.onCLS,a=r.onFCP,u=r.onINP;s(i._addToBuffer),o(i._addToBuffer),a(i._addToBuffer),u(i._addToBuffer),i._initialized=!0}),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[mi]),this.startIfEnabled()}return C(n,[{key:"isEnabled",get:function(){var e=X(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Je(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(m.info(ct+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=X(e.capturePerformance)&&!!e.capturePerformance.web_vitals;this.instance.persistence&&this.instance.persistence.register(v({},mi,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){p.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/web-vitals.js?v=".concat(ve.LIB_VERSION)),function(t){t&&m.error(ct+" failed to load script",t),e()})}},{key:"_currentURL",value:function(){var e=p?p.location.href:void 0;return e||m.error(ct+"Could not determine current URL"),e}}]),n}(),mt={},tr=function(){},Ye="posthog",Kr=!So&&N?.indexOf("MSIE")===-1&&N?.indexOf("Mozilla")===-1,nr=function(){var n,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=w?.location,t=e?.hostname,!!z(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:tr,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Z&&z(Z?.search)&&Z.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(p==null||(n=p.location)===null||n===void 0?void 0:n.protocol)==="https:",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:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,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,on_request_error:function(i){var r="Bad HTTP status: "+i.statusCode+" "+i.text;m.error(r)},get_device_id:function(i){return i},_onCapture:tr,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},ir=function(n){var e={};S(n.process_person)||(e.person_profiles=n.process_person),S(n.xhr_headers)||(e.request_headers=n.xhr_headers),S(n.cookie_name)||(e.persistence_name=n.cookie_name),S(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=J({},e,n);return H(n.property_blacklist)&&(S(n.property_denylist)?t.property_denylist=n.property_blacklist:H(n.property_denylist)?t.property_denylist=[].concat(je(n.property_blacklist),je(n.property_denylist)):m.error("Invalid value for property_denylist config: "+n.property_denylist)),t},Ko=function(){function n(){x(this,n),v(this,"__forceAllowLocalhost",!1)}return C(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){m.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),Zr=function(){function n(){var e=this;x(this,n),v(this,"webPerformance",new Ko),v(this,"_internalEventEmitter",new zo),this.config=nr(),this.decideEndpointWasHit=!1,this.SentryIntegration=xo,this.sentryIntegration=function(t){return function(i,r){var s=Br(i,r);return{name:qr,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new ws(this),this.toolbar=new ho(this),this.scrollManager=new Go(this),this.pageViewManager=new To(this),this.surveys=new qo(this),this.rateLimiter=new Bo(this),this.requestRouter=new Po(this),this.consent=new Yo(this),this.people={set:function(t,i,r){var s=z(t)?v({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=z(t)?v({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return m.info("send",t)})}return C(n,[{key:"init",value:function(e,t,i){if(i&&i!==Ye){var r,s=(r=mt[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),mt[i]=s,mt[Ye][i]=s,s}return this._init(e,t,i)}},{key:"_init",value:function(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(S(e)||ci(e))return m.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 m.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(J({},nr(),ir(s),{name:o,token:e})),this.compression=s.disable_compression?void 0:le.Base64,this.persistence=new on(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new on(b(b({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new fo(function(y){return r._send_retriable_request(y)}),this._retryQueue=new Ro(this),this.__request_queue=[],this.sessionManager=new Io(this.config,this.persistence),this.sessionPropsManager=new Uo(this.sessionManager,this.persistence),new Qo(this).startIfEnabledOrStop(),this.sessionRecording=new uo(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Vo(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Wo(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Xo(this),this.exceptionObserver=new Jo(this),this.exceptionObserver.startIfEnabled(),ve.DEBUG=ve.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,u,c=this.config.get_device_id(Me()),d=(a=s.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?c:s.bootstrap.distinctID;this.persistence.set_property(ke,(u=s.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var l,f,h=Object.keys(((l=s.bootstrap)===null||l===void 0?void 0:l.featureFlags)||{}).filter(function(y){var k,E;return!((k=s.bootstrap)===null||k===void 0||(E=k.featureFlags)===null||E===void 0||!E[y])}).reduce(function(y,k){var E,R;return y[k]=((E=s.bootstrap)===null||E===void 0||(R=E.featureFlags)===null||R===void 0?void 0:R[k])||!1,y},{}),g=Object.keys(((f=s.bootstrap)===null||f===void 0?void 0:f.featureFlagPayloads)||{}).filter(function(y){return h[y]}).reduce(function(y,k){var E,R,O,P;return(E=s.bootstrap)!==null&&E!==void 0&&(R=E.featureFlagPayloads)!==null&&R!==void 0&&R[k]&&(y[k]=(O=s.bootstrap)===null||O===void 0||(P=O.featureFlagPayloads)===null||P===void 0?void 0:P[k]),y},{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:g})}if(!this.get_distinct_id()){var _=this.config.get_device_id(Me());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(ke,"anonymous")}return p==null||(i=p.addEventListener)===null||i===void 0||i.call(p,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?Co(this,function(){return r._loaded()}):this._loaded(),ce(this.config._onCapture)&&this.on("eventCaptured",function(y){return r.config._onCapture(y.event,y)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o,a,u;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=I(e.supportedCompression,le.GZipJS)?le.GZipJS:I(e.supportedCompression,le.Base64)?le.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),(i=this.sessionRecording)===null||i===void 0||i.afterDecideResponse(e),(r=this.autocapture)===null||r===void 0||r.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.surveys)===null||o===void 0||o.afterDecideResponse(e),(a=this.webVitalsAutocapture)===null||a===void 0||a.afterDecideResponse(e),(u=this.exceptionObserver)===null||u===void 0||u.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(i){m.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){w&&e.capture("$pageview",{title:w.title},{send_instantly:!0})},1),t||(new lo(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Ze(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(t=this._retryQueue)===null||t===void 0||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(Kr?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Vt(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=b({},i);a.timeout=a.timeout||6e4,a.url=Vt(a.url,{_:new Date().getTime().toString(),ver:ve.LIB_VERSION,compression:a.compression});var u=(r=a.transport)!==null&&r!==void 0?r:"XHR",c=(s=(o=lr(gt,function(d){return d.transport===u}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:gt[0].method;if(!c)throw new Error("No available transport method");c(a)}(b(b({},e),{},{callback:function(i){var r,s,o;t.rateLimiter.checkForLimiting(i),i.statusCode>=400&&((s=(o=t.config).on_request_error)===null||s===void 0||s.call(o,i)),(r=e.callback)===null||r===void 0||r.call(e,i)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,i=this,r=[],s=[],o=[];Ze(e,function(u){u&&(t=u[0],H(t)?o.push(u):ce(u)?u.call(i):H(u)&&t==="alias"?r.push(u):H(u)&&t.indexOf("capture")!==-1&&ce(i[t])?o.push(u):s.push(u))});var a=function(u,c){Ze(u,function(d){if(H(d[0])){var l=c;T(d,function(f){l=l[f[0]].apply(l,f.slice(1))})}else this[d[0]].apply(this,d.slice(1))},c)};a(r,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,i){var r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return m.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!S(e)&&z(e)){if(!N||this.config.opt_out_useragent_filter||!Ki(N,this.config.custom_blocked_useragents)){var s=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o={uuid:Me(),event:e,properties:this._calculate_event_properties(e,t||{},i)};s&&(o.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(o.$set=i?.$set);var a=this._calculate_set_once_properties(i?.$set_once);a&&(o.$set_once=a),(o=ys(o,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i?.timestamp||new Date,S(i?.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var u=b(b({},o.properties.$set),o.$set);en(u)||this.setPersonPropertiesForFlags(u),this._internalEventEmitter.emit("eventCaptured",o);var c={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._send_retriable_request(c):this._requestQueue.enqueue(c),o}m.critical("This capture call is ignored due to client rate limiting.")}}else m.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(t){return e(t.event,t)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=b({},t);if(s.token=this.config.token,e==="$snapshot"){var o=b(b({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!z(s.distinct_id)&&!ue(s.distinct_id)||ci(s.distinct_id))&&m.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var a=U.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),c=u.sessionId,d=u.windowId;s.$session_id=c,s.$window_id=d}if(this.requestRouter.region===Ue.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var l=this.sessionPropsManager.getSessionProps();s=J(s,l)}if(!this.config.disable_scroll_properties){var f={};e==="$pageview"?f=this.pageViewManager.doPageView():e==="$pageleave"&&(f=this.pageViewManager.doPageLeave()),s=J(s,f)}if(e==="$pageview"&&w&&(s.title=w.title),!S(r)){var h=new Date().getTime()-r;s.$duration=parseFloat((h/1e3).toFixed(3))}if(N&&this.config.opt_out_useragent_filter&&(s.$browser_type=Ki(N,this.config.custom_blocked_useragents)?"bot":"browser"),(s=J({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),i==null||!i._noHeatmaps){var g,_=(g=this.heatmaps)===null||g===void 0?void 0:g.getAndClearBuffer();_&&(s.$heatmap_data=_)}H(this.config.property_denylist)?T(this.config.property_denylist,function(k){delete s[k]}):m.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;return y&&(s=y(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=J({},this.persistence.get_initial_props(),e||{});return en(t)?void 0:t}},{key:"register",value:function(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}},{key:"register_once",value:function(e,t,i){var r;(r=this.persistence)===null||r===void 0||r.register_once(e,t,i)}},{key:"register_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}},{key:"unregister",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(v({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"getNextSurveyStep",value:function(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}},{key:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return m.uninitializedWarning("posthog.identify");if(ue(e)&&(e=e.toString(),m.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()))m.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(dt)&&(this.unregister(dt),this.register({distinct_id:e}));var o=(this.persistence.get_property(ke)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(ke,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(qt))}}else m.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:b(b({},r),{},v({},e,t))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags(v({},e,i))),r[e]===t||i||this.reloadFeatureFlags()}}else m.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,i,r,s;if(!this.__loaded)return m.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(r=this.persistence)===null||r===void 0||r.set_property(ke,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(Me());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionId,r=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(i));if(e!=null&&e.withTimestamp&&r){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;var u=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);s+="?t=".concat(u)}return s}},{key:"alias",value:function(e,t){return e===this.get_property(cr)?(m.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(S(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(dt,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(m.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,i,r,s,o=b({},this.config);X(e)&&(J(this.config,ir(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new on(b(b({},this.config),{},{persistence:"sessionStorage"})),B.is_supported()&&B.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(ve.DEBUG=!0),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(r=this.autocapture)===null||r===void 0||r.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){if(e!=null&&e.sampling){var t,i,r=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId();(i=this.persistence)===null||i===void 0||i.register(v({},pt,!0)),m.info("Session recording started with sampling override for session: ",r?.sessionId)}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Ye;return t!==Ye&&(t=Ye+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(ke))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(ke))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&en(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[dt])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[Bt]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return this.config.person_profiles==="never"?(m.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Bt,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,i,r,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==a&&((i=this.persistence)===null||i===void 0||i.set_disabled(a)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==a&&((r=this.sessionPersistence)===null||r===void 0||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(S(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(e){e===!1?(p?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(p?.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}))}}]),n}();(function(n,e){for(var t=0;t<e.length;t++)n.prototype[e[t]]=ms(n.prototype[e[t]])})(Zr,["identify"]);var rr,es=(rr=mt[Ye]=new Zr,function(){function n(){n.done||(n.done=!0,Kr=!1,T(mt,function(e){e._dom_loaded()}))}w!=null&&w.addEventListener&&(w.readyState==="complete"?n():w.addEventListener("DOMContentLoaded",n,!1)),p&&Se(p,"load",n,!0)}(),rr);var ts=Et(as()),ns=Et(us()),Ge=Et(si());if(typeof Node=="function"&&Node.prototype){let n=Node.prototype.removeChild;Node.prototype.removeChild=function(t){return t.parentNode!==this?(console&&console.error("Cannot remove a child from a different parent",t,this),t):n.apply(this,arguments)};let e=Node.prototype.insertBefore;Node.prototype.insertBefore=function(t,i){return i&&i.parentNode!==this?(console&&console.error("Cannot insert before a reference node from a different parent",i,this),t):e.apply(this,arguments)}}function Zo(){return(0,ts.useEffect)(()=>{es.init("phc_B9KHXgLyLnpmC4ut4x8ZRSRD6O5dYu5NUD70T98Mq5T",{api_host:"https://us.i.posthog.com",person_profiles:"identified_only",autocapture:!1,capture_pageview:!1,capture_pageleave:!1,capture_performance:!1,disable_session_recording:!0,rageclick:!1})}),null}(0,ns.hydrate)((0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(ri,{}),(0,Ge.jsx)(Zo,{})]}),document);ai("IDTXBQDM",{url:"https://cdn.usefathom.com/script.js",spa:"history",excludedDomains:["localhost","127.0.0.1"]});
