posthog-js 1.83.2 → 1.83.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}Object.defineProperty(exports,"__esModule",{value:!0});var m={DEBUG:!1,LIB_VERSION:"1.83.2"},y=Array.prototype,b=Object.prototype,w=b.toString,k=b.hasOwnProperty,S="undefined"!=typeof window?window:{},x=S.navigator||{userAgent:""},E=S.document||{},F=x.userAgent,P=["localhost","127.0.0.1"],O=y.forEach,I=y.indexOf,$=Array.isArray,R={},T="[PostHog.js]",C={_log:function(e){if((m.DEBUG||window.POSTHOG_DEBUG)&&!U(window.console)&&window.console){for(var t=("__rrweb_original__"in window.console[e]?window.console[e].__rrweb_original__:window.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[T].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];C._log.apply(C,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];C._log.apply(C,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];C._log.apply(C,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[T].concat(n))},unintializedWarning:function(e){C.error("You must initialize PostHog before calling ".concat(e))}},M=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function A(e,t,n){if(Array.isArray(e))if(O&&e.forEach===O)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===R)return}function D(e,t,n){if(null!=e){if(Array.isArray(e))return A(e,t,n);for(var r in e)if(k.call(e,r)&&t.call(n,e[r],r)===R)return}}var j=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return A(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},N=$||function(e){return"[object Array]"===w.call(e)},L=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function H(e,t){return-1!==e.indexOf(t)}var B=function(e){return e===Object(e)&&!N(e)},q=function(e){if(B(e)){for(var t in e)if(k.call(e,t))return!1;return!0}return!1},U=function(e){return void 0===e},V=function(e){return"[object String]"==w.call(e)},z=function(e){return"[object Number]"==w.call(e)},W=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},G=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Y=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){C.critical("Implementation error. Please turn on debug and contact support@posthog.com."),C.critical(e)}}},Q=function(e){var t={};return D(e,(function(e,n){V(e)&&e.length>0&&(t[n]=e)})),t};var J=["$performance_raw"];function X(e,t){return n=e,r=function(e,n){return n&&J.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),N(t)?(o=[],A(t,(function(t){o.push(e(t))}))):(o={},D(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}function K(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,c="",l=[];if(!e)return e;e=Z(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[u++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(c=l.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}var Z=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},ee=["ahrefsbot","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","hubspot","linkedinbot","mj12bot","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","twitterbot","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"],te=function(e,t){return ee.concat(t).some((function(t){return e.includes?e.includes(t):-1!==e.indexOf(t)}))},ne=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch(e){C.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},re=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},ie=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){return function(i){if(i=i||e(window.event)){var o,s=!0;L(r)&&(o=r(i));var a=n.call(t,i);return!1!==o&&!1!==a||(s=!1),s}}}(t,r,a)}else C.error("No valid element provided to register_event")}}();function oe(e,t){var n=function(){var n=E.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=E.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):E.body.appendChild(n)};E.body?n():E.addEventListener("DOMContentLoaded",n)}var se={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return D(t,(function(e){var t=ne(E.URL,e);t.length&&(n[e]=t)})),n},searchEngine:function(){var e=E.referrer;return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=se.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(null!==e){n.$search_engine=e;var r=ne(E.referrer,t);r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||H(e," OPR/")?H(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":H(e,"IEMobile")||H(e,"WPDesktop")?"Internet Explorer Mobile":H(e,"SamsungBrowser/")?"Samsung Internet":H(e,"Edge")||H(e,"Edg/")?"Microsoft Edge":H(e,"FBIOS")?"Facebook Mobile":H(e,"Chrome")?"Chrome":H(e,"CriOS")?"Chrome iOS":H(e,"UCWEB")||H(e,"UCBrowser")?"UC Browser":H(e,"FxiOS")?"Firefox iOS":H(t,"Apple")?H(e,"Mobile")?"Mobile Safari":"Safari":H(e,"Android")?"Android Mobile":H(e,"Konqueror")?"Konqueror":H(e,"Firefox")?"Firefox":H(e,"MSIE")||H(e,"Trident/")?"Internet Explorer":H(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[se.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return x.language||x.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return E.referrer||"$direct"},referringDomain:function(){if(!E.referrer)return"$direct";var e=E.createElement("a");return e.href=E.referrer,e.host},properties:function(){var e=se.os(F),t=e.os_name,n=e.os_version;return j(Q({$os:t,$os_version:n,$browser:se.browser(F,x.vendor,S.opera),$device:se.device(F),$device_type:se.deviceType(F)}),{$current_url:null==S?void 0:S.location.href,$host:null==S?void 0:S.location.host,$pathname:null==S?void 0:S.location.pathname,$browser_version:se.browserVersion(F,x.vendor,S.opera),$browser_language:se.browserLanguage(),$screen_height:null==S?void 0:S.screen.height,$screen_width:null==S?void 0:S.screen.width,$viewport_height:null==S?void 0:S.innerHeight,$viewport_width:null==S?void 0:S.innerWidth,$lib:"web",$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:G()/1e3})},people_properties:function(){var e=se.os(F),t=e.os_name,n=e.os_version;return j(Q({$os:t,$os_version:n,$browser:se.browser(F,x.vendor,S.opera)}),{$browser_version:se.browserVersion(F,x.vendor,S.opera)})}};function ae(e){switch(n(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function ue(e){var t="";return he(e)&&!ge(e)&&e.childNodes&&e.childNodes.length&&D(e.childNodes,(function(e){de(e)&&e.textContent&&(t+=M(e.textContent).split(/(\s+)/).filter(_e).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),M(t)}function ce(e){return!!e&&1===e.nodeType}function le(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function de(e){return!!e&&3===e.nodeType}function fe(e){return!!e&&11===e.nodeType}var pe=["a","button","form","input","select","textarea","label"];function he(e){for(var t=e;t.parentNode&&!le(t,"body");t=t.parentNode){var n=ae(t).split(" ");if(H(n,"ph-sensitive")||H(n,"ph-no-capture"))return!1}if(H(ae(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if("string"==typeof i){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function ge(e){return!!(le(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||le(e,"select")||le(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function _e(e){if(null===e||U(e))return!1;if("string"==typeof e){e=M(e);if(/^(?:(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}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function ve(e){var t=ue(e);return _e(t="".concat(t," ").concat(me(e)).trim())?t:""}function me(e){var t="";return e&&e.childNodes&&e.childNodes.length&&D(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=ue(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(me(e)).trim())}catch(e){C.error(e)}})),t}var ye=function(){function e(t){r(this,e),this.clicks=[],this.enabled=t}return o(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),be="$people_distinct_id",we="__alias",ke="__timers",Se="$autocapture_disabled_server_side",xe="$session_recording_enabled_server_side",Ee="$console_log_recording_enabled_server_side",Fe="$session_recording_recorder_version_server_side",Pe="$sesid",Oe="$enabled_feature_flags",Ie="$early_access_features",$e="$stored_person_properties",Re="$stored_group_properties",Te="$surveys",Ce="$flag_call_reported",Me="$user_state",Ae="$posthog_quota_limited",De=[be,we,"__cmpns",ke,xe,Pe,Oe,Me,Ae,Ie,Re,$e,Te,Ce];function je(e,t){return t.length>e?t.slice(0,e)+"...":t}var Ne={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=null===this._isDisabledServerSide?!(null===(t=e.persistence)||void 0===t||!t.props[Se]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!ce(t));return t},_getAugmentPropertiesFromElement:function(e){if(!he(e))return{};var t={};return D(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&_e(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};pe.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=je(1024,ve(e)):o.$el_text=je(1024,ue(e)));var s=ae(e);s.length>0&&(o.classes=s.split(" ").filter((function(e){return""!==e})));var a=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;D(e.attributes,(function(n){var r;ge(e)&&-1===["name","id","class"].indexOf(n.name)||(null!=a&&a.includes(n.name)||!t&&_e(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(o["attr__"+n.name]=je(1024,n.value)))}));for(var u=1,c=1,l=e;l=this._previousElementSibling(l);)u++,l.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return D(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),_e(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return D(this._customProperties,(function(r){D(r.event_selectors,(function(i){D(document.querySelectorAll(i),(function(i){H(e,i)&&he(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);(de(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));if(o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||le(e,"html")||!ce(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,i=n.url_allowlist;if(i&&!i.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var s=n.element_allowlist;if(s&&!s.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var a=n.css_selector_allowlist;if(a&&!a.some((function(t){return e.matches(t)})))return!1}for(var u=!1,c=[e],l=!0,d=e;d.parentNode&&!le(d,"body");)if(fe(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(pe.indexOf(l.tagName.toLowerCase())>-1)u=!0;else{var f=window.getComputedStyle(l);f&&"pointer"===f.getPropertyValue("cursor")&&(u=!0)}c.push(l),d=l}var p=window.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return u?"click"===t.type:"click"===t.type&&(pe.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var s,a,u=[o],c=o;c.parentNode&&!le(c,"body");)fe(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var l,d=[],f={},p=!1;if(D(u,(function(e){var n=he(e);"a"===e.tagName.toLowerCase()&&(l=e.getAttribute("href"),l=n&&_e(l)&&l),H(ae(e).split(" "),"ph-no-capture")&&(p=!0),d.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var i=r._getAugmentPropertiesFromElement(e);j(f,i)})),t.config.mask_all_text||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?d[0].$el_text=ve(o):d[0].$el_text=ue(o)),l&&(d[0].attr__href=l),p)return!1;var h=j(this._getDefaultProperties(e.type),{$elements:d},null!==(s=d[0])&&void 0!==s&&s.$el_text?{$el_text:null===(a=d[0])||void 0===a?void 0:a.$el_text}:{},this._getCustomProperties(u),f);return t.capture(i,h),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};ie(document,"submit",n,!1,!0),ie(document,"change",n,!1,!0),ie(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;"boolean"!=typeof e.__autocapture&&(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new ye(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?C.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(s({},Se,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=U(t)?10:t,n=U(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return L(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(Ne),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Y(e[t]))}(Ne);var Le="$active_feature_flags",He="$override_feature_flags",Be="$feature_flag_payloads",qe=function(e){var t,n={},r=v(function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}(e||{}));try{for(r.s();!(t=r.n()).done;){var i=p(t.value,2),o=i[0],s=i[1];s&&(n[o]=s)}}catch(e){r.e(e)}finally{r.f()}return n},Ue=function(){function e(t){r(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return o(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Oe),t=this.instance.get_property(He);if(!t)return e||{};for(var n=j({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(C.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Be)||{}}},{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;this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property($e),r=this.instance.get_property(Re),i=K(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:i},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(Ce)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))Array.isArray(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(s({},Ce,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}C.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&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);C.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){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();!function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,a=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var u,c={};if(o)for(var l=0;l<o.length;l++)c[o[l]]=!0;n&&n.register((s(u={},Le,o),s(u,Oe,c),u))}else{var d,f=o,p=a;e.errorsWhileComputingFlags&&(f=t(t({},r),f),p=t(t({},i),p)),n&&n.register((s(d={},Le,Object.keys(qe(f))),s(d,Oe,f||{}),s(d,Be,p||{}),d))}}(e,this.instance.persistence,n,r),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return C.unintializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(He);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(s({},He,t))}else this.instance.persistence.register(s({},He,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=s({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},s({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((s(i={},Le,Object.keys(qe(a))),s(i,Oe,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Ie);if(r&&!n)return e(r);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},(function(n){var r,i=n.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(s({},Ie,i)),e(i)}))}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),t=e.flags,n=e.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(t,n)}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property($e)||{};this.instance.register(s({},$e,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister($e)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Re)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(s({},Re,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(Re)||{};this.instance.register(s({},Re,t(t({},n),{},s({},e,{}))))}else this.instance.unregister(Re)}}]),e}(),Ve=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,ze={is_supported:function(){return!0},error:function(e){C.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null},parse:function(e){var t;try{t=JSON.parse(ze.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){try{var o="",s="",a="";if(r){var u=document.location.hostname.match(Ve),c=u?u[0]:"";o=c?"; domain=."+c:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+a;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{ze.set(e,"",-1,t)}catch(e){return}}},We=null,Ge={is_supported:function(){if(null!==We)return We;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";Ge.set(t,"xyz"),'"xyz"'!==Ge.get(t)&&(e=!1),Ge.remove(t)}catch(t){e=!1}else e=!1;return e||C.error("localStorage unsupported; falling back to cookie store"),We=e,e},error:function(e){C.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){Ge.error(e)}return null},parse:function(e){try{return JSON.parse(Ge.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){Ge.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){Ge.error(e)}}},Ye=["distinct_id",Pe],Qe=t(t({},Ge),{},{parse:function(e){try{var t={};try{t=ze.parse(e)||{}}catch(e){}var n=j(t,JSON.parse(Ge.get(e)||"{}"));return Ge.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{Ge.set(e,t);var o={};Ye.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&ze.set(e,o,n,r,i)}catch(e){Ge.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),ze.remove(e,t)}catch(e){Ge.error(e)}}}),Je={},Xe={is_supported:function(){return!0},error:function(e){C.error("memoryStorage error: "+e)},get:function(e){return Je[e]||null},parse:function(e){return Je[e]||null},set:function(e,t){Je[e]=t},remove:function(e){delete Je[e]}},Ke=null,Ze={is_supported:function(){if(null!==Ke)return Ke;if(Ke=!0,"undefined"!=typeof window)try{var e="__support__";Ze.set(e,"xyz"),'"xyz"'!==Ze.get(e)&&(Ke=!1),Ze.remove(e)}catch(e){Ke=!1}else Ke=!1;return Ke},error:function(e){C.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){Ze.error(e)}return null},parse:function(e){try{return JSON.parse(Ze.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Ze.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){Ze.error(e)}}},et=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],tt=function(){function e(t){r(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog",-1===et.indexOf(t.persistence.toLowerCase())&&(C.critical("Unknown persistence type "+t.persistence+"; falling back to cookie"),t.persistence="cookie");var i=t.persistence.toLowerCase();"localstorage"===i&&Ge.is_supported()?this.storage=Ge:"localstorage+cookie"===i&&Qe.is_supported()?this.storage=Qe:"sessionstorage"===i&&Ze.is_supported()?this.storage=Ze:this.storage="memory"===i?Xe:ze,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return o(e,[{key:"properties",value:function(){var e={};return D(this.props,(function(t,r){if(r===Oe&&"object"===n(t))for(var i=Object.keys(t),o=0;o<i.length;o++)e["$feature/".concat(i[o])]=t[i[o]];else a=r,u=!1,(null===(s=De)?u:I&&s.indexOf===I?-1!=s.indexOf(a):(D(s,(function(e){if(u||(u=e===a))return R})),u))||(e[r]=t);var s,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,n){var r=this;if(B(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var i=!1;if(D(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(B(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(D(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,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(se.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(se.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||se.referrer(),$referring_domain:this.props.$referring_domain||se.referringDomain()})}},{key:"get_referrer_info",value:function(){return Q({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return D(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){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)}},{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 n=this.props[ke]||{};n[e]=t,this.props[ke]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ke]||{})[e];return U(t)||(delete this.props[ke][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Me]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Me]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[Ae]||{}}},{key:"set_quota_limits",value:function(e){this.props[Ae]=e,this.save()}}]),e}(),nt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",rt=2,it=4,ot=3,st=6,at=0,ut=5e6;var ct="rrweb/console@1";var lt,dt=o((function e(t){var n,i,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),s(this,"bucketSize",100),s(this,"refillRate",10),s(this,"mutationBuckets",{}),s(this,"loggedTracker",{}),s(this,"refillBuckets",(function(){Object.keys(o.mutationBuckets).forEach((function(e){o.mutationBuckets[e]=o.mutationBuckets[e]+o.refillRate,o.mutationBuckets[e]>=o.bucketSize&&delete o.mutationBuckets[e]}))})),s(this,"getNodeOrRelevantParent",(function(e){var t=o.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[o.rrweb.mirror.getId(n),n]}return[e,t]})),s(this,"numberOfChanges",(function(e){var t,n,r,i,o,s,a,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==a?a:0)})),s(this,"throttleMutations",(function(e){if(e.type!==ot||e.data.source!==at)return e;var t=e.data,n=o.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,i=p(o.getNodeOrRelevantParent(e.id),2),s=i[0],a=i[1];if(0===o.mutationBuckets[s])return!1;(o.mutationBuckets[s]=null!==(t=o.mutationBuckets[s])&&void 0!==t?t:o.bucketSize,o.mutationBuckets[s]=Math.max(o.mutationBuckets[s]-1,0),0===o.mutationBuckets[s])&&(o.loggedTracker[s]||(o.loggedTracker[s]=!0,null===(n=(r=o.options).onBlockedNode)||void 0===n||n.call(r,s,a)));return e})));var r=o.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=a,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(i=this.options.bucketSize)&&void 0!==i?i:this.bucketSize,setInterval((function(){o.refillBuckets()}),1e3)})),ft=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(ft||{}),pt="/s/";!function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(lt||(lt={}));var ht=[lt.MouseMove,lt.MouseInteraction,lt.Scroll,lt.ViewportResize,lt.Input,lt.TouchMove,lt.MediaInteraction,lt.Drag],gt=function(){function e(t){var n=this;r(this,e),s(this,"_lastActivityTimestamp",Date.now()),s(this,"isIdle",!1),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this._endpoint=pt,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1,S.addEventListener("beforeunload",(function(){n._flushBuffer()}))}return o(e,[{key:"lastActivityTimestamp",get:function(){return this._lastActivityTimestamp}},{key:"endpoint",get:function(){return this._endpoint}},{key:"getSessionManager",value:function(){if(this.instance.sessionManager)return this.instance.sessionManager;C.error("Session recording started without valid sessionManager")}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(xe),t=!this.instance.config.disable_session_recording;return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(Ee),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(Fe);return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,a;(this.receivedDecide=!0,this.instance.persistence)&&this.instance.persistence.register((s(o={},xe,!!e.sessionRecording),s(o,Ee,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),s(o,Fe,null===(i=e.sessionRecording)||void 0===i?void 0:i.recorderVersion),o));null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this._endpoint=null===(a=e.sessionRecording)||void 0===a?void 0:a.endpoint);null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:G()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshotBuffered(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){var e=this,t=this.getSessionManager();if(t&&void 0!==Object.assign&&!this.captureStarted&&!this.instance.config.disable_session_recording){this.captureStarted=!0,t.checkAndGetSessionAndWindowId();var n="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?oe(this.instance.config.api_host+"/static/".concat(n,"?v=").concat(m.LIB_VERSION),(function(t){if(t)return C.error("Could not load ".concat(n),t);e._onScriptLoaded()})):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var t;return e.type===ot&&-1!==ht.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.getSessionManager();if(t){var n=this._isInteractiveEvent(e);if(n||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0),n&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var r=t.checkAndGetSessionAndWindowId(!n,e.timestamp),i=r.windowId,o=r.sessionId;-1!==[rt,it].indexOf(e.type)||this.windowId===i&&this.sessionId===o||this._tryTakeFullSnapshot(),this.windowId=i,this.sessionId=o}}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this.captureStarted)return!1;try{var e;return null===(e=this.rrwebRecord)||void 0===e||e.takeFullSnapshot(),!0}catch(e){return C.error("Error taking full snapshot.",e),!1}}},{key:"_onScriptLoaded",value:function(){var e,n=this,r={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};this.rrwebRecord=S.rrweb?S.rrweb.record:S.rrwebRecord;for(var i=this.instance.config.session_recording,o=0,s=Object.entries(i||{});o<s.length;o++){var a=p(s[o],2),u=a[0],c=a[1];u in r&&(r[u]=c)}this.rrwebRecord?(this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new dt(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");C.info(r,{node:t}),n.log("[PostHog Recorder] "+r,"warn")}}),this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:S.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[S.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t,r=n._maskUrl(S.location.href);if(!r)return;null===(t=n.rrwebRecord)||void 0===t||t.addCustomEvent("$pageview",{href:r})}}catch(e){C.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):C.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(e){if(e&&"object"===n(e)){if(e.type===ft.Meta){var t=this._maskUrl(e.data.href);if(!t)return;e.data.href=t}var r=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(r){var i=function(e){var t=JSON.stringify(e);if(t.length>ut){var n,r=v(t.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim));try{for(r.s();!(n=r.n()).done;){var i=n.value;t="image/"===i[1].toLocaleLowerCase().slice(0,6)?t.replace(i[0],nt):t.replace(i[0],"")}}catch(e){r.e(e)}finally{r.f()}}return{event:JSON.parse(t),size:t.length}}(function(e){var t=e;if(t&&"object"===n(t)&&t.type===st&&"object"===n(t.data)&&t.data.plugin===ct){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;i<t.data.payload.payload.length;i++)t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?r.push(t.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):r.push(t.data.payload.payload[i]);return t.data.payload.payload=r,e}return e}(r)),o=i.event,s=i.size;if(this._updateWindowAndSessionIds(o),!this.isIdle){var a={$snapshot_bytes:s,$snapshot_data:o,$session_id:this.sessionId,$window_id:this.windowId};this.emit?this._captureSnapshotBuffered(a):this.snapshots.push(a)}}}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"_flushBuffer",value:function(){return this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0),this.buffer&&0!==this.buffer.data.length&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||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(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===rt}})}}]),e}(),_t={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},vt=["first-input","navigation","paint","resource"],mt=["/s/","/e/"],yt=function(){function e(t){r(this,e),s(this,"_forceAllowLocalhost",!1),this.instance=t}return o(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e,t,n=this;if(!this.observer)if(void 0!==(null===(e=window)||void 0===e||null===(t=e.PerformanceObserver)||void 0===t?void 0:t.supportedEntryTypes))if(!P.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver((function(e){e.getEntries().forEach((function(e){n._capturePerformanceEvent(e)}))}));var r=PerformanceObserver.supportedEntryTypes.filter((function(e){return vt.includes(e)}));r.forEach((function(e){var t;null===(t=n.observer)||void 0===t||t.observe({type:e,buffered:!0})}))}catch(e){C.error("PostHog failed to start performance observer",e),this.stopObserving()}else C.info("[PerformanceObserver] not started because we are on localhost.");else C.info("[PerformanceObserver] not started because PerformanceObserver is not supported by this browser.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.config.capture_performance)&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(0===e.name.indexOf(this.instance.config.api_host)){var t=e.name.replace(this.instance.config.api_host,"");if(mt.find((function(e){return 0===t.indexOf(e)})))return}var n={url:e.name},r=this.instance.config.session_recording;if(r.maskNetworkRequestFn&&(n=r.maskNetworkRequestFn(n)),n){var i=e.toJSON();i.name=n.url;var o={},a=Math.floor(Date.now()-performance.now());for(var u in o[_t.timeOrigin]=a,o[_t.timestamp]=Math.floor(a+e.startTime),_t)void 0!==i[u]&&(o[_t[u]]=i[u]);if(this.capturePerformanceEvent(o),bt(e)){var c,l=v(e.serverTiming||[]);try{for(l.s();!(c=l.n()).done;){var d,f=c.value;this.capturePerformanceEvent((s(d={},_t.timeOrigin,a),s(d,_t.timestamp,Math.floor(a+e.startTime)),s(d,_t.name,f.name),s(d,_t.duration,f.duration),s(d,_t.entryType,"serverTiming"),d))}}catch(e){l.e(e)}finally{l.f()}}}}},{key:"capturePerformanceEvent",value:function(e){var t,n=e[_t.timestamp];null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:e},timestamp:n})}}]),e}(),bt=function(e){return"navigation"===e.entryType||"resource"===e.entryType},wt=function(){function e(t){r(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return o(e,[{key:"call",value:function(){var e=this,t=K(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property($e),group_properties:this.instance.get_property(Re),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("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n,r,i,o=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),0!==(null==e?void 0:e.status)){if(!document||!document.body)return C.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){o.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),Ne.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),null===(r=this.instance.exceptionAutocapture)||void 0===r||r.afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.config.disable_compression){var s,a={},u=v(e.supportedCompression);try{for(u.s();!(s=u.n()).done;){a[s.value]=!0}}catch(e){u.e(e)}finally{u.f()}this.instance.compression=a}var c=null===(i=window)||void 0===i?void 0:i.extendPostHogWithSurveys;if(e.surveys&&!c&&oe(this.instance.config.api_host+"/static/surveys.js",(function(e){if(e)return C.error("Could not load surveys script",e);window.extendPostHogWithSurveys(o.instance)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var l,d=this.instance.config.api_host,f=v(e.siteApps);try{var p=function(){var e=l.value,t=e.id,n=e.url,r=[d,"/"===d[d.length-1]&&"/"===n[0]?n.substring(1):n].join("");window["__$$ph_site_app_".concat(t)]=o.instance,oe(r,(function(e){e&&C.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(f.s();!(l=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}}else e.siteApps.length>0&&C.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else C.error("Failed to fetch feature flags from PostHog.")}}]),e}(),kt=["https://app.posthog.com","https://eu.posthog.com"],St=["source"],xt=function(){function e(t){r(this,e),this.instance=t}return o(e,[{key:"afterDecideResponse",value:function(e){var n=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&n.toolbarVersion&&0===n.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(t({},n))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!t){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(e){return!1}t=window.localStorage}var r,i=re(e.hash,"__posthog")||re(e.hash,"state"),o=i?JSON.parse(decodeURIComponent(i)):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var n=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=this.instance.config.api_host,i=3e5,o=Math.floor(Date.now()/i)*i,s="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?t=").concat(o),a=!kt.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,u=t(t({token:this.instance.config.token},e),{},{apiURL:r},a?{instrument:!1}:{});u.source;var c=l(u,St);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(c)),oe(s,(function(e){e?C.error("Failed to load toolbar",e):(window.ph_load_toolbar||window.ph_load_editor)(u,n.instance)})),ie(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,n.loadToolbar(u)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;return this.maybeLoadToolbar(e,t,n)}}]),e}(),Et="__ph_opt_in_out_";function Ft(e,t){Mt(!0,e,t)}function Pt(e,t){Mt(!1,e,t)}function Ot(e,t){return"1"===Ct(e,t)}function It(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||S,n=t.navigator||{},r=!1;return D([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){H([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Ct(e,t)}function $t(e,t){Rt(t=t||{}).remove(Tt(e,t),!!t.crossSubdomainCookie)}function Rt(e){return"localStorage"===(e=e||{}).persistenceType?Ge:"localStorage+cookie"===e.persistenceType?Qe:ze}function Tt(e,t){return((t=t||{}).persistencePrefix||Et)+e}function Ct(e,t){return Rt(t).get(Tt(e,t))}function Mt(e,t,n){V(t)&&t.length?(Rt(n=n||{}).set(Tt(t,n),e?1:0,z(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):C.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var At=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;r(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return o(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),Dt=function(e){a(i,At);var n=f(i);function i(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return r(this,i),(t=n.call(this,o)).handlePollRequest=e,t}return o(i,[{key:"enqueue",value:function(e,t,n){this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,s=r.options;D(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,s)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var n=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var r=Object.values(n);[].concat(h(r.filter((function(e){return 0===e.url.indexOf("/e")}))),h(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(n){var r=n.url,i=n.data,o=n.options;e.handlePollRequest(r,i,t(t({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return D(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;void 0===e[o]&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),i}(),jt=Uint8Array,Nt=Uint16Array,Lt=Uint32Array,Ht=new jt([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]),Bt=new jt([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]),qt=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ut=function(e,t){for(var n=new Nt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Lt(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Vt=Ut(Ht,2),zt=Vt[0],Wt=Vt[1];zt[28]=258,Wt[258]=28;for(var Gt=Ut(Bt,0)[1],Yt=new Nt(32768),Qt=0;Qt<32768;++Qt){var Jt=(43690&Qt)>>>1|(21845&Qt)<<1;Jt=(61680&(Jt=(52428&Jt)>>>2|(13107&Jt)<<2))>>>4|(3855&Jt)<<4,Yt[Qt]=((65280&Jt)>>>8|(255&Jt)<<8)>>>1}var Xt=function(e,t,n){for(var r=e.length,i=0,o=new Nt(t);i<r;++i)++o[e[i]-1];var s,a=new Nt(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new Nt(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)s[Yt[d]>>>u]=c}else for(s=new Nt(r),i=0;i<r;++i)s[i]=Yt[a[e[i]-1]++]>>>15-e[i];return s},Kt=new jt(288);for(Qt=0;Qt<144;++Qt)Kt[Qt]=8;for(Qt=144;Qt<256;++Qt)Kt[Qt]=9;for(Qt=256;Qt<280;++Qt)Kt[Qt]=7;for(Qt=280;Qt<288;++Qt)Kt[Qt]=8;var Zt=new jt(32);for(Qt=0;Qt<32;++Qt)Zt[Qt]=5;var en,tn=Xt(Kt,9,0),nn=Xt(Zt,5,0),rn=function(e){return(e/8>>0)+(7&e&&1)},on=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Nt?Nt:e instanceof Lt?Lt:jt)(n-t);return r.set(e.subarray(t,n)),r},sn=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},an=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},un=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new jt(0),0];if(1==i){var s=new jt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],u=n[1],c=0,l=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};l!=i-1;)a=n[n[c].f<n[d].f?c++:d++],u=n[c!=l&&n[c].f<n[d].f?c++:d++],n[l++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new Nt(f+1),h=cn(n[l-1],p,0);if(h>t){r=0;var g=0,_=h-t,v=1<<_;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var m=o[r].s;if(!(p[m]>t))break;g+=v-(1<<h-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=o[r].s;p[y]<t?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;p[b]==t&&(--p[b],++g)}h=t}return[new jt(p),h]},cn=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},ln=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Nt(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},dn=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},fn=function(e,t,n){var r=n.length,i=rn(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},pn=function(e,t,n,r,i,o,s,a,u,c,l){sn(t,l++,n),++i[256];for(var d=un(i,15),f=d[0],p=d[1],h=un(o,15),g=h[0],_=h[1],v=ln(f),m=v[0],y=v[1],b=ln(g),w=b[0],k=b[1],S=new Nt(19),x=0;x<m.length;++x)S[31&m[x]]++;for(x=0;x<w.length;++x)S[31&w[x]]++;for(var E=un(S,7),F=E[0],P=E[1],O=19;O>4&&!F[qt[O-1]];--O);var I,$,R,T,C=c+5<<3,M=dn(i,Kt)+dn(o,Zt)+s,A=dn(i,f)+dn(o,g)+s+14+3*O+dn(S,F)+(2*S[16]+3*S[17]+7*S[18]);if(C<=M&&C<=A)return fn(t,l,e.subarray(u,u+c));if(sn(t,l,1+(A<M)),l+=2,A<M){I=Xt(f,p,0),$=f,R=Xt(g,_,0),T=g;var D=Xt(F,P,0);sn(t,l,y-257),sn(t,l+5,k-1),sn(t,l+10,O-4),l+=14;for(x=0;x<O;++x)sn(t,l+3*x,F[qt[x]]);l+=3*O;for(var j=[m,w],N=0;N<2;++N){var L=j[N];for(x=0;x<L.length;++x){var H=31&L[x];sn(t,l,D[H]),l+=F[H],H>15&&(sn(t,l,L[x]>>>5&127),l+=L[x]>>>12)}}}else I=tn,$=Kt,R=nn,T=Zt;for(x=0;x<a;++x)if(r[x]>255){H=r[x]>>>18&31;an(t,l,I[H+257]),l+=$[H+257],H>7&&(sn(t,l,r[x]>>>23&31),l+=Ht[H]);var B=31&r[x];an(t,l,R[B]),l+=T[B],B>3&&(an(t,l,r[x]>>>5&8191),l+=Bt[B])}else an(t,l,I[r[x]]),l+=$[r[x]];return an(t,l,I[256]),l+$[256]},hn=new Lt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),gn=new jt(0),_n=function(){for(var e=new Lt(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),vn=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=_n[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},mn=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new jt(r+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(r,a.length-i),c=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d<s?c=fn(u,c,e.subarray(l,d)):(u[l]=o,c=fn(u,c,e.subarray(l,s)))}else{for(var f=hn[t-1],p=f>>>13,h=8191&f,g=(1<<n)-1,_=new Nt(32768),v=new Nt(g+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new Lt(25e3),k=new Nt(288),S=new Nt(32),x=0,E=0,F=(l=0,0),P=0,O=0;l<s;++l){var I=b(l),$=32767&l,R=v[I];if(_[$]=R,v[I]=$,P<=l){var T=s-l;if((x>7e3||F>24576)&&T>423){c=pn(e,u,0,w,k,S,E,F,O,l-O,c),F=x=E=0,O=l;for(var C=0;C<286;++C)k[C]=0;for(C=0;C<30;++C)S[C]=0}var M=2,A=0,D=h,j=$-R&32767;if(T>2&&I==b(l-j))for(var N=Math.min(p,T)-1,L=Math.min(32767,l),H=Math.min(258,T);j<=L&&--D&&$!=R;){if(e[l+M]==e[l+M-j]){for(var B=0;B<H&&e[l+B]==e[l+B-j];++B);if(B>M){if(M=B,A=j,B>N)break;var q=Math.min(j,B-2),U=0;for(C=0;C<q;++C){var V=l-j+C+32768&32767,z=V-_[V]+32768&32767;z>U&&(U=z,R=V)}}}j+=($=R)-(R=_[$])+32768&32767}if(A){w[F++]=268435456|Wt[M]<<18|Gt[A];var W=31&Wt[M],G=31&Gt[A];E+=Ht[W]+Bt[G],++k[257+W],++S[G],P=l+M,++x}else w[F++]=e[l],++k[e[l]]}}c=pn(e,u,o,w,k,S,E,F,O,l-O,c),o||(c=fn(u,c,gn))}return on(a,0,r+rn(c)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},yn=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},bn=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&yn(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},wn=function(e){return 10+(e.filename&&e.filename.length+1||0)};function kn(e,t){void 0===t&&(t={});var n=vn(),r=e.length;n.p(e);var i=mn(e,t,wn(t),8),o=i.length;return bn(i,t),yn(i,o-8,n.d()),yn(i,o-4,r),i}function Sn(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new jt(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new jt(i+8+(n-s<<1));a.set(r),r=a}var u=e.charCodeAt(s);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return on(r,0,i)}exports.Compression=void 0,(en=exports.Compression||(exports.Compression={})).GZipJS="gzip-js",en.Base64="base64";var xn=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=m.LIB_VERSION;var i=e.split("?");if(i.length>1){var o,s=v(i[1].split("&"));try{for(s.s();!(o=s.n()).done;){var a=o.value.split("=")[0];r[a]&&delete r[a]}}catch(e){s.e(e)}finally{s.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return D(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t})),i.join(r)}(r)},En=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}if("POST"!==n.method)return null;var i,o;return i=Array.isArray(t)||(o=t,"[object Uint8Array]"===Object.prototype.toString.call(o))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i},Fn=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.callback,s=e.retriesPerformedSoFar,a=e.retryQueue,u=e.onXHRError,c=e.timeout,l=void 0===c?6e4:c,d=e.onResponse,f=new XMLHttpRequest;f.open(i.method||"GET",t,!0);var p=En(n,i);D(r,(function(e,t){f.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=l,f.withCredentials=!0,f.onreadystatechange=function(){if(4===f.readyState)if(null==d||d(f),200===f.status){if(o){var e;try{e=JSON.parse(f.responseText)}catch(e){return void C.error(e)}o(e)}}else"function"==typeof u&&u(f),(f.status<400||f.status>500)&&a.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(s||0)+1,callback:o}),null==o||o({status:0})},f.send(p)},Pn=18e5;var On=function(e){a(i,At);var n=f(i);function i(e,t){var o;return r(this,i),(o=n.call(this)).isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=e,o.rateLimiter=t,"undefined"!=typeof window&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return o(i,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(Pn,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=new Date(Date.now()+n);this.queue.push({retryAt:r,requestData:e}),C.warn("Enqueued failed request for retry in ".concat(n)),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._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=v(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,n=v(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestData,i=r.url,o=r.data,s=r.options;if(this.rateLimiter.isRateLimited(s._batchKey))C.warn("[RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(i,En(o,t(t({},s),{},{sendBeacon:!0})))}catch(e){C.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,s=e.retriesPerformedSoFar;this.rateLimiter.isRateLimited(r._batchKey)||Fn({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:s||0,callback:o,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),i}();
1
+ "use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}Object.defineProperty(exports,"__esModule",{value:!0});var m={DEBUG:!1,LIB_VERSION:"1.83.3"},y=Array.prototype,b=Object.prototype,w=b.toString,k=b.hasOwnProperty,S="undefined"!=typeof window?window:{},x=S.navigator||{userAgent:""},E=S.document||{},F=x.userAgent,P=["localhost","127.0.0.1"],O=y.forEach,I=y.indexOf,$=Array.isArray,R={},T="[PostHog.js]",C={_log:function(e){if((m.DEBUG||window.POSTHOG_DEBUG)&&!U(window.console)&&window.console){for(var t=("__rrweb_original__"in window.console[e]?window.console[e].__rrweb_original__:window.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[T].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];C._log.apply(C,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];C._log.apply(C,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];C._log.apply(C,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[T].concat(n))},unintializedWarning:function(e){C.error("You must initialize PostHog before calling ".concat(e))}},M=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function A(e,t,n){if(Array.isArray(e))if(O&&e.forEach===O)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===R)return}function D(e,t,n){if(null!=e){if(Array.isArray(e))return A(e,t,n);for(var r in e)if(k.call(e,r)&&t.call(n,e[r],r)===R)return}}var j=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return A(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},N=$||function(e){return"[object Array]"===w.call(e)},L=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function H(e,t){return-1!==e.indexOf(t)}var B=function(e){return e===Object(e)&&!N(e)},q=function(e){if(B(e)){for(var t in e)if(k.call(e,t))return!1;return!0}return!1},U=function(e){return void 0===e},V=function(e){return"[object String]"==w.call(e)},z=function(e){return"[object Number]"==w.call(e)},W=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},G=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Y=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){C.critical("Implementation error. Please turn on debug and contact support@posthog.com."),C.critical(e)}}},Q=function(e){var t={};return D(e,(function(e,n){V(e)&&e.length>0&&(t[n]=e)})),t};var J=["$performance_raw"];function X(e,t){return n=e,r=function(e,n){return n&&J.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),N(t)?(o=[],A(t,(function(t){o.push(e(t))}))):(o={},D(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}function K(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,c="",l=[];if(!e)return e;e=Z(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[u++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(c=l.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}var Z=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},ee=["ahrefsbot","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","hubspot","linkedinbot","mj12bot","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","twitterbot","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"],te=function(e,t){return ee.concat(t).some((function(t){return e.includes?e.includes(t):-1!==e.indexOf(t)}))},ne=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch(e){C.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},re=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},ie=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){return function(i){if(i=i||e(window.event)){var o,s=!0;L(r)&&(o=r(i));var a=n.call(t,i);return!1!==o&&!1!==a||(s=!1),s}}}(t,r,a)}else C.error("No valid element provided to register_event")}}();function oe(e,t){var n=function(){var n=E.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=E.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):E.body.appendChild(n)};E.body?n():E.addEventListener("DOMContentLoaded",n)}var se={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return D(t,(function(e){var t=ne(E.URL,e);t.length&&(n[e]=t)})),n},searchEngine:function(){var e=E.referrer;return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=se.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(null!==e){n.$search_engine=e;var r=ne(E.referrer,t);r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||H(e," OPR/")?H(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":H(e,"IEMobile")||H(e,"WPDesktop")?"Internet Explorer Mobile":H(e,"SamsungBrowser/")?"Samsung Internet":H(e,"Edge")||H(e,"Edg/")?"Microsoft Edge":H(e,"FBIOS")?"Facebook Mobile":H(e,"Chrome")?"Chrome":H(e,"CriOS")?"Chrome iOS":H(e,"UCWEB")||H(e,"UCBrowser")?"UC Browser":H(e,"FxiOS")?"Firefox iOS":H(t,"Apple")?H(e,"Mobile")?"Mobile Safari":"Safari":H(e,"Android")?"Android Mobile":H(e,"Konqueror")?"Konqueror":H(e,"Firefox")?"Firefox":H(e,"MSIE")||H(e,"Trident/")?"Internet Explorer":H(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[se.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return x.language||x.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return E.referrer||"$direct"},referringDomain:function(){if(!E.referrer)return"$direct";var e=E.createElement("a");return e.href=E.referrer,e.host},properties:function(){var e=se.os(F),t=e.os_name,n=e.os_version;return j(Q({$os:t,$os_version:n,$browser:se.browser(F,x.vendor,S.opera),$device:se.device(F),$device_type:se.deviceType(F)}),{$current_url:null==S?void 0:S.location.href,$host:null==S?void 0:S.location.host,$pathname:null==S?void 0:S.location.pathname,$browser_version:se.browserVersion(F,x.vendor,S.opera),$browser_language:se.browserLanguage(),$screen_height:null==S?void 0:S.screen.height,$screen_width:null==S?void 0:S.screen.width,$viewport_height:null==S?void 0:S.innerHeight,$viewport_width:null==S?void 0:S.innerWidth,$lib:"web",$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:G()/1e3})},people_properties:function(){var e=se.os(F),t=e.os_name,n=e.os_version;return j(Q({$os:t,$os_version:n,$browser:se.browser(F,x.vendor,S.opera)}),{$browser_version:se.browserVersion(F,x.vendor,S.opera)})}};function ae(e){switch(n(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function ue(e){var t="";return he(e)&&!ge(e)&&e.childNodes&&e.childNodes.length&&D(e.childNodes,(function(e){de(e)&&e.textContent&&(t+=M(e.textContent).split(/(\s+)/).filter(_e).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),M(t)}function ce(e){return!!e&&1===e.nodeType}function le(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function de(e){return!!e&&3===e.nodeType}function fe(e){return!!e&&11===e.nodeType}var pe=["a","button","form","input","select","textarea","label"];function he(e){for(var t=e;t.parentNode&&!le(t,"body");t=t.parentNode){var n=ae(t).split(" ");if(H(n,"ph-sensitive")||H(n,"ph-no-capture"))return!1}if(H(ae(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if("string"==typeof i){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function ge(e){return!!(le(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||le(e,"select")||le(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function _e(e){if(null===e||U(e))return!1;if("string"==typeof e){e=M(e);if(/^(?:(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}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function ve(e){var t=ue(e);return _e(t="".concat(t," ").concat(me(e)).trim())?t:""}function me(e){var t="";return e&&e.childNodes&&e.childNodes.length&&D(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=ue(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(me(e)).trim())}catch(e){C.error(e)}})),t}var ye=function(){function e(t){r(this,e),this.clicks=[],this.enabled=t}return o(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),be="$people_distinct_id",we="__alias",ke="__timers",Se="$autocapture_disabled_server_side",xe="$session_recording_enabled_server_side",Ee="$console_log_recording_enabled_server_side",Fe="$session_recording_recorder_version_server_side",Pe="$sesid",Oe="$enabled_feature_flags",Ie="$early_access_features",$e="$stored_person_properties",Re="$stored_group_properties",Te="$surveys",Ce="$flag_call_reported",Me="$user_state",Ae="$posthog_quota_limited",De=[be,we,"__cmpns",ke,xe,Pe,Oe,Me,Ae,Ie,Re,$e,Te,Ce];function je(e,t){return t.length>e?t.slice(0,e)+"...":t}var Ne={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=null===this._isDisabledServerSide?!(null===(t=e.persistence)||void 0===t||!t.props[Se]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!ce(t));return t},_getAugmentPropertiesFromElement:function(e){if(!he(e))return{};var t={};return D(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&_e(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};pe.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=je(1024,ve(e)):o.$el_text=je(1024,ue(e)));var s=ae(e);s.length>0&&(o.classes=s.split(" ").filter((function(e){return""!==e})));var a=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;D(e.attributes,(function(n){var r;ge(e)&&-1===["name","id","class"].indexOf(n.name)||(null!=a&&a.includes(n.name)||!t&&_e(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(o["attr__"+n.name]=je(1024,n.value)))}));for(var u=1,c=1,l=e;l=this._previousElementSibling(l);)u++,l.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return D(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),_e(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return D(this._customProperties,(function(r){D(r.event_selectors,(function(i){D(document.querySelectorAll(i),(function(i){H(e,i)&&he(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);(de(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));if(o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||le(e,"html")||!ce(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,i=n.url_allowlist;if(i&&!i.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var s=n.element_allowlist;if(s&&!s.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var a=n.css_selector_allowlist;if(a&&!a.some((function(t){return e.matches(t)})))return!1}for(var u=!1,c=[e],l=!0,d=e;d.parentNode&&!le(d,"body");)if(fe(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(pe.indexOf(l.tagName.toLowerCase())>-1)u=!0;else{var f=window.getComputedStyle(l);f&&"pointer"===f.getPropertyValue("cursor")&&(u=!0)}c.push(l),d=l}var p=window.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return u?"click"===t.type:"click"===t.type&&(pe.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var s,a,u=[o],c=o;c.parentNode&&!le(c,"body");)fe(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var l,d=[],f={},p=!1;if(D(u,(function(e){var n=he(e);"a"===e.tagName.toLowerCase()&&(l=e.getAttribute("href"),l=n&&_e(l)&&l),H(ae(e).split(" "),"ph-no-capture")&&(p=!0),d.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var i=r._getAugmentPropertiesFromElement(e);j(f,i)})),t.config.mask_all_text||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?d[0].$el_text=ve(o):d[0].$el_text=ue(o)),l&&(d[0].attr__href=l),p)return!1;var h=j(this._getDefaultProperties(e.type),{$elements:d},null!==(s=d[0])&&void 0!==s&&s.$el_text?{$el_text:null===(a=d[0])||void 0===a?void 0:a.$el_text}:{},this._getCustomProperties(u),f);return t.capture(i,h),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};ie(document,"submit",n,!1,!0),ie(document,"change",n,!1,!0),ie(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;"boolean"!=typeof e.__autocapture&&(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new ye(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?C.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(s({},Se,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=U(t)?10:t,n=U(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return L(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(Ne),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Y(e[t]))}(Ne);var Le="$active_feature_flags",He="$override_feature_flags",Be="$feature_flag_payloads",qe=function(e){var t,n={},r=v(function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}(e||{}));try{for(r.s();!(t=r.n()).done;){var i=p(t.value,2),o=i[0],s=i[1];s&&(n[o]=s)}}catch(e){r.e(e)}finally{r.f()}return n},Ue=function(){function e(t){r(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return o(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Oe),t=this.instance.get_property(He);if(!t)return e||{};for(var n=j({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(C.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Be)||{}}},{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;this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property($e),r=this.instance.get_property(Re),i=K(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0}));this.instance._send_request(this.instance.config.api_host+"/decide/?v=3",{data:i},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(Ce)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))Array.isArray(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(s({},Ce,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}C.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&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);C.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){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();!function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,a=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var u,c={};if(o)for(var l=0;l<o.length;l++)c[o[l]]=!0;n&&n.register((s(u={},Le,o),s(u,Oe,c),u))}else{var d,f=o,p=a;e.errorsWhileComputingFlags&&(f=t(t({},r),f),p=t(t({},i),p)),n&&n.register((s(d={},Le,Object.keys(qe(f))),s(d,Oe,f||{}),s(d,Be,p||{}),d))}}(e,this.instance.persistence,n,r),this._fireFeatureFlagsCallbacks()}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return C.unintializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(He);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(s({},He,t))}else this.instance.persistence.register(s({},He,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=s({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},s({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((s(i={},Le,Object.keys(qe(a))),s(i,Oe,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Ie);if(r&&!n)return e(r);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},(function(n){var r,i=n.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(s({},Ie,i)),e(i)}))}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var e=this._prepareFeatureFlagsForCallbacks(),t=e.flags,n=e.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(t,n)}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property($e)||{};this.instance.register(s({},$e,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister($e)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Re)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(s({},Re,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(Re)||{};this.instance.register(s({},Re,t(t({},n),{},s({},e,{}))))}else this.instance.unregister(Re)}}]),e}(),Ve=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,ze={is_supported:function(){return!0},error:function(e){C.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null},parse:function(e){var t;try{t=JSON.parse(ze.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){try{var o="",s="",a="";if(r){var u=document.location.hostname.match(Ve),c=u?u[0]:"";o=c?"; domain=."+c:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+a;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{ze.set(e,"",-1,t)}catch(e){return}}},We=null,Ge={is_supported:function(){if(null!==We)return We;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";Ge.set(t,"xyz"),'"xyz"'!==Ge.get(t)&&(e=!1),Ge.remove(t)}catch(t){e=!1}else e=!1;return e||C.error("localStorage unsupported; falling back to cookie store"),We=e,e},error:function(e){C.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){Ge.error(e)}return null},parse:function(e){try{return JSON.parse(Ge.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){Ge.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){Ge.error(e)}}},Ye=["distinct_id",Pe],Qe=t(t({},Ge),{},{parse:function(e){try{var t={};try{t=ze.parse(e)||{}}catch(e){}var n=j(t,JSON.parse(Ge.get(e)||"{}"));return Ge.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{Ge.set(e,t);var o={};Ye.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&ze.set(e,o,n,r,i)}catch(e){Ge.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),ze.remove(e,t)}catch(e){Ge.error(e)}}}),Je={},Xe={is_supported:function(){return!0},error:function(e){C.error("memoryStorage error: "+e)},get:function(e){return Je[e]||null},parse:function(e){return Je[e]||null},set:function(e,t){Je[e]=t},remove:function(e){delete Je[e]}},Ke=null,Ze={is_supported:function(){if(null!==Ke)return Ke;if(Ke=!0,"undefined"!=typeof window)try{var e="__support__";Ze.set(e,"xyz"),'"xyz"'!==Ze.get(e)&&(Ke=!1),Ze.remove(e)}catch(e){Ke=!1}else Ke=!1;return Ke},error:function(e){C.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){Ze.error(e)}return null},parse:function(e){try{return JSON.parse(Ze.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Ze.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){Ze.error(e)}}},et=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],tt=function(){function e(t){r(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog",-1===et.indexOf(t.persistence.toLowerCase())&&(C.critical("Unknown persistence type "+t.persistence+"; falling back to cookie"),t.persistence="cookie");var i=t.persistence.toLowerCase();"localstorage"===i&&Ge.is_supported()?this.storage=Ge:"localstorage+cookie"===i&&Qe.is_supported()?this.storage=Qe:"sessionstorage"===i&&Ze.is_supported()?this.storage=Ze:this.storage="memory"===i?Xe:ze,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return o(e,[{key:"properties",value:function(){var e={};return D(this.props,(function(t,r){if(r===Oe&&"object"===n(t))for(var i=Object.keys(t),o=0;o<i.length;o++)e["$feature/".concat(i[o])]=t[i[o]];else a=r,u=!1,(null===(s=De)?u:I&&s.indexOf===I?-1!=s.indexOf(a):(D(s,(function(e){if(u||(u=e===a))return R})),u))||(e[r]=t);var s,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,n){var r=this;if(B(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var i=!1;if(D(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(B(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(D(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,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(se.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(se.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||se.referrer(),$referring_domain:this.props.$referring_domain||se.referringDomain()})}},{key:"get_referrer_info",value:function(){return Q({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return D(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){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)}},{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 n=this.props[ke]||{};n[e]=t,this.props[ke]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ke]||{})[e];return U(t)||(delete this.props[ke][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Me]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Me]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[Ae]||{}}},{key:"set_quota_limits",value:function(e){this.props[Ae]=e,this.save()}}]),e}(),nt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",rt=2,it=4,ot=3,st=6,at=0,ut=5e6;var ct="rrweb/console@1";var lt,dt=o((function e(t){var n,i,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,e),s(this,"bucketSize",100),s(this,"refillRate",10),s(this,"mutationBuckets",{}),s(this,"loggedTracker",{}),s(this,"refillBuckets",(function(){Object.keys(o.mutationBuckets).forEach((function(e){o.mutationBuckets[e]=o.mutationBuckets[e]+o.refillRate,o.mutationBuckets[e]>=o.bucketSize&&delete o.mutationBuckets[e]}))})),s(this,"getNodeOrRelevantParent",(function(e){var t=o.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[o.rrweb.mirror.getId(n),n]}return[e,t]})),s(this,"numberOfChanges",(function(e){var t,n,r,i,o,s,a,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==a?a:0)})),s(this,"throttleMutations",(function(e){if(e.type!==ot||e.data.source!==at)return e;var t=e.data,n=o.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,i=p(o.getNodeOrRelevantParent(e.id),2),s=i[0],a=i[1];if(0===o.mutationBuckets[s])return!1;(o.mutationBuckets[s]=null!==(t=o.mutationBuckets[s])&&void 0!==t?t:o.bucketSize,o.mutationBuckets[s]=Math.max(o.mutationBuckets[s]-1,0),0===o.mutationBuckets[s])&&(o.loggedTracker[s]||(o.loggedTracker[s]=!0,null===(n=(r=o.options).onBlockedNode)||void 0===n||n.call(r,s,a)));return e})));var r=o.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=a,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(i=this.options.bucketSize)&&void 0!==i?i:this.bucketSize,setInterval((function(){o.refillBuckets()}),1e3)})),ft=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(ft||{}),pt="/s/";!function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(lt||(lt={}));var ht=[lt.MouseMove,lt.MouseInteraction,lt.Scroll,lt.ViewportResize,lt.Input,lt.TouchMove,lt.MediaInteraction,lt.Drag],gt=function(){function e(t){var n=this;r(this,e),s(this,"_lastActivityTimestamp",Date.now()),s(this,"isIdle",!1),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this._endpoint=pt,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1,S.addEventListener("beforeunload",(function(){n._flushBuffer()}))}return o(e,[{key:"lastActivityTimestamp",get:function(){return this._lastActivityTimestamp}},{key:"endpoint",get:function(){return this._endpoint}},{key:"getSessionManager",value:function(){if(this.instance.sessionManager)return this.instance.sessionManager;C.error("Session recording started without valid sessionManager")}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(xe),t=!this.instance.config.disable_session_recording;return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(Ee),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(Fe);return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,a;(this.receivedDecide=!0,this.instance.persistence)&&this.instance.persistence.register((s(o={},xe,!!e.sessionRecording),s(o,Ee,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),s(o,Fe,null===(i=e.sessionRecording)||void 0===i?void 0:i.recorderVersion),o));null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this._endpoint=null===(a=e.sessionRecording)||void 0===a?void 0:a.endpoint);null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:G()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshotBuffered(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){var e=this,t=this.getSessionManager();if(t&&void 0!==Object.assign&&!this.captureStarted&&!this.instance.config.disable_session_recording){this.captureStarted=!0,t.checkAndGetSessionAndWindowId();var n="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?oe(this.instance.config.api_host+"/static/".concat(n,"?v=").concat(m.LIB_VERSION),(function(t){if(t)return C.error("Could not load ".concat(n),t);e._onScriptLoaded()})):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var t;return e.type===ot&&-1!==ht.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.getSessionManager();if(t){var n=this._isInteractiveEvent(e);if(n||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0),n&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var r=t.checkAndGetSessionAndWindowId(!n,e.timestamp),i=r.windowId,o=r.sessionId;-1!==[rt,it].indexOf(e.type)||this.windowId===i&&this.sessionId===o||this._tryTakeFullSnapshot(),this.windowId=i,this.sessionId=o}}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this.captureStarted)return!1;try{var e;return null===(e=this.rrwebRecord)||void 0===e||e.takeFullSnapshot(),!0}catch(e){return C.error("Error taking full snapshot.",e),!1}}},{key:"_onScriptLoaded",value:function(){var e,n=this,r={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};this.rrwebRecord=S.rrweb?S.rrweb.record:S.rrwebRecord;for(var i=this.instance.config.session_recording,o=0,s=Object.entries(i||{});o<s.length;o++){var a=p(s[o],2),u=a[0],c=a[1];u in r&&(r[u]=c)}this.rrwebRecord?(this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new dt(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");C.info(r,{node:t}),n.log("[PostHog Recorder] "+r,"warn")}}),this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:S.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[S.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t,r=n._maskUrl(S.location.href);if(!r)return;null===(t=n.rrwebRecord)||void 0===t||t.addCustomEvent("$pageview",{href:r})}}catch(e){C.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1):C.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(e){if(e&&"object"===n(e)){if(e.type===ft.Meta){var t=this._maskUrl(e.data.href);if(!t)return;e.data.href=t}var r=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(r){var i=function(e){var t=JSON.stringify(e);if(t.length>ut){var n,r=v(t.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim));try{for(r.s();!(n=r.n()).done;){var i=n.value;t="image/"===i[1].toLocaleLowerCase().slice(0,6)?t.replace(i[0],nt):t.replace(i[0],"")}}catch(e){r.e(e)}finally{r.f()}}return{event:JSON.parse(t),size:t.length}}(function(e){var t=e;if(t&&"object"===n(t)&&t.type===st&&"object"===n(t.data)&&t.data.plugin===ct){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;i<t.data.payload.payload.length;i++)t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?r.push(t.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):r.push(t.data.payload.payload[i]);return t.data.payload.payload=r,e}return e}(r)),o=i.event,s=i.size;if(this._updateWindowAndSessionIds(o),!this.isIdle){var a={$snapshot_bytes:s,$snapshot_data:o,$session_id:this.sessionId,$window_id:this.windowId};this.emit?this._captureSnapshotBuffered(a):this.snapshots.push(a)}}}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"_flushBuffer",value:function(){return this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0),this.buffer&&0!==this.buffer.data.length&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||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(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this._endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===rt}})}}]),e}(),_t={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},vt=["first-input","navigation","paint","resource"],mt=["/s/","/e/"],yt=function(){function e(t){r(this,e),s(this,"_forceAllowLocalhost",!1),this.instance=t}return o(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e,t,n=this;if(!this.observer)if(void 0!==(null===(e=window)||void 0===e||null===(t=e.PerformanceObserver)||void 0===t?void 0:t.supportedEntryTypes))if(!P.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver((function(e){e.getEntries().forEach((function(e){n._capturePerformanceEvent(e)}))}));var r=PerformanceObserver.supportedEntryTypes.filter((function(e){return vt.includes(e)}));r.forEach((function(e){var t;null===(t=n.observer)||void 0===t||t.observe({type:e,buffered:!0})}))}catch(e){C.error("PostHog failed to start performance observer",e),this.stopObserving()}else C.info("[PerformanceObserver] not started because we are on localhost.");else C.info("[PerformanceObserver] not started because PerformanceObserver is not supported by this browser.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.config.capture_performance)&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(0===e.name.indexOf(this.instance.config.api_host)){var t=e.name.replace(this.instance.config.api_host,"");if(mt.find((function(e){return 0===t.indexOf(e)})))return}var n={url:e.name},r=this.instance.config.session_recording;if(r.maskNetworkRequestFn&&(n=r.maskNetworkRequestFn(n)),n){var i=e.toJSON();i.name=n.url;var o={},a=Math.floor(Date.now()-performance.now());for(var u in o[_t.timeOrigin]=a,o[_t.timestamp]=Math.floor(a+e.startTime),_t)void 0!==i[u]&&(o[_t[u]]=i[u]);if(this.capturePerformanceEvent(o),bt(e)){var c,l=v(e.serverTiming||[]);try{for(l.s();!(c=l.n()).done;){var d,f=c.value;this.capturePerformanceEvent((s(d={},_t.timeOrigin,a),s(d,_t.timestamp,Math.floor(a+e.startTime)),s(d,_t.name,f.name),s(d,_t.duration,f.duration),s(d,_t.entryType,"serverTiming"),d))}}catch(e){l.e(e)}finally{l.f()}}}}},{key:"capturePerformanceEvent",value:function(e){var t,n=e[_t.timestamp];null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:e},timestamp:n})}}]),e}(),bt=function(e){return"navigation"===e.entryType||"resource"===e.entryType},wt=function(){function e(t){r(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return o(e,[{key:"call",value:function(){var e=this,t=K(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property($e),group_properties:this.instance.get_property(Re),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("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n,r,i,o=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),0!==(null==e?void 0:e.status)){if(!document||!document.body)return C.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){o.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),Ne.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),null===(r=this.instance.exceptionAutocapture)||void 0===r||r.afterDecideResponse(e),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.config.disable_compression){var s,a={},u=v(e.supportedCompression);try{for(u.s();!(s=u.n()).done;){a[s.value]=!0}}catch(e){u.e(e)}finally{u.f()}this.instance.compression=a}var c=null===(i=window)||void 0===i?void 0:i.extendPostHogWithSurveys;if(e.surveys&&!c&&oe(this.instance.config.api_host+"/static/surveys.js",(function(e){if(e)return C.error("Could not load surveys script",e);window.extendPostHogWithSurveys(o.instance)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var l,d=this.instance.config.api_host,f=v(e.siteApps);try{var p=function(){var e=l.value,t=e.id,n=e.url,r=[d,"/"===d[d.length-1]&&"/"===n[0]?n.substring(1):n].join("");window["__$$ph_site_app_".concat(t)]=o.instance,oe(r,(function(e){e&&C.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(f.s();!(l=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}}else e.siteApps.length>0&&C.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else C.error("Failed to fetch feature flags from PostHog.")}}]),e}(),kt=["https://app.posthog.com","https://eu.posthog.com"],St=["source"],xt=function(){function e(t){r(this,e),this.instance=t}return o(e,[{key:"afterDecideResponse",value:function(e){var n=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&n.toolbarVersion&&0===n.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(t({},n))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!t){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(e){return!1}t=window.localStorage}var r,i=re(e.hash,"__posthog")||re(e.hash,"state"),o=i?JSON.parse(decodeURIComponent(i)):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var n=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=this.instance.config.api_host,i=3e5,o=Math.floor(Date.now()/i)*i,s="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?t=").concat(o),a=!kt.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,u=t(t({token:this.instance.config.token},e),{},{apiURL:r},a?{instrument:!1}:{});u.source;var c=l(u,St);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(c)),oe(s,(function(e){e?C.error("Failed to load toolbar",e):(window.ph_load_toolbar||window.ph_load_editor)(u,n.instance)})),ie(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,n.loadToolbar(u)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;return this.maybeLoadToolbar(e,t,n)}}]),e}(),Et="__ph_opt_in_out_";function Ft(e,t){Mt(!0,e,t)}function Pt(e,t){Mt(!1,e,t)}function Ot(e,t){return"1"===Ct(e,t)}function It(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||S,n=t.navigator||{},r=!1;return D([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){H([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Ct(e,t)}function $t(e,t){Rt(t=t||{}).remove(Tt(e,t),!!t.crossSubdomainCookie)}function Rt(e){return"localStorage"===(e=e||{}).persistenceType?Ge:"localStorage+cookie"===e.persistenceType?Qe:ze}function Tt(e,t){return((t=t||{}).persistencePrefix||Et)+e}function Ct(e,t){return Rt(t).get(Tt(e,t))}function Mt(e,t,n){V(t)&&t.length?(Rt(n=n||{}).set(Tt(t,n),e?1:0,z(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):C.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var At=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;r(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return o(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),Dt=function(e){a(i,At);var n=f(i);function i(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return r(this,i),(t=n.call(this,o)).handlePollRequest=e,t}return o(i,[{key:"enqueue",value:function(e,t,n){this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,s=r.options;D(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,s)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var n=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var r=Object.values(n);[].concat(h(r.filter((function(e){return 0===e.url.indexOf("/e")}))),h(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(n){var r=n.url,i=n.data,o=n.options;e.handlePollRequest(r,i,t(t({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return D(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;void 0===e[o]&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),i}(),jt=Uint8Array,Nt=Uint16Array,Lt=Uint32Array,Ht=new jt([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]),Bt=new jt([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]),qt=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ut=function(e,t){for(var n=new Nt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Lt(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Vt=Ut(Ht,2),zt=Vt[0],Wt=Vt[1];zt[28]=258,Wt[258]=28;for(var Gt=Ut(Bt,0)[1],Yt=new Nt(32768),Qt=0;Qt<32768;++Qt){var Jt=(43690&Qt)>>>1|(21845&Qt)<<1;Jt=(61680&(Jt=(52428&Jt)>>>2|(13107&Jt)<<2))>>>4|(3855&Jt)<<4,Yt[Qt]=((65280&Jt)>>>8|(255&Jt)<<8)>>>1}var Xt=function(e,t,n){for(var r=e.length,i=0,o=new Nt(t);i<r;++i)++o[e[i]-1];var s,a=new Nt(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new Nt(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)s[Yt[d]>>>u]=c}else for(s=new Nt(r),i=0;i<r;++i)s[i]=Yt[a[e[i]-1]++]>>>15-e[i];return s},Kt=new jt(288);for(Qt=0;Qt<144;++Qt)Kt[Qt]=8;for(Qt=144;Qt<256;++Qt)Kt[Qt]=9;for(Qt=256;Qt<280;++Qt)Kt[Qt]=7;for(Qt=280;Qt<288;++Qt)Kt[Qt]=8;var Zt=new jt(32);for(Qt=0;Qt<32;++Qt)Zt[Qt]=5;var en,tn=Xt(Kt,9,0),nn=Xt(Zt,5,0),rn=function(e){return(e/8>>0)+(7&e&&1)},on=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Nt?Nt:e instanceof Lt?Lt:jt)(n-t);return r.set(e.subarray(t,n)),r},sn=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},an=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},un=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new jt(0),0];if(1==i){var s=new jt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],u=n[1],c=0,l=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};l!=i-1;)a=n[n[c].f<n[d].f?c++:d++],u=n[c!=l&&n[c].f<n[d].f?c++:d++],n[l++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new Nt(f+1),h=cn(n[l-1],p,0);if(h>t){r=0;var g=0,_=h-t,v=1<<_;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var m=o[r].s;if(!(p[m]>t))break;g+=v-(1<<h-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=o[r].s;p[y]<t?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;p[b]==t&&(--p[b],++g)}h=t}return[new jt(p),h]},cn=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},ln=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Nt(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},dn=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},fn=function(e,t,n){var r=n.length,i=rn(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},pn=function(e,t,n,r,i,o,s,a,u,c,l){sn(t,l++,n),++i[256];for(var d=un(i,15),f=d[0],p=d[1],h=un(o,15),g=h[0],_=h[1],v=ln(f),m=v[0],y=v[1],b=ln(g),w=b[0],k=b[1],S=new Nt(19),x=0;x<m.length;++x)S[31&m[x]]++;for(x=0;x<w.length;++x)S[31&w[x]]++;for(var E=un(S,7),F=E[0],P=E[1],O=19;O>4&&!F[qt[O-1]];--O);var I,$,R,T,C=c+5<<3,M=dn(i,Kt)+dn(o,Zt)+s,A=dn(i,f)+dn(o,g)+s+14+3*O+dn(S,F)+(2*S[16]+3*S[17]+7*S[18]);if(C<=M&&C<=A)return fn(t,l,e.subarray(u,u+c));if(sn(t,l,1+(A<M)),l+=2,A<M){I=Xt(f,p,0),$=f,R=Xt(g,_,0),T=g;var D=Xt(F,P,0);sn(t,l,y-257),sn(t,l+5,k-1),sn(t,l+10,O-4),l+=14;for(x=0;x<O;++x)sn(t,l+3*x,F[qt[x]]);l+=3*O;for(var j=[m,w],N=0;N<2;++N){var L=j[N];for(x=0;x<L.length;++x){var H=31&L[x];sn(t,l,D[H]),l+=F[H],H>15&&(sn(t,l,L[x]>>>5&127),l+=L[x]>>>12)}}}else I=tn,$=Kt,R=nn,T=Zt;for(x=0;x<a;++x)if(r[x]>255){H=r[x]>>>18&31;an(t,l,I[H+257]),l+=$[H+257],H>7&&(sn(t,l,r[x]>>>23&31),l+=Ht[H]);var B=31&r[x];an(t,l,R[B]),l+=T[B],B>3&&(an(t,l,r[x]>>>5&8191),l+=Bt[B])}else an(t,l,I[r[x]]),l+=$[r[x]];return an(t,l,I[256]),l+$[256]},hn=new Lt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),gn=new jt(0),_n=function(){for(var e=new Lt(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),vn=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=_n[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},mn=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new jt(r+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(r,a.length-i),c=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d<s?c=fn(u,c,e.subarray(l,d)):(u[l]=o,c=fn(u,c,e.subarray(l,s)))}else{for(var f=hn[t-1],p=f>>>13,h=8191&f,g=(1<<n)-1,_=new Nt(32768),v=new Nt(g+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new Lt(25e3),k=new Nt(288),S=new Nt(32),x=0,E=0,F=(l=0,0),P=0,O=0;l<s;++l){var I=b(l),$=32767&l,R=v[I];if(_[$]=R,v[I]=$,P<=l){var T=s-l;if((x>7e3||F>24576)&&T>423){c=pn(e,u,0,w,k,S,E,F,O,l-O,c),F=x=E=0,O=l;for(var C=0;C<286;++C)k[C]=0;for(C=0;C<30;++C)S[C]=0}var M=2,A=0,D=h,j=$-R&32767;if(T>2&&I==b(l-j))for(var N=Math.min(p,T)-1,L=Math.min(32767,l),H=Math.min(258,T);j<=L&&--D&&$!=R;){if(e[l+M]==e[l+M-j]){for(var B=0;B<H&&e[l+B]==e[l+B-j];++B);if(B>M){if(M=B,A=j,B>N)break;var q=Math.min(j,B-2),U=0;for(C=0;C<q;++C){var V=l-j+C+32768&32767,z=V-_[V]+32768&32767;z>U&&(U=z,R=V)}}}j+=($=R)-(R=_[$])+32768&32767}if(A){w[F++]=268435456|Wt[M]<<18|Gt[A];var W=31&Wt[M],G=31&Gt[A];E+=Ht[W]+Bt[G],++k[257+W],++S[G],P=l+M,++x}else w[F++]=e[l],++k[e[l]]}}c=pn(e,u,o,w,k,S,E,F,O,l-O,c),o||(c=fn(u,c,gn))}return on(a,0,r+rn(c)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},yn=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},bn=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&yn(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},wn=function(e){return 10+(e.filename&&e.filename.length+1||0)};function kn(e,t){void 0===t&&(t={});var n=vn(),r=e.length;n.p(e);var i=mn(e,t,wn(t),8),o=i.length;return bn(i,t),yn(i,o-8,n.d()),yn(i,o-4,r),i}function Sn(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new jt(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new jt(i+8+(n-s<<1));a.set(r),r=a}var u=e.charCodeAt(s);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return on(r,0,i)}exports.Compression=void 0,(en=exports.Compression||(exports.Compression={})).GZipJS="gzip-js",en.Base64="base64";var xn=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=m.LIB_VERSION;var i=e.split("?");if(i.length>1){var o,s=v(i[1].split("&"));try{for(s.s();!(o=s.n()).done;){var a=o.value.split("=")[0];r[a]&&delete r[a]}}catch(e){s.e(e)}finally{s.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return D(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t})),i.join(r)}(r)},En=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}if("POST"!==n.method)return null;var i,o;return i=Array.isArray(t)||(o=t,"[object Uint8Array]"===Object.prototype.toString.call(o))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i},Fn=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.callback,s=e.retriesPerformedSoFar,a=e.retryQueue,u=e.onXHRError,c=e.timeout,l=void 0===c?6e4:c,d=e.onResponse,f=new XMLHttpRequest;f.open(i.method||"GET",t,!0);var p=En(n,i);D(r,(function(e,t){f.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.timeout=l,f.withCredentials=!0,f.onreadystatechange=function(){if(4===f.readyState)if(null==d||d(f),200===f.status){if(o){var e;try{e=JSON.parse(f.responseText)}catch(e){return void C.error(e)}o(e)}}else"function"==typeof u&&u(f),(f.status<400||f.status>500)&&a.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(s||0)+1,callback:o}),null==o||o({status:0})},f.send(p)},Pn=18e5;var On=function(e){a(i,At);var n=f(i);function i(e,t){var o;return r(this,i),(o=n.call(this)).isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=e,o.rateLimiter=t,"undefined"!=typeof window&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return o(i,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(Pn,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=new Date(Date.now()+n);this.queue.push({retryAt:r,requestData:e}),C.warn("Enqueued failed request for retry in ".concat(n)),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._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=v(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,n=v(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestData,i=r.url,o=r.data,s=r.options;if(this.rateLimiter.isRateLimited(s._batchKey))C.warn("[RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(i,En(o,t(t({},s),{},{sendBeacon:!0})))}catch(e){C.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,s=e.retriesPerformedSoFar;this.rateLimiter.isRateLimited(r._batchKey)||Fn({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:s||0,callback:o,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),i}();
2
2
  /**
3
3
  * uuidv7: An experimental implementation of the proposed UUID Version 7
4
4
  *