posthog-js 1.46.2 → 1.48.0
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/CHANGELOG.md +9 -0
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/es.js +1 -8289
- package/dist/es.js.map +1 -1
- package/dist/module.d.ts +2 -1
- package/dist/module.js +1 -8295
- package/dist/module.js.map +1 -1
- package/dist/recorder-v2.js +2 -2
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js +1 -1
- package/dist/recorder.js.map +1 -1
- package/lib/package.json +2 -2
- package/package.json +2 -2
package/dist/array.full.js
CHANGED
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function o(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="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},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(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 l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(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&&h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(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 m(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=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function _(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||b(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 y(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(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 b(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}function w(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 k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function S(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function C(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(a=i?i(a):"*".repeat(a.length)),a}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var I="__rrweb_original__";var O,x,E=1,T=new RegExp("[^a-z0-9-_:]");function M(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(F).join(""):null}catch(e){return null}}function F(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=M(e.styleSheet)||t}catch(e){}return t}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,N=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,P=/^(data:)([^,]*),(.*)/i;function A(e,t){return(e||"").replace(R,(function(e,n,r,o,i,a){var s,u=r||i||a,c=n||o||"";if(!u)return e;if(!N.test(u))return"url("+c+u+c+")";if(P.test(u))return"url("+c+u+c+")";if("/"===u[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+c+")";var l=t.split("/"),d=u.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url("+c+l.join("/")+c+")"}))}var L,D,$,j,q,B,H=/^[^ \t\n\r\u000c]+/,U=/^[, \t\n\r\u000c]+/;function W(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function V(){var e=document.createElement("a");return e.href="",e.href}function z(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?W(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(U),!(n>=t.length);){var i=r(H);if(","===i.slice(-1))i=W(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=W(e,i);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((i+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((i+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?A(r,V()):"object"===t&&"data"===n&&r?W(e,r):r:W(e,r)}function G(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!(!n||!e.matches(n))||G(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,G(e.parentNode,t,n)}function Q(t,n){var r,o,i,a,s=n.doc,u=n.blockClass,c=n.blockSelector,l=n.maskTextClass,d=n.maskTextSelector,p=n.inlineStylesheet,f=n.maskInputOptions,h=void 0===f?{}:f,v=n.maskTextFn,g=n.maskInputFn,m=n.dataURLOptions,_=void 0===m?{}:m,y=n.inlineImages,b=n.recordCanvas,w=n.keepIframeSrcFn;if(s.__sn){var k=s.__sn.id;o=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{type:e.Document,childNodes:[],rootId:o};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:o};case t.ELEMENT_NODE:for(var S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(t,u,c),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return T.test(t)?"div":t}(t),F={},R=0,N=Array.from(t.attributes);R<N.length;R++){var P=N[R],L=P.name,D=P.value;F[L]=z(s,E,L,D)}if("link"===E&&p){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),j=null;$&&(j=M($)),j&&(delete F.rel,delete F.href,F._cssText=A(j,$.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(j=M(t.sheet))&&(F._cssText=A(j,V()));if("input"===E||"textarea"===E||"select"===E){D=t.value;"radio"!==F.type&&"checkbox"!==F.type&&"submit"!==F.type&&"button"!==F.type&&D?F.value=C({type:F.type,tagName:E,value:D,maskInputOptions:h,maskInputFn:g}):t.checked&&(F.checked=t.checked)}if("option"===E&&(t.selected&&!h.select?F.selected=!0:delete F.selected),"canvas"===E&&b)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,i=I in o?o.__rrweb_original__:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(F.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var q=t.toDataURL(_.type,_.quality),B=document.createElement("canvas");B.width=t.width,B.height=t.height,q!==B.toDataURL(_.type,_.quality)&&(F.rr_dataURL=q)}if("img"===E&&y){O||(O=s.createElement("canvas"),x=O.getContext("2d"));var H=t,U=H.crossOrigin;H.crossOrigin="anonymous";var W=function(){try{O.width=H.naturalWidth,O.height=H.naturalHeight,x.drawImage(H,0,0),F.rr_dataURL=O.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+H.currentSrc+"! Error: "+e)}U?F.crossOrigin=U:delete F.crossOrigin};H.complete&&0!==H.naturalWidth?W():H.onload=W}if("audio"!==E&&"video"!==E||(F.rr_mediaState=t.paused?"paused":"played",F.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(F.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(F.rr_scrollTop=t.scrollTop),S){var Q=t.getBoundingClientRect(),J=Q.width,X=Q.height;F={class:F.class,rr_width:J+"px",rr_height:X+"px"}}return"iframe"!==E||w(F.src)||(t.contentDocument||(F.rr_src=F.src),delete F.src),{type:e.Element,tagName:E,attributes:F,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:S,rootId:o};case t.TEXT_NODE:var Z=t.parentNode&&t.parentNode.tagName,Y=t.textContent,K="STYLE"===Z||void 0,ee="SCRIPT"===Z||void 0;if(K&&Y){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(Y=(i=t.parentNode.sheet).cssRules?Array.from(i.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}Y=A(Y,V())}return ee&&(Y="SCRIPT_PLACEHOLDER"),!K&&!ee&&G(t,l,d)&&Y&&(Y=v?v(Y):Y.replace(/[\S]/g,"*")),{type:e.Text,textContent:Y||"",isStyle:K,rootId:o};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:o};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:o};default:return!1}}function J(e){return void 0===e?"":e.toLowerCase()}function X(t,n){var r,o=n.doc,i=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,c=n.maskTextSelector,l=n.skipChild,d=void 0!==l&&l,p=n.inlineStylesheet,f=void 0===p||p,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,m=n.maskInputFn,_=n.slimDOMOptions,y=n.dataURLOptions,b=void 0===y?{}:y,w=n.inlineImages,k=void 0!==w&&w,C=n.recordCanvas,I=void 0!==C&&C,O=n.onSerialize,x=n.onIframeLoad,T=n.iframeLoadTimeout,M=void 0===T?5e3:T,F=n.keepIframeSrcFn,R=void 0===F?function(){return!1}:F,N=n.preserveWhiteSpace,P=void 0===N||N,A=Q(t,{doc:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,keepIframeSrcFn:R});if(!A)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(J(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===J(t.attributes.name)||"icon"===J(t.attributes.rel)||"apple-touch-icon"===J(t.attributes.rel)||"shortcut icon"===J(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&J(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(J(t.attributes.property).match(/^(og|twitter|fb):/)||J(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===J(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===J(t.attributes.name)||"googlebot"===J(t.attributes.name)||"bingbot"===J(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===J(t.attributes.name)||"generator"===J(t.attributes.name)||"framework"===J(t.attributes.name)||"publisher"===J(t.attributes.name)||"progid"===J(t.attributes.name)||J(t.attributes.property).match(/^article:/)||J(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===J(t.attributes.name)||"yandex-verification"===J(t.attributes.name)||"csrf-token"===J(t.attributes.name)||"p:domain_verify"===J(t.attributes.name)||"verify-v1"===J(t.attributes.name)||"verification"===J(t.attributes.name)||"shopify-checkout-api-token"===J(t.attributes.name)))return!0}}return!1}(A,_)&&(P||A.type!==e.Text||A.isStyle||A.textContent.replace(/^\s+|\s+$/gm,"").length)?E++:-2;var L=Object.assign(A,{id:r});if(t.__sn=L,-2===r)return null;i[r]=t,O&&O(t);var D=!d;if(L.type===e.Element&&(D=D&&!L.needBlock,delete L.needBlock,t.shadowRoot&&(L.isShadowHost=!0)),(L.type===e.Document||L.type===e.Element)&&D){_.headWhitespace&&A.type===e.Element&&"head"===A.tagName&&(P=!1);for(var $={doc:o,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:P,onSerialize:O,onIframeLoad:x,iframeLoadTimeout:M,keepIframeSrcFn:R},j=0,q=Array.from(t.childNodes);j<q.length;j++){(U=X(q[j],$))&&L.childNodes.push(U)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var B=0,H=Array.from(t.shadowRoot.childNodes);B<H.length;B++){var U;(U=X(H[B],$))&&(U.isShadow=!0,L.childNodes.push(U))}}return t.parentNode&&S(t.parentNode)&&(L.isShadow=!0),L.type===e.Element&&"iframe"===L.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&x){var n=X(e,{doc:e,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:P,onSerialize:O,onIframeLoad:x,iframeLoadTimeout:M,keepIframeSrcFn:R});n&&x(t,n)}}),M),L}function Z(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(L||(L={})),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"}(D||(D={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}($||($={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(j||(j={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(q||(q={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(B||(B={}));var Y="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",K={map:{},getId:function(){return console.error(Y),-1},getNode:function(){return console.error(Y),null},removeNodeFromMap:function(){console.error(Y)},has:function(){return console.error(Y),!1},reset:function(){console.error(Y)}};function ee(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(i){var a=Date.now();o||!1!==n.leading||(o=a);var s=t-(a-o),u=this,c=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)}),s))}}function te(e,t,n,r,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return te(e,t,i||{},!0)}}function ne(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function re(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ie(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||ie(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ie(e.parentNode,t)}function ae(e){return"__sn"in e&&-2===e.__sn.id}function se(e,t){if(S(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||se(e.parentNode,t))}function ue(e){return Boolean(e.changedTouches)}function ce(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function le(e){return Boolean(null==e?void 0:e.shadowRoot)}function de(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(K=new Proxy(K,{get:function(e,t,n){return"map"===t&&console.error(Y),Reflect.get(e,t,n)}}));var pe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&de(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&de(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),fe=function(e,t){return"".concat(e,"@").concat(t)};function he(e){return"__sn"in e}var ve=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,o,i;if(!e.frozen&&!e.locked){for(var a=[],s=new pe,u=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},c=function(t){for(var n,r,o,i,c,l=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=l;null===(o=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===o?void 0:o.host;)d=(null===(c=null===(i=null==d?void 0:d.getRootNode)||void 0===i?void 0:i.call(d))||void 0===c?void 0:c.host)||null;var p=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!p){var f=S(t.parentNode)?e.mirror.getId(l):e.mirror.getId(t.parentNode),h=u(t);if(-1===f||-1===h)return s.addNode(t);var v=X(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){ce(n)&&e.iframeManager.addIframe(n),le(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:f,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=n(e.movedSet),d=l.next();!d.done;d=l.next()){var p=d.value;me(e.removes,p,e.mirror)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;_e(e.droppedSet,p)||me(e.removes,p,e.mirror)?_e(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}for(var v=null;s.length;){var g=null;if(v){var m=e.mirror.getId(v.value.parentNode),_=u(v.value);-1!==m&&-1!==_&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){m=e.mirror.getId(b.value.parentNode),_=u(b.value);if(-1!==m&&-1!==_){g=b;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),c(g.value)}var w={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(w))}},this.processMutation=function(t){var r,o,i,a;if(!ae(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ie(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:G(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=C({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),ie(t.target,e.blockClass)||s===t.oldValue)return;var c=e.attributes.find((function(e){return e.node===t.target}));if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),"style"===t.attributeName){var l=e.doc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var d=c.attributes.style;try{for(var p=n(Array.from(u.style)),f=p.next();!f.done;f=p.next()){var h=f.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===l.style.getPropertyValue(h)&&g===l.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}try{for(var m=n(Array.from(l.style)),_=m.next();!_.done;_=m.next()){h=_.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=z(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),o=S(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ie(t.target,e.blockClass)||ae(n)||(e.addedSet.has(n)?(ge(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||se(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[fe(r,o)]?ge(e.movedSet,n):e.removes.push({parentId:o,id:r,isShadow:!!S(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!ie(n,e.blockClass)){if(he(t)){if(ae(t))return;e.movedSet.add(t);var r=null;n&&he(n)&&(r=n.__sn.id),r&&(e.movedMap[fe(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ie(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function ge(e,t){e.delete(t),t.childNodes.forEach((function(t){return ge(e,t)}))}function me(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||me(e,r,n)}function _e(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||_e(e,n))}var ye=ve,be=[],we="undefined"!=typeof CSSGroupingRule,ke="undefined"!=typeof CSSMediaRule,Se="undefined"!=typeof CSSSupportsRule,Ce="undefined"!=typeof CSSConditionRule;function Ie(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Oe(e,t){var n,r,o=new ye;be.push(o),o.init(e);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function xe(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];return Object.keys($).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var i=e.toLowerCase(),a=function(e){return function(n){var i=Ie(n);if(!ie(i,o)){var a=ue(n)?n.changedTouches[0]:n;if(a){var s=r.getId(i),u=a.clientX,c=a.clientY;t({type:$[e],id:s,x:u,y:c})}}}}(e);s.push(Z(i,a,n))})),function(){s.forEach((function(e){return e()}))}}function Ee(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass;return Z("scroll",ee((function(e){var i=Ie(e);if(i&&!ie(i,o)){var a=r.getId(i);if(i===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),n)}function Te(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Me=["INPUT","TEXTAREA","SELECT"],Fe=new WeakMap;function Re(e){return function(e,t){if(we&&e.parentRule instanceof CSSGroupingRule||ke&&e.parentRule instanceof CSSMediaRule||Se&&e.parentRule instanceof CSSSupportsRule||Ce&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ne(e,i){var a,s;void 0===i&&(i={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,i=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,c=e.inputCb,l=e.mediaInteractionCb,d=e.styleSheetRuleCb,p=e.styleDeclarationCb,f=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];t.mutation&&t.mutation.apply(t,o([],r(e),!1)),n.apply(void 0,o([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,o([],r(e),!1)),i.apply(void 0,o([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,o([],r(e),!1)),a.apply(void 0,o([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,o([],r(e),!1)),s.apply(void 0,o([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,o([],r(e),!1)),u.apply(void 0,o([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,o([],r(e),!1)),c.apply(void 0,o([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,o([],r(e),!1)),l.apply(void 0,o([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,o([],r(e),!1)),d.apply(void 0,o([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,o([],r(e),!1)),p.apply(void 0,o([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,o([],r(e),!1)),f.apply(void 0,o([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,o([],r(e),!1)),h.apply(void 0,o([],r(e),!1))}}(e,i);var c=Oe(e,e.doc),l=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var i,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=ee((function(e){var n=Date.now()-i;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],i=null}),s),l=ee((function(e){var t=Ie(e),n=ue(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;i||(i=Date.now()),u.push({x:r,y:a,id:o.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?D.Drag:e instanceof MouseEvent?D.MouseMove:D.TouchMove)}),a,{trailing:!1}),d=[Z("mousemove",l,r),Z("touchmove",l,r),Z("drag",l,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=xe(e),p=Ee(e),f=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return Z("resize",ee((function(){var e=re(),o=oe();n===e&&r===o||(t({width:Number(o),height:Number(e)}),n=e,r=o)}),200),window)}(e),h=function(e){var n=e.inputCb,i=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,c=e.maskInputOptions,l=e.maskInputFn,d=e.sampling,p=e.userTriggeredOnInput;function f(e){var t=Ie(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Me.indexOf(t.tagName)<0)&&!ie(t,s)){var r=t.type;if(!t.classList.contains(u)){var o=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(c[t.tagName.toLowerCase()]||c[r])&&(o=C({maskInputOptions:c,tagName:t.tagName,type:r,value:o,maskInputFn:l})),h(t,Te({text:o,isChecked:a,userTriggered:n},p));var d=t.name;"radio"===r&&d&&a&&i.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Te({text:e.value,isChecked:!a,userTriggered:!1},p))}))}}}function h(e,r){var o=Fe.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Fe.set(e,r);var i=a.getId(e);n(t(t({},r),{id:i}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return Z(e,f,i)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,o([],r(m.map((function(e){return te(e[0],e[1],{set:function(){f({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,o=e.sampling,i=function(e){return ee((function(o){var i=Ie(o);if(i&&!ie(i,n)){var a=i,s=a.currentTime,u=a.volume,c=a.muted;t({type:e,id:r.getId(i),currentTime:s,volume:u,muted:c})}}),o.media||500)},a=[Z("play",i(0)),Z("pause",i(1)),Z("seeked",i(2)),Z("volumechange",i(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,i=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=i.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=i.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var c={};we?c.CSSGroupingRule=a.CSSGroupingRule:(ke&&(c.CSSMediaRule=a.CSSMediaRule),Ce&&(c.CSSConditionRule=a.CSSConditionRule),Se&&(c.CSSSupportsRule=a.CSSSupportsRule));var l={};return Object.entries(c).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];l[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=i.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:o(o([],r(Re(this)),!1),[t||0],!1)}]}),l[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=i.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:o(o([],r(Re(this)),!1),[e],!1)}]}),l[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(c).forEach((function(e){var t=r(e,2),n=t[0],o=t[1];o.prototype.insertRule=l[n].insertRule,o.prototype.deleteRule=l[n].deleteRule}))}}(e,{win:u}),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=t.win,i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(e,t,o){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:o},index:Re(this.parentRule)}),i.apply(this,arguments)};var a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,o,i=r.getId(null===(o=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==i&&n({id:i,remove:{property:e},index:Re(this.parentRule)}),a.apply(this,arguments)},function(){o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),_=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],i=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=ne(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=i.get(n);e&&(t(e),i.delete(n))}),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=a})),o.push(s),function(){o.forEach((function(e){return e()}))}}(e):function(){},y=[];try{for(var b=n(e.plugins),w=b.next();!w.done;w=b.next()){var k=w.value;y.push(k.observer(k.callback,u,k.options))}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return function(){be.forEach((function(e){return e.reset()})),c.disconnect(),l(),d(),p(),f(),h(),v(),g(),m(),_(),y.forEach((function(e){return e()}))}}var Pe=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),Ae=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(ne(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){Oe(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Ee(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(ne(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var Le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",De="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$e=0;$e<Le.length;$e++)De[Le.charCodeAt($e)]=$e;var je=new Map;var qe=function(e,t,n){if(e&&(Ue(e,t)||"object"===s(e))){var r=function(e,t){var n=je.get(e);return n||(n=new Map,je.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o}};function Be(e,t,n){if(e instanceof Array)return e.map((function(e){return Be(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var r=e.constructor.name,o=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Le[n[t]>>2],o+=Le[(3&n[t])<<4|n[t+1]>>4],o+=Le[(15&n[t+1])<<2|n[t+2]>>6],o+=Le[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:r,base64:o}}return e instanceof DataView?{rr_type:e.constructor.name,args:[Be(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Be(e.data,t,n),e.width,e.height]}:Ue(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:qe(e,t,n)}:e}var He=function(e,t,n){return o([],r(e),!1).map((function(e){return Be(e,t,n)}))},Ue=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function We(e,t,i,a,s,u){var c,l,d=[],p=Object.getOwnPropertyNames(e),f=function(n){try{if("function"!=typeof e[n])return"continue";var c=ne(e,n,(function(c){return function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];var p=c.apply(this,l);if(qe(p,u,e),!ie(this.canvas,a)){s.getId(this.canvas);var f=He(o([],r(l),!1),u,e),h={type:t,property:n,args:f};i(this.canvas,h)}return p}}));d.push(c)}catch(r){var l=te(e,n,{set:function(e){i(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(l)}};try{for(var h=n(p),v=h.next();!v.done;v=h.next()){f(v.value)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(c)throw c.error}}return d}var Ve,ze,Ge=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=function(e,t){var n=[];try{var i=ne(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return ie(this,t)||"__context"in this||(this.__context=n),e.apply(this,o([n],r(i),!1))}}));n.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,i,a){var s,u,c=[],l=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=ne(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ie(this.canvas,i)||setTimeout((function(){var t=o([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var i=t[0],u=i.getContext("2d"),c=null==u?void 0:u.getImageData(0,0,i.width,i.height),l=null==c?void 0:c.data;t[0]=JSON.stringify(l)}e(a.canvas,{type:j["2D"],property:n,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(r){var s=te(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:j["2D"],property:n,args:[t],setter:!0})}});c.push(s)}};try{for(var p=n(l),f=p.next();!f.done;f=p.next())d(f.value)}catch(e){s={error:e}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(s)throw s.error}}return function(){c.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,i){var a=[];return a.push.apply(a,o([],r(We(t.WebGLRenderingContext.prototype,j.WebGL,e,n,i,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,o([],r(We(t.WebGL2RenderingContext.prototype,j.WebGL2,e,n,i,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){i(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Qe(e){return t(t({},e),{timestamp:Date.now()})}var Je={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Xe(e){void 0===e&&(e={});var o=e.emit,i=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,c=e.blockSelector,l=void 0===c?null:c,d=e.ignoreClass,p=void 0===d?"rr-ignore":d,f=e.maskTextClass,h=void 0===f?"rr-mask":f,v=e.maskTextSelector,g=void 0===v?null:v,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,S=e.maskTextFn,C=e.hooks,I=e.packFn,O=e.sampling,x=void 0===O?{}:O,E=e.mousemoveWait,T=e.recordCanvas,M=void 0!==T&&T,F=e.userTriggeredOnInput,R=void 0!==F&&F,N=e.collectFonts,P=void 0!==N&&N,A=e.inlineImages,$=void 0!==A&&A,j=e.plugins,q=e.keepIframeSrcFn,B=void 0===q?function(){return!1}:q;if(!o)throw new Error("emit function is required");void 0!==E&&void 0===x.mousemove&&(x.mousemove=E);var H,U=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==b?b:{password:!0},W=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var V=0;Ve=function(e,t){var r;if(!(null===(r=be[0])||void 0===r?void 0:r.isFrozen())||e.type===L.FullSnapshot||e.type===L.IncrementalSnapshot&&e.data.source===D.Mutation||be.forEach((function(e){return e.unfreeze()})),o(function(e){var t,r;try{for(var o=n(j||[]),i=o.next();!i.done;i=o.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return I&&(e=I(e)),e}(e),t),e.type===L.FullSnapshot)H=e,V=0;else if(e.type===L.IncrementalSnapshot){if(e.data.source===D.Mutation&&e.data.isAttachIframe)return;V++;var s=a&&V>=a,u=i&&e.timestamp-H.timestamp>i;(s||u)&&ze(!0)}};var z=function(e){Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.Mutation},e)}))},G=function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.Scroll},e)}))},Q=function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.CanvasMutation},e)}))},J=new Pe({mutationCb:z}),Y=new Ge({recordCanvas:M,mutationCb:Q,win:window,blockClass:u,mirror:Je}),K=new Ae({mutationCb:z,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:U,maskTextFn:S,maskInputFn:k,recordCanvas:M,inlineImages:$,sampling:x,slimDOMOptions:W,iframeManager:J,canvasManager:Y},mirror:Je});ze=function(e){var t,n,o,i;void 0===e&&(e=!1),Ve(Qe({type:L.Meta,data:{href:window.location.href,width:oe(),height:re()}}),e),be.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"rr-block":r,i=n.blockSelector,a=void 0===i?null:i,s=n.maskTextClass,u=void 0===s?"rr-mask":s,c=n.maskTextSelector,l=void 0===c?null:c,d=n.inlineStylesheet,p=void 0===d||d,f=n.inlineImages,h=void 0!==f&&f,v=n.recordCanvas,g=void 0!==v&&v,m=n.maskAllInputs,_=void 0!==m&&m,y=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,O=n.onIframeLoad,x=n.iframeLoadTimeout,E=n.keepIframeSrcFn,T={};return[X(e,{doc:e,map:T,blockClass:o,blockSelector:a,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===_?{password:!0}:_,maskTextFn:y,maskInputFn:b,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:C,onSerialize:I,onIframeLoad:O,iframeLoadTimeout:x,keepIframeSrcFn:void 0===E?function(){return!1}:E}),T]}(document,{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:U,maskTextFn:S,slimDOM:W,recordCanvas:M,inlineImages:$,onSerialize:function(e){ce(e)&&J.addIframe(e),le(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){J.attachIframe(e,t),K.observeAttachShadow(e)},keepIframeSrcFn:B}),2),s=a[0],c=a[1];if(!s)return console.warn("Failed to snapshot the document");Je.map=c,Ve(Qe({type:L.FullSnapshot,data:{node:s,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(i=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),be.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(Z("DOMContentLoaded",(function(){Ve(Qe({type:L.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Ne({mutationCb:z,mousemoveCb:function(e,t){return Ve(Qe({type:L.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.ViewportResize},e)}))},inputCb:function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.Input},e)}))},mediaInteractionCb:function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.StyleDeclaration},e)}))},canvasMutationCb:Q,fontCb:function(e){return Ve(Qe({type:L.IncrementalSnapshot,data:t({source:D.Font},e)}))},blockClass:u,ignoreClass:p,maskTextClass:h,maskTextSelector:g,maskInputOptions:U,inlineStylesheet:_,sampling:x,recordCanvas:M,inlineImages:$,userTriggeredOnInput:R,collectFonts:P,doc:e,maskInputFn:k,maskTextFn:S,blockSelector:l,slimDOMOptions:W,mirror:Je,iframeManager:J,shadowDomManager:K,canvasManager:Y,plugins:(null===(n=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return Ve(Qe({type:L.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};J.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){ze(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(Z("load",(function(){Ve(Qe({type:L.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Xe.addCustomEvent=function(e,t){if(!Ve)throw new Error("please add custom event after start recording");Ve(Qe({type:L.Custom,data:{tag:e,payload:t}}))},Xe.freezePage=function(){be.forEach((function(e){return e.freeze()}))},Xe.takeFullSnapshot=function(e){if(!ze)throw new Error("please take full snapshot after start recording");ze(e)},Xe.mirror=Je;var Ze=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),Ye=/(^|@)\S+:\d+/,Ke=/^\s*at .*(\S+:\d+|\(native\))/m,et=/^(eval@)?(\[native code])?$/,tt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(Ke))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ke)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Ze({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(et)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ze({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Ze({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new Ze({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new Ze({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ye)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ze({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function nt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var i=0;i<r.children.length;i++){var a=r.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&o.push(a)}o.length>1&&(n+=":eq("+o.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function rt(e){return"[object Object]"===Object.prototype.toString.call(e)}function ot(e,t){var r,o;if(0===t)return!0;var i=Object.keys(e);try{for(var a=n(i),s=a.next();!s.done;s=a.next()){var u=s.value;if(rt(e[u])&&ot(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1}function it(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?o.splice(i,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if(rt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(rt(e)&&ot(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=nt(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var at={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function st(e,t,i){var a,s,u,c=i.logger;if(!c)return function(){};u="string"==typeof c?t[c]:c;var l=0,d=[];if(i.level.includes("error")&&window){var p=function(t){var n=t.message,r=t.error,o=tt.parse(r).map((function(e){return e.toString()})),a=[it(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};window.addEventListener("error",p),d.push((function(){window&&window.removeEventListener("error",p)}))}try{for(var f=n(i.level),h=f.next();!h.done;h=f.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?ne(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var c=tt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return it(e,i.stringifyOptions)}));++l<i.lengthThreshold?e({level:n,trace:c,payload:d}):l===i.lengthThreshold&&e({level:"warn",trace:[],payload:[it("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,o(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var ut="undefined"!=typeof window?window:{};ut.rrweb={record:Xe,version:"2.0.0-alpha.5"},ut.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:st,options:e?Object.assign({},at,e):at}}};var ct=String.fromCharCode,lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",pt={};function ft(e,t){if(!pt[e]){pt[e]={};for(var n=0;n<e.length;n++)pt[e][e.charAt(n)]=n}return pt[e][t]}var ht={compressToBase64:function(e){if(null==e)return"";var t=ht._compress(e,6,(function(e){return lt.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:ht._decompress(e.length,32,(function(t){return ft(lt,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":ht._compress(e,15,(function(e){return ct(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:ht._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=ht.compress(e),n=new Uint8Array(2*t.length),r=0,o=t.length;r<o;r++){var i=t.charCodeAt(r);n[2*r]=i>>>8,n[2*r+1]=i%256}return n},decompressFromUint8Array:function(e){if(null==e)return ht.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var o=[];return t.forEach((function(e){o.push(ct(e))})),ht.decompress(o.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":ht._compress(e,6,(function(e){return dt.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),ht._decompress(e.length,32,(function(t){return ft(dt,e.charAt(t))})))},compress:function(e){return ht._compress(e,16,(function(e){return ct(e)}))},_compress:function(e,t,n){if(null==e)return"";var r,o,i,a="",s="",u="",c=2,l=3,d=2,p=0,f=0,h={},v={},g=[];for(i=0;i<e.length;i+=1)if(a=e.charAt(i),Object.prototype.hasOwnProperty.call(h,a)||(h[a]=l++,v[a]=!0),s=u+a,Object.prototype.hasOwnProperty.call(h,s))u=s;else{if(Object.prototype.hasOwnProperty.call(v,u)){if(u.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(o=u.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}else{for(o=1,r=0;r<d;r++)p=p<<1|o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}0==--c&&(c=Math.pow(2,d),d++),delete v[u]}else for(o=h[u],r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;0==--c&&(c=Math.pow(2,d),d++),h[s]=l++,u=String(a)}if(""!==u){if(Object.prototype.hasOwnProperty.call(v,u)){if(u.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(o=u.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}else{for(o=1,r=0;r<d;r++)p=p<<1|o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}0==--c&&(c=Math.pow(2,d),d++),delete v[u]}else for(o=h[u],r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;0==--c&&(c=Math.pow(2,d),d++)}for(o=2,r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;for(;;){if(p<<=1,f==t-1){g.push(n(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:ht._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,o,i,a,s,u,c,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,v=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(i=0,s=Math.pow(2,2),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;switch(i){case 0:for(i=0,s=Math.pow(2,8),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;c=ct(i);break;case 1:for(i=0,s=Math.pow(2,16),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;c=ct(i);break;case 2:return""}for(l[3]=c,o=c,d.push(c);;){if(p.index>e)return"";for(i=0,s=Math.pow(2,v),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;switch(c=i){case 0:for(i=0,s=Math.pow(2,8),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;l[h++]=ct(i),c=h-1,f--;break;case 1:for(i=0,s=Math.pow(2,16),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;l[h++]=ct(i),c=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,v),v++),l[c])g=l[c];else{if(c!==h)return null;g=o+o.charAt(0)}d.push(g),l[h++]=o+g.charAt(0),o=g,0==--f&&(f=Math.pow(2,v),v++)}}},vt={DEBUG:!1,LIB_VERSION:"1.46.2"},gt=Array.prototype,mt=Object.prototype,_t=mt.toString,yt=mt.hasOwnProperty,bt="undefined"!=typeof window?window:{},wt=bt.navigator||{userAgent:""},kt=bt.document||{},St=wt.userAgent,Ct=gt.forEach,It=gt.indexOf,Ot=Array.isArray,xt={},Et=function(){if(vt.DEBUG&&!jt(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log?window.console.log.__rrweb_original__:window.console.log),t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(t){Nt(n,(function(t){e(t)}))}}},Tt=function(){if(vt.DEBUG&&!jt(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),o="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{o.apply(window.console,r)}catch(e){Nt(r,(function(e){o(e)}))}}},Mt=function(){if(!jt(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),o="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{o.apply(window.console,r)}catch(e){Nt(r,(function(e){o(e)}))}}},Ft=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Rt(e,t,n){if(null!=e)if(Ct&&Array.isArray(e)&&e.forEach===Ct)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===xt)return}else for(var i in e)if(yt.call(e,i)&&t.call(n,e[i],i)===xt)return}function Nt(e,t,n){if(Array.isArray(e))if(Ct&&e.forEach===Ct)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===xt)return}var Pt=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 Nt(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},At=Ot||function(e){return"[object Array]"===_t.call(e)},Lt=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function Dt(e,t){return-1!==e.indexOf(t)}var $t=function(e){return e===Object(e)&&!At(e)},jt=function(e){return void 0===e},qt=function(e){return"[object String]"==_t.call(e)},Bt=function e(t){return Rt(t,(function(n,r){!function(e){return"[object Date]"==_t.call(e)}(n)?$t(n)&&(t[r]=e(n)):t[r]=Ht(n)})),t},Ht=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Ut=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){Mt("Implementation error. Please turn on debug and contact support@posthog.com."),vt.DEBUG&&Mt(e)}}},Wt=function(e){var t={};return Rt(e,(function(e,n){qt(e)&&e.length>0&&(t[n]=e)})),t};var Vt=["$performance_raw"];function zt(e,t){return n=e,r=function(e,n){return n&&Vt.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},o=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:o.has(t)?void 0:(o.add(t),At(t)?(i=[],Nt(t,(function(t){i.push(e(t))}))):(i={},Rt(t,(function(t,n){o.has(t)||(i[n]=e(t,n))}))),i);var i}(n);var n,r,o}function Gt(e){var t,n,r,o,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",l=[];if(!e)return e;e=Jt(e);do{t=(i=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=i>>12&63,r=i>>6&63,o=63&i,l[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(o)}while(s<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 Qt,Jt=function(e){var t,n,r,o,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,o=0;o<r;o++){var a=e.charCodeAt(o),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(n>t&&(i+=e.substring(t,n)),i+=s,t=n=o+1)}return n>t&&(i+=e.substring(t,e.length)),i},Xt=(Qt=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e="undefined"!=typeof window?(window.screen.height*window.screen.width).toString(16):"0";return Qt()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=St,r=0,o=[];function i(e,t){var n,r=0;for(n=0;n<t.length;n++)r|=o[n]<<8*n;return e^r}for(e=0;e<n.length;e++)t=n.charCodeAt(e),o.unshift(255&t),o.length>=4&&(r=i(r,o),o=[]);return o.length>0&&(r=i(r,o)),r.toString(16)}()+"-"+e+"-"+Qt()}),Zt=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php)/i.test(e)},Yt=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 o=r[1];try{o=decodeURIComponent(o)}catch(e){Tt("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Kt=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},en=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,o,i){if(t)if(t.addEventListener&&!o)t.addEventListener(n,r,!!i);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(o){if(o=o||e(window.event)){var i,a=!0;Lt(r)&&(i=r(o));var s=n.call(t,o);return!1!==i&&!1!==s||(a=!1),a}}}(t,r,s)}else Tt("No valid element provided to register_event")}}(),tn={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),t={};return Rt(e,(function(e){var n=Yt(kt.URL,e);n.length&&(t[e]=n)})),t},searchEngine:function(e){return 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},searchInfo:function(e){var t=tn.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var o=Yt(e,n);o.length&&(r.ph_keyword=o)}return r},browser:function(e,t,n){return t=t||"",n||Dt(e," OPR/")?Dt(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Dt(e,"IEMobile")||Dt(e,"WPDesktop")?"Internet Explorer Mobile":Dt(e,"SamsungBrowser/")?"Samsung Internet":Dt(e,"Edge")||Dt(e,"Edg/")?"Microsoft Edge":Dt(e,"FBIOS")?"Facebook Mobile":Dt(e,"Chrome")?"Chrome":Dt(e,"CriOS")?"Chrome iOS":Dt(e,"UCWEB")||Dt(e,"UCBrowser")?"UC Browser":Dt(e,"FxiOS")?"Firefox iOS":Dt(t,"Apple")?Dt(e,"Mobile")?"Mobile Safari":"Safari":Dt(e,"Android")?"Android Mobile":Dt(e,"Konqueror")?"Konqueror":Dt(e,"Firefox")?"Firefox":Dt(e,"MSIE")||Dt(e,"Trident/")?"Internet Explorer":Dt(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+)?)/}[tn.browser(e,t,n)];if(void 0===r)return null;var o=e.match(r);return o?parseFloat(o[o.length-2]):null},browserLanguage:function(){return wt.language||wt.userLanguage},os:function(){var e=St;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},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"},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return Pt(Wt({$os:tn.os(),$browser:tn.browser(St,wt.vendor,bt.opera),$device:tn.device(St),$device_type:tn.deviceType(St)}),{$current_url:null==bt?void 0:bt.location.href,$host:null==bt?void 0:bt.location.host,$pathname:null==bt?void 0:bt.location.pathname,$browser_version:tn.browserVersion(St,wt.vendor,bt.opera),$browser_language:tn.browserLanguage(),$screen_height:null==bt?void 0:bt.screen.height,$screen_width:null==bt?void 0:bt.screen.width,$viewport_height:null==bt?void 0:bt.innerHeight,$viewport_width:null==bt?void 0:bt.innerWidth,$lib:"web",$lib_version:vt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:(Date.now=Date.now||function(){return+new Date},Date.now()/1e3)})},people_properties:function(){return Pt(Wt({$os:tn.os(),$browser:tn.browser(St,wt.vendor,bt.opera)}),{$browser_version:tn.browserVersion(St,wt.vendor,bt.opera)})}};function nn(e){switch(s(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function rn(e){var t="";return dn(e)&&!pn(e)&&e.childNodes&&e.childNodes.length&&Rt(e.childNodes,(function(e){sn(e)&&e.textContent&&(t+=Ft(e.textContent).split(/(\s+)/).filter(fn).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),Ft(t)}function on(e){return!!e&&1===e.nodeType}function an(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function sn(e){return!!e&&3===e.nodeType}function un(e){return!!e&&11===e.nodeType}var cn=["a","button","form","input","select","textarea","label"];function ln(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||an(e,"html")||!on(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,o=n.url_allowlist;if(o&&!o.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var i=n.dom_event_allowlist;if(i&&!i.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var a=n.element_allowlist;if(a&&!a.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var s=n.css_selector_allowlist;if(s&&!s.some((function(t){return e.matches(t)})))return!1}for(var u=!1,c=[e],l=!0,d=e;d.parentNode&&!an(d,"body");)if(un(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(cn.indexOf(l.tagName.toLowerCase())>-1)u=!0;else{var p=window.getComputedStyle(l);p&&"pointer"===p.getPropertyValue("cursor")&&(u=!0)}c.push(l),d=l}var f=window.getComputedStyle(e);if(f&&"pointer"===f.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&&(cn.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function dn(e){for(var t=e;t.parentNode&&!an(t,"body");t=t.parentNode){var n=nn(t).split(" ");if(Dt(n,"ph-sensitive")||Dt(n,"ph-no-capture"))return!1}if(Dt(nn(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";if("string"==typeof o){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function pn(e){return!!(an(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||an(e,"select")||an(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function fn(e){if(null===e||jt(e))return!1;if("string"==typeof e){e=Ft(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 hn(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,o=document.querySelectorAll("body > script");o.length>0?null===(r=o[0].parentNode)||void 0===r||r.insertBefore(n,o[0]):document.body.appendChild(n)}var vn=function(){function e(t){u(this,e),this.clicks=[],this.enabled=t}return l(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}(),gn={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!on(t));return t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),o={tag_name:r};cn.indexOf(r)>-1&&!n&&(o.$el_text=rn(e));var i=nn(e);i.length>0&&(o.classes=i.split(" ").filter((function(e){return""!==e}))),Rt(e.attributes,(function(n){var r;pn(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&fn(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(o["attr__"+n.name]=n.value)}));for(var a=1,s=1,u=e;u=this._previousElementSibling(u);)a++,u.tagName===e.tagName&&s++;return o.nth_child=a,o.nth_of_type=s,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return Rt(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),fn(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return Rt(this._customProperties,(function(r){Rt(r.event_selectors,(function(o){Rt(document.querySelectorAll(o),(function(o){Dt(e,o)&&dn(o)&&(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,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",i=this._getEventTarget(e);(sn(i)&&(i=i.parentNode||null),"$autocapture"===o&&"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(i&&ln(i,e,this.config)){for(var a=[i],s=i;s.parentNode&&!an(s,"body");)un(s.parentNode)?(a.push(s.parentNode.host),s=s.parentNode.host):(a.push(s.parentNode),s=s.parentNode);var u,c=[],l=!1;if(Rt(a,(function(e){var n=dn(e);"a"===e.tagName.toLowerCase()&&(u=e.getAttribute("href"),u=n&&fn(u)&&u),Dt(nn(e).split(" "),"ph-no-capture")&&(l=!0),c.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")))})),t.get_config("mask_all_text")||(c[0].$el_text=rn(i)),u&&(c[0].attr__href=u),l)return!1;var d=Pt(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(a));return t.capture(o,d),!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)};en(document,"submit",n,!1,!0),en(document,"change",n,!1,!0),en(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 vn(e.get_config("rageclick"))},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?Et('autocapture already initialized for token "'+n+'"'):(this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&t.get_config("autocapture")?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=jt(t)?10:t,n=jt(n)?10:n;for(var r=0,o=0;o<e.length;o++)r+=e.charCodeAt(o);return r%t<n},isBrowserSupported:function(){return Lt(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(gn),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Ut(e[t]))}(gn);var mn=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,_n={is_supported:function(){return!0},error:function(e){Tt("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}}catch(e){}return null},parse:function(e){var t;try{t=JSON.parse(_n.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,o){try{var i="",a="",s="";if(r){var u=document.location.hostname.match(mn),c=u?u[0]:"";i=c?"; domain=."+c:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),a="; expires="+l.toUTCString()}o&&(s="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; path=/"+i+s;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{_n.set(e,"",-1,t)}catch(e){return}}},yn=null,bn={is_supported:function(){if(null!==yn)return yn;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";bn.set(t,"xyz"),'"xyz"'!==bn.get(t)&&(e=!1),bn.remove(t)}catch(t){e=!1}else e=!1;return e||Tt("localStorage unsupported; falling back to cookie store"),yn=e,e},error:function(e){Tt("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){bn.error(e)}return null},parse:function(e){try{return JSON.parse(bn.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){bn.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){bn.error(e)}}},wn=a(a({},bn),{},{parse:function(e){try{var t={};try{(t=_n.parse(e)||{}).distinct_id&&_n.set(e,{distinct_id:t.distinct_id})}catch(e){}var n=Pt(t,JSON.parse(bn.get(e)||"{}"));return bn.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,o){try{bn.set(e,t),t.distinct_id&&_n.set(e,{distinct_id:t.distinct_id},n,r,o)}catch(e){bn.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),_n.remove(e,t)}catch(e){bn.error(e)}}}),kn={},Sn={is_supported:function(){return!0},error:function(e){Tt("memoryStorage error: "+e)},get:function(e){return kn[e]||null},parse:function(e){return kn[e]||null},set:function(e,t){kn[e]=t},remove:function(e){delete kn[e]}},Cn=null,In={is_supported:function(){if(null!==Cn)return Cn;if(Cn=!0,"undefined"!=typeof window)try{var e="__support__";In.set(e,"xyz"),'"xyz"'!==In.get(e)&&(Cn=!1),In.remove(e)}catch(e){Cn=!1}else Cn=!1;return Cn},error:function(e){vt.DEBUG&&Tt("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){In.error(e)}return null},parse:function(e){try{return JSON.parse(In.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){In.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){In.error(e)}}};function On(e,t){Pn(!0,e,t)}function xn(e,t){Pn(!1,e,t)}function En(e,t){return"1"===Nn(e,t)}function Tn(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||bt,n=t.navigator||{},r=!1;return Rt([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){Dt([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Nn(e,t)}function Mn(e,t){Fn(t=t||{}).remove(Rn(e,t),!!t.crossSubdomainCookie)}function Fn(e){return"localStorage"===(e=e||{}).persistenceType?bn:"localStorage+cookie"===e.persistenceType?wn:_n}function Rn(e,t){return((t=t||{}).persistencePrefix||"__ph_opt_in_out_")+e}function Nn(e,t){return Fn(t).get(Rn(e,t))}function Pn(e,t,n){var r;qt(t)&&t.length?(Fn(n=n||{}).set(Rn(t,n),e?1:0,(r=n.cookieExpiration,"[object Number]"==_t.call(r)?n.cookieExpiration:null),n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function An(e,t){var n=!1;try{var r=e.get_config("token"),o=e.get_config("respect_dnt"),i=e.get_config("opt_out_capturing_persistence_type"),a=e.get_config("opt_out_capturing_cookie_prefix")||void 0,s=e.get_config("window");r&&(n=Tn(r,{respectDnt:o,persistenceType:i,persistencePrefix:a,window:s}))}catch(e){t||console.error("Unexpected error when checking capturing opt-out status: "+e)}return n}function Ln(e,t,n){return function(){for(var r=An(e,n),o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];if(!r)return t.apply(this,i);var s=i[i.length-1];"function"==typeof s&&s(0)}}var Dn="$set",$n=function(){function e(t){var n=this;u(this,e),this._posthog=t,this.set=Ln(t,(function(e,t,r){var o=n.set_action(e,t);return $t(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.persistence.update_referrer_info(document.referrer),o.$set=Pt({},tn.people_properties(),n._posthog.persistence.get_referrer_info(),o.$set),n._send_request(o,r)})),this.set_once=Ln(t,(function(e,t,r){var o=n.set_once_action(e,t);return $t(e)&&(r=t),n._send_request(o,r)}))}return l(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),o=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),o&&(e.$had_persisted_distinct_id=o);var i=Bt(e),a=zt(i,this._get_config("properties_string_max_length")),s=Gt(JSON.stringify(i));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:s},{},this._posthog._prepare_callback(t,a)),a}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser(Dn,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,o={},i={};return $t(t)?Rt(t,(function(e,t){r._is_reserved_property(t)||(i[t]=e)})):i[t]=n,o[e]=i,o}}]),e}(),jn="$active_feature_flags",qn="$enabled_feature_flags",Bn="$override_feature_flags",Hn="$feature_flag_payloads",Un=function(){function e(t){u(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return l(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(qn),t=this.instance.get_property(Bn);if(!t)return e||{};for(var n=Pt({},e),r=Object.keys(t),o=0;o<r.length;o++)!1===t[r[o]]?delete n[r[o]]:n[r[o]]=t[r[o]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Hn)||{}}},{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.get_config("token"),n=Gt(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=3",{data:n},{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.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var n=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}},{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]:{};return this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"receivedFeatureFlags",value:function(e){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),n=this.getFlagPayloads();!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,i=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var s,u={};if(o)for(var c=0;c<o.length;c++)u[o[c]]=!0;t&&t.register((d(s={},jn,o),d(s,qn,u),s))}else{var l,p=o,f=i;e.errorsWhileComputingFlags&&(p=a(a({},n),p),f=a(a({},r),f)),t&&t.register((d(l={},jn,Object.keys(p||{})),d(l,qn,p||{}),d(l,Hn,f||{}),l))}else t&&(t.unregister(jn),t.unregister(qn),t.unregister(Hn))}(e,this.instance.persistence,t,n);var r=this._prepareFeatureFlagsForCallbacks(),o=r.flags,i=r.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(o,i)}))}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(Bn);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(d({},Bn,t))}else this.instance.persistence.register(d({},Bn,e))}},{key:"onFeatureFlags",value:function(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var t=this._prepareFeatureFlagsForCallbacks();e(t.flags,t.flagVariants)}}},{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}),{})}}}]),e}(),Wn="$people_distinct_id",Vn="__alias",zn="__timers",Gn="$session_recording_enabled_server_side",Qn="$console_log_recording_enabled_server_side",Jn="$sesid",Xn="$enabled_feature_flags",Zn="$user_state",Yn=["__mps","__mpso","__mpus","__mpa","__mpap","__mpr","__mpu",Wn,Vn,"__cmpns",zn,Gn,Jn,Xn,Zn],Kn=function(){function e(t){u(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,t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog";var r=t.persistence.toLowerCase();"cookie"!==r&&-1===r.indexOf("localstorage")&&"memory"!==r&&(Mt("Unknown persistence type "+r+"; falling back to cookie"),r=t.persistence="cookie"),"localstorage"===r&&bn.is_supported()?this.storage=bn:"localstorage+cookie"===r&&wn.is_supported()?this.storage=wn:this.storage="memory"===r?Sn:_n,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return l(e,[{key:"properties",value:function(){var e={};return Rt(this.props,(function(t,n){if(n===Xn&&"object"===s(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/".concat(r[o])]=t[r[o]];else a=n,u=!1,(null===(i=Yn)?u:It&&i.indexOf===It?-1!=i.indexOf(a):(Rt(i,(function(e){if(u||(u=e===a))return xt})),u))||(e[n]=t);var i,a,u})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Pt({},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($t(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var o=!1;if(Rt(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,o=!0)})),o)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if($t(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(Rt(e,(function(t,o){e.hasOwnProperty(o)&&n.props[o]!==t&&(n.props[o]=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(tn.campaignParams()),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(e){this.register(tn.searchInfo(e))}},{key:"update_referrer_info",value:function(e){this.register({$referrer:e||this.props.$referrer||"$direct",$referring_domain:tn.referringDomain(e)||this.props.$referring_domain||"$direct"})}},{key:"get_referrer_info",value:function(){return Wt({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Rt(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.__timers||{};n[e]=t,this.props.__timers=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props.__timers||{})[e];return jt(t)||(delete this.props.__timers[e],this.save()),t}},{key:"get_user_state",value:function(){return this.props.$user_state||"anonymous"}},{key:"set_user_state",value:function(e){this.props.$user_state=e,this.save()}}]),e}(),er=2,tr=4;var nr=function(){function e(t){u(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint="/e/",this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return l(e,[{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(Gn),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(Qn),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"afterDecideResponse",value:function(e){var t,n,r,o,i;(this.receivedDecide=!0,this.instance.persistence)&&this.instance.persistence.register((d(o={},Gn,!!e.sessionRecording),d(o,Qn,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),o));null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this.endpoint=null===(i=e.sessionRecording)||void 0===i?void 0:i.endpoint);null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshot(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){if(void 0!==Object.assign&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){var e=this.instance.get_config("session_recording");this.recorderVersion=(null==e?void 0:e.recorderVersion)||this.recorderVersion;var t="v2"===this.recorderVersion?"recorder-v2.js":"recorder.js";this.captureStarted=!0,this.instance.__loaded_recorder||hn(this.instance.get_config("api_host")+"/static/".concat(t,"?v=").concat(vt.LIB_VERSION),this._onScriptLoaded.bind(this)),this._onScriptLoaded()}}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n,r=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),o=this.instance.sessionManager.checkAndGetSessionAndWindowId(r,e.timestamp),i=o.windowId,a=o.sessionId;this.windowId===i&&this.sessionId===a||-1!==[er,tr].indexOf(e.type)||(null===(n=this.rrwebRecord)||void 0===n||n.takeFullSnapshot());this.windowId=i,this.sessionId=a}},{key:"_onScriptLoaded",value:function(){var e,t=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var r=this.instance.get_config("session_recording"),o=0,i=Object.entries(r||{});o<i.length;o++){var u=_(i[o],2),c=u[0],l=u[1];c in n&&(n[c]=l)}this.stopRrweb=null===(e=this.rrwebRecord)||void 0===e?void 0:e.call(this,a({emit:function(e){e=function(e){if(e&&"object"===s(e)&&6===e.type&&"object"===s(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===s(e)){var t=JSON.stringify(e);if(t.length>5e6){var n,r=k(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(r.s();!(n=r.n()).done;){var o=n.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg=="):t.replace(o[0],"")}}catch(e){r.e(e)}finally{r.f()}}return JSON.parse(t)}return e}(e)),t._updateWindowAndSessionIds(e);var n={$snapshot_data:e,$session_id:t.sessionId,$window_id:t.windowId};t.instance._captureMetrics.incr("rrweb-record"),t.instance._captureMetrics.incr("rrweb-record-".concat(e.type)),t.emit?t._captureSnapshot(n):t.snapshots.push(n)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},n)),this.instance._addCaptureHook((function(e){var n;"$pageview"===e&&(null===(n=t.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href}))}))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===er}})}}]),e}(),rr={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},or=["first-input","navigation","paint","resource"],ir=["/s/","/e/"],ar=function(){function e(t){u(this,e),this.instance=t}return l(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e=this;if(!this.observer)try{this.observer=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e._capturePerformanceEvent(t)}))}));var t=PerformanceObserver.supportedEntryTypes.filter((function(e){return or.includes(e)}));t.forEach((function(t){var n;null===(n=e.observer)||void 0===n||n.observe({type:t,buffered:!0})}))}catch(e){console.error("PostHog failed to start performance observer",e),this.stopObserving()}}},{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.get_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(e.name.startsWith(this.instance.get_config("api_host"))){var t=e.name.replace(this.instance.get_config("api_host"),"");if(ir.find((function(e){return t.startsWith(e)})))return}var n=e.toJSON(),r={},o=Math.floor(Date.now()-performance.now());for(var i in r[rr.timeOrigin]=o,r[rr.timestamp]=Math.floor(o+e.startTime),rr)void 0!==n[i]&&(r[rr[i]]=n[i]);if(this.capturePerformanceEvent(r),sr(e)){var a,s=k(e.serverTiming);try{for(s.s();!(a=s.n()).done;){var u,c=a.value;this.capturePerformanceEvent((d(u={},rr.timeOrigin,o),d(u,rr.timestamp,Math.floor(o+e.startTime)),d(u,rr.name,c.name),d(u,rr.duration,c.duration),d(u,rr.entryType,"serverTiming"),u))}}catch(e){s.e(e)}finally{s.f()}}}},{key:"capturePerformanceEvent",value:function(e){this.instance.capture("$performance_event",e,{transport:"XHR",method:"POST",endpoint:"/e/",_noTruncate:!0,_batchKey:"performanceEvent"})}}]),e}(),sr=function(e){return"navigation"===e.entryType||"resource"===e.entryType},ur=function(){function e(t){u(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return l(e,[{key:"call",value:function(){var e=this,t=Gt(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}));this.instance._send_request("".concat(this.instance.get_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=this;if(0!==(null==e?void 0:e.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){r.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),gn.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.get_config("disable_compression")){var o,i={},a=k(e.supportedCompression);try{for(a.s();!(o=a.n()).done;){i[o.value]=!0}}catch(e){a.e(e)}finally{a.f()}this.instance.compression=i}if(e.siteApps)if(this.instance.get_config("opt_in_site_apps")){var s,u=this.instance.get_config("api_host"),c=k(e.siteApps);try{var l=function(){var e=s.value,t=e.id,n=e.url,o=document.createElement("script");o.src=[u,"/"===u[u.length-1]&&"/"===n[0]?n.substring(1):n].join(""),o.onerror=function(e){console.error("Error while initializing PostHog app with config id ".concat(t),e)},window["__$$ph_site_app_".concat(t)]=r.instance,document.body.appendChild(o)};for(c.s();!(s=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}}else e.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),cr=["https://app.posthog.com","https://eu.posthog.com"],lr=["source"],dr=function(){function e(t){u(this,e),this.instance=t}return l(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(a(a({},t),{},{apiURL:this.instance.get_config("api_host")}))}},{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,o=Kt(e.hash,"__posthog")||Kt(e.hash,"state"),i=o?JSON.parse(decodeURIComponent(o)):null,a=i&&"ph_authorize"===i.action;return a?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?e.hash=i.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var n=(null==e?void 0:e.apiURL)||this.instance.get_config("api_host"),r=3e4*Math.floor(Date.now()/3e4),o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(r),i=!cr.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),s=a(a({apiURL:n,jsURL:n,token:this.instance.get_config("token")},e),i?{instrument:!1}:{});s.source;var u=v(s,lr);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),hn(o,(function(){(window.ph_load_toolbar||window.ph_load_editor)(s,t.instance)})),en(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,t.loadToolbar(s)})),!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}(),pr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;u(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return l(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}(),fr=function(e){p(n,e);var t=m(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return u(this,n),(o=t.call(this,i)).handlePollRequest=r,o.captureMetrics=e,o}return l(n,[{key:"enqueue",value:function(e,t,n){this.captureMetrics.incr("batch-enqueue"),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],o=r.url,i=r.data,a=r.options;Rt(i,(function(t,n){i[n].offset=Math.abs(i[n].timestamp-e.getTime()),delete i[n].timestamp})),e.handlePollRequest(o,i,a),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(o.slice(o.length-2))),e.captureMetrics.incr("batch-handle",i.length),e.captureMetrics.incr("batch-handle-".concat(o.slice(o.length-2)),i.length)};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:"updateUnloadMetrics",value:function(){var e=this.formatQueue();for(var t in e){var n=e[t],r=n.url,o=n.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(r.slice(r.length-2))),this.captureMetrics.incr("batch-unload",o.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),o.length)}}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var n=Object.values(t);[].concat(y(n.filter((function(e){return 0===e.url.indexOf("/e")}))),y(n.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var n=t.url,r=t.data,o=t.options;e.handlePollRequest(n,r,a(a({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return Rt(this._event_queue,(function(t){var n=t.url,r=t.data,o=t.options,i=(o?o._batchKey:null)||n;void 0===e[i]&&(e[i]={data:[],url:n,options:o}),o&&e[i].options&&e[i].options._metrics&&!e[i].options._metrics.rrweb_full_snapshot&&(e[i].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),e[i].data.push(r)})),e}}]),n}(pr),hr=function(){function e(t){u(this,e),this.enabled=t,this.metrics={}}return l(e,[{key:"incr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)+t)}},{key:"decr",value:function(e){this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)-1)}}]),e}(),vr=Uint8Array,gr=Uint16Array,mr=Uint32Array,_r=new vr([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]),yr=new vr([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]),br=new vr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wr=function(e,t){for(var n=new gr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new mr(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},kr=wr(_r,2),Sr=kr[0],Cr=kr[1];Sr[28]=258,Cr[258]=28;for(var Ir=wr(yr,0)[1],Or=new gr(32768),xr=0;xr<32768;++xr){var Er=(43690&xr)>>>1|(21845&xr)<<1;Er=(61680&(Er=(52428&Er)>>>2|(13107&Er)<<2))>>>4|(3855&Er)<<4,Or[xr]=((65280&Er)>>>8|(255&Er)<<8)>>>1}var Tr=function(e,t,n){for(var r=e.length,o=0,i=new gr(t);o<r;++o)++i[e[o]-1];var a,s=new gr(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new gr(1<<t);var u=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],d=s[e[o]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)a[Or[d]>>>u]=c}else for(a=new gr(r),o=0;o<r;++o)a[o]=Or[s[e[o]-1]++]>>>15-e[o];return a},Mr=new vr(288);for(xr=0;xr<144;++xr)Mr[xr]=8;for(xr=144;xr<256;++xr)Mr[xr]=9;for(xr=256;xr<280;++xr)Mr[xr]=7;for(xr=280;xr<288;++xr)Mr[xr]=8;var Fr=new vr(32);for(xr=0;xr<32;++xr)Fr[xr]=5;var Rr,Nr=Tr(Mr,9,0),Pr=Tr(Fr,5,0),Ar=function(e){return(e/8>>0)+(7&e&&1)},Lr=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof gr?gr:e instanceof mr?mr:vr)(n-t);return r.set(e.subarray(t,n)),r},Dr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},$r=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},jr=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new vr(0),0];if(1==o){var a=new vr(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],c=0,l=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=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:s.f+u.f,l:s,r:u};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var f=new gr(p+1),h=qr(n[l-1],f,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;for(i.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<o;++r){var _=i[r].s;if(!(f[_]>t))break;v+=m-(1<<h-f[_]),f[_]=t}for(v>>>=g;v>0;){var y=i[r].s;f[y]<t?v-=1<<t-f[y]++-1:++r}for(;r>=0&&v;--r){var b=i[r].s;f[b]==t&&(--f[b],++v)}h=t}return[new vr(f),h]},qr=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},Br=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new gr(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},Hr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ur=function(e,t,n){var r=n.length,o=Ar(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},Wr=function(e,t,n,r,o,i,a,s,u,c,l){Dr(t,l++,n),++o[256];for(var d=jr(o,15),p=d[0],f=d[1],h=jr(i,15),v=h[0],g=h[1],m=Br(p),_=m[0],y=m[1],b=Br(v),w=b[0],k=b[1],S=new gr(19),C=0;C<_.length;++C)S[31&_[C]]++;for(C=0;C<w.length;++C)S[31&w[C]]++;for(var I=jr(S,7),O=I[0],x=I[1],E=19;E>4&&!O[br[E-1]];--E);var T,M,F,R,N=c+5<<3,P=Hr(o,Mr)+Hr(i,Fr)+a,A=Hr(o,p)+Hr(i,v)+a+14+3*E+Hr(S,O)+(2*S[16]+3*S[17]+7*S[18]);if(N<=P&&N<=A)return Ur(t,l,e.subarray(u,u+c));if(Dr(t,l,1+(A<P)),l+=2,A<P){T=Tr(p,f,0),M=p,F=Tr(v,g,0),R=v;var L=Tr(O,x,0);Dr(t,l,y-257),Dr(t,l+5,k-1),Dr(t,l+10,E-4),l+=14;for(C=0;C<E;++C)Dr(t,l+3*C,O[br[C]]);l+=3*E;for(var D=[_,w],$=0;$<2;++$){var j=D[$];for(C=0;C<j.length;++C){var q=31&j[C];Dr(t,l,L[q]),l+=O[q],q>15&&(Dr(t,l,j[C]>>>5&127),l+=j[C]>>>12)}}}else T=Nr,M=Mr,F=Pr,R=Fr;for(C=0;C<s;++C)if(r[C]>255){q=r[C]>>>18&31;$r(t,l,T[q+257]),l+=M[q+257],q>7&&(Dr(t,l,r[C]>>>23&31),l+=_r[q]);var B=31&r[C];$r(t,l,F[B]),l+=R[B],B>3&&($r(t,l,r[C]>>>5&8191),l+=yr[B])}else $r(t,l,T[r[C]]),l+=M[r[C]];return $r(t,l,T[256]),l+M[256]},Vr=new mr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),zr=new vr(0),Gr=function(){for(var e=new mr(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Qr=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new vr(r+a+5*(1+Math.floor(a/7e3))+o),u=s.subarray(r,s.length-o),c=0;if(!t||a<8)for(var l=0;l<=a;l+=65535){var d=l+65535;d<a?c=Ur(u,c,e.subarray(l,d)):(u[l]=i,c=Ur(u,c,e.subarray(l,a)))}else{for(var p=Vr[t-1],f=p>>>13,h=8191&p,v=(1<<n)-1,g=new gr(32768),m=new gr(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},w=new mr(25e3),k=new gr(288),S=new gr(32),C=0,I=0,O=(l=0,0),x=0,E=0;l<a;++l){var T=b(l),M=32767&l,F=m[T];if(g[M]=F,m[T]=M,x<=l){var R=a-l;if((C>7e3||O>24576)&&R>423){c=Wr(e,u,0,w,k,S,I,O,E,l-E,c),O=C=I=0,E=l;for(var N=0;N<286;++N)k[N]=0;for(N=0;N<30;++N)S[N]=0}var P=2,A=0,L=h,D=M-F&32767;if(R>2&&T==b(l-D))for(var $=Math.min(f,R)-1,j=Math.min(32767,l),q=Math.min(258,R);D<=j&&--L&&M!=F;){if(e[l+P]==e[l+P-D]){for(var B=0;B<q&&e[l+B]==e[l+B-D];++B);if(B>P){if(P=B,A=D,B>$)break;var H=Math.min(D,B-2),U=0;for(N=0;N<H;++N){var W=l-D+N+32768&32767,V=W-g[W]+32768&32767;V>U&&(U=V,F=W)}}}D+=(M=F)-(F=g[M])+32768&32767}if(A){w[O++]=268435456|Cr[P]<<18|Ir[A];var z=31&Cr[P],G=31&Ir[A];I+=_r[z]+yr[G],++k[257+z],++S[G],x=l+P,++C}else w[O++]=e[l],++k[e[l]]}}c=Wr(e,u,i,w,k,S,I,O,E,l-E,c),i||(c=Ur(u,c,zr))}return Lr(s,0,r+Ar(c)+o)}(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,!o)},Jr=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Xr(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Gr[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var o,i=Qr(e,t,10+((o=t).filename&&o.filename.length+1||0),8),a=i.length;return 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&&Jr(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)}}(i,t),Jr(i,a-8,n.d()),Jr(i,a-4,r),i}function Zr(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new vr(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;a<n;++a){if(o+5>r.length){var s=new vr(o+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?i(u):u<2048?(i(192|u>>>6),i(128|63&u)):u>55295&&u<57344?(i(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),i(128|u>>>12&63),i(128|u>>>6&63),i(128|63&u)):(i(224|u>>>12),i(128|u>>>6&63),i(128|63&u))}return Lr(r,0,o)}!function(e){e.GZipJS="gzip-js",e.LZ64="lz64",e.Base64="base64"}(Rr||(Rr={}));var Yr,Kr,eo,to=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=vt.LIB_VERSION;var o=e.split("?");if(o.length>1){var i,a=k(o[1].split("&"));try{for(a.s();!(i=a.n()).done;){var s=i.value.split("=")[0];r[s]&&delete r[s]}}catch(e){a.e(e)}finally{a.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return Rt(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t})),o.join(r)}(r)},no=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 o,i;return o=Array.isArray(t)||(i=t,"[object Uint8Array]"===Object.prototype.toString.call(i))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(o+="&compression="+t.compression),o},ro=function(e){var t=e.url,n=e.data,r=e.headers,o=e.options,i=e.captureMetrics,a=e.callback,s=e.retriesPerformedSoFar,u=e.retryQueue,c=e.onXHRError,l=e.timeout,d=void 0===l?1e4:l,p=new XMLHttpRequest;p.open(o.method||"GET",t,!0);var f=no(n,o);i.incr("_send_request"),i.incr("_send_request_inflight"),Rt(r,(function(e,t){p.setRequestHeader(t,e)})),"POST"!==o.method||o.blob||p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),p.timeout=d,p.withCredentials=!0,p.onreadystatechange=function(){if(4===p.readyState)if(i.incr("xhr-response"),i.incr("xhr-response-".concat(p.status)),i.decr("_send_request_inflight"),200===p.status){if(a){var e;try{e=JSON.parse(p.responseText)}catch(e){return void Tt(e)}a(e)}}else"function"==typeof c&&c(p),[401,403,404,500].indexOf(p.status)<0&&u.enqueue({url:t,data:n,options:o,headers:r,retriesPerformedSoFar:(s||0)+1,callback:a}),a&&a({status:0})},p.send(f)},oo=function(e){p(n,e);var t=m(n);function n(e,r){var o;return u(this,n),(o=t.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=r,"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 l(n,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=3e3*Math.pow(2,t),r=new Date(Date.now()+n);console.warn("Enqueued failed request for retry in ".concat(n)),this.queue.push({retryAt:r,requestData:e}),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=k(t);try{for(r.s();!(n=r.n()).done;){var o=n.value.requestData;this._executeXhrRequest(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=k(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,r=n.url,o=n.data,i=n.options;try{window.navigator.sendBeacon(r,no(o,a(a({},i),{},{sendBeacon:!0})))}catch(e){vt.DEBUG&&console.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,o=e.headers,i=e.callback,a=e.retriesPerformedSoFar;ro({url:t,data:n||{},options:r||{},headers:o||{},retriesPerformedSoFar:a||0,callback:i,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(pr),io=18e5,ao=864e5,so=function(){function e(t,n){u(this,e),this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var r=t.persistence_name||t.token;if(this.window_id_storage_key="ph_"+r+"_window_id",this.primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",!this.persistence.disabled&&In.is_supported()){var o=In.parse(this.window_id_storage_key),i=In.parse(this.primary_window_exists_storage_key);o&&!i?this._windowId=o:In.remove(this.window_id_storage_key),In.set(this.primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return l(e,[{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,!this.persistence.disabled&&In.is_supported()&&In.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&In.is_supported()?In.parse(this.window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(d({},Jn,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props.$sesid;return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",(function(){!e.persistence.disabled&&In.is_supported()&&In.remove(e.primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t||(new Date).getTime(),r=this._getSessionId(),o=_(r,3),i=o[0],a=o[1],s=o[2],u=this._getWindowId(),c=s&&s>0&&Math.abs(n-s)>ao;!a||!e&&Math.abs(n-i)>io||c?(a=Xt(),u=Xt(),s=n):u||(u=Xt());var l=0===i||!e||c?n:i,d=0===s?(new Date).getTime():s;return this._setWindowId(u),this._setSessionId(a,l,d),{sessionId:a,windowId:u}}}]),e}(),uo=l((function e(t,n,r,o){u(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var i,a,s;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var u=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=u+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=u+"/recordings/"+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var c=(null===(i=e.exception)||void 0===i?void 0:i.values)||[],l={$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(a=c[0])||void 0===a?void 0:a.value,$sentry_exception_type:null===(s=c[0])||void 0===s?void 0:s.type,$sentry_tags:e.tags};return n&&r&&(l.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",l),e}))}})),co=function(){function e(){u(this,e),d(this,"_seenFirstPageView",!1)}return l(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=Xt()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=Xt()),this._pageViewId}}]),e}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(Yr||(Yr={}));var lo=function(){},po={},fo="posthog",ho=bt.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,vo=!ho&&-1===St.indexOf("MSIE")&&-1===St.indexOf("Mozilla"),go=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:-1===(null==kt||null===(e=kt.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:lo,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,capture_pageleave:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==bt||null===(n=bt.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;console.error(t)},get_device_id:function(e){return e},_onCapture:lo,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},mo=function(e,t,n){var r,o=n!==fo&&eo?n?eo[n]:void 0:eo;if(o&&Kr===Yr.INIT_MODULE)r=o;else{if(o&&!At(o))return void console.error("You have already initialized "+n);r=new _o}if(r._init(e,t,n),r.toolbar.maybeLoadToolbar(),r.sessionRecording=new nr(r),r.sessionRecording.startRecordingIfEnabled(),r.webPerformance=new ar(r),r.webPerformance.startObservingIfEnabled(),r.__autocapture=r.get_config("autocapture"),r.get_config("autocapture")){r.__autocapture=r.get_config("autocapture");gn.enabledForProject(r.get_config("token"),100,100)?gn.isBrowserSupported()?gn.init(r):(r.__autocapture=!1,Et("Disabling Automatic Event Collection because this browser is not supported")):(r.__autocapture=!1,Et("Not in active bucket: disabling Automatic Event Collection."))}return vt.DEBUG=vt.DEBUG||r.get_config("debug"),void 0!==o&&At(o)&&(r._execute_array.call(r.people,o.people),r._execute_array(o)),r},_o=function(){function e(){var t=this;u(this,e),this.config=go(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=uo,this.segmentIntegration=function(){return e=t,n=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return n(e,e.event.event)},page:function(e){return n(e,"$pageview")},identify:function(e){return n(e,"$identify")},screen:function(e){return n(e,"$screen")}};var e,n},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder=!1,this.__autocapture=void 0,this._jsc=function(){},this.people=new $n(this),this.featureFlags=new Un(this),this.feature_flags=this.featureFlags,this.toolbar=new dr(this),this.pageViewIdManager=new co,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return l(e,[{key:"init",value:function(e,t,n){if(jt(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==fo){var r=mo(e,t,n);return eo[n]=r,r._loaded(),r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Pt({},go(),r,{name:o,token:e,callback_fn:(o===fo?o:"posthog."+o)+"._jsc"})),this._jsc=function(){},(null!=bt&&null!==(t=bt.rrweb)&&void 0!==t&&t.record||null!=bt&&bt.rrwebRecord)&&(this.__loaded_recorder=!0),this._captureMetrics=new hr(this.get_config("_capture_metrics")),this._requestQueue=new fr(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new oo(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new Kn(this.config),this.sessionManager=new so(this.config,this.persistence),this._gdpr_init(),r.segment&&(this.config.get_device_id=function(){return r.segment.user().anonymousId()},r.segment.user().id()&&(this.register({distinct_id:r.segment.user().id()}),this.persistence.set_user_state("identified")),r.segment.register(this.segmentIntegration())),void 0!==(null===(n=r.bootstrap)||void 0===n?void 0:n.distinctID)){var i,a,s=this.get_config("get_device_id")(Xt()),u=null!==(i=r.bootstrap)&&void 0!==i&&i.isIdentifiedID?s:r.bootstrap.distinctID;this.persistence.set_user_state(null!==(a=r.bootstrap)&&void 0!==a&&a.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.bootstrap.distinctID,$device_id:u})}if(this._hasBootstrappedFeatureFlags()){var c,l,d=Object.keys((null===(c=r.bootstrap)||void 0===c?void 0:c.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=r.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,o;return e[t]=(null===(n=r.bootstrap)||void 0===n||null===(o=n.featureFlags)||void 0===o?void 0:o[t])||!1,e}),{}),p=Object.keys((null===(l=r.bootstrap)||void 0===l?void 0:l.featureFlagPayloads)||{}).filter((function(e){return d[e]})).reduce((function(e,t){var n,o,i,a;null!==(n=r.bootstrap)&&void 0!==n&&null!==(o=n.featureFlagPayloads)&&void 0!==o&&o[t]&&(e[t]=null===(i=r.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:d,featureFlagPayloads:p})}if(!this.get_distinct_id()){var f=this.get_config("get_device_id")(Xt());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_user_state("anonymous")}bt.addEventListener&&bt.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this))}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new ur(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Nt(this.__request_queue,(function(t){e._send_request.apply(e,y(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(jt(e))return null;if(ho)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(o){delete n[r],e(o,t)},o}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||po,lo)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var o,i=function(e,t,n){return e===Rr.LZ64?[{data:ht.compressToBase64(t),compression:Rr.LZ64},n]:e===Rr.GZipJS?[Xr(Zr(t),{mtime:0}),a(a({},n),{},{blob:!0,urlQueryArgs:{compression:Rr.GZipJS}})]:[{data:Gt(t)},n]}((o=this.compression)[Rr.GZipJS]?Rr.GZipJS:o[Rr.LZ64]?Rr.LZ64:Rr.Base64,t,n),s=_(i,2),u=s[0],c=s[1];this._send_request(e,u,c,r)}},{key:"_send_request",value:function(e,t,n,r){if(vo)this.__request_queue.push([e,t,n,r]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};n=Pt(o,n||{}),ho||(n.method="GET");var i="sendBeacon"in bt.navigator&&"sendBeacon"===n.transport;if(e=to(e,n.urlQueryArgs||{},{ip:this.get_config("ip")}),$t(t)&&this.get_config("img")){var s=kt.createElement("img");s.src=e,kt.body.appendChild(s)}else if(i)try{bt.navigator.sendBeacon(e,no(t,a(a({},n),{},{sendBeacon:!0})))}catch(e){this.get_config("debug")&&console.error(e)}else if(ho)try{ro({url:e,data:t,headers:this.get_config("xhr_headers"),options:n,captureMetrics:this._captureMetrics,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(e){console.error(e)}else{var u,c=kt.createElement("script");c.type="text/javascript",c.async=!0,c.defer=!0,c.src=e;var l=kt.getElementsByTagName("script")[0];null===(u=l.parentNode)||void 0===u||u.insertBefore(c,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],o=[],i=[];Nt(e,(function(e){e&&(t=e[0],At(t)?i.push(e):"function"==typeof e?e.call(n):At(e)&&"alias"===t?r.push(e):At(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?i.push(e):o.push(e))}));var a=function(e,t){Nt(e,(function(e){if(At(e[0])){var n=t;Rt(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(o,this),a(i,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:po;if(this.__loaded&&!An(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||po).transport;if(r&&(n.transport=r),jt(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!Zt(St)){this.persistence.update_search_keyword(kt.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(kt.referrer);var o={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(o.$set=n.$set),(o=zt(o,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&Et("PostHog.js send",o);var i=JSON.stringify(o),a=this.get_config("api_host")+(n.endpoint||"/e/"),s=n!==po;return!this.get_config("request_batching")||s&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(a,i,n):this._requestQueue.enqueue(a,o,n),this._invokeCaptureHooks(e,o),o}}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),Rt(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){var n,r=this.persistence.remove_event_timer(e),o=a({},t);if(o.token=this.get_config("token"),"$snapshot"===e){var i=this.persistence.properties();return o.distinct_id=i.distinct_id,o}var s=tn.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),c=u.sessionId,l=u.windowId;o.$session_id=c,o.$window_id=l}if(null!==(n=this.webPerformance)&&void 0!==n&&n.isEnabled&&("$pageview"===e&&this.pageViewIdManager.onPageview(),o=Pt(o,{$pageview_id:this.pageViewIdManager.getPageViewId()})),"$performance_event"===e){var d=this.persistence.properties();return o.distinct_id=d.distinct_id,o.$current_url=s.$current_url,o}if(void 0!==r){var p=(new Date).getTime()-r;o.$duration=parseFloat((p/1e3).toFixed(3))}o=Pt({},s,this.persistence.properties(),o);var f=this.get_config("property_blacklist");At(f)?Rt(f,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+f);var h=this.get_config("sanitize_properties");return h&&(o=h(o,e)),o}},{key:"register",value:function(e,t){this.persistence.register(e,t)}},{key:"register_once",value:function(e,t,n){this.persistence.register_once(e,t,n)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(d({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"identify",value:function(e,t,n){if(e){this._captureMetrics.incr("identify");var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(Vn)&&(this.unregister(Vn),this.register({distinct_id:e}));var i="anonymous"===this.persistence.get_user_state();e!==r&&i?(this.persistence.set_user_state("identified"),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t&&this.people.set(t),n&&this.people.set_once(n)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,t,n){if(e&&t){this._captureMetrics.incr("group");var r=this.getGroups();this.register({$groups:a(a({},r),{},d({},e,t))}),n&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),r[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.reloadFeatureFlags()}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(Xt());this.register_once({distinct_id:n,$device_id:e?n:t},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"alias",value:function(e,t){return e===this.get_property(Wn)?(Mt("Attempting to create alias for existing People user - aborting."),-2):(jt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Vn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t=a({},this.config);$t(e)&&(Pt(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),bn.is_supported()&&"true"===bn.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(vt.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&t.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started())}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_config",value:function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]}},{key:"get_property",value:function(e){return this.persistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:fo;return t!==fo&&(t="posthog."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&bn.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!_n.get("ph_optout")||(_n.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=Pt({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),bn.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=Pt({enable_persistence:!0},e||{}),this._gdpr_call_func(On,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=Pt({clear_persistence:!0},e||{});this._gdpr_call_func(xn,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(En,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Tn,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=Pt({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Mn,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(bt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(bt.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"decodeLZ64",value:function(e){return ht.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Ut(e.prototype[t[n]])}(_o,["identify"]);var yo={},bo=function(){eo.init=function(e,t,n){if(n)return eo[n]||(eo[n]=yo[n]=mo(e||"",t||{},n),eo[n]._loaded()),eo[n];var r=eo;return yo.posthog?r=yo.posthog:e&&((r=mo(e,t||{},fo))._loaded(),yo.posthog=r),eo=r,Kr===Yr.INIT_SNIPPET&&(bt.posthog=eo),Rt(yo,(function(e,t){t!==fo&&(eo[t]=e)})),r}};Kr=Yr.INIT_SNIPPET,jt(bt.posthog)&&(bt.posthog=[]),(eo=bt.posthog).__loaded||eo.config&&eo.persistence?console.error("PostHog library has already been downloaded at least once."):(Rt(eo._i,(function(e){e&&At(e)&&(yo[e[2]]=mo.apply(void 0,y(e)))})),bo(),eo.init(),Rt(yo,(function(e){e._loaded()})),function(){function e(){e.done||(e.done=!0,vo=!1,Rt(yo,(function(e){e._dom_loaded()})))}kt.addEventListener&&("complete"===kt.readyState?e():kt.addEventListener("DOMContentLoaded",e,!1)),en(bt,"load",e,!0)}())}();
|
|
15
|
+
***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function o(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="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},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(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 l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(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&&h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function v(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(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 m(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=f(e);if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return g(this,n)}}function _(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,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||b(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 y(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(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 b(e,t){if(e){if("string"==typeof e)return w(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)?w(e,t):void 0}}function w(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 k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function S(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function C(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,i=e.maskInputFn,a=o||"";return(t[n.toLowerCase()]||t[r])&&(a=i?i(a):"*".repeat(a.length)),a}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var I="__rrweb_original__";var O,x,E=1,T=new RegExp("[^a-z0-9-_:]"),M=-2;function F(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(R).join(""):null}catch(e){return null}}function R(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=F(e.styleSheet)||t}catch(e){}return t}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,P=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,A=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(N,(function(e,n,r,o,i,a){var s,u=r||i||a,c=n||o||"";if(!u)return e;if(!P.test(u))return"url("+c+u+c+")";if(A.test(u))return"url("+c+u+c+")";if("/"===u[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+c+")";var l=t.split("/"),d=u.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url("+c+l.join("/")+c+")"}))}var D,$,j,q,B,H,U=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;function V(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function z(){var e=document.createElement("a");return e.href="",e.href}function G(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?V(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(W),!(n>=t.length);){var i=r(U);if(","===i.slice(-1))i=V(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=V(e,i);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((i+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((i+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?L(r,z()):"object"===t&&"data"===n&&r?V(e,r):r:V(e,r)}function Q(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!(!n||!e.matches(n))||Q(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,Q(e.parentNode,t,n)}function J(t,n){var r,o,i,a,s=n.doc,u=n.blockClass,c=n.blockSelector,l=n.maskTextClass,d=n.maskTextSelector,p=n.inlineStylesheet,f=n.maskInputOptions,h=void 0===f?{}:f,v=n.maskTextFn,g=n.maskInputFn,m=n.dataURLOptions,_=void 0===m?{}:m,y=n.inlineImages,b=n.recordCanvas,w=n.keepIframeSrcFn;if(s.__sn){var k=s.__sn.id;o=1===k?void 0:k}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{type:e.Document,childNodes:[],rootId:o};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:o};case t.ELEMENT_NODE:for(var S=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(t,u,c),E=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return T.test(t)?"div":t}(t),M={},R=0,N=Array.from(t.attributes);R<N.length;R++){var P=N[R],A=P.name,D=P.value;M[A]=G(s,E,A,D)}if("link"===E&&p){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),j=null;$&&(j=F($)),j&&(delete M.rel,delete M.href,M._cssText=L(j,$.href))}if("style"===E&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(j=F(t.sheet))&&(M._cssText=L(j,z()));if("input"===E||"textarea"===E||"select"===E){D=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&D?M.value=C({type:M.type,tagName:E,value:D,maskInputOptions:h,maskInputFn:g}):t.checked&&(M.checked=t.checked)}if("option"===E&&(t.selected&&!h.select?M.selected=!0:delete M.selected),"canvas"===E&&b)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,i=I in o?o[I]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var q=t.toDataURL(_.type,_.quality),B=document.createElement("canvas");B.width=t.width,B.height=t.height,q!==B.toDataURL(_.type,_.quality)&&(M.rr_dataURL=q)}if("img"===E&&y){O||(O=s.createElement("canvas"),x=O.getContext("2d"));var H=t,U=H.crossOrigin;H.crossOrigin="anonymous";var W=function(){try{O.width=H.naturalWidth,O.height=H.naturalHeight,x.drawImage(H,0,0),M.rr_dataURL=O.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+H.currentSrc+"! Error: "+e)}U?M.crossOrigin=U:delete M.crossOrigin};H.complete&&0!==H.naturalWidth?W():H.onload=W}if("audio"!==E&&"video"!==E||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),S){var V=t.getBoundingClientRect(),J=V.width,X=V.height;M={class:M.class,rr_width:J+"px",rr_height:X+"px"}}return"iframe"!==E||w(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),{type:e.Element,tagName:E,attributes:M,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:S,rootId:o};case t.TEXT_NODE:var Z=t.parentNode&&t.parentNode.tagName,Y=t.textContent,K="STYLE"===Z||void 0,ee="SCRIPT"===Z||void 0;if(K&&Y){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(Y=(i=t.parentNode.sheet).cssRules?Array.from(i.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}Y=L(Y,z())}return ee&&(Y="SCRIPT_PLACEHOLDER"),!K&&!ee&&Q(t,l,d)&&Y&&(Y=v?v(Y):Y.replace(/[\S]/g,"*")),{type:e.Text,textContent:Y||"",isStyle:K,rootId:o};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:o};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:o};default:return!1}}function X(e){return void 0===e?"":e.toLowerCase()}function Z(t,n){var r,o=n.doc,i=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,c=n.maskTextSelector,l=n.skipChild,d=void 0!==l&&l,p=n.inlineStylesheet,f=void 0===p||p,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,m=n.maskInputFn,_=n.slimDOMOptions,y=n.dataURLOptions,b=void 0===y?{}:y,w=n.inlineImages,k=void 0!==w&&w,C=n.recordCanvas,I=void 0!==C&&C,O=n.onSerialize,x=n.onIframeLoad,T=n.iframeLoadTimeout,F=void 0===T?5e3:T,R=n.keepIframeSrcFn,N=void 0===R?function(){return!1}:R,P=n.preserveWhiteSpace,A=void 0===P||P,L=J(t,{doc:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:k,recordCanvas:I,keepIframeSrcFn:N});if(!L)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(X(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===X(t.attributes.name)||"icon"===X(t.attributes.rel)||"apple-touch-icon"===X(t.attributes.rel)||"shortcut icon"===X(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&X(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(X(t.attributes.property).match(/^(og|twitter|fb):/)||X(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===X(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===X(t.attributes.name)||"googlebot"===X(t.attributes.name)||"bingbot"===X(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===X(t.attributes.name)||"generator"===X(t.attributes.name)||"framework"===X(t.attributes.name)||"publisher"===X(t.attributes.name)||"progid"===X(t.attributes.name)||X(t.attributes.property).match(/^article:/)||X(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===X(t.attributes.name)||"yandex-verification"===X(t.attributes.name)||"csrf-token"===X(t.attributes.name)||"p:domain_verify"===X(t.attributes.name)||"verify-v1"===X(t.attributes.name)||"verification"===X(t.attributes.name)||"shopify-checkout-api-token"===X(t.attributes.name)))return!0}}return!1}(L,_)&&(A||L.type!==e.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?E++:M;var D=Object.assign(L,{id:r});if(t.__sn=D,r===M)return null;i[r]=t,O&&O(t);var $=!d;if(D.type===e.Element&&($=$&&!D.needBlock,delete D.needBlock,t.shadowRoot&&(D.isShadowHost=!0)),(D.type===e.Document||D.type===e.Element)&&$){_.headWhitespace&&L.type===e.Element&&"head"===L.tagName&&(A=!1);for(var j={doc:o,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:d,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:O,onIframeLoad:x,iframeLoadTimeout:F,keepIframeSrcFn:N},q=0,B=Array.from(t.childNodes);q<B.length;q++){(W=Z(B[q],j))&&D.childNodes.push(W)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var H=0,U=Array.from(t.shadowRoot.childNodes);H<U.length;H++){var W;(W=Z(U[H],j))&&(W.isShadow=!0,D.childNodes.push(W))}}return t.parentNode&&S(t.parentNode)&&(D.isShadow=!0),D.type===e.Element&&"iframe"===D.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&x){var n=Z(e,{doc:e,map:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:_,dataURLOptions:b,inlineImages:k,recordCanvas:I,preserveWhiteSpace:A,onSerialize:O,onIframeLoad:x,iframeLoadTimeout:F,keepIframeSrcFn:N});n&&x(t,n)}}),F),D}function Y(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(D||(D={})),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"}($||($={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(j||(j={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(q||(q={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(B||(B={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(H||(H={}));var K="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",ee={map:{},getId:function(){return console.error(K),-1},getNode:function(){return console.error(K),null},removeNodeFromMap:function(){console.error(K)},has:function(){return console.error(K),!1},reset:function(){console.error(K)}};function te(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(i){var a=Date.now();o||!1!==n.leading||(o=a);var s=t-(a-o),u=this,c=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),o=a,e.apply(u,c)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,c)}),s))}}function ne(e,t,n,r,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return ne(e,t,i||{},!0)}}function re(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||ae(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,ae(e.parentNode,t)}function se(e){return"__sn"in e&&e.__sn.id===M}function ue(e,t){if(S(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function le(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}function pe(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ee=new Proxy(ee,{get:function(e,t,n){return"map"===t&&console.error(K),Reflect.get(e,t,n)}}));var fe=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pe(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&pe(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),he=function(e,t){return"".concat(e,"@").concat(t)};function ve(e){return"__sn"in e}var ge=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,o,i;if(!e.frozen&&!e.locked){for(var a=[],s=new fe,u=function(t){for(var n=t,r=M;r===M;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},c=function(t){for(var n,r,o,i,c,l=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=l;null===(o=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===o?void 0:o.host;)d=(null===(c=null===(i=null==d?void 0:d.getRootNode)||void 0===i?void 0:i.call(d))||void 0===c?void 0:c.host)||null;var p=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!p){var f=S(t.parentNode)?e.mirror.getId(l):e.mirror.getId(t.parentNode),h=u(t);if(-1===f||-1===h)return s.addNode(t);var v=Z(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){le(n)&&e.iframeManager.addIframe(n),de(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:f,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var l=n(e.movedSet),d=l.next();!d.done;d=l.next()){var p=d.value;_e(e.removes,p,e.mirror)&&!e.movedSet.has(p.parentNode)||c(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;ye(e.droppedSet,p)||_e(e.removes,p,e.mirror)?ye(e.movedSet,p)?c(p):e.droppedSet.add(p):c(p)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}for(var v=null;s.length;){var g=null;if(v){var m=e.mirror.getId(v.value.parentNode),_=u(v.value);-1!==m&&-1!==_&&(g=v)}if(!g)for(var y=s.length-1;y>=0;y--){var b=s.get(y);if(b){m=e.mirror.getId(b.value.parentNode),_=u(b.value);if(-1!==m&&-1!==_){g=b;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),c(g.value)}var w={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(w.texts.length||w.attributes.length||w.removes.length||w.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(w))}},this.processMutation=function(t){var r,o,i,a;if(!se(t.target))switch(t.type){case"characterData":var s=t.target.textContent;ae(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:Q(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=C({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),ae(t.target,e.blockClass)||s===t.oldValue)return;var c=e.attributes.find((function(e){return e.node===t.target}));if(c||(c={node:t.target,attributes:{}},e.attributes.push(c)),"style"===t.attributeName){var l=e.doc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue),void 0!==c.attributes.style&&null!==c.attributes.style||(c.attributes.style={});var d=c.attributes.style;try{for(var p=n(Array.from(u.style)),f=p.next();!f.done;f=p.next()){var h=f.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===l.style.getPropertyValue(h)&&g===l.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}try{for(var m=n(Array.from(l.style)),_=m.next();!_.done;_=m.next()){h=_.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}}else c.attributes[t.attributeName]=G(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),o=S(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);ae(t.target,e.blockClass)||se(n)||(e.addedSet.has(n)?(me(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ue(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[he(r,o)]?me(e.movedSet,n):e.removes.push({parentId:o,id:r,isShadow:!!S(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!ae(n,e.blockClass)){if(ve(t)){if(se(t))return;e.movedSet.add(t);var r=null;n&&ve(n)&&(r=n.__sn.id),r&&(e.movedMap[he(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);ae(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function me(e,t){e.delete(t),t.childNodes.forEach((function(t){return me(e,t)}))}function _e(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||_e(e,r,n)}function ye(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||ye(e,n))}var be=ge,we=[],ke="undefined"!=typeof CSSGroupingRule,Se="undefined"!=typeof CSSMediaRule,Ce="undefined"!=typeof CSSSupportsRule,Ie="undefined"!=typeof CSSConditionRule;function Oe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function xe(e,t){var n,r,o=new be;we.push(o),o.init(e);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ee(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];return Object.keys(j).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var i=e.toLowerCase(),a=function(e){return function(n){var i=Oe(n);if(!ae(i,o)){var a=ce(n)?n.changedTouches[0]:n;if(a){var s=r.getId(i),u=a.clientX,c=a.clientY;t({type:j[e],id:s,x:u,y:c})}}}}(e);s.push(Y(i,a,n))})),function(){s.forEach((function(e){return e()}))}}function Te(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass;return Y("scroll",te((function(e){var i=Oe(e);if(i&&!ae(i,o)){var a=r.getId(i);if(i===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),n)}function Me(e,n){var r=t({},e);return n||delete r.userTriggered,r}var Fe=["INPUT","TEXTAREA","SELECT"],Re=new WeakMap;function Ne(e){return function(e,t){if(ke&&e.parentRule instanceof CSSGroupingRule||Se&&e.parentRule instanceof CSSMediaRule||Ce&&e.parentRule instanceof CSSSupportsRule||Ie&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Pe(e,i){var a,s;void 0===i&&(i={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,i=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,c=e.inputCb,l=e.mediaInteractionCb,d=e.styleSheetRuleCb,p=e.styleDeclarationCb,f=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];t.mutation&&t.mutation.apply(t,o([],r(e),!1)),n.apply(void 0,o([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,o([],r(e),!1)),i.apply(void 0,o([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,o([],r(e),!1)),a.apply(void 0,o([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,o([],r(e),!1)),s.apply(void 0,o([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,o([],r(e),!1)),u.apply(void 0,o([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,o([],r(e),!1)),c.apply(void 0,o([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,o([],r(e),!1)),l.apply(void 0,o([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,o([],r(e),!1)),d.apply(void 0,o([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,o([],r(e),!1)),p.apply(void 0,o([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,o([],r(e),!1)),f.apply(void 0,o([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,o([],r(e),!1)),h.apply(void 0,o([],r(e),!1))}}(e,i);var c=xe(e,e.doc),l=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var i,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=te((function(e){var n=Date.now()-i;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],i=null}),s),l=te((function(e){var t=Oe(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;i||(i=Date.now()),u.push({x:r,y:a,id:o.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?$.Drag:e instanceof MouseEvent?$.MouseMove:$.TouchMove)}),a,{trailing:!1}),d=[Y("mousemove",l,r),Y("touchmove",l,r),Y("drag",l,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=Ee(e),p=Te(e),f=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return Y("resize",te((function(){var e=oe(),o=ie();n===e&&r===o||(t({width:Number(o),height:Number(e)}),n=e,r=o)}),200),window)}(e),h=function(e){var n=e.inputCb,i=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,c=e.maskInputOptions,l=e.maskInputFn,d=e.sampling,p=e.userTriggeredOnInput;function f(e){var t=Oe(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Fe.indexOf(t.tagName)<0)&&!ae(t,s)){var r=t.type;if(!t.classList.contains(u)){var o=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(c[t.tagName.toLowerCase()]||c[r])&&(o=C({maskInputOptions:c,tagName:t.tagName,type:r,value:o,maskInputFn:l})),h(t,Me({text:o,isChecked:a,userTriggered:n},p));var d=t.name;"radio"===r&&d&&a&&i.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Me({text:e.value,isChecked:!a,userTriggered:!1},p))}))}}}function h(e,r){var o=Re.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Re.set(e,r);var i=a.getId(e);n(t(t({},r),{id:i}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return Y(e,f,i)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,o([],r(m.map((function(e){return ne(e[0],e[1],{set:function(){f({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,o=e.sampling,i=function(e){return te((function(o){var i=Oe(o);if(i&&!ae(i,n)){var a=i,s=a.currentTime,u=a.volume,c=a.muted;t({type:e,id:r.getId(i),currentTime:s,volume:u,muted:c})}}),o.media||500)},a=[Y("play",i(0)),Y("pause",i(1)),Y("seeked",i(2)),Y("volumechange",i(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,i=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=i.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=i.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var c={};ke?c.CSSGroupingRule=a.CSSGroupingRule:(Se&&(c.CSSMediaRule=a.CSSMediaRule),Ie&&(c.CSSConditionRule=a.CSSConditionRule),Ce&&(c.CSSSupportsRule=a.CSSSupportsRule));var l={};return Object.entries(c).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];l[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=i.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:o(o([],r(Ne(this)),!1),[t||0],!1)}]}),l[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=i.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:o(o([],r(Ne(this)),!1),[e],!1)}]}),l[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(c).forEach((function(e){var t=r(e,2),n=t[0],o=t[1];o.prototype.insertRule=l[n].insertRule,o.prototype.deleteRule=l[n].deleteRule}))}}(e,{win:u}),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=t.win,i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(e,t,o){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:o},index:Ne(this.parentRule)}),i.apply(this,arguments)};var a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,o,i=r.getId(null===(o=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===o?void 0:o.ownerNode);return-1!==i&&n({id:i,remove:{property:e},index:Ne(this.parentRule)}),a.apply(this,arguments)},function(){o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),_=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],i=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=re(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=i.get(n);e&&(t(e),i.delete(n))}),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=a})),o.push(s),function(){o.forEach((function(e){return e()}))}}(e):function(){},y=[];try{for(var b=n(e.plugins),w=b.next();!w.done;w=b.next()){var k=w.value;y.push(k.observer(k.callback,u,k.options))}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}return function(){we.forEach((function(e){return e.reset()})),c.disconnect(),l(),d(),p(),f(),h(),v(),g(),m(),_(),y.forEach((function(e){return e()}))}}var Ae=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),Le=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(re(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){xe(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Te(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(re(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),je=0;je<De.length;je++)$e[De.charCodeAt(je)]=je;var qe=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=De[n[t]>>2],o+=De[(3&n[t])<<4|n[t+1]>>4],o+=De[(15&n[t+1])<<2|n[t+2]>>6],o+=De[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o},Be=new Map;var He=function(e,t,n){if(e&&(Ve(e,t)||"object"===s(e))){var r=function(e,t){var n=Be.get(e);return n||(n=new Map,Be.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o}};function Ue(e,t,n){return e instanceof Array?e.map((function(e){return Ue(e,t,n)})):null===e?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:qe(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[Ue(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Ue(e.data,t,n),e.width,e.height]}:Ve(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:He(e,t,n)}:e}var We=function(e,t,n){return o([],r(e),!1).map((function(e){return Ue(e,t,n)}))},Ve=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function ze(e,t,i,a,s,u){var c,l,d=[],p=Object.getOwnPropertyNames(e),f=function(n){try{if("function"!=typeof e[n])return"continue";var c=re(e,n,(function(c){return function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];var p=c.apply(this,l);if(He(p,u,e),!ae(this.canvas,a)){s.getId(this.canvas);var f=We(o([],r(l),!1),u,e),h={type:t,property:n,args:f};i(this.canvas,h)}return p}}));d.push(c)}catch(r){var l=ne(e,n,{set:function(e){i(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(l)}};try{for(var h=n(p),v=h.next();!v.done;v=h.next()){f(v.value)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(c)throw c.error}}return d}var Ge,Qe,Je=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=function(e,t){var n=[];try{var i=re(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return ae(this,t)||"__context"in this||(this.__context=n),e.apply(this,o([n],r(i),!1))}}));n.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,i,a){var s,u,c=[],l=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=re(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return ae(this.canvas,i)||setTimeout((function(){var t=o([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var i=t[0],u=i.getContext("2d"),c=null==u?void 0:u.getImageData(0,0,i.width,i.height),l=null==c?void 0:c.data;t[0]=JSON.stringify(l)}e(a.canvas,{type:q["2D"],property:n,args:t})}),0),t.apply(this,s)}}));c.push(a)}catch(r){var s=ne(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:q["2D"],property:n,args:[t],setter:!0})}});c.push(s)}};try{for(var p=n(l),f=p.next();!f.done;f=p.next())d(f.value)}catch(e){s={error:e}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(s)throw s.error}}return function(){c.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,i){var a=[];return a.push.apply(a,o([],r(ze(t.WebGLRenderingContext.prototype,q.WebGL,e,n,i,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,o([],r(ze(t.WebGL2RenderingContext.prototype,q.WebGL2,e,n,i,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){i(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function Xe(e){return t(t({},e),{timestamp:Date.now()})}var Ze={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ye(e){void 0===e&&(e={});var o=e.emit,i=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,c=e.blockSelector,l=void 0===c?null:c,d=e.ignoreClass,p=void 0===d?"rr-ignore":d,f=e.maskTextClass,h=void 0===f?"rr-mask":f,v=e.maskTextSelector,g=void 0===v?null:v,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,S=e.maskTextFn,C=e.hooks,I=e.packFn,O=e.sampling,x=void 0===O?{}:O,E=e.mousemoveWait,T=e.recordCanvas,M=void 0!==T&&T,F=e.userTriggeredOnInput,R=void 0!==F&&F,N=e.collectFonts,P=void 0!==N&&N,A=e.inlineImages,L=void 0!==A&&A,j=e.plugins,q=e.keepIframeSrcFn,B=void 0===q?function(){return!1}:q;if(!o)throw new Error("emit function is required");void 0!==E&&void 0===x.mousemove&&(x.mousemove=E);var H,U=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==b?b:{password:!0},W=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var V=0;Ge=function(e,t){var r;if(!(null===(r=we[0])||void 0===r?void 0:r.isFrozen())||e.type===D.FullSnapshot||e.type===D.IncrementalSnapshot&&e.data.source===$.Mutation||we.forEach((function(e){return e.unfreeze()})),o(function(e){var t,r;try{for(var o=n(j||[]),i=o.next();!i.done;i=o.next()){var a=i.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return I&&(e=I(e)),e}(e),t),e.type===D.FullSnapshot)H=e,V=0;else if(e.type===D.IncrementalSnapshot){if(e.data.source===$.Mutation&&e.data.isAttachIframe)return;V++;var s=a&&V>=a,u=i&&e.timestamp-H.timestamp>i;(s||u)&&Qe(!0)}};var z=function(e){Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Mutation},e)}))},G=function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Scroll},e)}))},Q=function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.CanvasMutation},e)}))},J=new Ae({mutationCb:z}),X=new Je({recordCanvas:M,mutationCb:Q,win:window,blockClass:u,mirror:Ze}),K=new Le({mutationCb:z,scrollCb:G,bypassOptions:{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:U,maskTextFn:S,maskInputFn:k,recordCanvas:M,inlineImages:L,sampling:x,slimDOMOptions:W,iframeManager:J,canvasManager:X},mirror:Ze});Qe=function(e){var t,n,o,i;void 0===e&&(e=!1),Ge(Xe({type:D.Meta,data:{href:window.location.href,width:ie(),height:oe()}}),e),we.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"rr-block":r,i=n.blockSelector,a=void 0===i?null:i,s=n.maskTextClass,u=void 0===s?"rr-mask":s,c=n.maskTextSelector,l=void 0===c?null:c,d=n.inlineStylesheet,p=void 0===d||d,f=n.inlineImages,h=void 0!==f&&f,v=n.recordCanvas,g=void 0!==v&&v,m=n.maskAllInputs,_=void 0!==m&&m,y=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,O=n.onIframeLoad,x=n.iframeLoadTimeout,E=n.keepIframeSrcFn,T={};return[Z(e,{doc:e,map:T,blockClass:o,blockSelector:a,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===_?{password:!0}:_,maskTextFn:y,maskInputFn:b,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:C,onSerialize:I,onIframeLoad:O,iframeLoadTimeout:x,keepIframeSrcFn:void 0===E?function(){return!1}:E}),T]}(document,{blockClass:u,blockSelector:l,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:U,maskTextFn:S,slimDOM:W,recordCanvas:M,inlineImages:L,onSerialize:function(e){le(e)&&J.addIframe(e),de(e)&&K.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){J.attachIframe(e,t),K.observeAttachShadow(e)},keepIframeSrcFn:B}),2),s=a[0],c=a[1];if(!s)return console.warn("Failed to snapshot the document");Ze.map=c,Ge(Xe({type:D.FullSnapshot,data:{node:s,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(i=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),we.forEach((function(e){return e.unlock()}))};try{var ee=[];ee.push(Y("DOMContentLoaded",(function(){Ge(Xe({type:D.DomContentLoaded,data:{}}))})));var te=function(e){var n;return Pe({mutationCb:z,mousemoveCb:function(e,t){return Ge(Xe({type:D.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.MouseInteraction},e)}))},scrollCb:G,viewportResizeCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.ViewportResize},e)}))},inputCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Input},e)}))},mediaInteractionCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.StyleDeclaration},e)}))},canvasMutationCb:Q,fontCb:function(e){return Ge(Xe({type:D.IncrementalSnapshot,data:t({source:$.Font},e)}))},blockClass:u,ignoreClass:p,maskTextClass:h,maskTextSelector:g,maskInputOptions:U,inlineStylesheet:_,sampling:x,recordCanvas:M,inlineImages:L,userTriggeredOnInput:R,collectFonts:P,doc:e,maskInputFn:k,maskTextFn:S,blockSelector:l,slimDOMOptions:W,mirror:Ze,iframeManager:J,shadowDomManager:K,canvasManager:X,plugins:(null===(n=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return Ge(Xe({type:D.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};J.addLoadListener((function(e){ee.push(te(e.contentDocument))}));var ne=function(){Qe(),ee.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():ee.push(Y("load",(function(){Ge(Xe({type:D.Load,data:{}})),ne()}),window)),function(){ee.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Ye.addCustomEvent=function(e,t){if(!Ge)throw new Error("please add custom event after start recording");Ge(Xe({type:D.Custom,data:{tag:e,payload:t}}))},Ye.freezePage=function(){we.forEach((function(e){return e.freeze()}))},Ye.takeFullSnapshot=function(e){if(!Qe)throw new Error("please take full snapshot after start recording");Qe(e)},Ye.mirror=Ze;var Ke=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),et=/(^|@)\S+:\d+/,tt=/^\s*at .*(\S+:\d+|\(native\))/m,nt=/^(eval@)?(\[native code])?$/,rt={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(tt))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(tt)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Ke({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(nt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ke({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Ke({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new Ke({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new Ke({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(et)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ke({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function ot(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var i=0;i<r.children.length;i++){var a=r.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&o.push(a)}o.length>1&&(n+=":eq("+o.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function it(e){return"[object Object]"===Object.prototype.toString.call(e)}function at(e,t){var r,o;if(0===t)return!0;var i=Object.keys(e);try{for(var a=n(i),s=a.next();!s.done;s=a.next()){var u=s.value;if(it(e[u])&&at(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1}function st(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?o.splice(i,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if(it(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(it(e)&&at(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=ot(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var ut={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function ct(e,t,i){var a,s,u,c=i.logger;if(!c)return function(){};u="string"==typeof c?t[c]:c;var l=0,d=[];if(i.level.includes("error")&&window){var p=function(t){var n=t.message,r=t.error,o=rt.parse(r).map((function(e){return e.toString()})),a=[st(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};window.addEventListener("error",p),d.push((function(){window&&window.removeEventListener("error",p)}))}try{for(var f=n(i.level),h=f.next();!h.done;h=f.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?re(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var c=rt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return st(e,i.stringifyOptions)}));++l<i.lengthThreshold?e({level:n,trace:c,payload:d}):l===i.lengthThreshold&&e({level:"warn",trace:[],payload:[st("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,o(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var lt="undefined"!=typeof window?window:{};lt.rrweb={record:Ye,version:"1.1.3"},lt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:ct,options:e?Object.assign({},ut,e):ut}}};var dt=String.fromCharCode,pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",ht={};function vt(e,t){if(!ht[e]){ht[e]={};for(var n=0;n<e.length;n++)ht[e][e.charAt(n)]=n}return ht[e][t]}var gt={compressToBase64:function(e){if(null==e)return"";var t=gt._compress(e,6,(function(e){return pt.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:gt._decompress(e.length,32,(function(t){return vt(pt,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":gt._compress(e,15,(function(e){return dt(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:gt._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=gt.compress(e),n=new Uint8Array(2*t.length),r=0,o=t.length;r<o;r++){var i=t.charCodeAt(r);n[2*r]=i>>>8,n[2*r+1]=i%256}return n},decompressFromUint8Array:function(e){if(null==e)return gt.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var o=[];return t.forEach((function(e){o.push(dt(e))})),gt.decompress(o.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":gt._compress(e,6,(function(e){return ft.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),gt._decompress(e.length,32,(function(t){return vt(ft,e.charAt(t))})))},compress:function(e){return gt._compress(e,16,(function(e){return dt(e)}))},_compress:function(e,t,n){if(null==e)return"";var r,o,i,a="",s="",u="",c=2,l=3,d=2,p=0,f=0,h={},v={},g=[];for(i=0;i<e.length;i+=1)if(a=e.charAt(i),Object.prototype.hasOwnProperty.call(h,a)||(h[a]=l++,v[a]=!0),s=u+a,Object.prototype.hasOwnProperty.call(h,s))u=s;else{if(Object.prototype.hasOwnProperty.call(v,u)){if(u.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(o=u.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}else{for(o=1,r=0;r<d;r++)p=p<<1|o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}0==--c&&(c=Math.pow(2,d),d++),delete v[u]}else for(o=h[u],r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;0==--c&&(c=Math.pow(2,d),d++),h[s]=l++,u=String(a)}if(""!==u){if(Object.prototype.hasOwnProperty.call(v,u)){if(u.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(o=u.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}else{for(o=1,r=0;r<d;r++)p=p<<1|o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1}0==--c&&(c=Math.pow(2,d),d++),delete v[u]}else for(o=h[u],r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;0==--c&&(c=Math.pow(2,d),d++)}for(o=2,r=0;r<d;r++)p=p<<1|1&o,f==t-1?(f=0,g.push(n(p)),p=0):f++,o>>=1;for(;;){if(p<<=1,f==t-1){g.push(n(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:gt._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,o,i,a,s,u,c,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,v=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(i=0,s=Math.pow(2,2),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;switch(i){case 0:for(i=0,s=Math.pow(2,8),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;c=dt(i);break;case 1:for(i=0,s=Math.pow(2,16),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;c=dt(i);break;case 2:return""}for(l[3]=c,o=c,d.push(c);;){if(p.index>e)return"";for(i=0,s=Math.pow(2,v),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;switch(c=i){case 0:for(i=0,s=Math.pow(2,8),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;l[h++]=dt(i),c=h-1,f--;break;case 1:for(i=0,s=Math.pow(2,16),u=1;u!=s;)a=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(a>0?1:0)*u,u<<=1;l[h++]=dt(i),c=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,v),v++),l[c])g=l[c];else{if(c!==h)return null;g=o+o.charAt(0)}d.push(g),l[h++]=o+g.charAt(0),o=g,0==--f&&(f=Math.pow(2,v),v++)}}},mt={DEBUG:!1,LIB_VERSION:"1.48.0"},_t=Array.prototype,yt=Object.prototype,bt=yt.toString,wt=yt.hasOwnProperty,kt="undefined"!=typeof window?window:{},St=kt.navigator||{userAgent:""},Ct=kt.document||{},It=St.userAgent,Ot=_t.forEach,xt=_t.indexOf,Et=Array.isArray,Tt={},Mt={log:function(){if(mt.DEBUG&&!jt(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log?window.console.log.__rrweb_original__:window.console.log),t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(t){Nt(n,(function(t){e(t)}))}}},error:function(){if(mt.DEBUG&&!jt(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),o="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{o.apply(window.console,r)}catch(e){Nt(r,(function(e){o(e)}))}}},critical:function(){if(!jt(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),o="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{o.apply(window.console,r)}catch(e){Nt(r,(function(e){o(e)}))}}}},Ft=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Rt(e,t,n){if(null!=e)if(Ot&&Array.isArray(e)&&e.forEach===Ot)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===Tt)return}else for(var i in e)if(wt.call(e,i)&&t.call(n,e[i],i)===Tt)return}function Nt(e,t,n){if(Array.isArray(e))if(Ot&&e.forEach===Ot)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===Tt)return}var Pt=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 Nt(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},At=Et||function(e){return"[object Array]"===bt.call(e)},Lt=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function Dt(e,t){return-1!==e.indexOf(t)}var $t=function(e){return e===Object(e)&&!At(e)},jt=function(e){return void 0===e},qt=function(e){return"[object String]"==bt.call(e)},Bt=function(e){return"[object Number]"==bt.call(e)},Ht=function e(t){return Rt(t,(function(n,r){!function(e){return"[object Date]"==bt.call(e)}(n)?$t(n)&&(t[r]=e(n)):t[r]=Ut(n)})),t},Ut=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Wt=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){Mt.critical("Implementation error. Please turn on debug and contact support@posthog.com."),mt.DEBUG&&Mt.critical(e)}}},Vt=function(e){var t={};return Rt(e,(function(e,n){qt(e)&&e.length>0&&(t[n]=e)})),t};var zt=["$performance_raw"];function Gt(e,t){return n=e,r=function(e,n){return n&&zt.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},o=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:o.has(t)?void 0:(o.add(t),At(t)?(i=[],Nt(t,(function(t){i.push(e(t))}))):(i={},Rt(t,(function(t,n){o.has(t)||(i[n]=e(t,n))}))),i);var i}(n);var n,r,o}function Qt(e){var t,n,r,o,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",l=[];if(!e)return e;e=Xt(e);do{t=(i=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=i>>12&63,r=i>>6&63,o=63&i,l[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(o)}while(s<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 Jt,Xt=function(e){var t,n,r,o,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,o=0;o<r;o++){var a=e.charCodeAt(o),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(n>t&&(i+=e.substring(t,n)),i+=s,t=n=o+1)}return n>t&&(i+=e.substring(t,e.length)),i},Zt=(Jt=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e="undefined"!=typeof window?(window.screen.height*window.screen.width).toString(16):"0";return Jt()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=It,r=0,o=[];function i(e,t){var n,r=0;for(n=0;n<t.length;n++)r|=o[n]<<8*n;return e^r}for(e=0;e<n.length;e++)t=n.charCodeAt(e),o.unshift(255&t),o.length>=4&&(r=i(r,o),o=[]);return o.length>0&&(r=i(r,o)),r.toString(16)}()+"-"+e+"-"+Jt()}),Yt=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php)/i.test(e)},Kt=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 o=r[1];try{o=decodeURIComponent(o)}catch(e){Mt.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},en=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},tn=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,o,i){if(t)if(t.addEventListener&&!o)t.addEventListener(n,r,!!i);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(o){if(o=o||e(window.event)){var i,a=!0;Lt(r)&&(i=r(o));var s=n.call(t,o);return!1!==i&&!1!==s||(a=!1),a}}}(t,r,s)}else Mt.error("No valid element provided to register_event")}}(),nn={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),t={};return Rt(e,(function(e){var n=Kt(Ct.URL,e);n.length&&(t[e]=n)})),t},searchEngine:function(e){return 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},searchInfo:function(e){var t=nn.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var o=Kt(e,n);o.length&&(r.ph_keyword=o)}return r},browser:function(e,t,n){return t=t||"",n||Dt(e," OPR/")?Dt(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Dt(e,"IEMobile")||Dt(e,"WPDesktop")?"Internet Explorer Mobile":Dt(e,"SamsungBrowser/")?"Samsung Internet":Dt(e,"Edge")||Dt(e,"Edg/")?"Microsoft Edge":Dt(e,"FBIOS")?"Facebook Mobile":Dt(e,"Chrome")?"Chrome":Dt(e,"CriOS")?"Chrome iOS":Dt(e,"UCWEB")||Dt(e,"UCBrowser")?"UC Browser":Dt(e,"FxiOS")?"Firefox iOS":Dt(t,"Apple")?Dt(e,"Mobile")?"Mobile Safari":"Safari":Dt(e,"Android")?"Android Mobile":Dt(e,"Konqueror")?"Konqueror":Dt(e,"Firefox")?"Firefox":Dt(e,"MSIE")||Dt(e,"Trident/")?"Internet Explorer":Dt(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+)?)/}[nn.browser(e,t,n)];if(void 0===r)return null;var o=e.match(r);return o?parseFloat(o[o.length-2]):null},browserLanguage:function(){return St.language||St.userLanguage},os:function(){var e=It;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},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"},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return Pt(Vt({$os:nn.os(),$browser:nn.browser(It,St.vendor,kt.opera),$device:nn.device(It),$device_type:nn.deviceType(It)}),{$current_url:null==kt?void 0:kt.location.href,$host:null==kt?void 0:kt.location.host,$pathname:null==kt?void 0:kt.location.pathname,$browser_version:nn.browserVersion(It,St.vendor,kt.opera),$browser_language:nn.browserLanguage(),$screen_height:null==kt?void 0:kt.screen.height,$screen_width:null==kt?void 0:kt.screen.width,$viewport_height:null==kt?void 0:kt.innerHeight,$viewport_width:null==kt?void 0:kt.innerWidth,$lib:"web",$lib_version:mt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:(Date.now=Date.now||function(){return+new Date},Date.now()/1e3)})},people_properties:function(){return Pt(Vt({$os:nn.os(),$browser:nn.browser(It,St.vendor,kt.opera)}),{$browser_version:nn.browserVersion(It,St.vendor,kt.opera)})}};function rn(e){switch(s(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function on(e){var t="";return dn(e)&&!pn(e)&&e.childNodes&&e.childNodes.length&&Rt(e.childNodes,(function(e){un(e)&&e.textContent&&(t+=Ft(e.textContent).split(/(\s+)/).filter(fn).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),Ft(t)}function an(e){return!!e&&1===e.nodeType}function sn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function un(e){return!!e&&3===e.nodeType}function cn(e){return!!e&&11===e.nodeType}var ln=["a","button","form","input","select","textarea","label"];function dn(e){for(var t=e;t.parentNode&&!sn(t,"body");t=t.parentNode){var n=rn(t).split(" ");if(Dt(n,"ph-sensitive")||Dt(n,"ph-no-capture"))return!1}if(Dt(rn(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";if("string"==typeof o){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function pn(e){return!!(sn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||sn(e,"select")||sn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function fn(e){if(null===e||jt(e))return!1;if("string"==typeof e){e=Ft(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 hn(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,o=document.querySelectorAll("body > script");o.length>0?null===(r=o[0].parentNode)||void 0===r||r.insertBefore(n,o[0]):document.body.appendChild(n)}var vn=function(){function e(t){u(this,e),this.clicks=[],this.enabled=t}return l(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}(),gn={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!an(t));return t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),o={tag_name:r};ln.indexOf(r)>-1&&!n&&(o.$el_text=on(e));var i=rn(e);i.length>0&&(o.classes=i.split(" ").filter((function(e){return""!==e}))),Rt(e.attributes,(function(n){var r;pn(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&fn(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(o["attr__"+n.name]=n.value)}));for(var a=1,s=1,u=e;u=this._previousElementSibling(u);)a++,u.tagName===e.tagName&&s++;return o.nth_child=a,o.nth_of_type=s,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return Rt(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),fn(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return Rt(this._customProperties,(function(r){Rt(r.event_selectors,(function(o){Rt(document.querySelectorAll(o),(function(o){Dt(e,o)&&dn(o)&&(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,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",i=this._getEventTarget(e);(un(i)&&(i=i.parentNode||null),"$autocapture"===o&&"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(i&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||sn(e,"html")||!an(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,o=n.url_allowlist;if(o&&!o.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var i=n.dom_event_allowlist;if(i&&!i.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var a=n.element_allowlist;if(a&&!a.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var s=n.css_selector_allowlist;if(s&&!s.some((function(t){return e.matches(t)})))return!1}for(var u=!1,c=[e],l=!0,d=e;d.parentNode&&!sn(d,"body");)if(cn(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(ln.indexOf(l.tagName.toLowerCase())>-1)u=!0;else{var p=window.getComputedStyle(l);p&&"pointer"===p.getPropertyValue("cursor")&&(u=!0)}c.push(l),d=l}var f=window.getComputedStyle(e);if(f&&"pointer"===f.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&&(ln.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.config)){for(var a=[i],s=i;s.parentNode&&!sn(s,"body");)cn(s.parentNode)?(a.push(s.parentNode.host),s=s.parentNode.host):(a.push(s.parentNode),s=s.parentNode);var u,c=[],l=!1;if(Rt(a,(function(e){var n=dn(e);"a"===e.tagName.toLowerCase()&&(u=e.getAttribute("href"),u=n&&fn(u)&&u),Dt(rn(e).split(" "),"ph-no-capture")&&(l=!0),c.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")))})),t.get_config("mask_all_text")||(c[0].$el_text=on(i)),u&&(c[0].attr__href=u),l)return!1;var d=Pt(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(a));return t.capture(o,d),!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)};tn(document,"submit",n,!1,!0),tn(document,"change",n,!1,!0),tn(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 vn(e.get_config("rageclick"))},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?Mt.log('autocapture already initialized for token "'+n+'"'):(this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&t.get_config("autocapture")?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=jt(t)?10:t,n=jt(n)?10:n;for(var r=0,o=0;o<e.length;o++)r+=e.charCodeAt(o);return r%t<n},isBrowserSupported:function(){return Lt(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(gn),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Wt(e[t]))}(gn);var mn=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,_n={is_supported:function(){return!0},error:function(e){Mt.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}}catch(e){}return null},parse:function(e){var t;try{t=JSON.parse(_n.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,o){try{var i="",a="",s="";if(r){var u=document.location.hostname.match(mn),c=u?u[0]:"";i=c?"; domain=."+c:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),a="; expires="+l.toUTCString()}o&&(s="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; path=/"+i+s;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{_n.set(e,"",-1,t)}catch(e){return}}},yn=null,bn={is_supported:function(){if(null!==yn)return yn;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";bn.set(t,"xyz"),'"xyz"'!==bn.get(t)&&(e=!1),bn.remove(t)}catch(t){e=!1}else e=!1;return e||Mt.error("localStorage unsupported; falling back to cookie store"),yn=e,e},error:function(e){Mt.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){bn.error(e)}return null},parse:function(e){try{return JSON.parse(bn.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){bn.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){bn.error(e)}}},wn=a(a({},bn),{},{parse:function(e){try{var t={};try{(t=_n.parse(e)||{}).distinct_id&&_n.set(e,{distinct_id:t.distinct_id})}catch(e){}var n=Pt(t,JSON.parse(bn.get(e)||"{}"));return bn.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,o){try{bn.set(e,t),t.distinct_id&&_n.set(e,{distinct_id:t.distinct_id},n,r,o)}catch(e){bn.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),_n.remove(e,t)}catch(e){bn.error(e)}}}),kn={},Sn={is_supported:function(){return!0},error:function(e){Mt.error("memoryStorage error: "+e)},get:function(e){return kn[e]||null},parse:function(e){return kn[e]||null},set:function(e,t){kn[e]=t},remove:function(e){delete kn[e]}},Cn=null,In={is_supported:function(){if(null!==Cn)return Cn;if(Cn=!0,"undefined"!=typeof window)try{var e="__support__";In.set(e,"xyz"),'"xyz"'!==In.get(e)&&(Cn=!1),In.remove(e)}catch(e){Cn=!1}else Cn=!1;return Cn},error:function(e){mt.DEBUG&&Mt.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){In.error(e)}return null},parse:function(e){try{return JSON.parse(In.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){In.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){In.error(e)}}},On="__ph_opt_in_out_";function xn(e,t){An(!0,e,t)}function En(e,t){An(!1,e,t)}function Tn(e,t){return"1"===Pn(e,t)}function Mn(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||kt,n=t.navigator||{},r=!1;return Rt([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){Dt([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Pn(e,t)}function Fn(e,t){Rn(t=t||{}).remove(Nn(e,t),!!t.crossSubdomainCookie)}function Rn(e){return"localStorage"===(e=e||{}).persistenceType?bn:"localStorage+cookie"===e.persistenceType?wn:_n}function Nn(e,t){return((t=t||{}).persistencePrefix||On)+e}function Pn(e,t){return Rn(t).get(Nn(e,t))}function An(e,t,n){qt(t)&&t.length?(Rn(n=n||{}).set(Nn(t,n),e?1:0,Bt(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function Ln(e,t){var n=!1;try{var r=e.get_config("token"),o=e.get_config("respect_dnt"),i=e.get_config("opt_out_capturing_persistence_type"),a=e.get_config("opt_out_capturing_cookie_prefix")||void 0,s=e.get_config("window");r&&(n=Mn(r,{respectDnt:o,persistenceType:i,persistencePrefix:a,window:s}))}catch(e){t||console.error("Unexpected error when checking capturing opt-out status: "+e)}return n}function Dn(e,t,n){return function(){for(var r=Ln(e,n),o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];if(!r)return t.apply(this,i);var s=i[i.length-1];"function"==typeof s&&s(0)}}var $n="$set",jn=function(){function e(t){var n=this;u(this,e),this._posthog=t,this.set=Dn(t,(function(e,t,r){var o=n.set_action(e,t);return $t(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.persistence.update_referrer_info(document.referrer),o[$n]=Pt({},nn.people_properties(),n._posthog.persistence.get_referrer_info(),o[$n]),n._send_request(o,r)})),this.set_once=Dn(t,(function(e,t,r){var o=n.set_once_action(e,t);return $t(e)&&(r=t),n._send_request(o,r)}))}return l(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),o=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),o&&(e.$had_persisted_distinct_id=o);var i=Ht(e),a=Gt(i,this._get_config("properties_string_max_length")),s=Qt(JSON.stringify(i));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:s},{},this._posthog._prepare_callback(t,a)),a}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser($n,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,o={},i={};return $t(t)?Rt(t,(function(e,t){r._is_reserved_property(t)||(i[t]=e)})):i[t]=n,o[e]=i,o}}]),e}(),qn="$active_feature_flags",Bn="$enabled_feature_flags",Hn="$override_feature_flags",Un="$feature_flag_payloads",Wn=function(){function e(t){u(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return l(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Bn),t=this.instance.get_property(Hn);if(!t)return e||{};for(var n=Pt({},e),r=Object.keys(t),o=0;o<r.length;o++)!1===t[r[o]]?delete n[r[o]]:n[r[o]]=t[r[o]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Un)||{}}},{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.get_config("token"),n=Qt(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=3",{data:n},{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.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var n=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}},{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]:{};return this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"receivedFeatureFlags",value:function(e){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),n=this.getFlagPayloads();!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,i=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var s,u={};if(o)for(var c=0;c<o.length;c++)u[o[c]]=!0;t&&t.register((d(s={},qn,o),d(s,Bn,u),s))}else{var l,p=o,f=i;e.errorsWhileComputingFlags&&(p=a(a({},n),p),f=a(a({},r),f)),t&&t.register((d(l={},qn,Object.keys(p||{})),d(l,Bn,p||{}),d(l,Un,f||{}),l))}else t&&(t.unregister(qn),t.unregister(Bn),t.unregister(Un))}(e,this.instance.persistence,t,n);var r=this._prepareFeatureFlagsForCallbacks(),o=r.flags,i=r.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(o,i)}))}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(Hn);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(d({},Hn,t))}else this.instance.persistence.register(d({},Hn,e))}},{key:"onFeatureFlags",value:function(e){if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var t=this._prepareFeatureFlagsForCallbacks();e(t.flags,t.flagVariants)}}},{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}),{})}}}]),e}(),Vn="$people_distinct_id",zn="__alias",Gn="__timers",Qn="$session_recording_enabled_server_side",Jn="$console_log_recording_enabled_server_side",Xn="$session_recording_recorder_version_server_side",Zn="$sesid",Yn="$enabled_feature_flags",Kn="$user_state",er=["__mps","__mpso","__mpus","__mpa","__mpap","__mpr","__mpu",Vn,zn,"__cmpns",Gn,Qn,Zn,Yn,Kn],tr=function(){function e(t){u(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,t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog";var r=t.persistence.toLowerCase();"cookie"!==r&&-1===r.indexOf("localstorage")&&"memory"!==r&&(Mt.critical("Unknown persistence type "+r+"; falling back to cookie"),r=t.persistence="cookie"),"localstorage"===r&&bn.is_supported()?this.storage=bn:"localstorage+cookie"===r&&wn.is_supported()?this.storage=wn:this.storage="memory"===r?Sn:_n,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return l(e,[{key:"properties",value:function(){var e={};return Rt(this.props,(function(t,n){if(n===Yn&&"object"===s(t))for(var r=Object.keys(t),o=0;o<r.length;o++)e["$feature/".concat(r[o])]=t[r[o]];else a=n,u=!1,(null===(i=er)?u:xt&&i.indexOf===xt?-1!=i.indexOf(a):(Rt(i,(function(e){if(u||(u=e===a))return Tt})),u))||(e[n]=t);var i,a,u})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Pt({},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($t(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var o=!1;if(Rt(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,o=!0)})),o)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if($t(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(Rt(e,(function(t,o){e.hasOwnProperty(o)&&n.props[o]!==t&&(n.props[o]=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(nn.campaignParams()),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(e){this.register(nn.searchInfo(e))}},{key:"update_referrer_info",value:function(e){this.register({$referrer:e||this.props.$referrer||"$direct",$referring_domain:nn.referringDomain(e)||this.props.$referring_domain||"$direct"})}},{key:"get_referrer_info",value:function(){return Vt({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Rt(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[Gn]||{};n[e]=t,this.props[Gn]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Gn]||{})[e];return jt(t)||(delete this.props[Gn][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Kn]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Kn]=e,this.save()}}]),e}(),nr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",rr=2,or=4,ir=6;var ar="rrweb/console@1";var sr="/e/",ur=function(){function e(t){u(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=sr,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return l(e,[{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(Qn),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(Jn),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(Xn);return(null===(e=this.instance.get_config("session_recording"))||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,o,i,a;(this.receivedDecide=!0,this.instance.persistence)&&this.instance.persistence.register((d(i={},Qn,!!e.sessionRecording),d(i,Jn,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),d(i,Xn,null===(o=e.sessionRecording)||void 0===o?void 0:o.recorderVersion),i));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:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshot(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){if(void 0!==Object.assign&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){var e="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.captureStarted=!0,this.instance.__loaded_recorder_version!==this.getRecordingVersion()&&hn(this.instance.get_config("api_host")+"/static/".concat(e,"?v=").concat(mt.LIB_VERSION),this._onScriptLoaded.bind(this)),this._onScriptLoaded()}}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n,r=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),o=this.instance.sessionManager.checkAndGetSessionAndWindowId(r,e.timestamp),i=o.windowId,a=o.sessionId;this.windowId===i&&this.sessionId===a||-1!==[rr,or].indexOf(e.type)||(null===(n=this.rrwebRecord)||void 0===n||n.takeFullSnapshot());this.windowId=i,this.sessionId=a}},{key:"_onScriptLoaded",value:function(){var e,t=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var r=this.instance.get_config("session_recording"),o=0,i=Object.entries(r||{});o<i.length;o++){var u=_(i[o],2),c=u[0],l=u[1];c in n&&(n[c]=l)}this.stopRrweb=null===(e=this.rrwebRecord)||void 0===e?void 0:e.call(this,a({emit:function(e){e=function(e){if(e&&"object"===s(e)&&e.type===ir&&"object"===s(e.data)&&e.data.plugin===ar){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===s(e)){var t=JSON.stringify(e);if(t.length>5e6){var n,r=k(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(r.s();!(n=r.n()).done;){var o=n.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],nr):t.replace(o[0],"")}}catch(e){r.e(e)}finally{r.f()}}return JSON.parse(t)}return e}(e)),t._updateWindowAndSessionIds(e);var n={$snapshot_data:e,$session_id:t.sessionId,$window_id:t.windowId};t.instance._captureMetrics.incr("rrweb-record"),t.instance._captureMetrics.incr("rrweb-record-".concat(e.type)),t.emit?t._captureSnapshot(n):t.snapshots.push(n)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},n)),this.instance._addCaptureHook((function(e){var n;"$pageview"===e&&(null===(n=t.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href}))}))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===rr}})}}]),e}(),cr={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},lr=["first-input","navigation","paint","resource"],dr=["/s/","/e/"],pr=function(){function e(t){u(this,e),this.instance=t}return l(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e=this;if(!this.observer)try{this.observer=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e._capturePerformanceEvent(t)}))}));var t=PerformanceObserver.supportedEntryTypes.filter((function(e){return lr.includes(e)}));t.forEach((function(t){var n;null===(n=e.observer)||void 0===n||n.observe({type:t,buffered:!0})}))}catch(e){console.error("PostHog failed to start performance observer",e),this.stopObserving()}}},{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.get_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(e.name.startsWith(this.instance.get_config("api_host"))){var t=e.name.replace(this.instance.get_config("api_host"),"");if(dr.find((function(e){return t.startsWith(e)})))return}var n=e.toJSON(),r={},o=Math.floor(Date.now()-performance.now());for(var i in r[cr.timeOrigin]=o,r[cr.timestamp]=Math.floor(o+e.startTime),cr)void 0!==n[i]&&(r[cr[i]]=n[i]);if(this.capturePerformanceEvent(r),fr(e)){var a,s=k(e.serverTiming);try{for(s.s();!(a=s.n()).done;){var u,c=a.value;this.capturePerformanceEvent((d(u={},cr.timeOrigin,o),d(u,cr.timestamp,Math.floor(o+e.startTime)),d(u,cr.name,c.name),d(u,cr.duration,c.duration),d(u,cr.entryType,"serverTiming"),u))}}catch(e){s.e(e)}finally{s.f()}}}},{key:"capturePerformanceEvent",value:function(e){this.instance.capture("$performance_event",e,{transport:"XHR",method:"POST",endpoint:"/e/",_noTruncate:!0,_batchKey:"performanceEvent"})}}]),e}(),fr=function(e){return"navigation"===e.entryType||"resource"===e.entryType},hr=function(){function e(t){u(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return l(e,[{key:"call",value:function(){var e=this,t=Qt(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}));this.instance._send_request("".concat(this.instance.get_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=this;if(0!==(null==e?void 0:e.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){r.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),gn.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.get_config("disable_compression")){var o,i={},a=k(e.supportedCompression);try{for(a.s();!(o=a.n()).done;){i[o.value]=!0}}catch(e){a.e(e)}finally{a.f()}this.instance.compression=i}if(e.siteApps)if(this.instance.get_config("opt_in_site_apps")){var s,u=this.instance.get_config("api_host"),c=k(e.siteApps);try{var l=function(){var e=s.value,t=e.id,n=e.url,o=document.createElement("script");o.src=[u,"/"===u[u.length-1]&&"/"===n[0]?n.substring(1):n].join(""),o.onerror=function(e){console.error("Error while initializing PostHog app with config id ".concat(t),e)},window["__$$ph_site_app_".concat(t)]=r.instance,document.body.appendChild(o)};for(c.s();!(s=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}}else e.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),vr=["https://app.posthog.com","https://eu.posthog.com"],gr=["source"],mr=function(){function e(t){u(this,e),this.instance=t}return l(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(a(a({},t),{},{apiURL:this.instance.get_config("api_host")}))}},{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,o=en(e.hash,"__posthog")||en(e.hash,"state"),i=o?JSON.parse(decodeURIComponent(o)):null;return i&&"ph_authorize"===i.action?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?e.hash=i.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var n=(null==e?void 0:e.apiURL)||this.instance.get_config("api_host"),r=3e4*Math.floor(Date.now()/3e4),o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(r),i=!vr.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),s=a(a({apiURL:n,jsURL:n,token:this.instance.get_config("token")},e),i?{instrument:!1}:{});s.source;var u=v(s,gr);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),hn(o,(function(){(window.ph_load_toolbar||window.ph_load_editor)(s,t.instance)})),tn(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,t.loadToolbar(s)})),!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}(),_r=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;u(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return l(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}(),yr=function(e){p(n,e);var t=m(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return u(this,n),(o=t.call(this,i)).handlePollRequest=r,o.captureMetrics=e,o}return l(n,[{key:"enqueue",value:function(e,t,n){this.captureMetrics.incr("batch-enqueue"),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],o=r.url,i=r.data,a=r.options;Rt(i,(function(t,n){i[n].offset=Math.abs(i[n].timestamp-e.getTime()),delete i[n].timestamp})),e.handlePollRequest(o,i,a),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(o.slice(o.length-2))),e.captureMetrics.incr("batch-handle",i.length),e.captureMetrics.incr("batch-handle-".concat(o.slice(o.length-2)),i.length)};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:"updateUnloadMetrics",value:function(){var e=this.formatQueue();for(var t in e){var n=e[t],r=n.url,o=n.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(r.slice(r.length-2))),this.captureMetrics.incr("batch-unload",o.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),o.length)}}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var n=Object.values(t);[].concat(y(n.filter((function(e){return 0===e.url.indexOf("/e")}))),y(n.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var n=t.url,r=t.data,o=t.options;e.handlePollRequest(n,r,a(a({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return Rt(this._event_queue,(function(t){var n=t.url,r=t.data,o=t.options,i=(o?o._batchKey:null)||n;void 0===e[i]&&(e[i]={data:[],url:n,options:o}),o&&e[i].options&&e[i].options._metrics&&!e[i].options._metrics.rrweb_full_snapshot&&(e[i].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),e[i].data.push(r)})),e}}]),n}(_r),br=function(){function e(t){u(this,e),this.enabled=t,this.metrics={}}return l(e,[{key:"incr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)+t)}},{key:"decr",value:function(e){this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)-1)}}]),e}(),wr=Uint8Array,kr=Uint16Array,Sr=Uint32Array,Cr=new wr([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]),Ir=new wr([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]),Or=new wr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xr=function(e,t){for(var n=new kr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var o=new Sr(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return[n,o]},Er=xr(Cr,2),Tr=Er[0],Mr=Er[1];Tr[28]=258,Mr[258]=28;for(var Fr=xr(Ir,0)[1],Rr=new kr(32768),Nr=0;Nr<32768;++Nr){var Pr=(43690&Nr)>>>1|(21845&Nr)<<1;Pr=(61680&(Pr=(52428&Pr)>>>2|(13107&Pr)<<2))>>>4|(3855&Pr)<<4,Rr[Nr]=((65280&Pr)>>>8|(255&Pr)<<8)>>>1}var Ar=function(e,t,n){for(var r=e.length,o=0,i=new kr(t);o<r;++o)++i[e[o]-1];var a,s=new kr(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(n){a=new kr(1<<t);var u=15-t;for(o=0;o<r;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],d=s[e[o]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)a[Rr[d]>>>u]=c}else for(a=new kr(r),o=0;o<r;++o)a[o]=Rr[s[e[o]-1]++]>>>15-e[o];return a},Lr=new wr(288);for(Nr=0;Nr<144;++Nr)Lr[Nr]=8;for(Nr=144;Nr<256;++Nr)Lr[Nr]=9;for(Nr=256;Nr<280;++Nr)Lr[Nr]=7;for(Nr=280;Nr<288;++Nr)Lr[Nr]=8;var Dr=new wr(32);for(Nr=0;Nr<32;++Nr)Dr[Nr]=5;var $r,jr=Ar(Lr,9,0),qr=Ar(Dr,5,0),Br=function(e){return(e/8>>0)+(7&e&&1)},Hr=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof kr?kr:e instanceof Sr?Sr:wr)(n-t);return r.set(e.subarray(t,n)),r},Ur=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Wr=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},Vr=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var o=n.length,i=n.slice();if(!o)return[new wr(0),0];if(1==o){var a=new wr(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],c=0,l=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=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:s.f+u.f,l:s,r:u};var p=i[0].s;for(r=1;r<o;++r)i[r].s>p&&(p=i[r].s);var f=new kr(p+1),h=zr(n[l-1],f,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;for(i.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<o;++r){var _=i[r].s;if(!(f[_]>t))break;v+=m-(1<<h-f[_]),f[_]=t}for(v>>>=g;v>0;){var y=i[r].s;f[y]<t?v-=1<<t-f[y]++-1:++r}for(;r>=0&&v;--r){var b=i[r].s;f[b]==t&&(--f[b],++v)}h=t}return[new wr(f),h]},zr=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},Gr=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new kr(++t),r=0,o=e[0],i=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[n.subarray(0,r),t]},Qr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Jr=function(e,t,n){var r=n.length,o=Br(t+2);e[o]=255&r,e[o+1]=r>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;i<r;++i)e[o+i+4]=n[i];return 8*(o+4+r)},Xr=function(e,t,n,r,o,i,a,s,u,c,l){Ur(t,l++,n),++o[256];for(var d=Vr(o,15),p=d[0],f=d[1],h=Vr(i,15),v=h[0],g=h[1],m=Gr(p),_=m[0],y=m[1],b=Gr(v),w=b[0],k=b[1],S=new kr(19),C=0;C<_.length;++C)S[31&_[C]]++;for(C=0;C<w.length;++C)S[31&w[C]]++;for(var I=Vr(S,7),O=I[0],x=I[1],E=19;E>4&&!O[Or[E-1]];--E);var T,M,F,R,N=c+5<<3,P=Qr(o,Lr)+Qr(i,Dr)+a,A=Qr(o,p)+Qr(i,v)+a+14+3*E+Qr(S,O)+(2*S[16]+3*S[17]+7*S[18]);if(N<=P&&N<=A)return Jr(t,l,e.subarray(u,u+c));if(Ur(t,l,1+(A<P)),l+=2,A<P){T=Ar(p,f,0),M=p,F=Ar(v,g,0),R=v;var L=Ar(O,x,0);Ur(t,l,y-257),Ur(t,l+5,k-1),Ur(t,l+10,E-4),l+=14;for(C=0;C<E;++C)Ur(t,l+3*C,O[Or[C]]);l+=3*E;for(var D=[_,w],$=0;$<2;++$){var j=D[$];for(C=0;C<j.length;++C){var q=31&j[C];Ur(t,l,L[q]),l+=O[q],q>15&&(Ur(t,l,j[C]>>>5&127),l+=j[C]>>>12)}}}else T=jr,M=Lr,F=qr,R=Dr;for(C=0;C<s;++C)if(r[C]>255){q=r[C]>>>18&31;Wr(t,l,T[q+257]),l+=M[q+257],q>7&&(Ur(t,l,r[C]>>>23&31),l+=Cr[q]);var B=31&r[C];Wr(t,l,F[B]),l+=R[B],B>3&&(Wr(t,l,r[C]>>>5&8191),l+=Ir[B])}else Wr(t,l,T[r[C]]),l+=M[r[C]];return Wr(t,l,T[256]),l+M[256]},Zr=new Sr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yr=new wr(0),Kr=function(){for(var e=new Sr(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),eo=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Kr[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},to=function(e,t,n,r,o){return function(e,t,n,r,o,i){var a=e.length,s=new wr(r+a+5*(1+Math.floor(a/7e3))+o),u=s.subarray(r,s.length-o),c=0;if(!t||a<8)for(var l=0;l<=a;l+=65535){var d=l+65535;d<a?c=Jr(u,c,e.subarray(l,d)):(u[l]=i,c=Jr(u,c,e.subarray(l,a)))}else{for(var p=Zr[t-1],f=p>>>13,h=8191&p,v=(1<<n)-1,g=new kr(32768),m=new kr(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},w=new Sr(25e3),k=new kr(288),S=new kr(32),C=0,I=0,O=(l=0,0),x=0,E=0;l<a;++l){var T=b(l),M=32767&l,F=m[T];if(g[M]=F,m[T]=M,x<=l){var R=a-l;if((C>7e3||O>24576)&&R>423){c=Xr(e,u,0,w,k,S,I,O,E,l-E,c),O=C=I=0,E=l;for(var N=0;N<286;++N)k[N]=0;for(N=0;N<30;++N)S[N]=0}var P=2,A=0,L=h,D=M-F&32767;if(R>2&&T==b(l-D))for(var $=Math.min(f,R)-1,j=Math.min(32767,l),q=Math.min(258,R);D<=j&&--L&&M!=F;){if(e[l+P]==e[l+P-D]){for(var B=0;B<q&&e[l+B]==e[l+B-D];++B);if(B>P){if(P=B,A=D,B>$)break;var H=Math.min(D,B-2),U=0;for(N=0;N<H;++N){var W=l-D+N+32768&32767,V=W-g[W]+32768&32767;V>U&&(U=V,F=W)}}}D+=(M=F)-(F=g[M])+32768&32767}if(A){w[O++]=268435456|Mr[P]<<18|Fr[A];var z=31&Mr[P],G=31&Fr[A];I+=Cr[z]+Ir[G],++k[257+z],++S[G],x=l+P,++C}else w[O++]=e[l],++k[e[l]]}}c=Xr(e,u,i,w,k,S,I,O,E,l-E,c),i||(c=Jr(u,c,Yr))}return Hr(s,0,r+Br(c)+o)}(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,!o)},no=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},ro=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&&no(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)}},oo=function(e){return 10+(e.filename&&e.filename.length+1||0)};function io(e,t){void 0===t&&(t={});var n=eo(),r=e.length;n.p(e);var o=to(e,t,oo(t),8),i=o.length;return ro(o,t),no(o,i-8,n.d()),no(o,i-4,r),o}function ao(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new wr(e.length+(e.length>>>1)),o=0,i=function(e){r[o++]=e},a=0;a<n;++a){if(o+5>r.length){var s=new wr(o+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?i(u):u<2048?(i(192|u>>>6),i(128|63&u)):u>55295&&u<57344?(i(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),i(128|u>>>12&63),i(128|u>>>6&63),i(128|63&u)):(i(224|u>>>12),i(128|u>>>6&63),i(128|63&u))}return Hr(r,0,o)}!function(e){e.GZipJS="gzip-js",e.LZ64="lz64",e.Base64="base64"}($r||($r={}));var so,uo,co,lo=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=mt.LIB_VERSION;var o=e.split("?");if(o.length>1){var i,a=k(o[1].split("&"));try{for(a.s();!(i=a.n()).done;){var s=i.value.split("=")[0];r[s]&&delete r[s]}}catch(e){a.e(e)}finally{a.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return Rt(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t})),o.join(r)}(r)},po=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 o,i;return o=Array.isArray(t)||(i=t,"[object Uint8Array]"===Object.prototype.toString.call(i))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(o+="&compression="+t.compression),o},fo=function(e){var t=e.url,n=e.data,r=e.headers,o=e.options,i=e.captureMetrics,a=e.callback,s=e.retriesPerformedSoFar,u=e.retryQueue,c=e.onXHRError,l=e.timeout,d=void 0===l?1e4:l,p=new XMLHttpRequest;p.open(o.method||"GET",t,!0);var f=po(n,o);i.incr("_send_request"),i.incr("_send_request_inflight"),Rt(r,(function(e,t){p.setRequestHeader(t,e)})),"POST"!==o.method||o.blob||p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),p.timeout=d,p.withCredentials=!0,p.onreadystatechange=function(){if(4===p.readyState)if(i.incr("xhr-response"),i.incr("xhr-response-".concat(p.status)),i.decr("_send_request_inflight"),200===p.status){if(a){var e;try{e=JSON.parse(p.responseText)}catch(e){return void Mt.error(e)}a(e)}}else"function"==typeof c&&c(p),[401,403,404,500].indexOf(p.status)<0&&u.enqueue({url:t,data:n,options:o,headers:r,retriesPerformedSoFar:(s||0)+1,callback:a}),a&&a({status:0})},p.send(f)},ho=function(e){p(n,e);var t=m(n);function n(e,r){var o;return u(this,n),(o=t.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=r,"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 l(n,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=3e3*Math.pow(2,t),r=new Date(Date.now()+n);console.warn("Enqueued failed request for retry in ".concat(n)),this.queue.push({retryAt:r,requestData:e}),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=k(t);try{for(r.s();!(n=r.n()).done;){var o=n.value.requestData;this._executeXhrRequest(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=k(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,r=n.url,o=n.data,i=n.options;try{window.navigator.sendBeacon(r,po(o,a(a({},i),{},{sendBeacon:!0})))}catch(e){mt.DEBUG&&console.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,o=e.headers,i=e.callback,a=e.retriesPerformedSoFar;fo({url:t,data:n||{},options:r||{},headers:o||{},retriesPerformedSoFar:a||0,callback:i,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(_r),vo=18e5,go=864e5,mo=function(){function e(t,n){u(this,e),this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var r=t.persistence_name||t.token;if(this.window_id_storage_key="ph_"+r+"_window_id",this.primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",!this.persistence.disabled&&In.is_supported()){var o=In.parse(this.window_id_storage_key),i=In.parse(this.primary_window_exists_storage_key);o&&!i?this._windowId=o:In.remove(this.window_id_storage_key),In.set(this.primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return l(e,[{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,!this.persistence.disabled&&In.is_supported()&&In.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&In.is_supported()?In.parse(this.window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(d({},Zn,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Zn];return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",(function(){!e.persistence.disabled&&In.is_supported()&&In.remove(e.primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=_(this._getSessionId(),3),r=n[0],o=n[1],i=n[2],a=this._getWindowId(),s=i&&i>0&&Math.abs(t-i)>go;!o||!e&&Math.abs(t-r)>vo||s?(o=Zt(),a=Zt(),i=t):a||(a=Zt());var u=0===r||!e||s?t:r,c=0===i?(new Date).getTime():i;return this._setWindowId(a),this._setSessionId(o,u,c),{sessionId:o,windowId:a}}}]),e}(),_o=l((function e(t,n,r,o){u(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var i,a,s;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var u=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=u+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=u+"/recordings/"+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var c=(null===(i=e.exception)||void 0===i?void 0:i.values)||[],l={$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(a=c[0])||void 0===a?void 0:a.value,$sentry_exception_type:null===(s=c[0])||void 0===s?void 0:s.type,$sentry_tags:e.tags};return n&&r&&(l.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",l),e}))}})),yo=function(e){var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}},bo=function(){function e(){u(this,e),d(this,"_seenFirstPageView",!1)}return l(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=Zt()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=Zt()),this._pageViewId}}]),e}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(so||(so={}));var wo=function(){},ko={},So="posthog",Co=kt.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Io=!Co&&-1===It.indexOf("MSIE")&&-1===It.indexOf("Mozilla"),Oo=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:-1===(null==Ct||null===(e=Ct.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:wo,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,capture_pageleave:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==kt||null===(n=kt.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;console.error(t)},get_device_id:function(e){return e},_onCapture:wo,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},xo=function(e,t,n){var r,o=n!==So&&co?n?co[n]:void 0:co;if(o&&uo===so.INIT_MODULE)r=o;else{if(o&&!At(o))return void console.error("You have already initialized "+n);r=new Eo}if(r._init(e,t,n),r.toolbar.maybeLoadToolbar(),r.sessionRecording=new ur(r),r.sessionRecording.startRecordingIfEnabled(),r.webPerformance=new pr(r),r.webPerformance.startObservingIfEnabled(),r.__autocapture=r.get_config("autocapture"),r.get_config("autocapture")){r.__autocapture=r.get_config("autocapture");gn.enabledForProject(r.get_config("token"),100,100)?gn.isBrowserSupported()?gn.init(r):(r.__autocapture=!1,Mt.log("Disabling Automatic Event Collection because this browser is not supported")):(r.__autocapture=!1,Mt.log("Not in active bucket: disabling Automatic Event Collection."))}return mt.DEBUG=mt.DEBUG||r.get_config("debug"),void 0!==o&&At(o)&&(r._execute_array.call(r.people,o.people),r._execute_array(o)),r},Eo=function(){function e(){var t=this;u(this,e),this.config=Oo(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=_o,this.segmentIntegration=function(){return yo(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.people=new jn(this),this.featureFlags=new Wn(this),this.feature_flags=this.featureFlags,this.toolbar=new mr(this),this.pageViewIdManager=new bo,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return l(e,[{key:"init",value:function(e,t,n){if(jt(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==So){var r=xo(e,t,n);return co[n]=r,r._loaded(),r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Pt({},Oo(),o,{name:i,token:e,callback_fn:(i===So?i:So+"."+i)+"._jsc"})),this._jsc=function(){},null!=kt&&null!==(t=kt.rrweb)&&void 0!==t&&t.record||null!=kt&&kt.rrwebRecord)&&(this.__loaded_recorder_version=null==kt||null===(r=kt.rrweb)||void 0===r?void 0:r.version);if(this._captureMetrics=new br(this.get_config("_capture_metrics")),this._requestQueue=new yr(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new ho(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new tr(this.config),this.sessionManager=new mo(this.config,this.persistence),this._gdpr_init(),o.segment&&(this.config.get_device_id=function(){return o.segment.user().anonymousId()},o.segment.user().id()&&(this.register({distinct_id:o.segment.user().id()}),this.persistence.set_user_state("identified")),o.segment.register(this.segmentIntegration())),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var a,s,u=this.get_config("get_device_id")(Zt()),c=null!==(a=o.bootstrap)&&void 0!==a&&a.isIdentifiedID?u:o.bootstrap.distinctID;this.persistence.set_user_state(null!==(s=o.bootstrap)&&void 0!==s&&s.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:c})}if(this._hasBootstrappedFeatureFlags()){var l,d,p=Object.keys((null===(l=o.bootstrap)||void 0===l?void 0:l.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),f=Object.keys((null===(d=o.bootstrap)||void 0===d?void 0:d.featureFlagPayloads)||{}).filter((function(e){return p[e]})).reduce((function(e,t){var n,r,i,a;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:f})}if(!this.get_distinct_id()){var h=this.get_config("get_device_id")(Zt());this.register_once({distinct_id:h,$device_id:h},""),this.persistence.set_user_state("anonymous")}kt.addEventListener&&kt.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this))}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new hr(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Nt(this.__request_queue,(function(t){e._send_request.apply(e,y(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(jt(e))return null;if(Co)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(o){delete n[r],e(o,t)},o}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||ko,wo)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var o,i=function(e,t,n){return e===$r.LZ64?[{data:gt.compressToBase64(t),compression:$r.LZ64},n]:e===$r.GZipJS?[io(ao(t),{mtime:0}),a(a({},n),{},{blob:!0,urlQueryArgs:{compression:$r.GZipJS}})]:[{data:Qt(t)},n]}((o=this.compression)[$r.GZipJS]?$r.GZipJS:o[$r.LZ64]?$r.LZ64:$r.Base64,t,n),s=_(i,2),u=s[0],c=s[1];this._send_request(e,u,c,r)}},{key:"_send_request",value:function(e,t,n,r){if(Io)this.__request_queue.push([e,t,n,r]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};n=Pt(o,n||{}),Co||(n.method="GET");var i="sendBeacon"in kt.navigator&&"sendBeacon"===n.transport;if(e=lo(e,n.urlQueryArgs||{},{ip:this.get_config("ip")}),$t(t)&&this.get_config("img")){var s=Ct.createElement("img");s.src=e,Ct.body.appendChild(s)}else if(i)try{kt.navigator.sendBeacon(e,po(t,a(a({},n),{},{sendBeacon:!0})))}catch(e){this.get_config("debug")&&console.error(e)}else if(Co)try{fo({url:e,data:t,headers:this.get_config("xhr_headers"),options:n,captureMetrics:this._captureMetrics,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(e){console.error(e)}else{var u,c=Ct.createElement("script");c.type="text/javascript",c.async=!0,c.defer=!0,c.src=e;var l=Ct.getElementsByTagName("script")[0];null===(u=l.parentNode)||void 0===u||u.insertBefore(c,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],o=[],i=[];Nt(e,(function(e){e&&(t=e[0],At(t)?i.push(e):"function"==typeof e?e.call(n):At(e)&&"alias"===t?r.push(e):At(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?i.push(e):o.push(e))}));var a=function(e,t){Nt(e,(function(e){if(At(e[0])){var n=t;Rt(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(o,this),a(i,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ko;if(this.__loaded&&!Ln(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||ko).transport;if(r&&(n.transport=r),jt(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!Yt(It)){this.persistence.update_search_keyword(Ct.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(Ct.referrer);var o={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(o.$set=n.$set),(o=Gt(o,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&Mt.log("PostHog.js send",o);var i=JSON.stringify(o),a=this.get_config("api_host")+(n.endpoint||"/e/"),s=n!==ko;return!this.get_config("request_batching")||s&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(a,i,n):this._requestQueue.enqueue(a,o,n),this._invokeCaptureHooks(e,o),o}}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),Rt(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){var n,r=this.persistence.remove_event_timer(e),o=a({},t);if(o.token=this.get_config("token"),"$snapshot"===e){var i=this.persistence.properties();return o.distinct_id=i.distinct_id,o}var s=nn.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),c=u.sessionId,l=u.windowId;o.$session_id=c,o.$window_id=l}if(null!==(n=this.webPerformance)&&void 0!==n&&n.isEnabled&&("$pageview"===e&&this.pageViewIdManager.onPageview(),o=Pt(o,{$pageview_id:this.pageViewIdManager.getPageViewId()})),"$performance_event"===e){var d=this.persistence.properties();return o.distinct_id=d.distinct_id,o.$current_url=s.$current_url,o}if(void 0!==r){var p=(new Date).getTime()-r;o.$duration=parseFloat((p/1e3).toFixed(3))}o=Pt({},s,this.persistence.properties(),o);var f=this.get_config("property_blacklist");At(f)?Rt(f,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+f);var h=this.get_config("sanitize_properties");return h&&(o=h(o,e)),o}},{key:"register",value:function(e,t){this.persistence.register(e,t)}},{key:"register_once",value:function(e,t,n){this.persistence.register_once(e,t,n)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(d({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"identify",value:function(e,t,n){if(e){this._captureMetrics.incr("identify");var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==r&&e!==this.get_property(zn)&&(this.unregister(zn),this.register({distinct_id:e}));var i="anonymous"===this.persistence.get_user_state();e!==r&&i?(this.persistence.set_user_state("identified"),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t&&this.people.set(t),n&&this.people.set_once(n)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,t,n){if(e&&t){this._captureMetrics.incr("group");var r=this.getGroups();this.register({$groups:a(a({},r),{},d({},e,t))}),n&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),r[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.reloadFeatureFlags()}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(Zt());this.register_once({distinct_id:n,$device_id:e?n:t},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"alias",value:function(e,t){return e===this.get_property(Vn)?(Mt.critical("Attempting to create alias for existing People user - aborting."),-2):(jt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(zn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t=a({},this.config);$t(e)&&(Pt(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),bn.is_supported()&&"true"===bn.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(mt.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&t.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started())}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_config",value:function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]}},{key:"get_property",value:function(e){return this.persistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:So;return t!==So&&(t=So+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&bn.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!_n.get("ph_optout")||(_n.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=Pt({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),bn.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=Pt({enable_persistence:!0},e||{}),this._gdpr_call_func(xn,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=Pt({clear_persistence:!0},e||{});this._gdpr_call_func(En,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Tn,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Mn,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=Pt({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Fn,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(kt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(kt.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"decodeLZ64",value:function(e){return gt.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Wt(e.prototype[t[n]])}(Eo,["identify"]);var To={},Mo=function(){co.init=function(e,t,n){if(n)return co[n]||(co[n]=To[n]=xo(e||"",t||{},n),co[n]._loaded()),co[n];var r=co;return To[So]?r=To[So]:e&&((r=xo(e,t||{},So))._loaded(),To[So]=r),co=r,uo===so.INIT_SNIPPET&&(kt[So]=co),Rt(To,(function(e,t){t!==So&&(co[t]=e)})),r}},Fo=function(){function e(){e.done||(e.done=!0,Io=!1,Rt(To,(function(e){e._dom_loaded()})))}Ct.addEventListener&&("complete"===Ct.readyState?e():Ct.addEventListener("DOMContentLoaded",e,!1)),tn(kt,"load",e,!0)};uo=so.INIT_SNIPPET,jt(kt.posthog)&&(kt.posthog=[]),(co=kt.posthog).__loaded||co.config&&co.persistence?console.error("PostHog library has already been downloaded at least once."):(Rt(co._i,(function(e){e&&At(e)&&(To[e[2]]=xo.apply(void 0,y(e)))})),Mo(),co.init(),Rt(To,(function(e){e._loaded()})),Fo())}();
|
|
16
16
|
//# sourceMappingURL=array.full.js.map
|