posthog-js 1.115.2 → 1.116.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/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 -1
- package/dist/es.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/extensions/replay/config.js +2 -5
- package/lib/src/extensions/replay/config.js.map +1 -1
- package/package.json +1 -1
package/dist/array.full.js
CHANGED
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),yt=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new fe,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},i=[],o=g(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=void 0;if(this.styleMirror.has(a))s=this.styleMirror.getId(a);else{s=this.styleMirror.add(a);var u=Array.from(a.rules||CSSRule);i.push({styleId:s,rules:u.map((function(e,t){return{rule:b(e),index:t}}))})}r.styleIds.push(s)}}catch(e){o.e(e)}finally{o.f()}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),_t=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function bt(e){return Object.assign(Object.assign({},e),{timestamp:te()})}var It=!1,wt=new I;function kt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,a=e.blockSelector,s=void 0===a?null:a,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.ignoreSelector,d=void 0===l?null:l,f=e.maskTextClass,p=void 0===f?"rr-mask":f,h=e.maskTextSelector,v=void 0===h?null:h,m=e.inlineStylesheet,y=void 0===m||m,_=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,C=e.maskTextFn,S=e.hooks,A=e.packFn,R=e.sampling,F=void 0===R?{}:R,E=e.dataURLOptions,T=void 0===E?{}:E,x=e.mousemoveWait,M=e.recordCanvas,O=void 0!==M&&M,N=e.recordCrossOriginIframes,L=void 0!==N&&N,D=e.recordAfter,P=void 0===D?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":D,B=e.userTriggeredOnInput,q=void 0!==B&&B,W=e.collectFonts,V=void 0!==W&&W,H=e.inlineImages,G=void 0!==H&&H,U=e.plugins,j=e.keepIframeSrcFn,$=void 0===j?function(){return!1}:j,Z=e.ignoreCSSAttributes,Y=void 0===Z?new Set([]):Z;xe(e.errorHandler);var J=!L||window.parent===window,Q=!1;if(!J)try{window.parent.document&&(Q=!1)}catch(e){Q=!0}if(J&&!t)throw new Error("emit function is required");void 0!==x&&void 0===F.mousemove&&(F.mousemove=x),wt.reset();var X,ee=!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}:void 0!==b?b:{password:!0},te=!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(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===i)return!0}while(i=i&&i.parentNode);return!1})}();var oe=0,ae=function(e){var t,n=g(U||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return A&&!Q&&(e=A(e)),e};pt=function(e,i){var o;if(!(null===(o=Ne[0])||void 0===o?void 0:o.isFrozen())||e.type===ve.FullSnapshot||e.type===ve.IncrementalSnapshot&&e.data.source===me.Mutation||Ne.forEach((function(e){return e.unfreeze()})),J)null==t||t(ae(e),i);else if(Q){var a={type:"rrweb",event:ae(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(e.type===ve.FullSnapshot)X=e,oe=0;else if(e.type===ve.IncrementalSnapshot){if(e.data.source===me.Mutation&&e.data.isAttachIframe)return;oe++;var s=r&&oe>=r,u=n&&e.timestamp-X.timestamp>n;(s||u)&&ht(!0)}};var se,ue=function(e){pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Mutation},e)}))},fe=function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Scroll},e)}))},pe=function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.CanvasMutation},e)}))},he=new yt({mutationCb:ue,adoptedStyleSheetCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.AdoptedStyleSheet},e)}))}}),ge=new ze({mirror:wt,mutationCb:ue,stylesheetManager:he,recordCrossOriginIframes:L,wrappedEmit:pt}),ye=g(U||[]);try{for(ye.s();!(se=ye.n()).done;){var _e=se.value;_e.getMirror&&_e.getMirror({nodeMirror:wt,crossOriginIframeMirror:ge.crossOriginIframeMirror,crossOriginIframeStyleMirror:ge.crossOriginIframeStyleMirror})}}catch(e){ye.e(e)}finally{ye.f()}var be=new _t;gt=new mt({recordCanvas:O,mutationCb:pe,win:window,blockClass:o,blockSelector:s,mirror:wt,sampling:F.canvas,dataURLOptions:T});var Ie=new Ye({mutationCb:ue,scrollCb:fe,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:v,inlineStylesheet:y,maskInputOptions:ee,dataURLOptions:T,maskTextFn:C,maskInputFn:k,recordCanvas:O,inlineImages:G,sampling:F,slimDOMOptions:te,iframeManager:ge,stylesheetManager:he,canvasManager:gt,keepIframeSrcFn:$,processedNodeManager:be},mirror:wt});ht=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];pt(bt({type:ve.Meta,data:{href:window.location.href,width:ie(),height:re()}}),e),he.reset(),Ie.init(),Ne.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new I:r,o=n.blockClass,a=void 0===o?"rr-block":o,s=n.blockSelector,u=void 0===s?null:s,c=n.maskTextClass,l=void 0===c?"rr-mask":c,d=n.maskTextSelector,f=void 0===d?null:d,p=n.inlineStylesheet,h=void 0===p||p,g=n.inlineImages,v=void 0!==g&&g,m=n.recordCanvas,y=void 0!==m&&m,_=n.maskAllInputs,b=void 0!==_&&_,w=n.maskTextFn,k=n.maskInputFn,C=n.slimDOM,S=void 0!==C&&C,A=n.dataURLOptions,R=n.preserveWhiteSpace,F=n.onSerialize,E=n.onIframeLoad,T=n.iframeLoadTimeout,x=n.onStylesheetLoad,M=n.stylesheetLoadTimeout,O=n.keepIframeSrcFn;return K(e,{doc:e,mirror:i,blockClass:a,blockSelector:u,maskTextClass:l,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:w,maskInputFn:k,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,dataURLOptions:A,inlineImages:v,recordCanvas:y,preserveWhiteSpace:R,onSerialize:F,onIframeLoad:E,iframeLoadTimeout:T,onStylesheetLoad:x,stylesheetLoadTimeout:M,keepIframeSrcFn:void 0===O?function(){return!1}:O,newlyAddedElement:!1})}(document,{mirror:wt,blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:v,inlineStylesheet:y,maskAllInputs:ee,maskTextFn:C,slimDOM:te,dataURLOptions:T,recordCanvas:O,inlineImages:G,onSerialize:function(e){ce(e,wt)&&ge.addIframe(e),le(e,wt)&&he.trackLinkElement(e),de(e)&&Ie.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ge.attachIframe(e,t),Ie.observeAttachShadow(e)},onStylesheetLoad:function(e,t){he.attachLinkElement(e,t)},keepIframeSrcFn:$});if(!t)return console.warn("Failed to snapshot the document");pt(bt({type:ve.FullSnapshot,data:{node:t,initialOffset:ne(window)}}),e),Ne.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&he.adoptStyleSheets(document.adoptedStyleSheets,wt.getId(document))};try{var we=[],ke=function(e){var t;return Oe(je)({mutationCb:ue,mousemoveCb:function(e,t){return pt(bt({type:ve.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.MouseInteraction},e)}))},scrollCb:fe,viewportResizeCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.ViewportResize},e)}))},inputCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Input},e)}))},mediaInteractionCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.StyleDeclaration},e)}))},canvasMutationCb:pe,fontCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Font},e)}))},selectionCb:function(e){pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Selection},e)}))},blockClass:o,ignoreClass:c,ignoreSelector:d,maskTextClass:p,maskTextSelector:v,maskInputOptions:ee,inlineStylesheet:y,sampling:F,recordCanvas:O,inlineImages:G,userTriggeredOnInput:q,collectFonts:V,doc:e,maskInputFn:k,maskTextFn:C,keepIframeSrcFn:$,blockSelector:s,slimDOMOptions:te,dataURLOptions:T,mirror:wt,iframeManager:ge,stylesheetManager:he,shadowDomManager:Ie,processedNodeManager:be,canvasManager:gt,ignoreCSSAttributes:Y,plugins:(null===(t=null==U?void 0:U.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return pt(bt({type:ve.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};ge.addLoadListener((function(e){try{we.push(ke(e.contentDocument))}catch(e){console.warn(e)}}));var Ce=function(){ht(),we.push(ke(document)),It=!0};return"interactive"===document.readyState||"complete"===document.readyState?Ce():(we.push(z("DOMContentLoaded",(function(){pt(bt({type:ve.DomContentLoaded,data:{}})),"DOMContentLoaded"===P&&Ce()}))),we.push(z("load",(function(){pt(bt({type:ve.Load,data:{}})),"load"===P&&Ce()}),window))),function(){we.forEach((function(e){return e()})),be.destroy(),It=!1,Me()}}catch(e){console.warn(e)}}kt.addCustomEvent=function(e,t){if(!It)throw new Error("please add custom event after start recording");pt(bt({type:ve.Custom,data:{tag:e,payload:t}}))},kt.freezePage=function(){Ne.forEach((function(e){return e.freeze()}))},kt.takeFullSnapshot=function(e){if(!It)throw new Error("please take full snapshot after start recording");ht(e)},kt.mirror=wt;var Ct=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),St=/(^|@)\S+:\d+/,At=/^\s*at .*(\S+:\d+|\(native\))/m,Rt=/^(eval@)?(\[native code])?$/,Ft={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(At)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},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(At)}),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),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ct({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Rt)}),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 Ct({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ct({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[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=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ct({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=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ct({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(St)&&!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 Ct({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(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,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Tt(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(Tt(e[i])&&xt(e[i],t-1))return!0}return!1}function Mt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Tt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Tt(e)&&xt(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]=Et(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 Ot={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 Nt(e,t,n){var r,i=n?Object.assign({},Ot,n):Ot,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var c=function(t){var n=t.message,r=t.error,o=Ft.parse(r).map((function(e){return e.toString()})),a=[Mt(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Mt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Mt("Uncaught (in promise)",i.stringifyOptions),Mt(t.reason,i.stringifyOptions)]);var o=Ft.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,f=g(i.level);try{for(f.s();!(d=f.n()).done;){var p=d.value;u.push(h(r,p))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?ee(t,n,(function(t){return function(){for(var o=arguments.length,u=new Array(o),c=0;c<o;c++)u[c]=arguments[c];if(t.apply(r,u),!s){s=!0;try{var l=Ft.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Mt(e,i.stringifyOptions)}));++a<i.lengthThreshold?e({level:n,trace:l,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Mt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Lt=Array.isArray,Dt=Object.prototype,Pt=Dt.hasOwnProperty,Bt=Dt.toString,qt=Lt||function(e){return"[object Array]"===Bt.call(e)},Wt=function(e){return"function"==typeof e},Vt=function(e){return e===Object(e)&&!qt(e)},Ht=function(e){return void 0===e},Gt=function(e){return"[object String]"==Bt.call(e)},Ut=function(e){return null===e},jt=function(e){return Ht(e)||Ut(e)},$t=function(e){return"[object Number]"==Bt.call(e)},Zt=function(e){return"[object Boolean]"===Bt.call(e)},Kt=function(e){return e instanceof Document},zt=function(e){return e instanceof FormData},Yt={DEBUG:!1,LIB_VERSION:"1.115.2"},Jt="undefined"!=typeof window?window:void 0,Qt="undefined"!=typeof globalThis?globalThis:Jt,Xt=Array.prototype,en=Xt.forEach,tn=Xt.indexOf,nn=null==Qt?void 0:Qt.navigator,rn=null==Qt?void 0:Qt.document,on=null==Qt?void 0:Qt.location,an=null==Qt?void 0:Qt.fetch,sn=null!=Qt&&Qt.XMLHttpRequest&&"withCredentials"in new Qt.XMLHttpRequest?Qt.XMLHttpRequest:void 0,un=null==Qt?void 0:Qt.AbortController,cn=null==nn?void 0:nn.userAgent,ln=null!=Jt?Jt:{},dn="[PostHog.js]",fn={_log:function(e){if(Jt&&(Yt.DEBUG||ln.POSTHOG_DEBUG)&&!Ht(Jt.console)&&Jt.console){for(var t=("__rrweb_original__"in Jt.console[e]?Jt.console[e].__rrweb_original__:Jt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[dn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[dn].concat(n))},uninitializedWarning:function(e){fn.error("You must initialize PostHog before calling ".concat(e))}},pn={},hn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function gn(e,t,n){if(qt(e))if(en&&e.forEach===en)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===pn)return}function vn(e,t,n){if(!jt(e)){if(qt(e))return gn(e,t,n);if(zt(e)){var r,i=g(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===pn)return}}catch(e){i.e(e)}finally{i.f()}}else for(var a in e)if(Pt.call(e,a)&&t.call(n,e[a],a)===pn)return}}var mn=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 gn(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function yn(e,t){return-1!==e.indexOf(t)}function _n(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var bn=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},In=function(e){try{return e()}catch(e){return}},wn=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){fn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),fn.critical(e)}}},kn=function(e){var t={};return vn(e,(function(e,n){Gt(e)&&e.length>0&&(t[n]=e)})),t};function Cn(e,t){return n=e,r=function(e){return Gt(e)&&!Ut(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),qt(t)?(o=[],gn(t,(function(t){o.push(e(t))}))):(o={},vn(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var Sn=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),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),Ut(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},An=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==Jt?void 0:Jt.event)){var o,a=!0;Wt(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else fn.error("No valid element provided to register_event")}}();function Rn(e,t){var n=function(){if(!rn)return t("document not found");var n=rn.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=rn.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):rn.body.appendChild(n)};null!=rn&&rn.body?n():null==rn||rn.addEventListener("DOMContentLoaded",n)}var Fn=["localhost","127.0.0.1"],En=function(e){var t=null==rn?void 0:rn.createElement("a");return Ht(t)?null:(t.href=e,t)},Tn=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},xn=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return vn(e,(function(e,r){Ht(e)||Ht(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Mn=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!qt(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){fn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},On=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function Nn(e){return e?hn(e).split(/\s+/):[]}function Ln(e){var t="";switch(r(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Nn(t)}function Dn(e){return jt(e)?null:hn(e).split(/(\s+)/).filter((function(e){return Xn(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Pn(e){var t="";return jn(e)&&!$n(e)&&e.childNodes&&e.childNodes.length&&vn(e.childNodes,(function(e){var n;Wn(e)&&e.textContent&&(t+=null!==(n=Dn(e.textContent))&&void 0!==n?n:"")})),hn(t)}function Bn(e){return!!e&&1===e.nodeType}function qn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Wn(e){return!!e&&3===e.nodeType}function Vn(e){return!!e&&11===e.nodeType}var Hn=["a","button","form","input","select","textarea","label"];function Gn(e){var t=e.parentNode;return!(!t||!Bn(t))&&t}function Un(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!Jt||!e||qn(e,"html")||!Bn(e))return!1;if(null!=n&&n.url_allowlist){var a=Jt.location.href,s=n.url_allowlist;if(s&&!s.some((function(e){return a.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((function(e){return t.type===e})))return!1}for(var c=!1,l=[e],d=!0,f=e;f.parentNode&&!qn(f,"body");)if(Vn(f.parentNode))l.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=Gn(f)))break;if(i||Hn.indexOf(d.tagName.toLowerCase())>-1)c=!0;else{var p=Jt.getComputedStyle(d);p&&"pointer"===p.getPropertyValue("cursor")&&(c=!0)}l.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Ht(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(l,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Ht(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(l,n))return!1;var h=Jt.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return c?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&(Hn.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}function jn(e){for(var t=e;t.parentNode&&!qn(t,"body");t=t.parentNode){var n=Ln(t);if(yn(n,"ph-sensitive")||yn(n,"ph-no-capture"))return!1}if(yn(Ln(e),"ph-include"))return!0;var r=e.type||"";if(Gt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Gt(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function $n(e){return!!(qn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||qn(e,"select")||qn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Zn="(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})",Kn=new RegExp("^(?:".concat(Zn,")$")),zn=new RegExp(Zn),Yn="\\d{3}-?\\d{2}-?\\d{4}",Jn=new RegExp("^(".concat(Yn,")$")),Qn=new RegExp("(".concat(Yn,")"));function Xn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(jt(e))return!1;if(Gt(e)){if(e=hn(e),(t?Kn:zn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Jn:Qn).test(e))return!1}return!0}function er(e){var t=Pn(e);return Xn(t="".concat(t," ").concat(tr(e)).trim())?t:""}function tr(e){var t="";return e&&e.childNodes&&e.childNodes.length&&vn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Pn(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(tr(e)).trim())}catch(e){fn.error(e)}})),t}function nr(e){return function(e){var n=e.map((function(e){var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var o,a=g(e.attr_class);try{for(a.s();!(o=a.n()).done;){var s=o.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){a.e(e)}finally{a.f()}}var u=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),c={};return _n(u).sort((function(e,t){var n=d(e,1)[0],r=d(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];return c[rr(n.toString())]=rr(r.toString())})),i+=":",i+=_n(u).map((function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return n.join(";")}(function(e){return e.map((function(e){var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:ir(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return _n(e).filter((function(e){return 0===d(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=d(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function rr(e){return e.replace(/"|\\"/g,'\\"')}function ir(e){var t=e.attr__class;return t?qt(t)?t:Nn(t):void 0}var or="[SessionRecording]",ar={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},sr=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],ur=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],cr=["/s/","/e/","/i/"];function lr(e,t,n,r){if(jt(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Gt(i)&&(i=parseInt(i)),i>n?or+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function dr(e,t){if(jt(e))return e;var n=e;return Xn(n,!1)||(n=or+" "+t+" body redacted"),vn(ur,(function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=or+" "+t+" body redacted as might contain: "+e)})),n}var fr=function(e,n){var r,i,o,a=e.session_recording,s=!1!==a.recordHeaders&&n.recordHeaders,u=!1!==a.recordBody&&n.recordBody,c=!1!==a.recordPerformance&&n.recordPerformance,l=(r=a,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=lr(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=lr(e.responseBody,e.responseHeaders,o,"Response")),e}),d=function(e){return function(e){if(!Ht(e))return e.requestBody=dr(e.requestBody,"Request"),e.responseBody=dr(e.responseBody,"Response"),e}(l(function(e){var t=En(e.name);if(!(t&&t.pathname&&cr.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((t=e,vn(Object.keys(null!==(n=t.requestHeaders)&&void 0!==n?n:{}),(function(e){var n;sr.includes(e.toLowerCase())&&(null===(n=t.requestHeaders)||void 0===n||delete n[e])})),t))));var t,n},f=Wt(e.session_recording.maskNetworkRequestFn);return f&&Wt(e.session_recording.maskCapturedNetworkRequestFn)&&fn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),f&&(e.session_recording.maskCapturedNetworkRequestFn=function(n){var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),a.maskRequestFn=Wt(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:void 0,a.maskRequestFn||(a.maskRequestFn=d),t(t(t({},ar),a),{},{recordHeaders:s,recordBody:u,recordPerformance:c,recordInitialRequests:c})},pr=function(e){return"navigation"===e.entryType},hr=function(e){return"resource"===e.entryType};function gr(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return Wt(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function vr(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function mr(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return pr(e)||hr(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return Cr(e,void 0,void 0,{},!0)})),isInitial:!0})}var i=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return pr(e)||hr(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return Cr(e,void 0,void 0,{})}))})})),o=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return i.observe({entryTypes:o}),function(){i.disconnect()}}function yr(e,t){return!!t&&(Zt(t)||t[e])}function _r(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(Zt(t))return!0;if(qt(t))return r(t);var i=t[e];return Zt(i)?i:r(i)}function br(e,t,n,r,i){return Ir.apply(this,arguments)}function Ir(){return Ir=o(n().mark((function e(t,r,i,o,a){var s,u,c,l=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return fn.warn("Failed to get performance entry for request",{url:i,initiatorType:r}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(i),c=vr(u,(function(e){return hr(e)&&e.initiatorType===r&&(!o||e.startTime>=o)&&(!a||e.startTime<=a)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",br(t,r,i,o,a,s+1));case 10:return e.abrupt("return",c);case 11:case"end":return e.stop()}}),e)}))),Ir.apply(this,arguments)}function wr(e){if(jt(e))return null;if(Gt(e))return e;if(Kt(e))return e.textContent;if(zt(e))return xn(e);if(Vt(e))try{return JSON.stringify(e)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var kr=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function Cr(e,n,r,i,o){var a=Math.floor(Date.now()-performance.now()),s=Math.floor(a+e.startTime),u=[t(t({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:a,timestamp:s,method:n,initiatorType:e.initiatorType,status:r,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(kr(e)){var c,l=g(e.serverTiming||[]);try{for(l.s();!(c=l.n()).done;){var d=c.value;u.push({timeOrigin:a,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){l.e(e)}finally{l.f()}}return u}var Sr=["video/","audio/"];function Ar(e){var t;if("chunked"===e.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var n=null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),r=Sr.some((function(e){return null==n?void 0:n.startsWith(e)}));return n&&r?"Content-Type ".concat(n," is not supported"):null}function Rr(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function Fr(e){return Er.apply(this,arguments)}function Er(){return(Er=o(n().mark((function e(t){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Ar(t),Ut(r)){e.next=3;break}return e.abrupt("return",Promise.resolve(r));case 3:return e.abrupt("return",Rr(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tr(e,r,i){if(!("performance"in r))return function(){};var a=i?Object.assign({},ar,i):ar,s=function(n){var r=[];n.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},u=mr(s,r,a),c=function(){},l=function(){};return(a.recordHeaders||a.recordBody)&&(c=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=yr("request",n.recordHeaders),i=yr("response",n.recordHeaders),o=gr(t.XMLHttpRequest.prototype,"open",(function(o){return function(a,s){var u,c,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,p=this,h=new Request(s),g={},v={},m=p.setRequestHeader.bind(p);p.setRequestHeader=function(e,t){return v[e]=t,m(e,t)},r&&(g.requestHeaders=v);var y=p.send.bind(p);p.send=function(e){return _r("request",n.recordBody,v)&&(Ht(e)||Ut(e)?g.requestBody=null:g.requestBody=wr(e)),u=t.performance.now(),y(e)},p.addEventListener("readystatechange",(function(){if(p.readyState===p.DONE){c=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(g.responseHeaders=r),_r("response",n.recordBody,r)&&(jt(p.response)?g.responseBody=null:g.responseBody=wr(p.response)),br(t,"xmlhttprequest",h.url,u,c).then((function(t){if(!Ut(t)){var n=Cr(t,h.method,null==p?void 0:p.status,g);e({requests:n})}})).catch((function(){}))}})),o.call(p,a,s,l,d,f)}}));return function(){o()}}(s,r,a),l=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var i=yr("request",r.recordHeaders),a=yr("response",r.recordHeaders),s=gr(t,"fetch",(function(s){return function(){var u=o(n().mark((function o(u,c){var l,d,f,p,h,g,v;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=new Request(u,c),f={},n.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),i&&(f.requestHeaders=g),!_r("request",r.recordBody,g)){n.next=10;break}return n.next=9,Rr(l);case 9:f.requestBody=n.sent;case 10:return p=t.performance.now(),n.next=13,s(l);case 13:if(d=n.sent,h=t.performance.now(),v={},d.headers.forEach((function(e,t){v[t]=e})),a&&(f.responseHeaders=v),!_r("response",r.recordBody,v)){n.next=22;break}return n.next=21,Fr(d);case 21:f.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,br(t,"fetch",l.url,p,h).then((function(t){var n;if(!Ut(t)){var r=Cr(t,l.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),o,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),function(){u(),c(),l()}}Jt&&(Jt.rrweb={record:kt,version:"v2",rrwebVersion:"2.0.0-alpha.11"},Jt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Nt,options:e}}},Jt.getRecordNetworkPlugin=function(e){return{name:"rrweb/network@1",observer:Tr,options:e}});var xr=function(){function e(t){a(this,e),this.clicks=[],this.enabled=t}return u(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}(),Mr="$people_distinct_id",Or="__alias",Nr="__timers",Lr="$autocapture_disabled_server_side",Dr="$session_recording_enabled_server_side",Pr="$console_log_recording_enabled_server_side",Br="$session_recording_network_payload_capture",qr="$session_recording_canvas_recording",Wr="$sesid",Vr="$session_is_sampled",Hr="$enabled_feature_flags",Gr="$early_access_features",Ur="$stored_person_properties",jr="$stored_group_properties",$r="$surveys",Zr="$flag_call_reported",Kr="$user_state",zr="$posthog_quota_limited",Yr="$client_session_props",Jr=[Mr,Or,"__cmpns",Nr,Dr,Wr,Hr,Kr,zr,Gr,jr,Ur,$r,Zr,Yr],Qr="$copy_autocapture";function Xr(e,t){return t.length>e?t.slice(0,e)+"...":t}var ei,ti={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=Ut(this._isDisabledServerSide)?!(null===(t=e.persistence)||void 0===t||!t.props[Lr]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bn(t));return t},_getAugmentPropertiesFromElement:function(e){if(!jn(e))return{};var t={};return vn(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&Xn(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};Hn.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Xr(1024,er(e)):o.$el_text=Xr(1024,Pn(e)));var a=Ln(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;vn(e.attributes,(function(n){var r;if((!$n(e)||-1!==["name","id","class"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&Xn(n.value)&&(r=n.name,!Gt(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=Nn(i).join(" ")),o["attr__"+n.name]=Xr(1024,i)}}));for(var u=1,c=1,l=e;l=this._previousElementSibling(l);)u++,l.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return vn(null==rn?void 0:rn.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),Xn(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return vn(this._customProperties,(function(r){vn(r.event_selectors,(function(i){vn(null==rn?void 0:rn.querySelectorAll(i),(function(i){yn(e,i)&&jn(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return Ht(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=arguments.length>3?arguments[3]:void 0,a=this._getEventTarget(e);(Wn(a)&&(a=a.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));var s=i===Qr;if(a&&Un(a,e,this.config,s,s?["copy","cut"]:void 0)){for(var u,c,l=[a],d=a;d.parentNode&&!qn(d,"body");)Vn(d.parentNode)?(l.push(d.parentNode.host),d=d.parentNode.host):(l.push(d.parentNode),d=d.parentNode);var f,p=[],h={},g=!1;if(vn(l,(function(e){var n=jn(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=n&&Xn(f)&&f),yn(Ln(e),"ph-no-capture")&&(g=!0),p.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var i=r._getAugmentPropertiesFromElement(e);mn(h,i)})),t.config.mask_all_text||("a"===a.tagName.toLowerCase()||"button"===a.tagName.toLowerCase()?p[0].$el_text=er(a):p[0].$el_text=Pn(a)),f&&(p[0].attr__href=f),g)return!1;var v=mn(this._getDefaultProperties(e.type),t.elementsChainAsString?{$elements_chain:nr(p)}:{$elements:p},null!==(u=p[0])&&void 0!==u&&u.$el_text?{$el_text:null===(c=p[0])||void 0===c?void 0:c.$el_text}:{},this._getCustomProperties(l),h,o||{});if(i===Qr){var m,y=Dn(null==Jt||null===(m=Jt.getSelection())||void 0===m?void 0:m.toString()),_=e.type||"clipboard";if(!y)return!1;v.$selected_content=y,v.$copy_type=_}return t.capture(i,v),!0}},_navigate:function(e){Jt&&(Jt.location.href=e)},_addDomEventHandlers:function(e){var t=this;if(Jt&&rn){var n=function(n){n=n||(null==Jt?void 0:Jt.event),t._captureEvent(n,e)},r=function(n){n=n||(null==Jt?void 0:Jt.event),t._captureEvent(n,e,Qr)};An(rn,"submit",n,!1,!0),An(rn,"change",n,!1,!0),An(rn,"click",n,!1,!0),Vt(e.config.autocapture)&&e.config.autocapture.capture_copied_text&&(An(rn,"copy",r,!1,!0),An(rn,"cut",r,!1,!0))}},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;Zt(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 xr(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?fn.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(c({},Lr,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Ht(t)?10:t,n=Ht(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return Wt(null==rn?void 0:rn.querySelectorAll)}};!function(e){for(var t in e)Wt(e[t])&&(e[t]=e[t].bind(e))}(ti),function(e){for(var t in e)Wt(e[t])&&(e[t]=wn(e[t]))}(ti),function(e){e.GZipJS="gzip-js",e.Base64="base64"}(ei||(ei={}));var ni="$active_feature_flags",ri="$override_feature_flags",ii="$feature_flag_payloads",oi=function(e){var t,n={},r=g(_n(e||{}));try{for(r.s();!(t=r.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},ai=function(){function e(t){a(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Hr),t=this.instance.get_property(ri);if(!t)return e||{};for(var n=mn({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(fn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ii)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(Ur),r=this.instance.get_property(jr),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:ei.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){var n;e.setReloadingPaused(!1);var r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(Zr)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))qt(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(c({},Zr,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}fn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);fn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.featureFlags,s=e.featureFlagPayloads;if(a)if(qt(a)){var u,l={};if(a)for(var d=0;d<a.length;d++)l[a[d]]=!0;n&&n.register((c(u={},ni,a),c(u,Hr,l),u))}else{var f=a,p=s;e.errorsWhileComputingFlags&&(f=t(t({},i),f),p=t(t({},o),p)),n&&n.register((c(r={},ni,Object.keys(oi(f))),c(r,Hr,f||{}),c(r,ii,p||{}),r))}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return fn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ri);else if(qt(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(c({},ri,t))}else this.instance.persistence.register(c({},ri,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=c({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},c({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((c(i={},ni,Object.keys(oi(a))),c(i,Hr,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Gr);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(c({},Gr,i)),e(i)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Ur)||{};this.instance.register(c({},Ur,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Ur)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(jr)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(c({},jr,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(jr)||{};this.instance.register(c({},jr,t(t({},n),{},c({},e,{}))))}else this.instance.unregister(jr)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return $t(e)&&isFinite(e)&&Math.floor(e)===e});var si="0123456789abcdef",ui=function(){function e(t){if(a(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return u(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+si.charAt(this.bytes[t]>>>4)+si.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),ci=function(){function e(){a(this,e),c(this,"timestamp",0),c(this,"counter",0),c(this,"random",new fi)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Ht(e)){this.timestamp=0;var t=this.generateOrAbort();if(Ht(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return ui.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),li=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Jt&&!Ht(Jt.crypto)&&crypto.getRandomValues&&(li=function(e){return crypto.getRandomValues(e)});var di,fi=function(){function e(){a(this,e),c(this,"buffer",new Uint32Array(8)),c(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(li(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),pi=function(){return hi().toString()},hi=function(){return(di||(di=new ci)).generate()},gi="Thu, 01 Jan 1970 00:00:00 GMT",vi="";var mi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function yi(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rn;if(vi)return vi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+pi(),o=new RegExp("(^|;)\\s*"+i+"=1");!vi&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+gi,vi=a)}return vi}(e);if(!n){var r=function(e){var t=e.match(mi);return t?t[0]:""}(e);r!==n&&fn.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var _i,bi={is_supported:function(){return!!rn},error:function(e){fn.error("cookieStore error: "+e)},get:function(e){if(rn){try{for(var t=e+"=",n=rn.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(bi.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(rn)try{var o="",a="",s=yi(rn.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&fn.warn("cookieStore warning: large cookie, len="+c.length),rn.cookie=c,c}catch(e){return}},remove:function(e,t){try{bi.set(e,"",-1,t)}catch(e){return}}},Ii=null,wi={is_supported:function(){if(!Ut(Ii))return Ii;var e=!0;if(Ht(Jt))e=!1;else try{var t="__mplssupport__";wi.set(t,"xyz"),'"xyz"'!==wi.get(t)&&(e=!1),wi.remove(t)}catch(t){e=!1}return e||fn.error("localStorage unsupported; falling back to cookie store"),Ii=e,e},error:function(e){fn.error("localStorage error: "+e)},get:function(e){try{return null==Jt?void 0:Jt.localStorage.getItem(e)}catch(e){wi.error(e)}return null},parse:function(e){try{return JSON.parse(wi.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==Jt||Jt.localStorage.setItem(e,JSON.stringify(t))}catch(e){wi.error(e)}},remove:function(e){try{null==Jt||Jt.localStorage.removeItem(e)}catch(e){wi.error(e)}}},ki=["distinct_id",Wr,Vr],Ci=t(t({},wi),{},{parse:function(e){try{var t={};try{t=bi.parse(e)||{}}catch(e){}var n=mn(t,JSON.parse(wi.get(e)||"{}"));return wi.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{wi.set(e,t);var o={};ki.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&bi.set(e,o,n,r,i)}catch(e){wi.error(e)}},remove:function(e,t){try{null==Jt||Jt.localStorage.removeItem(e),bi.remove(e,t)}catch(e){wi.error(e)}}}),Si={},Ai={is_supported:function(){return!0},error:function(e){fn.error("memoryStorage error: "+e)},get:function(e){return Si[e]||null},parse:function(e){return Si[e]||null},set:function(e,t){Si[e]=t},remove:function(e){delete Si[e]}},Ri=null,Fi={is_supported:function(){if(!Ut(Ri))return Ri;if(Ri=!0,Ht(Jt))Ri=!1;else try{var e="__support__";Fi.set(e,"xyz"),'"xyz"'!==Fi.get(e)&&(Ri=!1),Fi.remove(e)}catch(e){Ri=!1}return Ri},error:function(e){fn.error("sessionStorage error: ",e)},get:function(e){try{return null==Jt?void 0:Jt.sessionStorage.getItem(e)}catch(e){Fi.error(e)}return null},parse:function(e){try{return JSON.parse(Fi.get(e))||null}catch(e){}return null},set:function(e,t){try{null==Jt||Jt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Fi.error(e)}},remove:function(e){try{null==Jt||Jt.sessionStorage.removeItem(e)}catch(e){Fi.error(e)}}},Ei="Mobile",Ti="iOS",xi="Android",Mi="Tablet",Oi=xi+" "+Mi,Ni="iPad",Li="Apple",Di=Li+" Watch",Pi="Safari",Bi="BlackBerry",qi="Samsung",Wi=qi+"Browser",Vi=qi+" Internet",Hi="Chrome",Gi=Hi+" OS",Ui=Hi+" "+Ti,ji="Internet Explorer",$i=ji+" "+Ei,Zi="Opera",Ki=Zi+" Mini",zi="Edge",Yi="Microsoft "+zi,Ji="Firefox",Qi=Ji+" "+Ti,Xi="Nintendo",eo="PlayStation",to="Xbox",no=xi+" "+Ei,ro=Ei+" "+Pi,io="Windows",oo=io+" Phone",ao="Nokia",so="Ouya",uo="Generic",co=uo+" "+Ei.toLowerCase(),lo=uo+" "+Mi.toLowerCase(),fo="Konqueror",po="(\\d+(\\.\\d+)?)",ho=new RegExp("Version/"+po),go=new RegExp(to,"i"),vo=new RegExp(eo+" \\w+","i"),mo=new RegExp(Xi+" \\w+","i"),yo=new RegExp(Bi+"|PlayBook|BB10","i"),_o={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var bo=function(e,t){return t&&yn(t,Li)||function(e){return yn(e,Pi)&&!yn(e,Hi)&&!yn(e,xi)}(e)},Io=function(e,t){return t=t||"",yn(e," OPR/")&&yn(e,"Mini")?Ki:yn(e," OPR/")?Zi:yo.test(e)?Bi:yn(e,"IE"+Ei)||yn(e,"WPDesktop")?$i:yn(e,Wi)?Vi:yn(e,zi)||yn(e,"Edg/")?Yi:yn(e,"FBIOS")?"Facebook "+Ei:yn(e,Hi)?Hi:yn(e,"CriOS")?Ui:yn(e,"UCWEB")||yn(e,"UCBrowser")?"UC Browser":yn(e,"FxiOS")?Qi:yn(e,xi)?no:yn(e.toLowerCase(),fo.toLowerCase())?fo:bo(e,t)?yn(e,Ei)?ro:Pi:yn(e,Ji)?Ji:yn(e,"MSIE")||yn(e,"Trident/")?ji:yn(e,"Gecko")?Ji:""},wo=(c(_i={},$i,[new RegExp("rv:"+po)]),c(_i,Yi,[new RegExp(zi+"?\\/"+po)]),c(_i,Hi,[new RegExp(Hi+"/"+po)]),c(_i,Ui,[new RegExp("CriOS\\/"+po)]),c(_i,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+po)]),c(_i,Pi,[ho]),c(_i,ro,[ho]),c(_i,Zi,[new RegExp("(Opera|OPR)\\/"+po)]),c(_i,Ji,[new RegExp(Ji+"\\/"+po)]),c(_i,Qi,[new RegExp("FxiOS\\/"+po)]),c(_i,fo,[new RegExp("Konqueror[:/]?"+po,"i")]),c(_i,Bi,[new RegExp(Bi+" "+po),ho]),c(_i,no,[new RegExp("android\\s"+po)]),c(_i,Vi,[new RegExp(Wi+"\\/"+po)]),c(_i,ji,[new RegExp("(rv:|MSIE )"+po)]),c(_i,"Mozilla",[new RegExp("rv:"+po)]),_i),ko=[[new RegExp(to+"; "+to+" (.*?)[);]","i"),function(e){return[to,e&&e[1]||""]}],[new RegExp(Xi,"i"),[Xi,""]],[new RegExp(eo,"i"),[eo,""]],[yo,[Bi,""]],[new RegExp(io,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[oo,""];if(new RegExp(Ei).test(t)&&!/IEMobile\b/.test(t))return[io+" "+Ei,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=_o[r]||"";return/arm/i.test(t)&&(i="RT"),[io,i]}return[io,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Ti,t.join(".")]}return[Ti,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Ht(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+xi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+xi+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[xi,t.join(".")]}return[xi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Gi,""]],[/Linux|debian/i,["Linux",""]]],Co=function(e){return mo.test(e)?Xi:vo.test(e)?eo:go.test(e)?to:new RegExp(so,"i").test(e)?so:new RegExp("("+oo+"|WPDesktop)","i").test(e)?oo:/iPad/.test(e)?Ni:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Di:yo.test(e)?Bi:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ao,"i").test(e)?ao:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Ei).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?xi:Oi:xi:new RegExp("(pda|"+Ei+")","i").test(e)?co:new RegExp(Mi,"i").test(e)&&!new RegExp(Mi+" pc","i").test(e)?lo:""},So="https?://(.*)",Ao={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"].concat(e||[]),n={};return vn(t,(function(e){var t=rn?Mn(rn.URL,e):"";t.length&&(n[e]=t)})),n},searchEngine:function(){var e=null==rn?void 0:rn.referrer;return e?0===e.search(So+"google.([^/?]*)")?"google":0===e.search(So+"bing.com")?"bing":0===e.search(So+"yahoo.com")?"yahoo":0===e.search(So+"duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=Ao.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!Ut(e)){n.$search_engine=e;var r=rn?Mn(rn.referrer,t):"";r.length&&(n.ph_keyword=r)}return n},browser:Io,browserVersion:function(e,t){var n=Io(e,t),r=wo[n];if(Ht(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<ko.length;t++){var n=d(ko[t],2),r=n[0],i=n[1],o=r.exec(e),a=o&&(Wt(i)?i(o,e):i);if(a)return a}return["",""]},device:Co,deviceType:function(e){var t=Co(e);return t===Ni||t===Oi||"Kobo"===t||"Kindle Fire"===t||t===lo?Mi:t===Xi||t===to||t===eo||t===so?"Console":t===Di?"Wearable":t?Ei:"Desktop"},referrer:function(){return(null==rn?void 0:rn.referrer)||"$direct"},referringDomain:function(){var e;return null!=rn&&rn.referrer&&(null===(e=En(rn.referrer))||void 0===e?void 0:e.host)||"$direct"},properties:function(){if(!cn)return{};var e=d(Ao.os(cn),2),t=e[0],n=e[1];return mn(kn({$os:t,$os_version:n,$browser:Ao.browser(cn,navigator.vendor),$device:Ao.device(cn),$device_type:Ao.deviceType(cn)}),{$current_url:null==on?void 0:on.href,$host:null==on?void 0:on.host,$pathname:null==on?void 0:on.pathname,$raw_user_agent:cn.length>1e3?cn.substring(0,997)+"...":cn,$browser_version:Ao.browserVersion(cn,navigator.vendor),$browser_language:Ao.browserLanguage(),$screen_height:null==Jt?void 0:Jt.screen.height,$screen_width:null==Jt?void 0:Jt.screen.width,$viewport_height:null==Jt?void 0:Jt.innerHeight,$viewport_width:null==Jt?void 0:Jt.innerWidth,$lib:"web",$lib_version:Yt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:bn()/1e3})},people_properties:function(){if(!cn)return{};var e=d(Ao.os(cn),2),t=e[0],n=e[1];return mn(kn({$os:t,$os_version:n,$browser:Ao.browser(cn,navigator.vendor)}),{$browser_version:Ao.browserVersion(cn,navigator.vendor)})}},Ro=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Fo=function(){function e(t){a(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(t),this.storage=this.buildStorage(t),this.load(),this.update_config(t,t),this.save()}return u(e,[{key:"buildStorage",value:function(e){-1===Ro.indexOf(e.persistence.toLowerCase())&&(fn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&wi.is_supported()?wi:"localstorage+cookie"===t&&Ci.is_supported()?Ci:"sessionstorage"===t&&Fi.is_supported()?Fi:"memory"===t?Ai:"cookie"===t?bi:Ci.is_supported()?Ci:bi}},{key:"properties",value:function(){var e={};return vn(this.props,(function(t,n){if(n===Hr&&Vt(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(Ut(o=Jr)?s:tn&&o.indexOf===tn?-1!=o.indexOf(a):(vn(o,(function(e){if(s||(s=e===a))return pn})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=mn({},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(Vt(e)){Ht(t)&&(t="None"),this.expire_days=Ht(n)?this.default_expiry:n;var i=!1;if(vn(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(Vt(e)){this.expire_days=Ht(t)?this.default_expiry:t;var r=!1;if(vn(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(Ao.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(Ao.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||Ao.referrer(),$referring_domain:this.props.$referring_domain||Ao.referringDomain()})}},{key:"get_referrer_info",value:function(){return kn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return vn(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Nr]||{};n[e]=t,this.props[Nr]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Nr]||{})[e];return Ht(t)||(delete this.props[Nr][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Kr]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Kr]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[zr]||{}}},{key:"set_quota_limits",value:function(e){this.props[zr]=e,this.save()}}]),e}(),Eo=2,To=4;var xo=u((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),c(this,"bucketSize",100),c(this,"refillRate",10),c(this,"mutationBuckets",{}),c(this,"loggedTracker",{}),c(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),c(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),c(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),c(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=d(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),Mo=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Mo||{}),Oo="__ph_opt_in_out_";function No(e,t){Ho(!0,e,t)}function Lo(e,t){Ho(!1,e,t)}function Do(e,t){return"1"===Vo(e,t)}function Po(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||Jt,n=null==t?void 0:t.navigator,r=!1;return vn([null==n?void 0:n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){yn([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Vo(e,t)}function Bo(e,t){qo(t=t||{}).remove(Wo(e,t),!!t.crossSubdomainCookie)}function qo(e){return"localStorage"===(e=e||{}).persistenceType?wi:"localStorage+cookie"===e.persistenceType?Ci:bi}function Wo(e,t){return((t=t||{}).persistencePrefix||Oo)+e}function Vo(e,t){return qo(t).get(Wo(e,t))}function Ho(e,t,n){Gt(t)&&t.length?(qo(n=n||{}).set(Wo(t,n),e?1:0,$t(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):fn.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function Go(e){var t=!1;try{var n=e.config.token,r=e.config.respect_dnt,i=e.config.opt_out_capturing_persistence_type,o=e.config.opt_out_capturing_cookie_prefix||void 0,a=e.config.window;n&&(t=Po(n,{respectDnt:r,persistenceType:i,persistencePrefix:o,window:a}))}catch(e){fn.error("Unexpected error when checking capturing opt-out status: "+e)}return t}var Uo,jo=3e5,$o=jo;!function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(Uo||(Uo={}));var Zo=[Uo.MouseMove,Uo.MouseInteraction,Uo.Scroll,Uo.ViewportResize,Uo.Input,Uo.TouchMove,Uo.MediaInteraction,Uo.Drag],Ko=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},zo="[SessionRecording]",Yo=function(){function e(t){var n=this;if(a(this,e),c(this,"queuedRRWebEvents",[]),c(this,"isIdle",!1),c(this,"_linkedFlagSeen",!1),c(this,"_lastActivityTimestamp",Date.now()),c(this,"windowId",null),c(this,"sessionId",null),c(this,"_linkedFlag",null),c(this,"_sampleRate",null),c(this,"_minimumDuration",null),c(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,null==Jt||Jt.addEventListener("beforeunload",(function(){n._flushBuffer()})),null==Jt||Jt.addEventListener("offline",(function(){n._tryAddCustomEvent("browser offline",{})})),null==Jt||Jt.addEventListener("online",(function(){n._tryAddCustomEvent("browser online",{})})),null==Jt||Jt.addEventListener("visibilitychange",(function(){if(null!=rn&&rn.visibilityState){var e="window "+rn.visibilityState;n._tryAddCustomEvent(e,{})}})),!this.instance.sessionManager)throw fn.error(zo+" started without valid sessionManager"),new Error(zo+" started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return u(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw fn.error(zo+" started without valid sessionManager"),new Error(zo+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return $t(this._sampleRate)?this.instance.get_property(Vr):null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Dr),t=!this.instance.config.disable_session_recording;return Jt&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Pr),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(qr);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(Br),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),a=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?jt(this._linkedFlag)||this._linkedFlagSeen?Zt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?(this._startCapture(),fn.info(zo+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,fn.info(zo+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e;if($t(this._sampleRate)){var r,i=this.isSampled;if(n||!Zt(i))r=Math.random()<this._sampleRate;else r=i;r||fn.warn(zo+" Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),null===(t=this.instance.persistence)||void 0===t||t.register(c({},Vr,r))}else{var o;null===(o=this.instance.persistence)||void 0===o||o.register(c({},Vr,null))}}},{key:"afterDecideResponse",value:function(e){var n,r,i,o,a,s,u,l,d,f,p=this;this.instance.persistence&&this.instance.persistence.register((c(f={},Dr,!!e.sessionRecording),c(f,Pr,null===(a=e.sessionRecording)||void 0===a?void 0:a.consoleLogRecordingEnabled),c(f,Br,t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture)),c(f,qr,{enabled:null===(u=e.sessionRecording)||void 0===u?void 0:u.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(d=e.sessionRecording)||void 0===d?void 0:d.canvasQuality}),f));var h=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate;this._sampleRate=jt(h)?null:parseFloat(h);var g,v=null===(r=e.sessionRecording)||void 0===r?void 0:r.minimumDurationMilliseconds;(this._minimumDuration=Ht(v)?null:v,this._linkedFlag=(null===(i=e.sessionRecording)||void 0===i?void 0:i.linkedFlag)||null,null!==(o=e.sessionRecording)&&void 0!==o&&o.endpoint)&&(this._endpoint=null===(g=e.sessionRecording)||void 0===g?void 0:g.endpoint);if($t(this._sampleRate)&&this.sessionManager.onSessionId((function(e){p.makeSamplingDecision(e)})),!jt(this._linkedFlag)){var m,y,_=Gt(this._linkedFlag)?this._linkedFlag:null===(m=this._linkedFlag)||void 0===m?void 0:m.flag,b=Gt(this._linkedFlag)?null:null===(y=this._linkedFlag)||void 0===y?void 0:y.variant;this.instance.onFeatureFlags((function(e,t){var n=Vt(t)&&_ in t,r=b?t[_]===b:n;r&&fn.info(zo+" linked flag matched",{linkedFlag:_,linkedVariant:b}),p._linkedFlagSeen=r}))}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:bn()})}},{key:"_startCapture",value:function(){var e=this;Ht(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||Go(this.instance)||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),"v2"!==this.instance.__loaded_recorder_version?Rn(this.instance.requestRouter.endpointFor("assets","/static/recorder-v2.js?v=".concat(Yt.LIB_VERSION)),(function(t){if(t)return fn.error(zo+" could not load recorder-v2.js",t);e._onScriptLoaded()})):this._onScriptLoaded())}},{key:"_isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==Zo.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this._isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>$o&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:$o}));var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,a=this.sessionId!==o,s=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[Eo,To].indexOf(e.type)&&(s||a))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):fn.warn(zo+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(Ko((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Ko((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){var e,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=Jt.rrweb?Jt.rrweb.record:Jt.rrwebRecord;for(var i=this.instance.config.session_recording,o=0,a=Object.entries(i||{});o<a.length;o++){var s=d(a[o],2),u=s[0],c=s[1];u in r&&(r[u]=c)}if(this.canvasRecording&&this.canvasRecording.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.canvasRecording.fps},r.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new xo(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");fn.info(r,{node:t}),n.log(zo+" "+r,"warn")}}),this._scheduleFullSnapshot();var l=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:l},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t=Jt?n._maskUrl(Jt.location.href):"";if(!t)return;n._tryAddCustomEvent("$pageview",{href:t}),n._tryTakeFullSnapshot()}}catch(e){fn.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:l.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else fn.error(zo+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),jo)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(ln.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(ln.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&Wt(ln.getRecordNetworkPlugin))&&(!Fn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(ln.getRecordNetworkPlugin(fr(this.instance.config,this.networkPayloadCapture))):fn.info(zo+" NetworkCapture not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Vt(e)){if(e.type===Mo.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Mo.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&Vt(t)&&6===t.type&&Vt(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(n),i=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Mo.Custom){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&Jt){var e=this._maskUrl(Jt.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=f(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(n){Date.now()-n.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length}):e._tryRRWebMethod(n)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length})}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this._minimumDuration,n=this.sessionDuration,r=$t(n)&&n>=0,i=$t(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),Ut(this.buffer.sessionId)&&!Ut(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings"})}}]),e}(),Jo=function(){function e(t){a(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ur),group_properties:this.instance.get_property(jr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:ei.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t,n=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var r=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},r),r)fn.error("Failed to fetch feature flags from PostHog.");else{if(!rn||!rn.body)return fn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.parseDecideResponse(e)}),500);this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),ti.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e);var i=null==Jt?void 0:Jt.extendPostHogWithSurveys;e.surveys&&!i&&Rn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),(function(e){if(e)return fn.error("Could not load surveys script",e);Jt.extendPostHogWithSurveys(n.instance)}));var o=null==Jt?void 0:Jt.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&Ht(o)&&Rn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),(function(t){if(t)return fn.error("Could not load exception autocapture script",t);Jt.extendPostHogWithExceptionAutocapture(n.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var a,s=g(e.siteApps);try{var u=function(){var e=a.value,t=e.id,r=e.url,i=n.instance.requestRouter.endpointFor("api",r);ln["__$$ph_site_app_".concat(t)]=n.instance,Rn(i,(function(e){e&&fn.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(s.s();!(a=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}else e.siteApps.length>0&&fn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),e}(),Qo=["source"],Xo=null!=Jt&&Jt.location?On(Jt.location.hash,"__posthog")||On(location.hash,"state"):null,ea=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"afterDecideResponse",value:function(e){var n=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&n.toolbarVersion&&0===n.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(t({},n))}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Jt||!rn)return!1;n=null!==(e=n)&&void 0!==e?e:Jt.location,i=null!==(t=i)&&void 0!==t?t:Jt.history;try{if(!r){try{Jt.localStorage.setItem("test","test"),Jt.localStorage.removeItem("test")}catch(e){return!1}r=null==Jt?void 0:Jt.localStorage}var o,a=Xo||On(n.hash,"__posthog")||On(n.hash,"state"),s=a?In((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||In((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState("",rn.title,n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var n=this;if(!Jt||ln._postHogToolbarLoaded)return!1;ln._postHogToolbarLoaded=!0;var r=3e5,i=Math.floor(Date.now()/r)*r,o=this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(i)),a="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},a?{instrument:!1}:{});s.source;var u=l(s,Qo);return Jt.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),Rn(o,(function(e){e?fn.error("Failed to load toolbar",e):(ln.ph_load_toolbar||ln.ph_load_editor)(s,n.instance)})),An(Jt,"turbolinks:load",(function(){ln._postHogToolbarLoaded=!1,n.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]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),ta=function(){function e(t){a(this,e),c(this,"isPaused",!0),c(this,"queue",[]),c(this,"flushTimeoutMs",3e3),this.sendRequest=t}return u(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},r=Object.values(n);[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(n){e.sendRequest(t(t({},n),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&qt(r.data)&&vn(r.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return vn(this.queue,(function(n){var r,i=n,o=(i?i.batchKey:null)||i.url;Ht(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}]),e}(),na=Uint8Array,ra=Uint16Array,ia=Uint32Array,oa=new na([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]),aa=new na([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]),sa=new na([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ua=function(e,t){for(var n=new ra(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ia(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},ca=ua(oa,2),la=ca[0],da=ca[1];la[28]=258,da[258]=28;for(var fa=ua(aa,0)[1],pa=new ra(32768),ha=0;ha<32768;++ha){var ga=(43690&ha)>>>1|(21845&ha)<<1;ga=(61680&(ga=(52428&ga)>>>2|(13107&ga)<<2))>>>4|(3855&ga)<<4,pa[ha]=((65280&ga)>>>8|(255&ga)<<8)>>>1}var va=function(e,t,n){for(var r=e.length,i=0,o=new ra(t);i<r;++i)++o[e[i]-1];var a,s=new ra(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new ra(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],l=t-e[i],d=s[e[i]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)a[pa[d]>>>u]=c}else for(a=new ra(r),i=0;i<r;++i)a[i]=pa[s[e[i]-1]++]>>>15-e[i];return a},ma=new na(288);for(ha=0;ha<144;++ha)ma[ha]=8;for(ha=144;ha<256;++ha)ma[ha]=9;for(ha=256;ha<280;++ha)ma[ha]=7;for(ha=280;ha<288;++ha)ma[ha]=8;var ya=new na(32);for(ha=0;ha<32;++ha)ya[ha]=5;var _a=va(ma,9,0),ba=va(ya,5,0),Ia=function(e){return(e/8>>0)+(7&e&&1)},wa=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ra?ra:e instanceof ia?ia:na)(n-t);return r.set(e.subarray(t,n)),r},ka=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Ca=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},Sa=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new na(0),0];if(1==i){var a=new na(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!=i-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 f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new ra(f+1),h=Aa(n[l-1],p,0);if(h>t){r=0;var g=0,v=h-t,m=1<<v;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(p[y]>t))break;g+=m-(1<<h-p[y]),p[y]=t}for(g>>>=v;g>0;){var _=o[r].s;p[_]<t?g-=1<<t-p[_]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;p[b]==t&&(--p[b],++g)}h=t}return[new na(p),h]},Aa=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},Ra=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ra(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},Fa=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ea=function(e,t,n){var r=n.length,i=Ia(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Ta=function(e,t,n,r,i,o,a,s,u,c,l){ka(t,l++,n),++i[256];for(var d=Sa(i,15),f=d[0],p=d[1],h=Sa(o,15),g=h[0],v=h[1],m=Ra(f),y=m[0],_=m[1],b=Ra(g),I=b[0],w=b[1],k=new ra(19),C=0;C<y.length;++C)k[31&y[C]]++;for(C=0;C<I.length;++C)k[31&I[C]]++;for(var S=Sa(k,7),A=S[0],R=S[1],F=19;F>4&&!A[sa[F-1]];--F);var E,T,x,M,O=c+5<<3,N=Fa(i,ma)+Fa(o,ya)+a,L=Fa(i,f)+Fa(o,g)+a+14+3*F+Fa(k,A)+(2*k[16]+3*k[17]+7*k[18]);if(O<=N&&O<=L)return Ea(t,l,e.subarray(u,u+c));if(ka(t,l,1+(L<N)),l+=2,L<N){E=va(f,p,0),T=f,x=va(g,v,0),M=g;var D=va(A,R,0);ka(t,l,_-257),ka(t,l+5,w-1),ka(t,l+10,F-4),l+=14;for(C=0;C<F;++C)ka(t,l+3*C,A[sa[C]]);l+=3*F;for(var P=[y,I],B=0;B<2;++B){var q=P[B];for(C=0;C<q.length;++C){var W=31&q[C];ka(t,l,D[W]),l+=A[W],W>15&&(ka(t,l,q[C]>>>5&127),l+=q[C]>>>12)}}}else E=_a,T=ma,x=ba,M=ya;for(C=0;C<s;++C)if(r[C]>255){W=r[C]>>>18&31;Ca(t,l,E[W+257]),l+=T[W+257],W>7&&(ka(t,l,r[C]>>>23&31),l+=oa[W]);var V=31&r[C];Ca(t,l,x[V]),l+=M[V],V>3&&(Ca(t,l,r[C]>>>5&8191),l+=aa[V])}else Ca(t,l,E[r[C]]),l+=T[r[C]];return Ca(t,l,E[256]),l+T[256]},xa=new ia([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ma=new na(0),Oa=function(){for(var e=new ia(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Na=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new na(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),c=0;if(!t||a<8)for(var l=0;l<=a;l+=65535){var d=l+65535;d<a?c=Ea(u,c,e.subarray(l,d)):(u[l]=o,c=Ea(u,c,e.subarray(l,a)))}else{for(var f=xa[t-1],p=f>>>13,h=8191&f,g=(1<<n)-1,v=new ra(32768),m=new ra(g+1),y=Math.ceil(n/3),_=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<_)&g},I=new ia(25e3),w=new ra(288),k=new ra(32),C=0,S=0,A=(l=0,0),R=0,F=0;l<a;++l){var E=b(l),T=32767&l,x=m[E];if(v[T]=x,m[E]=T,R<=l){var M=a-l;if((C>7e3||A>24576)&&M>423){c=Ta(e,u,0,I,w,k,S,A,F,l-F,c),A=C=S=0,F=l;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)k[O]=0}var N=2,L=0,D=h,P=T-x&32767;if(M>2&&E==b(l-P))for(var B=Math.min(p,M)-1,q=Math.min(32767,l),W=Math.min(258,M);P<=q&&--D&&T!=x;){if(e[l+N]==e[l+N-P]){for(var V=0;V<W&&e[l+V]==e[l+V-P];++V);if(V>N){if(N=V,L=P,V>B)break;var H=Math.min(P,V-2),G=0;for(O=0;O<H;++O){var U=l-P+O+32768&32767,j=U-v[U]+32768&32767;j>G&&(G=j,x=U)}}}P+=(T=x)-(x=v[T])+32768&32767}if(L){I[A++]=268435456|da[N]<<18|fa[L];var $=31&da[N],Z=31&fa[L];S+=oa[$]+aa[Z],++w[257+$],++k[Z],R=l+N,++C}else I[A++]=e[l],++w[e[l]]}}c=Ta(e,u,o,I,w,k,S,A,F,l-F,c),o||(c=Ea(u,c,Ma))}return wa(s,0,r+Ia(c)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},La=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Da(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=Oa[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o=Na(e,t,10+((i=t).filename&&i.filename.length+1||0),8),a=o.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&&La(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)}}(o,t),La(o,a-8,n.d()),La(o,a-4,r),o}var Pa=!!sn||!!an,Ba="text/plain",qa=function(e,n){var r=d(e.split("?"),2),i=r[0],o=r[1],a=t({},n);null==o||o.split("&").forEach((function(e){var t=d(e.split("="),1)[0];delete a[t]}));var s=xn(a);return s=s?(o?o+"&":"")+s:o,"".concat(i,"?").concat(s)},Wa=function(e){return"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))},Va=function(e){var t=e.data,n=e.compression;if(t){if(n===ei.GZipJS){var r=Da(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new na(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new na(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return wa(r,0,i)}(JSON.stringify(t)),{mtime:0});return{contentType:Ba,body:new Blob([r],{type:Ba})}}if(n===ei.Base64){var i=function(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",l=[];if(!e)return e;e=Sn(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}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}(JSON.stringify(t));return{contentType:"application/x-www-form-urlencoded",body:Wa(i)}}return{contentType:"application/json",body:JSON.stringify(t)}}},Ha=function(e){var t,n=new sn;n.open(e.method||"GET",e.url,!0);var r=null!==(t=Va(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;vn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)},Ga=function(e){var t,n,r=null!==(t=Va(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,a=new Headers;vn(a,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var s=e.url,u=null;if(un){var c=new un;u={signal:c.signal,timeout:setTimeout((function(){return c.abort()}),e.timeout)}}an(s,{method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method,body:o,signal:null===(n=u)||void 0===n?void 0:n.signal}).then((function(t){return t.text().then((function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){fn.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)}))})).catch((function(t){var n;fn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return u?clearTimeout(u.timeout):null}))},Ua=function(e){var t=qa(e.url,{beacon:"1"});try{var n,r=null!==(n=Va(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,a="string"==typeof o?new Blob([o],{type:i}):o;nn.sendBeacon(t,a)}catch(e){}},ja=function(e){var t;if(rn){var n=rn.createElement("script");n.type="text/javascript",n.async=!0,n.defer=!0,n.src=e.url;var r=rn.getElementsByTagName("script")[0];null===(t=r.parentNode)||void 0===t||t.insertBefore(n,r)}},$a=["retriesPerformedSoFar"];var Za,Ka=function(){function e(t){var n=this;a(this,e),c(this,"isPolling",!1),c(this,"pollIntervalMs",3e3),c(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Ht(Jt)&&"onLine"in Jt.navigator&&(this.areWeOnline=Jt.navigator.onLine,Jt.addEventListener("online",(function(){n.areWeOnline=!0,n.flush()})),Jt.addEventListener("offline",(function(){n.areWeOnline=!1})))}return u(e,[{key:"retriableRequest",value:function(e){var n=this,r=e.retriesPerformedSoFar,i=l(e,$a);$t(r)&&r>0&&(i.url=qa(i.url,{retry_count:r})),this.instance._send_request(t(t({},i),{},{callback:function(e){var o;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?n.enqueue(t({},i)):null===(o=i.callback)||void 0===o||o.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),fn.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var r,i=g(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=g(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestOptions;try{this.instance._send_request(t(t({},r),{},{transport:"sendBeacon"}))}catch(e){fn.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}}]),e}(),za=1800,Ya=function(){function e(t,n,r,i){a(this,e),c(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||pi,this._windowIdGenerator=i||pi;var o=t.persistence_name||t.token,s=t.session_idle_timeout_seconds||za;if($t(s)?s>za?fn.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):s<60&&fn.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(fn.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),s=za),this._sessionTimeoutMs=1e3*Math.min(Math.max(s,60),za),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=Fi.parse(this._window_id_storage_key),l=Fi.parse(this._primary_window_exists_storage_key);u&&!l?this._windowId=u:Fi.remove(this._window_id_storage_key),Fi.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return Ht(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Fi.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Fi.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Fi.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(c({},Wr,[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[Wr];return qt(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;null==Jt||Jt.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&Fi.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=d(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>864e5,u=!1,c=!i,l=!e&&Math.abs(t-r)>this._sessionTimeoutMs;c||l||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),fn.info("[SessionId] new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:c,activityTimeout:l,sessionPastMaximumLength:s}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=0===r||!e||s?t:r,p=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,f,p),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:p}}}]),e}();!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Za||(Za={}));var Ja=function(){function e(t){a(this,e),c(this,"_regionCache",{}),this.instance=t}return u(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e;return null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"")}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Za.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Za.EU:this._regionCache[this.apiHost]=Za.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost)+t;if(this.region===Za.CUSTOM)return this.apiHost+t;var n="i.posthog.com"+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}]),e}(),Qa=u((function e(t,n,r,i){a(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var o,a,s,u,c;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var l=t.requestRouter.endpointFor("ui","/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=l,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var d=(null===(o=e.exception)||void 0===o?void 0:o.values)||[],f={$exception_message:null===(a=d[0])||void 0===a?void 0:a.value,$exception_type:null===(s=d[0])||void 0===s?void 0:s.type,$exception_personURL:l,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(u=d[0])||void 0===u?void 0:u.value,$sentry_exception_type:null===(c=d[0])||void 0===c?void 0:c.type,$sentry_tags:e.tags};return n&&r&&(f.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",f),e}))}})),Xa=function(){function e(t){var n=this;a(this,e),c(this,"_hasSeenPageView",!1),c(this,"_updateScrollData",(function(){var e,t,r,i;n._pageViewData||(n._pageViewData=n._createPageViewData());var o=n._pageViewData,a=n._scrollY(),s=n._scrollHeight(),u=n._contentY(),c=n._contentHeight();o.lastScrollY=a,o.maxScrollY=Math.max(a,null!==(e=o.maxScrollY)&&void 0!==e?e:0),o.maxScrollHeight=Math.max(s,null!==(t=o.maxScrollHeight)&&void 0!==t?t:0),o.lastContentY=u,o.maxContentY=Math.max(u,null!==(r=o.maxContentY)&&void 0!==r?r:0),o.maxContentHeight=Math.max(c,null!==(i=o.maxContentHeight)&&void 0!==i?i:0)})),this._instance=t}return u(e,[{key:"_createPageViewData",value:function(){var e;return{pathname:null!==(e=null==Jt?void 0:Jt.location.pathname)&&void 0!==e?e:""}}},{key:"doPageView",value:function(){var e,n;return this._hasSeenPageView?(n=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,n=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),t({$prev_pageview_pathname:null===(e=n)||void 0===e?void 0:e.pathname},this._calculatePrevPageScrollProperties(n))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return t({$prev_pageview_pathname:null==e?void 0:e.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||null==e.maxScrollHeight||null==e.lastScrollY||null==e.maxScrollY||null==e.maxContentHeight||null==e.lastContentY||null==e.maxContentY)return{};var t=e.maxScrollHeight,n=e.lastScrollY,r=e.maxScrollY,i=e.maxContentHeight,o=e.lastContentY,a=e.maxContentY;return t=Math.ceil(t),n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),a=Math.ceil(a),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:t<=1?1:es(n/t,0,1),$prev_pageview_max_scroll:r,$prev_pageview_max_scroll_percentage:t<=1?1:es(r/t,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:i<=1?1:es(o/i,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:i<=1?1:es(a/i,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){null==Jt||Jt.addEventListener("scroll",this._updateScrollData,!0),null==Jt||Jt.addEventListener("scrollend",this._updateScrollData,!0),null==Jt||Jt.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){null==Jt||Jt.removeEventListener("scroll",this._updateScrollData),null==Jt||Jt.removeEventListener("scrollend",this._updateScrollData),null==Jt||Jt.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollElement",value:function(){if(!this._instance.config.scroll_root_selector)return null==Jt?void 0:Jt.document.documentElement;var e,t=g(qt(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==Jt?void 0:Jt.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"_scrollHeight",value:function(){var e=this._scrollElement();return e?Math.max(0,e.scrollHeight-e.clientHeight):0}},{key:"_scrollY",value:function(){if(this._instance.config.scroll_root_selector){var e=this._scrollElement();return e&&e.scrollTop||0}return Jt&&(Jt.scrollY||Jt.pageYOffset||Jt.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){var e=this._scrollElement();return(null==e?void 0:e.scrollHeight)||0}},{key:"_contentY",value:function(){var e=this._scrollElement(),t=(null==e?void 0:e.clientHeight)||0;return this._scrollY()+t}}]),e}();function es(e,t,n){return Math.max(t,Math.min(e,n))}var ts={icontains:function(e){return!!Jt&&Jt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return!!Jt&&Tn(Jt.location.href,e)},exact:function(e){return(null==Jt?void 0:Jt.location.href)===e}},ns=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property($r);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){var r;if(200!==n.statusCode||!n.json)return e([]);var i=n.json.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(c({},$r,i)),e(i)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||ts[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==rn?void 0:rn.querySelector(e.conditions.selector));return o&&a})).filter((function(e){if(!e.linked_flag_key&&!e.targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key);return n&&r}));return e(r)}),n)}}]),e}(),rs=function(){function e(){var t=this;a(this,e),c(this,"limits",{}),c(this,"checkForLimiting",(function(e){var n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((function(e){fn.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),t.limits[e]=(new Date).getTime()+6e4}))}catch(e){return void fn.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:n})}}))}return u(e,[{key:"isRateLimited",value:function(e){var t=this.limits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),is=function(){return t({initialPathName:(null==on?void 0:on.pathname)||"",referringDomain:Ao.referringDomain()},Ao.campaignParams())},os=function(){function e(t,n,r){var i=this;a(this,e),c(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(c({},Yr,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||is,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Yr]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),as=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],ss=function(e,t){if(!e)return!1;var n=e.toLowerCase();return as.concat(t||[]).some((function(e){var t=e.toLowerCase();return n.includes?n.includes(t):-1!==n.indexOf(t)}))},us={},cs=function(){},ls="posthog",ds=!Pa&&-1===(null==cn?void 0:cn.indexOf("MSIE"))&&-1===(null==cn?void 0:cn.indexOf("Mozilla")),fs=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==rn?void 0:rn.location,n=null==t?void 0:t.hostname,!!Gt(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:cs,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!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==Jt||null===(e=Jt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;fn.error(t)},get_device_id:function(e){return e},_onCapture:cs,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},ps=function(){function e(){a(this,e),c(this,"__forceAllowLocalhost",!1)}return u(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){fn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),hs=function(){function e(){var t=this;a(this,e),c(this,"webPerformance",new ps),this.config=fs(),this.decideEndpointWasHit=!1,this.SentryIntegration=Qa,this.segmentIntegration=function(){return function(e){Promise&&Promise.resolve||fn.warn("This browser does not have Promise support, and can not use the segment integration");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")}}}(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new ai(this),this.toolbar=new ea(this),this.pageViewManager=new Xa(this),this.surveys=new ns(this),this.rateLimiter=new rs,this.requestRouter=new Ja(this),this.people={set:function(e,n,r){var i=Gt(e)?c({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=Gt(e)?c({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}}}return u(e,[{key:"init",value:function(t,n,r){if(r&&r!==ls){var i,o=null!==(i=us[r])&&void 0!==i?i:new e;return o._init(t,n,r),us[r]=o,us[ls][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var n,r,i,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(Ht(e)||function(e){return Gt(e)&&0===e.trim().length}(e))fn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()");else{if(!this.__loaded){var u;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],a.request_headers=a.request_headers||a.xhr_headers,this.set_config(mn({},fs(),a,{name:s,token:e})),null!=Jt&&null!==(n=Jt.rrweb)&&void 0!==n&&n.record||null!=Jt&&Jt.rrwebRecord)this.__loaded_recorder_version=null==Jt||null===(u=Jt.rrweb)||void 0===u?void 0:u.version;if(this.compression=a.disable_compression?void 0:ei.Base64,this.persistence=new Fo(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Fo(t(t({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new ta((function(e){return o._send_request(e)})),this._retryQueue=new Ka(this),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Ya(this.config,this.persistence),this.sessionPropsManager=new os(this.sessionManager,this.persistence),this.sessionRecording=new Yo(this),this.sessionRecording.startRecordingIfEnabled(),this.config.disable_scroll_properties||this.pageViewManager.startMeasuringScrollPosition(),this.__autocapture=this.config.autocapture,ti._setIsAutocaptureEnabled(this),ti._isAutocaptureEnabled){this.__autocapture=this.config.autocapture;ti.enabledForProject(this.config.token,100,100)?ti.isBrowserSupported()?ti.init(this):(this.__autocapture=!1,fn.info("Disabling Automatic Event Collection because this browser is not supported")):(this.__autocapture=!1,fn.info("Not in active bucket: disabling Automatic Event Collection."))}if(Yt.DEBUG=Yt.DEBUG||this.config.debug,this._gdpr_init(),a.segment&&(this.config.get_device_id=function(){return a.segment.user().anonymousId()},a.segment.user().id()&&(this.register({distinct_id:a.segment.user().id()}),this.persistence.set_user_state("identified"))),void 0!==(null===(r=a.bootstrap)||void 0===r?void 0:r.distinctID)){var c,l,d=this.config.get_device_id(pi()),f=null!==(c=a.bootstrap)&&void 0!==c&&c.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_user_state(null!==(l=a.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var p,h,g=Object.keys((null===(p=a.bootstrap)||void 0===p?void 0:p.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=a.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=a.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),v=Object.keys((null===(h=a.bootstrap)||void 0===h?void 0:h.featureFlagPayloads)||{}).filter((function(e){return g[e]})).reduce((function(e,t){var n,r,i,o;null!==(n=a.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=a.bootstrap)||void 0===i||null===(o=i.featureFlagPayloads)||void 0===o?void 0:o[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:v})}if(!this.get_distinct_id()){var m=this.config.get_device_id(pi());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_user_state("anonymous")}return null==Jt||null===(i=Jt.addEventListener)||void 0===i||i.call(Jt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),a.segment?a.segment.register(this.segmentIntegration()).then((function(){o._loaded()})):this._loaded(),this}fn.warn("You have already initialized PostHog! Re-initialising is a no-op")}}},{key:"_afterDecideResponse",value:function(e){var t;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=yn(e.supportedCompression,ei.GZipJS)?ei.GZipJS:yn(e.supportedCompression,ei.Base64)?ei.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){fn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){rn&&e.capture("$pageview",{title:rn.title},{send_instantly:!0})}),1),t||(new Jo(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||gn(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var n=this;this.__loaded&&(ds?this.__request_queue.push(e):this.rateLimiter.isRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=qa(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var n=t({},e);n.timeout=n.timeout||6e4,n.url=qa(n.url,{_:(new Date).getTime().toString(),ver:Yt.LIB_VERSION,compression:n.compression}),"sendBeacon"===n.transport&&null!=nn&&nn.sendBeacon?Ua(n):"fetch"===n.transport&&an?Ga(n):sn||!rn?Ha(n):ja(n)}(t(t({},e),{},{callback:function(t){var r,i,o;(n.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(o=n.config).on_request_error)||void 0===i||i.call(o,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];gn(e,(function(e){e&&(t=e[0],qt(t)?o.push(e):Wt(e)?e.call(n):qt(e)&&"alias"===t?r.push(e):qt(e)&&-1!==t.indexOf("capture")&&Wt(n[t])?o.push(e):i.push(e))}));var a=function(e,t){gn(e,(function(e){if(qt(e[0])){var n=t;vn(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(i,this),a(o,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,n,r){var i;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return fn.uninitializedWarning("posthog.capture");if(!Go(this))if(!Ht(e)&&Gt(e)){if(!cn||this.config.opt_out_useragent_filter||!ss(cn,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var o={uuid:pi(),event:e,properties:this._calculate_event_properties(e,n||{})};"$identify"===e&&(o.$set=null==r?void 0:r.$set,o.$set_once=null==r?void 0:r.$set_once),(o=Cn(o,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=(null==r?void 0:r.timestamp)||new Date,Ht(null==r?void 0:r.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var a=t(t({},o.properties.$set),o.$set);(function(e){if(Vt(e)){for(var t in e)if(Pt.call(e,t))return!1;return!0}return!1})(a)||this.setPersonPropertiesForFlags(a),fn.info("send",o);var s={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(s):this._requestQueue.enqueue(s),this._invokeCaptureHooks(e,o),o}}else fn.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),vn(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,n){if(!this.persistence||!this.sessionPersistence)return n;var r=this.persistence.remove_event_timer(e),i=t({},n);if(i.token=this.config.token,"$snapshot"===e){var o=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=o.distinct_id,i}var a=Ao.properties();if(this.sessionManager){var s=this.sessionManager.checkAndGetSessionAndWindowId(),u=s.sessionId,c=s.windowId;i.$session_id=u,i.$window_id=c}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var l=this.sessionPropsManager.getSessionProps();i=mn(i,l)}if(!this.config.disable_scroll_properties){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),i=mn(i,d)}if("$pageview"===e&&rn&&(i.title=rn.title),"$performance_event"===e){var p=this.persistence.properties();return i.distinct_id=p.distinct_id,i.$current_url=a.$current_url,i}if(!Ht(r)){var h=(new Date).getTime()-r;i.$duration=parseFloat((h/1e3).toFixed(3))}(cn&&this.config.opt_out_useragent_filter&&(i.$browser_type=ss(cn,this.config.custom_blocked_useragents)?"bot":"browser"),i=mn({},Ao.properties(),this.persistence.properties(),this.sessionPersistence.properties(),i),qt(this.config.property_denylist)&&qt(this.config.property_blacklist))?vn([].concat(f(this.config.property_blacklist),f(this.config.property_denylist)),(function(e){delete i[e]})):fn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;return g&&(i=g(i,e)),i}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(c({},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:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return fn.uninitializedWarning("posthog.identify");if($t(e)&&(e=e.toString(),fn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))fn.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else{var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Or)&&(this.unregister(Or),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Zr))}else fn.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,n,r){if(e&&n){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},c({},e,n))}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(c({},e,r))),i[e]===n||r||this.reloadFeatureFlags()}else fn.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(!this.__loaded)return fn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_user_state("anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(pi());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/replay/"+n);if(null!=e&&e.withTimestamp&&r){var o,a=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);i+="?t=".concat(s)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(Mr)?(fn.critical("Attempting to create alias for existing People user - aborting."),-2):(Ht(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Or,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(fn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var n,r=t({},this.config);if(Vt(e)&&(mn(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),null===(n=this.persistence)||void 0===n||n.update_config(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Fo(t(t({},this.config),{},{persistence:"sessionStorage"})),wi.is_supported()&&"true"===wi.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Yt.DEBUG=!0),this.sessionRecording&&!Ht(e.disable_session_recording))){var i=r.disable_session_recording!==e.disable_session_recording,o=!Go(this)&&!e.disable_session_recording&&!this.sessionRecording.started;(i||o)&&(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_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:ls;return t!==ls&&(t=ls+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.config.opt_out_capturing_persistence_type&&wi.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.config.opt_out_capturing_by_default&&!bi.get("ph_optout")||(bi.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var t,n,r,i,o;if(e&&e.clear_persistence)r=!0;else{if(!e||!e.enable_persistence)return;r=!1}this.config.disable_persistence||(null===(t=this.persistence)||void 0===t?void 0:t.disabled)===r||(null===(i=this.persistence)||void 0===i||i.set_disabled(r));this.config.disable_persistence||(null===(n=this.sessionPersistence)||void 0===n?void 0:n.disabled)===r||(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(r))}},{key:"_gdpr_call_func",value:function(e,t){return t=mn({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},t||{}),wi.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.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=mn({enable_persistence:!0},e||{}),this._gdpr_call_func(No,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=mn({clear_persistence:!0},e||{});this._gdpr_call_func(Lo,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Do,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Po,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=mn({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Bo,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(null==Jt||Jt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Jt||Jt.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}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=wn(e.prototype[t[n]])}(hs,["identify"]);var gs,vs;gs=us[ls]=new hs,(vs=ln.posthog)&&vn(vs._i,(function(e){if(e&&qt(e)){var t=gs.init(e[0],e[1],e[2]),n=vs[e[2]]||vs;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),ln.posthog=gs,function(){function e(){e.done||(e.done=!0,ds=!1,vn(us,(function(e){e._dom_loaded()})))}null!=rn&&rn.addEventListener&&("complete"===rn.readyState?e():rn.addEventListener("DOMContentLoaded",e,!1)),Jt&&An(Jt,"load",e,!0)}()}();
|
|
16
|
+
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 i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),yt=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new fe,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},i=[],o=g(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=void 0;if(this.styleMirror.has(a))s=this.styleMirror.getId(a);else{s=this.styleMirror.add(a);var u=Array.from(a.rules||CSSRule);i.push({styleId:s,rules:u.map((function(e,t){return{rule:b(e),index:t}}))})}r.styleIds.push(s)}}catch(e){o.e(e)}finally{o.f()}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),_t=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function bt(e){return Object.assign(Object.assign({},e),{timestamp:te()})}var It=!1,wt=new I;function kt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,a=e.blockSelector,s=void 0===a?null:a,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.ignoreSelector,d=void 0===l?null:l,f=e.maskTextClass,p=void 0===f?"rr-mask":f,h=e.maskTextSelector,v=void 0===h?null:h,m=e.inlineStylesheet,y=void 0===m||m,_=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,C=e.maskTextFn,S=e.hooks,A=e.packFn,R=e.sampling,F=void 0===R?{}:R,E=e.dataURLOptions,T=void 0===E?{}:E,x=e.mousemoveWait,M=e.recordCanvas,O=void 0!==M&&M,N=e.recordCrossOriginIframes,L=void 0!==N&&N,D=e.recordAfter,P=void 0===D?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":D,B=e.userTriggeredOnInput,q=void 0!==B&&B,W=e.collectFonts,V=void 0!==W&&W,H=e.inlineImages,G=void 0!==H&&H,U=e.plugins,j=e.keepIframeSrcFn,$=void 0===j?function(){return!1}:j,Z=e.ignoreCSSAttributes,Y=void 0===Z?new Set([]):Z;xe(e.errorHandler);var J=!L||window.parent===window,Q=!1;if(!J)try{window.parent.document&&(Q=!1)}catch(e){Q=!0}if(J&&!t)throw new Error("emit function is required");void 0!==x&&void 0===F.mousemove&&(F.mousemove=x),wt.reset();var X,ee=!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}:void 0!==b?b:{password:!0},te=!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(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===i)return!0}while(i=i&&i.parentNode);return!1})}();var oe=0,ae=function(e){var t,n=g(U||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return A&&!Q&&(e=A(e)),e};pt=function(e,i){var o;if(!(null===(o=Ne[0])||void 0===o?void 0:o.isFrozen())||e.type===ve.FullSnapshot||e.type===ve.IncrementalSnapshot&&e.data.source===me.Mutation||Ne.forEach((function(e){return e.unfreeze()})),J)null==t||t(ae(e),i);else if(Q){var a={type:"rrweb",event:ae(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(e.type===ve.FullSnapshot)X=e,oe=0;else if(e.type===ve.IncrementalSnapshot){if(e.data.source===me.Mutation&&e.data.isAttachIframe)return;oe++;var s=r&&oe>=r,u=n&&e.timestamp-X.timestamp>n;(s||u)&&ht(!0)}};var se,ue=function(e){pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Mutation},e)}))},fe=function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Scroll},e)}))},pe=function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.CanvasMutation},e)}))},he=new yt({mutationCb:ue,adoptedStyleSheetCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.AdoptedStyleSheet},e)}))}}),ge=new ze({mirror:wt,mutationCb:ue,stylesheetManager:he,recordCrossOriginIframes:L,wrappedEmit:pt}),ye=g(U||[]);try{for(ye.s();!(se=ye.n()).done;){var _e=se.value;_e.getMirror&&_e.getMirror({nodeMirror:wt,crossOriginIframeMirror:ge.crossOriginIframeMirror,crossOriginIframeStyleMirror:ge.crossOriginIframeStyleMirror})}}catch(e){ye.e(e)}finally{ye.f()}var be=new _t;gt=new mt({recordCanvas:O,mutationCb:pe,win:window,blockClass:o,blockSelector:s,mirror:wt,sampling:F.canvas,dataURLOptions:T});var Ie=new Ye({mutationCb:ue,scrollCb:fe,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:v,inlineStylesheet:y,maskInputOptions:ee,dataURLOptions:T,maskTextFn:C,maskInputFn:k,recordCanvas:O,inlineImages:G,sampling:F,slimDOMOptions:te,iframeManager:ge,stylesheetManager:he,canvasManager:gt,keepIframeSrcFn:$,processedNodeManager:be},mirror:wt});ht=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];pt(bt({type:ve.Meta,data:{href:window.location.href,width:ie(),height:re()}}),e),he.reset(),Ie.init(),Ne.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new I:r,o=n.blockClass,a=void 0===o?"rr-block":o,s=n.blockSelector,u=void 0===s?null:s,c=n.maskTextClass,l=void 0===c?"rr-mask":c,d=n.maskTextSelector,f=void 0===d?null:d,p=n.inlineStylesheet,h=void 0===p||p,g=n.inlineImages,v=void 0!==g&&g,m=n.recordCanvas,y=void 0!==m&&m,_=n.maskAllInputs,b=void 0!==_&&_,w=n.maskTextFn,k=n.maskInputFn,C=n.slimDOM,S=void 0!==C&&C,A=n.dataURLOptions,R=n.preserveWhiteSpace,F=n.onSerialize,E=n.onIframeLoad,T=n.iframeLoadTimeout,x=n.onStylesheetLoad,M=n.stylesheetLoadTimeout,O=n.keepIframeSrcFn;return K(e,{doc:e,mirror:i,blockClass:a,blockSelector:u,maskTextClass:l,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:w,maskInputFn:k,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,dataURLOptions:A,inlineImages:v,recordCanvas:y,preserveWhiteSpace:R,onSerialize:F,onIframeLoad:E,iframeLoadTimeout:T,onStylesheetLoad:x,stylesheetLoadTimeout:M,keepIframeSrcFn:void 0===O?function(){return!1}:O,newlyAddedElement:!1})}(document,{mirror:wt,blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:v,inlineStylesheet:y,maskAllInputs:ee,maskTextFn:C,slimDOM:te,dataURLOptions:T,recordCanvas:O,inlineImages:G,onSerialize:function(e){ce(e,wt)&&ge.addIframe(e),le(e,wt)&&he.trackLinkElement(e),de(e)&&Ie.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ge.attachIframe(e,t),Ie.observeAttachShadow(e)},onStylesheetLoad:function(e,t){he.attachLinkElement(e,t)},keepIframeSrcFn:$});if(!t)return console.warn("Failed to snapshot the document");pt(bt({type:ve.FullSnapshot,data:{node:t,initialOffset:ne(window)}}),e),Ne.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&he.adoptStyleSheets(document.adoptedStyleSheets,wt.getId(document))};try{var we=[],ke=function(e){var t;return Oe(je)({mutationCb:ue,mousemoveCb:function(e,t){return pt(bt({type:ve.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.MouseInteraction},e)}))},scrollCb:fe,viewportResizeCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.ViewportResize},e)}))},inputCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Input},e)}))},mediaInteractionCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.StyleDeclaration},e)}))},canvasMutationCb:pe,fontCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Font},e)}))},selectionCb:function(e){pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Selection},e)}))},blockClass:o,ignoreClass:c,ignoreSelector:d,maskTextClass:p,maskTextSelector:v,maskInputOptions:ee,inlineStylesheet:y,sampling:F,recordCanvas:O,inlineImages:G,userTriggeredOnInput:q,collectFonts:V,doc:e,maskInputFn:k,maskTextFn:C,keepIframeSrcFn:$,blockSelector:s,slimDOMOptions:te,dataURLOptions:T,mirror:wt,iframeManager:ge,stylesheetManager:he,shadowDomManager:Ie,processedNodeManager:be,canvasManager:gt,ignoreCSSAttributes:Y,plugins:(null===(t=null==U?void 0:U.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return pt(bt({type:ve.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};ge.addLoadListener((function(e){try{we.push(ke(e.contentDocument))}catch(e){console.warn(e)}}));var Ce=function(){ht(),we.push(ke(document)),It=!0};return"interactive"===document.readyState||"complete"===document.readyState?Ce():(we.push(z("DOMContentLoaded",(function(){pt(bt({type:ve.DomContentLoaded,data:{}})),"DOMContentLoaded"===P&&Ce()}))),we.push(z("load",(function(){pt(bt({type:ve.Load,data:{}})),"load"===P&&Ce()}),window))),function(){we.forEach((function(e){return e()})),be.destroy(),It=!1,Me()}}catch(e){console.warn(e)}}kt.addCustomEvent=function(e,t){if(!It)throw new Error("please add custom event after start recording");pt(bt({type:ve.Custom,data:{tag:e,payload:t}}))},kt.freezePage=function(){Ne.forEach((function(e){return e.freeze()}))},kt.takeFullSnapshot=function(e){if(!It)throw new Error("please take full snapshot after start recording");ht(e)},kt.mirror=wt;var Ct=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),St=/(^|@)\S+:\d+/,At=/^\s*at .*(\S+:\d+|\(native\))/m,Rt=/^(eval@)?(\[native code])?$/,Ft={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(At)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},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(At)}),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),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ct({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Rt)}),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 Ct({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ct({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[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=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ct({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=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ct({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(St)&&!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 Ct({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(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,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Tt(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(Tt(e[i])&&xt(e[i],t-1))return!0}return!1}function Mt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Tt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Tt(e)&&xt(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]=Et(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 Ot={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 Nt(e,t,n){var r,i=n?Object.assign({},Ot,n):Ot,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var c=function(t){var n=t.message,r=t.error,o=Ft.parse(r).map((function(e){return e.toString()})),a=[Mt(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Mt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Mt("Uncaught (in promise)",i.stringifyOptions),Mt(t.reason,i.stringifyOptions)]);var o=Ft.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,f=g(i.level);try{for(f.s();!(d=f.n()).done;){var p=d.value;u.push(h(r,p))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?ee(t,n,(function(t){return function(){for(var o=arguments.length,u=new Array(o),c=0;c<o;c++)u[c]=arguments[c];if(t.apply(r,u),!s){s=!0;try{var l=Ft.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Mt(e,i.stringifyOptions)}));++a<i.lengthThreshold?e({level:n,trace:l,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Mt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Lt=Array.isArray,Dt=Object.prototype,Pt=Dt.hasOwnProperty,Bt=Dt.toString,qt=Lt||function(e){return"[object Array]"===Bt.call(e)},Wt=function(e){return"function"==typeof e},Vt=function(e){return e===Object(e)&&!qt(e)},Ht=function(e){return void 0===e},Gt=function(e){return"[object String]"==Bt.call(e)},Ut=function(e){return null===e},jt=function(e){return Ht(e)||Ut(e)},$t=function(e){return"[object Number]"==Bt.call(e)},Zt=function(e){return"[object Boolean]"===Bt.call(e)},Kt=function(e){return e instanceof Document},zt=function(e){return e instanceof FormData},Yt={DEBUG:!1,LIB_VERSION:"1.116.0"},Jt="undefined"!=typeof window?window:void 0,Qt="undefined"!=typeof globalThis?globalThis:Jt,Xt=Array.prototype,en=Xt.forEach,tn=Xt.indexOf,nn=null==Qt?void 0:Qt.navigator,rn=null==Qt?void 0:Qt.document,on=null==Qt?void 0:Qt.location,an=null==Qt?void 0:Qt.fetch,sn=null!=Qt&&Qt.XMLHttpRequest&&"withCredentials"in new Qt.XMLHttpRequest?Qt.XMLHttpRequest:void 0,un=null==Qt?void 0:Qt.AbortController,cn=null==nn?void 0:nn.userAgent,ln=null!=Jt?Jt:{},dn="[PostHog.js]",fn={_log:function(e){if(Jt&&(Yt.DEBUG||ln.POSTHOG_DEBUG)&&!Ht(Jt.console)&&Jt.console){for(var t=("__rrweb_original__"in Jt.console[e]?Jt.console[e].__rrweb_original__:Jt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[dn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[dn].concat(n))},uninitializedWarning:function(e){fn.error("You must initialize PostHog before calling ".concat(e))}},pn={},hn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function gn(e,t,n){if(qt(e))if(en&&e.forEach===en)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===pn)return}function vn(e,t,n){if(!jt(e)){if(qt(e))return gn(e,t,n);if(zt(e)){var r,i=g(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===pn)return}}catch(e){i.e(e)}finally{i.f()}}else for(var a in e)if(Pt.call(e,a)&&t.call(n,e[a],a)===pn)return}}var mn=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 gn(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function yn(e,t){return-1!==e.indexOf(t)}function _n(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var bn=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},In=function(e){try{return e()}catch(e){return}},wn=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){fn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),fn.critical(e)}}},kn=function(e){var t={};return vn(e,(function(e,n){Gt(e)&&e.length>0&&(t[n]=e)})),t};function Cn(e,t){return n=e,r=function(e){return Gt(e)&&!Ut(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),qt(t)?(o=[],gn(t,(function(t){o.push(e(t))}))):(o={},vn(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var Sn=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),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),Ut(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},An=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==Jt?void 0:Jt.event)){var o,a=!0;Wt(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else fn.error("No valid element provided to register_event")}}();function Rn(e,t){var n=function(){if(!rn)return t("document not found");var n=rn.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=rn.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):rn.body.appendChild(n)};null!=rn&&rn.body?n():null==rn||rn.addEventListener("DOMContentLoaded",n)}var Fn=["localhost","127.0.0.1"],En=function(e){var t=null==rn?void 0:rn.createElement("a");return Ht(t)?null:(t.href=e,t)},Tn=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},xn=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return vn(e,(function(e,r){Ht(e)||Ht(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Mn=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!qt(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){fn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},On=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function Nn(e){return e?hn(e).split(/\s+/):[]}function Ln(e){var t="";switch(r(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Nn(t)}function Dn(e){return jt(e)?null:hn(e).split(/(\s+)/).filter((function(e){return Xn(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Pn(e){var t="";return jn(e)&&!$n(e)&&e.childNodes&&e.childNodes.length&&vn(e.childNodes,(function(e){var n;Wn(e)&&e.textContent&&(t+=null!==(n=Dn(e.textContent))&&void 0!==n?n:"")})),hn(t)}function Bn(e){return!!e&&1===e.nodeType}function qn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Wn(e){return!!e&&3===e.nodeType}function Vn(e){return!!e&&11===e.nodeType}var Hn=["a","button","form","input","select","textarea","label"];function Gn(e){var t=e.parentNode;return!(!t||!Bn(t))&&t}function Un(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!Jt||!e||qn(e,"html")||!Bn(e))return!1;if(null!=n&&n.url_allowlist){var a=Jt.location.href,s=n.url_allowlist;if(s&&!s.some((function(e){return a.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((function(e){return t.type===e})))return!1}for(var c=!1,l=[e],d=!0,f=e;f.parentNode&&!qn(f,"body");)if(Vn(f.parentNode))l.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=Gn(f)))break;if(i||Hn.indexOf(d.tagName.toLowerCase())>-1)c=!0;else{var p=Jt.getComputedStyle(d);p&&"pointer"===p.getPropertyValue("cursor")&&(c=!0)}l.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Ht(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(l,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Ht(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(l,n))return!1;var h=Jt.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return c?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&(Hn.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}function jn(e){for(var t=e;t.parentNode&&!qn(t,"body");t=t.parentNode){var n=Ln(t);if(yn(n,"ph-sensitive")||yn(n,"ph-no-capture"))return!1}if(yn(Ln(e),"ph-include"))return!0;var r=e.type||"";if(Gt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Gt(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function $n(e){return!!(qn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||qn(e,"select")||qn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Zn="(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})",Kn=new RegExp("^(?:".concat(Zn,")$")),zn=new RegExp(Zn),Yn="\\d{3}-?\\d{2}-?\\d{4}",Jn=new RegExp("^(".concat(Yn,")$")),Qn=new RegExp("(".concat(Yn,")"));function Xn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(jt(e))return!1;if(Gt(e)){if(e=hn(e),(t?Kn:zn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Jn:Qn).test(e))return!1}return!0}function er(e){var t=Pn(e);return Xn(t="".concat(t," ").concat(tr(e)).trim())?t:""}function tr(e){var t="";return e&&e.childNodes&&e.childNodes.length&&vn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Pn(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(tr(e)).trim())}catch(e){fn.error(e)}})),t}function nr(e){return function(e){var n=e.map((function(e){var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var o,a=g(e.attr_class);try{for(a.s();!(o=a.n()).done;){var s=o.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){a.e(e)}finally{a.f()}}var u=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),c={};return _n(u).sort((function(e,t){var n=d(e,1)[0],r=d(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];return c[rr(n.toString())]=rr(r.toString())})),i+=":",i+=_n(u).map((function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return n.join(";")}(function(e){return e.map((function(e){var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:ir(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return _n(e).filter((function(e){return 0===d(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=d(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function rr(e){return e.replace(/"|\\"/g,'\\"')}function ir(e){var t=e.attr__class;return t?qt(t)?t:Nn(t):void 0}var or="[SessionRecording]",ar={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},sr=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],ur=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],cr=["/s/","/e/","/i/"];function lr(e,t,n,r){if(jt(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Gt(i)&&(i=parseInt(i)),i>n?or+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function dr(e,t){if(jt(e))return e;var n=e;return Xn(n,!1)||(n=or+" "+t+" body redacted"),vn(ur,(function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=or+" "+t+" body redacted as might contain: "+e)})),n}var fr=function(e,n){var r,i,o,a=e.session_recording,s=!1!==a.recordHeaders&&n.recordHeaders,u=!1!==a.recordBody&&n.recordBody,c=!1!==a.recordPerformance&&n.recordPerformance,l=(r=a,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=lr(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=lr(e.responseBody,e.responseHeaders,o,"Response")),e}),d=function(e){return l(function(e){var t=En(e.name);if(!(t&&t.pathname&&cr.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((t=e,vn(Object.keys(null!==(n=t.requestHeaders)&&void 0!==n?n:{}),(function(e){var n;sr.includes(e.toLowerCase())&&(null===(n=t.requestHeaders)||void 0===n||delete n[e])})),t)));var t,n},f=Wt(e.session_recording.maskNetworkRequestFn);return f&&Wt(e.session_recording.maskCapturedNetworkRequestFn)&&fn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),f&&(e.session_recording.maskCapturedNetworkRequestFn=function(n){var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),a.maskRequestFn=Wt(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:function(e){return function(e){if(!Ht(e))return e.requestBody=dr(e.requestBody,"Request"),e.responseBody=dr(e.responseBody,"Response"),e}(d(e))},t(t(t({},ar),a),{},{recordHeaders:s,recordBody:u,recordPerformance:c,recordInitialRequests:c})},pr=function(e){return"navigation"===e.entryType},hr=function(e){return"resource"===e.entryType};function gr(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return Wt(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function vr(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function mr(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return pr(e)||hr(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return Cr(e,void 0,void 0,{},!0)})),isInitial:!0})}var i=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return pr(e)||hr(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return Cr(e,void 0,void 0,{})}))})})),o=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return i.observe({entryTypes:o}),function(){i.disconnect()}}function yr(e,t){return!!t&&(Zt(t)||t[e])}function _r(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(Zt(t))return!0;if(qt(t))return r(t);var i=t[e];return Zt(i)?i:r(i)}function br(e,t,n,r,i){return Ir.apply(this,arguments)}function Ir(){return Ir=o(n().mark((function e(t,r,i,o,a){var s,u,c,l=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return fn.warn("Failed to get performance entry for request",{url:i,initiatorType:r}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(i),c=vr(u,(function(e){return hr(e)&&e.initiatorType===r&&(!o||e.startTime>=o)&&(!a||e.startTime<=a)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",br(t,r,i,o,a,s+1));case 10:return e.abrupt("return",c);case 11:case"end":return e.stop()}}),e)}))),Ir.apply(this,arguments)}function wr(e){if(jt(e))return null;if(Gt(e))return e;if(Kt(e))return e.textContent;if(zt(e))return xn(e);if(Vt(e))try{return JSON.stringify(e)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var kr=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function Cr(e,n,r,i,o){var a=Math.floor(Date.now()-performance.now()),s=Math.floor(a+e.startTime),u=[t(t({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:a,timestamp:s,method:n,initiatorType:e.initiatorType,status:r,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(kr(e)){var c,l=g(e.serverTiming||[]);try{for(l.s();!(c=l.n()).done;){var d=c.value;u.push({timeOrigin:a,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){l.e(e)}finally{l.f()}}return u}var Sr=["video/","audio/"];function Ar(e){var t;if("chunked"===e.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var n=null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),r=Sr.some((function(e){return null==n?void 0:n.startsWith(e)}));return n&&r?"Content-Type ".concat(n," is not supported"):null}function Rr(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function Fr(e){return Er.apply(this,arguments)}function Er(){return(Er=o(n().mark((function e(t){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Ar(t),Ut(r)){e.next=3;break}return e.abrupt("return",Promise.resolve(r));case 3:return e.abrupt("return",Rr(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tr(e,r,i){if(!("performance"in r))return function(){};var a=i?Object.assign({},ar,i):ar,s=function(n){var r=[];n.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},u=mr(s,r,a),c=function(){},l=function(){};return(a.recordHeaders||a.recordBody)&&(c=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=yr("request",n.recordHeaders),i=yr("response",n.recordHeaders),o=gr(t.XMLHttpRequest.prototype,"open",(function(o){return function(a,s){var u,c,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,p=this,h=new Request(s),g={},v={},m=p.setRequestHeader.bind(p);p.setRequestHeader=function(e,t){return v[e]=t,m(e,t)},r&&(g.requestHeaders=v);var y=p.send.bind(p);p.send=function(e){return _r("request",n.recordBody,v)&&(Ht(e)||Ut(e)?g.requestBody=null:g.requestBody=wr(e)),u=t.performance.now(),y(e)},p.addEventListener("readystatechange",(function(){if(p.readyState===p.DONE){c=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(g.responseHeaders=r),_r("response",n.recordBody,r)&&(jt(p.response)?g.responseBody=null:g.responseBody=wr(p.response)),br(t,"xmlhttprequest",h.url,u,c).then((function(t){if(!Ut(t)){var n=Cr(t,h.method,null==p?void 0:p.status,g);e({requests:n})}})).catch((function(){}))}})),o.call(p,a,s,l,d,f)}}));return function(){o()}}(s,r,a),l=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var i=yr("request",r.recordHeaders),a=yr("response",r.recordHeaders),s=gr(t,"fetch",(function(s){return function(){var u=o(n().mark((function o(u,c){var l,d,f,p,h,g,v;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=new Request(u,c),f={},n.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),i&&(f.requestHeaders=g),!_r("request",r.recordBody,g)){n.next=10;break}return n.next=9,Rr(l);case 9:f.requestBody=n.sent;case 10:return p=t.performance.now(),n.next=13,s(l);case 13:if(d=n.sent,h=t.performance.now(),v={},d.headers.forEach((function(e,t){v[t]=e})),a&&(f.responseHeaders=v),!_r("response",r.recordBody,v)){n.next=22;break}return n.next=21,Fr(d);case 21:f.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,br(t,"fetch",l.url,p,h).then((function(t){var n;if(!Ut(t)){var r=Cr(t,l.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),o,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),function(){u(),c(),l()}}Jt&&(Jt.rrweb={record:kt,version:"v2",rrwebVersion:"2.0.0-alpha.11"},Jt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Nt,options:e}}},Jt.getRecordNetworkPlugin=function(e){return{name:"rrweb/network@1",observer:Tr,options:e}});var xr=function(){function e(t){a(this,e),this.clicks=[],this.enabled=t}return u(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}(),Mr="$people_distinct_id",Or="__alias",Nr="__timers",Lr="$autocapture_disabled_server_side",Dr="$session_recording_enabled_server_side",Pr="$console_log_recording_enabled_server_side",Br="$session_recording_network_payload_capture",qr="$session_recording_canvas_recording",Wr="$sesid",Vr="$session_is_sampled",Hr="$enabled_feature_flags",Gr="$early_access_features",Ur="$stored_person_properties",jr="$stored_group_properties",$r="$surveys",Zr="$flag_call_reported",Kr="$user_state",zr="$posthog_quota_limited",Yr="$client_session_props",Jr=[Mr,Or,"__cmpns",Nr,Dr,Wr,Hr,Kr,zr,Gr,jr,Ur,$r,Zr,Yr],Qr="$copy_autocapture";function Xr(e,t){return t.length>e?t.slice(0,e)+"...":t}var ei,ti={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=Ut(this._isDisabledServerSide)?!(null===(t=e.persistence)||void 0===t||!t.props[Lr]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bn(t));return t},_getAugmentPropertiesFromElement:function(e){if(!jn(e))return{};var t={};return vn(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&Xn(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};Hn.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Xr(1024,er(e)):o.$el_text=Xr(1024,Pn(e)));var a=Ln(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;vn(e.attributes,(function(n){var r;if((!$n(e)||-1!==["name","id","class"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&Xn(n.value)&&(r=n.name,!Gt(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=Nn(i).join(" ")),o["attr__"+n.name]=Xr(1024,i)}}));for(var u=1,c=1,l=e;l=this._previousElementSibling(l);)u++,l.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return vn(null==rn?void 0:rn.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),Xn(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return vn(this._customProperties,(function(r){vn(r.event_selectors,(function(i){vn(null==rn?void 0:rn.querySelectorAll(i),(function(i){yn(e,i)&&jn(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return Ht(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=arguments.length>3?arguments[3]:void 0,a=this._getEventTarget(e);(Wn(a)&&(a=a.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));var s=i===Qr;if(a&&Un(a,e,this.config,s,s?["copy","cut"]:void 0)){for(var u,c,l=[a],d=a;d.parentNode&&!qn(d,"body");)Vn(d.parentNode)?(l.push(d.parentNode.host),d=d.parentNode.host):(l.push(d.parentNode),d=d.parentNode);var f,p=[],h={},g=!1;if(vn(l,(function(e){var n=jn(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=n&&Xn(f)&&f),yn(Ln(e),"ph-no-capture")&&(g=!0),p.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var i=r._getAugmentPropertiesFromElement(e);mn(h,i)})),t.config.mask_all_text||("a"===a.tagName.toLowerCase()||"button"===a.tagName.toLowerCase()?p[0].$el_text=er(a):p[0].$el_text=Pn(a)),f&&(p[0].attr__href=f),g)return!1;var v=mn(this._getDefaultProperties(e.type),t.elementsChainAsString?{$elements_chain:nr(p)}:{$elements:p},null!==(u=p[0])&&void 0!==u&&u.$el_text?{$el_text:null===(c=p[0])||void 0===c?void 0:c.$el_text}:{},this._getCustomProperties(l),h,o||{});if(i===Qr){var m,y=Dn(null==Jt||null===(m=Jt.getSelection())||void 0===m?void 0:m.toString()),_=e.type||"clipboard";if(!y)return!1;v.$selected_content=y,v.$copy_type=_}return t.capture(i,v),!0}},_navigate:function(e){Jt&&(Jt.location.href=e)},_addDomEventHandlers:function(e){var t=this;if(Jt&&rn){var n=function(n){n=n||(null==Jt?void 0:Jt.event),t._captureEvent(n,e)},r=function(n){n=n||(null==Jt?void 0:Jt.event),t._captureEvent(n,e,Qr)};An(rn,"submit",n,!1,!0),An(rn,"change",n,!1,!0),An(rn,"click",n,!1,!0),Vt(e.config.autocapture)&&e.config.autocapture.capture_copied_text&&(An(rn,"copy",r,!1,!0),An(rn,"cut",r,!1,!0))}},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;Zt(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 xr(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?fn.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(c({},Lr,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Ht(t)?10:t,n=Ht(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return Wt(null==rn?void 0:rn.querySelectorAll)}};!function(e){for(var t in e)Wt(e[t])&&(e[t]=e[t].bind(e))}(ti),function(e){for(var t in e)Wt(e[t])&&(e[t]=wn(e[t]))}(ti),function(e){e.GZipJS="gzip-js",e.Base64="base64"}(ei||(ei={}));var ni="$active_feature_flags",ri="$override_feature_flags",ii="$feature_flag_payloads",oi=function(e){var t,n={},r=g(_n(e||{}));try{for(r.s();!(t=r.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},ai=function(){function e(t){a(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Hr),t=this.instance.get_property(ri);if(!t)return e||{};for(var n=mn({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(fn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ii)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(Ur),r=this.instance.get_property(jr),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:ei.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){var n;e.setReloadingPaused(!1);var r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(Zr)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))qt(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(c({},Zr,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}fn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);fn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.featureFlags,s=e.featureFlagPayloads;if(a)if(qt(a)){var u,l={};if(a)for(var d=0;d<a.length;d++)l[a[d]]=!0;n&&n.register((c(u={},ni,a),c(u,Hr,l),u))}else{var f=a,p=s;e.errorsWhileComputingFlags&&(f=t(t({},i),f),p=t(t({},o),p)),n&&n.register((c(r={},ni,Object.keys(oi(f))),c(r,Hr,f||{}),c(r,ii,p||{}),r))}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return fn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ri);else if(qt(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(c({},ri,t))}else this.instance.persistence.register(c({},ri,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=c({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},c({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((c(i={},ni,Object.keys(oi(a))),c(i,Hr,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Gr);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(c({},Gr,i)),e(i)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Ur)||{};this.instance.register(c({},Ur,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Ur)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(jr)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(c({},jr,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(jr)||{};this.instance.register(c({},jr,t(t({},n),{},c({},e,{}))))}else this.instance.unregister(jr)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return $t(e)&&isFinite(e)&&Math.floor(e)===e});var si="0123456789abcdef",ui=function(){function e(t){if(a(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return u(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+si.charAt(this.bytes[t]>>>4)+si.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),ci=function(){function e(){a(this,e),c(this,"timestamp",0),c(this,"counter",0),c(this,"random",new fi)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Ht(e)){this.timestamp=0;var t=this.generateOrAbort();if(Ht(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return ui.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),li=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Jt&&!Ht(Jt.crypto)&&crypto.getRandomValues&&(li=function(e){return crypto.getRandomValues(e)});var di,fi=function(){function e(){a(this,e),c(this,"buffer",new Uint32Array(8)),c(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(li(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),pi=function(){return hi().toString()},hi=function(){return(di||(di=new ci)).generate()},gi="Thu, 01 Jan 1970 00:00:00 GMT",vi="";var mi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function yi(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rn;if(vi)return vi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+pi(),o=new RegExp("(^|;)\\s*"+i+"=1");!vi&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+gi,vi=a)}return vi}(e);if(!n){var r=function(e){var t=e.match(mi);return t?t[0]:""}(e);r!==n&&fn.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var _i,bi={is_supported:function(){return!!rn},error:function(e){fn.error("cookieStore error: "+e)},get:function(e){if(rn){try{for(var t=e+"=",n=rn.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(bi.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(rn)try{var o="",a="",s=yi(rn.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&fn.warn("cookieStore warning: large cookie, len="+c.length),rn.cookie=c,c}catch(e){return}},remove:function(e,t){try{bi.set(e,"",-1,t)}catch(e){return}}},Ii=null,wi={is_supported:function(){if(!Ut(Ii))return Ii;var e=!0;if(Ht(Jt))e=!1;else try{var t="__mplssupport__";wi.set(t,"xyz"),'"xyz"'!==wi.get(t)&&(e=!1),wi.remove(t)}catch(t){e=!1}return e||fn.error("localStorage unsupported; falling back to cookie store"),Ii=e,e},error:function(e){fn.error("localStorage error: "+e)},get:function(e){try{return null==Jt?void 0:Jt.localStorage.getItem(e)}catch(e){wi.error(e)}return null},parse:function(e){try{return JSON.parse(wi.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==Jt||Jt.localStorage.setItem(e,JSON.stringify(t))}catch(e){wi.error(e)}},remove:function(e){try{null==Jt||Jt.localStorage.removeItem(e)}catch(e){wi.error(e)}}},ki=["distinct_id",Wr,Vr],Ci=t(t({},wi),{},{parse:function(e){try{var t={};try{t=bi.parse(e)||{}}catch(e){}var n=mn(t,JSON.parse(wi.get(e)||"{}"));return wi.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{wi.set(e,t);var o={};ki.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&bi.set(e,o,n,r,i)}catch(e){wi.error(e)}},remove:function(e,t){try{null==Jt||Jt.localStorage.removeItem(e),bi.remove(e,t)}catch(e){wi.error(e)}}}),Si={},Ai={is_supported:function(){return!0},error:function(e){fn.error("memoryStorage error: "+e)},get:function(e){return Si[e]||null},parse:function(e){return Si[e]||null},set:function(e,t){Si[e]=t},remove:function(e){delete Si[e]}},Ri=null,Fi={is_supported:function(){if(!Ut(Ri))return Ri;if(Ri=!0,Ht(Jt))Ri=!1;else try{var e="__support__";Fi.set(e,"xyz"),'"xyz"'!==Fi.get(e)&&(Ri=!1),Fi.remove(e)}catch(e){Ri=!1}return Ri},error:function(e){fn.error("sessionStorage error: ",e)},get:function(e){try{return null==Jt?void 0:Jt.sessionStorage.getItem(e)}catch(e){Fi.error(e)}return null},parse:function(e){try{return JSON.parse(Fi.get(e))||null}catch(e){}return null},set:function(e,t){try{null==Jt||Jt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Fi.error(e)}},remove:function(e){try{null==Jt||Jt.sessionStorage.removeItem(e)}catch(e){Fi.error(e)}}},Ei="Mobile",Ti="iOS",xi="Android",Mi="Tablet",Oi=xi+" "+Mi,Ni="iPad",Li="Apple",Di=Li+" Watch",Pi="Safari",Bi="BlackBerry",qi="Samsung",Wi=qi+"Browser",Vi=qi+" Internet",Hi="Chrome",Gi=Hi+" OS",Ui=Hi+" "+Ti,ji="Internet Explorer",$i=ji+" "+Ei,Zi="Opera",Ki=Zi+" Mini",zi="Edge",Yi="Microsoft "+zi,Ji="Firefox",Qi=Ji+" "+Ti,Xi="Nintendo",eo="PlayStation",to="Xbox",no=xi+" "+Ei,ro=Ei+" "+Pi,io="Windows",oo=io+" Phone",ao="Nokia",so="Ouya",uo="Generic",co=uo+" "+Ei.toLowerCase(),lo=uo+" "+Mi.toLowerCase(),fo="Konqueror",po="(\\d+(\\.\\d+)?)",ho=new RegExp("Version/"+po),go=new RegExp(to,"i"),vo=new RegExp(eo+" \\w+","i"),mo=new RegExp(Xi+" \\w+","i"),yo=new RegExp(Bi+"|PlayBook|BB10","i"),_o={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var bo=function(e,t){return t&&yn(t,Li)||function(e){return yn(e,Pi)&&!yn(e,Hi)&&!yn(e,xi)}(e)},Io=function(e,t){return t=t||"",yn(e," OPR/")&&yn(e,"Mini")?Ki:yn(e," OPR/")?Zi:yo.test(e)?Bi:yn(e,"IE"+Ei)||yn(e,"WPDesktop")?$i:yn(e,Wi)?Vi:yn(e,zi)||yn(e,"Edg/")?Yi:yn(e,"FBIOS")?"Facebook "+Ei:yn(e,Hi)?Hi:yn(e,"CriOS")?Ui:yn(e,"UCWEB")||yn(e,"UCBrowser")?"UC Browser":yn(e,"FxiOS")?Qi:yn(e,xi)?no:yn(e.toLowerCase(),fo.toLowerCase())?fo:bo(e,t)?yn(e,Ei)?ro:Pi:yn(e,Ji)?Ji:yn(e,"MSIE")||yn(e,"Trident/")?ji:yn(e,"Gecko")?Ji:""},wo=(c(_i={},$i,[new RegExp("rv:"+po)]),c(_i,Yi,[new RegExp(zi+"?\\/"+po)]),c(_i,Hi,[new RegExp(Hi+"/"+po)]),c(_i,Ui,[new RegExp("CriOS\\/"+po)]),c(_i,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+po)]),c(_i,Pi,[ho]),c(_i,ro,[ho]),c(_i,Zi,[new RegExp("(Opera|OPR)\\/"+po)]),c(_i,Ji,[new RegExp(Ji+"\\/"+po)]),c(_i,Qi,[new RegExp("FxiOS\\/"+po)]),c(_i,fo,[new RegExp("Konqueror[:/]?"+po,"i")]),c(_i,Bi,[new RegExp(Bi+" "+po),ho]),c(_i,no,[new RegExp("android\\s"+po)]),c(_i,Vi,[new RegExp(Wi+"\\/"+po)]),c(_i,ji,[new RegExp("(rv:|MSIE )"+po)]),c(_i,"Mozilla",[new RegExp("rv:"+po)]),_i),ko=[[new RegExp(to+"; "+to+" (.*?)[);]","i"),function(e){return[to,e&&e[1]||""]}],[new RegExp(Xi,"i"),[Xi,""]],[new RegExp(eo,"i"),[eo,""]],[yo,[Bi,""]],[new RegExp(io,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[oo,""];if(new RegExp(Ei).test(t)&&!/IEMobile\b/.test(t))return[io+" "+Ei,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=_o[r]||"";return/arm/i.test(t)&&(i="RT"),[io,i]}return[io,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Ti,t.join(".")]}return[Ti,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Ht(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+xi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+xi+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[xi,t.join(".")]}return[xi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Gi,""]],[/Linux|debian/i,["Linux",""]]],Co=function(e){return mo.test(e)?Xi:vo.test(e)?eo:go.test(e)?to:new RegExp(so,"i").test(e)?so:new RegExp("("+oo+"|WPDesktop)","i").test(e)?oo:/iPad/.test(e)?Ni:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Di:yo.test(e)?Bi:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ao,"i").test(e)?ao:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Ei).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?xi:Oi:xi:new RegExp("(pda|"+Ei+")","i").test(e)?co:new RegExp(Mi,"i").test(e)&&!new RegExp(Mi+" pc","i").test(e)?lo:""},So="https?://(.*)",Ao={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"].concat(e||[]),n={};return vn(t,(function(e){var t=rn?Mn(rn.URL,e):"";t.length&&(n[e]=t)})),n},searchEngine:function(){var e=null==rn?void 0:rn.referrer;return e?0===e.search(So+"google.([^/?]*)")?"google":0===e.search(So+"bing.com")?"bing":0===e.search(So+"yahoo.com")?"yahoo":0===e.search(So+"duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=Ao.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!Ut(e)){n.$search_engine=e;var r=rn?Mn(rn.referrer,t):"";r.length&&(n.ph_keyword=r)}return n},browser:Io,browserVersion:function(e,t){var n=Io(e,t),r=wo[n];if(Ht(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<ko.length;t++){var n=d(ko[t],2),r=n[0],i=n[1],o=r.exec(e),a=o&&(Wt(i)?i(o,e):i);if(a)return a}return["",""]},device:Co,deviceType:function(e){var t=Co(e);return t===Ni||t===Oi||"Kobo"===t||"Kindle Fire"===t||t===lo?Mi:t===Xi||t===to||t===eo||t===so?"Console":t===Di?"Wearable":t?Ei:"Desktop"},referrer:function(){return(null==rn?void 0:rn.referrer)||"$direct"},referringDomain:function(){var e;return null!=rn&&rn.referrer&&(null===(e=En(rn.referrer))||void 0===e?void 0:e.host)||"$direct"},properties:function(){if(!cn)return{};var e=d(Ao.os(cn),2),t=e[0],n=e[1];return mn(kn({$os:t,$os_version:n,$browser:Ao.browser(cn,navigator.vendor),$device:Ao.device(cn),$device_type:Ao.deviceType(cn)}),{$current_url:null==on?void 0:on.href,$host:null==on?void 0:on.host,$pathname:null==on?void 0:on.pathname,$raw_user_agent:cn.length>1e3?cn.substring(0,997)+"...":cn,$browser_version:Ao.browserVersion(cn,navigator.vendor),$browser_language:Ao.browserLanguage(),$screen_height:null==Jt?void 0:Jt.screen.height,$screen_width:null==Jt?void 0:Jt.screen.width,$viewport_height:null==Jt?void 0:Jt.innerHeight,$viewport_width:null==Jt?void 0:Jt.innerWidth,$lib:"web",$lib_version:Yt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:bn()/1e3})},people_properties:function(){if(!cn)return{};var e=d(Ao.os(cn),2),t=e[0],n=e[1];return mn(kn({$os:t,$os_version:n,$browser:Ao.browser(cn,navigator.vendor)}),{$browser_version:Ao.browserVersion(cn,navigator.vendor)})}},Ro=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Fo=function(){function e(t){a(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(t),this.storage=this.buildStorage(t),this.load(),this.update_config(t,t),this.save()}return u(e,[{key:"buildStorage",value:function(e){-1===Ro.indexOf(e.persistence.toLowerCase())&&(fn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&wi.is_supported()?wi:"localstorage+cookie"===t&&Ci.is_supported()?Ci:"sessionstorage"===t&&Fi.is_supported()?Fi:"memory"===t?Ai:"cookie"===t?bi:Ci.is_supported()?Ci:bi}},{key:"properties",value:function(){var e={};return vn(this.props,(function(t,n){if(n===Hr&&Vt(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(Ut(o=Jr)?s:tn&&o.indexOf===tn?-1!=o.indexOf(a):(vn(o,(function(e){if(s||(s=e===a))return pn})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=mn({},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(Vt(e)){Ht(t)&&(t="None"),this.expire_days=Ht(n)?this.default_expiry:n;var i=!1;if(vn(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(Vt(e)){this.expire_days=Ht(t)?this.default_expiry:t;var r=!1;if(vn(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(Ao.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(Ao.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||Ao.referrer(),$referring_domain:this.props.$referring_domain||Ao.referringDomain()})}},{key:"get_referrer_info",value:function(){return kn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return vn(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Nr]||{};n[e]=t,this.props[Nr]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Nr]||{})[e];return Ht(t)||(delete this.props[Nr][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Kr]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Kr]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[zr]||{}}},{key:"set_quota_limits",value:function(e){this.props[zr]=e,this.save()}}]),e}(),Eo=2,To=4;var xo=u((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),c(this,"bucketSize",100),c(this,"refillRate",10),c(this,"mutationBuckets",{}),c(this,"loggedTracker",{}),c(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),c(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),c(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),c(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=d(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),Mo=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Mo||{}),Oo="__ph_opt_in_out_";function No(e,t){Ho(!0,e,t)}function Lo(e,t){Ho(!1,e,t)}function Do(e,t){return"1"===Vo(e,t)}function Po(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||Jt,n=null==t?void 0:t.navigator,r=!1;return vn([null==n?void 0:n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){yn([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Vo(e,t)}function Bo(e,t){qo(t=t||{}).remove(Wo(e,t),!!t.crossSubdomainCookie)}function qo(e){return"localStorage"===(e=e||{}).persistenceType?wi:"localStorage+cookie"===e.persistenceType?Ci:bi}function Wo(e,t){return((t=t||{}).persistencePrefix||Oo)+e}function Vo(e,t){return qo(t).get(Wo(e,t))}function Ho(e,t,n){Gt(t)&&t.length?(qo(n=n||{}).set(Wo(t,n),e?1:0,$t(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):fn.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function Go(e){var t=!1;try{var n=e.config.token,r=e.config.respect_dnt,i=e.config.opt_out_capturing_persistence_type,o=e.config.opt_out_capturing_cookie_prefix||void 0,a=e.config.window;n&&(t=Po(n,{respectDnt:r,persistenceType:i,persistencePrefix:o,window:a}))}catch(e){fn.error("Unexpected error when checking capturing opt-out status: "+e)}return t}var Uo,jo=3e5,$o=jo;!function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(Uo||(Uo={}));var Zo=[Uo.MouseMove,Uo.MouseInteraction,Uo.Scroll,Uo.ViewportResize,Uo.Input,Uo.TouchMove,Uo.MediaInteraction,Uo.Drag],Ko=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},zo="[SessionRecording]",Yo=function(){function e(t){var n=this;if(a(this,e),c(this,"queuedRRWebEvents",[]),c(this,"isIdle",!1),c(this,"_linkedFlagSeen",!1),c(this,"_lastActivityTimestamp",Date.now()),c(this,"windowId",null),c(this,"sessionId",null),c(this,"_linkedFlag",null),c(this,"_sampleRate",null),c(this,"_minimumDuration",null),c(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,null==Jt||Jt.addEventListener("beforeunload",(function(){n._flushBuffer()})),null==Jt||Jt.addEventListener("offline",(function(){n._tryAddCustomEvent("browser offline",{})})),null==Jt||Jt.addEventListener("online",(function(){n._tryAddCustomEvent("browser online",{})})),null==Jt||Jt.addEventListener("visibilitychange",(function(){if(null!=rn&&rn.visibilityState){var e="window "+rn.visibilityState;n._tryAddCustomEvent(e,{})}})),!this.instance.sessionManager)throw fn.error(zo+" started without valid sessionManager"),new Error(zo+" started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return u(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw fn.error(zo+" started without valid sessionManager"),new Error(zo+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return $t(this._sampleRate)?this.instance.get_property(Vr):null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Dr),t=!this.instance.config.disable_session_recording;return Jt&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Pr),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(qr);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(Br),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),a=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?jt(this._linkedFlag)||this._linkedFlagSeen?Zt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?(this._startCapture(),fn.info(zo+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,fn.info(zo+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e;if($t(this._sampleRate)){var r,i=this.isSampled;if(n||!Zt(i))r=Math.random()<this._sampleRate;else r=i;r||fn.warn(zo+" Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),null===(t=this.instance.persistence)||void 0===t||t.register(c({},Vr,r))}else{var o;null===(o=this.instance.persistence)||void 0===o||o.register(c({},Vr,null))}}},{key:"afterDecideResponse",value:function(e){var n,r,i,o,a,s,u,l,d,f,p=this;this.instance.persistence&&this.instance.persistence.register((c(f={},Dr,!!e.sessionRecording),c(f,Pr,null===(a=e.sessionRecording)||void 0===a?void 0:a.consoleLogRecordingEnabled),c(f,Br,t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture)),c(f,qr,{enabled:null===(u=e.sessionRecording)||void 0===u?void 0:u.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(d=e.sessionRecording)||void 0===d?void 0:d.canvasQuality}),f));var h=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate;this._sampleRate=jt(h)?null:parseFloat(h);var g,v=null===(r=e.sessionRecording)||void 0===r?void 0:r.minimumDurationMilliseconds;(this._minimumDuration=Ht(v)?null:v,this._linkedFlag=(null===(i=e.sessionRecording)||void 0===i?void 0:i.linkedFlag)||null,null!==(o=e.sessionRecording)&&void 0!==o&&o.endpoint)&&(this._endpoint=null===(g=e.sessionRecording)||void 0===g?void 0:g.endpoint);if($t(this._sampleRate)&&this.sessionManager.onSessionId((function(e){p.makeSamplingDecision(e)})),!jt(this._linkedFlag)){var m,y,_=Gt(this._linkedFlag)?this._linkedFlag:null===(m=this._linkedFlag)||void 0===m?void 0:m.flag,b=Gt(this._linkedFlag)?null:null===(y=this._linkedFlag)||void 0===y?void 0:y.variant;this.instance.onFeatureFlags((function(e,t){var n=Vt(t)&&_ in t,r=b?t[_]===b:n;r&&fn.info(zo+" linked flag matched",{linkedFlag:_,linkedVariant:b}),p._linkedFlagSeen=r}))}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:bn()})}},{key:"_startCapture",value:function(){var e=this;Ht(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||Go(this.instance)||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),"v2"!==this.instance.__loaded_recorder_version?Rn(this.instance.requestRouter.endpointFor("assets","/static/recorder-v2.js?v=".concat(Yt.LIB_VERSION)),(function(t){if(t)return fn.error(zo+" could not load recorder-v2.js",t);e._onScriptLoaded()})):this._onScriptLoaded())}},{key:"_isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==Zo.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this._isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>$o&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:$o}));var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,a=this.sessionId!==o,s=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[Eo,To].indexOf(e.type)&&(s||a))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):fn.warn(zo+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(Ko((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Ko((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){var e,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=Jt.rrweb?Jt.rrweb.record:Jt.rrwebRecord;for(var i=this.instance.config.session_recording,o=0,a=Object.entries(i||{});o<a.length;o++){var s=d(a[o],2),u=s[0],c=s[1];u in r&&(r[u]=c)}if(this.canvasRecording&&this.canvasRecording.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.canvasRecording.fps},r.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new xo(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");fn.info(r,{node:t}),n.log(zo+" "+r,"warn")}}),this._scheduleFullSnapshot();var l=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:l},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t=Jt?n._maskUrl(Jt.location.href):"";if(!t)return;n._tryAddCustomEvent("$pageview",{href:t}),n._tryTakeFullSnapshot()}}catch(e){fn.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:l.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else fn.error(zo+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),jo)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(ln.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(ln.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&Wt(ln.getRecordNetworkPlugin))&&(!Fn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(ln.getRecordNetworkPlugin(fr(this.instance.config,this.networkPayloadCapture))):fn.info(zo+" NetworkCapture not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Vt(e)){if(e.type===Mo.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Mo.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&Vt(t)&&6===t.type&&Vt(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(n),i=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Mo.Custom){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&Jt){var e=this._maskUrl(Jt.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=f(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(n){Date.now()-n.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length}):e._tryRRWebMethod(n)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length})}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this._minimumDuration,n=this.sessionDuration,r=$t(n)&&n>=0,i=$t(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),Ut(this.buffer.sessionId)&&!Ut(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings"})}}]),e}(),Jo=function(){function e(t){a(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ur),group_properties:this.instance.get_property(jr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:ei.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t,n=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var r=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},r),r)fn.error("Failed to fetch feature flags from PostHog.");else{if(!rn||!rn.body)return fn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.parseDecideResponse(e)}),500);this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),ti.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e);var i=null==Jt?void 0:Jt.extendPostHogWithSurveys;e.surveys&&!i&&Rn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),(function(e){if(e)return fn.error("Could not load surveys script",e);Jt.extendPostHogWithSurveys(n.instance)}));var o=null==Jt?void 0:Jt.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&Ht(o)&&Rn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),(function(t){if(t)return fn.error("Could not load exception autocapture script",t);Jt.extendPostHogWithExceptionAutocapture(n.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var a,s=g(e.siteApps);try{var u=function(){var e=a.value,t=e.id,r=e.url,i=n.instance.requestRouter.endpointFor("api",r);ln["__$$ph_site_app_".concat(t)]=n.instance,Rn(i,(function(e){e&&fn.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(s.s();!(a=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}else e.siteApps.length>0&&fn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),e}(),Qo=["source"],Xo=null!=Jt&&Jt.location?On(Jt.location.hash,"__posthog")||On(location.hash,"state"):null,ea=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"afterDecideResponse",value:function(e){var n=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&n.toolbarVersion&&0===n.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(t({},n))}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Jt||!rn)return!1;n=null!==(e=n)&&void 0!==e?e:Jt.location,i=null!==(t=i)&&void 0!==t?t:Jt.history;try{if(!r){try{Jt.localStorage.setItem("test","test"),Jt.localStorage.removeItem("test")}catch(e){return!1}r=null==Jt?void 0:Jt.localStorage}var o,a=Xo||On(n.hash,"__posthog")||On(n.hash,"state"),s=a?In((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||In((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState("",rn.title,n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var n=this;if(!Jt||ln._postHogToolbarLoaded)return!1;ln._postHogToolbarLoaded=!0;var r=3e5,i=Math.floor(Date.now()/r)*r,o=this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(i)),a="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},a?{instrument:!1}:{});s.source;var u=l(s,Qo);return Jt.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),Rn(o,(function(e){e?fn.error("Failed to load toolbar",e):(ln.ph_load_toolbar||ln.ph_load_editor)(s,n.instance)})),An(Jt,"turbolinks:load",(function(){ln._postHogToolbarLoaded=!1,n.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]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),ta=function(){function e(t){a(this,e),c(this,"isPaused",!0),c(this,"queue",[]),c(this,"flushTimeoutMs",3e3),this.sendRequest=t}return u(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},r=Object.values(n);[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(n){e.sendRequest(t(t({},n),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&qt(r.data)&&vn(r.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return vn(this.queue,(function(n){var r,i=n,o=(i?i.batchKey:null)||i.url;Ht(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}]),e}(),na=Uint8Array,ra=Uint16Array,ia=Uint32Array,oa=new na([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]),aa=new na([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]),sa=new na([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ua=function(e,t){for(var n=new ra(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ia(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},ca=ua(oa,2),la=ca[0],da=ca[1];la[28]=258,da[258]=28;for(var fa=ua(aa,0)[1],pa=new ra(32768),ha=0;ha<32768;++ha){var ga=(43690&ha)>>>1|(21845&ha)<<1;ga=(61680&(ga=(52428&ga)>>>2|(13107&ga)<<2))>>>4|(3855&ga)<<4,pa[ha]=((65280&ga)>>>8|(255&ga)<<8)>>>1}var va=function(e,t,n){for(var r=e.length,i=0,o=new ra(t);i<r;++i)++o[e[i]-1];var a,s=new ra(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new ra(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],l=t-e[i],d=s[e[i]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)a[pa[d]>>>u]=c}else for(a=new ra(r),i=0;i<r;++i)a[i]=pa[s[e[i]-1]++]>>>15-e[i];return a},ma=new na(288);for(ha=0;ha<144;++ha)ma[ha]=8;for(ha=144;ha<256;++ha)ma[ha]=9;for(ha=256;ha<280;++ha)ma[ha]=7;for(ha=280;ha<288;++ha)ma[ha]=8;var ya=new na(32);for(ha=0;ha<32;++ha)ya[ha]=5;var _a=va(ma,9,0),ba=va(ya,5,0),Ia=function(e){return(e/8>>0)+(7&e&&1)},wa=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ra?ra:e instanceof ia?ia:na)(n-t);return r.set(e.subarray(t,n)),r},ka=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Ca=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},Sa=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new na(0),0];if(1==i){var a=new na(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!=i-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 f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new ra(f+1),h=Aa(n[l-1],p,0);if(h>t){r=0;var g=0,v=h-t,m=1<<v;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(p[y]>t))break;g+=m-(1<<h-p[y]),p[y]=t}for(g>>>=v;g>0;){var _=o[r].s;p[_]<t?g-=1<<t-p[_]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;p[b]==t&&(--p[b],++g)}h=t}return[new na(p),h]},Aa=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},Ra=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ra(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},Fa=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ea=function(e,t,n){var r=n.length,i=Ia(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Ta=function(e,t,n,r,i,o,a,s,u,c,l){ka(t,l++,n),++i[256];for(var d=Sa(i,15),f=d[0],p=d[1],h=Sa(o,15),g=h[0],v=h[1],m=Ra(f),y=m[0],_=m[1],b=Ra(g),I=b[0],w=b[1],k=new ra(19),C=0;C<y.length;++C)k[31&y[C]]++;for(C=0;C<I.length;++C)k[31&I[C]]++;for(var S=Sa(k,7),A=S[0],R=S[1],F=19;F>4&&!A[sa[F-1]];--F);var E,T,x,M,O=c+5<<3,N=Fa(i,ma)+Fa(o,ya)+a,L=Fa(i,f)+Fa(o,g)+a+14+3*F+Fa(k,A)+(2*k[16]+3*k[17]+7*k[18]);if(O<=N&&O<=L)return Ea(t,l,e.subarray(u,u+c));if(ka(t,l,1+(L<N)),l+=2,L<N){E=va(f,p,0),T=f,x=va(g,v,0),M=g;var D=va(A,R,0);ka(t,l,_-257),ka(t,l+5,w-1),ka(t,l+10,F-4),l+=14;for(C=0;C<F;++C)ka(t,l+3*C,A[sa[C]]);l+=3*F;for(var P=[y,I],B=0;B<2;++B){var q=P[B];for(C=0;C<q.length;++C){var W=31&q[C];ka(t,l,D[W]),l+=A[W],W>15&&(ka(t,l,q[C]>>>5&127),l+=q[C]>>>12)}}}else E=_a,T=ma,x=ba,M=ya;for(C=0;C<s;++C)if(r[C]>255){W=r[C]>>>18&31;Ca(t,l,E[W+257]),l+=T[W+257],W>7&&(ka(t,l,r[C]>>>23&31),l+=oa[W]);var V=31&r[C];Ca(t,l,x[V]),l+=M[V],V>3&&(Ca(t,l,r[C]>>>5&8191),l+=aa[V])}else Ca(t,l,E[r[C]]),l+=T[r[C]];return Ca(t,l,E[256]),l+T[256]},xa=new ia([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ma=new na(0),Oa=function(){for(var e=new ia(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Na=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new na(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),c=0;if(!t||a<8)for(var l=0;l<=a;l+=65535){var d=l+65535;d<a?c=Ea(u,c,e.subarray(l,d)):(u[l]=o,c=Ea(u,c,e.subarray(l,a)))}else{for(var f=xa[t-1],p=f>>>13,h=8191&f,g=(1<<n)-1,v=new ra(32768),m=new ra(g+1),y=Math.ceil(n/3),_=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<_)&g},I=new ia(25e3),w=new ra(288),k=new ra(32),C=0,S=0,A=(l=0,0),R=0,F=0;l<a;++l){var E=b(l),T=32767&l,x=m[E];if(v[T]=x,m[E]=T,R<=l){var M=a-l;if((C>7e3||A>24576)&&M>423){c=Ta(e,u,0,I,w,k,S,A,F,l-F,c),A=C=S=0,F=l;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)k[O]=0}var N=2,L=0,D=h,P=T-x&32767;if(M>2&&E==b(l-P))for(var B=Math.min(p,M)-1,q=Math.min(32767,l),W=Math.min(258,M);P<=q&&--D&&T!=x;){if(e[l+N]==e[l+N-P]){for(var V=0;V<W&&e[l+V]==e[l+V-P];++V);if(V>N){if(N=V,L=P,V>B)break;var H=Math.min(P,V-2),G=0;for(O=0;O<H;++O){var U=l-P+O+32768&32767,j=U-v[U]+32768&32767;j>G&&(G=j,x=U)}}}P+=(T=x)-(x=v[T])+32768&32767}if(L){I[A++]=268435456|da[N]<<18|fa[L];var $=31&da[N],Z=31&fa[L];S+=oa[$]+aa[Z],++w[257+$],++k[Z],R=l+N,++C}else I[A++]=e[l],++w[e[l]]}}c=Ta(e,u,o,I,w,k,S,A,F,l-F,c),o||(c=Ea(u,c,Ma))}return wa(s,0,r+Ia(c)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},La=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Da(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=Oa[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o=Na(e,t,10+((i=t).filename&&i.filename.length+1||0),8),a=o.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&&La(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)}}(o,t),La(o,a-8,n.d()),La(o,a-4,r),o}var Pa=!!sn||!!an,Ba="text/plain",qa=function(e,n){var r=d(e.split("?"),2),i=r[0],o=r[1],a=t({},n);null==o||o.split("&").forEach((function(e){var t=d(e.split("="),1)[0];delete a[t]}));var s=xn(a);return s=s?(o?o+"&":"")+s:o,"".concat(i,"?").concat(s)},Wa=function(e){return"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))},Va=function(e){var t=e.data,n=e.compression;if(t){if(n===ei.GZipJS){var r=Da(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new na(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new na(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return wa(r,0,i)}(JSON.stringify(t)),{mtime:0});return{contentType:Ba,body:new Blob([r],{type:Ba})}}if(n===ei.Base64){var i=function(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",l=[];if(!e)return e;e=Sn(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}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}(JSON.stringify(t));return{contentType:"application/x-www-form-urlencoded",body:Wa(i)}}return{contentType:"application/json",body:JSON.stringify(t)}}},Ha=function(e){var t,n=new sn;n.open(e.method||"GET",e.url,!0);var r=null!==(t=Va(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;vn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)},Ga=function(e){var t,n,r=null!==(t=Va(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,a=new Headers;vn(a,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var s=e.url,u=null;if(un){var c=new un;u={signal:c.signal,timeout:setTimeout((function(){return c.abort()}),e.timeout)}}an(s,{method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method,body:o,signal:null===(n=u)||void 0===n?void 0:n.signal}).then((function(t){return t.text().then((function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){fn.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)}))})).catch((function(t){var n;fn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return u?clearTimeout(u.timeout):null}))},Ua=function(e){var t=qa(e.url,{beacon:"1"});try{var n,r=null!==(n=Va(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,a="string"==typeof o?new Blob([o],{type:i}):o;nn.sendBeacon(t,a)}catch(e){}},ja=function(e){var t;if(rn){var n=rn.createElement("script");n.type="text/javascript",n.async=!0,n.defer=!0,n.src=e.url;var r=rn.getElementsByTagName("script")[0];null===(t=r.parentNode)||void 0===t||t.insertBefore(n,r)}},$a=["retriesPerformedSoFar"];var Za,Ka=function(){function e(t){var n=this;a(this,e),c(this,"isPolling",!1),c(this,"pollIntervalMs",3e3),c(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Ht(Jt)&&"onLine"in Jt.navigator&&(this.areWeOnline=Jt.navigator.onLine,Jt.addEventListener("online",(function(){n.areWeOnline=!0,n.flush()})),Jt.addEventListener("offline",(function(){n.areWeOnline=!1})))}return u(e,[{key:"retriableRequest",value:function(e){var n=this,r=e.retriesPerformedSoFar,i=l(e,$a);$t(r)&&r>0&&(i.url=qa(i.url,{retry_count:r})),this.instance._send_request(t(t({},i),{},{callback:function(e){var o;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?n.enqueue(t({},i)):null===(o=i.callback)||void 0===o||o.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),fn.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var r,i=g(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=g(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestOptions;try{this.instance._send_request(t(t({},r),{},{transport:"sendBeacon"}))}catch(e){fn.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}}]),e}(),za=1800,Ya=function(){function e(t,n,r,i){a(this,e),c(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||pi,this._windowIdGenerator=i||pi;var o=t.persistence_name||t.token,s=t.session_idle_timeout_seconds||za;if($t(s)?s>za?fn.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):s<60&&fn.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(fn.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),s=za),this._sessionTimeoutMs=1e3*Math.min(Math.max(s,60),za),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=Fi.parse(this._window_id_storage_key),l=Fi.parse(this._primary_window_exists_storage_key);u&&!l?this._windowId=u:Fi.remove(this._window_id_storage_key),Fi.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return Ht(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Fi.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Fi.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Fi.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(c({},Wr,[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[Wr];return qt(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;null==Jt||Jt.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&Fi.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=d(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>864e5,u=!1,c=!i,l=!e&&Math.abs(t-r)>this._sessionTimeoutMs;c||l||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),fn.info("[SessionId] new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:c,activityTimeout:l,sessionPastMaximumLength:s}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=0===r||!e||s?t:r,p=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,f,p),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:p}}}]),e}();!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Za||(Za={}));var Ja=function(){function e(t){a(this,e),c(this,"_regionCache",{}),this.instance=t}return u(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e;return null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"")}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Za.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Za.EU:this._regionCache[this.apiHost]=Za.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost)+t;if(this.region===Za.CUSTOM)return this.apiHost+t;var n="i.posthog.com"+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}]),e}(),Qa=u((function e(t,n,r,i){a(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var o,a,s,u,c;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var l=t.requestRouter.endpointFor("ui","/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=l,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var d=(null===(o=e.exception)||void 0===o?void 0:o.values)||[],f={$exception_message:null===(a=d[0])||void 0===a?void 0:a.value,$exception_type:null===(s=d[0])||void 0===s?void 0:s.type,$exception_personURL:l,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(u=d[0])||void 0===u?void 0:u.value,$sentry_exception_type:null===(c=d[0])||void 0===c?void 0:c.type,$sentry_tags:e.tags};return n&&r&&(f.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",f),e}))}})),Xa=function(){function e(t){var n=this;a(this,e),c(this,"_hasSeenPageView",!1),c(this,"_updateScrollData",(function(){var e,t,r,i;n._pageViewData||(n._pageViewData=n._createPageViewData());var o=n._pageViewData,a=n._scrollY(),s=n._scrollHeight(),u=n._contentY(),c=n._contentHeight();o.lastScrollY=a,o.maxScrollY=Math.max(a,null!==(e=o.maxScrollY)&&void 0!==e?e:0),o.maxScrollHeight=Math.max(s,null!==(t=o.maxScrollHeight)&&void 0!==t?t:0),o.lastContentY=u,o.maxContentY=Math.max(u,null!==(r=o.maxContentY)&&void 0!==r?r:0),o.maxContentHeight=Math.max(c,null!==(i=o.maxContentHeight)&&void 0!==i?i:0)})),this._instance=t}return u(e,[{key:"_createPageViewData",value:function(){var e;return{pathname:null!==(e=null==Jt?void 0:Jt.location.pathname)&&void 0!==e?e:""}}},{key:"doPageView",value:function(){var e,n;return this._hasSeenPageView?(n=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,n=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),t({$prev_pageview_pathname:null===(e=n)||void 0===e?void 0:e.pathname},this._calculatePrevPageScrollProperties(n))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return t({$prev_pageview_pathname:null==e?void 0:e.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||null==e.maxScrollHeight||null==e.lastScrollY||null==e.maxScrollY||null==e.maxContentHeight||null==e.lastContentY||null==e.maxContentY)return{};var t=e.maxScrollHeight,n=e.lastScrollY,r=e.maxScrollY,i=e.maxContentHeight,o=e.lastContentY,a=e.maxContentY;return t=Math.ceil(t),n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),a=Math.ceil(a),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:t<=1?1:es(n/t,0,1),$prev_pageview_max_scroll:r,$prev_pageview_max_scroll_percentage:t<=1?1:es(r/t,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:i<=1?1:es(o/i,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:i<=1?1:es(a/i,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){null==Jt||Jt.addEventListener("scroll",this._updateScrollData,!0),null==Jt||Jt.addEventListener("scrollend",this._updateScrollData,!0),null==Jt||Jt.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){null==Jt||Jt.removeEventListener("scroll",this._updateScrollData),null==Jt||Jt.removeEventListener("scrollend",this._updateScrollData),null==Jt||Jt.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollElement",value:function(){if(!this._instance.config.scroll_root_selector)return null==Jt?void 0:Jt.document.documentElement;var e,t=g(qt(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==Jt?void 0:Jt.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"_scrollHeight",value:function(){var e=this._scrollElement();return e?Math.max(0,e.scrollHeight-e.clientHeight):0}},{key:"_scrollY",value:function(){if(this._instance.config.scroll_root_selector){var e=this._scrollElement();return e&&e.scrollTop||0}return Jt&&(Jt.scrollY||Jt.pageYOffset||Jt.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){var e=this._scrollElement();return(null==e?void 0:e.scrollHeight)||0}},{key:"_contentY",value:function(){var e=this._scrollElement(),t=(null==e?void 0:e.clientHeight)||0;return this._scrollY()+t}}]),e}();function es(e,t,n){return Math.max(t,Math.min(e,n))}var ts={icontains:function(e){return!!Jt&&Jt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return!!Jt&&Tn(Jt.location.href,e)},exact:function(e){return(null==Jt?void 0:Jt.location.href)===e}},ns=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property($r);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){var r;if(200!==n.statusCode||!n.json)return e([]);var i=n.json.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(c({},$r,i)),e(i)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||ts[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==rn?void 0:rn.querySelector(e.conditions.selector));return o&&a})).filter((function(e){if(!e.linked_flag_key&&!e.targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key);return n&&r}));return e(r)}),n)}}]),e}(),rs=function(){function e(){var t=this;a(this,e),c(this,"limits",{}),c(this,"checkForLimiting",(function(e){var n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((function(e){fn.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),t.limits[e]=(new Date).getTime()+6e4}))}catch(e){return void fn.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:n})}}))}return u(e,[{key:"isRateLimited",value:function(e){var t=this.limits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),is=function(){return t({initialPathName:(null==on?void 0:on.pathname)||"",referringDomain:Ao.referringDomain()},Ao.campaignParams())},os=function(){function e(t,n,r){var i=this;a(this,e),c(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(c({},Yr,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||is,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Yr]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),as=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],ss=function(e,t){if(!e)return!1;var n=e.toLowerCase();return as.concat(t||[]).some((function(e){var t=e.toLowerCase();return n.includes?n.includes(t):-1!==n.indexOf(t)}))},us={},cs=function(){},ls="posthog",ds=!Pa&&-1===(null==cn?void 0:cn.indexOf("MSIE"))&&-1===(null==cn?void 0:cn.indexOf("Mozilla")),fs=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==rn?void 0:rn.location,n=null==t?void 0:t.hostname,!!Gt(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:cs,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!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==Jt||null===(e=Jt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;fn.error(t)},get_device_id:function(e){return e},_onCapture:cs,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},ps=function(){function e(){a(this,e),c(this,"__forceAllowLocalhost",!1)}return u(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){fn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),hs=function(){function e(){var t=this;a(this,e),c(this,"webPerformance",new ps),this.config=fs(),this.decideEndpointWasHit=!1,this.SentryIntegration=Qa,this.segmentIntegration=function(){return function(e){Promise&&Promise.resolve||fn.warn("This browser does not have Promise support, and can not use the segment integration");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")}}}(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new ai(this),this.toolbar=new ea(this),this.pageViewManager=new Xa(this),this.surveys=new ns(this),this.rateLimiter=new rs,this.requestRouter=new Ja(this),this.people={set:function(e,n,r){var i=Gt(e)?c({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=Gt(e)?c({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}}}return u(e,[{key:"init",value:function(t,n,r){if(r&&r!==ls){var i,o=null!==(i=us[r])&&void 0!==i?i:new e;return o._init(t,n,r),us[r]=o,us[ls][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var n,r,i,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(Ht(e)||function(e){return Gt(e)&&0===e.trim().length}(e))fn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()");else{if(!this.__loaded){var u;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],a.request_headers=a.request_headers||a.xhr_headers,this.set_config(mn({},fs(),a,{name:s,token:e})),null!=Jt&&null!==(n=Jt.rrweb)&&void 0!==n&&n.record||null!=Jt&&Jt.rrwebRecord)this.__loaded_recorder_version=null==Jt||null===(u=Jt.rrweb)||void 0===u?void 0:u.version;if(this.compression=a.disable_compression?void 0:ei.Base64,this.persistence=new Fo(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Fo(t(t({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new ta((function(e){return o._send_request(e)})),this._retryQueue=new Ka(this),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Ya(this.config,this.persistence),this.sessionPropsManager=new os(this.sessionManager,this.persistence),this.sessionRecording=new Yo(this),this.sessionRecording.startRecordingIfEnabled(),this.config.disable_scroll_properties||this.pageViewManager.startMeasuringScrollPosition(),this.__autocapture=this.config.autocapture,ti._setIsAutocaptureEnabled(this),ti._isAutocaptureEnabled){this.__autocapture=this.config.autocapture;ti.enabledForProject(this.config.token,100,100)?ti.isBrowserSupported()?ti.init(this):(this.__autocapture=!1,fn.info("Disabling Automatic Event Collection because this browser is not supported")):(this.__autocapture=!1,fn.info("Not in active bucket: disabling Automatic Event Collection."))}if(Yt.DEBUG=Yt.DEBUG||this.config.debug,this._gdpr_init(),a.segment&&(this.config.get_device_id=function(){return a.segment.user().anonymousId()},a.segment.user().id()&&(this.register({distinct_id:a.segment.user().id()}),this.persistence.set_user_state("identified"))),void 0!==(null===(r=a.bootstrap)||void 0===r?void 0:r.distinctID)){var c,l,d=this.config.get_device_id(pi()),f=null!==(c=a.bootstrap)&&void 0!==c&&c.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_user_state(null!==(l=a.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var p,h,g=Object.keys((null===(p=a.bootstrap)||void 0===p?void 0:p.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=a.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=a.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),v=Object.keys((null===(h=a.bootstrap)||void 0===h?void 0:h.featureFlagPayloads)||{}).filter((function(e){return g[e]})).reduce((function(e,t){var n,r,i,o;null!==(n=a.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=a.bootstrap)||void 0===i||null===(o=i.featureFlagPayloads)||void 0===o?void 0:o[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:v})}if(!this.get_distinct_id()){var m=this.config.get_device_id(pi());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_user_state("anonymous")}return null==Jt||null===(i=Jt.addEventListener)||void 0===i||i.call(Jt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),a.segment?a.segment.register(this.segmentIntegration()).then((function(){o._loaded()})):this._loaded(),this}fn.warn("You have already initialized PostHog! Re-initialising is a no-op")}}},{key:"_afterDecideResponse",value:function(e){var t;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=yn(e.supportedCompression,ei.GZipJS)?ei.GZipJS:yn(e.supportedCompression,ei.Base64)?ei.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){fn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){rn&&e.capture("$pageview",{title:rn.title},{send_instantly:!0})}),1),t||(new Jo(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||gn(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var n=this;this.__loaded&&(ds?this.__request_queue.push(e):this.rateLimiter.isRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=qa(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var n=t({},e);n.timeout=n.timeout||6e4,n.url=qa(n.url,{_:(new Date).getTime().toString(),ver:Yt.LIB_VERSION,compression:n.compression}),"sendBeacon"===n.transport&&null!=nn&&nn.sendBeacon?Ua(n):"fetch"===n.transport&&an?Ga(n):sn||!rn?Ha(n):ja(n)}(t(t({},e),{},{callback:function(t){var r,i,o;(n.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(o=n.config).on_request_error)||void 0===i||i.call(o,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];gn(e,(function(e){e&&(t=e[0],qt(t)?o.push(e):Wt(e)?e.call(n):qt(e)&&"alias"===t?r.push(e):qt(e)&&-1!==t.indexOf("capture")&&Wt(n[t])?o.push(e):i.push(e))}));var a=function(e,t){gn(e,(function(e){if(qt(e[0])){var n=t;vn(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(i,this),a(o,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,n,r){var i;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return fn.uninitializedWarning("posthog.capture");if(!Go(this))if(!Ht(e)&&Gt(e)){if(!cn||this.config.opt_out_useragent_filter||!ss(cn,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var o={uuid:pi(),event:e,properties:this._calculate_event_properties(e,n||{})};"$identify"===e&&(o.$set=null==r?void 0:r.$set,o.$set_once=null==r?void 0:r.$set_once),(o=Cn(o,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=(null==r?void 0:r.timestamp)||new Date,Ht(null==r?void 0:r.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var a=t(t({},o.properties.$set),o.$set);(function(e){if(Vt(e)){for(var t in e)if(Pt.call(e,t))return!1;return!0}return!1})(a)||this.setPersonPropertiesForFlags(a),fn.info("send",o);var s={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(s):this._requestQueue.enqueue(s),this._invokeCaptureHooks(e,o),o}}else fn.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),vn(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,n){if(!this.persistence||!this.sessionPersistence)return n;var r=this.persistence.remove_event_timer(e),i=t({},n);if(i.token=this.config.token,"$snapshot"===e){var o=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=o.distinct_id,i}var a=Ao.properties();if(this.sessionManager){var s=this.sessionManager.checkAndGetSessionAndWindowId(),u=s.sessionId,c=s.windowId;i.$session_id=u,i.$window_id=c}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var l=this.sessionPropsManager.getSessionProps();i=mn(i,l)}if(!this.config.disable_scroll_properties){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),i=mn(i,d)}if("$pageview"===e&&rn&&(i.title=rn.title),"$performance_event"===e){var p=this.persistence.properties();return i.distinct_id=p.distinct_id,i.$current_url=a.$current_url,i}if(!Ht(r)){var h=(new Date).getTime()-r;i.$duration=parseFloat((h/1e3).toFixed(3))}(cn&&this.config.opt_out_useragent_filter&&(i.$browser_type=ss(cn,this.config.custom_blocked_useragents)?"bot":"browser"),i=mn({},Ao.properties(),this.persistence.properties(),this.sessionPersistence.properties(),i),qt(this.config.property_denylist)&&qt(this.config.property_blacklist))?vn([].concat(f(this.config.property_blacklist),f(this.config.property_denylist)),(function(e){delete i[e]})):fn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;return g&&(i=g(i,e)),i}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(c({},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:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return fn.uninitializedWarning("posthog.identify");if($t(e)&&(e=e.toString(),fn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))fn.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else{var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Or)&&(this.unregister(Or),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Zr))}else fn.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,n,r){if(e&&n){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},c({},e,n))}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(c({},e,r))),i[e]===n||r||this.reloadFeatureFlags()}else fn.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(!this.__loaded)return fn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_user_state("anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(pi());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/replay/"+n);if(null!=e&&e.withTimestamp&&r){var o,a=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);i+="?t=".concat(s)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(Mr)?(fn.critical("Attempting to create alias for existing People user - aborting."),-2):(Ht(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Or,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(fn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var n,r=t({},this.config);if(Vt(e)&&(mn(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),null===(n=this.persistence)||void 0===n||n.update_config(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Fo(t(t({},this.config),{},{persistence:"sessionStorage"})),wi.is_supported()&&"true"===wi.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Yt.DEBUG=!0),this.sessionRecording&&!Ht(e.disable_session_recording))){var i=r.disable_session_recording!==e.disable_session_recording,o=!Go(this)&&!e.disable_session_recording&&!this.sessionRecording.started;(i||o)&&(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_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:ls;return t!==ls&&(t=ls+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.config.opt_out_capturing_persistence_type&&wi.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.config.opt_out_capturing_by_default&&!bi.get("ph_optout")||(bi.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var t,n,r,i,o;if(e&&e.clear_persistence)r=!0;else{if(!e||!e.enable_persistence)return;r=!1}this.config.disable_persistence||(null===(t=this.persistence)||void 0===t?void 0:t.disabled)===r||(null===(i=this.persistence)||void 0===i||i.set_disabled(r));this.config.disable_persistence||(null===(n=this.sessionPersistence)||void 0===n?void 0:n.disabled)===r||(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(r))}},{key:"_gdpr_call_func",value:function(e,t){return t=mn({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},t||{}),wi.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.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=mn({enable_persistence:!0},e||{}),this._gdpr_call_func(No,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=mn({clear_persistence:!0},e||{});this._gdpr_call_func(Lo,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Do,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Po,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=mn({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Bo,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(null==Jt||Jt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Jt||Jt.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}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=wn(e.prototype[t[n]])}(hs,["identify"]);var gs,vs;gs=us[ls]=new hs,(vs=ln.posthog)&&vn(vs._i,(function(e){if(e&&qt(e)){var t=gs.init(e[0],e[1],e[2]),n=vs[e[2]]||vs;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),ln.posthog=gs,function(){function e(){e.done||(e.done=!0,ds=!1,vn(us,(function(e){e._dom_loaded()})))}null!=rn&&rn.addEventListener&&("complete"===rn.readyState?e():rn.addEventListener("DOMContentLoaded",e,!1)),Jt&&An(Jt,"load",e,!0)}()}();
|
|
17
17
|
//# sourceMappingURL=array.full.js.map
|