posthog-js 1.412.0 → 1.412.1
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.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours-preview.js +1 -1
- package/dist/product-tours-preview.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/rrweb.js +1 -1
- package/dist/rrweb.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +6 -6
package/dist/module.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function t(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(l||{}),u=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(u||{}),h=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(h||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),c=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(c||{}),v=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(v||{}),f=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(f||{});function p(t,e){return-1!==t.indexOf(e)}var g={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function b(t){if(y[t])return y[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in g?g[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in m?m[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return y[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return p(t,"AppleWebKit")&&!p(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),y[t]=h):r}catch(t){return r}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var _={};function w(t,e,r){var i,n=t+"."+String(r);if(_[n])return _[n].call(e);var s=b(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(_[n]=o,o.call(e)):e[r]}var x={};function k(t,e,r){var i=t+"."+String(r);if(x[i])return x[i].bind(e);var n=b(t)[r];return"function"!=typeof n?e[r]:(x[i]=n,n.bind(e))}function S(){return b("MutationObserver").constructor}function T(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else t[e]=n.next}}catch(t){return()=>{}}}var C={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),contains:(t,e)=>k("Node",t,"contains")(e),getRootNode:t=>k("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>k("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>k("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:T},E=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,deferredStylesheetCount:0});function M(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var I=0,R=0,P=E(),O=null,L=null,A=[],F={slowestBatchMs:0},D=t=>t&&t>0?t:null,N=32;function q(t,e,r){var i=t.length;if(r>=N)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)i+=q(o,e,r+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(i+=q(l,e,r+1))}}}catch(t){}}return i}function j(t){return 0!==I&&null!==L&&(P.cssRuleCount>=L||P.cssRuleCount+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),q(e,r,0)}catch(t){return 0}}(t)>L)}function B(t){return t.nodeType===t.ELEMENT_NODE}function U(t){var e=t&&"host"in t&&"mode"in t&&C.host(t)||null;return Boolean(e&&"shadowRoot"in e&&C.shadowRoot(e)===t)}function H(t){return"[object ShadowRoot]"==={}.toString.call(t)}var z=0;function W(t){var e,r,i=0===z,n=i?M():0;z+=1;try{var s=t.rules||t.cssRules;if(!s)return null;!function(t){0!==I&&(P.cssRuleCount+=q(t,null,0))}(s);var o=t.href;return!o&&t.ownerNode&&(o=t.ownerNode.baseURI),(r=Array.from(s,(t=>V(t,o))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(t){return null}finally{z-=1,i&&(e=M()-n,I>0&&(P.stylesheetMs+=e))}}function V(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=W(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return rt(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?rt(n,e):n}class Z{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),B(t)){var r=C.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function G(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Q(n);return(r[i.toLowerCase()]||a&&r[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Q(t){return t.toLowerCase()}var K="__rrweb_original__";function J(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Q(e):null}catch(t){return null}}var Y=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,X=/^(?:[a-z+]+:)?\/\//i,tt=/^www\..*/i,et=/^(data:)([^,]*),(.*)/i;function rt(t,e){return(t||"").replace(Y,((t,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return t;if(X.test(l)||tt.test(l))return"url("+u+l+u+")";if(et.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var it,nt,st="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",ot=4096,at=1e5,lt=10,ut=new Map,ht=1,dt=new RegExp("[^a-z0-9-_:]"),ct=-2;function vt(){return ht++}var ft=/^[^ \t\n\r\u000c]+/,pt=/^[, \t\n\r\u000c]+/,gt=new WeakMap;function mt(t,e){return e&&""!==e.trim()?yt(t,e):e}function yt(t,e){var r=gt.get(t);if(r||(r=t.createElement("a"),gt.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function bt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?st:t}(t,e.maxBase64ImageLength):t}function _t(t,e,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=mt(t,i);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,r,i){if(at>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>ot||t.naturalHeight>ot)return e;var n=ut.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(r||"image/webp",null!=i?i:.4),l=e.length>a.length?a:e;if(ut.size>=lt){var u=ut.keys().next().value;void 0!==u&&ut.delete(u)}return ut.set(e,{type:r,quality:i,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),bt(u,s)}if("image"===e)return bt(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=mt(t,i);return"image"===e&&h.startsWith("data:")?bt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(pt),e.length>r;){var s=i(ft);if(","===s.slice(-1))s=mt(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=mt(t,s);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?rt(i,yt(t)):"object"===e&&"data"===r?mt(t,i):i:mt(t,i)}function wt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function xt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&xt(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&xt(C.parentNode(t),e,r)}function kt(t,e,r,i){var n;if(B(t)){if(!C.childNodes(n=t).length)return!1}else{if(null===C.parentElement(t))return!1;n=C.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(xt(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function St(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var Tt=new Map;function Ct(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Et(t){return null==t?"":t.toLowerCase()}var Mt=50,It=!1,Rt=!1;function Pt(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,v=void 0===c?{}:c,p=e.maskTextFn,g=e.maskInputFn,m=e.slimDOMOptions,y=e.dataURLOptions,b=void 0===y?{}:y,_=e.inlineImages,w=void 0!==_&&_,x=e.recordCanvas,k=void 0!==x&&x,S=e.canvasMaskingConfigured,T=e.onSerialize,E=e.onIframeLoad,M=e.iframeLoadTimeout,R=void 0===M?5e3:M,O=e.onIframeListenerRegistered,L=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,D=void 0===F?5e3:F,N=e.keepIframeSrcFn,q=void 0===N?()=>!1:N,z=e.newlyAddedElement,V=void 0!==z&&z,Z=e.depth,Y=void 0===Z?0:Z,X=e.maxDepth,tt=void 0===X?Mt:X,et=e.needsMask,st=e.preserveWhiteSpace,ot=void 0===st||st;if(Y>=tt)return Rt=!0,It||(It=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+tt+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;et||(et=kt(t,o,a,void 0===et)),I>0&&(P.nodeCount+=1);var at,lt=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s,o=e.doc,a=e.inlineStylesheet,l=e.maskInputOptions,u=void 0===l?{}:l,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),x=function(t){if(t instanceof HTMLFormElement)return"form";var e=Q(t.tagName);return dt.test(e)?"div":e}(t),k={},S=t.attributes.length,T=0;S>T;T++){var E=t.attributes[T];wt(x,E.name)||(k[E.name]=_t(o,x,Q(E.name),E.value,t,c))}if("link"===x&&a&&!w){var M=t.sheet;if(!M){var R=function(t){return t.href}(t);R&&!(M=Ct(o,R))&&R.includes(".css")&&(M=Ct(o,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;M&&(j(M)?I>0&&A.push(t):P=W(M)),P&&(delete k.rel,delete k.href,k._cssText=P)}var O;if("style"===x&&t.sheet&&!(t.innerText||C.textContent(t)||"").trim().length){var L=W(t.sheet);L&&(k._cssText=L)}if("input"===x||"textarea"===x||"select"===x){var F=t.value,D=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&F?k.value=G({element:t,type:J(t),tagName:x,value:F,maskInputOptions:u,maskInputFn:h}):D&&(k.checked=D)}if("option"===x&&(t.selected&&!u.select?k.selected=!0:delete k.selected),"dialog"===x&&t.open)try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}if("canvas"===x&&p&&!(null==g?void 0:g()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((K in n?n[K]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var N=t.toDataURL(c.type,c.quality),q=o.createElement("canvas");q.width=t.width,q.height=t.height,N!==q.toDataURL(c.type,c.quality)&&(k.rr_dataURL=N)}if("img"===x&&v){it||(it=o.createElement("canvas"),nt=it.getContext("2d"));var B=t,U=B.currentSrc||B.getAttribute("src")||"<unknown-src>",H=B.crossOrigin,z=()=>{St(B,"load",z);try{it.width=B.naturalWidth,it.height=B.naturalHeight,nt.drawImage(B,0,0),k.rr_dataURL=it.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===B.crossOrigin&&(H?k.crossOrigin=H:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z)}if("audio"===x||"video"===x){var V=k;V.rr_mediaState=t.paused?"paused":"played",V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),w){var Z=t.getBoundingClientRect(),Y=Z.width,X=Z.height,tt=Z.left,et=Z.top,rt=null==(r=o.defaultView)?void 0:r.getComputedStyle(t);k={class:k.class,rr_width:Y+"px",rr_height:X+"px",rr_left:Math.floor(tt+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(et+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},rt&&(k.rr_position=rt.position||"static",rt.transform&&"none"!==rt.transform&&(k.rr_transform=rt.transform),rt.display&&rt.display.startsWith("inline")&&(k.rr_display=rt.display))}"iframe"!==x||m(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src);try{customElements.get(x)&&(s=!0)}catch(t){}return{type:f.Element,tagName:x,attributes:k,childNodes:[],isSVG:(O=t,Boolean("svg"===O.tagName||O.ownerSVGElement)||void 0),needBlock:w,rootId:_,isCustom:s}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,dataURLOptions:c,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:g,keepIframeSrcFn:m,newlyAddedElement:b,rootId:_});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,o=C.parentNode(t),a=o&&o.tagName,l=C.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(j(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var d=W(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=rt(l,yt(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,C.parentElement(t)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:_});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,keepIframeSrcFn:q,newlyAddedElement:V});if(!lt)return console.warn(t,"not serialized"),null;at=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Et(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Et(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Et(t.attributes.property).match(/^(og|twitter|fb):/)||Et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Et(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Et(t.attributes.name))||Et(t.attributes.property).match(/^article:/)||Et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Et(t.attributes.name)))return!0}}return!1}(lt,m)||!ot&<.type===f.Text&&!lt.isStyle&&!lt.textContent.replace(/^\s+|\s+$/gm,"").length?ct:vt();var ut=Object.assign(lt,{id:at});if(i.add(t,ut),at===ct)return null;T&&T(t);var ht=!u;if(ut.type===f.Element){ht=ht&&!ut.needBlock,delete ut.needBlock;var ft=C.shadowRoot(t);ft&&H(ft)&&(ut.isShadowHost=!0)}if((ut.type===f.Document||ut.type===f.Element)&&ht){m.headWhitespace&&ut.type===f.Element&&"head"===ut.tagName&&(ot=!1);var pt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:ot,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:O,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y+1,maxDepth:tt};if(ut.type===f.Element&&"textarea"===ut.tagName&&void 0!==ut.attributes.value);else for(var gt of Array.from(C.childNodes(t))){var mt=Pt(gt,pt);mt&&ut.childNodes.push(mt)}var bt=null;if(B(t)&&(bt=C.shadowRoot(t)))for(var xt of Array.from(C.childNodes(bt))){var Ot=Pt(xt,pt);Ot&&(H(bt)&&(Ot.isShadow=!0),ut.childNodes.push(Ot))}}var Lt=C.parentNode(t);if(Lt&&U(Lt)&&H(Lt)&&(ut.isShadow=!0),ut.type===f.Element&&"iframe"===ut.tagName){var At=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),St(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,r),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?St(t,"load",o):(a=!0,St(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),St(t,"load",o)}}return t.addEventListener("load",o),()=>{St(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var r=Pt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:ot,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:O,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y+1,maxDepth:tt});r&&E(t,r)}}),R);null==O||O(t,At)}return ut.type===f.Element&&"link"===ut.tagName&&"stylesheet"===ut.attributes.rel&&function(e,l,u){if(!Tt.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(L){var e=Pt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:ot,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y,maxDepth:tt});e&&L(t,e)}})()}finally{Tt.delete(e),c.abort()}}},_=setTimeout(y,u);c.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",y,{signal:c.signal,once:!0}),Tt.set(e,c)}}}(t,0,D),ut}function Ot(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Lt{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Lt))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function At(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Ft(r,t,e,i)}function Ft(t,e,r,i){$t((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function $t(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Dt="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",Nt={map:{},getId(){return console.error(Dt),-1},getNode(){return console.error(Dt),null},removeNodeFromMap(){console.error(Dt)},has(){return console.error(Dt),!1},reset(){console.error(Dt)}};function qt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function jt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>jt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Nt=new Proxy(Nt,{get(t,e,r){return"map"===e&&console.error(Dt),Reflect.get(t,e,r)}}));var Bt=Date.now;function Ut(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=C.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=C.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ht(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Wt(t){return t?t.nodeType===t.ELEMENT_NODE?t:C.parentElement(t):null}function Vt(t,e,r,i){if(!t)return!1;var n=Wt(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(xt(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Zt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===ct}function Gt(t,e){if(U(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=C.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Gt(i,e))}function Qt(t){return Boolean(t.changedTouches)}function Kt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Jt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Yt(t){return!!t&&(t instanceof Lt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(C.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Bt=()=>(new Date).getTime());class Xt{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function te(t){var e,r=null;return"getRootNode"in t&&(null==(e=C.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(t))&&(r=C.host(C.getRootNode(t))),r}function ee(t){var e=t.ownerDocument;return!!e&&(C.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=te(r);)r=e;return r}(t);return C.contains(e,r)}(t))}function re(t){return"__ln"in t}class ie{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&re(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&re(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var ne,se=(t,e)=>t+"@"+e;class oe{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"canvasMaskingConfigured"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e=M();try{this.processBufferedMutations()}finally{(t=M()-e)>F.slowestBatchMs&&(F.slowestBatchMs=t)}}})),a(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new ie,i=t=>{for(var e=t,r=ct;r===ct;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=C.parentNode(n);if(s&&ee(n)&&"TEXTAREA"!==s.tagName){var o=U(s)?this.mirror.getId(te(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=Pt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Kt(t,this.mirror)&&this.iframeManager.addIframe(t),Jt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Yt(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)le(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)ue(this.droppedSet,o)||le(this.removesSubTreeCache,o)?ue(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(C.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=C.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=C.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(C.childNodes(t),(t=>C.textContent(t)||"")).join("");e.attributes.value=G({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:J(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Zt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=C.textContent(t.target);Vt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:kt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Wt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=J(r);n=G({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Vt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!wt(r.tagName,i))if(o.attributes[i]=_t(this.doc,Q(r.tagName),Q(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&(a.style.cssText=t.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Vt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=U(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);Vt(t.target,this.blockClass,this.blockSelector,!1)||Zt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ae(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Gt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[se(r,i)]?ae(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!U(t.target)||!H(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),C.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Zt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[se(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Vt(t,this.blockClass,this.blockSelector,!1)||(C.childNodes(t).forEach((t=>this.genAdds(t))),Yt(t)&&C.childNodes(C.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function ae(t,e){t.delete(e),C.childNodes(e).forEach((e=>ae(t,e)))}function le(t,e,r){return 0!==t.size&&function(t,e,r){var i=C.parentNode(e);return!!i&&t.has(i)}(t,e)}function ue(t,e){return 0!==t.size&&he(t,e)}function he(t,e){var r=C.parentNode(e);return!!r&&(!!t.has(r)||he(t,r))}var de=t=>ne?function(){try{return t(...arguments)}catch(t){if(ne&&!0===ne(t))return;throw t}}:t,ce=[];function ve(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function fe(t,e){var r=new oe;ce.push(r),r.init(t);var i=new(S())(de(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),{observer:i,buffer:r}}function pe(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=ve(t);if(o&&!Vt(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=Ut(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var c=l+","+u;a.get(h)!==c&&(a.set(h,c),e({id:h,x:l,y:u}))}},u=[At("scroll",de(qt(de((t=>l(t))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(At("scrollend",de(l),r)),()=>u.forEach((t=>t()))}function ge(t,e){for(var r=ce.length-1;r>=0;r--){var i=ce[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),ce.splice(r,1))}}}var me=["INPUT","TEXTAREA","SELECT"],ye=new WeakMap;function be(t){return function t(e,r){if(ke("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ke("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ke("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ke("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function _e(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function we(t,e){var r,i,n,s,o=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:C.host(e));var a="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r;try{r=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return r}}),de((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function xe(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM){var o=fe(t,t.doc);i=o.observer,n=o.buffer}var a,l,c,f,p,g,m,y,b,_=function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=qt(de((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),d=de(qt(de((t=>{var e=ve(t),r=Qt(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;s||(s=Bt()),l.push({x:i,y:o,id:n.getId(e),timeOffset:Bt()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[At("mousemove",d,i),At("touchmove",d,i),At("drag",d,i)];return de((()=>{c.forEach((t=>t()))}))}(t),w=function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(h).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=Q(t),l=(t=>i=>{var a=ve(i);if(!Vt(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[t]===h.MouseDown?u="TouchStart":h[t]===h.MouseUp&&(u="TouchEnd"))}else Qt(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[t]===h.Click&&(l=c,c=null);var v=Qt(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),p=v.clientX,g=v.clientY;de(e)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(At(a,l,i))})),de((()=>{u.forEach((t=>t()))}))}(t),x=pe(t),k=function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return At("resize",de(qt(de((()=>{var t=Ht(),e=zt();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),S=function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=ve(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=C.parentElement(e)),e&&c&&me.indexOf(c)>=0&&!Vt(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=J(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[c.toLowerCase()]||u[g])&&(f=G({element:e,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=ye.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ye.set(t,i);var o=n.getId(t);de(e)(r({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>At(t,de(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>jt(t[0],t[1],{set(){de(c)({target:this,isTrusted:!1})}},!1,p)))),de((()=>{f.forEach((t=>t()))}))}(t),E=(l=(a=t).mediaInteractionCb,c=a.blockClass,f=a.blockSelector,p=a.mirror,g=a.sampling,m=a.doc,y=de((t=>qt(de((e=>{var r=ve(e);if(r&&!Vt(r,c,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,o=r.playbackRate,a=r.loop;l({type:t,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:o,loop:a})}})),g.media||500))),b=[At("play",y(v.Play),m),At("pause",y(v.Pause),m),At("seeked",y(v.Seeked),m),At("volumechange",y(v.VolumeChange),m),At("ratechange",y(v.RateChange),m)],de((()=>{b.forEach((t=>t()))}))),M=()=>{},I=()=>{},R=()=>{},P=()=>{};t.recordDOM&&(M=function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:de(((t,e,s)=>{var o=s[0],a=s[1],l=_e(e,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:de(((t,e,s)=>{var o=s[0],a=_e(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:de(((t,e,s)=>{var o=s[0],a=_e(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:de(((t,e,s)=>{var o=s[0],a=_e(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};Se("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(Se("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),Se("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),Se("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:de(((t,e,s)=>{var o=s[0],a=s[1],l=_e(e.parentStyleSheet,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:[...be(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:de(((t,e,s)=>{var o=s[0],a=_e(e.parentStyleSheet,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...be(e),o]}]}),t.apply(e,s)}))})})),de((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),I=we(t,t.doc),R=function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:de(((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2];if(n.has(u))return a.apply(e,[u,h,d]);var c=_e(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror),v=c.id,f=c.styleId;return(v&&-1!==v||f&&-1!==f)&&r({id:v,styleId:f,set:{property:u,value:h,priority:d},index:be(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:de(((t,e,o)=>{var a,u=o[0];if(n.has(u))return l.apply(e,[u]);var h=_e(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror),d=h.id,c=h.styleId;return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:u},index:be(e.parentRule)}),t.apply(e,o)}))}),de((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:s}),t.collectFonts&&(P=function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=T(r.fonts,"add",(function(t){return function(r){return setTimeout(de((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),de((()=>{n.forEach((t=>t()))}))}(t)));var O=function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=de((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;Vt(d,i,n,!0)||Vt(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),At("selectionchange",a)}(t),L=function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?T(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t),A=[];for(var F of t.plugins)A.push(F.observer(F.callback,s,F.options));return de((()=>{if(n){n.destroy(),n.reset();var e=ce.indexOf(n);-1!==e&&ce.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),_(),w(),x(),k(),S(),E(),M(),I(),R(),P(),O(),L(),A.forEach((t=>t()))}))}function ke(t){return void 0!==window[t]}function Se(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Te{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class Ce{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new Te(vt)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Te(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>$t(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Ft(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);$t((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}$t((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return e;case l.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case l.IncrementalSnapshot:switch(e.data.source){case u.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Ft(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Ft(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{$t((()=>this.mirror.removeNodeFromMap(t)))})),$t((()=>ge(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Ft(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Ft(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class Ee{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,n;if(H(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null==(n=C.host(t))?void 0:n.ownerDocument)&&void 0!==i?i:e,o=fe(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=ce.indexOf(l);-1!==t&&ce.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:pe(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(C.host(t))),this.restoreHandlers.push({doc:s,handler:we({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:T(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=C.shadowRoot(this);return s&&ee(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}var Me="skip-frame";function Ie(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oe=0;64>Oe;Oe++)Pe[Re.charCodeAt(Oe)]=Oe;var Le=new Map,Ae=(t,e,r)=>{if(t&&(De(t,e)||"object"==typeof t)){var i=function(t,e){var r=Le.get(t);return r||Le.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Fe(t,e,r,i){if(t instanceof Array)return t.map((t=>Fe(t,e,r,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Re[r[e]>>2],n+=Re[(3&r[e])<<4|r[e+1]>>4],n+=Re[(15&r[e+1])<<2|r[e+2]>>6],n+=Re[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Fe(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Fe(t.data,e,r,i),t.width,t.height]}:De(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ae(t,e,r)}:t}var $e=(t,e,r,i)=>t.map((t=>Fe(t,e,r,i))),De=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},Ne=["webgl","webgl2"];function qe(t){return"nodeType"in t}function je(t,e,i,n){var s=[];try{if(n){var o=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return T(n.prototype,"configure",(function(n){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||qe(o)&&Vt(o,e,i,!0))return n.call(this,s);qe(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(t,e,i);o&&s.push(o)}var a=T(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Vt(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&Ne.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...a])}}));s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function Be(t,e,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=T(t,l,(function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Ae(d,s,this),"tagName"in this.canvas&&!Vt(this.canvas,i,n,!0)){var c=$e(u,s,this,o);r(this.canvas,{type:e,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=jt(t,l,{set(t){r(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var Ue,He,ze,We='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',Ve="undefined"!=typeof self&&self.Blob&&new Blob([We],{type:"text/javascript;charset=utf-8"});function Ze(t){var e;try{if(!(e=Ve&&(self.URL||self.webkitURL).createObjectURL(Ve)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(We),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ge{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"resetFrameDedup",null),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,l=t.dataURLOptions,u=t.resolutionScale,h=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,s,l),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:l,resolutionScale:u,canvasMasking:h})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,u=je(r,i,n,!0),h=new Map;try{a=new Ze}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:c["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,g=t=>{var u,c;d||(p&&f>t-p||(p=t,(u=[],c=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Vt(t,i,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&c(t.shadowRoot)}))}catch(t){}},c(r.document),u).forEach(function(){var t=e((function*(t){var e,r,i=o.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.call(n))return void h.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(d*l)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return Me}if(void 0!==o){if(!Array.isArray(o)||!o.every(Ie))return Me;var a=r/n,l=i/s;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*a),r=Math.floor(t.y*l);return{x:e,y:r,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-r}}))}}}(s.canvasMasking,t,c,v,u,d);if(f===Me)return void h.set(i,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});a.postMessage({id:i,bitmap:p,width:c,height:v,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=je(t,e,r,!1),s=function(t,e,r,i,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=T(e.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Vt(this.canvas,r,i,!0)||setTimeout((()=>{var r=$e(l,e,this,n);t(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=jt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:c["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Be(e.WebGLRenderingContext.prototype,c.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Be(e.WebGL2RenderingContext.prototype,c.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s)));this.mutationCb({id:e,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Qe{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Xt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}inlineDeferredLinkElement(t,e){if(-1!==e&&t.isConnected){var r=null;try{var i=t.sheet;i&&(r=W(i))}catch(t){}r&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:r}}]})}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:V(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,Tt.forEach((t=>t.abort())),Tt.clear()}trackStylesheetInLinkElement(t){}}class Ke{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Je=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ye=document.createElement("iframe");document.body.appendChild(Ye),Array.from=(null==(n=Ye.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ye)}}catch(t){console.debug("Unable to override Array.from",t)}var Xe=new Z,tr=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function er(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function rr(t){var e;void 0===t&&(t={});var i=t,n=i.emit,s=i.checkoutEveryNms,o=i.checkoutEveryNth,a=i.blockClass,h=void 0===a?"rr-block":a,d=i.blockSelector,c=void 0===d?null:d,v=i.ignoreClass,f=void 0===v?"rr-ignore":v,p=i.ignoreSelector,g=void 0===p?null:p,m=i.maskTextClass,y=void 0===m?"rr-mask":m,b=i.maskTextSelector,_=void 0===b?null:b,w=i.inlineStylesheet,x=void 0===w||w,k=i.inlineStylesheetBudgetRules,S=void 0===k?1e4:k,T=i.maskAllInputs,F=i.maskInputOptions,N=i.slimDOMOptions,q=i.maskInputFn,j=i.maskTextFn,B=i.hooks,U=i.packFn,H=i.sampling,z=void 0===H?{}:H,W=i.dataURLOptions,V=void 0===W?{}:W,G=i.canvasResolutionScale,Q=i.canvasMasking,K=i.mousemoveWait,J=i.recordDOM,Y=void 0===J||J,X=i.recordCanvas,tt=void 0!==X&&X,et=i.recordCrossOriginIframes,rt=void 0!==et&&et,it=i.recordAfter,nt=void 0===it?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":it,st=i.userTriggeredOnInput,ot=void 0!==st&&st,at=i.collectFonts,lt=void 0!==at&&at,ut=i.inlineImages,ht=void 0!==ut&&ut,dt=i.plugins,ct=i.keepIframeSrcFn,vt=void 0===ct?()=>!1:ct,ft=i.ignoreCSSAttributes,pt=void 0===ft?new Set([]):ft,gt=i.attributeFilter;ne=i.errorHandler;var mt=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},V),yt=!rt||window.parent===window,bt=!1;if(!yt)try{window.parent.document&&(bt=!1)}catch(t){bt=!0}if(yt&&!n)throw new Error("emit function is required");if(!yt&&!bt)return()=>{};void 0!==K&&void 0===z.mousemove&&(z.mousemove=K),Xe.reset();var _t,wt=!0===T?{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!==F?F:{password:!0},xt=Ot(void 0!==N&&N);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var kt,St,Tt=0,Ct=new Map,Et=t=>{for(var e of dt||[])e.eventProcessor&&(t=e.eventProcessor(t));return U&&!bt&&(t=U(t)),t};Ue=(t,e)=>{var r,i=t;if(i.timestamp=Bt(),!(null==(r=ce[0])?void 0:r.isFrozen())||i.type===l.FullSnapshot||i.type===l.IncrementalSnapshot&&tr.has(i.data.source)||ce.forEach((t=>t.unfreeze())),yt)null==n||n(Et(i),e);else if(bt){var a={type:"rrweb",event:Et(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(i.type===l.FullSnapshot)_t=i,Tt=0;else if(i.type===l.IncrementalSnapshot){if(i.data.source===u.Mutation&&i.data.isAttachIframe)return;Tt++,(o&&Tt>=o||s&&i.timestamp-_t.timestamp>s)&&He(!0)}};var Mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Xe.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=Ft.getIframeElementById(r);n&&i.has(n)?Ft.forgetIframeId(r):(null==kt||kt(r),Ft.removeIframeById(r))}})),null==St||St(),Ft.cleanupDetachedIframes()}Ue({type:l.IncrementalSnapshot,data:r({source:u.Mutation},t)})},It=t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.Scroll},t)}),Rt=t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),Lt=new Qe({mutationCb:Mt,adoptedStyleSheetCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Ft=new Ce({mirror:Xe,mutationCb:Mt,stylesheetManager:Lt,recordCrossOriginIframes:rt,wrappedEmit:Ue});for(var Dt of dt||[])Dt.getMirror&&Dt.getMirror({nodeMirror:Xe,crossOriginIframeMirror:Ft.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ft.crossOriginIframeStyleMirror});var Nt=new Ke,qt=null==Q?void 0:Q.configured;ze=new Ge({recordCanvas:tt,mutationCb:Rt,win:window,blockClass:h,blockSelector:c,mirror:Xe,sampling:z.canvas,dataURLOptions:mt,resolutionScale:G,canvasMasking:Q});var jt=new Ee({mutationCb:Mt,scrollCb:It,bypassOptions:{blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:_,inlineStylesheet:x,maskInputOptions:wt,dataURLOptions:mt,maskTextFn:j,maskInputFn:q,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,sampling:z,slimDOMOptions:xt,iframeManager:Ft,stylesheetManager:Lt,canvasManager:ze,keepIframeSrcFn:vt,processedNodeManager:Nt,attributeFilter:gt},mirror:Xe});He=function(t){if(void 0===t&&(t=!1),Y){Ue({type:l.Meta,data:{href:window.location.href,width:zt(),height:Ht()}},t),null==e||e(),e=void 0,Lt.reset(),jt.init(),ce.forEach((t=>t.lock()));var r,i,n=null;try{n=function(t,e){var r,i=e||{},n=i.mirror,s=void 0===n?new Z:n,o=i.blockClass,a=void 0===o?"rr-block":o,l=i.blockSelector,u=void 0===l?null:l,h=i.maskTextClass,d=void 0===h?"rr-mask":h,c=i.maskTextSelector,v=void 0===c?null:c,f=i.inlineStylesheet,p=void 0===f||f,g=i.inlineImages,m=void 0!==g&&g,y=i.recordCanvas,b=void 0!==y&&y,_=i.canvasMaskingConfigured,w=i.maskAllInputs,x=void 0!==w&&w,k=i.maskTextFn,S=i.maskInputFn,T=i.slimDOM,C=i.dataURLOptions,F=i.preserveWhiteSpace,N=i.onSerialize,q=i.onIframeLoad,j=i.iframeLoadTimeout,B=i.onIframeListenerRegistered,U=i.onStylesheetLoad,H=i.stylesheetLoadTimeout,z=i.keepIframeSrcFn,W=void 0===z?()=>!1:z,V=i.maxDepth,G=i.inlineStylesheetBudgetRules,Q=!0===x?{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===x?{password:!0}:x,K=Ot(void 0!==T&&T);r=G,(I+=1)>1||(P=E(),A=[],L=D(r),R=M());try{return Pt(t,{doc:t,mirror:s,blockClass:a,blockSelector:u,maskTextClass:d,maskTextSelector:v,skipChild:!1,inlineStylesheet:p,maskInputOptions:Q,maskTextFn:k,maskInputFn:S,slimDOMOptions:K,dataURLOptions:C,inlineImages:m,recordCanvas:b,canvasMaskingConfigured:_,preserveWhiteSpace:F,onSerialize:N,onIframeLoad:q,iframeLoadTimeout:j,onIframeListenerRegistered:B,onStylesheetLoad:U,stylesheetLoadTimeout:H,keepIframeSrcFn:W,newlyAddedElement:!1,maxDepth:V})}finally{0===I?O||E():(I-=1)>0||(P.durationMs=M()-R,P.deferredStylesheetCount=A.length,L=null,O=P)}}(document,{mirror:Xe,blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:_,inlineStylesheet:x,maskAllInputs:wt,inlineStylesheetBudgetRules:S,maskTextFn:j,maskInputFn:q,slimDOM:xt,dataURLOptions:mt,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,onSerialize(t){Kt(t,Xe)&&Ft.addIframe(t),Jt(t,Xe)&&Lt.trackLinkElement(t),Yt(t)&&jt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){Ft.attachIframe(t,e),jt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Ft.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Lt.attachLinkElement(t,e)},keepIframeSrcFn:vt})}finally{r=A,A=[],i=r}if(!n)return console.warn("Failed to snapshot the document");Ue({type:l.FullSnapshot,data:{node:n,initialOffset:Ut(window)}},t),ce.forEach((t=>t.unlock())),ze.onFullSnapshot(),i.length&&(e=function(t,r,i){var n=!1,s=null,o=0,a=i=>{if(s=null,!n){var l=function(){var e=t[o];t[o]=null,o+=1,e&&$t((()=>r.inlineDeferredLinkElement(e,Xe.getId(e))))};do{l()}while(t.length>o&&i&&!i.didTimeout&&i.timeRemaining()>5);t.length>o?s=er(a):e=void 0}};return s=er(a),()=>{n=!0,null==s||s.cancel(),s=null}}(i,Lt)),rt&&Ft.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Lt.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))}};try{var Wt=[];kt=t=>{var e=Ct.get(t);e&&(e.forEach((t=>{$t(t);var e=Wt.indexOf(t);-1!==e&&Wt.splice(e,1)})),Ct.delete(t))},St=()=>{for(var t of Ct){var e=t[0],r=Xe.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==kt||kt(e)}catch(t){null==kt||kt(e)}else null==kt||kt(e)}};var Vt=t=>{var e;return de(xe)({mutationCb:Mt,mousemoveCb:(t,e)=>Ue({type:l.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:It,viewportResizeCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:Rt,fontCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){Ue({type:l.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){Ue({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:g,maskTextClass:y,maskTextSelector:_,maskInputOptions:wt,inlineStylesheet:x,sampling:z,recordDOM:Y,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,userTriggeredOnInput:ot,collectFonts:lt,doc:t,maskInputFn:q,maskTextFn:j,keepIframeSrcFn:vt,blockSelector:c,slimDOMOptions:xt,dataURLOptions:mt,mirror:Xe,iframeManager:Ft,stylesheetManager:Lt,shadowDomManager:jt,processedNodeManager:Nt,canvasManager:ze,ignoreCSSAttributes:pt,attributeFilter:gt,plugins:(null==(e=null==dt?void 0:dt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Ue({type:l.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},B)};Ft.addLoadListener((t=>{try{var e=Xe.getId(t),r=Vt(t.contentDocument);if(Wt.push(r),-1!==e){var i=Ct.get(e);i||Ct.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),Ft.addPageHideListener((t=>{var e=Xe.getId(t);null==kt||kt(e),ge(t)}));var Zt=-1,Gt=t=>Ue({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Qt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Xe.getId(s):-1;o!==Zt&&(-1!==Zt&&Gt({id:Zt,enter:!1}),Zt=o,-1!==o&&Gt({id:o,enter:!0}))},Xt=()=>{He(),Wt.push(Vt(document)),Wt.push(At("fullscreenchange",Qt)),Wt.push(At("webkitfullscreenchange",Qt)),Wt.push(At("mozfullscreenchange",Qt)),Wt.push(At("MSFullscreenChange",Qt)),Je=!0};return["interactive","complete"].includes(document.readyState)?Xt():(Wt.push(At("DOMContentLoaded",(()=>{Ue({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===nt&&Xt()}))),Wt.push(At("load",(()=>{Ue({type:l.Load,data:{}}),"load"===nt&&Xt()}),window))),()=>{null==e||e(),e=void 0,Wt.forEach((t=>$t(t))),Nt.destroy(),Ft.removeLoadListener(),Ft.destroy(),Ct.clear(),jt.reset(),Xe.reset(),Je=!1,ne=void 0}}catch(t){console.warn(t)}}rr.addCustomEvent=(t,e)=>{if(!Je)throw new Error("please add custom event after start recording");Ue({type:l.Custom,data:{tag:t,payload:e}})},rr.freezePage=()=>{ce.forEach((t=>t.freeze()))},rr.takeFullSnapshot=t=>{if(!Je)throw new Error("please take full snapshot after start recording");He(t)},rr.mirror=Xe;var ir=Object.defineProperty,nr=(t,e,r)=>((t,e,r)=>e in t?ir(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class sr{constructor(t){nr(this,"fileName"),nr(this,"functionName"),nr(this,"lineNumber"),nr(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var or=/(^|@)\S+:\d+/,ar=/^\s*at .*(\S+:\d+|\(native\))/m,lr=/^(eval@)?(\[native code])?$/,ur={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(ar)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(ar)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new sr({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(lr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new sr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new sr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new sr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new sr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(or)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new sr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function hr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function dr(t){return Array.isArray(t)}function cr(t){return"object"==typeof t&&null!==t&&!dr(t)}function vr(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(cr(t[i])&&vr(t[i],e-1))return!0;return!1}function fr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(cr(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||cr(o)&&vr(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=dr(u)?hr(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var pr={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 gr(t,e,r){var i,n=r?Object.assign({},pr,r):pr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=ur.parse(e.error).map((t=>t.toString())),s=[fr(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[fr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[fr("Uncaught (in promise)",n.stringifyOptions),fr(e.reason,n.stringifyOptions)]);var s=ur.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=ur.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((t=>fr(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[fr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var mr=t=>({name:"rrweb/console@1",observer:gr,options:t}),yr=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function br(t){return"string"==typeof t||t}function _r(t){return"string"==typeof t?t:void 0}var wr,xr=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],kr=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),Sr=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Tr="min_length",Cr="max_length",Er=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],Mr=["token"],Ir="NativeGzipValidationError",Rr=t=>t.length>=2&&31===t[0]&&139===t[1],Pr=(t,e)=>t===Sr.GZipJS||e===Sr.GZipJS||"gzip"===e,Or=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Lr=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Ir,e},Ar=function(){var t=e((function*(t,e){18>t.size&&Lr("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());Rr(r)&&8===r[2]||Lr("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(wr)return wr;wr=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;wr[t]=e>>>0}return wr})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Lr("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&Lr("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function Fr(){return Fr=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var t=e((function*(t){try{yield o.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield Ar(u,n),u}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),Fr.apply(this,arguments)}var $r=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Dr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return $r.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function Nr(t,e){return-1!==t.indexOf(e)}var qr=function(t){return t.trim()},jr=function(t){return t.replace(/^\$/,"")};function Br(t){var e,r=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(e))return"[Circular]";r.push(e)}return e}})))&&void 0!==e?e:"null"}var Ur=Object.prototype,Hr=Ur.hasOwnProperty,zr=Ur.toString,Wr=Array.isArray||function(t){return"[object Array]"===zr.call(t)},Vr=t=>"function"==typeof t,Zr=t=>t===Object(t)&&!Wr(t),Gr=t=>{if(Zr(t)){for(var e in t)if(Hr.call(t,e))return!1;return!0}return!1},Qr=t=>void 0===t,Kr=t=>"[object String]"==zr.call(t),Jr=t=>Kr(t)&&0===t.trim().length,Yr=t=>null===t,Xr=t=>Qr(t)||Yr(t),ti=t=>"[object Number]"==zr.call(t)&&t==t,ei=t=>ti(t)&&t>0,ri=t=>"[object Boolean]"===zr.call(t),ii=t=>t instanceof FormData,ni=t=>Nr(Er,t),si=t=>Nr(Mr,t);function oi(t){return null===t||"object"!=typeof t}function ai(t,e){return{}.toString.call(t)==="[object "+e+"]"}function li(t){return"undefined"!=typeof Event&&ui(t,Event)}function ui(t,e){try{return t instanceof e}catch(t){return!1}}var hi=[!0,"true",1,"1","yes"],di=t=>Nr(hi,t),ci=[!1,"false",0,"0","no"];function vi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ti(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),vi(n||r,e,r,i))}class fi{constructor(t){this.tt={},this.et=t.et,this.it=vi(t.bucketSize,0,100,t.rt),this.nt=vi(t.refillRate,0,this.it,t.rt),this.st=vi(t.refillInterval,0,864e5,t.rt)}ot(t,e){var r=Math.floor((e-t.lastAccess)/this.st);r>0&&(t.tokens=Math.min(t.tokens+r*this.nt,this.it),t.lastAccess=t.lastAccess+r*this.st)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.tt[i];return n?this.ot(n,r):this.tt[i]=n={tokens:this.it,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.et)||e.call(this,t)),0===n.tokens)}stop(){this.tt={}}}var pi="Mobile",gi="iOS",mi="Android",yi="Tablet",bi=mi+" "+yi,_i="iPad",wi="Apple",xi=wi+" Watch",ki="Safari",Si="BlackBerry",Ti="Samsung",Ci=Ti+"Browser",Ei=Ti+" Internet",Mi="Chrome",Ii=Mi+" OS",Ri=Mi+" "+gi,Pi="Internet Explorer",Oi=Pi+" "+pi,Li="Opera",Ai=Li+" Mini",Fi="Edge",$i="Microsoft "+Fi,Di="Firefox",Ni=Di+" "+gi,qi="Nintendo",ji="PlayStation",Bi="Xbox",Ui=mi+" "+pi,Hi=pi+" "+ki,zi="Windows",Wi=zi+" Phone",Vi="Nokia",Zi="Ouya",Gi="Generic",Qi=Gi+" "+pi.toLowerCase(),Ki=Gi+" "+yi.toLowerCase(),Ji="Konqueror",Yi="Oculus Browser",Xi="Vivaldi",tn="Yandex",en="Whale",rn="DuckDuckGo",nn="Pale Moon",sn="Waterfox",on="Brave",an="Google Search App",ln="(\\d+(\\.\\d+)?)",un=new RegExp("Version/"+ln),hn=new RegExp(Bi,"i"),dn=new RegExp(ji+" \\w+","i"),cn=new RegExp(qi+" \\w+","i"),vn=new RegExp(Si+"|PlayBook|BB10","i"),fn={"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"},pn=function(t,e,r,i){e=e||"";var n=function(t){return null!=t&&t.brave?on:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&Nr(t,"GSA/")?an:Nr(t," OPR/")&&Nr(t,"Mini")?Ai:Nr(t," OPR/")?Li:vn.test(t)?Si:Nr(t,"IE"+pi)||Nr(t,"WPDesktop")?Oi:Nr(t,"OculusBrowser")?Yi:Nr(t,Ci)?Ei:Nr(t,Fi)||Nr(t,"Edg/")?$i:Nr(t,Xi+"/")?Xi:Nr(t,"YaBrowser/")?tn:Nr(t,en+"/")?en:Nr(t,rn+"/")||Nr(t,"Ddg/")?rn:Nr(t,"FBIOS")?"Facebook "+pi:Nr(t,"UCWEB")||Nr(t,"UCBrowser")?"UC Browser":Nr(t,"CriOS")?Ri:Nr(t,"CrMo")||Nr(t,Mi)?Mi:Nr(t,mi)&&Nr(t,ki)?Ui:Nr(t,"FxiOS")?Ni:Nr(t.toLowerCase(),Ji.toLowerCase())?Ji:Nr(t,on+"/")?on:((t,e)=>e&&Nr(e,wi)||function(t){return Nr(t,ki)&&!Nr(t,Mi)&&!Nr(t,mi)}(t))(t,e)?Nr(t,pi)?Hi:ki:Nr(t,"PaleMoon/")?nn:Nr(t,sn+"/")?sn:Nr(t,Di)?Di:Nr(t,"MSIE")||Nr(t,"Trident/")?Pi:Nr(t,"Gecko")?Di:"")},gn={[Oi]:[new RegExp("rv:"+ln)],[$i]:[new RegExp(Fi+"?\\/"+ln)],[Mi]:[new RegExp("("+Mi+"|CrMo)\\/"+ln)],[Ri]:[new RegExp("CriOS\\/"+ln)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ln)],[ki]:[un],[Hi]:[un],[Li]:[new RegExp("(Opera|OPR)\\/"+ln)],[Di]:[new RegExp(Di+"\\/"+ln)],[Ni]:[new RegExp("FxiOS\\/"+ln)],[Ji]:[new RegExp("Konqueror[:/]?"+ln,"i")],[Si]:[new RegExp(Si+" "+ln),un],[Ui]:[new RegExp("android\\s"+ln,"i")],[Ei]:[new RegExp(Ci+"\\/"+ln)],[Yi]:[new RegExp("OculusBrowser\\/"+ln)],[Xi]:[new RegExp(Xi+"\\/"+ln)],[tn]:[new RegExp("YaBrowser\\/"+ln)],[en]:[new RegExp(en+"\\/"+ln)],[on]:[new RegExp(on+"\\/"+ln)],[rn]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ln)],[nn]:[new RegExp("PaleMoon\\/"+ln)],[sn]:[new RegExp(sn+"\\/"+ln)],[an]:[new RegExp("GSA\\/"+ln)],[Pi]:[new RegExp("(rv:|MSIE )"+ln)],Mozilla:[new RegExp("rv:"+ln)]},mn=function(t,e,r,i){var n=pn(t,e,r,i),s=gn[n];if(Qr(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},yn=[[new RegExp(Bi+"; "+Bi+" (.*?)[);]","i"),t=>[Bi,t&&t[1]||""]],[new RegExp(qi,"i"),[qi,""]],[new RegExp(ji,"i"),[ji,""]],[vn,[Si,""]],[new RegExp(zi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Wi,""];if(new RegExp(pi).test(e)&&!/IEMobile\b/.test(e))return[zi+" "+pi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=fn[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[zi,i]}return[zi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[gi,[t[3],t[4],t[5]||"0"].join(".")]:[gi,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Qr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+mi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mi+")","i"),t=>t&&t[2]?[mi,[t[2],t[3],t[4]||"0"].join(".")]:[mi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ii,""]],[/Linux|debian/i,["Linux",""]]],bn=function(t){return cn.test(t)?qi:dn.test(t)?ji:hn.test(t)?Bi:new RegExp(Zi,"i").test(t)?Zi:new RegExp("("+Wi+"|WPDesktop)","i").test(t)?Wi:/iPad/.test(t)?_i:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?xi:vn.test(t)?Si:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Vi,"i").test(t)?Vi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(pi).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?mi:bi:new RegExp("(pda|"+pi+")","i").test(t)?Qi:new RegExp(yi,"i").test(t)&&!new RegExp(yi+" pc","i").test(t)?Ki:""},_n=function(t,e){var r,i,n,s,o=bn(t);return o===_i||o===bi||"Kobo"===o||"Kindle Fire"===o||o===Ki?yi:o===qi||o===Bi||o===ji||o===Zi?"Console":o===xi?"Wearable":o?pi:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?pi:yi:"Desktop"},wn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xn(t,e){return"string"==typeof(r=t)&&wn.test(r)?t:e();var r}function kn(t){return t?t.split("#")[0]:t}function Sn(t,e){var r=setTimeout(t,e);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}function Tn(t,e,r){return Cn.apply(this,arguments)}function Cn(){return(Cn=e((function*(t,e,r){var i;try{return yield Promise.race([t,new Promise(((t,n)=>{i=Sn((()=>{try{null==r||r(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(i)}}))).apply(this,arguments)}var En=t=>t instanceof Error,Mn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},In=Mn.info;function Rn(t){if(ri(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(Wr(t))return{arrayValue:{values:t.map((t=>Rn(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Pn(t){var e=[];for(var r in t){var i=t[r];Yr(i)||Qr(i)||e.push({key:r,value:Rn(i)})}return e}function On(t,e){var i=Mn[t.level||"info"]||In,n=i.text,s=i.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Xr(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Xr(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=r({},a,t.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:Pn(l)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Qr(t.trace_flags)||(u.flags=t.trace_flags),u}function Ln(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function An(t,e,r,i){return{resourceLogs:[{resource:{attributes:Pn(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}let Fn=class{constructor(t,e,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Pe=e,this.rt=r,this.ut=i,this.ht=n,this.dt=s,this.vt=o,this.ct=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.Mt=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Et(),this.ct=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Pe.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.It()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.Pt(t);if(null!==e)if(e.body){if(this.Rt()){var r={record:On(e,this.ut())};this.ht((()=>this.Lt(r)))}}else this.rt.info("Log was rejected in beforeSend function")}}Pt(t){var e=this.Pe.beforeSend;if(!e)return t;var r=Wr(e)?e:[e],i=t;for(var n of r)try{var s=n(i);if(!s)return this.rt.info("Log was rejected in beforeSend function"),null;i=s}catch(t){return this.rt.error("Error in beforeSend function for log:",t),null}return i}Rt(){if(void 0===this.Tt)return!0;var t=Date.now(),e=t-this.bt;return this.Mt>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.rt.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var t=this;return e((function*(){if(!t._instance.isDisabled)return t.ct||(t.ct=t.Ot().finally((()=>{t.ct=null}))),t.ct}))()}Ot(){var t=this;return e((function*(){var e;t.Et();var r=null!==(e=t._instance.getPersistedProperty(kr.LogsQueue))&&void 0!==e?e:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;t.ft=0;var a=Math.min(r.length,t.Ct),l=r.slice(0,a),u=l.map((t=>t.record)),h=An(u,t.Ft(),null!==(s=t.vt)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.At(h);if("too-large"===d.kind&&l.length>1)t.Ct=Math.max(1,Math.floor(l.length/2)),t.rt.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ct);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.rt.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.Pe.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Pe.maxBatchRecordsPerPost,t.Ct+1)),yield t.Dt(l.length),r=null!==(o=t._instance.getPersistedProperty(kr.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}Dt(t){var r=this;return e((function*(){var e,i=Math.max(0,t-r.ft),n=null!==(e=r._instance.getPersistedProperty(kr.LogsQueue))&&void 0!==e?e:[];r._instance.setPersistedProperty(kr.LogsQueue,n.slice(i)),yield r.dt()}))()}Ft(){return Ln(this.Pe,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Lt(t){var e;if(!this._instance.optedOut){var r=null!==(e=this._instance.getPersistedProperty(kr.LogsQueue))&&void 0!==e?e:[];this.kt>r.length||(r.shift(),this.ft++,this.rt.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(kr.LogsQueue,r),this.xt>r.length?this.$t():this.It()}}$t(t){void 0===t&&(t=this.St),this.Nt||(this.Nt=Sn((()=>{this.Nt=void 0,this.It()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(kr.LogsQueue);return!!t&&t.length>0}shutdown(t){var r=this;return e((function*(){r.Et();var e=r.flush().catch((()=>{}));void 0!==t?yield Tn(e,t):yield e}))()}flushWithTimeout(t){var r=this;return e((function*(){var e=r.flush();yield Tn(e,t,(()=>{e.catch((()=>{}))}))}))()}It(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.rt.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.$t(this.qt())}))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var $n=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Dn(t){return String(t)+"000000"}function Nn(t,e,r,i){var n="";return i&&(n=Object.keys(i).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(i[t]))).join(",")),t+"\0"+e+"\0"+(null!=r?r:"")+"\0"+n}let qn=class{constructor(t,e,r){this._instance=t,this.Pe=e,this.rt=r,this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Wt=0}count(t,e,r){void 0===e&&(e=1),this.Vt({name:t,type:"count",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(t,e,r){this.Vt({name:t,type:"gauge",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(t,e,r){this.Vt({name:t,type:"histogram",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var t=this,r=this.ct,i=function(){var i=e((function*(){r&&(yield r.catch((()=>{}))),yield t.Zt()}));return function(){return i.apply(this,arguments)}}(),n=i().finally((()=>{this.ct===n&&(this.ct=null)}));return this.ct=n,n}drainWindow(){if(0===this.Bt.size)return null;var t=this.Bt;return this.Bt=new Map,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Wt++,this.Et(),this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set}Vt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Pt(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.rt.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,n;try{i=e.attributes?r({},e.attributes):void 0,n=Nn(e.type,e.name,e.unit,i)}catch(t){return void this.rt.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Bt.get(n);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Bt.set(n,s)}var o=this.Ut.get(e.name);void 0===o?this.Ut.set(e.name,e.type):o===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.rt.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.$t()}else this.rt.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.rt.warn("Dropping metric with empty name")}}Qt(){return this.Pe.maxSeriesPerFlush>this.Bt.size||(this.Ht||(this.Ht=!0,this.rt.warn("Metric series cap reached ("+this.Pe.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var r;switch(t.type){case"count":t.total=(null!==(r=t.total)&&void 0!==r?r:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array($n.length+1).fill(0)});var i=t.hist;i.count+=1,i.sum+=e,i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.bucketCounts[function(t,e){for(var r=0;e.length>r;r++)if(e[r]>=t)return r;return e.length}(e,$n)]+=1}}Pt(t){var e=this.Pe.beforeSend;if(!e)return t;var r=Wr(e)?e:[e],i=t;for(var n of r)try{var s=n(i);if(!s)return this.rt.info("Metric was rejected in beforeSend function"),null;i=s}catch(t){return this.rt.error("Error in beforeSend function for metric:",t),null}return i}$t(){this.Nt||(this.Nt=Sn((()=>{this.Nt=void 0,this.flush().catch((t=>{this.rt.error("Metrics flush failed:",t)}))}),this.Pe.flushIntervalMs))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}Zt(){var t=this;return e((function*(){if(0!==t.Bt.size){var e=t.Bt;t.Bt=new Map,t.Ht=!1,t.Ut=new Map,t.zt=new Set;var r=t.Wt,i=yield t._instance.Kt(t.Gt(e));if(r===t.Wt)switch(i.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.$t();case"too-large":return void t.rt.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.rt.error("Failed to send metrics batch:",i.error)}}}))()}Gt(t){return e=this.Xt(t),i=function(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}(this.Pe,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Pn(i)},scopeMetrics:[{scope:{name:n,version:s},metrics:e}]}]};var e,i,n,s}Xt(t){var e=Dn(Date.now()),i=new Map;for(var n of t.values()){var s,o=Nn(n.type,n.name,n.unit,void 0),a=i.get(o);a||(a=r({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(o,a));var l=Pn(null!==(s=n.attributes)&&void 0!==s?s:{}),u=Dn(n.windowStartMs);if("count"===n.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=n.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===n.type){var c,v={attributes:l,timeUnixNano:e,asDouble:null!==(c=n.last)&&void 0!==c?c:0};a.gauge.dataPoints.push(v)}else n.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:$n})}return Array.from(i.values())}Yt(t){var e,r;for(var i of t){var n=i[0],s=i[1],o=this.Bt.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(r=s.total)&&void 0!==r?r:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Qt()&&this.Bt.set(n,s)}}};function jn(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var Bn,Un,Hn;function zn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Hn&&r.length===Un||(Un=r.length,Hn=r.reduce(((r,i)=>{Bn||(Bn={});var n=Bn[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,Bn[i]=[l,u];break}}return r}),{})),Hn}}class Wn{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Wr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:zn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Vn="?";function Zn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Vn:r,in_app:!0};return Qr(i)||(s.lineno=i),Qr(n)||(s.colno=n),s}var Gn=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:Vn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Qn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Kn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Jn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yn=(t,e)=>{var r=Qn.exec(t);if(r)return Zn(e,r[1],Vn,+r[2],+r[3]);var i=Kn.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=Jn.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var s=Gn(i[1]||Vn,i[2]);return Zn(e,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Xn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ts=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,es=(t,e)=>{var r=Xn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=ts.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||Vn,o=Gn(s,n);return Zn(e,n=o[1],s=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},rs=/\(error: (.*)\)/,is=50;class ns{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Kr(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return ai(t,"DOMException")}isDOMError(t){return ai(t,"DOMError")}}class ss{match(t){return function(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return ui(t,Error)}}(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class os{constructor(){}match(t){return!!ai(t,"ErrorEvent")&&(null!=t.error||this.fe(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var n=e.apply(t.message);return r({},n,{stack:null!==(i=this.pe(t))&&void 0!==i?i:n.stack,synthetic:!0})}fe(t){return Kr(t.message)&&t.message.length>0}pe(t){var e=t;if(Kr(e.filename)&&e.filename.length>0){var r,i,n=null!==(r=e.lineno)&&void 0!==r?r:0,s=null!==(i=e.colno)&&void 0!==i?i:0;return"Error\n at "+e.filename+":"+n+":"+s}}}var as=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class ls{match(t){return"string"==typeof t}coerce(t,e){var r,i=this.getInfos(t),n=i[0],s=i[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(as);return i&&(e=i[1],r=i[2]),[e,r]}}var us=["fatal","error","warning","log","info","debug"];function hs(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class ds{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(r=this.getStack(t))&&void 0!==r?r:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return li(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+hs(t)}isSeverityLevel(t){return Kr(t)&&!Jr(t)&&us.indexOf(t)>=0}getStack(t){try{return Kr(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Kr(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(En(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class cs{match(t){return li(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+hs(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class vs{match(t){return oi(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class fs{match(t){return ai(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!li(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return oi(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var ps="$message",gs="$timestamp",ms=new Set([ps,gs]),ys={enabled:!0,max_bytes:32768};function bs(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:ys.enabled,max_bytes:ws(t.max_bytes,ys.max_bytes)}:r({},ys)}class _s{constructor(t){this.Je=[],this.Ke=0,this.Pe=bs(t)}setConfig(t){this.Pe=bs(t),this.Xe()}add(t){var e=function(t){var e;try{e=Br(t)}catch(t){return}try{var r=JSON.parse(e);if(!Zr(r))return;var i=r,n=i[ps],s=i[gs];if(!Kr(n)||0===n.trim().length)return;if(!Kr(s)&&!ti(s))return;return{step:i,json:e}}catch(t){return}}(t);if(e){var r=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),r=0,i=0;e.length>i;i++)"%"===e[i]?(r+=1,i+=2):r+=1;return r}(e.json);r>this.Pe.max_bytes||(this.Je.push({step:e.step,bytes:r}),this.Ke+=r,this.Xe())}}getAttachable(){return this.Je.map((t=>t.step))}clear(){this.Je=[],this.Ke=0}size(){return this.Je.length}Xe(){for(;this.Ke>this.Pe.max_bytes&&this.Je.length>0;){var t=this.Je.shift();t&&(this.Ke-=t.bytes)}}}function ws(t,e){if(!ti(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var xs="undefined"!=typeof window?window:void 0,ks="undefined"!=typeof globalThis?globalThis:xs,Ss=null==ks?void 0:ks.navigator,Ts=null==ks?void 0:ks.document,Cs=null==ks?void 0:ks.location,Es=null==ks?void 0:ks.fetch,Ms=null!=ks&&ks.XMLHttpRequest&&"withCredentials"in new ks.XMLHttpRequest?ks.XMLHttpRequest:void 0,Is=null==ks?void 0:ks.AbortController,Rs=null==ks?void 0:ks.CompressionStream,Ps=null==Ss?void 0:Ss.userAgent;function Os(){return!(!xs||!1===xs.navigator.onLine)}var Ls=t=>"undefined"!=typeof Document&&t instanceof Document,As={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"},Fs=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={k(e){if(xs&&(As.DEBUG||xs.POSTHOG_DEBUG||r)&&!Qr(xs.console)&&xs.console){for(var i=("__rrweb_original__"in xs.console[e]?xs.console[e].__rrweb_original__:xs.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Fs(t+" "+e,r)};return i},$s=Fs("[PostHog.js]"),Ds=$s.createLogger;function Ns(t,e){Wr(t)&&t.forEach(e)}function qs(t,e){if(!Xr(t))if(Wr(t))t.forEach(e);else if(ii(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Hr.call(t,r)&&e(t[r],r)}var js=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Bs(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var Us=function(t){try{return t()}catch(t){return}},Hs=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){$s.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$s.critical(t)}}},zs=function(t){var e={};return qs(t,(function(t,r){(Kr(t)&&t.length>0||ti(t))&&(e[r]=t)})),e};var Ws=["herokuapp.com","vercel.app","netlify.app"];function Vs(t){var e=null==t?void 0:t.hostname;if(!Kr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Ws)if(r===i)return!1;return!0}function Zs(t,e,r,i){var n=null!=i?i:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===o||o})}function Gs(t){return"ph_toolbar_internal"===t.name}var Qs=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return Br(t)}},Ks=t=>{var e=null==Ts?void 0:Ts.createElement("a");return Qr(e)?null:(e.href=t,e)},Js=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return qs(t,(function(t,e){Qr(t)||Qr(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Ys=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Wr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){$s.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Xs=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Wr(d)&&(e.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=n&&(c+="#"+n),c},to=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},eo=(t,e)=>t>=e&&Os(),ro=(t,e,r,i)=>{if(0===t){if(Os()){var n=e+1;return n===r&&i(),n}return e}return 0},io=()=>{};function no(t,e,r){try{if(!(e in t))return io;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Vr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];Vr(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return io}}function so(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function oo(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Vr(i))return e;try{var n=i(e);return Kr(n)&&n?n:e}catch(t){return $s.error("Error in get_current_url, falling back to window.location.href",t),e}}function ao(t){var e,r=null==xs||null==(e=xs.location)?void 0:e.href;return Qr(r)?void 0:oo(t,r)}var lo="__POSTHOG_TOOLBAR__",uo=1,ho=3,co=11;function vo(t){return t instanceof Element&&(t.id===lo||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function fo(t){return!!t&&t.nodeType===uo}function po(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function go(t){return!!t&&t.nodeType===ho}function mo(t){return!!t&&t.nodeType===co&&fo(t.host)}var yo=1e3;function bo(t){return t?qr(t).split(/\s+/):[]}function _o(t,e){var r=ao(e);return!!(r&&t&&t.some((t=>r.match(t))))}function wo(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return bo(e)}function xo(t){return Xr(t)?null:qr(t).split(/(\s+)/).filter((t=>Zo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ko(t){var e="";return No(t)&&!qo(t)&&t.childNodes&&t.childNodes.length&&qs(t.childNodes,(function(t){var r;go(t)&&t.textContent&&(e+=null!==(r=xo(t.textContent))&&void 0!==r?r:"")})),qr(e)}function So(t){var e;return Qr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var To=["a","button","form","input","select","textarea","label"];function Co(t,e){if(Qr(e))return!0;var r,i=function(t){if(e.some((e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Eo(t){var e=t.parentNode;return!(!e||!fo(e))&&e}var Mo=[".ph-no-autocapture","[data-ph-no-autocapture]"],Io=["next","previous","prev",">","<"],Ro=[...Io,"+","-","−","–"],Po=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Oo=[".ph-no-deadclick",".ph-no-capture"],Lo=[".ph-no-rageclick",".ph-no-capture"],Ao=["","text","search","email","password","url","tel","number"];function Fo(t,e){if(!xs||$o(t))return!1;var r,i,n,s,o;if(ri(e)?(r=!!e&&Lo,i=void 0,n=!1):(r=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:Lo,i=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(t){return!(!t||!fo(t))&&(!!po(t,"textarea")||(po(t,"input")?Nr(Ao,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(t))return!1;var a=Do(t,!1).targetElementList;return!function(t,e){if(!1===t||Qr(t))return!1;var r;if(!0===t)r=Io;else{if(!Wr(t))return!1;if(t.length>10)return $s.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,i=t.ariaLabel;return r.some((t=>Po(e,t)||Po(i,t)))}))}(i,a.map((t=>{var e;return{safeText:ko(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Co(a,r)}var $o=t=>!t||po(t,"html")||!fo(t),Do=(t,e)=>{if(!xs||$o(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!po(n,"body");)if(mo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Eo(n);if(!s)break;if(e||To.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{var o=xs.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function No(t){for(var e=new Set,r=0,i=t;i.parentNode&&!po(i,"body");i=i.parentNode){if(r++>=yo||e.has(i))return!1;e.add(i);var n=wo(i);if(Nr(n,"ph-sensitive")||Nr(n,"ph-no-capture"))return!1}if(Nr(wo(t),"ph-include"))return!0;var s=t.type||"";if(Kr(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Kr(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function qo(t){return!!(po(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||po(t,"select")||po(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var jo=new RegExp("^(?:(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}))$"),Bo=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Uo=[16,15,14,13],Ho=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),zo=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Wo=/[0-9A-Za-z_]/;function Vo(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}function Zo(t,e){if(void 0===e&&(e=!0),Xr(t))return!1;if(Kr(t)){t=qr(t);var r=e?jo.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Bo.lastIndex=0;e=Bo.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of Uo){var o=n+s;if(i.length>=o){var a=i.slice(n,o);if(jo.test(a)&&Vo(a))return!0}}}return!1}(t);if(r)return!1;var i=e?Ho.test(t):function(t){var e;for(zo.lastIndex=0;e=zo.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Wo.test(r)&&Wo.test(i)))return!0}return!1}(t);if(i)return!1}return!0}function Go(t){var e=ko(t);return Zo(e=(e+" "+Qo(t)).trim())?e:""}function Qo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&qs(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=ko(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Qo(t)).trim())}catch(t){$s.error("[AutoCapture]",t)}})),e}function Ko(t){return t.replace(/"|\\"/g,'\\"')}function Jo(t){var e=t.attr__class;if(e)return Wr(e)?e:bo(e)}var Yo=1e6,Xo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Yo,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},ta=Ds("[Recorder]"),ea=t=>"navigation"===t.entryType,ra=t=>"resource"===t.entryType;function ia(t,e){return!!e&&(ri(e)||e[t])}function na(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var sa=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function oa(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!na(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(sa))return!1;if(ri(r))return!0;if(Wr(r))return n(r);var s=r[e];return ri(s)?s:n(s)}function aa(t,e,r,i,n,s){return la.apply(this,arguments)}function la(){return la=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return ta.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(ra(o=t[s])&&o.initiatorType===e&&(Qr(i)||o.startTime>=i)&&(Qr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),aa(t,e,r,i,n,s+1))})),la.apply(this,arguments)}function ua(t){var e=t.body,r=t.options,i=t.url;if(Xr(e))return null;var n=so(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Kr(e))return e;if(Ls(e))return e.textContent;if(ii(e))return Js(e);if(Zr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ha=t=>!Yr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function da(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:Qr(a)?void 0:Math.round(a),endTime:Qr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(ha(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ca=["video/","audio/"];function va(t){return Zr(t)&&Vr(t.getReader)&&Vr(t.tee)}var fa=500,pa="[SessionReplay] Timeout while trying to read body",ga="[SessionReplay] Failed to read body";function ma(t){return ga+": "+t}function ya(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function ba(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(pa)),fa);try{t.clone().text().then((t=>e(t)),(t=>e(ma(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(ga)}}))}(t);var r=function(t){var e;return Math.min(Yo,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Yo)}(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(ya(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),r(t))}var a,l=setTimeout((()=>o(pa)),fa);try{a=t.clone()}catch(t){return void o(ga)}var u=a.body;if(va(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(t){return void o(ga)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,a=r.value;if(n)s();else if(i)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(ya(e));d+=a.byteLength,h.push(a)}t()}}),(t=>o(ma(t))))}()}else try{a.text().then((t=>o(t)),(t=>o(ma(t))))}catch(t){o(ga)}}))}(t,r)}function _a(){return _a=e((function*(t){var e=t.r,r=t.options,i=so(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):ba(e,r)})),_a.apply(this,arguments)}function wa(){return wa=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=ca.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var a=so(n,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Yr(i)?ba(e,r):Promise.resolve(i)})),wa.apply(this,arguments)}var xa=null;function ka(t,i,n){if(!("performance"in i))return()=>{};if(xa)return ta.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Xo,n):Xo,o=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>ea(t)||ra(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>da({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>ea(t)||ra(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>da({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ia("request",r.recordHeaders),n=ia("response",r.recordHeaders),s=no(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var c,v,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(oa({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ua({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),oa({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ua({body:d.response,options:r,url:a})),aa(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=da({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){ta.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ia("request",i.recordHeaders),s=ia("response",i.recordHeaders),o=no(r,"fetch",(o=>function(){var a=e((function*(e,a){var l,u;try{l=new Request(e,a)}catch(t){return ta.error("Failed to instrument fetch for network capture",t),o(e,a)}var h,d,c={};try{try{var v={};l.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!va(null==a?void 0:a.body)&&oa({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return _a.apply(this,arguments)}({r:l,options:i,url:e}))}catch(t){ta.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),u=na(e)?yield o(l):yield o(e,a),d=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),oa({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return wa.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{aa(r,"fetch",l.url,h,d).then((e=>{var r,i=da({entry:e,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),xa=()=>{a(),l(),u(),xa=null}}var Sa=t=>({name:"rrweb/network@1",observer:ka,options:t}),Ta="undefined"!=typeof globalThis?globalThis:xs;Ta&&"undefined"==typeof self&&(Ta.self=Ta),Ta&&"undefined"==typeof File&&(Ta.File=function(){});var Ca=null!=xs?xs:{};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:mr,getRecordNetworkPlugin:Sa},Ca.__PosthogExtensions__.rrweb={record:rr,version:"v2",wasMaxDepthReached:()=>Rt,resetMaxDepthState(){Rt=!1,It=!1},getLastSnapshotCost:()=>O,getMutationCost:()=>r({},F),resetSnapshotCostState(){I=0,R=0,P=E(),O=null,L=null,A=[],F={slowestBatchMs:0}}},Ca.rrweb={record:rr,version:"v2"},Ca.rrwebConsoleRecord={getRecordConsolePlugin:mr},Ca.getRecordNetworkPlugin=Sa;var Ea,Ma,Ia,Ra,Pa,Oa,La,Aa,Fa,$a,Da,Na,qa,ja,Ba,Ua={},Ha=[],za=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wa=Array.isArray;function Va(t,e){for(var r in e)t[r]=e[r];return t}function Za(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ga(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Ea.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Qa(t,o,i,n,null)}function Qa(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Ia:n,__i:-1,__u:0};return null==n&&null!=Ma.vnode&&Ma.vnode(s),s}function Ka(t){return t.children}function Ja(t,e){this.props=t,this.context=e}function Ya(t,e){if(null==e)return t.__?Ya(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Ya(t):null}function Xa(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],s=Va({},e);s.__v=e.__v+1,Ma.vnode&&Ma.vnode(s),ul(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?Ya(e):r,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,dl(i,s,n),e.__e=e.__=null,s.__e!=r&&tl(s)}}function tl(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),tl(t)}function el(t){(!t.__d&&(t.__d=!0)&&Ra.push(t)&&!rl.__r++||Pa!=Ma.debounceRendering)&&((Pa=Ma.debounceRendering)||Oa)(rl)}function rl(){try{for(var t,e=1;Ra.length;)Ra.length>e&&Ra.sort(La),t=Ra.shift(),e=Ra.length,Xa(t)}finally{Ra.length=rl.__r=0}}function il(t,e,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||Ha,b=e.length;for(l=function(t,e,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Qa(null,o,null,null,null):Wa(o)?o=t.__k[s]=Qa(Ka,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Qa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+c,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=sl(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?c--:h>n&&c++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Ya(a)),fl(a,a));return i}(r,e,y,l,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||Ua,v.__i=d,g=ul(t,v,c,n,s,o,a,l,u,h),f=v.__e,v.ref&&c.ref!=v.ref&&(c.ref&&vl(c.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||c.__k===v.__k?(l=nl(v,l,t,m),m&&c.__e&&(c.__e=null)):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function nl(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=nl(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Ya(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function sl(t,e,r,i){var n,s,o,a=t.key,l=t.type,u=e[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function ol(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||za.test(e)?r:r+"px"}function al(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||ol(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||ol(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Da,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r[$a]=i[$a]:(r[$a]=Na,t.addEventListener(e,s?ja:qa,s)):t.removeEventListener(e,s?ja:qa,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function ll(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[Fa])e[Fa]=Na++;else if(r[$a]>e[Fa])return;return r(Ma.event?Ma.event(e):e)}}}function ul(t,e,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,b,$,_,w,x,k,S,T=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=Ma.__b)&&h(e);t:if("function"==typeof T){d=o.length;try{if(y=e.props,b=T.prototype&&T.prototype.render,$=(h=T.contextType)&&i[h.__c],_=h?$?$.props.value:h.__:i,r.__c?m=(c=e.__c=r.__c).__=c.__E:(b?e.__c=c=new T(y,_):(e.__c=c=new Ja(y,_),c.constructor=T,c.render=pl),$&&$.sub(c),c.state||(c.state={}),c.__n=i,v=c.__d=!0,c.__h=[],c._sb=[]),b&&null==c.__s&&(c.__s=c.state),b&&null!=T.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Va({},c.__s)),Va(c.__s,T.getDerivedStateFromProps(y,c.__s))),f=c.props,p=c.state,c.__v=e,v)b&&null==T.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),b&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(b&&null==T.getDerivedStateFromProps&&y!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(y,_),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(y,c.__s,_)){e.__v!=r.__v&&(c.props=y,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),Ha.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(y,c.__s,_),b&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,g)}))}if(c.context=_,c.props=y,c.__P=t,c.__e=!1,w=Ma.__r,x=0,b)c.state=c.__s,c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),Ha.push.apply(c.__h,c._sb),c._sb=[];else do{c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++x);c.state=c.__s,null!=c.getChildContext&&(i=Va(Va({},i),c.getChildContext())),b&&!v&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,p)),k=null!=h&&h.type===Ka&&null==h.key?cl(h.props.children):h,a=il(t,Wa(k)?k:[k],e,r,i,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),m&&(c.__E=c.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(S=s.length;S--;)Za(s[S]);hl(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||hl(e);Ma.__e(t,e,r)}}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||Ua,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(Ma.__m&&Ma.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Ea.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"dangerouslySetInnerHTML"==u?d=v:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||al(t,u,null,v,n);for(u in m)v=m[u],"children"==u?c=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||al(t,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),il("template"==e.type?t.content:t,Wa(c)?c:[c],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Ya(r,0),a,l),null!=s)for(u=s.length;u--;)Za(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&al(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&al(t,u,p,g[u],n))}return t}(r.__e,e,r,i,n,s,o,l,u);return(h=Ma.diffed)&&h(e),128&e.__u?void 0:a}function hl(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(hl))}function dl(t,e,r){for(var i=0;r.length>i;i++)vl(r[i],r[++i],r[++i]);Ma.__c&&Ma.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Ma.__e(t,e.__v)}}))}function cl(t){return"object"!=typeof t||null==t||t.__b>0?t:Wa(t)?t.map(cl):void 0!==t.constructor?null:Va({},t)}function vl(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Ma.__e(t,r)}}function fl(t,e,r){var i,n;if(Ma.unmount&&Ma.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||vl(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){Ma.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&fl(i[n],e,r||"function"!=typeof t.type);r||Za(t.__e),t.__c=t.__=t.__e=void 0}function pl(t,e,r){return this.constructor(t,r)}function gl(t,e,r){var i,n,s;e==document&&(e=document.documentElement),Ma.__&&Ma.__(t,e),i=e.__k,n=[],s=[],ul(e,t=e.__k=Ga(Ka,null,[t]),i||Ua,Ua,e.namespaceURI,i?null:e.firstChild?Ea.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),dl(n,t,s),t.props.children=null}Ea=Ha.slice,Ma={__e(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Ia=0,Ja.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Va({},this.state),"function"==typeof t&&(t=t(Va({},r),this.props)),t&&Va(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),el(this))},Ja.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),el(this))},Ja.prototype.render=Ka,Ra=[],Oa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,La=function(t,e){return t.__v.__b-e.__v.__b},rl.__r=0,Aa=Math.random().toString(8),Fa="__d"+Aa,$a="__a"+Aa,Da=/(PointerCapture)$|Capture$/i,Na=0,qa=ll(!1),ja=ll(!0),Ba=0;var ml,yl,bl,_l,wl=0,xl=[],kl=Ma,Sl=kl.__b,Tl=kl.__r,Cl=kl.diffed,El=kl.__c,Ml=kl.unmount,Il=kl.__;function Rl(t,e){kl.__h&&kl.__h(yl,t,wl||e),wl=0;var r=yl.__H||(yl.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Pl(t){return wl=1,function(t,e,r){var i=Rl(ml++,2);if(i.t=t,!i.__c&&(i.__=[Ul(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=yl,!yl.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==t;if(i.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s){var a=s.call(this,t,e,r);return n?a||o:a}return!n||o};yl.__f=!0;var s=yl.shouldComponentUpdate,o=yl.componentWillUpdate;yl.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},yl.shouldComponentUpdate=n}return i.__N||i.__}(Ul,t)}function Ol(t,e){var r=Rl(ml++,3);!kl.__s&&Bl(r.__H,e)&&(r.__=t,r.u=e,yl.__H.__h.push(r))}function Ll(t){return wl=5,Al((function(){return{current:t}}),[])}function Al(t,e){var r=Rl(ml++,7);return Bl(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Fl(t){var e=yl.context[t.__c],r=Rl(ml++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(yl)),e.props.value):t.__}function $l(){for(var t;t=xl.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ql),e.__h.some(jl),e.__h=[]}catch(r){e.__h=[],kl.__e(r,t.__v)}}}kl.__b=function(t){yl=null,Sl&&Sl(t)},kl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Il&&Il(t,e)},kl.__r=function(t){Tl&&Tl(t),ml=0;var e=(yl=t.__c).__H;e&&(bl===yl?(e.__h=[],yl.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&$l(),ml=0)),bl=yl},kl.diffed=function(t){Cl&&Cl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==xl.push(e)&&_l===kl.requestAnimationFrame||((_l=kl.requestAnimationFrame)||Nl)($l)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),bl=yl=null},kl.__c=function(t,e){e.some((function(t){try{t.__h.some(ql),t.__h=t.__h.filter((function(t){return!t.__||jl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],kl.__e(r,t.__v)}})),El&&El(t,e)},kl.unmount=function(t){Ml&&Ml(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some((function(t){try{ql(t)}catch(t){e=t}})),r.__H=void 0,e&&kl.__e(e,r.__v))};var Dl="function"==typeof requestAnimationFrame;function Nl(t){var e,r=function(){clearTimeout(i),Dl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);Dl&&(e=requestAnimationFrame(r))}function ql(t){var e=yl,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),yl=e}function jl(t){var e=yl;t.__c=t.__(),yl=e}function Bl(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function Ul(t,e){return"function"==typeof e?e(t):e}function Hl(t){var e=!0;return{dispose(){if(e){e=!1;var r=t();r&&Vr(r.then)&&r.then(void 0,(()=>{}))}}}}var zl={GZipJS:"gzip-js",Base64:"base64"},Wl={Activation:"events",Cancellation:"cancelEvents"},Vl={Button:"button",Tab:"tab",Selector:"selector"},Zl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Gl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Ql={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Kl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Jl={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Yl={Once:"once",Recurring:"recurring",Always:"always"},Xl={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},tu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},eu={Popover:"popover",Inline:"inline"};function ru(t){return"$survey_response_"+t}function iu(t,e){if(!e)return null;var r=t[ru(e)];return Wr(r)?[...r]:r}function nu(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!Qr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=iu(t,e.id);Qr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:iu(t,e.id)})))},t,i)}function su(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function ou(t){return"string"==typeof t&&t.trim()?t.trim():null}function au(t){return t.toLowerCase()}function lu(t,e,r){if(!t||!e)return null;var i=au(e),n=Object.keys(t).find((t=>au(t)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(t).find((t=>au(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function uu(t,e,i){var n,s=lu(t.translations,e,i),o=r({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),Qr(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),Qr(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),Qr(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),Qr(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),Qr(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),Qr(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(t){return!(Qr(t.thankYouMessageHeader)&&Qr(t.thankYouMessageDescription)&&Qr(t.thankYouMessageCloseButtonText)&&Qr(t.submitButtonText)&&Qr(t.backButtonText))}(u)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=lu(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(n=t.translations)?void 0:n[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=r({},t),l=!1;return Qr(o.question)||(a.question=o.question,l=!0),Qr(o.description)||(a.description=o.description,l=!0),Qr(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Qr(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Qr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Qr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return Wr(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i))),d=h.map((t=>t.question)),c=h.some((t=>t.hasChanges)),v=null;return s||(v=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||v:null}}function hu(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function du(t){var e;return hu(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var cu=Ds("[Surveys]");function vu(t){return!(!t.start_date||t.end_date)}function fu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var pu="seenSurvey_",gu="inProgressSurvey_",mu=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),yu=t=>mu(pu,t),bu=t=>{try{var e=yu(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){cu.error("Failed to persist survey seen state",t)}},_u=[Ql.Popover,Ql.Widget,Ql.API],wu={ignoreConditions:!1,ignoreDelay:!1,displayType:eu.Popover},xu="$people_distinct_id",ku="$device_id",Su="$device_model",Tu="__alias",Cu="__timers",Eu="$autocapture_disabled_server_side",Mu="$heatmaps_enabled_server_side",Iu="$exception_capture_enabled_server_side",Ru="$error_tracking_suppression_rules",Pu="$error_tracking_capture_extension_exceptions",Ou="$web_vitals_enabled_server_side",Lu="$dead_clicks_enabled_server_side",Au="$product_tours_enabled_server_side",Fu="$web_vitals_allowed_metrics",$u="$session_recording_remote_config",Du="$replay_sample_rate",Nu="$replay_override_sampling",qu="$replay_override_linked_flag",ju="$replay_override_url_trigger",Bu="$replay_override_event_trigger",Uu="$sesid",Hu="$session_is_sampled",zu="$enabled_feature_flags",Wu="$active_feature_flags",Vu="$early_access_features",Zu="$feature_flag_details",Gu="$feature_flag_payloads",Qu="$feature_flag_request_id",Ku="$minimal_flag_called_events",Ju="$override_feature_flags",Yu="$override_feature_flag_payloads",Xu="$stored_person_properties",th="$stored_group_properties",eh="$surveys",rh="$surveys_loaded_at",ih="$surveys_activated",nh="$surveys_activated_session",sh="$surveys_activated_timestamps",oh="ph_product_tours",ah="$flag_call_reported",lh="$flag_call_reported_session_id",uh="$feature_flag_errors",hh="$feature_flag_evaluated_at",dh="$user_state",ch="$client_session_props",vh="$capture_rate_limit",fh="$initial_campaign_params",ph="$initial_referrer_info",gh="$initial_person_info",mh="$epp",yh="$posthog_cookieless",bh="$cookieless_mode",_h="$sdk_debug_extensions_init_method",wh="$sdk_debug_extensions_init_time_ms",xh="$sdk_debug_recording_script_not_loaded",kh="PostHog loadExternalDependency extension not found.",Sh="on_reject",Th="always",Ch="anonymous",Eh="identified",Mh="identified_only",Ih="visibilitychange",Rh="beforeunload",Ph="$pageview",Oh="$pageleave",Lh="$identify",Ah="$groupidentify";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ti(t)&&isFinite(t)&&Math.floor(t)===t});class Fh{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Fh(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Fh(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class $h{generate(){var t=this.generateOrAbort();if(!Qr(t))return t;this.S=0;var e=this.generateOrAbort();if(Qr(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.C();else{if(this.S>=t+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return Fh.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.R.nextUint32())}C(){this.I=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}constructor(){this.S=0,this.I=0,this.R=new qh}}var Dh,Nh=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};xs&&!Qr(xs.crypto)&&crypto.getRandomValues&&(Nh=t=>crypto.getRandomValues(t));class qh{nextUint32(){return this.O.length>this.N||(Nh(this.O),this.N=0),this.O[this.N++]}constructor(){this.O=new Uint32Array(8),this.N=1/0}}var jh=()=>Bh().toString(),Bh=()=>(Dh||(Dh=new $h)).generate(),Uh=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Hh(t,e,r){return Qs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var zh={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Uh(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Uh(e,t))))),icontains:(t,e)=>e.map(Wh).some((e=>t.map(Wh).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Wh).every((e=>t.map(Wh).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Wh=t=>t.toLowerCase();function Vh(t,e){return!t||Object.entries(t).every((t=>{var r=t[1],i=null==e?void 0:e[t[0]];if(Qr(i)||Yr(i))return!1;var n=[String(i)],s=zh[r.operator];return!!s&&s(r.values,n)}))}var Zh=t=>{if(Ts){try{for(var e=t+"=",r=Ts.cookie.split(";").filter((t=>t.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Gh="",Qh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Kh={P:()=>!!Ts,j(t){$s.error("cookieStore error: "+t)},q:Zh,H(t){var e;try{e=JSON.parse(Kh.q(t))||{}}catch(t){}return e},A(t,e,r,i,n){if(!Ts)return!1;try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=Ts),Gh)return Gh;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+jh();!Gh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Gh=s)}return Gh}(t);if(!r){var i=(t=>{var e=t.match(Qh);return e?e[0]:""})(t);i!==r&&$s.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(Ts.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&$s.warn("cookieStore warning: large cookie, len="+u.length),Ts.cookie=u,!0}catch(t){return!1}},F(t,e){if(null!=Ts&&Ts.cookie)try{Kh.A(t,"",-1,e)}catch(t){return}}},Jh=null,Yh={P(){if(!Yr(Jh))return Jh;var t=!0;if(Qr(xs))t=!1;else try{var e="__mplssupport__";Yh.A(e,"xyz"),'"xyz"'!==Yh.q(e)&&(t=!1),Yh.F(e)}catch(e){t=!1}return t||$s.error("localStorage unsupported; falling back to cookie store"),Jh=t,t},j(t){$s.error("localStorage error: "+t)},q(t){try{return null==xs?void 0:xs.localStorage.getItem(t)}catch(t){Yh.j(t)}return null},H(t){try{return JSON.parse(Yh.q(t))||{}}catch(t){}return null},A(t,e){try{return null==xs||xs.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Yh.j(t)}return!1},F(t){try{null==xs||xs.localStorage.removeItem(t)}catch(t){Yh.j(t)}}},Xh=[ku,"distinct_id",Uu,Hu,mh,gh,dh],td={},ed={P:()=>!0,j(t){$s.error("memoryStorage error: "+t)},q:t=>td[t]||null,H:t=>td[t]||null,A:(t,e)=>(td[t]=e,!0),F(t){delete td[t]}},rd=null,id={P(){if(!Yr(rd))return rd;if(rd=!0,Qr(xs))rd=!1;else try{var t="__support__";id.A(t,"xyz"),'"xyz"'!==id.q(t)&&(rd=!1),id.F(t)}catch(t){rd=!1}return rd},j(t){$s.error("sessionStorage error: ",t)},q(t){try{return null==xs?void 0:xs.sessionStorage.getItem(t)}catch(t){id.j(t)}return null},H(t){try{return JSON.parse(id.q(t))||null}catch(t){}return null},A(t,e){try{return null==xs||xs.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){id.j(t)}return!1},F(t){try{null==xs||xs.sessionStorage.removeItem(t)}catch(t){id.j(t)}}},nd=Ds("[Stylesheet Loader]"),sd=xs,od=Ts,ad="#020617",ld={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Zl.Right,widgetType:Vl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:ad,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},ud=[Zl.Center,Zl.Left,Zl.Right];function hd(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function dd(t){var e;void 0===t&&(t=ld.backgroundColor),"#"===t[0]&&(e=hd(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=hd(r)),!e)return ad;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?ad:"white"}return ad}var cd=(t,e,i)=>{var n=Rd(t),s=od.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=od.createElement("div");((t,e,i)=>{var n=r({},ld,i),s=t.style,o=!ud.includes(n.position)||e===Ql.Widget&&(null==i?void 0:i.widgetType)===Vl.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||dd(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",dd(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||dd(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",dd(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||dd(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return Vr(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(nd.error("prepare_external_dependency_stylesheet returned null"),null)})(od,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return od.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},vd=t=>{var e=t.responses,i=t.survey,n=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage;s?(bu(i),s.capture(Xl.SENT,r({[tu.SURVEY_NAME]:i.name,[tu.SURVEY_ID]:i.id,[tu.SURVEY_ITERATION]:i.current_iteration,[tu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[tu.SURVEY_SUBMISSION_ID]:n,[tu.SURVEY_COMPLETED]:o},l&&{[tu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},nu(e,i),a,{$set:{[su(i,"responded")]:!0}})),o&&(sd.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Id(i),s.reloadFeatureFlags())):cu.error("[survey sent] event not captured, PostHog instance not found.")},fd=(t,e,i)=>{return r({[tu.SURVEY_NAME]:t.name,[tu.SURVEY_ID]:t.id,[tu.SURVEY_ITERATION]:t.current_iteration,[tu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[tu.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!Xr(t))))},(null==e?void 0:e.surveyLanguage)&&{[tu.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[tu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},nu(null==e?void 0:e.responses,t));var n},pd=(t,e,i,n)=>{if(e){if(!i){var s=Ed(t);e.capture(Xl.DISMISSED,r({},fd(t,s,e),n&&{[tu.SURVEY_LANGUAGE]:n},{$set:{[su(t,"dismissed")]:!0}})),Id(t),bu(t),sd.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else cu.error("[survey dismissed] event not captured, PostHog instance not found.")},gd=(t,e)=>{if(e){var r=(t=>mu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Ed(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Xl.ABANDONED,fd(t,i,e),{transport:"sendBeacon"})}}else cu.error("[survey abandoned] event not captured, PostHog instance not found.")},md=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),yd=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,bd=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?yd(t.questions,md(t.questions)):t.questions,_d=t=>du(t)||Md(t),wd=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,el(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Ba++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),xd=()=>Fl(wd),kd=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,s,o,a=Va({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Ea.call(arguments,2):r),Qa(t.type,a,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function Sd(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n=ao(e);if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return zh[o](s,[n])}var Td=t=>mu(gu,t),Cd=(t,e)=>{try{localStorage.setItem(Td(t),JSON.stringify(e))}catch(t){cu.error("Error setting in-progress survey state in localStorage",t)}},Ed=t=>{try{var e=localStorage.getItem(Td(t));if(e)return JSON.parse(e)}catch(t){cu.error("Error getting in-progress survey state from localStorage",t)}return null},Md=t=>{var e=Ed(t);return!Xr(null==e?void 0:e.surveySubmissionId)},Id=t=>{try{localStorage.removeItem(Td(t))}catch(t){cu.error("Error clearing in-progress survey state from localStorage",t)}};function Rd(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Pd(t,e,r){if(void 0===e&&(e=Zl.Right),t===Ql.ExternalSurvey)return{};switch(e){case Zl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Zl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Zl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Zl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Zl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Zl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Zl.Left:return{left:"30px"};case Zl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Ql.Widget&&r===Vl.Tab?"60px":"30px"}}}var Od=0;function Ld(t,e,r,i,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Od,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Ma.vnode&&Ma.vnode(u),u}var Ad=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),$d=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Dd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Nd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),qd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),jd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Bd=function(t){var e=(void 0===t?{}:t).fill,r=void 0===e?"currentColor":e;return Ld("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ld("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ld("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]})},Ud=Ld("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ld("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ld("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ld("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ld("g",{mask:"url(#mask0_2415_6911)",children:[Ld("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Ld("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Ld("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Ld("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Ld("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Ld("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Ld("defs",{children:Ld("clipPath",{id:"clip0_2415_6911",children:Ld("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Hd(t){var e=t.urlParams,r=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return Ld("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ud]})}function zd(t){var e=t.text,r=t.submitDisabled,i=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,l=t.canGoBack,u=t.onBack,h=Fl(wd).isPreviewMode,d=!!l&&!!u,c=!a&&Ld("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==xs||xs.open(s)),h?null==o||o():n()},children:e});return Ld("div",{className:"bottom-section",children:[d?Ld("div",{className:"form-buttons form-buttons-with-back",children:[Ld("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&Ld(Hd,{urlParams:{utm_source:"survey-footer"}})]})}function Wd(t){var e=t.question,r=t.forceDisableHtml;return Ld("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Ld(e.type===Kl.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&kd({component:Ga("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Vd(t){return Ld("button",{className:"form-cancel",onClick:t.onClick,disabled:Fl(wd).isPreviewMode,"aria-label":"Close survey",type:"button",children:Bd({fill:"black"})})}Ld("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ld("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Zd=xs;function Gd(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Fl(wd).isPopup;return Ol((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Zs(Zd,"keydown",t),()=>{Zd.removeEventListener("keydown",t)}}),[o]),Ld("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ld(Vd,{onClick:()=>o()}),Ld("h3",{className:"thank-you-message-header",children:e}),r&&kd({component:Ga("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Ld(zd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Qd=t=>Wr(t)&&t.every((t=>Kr(t)));function Kd(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=xd().isPreviewMode,d=Ll(null),c=Pl((()=>Kr(a)?a:"")),v=c[0],f=c[1],p=null==i?void 0:i.disableAutofocus;Ol((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=Al((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case Tr:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Cr:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,e.validation,e.optional)),[v,e.validation,e.optional]),y=jn(e.validation,Tr),b=jn(e.validation,Cr),_=Al((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(v.trim())},x=()=>{m||s(v.trim())};return Ld(Ka,{children:[Ld("div",{className:"question-container",children:[Ld(Wd,{question:e,forceDisableHtml:r,htmlFor:g}),Ld("textarea",{ref:d,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?x():w())},value:v}),_&&Ld("div",{className:"validation-hint",children:_})]}),Ld(zd,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function Jd(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Ld(Ka,{children:[Ld("div",{className:"question-container",children:Ld(Wd,{question:e,forceDisableHtml:t.forceDisableHtml})}),Ld(zd,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Yd(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=r.scale,c=10===r.scale?0:1,v=Pl((()=>ti(l)?l:Wr(l)&&l.length>0&&ti(parseInt(l[0]))?parseInt(l[0]):Kr(l)&&ti(parseInt(l))?parseInt(l):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=xd().isPreviewMode,y=t=>m?a(t):o(t);return Ld(Ka,{children:[Ld("div",{className:"question-container",children:[Ld(Wd,{question:r,forceDisableHtml:i}),Ld("div",{className:"rating-section",children:[Ld("div",{className:"rating-options",children:["emoji"===r.display&&Ld("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=nc[r.scale])?void 0:e.map(((t,e)=>Ld("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e)))}),"number"===r.display&&Ld("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:sc(r.scale).map(((t,e)=>Ld(Xd,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e)))})]}),!g&&Ld("div",{className:"rating-text",children:[Ld("div",{children:r.lowerBoundLabel}),Ld("div",{children:r.upperBoundLabel})]})]})]}),Ld(zd,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Yr(f)&&!r.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function Xd(t){var e=t.num,r=t.setActiveNumber;return Ld("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function tc(t){var e=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Ll(null),c=Al((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=yd(e,md(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),v=Pl((()=>((t,e)=>Kr(t)||Qd(t)?t:e===Kl.SingleChoice?null:[])(l,e.type))),f=v[0],p=v[1],g=Pl((()=>((t,e)=>{if(Kr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Qd(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),m=g[0],y=g[1],b=xd().isPreviewMode,_=e.type===Kl.SingleChoice,w=e.type===Kl.MultipleChoice,x=e.skipSubmitButton&&_&&!e.hasOpenChoice,k=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&p(""),void(i&&setTimeout((()=>{var t;return null==(t=d.current)?void 0:t.focus()}),75))}if(_)return p(t),y((t=>r({},t,{isSelected:!1,inputValue:""}))),void(x&&(o(t),b&&a(t)));w&&Wr(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},S=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>r({},t,{inputValue:e}))),_&&p(e)},T=t=>{t.stopPropagation(),"Enter"!==t.key||C()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y((t=>r({},t,{isSelected:!1,inputValue:""}))),_&&p(null))},C=()=>!(e.optional||!Yr(f)&&(!Wr(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?Wr(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return Ld(Ka,{children:[Ld("div",{className:"question-container",children:[Ld(Wd,{question:e,forceDisableHtml:i}),Ld("fieldset",{className:"multiple-choice-options limit-height",children:[Ld("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),c.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?m.isSelected:_?f===t:Wr(f)&&f.includes(t);return Ld("label",{className:i?"choice-option-open":"",children:[Ld("div",{className:"response-choice",children:[Ld("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>k(t,i),id:s,"aria-controls":o}),Ld("span",{children:i?t+":":t})]}),i&&Ld("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:m.inputValue,onKeyDown:T,onInput:S,onClick(e){m.isSelected||k(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),Ld(zd,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:s,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var ec=[1,2,3,4,5],rc=[1,2,3,4,5,6,7],ic=[0,1,2,3,4,5,6,7,8,9,10],nc={2:[qd,jd],3:[$d,Fd,Ad],5:[Dd,$d,Fd,Ad,Nd]};function sc(t){switch(t){case 5:default:return ec;case 7:return rc;case 10:return ic}}var oc=Ds("[Surveys]");function ac(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Jl.End:s;if(n.branching.type===Jl.End)return Jl.End;if(n.branching.type===Jl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Jl.ResponseBased){if(n.type===Kl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Jl.End?Jl.End:s}}else if(n.type===Kl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Jl.End?Jl.End:s}}return s}return oc.warn("Falling back to next question index due to unexpected branching type"),s}var lc="https?://(.*)",uc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],hc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...uc],dc="<masked>",cc=["li_fat_id"];function vc(t,e,r){if(!Ts)return{};var i,n=e?[...uc,...r||[]]:[],s=fc(Xs(Ts.URL,n,dc),t),o=(i={},qs(cc,(function(t){var e=Zh(t);i[t]=e||null})),i);return js(o,s)}function fc(t,e){var r=hc.concat(e||[]),i={};return qs(r,(function(e){var r=Ys(t,e);i[e]=r||null})),i}function pc(t){var e=function(t){return t?0===t.search(lc+"google.([^/?]*)")?"google":0===t.search(lc+"bing.com")?"bing":0===t.search(lc+"yahoo.com")?"yahoo":0===t.search(lc+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!Yr(e)){i.$search_engine=e;var n=Ts?Ys(Ts.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function gc(){return navigator.language||navigator.userLanguage}var mc="$direct";function yc(){return(null==Ts?void 0:Ts.referrer)||mc}function bc(t,e,r){void 0===r&&(r=!1);var i=t?[...uc,...e||[]]:[],n=r?kn(null==Cs?void 0:Cs.href):null==Cs?void 0:Cs.href,s=null==n?void 0:n.substring(0,1e3);return{r:yc().substring(0,1e3),u:s?Xs(s,i,dc):void 0}}function _c(t,e){var r;void 0===e&&(e=!1);var i=t.r,n=t.u,s=e?kn(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==mc?mc:null==(r=Ks(i))?void 0:r.host};if(s){o.$current_url=s;var a=Ks(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=fc(s);js(o,l)}if(i){var u=pc(i);js(o,u)}return o}function wc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function xc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var kc=Ds("[SurveyTranslations]");function Sc(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=ou(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?ou(t.language):null}(r);if(s)return null==e||e.info("Using person property language: "+s),s;var o=ou(i);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Vr(t.get_property)?t.get_property(Xu):void 0,locale:gc()},kc)}(e);if(!r)return kc.info("No user language detected"),{survey:t,language:null};var i=uu(t,r,kc);return{survey:i.survey,language:i.matchedKey}}var Tc=xs,Cc=Ts,Ec="ph:show_survey_widget",Mc="PHWidgetSurveyClickListener";function Ic(t,e){try{var r=t.getBoundingClientRect(),i=Tc.innerHeight,n=Tc.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:ld.zIndex}}catch(t){return cu.warn("Failed to calculate trigger position:",t),null}}class Rc{constructor(t){var e=this;this.B=new Map,this.U=new Map,this.W=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(eh);if(t)for(var e of t)Md(e)&&gd(e,this._posthog)},this.handlePopoverSurvey=function(t,i,n){var s,o,a,l,u,h=(void 0===n?{}:n).resumeDelayFromActivation,d=void 0!==h&&h,c=e.V(t),v=c.survey,f=c.language,p=null!=i&&i.position||null!=i&&i.selector?r({},v,{appearance:r({},v.appearance,i.position&&{position:i.position},i.selector&&{widgetSelector:i.selector})}):v;e.Z(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.$(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.G(p);var _={};if((null==(o=p.appearance)?void 0:o.position)===Zl.NextToTrigger&&null!=(a=p.appearance)&&a.widgetSelector){var w,x=Cc.querySelector(p.appearance.widgetSelector);x&&(_=Ic(x,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||ld.maxWidth))||{})}var k=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,S=cd(p,e._posthog).shadow,T={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Y,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(0>=k)return gl(Ld(Ac,r({},T)),S);var C=()=>{if(!e.K(p))return cu.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Y(p);gl(Ld(Ac,r({},T,{survey:r({},p,{appearance:r({},p.appearance,{surveyPopupDelaySeconds:0})})})),S)},E=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,M=ti(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*k-M);if(0>=I)return C();var R=Tc.setTimeout((()=>{e.B.delete(p.id),C()}),I);e.B.set(p.id,R)}},this.J=t=>{var e=this.V(t),r=e.survey,i=e.language,n=cd(r,this._posthog),s=n.shadow;n.isNewlyCreated&&gl(Ld($c,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),s)},this.X=t=>{var e=this.U.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Mc),this.U.delete(t),cu.info("Removed click listener for survey "+t))},this.ee=t=>{this.te(t)||(this.re(t),this.X(t.id))},this.te=t=>{try{var e,r=Cc.querySelector(Rd(t,!0));return!(null==r||null==(e=r.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.ne=(t,e)=>{var r=Cc.querySelector(e),i=this.U.get(t.id);if(r){if(this.J(t),i){if(r===i.element)return;cu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.X(t.id)}if(!r.hasAttribute(Mc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Zl.NextToTrigger?Ic(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||ld.maxWidth)):{};Tc.dispatchEvent(new CustomEvent(Ec,{detail:{surveyId:t.id,position:n}}))};Zs(r,"click",n),r.setAttribute(Mc,"true"),this.U.set(t.id,{element:r,listener:n,survey:t}),cu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.ee(t)},this.renderPopover=t=>{var e=this.V(t),r=e.survey,i=e.language,n=cd(r,this._posthog).shadow;gl(Ld(Ac,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Y,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.V(t),s=n.survey,o=n.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this.ie(s,o,r)),gl(Ld(Ac,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Y,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.K(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Ql.Popover||t.type===Ql.Widget)),i=new Set(r.map((t=>t.id)));for(var n of Array.from(e.B.keys()))i.has(n)||e.cancelSurvey(n);var s=e.ae(r),o=new Set;s.forEach((t=>{if(t.type===Ql.Widget){var r,i,n,s;if((null==(r=t.appearance)?void 0:r.widgetType)===Vl.Tab)return void e.J(t);(null==(i=t.appearance)?void 0:i.widgetType)===Vl.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.ne(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Yr(e.oe)&&t.type===Ql.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.U.forEach((t=>{var r=t.survey;o.has(r.id)||e.ee(r)}))}),t)},this.G=t=>{Yr(this.oe)||cu.error("Survey "+this.oe+" already in focus. Cannot add survey "+t.id+"."),this.oe=t.id},this.Y=t=>{this.oe!==t.id&&cu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Z(t.id),this.oe=null,this.re(t)},this._posthog=t,this.oe=null}Z(t){var e=this.B.get(t);e&&(clearTimeout(e),this.B.delete(t))}cancelSurvey(t){this.B.has(t)&&(cu.info("Cancelled pending survey "+t),this.Z(t),this.oe===t&&(this.oe=null))}ae(t){return t.sort(((t,e)=>{var r,i,n=Md(t),s=Md(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Yl.Always,a=e.schedule===Yl.Always;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}V(t){return Sc(t,this._posthog)}ie(t,e,r){if(this.W.has(t.id))return!1;var i=function(t){var e={},r=!1,i=Tc.location.search.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!Qr(l)){var u=decodeURIComponent(a),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var c=parseInt(d[1],10);e[c]||(e[c]=[]),e[c].push(h)}}else r=!0}}return{params:e,autoSubmit:r}}(),n=i.params;if(0===Object.keys(n).length)return!1;cu.info("[Survey Prefill] Detected URL prefill parameters");var s=this.se(t,n,e);if(!s)return!1;var o=s.responses,a=s.submissionId,l=s.isSurveyCompleted,u=s.skippedResponses;return(Object.keys(u).length>0&&t.enable_partial_responses||l)&&vd({responses:l?o:u,survey:t,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:e}),this.W.add(t.id),l}$(t,e,r,i){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=Wr(o)?o.map(String):[String(o)]}cu.info("[Survey] Processing initial responses");var a=this.se(t,n,i);if(!a)return!1;var l=a.isSurveyCompleted;return vd({responses:a.responses,survey:t,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}se(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=ru(t.id);try{switch(t.type){case Kl.SingleChoice:if(!t.choices||0===t.choices.length)return void $s.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void $s.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Kl.MultipleChoice:if(!t.choices||0===t.choices.length)return void $s.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void $s.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&$s.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Kl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void $s.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:$s.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){$s.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return cu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=jh(),s=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,r){for(var i=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>i&&o>a&&(a++,e.includes(i));){var l=t.questions[i];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ru(l.id);Qr(r[u])||(n[u]=r[u])}s.push(i);var h=ac(t,i,l.id?r[ru(l.id)]:null);if(h===Jl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:s}}(t,s,i),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=t.questions.length;return Cd(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,visitedIndices:o.skippedIndices,surveyLanguage:r}),cu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(t){return cu.error("[Survey Prefill] Error handling prefill:",t),null}}ue(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}le(t){return!t.conditions||Sd(t,this._posthog)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!Ps)return!1;var s=_n(Ps,{userAgentDataPlatform:null==Ss||null==(r=Ss.userAgentData)?void 0:r.platform,maxTouchPoints:null==Ss?void 0:Ss.maxTouchPoints,screenWidth:null==xs||null==(i=xs.screen)?void 0:i.width,screenHeight:null==xs||null==(n=xs.screen)?void 0:n.height,devicePixelRatio:null==xs?void 0:xs.devicePixelRatio});return zh[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==od||!od.querySelector(t.conditions.selector))}(t)}ce(t){var e;return _d(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ue(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!vu(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!_u.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.ue(t.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.ue(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this.ce(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Yh.q("lastSeenSurveyDate"))?(t=>!!Yh.q(yu(t))&&!_d(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.ve(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}ve(t){var e;if(!hu(t)&&!fu(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}de(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ue(e)}))}K(t){return this.checkSurveyEligibility(t).eligible&&this.le(t)&&this.ve(t)&&this.de(t)}re(t){try{var e=Cc.querySelector(Rd(t,!0));null!=e&&e.shadowRoot&&gl(null,e.shadowRoot),null==e||e.remove()}catch(e){cu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.Y,surveyInFocus:this.oe,surveyTimeouts:this.B,handleWidget:this.J,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ne,sortSurveysByAppearanceDelay:this.ae,checkFlags:this.de.bind(this),isSurveyFeatureFlagEnabled:this.ue.bind(this)}}}function Pc(t,e){if(Cc&&Tc){var r,i=new Rc(t);if(t.config.disable_surveys_automatic_display)return cu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return cu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Qr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Zs(Cc,"visibilitychange",(()=>{Cc.hidden?Qr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Oc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Ol((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===Ql.Widget,s=Sd(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===Vl.Tab&&r;if(!s)return cu.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);o&&(cu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Zs(Tc,"popstate",r),Zs(Tc,"hashchange",r);var s=Tc.history.pushState,l=Tc.history.replaceState;return Tc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.apply(this,e),r()},Tc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];l.apply(this,e),r()},()=>{Tc.removeEventListener("popstate",r),Tc.removeEventListener("hashchange",r),Tc.history.pushState=s,Tc.history.replaceState=l}}}),[o,e,i,n,a])}function Lc(t){switch(void 0===t&&(t=Gl.Right),t){case Gl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Gl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Gl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Ac(t){var e,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.style,c=void 0===d?{}:d,v=t.previewPageIndex,f=t.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=t.isPopup,m=void 0===g||g,y=t.onPreviewSubmit,b=void 0===y?()=>{}:y,_=t.onPreviewBack,w=void 0===_?()=>{}:_,x=t.onPopupSurveyDismissed,k=void 0===x?()=>{}:x,S=t.onCloseConfirmationMessage,T=void 0===S?()=>{}:S,C=t.properties,E=t.isSurveyCompleted,M=t.skipShownEvent,I=t.surveyLanguage,R=Ll(null),P=Number.isInteger(v),O=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,L=function(t,e,i,n,s,o,a,l,u){var h=Pl(n||0===i||t.type===Ql.ExternalSurvey),d=h[0],c=h[1],v=Pl(!1),f=v[0],p=v[1],g=()=>{var e=()=>{o&&s(t),c(!1)};Cc.startViewTransition?Cc.startViewTransition((()=>{var t;null==a||null==(t=a.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},m=e=>{e.detail.surveyId===t.id&&g()};return Ol((()=>{if(e){if(!n){var s=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{g()}),5e3)}},o=()=>{if(Sd(t,e)){c(!0),Tc.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(Xl.SHOWN,r({[tu.SURVEY_NAME]:t.name,[tu.SURVEY_ID]:t.id,[tu.SURVEY_ITERATION]:t.current_iteration,[tu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[tu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};if(Zs(Tc,"PHSurveyClosed",m),Zs(Tc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),Tc.removeEventListener("PHSurveyClosed",m),Tc.removeEventListener("PHSurveySent",s)}}return o(),()=>{Tc.removeEventListener("PHSurveyClosed",m),Tc.removeEventListener("PHSurveySent",s)}}}else cu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Oc({survey:t,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:c,hidePopupWithViewTransition:g}}(l,h,O,P,p,m,R,M,I),A=L.isPopupVisible,F=L.hidePopupWithViewTransition,D=L.isSurveySent||v===l.questions.length||!0===E,N=Al((()=>{var t=Ed(l),e=(null==t?void 0:t.surveySubmissionId)||jh();return{isPreviewMode:P,previewPageIndex:v,onPopupSurveyDismissed(){I?pd(l,h,P,I):pd(l,h,P),k()},isPopup:m||!1,surveySubmissionId:e,onPreviewSubmit:b,onPreviewBack:w,posthog:h,properties:C,surveyLanguage:I}}),[P,v,m,h,l,k,b,w,C,I]);return A?Ld(wd.Provider,{value:N,children:Ld("div",{className:"ph-survey",style:r({},Pd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:R,children:D?Ld(Gd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||ld,onClose(){F(),T()}}):Ld(Fc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function Fc(t){var e,i,n=t.survey,s=t.forceDisableHtml,o=t.posthog,a=Al((()=>{var t=Ed(n);if(!t)return null;var e=ti(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&n.questions.length>t.lastQuestionIndex?t:(Id(n),null)}),[n]),l=Pl((()=>(null!=a&&a.responses&&cu.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),u=l[0],h=l[1],d=Fl(wd),c=d.previewPageIndex,v=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,b=d.properties,_=d.surveyLanguage,w=Pl((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=ti(t)&&t>=0&&n.questions.length>t?t:0;return c||e})),x=w[0],k=w[1],S=Pl((()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&n.questions.length>t))})),T=S[0],C=S[1],E=Al((()=>bd(n)),[n]);Ol((()=>{y&&!Qr(c)&&k(c)}),[c,y]);var M=!(null==(e=n.appearance)||!e.allowGoBack)&&(y?(null!=c?c:0)>0:T.length>0),I=E.at(x);return I?Ld("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&Ld(Vd,{onClick(){v()}}),Ld("div",{className:"survey-box","data-question-index":x,children:Dc({question:I,forceDisableHtml:s,displayQuestionIndex:x,appearance:n.appearance||ld,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=ru(s),l=r({},u,{[a]:e});h(l);var d=ac(n,i,e),c=d===Jl.End,v=[...T,i];if(c||(C(v),k(d),Cd(n,{surveySubmissionId:m,responses:l,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:_})),n.enable_partial_responses||c){var f=new Set(v.map((t=>{var e;return null==(e=E[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ru(t)))),p=Object.fromEntries(Object.entries(l).filter((t=>f.has(t[0]))));vd({responses:p,survey:n,surveySubmissionId:m,isSurveyCompleted:c,posthog:o,properties:b,surveyLanguage:_})}}else cu.error("onNextButtonClick called without a questionId.");else cu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:x,questionId:I.id}),onPreviewSubmit:p,initialValue:I.id?u[ru(I.id)]:void 0,canGoBack:M,onBack(){if(y)g();else if(0!==T.length){var t=T[T.length-1],e=T.slice(0,-1);C(e),k(t),Cd(n,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:_})}}})})]}):null}function $c(t){var e,r,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,c=t.surveyLanguage,v=Pl(!0),f=v[0],p=v[1],g=Pl(!1),m=g[0],y=g[1],b=Pl({}),_=b[0],w=b[1],x=()=>{y(!m)};if(Ol((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===l.id&&(cu.info("Received show event for feedback button survey "+l.id),w(r.detail.position||{}),x())};return Zs(Tc,Ec,e),()=>{Tc.removeEventListener(Ec,e)}}}else cu.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),Oc({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var k=()=>{l.schedule!==Yl.Always&&p(!1),setTimeout((()=>{y(!1)}),200)};return Ld(Ka,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ld("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Gl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:Lc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Ld(Ac,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:c})]})}var Dc=t=>{var e=t.question,i=t.onSubmit,n=t.onPreviewSubmit,s={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Kl.Open:return Ga(Kd,r({},s,{question:e,key:e.id}));case Kl.Link:return Ga(Jd,r({},s,{question:e,key:e.id}));case Kl.Rating:return Ga(Yd,r({},s,{question:e,key:e.id}));case Kl.SingleChoice:case Kl.MultipleChoice:return Ga(tc,r({},s,{question:e,key:e.id}));default:return cu.error("Unsupported question type: "+e.type),null}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.generateSurveys=Pc,Ca.extendPostHogWithSurveys=Pc;var Nc=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),qc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return Nc(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return Nc(e,JSON.stringify(t.slice(0,n)),r)},jc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Bc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},Uc=(t,e,r)=>{if(!r.truncated)if(Zr(t)){if(r.seen.has(t))return void Bc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Uc(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else Bc(e,t,r)},Hc=function(t,e,r,i,n,s){if(void 0===n&&(n=!1),!jc(t))return!n||Nc(e,"null",r);if(Yr(t)||(t=>{try{return ti(t)||ri(t)}catch(t){return!1}})(t))return Nc(e,JSON.stringify(t),r);if("string"==typeof t)return qc(t,e,r);if(!Zr(t)&&!Wr(t))return Nc(e,JSON.stringify(t),r);if(i.has(t))return qc("[Circular]",e,r);i.add(t);try{var o=t.toJSON;if(Vr(o))return Hc(o.call(t),e,r,i,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return qc(String(t.valueOf()),e,r);if("[object Number]"===a||"[object Boolean]"===a)return Nc(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Hc(l,e,r,i,n,s)}if(Wr(t)){if(!Nc(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Nc(e,",",r))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Hc(d,e,r,i,!0))return!1}return Nc(e,"]",r)}if(!Nc(e,"{",r))return!1;var c=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(s)try{Uc(f,v,s)}catch(t){}if(jc(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!Nc(e,p,r))return!1;var b=e.length,_=Hc(f,e,r,i,!1),w=r.truncated;if(e.length!==b){if(c=!1,!_)return!1}else if(e.length=g,r.remaining=m,r.truncated=_?y:w,!_)return!1}}}catch(t){}return Nc(e,"}",r)},zc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.logs={initializeLogs(t){var e={host:Ca.location.host},i=!1,n=function(n){var s=Ca.console[n],o=(s=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{if(l.length>0&&!i&&t.is_capturing()){var h;i=!0,o=!0;var d=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=Zr(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Nc(r," ",i))&&Hc(t[s],r,i,new WeakSet,!1,0===s?n:void 0);s++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(l),c=d.body,v=d.attributes,f=r({},e,d.truncated?{body_truncated:"true"}:{});null==(h=t.logs)||h.he({level:zc[n],body:c,attributes:r({"log.source":"console."+n},f,v)})}}catch(t){}finally{o&&(i=!1),s.apply(Ca.console,l)}})(s);o.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),Ca.console[n]=o};for(var s of Object.keys(zc))n(s)}};var Wc=Ds("[Error tracking]");function Vc(){return new Wn([new ns,new fs,new os,new ss,new cs,new ds,new ls,new vs],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=rs.test(l)?l.replace(rs,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=is)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,is).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Vn});var i}))}(s)}}("web:javascript",Yn,es))}var Zc=Ds("[ExceptionAutocapture]"),Gc=Vc(),Qc={wrapOnError(t){var e=xs;e||Zc.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=Gc.buildFromUnknown((t=>{var e=t[0],r=t[1],i=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Kr(e)&&Kr(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:r,lineno:i,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return t(o),!!Vr(r)&&null!==(e=r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection(t){var e=xs;e||Zc.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=Gc.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),!!Vr(r)&&null!==(i=r(e))&&void 0!==i&&i},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError(t){var e=console;e||Zc.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Gc.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(a),Vr(r)&&r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.errorWrappingFunctions=Qc,Ca.posthogErrorWrappingFunctions=Qc;var Kc="X-POSTHOG-SESSION-ID",Jc="X-POSTHOG-WINDOW-ID",Yc="X-POSTHOG-DISTINCT-ID",Xc=[Kc,Jc,Yc],tv=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],ev=(t,e)=>({}.hasOwnProperty.call(t,e)),rv=t=>"object"==typeof t&&!Yr(t)||Vr(t),iv=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),nv=t=>{try{var e;return iv(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==xs||null==(e=xs.location)?void 0:e.href).toString()}catch(t){return}},sv=(t,e,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(Wr(t)&&!t.includes(s))return!1;var o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Kc,a.sessionId),n.set(Jc,l),o=!0}var u=(t=>Vr(t)?t():t)(e);return u&&u!==yh&&(n.set(Yc,u),o=!0),o};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{};var ov={_patchFetch:(t,e,i)=>no(xs,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=nv(s);if(u)if(iv(s)){var h=new Request(s,o);sv(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(rv(o)?o.headers:void 0);if(sv(t,e,i,u,d)){var c=((t,e)=>{if(Qr(t)||Yr(t))return{headers:e};if(rv(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>ev(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>ev(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),tv.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&tv.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(t){l=a}return n.apply(this,l)})),_patchXHR:(t,e,r)=>no(xs.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=nv(s);d&&sv(t,e,r,d,h);var c=i.call(u,n,s,o,a,l);return Xc.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),c}))};Ca.__PosthogExtensions__.tracingHeadersPatchFns=ov,Ca.postHogTracingHeadersPatchFns=ov,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});let av=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var lv=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},uv=t=>{if("loading"===document.readyState)return"loading";var e=lv();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},hv=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},dv=t=>{var e="";try{for(;9!==(null==(r=t)?void 0:r.nodeType);){var r,i,n=t,s=n.id?"#"+n.id:[hv(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},cv=new WeakMap;function vv(t,e){var r=cv.get(e);return r||(r=new WeakMap,cv.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}var fv=-1,pv=()=>fv,gv=t=>{addEventListener("pageshow",(e=>{e.persisted&&(fv=e.timeStamp,t(e))}),!0)},mv=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},yv=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},bv=()=>{var t,e;return null!==(t=null==(e=lv())?void 0:e.activationStart)&&void 0!==t?t:0},_v=-1,wv=new Set,xv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,kv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of wv)e();isFinite(_v)||(_v="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",kv,!0))}},Sv=function(t){if(void 0===t&&(t=!1),t&&(_v=1/0),0>_v){var e,r=bv(),i=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=r)))?void 0:e.startTime;_v=null!=i?i:xv(),addEventListener("visibilitychange",kv,!0),addEventListener("prerenderingchange",kv,!0),gv((()=>{setTimeout((()=>{_v=xv()}))}))}return{get firstHiddenTime(){return _v},onHidden(t){wv.add(t)}}},Tv=function(t,e,r,i,n,s,o){void 0===e&&(e=-1),void 0===i&&(i=0);var a=lv(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return r?u=r:0>pv()?a&&(document.prerendering||bv()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:i||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Cv=function(t,e,i){void 0===i&&(i={});try{var n=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(n.length>0){var s=new PerformanceObserver((t=>{queueMicrotask((()=>{var r=t.getEntries();n.length>1&&r.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(r)}))}));for(var o of n)s.observe(r({type:o,buffered:!0},i));return s}}catch(t){}},Ev=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Mv=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Iv=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Rv=class{constructor(){this.u=void 0}};var Pv,Ov=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Lv=[1800,3e3],Av=function(t,e){void 0===e&&(e={});var r=Ev(e);Ov((()=>{var i,n=vv(e,Rv),s=Sv(),o=Tv("FCP"),a=Cv(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-bv(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,i(!0)))}));a&&(i=mv(t,o,Lv,e.reportAllChanges),gv((r=>{o=Tv("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pv()),i=mv(t,o,Lv,e.reportAllChanges),yv((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&Cv(["soft-navigation"],(r=>{r.forEach((r=>{n.u&&r.navigationId&&Mv(n.u,r);var s=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Tv("FCP",s,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=mv(t,o,Lv,e.reportAllChanges))(!0)}))}),e)}))},Fv=[.1,.25],$v=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Dv=0,Nv=1/0,qv=0,jv=t=>{for(var e of t)e.interactionId&&(Nv=Math.min(Nv,e.interactionId),qv=Math.max(qv,e.interactionId),Dv=qv?(qv-Nv)/7+1:0)},Bv=()=>{var t;return Pv?Dv:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Uv=0;let Hv=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){Uv=Bv(),this.h.length=0,this.v.clear()}T(t){var e=Bv()-Uv,r=Math.min(this.h.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.h[r]:{D:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.h.at(-1),i=this.v.get(t.interactionId);if(i||10>this.h.length||t.duration>r.D){var n;if(i?t.duration>i.D?(i.entries=[t],i.D=t.duration):t.duration===i.D&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.v.set((i={id:t.interactionId,entries:[t],D:t.duration}).id,i),this.h.push(i)),this.h.sort(((t,e)=>e.D-t.D)),this.h.length>10){var s=this.h.splice(10);for(var o of s)this.v.delete(o.id)}null==(n=this.m)||n.call(this,i)}}}};var zv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Iv(t),s=-1,o=()=>{i(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},Wv=[200,500];let Vv=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var Zv=[2500,4e3],Gv={onLCP(t,e){void 0===e&&(e={});var i=vv(e=Object.assign({},e),Vv),n=new WeakMap;Ev(e)&&(i.u=new Map),i.p=t=>{var r=t.element;if(r){var i,s=null!==(i=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==i?i:dv(r);n.set(t,s)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var r=!1,i=Ev(e);Ov((()=>{var n,s=Sv(),o=Tv("LCP"),a=vv(e,Vv),l=(i,a,l,u,h)=>{o=Tv("LCP",-1,i,a,l,u,h),n=mv(t,o,Zv,e.reportAllChanges),r=!1,"soft-navigation"===i&&(s=Sv(!0))},u=t=>{a.u&&t.navigationId&&Mv(a.u,t),r||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))if(r)if("soft-navigation"!==r.entryType){var l=0,h=[],d=r.startTime;if("largest-contentful-paint"===r.entryType)l=Math.max(r.startTime-bv(),0),a.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var c,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;d=(null==(c=v.largestContentfulPaint)?void 0:c.renderTime)||0,l=Math.max(d-r.startTime,0),v.largestContentfulPaint&&(a.l(v.largestContentfulPaint),h=[v.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(r)},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");var c=Cv(d,h);if(c){n=mv(t,o,Zv,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=o.id;zv((()=>{if(!r){if(!i)for(var t of(c.disconnect(),v))removeEventListener(t,f,{capture:!0});e===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});gv((i=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pv()),n=mv(t,o,Zv,e.reportAllChanges),yv((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var s,o,a,l,u,h,d=t.entries.at(-1),c=d.url&&performance.getEntriesByType("resource").find((t=>t.name===d.url));e.target=n.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),c&&(e.lcpResourceEntry=c);var v=0,f=0;if("soft-navigation"!==t.navigationType?(v=null!==(s=null==(o=h=lv())?void 0:o.activationStart)&&void 0!==s?s:0,f=null!==(a=null==(l=h)?void 0:l.responseStart)&&void 0!==a?a:0):(v=t.navigationStartTime||0,h=null==(u=i.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-v),g=Math.max(p,c?(c.requestStart||c.startTime)-v:0),m=Math.min(t.value,Math.max(g,c?c.responseEnd-v:0));e=r({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var r=vv(e=Object.assign({},e),av),i=new WeakMap;r.t=t=>{var r;if(null!=t&&null!=(r=t.sources)&&r.length){var n=$v(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:dv(s);i.set(n,a)}}},function(t,e){void 0===e&&(e={});var r=Sv();Av(Iv((()=>{var i,n=Tv("CLS",0),s=vv(e,av),o=(r,o,a,l,u)=>{n=Tv("CLS",0,r,o,a,l,u),s.o=0,i=mv(t,n,Fv,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),i(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);a()},h=["layout-shift"];Ev(e)&&h.push("soft-navigation");var d=Cv(h,u);d&&(i=mv(t,n,Fv,e.reportAllChanges),r.onHidden((()=>{u(d.takeRecords()),i(!0)})),gv((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,pv()),yv(i)})),setTimeout(i))})))}((e=>{t((t=>{var e={};if(t.entries.length){var r,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(r=n.sources)&&r.length){var s=$v(n.sources);s&&(e={largestShiftTarget:i.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:uv(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var r=vv(e=Object.assign({},e),Rv);Ev(e)&&(r.u=new Map),Av((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:uv(pv())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var i=lv(),n=t.entries.at(-1);if(i){var s=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:uv(t.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var o,a=null==(o=r.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=vv(e=Object.assign({},e),Hv),n=[],s=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(zv(d),u=!0)},d=()=>{var t=new Set(i.h.map((t=>a.get(t.entries[0])))),e=s.length-10;s=s.filter(((r,i)=>i>=e||t.has(r)));var r=new Set;for(var l of s){var h=c(l.startTime,l.processingEnd);for(var d of h)r.add(d)}n=n.filter((t=>t.startTime>o||r.has(t))),u=!1};i.p=t=>{var r,i=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var n=s.length-1;n>=0;n--){var l=s[n];if(8>=Math.abs(i-l.renderTime)){(r=l).startTime=Math.min(t.startTime,r.startTime),r.processingStart=Math.min(t.processingStart,r.processingStart),r.processingEnd=Math.max(t.processingEnd,r.processingEnd),e.includeProcessedEventEntries&&r.entries.push(t);break}}r||s.push(r={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&a.set(t,r),h()},i.m=t=>{if(!l.get(t)){var r,i=null==(r=t.entries.find((t=>t.target)))?void 0:r.target;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:dv(i);l.set(t,s)}else{var o,a=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;a&&l.set(t,a)}}};var c=(t,e)=>{var r=[];for(var i of n)if(i.startTime+i.duration>=t){if(i.startTime>e)break;r.push(i)}return r};Cv(["long-animation-frame"],(t=>{n=n.concat(t),h()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Sv();Ov((()=>{var n;"interactionCount"in performance||Pv||(Pv=Cv(["event"],jv,{durationThreshold:0}));var s,o=Tv("INP"),a=vv(e,Hv),l=(r,i,n,l,u)=>{a.M(),o=Tv("INP",-1,r,i,n,l,u),s=mv(t,o,Wv,e.reportAllChanges)},u=()=>{var t=a.T(o.navigationType);t&&t.D!==o.value&&(o.value=t.D,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),zv((()=>{for(var r of t)"soft-navigation"!==r.entryType?a.l(r):h(r);u(),e&&s(!0)}))},c=["event","first-input"];Ev(e)&&c.push("soft-navigation");var v=Cv(c,d,r({},e,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40}));s=mv(t,o,Wv,e.reportAllChanges),v&&(i.onHidden((()=>{d(v.takeRecords(),!0)})),gv((()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pv())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:uv(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.get(r),s=n.processingStart,o=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,o),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),d=c(r.startTime,u),v=i.v.get(r.interactionId),f={interactionTarget:l.get(v),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:o,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:o-u,loadState:uv(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var r=t.interactionTime,i=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&r&&i){var n,s,o=t.inputDelay,a=t.processingDuration,l=0,u=0,h=0,d=0;for(var c of t.longAnimationFrameEntries)for(var v of(u=u+c.startTime+c.duration-c.styleAndLayoutStart,c.scripts)){var f=v.startTime+v.duration;if(f>=r){var p=f-Math.max(r,v.startTime),g=v.duration?p/v.duration*v.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=r+o>v.startTime?"input-delay":r+o+a>v.startTime?"processing-duration":"presentation-delay",n=v,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=r+o+a&&(h=i-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=i-r-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Gv,Ca.__PosthogExtensions__.postHogWebVitalsCallbacks=Gv,Ca.postHogWebVitalsCallbacks=Gv;var Qv=-1,Kv=()=>Qv,Jv=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Qv=e.timeStamp,t(e))}),!0)},Yv=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Xv=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},tf=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},ef=()=>{var t,e;return null!==(t=null==(e=tf())?void 0:e.activationStart)&&void 0!==t?t:0},rf=-1,nf=new Set,sf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,of=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of nf)e();isFinite(rf)||(rf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",of,!0))}},af=function(t){if(void 0===t&&(t=!1),t&&(rf=1/0),0>rf){var e,r=ef(),i=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=r)))?void 0:e.startTime;rf=null!=i?i:sf(),addEventListener("visibilitychange",of,!0),addEventListener("prerenderingchange",of,!0),Jv((()=>{setTimeout((()=>{rf=sf()}))}))}return{get firstHiddenTime(){return rf},onHidden(t){nf.add(t)}}},lf=function(t,e,r,i,n,s,o){void 0===e&&(e=-1),void 0===i&&(i=0);var a=tf(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return r?u=r:0>Kv()?a&&(document.prerendering||ef()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:i||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},uf=new WeakMap;function hf(t,e){var r=uf.get(e);return r||(r=new WeakMap,uf.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}let df=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}};var cf=function(t,e,i){void 0===i&&(i={});try{var n=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(n.length>0){var s=new PerformanceObserver((t=>{queueMicrotask((()=>{var r=t.getEntries();n.length>1&&r.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(r)}))}));for(var o of n)s.observe(r({type:o,buffered:!0},i));return s}}catch(t){}},vf=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},ff=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},pf=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let gf=class{constructor(){this.l=void 0}};var mf,yf=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},bf=[1800,3e3],_f=function(t,e){void 0===e&&(e={});var r=vf(e);yf((()=>{var i,n=hf(e,gf),s=af(),o=lf("FCP"),a=cf(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-ef(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,i(!0)))}));a&&(i=Yv(t,o,bf,e.reportAllChanges),Jv((r=>{o=lf("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Kv()),i=Yv(t,o,bf,e.reportAllChanges),Xv((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&cf(["soft-navigation"],(r=>{r.forEach((r=>{n.l&&r.navigationId&&ff(n.l,r);var s=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=lf("FCP",s,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Yv(t,o,bf,e.reportAllChanges))(!0)}))}),e)}))},wf=[.1,.25],xf=0,kf=1/0,Sf=0,Tf=t=>{for(var e of t)e.interactionId&&(kf=Math.min(kf,e.interactionId),Sf=Math.max(Sf,e.interactionId),xf=Sf?(Sf-kf)/7+1:0)},Cf=()=>{var t;return mf?xf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Ef=0;let Mf=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){Ef=Cf(),this.u.length=0,this.v.clear()}M(t){var e=Cf()-Ef,r=Math.min(this.u.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.u[r]:{_:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.v.get(t.interactionId);if(i||10>this.u.length||t.duration>r._){var n;if(i?t.duration>i._?(i.entries=[t],i._=t.duration):t.duration===i._&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.v.set((i={id:t.interactionId,entries:[t],_:t.duration}).id,i),this.u.push(i)),this.u.sort(((t,e)=>e._-t._)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.v.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var If=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=pf(t),s=-1,o=()=>{i(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},Rf=[200,500];let Pf=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var Of=[2500,4e3],Lf={onLCP(t,e){void 0===e&&(e={});var r=!1,i=vf(e);yf((()=>{var n,s=af(),o=lf("LCP"),a=hf(e,Pf),l=(i,a,l,u,h)=>{o=lf("LCP",-1,i,a,l,u,h),n=Yv(t,o,Of,e.reportAllChanges),r=!1,"soft-navigation"===i&&(s=af(!0))},u=t=>{a.l&&t.navigationId&&ff(a.l,t),r||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))if(r)if("soft-navigation"!==r.entryType){var l=0,h=[],d=r.startTime;if("largest-contentful-paint"===r.entryType)l=Math.max(r.startTime-ef(),0),a.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var c,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;d=(null==(c=v.largestContentfulPaint)?void 0:c.renderTime)||0,l=Math.max(d-r.startTime,0),v.largestContentfulPaint&&(a.h(v.largestContentfulPaint),h=[v.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(r)},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");var c=cf(d,h);if(c){n=Yv(t,o,Of,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=o.id;If((()=>{if(!r){if(!i)for(var t of(c.disconnect(),v))removeEventListener(t,f,{capture:!0});e===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});Jv((i=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Kv()),n=Yv(t,o,Of,e.reportAllChanges),Xv((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=af();_f(pf((()=>{var i,n=lf("CLS",0),s=hf(e,df),o=(r,o,a,l,u)=>{n=lf("CLS",0,r,o,a,l,u),s.i=0,i=Yv(t,n,wf,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),i(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);a()},h=["layout-shift"];vf(e)&&h.push("soft-navigation");var d=cf(h,u);d&&(i=Yv(t,n,wf,e.reportAllChanges),r.onHidden((()=>{u(d.takeRecords()),i(!0)})),Jv((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Kv()),Xv(i)})),setTimeout(i))})))},onFCP:_f,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=af();yf((()=>{var n;"interactionCount"in performance||mf||(mf=cf(["event"],Tf,{durationThreshold:0}));var s,o=lf("INP"),a=hf(e,Mf),l=(r,i,n,l,u)=>{a.T(),o=lf("INP",-1,r,i,n,l,u),s=Yv(t,o,Rf,e.reportAllChanges)},u=()=>{var t=a.M(o.navigationType);t&&t._!==o.value&&(o.value=t._,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),If((()=>{for(var r of t)"soft-navigation"!==r.entryType?a.h(r):h(r);u(),e&&s(!0)}))},c=["event","first-input"];vf(e)&&c.push("soft-navigation");var v=cf(c,d,r({},e,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40}));s=Yv(t,o,Rf,e.reportAllChanges),v&&(i.onHidden((()=>{d(v.takeRecords(),!0)})),Jv((()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Kv())})))}))}}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Lf,Ca.__PosthogExtensions__.postHogWebVitalsCallbacks=Lf,Ca.postHogWebVitalsCallbacks=Lf,Ca.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Lf;let Af=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(t){var e;if(!t.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var Ff=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},$f=t=>{if("loading"===document.readyState)return"loading";var e=Ff();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Df=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Nf=t=>{var e="";try{for(;9!==(null==(r=t)?void 0:r.nodeType);){var r,i=t,n=i.id?"#"+i.id:[Df(i),...Array.from(i.classList).sort()].join(".");if(e.length+n.length>99)return e||n;if(e=e?n+">"+e:n,i.id)break;t=i.parentNode}}catch(t){}return e},qf=new WeakMap;function jf(t,e){var r=qf.get(e);return r||(r=new WeakMap,qf.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}var Bf,Uf=-1,Hf=()=>Uf,zf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Uf=e.timeStamp,t(e))}),!0)},Wf=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Vf=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Zf=()=>{var t,e;return null!==(t=null==(e=Ff())?void 0:e.activationStart)&&void 0!==t?t:0},Gf=function(t,e){void 0===e&&(e=-1);var r=Ff(),i="navigate";return 0>Hf()?r&&(document.prerendering||Zf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Qf=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Kf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Jf=-1,Yf=new Set,Xf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,tp=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Yf)e();isFinite(Jf)||(Jf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",tp,!0))}},ep=()=>{if(0>Jf){var t,e=Zf(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Jf=null!=r?r:Xf(),addEventListener("visibilitychange",tp,!0),addEventListener("prerenderingchange",tp,!0),zf((()=>{setTimeout((()=>{Jf=Xf()}))}))}return{get firstHiddenTime(){return Jf},onHidden(t){Yf.add(t)}}},rp=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},ip=[1800,3e3],np=function(t,e){void 0===e&&(e={}),rp((()=>{var r,i=ep(),n=Gf("FCP"),s=Qf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Zf(),0),n.entries.push(e),r(!0)))}));s&&(r=Wf(t,n,ip,e.reportAllChanges),zf((i=>{n=Gf("FCP"),r=Wf(t,n,ip,e.reportAllChanges),Vf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},sp=[.1,.25],op=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],ap=0,lp=1/0,up=0,hp=t=>{for(var e of t)e.interactionId&&(lp=Math.min(lp,e.interactionId),up=Math.max(up,e.interactionId),ap=up?(up-lp)/7+1:0)},dp=()=>{var t;return Bf?ap:null!==(t=performance.interactionCount)&&void 0!==t?t:0},cp=0;let vp=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){cp=dp(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((dp()-cp)/50));return this.l[t]}u(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.l.at(-1),i=this.h.get(t.interactionId);if(i||10>this.l.length||t.duration>r.T){var n;if(i?t.duration>i.T?(i.entries=[t],i.T=t.duration):t.duration===i.T&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.h.set((i={id:t.interactionId,entries:[t],T:t.duration}).id,i),this.l.push(i)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.h.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var fp=t=>{var e=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var i=Kf(t),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},pp=[200,500];let gp=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],mp={onLCP(t,e){void 0===e&&(e={});var i=jf(e=Object.assign({},e),gp),n=new WeakMap;i.m=t=>{var r=t.element;if(r){var i,s=null!==(i=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==i?i:Nf(r);n.set(t,s)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),rp((()=>{var r,i=ep(),n=Gf("LCP"),s=jf(e,gp),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Zf(),0),n.entries=[o],r())},a=Qf("largest-contentful-paint",o);if(a){r=Wf(t,n,$,e.reportAllChanges);var l=Kf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(fp(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});zf((i=>{n=Gf("LCP"),r=Wf(t,n,$,e.reportAllChanges),Vf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var i=t.entries.at(-1),s=i.url&&performance.getEntriesByType("resource").find((t=>t.name===i.url));e.target=n.get(i),e.lcpEntry=i,i.url&&(e.url=i.url),s&&(e.lcpResourceEntry=s);var o=Ff();if(o){var a=o.activationStart||0,l=Math.max(0,o.responseStart-a),u=Math.max(l,s?(s.requestStart||s.startTime)-a:0),h=Math.min(t.value,Math.max(u,s?s.responseEnd-a:0));e=r({},e,{timeToFirstByte:l,resourceLoadDelay:u-l,resourceLoadDuration:h-u,elementRenderDelay:t.value-h,navigationEntry:o})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var r=jf(e=Object.assign({},e),Af),i=new WeakMap;r.t=t=>{var r;if(null!=t&&null!=(r=t.sources)&&r.length){var n=op(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Nf(s);i.set(n,a)}}},function(t,e){void 0===e&&(e={});var r=ep();np(Kf((()=>{var i,n=Gf("CLS",0),s=jf(e,Af),o=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,i())},a=Qf("layout-shift",o);a&&(i=Wf(t,n,sp,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),zf((()=>{s.o=0,n=Gf("CLS",0),i=Wf(t,n,sp,e.reportAllChanges),Vf(i)})),setTimeout(i))})))}((e=>{t((t=>{var e={};if(t.entries.length){var r,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(r=n.sources)&&r.length){var s=op(n.sources);s&&(e={largestShiftTarget:i.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:$f(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),np((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:$f(Hf())};if(t.entries.length){var r=Ff(),i=t.entries.at(-1);if(r){var n=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:n,firstByteToFCP:t.value-n,loadState:$f(t.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var r=jf(e=Object.assign({},e),vp),i=[],n=[],s=0,o=new WeakMap,a=new WeakMap,l=!1,u=()=>{l||(fp(h),l=!0)},h=()=>{var t=new Set(r.l.map((t=>o.get(t.entries[0])))),e=n.length-10;n=n.filter(((r,i)=>i>=e||t.has(r)));var a=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var c of h)a.add(c)}i=i.filter((t=>t.startTime>s||a.has(t))),l=!1};r.m=t=>{var r,i=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var a=n.length-1;a>=0;a--){var l=n[a];if(8>=Math.abs(i-l.renderTime)){(r=l).startTime=Math.min(t.startTime,r.startTime),r.processingStart=Math.min(t.processingStart,r.processingStart),r.processingEnd=Math.max(t.processingEnd,r.processingEnd),!1!==e.includeProcessedEventEntries&&r.entries.push(t);break}}r||n.push(r={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:!1!==e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&o.set(t,r),u()},r.p=t=>{if(!a.get(t)){var r,i=null==(r=t.entries.find((t=>t.target)))?void 0:r.target;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Nf(i);a.set(t,s)}else{var o,l=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;l&&a.set(t,l)}}};var d=(t,e)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=t){if(n.startTime>e)break;r.push(n)}return r};Qf("long-animation-frame",(t=>{i=i.concat(t),u()})),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=ep();rp((()=>{var i;"interactionCount"in performance||Bf||(Bf=Qf("event",hp,{durationThreshold:0}));var n,s=Gf("INP"),o=jf(e,vp),a=t=>{fp((()=>{for(var e of t)o.u(e);var r=o.M();r&&r.T!==s.value&&(s.value=r.T,s.entries=r.entries,n())}))},l=Qf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Wf(t,s,pp,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),zf((()=>{o.v(),s=Gf("INP"),n=Wf(t,s,pp,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],i=o.get(e),n=e.processingStart,s=Math.max(e.startTime+e.duration,n),l=Math.min(i.processingEnd,s),u=i.entries.sort(((t,e)=>t.processingStart-e.processingStart)),h=d(e.startTime,l),c=r.h.get(e.interactionId),v={interactionTarget:a.get(c),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:h,inputDelay:n-e.startTime,processingDuration:l-n,presentationDelay:s-l,loadState:$f(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{if(null!=(e=t.longAnimationFrameEntries)&&e.length){var r,i,n=t.interactionTime,s=t.inputDelay,o=t.processingDuration,a=0,l=0,u=0,h=0;for(var d of t.longAnimationFrameEntries)for(var c of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var v=c.startTime+c.duration;if(v>=n){var f=v-Math.max(n,c.startTime),p=c.duration?f/c.duration*c.forcedStyleAndLayoutDuration:0;a+=f-p,l+=p,f>h&&(i=n+s>c.startTime?"input-delay":n+s+o>c.startTime?"processing-duration":"presentation-delay",r=c,h=f)}}var g=t.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+s+o&&(u=t.nextPaintTime-m),r&&i&&(t.longestScript={entry:r,subpart:i,intersectingDuration:h}),t.totalScriptDuration=a,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-a-l-u}})(v),Object.assign(t,{attribution:v})})(e))}),e)}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=mp,Ca.__PosthogExtensions__.postHogWebVitalsCallbacks=mp,Ca.postHogWebVitalsCallbacks=mp;var yp=-1,bp=t=>{addEventListener("pageshow",(e=>{e.persisted&&(yp=e.timeStamp,t(e))}),!0)},_p=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},wp=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},xp=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},kp=()=>{var t,e;return null!==(t=null==(e=xp())?void 0:e.activationStart)&&void 0!==t?t:0},Sp=function(t,e){void 0===e&&(e=-1);var r=xp(),i="navigate";return 0>yp?r&&(document.prerendering||kp()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Tp=new WeakMap;function Cp(t,e){var r=Tp.get(e);return r||(r=new WeakMap,Tp.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}class Ep{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Mp,Ip=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Rp=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Pp=-1,Op=new Set,Lp=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Ap=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Op)e();isFinite(Pp)||(Pp="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Ap,!0))}},Fp=()=>{if(0>Pp){var t,e=kp(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Pp=null!=r?r:Lp(),addEventListener("visibilitychange",Ap,!0),addEventListener("prerenderingchange",Ap,!0),bp((()=>{setTimeout((()=>{Pp=Lp()}))}))}return{get firstHiddenTime(){return Pp},onHidden(t){Op.add(t)}}},$p=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Dp=[1800,3e3],Np=function(t,e){void 0===e&&(e={}),$p((()=>{var r,i=Fp(),n=Sp("FCP"),s=Ip("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-kp(),0),n.entries.push(e),r(!0)))}));s&&(r=_p(t,n,Dp,e.reportAllChanges),bp((i=>{n=Sp("FCP"),r=_p(t,n,Dp,e.reportAllChanges),wp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},qp=[.1,.25],jp=0,Bp=1/0,Up=0,Hp=t=>{for(var e of t)e.interactionId&&(Bp=Math.min(Bp,e.interactionId),Up=Math.max(Up,e.interactionId),jp=Up?(Up-Bp)/7+1:0)},zp=()=>{var t;return Mp?jp:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Wp=0;class Vp{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Wp=zp(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((zp()-Wp)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.l.at(-1),i=this.u.get(t.interactionId);if(i||10>this.l.length||t.duration>r.L){var n;if(i?t.duration>i.L?(i.entries=[t],i.L=t.duration):t.duration===i.L&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.u.set((i={id:t.interactionId,entries:[t],L:t.duration}).id,i),this.l.push(i)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var Zp=t=>{var e=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var i=Rp(t),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},Gp=[200,500];class Qp{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Kp=[2500,4e3],Jp={onLCP(t,e){void 0===e&&(e={}),$p((()=>{var r,i=Fp(),n=Sp("LCP"),s=Cp(e,Qp),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-kp(),0),n.entries=[o],r())},a=Ip("largest-contentful-paint",o);if(a){r=_p(t,n,Kp,e.reportAllChanges);var l=Rp((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(Zp(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});bp((i=>{n=Sp("LCP"),r=_p(t,n,Kp,e.reportAllChanges),wp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=Fp();Np(Rp((()=>{var i,n=Sp("CLS",0),s=Cp(e,Ep),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Ip("layout-shift",o);a&&(i=_p(t,n,qp,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),bp((()=>{s.i=0,n=Sp("CLS",0),i=_p(t,n,qp,e.reportAllChanges),wp(i)})),setTimeout(i))})))},onFCP:Np,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Fp();$p((()=>{var i;"interactionCount"in performance||Mp||(Mp=Ip("event",Hp,{durationThreshold:0}));var n,s=Sp("INP"),o=Cp(e,Vp),a=t=>{Zp((()=>{for(var e of t)o.h(e);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=Ip("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=_p(t,s,Gp,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),bp((()=>{o.v(),s=Sp("INP"),n=_p(t,s,Gp,e.reportAllChanges)})))}))}}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Jp,Ca.__PosthogExtensions__.postHogWebVitalsCallbacks=Jp,Ca.postHogWebVitalsCallbacks=Jp,Ca.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Jp;class Yp{constructor(t){this.disabled=!1===t;var e=Zr(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var Xp="$copy_autocapture",tg=Ds("[AutoCapture]");function eg(t,e){return e.length>t?e.slice(0,t)+"...":e}function rg(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!fo(e));return e}function ig(t,e){var i,n,s=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!fo(t))return{props:{}};for(var d=[t],c=new Set([t]),v=t;v.parentNode&&!po(v,"body")&&yo>d.length;)if(mo(v.parentNode)){var f=v.parentNode.host;if(c.has(f))break;c.add(f),d.push(f),v=f}else{if(!fo(v.parentNode))break;if(c.has(v.parentNode))break;c.add(v.parentNode),d.push(v.parentNode),v=v.parentNode}var p,g,m=[],y={},b=!1,_=!1;if(qs(d,(t=>{var e=No(t);if(po(t,"a")){var r=t.getAttribute("href");b=!!(e&&r&&Zo(r))&&(h?kn(r):r)}Nr(wo(t),"ph-no-capture")&&(_=!0),m.push(function(t,e,r,i,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};To.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?eg(1024,Go(t)):eg(1024,ko(t)));var a=wo(t);a.length>0&&(o.classes=a.filter((function(t){return""!==t}))),qs(t.attributes,(function(r){var s;if((!qo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Zo(r.value)&&(!Kr(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=r.value;"class"===r.name&&(a=bo(a).join(" ")),o["attr__"+r.name]=eg(1024,"href"===r.name&&n?kn(a):a)}}));for(var l=1,u=1,h=t;h=rg(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,l,h));var i=function(t){if(!No(t))return{};var e={};return qs(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Zo(i)&&(e[r]=i)}})),e}(t);js(y,i)})),_)return{props:{},explicitNoCapture:_};if(a||(m[0].$el_text=po(t,"a")||po(t,"button")?Go(t):ko(t)),b){var w,x;m[0].attr__href=b;var k=null==(w=Ks(b))?void 0:w.host,S=null==xs||null==(x=xs.location)?void 0:x.host;k&&S&&k!==S&&(p=b)}return{props:js({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(t){return t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Bs(o).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return a[Ko(t[0].toString())]=Ko(e.toString())})),(n+=":")+Bs(a).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Jo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Bs(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>i.attributes[t[0]]=t[1])),i}))}(g)))},null!=(i=m[0])&&i.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},y)}}var ng={};function sg(t,e){var r=ng[t];if(r)return r;var i=e[t];if((t=>Vr(t)&&-1!==t.toString().indexOf("[native code]"))(i)&&(null==xs||!xs.Zone))return ng[t]=i.bind(e);var n=e.document;if(n&&Vr(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var a,l,u=s.contentWindow;u&&u[t]&&(i=u[t],"MutationObserver"===t&&function(t){return Nr(t,"AppleWebKit")&&!Nr(t,"Chrome")}(null!==(a=null==(l=e.navigator)?void 0:l.userAgent)&&void 0!==a?a:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){$s.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var h;!o&&null!=(h=s)&&h.parentNode&&s.parentNode.removeChild(s)}}return i&&Vr(i)?ng[t]=i.bind(e):i}function og(t,e){var i=So(t);return i?r({node:i,originalEvent:t,timestamp:Date.now()},e):null}function ag(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function lg(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var ug="canvas,video,audio,embed,object";function hg(t,e){return ti(t)&&t>=e}class dg{me(t){var e,r,i,n,s,o,a,l,u=this.ye((null==t?void 0:t.__onCapture)||this.ge.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.be=[],this.we=0,this.ye=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.ke=t=>{var e=og(t,{type:"click"});Yr(e)||this.xe(e)||this.be.push(e),this.Se()},this.Ce=()=>{var t=Date.now();this.Me=t,t%50==0&&this.be.forEach((e=>{Qr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Te=()=>{this._e=Date.now()},this.Ie=()=>{"visible"===(null==Ts?void 0:Ts.visibilityState)&&(this.Ee=Date.now())},this.Le=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[0]:void 0;this.Re=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.Oe=()=>{this.Re=void 0},this.Ne=t=>{var e,r=this.Re;if(this.Re=void 0,!Qr(r)&&this.Pe.max_dead_swipes_per_page_load>this.we){var i=t,n=null==(e=i.changedTouches)?void 0:e[0];if(n){var s=n.clientX-r.x,o=n.clientY-r.y,a=s*s+o*o,l=this.Pe.swipe_threshold_px;if(a>=l*l&&![this.Me,this.Ae,this._e].some((t=>ti(t)&&t>=r.timestamp))){var u;if(this.De()&&(null!==(u=null==Ts||null==Ts.elementsFromPoint?void 0:Ts.elementsFromPoint(r.x,r.y))&&void 0!==u?u:[]).some((t=>null==t.matches?void 0:t.matches(ug))))return;var h=og(i,{type:"swipe",swipeDirection:ag(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Yr(h)||this.xe(h)||this.be.push(h),this.Se()}}}},this.instance=t,this.Pe=this.me(e),this._onCapture=this.Pe.__onCapture}start(t){this.qe(),this.Fe(),this.je(),this.He(),this.Be(t),this.Pe.capture_dead_swipes&&this.Ue()}Be(t){if(!this.We){var e=function(t){return sg("MutationObserver",t)}(Ca);this.We=new e((t=>{this.Ve(t)})),this.We.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.We)||t.disconnect(),this.We=void 0,Ca.removeEventListener("click",this.ke),Ca.removeEventListener("scroll",this.Ce,{capture:!0}),Ca.removeEventListener("selectionchange",this.Te),Ca.removeEventListener("touchstart",this.Le,{capture:!0}),Ca.removeEventListener("touchend",this.Ne,{capture:!0}),Ca.removeEventListener("touchcancel",this.Oe,{capture:!0}),null==Ts||Ts.removeEventListener("visibilitychange",this.Ie),this.Re=void 0}Ve(t){this.Ae=Date.now()}qe(){Zs(Ca,"click",this.ke)}Se(){this.be.length&&Qr(this.Ze)&&(this.Ze=Ca.setTimeout((()=>{this.ze()}),1e3))}Fe(){Zs(Ca,"scroll",this.Ce,{capture:!0})}je(){Zs(Ca,"selectionchange",this.Te)}He(){Zs(Ts,"visibilitychange",this.Ie)}Ue(){Zs(Ca,"touchstart",this.Le,{capture:!0,passive:!0}),Zs(Ca,"touchend",this.Ne,{capture:!0,passive:!0}),Zs(Ca,"touchcancel",this.Oe,{capture:!0,passive:!0})}De(){var t=Qr(this.$e)||ti(this.Ae)&&this.Ae>this.$e;return(Qr(this.Qe)||t)&&(this.$e=Date.now(),this.Qe=!(null==Ts||!Ts.querySelector(ug))),!!this.Qe}xe(t){return!t||("swipe"===t.type?this.Ge(t):this.Ye(t))}Ge(t){if(vo(t.node))return!0;var e=this.be.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!e&&!po(t.node,"html")&&fo(t.node)&&function(t,e){var r;if(!xs||$o(t))return!1;var i=ri(e)?Oo:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:Oo;return!Co(Do(t,!1).targetElementList,i)}(t.node,{css_selector_ignorelist:this.Pe.css_selector_ignorelist}))}Ye(t){return!(this.Pe.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Ge(t)||(r=t.node,!(!xs||$o(r))&&Do(r,!1).targetElementList.some((t=>po(t,"a"))));var e,r}ze(){if(this.be.length){clearTimeout(this.Ze),this.Ze=void 0;var t=this.be;for(var e of(this.be=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Ae&&this.Ae>=e.timestamp?this.Ae-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this._e&&this._e>=e.timestamp?this._e-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Ee?Math.abs(e.timestamp-this.Ee):void 0;var i=hg(e.scrollDelayMs,this.Pe.scroll_threshold_ms),n=hg(e.selectionChangedDelayMs,this.Pe.selection_change_threshold_ms),s=hg(e.mutationDelayMs,this.Pe.mutation_threshold_ms),o=hg(e.absoluteDelayMs,1.1*this.Pe.mutation_threshold_ms),a=ti(e.scrollDelayMs)&&this.Pe.scroll_threshold_ms>e.scrollDelayMs,l=ti(e.mutationDelayMs)&&this.Pe.mutation_threshold_ms>e.mutationDelayMs,u=ti(e.selectionChangedDelayMs)&&this.Pe.selection_change_threshold_ms>e.selectionChangedDelayMs,h=ti(e.visibilityChangedDelayMs)&&this.Pe.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=hg(e.visibilityChangedDelayMs,this.Pe.selection_change_threshold_ms);if(i||s||o||n||d){var c=lg(e);if("$dead_swipe"===c){if(this.we>=this.Pe.max_dead_swipes_per_page_load)continue;this.we++}this._onCapture(e,{[c+"_last_mutation_timestamp"]:this.Ae,[c+"_event_timestamp"]:e.timestamp,[c+"_scroll_timeout"]:i,[c+"_mutation_timeout"]:s,[c+"_absolute_timeout"]:o,[c+"_selection_changed_timeout"]:n,[c+"_visibility_changed_timeout"]:d})}else this.Pe.mutation_threshold_ms>e.absoluteDelayMs&&this.be.push(e)}}this.Se()}}ge(t,e){var i=lg(t);this.instance.capture(i,r({},e,ig(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Pe.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new dg(t,e);var cg=Ds("[ExternalScriptsLoader]"),vg=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return cg.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Ts?void 0:Ts.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!Ts)return r("document not found");var i=Ts.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)Ts.head.appendChild(i);else{var n,s=Ts.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):Ts.body.appendChild(i)}};null!=Ts&&Ts.body?a():null==Ts||Ts.addEventListener("DOMContentLoaded",a)};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if("remote-config"!==e){var i;if(t.config.strict_script_versioning)i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var n="/static/"+e+".js?v="+t.version;if("toolbar"===e){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=t.requestRouter.endpointFor("assets",n)}vg(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");vg(t,o,r)}},Ca.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);vg(t,i,r)};As.DEBUG=!1,As.LIB_VERSION="1.412.0",As.LIB_NAME="web";class fg{constructor(t){this._instance=t}get Pe(){return this._instance.config}get consent(){return this.ti()?0:this.ei}isOptedOut(){return this.Pe.cookieless_mode===Th||this.isRejected()||-1===this.consent&&this.Pe.cookieless_mode===Sh}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Pe.opt_out_capturing_by_default}optInOut(t){this.ii.A(this.ri,t?1:0,this.Pe.cookie_expiration,this.Pe.cross_subdomain_cookie,this.Pe.secure_cookie)}reset(){this.ii.F(this.ri,this.Pe.cross_subdomain_cookie)}get ri(){var t=this._instance.config,e=t.token,r=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(r?r+e:"__ph_opt_in_out_"+e)}get ei(){var t=this.ii.q(this.ri);return di(t)?1:Nr(ci,t)?0:-1}get ii(){var t=this.Pe.opt_out_capturing_persistence_type,e="localStorage"===t?Yh:Kh;if(!this.ni||this.ni!==e){this.ni=e;var r="localStorage"===t?Kh:Yh;r.q(this.ri)&&(this.ni.q(this.ri)||this.optInOut(di(r.q(this.ri))),r.F(this.ri,this.Pe.cross_subdomain_cookie))}return this.ni}ti(){return!!this.Pe.respect_dnt&&[null==Ss?void 0:Ss.doNotTrack,null==Ss?void 0:Ss.msDoNotTrack,Ca.doNotTrack].some((t=>di(t)))}}var pg=Ds("[Dead Clicks]"),gg=()=>!0,mg=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(Lu)),i=t.instance.config.capture_dead_clicks;return ri(i)?i:!!Zr(i)||r};class yg{get lazyLoadedDeadClicksAutocapture(){return this.si}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Lu]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.ai((()=>{this.oi()})):this.stop()}ai(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?pg.error("failed to load script",e):t()}))}oi(){var t;if(Ts){if(!this.si&&null!=(t=Ca.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Zr(this.instance.config.capture_dead_clicks)?r({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.si=Ca.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.si.start(Ts),pg.info("starting...")}}else pg.error("`document` not found. Cannot start.")}stop(){this.si&&(this.si.stop(),this.si=void 0,pg.info("stopping..."))}}var bg=Ds("[SegmentIntegration]");var _g="posthog-js";function wg(t,e){var i=void 0===e?{}:e,n=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:e.tags};return n&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class xg{constructor(t,e,r,i,n,s){this.name=_g,this.setupOnce=function(o){o(wg(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class kg{constructor(t){this.li=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&($s.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ui=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.hi()}hi(){var t;this.di=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.li)}destroy(){var t;null==(t=this.di)||t.call(this),this.di=void 0}doPageView(t,e){var r,i=this.vi(t,e);return this.ui={pathname:null!==(r=null==xs?void 0:xs.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.vi(t,null==(e=this.ui)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ui)?void 0:t.pageViewId}}vi(t,e){var r=this.ui;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Qr(s)||Qr(o)||Qr(a)||Qr(l)||Qr(u)||Qr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?vi(o/s,0,1,$s):1,c=s>1?vi(a/s,0,1,$s):1,v=l>1?vi(u/l,0,1,$s):1,f=l>1?vi(h/l,0,1,$s):1;i=js(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Sg=["flags","surveys"],Tg={[xu]:{exposure:"hidden"},[Tu]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Cu]:{exposure:"hidden"},[Eu]:{exposure:"event"},[Mu]:{exposure:"hidden"},[Iu]:{exposure:"event"},[Ru]:{exposure:"hidden"},[Pu]:{exposure:"event"},[Ou]:{exposure:"event"},[Lu]:{exposure:"event"},[Au]:{exposure:"hidden"},[Fu]:{exposure:"event"},[$u]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Uu]:{exposure:"hidden"},[Hu]:{exposure:"event"},[Du]:{exposure:"event",shouldSkipFromEventProperties:t=>Yr(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[zu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Zr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[Wu]:{exposure:"event",storageGroup:"flags"},[Vu]:{exposure:"hidden"},[Zu]:{exposure:"hidden",storageGroup:"flags"},[Gu]:{exposure:"event",storageGroup:"flags"},[Qu]:{exposure:"event",storageGroup:"flags",volatile:!0},[Ku]:{exposure:"hidden",storageGroup:"flags"},[Ju]:{exposure:"event"},[Yu]:{exposure:"hidden"},[Xu]:{exposure:"hidden"},[th]:{exposure:"hidden"},[eh]:{exposure:"hidden",storageGroup:"surveys"},[rh]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ih]:{exposure:"event"},[nh]:{exposure:"hidden"},[sh]:{exposure:"hidden"},[oh]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ah]:{exposure:"hidden"},[lh]:{exposure:"hidden"},[uh]:{exposure:"hidden"},[hh]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[dh]:{exposure:"hidden"},[ch]:{exposure:"hidden"},[vh]:{exposure:"hidden"},[fh]:{exposure:"hidden"},[ph]:{exposure:"hidden"},[gh]:{exposure:"hidden"},[mh]:{exposure:"hidden"},[Nu]:{exposure:"event"},[qu]:{exposure:"event"},[ju]:{exposure:"event"},[Bu]:{exposure:"event"},[_h]:{exposure:"event"},[wh]:{exposure:"event"},[xh]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Cg=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Eg=t=>{var e=Tg[t];if(e)return e;for(var r of Cg){var i=r[1];if(0===t.indexOf(r[0]))return i}},Mg={flags:hh,surveys:rh},Ig=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Rg="main";class Pg{constructor(t,e,i){if(void 0===i&&(i=!0),this.ci={},this.fi=!1,this.pi=!1,this.Pe=t,this.gi=i,this.props={},this.mi=void 0,this.yi=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.ii=this.bi(t),this.pi=this.wi(t),this.load(),t.debug&&$s.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save(),xs){var n=()=>this.flush();Zs(xs,"beforeunload",n,{capture:!1}),Zs(xs,"pagehide",n,{capture:!1})}}xi(){var t,e=null==(t=this.Pe)?void 0:t.persistence_save_debounce_ms;return ti(e)&&e>0?e:0}isDisabled(){return!!this.ki}bi(t){-1===Ig.indexOf(t.persistence.toLowerCase())&&($s.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...Xh,...t];return r({},Yh,{H(t){try{var r={};try{r=Kh.H(t)||{}}catch(t){}var i,n=JSON.parse(Yh.q(t)||"{}");if(e){var s={};for(var o in r){var a=r[o];Yr(a)||""===a||(s[o]=a)}i=js(n,s)}else i=js(r,n);return Yh.A(t,i),i}catch(t){}return null},A(t,e,r,n,s,o){var a=Yh.A(t,e,void 0,void 0,o);try{var l={};i.forEach((t=>{e[t]&&(l[t]=e[t])})),Object.keys(l).length&&Kh.A(t,l,r,n,s,o)}catch(t){Yh.j(t)}return a},F(t,e){try{null==xs||xs.localStorage.removeItem(t),Kh.F(t,e)}catch(t){Yh.j(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&Yh.P()?(e=Yh,n=!0):"localstorage+cookie"===s&&i.P()?(e=i,n=!0):"sessionstorage"===s&&id.P()?e=id:"memory"===s?e=ed:"cookie"===s?e=Kh:i.P()?(e=i,n=!0):e=Kh,this.fi=n,e}Si(t){return this.yi+"__"+t}wi(t){return this.fi&&!!t.split_storage}Ci(t){var e=null!=t?t:this.Pe.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[hh];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return qs(this.props,((e,r)=>{var i=Eg(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===zu?()=>this.Ci():()=>!1))return;i.transformToEventProperties&&js(t,i.transformToEventProperties(e))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,(()=>!1)))return;t[r]=e}})),t}load(){if(!this.ki){var t=this.ii.H(this.yi);t&&(this.props=js({},t)),this.pi&&this.Mi()}}Mi(){for(var t of Sg){var e=Yh.H(this.Si(t));if(e&&!Gr(e)){var r=this.Ti(t);r.persisted=!0,this.Ei(t)||(r.fingerprint=this.Ii(e,t)),this.Pi(t,e)||js(this.props,e)}}}Ei(t){return Object.keys(this.props).some((e=>{var r;return(null==(r=Eg(e))?void 0:r.storageGroup)===t}))}Pi(t,e){var r=Mg[t];if(!r)return!1;var i=e[r],n=this.props[r];return ti(i)&&ti(n)&&n>i}refreshKey(t){var e;if(!this.ki){var r=this.pi?null==(e=Eg(t))?void 0:e.storageGroup:void 0,i=r?Yh.H(this.Si(r)):this.ii.H(this.yi);if(i&&t in i)this.Ri(t,i[t]);else{if(r){var n=this.ii.H(this.yi);if(n&&t in n)return void this.Ri(t,n[t])}this.Li(t)}}}save(){if(!this.ki){var t=this.xi();t>0?Qr(this.Oi)&&(this.Oi=setTimeout((()=>{this.Oi=void 0,this.Fi()}),t)):this.Fi()}}flush(){Qr(this.Oi)||(clearTimeout(this.Oi),this.Oi=void 0,this.Fi())}Fi(){this.ki||(this.pi?this.Ai():this.Di(this.ii,this.yi,this.props,Rg))}Ai(){var t=this.$i(),e=t.main,r=t.groups;for(var i of(this.Di(this.ii,this.yi,e,Rg),Sg)){var n,s=r[i];(!Gr(s)||null!=(n=this.ci[i])&&n.persisted)&&this.Di(Yh,this.Si(i),s,i)}}$i(){var t={},e={flags:{},surveys:{}};return qs(this.props,((r,i)=>{var n,s=null==(n=Eg(i))?void 0:n.storageGroup;s?e[s][i]=r:t[i]=r})),{main:t,groups:e}}Ii(t,e){if(e===Rg)return JSON.stringify(t)+"|"+this.Ni+"|"+this.qi+"|"+this.ji;var r={};return qs(t,((t,e)=>{var i;r[e]=null!=(i=Eg(e))&&i.volatile?"__volatile__":t})),JSON.stringify(r)}Di(t,e,r,i){var n=this.Ti(i);if(i===Rg||n.dirty||Qr(n.fingerprint)){var s;try{if((s=this.Ii(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.A(e,r,this.Ni,this.qi,this.ji,this.Pe.debug)?(n.dirty=!1,i!==Rg&&(n.persisted=!0),Qr(s)||(n.fingerprint=s)):this.Pe.debug&&$s.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,r=void 0!==e&&e;if(Qr(this.Oi)||(clearTimeout(this.Oi),this.Oi=void 0),this.ii.F(this.yi,!1),this.ii.F(this.yi,!0),!r&&this.gi)for(var i of Sg)Yh.F(this.Si(i));r?delete this.ci[Rg]:this.ci={}}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Zr(t)){Qr(e)&&(e="None"),this.Ni=Qr(r)?this.Bi:r;var i=!1;if(qs(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Ri(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Zr(t)){this.Ni=Qr(e)?this.Bi:e;var r=!1;if(qs(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Ri(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Li(t),this.save())}update_campaign_params(){var t=null==Ts?void 0:Ts.URL;if(t!==this.mi){var e=vc(this.Pe.custom_campaign_params,this.Pe.mask_personal_data_properties,this.Pe.custom_personal_data_properties);Gr(zs(e))||this.register(e),this.mi=t}}update_search_keyword(){var t;this.register((t=null==Ts?void 0:Ts.referrer)?pc(t):{})}update_referrer_info(){var t;this.register_once({$referrer:yc(),$referring_domain:null!=Ts&&Ts.referrer&&(null==(t=Ks(Ts.referrer))?void 0:t.host)||mc},void 0)}set_initial_person_info(){this.props[fh]||this.props[ph]||this.register_once({[gh]:bc(this.Pe.mask_personal_data_properties,this.Pe.custom_personal_data_properties,this.Pe.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};qs([ph,fh],(e=>{var r=this.props[e];r&&qs(r,(function(e,r){t["$initial_"+jr(r)]=e}))}));var e=this.props[gh];if(e){var r=function(t,e){void 0===e&&(e=!1);var r=_c(t,e),i={};return qs(r,(function(t,e){i["$initial_"+jr(e)]=t})),i}(e,this.Pe.disable_capture_url_hashes);js(t,r)}return t}safe_merge(t){return qs(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){this.Bi=this.Ni=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var i=t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),n=i?this.bi(t):this.ii,s=this.wi(t);if(i||s!==this.pi){var o=this.props;this.clear(),this.ii=n,this.pi=s,this.props=o,this.save()}}set_disabled(t){this.ki=t,this.ki?this.remove():this.save()}set_cross_subdomain(t){t!==this.qi&&(this.qi=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ji&&(this.ji=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var r=this.props[Cu]||{};r[t]=e,this.Ri(Cu,r),this.save()}remove_event_timer(t){var e=this.props[Cu]||{},r=e[t];return Qr(r)||(delete e[t],this.Ri(Cu,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Ri(t,e),this.save()}Ri(t,e){var r;this.props[t]=e,null!=(r=Eg(t))&&r.volatile||this.Hi(t)}Li(t){delete this.props[t],this.Hi(t)}Hi(t){var e,r=null==(e=Eg(t))?void 0:e.storageGroup;r&&(this.Ti(r).dirty=!0)}Ti(t){return this.ci[t]||(this.ci[t]={})}}var Og={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Lg={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Ag={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Fg=Ds("[RateLimiter]");class $g{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{Fg.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Fg.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(vh))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(ti(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Ui(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(vh,a),{isRateLimited:l,remainingTokens:a.tokens}}zi(t){var e=this.instance.config.property_denylist;return!Wr(e)||!e.includes(t)}Wi(){var t;if(this.zi("$current_url")&&this.zi("$pathname")&&null!=Cs&&Cs.pathname)return""+(null!==(t=Cs.origin)&&void 0!==t?t:"")+Cs.pathname}Ui(t){var e,r,i=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Wi(),o=this.zi("$session_id")?null==(e=(r=this.instance).get_session_id)?void 0:e.call(r):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+n+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Dg=Ds("[RemoteConfig]");class Ng{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=Ca._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Vi(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Zi(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Dg.info("Using preloaded remote config",this.remoteConfig),this.Gi(this.remoteConfig),void this.Qi();if(this._instance.Ji())return void Dg.warn("Remote config is disabled. Falling back to local config.");this.Vi((t=>{if(!t)return Dg.info("No config found after loading remote JS config. Falling back to JSON."),void this.Zi((t=>{this.Gi(t.json,t),this.Qi()}));this.Gi(t),this.Qi()}))}catch(t){Dg.error("Error loading remote config",t),this.Gi()}}stop(){this.Ki&&(clearInterval(this.Ki),this.Ki=void 0)}refresh(){!this._instance.Ji()&&Ts&&"hidden"!==Ts.visibilityState&&this._instance.reloadFeatureFlags()}Qi(){var t;if(!this.Ki){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Ki=setInterval((()=>{this.refresh()}),e))}}Gi(t,e){!t&&e&&(0===e.statusCode?e.error||Dg.warn("Failed to fetch remote config from PostHog."):Dg.error("Failed to fetch remote config from PostHog."));try{this._instance.Gi(t?{ok:!0,config:t}:{ok:!1})}catch(t){Dg.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;null==(r=this._instance.featureFlags)||r.ensureFlagsLoaded()}catch(t){Dg.error("Error loading feature flags",t)}}}var qg=["fatal","error","warning","log","info","debug"],jg=Uint8Array,Bg=Uint16Array,Ug=Uint32Array,Hg=new jg([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]),zg=new jg([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]),Wg=new jg([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vg=function(t,e){for(var r=new Bg(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Ug(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Zg=Vg(Hg,2),Gg=Zg[1];Zg[0][28]=258,Gg[258]=28;for(var Qg=Vg(zg,0)[1],Kg=new Bg(32768),Jg=0;32768>Jg;++Jg){var Yg=(43690&Jg)>>>1|(21845&Jg)<<1;Kg[Jg]=((65280&(Yg=(61680&(Yg=(52428&Yg)>>>2|(13107&Yg)<<2))>>>4|(3855&Yg)<<4))>>>8|(255&Yg)<<8)>>>1}var Xg=function(t,e,r){for(var i=t.length,n=0,s=new Bg(e);i>n;++n)++s[t[n]-1];var o,a=new Bg(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Bg(1<<e);var l=15-e;for(n=0;i>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[Kg[d]>>>l]=u}else for(o=new Bg(i),n=0;i>n;++n)o[n]=Kg[a[t[n]-1]++]>>>15-t[n];return o},tm=new jg(288);for(Jg=0;144>Jg;++Jg)tm[Jg]=8;for(Jg=144;256>Jg;++Jg)tm[Jg]=9;for(Jg=256;280>Jg;++Jg)tm[Jg]=7;for(Jg=280;288>Jg;++Jg)tm[Jg]=8;var em=new jg(32);for(Jg=0;32>Jg;++Jg)em[Jg]=5;var rm=Xg(tm,9,0),im=Xg(em,5,0),nm=function(t){return(t/8>>0)+(7&t&&1)},sm=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Bg?Bg:t instanceof Ug?Ug:jg)(r-e);return i.set(t.subarray(e,r)),i},om=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},am=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},lm=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new jg(0),0];if(1==n){var o=new jg(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new Bg(c+1),f=um(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==e&&(--v[_],++p)}f=e}return[new jg(v),f]},um=function(t,e,r){return-1==t.s?Math.max(um(t.l,e,r+1),um(t.r,e,r+1)):e[t.s]=r},hm=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Bg(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},dm=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},cm=function(t,e,r){var i=r.length,n=nm(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},vm=function(t,e,r,i,n,s,o,a,l,u,h){om(e,h++,r),++n[256];for(var d=lm(n,15),c=d[0],v=d[1],f=lm(s,15),p=f[0],g=f[1],m=hm(c),y=m[0],b=m[1],_=hm(p),w=_[0],x=_[1],k=new Bg(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var T=lm(k,7),C=T[0],E=T[1],M=19;M>4&&!C[Wg[M-1]];--M);var I,R,P,O,L=u+5<<3,A=dm(n,tm)+dm(s,em)+o,F=dm(n,c)+dm(s,p)+o+14+3*M+dm(k,C)+(2*k[16]+3*k[17]+7*k[18]);if(A>=L&&F>=L)return cm(e,h,t.subarray(l,l+u));if(om(e,h,1+(A>F)),h+=2,A>F){I=Xg(c,v,0),R=c,P=Xg(p,g,0),O=p;var D=Xg(C,E,0);for(om(e,h,b-257),om(e,h+5,x-1),om(e,h+10,M-4),h+=14,S=0;M>S;++S)om(e,h+3*S,C[Wg[S]]);h+=3*M;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(S=0;j.length>S;++S)om(e,h,D[B=31&j[S]]),h+=C[B],B>15&&(om(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}else I=rm,R=tm,P=im,O=em;for(S=0;a>S;++S)if(i[S]>255){var B;am(e,h,I[257+(B=i[S]>>>18&31)]),h+=R[B+257],B>7&&(om(e,h,i[S]>>>23&31),h+=Hg[B]);var U=31&i[S];am(e,h,P[U]),h+=O[U],U>3&&(am(e,h,i[S]>>>5&8191),h+=zg[U])}else am(e,h,I[i[S]]),h+=R[i[S]];return am(e,h,I[256]),h+R[256]},fm=new Ug([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),pm=function(){for(var t=new Ug(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),gm=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function mm(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=pm[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,l=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new jg(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=cm(l,u,t.subarray(h,d)):(l[h]=!0,u=cm(l,u,t.subarray(h,o)))}else{for(var c=fm[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new Bg(32768),m=new Bg(p+1),y=Math.ceil(r/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ug(25e3),x=new Bg(288),k=new Bg(32),S=0,T=0,C=(h=0,0),E=0,M=0;o>h;++h){var I=_(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=E){var O=o-h;if((S>7e3||C>24576)&&O>423){u=vm(t,l,0,w,x,k,T,C,M,h-M,u),C=S=T=0,M=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)k[L]=0}var A=2,F=0,D=f,N=R-P&32767;if(O>2&&I==_(h-N))for(var q=Math.min(v,O)-1,j=Math.min(32767,h),B=Math.min(258,O);j>=N&&--D&&R!=P;){if(t[h+A]==t[h+A-N]){for(var U=0;B>U&&t[h+U]==t[h+U-N];++U);if(U>A){if(A=U,F=N,U>q)break;var H=Math.min(N,U-2),z=0;for(L=0;H>L;++L){var W=h-N+L+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(F){w[C++]=268435456|Gg[A]<<18|Qg[F];var Z=31&Gg[A],G=31&Qg[F];T+=Hg[Z]+zg[G],++x[257+Z],++k[G],E=h+A,++S}else w[C++]=t[h],++x[t[h]]}}u=vm(t,l,!0,w,x,k,T,C,M,h-M,u)}return sm(a,0,i+nm(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&gm(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),gm(l,u-8,r.d()),gm(l,u-4,i),l}var ym=!!Ms||!!Es,bm="text/plain",_m=!1,wm=(t,e)=>{var r=t.split("#"),i=r[1],n=r[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},xm=function(t,e,i){var n;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=r({},e),u=null!==(n=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Js(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},km=t=>{if(t.Yi)return t.Yi;var e=t.data,r=t.compression;if(e){if(r===zl.GZipJS){var i=mm(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new jg(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new jg(n+8+(r-o<<1));a.set(i),i=a}var l=t.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return sm(i,0,n)}(Qs(e)),{mtime:0});return{contentType:bm,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===zl.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Qs(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Qs(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Qs(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Sm=t=>{var e,i,n=()=>"sendBeacon"===t.transport?{url:xm(t.url,{compression:zl.Base64}),encodedBody:km(r({},t,{compression:zl.Base64,Yi:void 0}))}:{url:wm(t.url,"compression"),encodedBody:km(r({},t,{compression:void 0,Yi:void 0}))};try{e=km(t)}catch(e){if(Pr(t.compression,Ys(t.url,"compression")))return $s.error("Failed to gzip request body, sending uncompressed payload",e),n();throw e}return e&&Pr(t.compression,Ys(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Rr(new Uint8Array(i)):ArrayBuffer.isView(i)&&Rr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(_m=!0,n()):{url:t.url,encodedBody:e}},Tm=t=>{try{return Sm(t)}catch(e){return $s.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Cm=function(){var t=e((function*(t){var e=Qs(t.data),i=yield function(t,e,r){return Fr.apply(this,arguments)}(e,As.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{Yi:{contentType:bm,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Em=/Failed to fetch|NetworkError|Load failed/i,Mm=t=>{var e=Tm(t);if(e){var i=e.url,n=e.encodedBody,s=null!=n?n:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;qs(t.headers,(function(t,e){u.append(e,t)})),o&&u.append("Content-Type",o);var h=null,d=!1;if(Is){var c=new Is;h={signal:c.signal,timeout:setTimeout((()=>{var e,r;d=!0,c.abort((e=t.timeout,(r=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",r))}),t.timeout)}}var v=e=>{d&&"AbortError"===(null==e?void 0:e.name)||(t=>"TypeError"===(null==t?void 0:t.name)&&Em.test((null==t?void 0:t.message)||""))(e)?$s.warn(e):$s.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;Es(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Xi&&52428.8>(l||0),body:a,signal:null==(f=h)?void 0:f.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){$s.error(t)}null==t.callback||t.callback(i)})))).catch(v).finally((()=>h?clearTimeout(h.timeout):null))}catch(t){h&&clearTimeout(h.timeout),v(t)}}},Im=t=>{try{var e,i=Sm(t),n=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(Ss.sendBeacon(n,u))return;var h=Wr(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Wr(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),c=e=>Wr(t.data)?e:r({},t.data,{batch:e});return Im(r({},t,{data:c(h.slice(0,d))})),void Im(r({},t,{data:c(h.slice(d))}))}$s.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Mm(r({},t,{Xi:!0}))}catch(t){$s.warn("Beacon send failed",t)}},Rm=(t,e,i,n)=>{var s="query"===n?"POST"===e?"sent_at":"_":void 0;return xm(i===zl.GZipJS?wm(t,"compression"):t,r({},s?{[s]:Date.now().toString()}:{},i===zl.GZipJS?{}:{compression:i}))},Pm=[];Es&&Pm.push({transport:"fetch",method:Mm}),Ms&&Pm.push({transport:"XHR",method(t){var e=Tm(t);if(e){var r=new Ms,i=e.encodedBody;r.open(t.method||"GET",e.url,!0);var n=null!=i?i:{},s=n.contentType,o=n.body;qs(t.headers,(function(t,e){r.setRequestHeader(e,t)})),s&&r.setRequestHeader("Content-Type",s),t.timeout&&(r.timeout=t.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(o)}}}),null!=Ss&&Ss.sendBeacon&&Pm.push({transport:"sendBeacon",method:Im});var Om=3e3;class Lm{constructor(t,e){this.tr=!0,this.er=[],this.ir=vi((null==e?void 0:e.flush_interval_ms)||Om,250,5e3,$s.createLogger("flush interval"),Om),this.rr=t}enqueue(t){this.er.push(t),this.nr||this.sr()}unload(){this.ar();var t=this.er.length>0?this.lr():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.ur(r({},t,{transport:"sendBeacon"}))}))}enable(){this.tr=!1,this.sr()}sr(){var t=this;this.tr||(this.nr=setTimeout((()=>{if(this.ar(),this.er.length>0){var e=this.lr(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Wr(r.data)&&qs(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ur(r)};for(var i in e)r()}}),this.ir))}ur(t){try{this.rr(t)}catch(t){$s.error(t)}}ar(){clearTimeout(this.nr),this.nr=void 0}lr(){var t={};return qs(this.er,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;Qr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.er=[],t}}var Am=["retriesPerformedSoFar"];class Fm{constructor(t){this.hr=!1,this.dr=3e3,this.er=[],this._instance=t,this.er=[],this.vr=!0,!Qr(xs)&&"onLine"in xs.navigator&&(this.vr=xs.navigator.onLine,this.cr=()=>{this.vr=!0,this.pr()},this.gr=()=>{this.vr=!1},Zs(xs,"online",this.cr),Zs(xs,"offline",this.gr))}get length(){return this.er.length}retriableRequest(t){var e=t.retriesPerformedSoFar,n=i(t,Am);ei(e)&&(n.url=xm(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.Lt(r({retriesPerformedSoFar:e},n));0===t.statusCode&&$s.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==n.callback||n.callback(t)}}))}Lt(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.er.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),$s.warn(n),this.hr||(this.hr=!0,this.mr())}mr(){if(this.yr&&clearTimeout(this.yr),0===this.er.length)return this.hr=!1,void(this.yr=void 0);this.yr=setTimeout((()=>{this.vr&&this.er.length>0&&this.pr(),this.mr()}),this.dr)}pr(){var t=Date.now(),e=[],r=this.er.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.er=e,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var t of(this.yr&&(clearTimeout(this.yr),this.yr=void 0),this.hr=!1,Qr(xs)||(this.cr&&(xs.removeEventListener("online",this.cr),this.cr=void 0),this.gr&&(xs.removeEventListener("offline",this.gr),this.gr=void 0)),this.er)){var e=t.requestOptions;try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(t){$s.error(t)}}this.er=[]}}class $m{constructor(t){this.br=()=>{var t,e,r,i;this._r||(this._r={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this._r.lastScrollY=Math.ceil(s),this._r.maxScrollY=Math.max(s,null!==(t=this._r.maxScrollY)&&void 0!==t?t:0),this._r.maxScrollHeight=Math.max(o,null!==(e=this._r.maxScrollHeight)&&void 0!==e?e:0),this._r.lastContentY=a,this._r.maxContentY=Math.max(a,null!==(r=this._r.maxContentY)&&void 0!==r?r:0),this._r.maxContentHeight=Math.max(l,null!==(i=this._r.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get wr(){return this._instance.config.scroll_root_selector}getContext(){return this._r}resetContext(){var t=this._r;return setTimeout(this.br,0),t}startMeasuringScrollPosition(){Zs(xs,"scroll",this.br,{capture:!0}),Zs(xs,"scrollend",this.br,{capture:!0}),Zs(xs,"resize",this.br)}scrollElement(){if(!this.wr)return null==xs?void 0:xs.document.documentElement;var t=Wr(this.wr)?this.wr:[this.wr];for(var e of t){var r=null==xs?void 0:xs.document.querySelector(e);if(r)return r}}kr(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.wr){var r=this.scrollElement();return r&&r[e]||0}return xs?"y"===t?xs.scrollY||xs.pageYOffset||xs.document.documentElement.scrollTop||0:xs.scrollX||xs.pageXOffset||xs.document.documentElement.scrollLeft||0:0}scrollY(){return this.kr("y")}scrollX(){return this.kr("x")}}var Dm=t=>bc(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class Nm{constructor(t,e,r,i){this.Sr=t=>{var e=this.Cr();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Mr(this._instance)};this.Tr.register({[ch]:r})}},this._instance=t,this.Er=e,this.Tr=r,this.Mr=i||Dm,this.Er.onSessionId(this.Sr)}Cr(){return this.Tr.props[ch]}getSetOnceProps(){var t,e=null==(t=this.Cr())?void 0:t.props;return e?"r"in e?_c(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return qs(zs(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+jr(r)]=e})),t}}class qm{on(t,e){return this.Ir[t]||(this.Ir[t]=[]),this.Ir[t].push(e),()=>{this.Ir[t]=this.Ir[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.Ir[t]||[])r(e);for(var i of this.Ir["*"]||[])i(t,e)}constructor(){this.Ir={}}}var jm=Ds("[SessionId]");class Bm{on(t,e){return this.Pr.on(t,e)}constructor(t,e,r){var i;if(this.Rr=null,this.Lr=[],this.Or=void 0,this.Fr=!1,this.Pr=new qm,this.Ar=(t,e)=>!(!ei(t)||!ei(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Th)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Pe=t.config,this.Tr=t.persistence,this.Dr=void 0,this.$r=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Nr=e||jh,this.qr=r||jh;var n=this.Pe.persistence_name||this.Pe.token;if(this._sessionTimeoutMs=1e3*vi(this.Pe.session_idle_timeout_seconds||1800,60,36e3,jm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.jr(),this.Br="ph_"+n+"_window_id",this.Hr="ph_"+n+"_primary_window_exists",this.Ur()){var s=id.H(this.Br),o=id.H(this.Hr);s&&!o?this.Dr=s:id.F(this.Br),id.A(this.Hr,!0)}if(null!=(i=this.Pe.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.Pe.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.zr(this.Pe.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){jm.error("Invalid sessionID in bootstrap",t)}this.Wr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Qr(this.Lr)&&(this.Lr=[]),this.Lr.push(t),this.$r&&t(this.$r,this.Dr),()=>{this.Lr=this.Lr.filter((e=>e!==t))}}Ur(){return"memory"!==this.Pe.persistence&&!this.Tr.ki&&id.P()}Vr(t){t!==this.Dr&&(this.Dr=t,this.Ur()&&id.A(this.Br,t))}Zr(){return this.Dr?this.Dr:this.Ur()?id.H(this.Br):null}Gr(t){var e=this.Rr;return!Yr(e)&&!Yr(t)&&5e3>Math.abs(t-e)}zr(t,e,r){var i=e!==this._sessionActivityTimestamp,n=!(t!==this.$r||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.$r=t,n&&!i||n&&this.Gr(e)||(this.Rr=e,this.Tr.register({[Uu]:[e,t,r]}))}Qr(){var t,e=null==(t=this.Pe)?void 0:t.persistence_save_debounce_ms;return ei(e)&&e>0}Jr(){this.Qr()?this.Tr.refreshKey(Uu):(this.Tr.flush(),this.Tr.load())}Kr(){var t;if(!Yr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Rr){this.Jr();var e=this.Yr();e[1]===this.$r&&e[2]===this._sessionStartTimestamp&&(this.Rr=this._sessionActivityTimestamp,this.Tr.register({[Uu]:[this._sessionActivityTimestamp,null!==(t=this.$r)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Tr.flush())}}Xr(){var t=this.Yr()[0],e=ei(t)?t:0,r=ei(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,r)}tn(t){return this.Jr(),this.Ar(t,this.Xr())}Yr(){var t=this.Tr.props[Uu];return Wr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Rr=null,clearTimeout(this.en),this.en=void 0,this.zr(null,null,null)}destroy(){this.Fr=!0,this.Kr(),clearTimeout(this.en),this.en=void 0,this.Or&&xs&&(xs.removeEventListener(Rh,this.Or,{capture:!1}),this.Or=void 0),this.Lr=[]}Wr(){this.Or=()=>{this.Kr(),this.Ur()&&id.F(this.Hr)},Zs(xs,Rh,this.Or,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Pe.cookieless_mode===Th)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),i=this.Yr(),n=i[1],s=i[2],o=this.Xr(),a=this.Zr(),l=ei(s)&&Math.abs(r-s)>864e5,u=!1,h=!1,d=!n,c=n,v=!d&&!t&&this.Ar(r,o);if(v){(v=this.tn(r))||jm.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Yr();n=f[1],s=f[2]}d||v||l?(n=this.Nr(),a=this.qr(),jm.info("new session ID generated",{sessionId:n,windowId:a,changeReason:{noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l}}),s=r,u=!0):(a||(a=this.qr(),u=!0),(h=n!==c)&&(jm.info("adopted cross-tab session id",{sessionId:n,windowId:a}),u=!0));var p=ei(o)&&t&&!l?o:r,g=ei(s)?s:(new Date).getTime();this.Vr(a),this.zr(n,p,g),t||this.jr();var m={noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.Lr.forEach((t=>t(n,a,m))),{sessionId:n,windowId:a,sessionStartTimestamp:g,changeReason:u?m:void 0,lastActivityTimestamp:o}}jr(){this.Fr||(clearTimeout(this.en),this.en=setTimeout((()=>{if(!this.Fr)if(this.tn((new Date).getTime())){var t=this.$r;this.resetSessionId(),this.Pr.emit("forcedIdleReset",{idleSessionId:t})}else this.jr()}),1.1*this.sessionTimeoutMs))}}var Um=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Dr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Dr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function Hm(){return Hm=e((function*(){var t=null==Ss?void 0:Ss.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Kr(r)&&r.length>0?r:void 0}catch(t){return void $s.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),Hm.apply(this,arguments)}var zm="custom",Wm="i.posthog.com",Vm=/^\/static\//;class Zm{constructor(t){this.rn={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+Wm,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.rn[this.apiHost]||(this.rn[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":zm),this.rn[this.apiHost]}nn(t){if(Vm.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if("assets"===t){var r=this.nn(e);if(r)return""+r+e}if(this.region===zm)return this.apiHost+e;var i=Wm+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Gm=Ds("[PostHog ExternalIntegrations]"),Qm={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Km{constructor(t){this._instance=t}ai(t,e){var r;null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Gm.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,i,n,s=r[0],o=r[1];!o||null!=(e=Ca.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.ai(Qm[s],(()=>{var e;null==(e=Ca.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!o&&null!=(i=Ca.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[s]&&(null==(n=Ca.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var r of Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{})){var i;e()}}}class Jm{constructor(t,e){this.rt=t,this.sn=e,this.an=new Map,this.ln=!1}add(t){var r=this;return e((function*(){if(r.ln)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(r.an.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');r.an.set(t.name,t);try{var e=t.setup(r.sn);e&&(yield e)}catch(e){var i=r.an.get(t.name)===t;i&&r.an.delete(t.name),r.rt.error('Failed to set up browser extension "'+t.name+'"',e),i&&r.un(t)}}))()}dispose(){if(!this.ln){this.ln=!0;var t=Array.from(this.an.values()).reverse();for(var e of(this.an.clear(),t))this.un(e)}}un(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Vr(e.then)&&e.then(void 0,(e=>{this.rt.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.rt.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class Ym{constructor(t){this._instance=t}get(t){var e;return null==(e=this._instance.persistence)?void 0:e.get_property(t)}set(t,e){var r;null==(r=this._instance.persistence)||r.set_property(t,e)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var Xm="extensionsRemoteConfig";class ty{constructor(t){this.ln=!1,this.instance=t,this.rt=$s.createLogger("[BrowserExtensions]"),this.hn=t.dn,this.kv=new Ym(t),this.onEvent=t=>Hl(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.rt.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.ln)return Hl((()=>{}));var e=e=>{try{t(e)}catch(t){this.rt.error("Browser extension remote config listener failed",t)}},r=this.instance.vn.on(Xm,e);return this.hn&&e(this.hn),Hl(r)},this.cn=new Jm(this.rt,this)}get logger(){return this.rt}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(ku))&&void 0!==t?t:this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var t,e,r,i,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(r=null==n?void 0:n.windowId)&&void 0!==r?r:"",sessionStartTimestamp:null!==(i=null==n?void 0:n.sessionStartTimestamp)&&void 0!==i?i:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.cn.add(t)}capture(t,r,i){var n=this;return e((function*(){i?n.instance.capture(t,r,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):n.instance.capture(t,r)}))()}registerDynamicEventProperties(t){return Hl(this.instance.fn(t))}handleRemoteConfig(t){this.ln||(this.hn=t,this.instance.vn.emit(Xm,t))}sendRequest(t,r){var i=this;return e((function*(){var e;void 0===r&&(r={});var n=i.instance.requestRouter.endpointFor(null!==(e=r.target)&&void 0!==e?e:"api",t),s={method:r.method,url:r.query?xm(n,r.query):n,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport};return"sendBeacon"===r.transport?(i.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,i.instance._send_request(s)}))}))()}dispose(){this.ln||(this.ln=!0,this.cn.dispose())}}var ey={},ry=0,iy=()=>{},ny='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',sy="Surveys module not available",oy="sanitize_properties is deprecated. Use before_send instead",ay="Invalid value for property_denylist config: ",ly=["token","distinct_id",bh],uy="posthog",hy=!ym&&-1===(null==Ps?void 0:Ps.indexOf("MSIE"))&&-1===(null==Ps?void 0:Ps.indexOf("Mozilla")),dy=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Vs(null==Ts?void 0:Ts.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:iy,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Cs&&Kr(null==Cs?void 0:Cs.search)&&-1!==Cs.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==xs||null==(e=xs.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){$s.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Mh,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Om},error_tracking:{},_onCapture:iy},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Ro,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(t))},cy=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],vy=t=>{var e={};for(var r of cy){var i=r[0],n=r[1];Qr(t[i])||(e[n]=t[i])}var s=js({},e,t),o=t.__preview_external_dependency_versioned_paths;return Qr(o)||(Qr(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Kr(o)&&Qr(t.asset_host)&&(s.asset_host=o)),Wr(t.property_blacklist)&&(Qr(t.property_denylist)?s.property_denylist=t.property_blacklist:Wr(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:$s.error(ay+t.property_denylist)),s};class fy{constructor(){this.__forceAllowLocalhost=!1}get pn(){return this.__forceAllowLocalhost}set pn(t){$s.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class py{gn(t,e){if(t){var r=this.an.indexOf(t);-1!==r&&this.an.splice(r,1)}return this.an.push(e),null==e.initialize||e.initialize(),e}mn(){return this.config.cookieless_mode===Th||this.config.cookieless_mode===Sh&&this.consent.isRejected()}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new fy,this.yn=!1,this.version=As.LIB_VERSION,this.vn=new qm,this.an=[],this.bn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=dy(),this.SentryIntegration=xg,this.sentryIntegration=t=>function(t,e){var r=wg(t,e);return{name:_g,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._n=!1,this.wn=null,this.xn=null,this.kn=null,this.scrollManager=new $m(this),this.pageViewManager=new kg(this),this.rateLimiter=new $g(this),this.requestRouter=new Zm(this),this.consent=new fg(this),this.externalIntegrations=new Km(this);var e=null!==(t=py.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=Kr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Kr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>$s.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==uy){var i,n=null!==(i=ey[r])&&void 0!==i?i:new py;return n._init(t,e,r),ey[r]=n,ey[uy][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;void 0===e&&(e={});var o,a=Kr(t)?t.trim():"";if(!a)return $s.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=dy(e.defaults),e.debug=this.Sn(e.debug),this.Cn=e,this.Mn=[],e.person_profiles?this.xn=e.person_profiles:e.process_person&&(this.xn=e.process_person);var l=dy(e.defaults),u=vy(e),h=js({},l,u,{name:i,token:a});Zr(l.rageclick)&&Zr(u.rageclick)&&(h.rageclick=js({},l.rageclick,u.rageclick)),Zr(l.session_recording)&&Zr(u.session_recording)&&(h.session_recording=js({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&$s.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:zl.GZipJS;var d=this.Tn();this.persistence=new Pg(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Pg(r({},this.config,{persistence:"sessionStorage"}),d,!1);var c=r({},this.persistence.props),v=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.En=new Lm((t=>this.In(t)),this.config.request_queue_config),this.Pn=new Fm(this),this.__request_queue=[];var f=this.mn();if(f||(this.sessionManager=new Bm(this),this.sessionPropsManager=new Nm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($s.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Rn(f)}),0)):($s.info("Initializing extensions synchronously"),this.Rn(f)),As.DEBUG=As.DEBUG||this.config.debug,As.DEBUG&&$s.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:c,s:v}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var p=e.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(dh);if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===Ch)this.identify(p);else if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===Eh)$s.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var y=this.config.get_device_id(jh()),b=e.bootstrap.isIdentifiedID?y:p;this.persistence.set_property(dh,e.bootstrap.isIdentifiedID?Eh:Ch),this.register({distinct_id:p,$device_id:b})}}if(f)this.register_once({distinct_id:yh,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(jh());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(dh,Ch)}return Zs(xs,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||jh();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(dh,Eh)),e()},n=r.user();"then"in n&&Vr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||bg.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(bg.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(bg.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Ph),identify:t=>e(t,Lh),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Ln())):this.Ln(),Vr(this.config._onCapture)&&this.config._onCapture!==iy&&($s.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&$s.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Hm.apply(this,arguments)}().then((t=>{t&&this.register({[Su]:t})})).catch(iy),this}Rn(t){var e,i,n,s,o,a,l,u,h=performance.now(),d=r({},py.__defaultExtensionClasses,this.config.__extensionClasses),c=[];d.featureFlags&&this.an.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new d.featureFlags(this)),d.exceptions&&this.an.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.an.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.an.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.an.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.an.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.an.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.an.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.an.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this)),d.metrics&&this.an.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.an.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.an.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.an.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.an.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.an.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.an.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,mg)),d.toolbar&&this.an.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.an.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.an.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.On){var t=this.On;this.On=void 0,this.an.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.Fn(c,h)}Fn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Fn(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){$s.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[_h]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[wh]:i}),this.config.__preview_deferred_init_extensions&&$s.info("PostHog extensions initialized ("+i+"ms)")}Gi(t){var e;if(!Ts||!Ts.body)return $s.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Gi(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.On=t),this.dn=t,this.compression=void 0,t.ok){var r,i=t.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=Nr(i.supportedCompression,zl.GZipJS)?zl.GZipJS:Nr(i.supportedCompression,zl.Base64)?zl.Base64:void 0),null!=(r=i.analytics)&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.xn?this.xn:Mh}),null==(e=this.An)||e.handleRemoteConfig(t),this.an.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Ln(){try{this.config.loaded(this)}catch(t){$s.critical("`loaded` function failed",t)}if(this.Dn(),this.config.internal_or_test_user_hostname&&null!=Cs&&Cs.hostname){var t=Cs.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.mn())&&this.$n()}),1),this.Nn=new Ng(this),this.Nn.load()}Dn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.En)||t.enable())}_dom_loaded(){this.is_capturing()&&Ns(this.__request_queue,(t=>this.In(t))),this.__request_queue=[],this.Dn()}_handle_unload(){var t,e,r,i,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.qn()&&this.capture(Oh),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.En)||i.unload(),null==(n=this.Pn)||n.unload()):this.qn()&&this.capture(Oh,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?hy?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(Qr(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Qr(s.compression)&&s.data&&(s.compression=zl.Base64),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=Wr(o=s.data)?o:[o])[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),Wr(t)?t.map((t=>r({},t,{sent_at:e}))):r({},t,{sent_at:e})}(s.data))),s.url=Rm(s.url,s.method,s.compression,s.timestampMode);var c=Pm.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),v=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(c,(t=>t.transport===d)))?void 0:n.method)&&void 0!==i?i:c[0].method;if(!v)throw new Error("No available transport method");"sendBeacon"!==d&&s.data&&s.compression===zl.GZipJS&&Rs&&"undefined"!=typeof Promise&&!_m?Cm(s).then((t=>{v(t)})).catch((e=>{if(Or(e))return _m=!0,void v(r({},s,{compression:void 0,url:Rm(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Or(t)||e===Ir})(e)&&(_m=!0),v(s)})):v(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}In(t){this.Pn?this.Pn.retriableRequest(t):this._send_request(t)}_execute_array(t){ry++;try{var e,r=[],i=[],n=[];Ns(t,(t=>{if(t)if(Wr(e=t[0]))n.push(t);else if(Vr(t))try{t.call(this)}catch(e){$s.error("Error executing queued PostHog call",t,e)}else Wr(t)&&"alias"===e?r.push(t):Wr(t)&&-1!==e.indexOf("capture")&&Vr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){Ns(t,(function(t){try{if(Wr(t[0])){var r=e;qs(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){$s.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{ry--}}push(t){if(ry>0&&Wr(t)&&Kr(t[0])){var e=py.prototype[t[0]];Vr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,l,u,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.En){if(this.is_capturing())if(!Qr(t)&&Kr(t)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var c=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){if(this.bn.length>0){var v={};for(var f of this.bn.slice())try{js(v,f())}catch(t){$s.error("Failed to produce browser extension event properties",t)}e=r({},v,null!=e?e:{})}var p;null!=(n=e)&&n.$current_url&&!Kr(null==(s=e)?void 0:s.$current_url)&&($s.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==(p=e)||delete p.$current_url),"$exception"!==t||null!=i&&i.jn||$s.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var g=new Date,m=(null==i?void 0:i.timestamp)||g,y=xn(null==i?void 0:i.uuid,jh),b={uuid:y,event:t,properties:this.calculateEventProperties(t,e||{},m,y)};t===Ph&&this.config.__preview_capture_bot_pageviews&&d&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),c&&(b.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var _="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property(Ku);(null==i?void 0:i.$set)&&!_&&(b.$set=null==i?void 0:i.$set);var w=null==i?void 0:i.$unset;w&&(b.$unset=w);var x=_?void 0:this.Bn(null==i?void 0:i.$set_once,t!==Ah,t===Lh);if(x&&(b.$set_once=x),null!=i&&i._noTruncate||(a=this.config.properties_string_max_length,l=b,u=t=>Kr(t)?t.slice(0,a):t,h=new Set,b=function t(e,r){if(e!==Object(e))return u?u(e):e;if(!h.has(e)){var i;if(h.add(e),Wr(e))i=[],Ns(e,(e=>{i.push(t(e))}));else{var n={};qs(e,((e,r)=>{h.has(e)||(n[r]=t(e,r))})),i=n}return i}}(l)),b.timestamp=m,Qr(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),_&&(b.properties=function(t,e){void 0===e&&(e=[]);var r={},i=e=>{void 0!==t[e]&&(r[e]=t[e])};return xr.forEach(i),e.forEach(i),r}(b.properties,ly)),t===Xl.DISMISSED||t===Xl.SENT){var k,S,T=null==(k=e)?void 0:k[tu.SURVEY_ID],C=null==(S=e)?void 0:S[tu.SURVEY_ITERATION];bu({id:T,current_iteration:C}),b.$set=r({},b.$set,{[su({id:T,current_iteration:C},t===Xl.SENT?"responded":"dismissed")]:!0})}else t===Xl.SHOWN&&(b.$set=r({},b.$set,{[tu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Lg.SHOWN){var E,M=null==(E=e)?void 0:E[Ag.TOUR_TYPE];M&&(b.$set=r({},b.$set,{[Ag.TOUR_LAST_SEEN_DATE+"/"+M]:(new Date).toISOString()}))}var I=r({},b.properties.$set,b.$set);if(Gr(I)||this.setPersonPropertiesForFlags(I),!Xr(this.config.before_send)){var R=this.Pt(b);if(!R)return;(b=R).uuid=xn(b.uuid,jh)}this.vn.emit("eventCaptured",b);var P=null!==(o=null==i?void 0:i._url)&&void 0!==o?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),O={method:"POST",url:P,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(P)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.In(O):this.En.enqueue(O),b}$s.critical("This capture call is ignored due to client rate limiting.")}}else $s.error("No event name provided to posthog.capture")}else $s.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}Hn(){var t;return null!==(t=this.An)&&void 0!==t?t:this.An=new ty(this)}fn(t){this.bn.push(t);var e=!0;return()=>{if(e){e=!1;var r=this.bn.indexOf(t);-1!==r&&this.bn.splice(r,1)}}}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.mn()&&(a[bh]=!0),"$snapshot"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Kr(a.distinct_id)&&!ti(a.distinct_id)||Jr(a.distinct_id))&&$s.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(t,e,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!Ps)return{};var l,u=t?[...uc,...e||[]]:[],h=function(t){for(var e=0;yn.length>e;e++){var r=yn[e],i=r[1],n=r[0].exec(t),s=n&&(Vr(i)?i(n,t):i);if(s)return s}return["",""]}(Ps),d=h[0],c=h[1],v=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={};Qr(r)||(f.detectGoogleSearchApp=r);var p={},g=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(s=navigator)?void 0:s.maxTouchPoints,y=null==xs||null==(o=xs.screen)?void 0:o.width,b=null==xs||null==(a=xs.screen)?void 0:a.height,_=null==xs?void 0:xs.devicePixelRatio;Qr(g)||(p.userAgentDataPlatform=g),Qr(m)||(p.maxTouchPoints=m),Qr(y)||(p.screenWidth=y),Qr(b)||(p.screenHeight=b),Qr(_)||(p.devicePixelRatio=_);var w,x=js(zs({$os:d,$os_version:c,$browser:pn(Ps,navigator.vendor,v,f),$device:bn(Ps),$device_type:_n(Ps,p),$timezone:wc(),$timezone_offset:xc()}),{$current_url:Xs(i?kn(null==Cs?void 0:Cs.href):null==Cs?void 0:Cs.href,u,dc),$host:null==Cs?void 0:Cs.host,$pathname:null==Cs?void 0:Cs.pathname,$raw_user_agent:Ps.length>1e3?Ps.substring(0,997)+"...":Ps,$browser_version:mn(Ps,navigator.vendor,v,f),$browser_language:gc(),$browser_language_prefix:(w=gc(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==xs?void 0:xs.screen.height,$screen_width:null==xs?void 0:xs.screen.width,$viewport_height:null==xs?void 0:xs.innerHeight,$viewport_width:null==xs?void 0:xs.innerWidth,$lib:As.LIB_NAME,$lib_version:As.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return As.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=As.SDK_DIST_CHANNEL),x}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime()),c=d.windowId;a.$session_id=d.sessionId,a.$window_id=c}this.sessionPropsManager&&js(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&js(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Pn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===zm&&(a.$lib_custom_api_host=this.config.api_host),u=t!==Ph||s?t!==Oh||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=js(a,u),t===Ph&&Ts&&(a.title=Ts.title),!Qr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}Ps&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),g=this.sessionPersistence.properties();qs(["$referrer","$referring_domain"],(t=>{t in p&&delete g[t]})),(a=js({},h,p,g,a)).$is_identified=this._isIdentified(),Wr(this.config.property_denylist)?qs(this.config.property_denylist,(function(t){delete a[t]})):$s.error(ay+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&($s.error(oy),a=m(a,t));var y=this.Un();return a.$process_person_profile=y,y&&!s&&this.zn("_calculate_event_properties"),a}Bn(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.Un())return t;if(this.yn&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=js({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&($s.error(oy),o=a(o,"$set_once")),e&&(this.yn=!0),Gr(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Wn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var r,i;return null!==(r=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e))&&void 0!==r?r:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.vn.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:sy}),()=>{})}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:sy})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:sy})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=wu),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:sy}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:sy})}Vn(t){return!t||Jr(t)?($s.critical("Unique user id has not been set in posthog.identify"),!1):t===yh?($s.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||($s.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return $s.uninitializedWarning("posthog.identify");if(ti(t)&&(t=t.toString(),$s.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Vn(t)&&this.zn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(ku)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Tu)&&(this.unregister(Tu),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(dh)||Ch)===Ch,o=t!==i,a=!o&&s;if(o&&s)this.persistence.set_property(dh,Eh),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(Lh,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.kn=Hh(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i);else if(a){this.persistence.set_property(dh,Eh);var l=e||{},u=r||{};this.setPersonPropertiesForFlags({$set:l,$set_once:u},!1),this.capture("$set",{$set:l,$set_once:u}),this.kn=Hh(t,e,r)}else(e||r)&&this.setPersonProperties(e,r);o?(this.reloadFeatureFlags(),this.unregister(ah)):a&&(e||r)&&this.reloadFeatureFlags()}}setPersonProperties(t,e){if((t||e)&&this.zn("posthog.setPersonProperties")){var r=Hh(this.get_distinct_id(),t,e);this.kn!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.kn=r):$s.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,r=(Wr(t)?t:[t]).filter((t=>Kr(t)&&t.length>0));0!==r.length&&this.zn("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.kn=null)}group(t,e,i){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(Ah,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else $s.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.zn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){this.Zn(t)}Zn(t,e){var r,i,n,s,o,a,l,u,h,d;if(void 0===e&&(e=!1),$s.info("reset"),!this.__loaded)return $s.uninitializedWarning("posthog.reset");var c,v=this.get_property(ku),f=this.get_property(Su),p=this.get_property($u),g=this.is_capturing();if(this.consent.reset(),e||!g||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after."),null==(r=this.persistence)||r.clear(),null==(i=this.sessionPersistence)||i.clear(),Qr(p)||null==(c=this.persistence)||c.register({[$u]:p}),null==(n=this.surveys)||n.reset(),null==(s=this.Nn)||s.stop(),null==(o=this.featureFlags)||o.reset(),null==(a=this.conversations)||a.reset(),null==(l=this.logs)||l.reset(),null==(u=this.metrics)||u.reset(),null==(h=this.persistence)||h.set_property(dh,Ch),null==(d=this.sessionManager)||d.resetSessionId(),this.kn=null,this.config.cookieless_mode===Th)this.register_once({distinct_id:yh,$device_id:null},"");else{var m=this.config.get_device_id(jh());this.register_once({distinct_id:m,$device_id:t?m:v},""),t||Qr(f)||this.register({[Su]:f})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var r=this;return e((function*(){var t,e,i,n,s,o,a;r.__loaded?(null==(t=r.Nn)||t.stop(),null==(e=r.An)||e.dispose(),null==(i=r.logs)||i.flushLogs("sendBeacon"),null==(n=r.metrics)||n.flush("sendBeacon"),null==(s=r.En)||s.unload(),null==(o=r.Pn)||o.unload(),null==(a=r.featureFlags)||a.destroy()):$s.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.Gn()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Qn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=e.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(xu)?($s.critical("Attempting to create alias for existing People user - aborting."),-2):this.zn("posthog.alias")?(Qr(e)&&(e=this.get_distinct_id()),t!==e?(this.Wn(Tu,t),this.capture("$create_alias",{alias:t,distinct_id:e})):($s.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Zr(t)){var i,n,s,o,a,l,u,h,d,c,v;js(this.config,vy(t));var f=this.Tn();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Pg(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.Sn(this.config.debug);ri(p)&&(this.config.debug=p),ri(this.config.debug)&&(this.config.debug?(As.DEBUG=!0,Yh.P()&&Yh.A("ph_debug",!0),$s.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(As.DEBUG=!1,Yh.P()&&Yh.F("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.Jn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){As.LIB_NAME=t,As.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}}addExceptionStep(t,e){var r;null==(r=this.exceptions)||r.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:py.Kn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:uy;return e!==uy&&(e=uy+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(dh))===Eh||(null==(e=this.sessionPersistence)?void 0:e.get_property(dh))===Eh}Un(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Mh&&!this._isIdentified()&&Gr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Tu])&&(null==(e=this.persistence)||null==(e=e.props)||!e[mh]))}qn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Un()||this.zn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.zn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}zn(t){return"never"===this.config.person_profiles?($s.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Wn(mh,!0),!0)}Tn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Sh)}Jn(){var t,e,r,i,n=this.Tn();return(null==(t=this.persistence)?void 0:t.ki)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.ki)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Th){if(this.mn()){var r,i,n,s,o;this.Zn(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Bm(this),this.pageViewManager=new kg(this),this.persistence&&(this.sessionPropsManager=new Nm(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=py.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.gn(this.sessionRecording,new l(this)),this.dn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.dn)))}var u,h;this.consent.optInOut(!0),this.Jn(),this.Dn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Sh&&(null==(u=this.surveys)||u.loadIfEnabled()),(Qr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$n()}else $s.warn(ny)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==Th?(this.config.cookieless_mode===Sh&&this.consent.isOptedIn()&&this.Zn(!0,!0),this.consent.optInOut(!1),this.Jn(),this.config.cookieless_mode===Sh&&(this.register({distinct_id:yh,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.$n(),this.Dn())):$s.warn(ny)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Th||(this.config.cookieless_mode===Sh?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Jn()}_is_bot(){return Ss?Um(Ss,this.config.custom_blocked_useragents):void 0}$n(){Ts&&("visible"===Ts.visibilityState?this._n||(this._n=!0,this.capture(Ph,{title:Ts.title},{send_instantly:!0}),this.wn&&(Ts.removeEventListener(Ih,this.wn),this.wn=null)):this.wn||(this.wn=this.$n.bind(this),Zs(Ts,Ih,this.wn)))}debug(t){!1===t?(null==xs||xs.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==xs||xs.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)`."),this.set_config({debug:!0}))}Ji(){var t=this.Cn||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?($s.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(t,e,r,i,n){var s=e in t&&!Xr(t[e]),o=r in t&&!Xr(t[r]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r])}(t,"advanced_disable_flags","advanced_disable_decide",0,$s)}Pt(t){var e;if(Xr(this.config.before_send))return t;var r=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(si),i=Wr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of i){if(n=s(n),Xr(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return ni(t.event)?$s.warn(o+". This can cause unexpected behavior."):$s.info(o),null}n.properties&&!Gr(n.properties)||$s.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&Xr(n.properties[a]))return $s.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.ui)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}Sn(t){var e=ri(t)&&!t,r=Yh.P()&&"true"===Yh.q("ph_debug");return!e&&(!!r||t)}}py.__defaultExtensionClasses={},py.Kn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=Hs(t.prototype[e[r]])}(py,["identify"]);var gy=Ds("[ExceptionAutocapture]"),my=Ds("[TracingHeaders]"),yy=Ds("[Web Vitals]"),by=9e5,_y="disabled",wy="lazy_loading",xy="awaiting_config",ky="missing_config";Ds("[SessionRecording]"),Ds("[SessionRecording]");var Sy="[SessionRecording]",Ty=Ds(Sy),Cy=Ds("[Heatmaps]");function Ey(t){return Zr(t)&&"clientX"in t&&"clientY"in t&&ti(t.clientX)&&ti(t.clientY)}var My=Ds("[Product Tours]"),Iy=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Au))},Ry=["$set_once","$set"],Py=Ds("[SiteApps]"),Oy="Error while initializing PostHog app with config id ";function Ly(t,e,r){if(Xr(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Ay{constructor(t){this.Yn=new qm,this.Xn=(t,e)=>this.ts(t,e)&&this.es(t,e)&&this.rs(t,e)&&this.ns(t,e),this.ts=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.ss=new Set,this.os=new Set}init(){var t,e;Qr(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!Qr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.os)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.ss)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.ss.has(t)||this.ss.has(e.event))&&this.os&&(null==(r=this.os)?void 0:r.size)>0&&this.os.forEach((t=>{this.ls(e,t)&&this.Yn.emit("actionCaptured",t.name)}))}us(t){this.onAction("actionCaptured",(e=>t(e)))}ls(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.Xn(t,r))return!0;return!1}onAction(t,e){return this.Yn.on(t,e)}es(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Ly(i,e.url,e.url_matching||"contains"))return!1}return!0}rs(t,e){return!!this.hs(t,e)&&!!this.ds(t,e)&&!!this.vs(t,e)}hs(t,e){var r;if(null==e||!e.href)return!0;var i=this.cs(t);if(i.length>0)return i.some((t=>Ly(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Ly((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ds(t,e){var r;if(null==e||!e.text)return!0;var i=this.cs(t);if(i.length>0)return i.some((t=>Ly(t.text,e.text,e.text_matching||"exact")||Ly(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!Xr(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Ly(t,s,o))))}vs(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}cs(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}ns(t,e){return null==e||!e.properties||0===e.properties.length||Vh(e.properties.reduce(((t,e)=>{var r=Wr(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Fy{constructor(t){var e;this.fs=[],this._instance=t,this.ps=new Map,this.gs=new Map,this.ys=new Map,null==(e=this._instance)||null==e.onSessionId||e.onSessionId((t=>this.bs(t)))}_s(t){return!1}ws(){return null}xs(t){}ks(){}Ss(t,e){return!!t&&Vh(t.propertyFilters,null==e?void 0:e.properties)}Cs(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}Ms(t,e,r){var i=(r===Wl.Activation?this.ps:this.gs).get(t),n=[];return this.Ts((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Ss(s,e)}))}register(t){var e;Qr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Es(t),this.Is(t))}Is(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==e.length&&(null==this.Ps&&(this.Ps=new Ay(this._instance),this.Ps.init(),this.Ps.us((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Ps)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.ys.get(e.name);r&&r.push(t.id),this.ys.set(e.name,r||[t.id])}})))})))}Es(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.ps=this.Cs(t,Wl.Activation),this.gs=this.Cs(t,Wl.Cancellation))}onEvent(t,e){var r,i,n=this.Rs(),s=(null==e||null==(r=e.properties)?void 0:r.$survey_id)||(null==e||null==(i=e.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.Ls(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Os([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Fs(s),void this.As([s])}if(this.gs.has(t)){var a=this.Ms(t,e,Wl.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map((t=>t.id))}),this.Os(a.map((t=>t.id))),a.forEach((t=>this.Ds(t.id))))}if(this.ps.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.ps.get(t)});var l=this.Ms(t,e,Wl.Activation);this.$s(l.map((t=>t.id)))}}onAction(t){this.ys.has(t)&&this.$s(this.ys.get(t)||[])}$s(t){var e;if(0!==t.length){var r=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),i=[];for(var n of t)r&&this._s(n)?this.Fs(n)&&this.Ns(n):i.push(n);i.length>0&&(this.fs=[...new Set([...this.fs,...i])]),this.Rs().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Fs(t){this.fs=this.fs.filter((e=>e!==t));var e=this.qs();return!e.includes(t)&&(this.js([...e,t]),this.Bs(),!0)}Os(t){var e=new Set(t);this.fs=this.fs.filter((t=>!e.has(t)));var r=this.Hs(),i=r.filter((t=>!e.has(t)));i.length!==r.length&&(this.js(i),0===i.length&&this.Us()),this.As(t)}zs(){var t,e=this.ws();if(!e)return{};var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r&&"object"==typeof r?r:{}}Ns(t){if(this.ws()){var e=this.zs();this.xs(r({},e,{[t]:Date.now()}))}}As(t){if(this.ws()){var e=this.zs(),r={},i=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?i=!0:r[s]=o}i&&(Gr(r)?this.ks():this.xs(r))}}Ws(){this.ws()&&this.ks()}getActivationTimestamp(t){if(this.qs().includes(t)){var e=this.zs()[t];return ti(e)?e:void 0}}Hs(){var t,e=this.Vs();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}qs(){var t,e,r=this.Hs();if(0===r.length)return[];var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Zs()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&i===n?r:[]}Bs(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Gs(e)}Us(){this.Qs()}bs(t){var e,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Zs()];if(r&&r!==t){var i=this.Hs(),n=this.zs();i.length>0&&(this.js([]),i.filter((t=>ti(n[t]))).forEach((t=>this.Ds(t)))),this.Us(),this.Ws()}}getActivatedIds(){return[...new Set([...this.qs(),...this.fs])].filter((t=>!this.Js(t)))}reset(){this.fs=[],this.Hs().length>0&&this.js([]),this.Us(),this.Ws()}getEventToItemsMap(){return this.ps}Ks(){return this.Ps}}class $y extends Fy{constructor(t){super(t)}Vs(){return ih}Zs(){return nh}ws(){return sh}xs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[sh]:t})}ks(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(sh)}_s(t){var e,r;this.Ts((e=>{r=e.find((e=>e.id===t))}));var i=null==(e=r)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return ti(i)&&i>0}Ys(){return Xl.SHOWN}Ts(t){var e;null==(e=this._instance)||e.getSurveys(t)}Ds(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Rs(){return cu}js(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ih]:t})}Gs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[nh]:t})}Qs(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(nh)}Js(){return!1}Ls(t,e){var r;return this.Ts((t=>{r=t.find((t=>t.id===e))})),!r||du(r)?t===Xl.SHOWN?"consume":"ignore":t===Xl.SHOWN?"persist":t===Xl.DISMISSED||t===Xl.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Dy="SDK is not enabled or survey functionality is not yet loaded",Ny="Disabled. Not loading surveys.",qy=null!=xs&&xs.location?to(xs.location.hash,"__posthog")||to(location.hash,"state"):null,jy="_postHogToolbarParams",By=Ds("[Toolbar]"),Uy=Ds("[FeatureFlags]"),Hy=Ds("[FeatureFlags]",{debugEnabled:!0}),zy="\" failed. Feature flags didn't load in time.",Wy=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},Vy=t=>{var e={};for(var r of Bs(t||{})){var i=r[1];i&&(e[r[0]]=i)}return e},Zy="Refusing to render web experiment since the viewer is a likely bot",Gy={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Uh(e,t),not_regex:(t,e)=>!Uh(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Qy{get Pe(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Qy.Xs("retrieved web experiments from the server"),e.ta=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.ta&&(Qy.Xs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.ta)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);Kr(i)&&t.variants[i]&&e.ea(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Qy.ia(s,e._instance)&&e.ea(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Qy.Xs(Zy);else if(!this.Pe.disable_web_experiments){if(Xr(this.ta))return this.ta=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Qy.Xs("applying feature flags",t),t.forEach((t=>{var e;if(this.ta&&null!=(e=this.ta)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.ta)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.ea(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Qy.getWindowLocation();if(null!=t&&t.search){var e=Ys(null==t?void 0:t.search,"__experiment_id"),r=Ys(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Qy.Xs("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.ra(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.Pe.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.Pe.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Pe.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}ra(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Qy.Xs("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.ea(i[0].name,e,i[0].variants[e].transforms))}static ia(t,e){return!Xr(t.conditions)&&Qy.na(t,e)&&Qy.sa(t)}static na(t,e){var r;if(Xr(t.conditions)||Xr(null==(r=t.conditions)?void 0:r.url))return!0;var i=Qy.getWindowLocation();if(i){var n,s,o,a=oo(e,i.href);return null==(n=t.conditions)||!n.url||Gy[null!==(s=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,a)}return!1}static getWindowLocation(){return null==xs?void 0:xs.location}static sa(t){var e;if(Xr(t.conditions)||Xr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=vc();if(r.utm_source){var i,n,s,o,a,l,u,h,d=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,c=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static Xs(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];$s.info("[WebExperiments] "+t,r)}ea(t,e,r){this._is_bot()?Qy.Xs(Zy):"control"!==e?r.forEach((r=>{if(r.selector){var i;Qy.Xs("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):Qy.Xs("Control variants leave the page unmodified.")}_is_bot(){return Ss&&this._instance?Um(Ss,this.Pe.custom_blocked_useragents):void 0}}var Ky=Ds("[Conversations]"),Jy="Conversations not available yet.",Yy="console",Xy="__posthogHandledLogsRequestError",tb=(t,e)=>{var r=t instanceof Error?t:new Error(e);return r[Xy]=!0,r},eb=t=>!!t&&"object"==typeof t&&!0===t[Xy],rb={featureFlags:class{constructor(t){this.aa=!1,this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.va=!1,this.ca=!1,this.fa=0,this.pa=()=>{var t=this.ga();this.fa=0,t&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],xs&&Zs(xs,"online",this.pa)}destroy(){null==xs||xs.removeEventListener("online",this.pa)}get Pe(){return this._instance.config}get Tr(){return this._instance.persistence}ma(t){return this._instance.get_property(t)}ya(){var t,e;return null!==(t=null==(e=this.Tr)?void 0:e.Ci(this.Pe.feature_flag_cache_ttl_ms))&&void 0!==t&&t}ba(){return!!this.ya()&&(this.ca||this.la||(this.ca=!0,Uy.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_a(){var t,e=null!==(t=this.Pe.evaluation_contexts)&&void 0!==t?t:this.Pe.evaluation_environments;return!this.Pe.evaluation_environments||this.Pe.evaluation_contexts||this.va||(Uy.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.va=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Uy.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}wa(){return this._a().length>0}xa(){var t=this.Pe.flag_keys;if(!Qr(t)){if(Wr(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Uy.error("Invalid flag key found:",t,"Expected non-empty string"),e}));Uy.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,r=this._instance.config,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.ma(zu))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.ma(Gu))&&void 0!==s?s:{},l=r({},o,t),u=r({},a,e),h={};for(var d of Object.entries(l)){var c=d[0],v=d[1];h[c]={key:c,enabled:br(v),variant:_r(v),reason:void 0,metadata:Qr(null==u?void 0:u[c])?void 0:{id:0,version:void 0,description:void 0,payload:u[c]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.oa}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.ma(Zu),e=this.ma(Ju),i=this.ma(Yu);if(!i&&!e)return t||{};var n=js({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],d=Qr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=Qr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:d,variant:d?null!=c?c:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),c!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v&&(f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.aa||(Uy.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.aa=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((r=>{var i=t[r];return{key:r,enabled:br(i),variant:_r(i),payload:yr(e[r])}}))}getFlagVariants(){var t=this.ma(zu),e=this.ma(Ju);if(!e)return t||{};for(var r=js({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.aa||(Uy.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.aa=!0),r}getFlagPayloads(){var t=this.ma(Gu),e=this.ma(Yu);if(!e)return t||{};for(var r=js({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.aa||(Uy.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.aa=!0),r}reloadFeatureFlags(){this.ua||this.Pe.advanced_disable_feature_flags||this.ga()||this.ka||(this._instance.vn.emit("featureFlagsReloading",!0),this.ka=setTimeout((()=>{this.Sa()}),5))}Ca(){clearTimeout(this.ka),this.ka=void 0}ensureFlagsLoaded(){this.oa||this.la||this.ka||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ua=t}Sa(t){var e;if(this.Ca(),!this._instance.Ji()&&!this.ga())if(this.la)this.ha=!0;else{var i=this.Pe.token,n=this.ma(ku),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this.Tr)?void 0:e.get_initial_props())||{},this.ma(Xu)||{},{$lib:As.LIB_NAME,$lib_version:As.LIB_VERSION}),group_properties:this.ma(th),timezone:wc()};Yr(n)||Qr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Pe.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.wa()&&(s.evaluation_contexts=this._a());var o=this.xa();Qr(o)||(s.flag_keys=o);var a=!!this.Pe.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Pe.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.la=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Pe.disable_compression?void 0:zl.Base64,timestampMode:"body",timeout:this.Pe.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(this.Ma(t.statusCode),200===t.statusCode&&(this.ha||(this.$anon_distinct_id=void 0),n=!1),this.la=!1,!s.disable_flags||this.ha){this.da=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.Tr)||i.register({[uh]:o}),u)Uy.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(l=t.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.ha&&(this.ha=!1,this.Sa())}}})}}ga(){return eo(this.fa,3)}Ma(t){this.fa=ro(t,this.fa,3,(()=>Uy.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Uy.warn('getFeatureFlag for key "'+t+zy)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.ma(Qu)||void 0,l=this.ma(hh)||void 0,u=this.ma(ah)||{};if(this.Pe.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.ma(lh);d&&d!==c&&(u={},null==(h=this.Tr)||h.register({[ah]:u,[lh]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var v,f,p,g,m,y,b,_,w,x,k;Wr(u[t])?u[t].push(o):u[t]=[o],null==(v=this.Tr)||v.register({[ah]:u});var S=this.getFeatureFlagDetails(t),T=[...null!==(f=this.ma(uh))&&void 0!==f?f:[]];Qr(n)&&T.push("flag_missing");var C={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Pe.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Pe.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.da};Qr(null==S||null==(m=S.metadata)?void 0:m.has_experiment)||(C.$feature_flag_has_experiment=S.metadata.has_experiment),Qr(null==S||null==(y=S.metadata)?void 0:y.version)||(C.$feature_flag_version=S.metadata.version);var E,M=null!==(b=null==S||null==(_=S.reason)?void 0:_.description)&&void 0!==b?b:null==S||null==(w=S.reason)?void 0:w.code;M&&(C.$feature_flag_reason=M),null!=S&&null!=(x=S.metadata)&&x.id&&(C.$feature_flag_id=S.metadata.id),Qr(null==S?void 0:S.original_variant)&&Qr(null==S?void 0:S.original_enabled)||(C.$feature_flag_original_response=Qr(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(k=S.metadata)&&k.original_payload&&(C.$feature_flag_original_payload=null==S||null==(E=S.metadata)?void 0:E.original_payload),T.length&&(C.$feature_flag_error=T.join(",")),this._instance.capture("$feature_flag_called",C)}if(i)return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:yr(s)}}}else Uy.warn('getFeatureFlagResult for key "'+t+zy)}getRemoteConfigPayload(t,e){var r=this.Pe.token,i={distinct_id:this._instance.get_distinct_id(),token:r,person_properties:{$lib:As.LIB_NAME,$lib_version:As.LIB_VERSION}};this.wa()&&(i.evaluation_contexts=this._a());var n=this.xa();Qr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Pe.disable_compression?void 0:zl.Base64,timestampMode:"body",timeout:this.Pe.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.da)return e.defaultValue;if(!(this.oa||this.getFlags()&&this.getFlags().length>0))return Uy.warn('isFeatureEnabled for key "'+t+zy),e.defaultValue;var r=this.getFeatureFlag(t,e);return Qr(r)?e.defaultValue:!!r}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.Tr){this.oa=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):t.featureFlags&&Uy.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,c=t.evaluatedAt;if(Wr(u)){Uy.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;e&&e.register({[Wu]:u,[zu]:v,[Ku]:!1})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(t.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((t=>{var e;return!(null!=(e=l[t])&&e.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((t=>y.has(t[0]))))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);e&&e.register(r({[Wu]:Object.keys(Vy(p)),[zu]:p||{},[Gu]:g||{},[Zu]:m||{},[Ku]:!0===t.minimalFlagCalledEvents},d?{[Qu]:d}:{},c?{[hh]:c}:{}))}}}(t,this.Tr,n,s,o,i),e||(this.ca=!1),this.Ta(e)}}override(t,e){void 0===e&&(e=!1),Uy.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.Tr)return Uy.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.Tr.unregister(Ju),this.Tr.unregister(Yu),this.Ta(),Hy.info("All overrides cleared");if(Wr(t)){var e=Wy(t);return this.Tr.register({[Ju]:e}),this.Ta(),Hy.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.aa=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.Tr.unregister(Ju),Hy.info("Flag overrides cleared");else if(i.flags){if(Wr(i.flags)){var n=Wy(i.flags);this.Tr.register({[Ju]:n})}else this.Tr.register({[Ju]:i.flags});Hy.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.Tr.unregister(Yu),Hy.info("Payload overrides cleared")):i.payloads&&(this.Tr.register({[Yu]:i.payloads}),Hy.info("Payload overrides set",{payloads:i.payloads}))),void this.Ta()}if(t&&"object"==typeof t)return this.Tr.register({[Ju]:t}),this.Ta(),Hy.info("Flag overrides set",{flags:t});Uy.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.oa){var e=this.Ea(),r=e.flags,i=e.flagVariants;try{t(r,i)}catch(t){Uy.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.ma(Vu)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[t]:e});null==(n=this.Tr)||n.register({[Wu]:Object.keys(Vy(l)),[zu]:l}),this.Ta()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.ma(Vu),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Pe.token+n),method:"GET",timestampMode:"query",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.Tr)||r.unregister(Vu),null==(i=this.Tr)||i.register({[Vu]:n}),t(n)}}})}Ea(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}Ta(t){var e=this.Ea(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(r,i,{errorsLoading:t})}catch(t){Uy.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.ma(Xu)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Xu]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=r({},this.ma(Xu)||{});t.forEach((t=>{delete i[t]})),this._instance.register({[Xu]:i}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this._instance.unregister(Xu),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.ma(th)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[th]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.ma(th)||{};this._instance.register({[th]:r({},e,{[t]:{}})})}else this._instance.unregister(th)}reset(){this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.$anon_distinct_id=void 0,this.Ca(),this.aa=!1,this.fa=0}}},ib={sessionRecording:class{get Pe(){return this._instance.config}get Tr(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Ia)||!t.isStarted)}get status(){var t,e;return this.Pa===xy||this.Pa===ky?this.Pa:null!==(t=null==(e=this.Ia)?void 0:e.status)&&void 0!==t?t:this.Pa}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Pa=_y,this.Ra=void 0,this._instance=t,!this._instance.sessionManager)throw Ty.error("started without valid sessionManager"),new Error(Sy+" started without valid sessionManager. This is a bug.");if(this.Pe.cookieless_mode===Th)throw new Error(Sy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get La(){var t,e=!(null==(t=this._instance.get_property($u))||!t.enabled),r=!this.Pe.disable_session_recording,i=this.Pe.disable_session_recording||this._instance.consent.isOptedOut();return xs&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.La||null==(e=this.Ia)||!e.isStarted){var r=!Qr(Object.assign)&&!Qr(Array.from);this.La&&r?(this.Oa(t),Ty.info("starting")):(this.Pa=_y,this.stopRecording())}}Oa(t){var e,r,i;this.La&&(this.Pa!==xy&&this.Pa!==ky&&(this.Pa=wy),null!=Ca&&null!=(e=Ca.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=Ca.__PosthogExtensions__)&&r.initSessionRecording?this.Fa(t):null==(i=Ca.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Aa,(e=>{if(e)return Ty.error("could not load recorder",e);this.Fa(t)})))}stopRecording(){var t,e;null==(t=this.Ra)||t.call(this),this.Ra=void 0,null==(e=this.Ia)||e.stop()}Da(){var t,e;null==(t=this.Ra)||t.call(this),this.Ra=void 0,null==(e=this.Ia)||e.discard()}$a(){var t,e;null==(t=this.Tr)||t.unregister(Hu),null==(e=this.Tr)||e.unregister(Du)}Na(t,e){if(Xr(t))return null;var r,i=ti(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Ty.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}qa(t){if(this.Tr){var e,i,n=this.Tr,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Na(null==(e=this.Pe.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Na(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Xr(a)&&this.$a();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[$u]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Qr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(e=this.Ra)||e.call(this),this.Ra=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.qa(e),void this.Da()):(this.qa(e),void this.startIfEnabledOrStop()):(this.Pa===xy&&(this.Pa=ky,Ty.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Ia)&&r.log?this.Ia.log(t,e):Ty.warn("log called before recorder was ready")}get Aa(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property($u);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}ja(){var t,e,r=this._instance.get_property($u);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return Ty.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var i=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}Fa(t){var e,r;if(null==(e=Ca.__PosthogExtensions__)||!e.initSessionRecording)return Ty.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[xh]:!0});if(this.Ia||(this.Ia=null==(r=Ca.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Ia._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ja()){if(this.Pa===ky||this.Pa===xy)return;return this.Pa=xy,Ty.info("persisted remote config is stale, requesting fresh config before starting"),void new Ng(this._instance).load()}this.Pa=wy,this.Ia.start(t)}onRRwebEmit(t){var e;null==(e=this.Ia)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Ia||null==(e=this.Tr)||e.register({[qu]:!0}),null==(t=this.Ia)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Ia||null==(e=this.Tr)||e.register({[Nu]:!0}),null==(t=this.Ia)||t.overrideSampling()}overrideTrigger(t){var e,r;this.Ia||null==(r=this.Tr)||r.register({["url"===t?ju:Bu]:!0}),null==(e=this.Ia)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Ia)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Ia)||!r.tryAddCustomEvent(t,e))}}},nb={autocapture:class{constructor(t){this.Ba=!1,this.Ha=null,this.Ua=!1,this.za=!1,this.instance=t,this.rageclicks=new Yp(t.config.rageclick),this.Wa=null}initialize(){this.startIfEnabled()}get Pe(){var t,e,r=Zr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}Va(){if(this.isBrowserSupported()){if(xs&&Ts){var t=t=>{t=t||(null==xs?void 0:xs.event);try{this.Za(t)}catch(t){tg.error("Failed to capture event",t)}};if(Zs(Ts,"submit",t,{capture:!0}),Zs(Ts,"change",t,{capture:!0}),Zs(Ts,"click",t,{capture:!0}),this.Pe.capture_copied_text){var e=t=>{t=t||(null==xs?void 0:xs.event);try{this.Za(t,Xp)}catch(t){tg.error("Failed to capture copy/cut event",t)}};Zs(Ts,"copy",e,{capture:!0}),Zs(Ts,"cut",e,{capture:!0})}}}else tg.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ba&&(this.Va(),this.Ba=!0)}onRemoteConfig(t){if(this.Ua=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.za=e.elementsChainAsString);var r=e.autocapture_opt_out;ri(r)&&(this.instance.persistence&&this.instance.persistence.register({[Eu]:r}),this.Ha=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Wa=t}getElementSelectors(t){var e,r=[];return null==(e=this.Wa)||e.forEach((e=>{var i=null==Ts?void 0:Ts.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[Eu],i=this.Ha,n=this.instance.Ji()&&!this.Ua;if(Yr(i)&&!ri(r)&&!n)return!1;var s=null!==(e=this.Ha)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!s}Za(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=So(t);go(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Fo(i,this.instance.config.rageclick)&&this.Za(t,"$rageclick");var n=e===Xp;if(i&&function(t,e,r,i,n,s){var o;if(!xs||$o(t))return!1;if(null!=r&&r.url_allowlist&&!_o(r.url_allowlist,s))return!1;if(null!=r&&r.url_ignorelist&&_o(r.url_ignorelist,s))return!1;if(null!=r&&r.dom_event_allowlist){var a=r.dom_event_allowlist;if(a&&!a.some((t=>e.type===t)))return!1}var l=Do(t,i),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Qr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(h,r))return!1;if(!Co(h,null==r?void 0:r.css_selector_allowlist))return!1;if(Co(h,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:Mo))return!1;try{var d=xs.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return u?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(To.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.Pe,n,n?["copy","cut"]:void 0,this.instance)){var s=ig(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Pe.element_attribute_ignorelist,elementsChainAsString:this.za,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=s.props;if(s.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===Xp){var l,u=xo(null==xs||null==(l=xs.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Vr(null==Ts?void 0:Ts.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ga=(null==xs||null==(e=xs.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&($s.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Qa&&this.Qa(),this.Qa=void 0,$s.info("History API monitoring stopped")}monitorHistoryChanges(){xs&&xs.history&&(this.Ja("pushState"),this.Ja("replaceState"),this.Ka())}Ja(t){var e;if(xs&&(null==(e=xs.history[t])||!e.__posthog_wrapped__)){var r=this;no(xs.history,t,(e=>function(i,n,s){e.call(this,i,n,s),r.Ya(t)}))}}Ya(t){try{var e,r=null==xs||null==(e=xs.location)?void 0:e.pathname;if(!r)return;r!==this.Ga&&this.isEnabled&&this._instance.capture(Ph,{navigation_type:t}),this.Ga=r}catch(e){$s.error("Error capturing "+t+" pageview",e)}}Ka(){if(!this.Qa){var t=()=>{this.Ya("popstate")};Zs(xs,"popstate",t),this.Qa=()=>{xs&&xs.removeEventListener("popstate",t)}}}},heatmaps:class{get Pe(){return this.instance.config}constructor(t){var e;this.Xa=!1,this.Ba=!1,this.eo=null,this.instance=t,this.Xa=!(null==(e=this.instance.persistence)||!e.props[Mu]),this.rageclicks=new Yp(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Zr(this.Pe.capture_heatmaps)&&this.Pe.capture_heatmaps.flush_interval_milliseconds&&(t=this.Pe.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Xr(this.Pe.capture_heatmaps)?Xr(this.Pe.enable_heatmaps)?this.Xa:this.Pe.enable_heatmaps:!1!==this.Pe.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ba)return;Cy.info("starting..."),this.io(),this.Ie()}else{var t;clearInterval(null!==(t=this.eo)&&void 0!==t?t:void 0),this.ro(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var r=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Mu]:r}),this.Xa=r,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.O;return this.O=void 0,t}no(t){Ey(t.originalEvent)&&this.ke(t.originalEvent,"deadclick")}Ie(){this.eo&&clearInterval(this.eo),this.eo="visible"===(null==Ts?void 0:Ts.visibilityState)?setInterval(this.pr.bind(this),this.flushIntervalMilliseconds):null}io(){xs&&Ts&&(this.so=this.pr.bind(this),Zs(xs,Rh,this.so),this.ao=t=>this.ke(t||(null==xs?void 0:xs.event)),Zs(Ts,"click",this.ao,{capture:!0}),this.oo=t=>this.lo(t||(null==xs?void 0:xs.event)),Zs(Ts,"mousemove",this.oo,{capture:!0}),this.uo=new yg(this.instance,gg,this.no.bind(this)),this.uo.startIfEnabledOrStop(),this.ho=this.Ie.bind(this),Zs(Ts,Ih,this.ho),this.Ba=!0)}ro(){var t;xs&&Ts&&(this.so&&xs.removeEventListener(Rh,this.so),this.ao&&Ts.removeEventListener("click",this.ao,{capture:!0}),this.oo&&Ts.removeEventListener("mousemove",this.oo,{capture:!0}),this.ho&&Ts.removeEventListener(Ih,this.ho),clearTimeout(this.do),null==(t=this.uo)||t.stop(),this.Ba=!1)}vo(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&fo(i)&&!po(i,"body");){if(i===r)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=i.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:xs)?void 0:s.getComputedStyle(i).position}catch(t){return!1}if(Nr(e,n))return!0;i=Eo(i)}return!1}(So(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}ke(t,e){var i;if(void 0===e&&(e="click"),!vo(t.target)&&Ey(t)){var n=this.vo(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Fo(So(t),this.instance.config.rageclick)&&this.Vt(r({},n,{type:"rageclick"})),this.Vt(n)}}lo(t){!vo(t.target)&&Ey(t)&&(clearTimeout(this.do),this.do=setTimeout((()=>{this.Vt(this.vo(t,"mousemove"))}),500))}Vt(t){if(xs){var e=this.Pe.disable_capture_url_hashes?kn(xs.location.href):xs.location.href,r=this.Pe.custom_personal_data_properties,i=this.Pe.mask_personal_data_properties?[...uc,...r||[]]:[],n=Xs(e,i,dc);this.O=this.O||{},this.O[n]||(this.O[n]=[]),this.O[n].push(t)}}pr(){this.O&&!Gr(this.O)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:yg,webVitalsAutocapture:class{constructor(t){var e;this.Xa=!1,this.Ba=!1,this.O={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.co=()=>{clearTimeout(this.fo),this.fo=void 0,0!==this.O.metrics.length&&(this._instance.capture("$web_vitals",r({$current_url:this.O.url},this.O.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.O={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.po=t=>{var e;if(this.O=this.O||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Xr(null==t?void 0:t.name)||Xr(null==t?void 0:t.value))yy.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,n=this.mo(i);if(!Qr(n)){var s=ti(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+n;if(!this.yo||this.yo>t.value){this.O.navigationKey!==s&&(this.co(),this.fo=setTimeout(this.co,this.flushToCaptureTimeoutMs)),Qr(this.O.navigationKey)&&(this.O.navigationKey=s,this.O.url=n),this.O.firstMetricTimestamp=Qr(this.O.firstMetricTimestamp)?Date.now():this.O.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var o=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=r({},t,i?{navigationURL:n}:{},{$current_url:n,timestamp:Date.now()});Qr(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.O.metrics.push(a),this.O.metrics.length===this.allowedMetrics.length&&this.co()}else yy.error("Ignoring metric with value >= "+this.yo,t)}}},this.bo=()=>{if(!this.Ba){var t,e,r,i,n=Ca.__PosthogExtensions__,s=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,o=(null==s?void 0:s[this._o])||("web-vitals"===this._o&&Qr(s)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(Qr(o)||(t=o.onLCP,e=o.onCLS,r=o.onFCP,i=o.onINP),t&&e&&r&&i){var a={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&t(this.po.bind(this),a),this.allowedMetrics.indexOf("CLS")>-1&&e(this.po.bind(this),a),this.allowedMetrics.indexOf("FCP")>-1&&r(this.po.bind(this),a),this.allowedMetrics.indexOf("INP")>-1&&i(this.po.bind(this),a),this.Ba=!0}else yy.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Xa=!(null==(e=this._instance.persistence)||!e.props[Ou]),this.startIfEnabled()}get wo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=Zr(this.wo)?null==(t=this.wo)?void 0:t.web_vitals_allowed_metrics:void 0;return Xr(r)?(null==(e=this._instance.persistence)?void 0:e.props[Fu])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Zr(this.wo)?this.wo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Zr(this.wo)?this.wo.web_vitals_attribution:void 0;return null!=t&&t}get useSoftNavs(){var t=Zr(this.wo)?this.wo.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get yo(){var t=Zr(this.wo)&&ti(this.wo.__web_vitals_max_value)?this.wo.__web_vitals_max_value:by;return t>0&&6e4>=t?by:t}get isEnabled(){var t=null==Cs?void 0:Cs.protocol;if("http:"!==t&&"https:"!==t)return yy.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Zr(this.wo)?this.wo.web_vitals:ri(this.wo)?this.wo:void 0;return ri(e)?e:this.Xa}startIfEnabled(){this.isEnabled&&!this.Ba&&(yy.info("enabled, starting..."),this.ai(this.bo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var r=Zr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=Zr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ou]:r}),this._instance.persistence.register({[Fu]:i})),this.Xa=r,this.startIfEnabled()}}}get _o(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}ai(t){var e=Ca.__PosthogExtensions__,r=this._o,i=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=i&&i[r]||"web-vitals"===r&&Qr(i)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,r,(e=>{e?yy.error("failed to load script",e):t()}))}mo(t){var e=t||(null==xs?void 0:xs.location.href);if(e){var r=this._instance.config.disable_capture_url_hashes?kn(e):e,i=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...uc,...i||[]]:[];return Xs(r,n,dc)}yy.error("Could not determine current URL")}}},sb={exceptionObserver:class{constructor(t){var e;this.bo=()=>{var t;if(xs&&this.isEnabled&&null!=(t=Ca.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=Ca.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Ca.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Ca.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.xo&&this.Pe.capture_unhandled_errors&&(this.xo=e(this.captureException.bind(this))),!this.ko&&this.Pe.capture_unhandled_rejections&&(this.ko=r(this.captureException.bind(this))),!this.So&&this.Pe.capture_console_errors&&(this.So=i(this.captureException.bind(this)))}catch(t){gy.error("failed to start",t),this.Co()}}},this._instance=t,this.Mo=!(null==(e=this._instance.persistence)||!e.props[Iu]),this.To=new fi(r({},function(t){var e,r,i,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(r=t.exceptionRateLimiterRefillRate)&&void 0!==r?r:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(i=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,rt:gy})),this.Pe=this.Eo(),this.startIfEnabledOrStop()}Eo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Zr(t)?e=r({},e,t):(Qr(t)?this.Mo:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Pe.capture_console_errors||this.Pe.capture_unhandled_errors||this.Pe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(gy.info("enabled"),this.Co(),this.ai(this.bo)):this.Co()}ai(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return gy.error("failed to load script",e);t()}))}Co(){var t,e,r;null==(t=this.xo)||t.call(this),this.xo=void 0,null==(e=this.ko)||e.call(this),this.ko=void 0,null==(r=this.So)||r.call(this),this.So=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Mo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Iu]:this.Mo}),this.Pe=this.Eo(),this.startIfEnabledOrStop())}}onConfigChange(){this.Pe=this.Eo()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.To.consumeRateLimit(n)?gy.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.Io=[],this.Po=Vc(),this._instance=t,this.Io=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(Ru))&&void 0!==e?e:[],this.Ro=bs(this.Lo()),this.Oo=new _s(this.Ro)}onConfigChange(){this.Ro=bs(this.Lo()),this.Oo.setConfig(this.Ro)}onRemoteConfig(t){var e,r,i;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(r=n.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=n.errorTracking)?void 0:i.captureExtensionExceptions;this.Io=s,this._instance.persistence&&this._instance.persistence.register({[Ru]:this.Io,[Pu]:o})}}}get Fo(){var t,e=!!this._instance.get_property(Pu),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.Po.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Ro.enabled)try{if(!Kr(t)||0===t.trim().length)return void Wc.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>ms.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(this.Ao(e)),n=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&Wc.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Oo.add(r({[ps]:t,[gs]:(new Date).toISOString()},n))}catch(t){Wc.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Do(e)){if(this.$o(e))return this.No("Exception dropped: matched a suppression rule"),void Wc.info("Skipping exception capture because a suppression rule matched");if(!this.Fo&&this.qo(e))return this.No("Exception dropped: thrown by a browser extension"),void Wc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.jo(e))return this.No("Exception dropped: thrown by the PostHog SDK"),void Wc.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.Ro.enabled&&Xr(t.$exception_steps)?this.Bo(t):t,i="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;i&&(r.$release_id=i);try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",jn:!0});return n&&this.Oo.clear(),n}catch(t){return Wc.error("Failed to capture exception event. Dropping this exception.",t),void this.Oo.clear()}}catch(t){return void Wc.error("Failed to process exception event. Ignoring this exception.",t)}var s}Bo(t){try{var e=this.Oo.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return Wc.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}No(t){this.Ro.enabled&&this.Oo.add({[ps]:t,[gs]:(new Date).toISOString()})}Ao(t){return Zr(t)?r({},t):{}}Lo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}$o(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var r=e.type,i=e.value;return Kr(r)&&r.length>0&&t.$exception_types.push(r),Kr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.Io.some((t=>{var r=t.values.map((t=>{var r=zh[t.operator],i=e[t.key];if(!r||!i)return!1;var n=Wr(t.value)?t.value:[t.value];return n.length>0&&r(n,i)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}catch(t){return Wc.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}qo(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}jo(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}Do(t){return!Xr(t)&&Wr(t)}}},ob=r({productTours:class{get Tr(){return this._instance.persistence}constructor(t){this.Ho=null,this.Uo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var r,i;if(this.Tr&&this.Tr.register({[Au]:!!e.productTours}),!Iy(this._instance))return!this.Ho&&Xr(null==(r=this.Tr)?void 0:r.props[oh])||My.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.Ho)||i.stop(),this.Ho=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Ho&&Iy(this._instance)&&this.ai((()=>this.zo()))}ai(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?My.error("Could not load product tours script",e):t()}))}zo(){var t;!this.Ho&&null!=(t=Ca.__PosthogExtensions__)&&t.generateProductTours&&(this.Ho=Ca.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Wr(this.Uo)||e){var r=this.Tr;if(r){var i=r.props[oh];if(Wr(i)&&!e)return this.Uo=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:e=>{if(Iy(this._instance)){var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return 0===i?e.error||My.warn(n):My.error(n),void t([],{isLoaded:!1,error:n})}var s=Wr(e.json.product_tours)?e.json.product_tours:[];this.Uo=s,r&&r.register({[oh]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Uo,{isLoaded:!0})}getActiveProductTours(t){Xr(this.Ho)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ho.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Ho)||e.showTourById(t)}previewTour(t){this.Ho?this.Ho.previewTour(t):this.ai((()=>{var e;this.zo(),null==(e=this.Ho)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Ho)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Ho)||t.nextStep()}previousStep(){var t;null==(t=this.Ho)||t.previousStep()}clearCache(){var t;this.Uo=null,null==(t=this.Tr)||t.unregister(oh)}resetTour(t){var e;null==(e=this.Ho)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Ho)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Ho)||e.cancelPendingTour(t)}}},rb),ab={siteApps:class{constructor(t){this.Wo=0,this._instance=t,this.Vo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Zo(t,e){if(e){var r=this.globalsForEvent(e);this.Vo.push(r),this.Vo.length>1e3&&(this.Vo=this.Vo.slice(10))}}get siteAppLoaders(){var t;return null==(t=Ca._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Zo.bind(this));this.Go=()=>{t(),this.Vo=[],this.Go=void 0}}}globalsForEvent(t){var e,n,s,o,a,l,u;if(!t)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var v of Object.entries(c)){var f=v[0];h[f]={id:d[f],type:f,properties:v[1]}}var p=t.$set_once,g=t.$set;return{event:r({},i(t,Ry),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}Qo(t){var e,r=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Py.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Py.error("prepare_external_dependency_script returned null"),null):t}Jo(){var t,e,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==Ts?void 0:Ts.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Wo++,this.Ko)return this.Yo();var h=[],d=this,c=new WeakSet,v=(t,e,r)=>{if(null!=t&&t[e]){var i=t[e];t[e]=r(i),h.push((()=>{t[e]=i}))}},f=t=>{if(c.has(t))return t;var e=d.Qo(t);return e&&c.add(e),e},p=t=>t.map((t=>"string"==typeof t?t:f(t))).filter((t=>!Yr(t)));return v(u,"appendChild",(t=>function(e){var r=f(e);return r?t.call(this,r):e})),v(u,"insertBefore",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):e})),v(u,"replaceChild",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):r})),[null==(e=l.Element)?void 0:e.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((t=>{v(t,"append",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"prepend",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach((t=>{v(t,"before",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"after",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"replaceWith",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:t.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(t=>function(e,r){var i=f(r);return i?t.call(this,e,i):null})),this.Ko=()=>{h.forEach((t=>t())),this.Ko=void 0},this.Yo()}Yo(){var t=!1;return()=>{var e;t||(t=!0,this.Wo--,0===this.Wo&&(null==(e=this.Ko)||e.call(this)))}}Xo(t,e){void 0===e&&(e=!0);var r=this.Jo();try{var i=t(r);return e&&r(),i}catch(t){throw r(),t}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;!e.errored&&this.Vo.length&&(Py.info("Processing "+this.Vo.length+" events for site app with id "+t.id),this.Vo.forEach((t=>this.Xo((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(r=this.Go)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Py.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var s=this.Xo((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),i=!0}catch(e){Py.error(Oy+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Py.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}tl(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}el(t){var e=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(t),i=function(i){try{e.Xo((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(e){Py.error("Error while processing event "+t.event+" for site app "+i.id,e)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.tl(),void this._instance.on("eventCaptured",(t=>this.el(t)))):void Py.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Go)||r.call(this),t.ok){var s=t.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled){var o=function(){var t,e=a.id,r=a.url;Ca["__$$ph_site_app_"+e]=n._instance,null==(t=Ca.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,r,(t=>{if(t)return Py.error(Oy+e,t)}))};for(var a of s.siteApps)o()}else Py.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},lb={tracingHeaders:class{constructor(t){this.il=void 0,this.rl=void 0,this.nl=void 0,this.bo=()=>{var t,e,r=this.sl();r?(Qr(this.il)&&(this.il=null==(t=Ca.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Qr(this.rl)&&(this.rl=null==(e=Ca.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Co()},this._instance=t}initialize(){this.startIfEnabledOrStop()}ai(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return my.error("failed to load script",e);t()}))}al(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}sl(){var t=this.al();return Wr(t)?(Wr(this.nl)?this.nl.splice(0,this.nl.length,...t):this.nl=[...t],t.length>0?this.nl:void 0):(Wr(this.nl)&&this.nl.splice(0),this.nl=t||void 0,this.nl)}Co(){var t,e;null==(t=this.il)||t.call(this),null==(e=this.rl)||e.call(this),this.il=void 0,this.rl=void 0}startIfEnabledOrStop(){this.sl()?this.ai(this.bo):this.Co()}}},ub=r({surveys:class{get Pe(){return this._instance.config}constructor(t){this.ol=void 0,this._surveyManager=null,this.ll=!1,this.ul=[],this.hl=null,this.dl=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Pe.disable_surveys){if(!t.ok)return cu.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Xr(e))return cu.warn("Flags not loaded yet. Not loading surveys.");var r=Wr(e);this.ol=r?e.length>0:e,cu.info("flags response received, isSurveysEnabled: "+this.ol),this.loadIfEnabled()}}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(pu)||null!=i&&i.startsWith(gu))&&e.push(i)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this._surveyManager)if(this.ll)cu.info("Already initializing surveys, skipping...");else if(this.Pe.disable_surveys)cu.info(Ny);else if(this.Pe.cookieless_mode&&this._instance.consent.isOptedOut())cu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==Ca?void 0:Ca.__PosthogExtensions__;if(t){if(!Qr(this.ol)||this.Pe.advanced_enable_surveys){var e=this.ol||this.Pe.advanced_enable_surveys;this.ll=!0;try{var r=t.generateSurveys;if(r)return void this.vl(r,e);var i=t.loadExternalDependency;if(!i)return void this.cl(kh);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.cl("Could not load surveys script",r):this.vl(t.generateSurveys,e)}))}catch(t){throw this.cl("Error initializing surveys",t),t}finally{this.ll=!1}}}else cu.error("PostHog Extensions not found.")}}vl(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new $y(this._instance),cu.info("Surveys loaded successfully"),this.fl({isLoaded:!0})}cl(t,e){cu.error(t,e),this.fl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ul.push(t),this._surveyManager&&this.fl({isLoaded:!0}),()=>{this.ul=this.ul.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Pe.disable_surveys)return cu.info(Ny),t([]);var r,i=this._instance.get_property(eh);if(i&&!e)return t(i,{isLoaded:!0}),void(this.pl()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.hl?this.hl.then((e=>t(e.surveys,e.context))):("undefined"!=typeof Promise&&(this.hl=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Pe.token),method:"GET",timestampMode:"query",timeout:this.Pe.surveys_request_timeout_ms,callback:e=>{var i;this.hl=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;0!==n?cu.error(s):e.error||cu.warn(s),this.dl=Date.now();var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}this.dl=null;var a,l=e.json.surveys||[],u=l.filter((t=>vu(t)&&(hu(t)||fu(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[eh]:l,[rh]:Date.now()});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}pl(){return this.gl()&&!this.hl&&!this.ml()}gl(){var t=this._instance.get_property(rh);return ti(t)&&Date.now()-t>3e5}ml(){return ti(this.dl)&&3e5>Date.now()-this.dl}markSurveyAsSeen(t,e){var r,i={id:t,current_iteration:null!==(r=null==e?void 0:e.iteration)&&void 0!==r?r:null};bu(i);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}fl(t){for(var e of this.ul)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){cu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Xr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);cu.warn("init was not called")}yl(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}bl(t){if(Xr(this._surveyManager))return{eligible:!1,reason:Dy};var e="string"==typeof t?this.yl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}_l(t){if(Xr(this._surveyManager))return{eligible:!1,reason:Dy};var e="string"==typeof t?this.yl(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Xr(this._surveyManager))return cu.warn("init was not called"),{visible:!1,disabledReason:Dy};var e=this._l(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Xr(this._surveyManager)?(cu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Dy})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this._l(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(Xr(this._surveyManager))cu.warn("init was not called");else{var n="string"==typeof t?this.yl(t):t;if(null!=n&&n.id)if(_u.includes(n.type)){var s=null==Ts?void 0:Ts.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(cu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;cu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),cu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);cu.warn("Survey element not found")}else cu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else cu.warn("Survey not found")}}displaySurvey(t,e){var i;if(Xr(this._surveyManager))cu.warn("init was not called");else{var n=this.yl(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==eu.Popover&&e.initialResponses&&cu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.bl(n);if(!o.eligible)return void cu.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==eu.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else cu.warn("Survey not found")}}cancelPendingSurvey(t){Xr(this._surveyManager)?cu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}},rb),hb={toolbar:class{constructor(t){this.instance=t}wl(t){Ca.ph_toolbar_state=t}xl(){var t;return null!==(t=Ca.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),Gs(this.instance.config))return!1;if(!xs||!Ts)return!1;t=null!=t?t:xs.location,r=null!=r?r:xs.history;try{if(!e){try{xs.localStorage.setItem("test","test"),xs.localStorage.removeItem("test")}catch(t){return!1}e=null==xs?void 0:xs.localStorage}var i,n=qy||to(t.hash,"__posthog")||to(t.hash,"state"),s=n?Us((()=>JSON.parse(atob(decodeURIComponent(n)))))||Us((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(jy)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}kl(t){var e=Ca.ph_load_toolbar||Ca.ph_load_editor;!Xr(e)&&Vr(e)?e(t,this.instance):By.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Ts||!Ts.getElementById(lo));if(!xs||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(xs.localStorage.setItem(jy,JSON.stringify(r({},n,{source:void 0}))),2===this.xl())this.kl(n);else if(0===this.xl()){var s;this.wl(1),null==(s=Ca.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return By.error("[Toolbar] Failed to load",t),void this.wl(0);this.wl(2),this.kl(n)})),Zs(xs,"turbolinks:load",(()=>{this.wl(0),this.loadToolbar(n)}))}return!0}Sl(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},db=r({experiments:Qy},rb),cb={conversations:class{constructor(t){this.Cl=void 0,this._conversationsManager=null,this.Ml=!1,this.Tl=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Xr(e)||(ri(e)?this.Cl=e:(this.Cl=e.enabled,this.Tl=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Cl=void 0,this.Tl=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ml||this._instance.config.disable_conversations||Gs(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Ca?void 0:Ca.__PosthogExtensions__;if(t&&!Qr(this.Cl)&&this.Cl)if(this.Tl&&this.Tl.token){this.Ml=!0;try{var e=t.initConversations;if(e)return this.El(e),void(this.Ml=!1);var r=t.loadExternalDependency;if(!r)return void this.Il(kh);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.Il("Could not load conversations script",e):this.El(t.initConversations),this.Ml=!1}))}catch(t){this.Il("Error initializing conversations",t),this.Ml=!1}}else Ky.error("Conversations enabled but missing token in remote config.")}}El(t){if(this.Tl)try{this._conversationsManager=t(this.Tl,this._instance),Ky.info("Conversations loaded successfully")}catch(t){this.Il("Error completing conversations initialization",t)}else Ky.error("Cannot complete initialization: remote config is null")}Il(t,e){Ky.error(t,e),this._conversationsManager=null,this.Ml=!1}show(){this._conversationsManager?this._conversationsManager.show():Ky.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Cl&&!Yr(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(Ky.warn(Jy),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Ky.warn(Jy),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Ky.warn(Jy),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Ky.warn(Jy),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(Ky.warn(Jy),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(Ky.warn(Jy),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ky.warn(Jy),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}Gn(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Qn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},vb={logs:class{constructor(t){var e,i=this;this.Pl=!1,this.Rl=!1,this.rt=Ds("[logs]"),this.Ll=r({},this.rt,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(eb)||i.rt.error(...e)}}),this.er=[],this.Ol=[],this.fa=0,this.Fl=()=>{var t,e;this.fa=0,null==(t=this.Al)||t.onReconnect(),null==(e=this.Dl)||e.onReconnect()},this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Pl=!0),xs&&Zs(xs,"online",this.Fl)}$l(t,e,r,i){var n,s=function(t,e){var r,i,n,s,o,a,l,u=null!==(r=null==t?void 0:t.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==t?void 0:t.maxBufferSize)&&void 0!==i?i:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Qr(d)?Math.max(h,2048):Math.max(h,d),v=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==t?void 0:t.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:v,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,r);return[new Fn(this.Nl(t,e),s,this.Ll,(()=>this.ql()),(t=>t()),void 0,i),s]}jl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Al||this.Bl!==e){var r;null==(r=this.Al)||r.reset(),this.Bl=e;var i=this.$l((()=>this.er),(t=>{this.er=t}));this.Al=i[0],this.Hl=i[1]}return this.Al}Ul(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Dl||this.zl!==e){var r;null==(r=this.Dl)||r.reset(),this.zl=e;var i=this.$l((()=>this.Ol),(t=>{this.Ol=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Yy);this.Dl=i[0],this.Wl=i[1]}return this.Dl}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var r=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!Xr(r)&&r&&(this.Pl=!0,this.loadIfEnabled())}}reset(){var t,e;this.er=[],null==(t=this.Al)||t.reset(),this.Ol=[],null==(e=this.Dl)||e.reset(),this.fa=0}captureLog(t){this.jl().captureLog(t)}he(t){this.Ul().captureLog(t)}get logger(){return this.Vl||(this.Vl={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Vl}flushLogs(t){t?this.Zl(t):(this.Al&&this.Al.flush().catch((t=>this.Gl(t))),this.Dl&&this.Dl.flush().catch((t=>this.Gl(t))))}Gl(t){eb(t)||this.rt.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Pl&&!this.Rl){var t=null==Ca?void 0:Ca.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var r;e||null==(r=t.logs)||!r.initializeLogs?this.rt.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.Rl=!0)})):this.rt.error(kh)}else this.rt.error("PostHog Extensions not found.")}}Nl(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:e=>e===kr.LogsQueue?t():void 0,setPersistedProperty(t,r){var i;t===kr.LogsQueue&&e(null!==(i=r)&&void 0!==i?i:[])},At:t=>this.At(t),getLibraryId:()=>As.LIB_NAME,getLibraryVersion:()=>As.LIB_VERSION}}At(t){return new Promise((e=>{if(eo(this.fa,3))e({kind:"fatal",error:tb(void 0,"logs endpoint is unreachable, dropping batch")});else{var r=!1,i=t=>{r||(r=!0,clearTimeout(n),e(t))},n=setTimeout((()=>{this.rt.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:tb(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Ql(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Jl(e),e>=200&&300>e)i({kind:"ok"});else if(413===e)i({kind:"too-large"});else if(0!==e&&429!==e&&500>e)i({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var r;0===e?(t.error||this.rt.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:tb(t.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("logs request failed with status "+e)})}}})}}))}Jl(t){(0!==t||this._instance.__loaded)&&(this.fa=ro(t,this.fa,3,(()=>this.rt.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Zl(t){this.er.length>0&&this.Kl(t,this.er,this.Hl,As.LIB_NAME,(t=>{this.er=t})),this.Ol.length>0&&this.Kl(t,this.Ol,this.Wl,Yy,(t=>{this.Ol=t}))}Kl(t,e,r,i,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var o=An(s,Ln(r,As.LIB_NAME,As.LIB_VERSION),i,As.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Ql(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Ql(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ql(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,n=r.sessionStartTimestamp,s=r.lastActivityTimestamp;e.sessionId=r.sessionId,e.windowId=i,Xr(n)||(e.sessionStartTimestamp=n),Xr(s)||(e.lastActivityTimestamp=s)}if(null!=Ca&&null!=(t=Ca.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?kn(Ca.location.href):Ca.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},fb={metrics:class{constructor(t){this.rt=Ds("[metrics]"),this._instance=t}initialize(){}jl(){var t,e,r=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Al&&this.Bl===r||(null==(e=this.Al)||e.reset(),this.Bl=r,this.Al=new qn(this.Nl(),function(t){var e,r,i,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(r=null==o?void 0:o["service.version"])&&void 0!==r?r:null==t?void 0:t.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(r),this.rt)),this.Al}count(t,e,r){void 0===e&&(e=1),this.jl().count(t,e,r)}gauge(t,e,r){this.jl().gauge(t,e,r)}histogram(t,e,r){this.jl().histogram(t,e,r)}flush(t){if(!this.Al)return Promise.resolve();if(t){var e=this.Al.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.Al.flush().catch((t=>this.rt.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Al)||t.reset()}Nl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:t=>e.Kt(t),getLibraryId:()=>As.LIB_NAME,getLibraryVersion:()=>As.LIB_VERSION}}Kt(t,e){return new Promise((i=>{var n=!1,s=t=>{n||(n=!0,clearTimeout(o),i(t))},o=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(r({method:"POST",url:this.Yl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)s({kind:"ok"});else if(413===e)s({kind:"too-large"});else if(0!==e&&429!==e&&500>e)s({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var r;s({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("metrics request failed with status "+e)})}}}))}))}Yl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},pb=r({},rb,ib,nb,sb,ob,ab,ub,lb,hb,db,cb,vb,fb);py.__defaultExtensionClasses=r({},pb);var gb=function(){As.SDK_DIST_CHANNEL="npm";var t=ey[uy]=new py;return function(){function t(){t.done||(t.done=!0,hy=!1,qs(ey,(function(t){t._dom_loaded()})))}null!=Ts&&Ts.addEventListener?"complete"===Ts.readyState?t():Zs(Ts,"DOMContentLoaded",t,{capture:!1}):xs&&$s.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{zl as Compression,Og as DEFAULT_PRODUCT_TOUR_APPEARANCE,eu as DisplaySurveyType,py as PostHog,Lg as ProductTourEventName,Ag as ProductTourEventProperties,Xl as SurveyEventName,tu as SurveyEventProperties,Wl as SurveyEventType,Zl as SurveyPosition,Jl as SurveyQuestionBranchingType,Kl as SurveyQuestionType,Yl as SurveySchedule,Gl as SurveyTabPosition,Ql as SurveyType,Vl as SurveyWidgetType,gb as default,gb as posthog,qg as severityLevels};
|
|
1
|
+
function t(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),l=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(l||{}),u=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(u||{}),h=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(h||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),c=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(c||{}),v=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(v||{}),f=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(f||{});function p(t,e){return-1!==t.indexOf(e)}var g={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function b(t){if(y[t])return y[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in g?g[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in m?m[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return y[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return p(t,"AppleWebKit")&&!p(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),y[t]=h):r}catch(t){return r}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var _={};function w(t,e,r){var i,n=t+"."+String(r);if(_[n])return _[n].call(e);var s=b(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(_[n]=o,o.call(e)):e[r]}var x={};function k(t,e,r){var i=t+"."+String(r);if(x[i])return x[i].bind(e);var n=b(t)[r];return"function"!=typeof n?e[r]:(x[i]=n,n.bind(e))}function S(){return b("MutationObserver").constructor}function T(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else t[e]=n.next}}catch(t){return()=>{}}}var C={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),contains:(t,e)=>k("Node",t,"contains")(e),getRootNode:t=>k("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>k("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>k("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:T},E=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,deferredStylesheetCount:0});function M(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var I=0,R=0,P=E(),O=null,L=null,A=[],F={slowestBatchMs:0},D=t=>t&&t>0?t:null,N=32;function q(t,e,r){var i=t.length;if(r>=N)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)i+=q(o,e,r+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(i+=q(l,e,r+1))}}}catch(t){}}return i}function j(t){return 0!==I&&null!==L&&(P.cssRuleCount>=L||P.cssRuleCount+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),q(e,r,0)}catch(t){return 0}}(t)>L)}function B(t){return t.nodeType===t.ELEMENT_NODE}function U(t){var e=t&&"host"in t&&"mode"in t&&C.host(t)||null;return Boolean(e&&"shadowRoot"in e&&C.shadowRoot(e)===t)}function H(t){return"[object ShadowRoot]"==={}.toString.call(t)}var z=0;function W(t){var e,r,i=0===z,n=i?M():0;z+=1;try{var s=t.rules||t.cssRules;if(!s)return null;!function(t){0!==I&&(P.cssRuleCount+=q(t,null,0))}(s);var o=t.href;return!o&&t.ownerNode&&(o=t.ownerNode.baseURI),(r=Array.from(s,(t=>V(t,o))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(t){return null}finally{z-=1,i&&(e=M()-n,I>0&&(P.stylesheetMs+=e))}}function V(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=W(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return rt(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?rt(n,e):n}class Z{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),B(t)){var r=C.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function G(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Q(n);return(r[i.toLowerCase()]||a&&r[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Q(t){return t.toLowerCase()}var K="__rrweb_original__";function J(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Q(e):null}catch(t){return null}}var Y=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,X=/^(?:[a-z+]+:)?\/\//i,tt=/^www\..*/i,et=/^(data:)([^,]*),(.*)/i;function rt(t,e){return(t||"").replace(Y,((t,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return t;if(X.test(l)||tt.test(l))return"url("+u+l+u+")";if(et.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+u+h.join("/")+u+")"}))}var it,nt,st="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",ot=4096,at=1e5,lt=10,ut=new Map,ht=1,dt=new RegExp("[^a-z0-9-_:]"),ct=-2;function vt(){return ht++}var ft=/^[^ \t\n\r\u000c]+/,pt=/^[, \t\n\r\u000c]+/,gt=new WeakMap;function mt(t,e){return e&&""!==e.trim()?yt(t,e):e}function yt(t,e){var r=gt.get(t);if(r||(r=t.createElement("a"),gt.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function bt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?st:t}(t,e.maxBase64ImageLength):t}function _t(t,e,r,i,n,s){var o;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a=null==(o=n.sheet)?void 0:o.href;if(a)return a}var l=mt(t,i);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,r,i){if(at>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>ot||t.naturalHeight>ot)return e;var n=ut.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(r||"image/webp",null!=i?i:.4),l=e.length>a.length?a:e;if(ut.size>=lt){var u=ut.keys().next().value;void 0!==u&&ut.delete(u)}return ut.set(e,{type:r,quality:i,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),bt(u,s)}if("image"===e)return bt(l,s)}return l}if("xlink:href"===r&&"#"!==i[0]){var h=mt(t,i);return"image"===e&&h.startsWith("data:")?bt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(pt),e.length>r;){var s=i(ft);if(","===s.slice(-1))s=mt(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=mt(t,s);for(var a=!1;;){var l=e.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(t,i):"style"===r?rt(i,yt(t)):"object"===e&&"data"===r?mt(t,i):i:mt(t,i)}function wt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function xt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&xt(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&xt(C.parentNode(t),e,r)}function kt(t,e,r,i){var n;if(B(t)){if(!C.childNodes(n=t).length)return!1}else{if(null===C.parentElement(t))return!1;n=C.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(xt(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function St(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var Tt=new Map;function Ct(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Et(t){return null==t?"":t.toLowerCase()}var Mt=50,It=!1,Rt=!1;function Pt(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,v=void 0===c?{}:c,p=e.maskTextFn,g=e.maskInputFn,m=e.slimDOMOptions,y=e.dataURLOptions,b=void 0===y?{}:y,_=e.inlineImages,w=void 0!==_&&_,x=e.recordCanvas,k=void 0!==x&&x,S=e.canvasMaskingConfigured,T=e.onSerialize,E=e.onIframeLoad,M=e.iframeLoadTimeout,R=void 0===M?5e3:M,O=e.onIframeListenerRegistered,L=e.onStylesheetLoad,F=e.stylesheetLoadTimeout,D=void 0===F?5e3:F,N=e.keepIframeSrcFn,q=void 0===N?()=>!1:N,z=e.newlyAddedElement,V=void 0!==z&&z,Z=e.depth,Y=void 0===Z?0:Z,X=e.maxDepth,tt=void 0===X?Mt:X,et=e.needsMask,st=e.preserveWhiteSpace,ot=void 0===st||st;if(Y>=tt)return Rt=!0,It||(It=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+tt+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;et||(et=kt(t,o,a,void 0===et)),I>0&&(P.nodeCount+=1);var at,lt=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,u=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s,o=e.doc,a=e.inlineStylesheet,l=e.maskInputOptions,u=void 0===l?{}:l,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),x=function(t){if(t instanceof HTMLFormElement)return"form";var e=Q(t.tagName);return dt.test(e)?"div":e}(t),k={},S=t.attributes.length,T=0;S>T;T++){var E=t.attributes[T];wt(x,E.name)||(k[E.name]=_t(o,x,Q(E.name),E.value,t,c))}if("link"===x&&a&&!w){var M=t.sheet;if(!M){var R=function(t){return t.href}(t);R&&!(M=Ct(o,R))&&R.includes(".css")&&(M=Ct(o,window.location.origin+"/"+R.replace(window.location.href,"")))}var P=null;M&&(j(M)?I>0&&A.push(t):P=W(M)),P&&(delete k.rel,delete k.href,k._cssText=P)}var O;if("style"===x&&t.sheet&&!(t.innerText||C.textContent(t)||"").trim().length){var L=W(t.sheet);L&&(k._cssText=L)}if("input"===x||"textarea"===x||"select"===x){var F=t.value,D=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&F?k.value=G({element:t,type:J(t),tagName:x,value:F,maskInputOptions:u,maskInputFn:h}):D&&(k.checked=D)}if("option"===x&&(t.selected&&!u.select?k.selected=!0:delete k.selected),"dialog"===x&&t.open)try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}if("canvas"===x&&p&&!(null==g?void 0:g()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((K in n?n[K]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var N=t.toDataURL(c.type,c.quality),q=o.createElement("canvas");q.width=t.width,q.height=t.height,N!==q.toDataURL(c.type,c.quality)&&(k.rr_dataURL=N)}if("img"===x&&v){it||(it=o.createElement("canvas"),nt=it.getContext("2d"));var B=t,U=B.currentSrc||B.getAttribute("src")||"<unknown-src>",H=B.crossOrigin,z=()=>{St(B,"load",z);try{it.width=B.naturalWidth,it.height=B.naturalHeight,nt.drawImage(B,0,0),k.rr_dataURL=it.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===B.crossOrigin&&(H?k.crossOrigin=H:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z)}if("audio"===x||"video"===x){var V=k;V.rr_mediaState=t.paused?"paused":"played",V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),w){var Z=t.getBoundingClientRect(),Y=Z.width,X=Z.height,tt=Z.left,et=Z.top,rt=null==(r=o.defaultView)?void 0:r.getComputedStyle(t);k={class:k.class,rr_width:Y+"px",rr_height:X+"px",rr_left:Math.floor(tt+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(et+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},rt&&(k.rr_position=rt.position||"static",rt.transform&&"none"!==rt.transform&&(k.rr_transform=rt.transform),rt.display&&rt.display.startsWith("inline")&&(k.rr_display=rt.display))}"iframe"!==x||m(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src);try{customElements.get(x)&&(s=!0)}catch(t){}return{type:f.Element,tagName:x,attributes:k,childNodes:[],isSVG:(O=t,Boolean("svg"===O.tagName||O.ownerSVGElement)||void 0),needBlock:w,rootId:_,isCustom:s}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,dataURLOptions:c,inlineImages:v,recordCanvas:p,canvasMaskingConfigured:g,keepIframeSrcFn:m,newlyAddedElement:b,rootId:_});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,o=C.parentNode(t),a=o&&o.tagName,l=C.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(j(o.sheet));else if(null==(r=o.sheet)?void 0:r.cssRules){var d=W(o.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=rt(l,yt(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&i&&(l=n?n(l,C.parentElement(t)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:u,rootId:_});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,keepIframeSrcFn:q,newlyAddedElement:V});if(!lt)return console.warn(t,"not serialized"),null;at=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Et(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Et(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Et(t.attributes.property).match(/^(og|twitter|fb):/)||Et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Et(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Et(t.attributes.name))||Et(t.attributes.property).match(/^article:/)||Et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Et(t.attributes.name)))return!0}}return!1}(lt,m)||!ot&<.type===f.Text&&!lt.isStyle&&!lt.textContent.replace(/^\s+|\s+$/gm,"").length?ct:vt();var ut=Object.assign(lt,{id:at});if(i.add(t,ut),at===ct)return null;T&&T(t);var ht=!u;if(ut.type===f.Element){ht=ht&&!ut.needBlock,delete ut.needBlock;var ft=C.shadowRoot(t);ft&&H(ft)&&(ut.isShadowHost=!0)}if((ut.type===f.Document||ut.type===f.Element)&&ht){m.headWhitespace&&ut.type===f.Element&&"head"===ut.tagName&&(ot=!1);var pt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:ot,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:O,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y+1,maxDepth:tt};if(ut.type===f.Element&&"textarea"===ut.tagName&&void 0!==ut.attributes.value);else for(var gt of Array.from(C.childNodes(t))){var mt=Pt(gt,pt);mt&&ut.childNodes.push(mt)}var bt=null;if(B(t)&&(bt=C.shadowRoot(t)))for(var xt of Array.from(C.childNodes(bt))){var Ot=Pt(xt,pt);Ot&&(H(bt)&&(Ot.isShadow=!0),ut.childNodes.push(Ot))}}var Lt=C.parentNode(t);if(Lt&&U(Lt)&&H(Lt)&&(ut.isShadow=!0),ut.type===f.Element&&"iframe"===ut.tagName){var At=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),St(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,r),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?St(t,"load",o):(a=!0,St(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),St(t,"load",o)}}return t.addEventListener("load",o),()=>{St(t,"load",o)}}(t,(()=>{var e=t.contentDocument;if(e&&E){var r=Pt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:ot,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:R,onIframeListenerRegistered:O,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y+1,maxDepth:tt});r&&E(t,r)}}),R);null==O||O(t,At)}return ut.type===f.Element&&"link"===ut.tagName&&"stylesheet"===ut.attributes.rel&&function(e,l,u){if(!Tt.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(L){var e=Pt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:v,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:ot,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:R,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y,maxDepth:tt});e&&L(t,e)}})()}finally{Tt.delete(e),c.abort()}}},_=setTimeout(y,u);c.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",y,{signal:c.signal,once:!0}),Tt.set(e,c)}}}(t,0,D),ut}function Ot(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Lt{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Lt))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function At(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Ft(r,t,e,i)}function Ft(t,e,r,i){$t((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function $t(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Dt="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",Nt={map:{},getId(){return console.error(Dt),-1},getNode(){return console.error(Dt),null},removeNodeFromMap(){console.error(Dt)},has(){return console.error(Dt),!1},reset(){console.error(Dt)}};function qt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(i&&(clearTimeout(i),i=null),n=l,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),u))}}function jt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>jt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Nt=new Proxy(Nt,{get(t,e,r){return"map"===e&&console.error(Dt),Reflect.get(t,e,r)}}));var Bt=Date.now;function Ut(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=C.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=C.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ht(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Wt(t){return t?t.nodeType===t.ELEMENT_NODE?t:C.parentElement(t):null}function Vt(t,e,r,i){if(!t)return!1;var n=Wt(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(xt(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Zt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===ct}function Gt(t,e){if(U(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=C.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Gt(i,e))}function Qt(t){return Boolean(t.changedTouches)}function Kt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Jt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Yt(t){return!!t&&(t instanceof Lt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(C.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Bt=()=>(new Date).getTime());class Xt{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function te(t){var e,r=null;return"getRootNode"in t&&(null==(e=C.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(t))&&(r=C.host(C.getRootNode(t))),r}function ee(t){var e=t.ownerDocument;return!!e&&(C.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=te(r);)r=e;return r}(t);return C.contains(e,r)}(t))}function re(t){return"__ln"in t}class ie{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&re(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&re(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var ne,se=(t,e)=>t+"@"+e;class oe{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"canvasMaskingConfigured"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e=M();try{this.processBufferedMutations()}finally{(t=M()-e)>F.slowestBatchMs&&(F.slowestBatchMs=t)}}})),a(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new ie,i=t=>{for(var e=t,r=ct;r===ct;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=C.parentNode(n);if(s&&ee(n)&&"TEXTAREA"!==s.tagName){var o=U(s)?this.mirror.getId(te(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=Pt(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Kt(t,this.mirror)&&this.iframeManager.addIframe(t),Jt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Yt(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)le(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)ue(this.droppedSet,o)||le(this.removesSubTreeCache,o)?ue(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(C.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){l=c;break}var f=C.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){l=c;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=C.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(C.childNodes(t),(t=>C.textContent(t)||"")).join("");e.attributes.value=G({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:J(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Zt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=C.textContent(t.target);Vt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:kt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Wt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=J(r);n=G({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Vt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!wt(r.tagName,i))if(o.attributes[i]=_t(this.doc,Q(r.tagName),Q(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&(a.style.cssText=t.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Vt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=U(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);Vt(t.target,this.blockClass,this.blockSelector,!1)||Zt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ae(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Gt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[se(r,i)]?ae(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!U(t.target)||!H(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),C.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Zt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[se(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Vt(t,this.blockClass,this.blockSelector,!1)||(C.childNodes(t).forEach((t=>this.genAdds(t))),Yt(t)&&C.childNodes(C.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function ae(t,e){t.delete(e),C.childNodes(e).forEach((e=>ae(t,e)))}function le(t,e,r){return 0!==t.size&&function(t,e,r){var i=C.parentNode(e);return!!i&&t.has(i)}(t,e)}function ue(t,e){return 0!==t.size&&he(t,e)}function he(t,e){var r=C.parentNode(e);return!!r&&(!!t.has(r)||he(t,r))}var de=t=>ne?function(){try{return t(...arguments)}catch(t){if(ne&&!0===ne(t))return;throw t}}:t,ce=[];function ve(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function fe(t,e){var r=new oe;ce.push(r),r.init(t);var i=new(S())(de(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),{observer:i,buffer:r}}function pe(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=ve(t);if(o&&!Vt(o,n,s,!0)){var l,u,h=i.getId(o);if(o===r&&r.defaultView){var d=Ut(r.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var c=l+","+u;a.get(h)!==c&&(a.set(h,c),e({id:h,x:l,y:u}))}},u=[At("scroll",de(qt(de((t=>l(t))),o.scroll||100)),r)];return"onscrollend"in r&&u.push(At("scrollend",de(l),r)),()=>u.forEach((t=>t()))}function ge(t,e){for(var r=ce.length-1;r>=0;r--){var i=ce[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),ce.splice(r,1))}}}var me=["INPUT","TEXTAREA","SELECT"],ye=new WeakMap;function be(t){return function t(e,r){if(ke("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ke("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ke("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ke("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function _e(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function we(t,e){var r,i,n,s,o=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:C.host(e));var a="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r;try{r=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return r}}),de((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function xe(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,o=t.viewportResizeCb,a=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM){var o=fe(t,t.doc);i=o.observer,n=o.buffer}var a,l,c,f,p,g,m,y,b,_=function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=qt(de((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),a),d=de(qt(de((t=>{var e=ve(t),r=Qt(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;s||(s=Bt()),l.push({x:i,y:o,id:n.getId(e),timeOffset:Bt()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),o,{trailing:!1})),c=[At("mousemove",d,i),At("touchmove",d,i),At("drag",d,i)];return de((()=>{c.forEach((t=>t()))}))}(t),w=function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(h).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=Q(t),l=(t=>i=>{var a=ve(i);if(!Vt(a,s,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[t]===h.MouseDown?u="TouchStart":h[t]===h.MouseUp&&(u="TouchEnd"))}else Qt(i)&&(l=d.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[t]===h.Click&&(l=c,c=null);var v=Qt(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),p=v.clientX,g=v.clientY;de(e)(r({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(At(a,l,i))})),de((()=>{u.forEach((t=>t()))}))}(t),x=pe(t),k=function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return At("resize",de(qt(de((()=>{var t=Ht(),e=zt();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),S=function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=ve(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=C.parentElement(e)),e&&c&&me.indexOf(c)>=0&&!Vt(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=J(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[c.toLowerCase()]||u[g])&&(f=G({element:e,maskInputOptions:u,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=ye.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ye.set(t,i);var o=n.getId(t);de(e)(r({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>At(t,de(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>jt(t[0],t[1],{set(){de(c)({target:this,isTrusted:!1})}},!1,p)))),de((()=>{f.forEach((t=>t()))}))}(t),E=(l=(a=t).mediaInteractionCb,c=a.blockClass,f=a.blockSelector,p=a.mirror,g=a.sampling,m=a.doc,y=de((t=>qt(de((e=>{var r=ve(e);if(r&&!Vt(r,c,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,o=r.playbackRate,a=r.loop;l({type:t,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:o,loop:a})}})),g.media||500))),b=[At("play",y(v.Play),m),At("pause",y(v.Pause),m),At("seeked",y(v.Seeked),m),At("volumechange",y(v.VolumeChange),m),At("ratechange",y(v.RateChange),m)],de((()=>{b.forEach((t=>t()))}))),M=()=>{},I=()=>{},R=()=>{},P=()=>{};t.recordDOM&&(M=function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:de(((t,e,s)=>{var o=s[0],a=s[1],l=_e(e,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:de(((t,e,s)=>{var o=s[0],a=_e(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:de(((t,e,s)=>{var o=s[0],a=_e(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:de(((t,e,s)=>{var o=s[0],a=_e(e,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};Se("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(Se("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),Se("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),Se("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:de(((t,e,s)=>{var o=s[0],a=s[1],l=_e(e.parentStyleSheet,i,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&r({id:u,styleId:h,adds:[{rule:o,index:[...be(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:de(((t,e,s)=>{var o=s[0],a=_e(e.parentStyleSheet,i,n.styleMirror),l=a.id,u=a.styleId;return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,removes:[{index:[...be(e),o]}]}),t.apply(e,s)}))})})),de((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),I=we(t,t.doc),R=function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:de(((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2];if(n.has(u))return a.apply(e,[u,h,d]);var c=_e(null==(l=e.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror),v=c.id,f=c.styleId;return(v&&-1!==v||f&&-1!==f)&&r({id:v,styleId:f,set:{property:u,value:h,priority:d},index:be(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:de(((t,e,o)=>{var a,u=o[0];if(n.has(u))return l.apply(e,[u]);var h=_e(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror),d=h.id,c=h.styleId;return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:u},index:be(e.parentRule)}),t.apply(e,o)}))}),de((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:s}),t.collectFonts&&(P=function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=T(r.fonts,"add",(function(t){return function(r){return setTimeout(de((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),de((()=>{n.forEach((t=>t()))}))}(t)));var O=function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=de((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;Vt(d,i,n,!0)||Vt(v,i,n,!0)||a.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),At("selectionchange",a)}(t),L=function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?T(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t),A=[];for(var F of t.plugins)A.push(F.observer(F.callback,s,F.options));return de((()=>{if(n){n.destroy(),n.reset();var e=ce.indexOf(n);-1!==e&&ce.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),_(),w(),x(),k(),S(),E(),M(),I(),R(),P(),O(),L(),A.forEach((t=>t()))}))}function ke(t){return void 0!==window[t]}function Se(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Te{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class Ce{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new Te(vt)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Te(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>$t(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Ft(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);$t((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}$t((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return e;case l.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case l.IncrementalSnapshot:switch(e.data.source){case u.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Ft(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Ft(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{$t((()=>this.mirror.removeNodeFromMap(t)))})),$t((()=>ge(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Ft(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Ft(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class Ee{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,n;if(H(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null==(n=C.host(t))?void 0:n.ownerDocument)&&void 0!==i?i:e,o=fe(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:s,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=ce.indexOf(l);-1!==t&&ce.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:pe(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(C.host(t))),this.restoreHandlers.push({doc:s,handler:we({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:T(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=C.shadowRoot(this);return s&&ee(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}var Me="skip-frame";function Ie(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oe=0;64>Oe;Oe++)Pe[Re.charCodeAt(Oe)]=Oe;var Le=new Map,Ae=(t,e,r)=>{if(t&&(De(t,e)||"object"==typeof t)){var i=function(t,e){var r=Le.get(t);return r||Le.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Fe(t,e,r,i){if(t instanceof Array)return t.map((t=>Fe(t,e,r,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Re[r[e]>>2],n+=Re[(3&r[e])<<4|r[e+1]>>4],n+=Re[(15&r[e+1])<<2|r[e+2]>>6],n+=Re[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Fe(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Fe(t.data,e,r,i),t.width,t.height]}:De(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ae(t,e,r)}:t}var $e=(t,e,r,i)=>t.map((t=>Fe(t,e,r,i))),De=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},Ne=["webgl","webgl2"];function qe(t){return"nodeType"in t}function je(t,e,i,n){var s=[];try{if(n){var o=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return T(n.prototype,"configure",(function(n){return function(s){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||qe(o)&&Vt(o,e,i,!0))return n.call(this,s);qe(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(t,e,i);o&&s.push(o)}var a=T(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Vt(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&Ne.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...a])}}));s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function Be(t,e,r,i,n,s,o){var a=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=T(t,l,(function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Ae(d,s,this),"tagName"in this.canvas&&!Vt(this.canvas,i,n,!0)){var c=$e(u,s,this,o);r(this.canvas,{type:e,property:l,args:c})}return d}}));a.push(u)}catch(i){var h=jt(t,l,{set(t){r(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var Ue,He,ze,We='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',Ve="undefined"!=typeof self&&self.Blob&&new Blob([We],{type:"text/javascript;charset=utf-8"});function Ze(t){var e;try{if(!(e=Ve&&(self.URL||self.webkitURL).createObjectURL(Ve)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(We),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ge{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"resetFrameDedup",null),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,l=t.dataURLOptions,u=t.resolutionScale,h=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,s,l),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:l,resolutionScale:u,canvasMasking:h})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,u=je(r,i,n,!0),h=new Map;try{a=new Ze}catch(t){return}var d=!1;a.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null},this.resetFrameDedup=()=>{a.postMessage({resetFrameDedup:!0})},a.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:c["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,g=t=>{var u,c;d||(p&&f>t-p||(p=t,(u=[],c=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Vt(t,i,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&c(t.shadowRoot)}))}catch(t){}},c(r.document),u).forEach(function(){var t=e((function*(t){var e,r,i=o.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.call(n))return void h.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(u*l)),v=Math.max(1,Math.round(d*l)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return Me}if(void 0!==o){if(!Array.isArray(o)||!o.every(Ie))return Me;var a=r/n,l=i/s;return o.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*a),r=Math.floor(t.y*l);return{x:e,y:r,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-r}}))}}}(s.canvasMasking,t,c,v,u,d);if(f===Me)return void h.set(i,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});a.postMessage({id:i,bitmap:p,width:c,height:v,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null==(t=a.terminate)||t.call(a),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=je(t,e,r,!1),s=function(t,e,r,i,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=T(e.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Vt(this.canvas,r,i,!0)||setTimeout((()=>{var r=$e(l,e,this,n);t(this.canvas,{type:c["2D"],property:o,args:r})}),0),s.apply(this,l)}}));s.push(a)}catch(r){var l=jt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:c["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)a(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Be(e.WebGLRenderingContext.prototype,c.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Be(e.WebGL2RenderingContext.prototype,c.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s)));this.mutationCb({id:e,type:r[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Qe{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Xt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}inlineDeferredLinkElement(t,e){if(-1!==e&&t.isConnected){var r=null;try{var i=t.sheet;i&&(r=W(i))}catch(t){}r&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:r}}]})}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:V(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,Tt.forEach((t=>t.abort())),Tt.clear()}trackStylesheetInLinkElement(t){}}class Ke{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Je=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ye=document.createElement("iframe");document.body.appendChild(Ye),Array.from=(null==(n=Ye.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ye)}}catch(t){console.debug("Unable to override Array.from",t)}var Xe=new Z,tr=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function er(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function rr(t){var e;void 0===t&&(t={});var i=t,n=i.emit,s=i.checkoutEveryNms,o=i.checkoutEveryNth,a=i.blockClass,h=void 0===a?"rr-block":a,d=i.blockSelector,c=void 0===d?null:d,v=i.ignoreClass,f=void 0===v?"rr-ignore":v,p=i.ignoreSelector,g=void 0===p?null:p,m=i.maskTextClass,y=void 0===m?"rr-mask":m,b=i.maskTextSelector,_=void 0===b?null:b,w=i.inlineStylesheet,x=void 0===w||w,k=i.inlineStylesheetBudgetRules,S=void 0===k?1e4:k,T=i.maskAllInputs,F=i.maskInputOptions,N=i.slimDOMOptions,q=i.maskInputFn,j=i.maskTextFn,B=i.hooks,U=i.packFn,H=i.sampling,z=void 0===H?{}:H,W=i.dataURLOptions,V=void 0===W?{}:W,G=i.canvasResolutionScale,Q=i.canvasMasking,K=i.mousemoveWait,J=i.recordDOM,Y=void 0===J||J,X=i.recordCanvas,tt=void 0!==X&&X,et=i.recordCrossOriginIframes,rt=void 0!==et&&et,it=i.recordAfter,nt=void 0===it?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":it,st=i.userTriggeredOnInput,ot=void 0!==st&&st,at=i.collectFonts,lt=void 0!==at&&at,ut=i.inlineImages,ht=void 0!==ut&&ut,dt=i.plugins,ct=i.keepIframeSrcFn,vt=void 0===ct?()=>!1:ct,ft=i.ignoreCSSAttributes,pt=void 0===ft?new Set([]):ft,gt=i.attributeFilter;ne=i.errorHandler;var mt=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},V),yt=!rt||window.parent===window,bt=!1;if(!yt)try{window.parent.document&&(bt=!1)}catch(t){bt=!0}if(yt&&!n)throw new Error("emit function is required");if(!yt&&!bt)return()=>{};void 0!==K&&void 0===z.mousemove&&(z.mousemove=K),Xe.reset();var _t,wt=!0===T?{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!==F?F:{password:!0},xt=Ot(void 0!==N&&N);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var kt,St,Tt=0,Ct=new Map,Et=t=>{for(var e of dt||[])e.eventProcessor&&(t=e.eventProcessor(t));return U&&!bt&&(t=U(t)),t};Ue=(t,e)=>{var r,i=t;if(i.timestamp=Bt(),!(null==(r=ce[0])?void 0:r.isFrozen())||i.type===l.FullSnapshot||i.type===l.IncrementalSnapshot&&tr.has(i.data.source)||ce.forEach((t=>t.unfreeze())),yt)null==n||n(Et(i),e);else if(bt){var a={type:"rrweb",event:Et(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(i.type===l.FullSnapshot)_t=i,Tt=0;else if(i.type===l.IncrementalSnapshot){if(i.data.source===u.Mutation&&i.data.isAttachIframe)return;Tt++,(o&&Tt>=o||s&&i.timestamp-_t.timestamp>s)&&He(!0)}};var Mt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Xe.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=Ft.getIframeElementById(r);n&&i.has(n)?Ft.forgetIframeId(r):(null==kt||kt(r),Ft.removeIframeById(r))}})),null==St||St(),Ft.cleanupDetachedIframes()}Ue({type:l.IncrementalSnapshot,data:r({source:u.Mutation},t)})},It=t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.Scroll},t)}),Rt=t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),Lt=new Qe({mutationCb:Mt,adoptedStyleSheetCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Ft=new Ce({mirror:Xe,mutationCb:Mt,stylesheetManager:Lt,recordCrossOriginIframes:rt,wrappedEmit:Ue});for(var Dt of dt||[])Dt.getMirror&&Dt.getMirror({nodeMirror:Xe,crossOriginIframeMirror:Ft.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ft.crossOriginIframeStyleMirror});var Nt=new Ke,qt=null==Q?void 0:Q.configured;ze=new Ge({recordCanvas:tt,mutationCb:Rt,win:window,blockClass:h,blockSelector:c,mirror:Xe,sampling:z.canvas,dataURLOptions:mt,resolutionScale:G,canvasMasking:Q});var jt=new Ee({mutationCb:Mt,scrollCb:It,bypassOptions:{blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:_,inlineStylesheet:x,maskInputOptions:wt,dataURLOptions:mt,maskTextFn:j,maskInputFn:q,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,sampling:z,slimDOMOptions:xt,iframeManager:Ft,stylesheetManager:Lt,canvasManager:ze,keepIframeSrcFn:vt,processedNodeManager:Nt,attributeFilter:gt},mirror:Xe});He=function(t){if(void 0===t&&(t=!1),Y){Ue({type:l.Meta,data:{href:window.location.href,width:zt(),height:Ht()}},t),null==e||e(),e=void 0,Lt.reset(),jt.init(),ce.forEach((t=>t.lock()));var r,i,n=null;try{n=function(t,e){var r,i=e||{},n=i.mirror,s=void 0===n?new Z:n,o=i.blockClass,a=void 0===o?"rr-block":o,l=i.blockSelector,u=void 0===l?null:l,h=i.maskTextClass,d=void 0===h?"rr-mask":h,c=i.maskTextSelector,v=void 0===c?null:c,f=i.inlineStylesheet,p=void 0===f||f,g=i.inlineImages,m=void 0!==g&&g,y=i.recordCanvas,b=void 0!==y&&y,_=i.canvasMaskingConfigured,w=i.maskAllInputs,x=void 0!==w&&w,k=i.maskTextFn,S=i.maskInputFn,T=i.slimDOM,C=i.dataURLOptions,F=i.preserveWhiteSpace,N=i.onSerialize,q=i.onIframeLoad,j=i.iframeLoadTimeout,B=i.onIframeListenerRegistered,U=i.onStylesheetLoad,H=i.stylesheetLoadTimeout,z=i.keepIframeSrcFn,W=void 0===z?()=>!1:z,V=i.maxDepth,G=i.inlineStylesheetBudgetRules,Q=!0===x?{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===x?{password:!0}:x,K=Ot(void 0!==T&&T);r=G,(I+=1)>1||(P=E(),A=[],L=D(r),R=M());try{return Pt(t,{doc:t,mirror:s,blockClass:a,blockSelector:u,maskTextClass:d,maskTextSelector:v,skipChild:!1,inlineStylesheet:p,maskInputOptions:Q,maskTextFn:k,maskInputFn:S,slimDOMOptions:K,dataURLOptions:C,inlineImages:m,recordCanvas:b,canvasMaskingConfigured:_,preserveWhiteSpace:F,onSerialize:N,onIframeLoad:q,iframeLoadTimeout:j,onIframeListenerRegistered:B,onStylesheetLoad:U,stylesheetLoadTimeout:H,keepIframeSrcFn:W,newlyAddedElement:!1,maxDepth:V})}finally{0===I?O||E():(I-=1)>0||(P.durationMs=M()-R,P.deferredStylesheetCount=A.length,L=null,O=P)}}(document,{mirror:Xe,blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:_,inlineStylesheet:x,maskAllInputs:wt,inlineStylesheetBudgetRules:S,maskTextFn:j,maskInputFn:q,slimDOM:xt,dataURLOptions:mt,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,onSerialize(t){Kt(t,Xe)&&Ft.addIframe(t),Jt(t,Xe)&&Lt.trackLinkElement(t),Yt(t)&&jt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){Ft.attachIframe(t,e),jt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Ft.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Lt.attachLinkElement(t,e)},keepIframeSrcFn:vt})}finally{r=A,A=[],i=r}if(!n)return console.warn("Failed to snapshot the document");Ue({type:l.FullSnapshot,data:{node:n,initialOffset:Ut(window)}},t),ce.forEach((t=>t.unlock())),ze.onFullSnapshot(),i.length&&(e=function(t,r,i){var n=!1,s=null,o=0,a=i=>{if(s=null,!n){var l=function(){var e=t[o];t[o]=null,o+=1,e&&$t((()=>r.inlineDeferredLinkElement(e,Xe.getId(e))))};do{l()}while(t.length>o&&i&&!i.didTimeout&&i.timeRemaining()>5);t.length>o?s=er(a):e=void 0}};return s=er(a),()=>{n=!0,null==s||s.cancel(),s=null}}(i,Lt)),rt&&Ft.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Lt.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))}};try{var Wt=[];kt=t=>{var e=Ct.get(t);e&&(e.forEach((t=>{$t(t);var e=Wt.indexOf(t);-1!==e&&Wt.splice(e,1)})),Ct.delete(t))},St=()=>{for(var t of Ct){var e=t[0],r=Xe.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==kt||kt(e)}catch(t){null==kt||kt(e)}else null==kt||kt(e)}};var Vt=t=>{var e;return de(xe)({mutationCb:Mt,mousemoveCb:(t,e)=>Ue({type:l.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:It,viewportResizeCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:Rt,fontCb:t=>Ue({type:l.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){Ue({type:l.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){Ue({type:l.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:g,maskTextClass:y,maskTextSelector:_,maskInputOptions:wt,inlineStylesheet:x,sampling:z,recordDOM:Y,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,userTriggeredOnInput:ot,collectFonts:lt,doc:t,maskInputFn:q,maskTextFn:j,keepIframeSrcFn:vt,blockSelector:c,slimDOMOptions:xt,dataURLOptions:mt,mirror:Xe,iframeManager:Ft,stylesheetManager:Lt,shadowDomManager:jt,processedNodeManager:Nt,canvasManager:ze,ignoreCSSAttributes:pt,attributeFilter:gt,plugins:(null==(e=null==dt?void 0:dt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>Ue({type:l.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},B)};Ft.addLoadListener((t=>{try{var e=Xe.getId(t),r=Vt(t.contentDocument);if(Wt.push(r),-1!==e){var i=Ct.get(e);i||Ct.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),Ft.addPageHideListener((t=>{var e=Xe.getId(t);null==kt||kt(e),ge(t)}));var Zt=-1,Gt=t=>Ue({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Qt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,o=s?Xe.getId(s):-1;o!==Zt&&(-1!==Zt&&Gt({id:Zt,enter:!1}),Zt=o,-1!==o&&Gt({id:o,enter:!0}))},Xt=()=>{He(),Wt.push(Vt(document)),Wt.push(At("fullscreenchange",Qt)),Wt.push(At("webkitfullscreenchange",Qt)),Wt.push(At("mozfullscreenchange",Qt)),Wt.push(At("MSFullscreenChange",Qt)),Je=!0};return["interactive","complete"].includes(document.readyState)?Xt():(Wt.push(At("DOMContentLoaded",(()=>{Ue({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===nt&&Xt()}))),Wt.push(At("load",(()=>{Ue({type:l.Load,data:{}}),"load"===nt&&Xt()}),window))),()=>{null==e||e(),e=void 0,Wt.forEach((t=>$t(t))),Nt.destroy(),Ft.removeLoadListener(),Ft.destroy(),Ct.clear(),jt.reset(),Xe.reset(),Je=!1,ne=void 0}}catch(t){console.warn(t)}}rr.addCustomEvent=(t,e)=>{if(!Je)throw new Error("please add custom event after start recording");Ue({type:l.Custom,data:{tag:t,payload:e}})},rr.freezePage=()=>{ce.forEach((t=>t.freeze()))},rr.takeFullSnapshot=t=>{if(!Je)throw new Error("please take full snapshot after start recording");He(t)},rr.mirror=Xe;var ir=Object.defineProperty,nr=(t,e,r)=>((t,e,r)=>e in t?ir(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class sr{constructor(t){nr(this,"fileName"),nr(this,"functionName"),nr(this,"lineNumber"),nr(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var or=/(^|@)\S+:\d+/,ar=/^\s*at .*(\S+:\d+|\(native\))/m,lr=/^(eval@)?(\[native code])?$/,ur={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(ar)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(ar)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new sr({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(lr)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new sr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new sr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new sr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new sr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(or)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new sr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function hr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function dr(t){return Array.isArray(t)}function cr(t){return"object"==typeof t&&null!==t&&!dr(t)}function vr(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(cr(t[i])&&vr(t[i],e-1))return!0;return!1}function fr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(cr(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||cr(o)&&vr(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=dr(u)?hr(u.length?u[0]:null):u}return a}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var pr={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 gr(t,e,r){var i,n=r?Object.assign({},pr,r):pr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var r=e.message,i=ur.parse(e.error).map((t=>t.toString())),s=[fr(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var r,i;e.reason instanceof Error?i=[fr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[fr("Uncaught (in promise)",n.stringifyOptions),fr(e.reason,n.stringifyOptions)]);var s=ur.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(c(i,d));return()=>{l.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=ur.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((t=>fr(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[fr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var mr=t=>({name:"rrweb/console@1",observer:gr,options:t}),yr=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function br(t){return"string"==typeof t||t}function _r(t){return"string"==typeof t?t:void 0}var wr,xr=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],kr=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),Sr=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Tr="min_length",Cr="max_length",Er=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],Mr=["token"],Ir="NativeGzipValidationError",Rr=t=>t.length>=2&&31===t[0]&&139===t[1],Pr=(t,e)=>t===Sr.GZipJS||e===Sr.GZipJS||"gzip"===e,Or=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Lr=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Ir,e},Ar=function(){var t=e((function*(t,e){18>t.size&&Lr("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());Rr(r)&&8===r[2]||Lr("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(wr)return wr;wr=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;wr[t]=e>>>0}return wr})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Lr("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&Lr("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function Fr(){return Fr=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var t=e((function*(t){try{yield o.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,a]))[0];return yield Ar(u,n),u}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),Fr.apply(this,arguments)}var $r=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Dr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return $r.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function Nr(t,e){return-1!==t.indexOf(e)}var qr=function(t){return t.trim()},jr=function(t){return t.replace(/^\$/,"")};function Br(t){var e,r=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(e))return"[Circular]";r.push(e)}return e}})))&&void 0!==e?e:"null"}var Ur=Object.prototype,Hr=Ur.hasOwnProperty,zr=Ur.toString,Wr=Array.isArray||function(t){return"[object Array]"===zr.call(t)},Vr=t=>"function"==typeof t,Zr=t=>t===Object(t)&&!Wr(t),Gr=t=>{if(Zr(t)){for(var e in t)if(Hr.call(t,e))return!1;return!0}return!1},Qr=t=>void 0===t,Kr=t=>"[object String]"==zr.call(t),Jr=t=>Kr(t)&&0===t.trim().length,Yr=t=>null===t,Xr=t=>Qr(t)||Yr(t),ti=t=>"[object Number]"==zr.call(t)&&t==t,ei=t=>ti(t)&&t>0,ri=t=>"[object Boolean]"===zr.call(t),ii=t=>t instanceof FormData,ni=t=>Nr(Er,t),si=t=>Nr(Mr,t);function oi(t){return null===t||"object"!=typeof t}function ai(t,e){return{}.toString.call(t)==="[object "+e+"]"}function li(t){return"undefined"!=typeof Event&&ui(t,Event)}function ui(t,e){try{return t instanceof e}catch(t){return!1}}var hi=[!0,"true",1,"1","yes"],di=t=>Nr(hi,t),ci=[!1,"false",0,"0","no"];function vi(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),ti(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),vi(n||r,e,r,i))}class fi{constructor(t){this.tt={},this.et=t.et,this.it=vi(t.bucketSize,0,100,t.rt),this.nt=vi(t.refillRate,0,this.it,t.rt),this.st=vi(t.refillInterval,0,864e5,t.rt)}ot(t,e){var r=Math.floor((e-t.lastAccess)/this.st);r>0&&(t.tokens=Math.min(t.tokens+r*this.nt,this.it),t.lastAccess=t.lastAccess+r*this.st)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.tt[i];return n?this.ot(n,r):this.tt[i]=n={tokens:this.it,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.et)||e.call(this,t)),0===n.tokens)}stop(){this.tt={}}}var pi="Mobile",gi="iOS",mi="Android",yi="Tablet",bi=mi+" "+yi,_i="iPad",wi="Apple",xi=wi+" Watch",ki="Safari",Si="BlackBerry",Ti="Samsung",Ci=Ti+"Browser",Ei=Ti+" Internet",Mi="Chrome",Ii=Mi+" OS",Ri=Mi+" "+gi,Pi="Internet Explorer",Oi=Pi+" "+pi,Li="Opera",Ai=Li+" Mini",Fi="Edge",$i="Microsoft "+Fi,Di="Firefox",Ni=Di+" "+gi,qi="Nintendo",ji="PlayStation",Bi="Xbox",Ui=mi+" "+pi,Hi=pi+" "+ki,zi="Windows",Wi=zi+" Phone",Vi="Nokia",Zi="Ouya",Gi="Generic",Qi=Gi+" "+pi.toLowerCase(),Ki=Gi+" "+yi.toLowerCase(),Ji="Konqueror",Yi="Oculus Browser",Xi="Vivaldi",tn="Yandex",en="Whale",rn="DuckDuckGo",nn="Pale Moon",sn="Waterfox",on="Brave",an="Google Search App",ln="(\\d+(\\.\\d+)?)",un=new RegExp("Version/"+ln),hn=new RegExp(Bi,"i"),dn=new RegExp(ji+" \\w+","i"),cn=new RegExp(qi+" \\w+","i"),vn=new RegExp(Si+"|PlayBook|BB10","i"),fn={"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"},pn=function(t,e,r,i){e=e||"";var n=function(t){return null!=t&&t.brave?on:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&Nr(t,"GSA/")?an:Nr(t," OPR/")&&Nr(t,"Mini")?Ai:Nr(t," OPR/")?Li:vn.test(t)?Si:Nr(t,"IE"+pi)||Nr(t,"WPDesktop")?Oi:Nr(t,"OculusBrowser")?Yi:Nr(t,Ci)?Ei:Nr(t,Fi)||Nr(t,"Edg/")?$i:Nr(t,Xi+"/")?Xi:Nr(t,"YaBrowser/")?tn:Nr(t,en+"/")?en:Nr(t,rn+"/")||Nr(t,"Ddg/")?rn:Nr(t,"FBIOS")?"Facebook "+pi:Nr(t,"UCWEB")||Nr(t,"UCBrowser")?"UC Browser":Nr(t,"CriOS")?Ri:Nr(t,"CrMo")||Nr(t,Mi)?Mi:Nr(t,mi)&&Nr(t,ki)?Ui:Nr(t,"FxiOS")?Ni:Nr(t.toLowerCase(),Ji.toLowerCase())?Ji:Nr(t,on+"/")?on:((t,e)=>e&&Nr(e,wi)||function(t){return Nr(t,ki)&&!Nr(t,Mi)&&!Nr(t,mi)}(t))(t,e)?Nr(t,pi)?Hi:ki:Nr(t,"PaleMoon/")?nn:Nr(t,sn+"/")?sn:Nr(t,Di)?Di:Nr(t,"MSIE")||Nr(t,"Trident/")?Pi:Nr(t,"Gecko")?Di:"")},gn={[Oi]:[new RegExp("rv:"+ln)],[$i]:[new RegExp(Fi+"?\\/"+ln)],[Mi]:[new RegExp("("+Mi+"|CrMo)\\/"+ln)],[Ri]:[new RegExp("CriOS\\/"+ln)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ln)],[ki]:[un],[Hi]:[un],[Li]:[new RegExp("(Opera|OPR)\\/"+ln)],[Di]:[new RegExp(Di+"\\/"+ln)],[Ni]:[new RegExp("FxiOS\\/"+ln)],[Ji]:[new RegExp("Konqueror[:/]?"+ln,"i")],[Si]:[new RegExp(Si+" "+ln),un],[Ui]:[new RegExp("android\\s"+ln,"i")],[Ei]:[new RegExp(Ci+"\\/"+ln)],[Yi]:[new RegExp("OculusBrowser\\/"+ln)],[Xi]:[new RegExp(Xi+"\\/"+ln)],[tn]:[new RegExp("YaBrowser\\/"+ln)],[en]:[new RegExp(en+"\\/"+ln)],[on]:[new RegExp(on+"\\/"+ln)],[rn]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ln)],[nn]:[new RegExp("PaleMoon\\/"+ln)],[sn]:[new RegExp(sn+"\\/"+ln)],[an]:[new RegExp("GSA\\/"+ln)],[Pi]:[new RegExp("(rv:|MSIE )"+ln)],Mozilla:[new RegExp("rv:"+ln)]},mn=function(t,e,r,i){var n=pn(t,e,r,i),s=gn[n];if(Qr(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},yn=[[new RegExp(Bi+"; "+Bi+" (.*?)[);]","i"),t=>[Bi,t&&t[1]||""]],[new RegExp(qi,"i"),[qi,""]],[new RegExp(ji,"i"),[ji,""]],[vn,[Si,""]],[new RegExp(zi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Wi,""];if(new RegExp(pi).test(e)&&!/IEMobile\b/.test(e))return[zi+" "+pi,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=fn[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[zi,i]}return[zi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[gi,[t[3],t[4],t[5]||"0"].join(".")]:[gi,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Qr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+mi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mi+")","i"),t=>t&&t[2]?[mi,[t[2],t[3],t[4]||"0"].join(".")]:[mi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ii,""]],[/Linux|debian/i,["Linux",""]]],bn=function(t){return cn.test(t)?qi:dn.test(t)?ji:hn.test(t)?Bi:new RegExp(Zi,"i").test(t)?Zi:new RegExp("("+Wi+"|WPDesktop)","i").test(t)?Wi:/iPad/.test(t)?_i:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?xi:vn.test(t)?Si:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Vi,"i").test(t)?Vi:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(pi).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?mi:bi:new RegExp("(pda|"+pi+")","i").test(t)?Qi:new RegExp(yi,"i").test(t)&&!new RegExp(yi+" pc","i").test(t)?Ki:""},_n=function(t,e){var r,i,n,s,o=bn(t);return o===_i||o===bi||"Kobo"===o||"Kindle Fire"===o||o===Ki?yi:o===qi||o===Bi||o===ji||o===Zi?"Console":o===xi?"Wearable":o?pi:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?pi:yi:"Desktop"},wn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xn(t,e){return"string"==typeof(r=t)&&wn.test(r)?t:e();var r}function kn(t){return t?t.split("#")[0]:t}function Sn(t,e){var r=setTimeout(t,e);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}function Tn(t,e,r){return Cn.apply(this,arguments)}function Cn(){return(Cn=e((function*(t,e,r){var i;try{return yield Promise.race([t,new Promise(((t,n)=>{i=Sn((()=>{try{null==r||r(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(i)}}))).apply(this,arguments)}var En=t=>t instanceof Error,Mn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},In=Mn.info;function Rn(t){if(ri(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(Wr(t))return{arrayValue:{values:t.map((t=>Rn(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Pn(t){var e=[];for(var r in t){var i=t[r];Yr(i)||Qr(i)||e.push({key:r,value:Rn(i)})}return e}function On(t,e){var i=Mn[t.level||"info"]||In,n=i.text,s=i.number,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Xr(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Xr(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var l=r({},a,t.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:Pn(l)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Qr(t.trace_flags)||(u.flags=t.trace_flags),u}function Ln(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}function An(t,e,r,i){return{resourceLogs:[{resource:{attributes:Pn(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}let Fn=class{constructor(t,e,r,i,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Pe=e,this.rt=r,this.ut=i,this.ht=n,this.dt=s,this.vt=o,this.ct=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.Mt=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Et(),this.ct=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Pe.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.It()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.Pt(t);if(null!==e)if(e.body){if(this.Rt()){var r={record:On(e,this.ut())};this.ht((()=>this.Lt(r)))}}else this.rt.info("Log was rejected in beforeSend function")}}Pt(t){var e=this.Pe.beforeSend;if(!e)return t;var r=Wr(e)?e:[e],i=t;for(var n of r)try{var s=n(i);if(!s)return this.rt.info("Log was rejected in beforeSend function"),null;i=s}catch(t){return this.rt.error("Error in beforeSend function for log:",t),null}return i}Rt(){if(void 0===this.Tt)return!0;var t=Date.now(),e=t-this.bt;return this.Mt>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.rt.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var t=this;return e((function*(){if(!t._instance.isDisabled)return t.ct||(t.ct=t.Ot().finally((()=>{t.ct=null}))),t.ct}))()}Ot(){var t=this;return e((function*(){var e;t.Et();var r=null!==(e=t._instance.getPersistedProperty(kr.LogsQueue))&&void 0!==e?e:[];if(0!==r.length)for(var i=r.length,n=0;r.length>0&&i>n;){var s,o;t.ft=0;var a=Math.min(r.length,t.Ct),l=r.slice(0,a),u=l.map((t=>t.record)),h=An(u,t.Ft(),null!==(s=t.vt)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.At(h);if("too-large"===d.kind&&l.length>1)t.Ct=Math.max(1,Math.floor(l.length/2)),t.rt.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ct);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.rt.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.Pe.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Pe.maxBatchRecordsPerPost,t.Ct+1)),yield t.Dt(l.length),r=null!==(o=t._instance.getPersistedProperty(kr.LogsQueue))&&void 0!==o?o:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}Dt(t){var r=this;return e((function*(){var e,i=Math.max(0,t-r.ft),n=null!==(e=r._instance.getPersistedProperty(kr.LogsQueue))&&void 0!==e?e:[];r._instance.setPersistedProperty(kr.LogsQueue,n.slice(i)),yield r.dt()}))()}Ft(){return Ln(this.Pe,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Lt(t){var e;if(!this._instance.optedOut){var r=null!==(e=this._instance.getPersistedProperty(kr.LogsQueue))&&void 0!==e?e:[];this.kt>r.length||(r.shift(),this.ft++,this.rt.info("Logs queue is full, dropping oldest record.")),r.push(t),this._instance.setPersistedProperty(kr.LogsQueue,r),this.xt>r.length?this.$t():this.It()}}$t(t){void 0===t&&(t=this.St),this.Nt||(this.Nt=Sn((()=>{this.Nt=void 0,this.It()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(kr.LogsQueue);return!!t&&t.length>0}shutdown(t){var r=this;return e((function*(){r.Et();var e=r.flush().catch((()=>{}));void 0!==t?yield Tn(e,t):yield e}))()}flushWithTimeout(t){var r=this;return e((function*(){var e=r.flush();yield Tn(e,t,(()=>{e.catch((()=>{}))}))}))()}It(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.rt.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.$t(this.qt())}))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var $n=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Dn(t){return String(t)+"000000"}function Nn(t,e,r,i){var n="";return i&&(n=Object.keys(i).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(i[t]))).join(",")),t+"\0"+e+"\0"+(null!=r?r:"")+"\0"+n}let qn=class{constructor(t,e,r){this._instance=t,this.Pe=e,this.rt=r,this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Wt=0}count(t,e,r){void 0===e&&(e=1),this.Vt({name:t,type:"count",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(t,e,r){this.Vt({name:t,type:"gauge",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(t,e,r){this.Vt({name:t,type:"histogram",value:e,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var t=this,r=this.ct,i=function(){var i=e((function*(){r&&(yield r.catch((()=>{}))),yield t.Zt()}));return function(){return i.apply(this,arguments)}}(),n=i().finally((()=>{this.ct===n&&(this.ct=null)}));return this.ct=n,n}drainWindow(){if(0===this.Bt.size)return null;var t=this.Bt;return this.Bt=new Map,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Wt++,this.Et(),this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set}Vt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Pt(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.rt.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,n;try{i=e.attributes?r({},e.attributes):void 0,n=Nn(e.type,e.name,e.unit,i)}catch(t){return void this.rt.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Bt.get(n);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Bt.set(n,s)}var o=this.Ut.get(e.name);void 0===o?this.Ut.set(e.name,e.type):o===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.rt.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.$t()}else this.rt.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.rt.warn("Dropping metric with empty name")}}Qt(){return this.Pe.maxSeriesPerFlush>this.Bt.size||(this.Ht||(this.Ht=!0,this.rt.warn("Metric series cap reached ("+this.Pe.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var r;switch(t.type){case"count":t.total=(null!==(r=t.total)&&void 0!==r?r:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array($n.length+1).fill(0)});var i=t.hist;i.count+=1,i.sum+=e,i.min=Math.min(i.min,e),i.max=Math.max(i.max,e),i.bucketCounts[function(t,e){for(var r=0;e.length>r;r++)if(e[r]>=t)return r;return e.length}(e,$n)]+=1}}Pt(t){var e=this.Pe.beforeSend;if(!e)return t;var r=Wr(e)?e:[e],i=t;for(var n of r)try{var s=n(i);if(!s)return this.rt.info("Metric was rejected in beforeSend function"),null;i=s}catch(t){return this.rt.error("Error in beforeSend function for metric:",t),null}return i}$t(){this.Nt||(this.Nt=Sn((()=>{this.Nt=void 0,this.flush().catch((t=>{this.rt.error("Metrics flush failed:",t)}))}),this.Pe.flushIntervalMs))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}Zt(){var t=this;return e((function*(){if(0!==t.Bt.size){var e=t.Bt;t.Bt=new Map,t.Ht=!1,t.Ut=new Map,t.zt=new Set;var r=t.Wt,i=yield t._instance.Kt(t.Gt(e));if(r===t.Wt)switch(i.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.$t();case"too-large":return void t.rt.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.rt.error("Failed to send metrics batch:",i.error)}}}))()}Gt(t){return e=this.Xt(t),i=function(t,e,i){return r({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":i})}(this.Pe,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Pn(i)},scopeMetrics:[{scope:{name:n,version:s},metrics:e}]}]};var e,i,n,s}Xt(t){var e=Dn(Date.now()),i=new Map;for(var n of t.values()){var s,o=Nn(n.type,n.name,n.unit,void 0),a=i.get(o);a||(a=r({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(o,a));var l=Pn(null!==(s=n.attributes)&&void 0!==s?s:{}),u=Dn(n.windowStartMs);if("count"===n.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=n.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===n.type){var c,v={attributes:l,timeUnixNano:e,asDouble:null!==(c=n.last)&&void 0!==c?c:0};a.gauge.dataPoints.push(v)}else n.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:$n})}return Array.from(i.values())}Yt(t){var e,r;for(var i of t){var n=i[0],s=i[1],o=this.Bt.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.total)&&void 0!==e?e:0)+(null!==(r=s.total)&&void 0!==r?r:0);break;case"gauge":break;case"histogram":if(s.hist)if(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Qt()&&this.Bt.set(n,s)}}};function jn(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}var Bn,Un,Hn;function zn(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Hn&&r.length===Un||(Un=r.length,Hn=r.reduce(((r,i)=>{Bn||(Bn={});var n=Bn[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[i];if(l&&u){r[l]=u,Bn[i]=[l,u];break}}return r}),{})),Hn}}class Wn{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Wr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:zn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Vn="?";function Zn(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Vn:r,in_app:!0};return Qr(i)||(s.lineno=i),Qr(n)||(s.colno=n),s}var Gn=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:Vn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Qn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Kn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Jn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yn=(t,e)=>{var r=Qn.exec(t);if(r)return Zn(e,r[1],Vn,+r[2],+r[3]);var i=Kn.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=Jn.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var s=Gn(i[1]||Vn,i[2]);return Zn(e,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Xn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ts=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,es=(t,e)=>{var r=Xn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=ts.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||Vn,o=Gn(s,n);return Zn(e,n=o[1],s=o[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},rs=/\(error: (.*)\)/,is=50;class ns{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=Kr(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return ai(t,"DOMException")}isDOMError(t){return ai(t,"DOMError")}}class ss{match(t){return function(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return ui(t,Error)}}(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class os{constructor(){}match(t){return!!ai(t,"ErrorEvent")&&(null!=t.error||this.fe(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var n=e.apply(t.message);return r({},n,{stack:null!==(i=this.pe(t))&&void 0!==i?i:n.stack,synthetic:!0})}fe(t){return Kr(t.message)&&t.message.length>0}pe(t){var e=t;if(Kr(e.filename)&&e.filename.length>0){var r,i,n=null!==(r=e.lineno)&&void 0!==r?r:0,s=null!==(i=e.colno)&&void 0!==i?i:0;return"Error\n at "+e.filename+":"+n+":"+s}}}var as=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class ls{match(t){return"string"==typeof t}coerce(t,e){var r,i=this.getInfos(t),n=i[0],s=i[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(as);return i&&(e=i[1],r=i[2]),[e,r]}}var us=["fatal","error","warning","log","info","debug"];function hs(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class ds{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(r=this.getStack(t))&&void 0!==r?r:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return li(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+hs(t)}isSeverityLevel(t){return Kr(t)&&!Jr(t)&&us.indexOf(t)>=0}getStack(t){try{return Kr(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Kr(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(En(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class cs{match(t){return li(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+hs(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class vs{match(t){return oi(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class fs{match(t){return ai(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!li(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return oi(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var ps="$message",gs="$timestamp",ms=new Set([ps,gs]),ys={enabled:!0,max_bytes:32768};function bs(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:ys.enabled,max_bytes:ws(t.max_bytes,ys.max_bytes)}:r({},ys)}class _s{constructor(t){this.Je=[],this.Ke=0,this.Pe=bs(t)}setConfig(t){this.Pe=bs(t),this.Xe()}add(t){var e=function(t){var e;try{e=Br(t)}catch(t){return}try{var r=JSON.parse(e);if(!Zr(r))return;var i=r,n=i[ps],s=i[gs];if(!Kr(n)||0===n.trim().length)return;if(!Kr(s)&&!ti(s))return;return{step:i,json:e}}catch(t){return}}(t);if(e){var r=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),r=0,i=0;e.length>i;i++)"%"===e[i]?(r+=1,i+=2):r+=1;return r}(e.json);r>this.Pe.max_bytes||(this.Je.push({step:e.step,bytes:r}),this.Ke+=r,this.Xe())}}getAttachable(){return this.Je.map((t=>t.step))}clear(){this.Je=[],this.Ke=0}size(){return this.Je.length}Xe(){for(;this.Ke>this.Pe.max_bytes&&this.Je.length>0;){var t=this.Je.shift();t&&(this.Ke-=t.bytes)}}}function ws(t,e){if(!ti(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var xs="undefined"!=typeof window?window:void 0,ks="undefined"!=typeof globalThis?globalThis:xs,Ss=null==ks?void 0:ks.navigator,Ts=null==ks?void 0:ks.document,Cs=null==ks?void 0:ks.location,Es=null==ks?void 0:ks.fetch,Ms=null!=ks&&ks.XMLHttpRequest&&"withCredentials"in new ks.XMLHttpRequest?ks.XMLHttpRequest:void 0,Is=null==ks?void 0:ks.AbortController,Rs=null==ks?void 0:ks.CompressionStream,Ps=null==Ss?void 0:Ss.userAgent;function Os(){return!(!xs||!1===xs.navigator.onLine)}var Ls=t=>"undefined"!=typeof Document&&t instanceof Document,As={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"},Fs=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={k(e){if(xs&&(As.DEBUG||xs.POSTHOG_DEBUG||r)&&!Qr(xs.console)&&xs.console){for(var i=("__rrweb_original__"in xs.console[e]?xs.console[e].__rrweb_original__:xs.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Fs(t+" "+e,r)};return i},$s=Fs("[PostHog.js]"),Ds=$s.createLogger;function Ns(t,e){Wr(t)&&t.forEach(e)}function qs(t,e){if(!Xr(t))if(Wr(t))t.forEach(e);else if(ii(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Hr.call(t,r)&&e(t[r],r)}var js=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Bs(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var Us=function(t){try{return t()}catch(t){return}},Hs=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){$s.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$s.critical(t)}}},zs=function(t){var e={};return qs(t,(function(t,r){(Kr(t)&&t.length>0||ti(t))&&(e[r]=t)})),e};var Ws=["herokuapp.com","vercel.app","netlify.app"];function Vs(t){var e=null==t?void 0:t.hostname;if(!Kr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Ws)if(r===i)return!1;return!0}function Zs(t,e,r,i){var n=null!=i?i:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===o||o})}function Gs(t){return"ph_toolbar_internal"===t.name}var Qs=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return Br(t)}},Ks=t=>{var e=null==Ts?void 0:Ts.createElement("a");return Qr(e)?null:(e.href=t,e)},Js=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return qs(t,(function(t,e){Qr(t)||Qr(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Ys=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!Wr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){$s.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Xs=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Wr(d)&&(e.includes(d[0])?u.push(d[0]+"="+r):u.push(l[h]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=n&&(c+="#"+n),c},to=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},eo=(t,e)=>t>=e&&Os(),ro=(t,e,r,i)=>{if(0===t){if(Os()){var n=e+1;return n===r&&i(),n}return e}return 0},io=()=>{};function no(t,e,r){try{if(!(e in t))return io;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Vr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];Vr(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return io}}function so(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function oo(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Vr(i))return e;try{var n=i(e);return Kr(n)&&n?n:e}catch(t){return $s.error("Error in get_current_url, falling back to window.location.href",t),e}}function ao(t){var e,r=null==xs||null==(e=xs.location)?void 0:e.href;return Qr(r)?void 0:oo(t,r)}var lo="__POSTHOG_TOOLBAR__",uo=1,ho=3,co=11;function vo(t){return t instanceof Element&&(t.id===lo||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function fo(t){return!!t&&t.nodeType===uo}function po(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function go(t){return!!t&&t.nodeType===ho}function mo(t){return!!t&&t.nodeType===co&&fo(t.host)}var yo=1e3;function bo(t){return t?qr(t).split(/\s+/):[]}function _o(t,e){var r=ao(e);return!!(r&&t&&t.some((t=>r.match(t))))}function wo(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return bo(e)}function xo(t){return Xr(t)?null:qr(t).split(/(\s+)/).filter((t=>Zo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ko(t){var e="";return No(t)&&!qo(t)&&t.childNodes&&t.childNodes.length&&qs(t.childNodes,(function(t){var r;go(t)&&t.textContent&&(e+=null!==(r=xo(t.textContent))&&void 0!==r?r:"")})),qr(e)}function So(t){var e;return Qr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var To=["a","button","form","input","select","textarea","label"];function Co(t,e){if(Qr(e))return!0;var r,i=function(t){if(e.some((e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function Eo(t){var e=t.parentNode;return!(!e||!fo(e))&&e}var Mo=[".ph-no-autocapture","[data-ph-no-autocapture]"],Io=["next","previous","prev",">","<"],Ro=[...Io,"+","-","−","–"],Po=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Oo=[".ph-no-deadclick",".ph-no-capture"],Lo=[".ph-no-rageclick",".ph-no-capture"],Ao=["","text","search","email","password","url","tel","number"];function Fo(t,e){if(!xs||$o(t))return!1;var r,i,n,s,o;if(ri(e)?(r=!!e&&Lo,i=void 0,n=!1):(r=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:Lo,i=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(t){return!(!t||!fo(t))&&(!!po(t,"textarea")||(po(t,"input")?Nr(Ao,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(t))return!1;var a=Do(t,!1).targetElementList;return!function(t,e){if(!1===t||Qr(t))return!1;var r;if(!0===t)r=Io;else{if(!Wr(t))return!1;if(t.length>10)return $s.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,i=t.ariaLabel;return r.some((t=>Po(e,t)||Po(i,t)))}))}(i,a.map((t=>{var e;return{safeText:ko(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Co(a,r)}var $o=t=>!t||po(t,"html")||!fo(t),Do=(t,e)=>{if(!xs||$o(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!po(n,"body");)if(mo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Eo(n);if(!s)break;if(e||To.indexOf(s.tagName.toLowerCase())>-1)r=!0;else try{var o=xs.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}catch(t){}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function No(t){for(var e=new Set,r=0,i=t;i.parentNode&&!po(i,"body");i=i.parentNode){if(r++>=yo||e.has(i))return!1;e.add(i);var n=wo(i);if(Nr(n,"ph-sensitive")||Nr(n,"ph-no-capture"))return!1}if(Nr(wo(t),"ph-include"))return!0;var s=t.type||"";if(Kr(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Kr(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function qo(t){return!!(po(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||po(t,"select")||po(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var jo=new RegExp("^(?:(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}))$"),Bo=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Uo=[16,15,14,13],Ho=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),zo=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Wo=/[0-9A-Za-z_]/;function Vo(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}function Zo(t,e){if(void 0===e&&(e=!0),Xr(t))return!1;if(Kr(t)){t=qr(t);var r=e?jo.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Bo.lastIndex=0;e=Bo.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of Uo){var o=n+s;if(i.length>=o){var a=i.slice(n,o);if(jo.test(a)&&Vo(a))return!0}}}return!1}(t);if(r)return!1;var i=e?Ho.test(t):function(t){var e;for(zo.lastIndex=0;e=zo.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Wo.test(r)&&Wo.test(i)))return!0}return!1}(t);if(i)return!1}return!0}function Go(t){var e=ko(t);return Zo(e=(e+" "+Qo(t)).trim())?e:""}function Qo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&qs(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=ko(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Qo(t)).trim())}catch(t){$s.error("[AutoCapture]",t)}})),e}function Ko(t){return t.replace(/"|\\"/g,'\\"')}function Jo(t){var e=t.attr__class;if(e)return Wr(e)?e:bo(e)}var Yo=1e6,Xo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Yo,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},ta=Ds("[Recorder]"),ea=t=>"navigation"===t.entryType,ra=t=>"resource"===t.entryType;function ia(t,e){return!!e&&(ri(e)||e[t])}function na(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var sa=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function oa(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!na(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(sa))return!1;if(ri(r))return!0;if(Wr(r))return n(r);var s=r[e];return ri(s)?s:n(s)}function aa(t,e,r,i,n,s){return la.apply(this,arguments)}function la(){return la=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return ta.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(ra(o=t[s])&&o.initiatorType===e&&(Qr(i)||o.startTime>=i)&&(Qr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),aa(t,e,r,i,n,s+1))})),la.apply(this,arguments)}function ua(t){var e=t.body,r=t.options,i=t.url;if(Xr(e))return null;var n=so(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Kr(e))return e;if(Ls(e))return e.textContent;if(ii(e))return Js(e);if(Zr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ha=t=>!Yr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function da(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(a||0)),v=[r({},e?e.toJSON():{name:u},{startTime:Qr(a)?void 0:Math.round(a),endTime:Qr(l)?void 0:Math.round(l),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(ha(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ca=["video/","audio/"];function va(t){return Zr(t)&&Vr(t.getReader)&&Vr(t.tee)}var fa=500,pa="[SessionReplay] Timeout while trying to read body",ga="[SessionReplay] Failed to read body";function ma(t){return ga+": "+t}function ya(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function ba(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(pa)),fa);try{t.clone().text().then((t=>e(t)),(t=>e(ma(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e(ga)}}))}(t);var r=function(t){var e;return Math.min(Yo,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Yo)}(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(ya(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),r(t))}var a,l=setTimeout((()=>o(pa)),fa);try{a=t.clone()}catch(t){return void o(ga)}var u=a.body;if(va(u)&&"undefined"!=typeof TextDecoder){try{i=u.getReader()}catch(t){return void o(ga)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,a=r.value;if(n)s();else if(i)o((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(a){if(d+a.byteLength>e)return void o(ya(e));d+=a.byteLength,h.push(a)}t()}}),(t=>o(ma(t))))}()}else try{a.text().then((t=>o(t)),(t=>o(ma(t))))}catch(t){o(ga)}}))}(t,r)}function _a(){return _a=e((function*(t){var e=t.r,r=t.options,i=so(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):ba(e,r)})),_a.apply(this,arguments)}function wa(){return wa=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=ca.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var a=so(n,i);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Yr(i)?ba(e,r):Promise.resolve(i)})),wa.apply(this,arguments)}var xa=null;function ka(t,i,n){if(!("performance"in i))return()=>{};if(xa)return ta.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Xo,n):Xo,o=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>ea(t)||ra(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>da({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>ea(t)||ra(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>da({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ia("request",r.recordHeaders),n=ia("response",r.recordHeaders),s=no(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var c,v,f=new Request(a),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(oa({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ua({body:t,options:r,url:a})),c=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),oa({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ua({body:d.response,options:r,url:a})),aa(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=da({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){ta.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ia("request",i.recordHeaders),s=ia("response",i.recordHeaders),o=no(r,"fetch",(o=>function(){var a=e((function*(e,a){var l,u;try{l=new Request(e,a)}catch(t){return ta.error("Failed to instrument fetch for network capture",t),o(e,a)}var h,d,c={};try{try{var v={};l.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!va(null==a?void 0:a.body)&&oa({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return _a.apply(this,arguments)}({r:l,options:i,url:e}))}catch(t){ta.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),u=na(e)?yield o(l):yield o(e,a),d=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),oa({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return wa.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{aa(r,"fetch",l.url,h,d).then((e=>{var r,i=da({entry:e,method:l.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),xa=()=>{a(),l(),u(),xa=null}}var Sa=t=>({name:"rrweb/network@1",observer:ka,options:t}),Ta="undefined"!=typeof globalThis?globalThis:xs;Ta&&"undefined"==typeof self&&(Ta.self=Ta),Ta&&"undefined"==typeof File&&(Ta.File=function(){});var Ca=null!=xs?xs:{};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:mr,getRecordNetworkPlugin:Sa},Ca.__PosthogExtensions__.rrweb={record:rr,version:"v2",wasMaxDepthReached:()=>Rt,resetMaxDepthState(){Rt=!1,It=!1},getLastSnapshotCost:()=>O,getMutationCost:()=>r({},F),resetSnapshotCostState(){I=0,R=0,P=E(),O=null,L=null,A=[],F={slowestBatchMs:0}}},Ca.rrweb={record:rr,version:"v2"},Ca.rrwebConsoleRecord={getRecordConsolePlugin:mr},Ca.getRecordNetworkPlugin=Sa;var Ea,Ma,Ia,Ra,Pa,Oa,La,Aa,Fa,$a,Da,Na,qa,ja,Ba,Ua={},Ha=[],za=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wa=Array.isArray;function Va(t,e){for(var r in e)t[r]=e[r];return t}function Za(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ga(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Ea.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Qa(t,o,i,n,null)}function Qa(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Ia:n,__i:-1,__u:0};return null==n&&null!=Ma.vnode&&Ma.vnode(s),s}function Ka(t){return t.children}function Ja(t,e){this.props=t,this.context=e}function Ya(t,e){if(null==e)return t.__?Ya(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Ya(t):null}function Xa(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],s=Va({},e);s.__v=e.__v+1,Ma.vnode&&Ma.vnode(s),ul(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?Ya(e):r,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,dl(i,s,n),e.__e=e.__=null,s.__e!=r&&tl(s)}}function tl(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),tl(t)}function el(t){(!t.__d&&(t.__d=!0)&&Ra.push(t)&&!rl.__r++||Pa!=Ma.debounceRendering)&&((Pa=Ma.debounceRendering)||Oa)(rl)}function rl(){try{for(var t,e=1;Ra.length;)Ra.length>e&&Ra.sort(La),t=Ra.shift(),e=Ra.length,Xa(t)}finally{Ra.length=rl.__r=0}}function il(t,e,r,i,n,s,o,a,l,u,h){var d,c,v,f,p,g,m,y=i&&i.__k||Ha,b=e.length;for(l=function(t,e,r,i,n){var s,o,a,l,u,h=r.length,d=h,c=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Qa(null,o,null,null,null):Wa(o)?o=t.__k[s]=Qa(Ka,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Qa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+c,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=sl(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?c--:h>n&&c++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Ya(a)),fl(a,a));return i}(r,e,y,l,b),d=0;b>d;d++)null!=(v=r.__k[d])&&(c=-1!=v.__i&&y[v.__i]||Ua,v.__i=d,g=ul(t,v,c,n,s,o,a,l,u,h),f=v.__e,v.ref&&c.ref!=v.ref&&(c.ref&&vl(c.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||c.__k===v.__k?(l=nl(v,l,t,m),m&&c.__e&&(c.__e=null)):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function nl(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=nl(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Ya(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function sl(t,e,r,i){var n,s,o,a=t.key,l=t.type,u=e[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||e.length>s;)if(null!=(u=e[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function ol(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||za.test(e)?r:r+"px"}function al(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||ol(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||ol(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Da,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r[$a]=i[$a]:(r[$a]=Na,t.addEventListener(e,s?ja:qa,s)):t.removeEventListener(e,s?ja:qa,s);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function ll(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[Fa])e[Fa]=Na++;else if(r[$a]>e[Fa])return;return r(Ma.event?Ma.event(e):e)}}}function ul(t,e,r,i,n,s,o,a,l,u){var h,d,c,v,f,p,g,m,y,b,$,_,w,x,k,S,T=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=Ma.__b)&&h(e);t:if("function"==typeof T){d=o.length;try{if(y=e.props,b=T.prototype&&T.prototype.render,$=(h=T.contextType)&&i[h.__c],_=h?$?$.props.value:h.__:i,r.__c?m=(c=e.__c=r.__c).__=c.__E:(b?e.__c=c=new T(y,_):(e.__c=c=new Ja(y,_),c.constructor=T,c.render=pl),$&&$.sub(c),c.state||(c.state={}),c.__n=i,v=c.__d=!0,c.__h=[],c._sb=[]),b&&null==c.__s&&(c.__s=c.state),b&&null!=T.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Va({},c.__s)),Va(c.__s,T.getDerivedStateFromProps(y,c.__s))),f=c.props,p=c.state,c.__v=e,v)b&&null==T.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),b&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(b&&null==T.getDerivedStateFromProps&&y!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(y,_),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(y,c.__s,_)){e.__v!=r.__v&&(c.props=y,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((function(t){t&&(t.__=e)})),Ha.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(y,c.__s,_),b&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,g)}))}if(c.context=_,c.props=y,c.__P=t,c.__e=!1,w=Ma.__r,x=0,b)c.state=c.__s,c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),Ha.push.apply(c.__h,c._sb),c._sb=[];else do{c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++x);c.state=c.__s,null!=c.getChildContext&&(i=Va(Va({},i),c.getChildContext())),b&&!v&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,p)),k=null!=h&&h.type===Ka&&null==h.key?cl(h.props.children):h,a=il(t,Wa(k)?k:[k],e,r,i,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),m&&(c.__E=c.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(S=s.length;S--;)Za(s[S]);hl(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||hl(e);Ma.__e(t,e,r)}}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,s,o,a,l){var u,h,d,c,v,f,p,g=r.props||Ua,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(Ma.__m&&Ma.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Ea.call(t.childNodes),!a&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"dangerouslySetInnerHTML"==u?d=v:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||al(t,u,null,v,n);for(u in m)v=m[u],"children"==u?c=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||al(t,u,v,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),il("template"==e.type?t.content:t,Wa(c)?c:[c],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Ya(r,0),a,l),null!=s)for(u=s.length;u--;)Za(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&al(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&al(t,u,p,g[u],n))}return t}(r.__e,e,r,i,n,s,o,l,u);return(h=Ma.diffed)&&h(e),128&e.__u?void 0:a}function hl(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(hl))}function dl(t,e,r){for(var i=0;r.length>i;i++)vl(r[i],r[++i],r[++i]);Ma.__c&&Ma.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Ma.__e(t,e.__v)}}))}function cl(t){return"object"!=typeof t||null==t||t.__b>0?t:Wa(t)?t.map(cl):void 0!==t.constructor?null:Va({},t)}function vl(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Ma.__e(t,r)}}function fl(t,e,r){var i,n;if(Ma.unmount&&Ma.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||vl(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){Ma.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&fl(i[n],e,r||"function"!=typeof t.type);r||Za(t.__e),t.__c=t.__=t.__e=void 0}function pl(t,e,r){return this.constructor(t,r)}function gl(t,e,r){var i,n,s;e==document&&(e=document.documentElement),Ma.__&&Ma.__(t,e),i=e.__k,n=[],s=[],ul(e,t=e.__k=Ga(Ka,null,[t]),i||Ua,Ua,e.namespaceURI,i?null:e.firstChild?Ea.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),dl(n,t,s),t.props.children=null}Ea=Ha.slice,Ma={__e(t,e,r,i){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Ia=0,Ja.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Va({},this.state),"function"==typeof t&&(t=t(Va({},r),this.props)),t&&Va(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),el(this))},Ja.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),el(this))},Ja.prototype.render=Ka,Ra=[],Oa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,La=function(t,e){return t.__v.__b-e.__v.__b},rl.__r=0,Aa=Math.random().toString(8),Fa="__d"+Aa,$a="__a"+Aa,Da=/(PointerCapture)$|Capture$/i,Na=0,qa=ll(!1),ja=ll(!0),Ba=0;var ml,yl,bl,_l,wl=0,xl=[],kl=Ma,Sl=kl.__b,Tl=kl.__r,Cl=kl.diffed,El=kl.__c,Ml=kl.unmount,Il=kl.__;function Rl(t,e){kl.__h&&kl.__h(yl,t,wl||e),wl=0;var r=yl.__H||(yl.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Pl(t){return wl=1,function(t,e,r){var i=Rl(ml++,2);if(i.t=t,!i.__c&&(i.__=[Ul(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=yl,!yl.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=!1,o=i.__c.props!==t;if(i.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s){var a=s.call(this,t,e,r);return n?a||o:a}return!n||o};yl.__f=!0;var s=yl.shouldComponentUpdate,o=yl.componentWillUpdate;yl.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},yl.shouldComponentUpdate=n}return i.__N||i.__}(Ul,t)}function Ol(t,e){var r=Rl(ml++,3);!kl.__s&&Bl(r.__H,e)&&(r.__=t,r.u=e,yl.__H.__h.push(r))}function Ll(t){return wl=5,Al((function(){return{current:t}}),[])}function Al(t,e){var r=Rl(ml++,7);return Bl(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Fl(t){var e=yl.context[t.__c],r=Rl(ml++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(yl)),e.props.value):t.__}function $l(){for(var t;t=xl.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ql),e.__h.some(jl),e.__h=[]}catch(r){e.__h=[],kl.__e(r,t.__v)}}}kl.__b=function(t){yl=null,Sl&&Sl(t)},kl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Il&&Il(t,e)},kl.__r=function(t){Tl&&Tl(t),ml=0;var e=(yl=t.__c).__H;e&&(bl===yl?(e.__h=[],yl.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&$l(),ml=0)),bl=yl},kl.diffed=function(t){Cl&&Cl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==xl.push(e)&&_l===kl.requestAnimationFrame||((_l=kl.requestAnimationFrame)||Nl)($l)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),bl=yl=null},kl.__c=function(t,e){e.some((function(t){try{t.__h.some(ql),t.__h=t.__h.filter((function(t){return!t.__||jl(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],kl.__e(r,t.__v)}})),El&&El(t,e)},kl.unmount=function(t){Ml&&Ml(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some((function(t){try{ql(t)}catch(t){e=t}})),r.__H=void 0,e&&kl.__e(e,r.__v))};var Dl="function"==typeof requestAnimationFrame;function Nl(t){var e,r=function(){clearTimeout(i),Dl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);Dl&&(e=requestAnimationFrame(r))}function ql(t){var e=yl,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),yl=e}function jl(t){var e=yl;t.__c=t.__(),yl=e}function Bl(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function Ul(t,e){return"function"==typeof e?e(t):e}function Hl(t){var e=!0;return{dispose(){if(e){e=!1;var r=t();r&&Vr(r.then)&&r.then(void 0,(()=>{}))}}}}var zl={GZipJS:"gzip-js",Base64:"base64"},Wl={Activation:"events",Cancellation:"cancelEvents"},Vl={Button:"button",Tab:"tab",Selector:"selector"},Zl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Gl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Ql={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Kl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Jl={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Yl={Once:"once",Recurring:"recurring",Always:"always"},Xl={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},tu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},eu={Popover:"popover",Inline:"inline"};function ru(t){return"$survey_response_"+t}function iu(t,e){if(!e)return null;var r=t[ru(e)];return Wr(r)?[...r]:r}function nu(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!Qr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=iu(t,e.id);Qr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:iu(t,e.id)})))},t,i)}function su(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function ou(t){return"string"==typeof t&&t.trim()?t.trim():null}function au(t){return t.toLowerCase()}function lu(t,e,r){if(!t||!e)return null;var i=au(e),n=Object.keys(t).find((t=>au(t)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(t).find((t=>au(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function uu(t,e,i){var n,s=lu(t.translations,e,i),o=r({},t),a=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];u&&(null==i||i.info("Applying survey-level translation for language: "+s),Qr(u.name)||(o.name=u.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),Qr(u.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=u.thankYouMessageHeader,a=!0),Qr(u.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=u.thankYouMessageDescription,a=!0),Qr(u.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,a=!0),Qr(u.submitButtonText)||(o.appearance.submitButtonText=u.submitButtonText,a=!0),Qr(u.backButtonText)||(o.appearance.backButtonText=u.backButtonText,a=!0)):function(t){return!(Qr(t.thankYouMessageHeader)&&Qr(t.thankYouMessageDescription)&&Qr(t.thankYouMessageCloseButtonText)&&Qr(t.submitButtonText)&&Qr(t.backButtonText))}(u)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=lu(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(n=t.translations)?void 0:n[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=r({},t),l=!1;return Qr(o.question)||(a.question=o.question,l=!0),Qr(o.description)||(a.description=o.description,l=!0),Qr(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Qr(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Qr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Qr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return Wr(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?s:null,hasChanges:l}}(t,e,i))),d=h.map((t=>t.question)),c=h.some((t=>t.hasChanges)),v=null;return s||(v=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),c&&(o.questions=d,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||v:null}}function hu(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function du(t){var e;return hu(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var cu=Ds("[Surveys]");function vu(t){return!(!t.start_date||t.end_date)}function fu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var pu="seenSurvey_",gu="inProgressSurvey_",mu=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),yu=t=>mu(pu,t),bu=t=>{try{var e=yu(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){cu.error("Failed to persist survey seen state",t)}},_u=[Ql.Popover,Ql.Widget,Ql.API],wu={ignoreConditions:!1,ignoreDelay:!1,displayType:eu.Popover},xu="$people_distinct_id",ku="$device_id",Su="$device_model",Tu="__alias",Cu="__timers",Eu="$autocapture_disabled_server_side",Mu="$heatmaps_enabled_server_side",Iu="$exception_capture_enabled_server_side",Ru="$error_tracking_suppression_rules",Pu="$error_tracking_capture_extension_exceptions",Ou="$web_vitals_enabled_server_side",Lu="$dead_clicks_enabled_server_side",Au="$product_tours_enabled_server_side",Fu="$web_vitals_allowed_metrics",$u="$session_recording_remote_config",Du="$replay_sample_rate",Nu="$replay_override_sampling",qu="$replay_override_linked_flag",ju="$replay_override_url_trigger",Bu="$replay_override_event_trigger",Uu="$sesid",Hu="$session_is_sampled",zu="$enabled_feature_flags",Wu="$active_feature_flags",Vu="$early_access_features",Zu="$feature_flag_details",Gu="$feature_flag_payloads",Qu="$feature_flag_request_id",Ku="$minimal_flag_called_events",Ju="$override_feature_flags",Yu="$override_feature_flag_payloads",Xu="$stored_person_properties",th="$stored_group_properties",eh="$surveys",rh="$surveys_loaded_at",ih="$surveys_activated",nh="$surveys_activated_session",sh="$surveys_activated_timestamps",oh="ph_product_tours",ah="$flag_call_reported",lh="$flag_call_reported_session_id",uh="$feature_flag_errors",hh="$feature_flag_evaluated_at",dh="$user_state",ch="$client_session_props",vh="$capture_rate_limit",fh="$initial_campaign_params",ph="$initial_referrer_info",gh="$initial_person_info",mh="$epp",yh="$posthog_cookieless",bh="$cookieless_mode",_h="$sdk_debug_extensions_init_method",wh="$sdk_debug_extensions_init_time_ms",xh="$sdk_debug_recording_script_not_loaded",kh="PostHog loadExternalDependency extension not found.",Sh="on_reject",Th="always",Ch="anonymous",Eh="identified",Mh="identified_only",Ih="visibilitychange",Rh="beforeunload",Ph="$pageview",Oh="$pageleave",Lh="$identify",Ah="$groupidentify";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return ti(t)&&isFinite(t)&&Math.floor(t)===t});class Fh{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Fh(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Fh(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class $h{generate(){var t=this.generateOrAbort();if(!Qr(t))return t;this.S=0;var e=this.generateOrAbort();if(Qr(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.C();else{if(this.S>=t+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return Fh.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.R.nextUint32())}C(){this.I=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}constructor(){this.S=0,this.I=0,this.R=new qh}}var Dh,Nh=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};xs&&!Qr(xs.crypto)&&crypto.getRandomValues&&(Nh=t=>crypto.getRandomValues(t));class qh{nextUint32(){return this.O.length>this.N||(Nh(this.O),this.N=0),this.O[this.N++]}constructor(){this.O=new Uint32Array(8),this.N=1/0}}var jh=()=>Bh().toString(),Bh=()=>(Dh||(Dh=new $h)).generate(),Uh=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Hh(t,e,r){return Qs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var zh={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Uh(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Uh(e,t))))),icontains:(t,e)=>e.map(Wh).some((e=>t.map(Wh).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Wh).every((e=>t.map(Wh).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Wh=t=>t.toLowerCase();function Vh(t,e){return!t||Object.entries(t).every((t=>{var r=t[1],i=null==e?void 0:e[t[0]];if(Qr(i)||Yr(i))return!1;var n=[String(i)],s=zh[r.operator];return!!s&&s(r.values,n)}))}var Zh=t=>{if(Ts){try{for(var e=t+"=",r=Ts.cookie.split(";").filter((t=>t.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Gh="",Qh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Kh={P:()=>!!Ts,j(t){$s.error("cookieStore error: "+t)},q:Zh,H(t){var e;try{e=JSON.parse(Kh.q(t))||{}}catch(t){}return e},A(t,e,r,i,n){if(!Ts)return!1;try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=Ts),Gh)return Gh;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+jh();!Gh&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Gh=s)}return Gh}(t);if(!r){var i=(t=>{var e=t.match(Qh);return e?e[0]:""})(t);i!==r&&$s.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(Ts.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&$s.warn("cookieStore warning: large cookie, len="+u.length),Ts.cookie=u,!0}catch(t){return!1}},F(t,e){if(null!=Ts&&Ts.cookie)try{Kh.A(t,"",-1,e)}catch(t){return}}},Jh=null,Yh={P(){if(!Yr(Jh))return Jh;var t=!0;if(Qr(xs))t=!1;else try{var e="__mplssupport__";Yh.A(e,"xyz"),'"xyz"'!==Yh.q(e)&&(t=!1),Yh.F(e)}catch(e){t=!1}return t||$s.error("localStorage unsupported; falling back to cookie store"),Jh=t,t},j(t){$s.error("localStorage error: "+t)},q(t){try{return null==xs?void 0:xs.localStorage.getItem(t)}catch(t){Yh.j(t)}return null},H(t){try{return JSON.parse(Yh.q(t))||{}}catch(t){}return null},A(t,e){try{return null==xs||xs.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Yh.j(t)}return!1},F(t){try{null==xs||xs.localStorage.removeItem(t)}catch(t){Yh.j(t)}}},Xh=[ku,"distinct_id",Uu,Hu,mh,gh,dh],td={},ed={P:()=>!0,j(t){$s.error("memoryStorage error: "+t)},q:t=>td[t]||null,H:t=>td[t]||null,A:(t,e)=>(td[t]=e,!0),F(t){delete td[t]}},rd=null,id={P(){if(!Yr(rd))return rd;if(rd=!0,Qr(xs))rd=!1;else try{var t="__support__";id.A(t,"xyz"),'"xyz"'!==id.q(t)&&(rd=!1),id.F(t)}catch(t){rd=!1}return rd},j(t){$s.error("sessionStorage error: ",t)},q(t){try{return null==xs?void 0:xs.sessionStorage.getItem(t)}catch(t){id.j(t)}return null},H(t){try{return JSON.parse(id.q(t))||null}catch(t){}return null},A(t,e){try{return null==xs||xs.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){id.j(t)}return!1},F(t){try{null==xs||xs.sessionStorage.removeItem(t)}catch(t){id.j(t)}}},nd=Ds("[Stylesheet Loader]"),sd=xs,od=Ts,ad="#020617",ld={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Zl.Right,widgetType:Vl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:ad,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},ud=[Zl.Center,Zl.Left,Zl.Right];function hd(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function dd(t){var e;void 0===t&&(t=ld.backgroundColor),"#"===t[0]&&(e=hd(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=hd(r)),!e)return ad;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?ad:"white"}return ad}var cd=(t,e,i)=>{var n=Rd(t),s=od.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=od.createElement("div");((t,e,i)=>{var n=r({},ld,i),s=t.style,o=!ud.includes(n.position)||e===Ql.Widget&&(null==i?void 0:i.widgetType)===Vl.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||dd(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",dd(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||dd(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",dd(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||dd(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return Vr(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(nd.error("prepare_external_dependency_stylesheet returned null"),null)})(od,':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return od.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},vd=t=>{var e=t.responses,i=t.survey,n=t.surveySubmissionId,s=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage;s?(bu(i),s.capture(Xl.SENT,r({[tu.SURVEY_NAME]:i.name,[tu.SURVEY_ID]:i.id,[tu.SURVEY_ITERATION]:i.current_iteration,[tu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[tu.SURVEY_SUBMISSION_ID]:n,[tu.SURVEY_COMPLETED]:o},l&&{[tu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},nu(e,i),a,{$set:{[su(i,"responded")]:!0}})),o&&(sd.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Id(i),s.reloadFeatureFlags())):cu.error("[survey sent] event not captured, PostHog instance not found.")},fd=(t,e,i)=>{return r({[tu.SURVEY_NAME]:t.name,[tu.SURVEY_ID]:t.id,[tu.SURVEY_ITERATION]:t.current_iteration,[tu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[tu.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!Xr(t))))},(null==e?void 0:e.surveyLanguage)&&{[tu.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[tu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},nu(null==e?void 0:e.responses,t));var n},pd=(t,e,i,n)=>{if(e){if(!i){var s=Ed(t);e.capture(Xl.DISMISSED,r({},fd(t,s,e),n&&{[tu.SURVEY_LANGUAGE]:n},{$set:{[su(t,"dismissed")]:!0}})),Id(t),bu(t),sd.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else cu.error("[survey dismissed] event not captured, PostHog instance not found.")},gd=(t,e)=>{if(e){var r=(t=>mu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Ed(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(Xl.ABANDONED,fd(t,i,e),{transport:"sendBeacon"})}}else cu.error("[survey abandoned] event not captured, PostHog instance not found.")},md=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),yd=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,bd=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?yd(t.questions,md(t.questions)):t.questions,_d=t=>du(t)||Md(t),wd=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,el(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Ba++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),xd=()=>Fl(wd),kd=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,s,o,a=Va({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Ea.call(arguments,2):r),Qa(t.type,a,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function Sd(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n=ao(e);if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return zh[o](s,[n])}var Td=t=>mu(gu,t),Cd=(t,e)=>{try{localStorage.setItem(Td(t),JSON.stringify(e))}catch(t){cu.error("Error setting in-progress survey state in localStorage",t)}},Ed=t=>{try{var e=localStorage.getItem(Td(t));if(e)return JSON.parse(e)}catch(t){cu.error("Error getting in-progress survey state from localStorage",t)}return null},Md=t=>{var e=Ed(t);return!Xr(null==e?void 0:e.surveySubmissionId)},Id=t=>{try{localStorage.removeItem(Td(t))}catch(t){cu.error("Error clearing in-progress survey state from localStorage",t)}};function Rd(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Pd(t,e,r){if(void 0===e&&(e=Zl.Right),t===Ql.ExternalSurvey)return{};switch(e){case Zl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Zl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Zl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Zl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Zl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Zl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Zl.Left:return{left:"30px"};case Zl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Ql.Widget&&r===Vl.Tab?"60px":"30px"}}}var Od=0;function Ld(t,e,r,i,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Od,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Ma.vnode&&Ma.vnode(u),u}var Ad=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),$d=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Dd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Nd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ld("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),qd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),jd=Ld("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ld("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),Bd=function(t){var e=(void 0===t?{}:t).fill,r=void 0===e?"currentColor":e;return Ld("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ld("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ld("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]})},Ud=Ld("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ld("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ld("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ld("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ld("g",{mask:"url(#mask0_2415_6911)",children:[Ld("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Ld("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Ld("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Ld("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Ld("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Ld("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Ld("defs",{children:Ld("clipPath",{id:"clip0_2415_6911",children:Ld("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Hd(t){var e=t.urlParams,r=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return Ld("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ud]})}function zd(t){var e=t.text,r=t.submitDisabled,i=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,l=t.canGoBack,u=t.onBack,h=Fl(wd).isPreviewMode,d=!!l&&!!u,c=!a&&Ld("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==xs||xs.open(s)),h?null==o||o():n()},children:e});return Ld("div",{className:"bottom-section",children:[d?Ld("div",{className:"form-buttons form-buttons-with-back",children:[Ld("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:i.backButtonText||"Back"}),c]}):c,!i.whiteLabel&&Ld(Hd,{urlParams:{utm_source:"survey-footer"}})]})}function Wd(t){var e=t.question,r=t.forceDisableHtml;return Ld("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Ld(e.type===Kl.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&kd({component:Ga("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Vd(t){return Ld("button",{className:"form-cancel",onClick:t.onClick,disabled:Fl(wd).isPreviewMode,"aria-label":"Close survey",type:"button",children:Bd({fill:"black"})})}Ld("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ld("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});var Zd=xs;function Gd(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Fl(wd).isPopup;return Ol((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Zs(Zd,"keydown",t),()=>{Zd.removeEventListener("keydown",t)}}),[o]),Ld("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ld(Vd,{onClick:()=>o()}),Ld("h3",{className:"thank-you-message-header",children:e}),r&&kd({component:Ga("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Ld(zd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Qd=t=>Wr(t)&&t.every((t=>Kr(t)));function Kd(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=xd().isPreviewMode,d=Ll(null),c=Pl((()=>Kr(a)?a:"")),v=c[0],f=c[1],p=null==i?void 0:i.disableAutofocus;Ol((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+o,m=Al((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case Tr:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Cr:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(v,e.validation,e.optional)),[v,e.validation,e.optional]),y=jn(e.validation,Tr),b=jn(e.validation,Cr),_=Al((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(v.trim())},x=()=>{m||s(v.trim())};return Ld(Ka,{children:[Ld("div",{className:"question-container",children:[Ld(Wd,{question:e,forceDisableHtml:r,htmlFor:g}),Ld("textarea",{ref:d,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?x():w())},value:v}),_&&Ld("div",{className:"validation-hint",children:_})]}),Ld(zd,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function Jd(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Ld(Ka,{children:[Ld("div",{className:"question-container",children:Ld(Wd,{question:e,forceDisableHtml:t.forceDisableHtml})}),Ld(zd,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function Yd(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=r.scale,c=10===r.scale?0:1,v=Pl((()=>ti(l)?l:Wr(l)&&l.length>0&&ti(parseInt(l[0]))?parseInt(l[0]):Kr(l)&&ti(parseInt(l))?parseInt(l):null)),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=xd().isPreviewMode,y=t=>m?a(t):o(t);return Ld(Ka,{children:[Ld("div",{className:"question-container",children:[Ld(Wd,{question:r,forceDisableHtml:i}),Ld("div",{className:"rating-section",children:[Ld("div",{className:"rating-options",children:["emoji"===r.display&&Ld("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=nc[r.scale])?void 0:e.map(((t,e)=>Ld("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e)))}),"number"===r.display&&Ld("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-c+1)+", minmax(0, 1fr))"},children:sc(r.scale).map(((t,e)=>Ld(Xd,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e)))})]}),!g&&Ld("div",{className:"rating-text",children:[Ld("div",{children:r.lowerBoundLabel}),Ld("div",{children:r.upperBoundLabel})]})]})]}),Ld(zd,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Yr(f)&&!r.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:r.skipSubmitButton,canGoBack:u,onBack:h})]})}function Xd(t){var e=t.num,r=t.setActiveNumber;return Ld("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function tc(t){var e=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Ll(null),c=Al((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=yd(e,md(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),v=Pl((()=>((t,e)=>Kr(t)||Qd(t)?t:e===Kl.SingleChoice?null:[])(l,e.type))),f=v[0],p=v[1],g=Pl((()=>((t,e)=>{if(Kr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Qd(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),m=g[0],y=g[1],b=xd().isPreviewMode,_=e.type===Kl.SingleChoice,w=e.type===Kl.MultipleChoice,x=e.skipSubmitButton&&_&&!e.hasOpenChoice,k=(t,e)=>{if(e){var i=!m.isSelected;return y((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),_&&p(""),void(i&&setTimeout((()=>{var t;return null==(t=d.current)?void 0:t.focus()}),75))}if(_)return p(t),y((t=>r({},t,{isSelected:!1,inputValue:""}))),void(x&&(o(t),b&&a(t)));w&&Wr(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},S=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>r({},t,{inputValue:e}))),_&&p(e)},T=t=>{t.stopPropagation(),"Enter"!==t.key||C()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y((t=>r({},t,{isSelected:!1,inputValue:""}))),_&&p(null))},C=()=>!(e.optional||!Yr(f)&&(!Wr(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?Wr(f)&&(b?a([...f,m.inputValue]):o([...f,m.inputValue])):b?a(f):o(f)};return Ld(Ka,{children:[Ld("div",{className:"question-container",children:[Ld(Wd,{question:e,forceDisableHtml:i}),Ld("fieldset",{className:"multiple-choice-options limit-height",children:[Ld("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),c.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?m.isSelected:_?f===t:Wr(f)&&f.includes(t);return Ld("label",{className:i?"choice-option-open":"",children:[Ld("div",{className:"response-choice",children:[Ld("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>k(t,i),id:s,"aria-controls":o}),Ld("span",{children:i?t+":":t})]}),i&&Ld("input",{type:"text",ref:d,id:o,name:"question"+n+"Open",value:m.inputValue,onKeyDown:T,onInput:S,onClick(e){m.isSelected||k(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},r)}))]})]}),Ld(zd,{text:e.buttonText||"Submit",submitDisabled:C(),appearance:s,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var ec=[1,2,3,4,5],rc=[1,2,3,4,5,6,7],ic=[0,1,2,3,4,5,6,7,8,9,10],nc={2:[qd,jd],3:[$d,Fd,Ad],5:[Dd,$d,Fd,Ad,Nd]};function sc(t){switch(t){case 5:default:return ec;case 7:return rc;case 10:return ic}}var oc=Ds("[Surveys]");function ac(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Jl.End:s;if(n.branching.type===Jl.End)return Jl.End;if(n.branching.type===Jl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Jl.ResponseBased){if(n.type===Kl.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Jl.End?Jl.End:s}}else if(n.type===Kl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Jl.End?Jl.End:s}}return s}return oc.warn("Falling back to next question index due to unexpected branching type"),s}var lc="https?://(.*)",uc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],hc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...uc],dc="<masked>",cc=["li_fat_id"];function vc(t,e,r){if(!Ts)return{};var i,n=e?[...uc,...r||[]]:[],s=fc(Xs(Ts.URL,n,dc),t),o=(i={},qs(cc,(function(t){var e=Zh(t);i[t]=e||null})),i);return js(o,s)}function fc(t,e){var r=hc.concat(e||[]),i={};return qs(r,(function(e){var r=Ys(t,e);i[e]=r||null})),i}function pc(t){var e=function(t){return t?0===t.search(lc+"google.([^/?]*)")?"google":0===t.search(lc+"bing.com")?"bing":0===t.search(lc+"yahoo.com")?"yahoo":0===t.search(lc+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!Yr(e)){i.$search_engine=e;var n=Ts?Ys(Ts.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function gc(){return navigator.language||navigator.userLanguage}var mc="$direct";function yc(){return(null==Ts?void 0:Ts.referrer)||mc}function bc(t,e,r){void 0===r&&(r=!1);var i=t?[...uc,...e||[]]:[],n=r?kn(null==Cs?void 0:Cs.href):null==Cs?void 0:Cs.href,s=null==n?void 0:n.substring(0,1e3);return{r:yc().substring(0,1e3),u:s?Xs(s,i,dc):void 0}}function _c(t,e){var r;void 0===e&&(e=!1);var i=t.r,n=t.u,s=e?kn(n):n,o={$referrer:i,$referring_domain:null==i?void 0:i==mc?mc:null==(r=Ks(i))?void 0:r.host};if(s){o.$current_url=s;var a=Ks(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=fc(s);js(o,l)}if(i){var u=pc(i);js(o,u)}return o}function wc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function xc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var kc=Ds("[SurveyTranslations]");function Sc(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=ou(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?ou(t.language):null}(r);if(s)return null==e||e.info("Using person property language: "+s),s;var o=ou(i);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Vr(t.get_property)?t.get_property(Xu):void 0,locale:gc()},kc)}(e);if(!r)return kc.info("No user language detected"),{survey:t,language:null};var i=uu(t,r,kc);return{survey:i.survey,language:i.matchedKey}}var Tc=xs,Cc=Ts,Ec="ph:show_survey_widget",Mc="PHWidgetSurveyClickListener";function Ic(t,e){try{var r=t.getBoundingClientRect(),i=Tc.innerHeight,n=Tc.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:ld.zIndex}}catch(t){return cu.warn("Failed to calculate trigger position:",t),null}}class Rc{constructor(t){var e=this;this.B=new Map,this.U=new Map,this.W=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(eh);if(t)for(var e of t)Md(e)&&gd(e,this._posthog)},this.handlePopoverSurvey=function(t,i,n){var s,o,a,l,u,h=(void 0===n?{}:n).resumeDelayFromActivation,d=void 0!==h&&h,c=e.V(t),v=c.survey,f=c.language,p=null!=i&&i.position||null!=i&&i.selector?r({},v,{appearance:r({},v.appearance,i.position&&{position:i.position},i.selector&&{widgetSelector:i.selector})}):v;e.Z(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.$(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.G(p);var _={};if((null==(o=p.appearance)?void 0:o.position)===Zl.NextToTrigger&&null!=(a=p.appearance)&&a.widgetSelector){var w,x=Cc.querySelector(p.appearance.widgetSelector);x&&(_=Ic(x,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||ld.maxWidth))||{})}var k=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,S=cd(p,e._posthog).shadow,T={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Y,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(0>=k)return gl(Ld(Ac,r({},T)),S);var C=()=>{if(!e.K(p))return cu.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Y(p);gl(Ld(Ac,r({},T,{survey:r({},p,{appearance:r({},p.appearance,{surveyPopupDelaySeconds:0})})})),S)},E=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,M=ti(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*k-M);if(0>=I)return C();var R=Tc.setTimeout((()=>{e.B.delete(p.id),C()}),I);e.B.set(p.id,R)}},this.J=t=>{var e=this.V(t),r=e.survey,i=e.language,n=cd(r,this._posthog),s=n.shadow;n.isNewlyCreated&&gl(Ld($c,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),s)},this.X=t=>{var e=this.U.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Mc),this.U.delete(t),cu.info("Removed click listener for survey "+t))},this.ee=t=>{this.te(t)||(this.re(t),this.X(t.id))},this.te=t=>{try{var e,r=Cc.querySelector(Rd(t,!0));return!(null==r||null==(e=r.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.ne=(t,e)=>{var r=Cc.querySelector(e),i=this.U.get(t.id);if(r){if(this.J(t),i){if(r===i.element)return;cu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.X(t.id)}if(!r.hasAttribute(Mc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Zl.NextToTrigger?Ic(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||ld.maxWidth)):{};Tc.dispatchEvent(new CustomEvent(Ec,{detail:{surveyId:t.id,position:n}}))};Zs(r,"click",n),r.setAttribute(Mc,"true"),this.U.set(t.id,{element:r,listener:n,survey:t}),cu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.ee(t)},this.renderPopover=t=>{var e=this.V(t),r=e.survey,i=e.language,n=cd(r,this._posthog).shadow;gl(Ld(Ac,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Y,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.V(t),s=n.survey,o=n.language,a=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(a=this.ie(s,o,r)),gl(Ld(Ac,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Y,isPopup:!1,properties:r,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.K(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===Ql.Popover||t.type===Ql.Widget)),i=new Set(r.map((t=>t.id)));for(var n of Array.from(e.B.keys()))i.has(n)||e.cancelSurvey(n);var s=e.ae(r),o=new Set;s.forEach((t=>{if(t.type===Ql.Widget){var r,i,n,s;if((null==(r=t.appearance)?void 0:r.widgetType)===Vl.Tab)return void e.J(t);(null==(i=t.appearance)?void 0:i.widgetType)===Vl.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.ne(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Yr(e.oe)&&t.type===Ql.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.U.forEach((t=>{var r=t.survey;o.has(r.id)||e.ee(r)}))}),t)},this.G=t=>{Yr(this.oe)||cu.error("Survey "+this.oe+" already in focus. Cannot add survey "+t.id+"."),this.oe=t.id},this.Y=t=>{this.oe!==t.id&&cu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Z(t.id),this.oe=null,this.re(t)},this._posthog=t,this.oe=null}Z(t){var e=this.B.get(t);e&&(clearTimeout(e),this.B.delete(t))}cancelSurvey(t){this.B.has(t)&&(cu.info("Cancelled pending survey "+t),this.Z(t),this.oe===t&&(this.oe=null))}ae(t){return t.sort(((t,e)=>{var r,i,n=Md(t),s=Md(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Yl.Always,a=e.schedule===Yl.Always;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}V(t){return Sc(t,this._posthog)}ie(t,e,r){if(this.W.has(t.id))return!1;var i=function(t){var e={},r=!1,i=Tc.location.search.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var o=s.split("="),a=o[0],l=o[1];if(a&&!Qr(l)){var u=decodeURIComponent(a),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var c=parseInt(d[1],10);e[c]||(e[c]=[]),e[c].push(h)}}else r=!0}}return{params:e,autoSubmit:r}}(),n=i.params;if(0===Object.keys(n).length)return!1;cu.info("[Survey Prefill] Detected URL prefill parameters");var s=this.se(t,n,e);if(!s)return!1;var o=s.responses,a=s.submissionId,l=s.isSurveyCompleted,u=s.skippedResponses;return(Object.keys(u).length>0&&t.enable_partial_responses||l)&&vd({responses:l?o:u,survey:t,surveySubmissionId:a,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:e}),this.W.add(t.id),l}$(t,e,r,i){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=Wr(o)?o.map(String):[String(o)]}cu.info("[Survey] Processing initial responses");var a=this.se(t,n,i);if(!a)return!1;var l=a.isSurveyCompleted;return vd({responses:a.responses,survey:t,surveySubmissionId:a.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:r,surveyLanguage:i}),l}se(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=ru(t.id);try{switch(t.type){case Kl.SingleChoice:if(!t.choices||0===t.choices.length)return void $s.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void $s.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Kl.MultipleChoice:if(!t.choices||0===t.choices.length)return void $s.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void $s.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((e=>t.choices[e])))];a.length>l.length&&$s.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Kl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void $s.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:$s.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){$s.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return cu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=jh(),s=Object.keys(e).map((t=>parseInt(t,10))),o=function(t,e,r){for(var i=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>i&&o>a&&(a++,e.includes(i));){var l=t.questions[i];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=ru(l.id);Qr(r[u])||(n[u]=r[u])}s.push(i);var h=ac(t,i,l.id?r[ru(l.id)]:null);if(h===Jl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:s}}(t,s,i),a=o.startQuestionIndex,l=o.skippedResponses,u=a>=t.questions.length;return Cd(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,visitedIndices:o.skippedIndices,surveyLanguage:r}),cu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:u,skippedResponses:l}}catch(t){return cu.error("[Survey Prefill] Error handling prefill:",t),null}}ue(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}le(t){return!t.conditions||Sd(t,this._posthog)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!Ps)return!1;var s=_n(Ps,{userAgentDataPlatform:null==Ss||null==(r=Ss.userAgentData)?void 0:r.platform,maxTouchPoints:null==Ss?void 0:Ss.maxTouchPoints,screenWidth:null==xs||null==(i=xs.screen)?void 0:i.width,screenHeight:null==xs||null==(n=xs.screen)?void 0:n.height,devicePixelRatio:null==xs?void 0:xs.devicePixelRatio});return zh[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==od||!od.querySelector(t.conditions.selector))}(t)}ce(t){var e;return _d(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ue(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!vu(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!_u.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.ue(t.linked_flag_key,n))return i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i;if(!this.ue(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this.ce(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Yh.q("lastSeenSurveyDate"))?(t=>!!Yh.q(yu(t))&&!_d(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.ve(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}ve(t){var e;if(!hu(t)&&!fu(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}de(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ue(e)}))}K(t){return this.checkSurveyEligibility(t).eligible&&this.le(t)&&this.ve(t)&&this.de(t)}re(t){try{var e=Cc.querySelector(Rd(t,!0));null!=e&&e.shadowRoot&&gl(null,e.shadowRoot),null==e||e.remove()}catch(e){cu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.Y,surveyInFocus:this.oe,surveyTimeouts:this.B,handleWidget:this.J,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ne,sortSurveysByAppearanceDelay:this.ae,checkFlags:this.de.bind(this),isSurveyFeatureFlagEnabled:this.ue.bind(this)}}}function Pc(t,e){if(Cc&&Tc){var r,i=new Rc(t);if(t.config.disable_surveys_automatic_display)return cu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return cu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Qr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Zs(Cc,"visibilitychange",(()=>{Cc.hidden?Qr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Oc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Ol((()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===Ql.Widget,s=Sd(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===Vl.Tab&&r;if(!s)return cu.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);o&&(cu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Zs(Tc,"popstate",r),Zs(Tc,"hashchange",r);var s=Tc.history.pushState,l=Tc.history.replaceState;return Tc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.apply(this,e),r()},Tc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];l.apply(this,e),r()},()=>{Tc.removeEventListener("popstate",r),Tc.removeEventListener("hashchange",r),Tc.history.pushState=s,Tc.history.replaceState=l}}}),[o,e,i,n,a])}function Lc(t){switch(void 0===t&&(t=Gl.Right),t){case Gl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Gl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Gl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Ac(t){var e,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.style,c=void 0===d?{}:d,v=t.previewPageIndex,f=t.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=t.isPopup,m=void 0===g||g,y=t.onPreviewSubmit,b=void 0===y?()=>{}:y,_=t.onPreviewBack,w=void 0===_?()=>{}:_,x=t.onPopupSurveyDismissed,k=void 0===x?()=>{}:x,S=t.onCloseConfirmationMessage,T=void 0===S?()=>{}:S,C=t.properties,E=t.isSurveyCompleted,M=t.skipShownEvent,I=t.surveyLanguage,R=Ll(null),P=Number.isInteger(v),O=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,L=function(t,e,i,n,s,o,a,l,u){var h=Pl(n||0===i||t.type===Ql.ExternalSurvey),d=h[0],c=h[1],v=Pl(!1),f=v[0],p=v[1],g=()=>{var e=()=>{o&&s(t),c(!1)};Cc.startViewTransition?Cc.startViewTransition((()=>{var t;null==a||null==(t=a.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},m=e=>{e.detail.surveyId===t.id&&g()};return Ol((()=>{if(e){if(!n){var s=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return g();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{g()}),5e3)}},o=()=>{if(Sd(t,e)){c(!0),Tc.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(Xl.SHOWN,r({[tu.SURVEY_NAME]:t.name,[tu.SURVEY_ID]:t.id,[tu.SURVEY_ITERATION]:t.current_iteration,[tu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[tu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};if(Zs(Tc,"PHSurveyClosed",m),Zs(Tc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),Tc.removeEventListener("PHSurveyClosed",m),Tc.removeEventListener("PHSurveySent",s)}}return o(),()=>{Tc.removeEventListener("PHSurveyClosed",m),Tc.removeEventListener("PHSurveySent",s)}}}else cu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Oc({survey:t,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:c,hidePopupWithViewTransition:g}}(l,h,O,P,p,m,R,M,I),A=L.isPopupVisible,F=L.hidePopupWithViewTransition,D=L.isSurveySent||v===l.questions.length||!0===E,N=Al((()=>{var t=Ed(l),e=(null==t?void 0:t.surveySubmissionId)||jh();return{isPreviewMode:P,previewPageIndex:v,onPopupSurveyDismissed(){I?pd(l,h,P,I):pd(l,h,P),k()},isPopup:m||!1,surveySubmissionId:e,onPreviewSubmit:b,onPreviewBack:w,posthog:h,properties:C,surveyLanguage:I}}),[P,v,m,h,l,k,b,w,C,I]);return A?Ld(wd.Provider,{value:N,children:Ld("div",{className:"ph-survey",style:r({},Pd(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:R,children:D?Ld(Gd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||ld,onClose(){F(),T()}}):Ld(Fc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function Fc(t){var e,i,n=t.survey,s=t.forceDisableHtml,o=t.posthog,a=Al((()=>{var t=Ed(n);if(!t)return null;var e=ti(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&n.questions.length>t.lastQuestionIndex?t:(Id(n),null)}),[n]),l=Pl((()=>(null!=a&&a.responses&&cu.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{}))),u=l[0],h=l[1],d=Fl(wd),c=d.previewPageIndex,v=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,b=d.properties,_=d.surveyLanguage,w=Pl((()=>{var t=null==a?void 0:a.lastQuestionIndex,e=ti(t)&&t>=0&&n.questions.length>t?t:0;return c||e})),x=w[0],k=w[1],S=Pl((()=>{var t;return(null!==(t=null==a?void 0:a.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&n.questions.length>t))})),T=S[0],C=S[1],E=Al((()=>bd(n)),[n]);Ol((()=>{y&&!Qr(c)&&k(c)}),[c,y]);var M=!(null==(e=n.appearance)||!e.allowGoBack)&&(y?(null!=c?c:0)>0:T.length>0),I=E.at(x);return I?Ld("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&Ld(Vd,{onClick(){v()}}),Ld("div",{className:"survey-box","data-question-index":x,children:Dc({question:I,forceDisableHtml:s,displayQuestionIndex:x,appearance:n.appearance||ld,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,s=t.questionId;if(o)if(s){var a=ru(s),l=r({},u,{[a]:e});h(l);var d=ac(n,i,e),c=d===Jl.End,v=[...T,i];if(c||(C(v),k(d),Cd(n,{surveySubmissionId:m,responses:l,lastQuestionIndex:d,visitedIndices:v,surveyLanguage:_})),n.enable_partial_responses||c){var f=new Set(v.map((t=>{var e;return null==(e=E[t])?void 0:e.id})).filter((t=>!!t)).map((t=>ru(t)))),p=Object.fromEntries(Object.entries(l).filter((t=>f.has(t[0]))));vd({responses:p,survey:n,surveySubmissionId:m,isSurveyCompleted:c,posthog:o,properties:b,surveyLanguage:_})}}else cu.error("onNextButtonClick called without a questionId.");else cu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:x,questionId:I.id}),onPreviewSubmit:p,initialValue:I.id?u[ru(I.id)]:void 0,canGoBack:M,onBack(){if(y)g();else if(0!==T.length){var t=T[T.length-1],e=T.slice(0,-1);C(e),k(t),Cd(n,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:_})}}})})]}):null}function $c(t){var e,r,i,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,c=t.surveyLanguage,v=Pl(!0),f=v[0],p=v[1],g=Pl(!1),m=g[0],y=g[1],b=Pl({}),_=b[0],w=b[1],x=()=>{y(!m)};if(Ol((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===l.id&&(cu.info("Received show event for feedback button survey "+l.id),w(r.detail.position||{}),x())};return Zs(Tc,Ec,e),()=>{Tc.removeEventListener(Ec,e)}}}else cu.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),Oc({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var k=()=>{l.schedule!==Yl.Always&&p(!1),setTimeout((()=>{y(!1)}),200)};return Ld(Ka,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ld("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Gl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:Lc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Ld(Ac,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:c})]})}var Dc=t=>{var e=t.question,i=t.onSubmit,n=t.onPreviewSubmit,s={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){i(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Kl.Open:return Ga(Kd,r({},s,{question:e,key:e.id}));case Kl.Link:return Ga(Jd,r({},s,{question:e,key:e.id}));case Kl.Rating:return Ga(Yd,r({},s,{question:e,key:e.id}));case Kl.SingleChoice:case Kl.MultipleChoice:return Ga(tc,r({},s,{question:e,key:e.id}));default:return cu.error("Unsupported question type: "+e.type),null}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.generateSurveys=Pc,Ca.extendPostHogWithSurveys=Pc;var Nc=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),qc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return Nc(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return Nc(e,JSON.stringify(t.slice(0,n)),r)},jc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Bc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},Uc=(t,e,r)=>{if(!r.truncated)if(Zr(t)){if(r.seen.has(t))return void Bc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Uc(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else Bc(e,t,r)},Hc=function(t,e,r,i,n,s){if(void 0===n&&(n=!1),!jc(t))return!n||Nc(e,"null",r);if(Yr(t)||(t=>{try{return ti(t)||ri(t)}catch(t){return!1}})(t))return Nc(e,JSON.stringify(t),r);if("string"==typeof t)return qc(t,e,r);if(!Zr(t)&&!Wr(t))return Nc(e,JSON.stringify(t),r);if(i.has(t))return qc("[Circular]",e,r);i.add(t);try{var o=t.toJSON;if(Vr(o))return Hc(o.call(t),e,r,i,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return qc(String(t.valueOf()),e,r);if("[object Number]"===a||"[object Boolean]"===a)return Nc(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Hc(l,e,r,i,n,s)}if(Wr(t)){if(!Nc(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Nc(e,",",r))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Hc(d,e,r,i,!0))return!1}return Nc(e,"]",r)}if(!Nc(e,"{",r))return!1;var c=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(s)try{Uc(f,v,s)}catch(t){}if(jc(f)){var p=(c?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!Nc(e,p,r))return!1;var b=e.length,_=Hc(f,e,r,i,!1),w=r.truncated;if(e.length!==b){if(c=!1,!_)return!1}else if(e.length=g,r.remaining=m,r.truncated=_?y:w,!_)return!1}}}catch(t){}return Nc(e,"}",r)},zc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.logs={initializeLogs(t){var e={host:Ca.location.host},i=!1,n=function(n){var s=Ca.console[n],o=(s=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{if(l.length>0&&!i&&t.is_capturing()){var h;i=!0,o=!0;var d=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=Zr(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Nc(r," ",i))&&Hc(t[s],r,i,new WeakSet,!1,0===s?n:void 0);s++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}})(l),c=d.body,v=d.attributes,f=r({},e,d.truncated?{body_truncated:"true"}:{});null==(h=t.logs)||h.he({level:zc[n],body:c,attributes:r({"log.source":"console."+n},f,v)})}}catch(t){}finally{o&&(i=!1),s.apply(Ca.console,l)}})(s);o.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),Ca.console[n]=o};for(var s of Object.keys(zc))n(s)}};var Wc=Ds("[Error tracking]");function Vc(){return new Wn([new ns,new fs,new os,new ss,new cs,new ds,new ls,new vs],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=rs.test(l)?l.replace(rs,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=is)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,is).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Vn});var i}))}(s)}}("web:javascript",Yn,es))}var Zc=Ds("[ExceptionAutocapture]"),Gc=Vc(),Qc={wrapOnError(t){var e=xs;e||Zc.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=Gc.buildFromUnknown((t=>{var e=t[0],r=t[1],i=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Kr(e)&&Kr(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:r,lineno:i,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return t(o),!!Vr(r)&&null!==(e=r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection(t){var e=xs;e||Zc.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=Gc.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),!!Vr(r)&&null!==(i=r(e))&&void 0!==i&&i},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError(t){var e=console;e||Zc.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Gc.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(a),Vr(r)&&r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.errorWrappingFunctions=Qc,Ca.posthogErrorWrappingFunctions=Qc;var Kc="X-POSTHOG-SESSION-ID",Jc="X-POSTHOG-WINDOW-ID",Yc="X-POSTHOG-DISTINCT-ID",Xc=[Kc,Jc,Yc],tv=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],ev=(t,e)=>({}.hasOwnProperty.call(t,e)),rv=t=>"object"==typeof t&&!Yr(t)||Vr(t),iv=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),nv=t=>{try{var e;return iv(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==xs||null==(e=xs.location)?void 0:e.href).toString()}catch(t){return}},sv=(t,e,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(Wr(t)&&!t.includes(s))return!1;var o=!1;if(r){var a=r.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(Kc,a.sessionId),n.set(Jc,l),o=!0}var u=(t=>Vr(t)?t():t)(e);return u&&u!==yh&&(n.set(Yc,u),o=!0),o};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{};var ov={_patchFetch:(t,e,i)=>no(xs,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],l=a;try{var u=nv(s);if(u)if(iv(s)){var h=new Request(s,o);sv(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(rv(o)?o.headers:void 0);if(sv(t,e,i,u,d)){var c=((t,e)=>{if(Qr(t)||Yr(t))return{headers:e};if(rv(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>ev(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>ev(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),tv.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&tv.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);c&&(l=[s,c])}}}catch(t){l=a}return n.apply(this,l)})),_patchXHR:(t,e,r)=>no(xs.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=nv(s);d&&sv(t,e,r,d,h);var c=i.call(u,n,s,o,a,l);return Xc.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),c}))};Ca.__PosthogExtensions__.tracingHeadersPatchFns=ov,Ca.postHogTracingHeadersPatchFns=ov,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0});let av=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var lv=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},uv=t=>{if("loading"===document.readyState)return"loading";var e=lv();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},hv=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},dv=t=>{var e="";try{for(;9!==(null==(r=t)?void 0:r.nodeType);){var r,i,n=t,s=n.id?"#"+n.id:[hv(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},cv=new WeakMap;function vv(t,e){var r=cv.get(e);return r||(r=new WeakMap,cv.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}var fv=-1,pv=()=>fv,gv=t=>{addEventListener("pageshow",(e=>{e.persisted&&(fv=e.timeStamp,t(e))}),!0)},mv=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},yv=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},bv=()=>{var t,e;return null!==(t=null==(e=lv())?void 0:e.activationStart)&&void 0!==t?t:0},_v=-1,wv=new Set,xv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,kv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of wv)e();isFinite(_v)||(_v="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",kv,!0))}},Sv=function(t){if(void 0===t&&(t=!1),t&&(_v=1/0),0>_v){var e,r=bv(),i=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=r)))?void 0:e.startTime;_v=null!=i?i:xv(),addEventListener("visibilitychange",kv,!0),addEventListener("prerenderingchange",kv,!0),gv((()=>{setTimeout((()=>{_v=xv()}))}))}return{get firstHiddenTime(){return _v},onHidden(t){wv.add(t)}}},Tv=function(t,e,r,i,n,s,o){void 0===e&&(e=-1),void 0===i&&(i=0);var a=lv(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return r?u=r:0>pv()?a&&(document.prerendering||bv()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:i||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},Cv=function(t,e,i){void 0===i&&(i={});try{var n=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(n.length>0){var s=new PerformanceObserver((t=>{queueMicrotask((()=>{var r=t.getEntries();n.length>1&&r.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(r)}))}));for(var o of n)s.observe(r({type:o,buffered:!0},i));return s}}catch(t){}},Ev=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Mv=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Iv=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Rv=class{constructor(){this.u=void 0}};var Pv,Ov=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Lv=[1800,3e3],Av=function(t,e){void 0===e&&(e={});var r=Ev(e);Ov((()=>{var i,n=vv(e,Rv),s=Sv(),o=Tv("FCP"),a=Cv(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-bv(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,i(!0)))}));a&&(i=mv(t,o,Lv,e.reportAllChanges),gv((r=>{o=Tv("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pv()),i=mv(t,o,Lv,e.reportAllChanges),yv((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&Cv(["soft-navigation"],(r=>{r.forEach((r=>{n.u&&r.navigationId&&Mv(n.u,r);var s=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=Tv("FCP",s,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=mv(t,o,Lv,e.reportAllChanges))(!0)}))}),e)}))},Fv=[.1,.25],$v=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],Dv=0,Nv=1/0,qv=0,jv=t=>{for(var e of t)e.interactionId&&(Nv=Math.min(Nv,e.interactionId),qv=Math.max(qv,e.interactionId),Dv=qv?(qv-Nv)/7+1:0)},Bv=()=>{var t;return Pv?Dv:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Uv=0;let Hv=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){Uv=Bv(),this.h.length=0,this.v.clear()}T(t){var e=Bv()-Uv,r=Math.min(this.h.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.h[r]:{D:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.h.at(-1),i=this.v.get(t.interactionId);if(i||10>this.h.length||t.duration>r.D){var n;if(i?t.duration>i.D?(i.entries=[t],i.D=t.duration):t.duration===i.D&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.v.set((i={id:t.interactionId,entries:[t],D:t.duration}).id,i),this.h.push(i)),this.h.sort(((t,e)=>e.D-t.D)),this.h.length>10){var s=this.h.splice(10);for(var o of s)this.v.delete(o.id)}null==(n=this.m)||n.call(this,i)}}}};var zv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Iv(t),s=-1,o=()=>{i(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},Wv=[200,500];let Vv=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var Zv=[2500,4e3],Gv={onLCP(t,e){void 0===e&&(e={});var i=vv(e=Object.assign({},e),Vv),n=new WeakMap;Ev(e)&&(i.u=new Map),i.p=t=>{var r=t.element;if(r){var i,s=null!==(i=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==i?i:dv(r);n.set(t,s)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var r=!1,i=Ev(e);Ov((()=>{var n,s=Sv(),o=Tv("LCP"),a=vv(e,Vv),l=(i,a,l,u,h)=>{o=Tv("LCP",-1,i,a,l,u,h),n=mv(t,o,Zv,e.reportAllChanges),r=!1,"soft-navigation"===i&&(s=Sv(!0))},u=t=>{a.u&&t.navigationId&&Mv(a.u,t),r||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))if(r)if("soft-navigation"!==r.entryType){var l=0,h=[],d=r.startTime;if("largest-contentful-paint"===r.entryType)l=Math.max(r.startTime-bv(),0),a.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var c,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;d=(null==(c=v.largestContentfulPaint)?void 0:c.renderTime)||0,l=Math.max(d-r.startTime,0),v.largestContentfulPaint&&(a.l(v.largestContentfulPaint),h=[v.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(r)},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");var c=Cv(d,h);if(c){n=mv(t,o,Zv,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=o.id;zv((()=>{if(!r){if(!i)for(var t of(c.disconnect(),v))removeEventListener(t,f,{capture:!0});e===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});gv((i=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pv()),n=mv(t,o,Zv,e.reportAllChanges),yv((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var s,o,a,l,u,h,d=t.entries.at(-1),c=d.url&&performance.getEntriesByType("resource").find((t=>t.name===d.url));e.target=n.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),c&&(e.lcpResourceEntry=c);var v=0,f=0;if("soft-navigation"!==t.navigationType?(v=null!==(s=null==(o=h=lv())?void 0:o.activationStart)&&void 0!==s?s:0,f=null!==(a=null==(l=h)?void 0:l.responseStart)&&void 0!==a?a:0):(v=t.navigationStartTime||0,h=null==(u=i.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-v),g=Math.max(p,c?(c.requestStart||c.startTime)-v:0),m=Math.min(t.value,Math.max(g,c?c.responseEnd-v:0));e=r({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var r=vv(e=Object.assign({},e),av),i=new WeakMap;r.t=t=>{var r;if(null!=t&&null!=(r=t.sources)&&r.length){var n=$v(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:dv(s);i.set(n,a)}}},function(t,e){void 0===e&&(e={});var r=Sv();Av(Iv((()=>{var i,n=Tv("CLS",0),s=vv(e,av),o=(r,o,a,l,u)=>{n=Tv("CLS",0,r,o,a,l,u),s.o=0,i=mv(t,n,Fv,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),i(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);a()},h=["layout-shift"];Ev(e)&&h.push("soft-navigation");var d=Cv(h,u);d&&(i=mv(t,n,Fv,e.reportAllChanges),r.onHidden((()=>{u(d.takeRecords()),i(!0)})),gv((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,pv()),yv(i)})),setTimeout(i))})))}((e=>{t((t=>{var e={};if(t.entries.length){var r,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(r=n.sources)&&r.length){var s=$v(n.sources);s&&(e={largestShiftTarget:i.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:uv(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var r=vv(e=Object.assign({},e),Rv);Ev(e)&&(r.u=new Map),Av((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:uv(pv())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var i=lv(),n=t.entries.at(-1);if(i){var s=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:uv(t.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var o,a=null==(o=r.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=vv(e=Object.assign({},e),Hv),n=[],s=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(zv(d),u=!0)},d=()=>{var t=new Set(i.h.map((t=>a.get(t.entries[0])))),e=s.length-10;s=s.filter(((r,i)=>i>=e||t.has(r)));var r=new Set;for(var l of s){var h=c(l.startTime,l.processingEnd);for(var d of h)r.add(d)}n=n.filter((t=>t.startTime>o||r.has(t))),u=!1};i.p=t=>{var r,i=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var n=s.length-1;n>=0;n--){var l=s[n];if(8>=Math.abs(i-l.renderTime)){(r=l).startTime=Math.min(t.startTime,r.startTime),r.processingStart=Math.min(t.processingStart,r.processingStart),r.processingEnd=Math.max(t.processingEnd,r.processingEnd),e.includeProcessedEventEntries&&r.entries.push(t);break}}r||s.push(r={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&a.set(t,r),h()},i.m=t=>{if(!l.get(t)){var r,i=null==(r=t.entries.find((t=>t.target)))?void 0:r.target;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:dv(i);l.set(t,s)}else{var o,a=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;a&&l.set(t,a)}}};var c=(t,e)=>{var r=[];for(var i of n)if(i.startTime+i.duration>=t){if(i.startTime>e)break;r.push(i)}return r};Cv(["long-animation-frame"],(t=>{n=n.concat(t),h()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Sv();Ov((()=>{var n;"interactionCount"in performance||Pv||(Pv=Cv(["event"],jv,{durationThreshold:0}));var s,o=Tv("INP"),a=vv(e,Hv),l=(r,i,n,l,u)=>{a.M(),o=Tv("INP",-1,r,i,n,l,u),s=mv(t,o,Wv,e.reportAllChanges)},u=()=>{var t=a.T(o.navigationType);t&&t.D!==o.value&&(o.value=t.D,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),zv((()=>{for(var r of t)"soft-navigation"!==r.entryType?a.l(r):h(r);u(),e&&s(!0)}))},c=["event","first-input"];Ev(e)&&c.push("soft-navigation");var v=Cv(c,d,r({},e,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40}));s=mv(t,o,Wv,e.reportAllChanges),v&&(i.onHidden((()=>{d(v.takeRecords(),!0)})),gv((()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pv())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:uv(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.get(r),s=n.processingStart,o=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,o),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),d=c(r.startTime,u),v=i.v.get(r.interactionId),f={interactionTarget:l.get(v),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:o,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:o-u,loadState:uv(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var r=t.interactionTime,i=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&r&&i){var n,s,o=t.inputDelay,a=t.processingDuration,l=0,u=0,h=0,d=0;for(var c of t.longAnimationFrameEntries)for(var v of(u=u+c.startTime+c.duration-c.styleAndLayoutStart,c.scripts)){var f=v.startTime+v.duration;if(f>=r){var p=f-Math.max(r,v.startTime),g=v.duration?p/v.duration*v.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=r+o>v.startTime?"input-delay":r+o+a>v.startTime?"processing-duration":"presentation-delay",n=v,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=r+o+a&&(h=i-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=i-r-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Gv,Ca.__PosthogExtensions__.postHogWebVitalsCallbacks=Gv,Ca.postHogWebVitalsCallbacks=Gv;var Qv=-1,Kv=()=>Qv,Jv=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Qv=e.timeStamp,t(e))}),!0)},Yv=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Xv=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},tf=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},ef=()=>{var t,e;return null!==(t=null==(e=tf())?void 0:e.activationStart)&&void 0!==t?t:0},rf=-1,nf=new Set,sf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,of=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of nf)e();isFinite(rf)||(rf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",of,!0))}},af=function(t){if(void 0===t&&(t=!1),t&&(rf=1/0),0>rf){var e,r=ef(),i=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=r)))?void 0:e.startTime;rf=null!=i?i:sf(),addEventListener("visibilitychange",of,!0),addEventListener("prerenderingchange",of,!0),Jv((()=>{setTimeout((()=>{rf=sf()}))}))}return{get firstHiddenTime(){return rf},onHidden(t){nf.add(t)}}},lf=function(t,e,r,i,n,s,o){void 0===e&&(e=-1),void 0===i&&(i=0);var a=tf(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return r?u=r:0>Kv()?a&&(document.prerendering||ef()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:i||l,navigationInteractionId:n,navigationURL:s||(null==a?void 0:a.name),navigationStartTime:o||0}},uf=new WeakMap;function hf(t,e){var r=uf.get(e);return r||(r=new WeakMap,uf.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}let df=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}};var cf=function(t,e,i){void 0===i&&(i={});try{var n=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(n.length>0){var s=new PerformanceObserver((t=>{queueMicrotask((()=>{var r=t.getEntries();n.length>1&&r.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(r)}))}));for(var o of n)s.observe(r({type:o,buffered:!0},i));return s}}catch(t){}},vf=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},ff=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},pf=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let gf=class{constructor(){this.l=void 0}};var mf,yf=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},bf=[1800,3e3],_f=function(t,e){void 0===e&&(e={});var r=vf(e);yf((()=>{var i,n=hf(e,gf),s=af(),o=lf("FCP"),a=cf(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-ef(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,i(!0)))}));a&&(i=Yv(t,o,bf,e.reportAllChanges),Jv((r=>{o=lf("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Kv()),i=Yv(t,o,bf,e.reportAllChanges),Xv((()=>{o.value=performance.now()-r.timeStamp,i(!0)}))}))),r&&cf(["soft-navigation"],(r=>{r.forEach((r=>{n.l&&r.navigationId&&ff(n.l,r);var s=Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0);o=lf("FCP",s,"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Yv(t,o,bf,e.reportAllChanges))(!0)}))}),e)}))},wf=[.1,.25],xf=0,kf=1/0,Sf=0,Tf=t=>{for(var e of t)e.interactionId&&(kf=Math.min(kf,e.interactionId),Sf=Math.max(Sf,e.interactionId),xf=Sf?(Sf-kf)/7+1:0)},Cf=()=>{var t;return mf?xf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Ef=0;let Mf=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){Ef=Cf(),this.u.length=0,this.v.clear()}M(t){var e=Cf()-Ef,r=Math.min(this.u.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.u[r]:{_:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.v.get(t.interactionId);if(i||10>this.u.length||t.duration>r._){var n;if(i?t.duration>i._?(i.entries=[t],i._=t.duration):t.duration===i._&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.v.set((i={id:t.interactionId,entries:[t],_:t.duration}).id,i),this.u.push(i)),this.u.sort(((t,e)=>e._-t._)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.v.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var If=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=pf(t),s=-1,o=()=>{i(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=r((()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()}),{timeout:e})}},Rf=[200,500];let Pf=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var Of=[2500,4e3],Lf={onLCP(t,e){void 0===e&&(e={});var r=!1,i=vf(e);yf((()=>{var n,s=af(),o=lf("LCP"),a=hf(e,Pf),l=(i,a,l,u,h)=>{o=lf("LCP",-1,i,a,l,u,h),n=Yv(t,o,Of,e.reportAllChanges),r=!1,"soft-navigation"===i&&(s=af(!0))},u=t=>{a.l&&t.navigationId&&ff(a.l,t),r||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))if(r)if("soft-navigation"!==r.entryType){var l=0,h=[],d=r.startTime;if("largest-contentful-paint"===r.entryType)l=Math.max(r.startTime-ef(),0),a.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var c,v=r;if(!o.navigationId)continue;if("interactionId"in v&&v.interactionId!=o.navigationInteractionId)continue;d=(null==(c=v.largestContentfulPaint)?void 0:c.renderTime)||0,l=Math.max(d-r.startTime,0),v.largestContentfulPaint&&(a.h(v.largestContentfulPaint),h=[v.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(r)},d=["largest-contentful-paint"];i&&d.push("interaction-contentful-paint","soft-navigation");var c=cf(d,h);if(c){n=Yv(t,o,Of,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=o.id;If((()=>{if(!r){if(!i)for(var t of(c.disconnect(),v))removeEventListener(t,f,{capture:!0});e===o.id&&(r=!0,n(!0))}}))}};for(var p of v)addEventListener(p,f,{capture:!0});Jv((i=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Kv()),n=Yv(t,o,Of,e.reportAllChanges),Xv((()=>{o.value=performance.now()-i.timeStamp,r=!0,n(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=af();_f(pf((()=>{var i,n=lf("CLS",0),s=hf(e,df),o=(r,o,a,l,u)=>{n=lf("CLS",0,r,o,a,l,u),s.i=0,i=Yv(t,n,wf,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),i(t)},l=t=>{a(!0),o("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);a()},h=["layout-shift"];vf(e)&&h.push("soft-navigation");var d=cf(h,u);d&&(i=Yv(t,n,wf,e.reportAllChanges),r.onHidden((()=>{u(d.takeRecords()),i(!0)})),Jv((()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Kv()),Xv(i)})),setTimeout(i))})))},onFCP:_f,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=af();yf((()=>{var n;"interactionCount"in performance||mf||(mf=cf(["event"],Tf,{durationThreshold:0}));var s,o=lf("INP"),a=hf(e,Mf),l=(r,i,n,l,u)=>{a.T(),o=lf("INP",-1,r,i,n,l,u),s=Yv(t,o,Rf,e.reportAllChanges)},u=()=>{var t=a.M(o.navigationType);t&&t._!==o.value&&(o.value=t._,o.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),If((()=>{for(var r of t)"soft-navigation"!==r.entryType?a.h(r):h(r);u(),e&&s(!0)}))},c=["event","first-input"];vf(e)&&c.push("soft-navigation");var v=cf(c,d,r({},e,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40}));s=Yv(t,o,Rf,e.reportAllChanges),v&&(i.onHidden((()=>{d(v.takeRecords(),!0)})),Jv((()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Kv())})))}))}}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Lf,Ca.__PosthogExtensions__.postHogWebVitalsCallbacks=Lf,Ca.postHogWebVitalsCallbacks=Lf,Ca.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Lf;let Af=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(t){var e;if(!t.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var Ff=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},$f=t=>{if("loading"===document.readyState)return"loading";var e=Ff();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Df=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Nf=t=>{var e="";try{for(;9!==(null==(r=t)?void 0:r.nodeType);){var r,i=t,n=i.id?"#"+i.id:[Df(i),...Array.from(i.classList).sort()].join(".");if(e.length+n.length>99)return e||n;if(e=e?n+">"+e:n,i.id)break;t=i.parentNode}}catch(t){}return e},qf=new WeakMap;function jf(t,e){var r=qf.get(e);return r||(r=new WeakMap,qf.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}var Bf,Uf=-1,Hf=()=>Uf,zf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Uf=e.timeStamp,t(e))}),!0)},Wf=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Vf=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Zf=()=>{var t,e;return null!==(t=null==(e=Ff())?void 0:e.activationStart)&&void 0!==t?t:0},Gf=function(t,e){void 0===e&&(e=-1);var r=Ff(),i="navigate";return 0>Hf()?r&&(document.prerendering||Zf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Qf=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Kf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Jf=-1,Yf=new Set,Xf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,tp=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Yf)e();isFinite(Jf)||(Jf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",tp,!0))}},ep=()=>{if(0>Jf){var t,e=Zf(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Jf=null!=r?r:Xf(),addEventListener("visibilitychange",tp,!0),addEventListener("prerenderingchange",tp,!0),zf((()=>{setTimeout((()=>{Jf=Xf()}))}))}return{get firstHiddenTime(){return Jf},onHidden(t){Yf.add(t)}}},rp=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},ip=[1800,3e3],np=function(t,e){void 0===e&&(e={}),rp((()=>{var r,i=ep(),n=Gf("FCP"),s=Qf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Zf(),0),n.entries.push(e),r(!0)))}));s&&(r=Wf(t,n,ip,e.reportAllChanges),zf((i=>{n=Gf("FCP"),r=Wf(t,n,ip,e.reportAllChanges),Vf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},sp=[.1,.25],op=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],ap=0,lp=1/0,up=0,hp=t=>{for(var e of t)e.interactionId&&(lp=Math.min(lp,e.interactionId),up=Math.max(up,e.interactionId),ap=up?(up-lp)/7+1:0)},dp=()=>{var t;return Bf?ap:null!==(t=performance.interactionCount)&&void 0!==t?t:0},cp=0;let vp=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){cp=dp(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((dp()-cp)/50));return this.l[t]}u(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.l.at(-1),i=this.h.get(t.interactionId);if(i||10>this.l.length||t.duration>r.T){var n;if(i?t.duration>i.T?(i.entries=[t],i.T=t.duration):t.duration===i.T&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.h.set((i={id:t.interactionId,entries:[t],T:t.duration}).id,i),this.l.push(i)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.h.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}};var fp=t=>{var e=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var i=Kf(t),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},pp=[200,500];let gp=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],mp={onLCP(t,e){void 0===e&&(e={});var i=jf(e=Object.assign({},e),gp),n=new WeakMap;i.m=t=>{var r=t.element;if(r){var i,s=null!==(i=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==i?i:Nf(r);n.set(t,s)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),rp((()=>{var r,i=ep(),n=Gf("LCP"),s=jf(e,gp),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Zf(),0),n.entries=[o],r())},a=Qf("largest-contentful-paint",o);if(a){r=Wf(t,n,$,e.reportAllChanges);var l=Kf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(fp(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});zf((i=>{n=Gf("LCP"),r=Wf(t,n,$,e.reportAllChanges),Vf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var i=t.entries.at(-1),s=i.url&&performance.getEntriesByType("resource").find((t=>t.name===i.url));e.target=n.get(i),e.lcpEntry=i,i.url&&(e.url=i.url),s&&(e.lcpResourceEntry=s);var o=Ff();if(o){var a=o.activationStart||0,l=Math.max(0,o.responseStart-a),u=Math.max(l,s?(s.requestStart||s.startTime)-a:0),h=Math.min(t.value,Math.max(u,s?s.responseEnd-a:0));e=r({},e,{timeToFirstByte:l,resourceLoadDelay:u-l,resourceLoadDuration:h-u,elementRenderDelay:t.value-h,navigationEntry:o})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var r=jf(e=Object.assign({},e),Af),i=new WeakMap;r.t=t=>{var r;if(null!=t&&null!=(r=t.sources)&&r.length){var n=op(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:Nf(s);i.set(n,a)}}},function(t,e){void 0===e&&(e={});var r=ep();np(Kf((()=>{var i,n=Gf("CLS",0),s=jf(e,Af),o=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,i())},a=Qf("layout-shift",o);a&&(i=Wf(t,n,sp,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),zf((()=>{s.o=0,n=Gf("CLS",0),i=Wf(t,n,sp,e.reportAllChanges),Vf(i)})),setTimeout(i))})))}((e=>{t((t=>{var e={};if(t.entries.length){var r,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(r=n.sources)&&r.length){var s=op(n.sources);s&&(e={largestShiftTarget:i.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:$f(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),np((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:$f(Hf())};if(t.entries.length){var r=Ff(),i=t.entries.at(-1);if(r){var n=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:n,firstByteToFCP:t.value-n,loadState:$f(t.entries[0].startTime),navigationEntry:r,fcpEntry:i}}}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var r=jf(e=Object.assign({},e),vp),i=[],n=[],s=0,o=new WeakMap,a=new WeakMap,l=!1,u=()=>{l||(fp(h),l=!0)},h=()=>{var t=new Set(r.l.map((t=>o.get(t.entries[0])))),e=n.length-10;n=n.filter(((r,i)=>i>=e||t.has(r)));var a=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var c of h)a.add(c)}i=i.filter((t=>t.startTime>s||a.has(t))),l=!1};r.m=t=>{var r,i=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var a=n.length-1;a>=0;a--){var l=n[a];if(8>=Math.abs(i-l.renderTime)){(r=l).startTime=Math.min(t.startTime,r.startTime),r.processingStart=Math.min(t.processingStart,r.processingStart),r.processingEnd=Math.max(t.processingEnd,r.processingEnd),!1!==e.includeProcessedEventEntries&&r.entries.push(t);break}}r||n.push(r={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:!1!==e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&o.set(t,r),u()},r.p=t=>{if(!a.get(t)){var r,i=null==(r=t.entries.find((t=>t.target)))?void 0:r.target;if(i){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==n?n:Nf(i);a.set(t,s)}else{var o,l=null==(o=t.entries.find((t=>t.targetSelector)))?void 0:o.targetSelector;l&&a.set(t,l)}}};var d=(t,e)=>{var r=[];for(var n of i)if(n.startTime+n.duration>=t){if(n.startTime>e)break;r.push(n)}return r};Qf("long-animation-frame",(t=>{i=i.concat(t),u()})),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=ep();rp((()=>{var i;"interactionCount"in performance||Bf||(Bf=Qf("event",hp,{durationThreshold:0}));var n,s=Gf("INP"),o=jf(e,vp),a=t=>{fp((()=>{for(var e of t)o.u(e);var r=o.M();r&&r.T!==s.value&&(s.value=r.T,s.entries=r.entries,n())}))},l=Qf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Wf(t,s,pp,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),zf((()=>{o.v(),s=Gf("INP"),n=Wf(t,s,pp,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],i=o.get(e),n=e.processingStart,s=Math.max(e.startTime+e.duration,n),l=Math.min(i.processingEnd,s),u=i.entries.sort(((t,e)=>t.processingStart-e.processingStart)),h=d(e.startTime,l),c=r.h.get(e.interactionId),v={interactionTarget:a.get(c),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:h,inputDelay:n-e.startTime,processingDuration:l-n,presentationDelay:s-l,loadState:$f(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{if(null!=(e=t.longAnimationFrameEntries)&&e.length){var r,i,n=t.interactionTime,s=t.inputDelay,o=t.processingDuration,a=0,l=0,u=0,h=0;for(var d of t.longAnimationFrameEntries)for(var c of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var v=c.startTime+c.duration;if(v>=n){var f=v-Math.max(n,c.startTime),p=c.duration?f/c.duration*c.forcedStyleAndLayoutDuration:0;a+=f-p,l+=p,f>h&&(i=n+s>c.startTime?"input-delay":n+s+o>c.startTime?"processing-duration":"presentation-delay",r=c,h=f)}}var g=t.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+s+o&&(u=t.nextPaintTime-m),r&&i&&(t.longestScript={entry:r,subpart:i,intersectingDuration:h}),t.totalScriptDuration=a,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-a-l-u}})(v),Object.assign(t,{attribution:v})})(e))}),e)}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=mp,Ca.__PosthogExtensions__.postHogWebVitalsCallbacks=mp,Ca.postHogWebVitalsCallbacks=mp;var yp=-1,bp=t=>{addEventListener("pageshow",(e=>{e.persisted&&(yp=e.timeStamp,t(e))}),!0)},_p=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},wp=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},xp=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},kp=()=>{var t,e;return null!==(t=null==(e=xp())?void 0:e.activationStart)&&void 0!==t?t:0},Sp=function(t,e){void 0===e&&(e=-1);var r=xp(),i="navigate";return 0>yp?r&&(document.prerendering||kp()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Tp=new WeakMap;function Cp(t,e){var r=Tp.get(e);return r||(r=new WeakMap,Tp.set(e,r)),r.get(t)||r.set(t,new e),r.get(t)}class Ep{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Mp,Ip=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Rp=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Pp=-1,Op=new Set,Lp=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Ap=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Op)e();isFinite(Pp)||(Pp="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Ap,!0))}},Fp=()=>{if(0>Pp){var t,e=kp(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Pp=null!=r?r:Lp(),addEventListener("visibilitychange",Ap,!0),addEventListener("prerenderingchange",Ap,!0),bp((()=>{setTimeout((()=>{Pp=Lp()}))}))}return{get firstHiddenTime(){return Pp},onHidden(t){Op.add(t)}}},$p=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Dp=[1800,3e3],Np=function(t,e){void 0===e&&(e={}),$p((()=>{var r,i=Fp(),n=Sp("FCP"),s=Ip("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-kp(),0),n.entries.push(e),r(!0)))}));s&&(r=_p(t,n,Dp,e.reportAllChanges),bp((i=>{n=Sp("FCP"),r=_p(t,n,Dp,e.reportAllChanges),wp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},qp=[.1,.25],jp=0,Bp=1/0,Up=0,Hp=t=>{for(var e of t)e.interactionId&&(Bp=Math.min(Bp,e.interactionId),Up=Math.max(Up,e.interactionId),jp=Up?(Up-Bp)/7+1:0)},zp=()=>{var t;return Mp?jp:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Wp=0;class Vp{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Wp=zp(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((zp()-Wp)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.l.at(-1),i=this.u.get(t.interactionId);if(i||10>this.l.length||t.duration>r.L){var n;if(i?t.duration>i.L?(i.entries=[t],i.L=t.duration):t.duration===i.L&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.u.set((i={id:t.interactionId,entries:[t],L:t.duration}).id,i),this.l.push(i)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var o of s)this.u.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var Zp=t=>{var e=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var i=Rp(t),n=-1,s=()=>{r(n),i()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),i()}))}},Gp=[200,500];class Qp{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Kp=[2500,4e3],Jp={onLCP(t,e){void 0===e&&(e={}),$p((()=>{var r,i=Fp(),n=Sp("LCP"),s=Cp(e,Qp),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-kp(),0),n.entries=[o],r())},a=Ip("largest-contentful-paint",o);if(a){r=_p(t,n,Kp,e.reportAllChanges);var l=Rp((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=t=>{t.isTrusted&&(Zp(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});bp((i=>{n=Sp("LCP"),r=_p(t,n,Kp,e.reportAllChanges),wp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=Fp();Np(Rp((()=>{var i,n=Sp("CLS",0),s=Cp(e,Ep),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Ip("layout-shift",o);a&&(i=_p(t,n,qp,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),bp((()=>{s.i=0,n=Sp("CLS",0),i=_p(t,n,qp,e.reportAllChanges),wp(i)})),setTimeout(i))})))},onFCP:Np,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Fp();$p((()=>{var i;"interactionCount"in performance||Mp||(Mp=Ip("event",Hp,{durationThreshold:0}));var n,s=Sp("INP"),o=Cp(e,Vp),a=t=>{Zp((()=>{for(var e of t)o.h(e);var r=o.T();r&&r.L!==s.value&&(s.value=r.L,s.entries=r.entries,n())}))},l=Ip("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=_p(t,s,Gp,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),bp((()=>{o.v(),s=Sp("INP"),n=_p(t,s,Gp,e.reportAllChanges)})))}))}}};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Ca.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Jp,Ca.__PosthogExtensions__.postHogWebVitalsCallbacks=Jp,Ca.postHogWebVitalsCallbacks=Jp,Ca.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Jp;class Yp{constructor(t){this.disabled=!1===t;var e=Zr(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var Xp="$copy_autocapture",tg=Ds("[AutoCapture]");function eg(t,e){return e.length>t?e.slice(0,t)+"...":e}function rg(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!fo(e));return e}function ig(t,e){var i,n,s=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!fo(t))return{props:{}};for(var d=[t],c=new Set([t]),v=t;v.parentNode&&!po(v,"body")&&yo>d.length;)if(mo(v.parentNode)){var f=v.parentNode.host;if(c.has(f))break;c.add(f),d.push(f),v=f}else{if(!fo(v.parentNode))break;if(c.has(v.parentNode))break;c.add(v.parentNode),d.push(v.parentNode),v=v.parentNode}var p,g,m=[],y={},b=!1,_=!1;if(qs(d,(t=>{var e=No(t);if(po(t,"a")){var r=t.getAttribute("href");b=!!(e&&r&&Zo(r))&&(h?kn(r):r)}Nr(wo(t),"ph-no-capture")&&(_=!0),m.push(function(t,e,r,i,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};To.indexOf(s)>-1&&!r&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?eg(1024,Go(t)):eg(1024,ko(t)));var a=wo(t);a.length>0&&(o.classes=a.filter((function(t){return""!==t}))),qs(t.attributes,(function(r){var s;if((!qo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Zo(r.value)&&(!Kr(s=r.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=r.value;"class"===r.name&&(a=bo(a).join(" ")),o["attr__"+r.name]=eg(1024,"href"===r.name&&n?kn(a):a)}}));for(var l=1,u=1,h=t;h=rg(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,l,h));var i=function(t){if(!No(t))return{};var e={};return qs(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Zo(i)&&(e[r]=i)}})),e}(t);js(y,i)})),_)return{props:{},explicitNoCapture:_};if(a||(m[0].$el_text=po(t,"a")||po(t,"button")?Go(t):ko(t)),b){var w,x;m[0].attr__href=b;var k=null==(w=Ks(b))?void 0:w.host,S=null==xs||null==(x=xs.location)?void 0:x.host;k&&S&&k!==S&&(p=b)}return{props:js({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(t){return t.map((t=>{var e,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Bs(o).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return a[Ko(t[0].toString())]=Ko(e.toString())})),(n+=":")+Bs(a).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Jo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Bs(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>i.attributes[t[0]]=t[1])),i}))}(g)))},null!=(i=m[0])&&i.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},y)}}var ng={};function sg(t,e){var r=ng[t];if(r)return r;var i=e[t];if((t=>Vr(t)&&-1!==t.toString().indexOf("[native code]"))(i)&&(null==xs||!xs.Zone))return ng[t]=i.bind(e);var n=e.document;if(n&&Vr(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var a,l,u=s.contentWindow;u&&u[t]&&(i=u[t],"MutationObserver"===t&&function(t){return Nr(t,"AppleWebKit")&&!Nr(t,"Chrome")}(null!==(a=null==(l=e.navigator)?void 0:l.userAgent)&&void 0!==a?a:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){$s.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var h;!o&&null!=(h=s)&&h.parentNode&&s.parentNode.removeChild(s)}}return i&&Vr(i)?ng[t]=i.bind(e):i}function og(t,e){var i=So(t);return i?r({node:i,originalEvent:t,timestamp:Date.now()},e):null}function ag(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function lg(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var ug="canvas,video,audio,embed,object";function hg(t,e){return ti(t)&&t>=e}class dg{me(t){var e,r,i,n,s,o,a,l,u=this.ye((null==t?void 0:t.__onCapture)||this.ge.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.be=[],this.we=0,this.ye=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.ke=t=>{var e=og(t,{type:"click"});Yr(e)||this.xe(e)||this.be.push(e),this.Se()},this.Ce=()=>{var t=Date.now();this.Me=t,t%50==0&&this.be.forEach((e=>{Qr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Te=()=>{this._e=Date.now()},this.Ie=()=>{"visible"===(null==Ts?void 0:Ts.visibilityState)&&(this.Ee=Date.now())},this.Le=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[0]:void 0;this.Re=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.Oe=()=>{this.Re=void 0},this.Ne=t=>{var e,r=this.Re;if(this.Re=void 0,!Qr(r)&&this.Pe.max_dead_swipes_per_page_load>this.we){var i=t,n=null==(e=i.changedTouches)?void 0:e[0];if(n){var s=n.clientX-r.x,o=n.clientY-r.y,a=s*s+o*o,l=this.Pe.swipe_threshold_px;if(a>=l*l&&![this.Me,this.Ae,this._e].some((t=>ti(t)&&t>=r.timestamp))){var u;if(this.De()&&(null!==(u=null==Ts||null==Ts.elementsFromPoint?void 0:Ts.elementsFromPoint(r.x,r.y))&&void 0!==u?u:[]).some((t=>null==t.matches?void 0:t.matches(ug))))return;var h=og(i,{type:"swipe",swipeDirection:ag(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Yr(h)||this.xe(h)||this.be.push(h),this.Se()}}}},this.instance=t,this.Pe=this.me(e),this._onCapture=this.Pe.__onCapture}start(t){this.qe(),this.Fe(),this.je(),this.He(),this.Be(t),this.Pe.capture_dead_swipes&&this.Ue()}Be(t){if(!this.We){var e=function(t){return sg("MutationObserver",t)}(Ca);this.We=new e((t=>{this.Ve(t)})),this.We.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.We)||t.disconnect(),this.We=void 0,Ca.removeEventListener("click",this.ke),Ca.removeEventListener("scroll",this.Ce,{capture:!0}),Ca.removeEventListener("selectionchange",this.Te),Ca.removeEventListener("touchstart",this.Le,{capture:!0}),Ca.removeEventListener("touchend",this.Ne,{capture:!0}),Ca.removeEventListener("touchcancel",this.Oe,{capture:!0}),null==Ts||Ts.removeEventListener("visibilitychange",this.Ie),this.Re=void 0}Ve(t){this.Ae=Date.now()}qe(){Zs(Ca,"click",this.ke)}Se(){this.be.length&&Qr(this.Ze)&&(this.Ze=Ca.setTimeout((()=>{this.ze()}),1e3))}Fe(){Zs(Ca,"scroll",this.Ce,{capture:!0})}je(){Zs(Ca,"selectionchange",this.Te)}He(){Zs(Ts,"visibilitychange",this.Ie)}Ue(){Zs(Ca,"touchstart",this.Le,{capture:!0,passive:!0}),Zs(Ca,"touchend",this.Ne,{capture:!0,passive:!0}),Zs(Ca,"touchcancel",this.Oe,{capture:!0,passive:!0})}De(){var t=Qr(this.$e)||ti(this.Ae)&&this.Ae>this.$e;return(Qr(this.Qe)||t)&&(this.$e=Date.now(),this.Qe=!(null==Ts||!Ts.querySelector(ug))),!!this.Qe}xe(t){return!t||("swipe"===t.type?this.Ge(t):this.Ye(t))}Ge(t){if(vo(t.node))return!0;var e=this.be.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!e&&!po(t.node,"html")&&fo(t.node)&&function(t,e){var r;if(!xs||$o(t))return!1;var i=ri(e)?Oo:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:Oo;return!Co(Do(t,!1).targetElementList,i)}(t.node,{css_selector_ignorelist:this.Pe.css_selector_ignorelist}))}Ye(t){return!(this.Pe.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Ge(t)||(r=t.node,!(!xs||$o(r))&&Do(r,!1).targetElementList.some((t=>po(t,"a"))));var e,r}ze(){if(this.be.length){clearTimeout(this.Ze),this.Ze=void 0;var t=this.be;for(var e of(this.be=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Ae&&this.Ae>=e.timestamp?this.Ae-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this._e&&this._e>=e.timestamp?this._e-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Ee?Math.abs(e.timestamp-this.Ee):void 0;var i=hg(e.scrollDelayMs,this.Pe.scroll_threshold_ms),n=hg(e.selectionChangedDelayMs,this.Pe.selection_change_threshold_ms),s=hg(e.mutationDelayMs,this.Pe.mutation_threshold_ms),o=hg(e.absoluteDelayMs,1.1*this.Pe.mutation_threshold_ms),a=ti(e.scrollDelayMs)&&this.Pe.scroll_threshold_ms>e.scrollDelayMs,l=ti(e.mutationDelayMs)&&this.Pe.mutation_threshold_ms>e.mutationDelayMs,u=ti(e.selectionChangedDelayMs)&&this.Pe.selection_change_threshold_ms>e.selectionChangedDelayMs,h=ti(e.visibilityChangedDelayMs)&&this.Pe.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||l||u||h)){var d=hg(e.visibilityChangedDelayMs,this.Pe.selection_change_threshold_ms);if(i||s||o||n||d){var c=lg(e);if("$dead_swipe"===c){if(this.we>=this.Pe.max_dead_swipes_per_page_load)continue;this.we++}this._onCapture(e,{[c+"_last_mutation_timestamp"]:this.Ae,[c+"_event_timestamp"]:e.timestamp,[c+"_scroll_timeout"]:i,[c+"_mutation_timeout"]:s,[c+"_absolute_timeout"]:o,[c+"_selection_changed_timeout"]:n,[c+"_visibility_changed_timeout"]:d})}else this.Pe.mutation_threshold_ms>e.absoluteDelayMs&&this.be.push(e)}}this.Se()}}ge(t,e){var i=lg(t);this.instance.capture(i,r({},e,ig(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Pe.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new dg(t,e);var cg=Ds("[ExternalScriptsLoader]"),vg=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return cg.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Ts?void 0:Ts.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!Ts)return r("document not found");var i=Ts.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)Ts.head.appendChild(i);else{var n,s=Ts.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):Ts.body.appendChild(i)}};null!=Ts&&Ts.body?a():null==Ts||Ts.addEventListener("DOMContentLoaded",a)};Ca.__PosthogExtensions__=Ca.__PosthogExtensions__||{},Ca.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if("remote-config"!==e){var i;if(t.config.strict_script_versioning)i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var n="/static/"+e+".js?v="+t.version;if("toolbar"===e){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=t.requestRouter.endpointFor("assets",n)}vg(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");vg(t,o,r)}},Ca.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);vg(t,i,r)};As.DEBUG=!1,As.LIB_VERSION="1.412.1",As.LIB_NAME="web";class fg{constructor(t){this._instance=t}get Pe(){return this._instance.config}get consent(){return this.ti()?0:this.ei}isOptedOut(){return this.Pe.cookieless_mode===Th||this.isRejected()||-1===this.consent&&this.Pe.cookieless_mode===Sh}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Pe.opt_out_capturing_by_default}optInOut(t){this.ii.A(this.ri,t?1:0,this.Pe.cookie_expiration,this.Pe.cross_subdomain_cookie,this.Pe.secure_cookie)}reset(){this.ii.F(this.ri,this.Pe.cross_subdomain_cookie)}get ri(){var t=this._instance.config,e=t.token,r=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(r?r+e:"__ph_opt_in_out_"+e)}get ei(){var t=this.ii.q(this.ri);return di(t)?1:Nr(ci,t)?0:-1}get ii(){var t=this.Pe.opt_out_capturing_persistence_type,e="localStorage"===t?Yh:Kh;if(!this.ni||this.ni!==e){this.ni=e;var r="localStorage"===t?Kh:Yh;r.q(this.ri)&&(this.ni.q(this.ri)||this.optInOut(di(r.q(this.ri))),r.F(this.ri,this.Pe.cross_subdomain_cookie))}return this.ni}ti(){return!!this.Pe.respect_dnt&&[null==Ss?void 0:Ss.doNotTrack,null==Ss?void 0:Ss.msDoNotTrack,Ca.doNotTrack].some((t=>di(t)))}}var pg=Ds("[Dead Clicks]"),gg=()=>!0,mg=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(Lu)),i=t.instance.config.capture_dead_clicks;return ri(i)?i:!!Zr(i)||r};class yg{get lazyLoadedDeadClicksAutocapture(){return this.si}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Lu]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.ai((()=>{this.oi()})):this.stop()}ai(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?pg.error("failed to load script",e):t()}))}oi(){var t;if(Ts){if(!this.si&&null!=(t=Ca.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Zr(this.instance.config.capture_dead_clicks)?r({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.si=Ca.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.si.start(Ts),pg.info("starting...")}}else pg.error("`document` not found. Cannot start.")}stop(){this.si&&(this.si.stop(),this.si=void 0,pg.info("stopping..."))}}var bg=Ds("[SegmentIntegration]");var _g="posthog-js";function wg(t,e){var i=void 0===e?{}:e,n=i.organization,s=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(c=p[0])?void 0:c.type,$sentry_tags:e.tags};return n&&s&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class xg{constructor(t,e,r,i,n,s){this.name=_g,this.setupOnce=function(o){o(wg(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class kg{constructor(t){this.li=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&($s.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.ui=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.hi()}hi(){var t;this.di=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.li)}destroy(){var t;null==(t=this.di)||t.call(this),this.di=void 0}doPageView(t,e){var r,i=this.vi(t,e);return this.ui={pathname:null!==(r=null==xs?void 0:xs.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.vi(t,null==(e=this.ui)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ui)?void 0:t.pageViewId}}vi(t,e){var r=this.ui;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Qr(s)||Qr(o)||Qr(a)||Qr(l)||Qr(u)||Qr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?vi(o/s,0,1,$s):1,c=s>1?vi(a/s,0,1,$s):1,v=l>1?vi(u/l,0,1,$s):1,f=l>1?vi(h/l,0,1,$s):1;i=js(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Sg=["flags","surveys"],Tg={[xu]:{exposure:"hidden"},[Tu]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Cu]:{exposure:"hidden"},[Eu]:{exposure:"event"},[Mu]:{exposure:"hidden"},[Iu]:{exposure:"event"},[Ru]:{exposure:"hidden"},[Pu]:{exposure:"event"},[Ou]:{exposure:"event"},[Lu]:{exposure:"event"},[Au]:{exposure:"hidden"},[Fu]:{exposure:"event"},[$u]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Uu]:{exposure:"hidden"},[Hu]:{exposure:"event"},[Du]:{exposure:"event",shouldSkipFromEventProperties:t=>Yr(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[zu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Zr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[Wu]:{exposure:"event",storageGroup:"flags"},[Vu]:{exposure:"hidden"},[Zu]:{exposure:"hidden",storageGroup:"flags"},[Gu]:{exposure:"event",storageGroup:"flags"},[Qu]:{exposure:"event",storageGroup:"flags",volatile:!0},[Ku]:{exposure:"hidden",storageGroup:"flags"},[Ju]:{exposure:"event"},[Yu]:{exposure:"hidden"},[Xu]:{exposure:"hidden"},[th]:{exposure:"hidden"},[eh]:{exposure:"hidden",storageGroup:"surveys"},[rh]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ih]:{exposure:"event"},[nh]:{exposure:"hidden"},[sh]:{exposure:"hidden"},[oh]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ah]:{exposure:"hidden"},[lh]:{exposure:"hidden"},[uh]:{exposure:"hidden"},[hh]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[dh]:{exposure:"hidden"},[ch]:{exposure:"hidden"},[vh]:{exposure:"hidden"},[fh]:{exposure:"hidden"},[ph]:{exposure:"hidden"},[gh]:{exposure:"hidden"},[mh]:{exposure:"hidden"},[Nu]:{exposure:"event"},[qu]:{exposure:"event"},[ju]:{exposure:"event"},[Bu]:{exposure:"event"},[_h]:{exposure:"event"},[wh]:{exposure:"event"},[xh]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Cg=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Eg=t=>{var e=Tg[t];if(e)return e;for(var r of Cg){var i=r[1];if(0===t.indexOf(r[0]))return i}},Mg={flags:hh,surveys:rh},Ig=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Rg="main";class Pg{constructor(t,e,i){if(void 0===i&&(i=!0),this.ci={},this.fi=!1,this.pi=!1,this.Pe=t,this.gi=i,this.props={},this.mi=void 0,this.yi=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.ii=this.bi(t),this.pi=this.wi(t),this.load(),t.debug&&$s.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save(),xs){var n=()=>this.flush();Zs(xs,"beforeunload",n,{capture:!1}),Zs(xs,"pagehide",n,{capture:!1})}}xi(){var t,e=null==(t=this.Pe)?void 0:t.persistence_save_debounce_ms;return ti(e)&&e>0?e:0}isDisabled(){return!!this.ki}bi(t){-1===Ig.indexOf(t.persistence.toLowerCase())&&($s.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...Xh,...t];return r({},Yh,{H(t){try{var r={};try{r=Kh.H(t)||{}}catch(t){}var i,n=JSON.parse(Yh.q(t)||"{}");if(e){var s={};for(var o in r){var a=r[o];Yr(a)||""===a||(s[o]=a)}i=js(n,s)}else i=js(r,n);return Yh.A(t,i),i}catch(t){}return null},A(t,e,r,n,s,o){var a=Yh.A(t,e,void 0,void 0,o);try{var l={};i.forEach((t=>{e[t]&&(l[t]=e[t])})),Object.keys(l).length&&Kh.A(t,l,r,n,s,o)}catch(t){Yh.j(t)}return a},F(t,e){try{null==xs||xs.localStorage.removeItem(t),Kh.F(t,e)}catch(t){Yh.j(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&Yh.P()?(e=Yh,n=!0):"localstorage+cookie"===s&&i.P()?(e=i,n=!0):"sessionstorage"===s&&id.P()?e=id:"memory"===s?e=ed:"cookie"===s?e=Kh:i.P()?(e=i,n=!0):e=Kh,this.fi=n,e}Si(t){return this.yi+"__"+t}wi(t){return this.fi&&!!t.split_storage}Ci(t){var e=null!=t?t:this.Pe.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[hh];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return qs(this.props,((e,r)=>{var i=Eg(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===zu?()=>this.Ci():()=>!1))return;i.transformToEventProperties&&js(t,i.transformToEventProperties(e))}else if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,(()=>!1)))return;t[r]=e}})),t}load(){if(!this.ki){var t=this.ii.H(this.yi);t&&(this.props=js({},t)),this.pi&&this.Mi()}}Mi(){for(var t of Sg){var e=Yh.H(this.Si(t));if(e&&!Gr(e)){var r=this.Ti(t);r.persisted=!0,this.Ei(t)||(r.fingerprint=this.Ii(e,t)),this.Pi(t,e)||js(this.props,e)}}}Ei(t){return Object.keys(this.props).some((e=>{var r;return(null==(r=Eg(e))?void 0:r.storageGroup)===t}))}Pi(t,e){var r=Mg[t];if(!r)return!1;var i=e[r],n=this.props[r];return ti(i)&&ti(n)&&n>i}refreshKey(t){var e;if(!this.ki){var r=this.pi?null==(e=Eg(t))?void 0:e.storageGroup:void 0,i=r?Yh.H(this.Si(r)):this.ii.H(this.yi);if(i&&t in i)this.Ri(t,i[t]);else{if(r){var n=this.ii.H(this.yi);if(n&&t in n)return void this.Ri(t,n[t])}this.Li(t)}}}save(){if(!this.ki){var t=this.xi();t>0?Qr(this.Oi)&&(this.Oi=setTimeout((()=>{this.Oi=void 0,this.Fi()}),t)):this.Fi()}}flush(){Qr(this.Oi)||(clearTimeout(this.Oi),this.Oi=void 0,this.Fi())}Fi(){this.ki||(this.pi?this.Ai():this.Di(this.ii,this.yi,this.props,Rg))}Ai(){var t=this.$i(),e=t.main,r=t.groups;for(var i of(this.Di(this.ii,this.yi,e,Rg),Sg)){var n,s=r[i];(!Gr(s)||null!=(n=this.ci[i])&&n.persisted)&&this.Di(Yh,this.Si(i),s,i)}}$i(){var t={},e={flags:{},surveys:{}};return qs(this.props,((r,i)=>{var n,s=null==(n=Eg(i))?void 0:n.storageGroup;s?e[s][i]=r:t[i]=r})),{main:t,groups:e}}Ii(t,e){if(e===Rg)return JSON.stringify(t)+"|"+this.Ni+"|"+this.qi+"|"+this.ji;var r={};return qs(t,((t,e)=>{var i;r[e]=null!=(i=Eg(e))&&i.volatile?"__volatile__":t})),JSON.stringify(r)}Di(t,e,r,i){var n=this.Ti(i);if(i===Rg||n.dirty||Qr(n.fingerprint)){var s;try{if((s=this.Ii(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.A(e,r,this.Ni,this.qi,this.ji,this.Pe.debug)?(n.dirty=!1,i!==Rg&&(n.persisted=!0),Qr(s)||(n.fingerprint=s)):this.Pe.debug&&$s.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,r=void 0!==e&&e;if(Qr(this.Oi)||(clearTimeout(this.Oi),this.Oi=void 0),this.ii.F(this.yi,!1),this.ii.F(this.yi,!0),!r&&this.gi)for(var i of Sg)Yh.F(this.Si(i));r?delete this.ci[Rg]:this.ci={}}clear(){this.remove(),this.props={}}register_once(t,e,r){if(Zr(t)){Qr(e)&&(e="None"),this.Ni=Qr(r)?this.Bi:r;var i=!1;if(qs(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Ri(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(Zr(t)){this.Ni=Qr(e)?this.Bi:e;var r=!1;if(qs(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Ri(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Li(t),this.save())}update_campaign_params(){var t=null==Ts?void 0:Ts.URL;if(t!==this.mi){var e=vc(this.Pe.custom_campaign_params,this.Pe.mask_personal_data_properties,this.Pe.custom_personal_data_properties);Gr(zs(e))||this.register(e),this.mi=t}}update_search_keyword(){var t;this.register((t=null==Ts?void 0:Ts.referrer)?pc(t):{})}update_referrer_info(){var t;this.register_once({$referrer:yc(),$referring_domain:null!=Ts&&Ts.referrer&&(null==(t=Ks(Ts.referrer))?void 0:t.host)||mc},void 0)}set_initial_person_info(){this.props[fh]||this.props[ph]||this.register_once({[gh]:bc(this.Pe.mask_personal_data_properties,this.Pe.custom_personal_data_properties,this.Pe.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};qs([ph,fh],(e=>{var r=this.props[e];r&&qs(r,(function(e,r){t["$initial_"+jr(r)]=e}))}));var e=this.props[gh];if(e){var r=function(t,e){void 0===e&&(e=!1);var r=_c(t,e),i={};return qs(r,(function(t,e){i["$initial_"+jr(e)]=t})),i}(e,this.Pe.disable_capture_url_hashes);js(t,r)}return t}safe_merge(t){return qs(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){this.Bi=this.Ni=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var i=t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),n=i?this.bi(t):this.ii,s=this.wi(t);if(i||s!==this.pi){var o=this.props;this.clear(),this.ii=n,this.pi=s,this.props=o,this.save()}}set_disabled(t){this.ki=t,this.ki?this.remove():this.save()}set_cross_subdomain(t){t!==this.qi&&(this.qi=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ji&&(this.ji=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var r=this.props[Cu]||{};r[t]=e,this.Ri(Cu,r),this.save()}remove_event_timer(t){var e=this.props[Cu]||{},r=e[t];return Qr(r)||(delete e[t],this.Ri(Cu,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Ri(t,e),this.save()}Ri(t,e){var r;this.props[t]=e,null!=(r=Eg(t))&&r.volatile||this.Hi(t)}Li(t){delete this.props[t],this.Hi(t)}Hi(t){var e,r=null==(e=Eg(t))?void 0:e.storageGroup;r&&(this.Ti(r).dirty=!0)}Ti(t){return this.ci[t]||(this.ci[t]={})}}var Og={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Lg={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Ag={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Fg=Ds("[RateLimiter]");class $g{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{Fg.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Fg.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(vh))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(ti(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Ui(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(vh,a),{isRateLimited:l,remainingTokens:a.tokens}}zi(t){var e=this.instance.config.property_denylist;return!Wr(e)||!e.includes(t)}Wi(){var t;if(this.zi("$current_url")&&this.zi("$pathname")&&null!=Cs&&Cs.pathname)return""+(null!==(t=Cs.origin)&&void 0!==t?t:"")+Cs.pathname}Ui(t){var e,r,i=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Wi(),o=this.zi("$session_id")?null==(e=(r=this.instance).get_session_id)?void 0:e.call(r):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+n+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Dg=Ds("[RemoteConfig]");class Ng{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=Ca._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Vi(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Zi(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Dg.info("Using preloaded remote config",this.remoteConfig),this.Gi(this.remoteConfig),void this.Qi();if(this._instance.Ji())return void Dg.warn("Remote config is disabled. Falling back to local config.");this.Vi((t=>{if(!t)return Dg.info("No config found after loading remote JS config. Falling back to JSON."),void this.Zi((t=>{this.Gi(t.json,t),this.Qi()}));this.Gi(t),this.Qi()}))}catch(t){Dg.error("Error loading remote config",t),this.Gi()}}stop(){this.Ki&&(clearInterval(this.Ki),this.Ki=void 0)}refresh(){!this._instance.Ji()&&Ts&&"hidden"!==Ts.visibilityState&&this._instance.reloadFeatureFlags()}Qi(){var t;if(!this.Ki){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Ki=setInterval((()=>{this.refresh()}),e))}}Gi(t,e){!t&&e&&(0===e.statusCode?e.error||Dg.warn("Failed to fetch remote config from PostHog."):Dg.error("Failed to fetch remote config from PostHog."));try{this._instance.Gi(t?{ok:!0,config:t}:{ok:!1})}catch(t){Dg.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;null==(r=this._instance.featureFlags)||r.ensureFlagsLoaded()}catch(t){Dg.error("Error loading feature flags",t)}}}var qg=["fatal","error","warning","log","info","debug"],jg=Uint8Array,Bg=Uint16Array,Ug=Uint32Array,Hg=new jg([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]),zg=new jg([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]),Wg=new jg([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Vg=function(t,e){for(var r=new Bg(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Ug(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Zg=Vg(Hg,2),Gg=Zg[1];Zg[0][28]=258,Gg[258]=28;for(var Qg=Vg(zg,0)[1],Kg=new Bg(32768),Jg=0;32768>Jg;++Jg){var Yg=(43690&Jg)>>>1|(21845&Jg)<<1;Kg[Jg]=((65280&(Yg=(61680&(Yg=(52428&Yg)>>>2|(13107&Yg)<<2))>>>4|(3855&Yg)<<4))>>>8|(255&Yg)<<8)>>>1}var Xg=function(t,e,r){for(var i=t.length,n=0,s=new Bg(e);i>n;++n)++s[t[n]-1];var o,a=new Bg(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Bg(1<<e);var l=15-e;for(n=0;i>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=a[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)o[Kg[d]>>>l]=u}else for(o=new Bg(i),n=0;i>n;++n)o[n]=Kg[a[t[n]-1]++]>>>15-t[n];return o},tm=new jg(288);for(Jg=0;144>Jg;++Jg)tm[Jg]=8;for(Jg=144;256>Jg;++Jg)tm[Jg]=9;for(Jg=256;280>Jg;++Jg)tm[Jg]=7;for(Jg=280;288>Jg;++Jg)tm[Jg]=8;var em=new jg(32);for(Jg=0;32>Jg;++Jg)em[Jg]=5;var rm=Xg(tm,9,0),im=Xg(em,5,0),nm=function(t){return(t/8>>0)+(7&t&&1)},sm=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Bg?Bg:t instanceof Ug?Ug:jg)(r-e);return i.set(t.subarray(e,r)),i},om=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},am=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},lm=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new jg(0),0];if(1==n){var o=new jg(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[d].f>r[u].f?u++:d++],l=r[u!=h&&r[d].f>r[u].f?u++:d++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new Bg(c+1),f=um(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==e&&(--v[_],++p)}f=e}return[new jg(v),f]},um=function(t,e,r){return-1==t.s?Math.max(um(t.l,e,r+1),um(t.r,e,r+1)):e[t.s]=r},hm=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Bg(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[r.subarray(0,i),e]},dm=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},cm=function(t,e,r){var i=r.length,n=nm(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},vm=function(t,e,r,i,n,s,o,a,l,u,h){om(e,h++,r),++n[256];for(var d=lm(n,15),c=d[0],v=d[1],f=lm(s,15),p=f[0],g=f[1],m=hm(c),y=m[0],b=m[1],_=hm(p),w=_[0],x=_[1],k=new Bg(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var T=lm(k,7),C=T[0],E=T[1],M=19;M>4&&!C[Wg[M-1]];--M);var I,R,P,O,L=u+5<<3,A=dm(n,tm)+dm(s,em)+o,F=dm(n,c)+dm(s,p)+o+14+3*M+dm(k,C)+(2*k[16]+3*k[17]+7*k[18]);if(A>=L&&F>=L)return cm(e,h,t.subarray(l,l+u));if(om(e,h,1+(A>F)),h+=2,A>F){I=Xg(c,v,0),R=c,P=Xg(p,g,0),O=p;var D=Xg(C,E,0);for(om(e,h,b-257),om(e,h+5,x-1),om(e,h+10,M-4),h+=14,S=0;M>S;++S)om(e,h+3*S,C[Wg[S]]);h+=3*M;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(S=0;j.length>S;++S)om(e,h,D[B=31&j[S]]),h+=C[B],B>15&&(om(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}else I=rm,R=tm,P=im,O=em;for(S=0;a>S;++S)if(i[S]>255){var B;am(e,h,I[257+(B=i[S]>>>18&31)]),h+=R[B+257],B>7&&(om(e,h,i[S]>>>23&31),h+=Hg[B]);var U=31&i[S];am(e,h,P[U]),h+=O[U],U>3&&(am(e,h,i[S]>>>5&8191),h+=zg[U])}else am(e,h,I[i[S]]),h+=R[i[S]];return am(e,h,I[256]),h+R[256]},fm=new Ug([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),pm=function(){for(var t=new Ug(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),gm=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function mm(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=pm[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,l=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new jg(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=cm(l,u,t.subarray(h,d)):(l[h]=!0,u=cm(l,u,t.subarray(h,o)))}else{for(var c=fm[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new Bg(32768),m=new Bg(p+1),y=Math.ceil(r/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Ug(25e3),x=new Bg(288),k=new Bg(32),S=0,T=0,C=(h=0,0),E=0,M=0;o>h;++h){var I=_(h),R=32767&h,P=m[I];if(g[R]=P,m[I]=R,h>=E){var O=o-h;if((S>7e3||C>24576)&&O>423){u=vm(t,l,0,w,x,k,T,C,M,h-M,u),C=S=T=0,M=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)k[L]=0}var A=2,F=0,D=f,N=R-P&32767;if(O>2&&I==_(h-N))for(var q=Math.min(v,O)-1,j=Math.min(32767,h),B=Math.min(258,O);j>=N&&--D&&R!=P;){if(t[h+A]==t[h+A-N]){for(var U=0;B>U&&t[h+U]==t[h+U-N];++U);if(U>A){if(A=U,F=N,U>q)break;var H=Math.min(N,U-2),z=0;for(L=0;H>L;++L){var W=h-N+L+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,P=W)}}}N+=(R=P)-(P=g[R])+32768&32767}if(F){w[C++]=268435456|Gg[A]<<18|Qg[F];var Z=31&Gg[A],G=31&Qg[F];T+=Hg[Z]+zg[G],++x[257+Z],++k[G],E=h+A,++S}else w[C++]=t[h],++x[t[h]]}}u=vm(t,l,!0,w,x,k,T,C,M,h-M,u)}return sm(a,0,i+nm(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&gm(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),gm(l,u-8,r.d()),gm(l,u-4,i),l}var ym=!!Ms||!!Es,bm="text/plain",_m=!1,wm=(t,e)=>{var r=t.split("#"),i=r[1],n=r[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},xm=function(t,e,i){var n;void 0===i&&(i=!0);var s=t.split("?"),o=s[0],a=s[1],l=r({},e),u=null!==(n=null==a?void 0:a.split("&").map((t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Js(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},km=t=>{if(t.Yi)return t.Yi;var e=t.data,r=t.compression;if(e){if(r===zl.GZipJS){var i=mm(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new jg(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new jg(n+8+(r-o<<1));a.set(i),i=a}var l=t.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return sm(i,0,n)}(Qs(e)),{mtime:0});return{contentType:bm,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===zl.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Qs(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Qs(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Qs(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Sm=t=>{var e,i,n=()=>"sendBeacon"===t.transport?{url:xm(t.url,{compression:zl.Base64}),encodedBody:km(r({},t,{compression:zl.Base64,Yi:void 0}))}:{url:wm(t.url,"compression"),encodedBody:km(r({},t,{compression:void 0,Yi:void 0}))};try{e=km(t)}catch(e){if(Pr(t.compression,Ys(t.url,"compression")))return $s.error("Failed to gzip request body, sending uncompressed payload",e),n();throw e}return e&&Pr(t.compression,Ys(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Rr(new Uint8Array(i)):ArrayBuffer.isView(i)&&Rr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(_m=!0,n()):{url:t.url,encodedBody:e}},Tm=t=>{try{return Sm(t)}catch(e){return $s.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Cm=function(){var t=e((function*(t){var e=Qs(t.data),i=yield function(t,e,r){return Fr.apply(this,arguments)}(e,As.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{Yi:{contentType:bm,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Em=/Failed to fetch|NetworkError|Load failed/i,Mm=t=>{var e=Tm(t);if(e){var i=e.url,n=e.encodedBody,s=null!=n?n:{},o=s.contentType,a=s.body,l=s.estimatedSize,u=new Headers;qs(t.headers,(function(t,e){u.append(e,t)})),o&&u.append("Content-Type",o);var h=null,d=!1;if(Is){var c=new Is;h={signal:c.signal,timeout:setTimeout((()=>{var e,r;d=!0,c.abort((e=t.timeout,(r=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",r))}),t.timeout)}}var v=e=>{d&&"AbortError"===(null==e?void 0:e.name)||(t=>"TypeError"===(null==t?void 0:t.name)&&Em.test((null==t?void 0:t.message)||""))(e)?$s.warn(e):$s.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;Es(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Xi&&52428.8>(l||0),body:a,signal:null==(f=h)?void 0:f.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){$s.error(t)}null==t.callback||t.callback(i)})))).catch(v).finally((()=>h?clearTimeout(h.timeout):null))}catch(t){h&&clearTimeout(h.timeout),v(t)}}},Im=t=>{try{var e,i=Sm(t),n=i.url,s=i.encodedBody,o=null!=s?s:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(Ss.sendBeacon(n,u))return;var h=Wr(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Wr(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),c=e=>Wr(t.data)?e:r({},t.data,{batch:e});return Im(r({},t,{data:c(h.slice(0,d))})),void Im(r({},t,{data:c(h.slice(d))}))}$s.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Mm(r({},t,{Xi:!0}))}catch(t){$s.warn("Beacon send failed",t)}},Rm=(t,e,i,n)=>{var s="query"===n?"POST"===e?"sent_at":"_":void 0;return xm(i===zl.GZipJS?wm(t,"compression"):t,r({},s?{[s]:Date.now().toString()}:{},i===zl.GZipJS?{}:{compression:i}))},Pm=[];Es&&Pm.push({transport:"fetch",method:Mm}),Ms&&Pm.push({transport:"XHR",method(t){var e=Tm(t);if(e){var r=new Ms,i=e.encodedBody;r.open(t.method||"GET",e.url,!0);var n=null!=i?i:{},s=n.contentType,o=n.body;qs(t.headers,(function(t,e){r.setRequestHeader(e,t)})),s&&r.setRequestHeader("Content-Type",s),t.timeout&&(r.timeout=t.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(o)}}}),null!=Ss&&Ss.sendBeacon&&Pm.push({transport:"sendBeacon",method:Im});var Om=3e3;class Lm{constructor(t,e){this.tr=!0,this.er=[],this.ir=vi((null==e?void 0:e.flush_interval_ms)||Om,250,5e3,$s.createLogger("flush interval"),Om),this.rr=t}enqueue(t){this.er.push(t),this.nr||this.sr()}unload(){this.ar();var t=this.er.length>0?this.lr():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.ur(r({},t,{transport:"sendBeacon"}))}))}enable(){this.tr=!1,this.sr()}sr(){var t=this;this.tr||(this.nr=setTimeout((()=>{if(this.ar(),this.er.length>0){var e=this.lr(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&Wr(r.data)&&qs(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ur(r)};for(var i in e)r()}}),this.ir))}ur(t){try{this.rr(t)}catch(t){$s.error(t)}}ar(){clearTimeout(this.nr),this.nr=void 0}lr(){var t={};return qs(this.er,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;Qr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.er=[],t}}var Am=["retriesPerformedSoFar"];class Fm{constructor(t){this.hr=!1,this.dr=3e3,this.er=[],this._instance=t,this.er=[],this.vr=!0,!Qr(xs)&&"onLine"in xs.navigator&&(this.vr=xs.navigator.onLine,this.cr=()=>{this.vr=!0,this.pr()},this.gr=()=>{this.vr=!1},Zs(xs,"online",this.cr),Zs(xs,"offline",this.gr))}get length(){return this.er.length}retriableRequest(t){var e=t.retriesPerformedSoFar,n=i(t,Am);ei(e)&&(n.url=xm(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.Lt(r({retriesPerformedSoFar:e},n));0===t.statusCode&&$s.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==n.callback||n.callback(t)}}))}Lt(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.er.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),$s.warn(n),this.hr||(this.hr=!0,this.mr())}mr(){if(this.yr&&clearTimeout(this.yr),0===this.er.length)return this.hr=!1,void(this.yr=void 0);this.yr=setTimeout((()=>{this.vr&&this.er.length>0&&this.pr(),this.mr()}),this.dr)}pr(){var t=Date.now(),e=[],r=this.er.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.er=e,r.length>0)for(var i of r)this.retriableRequest(i.requestOptions)}unload(){for(var t of(this.yr&&(clearTimeout(this.yr),this.yr=void 0),this.hr=!1,Qr(xs)||(this.cr&&(xs.removeEventListener("online",this.cr),this.cr=void 0),this.gr&&(xs.removeEventListener("offline",this.gr),this.gr=void 0)),this.er)){var e=t.requestOptions;try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(t){$s.error(t)}}this.er=[]}}class $m{constructor(t){this.br=()=>{var t,e,r,i;this._r||(this._r={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this._r.lastScrollY=Math.ceil(s),this._r.maxScrollY=Math.max(s,null!==(t=this._r.maxScrollY)&&void 0!==t?t:0),this._r.maxScrollHeight=Math.max(o,null!==(e=this._r.maxScrollHeight)&&void 0!==e?e:0),this._r.lastContentY=a,this._r.maxContentY=Math.max(a,null!==(r=this._r.maxContentY)&&void 0!==r?r:0),this._r.maxContentHeight=Math.max(l,null!==(i=this._r.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get wr(){return this._instance.config.scroll_root_selector}getContext(){return this._r}resetContext(){var t=this._r;return setTimeout(this.br,0),t}startMeasuringScrollPosition(){Zs(xs,"scroll",this.br,{capture:!0}),Zs(xs,"scrollend",this.br,{capture:!0}),Zs(xs,"resize",this.br)}scrollElement(){if(!this.wr)return null==xs?void 0:xs.document.documentElement;var t=Wr(this.wr)?this.wr:[this.wr];for(var e of t){var r=null==xs?void 0:xs.document.querySelector(e);if(r)return r}}kr(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.wr){var r=this.scrollElement();return r&&r[e]||0}return xs?"y"===t?xs.scrollY||xs.pageYOffset||xs.document.documentElement.scrollTop||0:xs.scrollX||xs.pageXOffset||xs.document.documentElement.scrollLeft||0:0}scrollY(){return this.kr("y")}scrollX(){return this.kr("x")}}var Dm=t=>bc(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class Nm{constructor(t,e,r,i){this.Sr=t=>{var e=this.Cr();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Mr(this._instance)};this.Tr.register({[ch]:r})}},this._instance=t,this.Er=e,this.Tr=r,this.Mr=i||Dm,this.Er.onSessionId(this.Sr)}Cr(){return this.Tr.props[ch]}getSetOnceProps(){var t,e=null==(t=this.Cr())?void 0:t.props;return e?"r"in e?_c(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return qs(zs(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+jr(r)]=e})),t}}class qm{on(t,e){return this.Ir[t]||(this.Ir[t]=[]),this.Ir[t].push(e),()=>{this.Ir[t]=this.Ir[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.Ir[t]||[])r(e);for(var i of this.Ir["*"]||[])i(t,e)}constructor(){this.Ir={}}}var jm=Ds("[SessionId]");class Bm{on(t,e){return this.Pr.on(t,e)}constructor(t,e,r){var i;if(this.Rr=null,this.Lr=[],this.Or=void 0,this.Fr=!1,this.Pr=new qm,this.Ar=(t,e)=>!(!ei(t)||!ei(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Th)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Pe=t.config,this.Tr=t.persistence,this.Dr=void 0,this.$r=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Nr=e||jh,this.qr=r||jh;var n=this.Pe.persistence_name||this.Pe.token;if(this._sessionTimeoutMs=1e3*vi(this.Pe.session_idle_timeout_seconds||1800,60,36e3,jm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.jr(),this.Br="ph_"+n+"_window_id",this.Hr="ph_"+n+"_primary_window_exists",this.Ur()){var s=id.H(this.Br),o=id.H(this.Hr);s&&!o?this.Dr=s:id.F(this.Br),id.A(this.Hr,!0)}if(null!=(i=this.Pe.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.Pe.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.zr(this.Pe.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){jm.error("Invalid sessionID in bootstrap",t)}this.Wr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Qr(this.Lr)&&(this.Lr=[]),this.Lr.push(t),this.$r&&t(this.$r,this.Dr),()=>{this.Lr=this.Lr.filter((e=>e!==t))}}Ur(){return"memory"!==this.Pe.persistence&&!this.Tr.ki&&id.P()}Vr(t){t!==this.Dr&&(this.Dr=t,this.Ur()&&id.A(this.Br,t))}Zr(){return this.Dr?this.Dr:this.Ur()?id.H(this.Br):null}Gr(t){var e=this.Rr;return!Yr(e)&&!Yr(t)&&5e3>Math.abs(t-e)}zr(t,e,r){var i=e!==this._sessionActivityTimestamp,n=!(t!==this.$r||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.$r=t,n&&!i||n&&this.Gr(e)||(this.Rr=e,this.Tr.register({[Uu]:[e,t,r]}))}Qr(){var t,e=null==(t=this.Pe)?void 0:t.persistence_save_debounce_ms;return ei(e)&&e>0}Jr(){this.Qr()?this.Tr.refreshKey(Uu):(this.Tr.flush(),this.Tr.load())}Kr(){var t;if(!Yr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Rr){this.Jr();var e=this.Yr();e[1]===this.$r&&e[2]===this._sessionStartTimestamp&&(this.Rr=this._sessionActivityTimestamp,this.Tr.register({[Uu]:[this._sessionActivityTimestamp,null!==(t=this.$r)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Tr.flush())}}Xr(){var t=this.Yr()[0],e=ei(t)?t:0,r=ei(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,r)}tn(t){return this.Jr(),this.Ar(t,this.Xr())}Yr(){var t=this.Tr.props[Uu];return Wr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Rr=null,clearTimeout(this.en),this.en=void 0,this.zr(null,null,null)}destroy(){this.Fr=!0,this.Kr(),clearTimeout(this.en),this.en=void 0,this.Or&&xs&&(xs.removeEventListener(Rh,this.Or,{capture:!1}),this.Or=void 0),this.Lr=[]}Wr(){this.Or=()=>{this.Kr(),this.Ur()&&id.F(this.Hr)},Zs(xs,Rh,this.Or,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Pe.cookieless_mode===Th)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),i=this.Yr(),n=i[1],s=i[2],o=this.Xr(),a=this.Zr(),l=ei(s)&&Math.abs(r-s)>864e5,u=!1,h=!1,d=!n,c=n,v=!d&&!t&&this.Ar(r,o);if(v){(v=this.tn(r))||jm.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Yr();n=f[1],s=f[2]}d||v||l?(n=this.Nr(),a=this.qr(),jm.info("new session ID generated",{sessionId:n,windowId:a,changeReason:{noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l}}),s=r,u=!0):(a||(a=this.qr(),u=!0),(h=n!==c)&&(jm.info("adopted cross-tab session id",{sessionId:n,windowId:a}),u=!0));var p=ei(o)&&t&&!l?o:r,g=ei(s)?s:(new Date).getTime();this.Vr(a),this.zr(n,p,g),t||this.jr();var m={noSessionId:d,activityTimeout:v,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.Lr.forEach((t=>t(n,a,m))),{sessionId:n,windowId:a,sessionStartTimestamp:g,changeReason:u?m:void 0,lastActivityTimestamp:o}}jr(){this.Fr||(clearTimeout(this.en),this.en=setTimeout((()=>{if(!this.Fr)if(this.tn((new Date).getTime())){var t=this.$r;this.resetSessionId(),this.Pr.emit("forcedIdleReset",{idleSessionId:t})}else this.jr()}),1.1*this.sessionTimeoutMs))}}var Um=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Dr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Dr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function Hm(){return Hm=e((function*(){var t=null==Ss?void 0:Ss.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return Kr(r)&&r.length>0?r:void 0}catch(t){return void $s.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),Hm.apply(this,arguments)}var zm="custom",Wm="i.posthog.com",Vm=/^\/static\//;class Zm{constructor(t){this.rn={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+Wm,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.rn[this.apiHost]||(this.rn[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":zm),this.rn[this.apiHost]}nn(t){if(Vm.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if("assets"===t){var r=this.nn(e);if(r)return""+r+e}if(this.region===zm)return this.apiHost+e;var i=Wm+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Gm=Ds("[PostHog ExternalIntegrations]"),Qm={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Km{constructor(t){this._instance=t}ai(t,e){var r;null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Gm.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,i,n,s=r[0],o=r[1];!o||null!=(e=Ca.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.ai(Qm[s],(()=>{var e;null==(e=Ca.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!o&&null!=(i=Ca.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[s]&&(null==(n=Ca.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var r of Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{})){var i;e()}}}class Jm{constructor(t,e){this.rt=t,this.sn=e,this.an=new Map,this.ln=!1}add(t){var r=this;return e((function*(){if(r.ln)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(r.an.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');r.an.set(t.name,t);try{var e=t.setup(r.sn);e&&(yield e)}catch(e){var i=r.an.get(t.name)===t;i&&r.an.delete(t.name),r.rt.error('Failed to set up browser extension "'+t.name+'"',e),i&&r.un(t)}}))()}dispose(){if(!this.ln){this.ln=!0;var t=Array.from(this.an.values()).reverse();for(var e of(this.an.clear(),t))this.un(e)}}un(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Vr(e.then)&&e.then(void 0,(e=>{this.rt.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.rt.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class Ym{constructor(t){this._instance=t}get(t){var e;return null==(e=this._instance.persistence)?void 0:e.get_property(t)}set(t,e){var r;null==(r=this._instance.persistence)||r.set_property(t,e)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var Xm="extensionsRemoteConfig";class ty{constructor(t){this.ln=!1,this.instance=t,this.rt=$s.createLogger("[BrowserExtensions]"),this.hn=t.dn,this.kv=new Ym(t),this.onEvent=t=>Hl(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.rt.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.ln)return Hl((()=>{}));var e=e=>{try{t(e)}catch(t){this.rt.error("Browser extension remote config listener failed",t)}},r=this.instance.vn.on(Xm,e);return this.hn&&e(this.hn),Hl(r)},this.cn=new Jm(this.rt,this)}get logger(){return this.rt}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(ku))&&void 0!==t?t:this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var t,e,r,i,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(r=null==n?void 0:n.windowId)&&void 0!==r?r:"",sessionStartTimestamp:null!==(i=null==n?void 0:n.sessionStartTimestamp)&&void 0!==i?i:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.cn.add(t)}capture(t,r,i){var n=this;return e((function*(){i?n.instance.capture(t,r,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):n.instance.capture(t,r)}))()}registerDynamicEventProperties(t){return Hl(this.instance.fn(t))}handleRemoteConfig(t){this.ln||(this.hn=t,this.instance.vn.emit(Xm,t))}sendRequest(t,r){var i=this;return e((function*(){var e;void 0===r&&(r={});var n=i.instance.requestRouter.endpointFor(null!==(e=r.target)&&void 0!==e?e:"api",t),s={method:r.method,url:r.query?xm(n,r.query):n,data:r.body,headers:r.headers,timeout:r.timeoutMs,fireCallbackOnDrop:!0,transport:r.transport};return"sendBeacon"===r.transport?(i.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,i.instance._send_request(s)}))}))()}dispose(){this.ln||(this.ln=!0,this.cn.dispose())}}var ey={},ry=0,iy=()=>{},ny='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',sy="Surveys module not available",oy="sanitize_properties is deprecated. Use before_send instead",ay="Invalid value for property_denylist config: ",ly=["token","distinct_id",bh],uy="posthog",hy=!ym&&-1===(null==Ps?void 0:Ps.indexOf("MSIE"))&&-1===(null==Ps?void 0:Ps.indexOf("Mozilla")),dy=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Vs(null==Ts?void 0:Ts.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:iy,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Cs&&Kr(null==Cs?void 0:Cs.search)&&-1!==Cs.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==xs||null==(e=xs.location)?void 0:e.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){$s.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Mh,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Om},error_tracking:{},_onCapture:iy},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Ro,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(t))},cy=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],vy=t=>{var e={};for(var r of cy){var i=r[0],n=r[1];Qr(t[i])||(e[n]=t[i])}var s=js({},e,t),o=t.__preview_external_dependency_versioned_paths;return Qr(o)||(Qr(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Kr(o)&&Qr(t.asset_host)&&(s.asset_host=o)),Wr(t.property_blacklist)&&(Qr(t.property_denylist)?s.property_denylist=t.property_blacklist:Wr(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:$s.error(ay+t.property_denylist)),s};class fy{constructor(){this.__forceAllowLocalhost=!1}get pn(){return this.__forceAllowLocalhost}set pn(t){$s.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class py{gn(t,e){if(t){var r=this.an.indexOf(t);-1!==r&&this.an.splice(r,1)}return this.an.push(e),null==e.initialize||e.initialize(),e}mn(){return this.config.cookieless_mode===Th||this.config.cookieless_mode===Sh&&this.consent.isRejected()}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new fy,this.yn=!1,this.version=As.LIB_VERSION,this.vn=new qm,this.an=[],this.bn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=dy(),this.SentryIntegration=xg,this.sentryIntegration=t=>function(t,e){var r=wg(t,e);return{name:_g,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._n=!1,this.wn=null,this.xn=null,this.kn=null,this.scrollManager=new $m(this),this.pageViewManager=new kg(this),this.rateLimiter=new $g(this),this.requestRouter=new Zm(this),this.consent=new fg(this),this.externalIntegrations=new Km(this);var e=null!==(t=py.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=Kr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=Kr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>$s.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==uy){var i,n=null!==(i=ey[r])&&void 0!==i?i:new py;return n._init(t,e,r),ey[r]=n,ey[uy][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;void 0===e&&(e={});var o,a=Kr(t)?t.trim():"";if(!a)return $s.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+a+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=dy(e.defaults),e.debug=this.Sn(e.debug),this.Cn=e,this.Mn=[],e.person_profiles?this.xn=e.person_profiles:e.process_person&&(this.xn=e.process_person);var l=dy(e.defaults),u=vy(e),h=js({},l,u,{name:i,token:a});Zr(l.rageclick)&&Zr(u.rageclick)&&(h.rageclick=js({},l.rageclick,u.rageclick)),Zr(l.session_recording)&&Zr(u.session_recording)&&(h.session_recording=js({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&$s.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:zl.GZipJS;var d=this.Tn();this.persistence=new Pg(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Pg(r({},this.config,{persistence:"sessionStorage"}),d,!1);var c=r({},this.persistence.props),v=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.En=new Lm((t=>this.In(t)),this.config.request_queue_config),this.Pn=new Fm(this),this.__request_queue=[];var f=this.mn();if(f||(this.sessionManager=new Bm(this),this.sessionPropsManager=new Nm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($s.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Rn(f)}),0)):($s.info("Initializing extensions synchronously"),this.Rn(f)),As.DEBUG=As.DEBUG||this.config.debug,As.DEBUG&&$s.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:c,s:v}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var p=e.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(dh);if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===Ch)this.identify(p);else if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===Eh)$s.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var y=this.config.get_device_id(jh()),b=e.bootstrap.isIdentifiedID?y:p;this.persistence.set_property(dh,e.bootstrap.isIdentifiedID?Eh:Ch),this.register({distinct_id:p,$device_id:b})}}if(f)this.register_once({distinct_id:yh,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(jh());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(dh,Ch)}return Zs(xs,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||jh();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(dh,Eh)),e()},n=r.user();"then"in n&&Vr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||bg.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(bg.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(bg.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Ph),identify:t=>e(t,Lh),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Ln())):this.Ln(),Vr(this.config._onCapture)&&this.config._onCapture!==iy&&($s.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&$s.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Hm.apply(this,arguments)}().then((t=>{t&&this.register({[Su]:t})})).catch(iy),this}Rn(t){var e,i,n,s,o,a,l,u,h=performance.now(),d=r({},py.__defaultExtensionClasses,this.config.__extensionClasses),c=[];d.featureFlags&&this.an.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new d.featureFlags(this)),d.exceptions&&this.an.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.an.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.an.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.an.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.an.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.an.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.an.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.an.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this)),d.metrics&&this.an.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.an.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.an.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.an.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.an.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.an.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.an.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,mg)),d.toolbar&&this.an.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.an.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.an.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.On){var t=this.On;this.On=void 0,this.an.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.Fn(c,h)}Fn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Fn(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){$s.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[_h]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[wh]:i}),this.config.__preview_deferred_init_extensions&&$s.info("PostHog extensions initialized ("+i+"ms)")}Gi(t){var e;if(!Ts||!Ts.body)return $s.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Gi(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.On=t),this.dn=t,this.compression=void 0,t.ok){var r,i=t.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=Nr(i.supportedCompression,zl.GZipJS)?zl.GZipJS:Nr(i.supportedCompression,zl.Base64)?zl.Base64:void 0),null!=(r=i.analytics)&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.xn?this.xn:Mh}),null==(e=this.An)||e.handleRemoteConfig(t),this.an.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Ln(){try{this.config.loaded(this)}catch(t){$s.critical("`loaded` function failed",t)}if(this.Dn(),this.config.internal_or_test_user_hostname&&null!=Cs&&Cs.hostname){var t=Cs.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.mn())&&this.$n()}),1),this.Nn=new Ng(this),this.Nn.load()}Dn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.En)||t.enable())}_dom_loaded(){this.is_capturing()&&Ns(this.__request_queue,(t=>this.In(t))),this.__request_queue=[],this.Dn()}_handle_unload(){var t,e,r,i,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.qn()&&this.capture(Oh),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.En)||i.unload(),null==(n=this.Pn)||n.unload()):this.qn()&&this.capture(Oh,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?hy?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=r({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(Qr(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,n,s=r({},t);s.timeout=s.timeout||6e4;var o,a,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Qr(s.compression)&&s.data&&(s.compression=zl.Base64),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(h=(u=Wr(o=s.data)?o:[o])[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==a?a:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),Wr(t)?t.map((t=>r({},t,{sent_at:e}))):r({},t,{sent_at:e})}(s.data))),s.url=Rm(s.url,s.method,s.compression,s.timestampMode);var c=Pm.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),v=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(c,(t=>t.transport===d)))?void 0:n.method)&&void 0!==i?i:c[0].method;if(!v)throw new Error("No available transport method");"sendBeacon"!==d&&s.data&&s.compression===zl.GZipJS&&Rs&&"undefined"!=typeof Promise&&!_m?Cm(s).then((t=>{v(t)})).catch((e=>{if(Or(e))return _m=!0,void v(r({},s,{compression:void 0,url:Rm(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Or(t)||e===Ir})(e)&&(_m=!0),v(s)})):v(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}In(t){this.Pn?this.Pn.retriableRequest(t):this._send_request(t)}_execute_array(t){ry++;try{var e,r=[],i=[],n=[];Ns(t,(t=>{if(t)if(Wr(e=t[0]))n.push(t);else if(Vr(t))try{t.call(this)}catch(e){$s.error("Error executing queued PostHog call",t,e)}else Wr(t)&&"alias"===e?r.push(t):Wr(t)&&-1!==e.indexOf("capture")&&Vr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){Ns(t,(function(t){try{if(Wr(t[0])){var r=e;qs(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){$s.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{ry--}}push(t){if(ry>0&&Wr(t)&&Kr(t[0])){var e=py.prototype[t[0]];Vr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,l,u,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.En){if(this.is_capturing())if(!Qr(t)&&Kr(t)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var c=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){if(this.bn.length>0){var v={};for(var f of this.bn.slice())try{js(v,f())}catch(t){$s.error("Failed to produce browser extension event properties",t)}e=r({},v,null!=e?e:{})}var p;null!=(n=e)&&n.$current_url&&!Kr(null==(s=e)?void 0:s.$current_url)&&($s.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==(p=e)||delete p.$current_url),"$exception"!==t||null!=i&&i.jn||$s.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var g=new Date,m=(null==i?void 0:i.timestamp)||g,y=xn(null==i?void 0:i.uuid,jh),b={uuid:y,event:t,properties:this.calculateEventProperties(t,e||{},m,y)};t===Ph&&this.config.__preview_capture_bot_pageviews&&d&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),c&&(b.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var _="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property(Ku);(null==i?void 0:i.$set)&&!_&&(b.$set=null==i?void 0:i.$set);var w=null==i?void 0:i.$unset;w&&(b.$unset=w);var x=_?void 0:this.Bn(null==i?void 0:i.$set_once,t!==Ah,t===Lh);if(x&&(b.$set_once=x),null!=i&&i._noTruncate||(a=this.config.properties_string_max_length,l=b,u=t=>Kr(t)?t.slice(0,a):t,h=new Set,b=function t(e,r){if(e!==Object(e))return u?u(e):e;if(!h.has(e)){var i;if(h.add(e),Wr(e))i=[],Ns(e,(e=>{i.push(t(e))}));else{var n={};qs(e,((e,r)=>{h.has(e)||(n[r]=t(e,r))})),i=n}return i}}(l)),b.timestamp=m,Qr(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),_&&(b.properties=function(t,e){void 0===e&&(e=[]);var r={},i=e=>{void 0!==t[e]&&(r[e]=t[e])};return xr.forEach(i),e.forEach(i),r}(b.properties,ly)),t===Xl.DISMISSED||t===Xl.SENT){var k,S,T=null==(k=e)?void 0:k[tu.SURVEY_ID],C=null==(S=e)?void 0:S[tu.SURVEY_ITERATION];bu({id:T,current_iteration:C}),b.$set=r({},b.$set,{[su({id:T,current_iteration:C},t===Xl.SENT?"responded":"dismissed")]:!0})}else t===Xl.SHOWN&&(b.$set=r({},b.$set,{[tu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Lg.SHOWN){var E,M=null==(E=e)?void 0:E[Ag.TOUR_TYPE];M&&(b.$set=r({},b.$set,{[Ag.TOUR_LAST_SEEN_DATE+"/"+M]:(new Date).toISOString()}))}var I=r({},b.properties.$set,b.$set);if(Gr(I)||this.setPersonPropertiesForFlags(I),!Xr(this.config.before_send)){var R=this.Pt(b);if(!R)return;(b=R).uuid=xn(b.uuid,jh)}this.vn.emit("eventCaptured",b);var P=null!==(o=null==i?void 0:i._url)&&void 0!==o?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),O={method:"POST",url:P,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(P)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.In(O):this.En.enqueue(O),b}$s.critical("This capture call is ignored due to client rate limiting.")}}else $s.error("No event name provided to posthog.capture")}else $s.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}Hn(){var t;return null!==(t=this.An)&&void 0!==t?t:this.An=new ty(this)}fn(t){this.bn.push(t);var e=!0;return()=>{if(e){e=!1;var r=this.bn.indexOf(t);-1!==r&&this.bn.splice(r,1)}}}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.mn()&&(a[bh]=!0),"$snapshot"===t){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Kr(a.distinct_id)&&!ti(a.distinct_id)||Jr(a.distinct_id))&&$s.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(t,e,r,i){var n,s,o,a;if(void 0===i&&(i=!1),!Ps)return{};var l,u=t?[...uc,...e||[]]:[],h=function(t){for(var e=0;yn.length>e;e++){var r=yn[e],i=r[1],n=r[0].exec(t),s=n&&(Vr(i)?i(n,t):i);if(s)return s}return["",""]}(Ps),d=h[0],c=h[1],v=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={};Qr(r)||(f.detectGoogleSearchApp=r);var p={},g=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(s=navigator)?void 0:s.maxTouchPoints,y=null==xs||null==(o=xs.screen)?void 0:o.width,b=null==xs||null==(a=xs.screen)?void 0:a.height,_=null==xs?void 0:xs.devicePixelRatio;Qr(g)||(p.userAgentDataPlatform=g),Qr(m)||(p.maxTouchPoints=m),Qr(y)||(p.screenWidth=y),Qr(b)||(p.screenHeight=b),Qr(_)||(p.devicePixelRatio=_);var w,x=js(zs({$os:d,$os_version:c,$browser:pn(Ps,navigator.vendor,v,f),$device:bn(Ps),$device_type:_n(Ps,p),$timezone:wc(),$timezone_offset:xc()}),{$current_url:Xs(i?kn(null==Cs?void 0:Cs.href):null==Cs?void 0:Cs.href,u,dc),$host:null==Cs?void 0:Cs.host,$pathname:null==Cs?void 0:Cs.pathname,$raw_user_agent:Ps.length>1e3?Ps.substring(0,997)+"...":Ps,$browser_version:mn(Ps,navigator.vendor,v,f),$browser_language:gc(),$browser_language_prefix:(w=gc(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==xs?void 0:xs.screen.height,$screen_width:null==xs?void 0:xs.screen.width,$viewport_height:null==xs?void 0:xs.innerHeight,$viewport_width:null==xs?void 0:xs.innerWidth,$lib:As.LIB_NAME,$lib_version:As.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return As.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=As.SDK_DIST_CHANNEL),x}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime()),c=d.windowId;a.$session_id=d.sessionId,a.$window_id=c}this.sessionPropsManager&&js(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&js(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Pn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===zm&&(a.$lib_custom_api_host=this.config.api_host),u=t!==Ph||s?t!==Oh||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=js(a,u),t===Ph&&Ts&&(a.title=Ts.title),!Qr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}Ps&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),g=this.sessionPersistence.properties();qs(["$referrer","$referring_domain"],(t=>{t in p&&delete g[t]})),(a=js({},h,p,g,a)).$is_identified=this._isIdentified(),Wr(this.config.property_denylist)?qs(this.config.property_denylist,(function(t){delete a[t]})):$s.error(ay+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&($s.error(oy),a=m(a,t));var y=this.Un();return a.$process_person_profile=y,y&&!s&&this.zn("_calculate_event_properties"),a}Bn(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.Un())return t;if(this.yn&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=js({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&($s.error(oy),o=a(o,"$set_once")),e&&(this.yn=!0),Gr(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Wn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var r,i;return null!==(r=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e))&&void 0!==r?r:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.vn.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:sy}),()=>{})}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:sy})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:sy})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=wu),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:sy}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:sy})}Vn(t){return!t||Jr(t)?($s.critical("Unique user id has not been set in posthog.identify"),!1):t===yh?($s.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||($s.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return $s.uninitializedWarning("posthog.identify");if(ti(t)&&(t=t.toString(),$s.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Vn(t)&&this.zn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(ku)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Tu)&&(this.unregister(Tu),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(dh)||Ch)===Ch,o=t!==i,a=!o&&s;if(o&&s)this.persistence.set_property(dh,Eh),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(Lh,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.kn=Hh(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i);else if(a){this.persistence.set_property(dh,Eh);var l=e||{},u=r||{};this.setPersonPropertiesForFlags({$set:l,$set_once:u},!1),this.capture("$set",{$set:l,$set_once:u}),this.kn=Hh(t,e,r)}else(e||r)&&this.setPersonProperties(e,r);o?(this.reloadFeatureFlags(),this.unregister(ah)):a&&(e||r)&&this.reloadFeatureFlags()}}setPersonProperties(t,e){if((t||e)&&this.zn("posthog.setPersonProperties")){var r=Hh(this.get_distinct_id(),t,e);this.kn!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.kn=r):$s.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,r=(Wr(t)?t:[t]).filter((t=>Kr(t)&&t.length>0));0!==r.length&&this.zn("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.kn=null)}group(t,e,i){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(Ah,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else $s.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.zn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){this.Zn(t)}Zn(t,e){var r,i,n,s,o,a,l,u,h,d;if(void 0===e&&(e=!1),$s.info("reset"),!this.__loaded)return $s.uninitializedWarning("posthog.reset");var c,v=this.get_property(ku),f=this.get_property(Su),p=this.get_property($u),g=this.is_capturing();if(this.consent.reset(),e||!g||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after."),null==(r=this.persistence)||r.clear(),null==(i=this.sessionPersistence)||i.clear(),Qr(p)||null==(c=this.persistence)||c.register({[$u]:p}),null==(n=this.surveys)||n.reset(),null==(s=this.Nn)||s.stop(),null==(o=this.featureFlags)||o.reset(),null==(a=this.conversations)||a.reset(),null==(l=this.logs)||l.reset(),null==(u=this.metrics)||u.reset(),null==(h=this.persistence)||h.set_property(dh,Ch),null==(d=this.sessionManager)||d.resetSessionId(),this.kn=null,this.config.cookieless_mode===Th)this.register_once({distinct_id:yh,$device_id:null},"");else{var m=this.config.get_device_id(jh());this.register_once({distinct_id:m,$device_id:t?m:v},""),t||Qr(f)||this.register({[Su]:f})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var r=this;return e((function*(){var t,e,i,n,s,o,a;r.__loaded?(null==(t=r.Nn)||t.stop(),null==(e=r.An)||e.dispose(),null==(i=r.logs)||i.flushLogs("sendBeacon"),null==(n=r.metrics)||n.flush("sendBeacon"),null==(s=r.En)||s.unload(),null==(o=r.Pn)||o.unload(),null==(a=r.featureFlags)||a.destroy()):$s.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.Gn()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Qn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=e.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(xu)?($s.critical("Attempting to create alias for existing People user - aborting."),-2):this.zn("posthog.alias")?(Qr(e)&&(e=this.get_distinct_id()),t!==e?(this.Wn(Tu,t),this.capture("$create_alias",{alias:t,distinct_id:e})):($s.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(Zr(t)){var i,n,s,o,a,l,u,h,d,c,v;js(this.config,vy(t));var f=this.Tn();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Pg(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.Sn(this.config.debug);ri(p)&&(this.config.debug=p),ri(this.config.debug)&&(this.config.debug?(As.DEBUG=!0,Yh.P()&&Yh.A("ph_debug",!0),$s.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(As.DEBUG=!1,Yh.P()&&Yh.F("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.Jn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){As.LIB_NAME=t,As.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}}addExceptionStep(t,e){var r;null==(r=this.exceptions)||r.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:py.Kn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:uy;return e!==uy&&(e=uy+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(dh))===Eh||(null==(e=this.sessionPersistence)?void 0:e.get_property(dh))===Eh}Un(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Mh&&!this._isIdentified()&&Gr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Tu])&&(null==(e=this.persistence)||null==(e=e.props)||!e[mh]))}qn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Un()||this.zn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.zn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}zn(t){return"never"===this.config.person_profiles?($s.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Wn(mh,!0),!0)}Tn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Sh)}Jn(){var t,e,r,i,n=this.Tn();return(null==(t=this.persistence)?void 0:t.ki)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.ki)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Th){if(this.mn()){var r,i,n,s,o;this.Zn(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Bm(this),this.pageViewManager=new kg(this),this.persistence&&(this.sessionPropsManager=new Nm(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=py.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.gn(this.sessionRecording,new l(this)),this.dn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.dn)))}var u,h;this.consent.optInOut(!0),this.Jn(),this.Dn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Sh&&(null==(u=this.surveys)||u.loadIfEnabled()),(Qr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$n()}else $s.warn(ny)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==Th?(this.config.cookieless_mode===Sh&&this.consent.isOptedIn()&&this.Zn(!0,!0),this.consent.optInOut(!1),this.Jn(),this.config.cookieless_mode===Sh&&(this.register({distinct_id:yh,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.$n(),this.Dn())):$s.warn(ny)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Th||(this.config.cookieless_mode===Sh?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Jn()}_is_bot(){return Ss?Um(Ss,this.config.custom_blocked_useragents):void 0}$n(){Ts&&("visible"===Ts.visibilityState?this._n||(this._n=!0,this.capture(Ph,{title:Ts.title},{send_instantly:!0}),this.wn&&(Ts.removeEventListener(Ih,this.wn),this.wn=null)):this.wn||(this.wn=this.$n.bind(this),Zs(Ts,Ih,this.wn)))}debug(t){!1===t?(null==xs||xs.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==xs||xs.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)`."),this.set_config({debug:!0}))}Ji(){var t=this.Cn||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?($s.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(t,e,r,i,n){var s=e in t&&!Xr(t[e]),o=r in t&&!Xr(t[r]);return s?t[e]:!!o&&(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r])}(t,"advanced_disable_flags","advanced_disable_decide",0,$s)}Pt(t){var e;if(Xr(this.config.before_send))return t;var r=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(si),i=Wr(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of i){if(n=s(n),Xr(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return ni(t.event)?$s.warn(o+". This can cause unexpected behavior."):$s.info(o),null}n.properties&&!Gr(n.properties)||$s.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of r)if(n.properties&&Xr(n.properties[a]))return $s.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.ui)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}Sn(t){var e=ri(t)&&!t,r=Yh.P()&&"true"===Yh.q("ph_debug");return!e&&(!!r||t)}}py.__defaultExtensionClasses={},py.Kn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=Hs(t.prototype[e[r]])}(py,["identify"]);var gy=Ds("[ExceptionAutocapture]"),my=Ds("[TracingHeaders]"),yy=Ds("[Web Vitals]"),by=9e5,_y="disabled",wy="lazy_loading",xy="awaiting_config",ky="missing_config";Ds("[SessionRecording]"),Ds("[SessionRecording]");var Sy="[SessionRecording]",Ty=Ds(Sy),Cy=Ds("[Heatmaps]");function Ey(t){return Zr(t)&&"clientX"in t&&"clientY"in t&&ti(t.clientX)&&ti(t.clientY)}var My=Ds("[Product Tours]"),Iy=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Au))},Ry=["$set_once","$set"],Py=Ds("[SiteApps]"),Oy="Error while initializing PostHog app with config id ";function Ly(t,e,r){if(Xr(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Ay{constructor(t){this.Yn=new qm,this.Xn=(t,e)=>this.ts(t,e)&&this.es(t,e)&&this.rs(t,e)&&this.ns(t,e),this.ts=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.ss=new Set,this.os=new Set}init(){var t,e;Qr(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!Qr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.os)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.ss)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.ss.has(t)||this.ss.has(e.event))&&this.os&&(null==(r=this.os)?void 0:r.size)>0&&this.os.forEach((t=>{this.ls(e,t)&&this.Yn.emit("actionCaptured",t.name)}))}us(t){this.onAction("actionCaptured",(e=>t(e)))}ls(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.Xn(t,r))return!0;return!1}onAction(t,e){return this.Yn.on(t,e)}es(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Ly(i,e.url,e.url_matching||"contains"))return!1}return!0}rs(t,e){return!!this.hs(t,e)&&!!this.ds(t,e)&&!!this.vs(t,e)}hs(t,e){var r;if(null==e||!e.href)return!0;var i=this.cs(t);if(i.length>0)return i.some((t=>Ly(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Ly((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ds(t,e){var r;if(null==e||!e.text)return!0;var i=this.cs(t);if(i.length>0)return i.some((t=>Ly(t.text,e.text,e.text_matching||"exact")||Ly(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!Xr(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Ly(t,s,o))))}vs(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}cs(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}ns(t,e){return null==e||!e.properties||0===e.properties.length||Vh(e.properties.reduce(((t,e)=>{var r=Wr(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Fy{constructor(t){var e;this.fs=[],this._instance=t,this.ps=new Map,this.gs=new Map,this.ys=new Map,null==(e=this._instance)||null==e.onSessionId||e.onSessionId((t=>this.bs(t)))}_s(t){return!1}ws(){return null}xs(t){}ks(){}Ss(t,e){return!!t&&Vh(t.propertyFilters,null==e?void 0:e.properties)}Cs(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}Ms(t,e,r){var i=(r===Wl.Activation?this.ps:this.gs).get(t),n=[];return this.Ts((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Ss(s,e)}))}register(t){var e;Qr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Es(t),this.Is(t))}Is(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==e.length&&(null==this.Ps&&(this.Ps=new Ay(this._instance),this.Ps.init(),this.Ps.us((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Ps)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var r=this.ys.get(e.name);r&&r.push(t.id),this.ys.set(e.name,r||[t.id])}})))})))}Es(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.ps=this.Cs(t,Wl.Activation),this.gs=this.Cs(t,Wl.Cancellation))}onEvent(t,e){var r,i,n=this.Rs(),s=(null==e||null==(r=e.properties)?void 0:r.$survey_id)||(null==e||null==(i=e.properties)?void 0:i.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var o=this.Ls(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Os([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Fs(s),void this.As([s])}if(this.gs.has(t)){var a=this.Ms(t,e,Wl.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map((t=>t.id))}),this.Os(a.map((t=>t.id))),a.forEach((t=>this.Ds(t.id))))}if(this.ps.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.ps.get(t)});var l=this.Ms(t,e,Wl.Activation);this.$s(l.map((t=>t.id)))}}onAction(t){this.ys.has(t)&&this.$s(this.ys.get(t)||[])}$s(t){var e;if(0!==t.length){var r=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),i=[];for(var n of t)r&&this._s(n)?this.Fs(n)&&this.Ns(n):i.push(n);i.length>0&&(this.fs=[...new Set([...this.fs,...i])]),this.Rs().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Fs(t){this.fs=this.fs.filter((e=>e!==t));var e=this.qs();return!e.includes(t)&&(this.js([...e,t]),this.Bs(),!0)}Os(t){var e=new Set(t);this.fs=this.fs.filter((t=>!e.has(t)));var r=this.Hs(),i=r.filter((t=>!e.has(t)));i.length!==r.length&&(this.js(i),0===i.length&&this.Us()),this.As(t)}zs(){var t,e=this.ws();if(!e)return{};var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return r&&"object"==typeof r?r:{}}Ns(t){if(this.ws()){var e=this.zs();this.xs(r({},e,{[t]:Date.now()}))}}As(t){if(this.ws()){var e=this.zs(),r={},i=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?i=!0:r[s]=o}i&&(Gr(r)?this.ks():this.xs(r))}}Ws(){this.ws()&&this.ks()}getActivationTimestamp(t){if(this.qs().includes(t)){var e=this.zs()[t];return ti(e)?e:void 0}}Hs(){var t,e=this.Vs();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}qs(){var t,e,r=this.Hs();if(0===r.length)return[];var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Zs()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&i===n?r:[]}Bs(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Gs(e)}Us(){this.Qs()}bs(t){var e,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Zs()];if(r&&r!==t){var i=this.Hs(),n=this.zs();i.length>0&&(this.js([]),i.filter((t=>ti(n[t]))).forEach((t=>this.Ds(t)))),this.Us(),this.Ws()}}getActivatedIds(){return[...new Set([...this.qs(),...this.fs])].filter((t=>!this.Js(t)))}reset(){this.fs=[],this.Hs().length>0&&this.js([]),this.Us(),this.Ws()}getEventToItemsMap(){return this.ps}Ks(){return this.Ps}}class $y extends Fy{constructor(t){super(t)}Vs(){return ih}Zs(){return nh}ws(){return sh}xs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[sh]:t})}ks(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(sh)}_s(t){var e,r;this.Ts((e=>{r=e.find((e=>e.id===t))}));var i=null==(e=r)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return ti(i)&&i>0}Ys(){return Xl.SHOWN}Ts(t){var e;null==(e=this._instance)||e.getSurveys(t)}Ds(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Rs(){return cu}js(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ih]:t})}Gs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[nh]:t})}Qs(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(nh)}Js(){return!1}Ls(t,e){var r;return this.Ts((t=>{r=t.find((t=>t.id===e))})),!r||du(r)?t===Xl.SHOWN?"consume":"ignore":t===Xl.SHOWN?"persist":t===Xl.DISMISSED||t===Xl.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Dy="SDK is not enabled or survey functionality is not yet loaded",Ny="Disabled. Not loading surveys.",qy=null!=xs&&xs.location?to(xs.location.hash,"__posthog")||to(location.hash,"state"):null,jy="_postHogToolbarParams",By=Ds("[Toolbar]"),Uy=Ds("[FeatureFlags]"),Hy=Ds("[FeatureFlags]",{debugEnabled:!0}),zy="\" failed. Feature flags didn't load in time.",Wy=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},Vy=t=>{var e={};for(var r of Bs(t||{})){var i=r[1];i&&(e[r[0]]=i)}return e},Zy="Refusing to render web experiment since the viewer is a likely bot",Gy={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Uh(e,t),not_regex:(t,e)=>!Uh(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Qy{get Pe(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Qy.Xs("retrieved web experiments from the server"),e.ta=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.ta&&(Qy.Xs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.ta)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);Kr(i)&&t.variants[i]&&e.ea(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Qy.ia(s,e._instance)&&e.ea(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Qy.Xs(Zy);else if(!this.Pe.disable_web_experiments){if(Xr(this.ta))return this.ta=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Qy.Xs("applying feature flags",t),t.forEach((t=>{var e;if(this.ta&&null!=(e=this.ta)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.ta)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.ea(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Qy.getWindowLocation();if(null!=t&&t.search){var e=Ys(null==t?void 0:t.search,"__experiment_id"),r=Ys(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Qy.Xs("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.ra(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.Pe.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.Pe.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Pe.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}ra(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Qy.Xs("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.ea(i[0].name,e,i[0].variants[e].transforms))}static ia(t,e){return!Xr(t.conditions)&&Qy.na(t,e)&&Qy.sa(t)}static na(t,e){var r;if(Xr(t.conditions)||Xr(null==(r=t.conditions)?void 0:r.url))return!0;var i=Qy.getWindowLocation();if(i){var n,s,o,a=oo(e,i.href);return null==(n=t.conditions)||!n.url||Gy[null!==(s=null==(o=t.conditions)?void 0:o.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,a)}return!1}static getWindowLocation(){return null==xs?void 0:xs.location}static sa(t){var e;if(Xr(t.conditions)||Xr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=vc();if(r.utm_source){var i,n,s,o,a,l,u,h,d=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,c=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return d&&v&&f&&c}return!1}static Xs(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];$s.info("[WebExperiments] "+t,r)}ea(t,e,r){this._is_bot()?Qy.Xs(Zy):"control"!==e?r.forEach((r=>{if(r.selector){var i;Qy.Xs("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):Qy.Xs("Control variants leave the page unmodified.")}_is_bot(){return Ss&&this._instance?Um(Ss,this.Pe.custom_blocked_useragents):void 0}}var Ky=Ds("[Conversations]"),Jy="Conversations not available yet.",Yy="console",Xy="__posthogHandledLogsRequestError",tb=(t,e)=>{var r=t instanceof Error?t:new Error(e);return r[Xy]=!0,r},eb=t=>!!t&&"object"==typeof t&&!0===t[Xy],rb={featureFlags:class{constructor(t){this.aa=!1,this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.va=!1,this.ca=!1,this.fa=0,this.pa=()=>{var t=this.ga();this.fa=0,t&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],xs&&Zs(xs,"online",this.pa)}destroy(){null==xs||xs.removeEventListener("online",this.pa)}get Pe(){return this._instance.config}get Tr(){return this._instance.persistence}ma(t){return this._instance.get_property(t)}ya(){var t,e;return null!==(t=null==(e=this.Tr)?void 0:e.Ci(this.Pe.feature_flag_cache_ttl_ms))&&void 0!==t&&t}ba(){return!!this.ya()&&(this.ca||this.la||(this.ca=!0,Uy.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_a(){var t,e=null!==(t=this.Pe.evaluation_contexts)&&void 0!==t?t:this.Pe.evaluation_environments;return!this.Pe.evaluation_environments||this.Pe.evaluation_contexts||this.va||(Uy.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.va=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Uy.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}wa(){return this._a().length>0}xa(){var t=this.Pe.flag_keys;if(!Qr(t)){if(Wr(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Uy.error("Invalid flag key found:",t,"Expected non-empty string"),e}));Uy.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,r=this._instance.config,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),l=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(t,e,i){var n,s,o=null!=i&&i.merge&&null!==(n=this.ma(zu))&&void 0!==n?n:{},a=null!=i&&i.merge&&null!==(s=this.ma(Gu))&&void 0!==s?s:{},l=r({},o,t),u=r({},a,e),h={};for(var d of Object.entries(l)){var c=d[0],v=d[1];h[c]={key:c,enabled:br(v),variant:_r(v),reason:void 0,metadata:Qr(null==u?void 0:u[c])?void 0:{id:0,version:void 0,description:void 0,payload:u[c]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.oa}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.ma(Zu),e=this.ma(Ju),i=this.ma(Yu);if(!i&&!e)return t||{};var n=js({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],d=Qr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,c=Qr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:d,variant:d?null!=c?c:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),c!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v&&(f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.aa||(Uy.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.aa=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((r=>{var i=t[r];return{key:r,enabled:br(i),variant:_r(i),payload:yr(e[r])}}))}getFlagVariants(){var t=this.ma(zu),e=this.ma(Ju);if(!e)return t||{};for(var r=js({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.aa||(Uy.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.aa=!0),r}getFlagPayloads(){var t=this.ma(Gu),e=this.ma(Yu);if(!e)return t||{};for(var r=js({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.aa||(Uy.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.aa=!0),r}reloadFeatureFlags(){this.ua||this.Pe.advanced_disable_feature_flags||this.ga()||this.ka||(this._instance.vn.emit("featureFlagsReloading",!0),this.ka=setTimeout((()=>{this.Sa()}),5))}Ca(){clearTimeout(this.ka),this.ka=void 0}ensureFlagsLoaded(){this.oa||this.la||this.ka||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ua=t}Sa(t){var e;if(this.Ca(),!this._instance.Ji()&&!this.ga())if(this.la)this.ha=!0;else{var i=this.Pe.token,n=this.ma(ku),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this.Tr)?void 0:e.get_initial_props())||{},this.ma(Xu)||{},{$lib:As.LIB_NAME,$lib_version:As.LIB_VERSION}),group_properties:this.ma(th),timezone:wc()};Yr(n)||Qr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Pe.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.wa()&&(s.evaluation_contexts=this._a());var o=this.xa();Qr(o)||(s.flag_keys=o);var a=!!this.Pe.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Pe.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.la=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Pe.disable_compression?void 0:zl.Base64,timestampMode:"body",timeout:this.Pe.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(this.Ma(t.statusCode),200===t.statusCode&&(this.ha||(this.$anon_distinct_id=void 0),n=!1),this.la=!1,!s.disable_flags||this.ha){this.da=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.Tr)||i.register({[uh]:o}),u)Uy.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(l=t.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.ha&&(this.ha=!1,this.Sa())}}})}}ga(){return eo(this.fa,3)}Ma(t){this.fa=ro(t,this.fa,3,(()=>Uy.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Uy.warn('getFeatureFlag for key "'+t+zy)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.ma(Qu)||void 0,l=this.ma(hh)||void 0,u=this.ma(ah)||{};if(this.Pe.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),c=this.ma(lh);d&&d!==c&&(u={},null==(h=this.Tr)||h.register({[ah]:u,[lh]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(o))){var v,f,p,g,m,y,b,_,w,x,k;Wr(u[t])?u[t].push(o):u[t]=[o],null==(v=this.Tr)||v.register({[ah]:u});var S=this.getFeatureFlagDetails(t),T=[...null!==(f=this.ma(uh))&&void 0!==f?f:[]];Qr(n)&&T.push("flag_missing");var C={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Pe.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Pe.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.da};Qr(null==S||null==(m=S.metadata)?void 0:m.has_experiment)||(C.$feature_flag_has_experiment=S.metadata.has_experiment),Qr(null==S||null==(y=S.metadata)?void 0:y.version)||(C.$feature_flag_version=S.metadata.version);var E,M=null!==(b=null==S||null==(_=S.reason)?void 0:_.description)&&void 0!==b?b:null==S||null==(w=S.reason)?void 0:w.code;M&&(C.$feature_flag_reason=M),null!=S&&null!=(x=S.metadata)&&x.id&&(C.$feature_flag_id=S.metadata.id),Qr(null==S?void 0:S.original_variant)&&Qr(null==S?void 0:S.original_enabled)||(C.$feature_flag_original_response=Qr(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(k=S.metadata)&&k.original_payload&&(C.$feature_flag_original_payload=null==S||null==(E=S.metadata)?void 0:E.original_payload),T.length&&(C.$feature_flag_error=T.join(",")),this._instance.capture("$feature_flag_called",C)}if(i)return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:yr(s)}}}else Uy.warn('getFeatureFlagResult for key "'+t+zy)}getRemoteConfigPayload(t,e){var r=this.Pe.token,i={distinct_id:this._instance.get_distinct_id(),token:r,person_properties:{$lib:As.LIB_NAME,$lib_version:As.LIB_VERSION}};this.wa()&&(i.evaluation_contexts=this._a());var n=this.xa();Qr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Pe.disable_compression?void 0:zl.Base64,timestampMode:"body",timeout:this.Pe.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.da)return e.defaultValue;if(!(this.oa||this.getFlags()&&this.getFlags().length>0))return Uy.warn('isFeatureEnabled for key "'+t+zy),e.defaultValue;var r=this.getFeatureFlag(t,e);return Qr(r)?e.defaultValue:!!r}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.Tr){this.oa=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):t.featureFlags&&Uy.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,c=t.evaluatedAt;if(Wr(u)){Uy.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;e&&e.register({[Wu]:u,[zu]:v,[Ku]:!1})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(t.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((t=>{var e;return!(null!=(e=l[t])&&e.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((t=>y.has(t[0]))))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);e&&e.register(r({[Wu]:Object.keys(Vy(p)),[zu]:p||{},[Gu]:g||{},[Zu]:m||{},[Ku]:!0===t.minimalFlagCalledEvents},d?{[Qu]:d}:{},c?{[hh]:c}:{}))}}}(t,this.Tr,n,s,o,i),e||(this.ca=!1),this.Ta(e)}}override(t,e){void 0===e&&(e=!1),Uy.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.Tr)return Uy.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.Tr.unregister(Ju),this.Tr.unregister(Yu),this.Ta(),Hy.info("All overrides cleared");if(Wr(t)){var e=Wy(t);return this.Tr.register({[Ju]:e}),this.Ta(),Hy.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.aa=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.Tr.unregister(Ju),Hy.info("Flag overrides cleared");else if(i.flags){if(Wr(i.flags)){var n=Wy(i.flags);this.Tr.register({[Ju]:n})}else this.Tr.register({[Ju]:i.flags});Hy.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.Tr.unregister(Yu),Hy.info("Payload overrides cleared")):i.payloads&&(this.Tr.register({[Yu]:i.payloads}),Hy.info("Payload overrides set",{payloads:i.payloads}))),void this.Ta()}if(t&&"object"==typeof t)return this.Tr.register({[Ju]:t}),this.Ta(),Hy.info("Flag overrides set",{flags:t});Uy.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.oa){var e=this.Ea(),r=e.flags,i=e.flagVariants;try{t(r,i)}catch(t){Uy.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.ma(Vu)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[t]:e});null==(n=this.Tr)||n.register({[Wu]:Object.keys(Vy(l)),[zu]:l}),this.Ta()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.ma(Vu),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Pe.token+n),method:"GET",timestampMode:"query",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.Tr)||r.unregister(Vu),null==(i=this.Tr)||i.register({[Vu]:n}),t(n)}}})}Ea(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}Ta(t){var e=this.Ea(),r=e.flags,i=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(r,i,{errorsLoading:t})}catch(t){Uy.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.ma(Xu)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[Xu]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=r({},this.ma(Xu)||{});t.forEach((t=>{delete i[t]})),this._instance.register({[Xu]:i}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this._instance.unregister(Xu),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.ma(th)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[th]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.ma(th)||{};this._instance.register({[th]:r({},e,{[t]:{}})})}else this._instance.unregister(th)}reset(){this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.$anon_distinct_id=void 0,this.Ca(),this.aa=!1,this.fa=0}}},ib={sessionRecording:class{get Pe(){return this._instance.config}get Tr(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Ia)||!t.isStarted)}get status(){var t,e;return this.Pa===xy||this.Pa===ky?this.Pa:null!==(t=null==(e=this.Ia)?void 0:e.status)&&void 0!==t?t:this.Pa}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Pa=_y,this.Ra=void 0,this._instance=t,!this._instance.sessionManager)throw Ty.error("started without valid sessionManager"),new Error(Sy+" started without valid sessionManager. This is a bug.");if(this.Pe.cookieless_mode===Th)throw new Error(Sy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get La(){var t,e=!(null==(t=this._instance.get_property($u))||!t.enabled),r=!this.Pe.disable_session_recording,i=this.Pe.disable_session_recording||this._instance.consent.isOptedOut();return xs&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.La||null==(e=this.Ia)||!e.isStarted){var r=!Qr(Object.assign)&&!Qr(Array.from);this.La&&r?(this.Oa(t),Ty.info("starting")):(this.Pa=_y,this.stopRecording())}}Oa(t){var e,r,i;this.La&&(this.Pa!==xy&&this.Pa!==ky&&(this.Pa=wy),null!=Ca&&null!=(e=Ca.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=Ca.__PosthogExtensions__)&&r.initSessionRecording?this.Fa(t):null==(i=Ca.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Aa,(e=>{if(e)return Ty.error("could not load recorder",e);this.Fa(t)})))}stopRecording(){var t,e;null==(t=this.Ra)||t.call(this),this.Ra=void 0,null==(e=this.Ia)||e.stop()}Da(){var t,e;null==(t=this.Ra)||t.call(this),this.Ra=void 0,null==(e=this.Ia)||e.discard()}$a(){var t,e;null==(t=this.Tr)||t.unregister(Hu),null==(e=this.Tr)||e.unregister(Du)}Na(t,e){if(Xr(t))return null;var r,i=ti(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Ty.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}qa(t){if(this.Tr){var e,i,n=this.Tr,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Na(null==(e=this.Pe.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Na(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Xr(a)&&this.$a();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[$u]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Qr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(e=this.Ra)||e.call(this),this.Ra=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.qa(e),void this.Da()):(this.qa(e),void this.startIfEnabledOrStop()):(this.Pa===xy&&(this.Pa=ky,Ty.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Ia)&&r.log?this.Ia.log(t,e):Ty.warn("log called before recorder was ready")}get Aa(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property($u);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}ja(){var t,e,r=this._instance.get_property($u);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return Ty.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var i=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}Fa(t){var e,r;if(null==(e=Ca.__PosthogExtensions__)||!e.initSessionRecording)return Ty.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[xh]:!0});if(this.Ia||(this.Ia=null==(r=Ca.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Ia._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ja()){if(this.Pa===ky||this.Pa===xy)return;return this.Pa=xy,Ty.info("persisted remote config is stale, requesting fresh config before starting"),void new Ng(this._instance).load()}this.Pa=wy,this.Ia.start(t)}onRRwebEmit(t){var e;null==(e=this.Ia)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Ia||null==(e=this.Tr)||e.register({[qu]:!0}),null==(t=this.Ia)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Ia||null==(e=this.Tr)||e.register({[Nu]:!0}),null==(t=this.Ia)||t.overrideSampling()}overrideTrigger(t){var e,r;this.Ia||null==(r=this.Tr)||r.register({["url"===t?ju:Bu]:!0}),null==(e=this.Ia)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Ia)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Ia)||!r.tryAddCustomEvent(t,e))}}},nb={autocapture:class{constructor(t){this.Ba=!1,this.Ha=null,this.Ua=!1,this.za=!1,this.instance=t,this.rageclicks=new Yp(t.config.rageclick),this.Wa=null}initialize(){this.startIfEnabled()}get Pe(){var t,e,r=Zr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}Va(){if(this.isBrowserSupported()){if(xs&&Ts){var t=t=>{t=t||(null==xs?void 0:xs.event);try{this.Za(t)}catch(t){tg.error("Failed to capture event",t)}};if(Zs(Ts,"submit",t,{capture:!0}),Zs(Ts,"change",t,{capture:!0}),Zs(Ts,"click",t,{capture:!0}),this.Pe.capture_copied_text){var e=t=>{t=t||(null==xs?void 0:xs.event);try{this.Za(t,Xp)}catch(t){tg.error("Failed to capture copy/cut event",t)}};Zs(Ts,"copy",e,{capture:!0}),Zs(Ts,"cut",e,{capture:!0})}}}else tg.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ba&&(this.Va(),this.Ba=!0)}onRemoteConfig(t){if(this.Ua=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.za=e.elementsChainAsString);var r=e.autocapture_opt_out;ri(r)&&(this.instance.persistence&&this.instance.persistence.register({[Eu]:r}),this.Ha=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Wa=t}getElementSelectors(t){var e,r=[];return null==(e=this.Wa)||e.forEach((e=>{var i=null==Ts?void 0:Ts.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[Eu],i=this.Ha,n=this.instance.Ji()&&!this.Ua;if(Yr(i)&&!ri(r)&&!n)return!1;var s=null!==(e=this.Ha)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!s}Za(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=So(t);go(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Fo(i,this.instance.config.rageclick)&&this.Za(t,"$rageclick");var n=e===Xp;if(i&&function(t,e,r,i,n,s){var o;if(!xs||$o(t))return!1;if(null!=r&&r.url_allowlist&&!_o(r.url_allowlist,s))return!1;if(null!=r&&r.url_ignorelist&&_o(r.url_ignorelist,s))return!1;if(null!=r&&r.dom_event_allowlist){var a=r.dom_event_allowlist;if(a&&!a.some((t=>e.type===t)))return!1}var l=Do(t,i),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(Qr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(h,r))return!1;if(!Co(h,null==r?void 0:r.css_selector_allowlist))return!1;if(Co(h,null!==(o=null==r?void 0:r.css_selector_ignorelist)&&void 0!==o?o:Mo))return!1;try{var d=xs.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return u?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(To.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.Pe,n,n?["copy","cut"]:void 0,this.instance)){var s=ig(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Pe.element_attribute_ignorelist,elementsChainAsString:this.za,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=s.props;if(s.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(o.$element_selectors=a),e===Xp){var l,u=xo(null==xs||null==(l=xs.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;o.$selected_content=u,o.$copy_type=h}return this.instance.capture(e,o),!0}}}isBrowserSupported(){return Vr(null==Ts?void 0:Ts.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ga=(null==xs||null==(e=xs.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&($s.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Qa&&this.Qa(),this.Qa=void 0,$s.info("History API monitoring stopped")}monitorHistoryChanges(){xs&&xs.history&&(this.Ja("pushState"),this.Ja("replaceState"),this.Ka())}Ja(t){var e;if(xs&&(null==(e=xs.history[t])||!e.__posthog_wrapped__)){var r=this;no(xs.history,t,(e=>function(i,n,s){e.call(this,i,n,s),r.Ya(t)}))}}Ya(t){try{var e,r=null==xs||null==(e=xs.location)?void 0:e.pathname;if(!r)return;r!==this.Ga&&this.isEnabled&&this._instance.capture(Ph,{navigation_type:t}),this.Ga=r}catch(e){$s.error("Error capturing "+t+" pageview",e)}}Ka(){if(!this.Qa){var t=()=>{this.Ya("popstate")};Zs(xs,"popstate",t),this.Qa=()=>{xs&&xs.removeEventListener("popstate",t)}}}},heatmaps:class{get Pe(){return this.instance.config}constructor(t){var e;this.Xa=!1,this.Ba=!1,this.eo=null,this.instance=t,this.Xa=!(null==(e=this.instance.persistence)||!e.props[Mu]),this.rageclicks=new Yp(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Zr(this.Pe.capture_heatmaps)&&this.Pe.capture_heatmaps.flush_interval_milliseconds&&(t=this.Pe.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Xr(this.Pe.capture_heatmaps)?Xr(this.Pe.enable_heatmaps)?this.Xa:this.Pe.enable_heatmaps:!1!==this.Pe.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ba)return;Cy.info("starting..."),this.io(),this.Ie()}else{var t;clearInterval(null!==(t=this.eo)&&void 0!==t?t:void 0),this.ro(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var r=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Mu]:r}),this.Xa=r,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.O;return this.O=void 0,t}no(t){Ey(t.originalEvent)&&this.ke(t.originalEvent,"deadclick")}Ie(){this.eo&&clearInterval(this.eo),this.eo="visible"===(null==Ts?void 0:Ts.visibilityState)?setInterval(this.pr.bind(this),this.flushIntervalMilliseconds):null}io(){xs&&Ts&&(this.so=this.pr.bind(this),Zs(xs,Rh,this.so),this.ao=t=>this.ke(t||(null==xs?void 0:xs.event)),Zs(Ts,"click",this.ao,{capture:!0}),this.oo=t=>this.lo(t||(null==xs?void 0:xs.event)),Zs(Ts,"mousemove",this.oo,{capture:!0}),this.uo=new yg(this.instance,gg,this.no.bind(this)),this.uo.startIfEnabledOrStop(),this.ho=this.Ie.bind(this),Zs(Ts,Ih,this.ho),this.Ba=!0)}ro(){var t;xs&&Ts&&(this.so&&xs.removeEventListener(Rh,this.so),this.ao&&Ts.removeEventListener("click",this.ao,{capture:!0}),this.oo&&Ts.removeEventListener("mousemove",this.oo,{capture:!0}),this.ho&&Ts.removeEventListener(Ih,this.ho),clearTimeout(this.do),null==(t=this.uo)||t.stop(),this.Ba=!1)}vo(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&fo(i)&&!po(i,"body");){if(i===r)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=i.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:xs)?void 0:s.getComputedStyle(i).position}catch(t){return!1}if(Nr(e,n))return!0;i=Eo(i)}return!1}(So(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}ke(t,e){var i;if(void 0===e&&(e="click"),!vo(t.target)&&Ey(t)){var n=this.vo(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Fo(So(t),this.instance.config.rageclick)&&this.Vt(r({},n,{type:"rageclick"})),this.Vt(n)}}lo(t){!vo(t.target)&&Ey(t)&&(clearTimeout(this.do),this.do=setTimeout((()=>{this.Vt(this.vo(t,"mousemove"))}),500))}Vt(t){if(xs){var e=this.Pe.disable_capture_url_hashes?kn(xs.location.href):xs.location.href,r=this.Pe.custom_personal_data_properties,i=this.Pe.mask_personal_data_properties?[...uc,...r||[]]:[],n=Xs(e,i,dc);this.O=this.O||{},this.O[n]||(this.O[n]=[]),this.O[n].push(t)}}pr(){this.O&&!Gr(this.O)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:yg,webVitalsAutocapture:class{constructor(t){var e;this.Xa=!1,this.Ba=!1,this.O={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.co=()=>{clearTimeout(this.fo),this.fo=void 0,0!==this.O.metrics.length&&(this._instance.capture("$web_vitals",r({$current_url:this.O.url},this.O.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.O={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.po=t=>{var e;if(this.O=this.O||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Xr(null==t?void 0:t.name)||Xr(null==t?void 0:t.value))yy.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,n=this.mo(i);if(!Qr(n)){var s=ti(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+n;if(!this.yo||this.yo>t.value){this.O.navigationKey!==s&&(this.co(),this.fo=setTimeout(this.co,this.flushToCaptureTimeoutMs)),Qr(this.O.navigationKey)&&(this.O.navigationKey=s,this.O.url=n),this.O.firstMetricTimestamp=Qr(this.O.firstMetricTimestamp)?Date.now():this.O.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var o=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=r({},t,i?{navigationURL:n}:{},{$current_url:n,timestamp:Date.now()});Qr(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.O.metrics.push(a),this.O.metrics.length===this.allowedMetrics.length&&this.co()}else yy.error("Ignoring metric with value >= "+this.yo,t)}}},this.bo=()=>{if(!this.Ba){var t,e,r,i,n=Ca.__PosthogExtensions__,s=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,o=(null==s?void 0:s[this._o])||("web-vitals"===this._o&&Qr(s)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(Qr(o)||(t=o.onLCP,e=o.onCLS,r=o.onFCP,i=o.onINP),t&&e&&r&&i){var a={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&t(this.po.bind(this),a),this.allowedMetrics.indexOf("CLS")>-1&&e(this.po.bind(this),a),this.allowedMetrics.indexOf("FCP")>-1&&r(this.po.bind(this),a),this.allowedMetrics.indexOf("INP")>-1&&i(this.po.bind(this),a),this.Ba=!0}else yy.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Xa=!(null==(e=this._instance.persistence)||!e.props[Ou]),this.startIfEnabled()}get wo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=Zr(this.wo)?null==(t=this.wo)?void 0:t.web_vitals_allowed_metrics:void 0;return Xr(r)?(null==(e=this._instance.persistence)?void 0:e.props[Fu])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Zr(this.wo)?this.wo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Zr(this.wo)?this.wo.web_vitals_attribution:void 0;return null!=t&&t}get useSoftNavs(){var t=Zr(this.wo)?this.wo.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get yo(){var t=Zr(this.wo)&&ti(this.wo.__web_vitals_max_value)?this.wo.__web_vitals_max_value:by;return t>0&&6e4>=t?by:t}get isEnabled(){var t=null==Cs?void 0:Cs.protocol;if("http:"!==t&&"https:"!==t)return yy.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Zr(this.wo)?this.wo.web_vitals:ri(this.wo)?this.wo:void 0;return ri(e)?e:this.Xa}startIfEnabled(){this.isEnabled&&!this.Ba&&(yy.info("enabled, starting..."),this.ai(this.bo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var r=Zr(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=Zr(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ou]:r}),this._instance.persistence.register({[Fu]:i})),this.Xa=r,this.startIfEnabled()}}}get _o(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}ai(t){var e=Ca.__PosthogExtensions__,r=this._o,i=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=i&&i[r]||"web-vitals"===r&&Qr(i)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,r,(e=>{e?yy.error("failed to load script",e):t()}))}mo(t){var e=t||(null==xs?void 0:xs.location.href);if(e){var r=this._instance.config.disable_capture_url_hashes?kn(e):e,i=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...uc,...i||[]]:[];return Xs(r,n,dc)}yy.error("Could not determine current URL")}}},sb={exceptionObserver:class{constructor(t){var e;this.bo=()=>{var t;if(xs&&this.isEnabled&&null!=(t=Ca.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=Ca.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Ca.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Ca.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.xo&&this.Pe.capture_unhandled_errors&&(this.xo=e(this.captureException.bind(this))),!this.ko&&this.Pe.capture_unhandled_rejections&&(this.ko=r(this.captureException.bind(this))),!this.So&&this.Pe.capture_console_errors&&(this.So=i(this.captureException.bind(this)))}catch(t){gy.error("failed to start",t),this.Co()}}},this._instance=t,this.Mo=!(null==(e=this._instance.persistence)||!e.props[Iu]),this.To=new fi(r({},function(t){var e,r,i,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(r=t.exceptionRateLimiterRefillRate)&&void 0!==r?r:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(i=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,rt:gy})),this.Pe=this.Eo(),this.startIfEnabledOrStop()}Eo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Zr(t)?e=r({},e,t):(Qr(t)?this.Mo:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Pe.capture_console_errors||this.Pe.capture_unhandled_errors||this.Pe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(gy.info("enabled"),this.Co(),this.ai(this.bo)):this.Co()}ai(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return gy.error("failed to load script",e);t()}))}Co(){var t,e,r;null==(t=this.xo)||t.call(this),this.xo=void 0,null==(e=this.ko)||e.call(this),this.ko=void 0,null==(r=this.So)||r.call(this),this.So=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Mo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Iu]:this.Mo}),this.Pe=this.Eo(),this.startIfEnabledOrStop())}}onConfigChange(){this.Pe=this.Eo()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.To.consumeRateLimit(n)?gy.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.Io=[],this.Po=Vc(),this._instance=t,this.Io=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(Ru))&&void 0!==e?e:[],this.Ro=bs(this.Lo()),this.Oo=new _s(this.Ro)}onConfigChange(){this.Ro=bs(this.Lo()),this.Oo.setConfig(this.Ro)}onRemoteConfig(t){var e,r,i;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(r=n.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],o=null==(i=n.errorTracking)?void 0:i.captureExtensionExceptions;this.Io=s,this._instance.persistence&&this._instance.persistence.register({[Ru]:this.Io,[Pu]:o})}}}get Fo(){var t,e=!!this._instance.get_property(Pu),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.Po.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Ro.enabled)try{if(!Kr(t)||0===t.trim().length)return void Wc.warn("Ignoring exception step because message must be a non-empty string");var i=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>ms.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(this.Ao(e)),n=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&Wc.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Oo.add(r({[ps]:t,[gs]:(new Date).toISOString()},n))}catch(t){Wc.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Do(e)){if(this.$o(e))return this.No("Exception dropped: matched a suppression rule"),void Wc.info("Skipping exception capture because a suppression rule matched");if(!this.Fo&&this.qo(e))return this.No("Exception dropped: thrown by a browser extension"),void Wc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.jo(e))return this.No("Exception dropped: thrown by the PostHog SDK"),void Wc.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.Ro.enabled&&Xr(t.$exception_steps)?this.Bo(t):t,i="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;i&&(r.$release_id=i);try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",jn:!0});return n&&this.Oo.clear(),n}catch(t){return Wc.error("Failed to capture exception event. Dropping this exception.",t),void this.Oo.clear()}}catch(t){return void Wc.error("Failed to process exception event. Ignoring this exception.",t)}var s}Bo(t){try{var e=this.Oo.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return Wc.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}No(t){this.Ro.enabled&&this.Oo.add({[ps]:t,[gs]:(new Date).toISOString()})}Ao(t){return Zr(t)?r({},t):{}}Lo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}$o(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var r=e.type,i=e.value;return Kr(r)&&r.length>0&&t.$exception_types.push(r),Kr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.Io.some((t=>{var r=t.values.map((t=>{var r=zh[t.operator],i=e[t.key];if(!r||!i)return!1;var n=Wr(t.value)?t.value:[t.value];return n.length>0&&r(n,i)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}catch(t){return Wc.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}qo(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}jo(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}Do(t){return!Xr(t)&&Wr(t)}}},ob=r({productTours:class{get Tr(){return this._instance.persistence}constructor(t){this.Ho=null,this.Uo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var r,i;if(this.Tr&&this.Tr.register({[Au]:!!e.productTours}),!Iy(this._instance))return!this.Ho&&Xr(null==(r=this.Tr)?void 0:r.props[oh])||My.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.Ho)||i.stop(),this.Ho=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Ho&&Iy(this._instance)&&this.ai((()=>this.zo()))}ai(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?My.error("Could not load product tours script",e):t()}))}zo(){var t;!this.Ho&&null!=(t=Ca.__PosthogExtensions__)&&t.generateProductTours&&(this.Ho=Ca.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Wr(this.Uo)||e){var r=this.Tr;if(r){var i=r.props[oh];if(Wr(i)&&!e)return this.Uo=i,void t(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:e=>{if(Iy(this._instance)){var i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return 0===i?e.error||My.warn(n):My.error(n),void t([],{isLoaded:!1,error:n})}var s=Wr(e.json.product_tours)?e.json.product_tours:[];this.Uo=s,r&&r.register({[oh]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Uo,{isLoaded:!0})}getActiveProductTours(t){Xr(this.Ho)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ho.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Ho)||e.showTourById(t)}previewTour(t){this.Ho?this.Ho.previewTour(t):this.ai((()=>{var e;this.zo(),null==(e=this.Ho)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Ho)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Ho)||t.nextStep()}previousStep(){var t;null==(t=this.Ho)||t.previousStep()}clearCache(){var t;this.Uo=null,null==(t=this.Tr)||t.unregister(oh)}resetTour(t){var e;null==(e=this.Ho)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Ho)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Ho)||e.cancelPendingTour(t)}}},rb),ab={siteApps:class{constructor(t){this.Wo=0,this._instance=t,this.Vo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Zo(t,e){if(e){var r=this.globalsForEvent(e);this.Vo.push(r),this.Vo.length>1e3&&(this.Vo=this.Vo.slice(10))}}get siteAppLoaders(){var t;return null==(t=Ca._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Zo.bind(this));this.Go=()=>{t(),this.Vo=[],this.Go=void 0}}}globalsForEvent(t){var e,n,s,o,a,l,u;if(!t)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var v of Object.entries(c)){var f=v[0];h[f]={id:d[f],type:f,properties:v[1]}}var p=t.$set_once,g=t.$set;return{event:r({},i(t,Ry),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}Qo(t){var e,r=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Py.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Py.error("prepare_external_dependency_script returned null"),null):t}Jo(){var t,e,r,i,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==Ts?void 0:Ts.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Wo++,this.Ko)return this.Yo();var h=[],d=this,c=new WeakSet,v=(t,e,r)=>{if(null!=t&&t[e]){var i=t[e];t[e]=r(i),h.push((()=>{t[e]=i}))}},f=t=>{if(c.has(t))return t;var e=d.Qo(t);return e&&c.add(e),e},p=t=>t.map((t=>"string"==typeof t?t:f(t))).filter((t=>!Yr(t)));return v(u,"appendChild",(t=>function(e){var r=f(e);return r?t.call(this,r):e})),v(u,"insertBefore",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):e})),v(u,"replaceChild",(t=>function(e,r){var i=f(e);return i?t.call(this,i,r):r})),[null==(e=l.Element)?void 0:e.prototype,null==(r=l.Document)?void 0:r.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach((t=>{v(t,"append",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"prepend",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach((t=>{v(t,"before",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"after",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,p(r))})),v(t,"replaceWith",(t=>function(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];var n=p(r);return r.length&&!n.length?void 0:t.apply(this,n)}))})),v(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",(t=>function(e,r){var i=f(r);return i?t.call(this,e,i):null})),this.Ko=()=>{h.forEach((t=>t())),this.Ko=void 0},this.Yo()}Yo(){var t=!1;return()=>{var e;t||(t=!0,this.Wo--,0===this.Wo&&(null==(e=this.Ko)||e.call(this)))}}Xo(t,e){void 0===e&&(e=!0);var r=this.Jo();try{var i=t(r);return e&&r(),i}catch(t){throw r(),t}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;!e.errored&&this.Vo.length&&(Py.info("Processing "+this.Vo.length+" events for site app with id "+t.id),this.Vo.forEach((t=>this.Xo((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(r=this.Go)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Py.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var s=this.Xo((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),i=!0}catch(e){Py.error(Oy+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Py.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}tl(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}el(t){var e=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(t),i=function(i){try{e.Xo((()=>null==i.processEvent?void 0:i.processEvent(r)))}catch(e){Py.error("Error while processing event "+t.event+" for site app "+i.id,e)}};for(var n of Object.values(this.apps))i(n)}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.tl(),void this._instance.on("eventCaptured",(t=>this.el(t)))):void Py.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Go)||r.call(this),t.ok){var s=t.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled){var o=function(){var t,e=a.id,r=a.url;Ca["__$$ph_site_app_"+e]=n._instance,null==(t=Ca.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,r,(t=>{if(t)return Py.error(Oy+e,t)}))};for(var a of s.siteApps)o()}else Py.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},lb={tracingHeaders:class{constructor(t){this.il=void 0,this.rl=void 0,this.nl=void 0,this.bo=()=>{var t,e,r=this.sl();r?(Qr(this.il)&&(this.il=null==(t=Ca.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Qr(this.rl)&&(this.rl=null==(e=Ca.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Co()},this._instance=t}initialize(){this.startIfEnabledOrStop()}ai(t){var e,r;null!=(e=Ca.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(r=Ca.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return my.error("failed to load script",e);t()}))}al(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}sl(){var t=this.al();return Wr(t)?(Wr(this.nl)?this.nl.splice(0,this.nl.length,...t):this.nl=[...t],t.length>0?this.nl:void 0):(Wr(this.nl)&&this.nl.splice(0),this.nl=t||void 0,this.nl)}Co(){var t,e;null==(t=this.il)||t.call(this),null==(e=this.rl)||e.call(this),this.il=void 0,this.rl=void 0}startIfEnabledOrStop(){this.sl()?this.ai(this.bo):this.Co()}}},ub=r({surveys:class{get Pe(){return this._instance.config}constructor(t){this.ol=void 0,this._surveyManager=null,this.ll=!1,this.ul=[],this.hl=null,this.dl=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Pe.disable_surveys){if(!t.ok)return cu.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Xr(e))return cu.warn("Flags not loaded yet. Not loading surveys.");var r=Wr(e);this.ol=r?e.length>0:e,cu.info("flags response received, isSurveysEnabled: "+this.ol),this.loadIfEnabled()}}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith(pu)||null!=i&&i.startsWith(gu))&&e.push(i)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this._surveyManager)if(this.ll)cu.info("Already initializing surveys, skipping...");else if(this.Pe.disable_surveys)cu.info(Ny);else if(this.Pe.cookieless_mode&&this._instance.consent.isOptedOut())cu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==Ca?void 0:Ca.__PosthogExtensions__;if(t){if(!Qr(this.ol)||this.Pe.advanced_enable_surveys){var e=this.ol||this.Pe.advanced_enable_surveys;this.ll=!0;try{var r=t.generateSurveys;if(r)return void this.vl(r,e);var i=t.loadExternalDependency;if(!i)return void this.cl(kh);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.cl("Could not load surveys script",r):this.vl(t.generateSurveys,e)}))}catch(t){throw this.cl("Error initializing surveys",t),t}finally{this.ll=!1}}}else cu.error("PostHog Extensions not found.")}}vl(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new $y(this._instance),cu.info("Surveys loaded successfully"),this.fl({isLoaded:!0})}cl(t,e){cu.error(t,e),this.fl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ul.push(t),this._surveyManager&&this.fl({isLoaded:!0}),()=>{this.ul=this.ul.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Pe.disable_surveys)return cu.info(Ny),t([]);var r,i=this._instance.get_property(eh);if(i&&!e)return t(i,{isLoaded:!0}),void(this.pl()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.hl?this.hl.then((e=>t(e.surveys,e.context))):("undefined"!=typeof Promise&&(this.hl=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Pe.token),method:"GET",timestampMode:"query",timeout:this.Pe.surveys_request_timeout_ms,callback:e=>{var i;this.hl=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;0!==n?cu.error(s):e.error||cu.warn(s),this.dl=Date.now();var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}this.dl=null;var a,l=e.json.surveys||[],u=l.filter((t=>vu(t)&&(hu(t)||fu(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[eh]:l,[rh]:Date.now()});var h={isLoaded:!0};t(l,h),null==r||r({surveys:l,context:h})}}))}pl(){return this.gl()&&!this.hl&&!this.ml()}gl(){var t=this._instance.get_property(rh);return ti(t)&&Date.now()-t>3e5}ml(){return ti(this.dl)&&3e5>Date.now()-this.dl}markSurveyAsSeen(t,e){var r,i={id:t,current_iteration:null!==(r=null==e?void 0:e.iteration)&&void 0!==r?r:null};bu(i);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}fl(t){for(var e of this.ul)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){cu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Xr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);cu.warn("init was not called")}yl(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}bl(t){if(Xr(this._surveyManager))return{eligible:!1,reason:Dy};var e="string"==typeof t?this.yl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}_l(t){if(Xr(this._surveyManager))return{eligible:!1,reason:Dy};var e="string"==typeof t?this.yl(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Xr(this._surveyManager))return cu.warn("init was not called"),{visible:!1,disabledReason:Dy};var e=this._l(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Xr(this._surveyManager)?(cu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Dy})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this._l(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(Xr(this._surveyManager))cu.warn("init was not called");else{var n="string"==typeof t?this.yl(t):t;if(null!=n&&n.id)if(_u.includes(n.type)){var s=null==Ts?void 0:Ts.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(cu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;cu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),cu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);cu.warn("Survey element not found")}else cu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else cu.warn("Survey not found")}}displaySurvey(t,e){var i;if(Xr(this._surveyManager))cu.warn("init was not called");else{var n=this.yl(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==eu.Popover&&e.initialResponses&&cu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.bl(n);if(!o.eligible)return void cu.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==eu.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else cu.warn("Survey not found")}}cancelPendingSurvey(t){Xr(this._surveyManager)?cu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}},rb),hb={toolbar:class{constructor(t){this.instance=t}wl(t){Ca.ph_toolbar_state=t}xl(){var t;return null!==(t=Ca.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),Gs(this.instance.config))return!1;if(!xs||!Ts)return!1;t=null!=t?t:xs.location,r=null!=r?r:xs.history;try{if(!e){try{xs.localStorage.setItem("test","test"),xs.localStorage.removeItem("test")}catch(t){return!1}e=null==xs?void 0:xs.localStorage}var i,n=qy||to(t.hash,"__posthog")||to(t.hash,"state"),s=n?Us((()=>JSON.parse(atob(decodeURIComponent(n)))))||Us((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(jy)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}kl(t){var e=Ca.ph_load_toolbar||Ca.ph_load_editor;!Xr(e)&&Vr(e)?e(t,this.instance):By.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Ts||!Ts.getElementById(lo));if(!xs||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(xs.localStorage.setItem(jy,JSON.stringify(r({},n,{source:void 0}))),2===this.xl())this.kl(n);else if(0===this.xl()){var s;this.wl(1),null==(s=Ca.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return By.error("[Toolbar] Failed to load",t),void this.wl(0);this.wl(2),this.kl(n)})),Zs(xs,"turbolinks:load",(()=>{this.wl(0),this.loadToolbar(n)}))}return!0}Sl(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},db=r({experiments:Qy},rb),cb={conversations:class{constructor(t){this.Cl=void 0,this._conversationsManager=null,this.Ml=!1,this.Tl=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Xr(e)||(ri(e)?this.Cl=e:(this.Cl=e.enabled,this.Tl=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Cl=void 0,this.Tl=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ml||this._instance.config.disable_conversations||Gs(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Ca?void 0:Ca.__PosthogExtensions__;if(t&&!Qr(this.Cl)&&this.Cl)if(this.Tl&&this.Tl.token){this.Ml=!0;try{var e=t.initConversations;if(e)return this.El(e),void(this.Ml=!1);var r=t.loadExternalDependency;if(!r)return void this.Il(kh);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.Il("Could not load conversations script",e):this.El(t.initConversations),this.Ml=!1}))}catch(t){this.Il("Error initializing conversations",t),this.Ml=!1}}else Ky.error("Conversations enabled but missing token in remote config.")}}El(t){if(this.Tl)try{this._conversationsManager=t(this.Tl,this._instance),Ky.info("Conversations loaded successfully")}catch(t){this.Il("Error completing conversations initialization",t)}else Ky.error("Cannot complete initialization: remote config is null")}Il(t,e){Ky.error(t,e),this._conversationsManager=null,this.Ml=!1}show(){this._conversationsManager?this._conversationsManager.show():Ky.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Cl&&!Yr(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(Ky.warn(Jy),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Ky.warn(Jy),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Ky.warn(Jy),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Ky.warn(Jy),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(Ky.warn(Jy),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(Ky.warn(Jy),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ky.warn(Jy),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}Gn(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Qn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},vb={logs:class{constructor(t){var e,i=this;this.Pl=!1,this.Rl=!1,this.rt=Ds("[logs]"),this.Ll=r({},this.rt,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(eb)||i.rt.error(...e)}}),this.er=[],this.Ol=[],this.fa=0,this.Fl=()=>{var t,e;this.fa=0,null==(t=this.Al)||t.onReconnect(),null==(e=this.Dl)||e.onReconnect()},this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Pl=!0),xs&&Zs(xs,"online",this.Fl)}$l(t,e,r,i){var n,s=function(t,e){var r,i,n,s,o,a,l,u=null!==(r=null==t?void 0:t.flushIntervalMs)&&void 0!==r?r:3e3,h=null!==(i=null==t?void 0:t.maxBufferSize)&&void 0!==i?i:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,c=Qr(d)?Math.max(h,2048):Math.max(h,d),v=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(o=null==v?void 0:v["service.name"])&&void 0!==o?o:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(a=null==v?void 0:v["service.version"])&&void 0!==a?a:null==t?void 0:t.serviceVersion,environment:null!==(l=null==v?void 0:v["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:v,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:c,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,r);return[new Fn(this.Nl(t,e),s,this.Ll,(()=>this.ql()),(t=>t()),void 0,i),s]}jl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Al||this.Bl!==e){var r;null==(r=this.Al)||r.reset(),this.Bl=e;var i=this.$l((()=>this.er),(t=>{this.er=t}));this.Al=i[0],this.Hl=i[1]}return this.Al}Ul(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Dl||this.zl!==e){var r;null==(r=this.Dl)||r.reset(),this.zl=e;var i=this.$l((()=>this.Ol),(t=>{this.Ol=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Yy);this.Dl=i[0],this.Wl=i[1]}return this.Dl}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var r=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!Xr(r)&&r&&(this.Pl=!0,this.loadIfEnabled())}}reset(){var t,e;this.er=[],null==(t=this.Al)||t.reset(),this.Ol=[],null==(e=this.Dl)||e.reset(),this.fa=0}captureLog(t){this.jl().captureLog(t)}he(t){this.Ul().captureLog(t)}get logger(){return this.Vl||(this.Vl={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.Vl}flushLogs(t){t?this.Zl(t):(this.Al&&this.Al.flush().catch((t=>this.Gl(t))),this.Dl&&this.Dl.flush().catch((t=>this.Gl(t))))}Gl(t){eb(t)||this.rt.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Pl&&!this.Rl){var t=null==Ca?void 0:Ca.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var r;e||null==(r=t.logs)||!r.initializeLogs?this.rt.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.Rl=!0)})):this.rt.error(kh)}else this.rt.error("PostHog Extensions not found.")}}Nl(t,e){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:e=>e===kr.LogsQueue?t():void 0,setPersistedProperty(t,r){var i;t===kr.LogsQueue&&e(null!==(i=r)&&void 0!==i?i:[])},At:t=>this.At(t),getLibraryId:()=>As.LIB_NAME,getLibraryVersion:()=>As.LIB_VERSION}}At(t){return new Promise((e=>{if(eo(this.fa,3))e({kind:"fatal",error:tb(void 0,"logs endpoint is unreachable, dropping batch")});else{var r=!1,i=t=>{r||(r=!0,clearTimeout(n),e(t))},n=setTimeout((()=>{this.rt.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:tb(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Ql(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Jl(e),e>=200&&300>e)i({kind:"ok"});else if(413===e)i({kind:"too-large"});else if(0!==e&&429!==e&&500>e)i({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var r;0===e?(t.error||this.rt.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:tb(t.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("logs request failed with status "+e)})}}})}}))}Jl(t){(0!==t||this._instance.__loaded)&&(this.fa=ro(t,this.fa,3,(()=>this.rt.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Zl(t){this.er.length>0&&this.Kl(t,this.er,this.Hl,As.LIB_NAME,(t=>{this.er=t})),this.Ol.length>0&&this.Kl(t,this.Ol,this.Wl,Yy,(t=>{this.Ol=t}))}Kl(t,e,r,i,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var o=An(s,Ln(r,As.LIB_NAME,As.LIB_VERSION),i,As.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Ql(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Ql(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ql(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.windowId,n=r.sessionStartTimestamp,s=r.lastActivityTimestamp;e.sessionId=r.sessionId,e.windowId=i,Xr(n)||(e.sessionStartTimestamp=n),Xr(s)||(e.lastActivityTimestamp=s)}if(null!=Ca&&null!=(t=Ca.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?kn(Ca.location.href):Ca.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},fb={metrics:class{constructor(t){this.rt=Ds("[metrics]"),this._instance=t}initialize(){}jl(){var t,e,r=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Al&&this.Bl===r||(null==(e=this.Al)||e.reset(),this.Bl=r,this.Al=new qn(this.Nl(),function(t){var e,r,i,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(r=null==o?void 0:o["service.version"])&&void 0!==r?r:null==t?void 0:t.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==t?void 0:t.environment,resourceAttributes:o,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(r),this.rt)),this.Al}count(t,e,r){void 0===e&&(e=1),this.jl().count(t,e,r)}gauge(t,e,r){this.jl().gauge(t,e,r)}histogram(t,e,r){this.jl().histogram(t,e,r)}flush(t){if(!this.Al)return Promise.resolve();if(t){var e=this.Al.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.Al.flush().catch((t=>this.rt.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Al)||t.reset()}Nl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:t=>e.Kt(t),getLibraryId:()=>As.LIB_NAME,getLibraryVersion:()=>As.LIB_VERSION}}Kt(t,e){return new Promise((i=>{var n=!1,s=t=>{n||(n=!0,clearTimeout(o),i(t))},o=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(r({method:"POST",url:this.Yl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)s({kind:"ok"});else if(413===e)s({kind:"too-large"});else if(0!==e&&429!==e&&500>e)s({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var r;s({kind:"retry-later",error:null!==(r=t.error)&&void 0!==r?r:new Error("metrics request failed with status "+e)})}}}))}))}Yl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},pb=r({},rb,ib,nb,sb,ob,ab,ub,lb,hb,db,cb,vb,fb);py.__defaultExtensionClasses=r({},pb);var gb=function(){As.SDK_DIST_CHANNEL="npm";var t=ey[uy]=new py;return function(){function t(){t.done||(t.done=!0,hy=!1,qs(ey,(function(t){t._dom_loaded()})))}null!=Ts&&Ts.addEventListener?"complete"===Ts.readyState?t():Zs(Ts,"DOMContentLoaded",t,{capture:!1}):xs&&$s.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{zl as Compression,Og as DEFAULT_PRODUCT_TOUR_APPEARANCE,eu as DisplaySurveyType,py as PostHog,Lg as ProductTourEventName,Ag as ProductTourEventProperties,Xl as SurveyEventName,tu as SurveyEventProperties,Wl as SurveyEventType,Zl as SurveyPosition,Jl as SurveyQuestionBranchingType,Kl as SurveyQuestionType,Yl as SurveySchedule,Gl as SurveyTabPosition,Ql as SurveyType,Vl as SurveyWidgetType,gb as default,gb as posthog,qg as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.full.js.map
|