posthog-js 1.347.2 → 1.348.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/array.full.es5.js +1 -1
  2. package/dist/array.full.js +1 -1
  3. package/dist/array.full.no-external.js +1 -1
  4. package/dist/array.js +1 -1
  5. package/dist/array.no-external.js +1 -1
  6. package/dist/conversations.js +1 -1
  7. package/dist/conversations.js.map +1 -1
  8. package/dist/customizations.full.js +1 -1
  9. package/dist/lazy-recorder.js +1 -1
  10. package/dist/main.js +1 -1
  11. package/dist/main.js.map +1 -1
  12. package/dist/module.d.ts +43 -1
  13. package/dist/module.full.d.ts +43 -1
  14. package/dist/module.full.js +1 -1
  15. package/dist/module.full.js.map +1 -1
  16. package/dist/module.full.no-external.d.ts +43 -1
  17. package/dist/module.full.no-external.js +1 -1
  18. package/dist/module.full.no-external.js.map +1 -1
  19. package/dist/module.js +1 -1
  20. package/dist/module.js.map +1 -1
  21. package/dist/module.no-external.d.ts +43 -1
  22. package/dist/module.no-external.js +1 -1
  23. package/dist/module.no-external.js.map +1 -1
  24. package/dist/posthog-recorder.js +1 -1
  25. package/dist/product-tours-preview.d.ts +2 -0
  26. package/dist/product-tours-preview.js +1 -1
  27. package/dist/product-tours-preview.js.map +1 -1
  28. package/dist/product-tours.js +1 -1
  29. package/dist/product-tours.js.map +1 -1
  30. package/dist/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
  31. package/dist/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
  32. package/dist/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
  33. package/dist/src/extensions/conversations/external/components/styles.d.ts +184 -0
  34. package/dist/src/extensions/conversations/external/components/utils.d.ts +8 -0
  35. package/dist/src/extensions/conversations/external/index.d.ts +39 -1
  36. package/dist/src/extensions/product-tours/product-tours.d.ts +2 -0
  37. package/dist/src/posthog-product-tours-types.d.ts +42 -0
  38. package/dist/surveys-preview.d.ts +2 -0
  39. package/lib/package.json +1 -1
  40. package/lib/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
  41. package/lib/src/extensions/conversations/external/components/ConversationsWidget.js +96 -28
  42. package/lib/src/extensions/conversations/external/components/ConversationsWidget.js.map +1 -1
  43. package/lib/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
  44. package/lib/src/extensions/conversations/external/components/TicketListItem.js +47 -0
  45. package/lib/src/extensions/conversations/external/components/TicketListItem.js.map +1 -0
  46. package/lib/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
  47. package/lib/src/extensions/conversations/external/components/TicketListView.js +75 -0
  48. package/lib/src/extensions/conversations/external/components/TicketListView.js.map +1 -0
  49. package/lib/src/extensions/conversations/external/components/styles.d.ts +184 -0
  50. package/lib/src/extensions/conversations/external/components/styles.js +189 -0
  51. package/lib/src/extensions/conversations/external/components/styles.js.map +1 -1
  52. package/lib/src/extensions/conversations/external/components/utils.d.ts +8 -0
  53. package/lib/src/extensions/conversations/external/components/utils.js +49 -0
  54. package/lib/src/extensions/conversations/external/components/utils.js.map +1 -0
  55. package/lib/src/extensions/conversations/external/index.d.ts +39 -1
  56. package/lib/src/extensions/conversations/external/index.js +253 -31
  57. package/lib/src/extensions/conversations/external/index.js.map +1 -1
  58. package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js +1 -1
  59. package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js.map +1 -1
  60. package/lib/src/extensions/product-tours/product-tours.d.ts +2 -0
  61. package/lib/src/extensions/product-tours/product-tours.js +78 -71
  62. package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
  63. package/lib/src/posthog-product-tours-types.d.ts +42 -0
  64. package/lib/src/posthog-product-tours-types.js +43 -1
  65. package/lib/src/posthog-product-tours-types.js.map +1 -1
  66. package/lib/src/utils/product-tour-event-receiver.js +2 -1
  67. package/lib/src/utils/product-tour-event-receiver.js.map +1 -1
  68. package/lib/tsconfig.tsbuildinfo +1 -1
  69. package/package.json +3 -3
  70. package/react/dist/esm/index.js +25 -1
  71. package/react/dist/esm/index.js.map +1 -1
  72. package/react/dist/types/index.d.ts +4 -2
  73. package/react/dist/umd/index.js +25 -0
  74. package/react/dist/umd/index.js.map +1 -1
@@ -1,2 +1,2 @@
1
- function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),c=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(c||{}),d={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},h={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var p={};function v(e){if(p[e])return p[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in d?d[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in h?h[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return p[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?p[e]=u:t.prototype}catch(e){return t.prototype}}var g={};function f(e,t,r){var i,n=e+"."+String(r);if(g[n])return g[n].call(t);var s=v(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(g[n]=o,o.call(t)):t[r]}var _={};function m(e,t,r){var i=e+"."+String(r);if(_[i])return _[i].bind(t);var n=v(e)[r];return"function"!=typeof n?t[r]:(_[i]=n,n.bind(t))}var y={childNodes:function(e){return f("Node",e,"childNodes")},parentNode:function(e){return f("Node",e,"parentNode")},parentElement:function(e){return f("Node",e,"parentElement")},textContent:function(e){return f("Node",e,"textContent")},contains:function(e,t){return m("Node",e,"contains")(t)},getRootNode:function(e){return m("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?f("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?f("Element",e,"shadowRoot"):null},querySelector:function(e,t){return f("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return f("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return v("MutationObserver").constructor}};function b(e){return e.nodeType===e.ELEMENT_NODE}function w(e){var t=e&&"host"in e&&"mode"in e&&y.host(e)||null;return Boolean(t&&"shadowRoot"in t&&y.shadowRoot(t)===e)}function S(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>I(t,e.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(e){return null}var i}function I(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=C(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?F(r,e.styleSheet.href):r}var i,n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),t?F(n,t):n}function k(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let E=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function x(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=e,a=s||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function T(e){return e.toLowerCase()}var M="__rrweb_original__";function R(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function A(e,t){var r,i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){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}var P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,L=/^(?:[a-z+]+:)?\/\//i,N=/^www\..*/i,O=/^(data:)([^,]*),(.*)/i;function F(e,t){return(e||"").replace(P,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(L.test(l)||N.test(l))return"url("+u+l+u+")";if(O.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var c=t.split("/"),d=l.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+u+c.join("/")+u+")"}))}var D,H,B=1,q=new RegExp("[^a-z0-9-_:]"),U=-2;function V(){return B++}var j=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;var z=new WeakMap;function Z(e,t){return t&&""!==t.trim()?Y(e,t):t}function G(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Y(e,t){var r=z.get(e);if(r||(r=e.createElement("a"),z.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Z(e,i):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(W),!(r>=t.length);){var s=i(j);if(","===s.slice(-1))s=Z(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Z(e,s);for(var a=!1;;){var l=t.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(", ")}(e,i):"style"===r?F(i,Y(e)):"object"===t&&"data"===r?Z(e,i):i:Z(e,i):i}function K(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&J(y.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&J(y.parentNode(e),t,r)}function Q(e,t,r,i){var n;if(b(e)){if(n=e,!y.childNodes(n).length)return!1}else{if(null===y.parentElement(e))return!1;n=y.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(J(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function ee(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f=!1}=t,_=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:c.Document,childNodes:[],compatMode:e.compatMode}:{type:c.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:c.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,f=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),_=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return q.test(t)?"div":t}(e),m={},b=e.attributes.length,w=0;w<b;w++){var S=e.attributes[w];K(_,S.name,S.value)||(m[S.name]=X(i,_,T(S.name),S.value))}if("link"===_&&o){var I=function(e){return null==e?void 0:e.href}(e);if(I){var E=k(i,I);if(!E&&I.includes(".css"))E=k(i,window.location.origin+"/"+I.replace(window.location.href,""));var A=null;E&&(A=C(E)),A&&(delete m.rel,delete m.href,m._cssText=A)}}if("style"===_&&e.sheet&&!(e.innerText||y.textContent(e)||"").trim().length){var P=C(e.sheet);P&&(m._cssText=P)}if("input"===_||"textarea"===_||"select"===_){var L=e.value,N=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&L?m.value=x({element:e,type:R(e),tagName:_,value:L,maskInputOptions:a,maskInputFn:l}):N&&(m.checked=N)}"option"===_&&(e.selected&&!a.select?m.selected=!0:delete m.selected);if("dialog"===_&&e.open)try{m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){m.rr_open_mode="modal",m.ph_rr_could_not_detect_modal=!0}if("canvas"===_&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var i=0;i<e.height;i+=50){var n=t.getImageData,s=M in n?n[M]:n;if(new Uint32Array(s.call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var O=e.toDataURL(u.type,u.quality),F=i.createElement("canvas");F.width=e.width,F.height=e.height,O!==F.toDataURL(u.type,u.quality)&&(m.rr_dataURL=O)}if("img"===_&&d){D||(D=i.createElement("canvas"),H=D.getContext("2d"));var B=e,U=B.currentSrc||B.getAttribute("src")||"<unknown-src>",V=B.crossOrigin,j=()=>{B.removeEventListener("load",j);try{D.width=B.naturalWidth,D.height=B.naturalHeight,H.drawImage(B,0,0),m.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?j():B.addEventListener("load",j));console.warn("Cannot inline img src="+U+"! Error: "+e)}"anonymous"===B.crossOrigin&&(V?m.crossOrigin=V:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?j():B.addEventListener("load",j)}if("audio"===_||"video"===_){var W=m;W.rr_mediaState=e.paused?"paused":"played",W.rr_mediaCurrentTime=e.currentTime,W.rr_mediaPlaybackRate=e.playbackRate,W.rr_mediaMuted=e.muted,W.rr_mediaLoop=e.loop,W.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(f){var{width:z,height:Z}=e.getBoundingClientRect();m={class:m.class,rr_width:z+"px",rr_height:Z+"px"}}"iframe"!==_||p(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);try{customElements.get(_)&&(r=!0)}catch(e){}return{type:c.Element,tagName:_,attributes:m,childNodes:[],isSVG:G(e)||void 0,needBlock:f,rootId:g,isCustom:r}}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f,rootId:_});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:s}=t,o=y.parentNode(e),a=o&&o.tagName,l=y.textContent(e),u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(l=C(o.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=F(l,Y(t.doc))}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&i&&(l=n?n(l,y.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:c.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:_});case e.CDATA_SECTION_NODE:return{type:c.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:c.Comment,textContent:y.textContent(e)||"",rootId:_};default:return!1}}function te(e){return null==e?"":e.toLowerCase()}function re(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:f=!1,recordCanvas:_=!1,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=Q(e,o,a,void 0===M));var P,L=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:_,keepIframeSrcFn:x,newlyAddedElement:T});if(!L)return console.warn(e,"not serialized"),null;P=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===c.Comment)return!0;if(e.type===c.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===A(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(te(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===te(e.attributes.name)||"icon"===te(e.attributes.rel)||"apple-touch-icon"===te(e.attributes.rel)||"shortcut icon"===te(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&te(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(te(e.attributes.property).match(/^(og|twitter|fb):/)||te(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===te(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===te(e.attributes.name)||"googlebot"===te(e.attributes.name)||"bingbot"===te(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===te(e.attributes.name)||"generator"===te(e.attributes.name)||"framework"===te(e.attributes.name)||"publisher"===te(e.attributes.name)||"progid"===te(e.attributes.name)||te(e.attributes.property).match(/^article:/)||te(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===te(e.attributes.name)||"yandex-verification"===te(e.attributes.name)||"csrf-token"===te(e.attributes.name)||"p:domain_verify"===te(e.attributes.name)||"verify-v1"===te(e.attributes.name)||"verification"===te(e.attributes.name)||"shopify-checkout-api-token"===te(e.attributes.name)))return!0}}return!1}(L,v)&&(R||L.type!==c.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?V():U;var N=Object.assign(L,{id:P});if(i.add(e,N),P===U)return null;m&&m(e);var O=!l;if(N.type===c.Element){O=O&&!N.needBlock,delete N.needBlock;var F=y.shadowRoot(e);F&&S(F)&&(N.isShadowHost=!0)}if((N.type===c.Document||N.type===c.Element)&&O){v.headWhitespace&&N.type===c.Element&&"head"===N.tagName&&(R=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:_,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x};if(N.type===c.Element&&"textarea"===N.tagName&&void 0!==N.attributes.value);else for(var H of Array.from(y.childNodes(e))){var B=re(H,D);B&&N.childNodes.push(B)}var q=null;if(b(e)&&(q=y.shadowRoot(e)))for(var j of Array.from(y.childNodes(q))){var W=re(j,D);W&&(S(q)&&(W.isShadow=!0),N.childNodes.push(W))}}var z=y.parentNode(e);return z&&w(z)&&S(z)&&(N.isShadow=!0),N.type===c.Element&&"iframe"===N.tagName&&function(e,t,r){var i=e.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(e){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{s||(t(),s=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),s=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&C){var r=re(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:_,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});r&&C(e,r)}}),I),N.type===c.Element&&"link"===N.tagName&&"string"==typeof N.attributes.rel&&("stylesheet"===N.attributes.rel||"preload"===N.attributes.rel&&"string"==typeof N.attributes.href&&"css"===A(N.attributes.href))&&function(e,t,r){var i,n=!1;try{i=e.sheet}catch(e){return}if(!i){var s=setTimeout((()=>{n||(t(),n=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),n=!0,t()}))}}(e,(()=>{if(k){var t=re(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:M,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:_,preserveWhiteSpace:R,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});t&&k(e,t)}}),E),N}let ie=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var oe={};function ae(e){if(oe[e])return oe[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in ne?ne[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in se?se[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return oe[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?oe[e]=u:r}catch(e){return r}}var le={};function ue(e,t,r){var i,n=e+"."+String(r);if(le[n])return le[n].call(t);var s=ae(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(le[n]=o,o.call(t)):t[r]}var ce={};function de(e,t,r){var i=e+"."+String(r);if(ce[i])return ce[i].bind(t);var n=ae(e)[r];return"function"!=typeof n?t[r]:(ce[i]=n,n.bind(t))}function he(){return ae("MutationObserver").constructor}var pe={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return de("Node",e,"contains")(t)},getRootNode:function(e){return de("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:he};function ve(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}var ge="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.",fe={map:{},getId:()=>(console.error(ge),-1),getNode:()=>(console.error(ge),null),removeNodeFromMap(){console.error(ge)},has:()=>(console.error(ge),!1),reset(){console.error(ge)}};function _e(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)}),u))}}function me(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>me(e,t,s||{},!0)}function ye(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fe=new Proxy(fe,{get:(e,t,r)=>("map"===t&&console.error(ge),Reflect.get(e,t,r))}));var be=Date.now;function we(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=pe.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=pe.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Se(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ce(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:pe.parentElement(e):null}function ke(e,t,r,i){if(!e)return!1;var n=Ie(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(J(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Ee(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===U}function xe(e,t){if(w(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=pe.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||xe(i,t))}function Te(e){return Boolean(e.changedTouches)}function Me(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Re(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ae(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pe.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(be=()=>(new Date).getTime());let Pe=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Le(e){var t,r=null;return"getRootNode"in e&&(null==(t=pe.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pe.host(pe.getRootNode(e))&&(r=pe.host(pe.getRootNode(e))),r}function Ne(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Le(r);)r=t;return r}(e);return pe.contains(t,r)}function Oe(e){var t=e.ownerDocument;return!!t&&(pe.contains(t,e)||Ne(e))}var Fe=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Fe||{}),De=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(De||{}),He=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(He||{}),Be=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Be||{}),qe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(qe||{}),Ue=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ue||{});function Ve(e){return"__ln"in e}class je{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var $e,We=(e,t)=>e+"@"+t;class ze{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,"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,"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,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new je,i=e=>{for(var t=e,r=U;r===U;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=pe.parentNode(n);if(s&&Oe(n)&&"TEXTAREA"!==s.tagName){var o=w(s)?this.mirror.getId(Le(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=re(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,inlineImages:this.inlineImages,onSerialize:e=>{Me(e,this.mirror)&&this.iframeManager.addIframe(e),Re(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ae(n)&&this.shadowDomManager.addShadowRoot(pe.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ge(this.removes,s,this.mirror)&&!this.movedSet.has(pe.parentNode(s))||n(s);for(var o of this.addedSet)Ye(this.droppedSet,o)||Ge(this.removes,o,this.mirror)?Ye(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(pe.parentNode(a.value)),c=i(a.value);-1!==u&&-1!==c&&(l=a)}if(!l)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(pe.parentNode(h.value));if(-1===i(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=pe.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var f=pe.host(g);if(-1!==this.mirror.getId(f)){l=h;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var _={texts:this.texts.map((e=>{var t=e.node,r=pe.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(_.texts.length||_.attributes.length||_.removes.length||_.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.movedMap={},this.mutationCb(_))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(pe.childNodes(e),(e=>pe.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Ee(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=pe.textContent(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Q(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=R(r);n=x({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(ke(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!K(r.tagName,i))if(o.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&a.setAttribute("style",e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||c!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===c?u:[u,c]:o._unchangedStyles[l]=[u,c]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(ke(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=w(e.target)?this.mirror.getId(pe.host(e.target)):this.mirror.getId(e.target);ke(e.target,this.blockClass,this.blockSelector,!1)||Ee(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||xe(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[We(r,i)]?Ze(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!w(e.target)||!S(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ee(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[We(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ke(e,this.blockClass,this.blockSelector,!1)||(pe.childNodes(e).forEach((e=>this.genAdds(e))),Ae(e)&&pe.childNodes(pe.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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.shadowDomManager.reset(),this.canvasManager.reset()}}function Ze(e,t){e.delete(t),pe.childNodes(t).forEach((t=>Ze(e,t)))}function Ge(e,t,r){return 0!==e.length&&function(e,t,r){var i,n=pe.parentNode(t),s=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=pe.parentNode(n)};for(;n;)if(i=s())return i.v;return!1}(e,t,r)}function Ye(e,t){return 0!==e.size&&Xe(e,t)}function Xe(e,t){var r=pe.parentNode(t);return!!r&&(!!e.has(r)||Xe(e,r))}var Ke=e=>{if(!$e)return e;return function(){try{return e(...arguments)}catch(e){if($e&&!0===$e(e))return;throw e}}},Je=[];function Qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function et(e,t){var r=new ze;Je.push(r),r.init(e);var i=new(he())(Ke(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function tt(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(He).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=T(e),l=(e=>i=>{var a=Qe(i);if(!ke(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Be.Mouse;break;case"touch":l=Be.Touch;break;case"pen":l=Be.Pen}l===Be.Touch?He[e]===He.MouseDown?u="TouchStart":He[e]===He.MouseUp&&(u="TouchEnd"):Be.Pen}else Te(i)&&(l=Be.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===Be.Touch||u.startsWith("Mouse")&&l===Be.Mouse)&&(l=null)):He[e]===He.Click&&(l=c,c=null);var d=Te(i)?i.changedTouches[0]:i;if(d){var h=n.getId(a),{clientX:p,clientY:v}=d;Ke(t)(r({type:He[u],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(He[e]){case He.MouseDown:case He.MouseUp:a=a.replace("mouse","pointer");break;case He.TouchStart:case He.TouchEnd:return}u.push(ve(a,l,i))})),Ke((()=>{u.forEach((e=>e()))}))}function rt(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e;return ve("scroll",Ke(_e(Ke((e=>{var o=Qe(e);if(o&&!ke(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=we(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var it=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function st(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function ot(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function at(e,t){var r,i,n,{mirror:s,stylesheetManager:o}=e,a=null;a="#document"===t.nodeName?s.getId(t):s.getId(pe.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function lt(e,t){void 0===t&&(t={});var i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t),e.recordDOM&&(i=et(e,e.doc));var s=function(e){var{mousemoveCb:t,sampling:r,doc:i,mirror:n}=e;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=_e(Ke((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),c=Ke(_e(Ke((e=>{var t=Qe(e),{clientX:r,clientY:i}=Te(e)?e.changedTouches[0]:e;s||(s=be()),l.push({x:r,y:i,id:n.getId(t),timeOffset:be()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)})),o,{trailing:!1})),d=[ve("mousemove",c,i),ve("touchmove",c,i),ve("drag",c,i)];return Ke((()=>{d.forEach((e=>e()))}))}(e),o=tt(e),a=rt(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return ve("resize",Ke(_e(Ke((()=>{var e=Se(),t=Ce();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:n}),u=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=Qe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=pe.parentElement(t)),t&&n&&!(it.indexOf(n)<0)&&!ke(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=R(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[n.toLowerCase()]||u[g])&&(d=x({element:t,maskInputOptions:u,tagName:n,type:g,value:d,maskInputFn:c})),v(t,h?{text:d,isChecked:p,userTriggered:r}:{text:d,isChecked:p});var f=t.name;"radio"===g&&f&&p&&i.querySelectorAll('input[type="radio"][name="'+f+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}function v(e,i){var s=nt.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){nt.set(e,i);var o=n.getId(e);Ke(t)(r({},i,{id:o}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>ve(e,Ke(p),i))),f=i.defaultView;if(!f)return()=>{g.forEach((e=>e()))};var _=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),m=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return _&&_.set&&g.push(...m.map((e=>me(e[0],e[1],{set(){Ke(p)({target:this,isTrusted:!1})}},!1,f)))),Ke((()=>{g.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ke((e=>_e(Ke((s=>{var o=Qe(s);if(o&&!ke(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=o;t({type:e,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}})),s.media||500))),l=[ve("play",a(Ue.Play),o),ve("pause",a(Ue.Pause),o),ve("seeked",a(Ue.Seeked),o),ve("volumechange",a(Ue.VolumeChange),o),ve("ratechange",a(Ue.RateChange),o)];return Ke((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ke(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=ot(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){void 0===r&&(r=this.cssRules.length);var i=e+" { "+t+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var c={};ct("CSSGroupingRule")?c.CSSGroupingRule=s.CSSGroupingRule:(ct("CSSMediaRule")&&(c.CSSMediaRule=s.CSSMediaRule),ct("CSSConditionRule")&&(c.CSSConditionRule=s.CSSConditionRule),ct("CSSSupportsRule")&&(c.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var[t,s]=e;d[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=ot(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...st(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...st(t),o]}]}),e.apply(t,s)}))})})),Ke((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),h=at(e,e.doc),p=function(e,t){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=e,{win:o}=t,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ke(((e,t,o)=>{var l,[u,c,d]=o;if(n.has(u))return a.apply(t,[u,c,d]);var{id:h,styleId:p}=ot(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||p&&-1!==p)&&r({id:h,styleId:p,set:{property:u,value:c,priority:d},index:st(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ke(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:c,styleId:d}=ot(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:u},index:st(t.parentRule)}),e.apply(t,o)}))}),Ke((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:r}=e,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=ye(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ke((()=>{n.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ke((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;u<l;u++){var c=e.getRangeAt(u),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=c;ke(d,i,n,!0)||ke(p,i,n,!0)||a.push({start:r.getId(d),startOffset:h,end:r.getId(p),endOffset:v})}s({ranges:a})}}));return a(),ve("selectionchange",a)}(e),f=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?ye(i.customElements,"define",(function(e){return function(t,i,n){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,n])}})):()=>{}}(e),_=[];for(var m of e.plugins)_.push(m.observer(m.callback,n,m.options));return Ke((()=>{Je.forEach((e=>e.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),c(),d(),h(),p(),v(),g(),f(),_.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function ct(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class dt{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var n=i.get(t);return n||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ht{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new dt(V)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new dt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Fe.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:Fe.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Fe.Meta:case Fe.Load:case Fe.DomContentLoaded:return!1;case Fe.Plugin:return t;case Fe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Fe.IncrementalSnapshot:switch(t.data.source){case De.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.Drag:case De.TouchMove:case De.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(t.data,e,["id"]),t;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case De.Font:return t;case De.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case De.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===c.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class pt{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(S(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=et(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(rt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(pe.host(e))),this.restoreHandlers.push(at({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(ye(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=pe.shadowRoot(this);return s&&Oe(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ft=0;ft<64;ft++)gt[vt.charCodeAt(ft)]=ft;var _t=new Map;var mt=(e,t,r)=>{if(e&&(wt(e,t)||"object"==typeof e)){var i=function(e,t){var r=_t.get(e);return r||(r=new Map,_t.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function yt(e,t,r){if(e instanceof Array)return e.map((e=>yt(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;t<i;t+=3)n+=vt[r[t]>>2],n+=vt[(3&r[t])<<4|r[t+1]>>4],n+=vt[(15&r[t+1])<<2|r[t+2]>>6],n+=vt[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[yt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var i=e.constructor.name,{src:n}=e;return{rr_type:i,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[yt(e.data,t,r),e.width,e.height]}:wt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,r)}:e}var bt=(e,t,r)=>e.map((e=>yt(e,t,r))),wt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function St(e,t,r,i){var n=[];try{var s=ye(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!ke(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}}));n.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function Ct(e,t,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var l=ye(e,a,(function(e){return function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var c=e.apply(this,l);if(mt(c,s,this),"tagName"in this.canvas&&!ke(this.canvas,i,n,!0)){var d=bt(l,s,this),h={type:t,property:a,args:d};r(this.canvas,h)}return c}}));o.push(l)}catch(i){var u=me(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var It,kt,Et,xt,Tt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Mt="undefined"!=typeof window&&window.Blob&&new Blob([(It=Tt,Uint8Array.from(atob(It),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Rt(e){var t;try{if(!(t=Mt&&(window.URL||window.webkitURL).createObjectURL(Mt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class At{constructor(e){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,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,i,n,s){var o=this,a=St(r,i,n,!0),l=new Map,u=new Rt;u.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:i,width:n,height:s}=e.data;this.mutationCb({id:t,type:qe["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var c,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?c=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{ke(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(r.document),a).forEach(function(){var e=t((function*(e){var t,r=o.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=e.clientWidth||e.width,a=e.clientHeight||e.height,c=yield createImageBitmap(e,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:c,width:n,height:a,dataURLOptions:s.dataURLOptions},[c])}}));return function(t){return e.apply(this,arguments)}}()),c=requestAnimationFrame(p))};c=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=St(e,t,r,!1),n=function(e,t,r,i){var n=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])return 1;var o=ye(t.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return ke(this.canvas,r,i,!0)||setTimeout((()=>{var r=bt(a,t,this);e(this.canvas,{type:qe["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=me(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:qe["2D"],property:s,args:[t],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,i){var n=[];return n.push(...Ct(t.WebGLRenderingContext.prototype,qe.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...Ct(t.WebGL2RenderingContext.prototype,qe.WebGL2,e,r,i,t)),()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>i(e,s))),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Pt{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Pe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],s=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:I(t,e.href),index:r})))})),i.styleIds.push(t)};for(var o of e)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Lt{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Nt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Ot=document.createElement("iframe");document.body.appendChild(Ot),Array.from=(null==(n=Ot.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ot)}}catch(e){console.debug("Unable to override Array.from",e)}var Ft,Dt,Ht=new E;function Bt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:f,hooks:_,packFn:m,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:T=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:P=new Set([]),errorHandler:L}=e;$e=L;var N=!I||window.parent===window,O=!1;if(!N)try{window.parent.document&&(O=!1)}catch(e){O=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!O)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Ht.reset();var F,D=!0===h?{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!==p?p:{password:!0},H=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var B=0,q=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&!O&&(e=m(e)),e};kt=(e,r)=>{var s,o=e;if(o.timestamp=be(),!(null==(s=Je[0])?void 0:s.isFrozen())||o.type===Fe.FullSnapshot||o.type===Fe.IncrementalSnapshot&&o.data.source===De.Mutation||Je.forEach((e=>e.unfreeze())),N)null==t||t(q(o),r);else if(O){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Fe.FullSnapshot)F=o,B=0;else if(o.type===Fe.IncrementalSnapshot){if(o.data.source===De.Mutation&&o.data.isAttachIframe)return;B++;var l=n&&B>=n,u=i&&o.timestamp-F.timestamp>i;(l||u)&&Et(!0)}};var U=e=>{kt({type:Fe.IncrementalSnapshot,data:r({source:De.Mutation},e)})},V=e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.Scroll},e)}),j=e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.CanvasMutation},e)}),W=new Pt({mutationCb:U,adoptedStyleSheetCb:e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.AdoptedStyleSheet},e)})}),z=new ht({mirror:Ht,mutationCb:U,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:kt});for(var Z of R||[])Z.getMirror&&Z.getMirror({nodeMirror:Ht,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var G=new Lt;xt=new At({recordCanvas:C,mutationCb:j,win:window,blockClass:s,blockSelector:o,mirror:Ht,sampling:y.canvas,dataURLOptions:b});var Y=new pt({mutationCb:U,scrollCb:V,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:M,sampling:y,slimDOMOptions:H,iframeManager:z,stylesheetManager:W,canvasManager:xt,keepIframeSrcFn:A,processedNodeManager:G},mirror:Ht});Et=function(e){if(void 0===e&&(e=!1),S){kt({type:Fe.Meta,data:{href:window.location.href,width:Ce(),height:Se()}},e),W.reset(),Y.init(),Je.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new E,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:_,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w=(()=>!1)}=t||{};return re(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:u,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:_,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Ht,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:D,maskTextFn:f,maskInputFn:g,slimDOM:H,dataURLOptions:b,recordCanvas:C,inlineImages:M,onSerialize:e=>{Me(e,Ht)&&z.addIframe(e),Re(e,Ht)&&W.trackLinkElement(e),Ae(e)&&Y.addShadowRoot(pe.shadowRoot(e),document)},onIframeLoad:(e,t)=>{z.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");kt({type:Fe.FullSnapshot,data:{node:t,initialOffset:we(window)}},e),Je.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Ht.getId(document))}};try{var X=[],K=e=>{var t;return Ke(lt)({mutationCb:U,mousemoveCb:(e,t)=>kt({type:Fe.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.MouseInteraction},e)}),scrollCb:V,viewportResizeCb:e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.ViewportResize},e)}),inputCb:e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.Input},e)}),mediaInteractionCb:e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.MediaInteraction},e)}),styleSheetRuleCb:e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.StyleSheetRule},e)}),styleDeclarationCb:e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.StyleDeclaration},e)}),canvasMutationCb:j,fontCb:e=>kt({type:Fe.IncrementalSnapshot,data:r({source:De.Font},e)}),selectionCb:e=>{kt({type:Fe.IncrementalSnapshot,data:r({source:De.Selection},e)})},customElementCb:e=>{kt({type:Fe.IncrementalSnapshot,data:r({source:De.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:M,userTriggeredOnInput:x,collectFonts:T,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:H,dataURLOptions:b,mirror:Ht,iframeManager:z,stylesheetManager:W,shadowDomManager:Y,processedNodeManager:G,canvasManager:xt,ignoreCSSAttributes:P,plugins:(null==(t=null==R?void 0:R.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>kt({type:Fe.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},_)};z.addLoadListener((e=>{try{X.push(K(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{Et(),X.push(K(document)),Nt=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(X.push(ve("DOMContentLoaded",(()=>{kt({type:Fe.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),X.push(ve("load",(()=>{kt({type:Fe.Load,data:{}}),"load"===k&&J()}),window))),()=>{X.forEach((e=>e())),G.destroy(),Nt=!1,$e=void 0}}catch(e){console.warn(e)}}Bt.addCustomEvent=(e,t)=>{if(!Nt)throw new Error("please add custom event after start recording");kt({type:Fe.Custom,data:{tag:e,payload:t}})},Bt.freezePage=()=>{Je.forEach((e=>e.freeze()))},Bt.takeFullSnapshot=e=>{if(!Nt)throw new Error("please take full snapshot after start recording");Et(e)},Bt.mirror=Ht,(Dt=Ft||(Ft={}))[Dt.NotStarted=0]="NotStarted",Dt[Dt.Running=1]="Running",Dt[Dt.Stopped=2]="Stopped";var qt,Ut=Object.defineProperty,Vt=(e,t,r)=>((e,t,r)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),jt=Object.defineProperty,$t=(e,t,r)=>((e,t,r)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Wt=Object.defineProperty,zt=(e,t,r)=>((e,t,r)=>t in e?Wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Gt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Yt={};function Xt(e){if(Yt[e])return Yt[e];var t=globalThis[e],r=t.prototype,i=e in Zt?Zt[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in Gt?Gt[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return Yt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?Yt[e]=u:r}catch(e){return r}}var Kt={};function Jt(e,t,r){var i,n=e+"."+String(r);if(Kt[n])return Kt[n].call(t);var s=Xt(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Kt[n]=o,o.call(t)):t[r]}var Qt={};function er(e,t,r){var i=e+"."+String(r);if(Qt[i])return Qt[i].bind(t);var n=Xt(e)[r];return"function"!=typeof n?t[r]:(Qt[i]=n,n.bind(t))}var tr={childNodes:function(e){return Jt("Node",e,"childNodes")},parentNode:function(e){return Jt("Node",e,"parentNode")},parentElement:function(e){return Jt("Node",e,"parentElement")},textContent:function(e){return Jt("Node",e,"textContent")},contains:function(e,t){return er("Node",e,"contains")(t)},getRootNode:function(e){return er("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Jt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Jt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Jt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Jt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xt("MutationObserver").constructor}};class rr{constructor(){zt(this,"idNodeMap",new Map),zt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ir(tr.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&ir(tr.parentNode(e),t,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof nr))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function lr(e){if(ar[e])return ar[e];var t=globalThis[e],r=t.prototype,i=e in sr?sr[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in or?or[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return ar[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?ar[e]=u:r}catch(e){return r}}var ur={};function cr(e,t,r){var i,n=e+"."+String(r);if(ur[n])return ur[n].call(t);var s=lr(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(ur[n]=o,o.call(t)):t[r]}var dr={};function hr(e,t,r){var i=e+"."+String(r);if(dr[i])return dr[i].bind(t);var n=lr(e)[r];return"function"!=typeof n?t[r]:(dr[i]=n,n.bind(t))}var pr={childNodes:function(e){return cr("Node",e,"childNodes")},parentNode:function(e){return cr("Node",e,"parentNode")},parentElement:function(e){return cr("Node",e,"parentElement")},textContent:function(e){return cr("Node",e,"textContent")},contains:function(e,t){return hr("Node",e,"contains")(t)},getRootNode:function(e){return hr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?cr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?cr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return cr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return cr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return lr("MutationObserver").constructor}};var vr="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.",gr={map:{},getId:()=>(console.error(vr),-1),getNode:()=>(console.error(vr),null),removeNodeFromMap(){console.error(vr)},has:()=>(console.error(vr),!1),reset(){console.error(vr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gr=new Proxy(gr,{get:(e,t,r)=>("map"===t&&console.error(vr),Reflect.get(e,t,r))}));var fr=Date.now;function _r(e){return e?e.nodeType===e.ELEMENT_NODE?e:pr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(fr=()=>(new Date).getTime());function mr(e){var t,r=null;return"getRootNode"in e&&(null==(t=pr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pr.host(pr.getRootNode(e))&&(r=pr.host(pr.getRootNode(e))),r}function yr(e){for(var t,r=e;t=mr(r);)r=t;return r}function br(e){var t=e.ownerDocument;if(!t)return!1;var r=yr(e);return pr.contains(t,r)}for(var wr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){$t(this,"id",1),$t(this,"styleIDMap",new WeakMap),$t(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return gr},closestElementOfNode:_r,getBaseDimension:function e(t,r){var i,n,s=null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=e(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){var i=t[r[0]];return 1===r.length?i:e(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:yr,getShadowHost:mr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=pr.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=pr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pr.shadowRoot(e)))},hookSetter:function e(t,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(t,r);return s.Object.defineProperty(t,r,n?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(pr.contains(t,e)||br(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&tr.host(i)||null,Boolean(n&&"shadowRoot"in n&&tr.shadowRoot(n)===i))return!1;var i,n,s=r.getId(t);if(!r.has(s))return!0;var o=pr.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked:function(e,t,r,i){if(!e)return!1;var n=_r(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(ir(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var i=t.children.length-1;i>=0;i--)e(t.children[i],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return fr},on:function(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var i={value:e,parent:r,children:[]};return t[e.node.id]=i,i},i=[];for(var n of e){var{nextId:s,parentId:o}=n;if(s&&s in t){var a=t[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(o in t){var c=t[o];c.children.push(r(n,c))}else i.push(r(n,null))}return i},shadowHostInDom:br,throttle:function(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)}),u))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],i=e.length;i--;){var n=e[i];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Sr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ir=0;Ir<64;Ir++)Cr[Sr.charCodeAt(Ir)]=Ir;var kr;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var Er=document.createElement("iframe");document.body.appendChild(Er),Array.from=(null==(qt=Er.contentWindow)?void 0:qt.Array.from)||Array.from,document.body.removeChild(Er)}}catch(e){console.debug("Unable to override Array.from",e)}new rr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(kr||(kr={}));class xr{constructor(e){Vt(this,"fileName"),Vt(this,"functionName"),Vt(this,"lineNumber"),Vt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Tr=/(^|@)\S+:\d+/,Mr=/^\s*at .*(\S+:\d+|\(native\))/m,Rr=/^(eval@)?(\[native code])?$/,Ar={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Mr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).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 xr({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Rr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new xr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new xr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;n<s;n+=2){var o=t.exec(r[n]);o&&i.push(new xr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;n<s;n+=2){var o=t.exec(r[n]);o&&i.push(new xr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new xr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Pr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;s<i.children.length;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(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Lr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Nr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Lr(e[i])&&Nr(e[i],t-1))return!0;return!1}function Or(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Lr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Lr(e)&&Nr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"...");return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var o={};for(var a in t){var l=t[a];Array.isArray(l)?o[a]=Pr(l.length?l[0]:null):o[a]=l}return o}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Fr={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 Dr(e,t,r){var i,n=r?Object.assign({},Fr,r):Fr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?t[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=t.error,s=Ar.parse(i).map((e=>e.toString())),o=[Or(r,n.stringifyOptions)];e({level:"error",trace:s,payload:o})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var c=t=>{var r,i;t.reason instanceof Error?i=[Or("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Or("Uncaught (in promise)",n.stringifyOptions),Or(t.reason,n.stringifyOptions)]);var s=Ar.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",c),l.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of n.level)l.push(h(i,d));return()=>{l.forEach((e=>e()))};function h(t,r){var i=this;return t[r]?wr.patch(t,r,(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var c=Ar.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Or(e,n.stringifyOptions)));++o<n.lengthThreshold?e({level:r,trace:c,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Or("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Hr=e=>({name:"rrweb/console@1",observer:Dr,options:e}),Br=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({}),qr=["$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"];function Ur(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}var Vr=["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"],jr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return Vr.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))};function $r(e,t){return-1!==e.indexOf(t)}var Wr=function(e){return e.trim()},zr=function(e){return e.replace(/^\$/,"")};var Zr=Array.isArray,Gr=Object.prototype,Yr=Gr.hasOwnProperty,Xr=Gr.toString,Kr=Zr||function(e){return"[object Array]"===Xr.call(e)},Jr=e=>"function"==typeof e,Qr=e=>Jr(e)&&-1!==e.toString().indexOf("[native code]"),ei=e=>e===Object(e)&&!Kr(e),ti=e=>{if(ei(e)){for(var t in e)if(Yr.call(e,t))return!1;return!0}return!1},ri=e=>void 0===e,ii=e=>"[object String]"==Xr.call(e),ni=e=>ii(e)&&0===e.trim().length,si=e=>null===e,oi=e=>ri(e)||si(e),ai=e=>"[object Number]"==Xr.call(e)&&e==e,li=e=>ai(e)&&e>0,ui=e=>"[object Boolean]"===Xr.call(e),ci=e=>e instanceof FormData,di=e=>$r(qr,e);function hi(e){return null===e||"object"!=typeof e}function pi(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function vi(e){return!ri(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var gi=[!0,"true",1,"1","yes"],fi=e=>$r(gi,e),_i=[!1,"false",0,"0","no"];function mi(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),ai(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),mi(n||r,t,r,i))}class yi{constructor(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=mi(e.bucketSize,0,100,e._logger),this._refillRate=mi(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=mi(e.refillInterval,0,864e5,e._logger)}_applyRefill(e,t){var r=t-e.lastAccess,i=Math.floor(r/this._refillInterval);if(i>0){var n=i*this._refillRate;e.tokens=Math.min(e.tokens+n,this._bucketSize),e.lastAccess=e.lastAccess+i*this._refillInterval}}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this._buckets[i];return n?this._applyRefill(n,r):(n={tokens:this._bucketSize,lastAccess:r},this._buckets[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===n.tokens)}stop(){this._buckets={}}}var bi="Mobile",wi="iOS",Si="Android",Ci="Tablet",Ii=Si+" "+Ci,ki="iPad",Ei="Apple",xi=Ei+" Watch",Ti="Safari",Mi="BlackBerry",Ri="Samsung",Ai=Ri+"Browser",Pi=Ri+" Internet",Li="Chrome",Ni=Li+" OS",Oi=Li+" "+wi,Fi="Internet Explorer",Di=Fi+" "+bi,Hi="Opera",Bi=Hi+" Mini",qi="Edge",Ui="Microsoft "+qi,Vi="Firefox",ji=Vi+" "+wi,$i="Nintendo",Wi="PlayStation",zi="Xbox",Zi=Si+" "+bi,Gi=bi+" "+Ti,Yi="Windows",Xi=Yi+" Phone",Ki="Nokia",Ji="Ouya",Qi="Generic",en=Qi+" "+bi.toLowerCase(),tn=Qi+" "+Ci.toLowerCase(),rn="Konqueror",nn="(\\d+(\\.\\d+)?)",sn=new RegExp("Version/"+nn),on=new RegExp(zi,"i"),an=new RegExp(Wi+" \\w+","i"),ln=new RegExp($i+" \\w+","i"),un=new RegExp(Mi+"|PlayBook|BB10","i"),cn={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var dn,hn,pn,vn=(e,t)=>t&&$r(t,Ei)||function(e){return $r(e,Ti)&&!$r(e,Li)&&!$r(e,Si)}(e),gn=function(e,t){return t=t||"",$r(e," OPR/")&&$r(e,"Mini")?Bi:$r(e," OPR/")?Hi:un.test(e)?Mi:$r(e,"IE"+bi)||$r(e,"WPDesktop")?Di:$r(e,Ai)?Pi:$r(e,qi)||$r(e,"Edg/")?Ui:$r(e,"FBIOS")?"Facebook "+bi:$r(e,"UCWEB")||$r(e,"UCBrowser")?"UC Browser":$r(e,"CriOS")?Oi:$r(e,"CrMo")||$r(e,Li)?Li:$r(e,Si)&&$r(e,Ti)?Zi:$r(e,"FxiOS")?ji:$r(e.toLowerCase(),rn.toLowerCase())?rn:vn(e,t)?$r(e,bi)?Gi:Ti:$r(e,Vi)?Vi:$r(e,"MSIE")||$r(e,"Trident/")?Fi:$r(e,"Gecko")?Vi:""},fn={[Di]:[new RegExp("rv:"+nn)],[Ui]:[new RegExp(qi+"?\\/"+nn)],[Li]:[new RegExp("("+Li+"|CrMo)\\/"+nn)],[Oi]:[new RegExp("CriOS\\/"+nn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+nn)],[Ti]:[sn],[Gi]:[sn],[Hi]:[new RegExp("(Opera|OPR)\\/"+nn)],[Vi]:[new RegExp(Vi+"\\/"+nn)],[ji]:[new RegExp("FxiOS\\/"+nn)],[rn]:[new RegExp("Konqueror[:/]?"+nn,"i")],[Mi]:[new RegExp(Mi+" "+nn),sn],[Zi]:[new RegExp("android\\s"+nn,"i")],[Pi]:[new RegExp(Ai+"\\/"+nn)],[Fi]:[new RegExp("(rv:|MSIE )"+nn)],Mozilla:[new RegExp("rv:"+nn)]},_n=function(e,t){var r=gn(e,t),i=fn[r];if(ri(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},mn=[[new RegExp(zi+"; "+zi+" (.*?)[);]","i"),e=>[zi,e&&e[1]||""]],[new RegExp($i,"i"),[$i,""]],[new RegExp(Wi,"i"),[Wi,""]],[un,[Mi,""]],[new RegExp(Yi,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Xi,""];if(new RegExp(bi).test(t)&&!/IEMobile\b/.test(t))return[Yi+" "+bi,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=r[1],n=cn[i]||"";return/arm/i.test(t)&&(n="RT"),[Yi,n]}return[Yi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[wi,t.join(".")]}return[wi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ri(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Si+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Si+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Si,t.join(".")]}return[Si,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ni,""]],[/Linux|debian/i,["Linux",""]]],yn=function(e){return ln.test(e)?$i:an.test(e)?Wi:on.test(e)?zi:new RegExp(Ji,"i").test(e)?Ji:new RegExp("("+Xi+"|WPDesktop)","i").test(e)?Xi:/iPad/.test(e)?ki:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?xi:un.test(e)?Mi:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ki,"i").test(e)?Ki:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(bi).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Si:Ii:new RegExp("(pda|"+bi+")","i").test(e)?en:new RegExp(Ci,"i").test(e)&&!new RegExp(Ci+" pc","i").test(e)?tn:""},bn=function(e){var t=yn(e);return t===ki||t===Ii||"Kobo"===t||"Kindle Fire"===t||t===tn?Ci:t===$i||t===zi||t===Wi||t===Ji?"Console":t===xi?"Wearable":t?bi:"Desktop"},wn=e=>e instanceof Error;function Sn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return pn&&r.length===hn||(hn=r.length,pn=r.reduce(((r,i)=>{dn||(dn={});var n=dn[i];if(n)r[n[0]]=n[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,dn[i]=[l,u];break}}return r}),{})),pn}}class Cn{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Kr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:Sn(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var In="?";function kn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?In:r,in_app:!0};return ri(i)||(s.lineno=i),ri(n)||(s.colno=n),s}var En=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:In,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},xn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rn=(e,t)=>{var r=xn.exec(e);if(r){var[,i,n,s]=r;return kn(t,i,In,+n,+s)}var o=Tn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Mn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=En(o[1]||In,o[2]);return kn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},An=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Pn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ln=(e,t)=>{var r=An.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Pn.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]||In;return[s,n]=En(s,n),kn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Nn=/\(error: (.*)\)/,On=50;function Fn(){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;a<o.length;a++){var l=o[a];if(!(l.length>1024)){var u=Nn.test(l)?l.replace(Nn,"$1"):l;if(!u.match(/\S*Error: /)){for(var c of i){var d=c(u,e);if(d){s.push(d);break}}if(s.length>=On)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,On).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||In});var i}))}(s)}}("web:javascript",Rn,Ln)}class Dn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=ii(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return pi(e,"DOMException")}isDOMError(e){return pi(e,"DOMError")}}class Hn{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Bn{constructor(){}match(e){return pi(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r,i=t.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var qn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Un{match(e){return"string"==typeof e}coerce(e,t){var r,[i,n]=this.getInfos(e);return{type:null!=i?i:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(qn);return i&&(t=i[1],r=i[2]),[t,r]}}var Vn=["fatal","error","warning","log","info","debug"];function jn(e,t){void 0===t&&(t=40);var r=Object.keys(e);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(!(n.length>t))return i===r.length||n.length<=t?n:n.slice(0,t)+"..."}return""}class $n{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return vi(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+jn(e)}isSeverityLevel(e){return ii(e)&&!ni(e)&&Vn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(wn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Wn{match(e){return vi(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+jn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class zn{match(e){return hi(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Zn{match(e){return pi(e,"PromiseRejectionEvent")}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return hi(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){if(hi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Gn="undefined"!=typeof window?window:void 0,Yn="undefined"!=typeof globalThis?globalThis:Gn;"undefined"==typeof self&&(Yn.self=Yn),"undefined"==typeof File&&(Yn.File=function(){});var Xn=Array.prototype,Kn=Xn.forEach,Jn=Xn.indexOf,Qn=null==Yn?void 0:Yn.navigator,es=null==Yn?void 0:Yn.document,ts=null==Yn?void 0:Yn.location,rs=null==Yn?void 0:Yn.fetch,is=null!=Yn&&Yn.XMLHttpRequest&&"withCredentials"in new Yn.XMLHttpRequest?Yn.XMLHttpRequest:void 0,ns=null==Yn?void 0:Yn.AbortController,ss=null==Qn?void 0:Qn.userAgent,os=null!=Gn?Gn:{},as=()=>!!Gn.Zone,ls=e=>e instanceof Document,us={DEBUG:!1,LIB_VERSION:"1.347.2"},cs=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={_log:function(t){if(Gn&&(us.DEBUG||os.POSTHOG_DEBUG||r)&&!ri(Gn.console)&&Gn.console){for(var i=("__rrweb_original__"in Gn.console[t]?Gn.console[t].__rrweb_original__:Gn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(e,...s)}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("error",...t)},critical:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>cs(e+" "+t,r)};return i},ds=cs("[PostHog.js]"),hs=ds.createLogger,ps={};function vs(e,t,r){if(Kr(e))if(Kn&&e.forEach===Kn)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var i=0,n=e.length;i<n;i++)if(i in e&&t.call(r,e[i],i)===ps)return}function gs(e,t,r){if(!oi(e)){if(Kr(e))return vs(e,t,r);if(ci(e)){for(var i of e.entries())if(t.call(r,i[1],i[0])===ps)return}else for(var n in e)if(Yr.call(e,n)&&t.call(r,e[n],n)===ps)return}}var fs=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return vs(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},_s=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return vs(r,(function(t){vs(t,(function(t){e.push(t)}))})),e};function ms(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var ys=function(e){try{return e()}catch(e){return}},bs=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){ds.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ds.critical(e)}}},ws=function(e){var t={};return gs(e,(function(e,r){(ii(e)&&e.length>0||ai(e))&&(t[r]=e)})),t};function Ss(e,t){return r=e,i=e=>ii(e)&&!si(t)?e.slice(0,t):e,n=new Set,function e(t,r){return t!==Object(t)?i?i(t,r):t:n.has(t)?void 0:(n.add(t),Kr(t)?(s=[],vs(t,(t=>{s.push(e(t))}))):(s={},gs(t,((t,r)=>{n.has(t)||(s[r]=e(t,r))}))),s);var s}(r);var r,i,n}var Cs=["herokuapp.com","vercel.app","netlify.app"];function Is(e){var t=null==e?void 0:e.hostname;if(!ii(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of Cs)if(r===i)return!1;return!0}function ks(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function Es(e,t,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:s})}var xs=e=>{var t=null==es?void 0:es.createElement("a");return ri(t)?null:(t.href=e,t)},Ts=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return gs(e,(function(e,t){ri(e)||ri(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},Ms=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Kr(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){ds.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Rs=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[0]||"",s=i[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");Kr(h)&&(t.includes(h[0])?c.push(h[0]+"="+r):c.push(u[d]))}var p=l;return null!=a&&(p+="?"+c.join("&")),null!=s&&(p+="#"+s),p},As=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Ps(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return Jr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Ls(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of t.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Ns="$people_distinct_id",Os="__alias",Fs="__timers",Ds="$autocapture_disabled_server_side",Hs="$heatmaps_enabled_server_side",Bs="$exception_capture_enabled_server_side",qs="$error_tracking_suppression_rules",Us="$error_tracking_capture_extension_exceptions",Vs="$web_vitals_enabled_server_side",js="$dead_clicks_enabled_server_side",$s="$product_tours_enabled_server_side",Ws="$web_vitals_allowed_metrics",zs="$session_recording_remote_config",Zs="$sesid",Gs="$session_is_sampled",Ys="$enabled_feature_flags",Xs="$early_access_features",Ks="$feature_flag_details",Js="$stored_person_properties",Qs="$stored_group_properties",eo="$surveys",to="$flag_call_reported",ro="$feature_flag_errors",io="$user_state",no="$client_session_props",so="$capture_rate_limit",oo="$initial_campaign_params",ao="$initial_referrer_info",lo="$initial_person_info",uo="$epp",co="__POSTHOG_TOOLBAR__",ho="$posthog_cookieless",po=[Ns,Os,"__cmpns",Fs,"$session_recording_enabled_server_side",Hs,Zs,Ys,qs,io,Xs,Ks,Qs,Js,eo,to,ro,no,so,oo,ao,uo,lo,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function vo(e){return e instanceof Element&&(e.id===co||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function go(e){return!!e&&1===e.nodeType}function fo(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function _o(e){return!!e&&3===e.nodeType}function mo(e){return!!e&&11===e.nodeType}function yo(e){return e?Wr(e).split(/\s+/):[]}function bo(e){var t=null==Gn?void 0:Gn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function wo(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return yo(t)}function So(e){return oi(e)?null:Wr(e).split(/(\s+)/).filter((e=>jo(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Co(e){var t="";return Oo(e)&&!Fo(e)&&e.childNodes&&e.childNodes.length&&gs(e.childNodes,(function(e){var r;_o(e)&&e.textContent&&(t+=null!==(r=So(e.textContent))&&void 0!==r?r:"")})),Wr(t)}function Io(e){return ri(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ko=["a","button","form","input","select","textarea","label"];function Eo(e,t){if(ri(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function xo(e){var t=e.parentNode;return!(!t||!go(t))&&t}var To=["next","previous","prev",">","<"],Mo=10;var Ro=[".ph-no-rageclick",".ph-no-capture"];function Ao(e,t){if(!Gn||Po(e))return!1;var r,i,n;ui(t)?(r=!!t&&Ro,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:Ro,i=null==t?void 0:t.content_ignorelist);if(!1===r)return!1;var{targetElementList:s}=Lo(e,!1);return!function(e,t){if(!1===e||ri(e))return!1;var r;if(!0===e)r=To;else{if(!Kr(e))return!1;if(e.length>Mo)return ds.error("[PostHog] content_ignorelist array cannot exceed "+Mo+" items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>t.includes(e)||i.includes(e)))}))}(i,s.map((e=>{var t;return{safeText:Co(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!Eo(s,r)}var Po=e=>!e||fo(e,"html")||!go(e),Lo=(e,t)=>{if(!Gn||Po(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!fo(n,"body");)if(mo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=xo(n);if(!s)break;if(t||ko.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Gn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function No(e,t,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!Gn||Po(e))return!1;if(null!=(s=r)&&s.url_allowlist&&!bo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&bo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=Lo(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(ri(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var s of e)if(i=n(s))return i.v;return!1}(d,r))return!1;if(!Eo(d,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var h=Gn.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return c?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(ko.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}function Oo(e){for(var t=e;t.parentNode&&!fo(t,"body");t=t.parentNode){var r=wo(t);if($r(r,"ph-sensitive")||$r(r,"ph-no-capture"))return!1}if($r(wo(e),"ph-include"))return!0;var i=e.type||"";if(ii(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";if(ii(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Fo(e){return!!(fo(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||fo(e,"select")||fo(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Do="(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})",Ho=new RegExp("^(?:"+Do+")$"),Bo=new RegExp(Do),qo="\\d{3}-?\\d{2}-?\\d{4}",Uo=new RegExp("^("+qo+")$"),Vo=new RegExp("("+qo+")");function jo(e,t){if(void 0===t&&(t=!0),oi(e))return!1;if(ii(e)){if(e=Wr(e),(t?Ho:Bo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Uo:Vo).test(e))return!1}return!0}function $o(e){var t=Co(e);return jo(t=(t+" "+Wo(e)).trim())?t:""}function Wo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&gs(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Co(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Wo(e)).trim())}catch(e){ds.error("[AutoCapture]",e)}})),t}function zo(e){return function(e){var t=e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))n+="."+s.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return ms(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[Zo(t.toString())]=Zo(r.toString())})),n+=":",n+=ms(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Go(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ms(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(e))}function Zo(e){return e.replace(/"|\\"/g,'\\"')}function Go(e){var t=e.attr__class;return t?Kr(t)?t:yo(t):void 0}var Yo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Xo=hs("[Recorder]"),Ko=e=>"navigation"===e.entryType,Jo=e=>"resource"===e.entryType;function Qo(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Ko(e)||Jo(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>oa({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>Ko(e)||Jo(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>oa({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}function ea(e,t){return!!t&&(ui(t)||t[e])}function ta(e){var{type:t,recordBody:r,headers:i,url:n}=e;function s(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(n))return!1;if(ui(r))return!0;if(Kr(r))return s(r);var o=r[t];return ui(o)?o:s(o)}function ra(e,t,r,i,n,s){return ia.apply(this,arguments)}function ia(){return ia=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return Xo.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Jo(e)&&e.initiatorType===t&&(ri(i)||e.startTime>=i)&&(ri(n)||e.startTime<=n)));return o||(yield new Promise((e=>setTimeout(e,50*s))),ra(e,t,r,i,n,s+1))})),ia.apply(this,arguments)}function na(e){var{body:t,options:r,url:i}=e;if(oi(t))return null;var{hostname:n,isHostDenied:s}=Ls(i,r);if(s)return n+" is in deny list";if(ii(t))return t;if(ls(t))return t.textContent;if(ci(t))return Ts(t);if(ei(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var sa=e=>!si(e)&&("navigation"===e.entryType||"resource"===e.entryType);function oa(e){var{entry:t,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:c}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[r({},t?t.toJSON():{name:u},{startTime:ri(a)?void 0:Math.round(a),endTime:ri(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:i,initiatorType:c||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(sa(t))for(var v of t.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var aa=["video/","audio/"];function la(e){return new Promise(((t,r)=>{var i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(i)))}catch(e){clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}function ua(){return ua=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=Ls(i,r);return s?Promise.resolve(n+" is in deny list"):la(t)})),ua.apply(this,arguments)}function ca(){return ca=t((function*(e){var{r:t,options:r,url:i}=e,n=function(e){var t,{r:r,options:i,url:n}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=aa.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Ls(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return si(n)?la(t):Promise.resolve(n)})),ca.apply(this,arguments)}function da(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ea("request",i.recordHeaders),s=ea("response",i.recordHeaders),o=Ps(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u,c,d=new Request(t,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),n&&(h.requestHeaders=p),ta({type:"request",headers:p,url:t,recordBody:i.recordBody})&&(h.requestBody=yield function(e){return ua.apply(this,arguments)}({r:d,options:i,url:t})),u=r.performance.now(),l=yield o(d),c=r.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),s&&(h.responseHeaders=v),ta({type:"response",headers:v,url:t,recordBody:i.recordBody})&&(h.responseBody=yield function(e){return ca.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{ra(r,"fetch",d.url,u,c).then((t=>{var r,i=oa({entry:t,method:d.method,status:null==(r=l)?void 0:r.status,networkRequest:h,start:u,end:c,url:d.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}var ha=null;function pa(e,t,i){if(!("performance"in t))return()=>{};if(ha)return Xo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Yo,i):Yo,s=t=>{var i=[];t.requests.forEach((e=>{var t=n.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},o=Qo(s,t,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ea("request",r.recordHeaders),n=ea("response",r.recordHeaders),s=Ps(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,c){void 0===l&&(l=!0);var d,h,p=this,v=new Request(a),g={},f={},_=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(f[e]=t,_(e,t)),i&&(g.requestHeaders=f);var m=p.send.bind(p);p.send=e=>(ta({type:"request",headers:f,url:a,recordBody:r.recordBody})&&(g.requestBody=na({body:e,options:r,url:a})),d=t.performance.now(),m(e));var y=()=>{p.removeEventListener("readystatechange",b),p.removeEventListener("error",y),p.removeEventListener("abort",y),p.removeEventListener("timeout",y)},b=()=>{if(p.readyState===p.DONE){y(),h=t.performance.now();var i={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(g.responseHeaders=i),ta({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(g.responseBody=na({body:p.response,options:r,url:a})),ra(t,"xmlhttprequest",v.url,d,h).then((t=>{var r=oa({entry:t,method:o,status:null==p?void 0:p.status,networkRequest:g,start:d,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};p.addEventListener("readystatechange",b),p.addEventListener("error",y),p.addEventListener("abort",y),p.addEventListener("timeout",y),s.call(p,o,a.toString(),l,u,c)}));return()=>{s()}}(s,t,n),l=da(s,t,n)),ha=()=>{o(),a(),l(),ha=null}}var va=e=>({name:"rrweb/network@1",observer:pa,options:e});os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hr,getRecordNetworkPlugin:va},os.__PosthogExtensions__.rrweb={record:Bt,version:"v2"},os.rrweb={record:Bt,version:"v2"},os.rrwebConsoleRecord={getRecordConsolePlugin:Hr},os.getRecordNetworkPlugin=va;var ga,fa,_a,ma,ya,ba,wa,Sa,Ca,Ia,ka,Ea,xa={},Ta=[],Ma=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ra=Array.isArray;function Aa(e,t){for(var r in t)e[r]=t[r];return e}function Pa(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function La(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?ga.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return Na(e,o,i,n,null)}function Na(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++_a:n,__i:-1,__u:0};return null==n&&null!=fa.vnode&&fa.vnode(s),s}function Oa(e){return e.children}function Fa(e,t){this.props=e,this.context=t}function Da(e,t){if(null==t)return e.__?Da(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Da(e):null}function Ha(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Ha(e)}}function Ba(e){(!e.__d&&(e.__d=!0)&&ma.push(e)&&!$.__r++||ya!=fa.debounceRendering)&&((ya=fa.debounceRendering)||ba)($)}function $(){for(var e,t,r,i,n,s,o,a=1;ma.length;)ma.length>a&&ma.sort(wa),e=ma.shift(),a=ma.length,e.__d&&(r=void 0,i=void 0,n=(i=(t=e).__v).__e,s=[],o=[],t.__P&&((r=Aa({},i)).__v=i.__v+1,fa.vnode&&fa.vnode(r),za(t.__P,r,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Da(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Ga(s,r,o),i.__e=i.__=null,r.__e!=n&&Ha(r)));$.__r=0}function qa(e,t,r,i,n,s,o,a,l,u,c){var d,h,p,v,g,f,_,m=i&&i.__k||Ta,y=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,c=r.length,d=c,h=0;for(e.__k=new Array(n),s=0;s<n;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=Na(null,o,null,null,null):Ra(o)?o=e.__k[s]=Na(Oa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=Na(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+h,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=Va(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>c?h--:n<c&&h++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;s<c;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Da(a)),Ka(a,a));return i}(r,t,m,l,y),d=0;d<y;d++)null!=(p=r.__k[d])&&(h=-1==p.__i?xa:m[p.__i]||xa,p.__i=d,f=za(e,p,h,n,s,o,a,l,u,c),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Xa(h.ref,null,p),c.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),(_=!!(4&p.__u))||h.__k===p.__k?l=Ua(p,l,e,_):"function"==typeof p.type&&void 0!==f?l=f:v&&(l=v.nextSibling),p.__u&=-7);return r.__e=g,l}function Ua(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=e,t=Ua(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=Da(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Va(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],c=null!=u&&0==(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return r;if(i>(c?1:0))for(n=r-1,s=r+1;n>=0||s<t.length;)if(null!=(u=t[o=n>=0?n--:s++])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function ja(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Ma.test(t)?r:r+"px"}function $a(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||ja(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||ja(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(Sa,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r.u=i.u:(r.u=Ca,e.addEventListener(t,s?ka:Ia,s)):e.removeEventListener(t,s?ka:Ia,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Wa(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=Ca++;else if(t.t<r.u)return;return r(fa.event?fa.event(t):t)}}}function za(e,t,r,i,n,s,o,a,l,u){var c,d,h,p,v,g,f,_,m,y,b,$,w,S,C,I,k,E=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(c=fa.__b)&&c(t);e:if("function"==typeof E)try{if(_=t.props,m="prototype"in E&&E.prototype.render,y=(c=E.contextType)&&i[c.__c],b=c?y?y.props.value:c.__:i,r.__c?f=(d=t.__c=r.__c).__=d.__E:(m?t.__c=d=new E(_,b):(t.__c=d=new Fa(_,b),d.constructor=E,d.render=Ja),y&&y.sub(d),d.state||(d.state={}),d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),m&&null==d.__s&&(d.__s=d.state),m&&null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Aa({},d.__s)),Aa(d.__s,E.getDerivedStateFromProps(_,d.__s))),p=d.props,v=d.state,d.__v=t,h)m&&null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),m&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(m&&null==E.getDerivedStateFromProps&&_!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,b),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,b)){for(t.__v!=r.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),$=0;$<d._sb.length;$++)d.__h.push(d._sb[$]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,b),m&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=b,d.props=_,d.__P=e,d.__e=!1,w=fa.__r,S=0,m){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(i=Aa(Aa({},i),d.getChildContext())),m&&!h&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,v)),I=c,null!=c&&c.type===Oa&&null==c.key&&(I=Ya(c.props.children)),a=qa(e,Ra(I)?I:[I],t,r,i,n,s,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),f&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(k=s.length;k--;)Pa(s[k]);Za(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Za(t);fa.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=function(e,t,r,i,n,s,o,a,l){var u,c,d,h,p,v,g,f=r.props||xa,_=t.props,m=t.type;if("svg"==m?n="http://www.w3.org/2000/svg":"math"==m?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!m&&(m?p.localName==m:3==p.nodeType)){e=p,s[u]=null;break}if(null==e){if(null==m)return document.createTextNode(_);e=document.createElementNS(n,m,_.is&&_),a&&(fa.__m&&fa.__m(t,s),a=!1),s=null}if(null==m)f===_||a&&e.data==_||(e.data=_);else{if(s=s&&ga.call(e.childNodes),!a&&null!=s)for(f={},u=0;u<e.attributes.length;u++)f[(p=e.attributes[u]).name]=p.value;for(u in f)if(p=f[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=p;else if(!(u in _)){if("value"==u&&"defaultValue"in _||"checked"==u&&"defaultChecked"in _)continue;$a(e,u,null,p,n)}for(u in _)p=_[u],"children"==u?h=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?v=p:"checked"==u?g=p:a&&"function"!=typeof p||f[u]===p||$a(e,u,p,f[u],n);if(c)a||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),qa("template"==t.type?e.content:e,Ra(h)?h:[h],t,r,i,"foreignObject"==m?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Da(r,0),a,l),null!=s)for(u=s.length;u--;)Pa(s[u]);a||(u="value","progress"==m&&null==v?e.removeAttribute("value"):null!=v&&(v!==e[u]||"progress"==m&&!v||"option"==m&&v!=f[u])&&$a(e,u,v,f[u],n),u="checked",null!=g&&g!=e[u]&&$a(e,u,g,f[u],n))}return e}(r.__e,t,r,i,n,s,o,l,u);return(c=fa.diffed)&&c(t),128&t.__u?void 0:a}function Za(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Za)}function Ga(e,t,r){for(var i=0;i<r.length;i++)Xa(r[i],r[++i],r[++i]);fa.__c&&fa.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){fa.__e(e,t.__v)}}))}function Ya(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Ra(e)?e.map(Ya):Aa({},e)}function Xa(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){fa.__e(e,r)}}function Ka(e,t,r){var i,n;if(fa.unmount&&fa.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Xa(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){fa.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Ka(i[n],t,r||"function"!=typeof e.type);r||Pa(e.__e),e.__c=e.__=e.__e=void 0}function Ja(e,t,r){return this.constructor(e,r)}function Qa(e,t,r){var i,n,s;t==document&&(t=document.documentElement),fa.__&&fa.__(e,t),i=!1?null:t.__k,n=[],s=[],za(t,e=t.__k=La(Oa,null,[e]),i||xa,xa,t.namespaceURI,i?null:t.firstChild?ga.call(t.childNodes):null,n,i?i.__e:t.firstChild,false,s),Ga(n,e,s)}function el(e,t,r){var i,n,s,o,a=Aa({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?ga.call(arguments,2):r),Na(e.type,a,i||e.key,n||e.ref,null)}ga=Ta.slice,fa={__e:function(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},_a=0,Fa.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Aa({},this.state),"function"==typeof e&&(e=e(Aa({},r),this.props)),e&&Aa(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ba(this))},Fa.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ba(this))},Fa.prototype.render=Oa,ma=[],ba="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wa=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,Sa=/(PointerCapture)$|Capture$/i,Ca=0,Ia=Wa(!1),ka=Wa(!0),Ea=0;var tl,rl,il,nl,sl=0,ol=[],al=fa,ll=al.__b,ul=al.__r,cl=al.diffed,dl=al.__c,hl=al.unmount,pl=al.__;function vl(e,t){al.__h&&al.__h(rl,e,sl||t),sl=0;var r=rl.__H||(rl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function gl(e){return sl=1,function(e,t,r){var i=vl(tl++,2);if(i.t=e,!i.__c&&(i.__=[El(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=rl,!rl.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!s||s.call(this,e,t,r);var o=i.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s&&s.call(this,e,t,r)||o};rl.__f=!0;var s=rl.shouldComponentUpdate,o=rl.componentWillUpdate;rl.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,n(e,t,r),s=i}o&&o.call(this,e,t,r)},rl.shouldComponentUpdate=n}return i.__N||i.__}(El,e)}function fl(e,t){var r=vl(tl++,3);!al.__s&&kl(r.__H,t)&&(r.__=e,r.u=t,rl.__H.__h.push(r))}function _l(e){return sl=5,ml((function(){return{current:e}}),[])}function ml(e,t){var r=vl(tl++,7);return kl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function yl(e){var t=rl.context[e.__c],r=vl(tl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(rl)),t.props.value):e.__}function bl(){for(var e;e=ol.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Cl),e.__H.__h.forEach(Il),e.__H.__h=[]}catch(t){e.__H.__h=[],al.__e(t,e.__v)}}al.__b=function(e){rl=null,ll&&ll(e)},al.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pl&&pl(e,t)},al.__r=function(e){ul&&ul(e),tl=0;var t=(rl=e.__c).__H;t&&(il===rl?(t.__h=[],rl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Cl),t.__h.forEach(Il),t.__h=[],tl=0)),il=rl},al.diffed=function(e){cl&&cl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ol.push(t)&&nl===al.requestAnimationFrame||((nl=al.requestAnimationFrame)||Sl)(bl)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),il=rl=null},al.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Cl),e.__h=e.__h.filter((function(e){return!e.__||Il(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],al.__e(r,e.__v)}})),dl&&dl(e,t)},al.unmount=function(e){hl&&hl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Cl(e)}catch(e){t=e}})),r.__H=void 0,t&&al.__e(t,r.__v))};var wl="function"==typeof requestAnimationFrame;function Sl(e){var t,r=function(){clearTimeout(i),wl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);wl&&(t=requestAnimationFrame(r))}function Cl(e){var t=rl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),rl=t}function Il(e){var t=rl;e.__c=e.__(),rl=t}function kl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function El(e,t){return"function"==typeof t?t(e):t}var xl=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({}),Tl=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),Ml=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),Rl=function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e}({}),Al=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),Pl=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Ll=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),Nl=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),Ol=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({}),Fl=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e}({}),Dl=function(e){return e.Popover="popover",e.Inline="inline",e}({}),Hl=hs("[Surveys]");function Bl(e){return!(!e.start_date||e.end_date)}function ql(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Ul(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Vl="seenSurvey_",jl="inProgressSurvey_",$l=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},Wl=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},zl=e=>Wl(Vl,e),Zl=e=>{localStorage.getItem(zl(e))||localStorage.setItem(zl(e),"true")},Gl=[Al.Popover,Al.Widget,Al.API],Yl={ignoreConditions:!1,ignoreDelay:!1,displayType:Dl.Popover};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return ai(e)&&isFinite(e)&&Math.floor(e)===e});var Xl="0123456789abcdef";class Kl{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||t<0||r<0||i<0||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,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 Kl(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Xl.charAt(this.bytes[t]>>>4)+Xl.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Kl(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Jl{constructor(){this._timestamp=0,this._counter=0,this._random=new tu}generate(){var e=this.generateOrAbort();if(ri(e)){this._timestamp=0;var t=this.generateOrAbort();if(ri(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(!(e+1e4>this._timestamp))return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return Kl.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}}var Ql,eu=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Gn&&!ri(Gn.crypto)&&crypto.getRandomValues&&(eu=e=>crypto.getRandomValues(e));class tu{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._cursor>=this._buffer.length&&(eu(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var ru=()=>iu().toString(),iu=()=>(Ql||(Ql=new Jl)).generate(),nu=["fatal","error","warning","log","info","debug"],su=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),ou=Uint8Array,au=Uint16Array,lu=Uint32Array,uu=new ou([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]),cu=new ou([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]),du=new ou([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hu=function(e,t){for(var r=new au(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];var n=new lu(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},pu=hu(uu,2),vu=pu[0],gu=pu[1];vu[28]=258,gu[258]=28;for(var fu=hu(cu,0)[1],_u=new au(32768),mu=0;mu<32768;++mu){var yu=(43690&mu)>>>1|(21845&mu)<<1;yu=(61680&(yu=(52428&yu)>>>2|(13107&yu)<<2))>>>4|(3855&yu)<<4,_u[mu]=((65280&yu)>>>8|(255&yu)<<8)>>>1}var bu=function(e,t,r){for(var i=e.length,n=0,s=new au(t);n<i;++n)++s[e[n]-1];var o,a=new au(t);for(n=0;n<t;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new au(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],d=a[e[n]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)o[_u[d]>>>l]=u}else for(o=new au(i),n=0;n<i;++n)o[n]=_u[a[e[n]-1]++]>>>15-e[n];return o},wu=new ou(288);for(mu=0;mu<144;++mu)wu[mu]=8;for(mu=144;mu<256;++mu)wu[mu]=9;for(mu=256;mu<280;++mu)wu[mu]=7;for(mu=280;mu<288;++mu)wu[mu]=8;var Su=new ou(32);for(mu=0;mu<32;++mu)Su[mu]=5;var Cu=bu(wu,9,0),Iu=bu(Su,5,0),ku=function(e){return(e/8>>0)+(7&e&&1)},Eu=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof au?au:e instanceof lu?lu:ou)(r-t);return i.set(e.subarray(t,r)),i},xu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8},Tu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},Mu=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new ou(0),0];if(1==n){var o=new ou(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=n-1;)a=r[r[u].f<r[d].f?u++:d++],l=r[u!=c&&r[u].f<r[d].f?u++:d++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(i=1;i<n;++i)s[i].s>h&&(h=s[i].s);var p=new au(h+1),v=Ru(r[c-1],p,0);if(v>t){i=0;var g=0,f=v-t,_=1<<f;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<n;++i){var m=s[i].s;if(!(p[m]>t))break;g+=_-(1<<v-p[m]),p[m]=t}for(g>>>=f;g>0;){var y=s[i].s;p[y]<t?g-=1<<t-p[y]++-1:++i}for(;i>=0&&g;--i){var b=s[i].s;p[b]==t&&(--p[b],++g)}v=t}return[new ou(p),v]},Ru=function(e,t,r){return-1==e.s?Math.max(Ru(e.l,t,r+1),Ru(e.r,t,r+1)):t[e.s]=r},Au=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new au(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++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=e[a]}return[r.subarray(0,i),t]},Pu=function(e,t){for(var r=0,i=0;i<t.length;++i)r+=e[i]*t[i];return r},Lu=function(e,t,r){var i=r.length,n=ku(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;s<i;++s)e[n+s+4]=r[s];return 8*(n+4+i)},Nu=function(e,t,r,i,n,s,o,a,l,u,c){xu(t,c++,r),++n[256];for(var d=Mu(n,15),h=d[0],p=d[1],v=Mu(s,15),g=v[0],f=v[1],_=Au(h),m=_[0],y=_[1],b=Au(g),w=b[0],S=b[1],C=new au(19),I=0;I<m.length;++I)C[31&m[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=Mu(C,7),E=k[0],x=k[1],T=19;T>4&&!E[du[T-1]];--T);var M,R,A,P,L=u+5<<3,N=Pu(n,wu)+Pu(s,Su)+o,O=Pu(n,h)+Pu(s,g)+o+14+3*T+Pu(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(L<=N&&L<=O)return Lu(t,c,e.subarray(l,l+u));if(xu(t,c,1+(O<N)),c+=2,O<N){M=bu(h,p,0),R=h,A=bu(g,f,0),P=g;var F=bu(E,x,0);xu(t,c,y-257),xu(t,c+5,S-1),xu(t,c+10,T-4),c+=14;for(I=0;I<T;++I)xu(t,c+3*I,E[du[I]]);c+=3*T;for(var D=[m,w],H=0;H<2;++H){var B=D[H];for(I=0;I<B.length;++I){var q=31&B[I];xu(t,c,F[q]),c+=E[q],q>15&&(xu(t,c,B[I]>>>5&127),c+=B[I]>>>12)}}}else M=Cu,R=wu,A=Iu,P=Su;for(I=0;I<a;++I)if(i[I]>255){q=i[I]>>>18&31;Tu(t,c,M[q+257]),c+=R[q+257],q>7&&(xu(t,c,i[I]>>>23&31),c+=uu[q]);var U=31&i[I];Tu(t,c,A[U]),c+=P[U],U>3&&(Tu(t,c,i[I]>>>5&8191),c+=cu[U])}else Tu(t,c,M[i[I]]),c+=R[i[I]];return Tu(t,c,M[256]),c+R[256]},Ou=new lu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fu=function(){for(var e=new lu(256),t=0;t<256;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Du=function(e,t,r,i,n){return function(e,t,r,i,n,s){var o=e.length,a=new ou(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d<o?u=Lu(l,u,e.subarray(c,d)):(l[c]=s,u=Lu(l,u,e.subarray(c,o)))}else{for(var h=Ou[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,f=new au(32768),_=new au(g+1),m=Math.ceil(r/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new lu(25e3),S=new au(288),C=new au(32),I=0,k=0,E=(c=0,0),x=0,T=0;c<o;++c){var M=b(c),R=32767&c,A=_[M];if(f[R]=A,_[M]=R,x<=c){var P=o-c;if((I>7e3||E>24576)&&P>423){u=Nu(e,l,0,w,S,C,k,E,T,c-T,u),E=I=k=0,T=c;for(var L=0;L<286;++L)S[L]=0;for(L=0;L<30;++L)C[L]=0}var N=2,O=0,F=v,D=R-A&32767;if(P>2&&M==b(c-D))for(var H=Math.min(p,P)-1,B=Math.min(32767,c),q=Math.min(258,P);D<=B&&--F&&R!=A;){if(e[c+N]==e[c+N-D]){for(var U=0;U<q&&e[c+U]==e[c+U-D];++U);if(U>N){if(N=U,O=D,U>H)break;var V=Math.min(D,U-2),j=0;for(L=0;L<V;++L){var W=c-D+L+32768&32767,z=W-f[W]+32768&32767;z>j&&(j=z,A=W)}}}D+=(R=A)-(A=f[R])+32768&32767}if(O){w[E++]=268435456|gu[N]<<18|fu[O];var Z=31&gu[N],G=31&fu[O];k+=uu[Z]+cu[G],++S[257+Z],++C[G],x=c+N,++I}else w[E++]=e[c],++S[e[c]]}}u=Nu(e,l,s,w,S,C,k,E,T,c-T,u)}return Eu(a,0,i+ku(u)+n)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i,!0)},Hu=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Bu(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p:function(t){for(var r=e,i=0;i<t.length;++i)r=Fu[255&r^t[i]]^r>>>8;e=r},d:function(){return 4294967295^e}}}(),i=e.length;r.p(e);var n=Du(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),s=n.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Hu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;i<=r.length;++i)e[i+10]=r.charCodeAt(i)}}(n,t),Hu(n,s-8,r.d()),Hu(n,s-4,i),n}var qu=function(e){var t,r,i,n,s="";for(t=r=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var o=e.charCodeAt(n),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),si(a)||(r>t&&(s+=e.substring(t,r)),s+=a,t=r=n+1)}return r>t&&(s+=e.substring(t,e.length)),s},Uu=!!is||!!rs,Vu="text/plain",ju=function(e,t,i){var n;void 0===i&&(i=!0);var[s,o]=e.split("?"),a=r({},t),l=null!==(n=null==o?void 0:o.split("&").map((e=>{var t,[r,n]=e.split("="),s=i&&null!==(t=a[r])&&void 0!==t?t:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],u=Ts(a);return u&&l.push(u),s+"?"+l.join("&")},$u=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Wu=e=>{var{data:t,compression:r}=e;if(t){if(r===su.GZipJS){var i=Bu(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new ou(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;o<r;++o){if(n+5>i.length){var a=new ou(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.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 Eu(i,0,n)}($u(t)),{mtime:0}),n=new Blob([i],{type:Vu});return{contentType:Vu,body:n,estimatedSize:n.size}}if(r===su.Base64){var s=function(e){var t,r,i,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!e)return e;e=qu(e);do{t=(s=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,c[l++]=o.charAt(t)+o.charAt(r)+o.charAt(i)+o.charAt(n)}while(a<e.length);switch(u=c.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}($u(t)),o=(e=>"data="+encodeURIComponent("string"==typeof e?e:$u(e)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=$u(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},zu=[];rs&&zu.push({transport:"fetch",method:e=>{var t,i,{contentType:n,body:s,estimatedSize:o}=null!==(t=Wu(e))&&void 0!==t?t:{},a=new Headers;gs(e.headers,(function(e,t){a.append(t,e)})),n&&a.append("Content-Type",n);var l=e.url,u=null;if(ns){var c=new ns;u={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}rs(l,r({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(o||0)<52428.8,body:s,signal:null==(i=u)?void 0:i.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){ds.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{ds.error(t),null==e.callback||e.callback({statusCode:0,error:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),is&&zu.push({transport:"XHR",method:e=>{var t,r=new is;r.open(e.method||"GET",e.url,!0);var{contentType:i,body:n}=null!==(t=Wu(e))&&void 0!==t?t:{};gs(e.headers,(function(e,t){r.setRequestHeader(t,e)})),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(n)}}),null!=Qn&&Qn.sendBeacon&&zu.push({transport:"sendBeacon",method:e=>{var t=ju(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Wu(e))&&void 0!==r?r:{},s="string"==typeof n?new Blob([n],{type:i}):n;Qn.sendBeacon(t,s)}catch(e){}}});var Zu=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Gu(e,t,r){return $u({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Yu={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Zu(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Zu(t,e))))),icontains:(e,t)=>t.map(Xu).some((t=>e.map(Xu).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Xu).every((t=>e.map(Xu).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},Xu=e=>e.toLowerCase();function Ku(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(ri(n)||si(n))return!1;var s=[String(n)],o=Yu[i.operator];return!!o&&o(i.values,s)}))}var Ju=hs("[Stylesheet Loader]"),Qu=Gn,ec=es;function tc(e){return"$survey_response_"+e}var rc="#020617",ic={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:Ml.Right,widgetType:Tl.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:rc,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function nc(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function sc(e){var t;void 0===e&&(e=ic.backgroundColor),"#"===e[0]&&(t=nc(e)),e.startsWith("rgb")&&(t=e);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"}[e.toLowerCase()];if(r&&(t=nc(r)),!t)return rc;var i=t.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?rc:"white"}return rc}function oc(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=t,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Ju.error("prepare_external_dependency_stylesheet returned null"),null)})(ec,':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}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) 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:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.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)}.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)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var ac=(e,t,i)=>{var n=Tc(e),s=ec.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=ec.createElement("div");((e,t,i)=>{var n=r({},ic,i),s=e.style,o=![Ml.Center,Ml.Left,Ml.Right].includes(n.position)||t===Al.Widget&&(null==i?void 0:i.widgetType)===Tl.Tab;s.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(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)||sc(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",sc(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||sc(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",sc(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)||sc(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,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=oc(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return ec.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},lc=(e,t)=>{if(!t)return null;var r=e[tc(t)];return Kr(r)?[...r]:r},uc=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=e;s?(Zl(i),s.capture(Ol.SENT,r({[Fl.SURVEY_NAME]:i.name,[Fl.SURVEY_ID]:i.id,[Fl.SURVEY_ITERATION]:i.current_iteration,[Fl.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Fl.SURVEY_QUESTIONS]:i.questions.map((e=>({id:e.id,question:e.question,response:lc(t,e.id)}))),[Fl.SURVEY_SUBMISSION_ID]:n,[Fl.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},t,a,{$set:{[$l(i,"responded")]:!0}})),o&&(Qu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),xc(i))):Hl.error("[survey sent] event not captured, PostHog instance not found.")},cc=e=>Object.values((null==e?void 0:e.responses)||{}).filter((e=>!oi(e))).length>0,dc=(e,t,i)=>r({[Fl.SURVEY_NAME]:e.name,[Fl.SURVEY_ID]:e.id,[Fl.SURVEY_ITERATION]:e.current_iteration,[Fl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Fl.SURVEY_PARTIALLY_COMPLETED]:cc(t),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==t?void 0:t.responses,{[Fl.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId,[Fl.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:lc((null==t?void 0:t.responses)||{},e.id)})))}),hc=(e,t,i)=>{if(t){if(!i){var n=kc(e);t.capture(Ol.DISMISSED,r({},dc(e,n,t),{$set:{[$l(e,"dismissed")]:!0}})),xc(e),Zl(e),Qu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Hl.error("[survey dismissed] event not captured, PostHog instance not found.")},pc=(e,t)=>{if(t){var r=(e=>Wl("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=kc(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Ol.ABANDONED,dc(e,i,t),{transport:"sendBeacon"})}}else Hl.error("[survey abandoned] event not captured, PostHog instance not found.")},vc=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),gc=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,fc=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?gc(e.questions,vc(e.questions)):e.questions,_c=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===Nl.Always||Ec(e)},mc=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Ba(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Ea++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:"",properties:void 0}),yc=()=>yl(mc),bc=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return el(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function wc(e){return null!=e?e:"icontains"}function Sc(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==Qu||null==(r=Qu.location)?void 0:r.href;if(!n)return!1;var s=[e.conditions.url],o=wc(null==(i=e.conditions)?void 0:i.urlMatchType);return Yu[o](s,[n])}var Cc=e=>{var t=""+jl+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+jl+e.id+"_"+e.current_iteration),t},Ic=(e,t)=>{try{localStorage.setItem(Cc(e),JSON.stringify(t))}catch(e){Hl.error("Error setting in-progress survey state in localStorage",e)}},kc=e=>{try{var t=localStorage.getItem(Cc(e));if(t)return JSON.parse(t)}catch(e){Hl.error("Error getting in-progress survey state from localStorage",e)}return null},Ec=e=>{var t=kc(e);return!oi(null==t?void 0:t.surveySubmissionId)},xc=e=>{try{localStorage.removeItem(Cc(e))}catch(e){Hl.error("Error clearing in-progress survey state from localStorage",e)}};function Tc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Mc(e,t,r){if(void 0===t&&(t=Ml.Right),e===Al.ExternalSurvey)return{};switch(t){case Ml.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ml.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ml.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ml.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ml.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ml.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ml.Left:return{left:"30px"};case Ml.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Ml.Right:return{right:e===Al.Widget&&r===Tl.Tab?"60px":"30px"}}}var Rc=0;function Ac(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rc,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return fa.vnode&&fa.vnode(u),u}var Pc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Lc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Nc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Oc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Fc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Dc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ac("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"})}),Hc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ac("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"})}),Bc=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return Ac("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ac("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ac("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:t})]})},qc=Ac("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ac("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ac("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ac("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ac("g",{mask:"url(#mask0_2415_6911)",children:[Ac("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"}),Ac("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"}),Ac("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"}),Ac("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"}),Ac("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"}),Ac("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"})]})]}),Ac("defs",{children:Ac("clipPath",{id:"clip0_2415_6911",children:Ac("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Uc(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Ac("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",qc]})}function Vc(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=e,{isPreviewMode:l}=yl(mc);return Ac("div",{className:"bottom-section",children:[!a&&Ac("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==Gn||Gn.open(s)),l?null==o||o():n()},children:t}),!i.whiteLabel&&Ac(Uc,{urlParams:{utm_source:"survey-footer"}})]})}function jc(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return Ac("div",{class:"question-header",children:[Ac(t.type===Pl.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&bc({component:La("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function $c(e){var{onClick:t}=e,{isPreviewMode:r}=yl(mc);return Ac("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Bc({fill:"black"})})}Ac("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ac("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 Wc=Gn;function zc(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=yl(mc);return fl((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Es(Wc,"keydown",e),()=>{Wc.removeEventListener("keydown",e)}}),[o]),Ac("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ac($c,{onClick:()=>o()}),Ac("h3",{className:"thank-you-message-header",children:t}),r&&bc({component:La("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Ac(Vc,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Zc=e=>Kr(e)&&e.every((e=>ii(e)));function Gc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=e,{isPreviewMode:l}=yc(),u=_l(null),[c,d]=gl((()=>ii(a)?a:""));fl((()=>{setTimeout((()=>{var e;l||(null==(e=u.current)||e.focus())}),100)}),[l]);var h="surveyQuestion"+o,p=ml((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case Br.MinLength:if(void 0!==o.value&&s.length<o.value)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Br.MaxLength: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}(c,t.validation,t.optional)),[c,t.validation,t.optional]),v=Ur(t.validation,Br.MinLength),g=Ur(t.validation,Br.MaxLength),f=ml((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(v,g)),[v,g]);return Ac(Oa,{children:[Ac("div",{className:"question-container",children:[Ac(jc,{question:t,forceDisableHtml:r,htmlFor:h}),Ac("textarea",{ref:u,id:h,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:v,maxLength:g,onInput:e=>{d(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:c}),f&&Ac("div",{className:"validation-hint",children:f})]}),Ac(Vc,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:i,onSubmit:()=>{p||n(c.trim())},onPreviewSubmit:()=>{p||s(c.trim())}})]})}function Yc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=e;return Ac(Oa,{children:[Ac("div",{className:"question-container",children:Ac(jc,{question:t,forceDisableHtml:r})}),Ac(Vc,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Xc(e){var t,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=r.scale,c=10===r.scale?0:1,[d,h]=gl((()=>ai(l)?l:Kr(l)&&l.length>0&&ai(parseInt(l[0]))?parseInt(l[0]):ii(l)&&ai(parseInt(l))?parseInt(l):null)),p="emoji"===r.display&&2===r.scale,{isPreviewMode:v}=yc(),g=e=>v?a(e):o(e);return Ac(Oa,{children:[Ac("div",{className:"question-container",children:[Ac(jc,{question:r,forceDisableHtml:i}),Ac("div",{className:"rating-section",children:[Ac("div",{className:"rating-options",children:["emoji"===r.display&&Ac("div",{className:"rating-options-emoji"+(p?" rating-options-emoji-2":""),children:null==(t=rd[r.scale])?void 0:t.map(((e,t)=>Ac("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===d?"rating-active":""),value:t+1,type:"button",onClick:()=>{var e=t+1;h(e),r.skipSubmitButton&&g(e)},children:e},t)))}),"number"===r.display&&Ac("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-c+1)+", minmax(0, 1fr))"},children:id(r.scale).map(((e,t)=>Ac(Kc,{displayQuestionIndex:n,active:d===e,appearance:s,num:e,setActiveNumber:e=>{h(e),r.skipSubmitButton&&g(e)}},t)))})]}),!p&&Ac("div",{className:"rating-text",children:[Ac("div",{children:r.lowerBoundLabel}),Ac("div",{children:r.upperBoundLabel})]})]})]}),Ac(Vc,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:si(d)&&!r.optional,appearance:s,onSubmit:()=>o(d),onPreviewSubmit:()=>a(d),skipSubmitButton:r.skipSubmitButton})]})}function Kc(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return Ac("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(t)},children:t})}function Jc(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=_l(null),c=ml((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=gc(t,vc(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[d,h]=gl((()=>((e,t)=>ii(e)||Zc(e)?e:t===Pl.SingleChoice?null:[])(l,t.type))),[p,v]=gl((()=>((e,t)=>{if(ii(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Zc(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:g}=yc(),f=t.type===Pl.SingleChoice,_=t.type===Pl.MultipleChoice,m=t.skipSubmitButton&&f&&!t.hasOpenChoice,y=(e,t)=>{if(t){var i=!p.isSelected;return v((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),f&&h(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(f)return h(e),v((e=>r({},e,{isSelected:!1,inputValue:""}))),void(m&&(o(e),g&&a(e)));_&&Kr(d)&&(d.includes(e)?h(d.filter((t=>t!==e))):h([...d,e]))},b=e=>{e.stopPropagation();var t=e.currentTarget.value;v((e=>r({},e,{inputValue:t}))),f&&h(t)},w=e=>{e.stopPropagation(),"Enter"!==e.key||S()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),v((e=>r({},e,{isSelected:!1,inputValue:""}))),f&&h(null))},S=()=>!t.optional&&(!!si(d)||(!(!Kr(d)||p.isSelected||0!==d.length)||!(!p.isSelected||""!==p.inputValue.trim()))),C=()=>{p.isSelected&&_?Kr(d)&&(g?a([...d,p.inputValue]):o([...d,p.inputValue])):g?a(d):o(d)};return Ac(Oa,{children:[Ac("div",{className:"question-container",children:[Ac(jc,{question:t,forceDisableHtml:i}),Ac("fieldset",{className:"multiple-choice-options limit-height",children:[Ac("legend",{className:"sr-only",children:_?" Select all that apply":" Select one"}),c.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?p.isSelected:f?d===e:Kr(d)&&d.includes(e);return Ac("label",{className:i?"choice-option-open":"",children:[Ac("div",{className:"response-choice",children:[Ac("input",{type:f?"radio":"checkbox",name:s,checked:a,onChange:()=>y(e,i),id:s,"aria-controls":o}),Ac("span",{children:i?e+":":e})]}),i&&Ac("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:p.inputValue,onKeyDown:w,onInput:b,onClick:t=>{p.isSelected||y(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Ac(Vc,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:m})]})}var Qc=[1,2,3,4,5],ed=[1,2,3,4,5,6,7],td=[0,1,2,3,4,5,6,7,8,9,10],rd={2:[Dc,Hc],3:[Nc,Lc,Pc],5:[Oc,Nc,Lc,Pc,Fc]};function id(e){switch(e){case 5:default:return Qc;case 7:return ed;case 10:return td}}var nd=hs("[Surveys]");function sd(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?Ll.End:s;if(n.branching.type===Ll.End)return Ll.End;if(n.branching.type===Ll.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Ll.ResponseBased){if(n.type===Pl.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===Ll.End?Ll.End:s}}else if(n.type===Pl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(e<1||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}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(c)){var d=n.branching.responseValues[c];return Number.isInteger(d)?d:d===Ll.End?Ll.End:s}}return s}return nd.warn("Falling back to next question index due to unexpected branching type"),s}var od=Gn,ad=es,ld="ph:show_survey_widget",ud="PHWidgetSurveyClickListener",cd=250,dd=20,hd=12;function pd(e,t){try{var r=e.getBoundingClientRect(),i=od.innerHeight,n=od.innerWidth,s=cd,o=r.left+r.width/2-t/2;o+t>n-dd&&(o=n-t-dd),o<dd&&(o=dd);var a=hd,l=i-r.bottom,u=r.top,c=l<s&&u>l;return{position:"fixed",top:c?"auto":r.bottom+a+"px",left:o+"px",right:"auto",bottom:c?i-r.top+a+"px":"auto",zIndex:ic.zIndex}}catch(e){return Hl.warn("Failed to calculate trigger position:",e),null}}class vd{constructor(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._prefillHandledSurveys=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(eo);if(e)for(var t of e)Ec(t)&&pc(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,a=null!=t&&t.position||null!=t&&t.selector?r({},e,{appearance:r({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e;this._clearSurveyTimeout(a.id);var{properties:l,initialResponses:u}=null!=t?t:{},c=!!(u&&Object.keys(u).length>0)&&this._handleInitialResponses(a,u,l);if(!c||null!=(i=a.appearance)&&i.displayThankYouMessage){this._addSurveyToFocus(a);var d={};if((null==(n=a.appearance)?void 0:n.position)===Ml.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var h,p=ad.querySelector(a.appearance.widgetSelector);if(p)d=pd(p,parseInt((null==(h=a.appearance)?void 0:h.maxWidth)||ic.maxWidth))||{}}var v=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:g}=ac(a,this._posthog),f={posthog:this._posthog,survey:a,removeSurveyFromFocus:this._removeSurveyFromFocus,properties:l,style:d,isSurveyCompleted:c,skipShownEvent:null==t?void 0:t.skipShownEvent};if(v<=0)return Qa(Ac(md,r({},f)),g);var _=setTimeout((()=>{if(this._surveyTimeouts.delete(a.id),!Sc(a))return this._removeSurveyFromFocus(a);Qa(Ac(md,r({},f,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),g)}),1e3*v);this._surveyTimeouts.set(a.id,_)}},this._handleWidget=e=>{var{shadow:t,isNewlyCreated:r}=ac(e,this._posthog);r&&Qa(Ac(bd,{posthog:this._posthog,survey:e},e.id),t)},this._removeWidgetSelectorListener=e=>{this._removeSurveyFromDom(e);var t=this._widgetSelectorListeners.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(ud),this._widgetSelectorListeners.delete(e.id),Hl.info("Removed click listener for survey "+e.id))},this._manageWidgetSelectorListener=(e,t)=>{var r=ad.querySelector(t),i=this._widgetSelectorListeners.get(e.id);if(r){if(this._handleWidget(e),i){if(r===i.element)return;Hl.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this._removeWidgetSelectorListener(e)}if(!r.hasAttribute(ud)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===Ml.NextToTrigger?pd(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||ic.maxWidth)):{};od.dispatchEvent(new CustomEvent(ld,{detail:{surveyId:e.id,position:n}}))};Es(r,"click",n),r.setAttribute(ud,"true"),this._widgetSelectorListeners.set(e.id,{element:r,listener:n,survey:e}),Hl.info("Attached click listener for feedback button survey "+e.id)}}else i&&this._removeWidgetSelectorListener(e)},this.renderPopover=e=>{var{shadow:t}=ac(e,this._posthog);Qa(Ac(md,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus}),t)},this.renderSurvey=(e,t,r)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this._handleUrlPrefill(e),Qa(Ac(md,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus,isPopup:!1,properties:r}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t._isSurveyConditionMatched(e)&&t._hasActionOrEventTriggeredSurvey(e)&&t._checkFlags(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Al.Popover||e.type===Al.Widget)),i=t._sortSurveysByAppearanceDelay(r),n=new Set;i.forEach((e=>{if(e.type===Al.Widget){var r,i,s,o;if((null==(r=e.appearance)?void 0:r.widgetType)===Tl.Tab)return void t._handleWidget(e);if((null==(i=e.appearance)?void 0:i.widgetType)===Tl.Selector&&null!=(s=e.appearance)&&s.widgetSelector)n.add(e.id),t._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector)}si(t._surveyInFocus)&&e.type===Al.Popover&&t.handlePopoverSurvey(e)})),t._widgetSelectorListeners.forEach((e=>{var{survey:r}=e;n.has(r.id)||t._removeWidgetSelectorListener(r)}))}),e)},this._addSurveyToFocus=e=>{si(this._surveyInFocus)||Hl.error("Survey "+this._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),this._surveyInFocus=e.id},this._removeSurveyFromFocus=e=>{this._surveyInFocus!==e.id&&Hl.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this._clearSurveyTimeout(e.id),this._surveyInFocus=null,this._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null}_clearSurveyTimeout(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))}cancelSurvey(e){this._surveyTimeouts.has(e)&&(Hl.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null))}_sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var r,i,n=Ec(e),s=Ec(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===Nl.Always,a=t.schedule===Nl.Always;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}_handleUrlPrefill(e){if(!this._prefillHandledSurveys.has(e.id)){var{params:t}=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!ri(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(od.location.search);if(0!==Object.keys(t).length){Hl.info("[Survey Prefill] Detected URL prefill parameters");var r=this._processPrefillData(e,t);if(r){var{responses:i,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=r;(Object.keys(o).length>0&&e.enable_partial_responses||s)&&uc({responses:s?i:o,survey:e,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this._prefillHandledSurveys.add(e.id)}}}}_handleInitialResponses(e,t,r){var i={};for(var[n,s]of Object.entries(t)){i[parseInt(n)]=Kr(s)?s.map(String):[String(s)]}Hl.info("[Survey] Processing initial responses");var o=this._processPrefillData(e,i);if(!o)return!1;var{responses:a,submissionId:l,isSurveyCompleted:u}=o;return uc({responses:a,survey:e,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:u,properties:r}),u}_processPrefillData(e,t){try{var r=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=tc(e.id);try{switch(e.type){case Pl.SingleChoice:if(!e.choices||0===e.choices.length)return void ds.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=e.choices.length)return void ds.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Pl.MultipleChoice:if(!e.choices||0===e.choices.length)return void ds.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&t<e.choices.length));if(0===a.length)return void ds.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];l.length<a.length&&ds.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Pl.Rating:var u=parseInt(n[0],10),c=e.scale||10;if(isNaN(u)||u<0||u>c)return void ds.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+c+")");r[s]=u;break;default:ds.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){ds.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(r).length)return Hl.warn("[Survey Prefill] No valid responses after conversion"),null;var i=ru(),n=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:s,skippedResponses:o}=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;i<e.questions.length&&0<s&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=tc(o.id);ri(r[a])||(n[a]=r[a])}var l=sd(e,i,o.id?r[tc(o.id)]:null);if(l===Ll.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,n,r),a=s>=e.questions.length;return Ic(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:s}),Hl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(e){return Hl.error("[Survey Prefill] Error handling prefill:",e),null}}_isSurveyFeatureFlagEnabled(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}),i=!0;t&&(i=this._posthog.featureFlags.getFeatureFlag(e,{send_event:!1})===t||"any"===t);return r&&i}_isSurveyConditionMatched(e){return!e.conditions||Sc(e)&&function(e){var t,r,i;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!ss)return!1;var n=bn(ss);return Yu[wc(null==(i=e.conditions)?void 0:i.deviceTypesMatchType)](e.conditions.deviceTypes,[n])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==ec||!ec.querySelector(e.conditions.selector))}(e)}_internalFlagCheckSatisfied(e){return _c(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||Ec(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Bl(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Gl.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this._isSurveyFeatureFlagEnabled(e.linked_flag_key,n)?this._isSurveyFeatureFlagEnabled(e.targeting_flag_key)?this._internalFlagCheckSatisfied(e)?(e=>{var t=localStorage.getItem("lastSeenSurveyDate");if(!e||!t)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(t).getTime());return Math.ceil(i/864e5)>e})(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(e=>!!localStorage.getItem(zl(e))&&!_c(e))(e)?(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="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}_hasActionOrEventTriggeredSurvey(e){var t;if(!ql(e)&&!Ul(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}_checkFlags(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this._isSurveyFeatureFlagEnabled(r)}))}_removeSurveyFromDom(e){try{var t=ad.querySelector(Tc(e,!0));null!=t&&t.shadowRoot&&Qa(null,t.shadowRoot),null==t||t.remove()}catch(t){Hl.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this._addSurveyToFocus,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyInFocus:this._surveyInFocus,surveyTimeouts:this._surveyTimeouts,handleWidget:this._handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this._manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this._sortSurveysByAppearanceDelay,checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this)}}}function gd(e,t){if(ad&&od){var r,i=new vd(e);if(e.config.disable_surveys_automatic_display)return Hl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Hl.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ri(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Es(ad,"visibilitychange",(()=>{ad.hidden?ri(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function fd(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;fl((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var s=()=>{var e,n=t.type===Al.Widget,s=Sc(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===Tl.Tab&&n;if(!s)return Hl.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(Hl.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};Es(od,"popstate",s),Es(od,"hashchange",s);var o=od.history.pushState,a=od.history.replaceState;return od.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t),s()},od.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),s()},()=>{od.removeEventListener("popstate",s),od.removeEventListener("hashchange",s),od.history.pushState=o,od.history.replaceState=a}}}),[n,t,r,i])}function _d(e){switch(void 0===e&&(e=Rl.Right),e){case Rl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Rl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Rl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Rl.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function md(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:p=(()=>{}),isPopup:v=!0,onPreviewSubmit:g=(()=>{}),onPopupSurveyDismissed:f=(()=>{}),onCloseConfirmationMessage:_=(()=>{}),properties:m,isSurveyCompleted:y,skipShownEvent:b}=e,w=_l(null),S=Number.isInteger(h),C=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:I,isSurveySent:k,hidePopupWithViewTransition:E}=function(e,t,r,i,n,s,o,a){var[l,u]=gl(i||0===r||e.type===Al.ExternalSurvey),[c,d]=gl(!1),h=()=>{var t=()=>{s&&n(e),u(!1)};ad.startViewTransition?ad.startViewTransition((()=>{var e;null==o||null==(e=o.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&h()};return fl((()=>{if(t){if(!i){var n=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return h();d(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{h()}),5e3)}},s=()=>{Sc(e)&&(u(!0),od.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(Ol.SHOWN,{[Fl.SURVEY_NAME]:e.name,[Fl.SURVEY_ID]:e.id,[Fl.SURVEY_ITERATION]:e.current_iteration,[Fl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Es(od,"PHSurveyClosed",p),Es(od,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),od.removeEventListener("PHSurveyClosed",p),od.removeEventListener("PHSurveySent",n)}}return s(),()=>{od.removeEventListener("PHSurveyClosed",p),od.removeEventListener("PHSurveySent",n)}}}else Hl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),fd({survey:e,removeSurveyFromFocus:n,setSurveyVisible:u,isPreviewMode:i}),{isPopupVisible:l,isSurveySent:c,setIsPopupVisible:u,hidePopupWithViewTransition:h}}(l,c,C,S,p,v,w,b),x=k||h===l.questions.length||!0===y,T=ml((()=>{var e=kc(l);return{isPreviewMode:S,previewPageIndex:h,onPopupSurveyDismissed:()=>{hc(l,c,S),f()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||ru(),onPreviewSubmit:g,posthog:c,properties:m}}),[S,h,v,c,l,f,g,m]);return I?Ac(mc.Provider,{value:T,children:Ac("div",{className:"ph-survey",style:r({},Mc(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),d),ref:w,children:x?Ac(zc,{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||ic,onClose:()=>{E(),_()}}):Ac(yd,{survey:l,forceDisableHtml:!!u,posthog:c})})}):null}function yd(e){var t,{survey:i,forceDisableHtml:n,posthog:s}=e,[o,a]=gl((()=>{var e=kc(i);return null!=e&&e.responses&&Hl.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:c,onPreviewSubmit:d,surveySubmissionId:h,isPreviewMode:p,properties:v}=yl(mc),[g,f]=gl((()=>{var e=kc(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),_=ml((()=>fc(i)),[i]);fl((()=>{p&&!ri(l)&&f(l)}),[l,p]);var m=_.at(g);return m?Ac("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(t=i.appearance)?void 0:t.hideCancelButton)&&Ac($c,{onClick:()=>{u()}}),Ac("div",{className:"survey-box",children:wd({question:m,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||ic,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:l}=e;if(s)if(l){var u=tc(l),c=r({},o,{[u]:t});a(c);var d=sd(i,n,t),p=d===Ll.End;p||(f(d),Ic(i,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(i.enable_partial_responses||p)&&uc({responses:c,survey:i,surveySubmissionId:h,isSurveyCompleted:p,posthog:s,properties:v})}else Hl.error("onNextButtonClick called without a questionId.");else Hl.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:g,questionId:m.id}),onPreviewSubmit:d,initialValue:m.id?o[tc(m.id)]:void 0})})]}):null}function bd(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,readOnly:d}=e,[h,p]=gl(!0),[v,g]=gl(!1),[f,_]=gl({}),m=()=>{g(!v)};if(fl((()=>{var e;if(c){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&_({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Hl.info("Received show event for feedback button survey "+l.id),_(r.detail.position||{}),m())};return Es(od,ld,t),()=>{od.removeEventListener(ld,t)}}}else Hl.error("FeedbackWidget called without a PostHog instance.")}),[c,d,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),fd({survey:l,setSurveyVisible:p}),!h)return null;var y=()=>{l.schedule!==Nl.Always&&p(!1),setTimeout((()=>{g(!1)}),200)};return Ac(Oa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ac("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Rl.Top?"widget-tab-top":""),onClick:m,disabled:d,style:_d(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),v&&Ac(md,{posthog:c,survey:l,forceDisableHtml:u,style:f,onPopupSurveyDismissed:y,onCloseConfirmationMessage:y})]})}var wd=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u={forceDisableHtml:i,appearance:s,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{o(e)},initialValue:l,displayQuestionIndex:n};switch(t.type){case Pl.Open:return La(Gc,r({},u,{question:t,key:t.id}));case Pl.Link:return La(Yc,r({},u,{question:t,key:t.id}));case Pl.Rating:return La(Xc,r({},u,{question:t,key:t.id}));case Pl.SingleChoice:case Pl.MultipleChoice:return La(Jc,r({},u,{question:t,key:t.id}));default:return Hl.error("Unsupported question type: "+t.type),null}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.generateSurveys=gd,os.extendPostHogWithSurveys=gd;class Sd{emit(e){}}var Cd=new Sd;var Id=new class{getLogger(e,t,r){return new Sd}};class kd{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;var e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Cd}}class Ed{getLogger(e,t,r){var i;return null!==(i=this._getDelegateLogger(e,t,r))&&void 0!==i?i:new kd(this,e,t,r)}_getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Id}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getLogger(e,t,r)}}var xd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Td=Symbol.for("io.opentelemetry.js.api.logs"),Md=xd;class Rd{constructor(){this._proxyLoggerProvider=new Ed}static getInstance(){return this._instance||(this._instance=new Rd),this._instance}setGlobalLoggerProvider(e){return Md[Td]?this.getLoggerProvider():(Md[Td]=(t=1,r=e,i=Id,e=>e===t?r:i),this._proxyLoggerProvider._setDelegate(e),e);var t,r,i}getLoggerProvider(){var e,t;return null!==(t=null===(e=Md[Td])||void 0===e?void 0:e.call(Md,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete Md[Td],this._proxyLoggerProvider=new Ed}}var Ad=Rd.getInstance();class Pd{constructor(e){this._delegate=void 0,this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Ld extends Error{constructor(e,t,r){super(e),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=t}}function Nd(e){if(Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}class Od{constructor(e){this._concurrencyLimit=void 0,this._sendingPromises=[],this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);var t=()=>{var t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return t((function*(){yield Promise.all(e._sendingPromises)}))()}}function Fd(e){return new Od(e.concurrencyLimit)}var Dd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Hd="1.9.0",Bd=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var qd=function(e){var t=new Set([e]),r=new Set,i=e.match(Bd);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(t){return t===e};function a(e){return r.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var i=e.match(Bd);if(!i)return a(e);var u=+i[1],c=+i[2],d=+i[3];return null!=i[4]||n!==u?a(e):0===n?s===c&&o<=d?l(e):a(e):s<=c?l(e):a(e)}}(Hd),Ud=Hd.split(".")[0],Vd=Symbol.for("opentelemetry.js.api."+Ud),jd=Dd;function $d(e,t,r,i){var n;void 0===i&&(i=!1);var s=jd[Vd]=null!==(n=jd[Vd])&&void 0!==n?n:{version:Hd};if(!i&&s[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}if(s.version!==Hd){o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+Hd);return r.error(o.stack||o.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Hd+"."),!0}function Wd(e){var t,r,i=null===(t=jd[Vd])||void 0===t?void 0:t.version;if(i&&qd(i))return null===(r=jd[Vd])||void 0===r?void 0:r[e]}function zd(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Hd+".");var r=jd[Vd];r&&delete r[e]}var Zd,Gd=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Yd=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},Xd=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("verbose",this._namespace,e)},e}();function Kd(e,t,r){var i=Wd("diag");if(i)return r.unshift(t),i[e].apply(i,Yd([],Gd(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Zd||(Zd={}));var Jd=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Qd=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},eh=function(){function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=Wd("diag");if(i)return i[e].apply(i,Qd([],Jd(t),!1))}}var t=this;t.setLogger=function(e,r){var i,n,s;if(void 0===r&&(r={logLevel:Zd.INFO}),e===t){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=Wd("diag"),l=function(e,t){function r(r,i){var n=t[r];return"function"==typeof n&&e>=i?n.bind(t):function(){}}return e<Zd.NONE?e=Zd.NONE:e>Zd.ALL&&(e=Zd.ALL),t=t||{},{error:r("error",Zd.ERROR),warn:r("warn",Zd.WARN),info:r("info",Zd.INFO),debug:r("debug",Zd.DEBUG),verbose:r("verbose",Zd.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Zd.INFO,e);if(a&&!r.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),l.warn("Current logger will overwrite one already registered from "+u)}return $d("diag",l,t,!0)},t.disable=function(){zd("diag",t)},t.createComponentLogger=function(e){return new Xd(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function th(e){return Symbol.for(e)}var rh,ih=function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,i){var n=new e(r._currentContext);return n._currentContext.set(t,i),n},r.deleteValue=function(t){var i=new e(r._currentContext);return i._currentContext.delete(t),i}},nh=new ih,sh=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},oh=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},ah=function(){function e(){}return e.prototype.active=function(){return nh},e.prototype.with=function(e,t,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];return t.call.apply(t,oh([r],sh(i),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),lh=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},uh=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},ch="context",dh=new ah,hh=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return $d(ch,e,eh.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,r){for(var i,n=[],s=3;s<arguments.length;s++)n[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,uh([e,t,r],lh(n),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Wd(ch)||dh},e.prototype.disable=function(){this._getContextManager().disable(),zd(ch,eh.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(rh||(rh={}));var ph="0000000000000000",vh="00000000000000000000000000000000",gh={traceId:vh,spanId:ph,traceFlags:rh.NONE},fh=function(){function e(e){void 0===e&&(e=gh),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),_h=th("OpenTelemetry Context Key SPAN");function mh(e){return e.getValue(_h)||void 0}function yh(){return mh(hh.getInstance().active())}function bh(e,t){return e.setValue(_h,t)}function wh(e){return e.deleteValue(_h)}function Sh(e,t){return bh(e,new fh(t))}function Ch(e){var t;return null===(t=mh(e))||void 0===t?void 0:t.spanContext()}var Ih=/^([0-9a-f]{32})$/i,kh=/^[0-9a-f]{16}$/i;function Eh(e){return r=e.traceId,Ih.test(r)&&r!==vh&&(t=e.spanId,kh.test(t)&&t!==ph);var t,r}function xh(e){return new fh(e)}var Th=hh.getInstance(),Mh=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=Th.active()),Boolean(null==t?void 0:t.root))return new fh;var i,n=r&&Ch(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Eh(n)?new fh(n):new fh},e.prototype.startActiveSpan=function(e,t,r,i){var n,s,o;if(!(arguments.length<2)){2===arguments.length?o=t:3===arguments.length?(n=t,o=r):(n=t,s=r,o=i);var a=null!=s?s:Th.active(),l=this.startSpan(e,n,a),u=bh(a,l);return Th.with(u,o,void 0,l)}},e}();var Rh=new Mh,Ah=function(){function e(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,i){var n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Rh},e}(),Ph=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new Mh},e}()),Lh=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var i;return null!==(i=this.getDelegateTracer(e,t,r))&&void 0!==i?i:new Ah(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Ph},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getTracer(e,t,r)},e}(),Nh=hh.getInstance(),Oh=eh.instance(),Fh="trace",Dh=function(){function e(){this._proxyTracerProvider=new Lh,this.wrapSpanContext=xh,this.isSpanContextValid=Eh,this.deleteSpan=wh,this.getSpan=mh,this.getActiveSpan=yh,this.getSpanContext=Ch,this.setSpan=bh,this.setSpanContext=Sh}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=$d(Fh,this._proxyTracerProvider,eh.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Wd(Fh)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){zd(Fh,eh.instance()),this._proxyTracerProvider=new Lh},e}(),Hh=Dh.getInstance(),Bh=th("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function qh(e){return null==e||(Array.isArray(e)?function(e){var t;for(var r of e)if(null!=r){var i=typeof r;if(i!==t){if(!t){if(Uh(i)){t=i;continue}return!1}return!1}}return!0}(e):Uh(typeof e))}function Uh(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}var Vh=e=>{Oh.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach((e=>{if(!t[e]){var i=r[e];i&&(t[e]=String(i))}})),r=Object.getPrototypeOf(r);return t}(e))}(e))};function jh(e){try{Vh(e)}catch(e){}}var $h,Wh=performance,zh="telemetry.sdk.language",Zh="telemetry.sdk.name",Gh="telemetry.sdk.version",Yh={[Zh]:"opentelemetry","process.runtime.name":"browser",[zh]:"webjs",[Gh]:"2.2.0"},Xh=Math.pow(10,6),Kh=Math.pow(10,9);function Jh(e){var t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Xh)]}function Qh(){var e=Wh.timeOrigin;if("number"!=typeof e){var t=Wh;e=t.timing&&t.timing.fetchStart}return e}function ep(e){return function(e,t){var r=[e[0]+t[0],e[1]+t[1]];r[1]>=Kh&&(r[1]-=Kh,r[0]+=1);return r}(Jh(Qh()),Jh("number"==typeof e?e:Wh.now()))}function tp(e){if(t=e,Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return e;if("number"==typeof e)return e<Qh()?ep(e):Jh(e);if(e instanceof Date)return Jh(e.getTime());throw TypeError("Invalid input type");var t}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}($h||($h={}));var rp="[object Object]",ip="[object Null]",np="[object Undefined]",sp=Function.prototype.toString,op=sp.call(Object),ap=Object.getPrototypeOf,lp=Object.prototype,up=lp.hasOwnProperty,cp=Symbol?Symbol.toStringTag:void 0,dp=lp.toString;function hp(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){if(null==e)return void 0===e?np:ip;return cp&&cp in Object(e)?function(e){var t=up.call(e,cp),r=e[cp],i=!1;try{e[cp]=void 0,i=!0}catch(e){}var n=dp.call(e);i&&(t?e[cp]=r:delete e[cp]);return n}(e):function(e){return dp.call(e)}(e)}(e)!==rp)return!1;var t=ap(e);if(null===t)return!0;var r=up.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&sp.call(r)===op}var pp=20;function vp(e){return _p(e)?e.slice():e}function gp(e,t,r,i){var n;if(void 0===r&&(r=0),!(r>pp)){if(r++,bp(e)||bp(t)||mp(t))n=vp(t);else if(_p(e)){if(n=e.slice(),_p(t))for(var s=0,o=t.length;s<o;s++)n.push(vp(t[s]));else if(yp(t))for(var a=Object.keys(t),l=0,u=a.length;l<u;l++){var c=a[l];n[c]=vp(t[c])}}else if(yp(e))if(yp(t)){if(!function(e,t){if(!hp(e)||!hp(t))return!1;return!0}(e,t))return t;n=Object.assign({},e);for(var d=Object.keys(t),h=0,p=d.length;h<p;h++){var v=d[h],g=t[v];if(bp(g))void 0===g?delete n[v]:n[v]=g;else{var f=n[v],_=g;if(fp(e,v,i)||fp(t,v,i))delete n[v];else{if(yp(f)&&yp(_)){var m=i.get(f)||[],y=i.get(_)||[];m.push({obj:e,key:v}),y.push({obj:t,key:v}),i.set(f,m),i.set(_,y)}n[v]=gp(n[v],g,r,i)}}}}else n=t;return n}}function fp(e,t,r){for(var i=r.get(e[t])||[],n=0,s=i.length;n<s;n++){var o=i[n];if(o.key===t&&o.obj===e)return!0}return!1}function _p(e){return Array.isArray(e)}function mp(e){return"function"==typeof e}function yp(e){return!bp(e)&&!_p(e)&&!mp(e)&&"object"==typeof e}function bp(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class wp extends Error{constructor(e){super(e),Object.setPrototypeOf(this,wp.prototype)}}function Sp(e,t){var r,i=new Promise((function(e,i){r=setTimeout((function(){i(new wp("Operation timed out."))}),t)}));return Promise.race([e,i]).then((e=>(clearTimeout(r),e)),(e=>{throw clearTimeout(r),e}))}class Cp{constructor(){this._promise=void 0,this._resolve=void 0,this._reject=void 0,this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class Ip{constructor(e,t){this._callback=void 0,this._that=void 0,this._isCalled=!1,this._deferred=new Cp,this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(){if(!this._isCalled){this._isCalled=!0;try{for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Promise.resolve(this._callback.call(this._that,...t)).then((e=>this._deferred.resolve(e)),(e=>this._deferred.reject(e)))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}var kp={_export:function(e,t){return new Promise((r=>{Nh.with(function(e){return e.setValue(Bh,!0)}(Nh.active()),(()=>{e.export(t,(e=>{r(e)}))}))}))}};function Ep(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Oh.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class xp{constructor(e,t,r,i,n){this._transport=void 0,this._serializer=void 0,this._responseHandler=void 0,this._promiseQueue=void 0,this._timeout=void 0,this._diagLogger=void 0,this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=i,this._timeout=n,this._diagLogger=Oh.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())t({code:$h.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this._serializer.serializeRequest(e);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then((e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:$h.FAILED,error:e.error}):"retryable"===e.status?t({code:$h.FAILED,error:new Ld("Export failed with retryable status")}):t({code:$h.FAILED,error:new Ld("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:$h.SUCCESS})}}),(e=>t({code:$h.FAILED,error:e})))):t({code:$h.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return t((function*(){e._diagLogger.debug("shutdown started"),yield e.forceFlush(),e._transport.shutdown()}))()}}function Tp(e,t,r){return i={transport:r,serializer:t,promiseHandler:Fd(e)},n={timeout:e.timeoutMillis},new xp(i.transport,i.serializer,Ep(),i.promiseHandler,n.timeout);var i,n}function Mp(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Rp(e){for(var t=new Uint8Array(e.length/2),r=0,i=0;i<e.length;i+=2){var n=Mp(e.charCodeAt(i)),s=Mp(e.charCodeAt(i+1));t[r++]=n<<4|s}return t}function Ap(e){var t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Pp(e){var t,r=Ap(e);return t=r,{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}var Lp="undefined"!=typeof BigInt?function(e){return Ap(e).toString()}:function(e){return e[0]*Kh+e[1]};function Np(e){return e}function Op(e){if(void 0!==e)return Rp(e)}var Fp={encodeHrTime:Pp,encodeSpanContext:Rp,encodeOptionalSpanContext:Op};function Dp(e,t){return{key:e,value:Hp(t)}}function Hp(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Hp)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((e=>{var[t,r]=e;return Dp(t,r)}))}}:{}}function Bp(e,t){var r=function(e){var t,r;if(void 0===e)return Fp;var i=null===(t=e.useLongBits)||void 0===t||t,n=null!==(r=e.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Pp:Lp,encodeSpanContext:n?Np:Rp,encodeOptionalSpanContext:n?Np:Op}}(t);return{resourceLogs:qp(e,r)}}function qp(e,t){var r=function(e){var t=new Map;for(var r of e){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=t.get(i);a||(a=new Map,t.set(i,a));var l=n+"@"+s+":"+o,u=a.get(l);u||(u=[],a.set(l,u)),u.push(r)}return t}(e);return Array.from(r,(e=>{var[r,i]=e,n=function(e){var t,r={attributes:(t=e.attributes,Object.keys(t).map((e=>Dp(e,t[e])))),droppedAttributesCount:0},i=e.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(e=>{var r,[,i]=e;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((e=>function(e,t){var r,i,n;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:Hp(e.body),eventName:e.eventName,attributes:Up(e.attributes),droppedAttributesCount:e.droppedAttributesCount,flags:null==(r=e.spanContext)?void 0:r.traceFlags,traceId:t.encodeOptionalSpanContext(null==(i=e.spanContext)?void 0:i.traceId),spanId:t.encodeOptionalSpanContext(null==(n=e.spanContext)?void 0:n.spanId)}}(e,t))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}function Up(e){return Object.keys(e).map((t=>Dp(t,e[t])))}var Vp=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class jp{static FromAttributeList(e,t){var r=new jp({},t);return r._rawAttributes=Wp(e),r._asyncAttributesPending=e.filter((e=>{var[t,r]=e;return Vp(r)})).length>0,r}constructor(e,t){var r;this._rawAttributes=void 0,this._asyncAttributesPending=!1,this._schemaUrl=void 0,this._memoizedAttributes=void 0;var i=null!==(r=e.attributes)&&void 0!==r?r:{};this._rawAttributes=Object.entries(i).map((e=>{var[t,r]=e;return Vp(r)&&(this._asyncAttributesPending=!0),[t,r]})),this._rawAttributes=Wp(this._rawAttributes),this._schemaUrl=function(e){if("string"==typeof e||void 0===e)return e;return void Oh.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(null==t?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return t((function*(){if(e.asyncAttributesPending){for(var t=0;t<e._rawAttributes.length;t++){var[r,i]=e._rawAttributes[t];e._rawAttributes[t]=[r,Vp(i)?yield i:i]}e._asyncAttributesPending=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Oh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;var e={};for(var[t,r]of this._rawAttributes){var i;if(Vp(r))Oh.debug("Unsettled resource attribute "+t+" skipped");else if(null!=r)null!==(i=e[t])&&void 0!==i||(e[t]=r)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(null==e)return this;var t=function(e,t){var r=null==e?void 0:e.schemaUrl,i=null==t?void 0:t.schemaUrl,n=void 0===r||""===r,s=void 0===i||""===i;if(n)return i;if(s)return r;if(r===i)return r;return void Oh.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,i)}(this,e),r=t?{schemaUrl:t}:void 0;return jp.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],r)}}function $p(e,t){return jp.FromAttributeList(Object.entries(e),t)}function Wp(e){return e.map((e=>{var[t,r]=e;return Vp(r)?[t,r.catch((e=>{Oh.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,r]}))}var zp={serializeRequest:e=>{var t=Bp(e,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};var t=new TextDecoder;return JSON.parse(t.decode(e))}};class Zp{constructor(e){this._transport=void 0,this._transport=e}retry(e,t,r){return new Promise(((i,n)=>{setTimeout((()=>{this._transport.send(e,t).then(i,n)}),r)}))}send(e,r){var i=this;return t((function*(){for(var t=Date.now()+r,n=yield i._transport.send(e,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var l=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var u=null!==(a=n.retryInMillis)&&void 0!==a?a:l,c=t-Date.now();if(u>c)return n;n=yield i.retry(e,c,u)}return n}))()}shutdown(){return this._transport.shutdown()}}function Gp(e){return new Zp(e.transport)}function Yp(e){return[429,502,503,504].includes(e)}function Xp(e){if(null!=e){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var r=new Date(e).getTime()-Date.now();return r>=0?r:0}}class Kp{constructor(e){this._parameters=void 0,this._parameters=e}send(e,r){var i=this;return t((function*(){var t=yield i._parameters.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i._parameters.url),Object.entries(t).forEach((e=>{var[t,r]=e;s.setRequestHeader(t,r)})),s.ontimeout=e=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{s.status>=200&&s.status<=299?(Oh.debug("XHR success"),n({status:"success"})):s.status&&Yp(s.status)?n({status:"retryable",retryInMillis:Xp(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(e)}));return n}))()}shutdown(){}}class Jp{constructor(e){this._params=void 0,this._params=e}send(e){var r=this;return t((function*(){var t=(yield r._params.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r._params.url,new Blob([e],{type:t}))?(Oh.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Qp{constructor(e){this._parameters=void 0,this._parameters=e}send(e,r){var i=this;return t((function*(){var t=new AbortController,n=setTimeout((()=>t.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i._parameters.url),l=yield fetch(a.href,{method:"POST",headers:yield i._parameters.headers(),body:e,signal:t.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return l.status>=200&&l.status<=299?(Oh.debug("response success"),{status:"success"}):Yp(l.status)?{status:"retryable",retryInMillis:Xp(l.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(e){return"AbortError"===(null==e?void 0:e.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:e})}:{status:"failure",error:new Error("Fetch request errored",{cause:e})}}finally{clearTimeout(n)}}))()}shutdown(){}}function ev(e,t){return Tp(e,t,Gp({transport:(r=e,new Kp(r))}));var r}function tv(e,t){return Tp(e,t,Gp({transport:(r=e,new Qp(r))}));var r}function rv(e,t){return Tp(e,t,Gp({transport:(r={url:e.url,headers:e.headers},new Jp(r))}));var r}function iv(e,i,n){return t((function*(){var t=r({},yield n()),s={};return null!=i&&Object.assign(s,yield i()),null!=e&&Object.assign(s,function(e){var t={};return Object.entries(null!=e?e:{}).forEach((e=>{var[r,i]=e;void 0!==i?t[r]=String(i):Oh.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),t}(yield e())),Object.assign(s,t)}))}function nv(e){if(null!=e)try{var t,r=null==(t=globalThis.location)?void 0:t.href;return new URL(e,r).href}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function sv(e,t,i){var n,s;return r({},function(e,t,r){var i,n,s,o,a,l;return{timeoutMillis:Nd(null!==(i=null!==(n=e.timeoutMillis)&&void 0!==n?n:t.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=e.concurrencyLimit)&&void 0!==o?o:t.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(l=e.compression)&&void 0!==l?l:t.compression)&&void 0!==a?a:r.compression}}(e,t,i),{headers:iv(e.headers,t.headers,i.headers),url:null!==(n=null!==(s=nv(e.url))&&void 0!==s?s:t.url)&&void 0!==n?n:i.url})}function ov(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return t((function*(){return e}))}(e.headers)}function av(e,i,n){return sv({url:e.url,timeoutMillis:e.timeoutMillis,headers:ov(e),concurrencyLimit:e.concurrencyLimit},{},function(e,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=t((function*(){return e})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i))}function lv(e,t,r,i){return(e.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?tv:ev:rv)(av(e,r,i),t)}class uv extends Pd{constructor(e){void 0===e&&(e={}),super(lv(e,zp,"v1/logs",{"Content-Type":"application/json"}))}}class cv{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this._severityText=void 0,this._severityNumber=void 0,this._body=void 0,this._eventName=void 0,this.totalAttributesCount=0,this._isReadonly=!1,this._logRecordLimits=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:u={},context:c}=r,d=Date.now();if(this.hrTime=tp(null!=i?i:d),this.hrTimeObserved=tp(null!=n?n:d),c){var h=Hh.getSpanContext(c);h&&Eh(h)&&(this.spanContext=h)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=s,this.setAttributes(u)}setAttribute(e,t){return this._isLogRecordReadonly()||null===t?this:0===e.length?(Oh.warn("Invalid attribute key: "+e),this):qh(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(1===this.droppedAttributesCount&&Oh.warn("Dropping extra attributes."),this):(qh(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this)):(Oh.warn("Invalid attribute value set for key: "+e),this)}setAttributes(e){for(var[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){var t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(Oh.warn("Attribute value limit must be positive, got "+t),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e)):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&Oh.warn("Can not execute the operation on emitted log record"),this._isReadonly}}class dv{constructor(e,t){this.instrumentationScope=void 0,this._sharedState=void 0,this.instrumentationScope=e,this._sharedState=t}emit(e){var t=e.context||Nh.active(),i=new cv(this._sharedState,this.instrumentationScope,r({context:t},e));this._sharedState.activeProcessor.onEmit(i,t),i._makeReadonly()}}class hv{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class pv{constructor(e,t){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return t((function*(){var t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map((e=>Sp(e.forceFlush(),t))))}))()}onEmit(e,t){this.processors.forEach((r=>r.onEmit(e,t)))}shutdown(){var e=this;return t((function*(){yield Promise.all(e.processors.map((e=>e.shutdown())))}))()}}class vv{constructor(e,t,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new pv(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new hv}}class gv{constructor(e){var t,r,i;void 0===e&&(e={}),this._shutdownOnce=void 0,this._sharedState=void 0;var n,s,o,a,l,u,c,d=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var i=t.shift(),n=new WeakMap;t.length>0;)i=gp(i,t.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},e),h=null!==(t=e.resource)&&void 0!==t?t:$p({"service.name":"unknown_service",[zh]:Yh[zh],[Zh]:Yh[Zh],[Gh]:Yh[Gh]});this._sharedState=new vv(h,d.forceFlushTimeoutMillis,(n=d.logRecordLimits,{attributeCountLimit:null!==(s=null!==(o=null!==(a=n.attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(l=null!==(u=null!==(c=n.attributeValueLengthLimit)&&void 0!==c?c:void 0)&&void 0!==u?u:void 0)&&void 0!==l?l:1/0}),null!==(r=null==(i=e)?void 0:i.processors)&&void 0!==r?r:[]),this._shutdownOnce=new Ip(this._shutdown,this)}getLogger(e,t,r){if(this._shutdownOnce.isCalled)return Oh.warn("A shutdown LoggerProvider cannot provide a Logger"),Cd;e||Oh.warn("Logger requested without instrumentation scope name.");var i=e||"unknown",n=i+"@"+(t||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this._sharedState.loggers.has(n)||this._sharedState.loggers.set(n,new dv({name:i,version:t,schemaUrl:null==r?void 0:r.schemaUrl},this._sharedState)),this._sharedState.loggers.get(n)}forceFlush(){return this._shutdownOnce.isCalled?(Oh.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Oh.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}class fv{constructor(e,t){var r,i,n,s,o,a,l,u;this._exporter=void 0,this._maxExportBatchSize=void 0,this._maxQueueSize=void 0,this._scheduledDelayMillis=void 0,this._exportTimeoutMillis=void 0,this._isExporting=!1,this._finishedLogRecords=[],this._timer=void 0,this._shutdownOnce=void 0,this._exporter=e,this._maxExportBatchSize=null!==(r=null!==(i=null==t?void 0:t.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this._maxQueueSize=null!==(n=null!==(s=null==t?void 0:t.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this._scheduledDelayMillis=null!==(o=null!==(a=null==t?void 0:t.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this._exportTimeoutMillis=null!==(l=null!==(u=null==t?void 0:t.exportTimeoutMillis)&&void 0!==u?u:void 0)&&void 0!==l?l:3e4,this._shutdownOnce=new Ip(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Oh.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return t((function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()}))()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise(((e,t)=>{for(var r=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize),n=0;n<i;n++)r.push(this._flushOneBatch());Promise.all(r).then((()=>{e()})).catch(t)}))}_flushOneBatch(){return this._clearTimer(),0===this._finishedLogRecords.length?Promise.resolve():new Promise(((e,t)=>{Sp(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then((()=>e())).catch(t)}))}_maybeStartTimer(){if(!this._isExporting){var e=()=>{this._isExporting=!0,this._flushOneBatch().then((()=>{this._isExporting=!1,this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())})).catch((e=>{this._isExporting=!1,jh(e)}))};if(this._finishedLogRecords.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout((()=>e()),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){var t=()=>kp._export(this._exporter,e).then((e=>{var t;e.code!==$h.SUCCESS&&jh(null!==(t=e.error)&&void 0!==t?t:new Error("BatchLogRecordProcessor: log record export failed (status "+e+")"))})).catch(jh),r=e.map((e=>e.resource)).filter((e=>e.asyncAttributesPending));return 0===r.length?t():Promise.all(r.map((e=>null==e.waitForAsyncAttributes?void 0:e.waitForAsyncAttributes()))).then(t,jh)}}class _v extends fv{constructor(e,t){super(e,t),this._visibilityChangeListener=void 0,this._pageHideListener=void 0,this._onInit(t)}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}_onInit(e){!0!==(null==e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}}var mv=1e4,yv=function(e,t,r,i,n,s){if(void 0===t&&(t=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=mv),void 0===s&&(s=new WeakSet),s.has(e))return r[t||"circular"]="[Circular]",r;for(var o in s.add(e),e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=e[o],l=t?t+"."+o:o;if(ei(a))yv(a,l,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=l.length,i<=0||n<=0)return void(r.attributes_truncated=!0);r[l]=a}}return r},bv={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.logs={initializeLogs:e=>{(e=>{var t={"service.name":"posthog-browser-logs",host:os.location.host};if(e.sessionManager){var{sessionId:i,windowId:n}=e.sessionManager.checkAndGetSessionAndWindowId(!0);t=r({},t,{"session.id":i,"window.id":n})}Ad.setGlobalLoggerProvider(new gv({resource:$p(t),processors:[new _v(new uv({url:e.config.api_host+"/i/v1/logs?token="+e.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(e);var t=Ad.getLogger("console"),i={};if(e.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s=os.console[n];os.console[n]=(s=>function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];if(a.length>0){var u=a.map((e=>{return JSON.stringify(e,(t=new WeakSet,(e,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!si(i)){if(t.has(i))return"[Circular]";t.add(i)}return i}));var t})).join(" ");u.length>mv&&(u=u.slice(0,mv)+"...",i.body_truncated="true"),t.emit({severityText:bv[n],body:u,attributes:r({"log.source":"console."+n,distinct_id:e.get_distinct_id(),"location.href":os.location.href},i,ei(a[0])?yv(a[0]):{})}),s.apply(os.console,a)}})(s)};for(var a of["debug","log","warn","error","info"])o(a)}};var wv=hs("[Error tracking]");function Sv(){return new Cn([new Dn,new Zn,new Bn,new Hn,new Wn,new $n,new Un,new zn],Fn())}class Cv{constructor(e){var t,r;this._suppressionRules=[],this._errorPropertiesBuilder=Sv(),this._instance=e,this._suppressionRules=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(qs))&&void 0!==t?t:[]}onRemoteConfig(e){var t,r,i,n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],s=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this._suppressionRules=n,this._instance.persistence&&this._instance.persistence.register({[qs]:this._suppressionRules,[Us]:s})}get _captureExtensionExceptions(){var e,t=!!this._instance.get_property(Us),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return void wv.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return void wv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return void wv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}_matchesSuppressionRule(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return ii(r)&&r.length>0&&e.$exception_types.push(r),ii(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this._suppressionRules.some((e=>{var r=e.values.map((e=>{var r,i=Yu[e.operator],n=Kr(e.value)?e.value:[e.value],s=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}_isExtensionException(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}_isPostHogException(e){if(e.length>0){var t,r,i,n,s=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],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}_isExceptionList(e){return!oi(e)&&Kr(e)}}var Iv=hs("[ExceptionAutocapture]"),kv=Sv(),Ev={wrapOnError:e=>{var t=Gn;t||Iv.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];var o=n[4],a=n[0],l=kv.buildFromUnknown(o||a,{mechanism:{handled:!1}});return e(l),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=Gn;t||Iv.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(i){var n,s=kv.buildFromUnknown(i,{mechanism:{handled:!1}});return e(s),null!==(n=null==r?void 0:r.apply(t,[i]))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||Iv.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=kv.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(a),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.errorWrappingFunctions=Ev,os.posthogErrorWrappingFunctions=Ev;var xv=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Kr(e)||e.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}t!==ho&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};os.__PosthogExtensions__=os.__PosthogExtensions__||{};var Tv={_patchFetch:(e,r,i)=>Ps(Gn,"fetch",(n=>function(){var s=t((function*(t,s){var o=new Request(t,s);return xv(e,r,i,o),n(o)}));return function(e,t){return s.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Ps(Gn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return xv(e,t,r,u),i.call(this,n,u.url,o,a,l)}))};os.__PosthogExtensions__.tracingHeadersPatchFns=Tv,os.postHogTracingHeadersPatchFns=Tv;var Mv=-1,Rv=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Mv=t.timeStamp,e(t))}),!0)},Av=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&(((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},Pv=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Lv=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Nv=()=>{var e,t=Lv();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},Ov=function(e,t){void 0===t&&(t=-1);var r=Lv(),i="navigate";return Mv>=0?i="back-forward-cache":r&&(document.prerendering||Nv()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Fv=new WeakMap;function Dv(e,t){return Fv.get(e)||Fv.set(e,new t),Fv.get(e)}class Hv{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&e.startTime-i.startTime<1e3&&e.startTime-r.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var Bv,qv=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},Uv=e=>{var t=!1;return()=>{t||(e(),t=!0)}},Vv=-1,jv=new Set,$v=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Wv=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of jv)t();isFinite(Vv)||(Vv="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Wv,!0))}},zv=()=>{if(Vv<0){var e,t=Nv(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;Vv=null!=r?r:$v(),addEventListener("visibilitychange",Wv,!0),addEventListener("prerenderingchange",Wv,!0),Rv((()=>{setTimeout((()=>{Vv=$v()}))}))}return{get firstHiddenTime(){return Vv},onHidden(e){jv.add(e)}}},Zv=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},Gv=[1800,3e3],Yv=function(e,t){void 0===t&&(t={}),Zv((()=>{var r,i=zv(),n=Ov("FCP"),s=qv("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Nv(),0),n.entries.push(t),r(!0)))}));s&&(r=Av(e,n,Gv,t.reportAllChanges),Rv((i=>{n=Ov("FCP"),r=Av(e,n,Gv,t.reportAllChanges),Pv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Xv=[.1,.25],Kv=0,Jv=1/0,Qv=0,eg=e=>{for(var t of e)t.interactionId&&(Jv=Math.min(Jv,t.interactionId),Qv=Math.max(Qv,t.interactionId),Kv=Qv?(Qv-Jv)/7+1:0)},tg=()=>{var e;return Bv?Kv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},rg=0;class ig{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){rg=tg(),this.u.length=0,this.l.clear()}L(){var e=Math.min(this.u.length-1,Math.floor((tg()-rg)/50));return this.u[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.l.get(e.interactionId);if(i||this.u.length<10||e.duration>r.P){var n;if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var ng=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Uv(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},sg=[200,500];class og{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var ag=[2500,4e3],lg={onLCP:function(e,t){void 0===t&&(t={}),Zv((()=>{var r,i=zv(),n=Ov("LCP"),s=Dv(t,og),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),o.startTime<i.firstHiddenTime&&(n.value=Math.max(o.startTime-Nv(),0),n.entries=[o],r())},a=qv("largest-contentful-paint",o);if(a){r=Av(e,n,ag,t.reportAllChanges);var l=Uv((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(ng(l),removeEventListener(e.type,u,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,u,{capture:!0});Rv((i=>{n=Ov("LCP"),r=Av(e,n,ag,t.reportAllChanges),Pv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS:function(e,t){void 0===t&&(t={});var r=zv();Yv(Uv((()=>{var i,n=Ov("CLS",0),s=Dv(t,Hv),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=qv("layout-shift",o);a&&(i=Av(e,n,Xv,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Rv((()=>{s.i=0,n=Ov("CLS",0),i=Av(e,n,Xv,t.reportAllChanges),Pv((()=>i()))})),setTimeout(i))})))},onFCP:Yv,onINP:function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=zv();Zv((()=>{var i;"interactionCount"in performance||Bv||(Bv=qv("event",eg,{type:"event",buffered:!0,durationThreshold:0}));var n,s=Ov("INP"),o=Dv(t,ig),a=e=>{ng((()=>{for(var t of e)o.h(t);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},l=qv("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=Av(e,s,sg,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),Rv((()=>{o.v(),s=Ov("INP"),n=Av(e,s,sg,t.reportAllChanges)})))}))}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.postHogWebVitalsCallbacks=lg,os.postHogWebVitalsCallbacks=lg,os.__PosthogExtensions__.loadWebVitalsCallbacks=()=>lg;class ug{constructor(e){this.disabled=!1===e;var t=ei(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var cg="$copy_autocapture",dg=hs("[AutoCapture]");function hg(e,t){return t.length>e?t.slice(0,e)+"...":t}function pg(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!go(t));return t}function vg(e,t,r,i){var n=e.tagName.toLowerCase(),s={tag_name:n};ko.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=hg(1024,$o(e)):s.$el_text=hg(1024,Co(e)));var o=wo(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e}))),gs(e.attributes,(function(r){var n;if((!Fo(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!t&&jo(r.value)&&(n=r.name,!ii(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=r.value;"class"===r.name&&(o=yo(o).join(" ")),s["attr__"+r.name]=hg(1024,o)}}));for(var a=1,l=1,u=e;u=pg(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function gg(e,t){for(var r,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],c=e;c.parentNode&&!fo(c,"body");)mo(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],p={},v=!1,g=!1;if(gs(u,(e=>{var t=Oo(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&jo(v)&&v),$r(wo(e),"ph-no-capture")&&(g=!0),h.push(vg(e,s,o,a));var r=function(e){if(!Oo(e))return{};var t={};return gs(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&jo(i)&&(t[r]=i)}})),t}(e);fs(p,r)})),g)return{props:{},explicitNoCapture:g};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=$o(e):h[0].$el_text=Co(e)),v){var f,_;h[0].attr__href=v;var m=null==(f=xs(v))?void 0:f.host,y=null==Gn||null==(_=Gn.location)?void 0:_.host;m&&y&&m!==y&&(d=v)}return{props:fs({$event_type:n.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:zo(h)},null!=(r=h[0])&&r.$el_text?{$el_text:null==(i=h[0])?void 0:i.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},p)}}class fg{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this._elementsChainAsString=!1,this.instance=e,this.rageclicks=new ug(e.config.rageclick),this._elementSelectors=null}get _config(){var e,t,r=ei(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Gn&&es){var e=e=>{e=e||(null==Gn?void 0:Gn.event);try{this._captureEvent(e)}catch(e){dg.error("Failed to capture event",e)}};if(Es(es,"submit",e,{capture:!0}),Es(es,"change",e,{capture:!0}),Es(es,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{e=e||(null==Gn?void 0:Gn.event),this._captureEvent(e,cg)};Es(es,"copy",t,{capture:!0}),Es(es,"cut",t,{capture:!0})}}}else dg.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ds]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null==(t=this._elementSelectors)||t.forEach((t=>{var i=null==es?void 0:es.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Ds],i=this._isDisabledServerSide;if(si(i)&&!ui(r)&&!this.instance._shouldDisableFlags())return!1;var n=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!n}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Io(e);if(_o(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Ao(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var n=t===cg;if(i&&No(i,e,this._config,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=gg(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===cg){var l,u=So(null==Gn||null==(l=Gn.getSelection())?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=c}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return Jr(null==es?void 0:es.querySelectorAll)}}var _g={};function mg(e){return function(e,t){var r=_g[e];if(r)return r;var i=t[e];if(Qr(i)&&!as())return _g[e]=i.bind(t);var n=t.document;if(n&&Jr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[e]&&(i=o[e]),n.head.removeChild(s)}catch(t){ds.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&Jr(i)?_g[e]=i.bind(t):i}("MutationObserver",e)}function yg(e,t){return ai(e)&&e>=t}class bg{_asRequiredConfig(e){var t,r,i,n,s,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(e,t){this._clicks=[],this._defaultConfig=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this._onClick=e=>{var t=function(e){var t=Io(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);si(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&ri(this._checkClickTimer)&&(this._checkClickTimer=os.setTimeout((()=>{this._checkClicks()}),1e3))},this._onScroll=()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{ri(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this._onSelectionChange=()=>{this._lastSelectionChanged=Date.now()},this.instance=e,this._config=this._asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=mg(os);this._mutationObserver=new t((e=>{this._onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this._mutationObserver)||e.disconnect(),this._mutationObserver=void 0,os.removeEventListener("click",this._onClick),os.removeEventListener("scroll",this._onScroll,{capture:!0}),os.removeEventListener("selectionchange",this._onSelectionChange)}_onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){Es(os,"click",this._onClick)}_startScrollObserver(){Es(os,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){Es(os,"selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(!this._config.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(vo(e.node))return!0;var r=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!fo(e.node,"html")&&go(e.node)&&!ko.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var i=yg(t.scrollDelayMs,this._config.scroll_threshold_ms),n=yg(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),s=yg(t.mutationDelayMs,this._config.mutation_threshold_ms),o=yg(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=ai(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=ai(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,u=ai(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||u||(i||s||o||n?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&ri(this._checkClickTimer)&&(this._checkClickTimer=os.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,t){this.instance.capture("$dead_click",r({},t,gg(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new bg(e,t);var wg="";var Sg=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Cg(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=es),wg)return wg;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+ru();!wg&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",wg=s)}return wg}(e);if(!r){var i=(e=>{var t=e.match(Sg);return t?t[0]:""})(e);i!==r&&ds.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Ig={_is_supported:()=>!!es,_error:function(e){ds.error("cookieStore error: "+e)},_get:function(e){if(es){try{for(var t=e+"=",r=es.cookie.split(";").filter((e=>e.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},_parse:function(e){var t;try{t=JSON.parse(Ig._get(e))||{}}catch(e){}return t},_set:function(e,t,r,i,n){if(es)try{var s="",o="",a=Cg(es.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ds.warn("cookieStore warning: large cookie, len="+u.length),es.cookie=u,u}catch(e){return}},_remove:function(e,t){if(null!=es&&es.cookie)try{Ig._set(e,"",-1,t)}catch(e){return}}},kg=null,Eg={_is_supported:function(){if(!si(kg))return kg;var e=!0;if(ri(Gn))e=!1;else try{var t="__mplssupport__";Eg._set(t,"xyz"),'"xyz"'!==Eg._get(t)&&(e=!1),Eg._remove(t)}catch(t){e=!1}return e||ds.error("localStorage unsupported; falling back to cookie store"),kg=e,e},_error:function(e){ds.error("localStorage error: "+e)},_get:function(e){try{return null==Gn?void 0:Gn.localStorage.getItem(e)}catch(e){Eg._error(e)}return null},_parse:function(e){try{return JSON.parse(Eg._get(e))||{}}catch(e){}return null},_set:function(e,t){try{null==Gn||Gn.localStorage.setItem(e,JSON.stringify(t))}catch(e){Eg._error(e)}},_remove:function(e){try{null==Gn||Gn.localStorage.removeItem(e)}catch(e){Eg._error(e)}}},xg=["$device_id","distinct_id",Zs,Gs,uo,lo],Tg={},Mg={_is_supported:function(){return!0},_error:function(e){ds.error("memoryStorage error: "+e)},_get:function(e){return Tg[e]||null},_parse:function(e){return Tg[e]||null},_set:function(e,t){Tg[e]=t},_remove:function(e){delete Tg[e]}},Rg=null,Ag={_is_supported:function(){if(!si(Rg))return Rg;if(Rg=!0,ri(Gn))Rg=!1;else try{var e="__support__";Ag._set(e,"xyz"),'"xyz"'!==Ag._get(e)&&(Rg=!1),Ag._remove(e)}catch(e){Rg=!1}return Rg},_error:function(e){ds.error("sessionStorage error: ",e)},_get:function(e){try{return null==Gn?void 0:Gn.sessionStorage.getItem(e)}catch(e){Ag._error(e)}return null},_parse:function(e){try{return JSON.parse(Ag._get(e))||null}catch(e){}return null},_set:function(e,t){try{null==Gn||Gn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Ag._error(e)}},_remove:function(e){try{null==Gn||Gn.sessionStorage.removeItem(e)}catch(e){Ag._error(e)}}},Pg=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class Lg{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?Pg.DENIED:this._storedConsent}isOptedOut(){return"always"===this._config.cookieless_mode||(this.consent===Pg.DENIED||this.consent===Pg.PENDING&&(this._config.opt_out_capturing_by_default||"on_reject"===this._config.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Pg.DENIED}optInOut(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get _storedConsent(){var e=this._storage._get(this._storageKey);return fi(e)?Pg.GRANTED:$r(_i,e)?Pg.DENIED:Pg.PENDING}get _storage(){if(!this._persistentStore){var e=this._config.opt_out_capturing_persistence_type;this._persistentStore="localStorage"===e?Eg:Ig;var t="localStorage"===e?Ig:Eg;t._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(fi(t._get(this._storageKey))),t._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&!!ks([null==Qn?void 0:Qn.doNotTrack,null==Qn?void 0:Qn.msDoNotTrack,os.doNotTrack],(e=>fi(e)))}}var Ng=hs("[Dead Clicks]"),Og=()=>!0,Fg=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(js)),i=e.instance.config.capture_dead_clicks;return ui(i)?i:!!ei(i)||r};class Dg{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[js]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabledOrStop()}startIfEnabledOrStop(){this.isEnabled(this)?this._loadScript((()=>{this._start()})):this.stop()}_loadScript(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Ng.error("failed to load script",t):e()}))}_start(){var e;if(es){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=os.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=ei(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=os.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(es),Ng.info("starting...")}}else Ng.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Ng.info("stopping..."))}}var Hg=hs("[ExceptionAutocapture]");class Bg{constructor(e){var t,r,i;this._startCapturing=()=>{var e;if(Gn&&this.isEnabled&&null!=(e=os.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=os.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=os.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=os.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this._unwrapOnError&&this._config.capture_unhandled_errors&&(this._unwrapOnError=t(this.captureException.bind(this))),!this._unwrapUnhandledRejection&&this._config.capture_unhandled_rejections&&(this._unwrapUnhandledRejection=r(this.captureException.bind(this))),!this._unwrapConsoleError&&this._config.capture_console_errors&&(this._unwrapConsoleError=i(this.captureException.bind(this)))}catch(e){Hg.error("failed to start",e),this._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Bs]),this._rateLimiter=new yi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,_logger:Hg}),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}_requiredConfig(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ei(e)?t=r({},t,e):(ri(e)?this._remoteEnabled:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Hg.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()}_loadScript(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Hg.error("failed to load script",t);e()}))}_stopCapturing(){var e,t,r;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(r=this._unwrapConsoleError)||r.call(this),this._unwrapConsoleError=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this._remoteEnabled=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[Bs]:this._remoteEnabled}),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}onConfigChange(){this._config=this._requiredConfig()}captureException(e){var t,r,i=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this._rateLimiter.consumeRateLimit(i)?Hg.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}class qg{constructor(e){var t;this._instance=e,this._lastPathname=(null==Gn||null==(t=Gn.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ds.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,ds.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Gn&&Gn.history){var r=this;null!=(e=Gn.history.pushState)&&e.__posthog_wrapped__||Ps(Gn.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("pushState")})),null!=(t=Gn.history.replaceState)&&t.__posthog_wrapped__||Ps(Gn.history,"replaceState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("replaceState")})),this._setupPopstateListener()}}_capturePageview(e){try{var t,r=null==Gn||null==(t=Gn.location)?void 0:t.pathname;if(!r)return;r!==this._lastPathname&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._lastPathname=r}catch(t){ds.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener){var e=()=>{this._capturePageview("popstate")};Es(Gn,"popstate",e),this._popstateListener=()=>{Gn&&Gn.removeEventListener("popstate",e)}}}}var Ug=hs("[SegmentIntegration]");function Vg(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||ru();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(io,"identified")),t()},n=r.user();"then"in n&&Jr(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Ug.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Ug.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Ug.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}var jg="posthog-js";function $g(e,t){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,c,d,h;if(!("*"===o||o.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var v=(null==(l=t.exception)?void 0:l.values)||[],g=v.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),f={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=v[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=v[0])?void 0:h.type,$sentry_tags:t.tags};return i&&n&&(f.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&e.exceptions.sendExceptionEvent(f),t}}class Wg{constructor(e,t,r,i,n,s){this.name=jg,this.setupOnce=function(o){o($g(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var zg=null!=Gn&&Gn.location?As(Gn.location.hash,"__posthog")||As(location.hash,"state"):null,Zg="_postHogToolbarParams",Gg=hs("[Toolbar]"),Yg=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Yg||{});class Xg{constructor(e){this.instance=e}_setToolbarState(e){os.ph_toolbar_state=e}_getToolbarState(){var e;return null!==(e=os.ph_toolbar_state)&&void 0!==e?e:Yg.UNINITIALIZED}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.instance.config.name&&"ph_toolbar_internal"===this.instance.config.name)return!1;if(!Gn||!es)return!1;e=null!=e?e:Gn.location,r=null!=r?r:Gn.history;try{if(!t){try{Gn.localStorage.setItem("test","test"),Gn.localStorage.removeItem("test")}catch(e){return!1}t=null==Gn?void 0:Gn.localStorage}var i,n=zg||As(e.hash,"__posthog")||As(e.hash,"state"),s=n?ys((()=>JSON.parse(atob(decodeURIComponent(n)))))||ys((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(Zg)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=os.ph_load_toolbar||os.ph_load_editor;!oi(t)&&Jr(t)?t(e,this.instance):Gg.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==es||!es.getElementById(co));if(!Gn||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Gn.localStorage.setItem(Zg,JSON.stringify(r({},n,{source:void 0}))),this._getToolbarState()===Yg.LOADED)this._callLoadToolbar(n);else if(this._getToolbarState()===Yg.UNINITIALIZED){var s;this._setToolbarState(Yg.LOADING),null==(s=os.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return Gg.error("[Toolbar] Failed to load",e),void this._setToolbarState(Yg.UNINITIALIZED);this._setToolbarState(Yg.LOADED),this._callLoadToolbar(n)})),Es(Gn,"turbolinks:load",(()=>{this._setToolbarState(Yg.UNINITIALIZED),this.loadToolbar(n)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}var Kg=hs("[TracingHeaders]");class Jg{constructor(e){this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._startCapturing=()=>{var e,t;ri(this._restoreXHRPatch)&&(null==(e=os.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ri(this._restoreFetchPatch)&&(null==(t=os.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}_loadScript(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return Kg.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var Qg="https?://(.*)",ef=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],tf=_s(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],ef),rf="<masked>",nf=["li_fat_id"];function sf(e,t,r){if(!es)return{};var i,n=t?_s([],ef,r||[]):[],s=of(Rs(es.URL,n,rf),e),o=(i={},gs(nf,(function(e){var t=Ig._get(e);i[e]=t||null})),i);return fs(o,s)}function of(e,t){var r=tf.concat(t||[]),i={};return gs(r,(function(t){var r=Ms(e,t);i[t]=r||null})),i}function af(e){var t=function(e){return e?0===e.search(Qg+"google.([^/?]*)")?"google":0===e.search(Qg+"bing.com")?"bing":0===e.search(Qg+"yahoo.com")?"yahoo":0===e.search(Qg+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!si(t)){i.$search_engine=t;var n=es?Ms(es.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function lf(){return navigator.language||navigator.userLanguage}function uf(){return(null==es?void 0:es.referrer)||"$direct"}function cf(e,t){var r=e?_s([],ef,t||[]):[],i=null==ts?void 0:ts.href.substring(0,1e3);return{r:uf().substring(0,1e3),u:i?Rs(i,r,rf):void 0}}function df(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(t=xs(r))?void 0:t.host};if(i){n.$current_url=i;var s=xs(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=of(i);fs(n,o)}if(r){var a=af(r);fs(n,a)}return n}function hf(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function pf(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function vf(e,t){if(!ss)return{};var r,i=e?_s([],ef,t||[]):[],[n,s]=function(e){for(var t=0;t<mn.length;t++){var[r,i]=mn[t],n=r.exec(e),s=n&&(Jr(i)?i(n,e):i);if(s)return s}return["",""]}(ss);return fs(ws({$os:n,$os_version:s,$browser:gn(ss,navigator.vendor),$device:yn(ss),$device_type:bn(ss),$timezone:hf(),$timezone_offset:pf()}),{$current_url:Rs(null==ts?void 0:ts.href,i,rf),$host:null==ts?void 0:ts.host,$pathname:null==ts?void 0:ts.pathname,$raw_user_agent:ss.length>1e3?ss.substring(0,997)+"...":ss,$browser_version:_n(ss,navigator.vendor),$browser_language:lf(),$browser_language_prefix:(r=lf(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Gn?void 0:Gn.screen.height,$screen_width:null==Gn?void 0:Gn.screen.width,$viewport_height:null==Gn?void 0:Gn.innerHeight,$viewport_width:null==Gn?void 0:Gn.innerWidth,$lib:"web",$lib_version:us.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var gf=hs("[Web Vitals]"),ff=9e5;class _f{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this._buffer.metrics.length&&(this._instance.capture("$web_vitals",this._buffer.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(ri(i))gf.error("Could not read session ID. Dropping metrics!");else{this._buffer=this._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this._currentURL();if(!ri(n))if(oi(null==e?void 0:e.name)||oi(null==e?void 0:e.value))gf.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)gf.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this._buffer.url!==n&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),ri(this._buffer.url)&&(this._buffer.url=n),this._buffer.firstMetricTimestamp=ri(this._buffer.firstMetricTimestamp)?Date.now():this._buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this._buffer.metrics.push(r({},e,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this._buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}},this._startCapturing=()=>{if(!this._initialized){var e,t,r,i,n=os.__PosthogExtensions__;ri(n)||ri(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._addToBuffer.bind(this)),this._initialized=!0):gf.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[Vs]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=ei(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return oi(r)?(null==(t=this._instance.persistence)?void 0:t.props[Ws])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ei(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=ei(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=e&&e}get _maxAllowedValue(){var e=ei(this._instance.config.capture_performance)&&ai(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:ff;return 0<e&&e<=6e4?ff:e}get isEnabled(){var e=null==ts?void 0:ts.protocol;if("http:"!==e&&"https:"!==e)return gf.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=ei(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ui(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ui(t)?t:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(gf.info("enabled, starting..."),this._loadScript(this._startCapturing))}onRemoteConfig(e){var t=ei(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ei(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Vs]:t}),this._instance.persistence.register({[Ws]:r})),this._enabledServerSide=t,this.startIfEnabled()}_loadScript(e){var t,r;if(null!=(t=os.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks)e();else{var i=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,i,(t=>{t?gf.error("failed to load script",t):e()}))}}_currentURL(){var e=Gn?Gn.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=t?_s([],ef,r||[]):[];return Rs(e,i,rf)}gf.error("Could not determine current URL")}}var mf=hs("[Heatmaps]");function yf(e){return ei(e)&&"clientX"in e&&"clientY"in e&&ai(e.clientX)&&ai(e.clientY)}class bf{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[Hs]),this.rageclicks=new ug(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return ei(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return oi(this.instance.config.capture_heatmaps)?oi(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;mf.info("starting..."),this._setupListeners(),this._onVisibilityChange()}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this._removeListeners(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Hs]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this._buffer;return this._buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_onVisibilityChange(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(es)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null}_setupListeners(){Gn&&es&&(this._flushHandler=this._flush.bind(this),Es(Gn,"beforeunload",this._flushHandler),this._onClickHandler=e=>this._onClick(e||(null==Gn?void 0:Gn.event)),Es(es,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=e=>this._onMouseMove(e||(null==Gn?void 0:Gn.event)),Es(es,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Dg(this.instance,Og,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),Es(es,"visibilitychange",this._onVisibilityChange_handler),this._initialized=!0)}_removeListeners(){var e;Gn&&es&&(this._flushHandler&&Gn.removeEventListener("beforeunload",this._flushHandler),this._onClickHandler&&es.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&es.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&es.removeEventListener("visibilitychange",this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(e,t,r){for(var i=e;i&&go(i)&&!fo(i,"body");){if(i===r)return!1;if($r(t,null==Gn?void 0:Gn.getComputedStyle(i).position))return!0;i=xo(i)}return!1}(Io(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}_onClick(e,t){var i;if(void 0===t&&(t="click"),!vo(e.target)&&yf(e)){var n=this._getProperties(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(r({},n,{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){!vo(e.target)&&yf(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(Gn){var t=Gn.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?_s([],ef,i||[]):[],s=Rs(t,n,rf);this._buffer=this._buffer||{},this._buffer[s]||(this._buffer[s]=[]),this._buffer[s].push(e)}}_flush(){this._buffer&&!ti(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class wf{constructor(e){this._onSessionIdChange=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(ds.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this._currentPageview=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}_setupSessionRotationHandler(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)}destroy(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0}doPageView(e,t){var r,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(r=null==Gn?void 0:Gn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=n;if(!(ri(s)||ri(o)||ri(a)||ri(l)||ri(u)||ri(c))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=s<=1?1:mi(o/s,0,1,ds),h=s<=1?1:mi(a/s,0,1,ds),p=l<=1?1:mi(u/l,0,1,ds),v=l<=1?1:mi(c/l,0,1,ds);i=fs(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var Sf=hs("[FeatureFlags]"),Cf=hs("[FeatureFlags]",{debugEnabled:!0}),If="errors_while_computing_flags",kf="flag_missing",Ef="quota_limited",xf="timeout",Tf="connection_error",Mf="unknown_error",Rf=e=>"api_error_"+e,Af="$active_feature_flags",Pf="$override_feature_flags",Lf="$feature_flag_payloads",Nf="$override_feature_flag_payloads",Of="$feature_flag_request_id",Ff="$feature_flag_evaluated_at",Df=e=>{var t={};for(var[r,i]of ms(e||{}))i&&(t[r]=i);return t},Hf=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):Sf.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},Bf=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class qf{constructor(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsCalled=!1,this._flagsLoadedFromRemote=!1,this._hasLoggedDeprecationWarning=!1,this._instance=e,this.featureFlagEventHandlers=[]}_getValidEvaluationEnvironments(){var e,t=null!==(e=this._instance.config.evaluation_contexts)&&void 0!==e?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this._hasLoggedDeprecationWarning||(Sf.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._hasLoggedDeprecationWarning=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||Sf.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}_shouldIncludeEvaluationEnvironments(){return this._getValidEvaluationEnvironments().length>0}flags(){if(this._instance.config.__preview_remote_config)this._flagsCalled=!0;else{var e=!this._reloadDebouncer&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this._callFlagsEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Ks),t=this._instance.get_property(Pf),i=this._instance.get_property(Nf);if(!i&&!t)return e||{};var n=fs({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],c=null==t?void 0:t[o],d=ri(c)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!c,h=ri(c)?u.variant:"string"==typeof c?c:void 0,p=null==i?void 0:i[o],v=r({},u,{enabled:d,variant:d?null!=h?h:null==u?void 0:u.variant:void 0});if(d!==(null==u?void 0:u.enabled)&&(v.original_enabled=null==u?void 0:u.enabled),h!==(null==u?void 0:u.variant)&&(v.original_variant=null==u?void 0:u.variant),p)v.metadata=r({},null==u?void 0:u.metadata,{payload:p,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload});n[o]=v}return this._override_warning||(Sf.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this._override_warning=!0),n}getFlagVariants(){var e=this._instance.get_property(Ys),t=this._instance.get_property(Pf);if(!t)return e||{};for(var r=fs({},e),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this._override_warning||(Sf.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this._instance.get_property(Lf),t=this._instance.get_property(Nf);if(!t)return e||{};for(var r=fs({},e||{}),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this._override_warning||(Sf.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this._instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._instance._internalEventEmitter.emit("featureFlagsReloading",!0),this._reloadDebouncer=setTimeout((()=>{this._callFlagsEndpoint()}),5))}_clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callFlagsEndpoint(e){var t;if(this._clearDebouncer(),!this._instance._shouldDisableFlags())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),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==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Js)||{}),group_properties:this._instance.get_property(Qs)};si(n)||ri(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this._shouldIncludeEvaluationEnvironments()&&(s.evaluation_contexts=this._getValidEvaluationEnvironments());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);o&&(s.timezone=hf()),this._requestInFlight=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this._instance.config.disable_compression?void 0:su.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n,o=!0;(200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),o=!1),this._requestInFlight=!1,this._flagsCalled)||(this._flagsCalled=!0,this._instance._onRemoteConfig(null!==(n=e.json)&&void 0!==n?n:{}));if(!s.disable_flags||this._additionalReloadRequested){this._flagsLoadedFromRemote=!o;var a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?xf:Tf):a.push(Mf):200!==e.statusCode&&a.push(Rf(e.statusCode)),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push(If);var l=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes(Bf.FeatureFlags));if(l&&a.push(Ef),null==(i=this._instance.persistence)||i.register({[ro]:a}),l)Sf.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{var u;if(!s.disable_flags)this.receivedFeatureFlags(null!==(u=e.json)&&void 0!==u?u:{},o);this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callFlagsEndpoint())}}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}Sf.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this._instance.get_property(Of)||void 0,l=this._instance.get_property(Ff)||void 0,u=this._instance.get_property(to)||{};if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var c,d,h,p,v,g,f,_,m,y;Kr(u[e])?u[e].push(o):u[e]=[o],null==(c=this._instance.persistence)||c.register({[to]:u});var b=this.getFeatureFlagDetails(e),w=[...null!==(d=this._instance.get_property(ro))&&void 0!==d?d:[]];ri(n)&&w.push(kf);var S={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(h=this._instance.config.bootstrap)||null==(h=h.featureFlags)?void 0:h[e])||null,$feature_flag_bootstrapped_payload:(null==(p=this._instance.config.bootstrap)||null==(p=p.featureFlagPayloads)?void 0:p[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};ri(null==b||null==(v=b.metadata)?void 0:v.version)||(S.$feature_flag_version=b.metadata.version);var C,I=null!==(g=null==b||null==(f=b.reason)?void 0:f.description)&&void 0!==g?g:null==b||null==(_=b.reason)?void 0:_.code;if(I&&(S.$feature_flag_reason=I),null!=b&&null!=(m=b.metadata)&&m.id&&(S.$feature_flag_id=b.metadata.id),ri(null==b?void 0:b.original_variant)&&ri(null==b?void 0:b.original_enabled)||(S.$feature_flag_original_response=ri(b.original_variant)?b.original_enabled:b.original_variant),null!=b&&null!=(y=b.metadata)&&y.original_payload)S.$feature_flag_original_payload=null==b||null==(C=b.metadata)?void 0:C.original_payload;w.length&&(S.$feature_flag_error=w.join(",")),this._instance.capture("$feature_flag_called",S)}if(i){var k=s;if(!ri(s))try{k=JSON.parse(s)}catch(e){}return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k}}}else Sf.warn('getFeatureFlagResult for key "'+e+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(e,t){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this._shouldIncludeEvaluationEnvironments()&&(i.evaluation_contexts=this._getValidEvaluationEnvironments()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:su.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return ri(r)?void 0:!!r}Sf.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this._instance.persistence){this._hasLoadedFlags=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,i,n,s){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var o=Hf(e),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var c=e.requestId,d=e.evaluatedAt;if(Kr(l)){Sf.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var p=0;p<l.length;p++)h[l[p]]=!0;t&&t.register({[Af]:l,[Ys]:h})}else{var v=l,g=u,f=a;if(e.errorsWhileComputingFlags)if(a){var _=new Set(Object.keys(a).filter((e=>{var t;return!(null!=(t=a[e])&&t.failed)})));v=r({},i,Object.fromEntries(Object.entries(v).filter((e=>{var[t]=e;return _.has(t)})))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return _.has(t)})))),f=r({},s,Object.fromEntries(Object.entries(f||{}).filter((e=>{var[t]=e;return _.has(t)}))))}else v=r({},i,v),g=r({},n,g),f=r({},s,f);t&&t.register(r({[Af]:Object.keys(Df(v)),[Ys]:v||{},[Lf]:g||{},[Ks]:f||{}},c?{[Of]:c}:{},d?{[Ff]:d}:{}))}}}(e,this._instance.persistence,i,n,s),this._fireFeatureFlagsCallbacks(t)}}override(e,t){void 0===t&&(t=!1),Sf.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Sf.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(Pf),this._instance.persistence.unregister(Nf),this._fireFeatureFlagsCallbacks(),Cf.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,r=e;if(this._override_warning=Boolean(null!==(t=r.suppressWarning)&&void 0!==t&&t),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(Pf),Cf.info("Flag overrides cleared");else if(r.flags){if(Kr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[Pf]:i})}else this._instance.persistence.register({[Pf]:r.flags});Cf.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(Nf),Cf.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Nf]:r.payloads}),Cf.info("Payload overrides set",{payloads:r.payloads}))),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this._instance.get_property(Xs)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$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(),{[e]:t});null==(n=this._instance.persistence)||n.register({[Af]:Object.keys(Df(l)),[Ys]:l}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._instance.get_property(Xs),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Xs),null==(i=this._instance.persistence)||i.register({[Xs]:n}),e(n)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Js)||{};this._instance.register({[Js]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Js)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Qs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[Qs]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Qs)||{};this._instance.register({[Qs]:r({},t,{[e]:{}})})}else this._instance.unregister(Qs)}reset(){this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsCalled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1}}var Uf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Vf{constructor(e,t){this._config=e,this.props={},this._campaign_params_saved=!1,this._name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this._storage=this._buildStorage(e),this.load(),e.debug&&ds.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._disabled}_buildStorage(e){-1===Uf.indexOf(e.persistence.toLowerCase())&&(ds.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(e){void 0===e&&(e=[]);var t=[...xg,...e];return r({},Eg,{_parse:function(e){try{var t={};try{t=Ig._parse(e)||{}}catch(e){}var r=fs(t,JSON.parse(Eg._get(e)||"{}"));return Eg._set(e,r),r}catch(e){}return null},_set:function(e,r,i,n,s,o){try{Eg._set(e,r,void 0,void 0,o);var a={};t.forEach((e=>{r[e]&&(a[e]=r[e])})),Object.keys(a).length&&Ig._set(e,a,i,n,s,o)}catch(e){Eg._error(e)}},_remove:function(e,t){try{null==Gn||Gn.localStorage.removeItem(e),Ig._remove(e,t)}catch(e){Eg._error(e)}}})}(e.cookie_persisted_properties||[]),i=e.persistence.toLowerCase();return"localstorage"===i&&Eg._is_supported()?Eg:"localstorage+cookie"===i&&t._is_supported()?t:"sessionstorage"===i&&Ag._is_supported()?Ag:"memory"===i?Mg:"cookie"===i?Ig:t._is_supported()?t:Ig}properties(){var e={};return gs(this.props,(function(t,r){if(r===Ys&&ei(t))for(var i=Object.keys(t),n=0;n<i.length;n++)e["$feature/"+i[n]]=t[i[n]];else o=r,a=!1,(si(s=po)?a:Jn&&s.indexOf===Jn?-1!=s.indexOf(o):(gs(s,(function(e){if(a||(a=e===o))return ps})),a))||(e[r]=t);var s,o,a})),e}load(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=fs({},e))}}save(){this._disabled||this._storage._set(this._name,this.props,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)}remove(){this._storage._remove(this._name,!1),this._storage._remove(this._name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(ei(e)){ri(t)&&(t="None"),this._expire_days=ri(r)?this._default_expiry:r;var i=!1;if(gs(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(ei(e)){this._expire_days=ri(t)?this._default_expiry:t;var r=!1;if(gs(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=sf(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);ti(ws(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==es?void 0:es.referrer)?af(e):{})}update_referrer_info(){var e;this.register_once({$referrer:uf(),$referring_domain:null!=es&&es.referrer&&(null==(e=xs(es.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[oo]||this.props[ao]||this.register_once({[lo]:cf(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};gs([ao,oo],(t=>{var r=this.props[t];r&&gs(r,(function(t,r){e["$initial_"+zr(r)]=t}))}));var t,r,i=this.props[lo];if(i){var n=(t=df(i),r={},gs(t,(function(e,t){r["$initial_"+zr(t)]=e})),r);fs(e,n)}return e}safe_merge(e){return gs(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var i=this._buildStorage(e),n=this.props;this.clear(),this._storage=i,this.props=n,this.save()}}set_disabled(e){this._disabled=e,this._disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove(),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Fs]||{};r[e]=t,this.props[Fs]=r,this.save()}remove_event_timer(e){var t=(this.props[Fs]||{})[e];return ri(t)||(delete this.props[Fs][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var jf=hs("[Product Tours]"),$f="ph_product_tours";class Wf{constructor(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[$s]:!(null==e||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,t;this._productTourManager||((e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property($s))||this._loadScript((()=>this._startProductTours()))}_loadScript(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?jf.error("Could not load product tours script",t):e()}))}_startProductTours(){var e;!this._productTourManager&&null!=(e=os.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=os.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Kr(this._cachedTours)||t){var r=this._instance.persistence;if(r){var i=r.props[$f];if(Kr(i)&&!t)return this._cachedTours=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return jf.error(n),void e([],{isLoaded:!1,error:n})}var s=Kr(t.json.product_tours)?t.json.product_tours:[];this._cachedTours=s,r&&r.register({[$f]:s}),e(s,{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})}getActiveProductTours(e){oi(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this._productTourManager)||t.showTourById(e)}previewTour(e){this._productTourManager?this._productTourManager.previewTour(e):this._loadScript((()=>{var t;this._startProductTours(),null==(t=this._productTourManager)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this._productTourManager)||e.nextStep()}previousStep(){var e;null==(e=this._productTourManager)||e.previousStep()}clearCache(){var e;this._cachedTours=null,null==(e=this._instance.persistence)||e.unregister($f)}resetTour(e){var t;null==(t=this._productTourManager)||t.resetTour(e)}resetAllTours(){var e;null==(e=this._productTourManager)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)}}class zf{constructor(){this._events={},this._events={}}on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this._events[e]||[])r(t);for(var i of this._events["*"]||[])i(e,t)}}function Zf(e,t,r){if(oi(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class Gf{constructor(e){this._debugEventEmitter=new zf,this._checkStep=(e,t)=>this._checkStepEvent(e,t)&&this._checkStepUrl(e,t)&&this._checkStepElement(e,t)&&this._checkStepProperties(e,t),this._checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this._actionEvents=new Set,this._actionRegistry=new Set}init(){var e;if(!ri(null==(e=this._instance)?void 0:e._addCaptureHook)){var t;null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,r;if(!ri(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this._actionRegistry)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this._actionEvents)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(null==t?void 0:t.event))&&this._actionRegistry&&(null==(r=this._actionRegistry)?void 0:r.size)>0&&this._actionRegistry.forEach((e=>{this._checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}_checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this._checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}_checkStepUrl(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Zf(i,t.url,t.url_matching||"contains"))return!1}return!0}_checkStepElement(e,t){return!!this._checkStepHref(e,t)&&(!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t))}_checkStepHref(e,t){var r;if(null==t||!t.href)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some((e=>Zf(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&Zf((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}_checkStepText(e,t){var r;if(null==t||!t.text)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some((e=>Zf(e.text,t.text,t.text_matching||"exact")||Zf(e.$el_text,t.text,t.text_matching||"exact")));var n,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!oi(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),s=t.text,o=t.text_matching||"exact",n.some((e=>Zf(e,s,o))))}_checkStepSelector(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}_getElementsList(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}_checkStepProperties(e,t){return null==t||!t.properties||0===t.properties.length||Ku(t.properties.reduce(((e,t)=>{var r=Kr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class Yf{constructor(e){this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}_doesEventMatchFilter(e,t){return!!e&&Ku(e.propertyFilters,null==t?void 0:t.properties)}_buildEventToItemMap(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}_getMatchingItems(e,t,r){var i=(r===xl.Activation?this._eventToItems:this._cancelEventToItems).get(e),n=[];return this._getItems((e=>{n=e.filter((e=>null==i?void 0:i.includes(e.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this._doesEventMatchFilter(s,t)}))}register(e){var t;ri(null==(t=this._instance)?void 0:t._addCaptureHook)||(this._setupEventBasedItems(e),this._setupActionBasedItems(e))}_setupActionBasedItems(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==t.length){if(null==this._actionMatcher){this._actionMatcher=new Gf(this._instance),this._actionMatcher.init();this._actionMatcher._addActionHook((e=>{this.onAction(e)}))}t.forEach((e=>{var t,r,i,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this._actionMatcher)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((t=>{if(t&&t.name){var r=this._actionToItems.get(t.name);r&&r.push(e.id),this._actionToItems.set(t.name,r||[e.id])}})))}))}}_setupEventBasedItems(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this._eventToItems=this._buildEventToItemMap(e,xl.Activation),this._cancelEventToItems=this._buildEventToItemMap(e,xl.Cancellation)}}onEvent(e,t){var r,i=this._getLogger(),n=this._getActivatedKey(),s=this._getShownEventName(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===e&&t&&o.length>0){var a,l;i.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var c=o.indexOf(u);c>=0&&(o.splice(c,1),this._updateActivatedItems(o))}}else{if(this._cancelEventToItems.has(e)){var d=this._getMatchingItems(e,t,xl.Cancellation);d.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);t>=0&&o.splice(t,1),this._cancelPendingItem(e.id)})),this._updateActivatedItems(o))}if(this._eventToItems.has(e)){i.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var h=this._getMatchingItems(e,t,xl.Activation);this._updateActivatedItems(o.concat(h.map((e=>e.id))||[]))}}}onAction(e){var t,r=this._getActivatedKey(),i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[r])||[];this._actionToItems.has(e)&&this._updateActivatedItems(i.concat(this._actionToItems.get(e)||[]))}_updateActivatedItems(e){var t,r=this._getLogger(),i=this._getActivatedKey(),n=[...new Set(e)].filter((e=>!this._isItemPermanentlyIneligible(e)));r.info("updating activated items",{activatedItems:n}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[i]:n})}getActivatedIds(){var e,t=this._getActivatedKey(),r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return r||[]}getEventToItemsMap(){return this._eventToItems}_getActionMatcher(){return this._actionMatcher}}class Xf extends Yf{constructor(e){super(e)}_getActivatedKey(){return"$surveys_activated"}_getShownEventName(){return Ol.SHOWN}_getItems(e){var t;null==(t=this._instance)||t.getSurveys(e)}_cancelPendingItem(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}_getLogger(){return Hl}_isItemPermanentlyIneligible(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Kf{constructor(e){this._isSurveysEnabled=void 0,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(oi(t))return Hl.warn("Flags not loaded yet. Not loading surveys.");var r=Kr(t);this._isSurveysEnabled=r?t.length>0:t,Hl.info("flags response received, isSurveysEnabled: "+this._isSurveysEnabled),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(null!=r&&r.startsWith(Vl)||null!=r&&r.startsWith(jl))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)Hl.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Hl.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Hl.info("Not loading surveys in cookieless mode without consent.");else{var e=null==os?void 0:os.__PosthogExtensions__;if(e){if(!ri(this._isSurveysEnabled)||this._instance.config.advanced_enable_surveys){var t=this._isSurveysEnabled||this._instance.config.advanced_enable_surveys;this._isInitializingSurveys=!0;try{var r=e.generateSurveys;if(r)return void this._completeSurveyInitialization(r,t);var i=e.loadExternalDependency;if(!i)return void this._handleSurveyLoadError("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this._handleSurveyLoadError("Could not load surveys script",r):this._completeSurveyInitialization(e.generateSurveys,t)}))}catch(e){throw this._handleSurveyLoadError("Error initializing surveys",e),e}finally{this._isInitializingSurveys=!1}}}else Hl.error("PostHog Extensions not found.")}}_completeSurveyInitialization(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Xf(this._instance),Hl.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})}_handleSurveyLoadError(e,t){Hl.error(e,t),this._notifySurveyCallbacks({isLoaded:!1,error:e})}onSurveysLoaded(e){return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return Hl.info("Disabled. Not loading surveys."),e([]);var r,i=this._instance.get_property(eo);if(i&&!t)return e(i,{isLoaded:!0});"undefined"!=typeof Promise&&this._getSurveysInFlightPromise?this._getSurveysInFlightPromise.then((t=>{var{surveys:r,context:i}=t;return e(r,i)})):("undefined"!=typeof Promise&&(this._getSurveysInFlightPromise=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var i;this._getSurveysInFlightPromise=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;Hl.error(s);var o={isLoaded:!1,error:s};return e([],o),void(null==r||r({surveys:[],context:o}))}var a,l=t.json.surveys||[],u=l.filter((e=>Bl(e)&&(ql(e)||Ul(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u));null==(i=this._instance.persistence)||i.register({[eo]:l});var c={isLoaded:!0};e(l,c),null==r||r({surveys:l,context:c})}}))}_notifySurveyCallbacks(e){for(var t of this._surveyCallbacks)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Hl.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!oi(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Hl.warn("init was not called")}_getSurveyById(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}_checkSurveyEligibility(e){if(oi(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(oi(this._surveyManager))return Hl.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return oi(this._surveyManager)?(Hl.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var s=this._checkSurveyEligibility(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var i;if(oi(this._surveyManager))Hl.warn("init was not called");else{var n="string"==typeof e?this._getSurveyById(e):e;if(null!=n&&n.id)if(Gl.includes(n.type)){var s=null==es?void 0:es.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Hl.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Hl.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),Hl.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Hl.warn("Survey element not found")}else Hl.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Hl.warn("Survey not found")}}displaySurvey(e,t){var i;if(oi(this._surveyManager))Hl.warn("init was not called");else{var n=this._getSurveyById(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Dl.Popover&&t.initialResponses&&Hl.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Hl.warn("Survey is not eligible to be displayed: ",o.disabledReason)}t.displayType!==Dl.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else Hl.warn("Survey not found")}}cancelPendingSurvey(e){oi(this._surveyManager)?Hl.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var Jf=hs("[Conversations]");class Qf{constructor(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;oi(t)||(ui(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null}loadIfEnabled(){if(!this._conversationsManager&&!this._isInitializing&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==os?void 0:os.__PosthogExtensions__;if(e&&!ri(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){this._isInitializing=!0;try{var t=e.initConversations;if(t)return this._completeInitialization(t),void(this._isInitializing=!1);var r=e.loadExternalDependency;if(!r)return void this._handleLoadError("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(t=>{t||!e.initConversations?this._handleLoadError("Could not load conversations script",t):this._completeInitialization(e.initConversations),this._isInitializing=!1}))}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}else Jf.error("Conversations enabled but missing token in remote config.")}}_completeInitialization(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),Jf.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else Jf.error("Cannot complete initialization: remote config is null")}_handleLoadError(e,t){Jf.error(e,t),this._conversationsManager=null,this._isInitializing=!1}show(){this._conversationsManager?this._conversationsManager.show():Jf.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._isConversationsEnabled&&!si(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(Jf.warn("Conversations not available yet."),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(Jf.warn("Conversations not available yet."),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(Jf.warn("Conversations not available yet."),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(Jf.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}}class e_{constructor(e){var t;this._isLogsEnabled=!1,this._isLoaded=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0)}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!oi(r)&&r&&(this._isLogsEnabled=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this._isLogsEnabled&&!this._isLoaded){var e=hs("[logs]"),t=null==os?void 0:os.__PosthogExtensions__;if(t){var r=t.loadExternalDependency;r?r(this._instance,"logs",(r=>{var i;r||null==(i=t.logs)||!i.initializeLogs?e.error("Could not load logs script",r):(t.logs.initializeLogs(this._instance),this._isLoaded=!0)})):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var t_=hs("[RateLimiter]");class r_{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{t_.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void t_.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(so))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=a.tokens<1;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(so,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var i_=hs("[RemoteConfig]");class n_{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=os._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(i_.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return i_.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void i_.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return i_.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this._onRemoteConfig(e)}));this._onRemoteConfig(e)}))}catch(e){i_.error("Error loading remote config",e)}}_onRemoteConfig(e){e?this._instance.config.__preview_remote_config?(this._instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):i_.info("__preview_remote_config is disabled. Logging config instead",e):i_.error("Failed to fetch remote config from PostHog.")}}var s_=3e3;class o_{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=mi((null==t?void 0:t.flush_interval_ms)||s_,250,5e3,ds.createLogger("flush interval"),s_),this._sendRequest=e}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){this._clearFlushTimeout();var e=this._queue.length>0?this._formatQueue():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this._sendRequest(r({},e,{transport:"sendBeacon"}))}))}enable(){this._isPaused=!1,this._setFlushTimeout()}_setFlushTimeout(){var e=this;this._isPaused||(this._flushTimeout=setTimeout((()=>{if(this._clearFlushTimeout(),this._queue.length>0){var t=this._formatQueue(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Kr(r.data)&&gs(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e._sendRequest(r)};for(var i in t)r()}}),this._flushTimeoutMs))}_clearFlushTimeout(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0}_formatQueue(){var e={};return gs(this._queue,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;ri(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this._queue=[],e}}var a_=["retriesPerformedSoFar"];class l_{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!ri(Gn)&&"onLine"in Gn.navigator&&(this._areWeOnline=Gn.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},Es(Gn,"online",this._onlineListener),Es(Gn,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,a_);li(t)&&(n.url=ju(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this._enqueue(r({retriesPerformedSoFar:t},n)):null==n.callback||n.callback(e)}}))}_enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(t),i=Date.now()+r;this._queue.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ds.warn(n),this._isPolling||(this._isPolling=!0,this._poll())}_poll(){if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout((()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._poll()}),this._pollIntervalMs)}_flush(){var e=Date.now(),t=[],r=this._queue.filter((r=>r.retryAt<e||(t.push(r),!1)));if(this._queue=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,ri(Gn)||(this._onlineListener&&(Gn.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Gn.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0)),this._queue))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){ds.error(e)}this._queue=[]}}class u_{constructor(e){this._updateScrollData=()=>{var e,t,r,i;this._context||(this._context={});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._context.lastScrollY=Math.ceil(s),this._context.maxScrollY=Math.max(s,null!==(e=this._context.maxScrollY)&&void 0!==e?e:0),this._context.maxScrollHeight=Math.max(o,null!==(t=this._context.maxScrollHeight)&&void 0!==t?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!==(r=this._context.maxContentY)&&void 0!==r?r:0),this._context.maxContentHeight=Math.max(l,null!==(i=this._context.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){Es(Gn,"scroll",this._updateScrollData,{capture:!0}),Es(Gn,"scrollend",this._updateScrollData,{capture:!0}),Es(Gn,"resize",this._updateScrollData)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Gn?void 0:Gn.document.documentElement;var e=Kr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var r=null==Gn?void 0:Gn.document.querySelector(t);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Gn&&(Gn.scrollY||Gn.pageYOffset||Gn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Gn&&(Gn.scrollX||Gn.pageXOffset||Gn.document.documentElement.scrollLeft)||0}}var c_=e=>cf(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class d_{constructor(e,t,r,i){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[no]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||c_,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[no]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?df(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return gs(ws(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+zr(r)]=t})),e}}var h_=hs("[SessionId]");class p_{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,r){var i;if(this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._eventEmitter=new zf,this._sessionHasBeenIdleTooLong=(e,t)=>!(!li(e)||!li(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||ru,this._windowIdGenerator=r||ru;var n=this._config.persistence_name||this._config.token,s=this._config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*mi(s,60,36e3,h_.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+n+"_window_id",this._primary_window_exists_storage_key="ph_"+n+"_primary_window_exists",this._canUseSessionStorage()){var o=Ag._parse(this._window_id_storage_key),a=Ag._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:Ag._remove(this._window_id_storage_key),Ag._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this._config.bootstrap.sessionID);this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){h_.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ri(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&Ag._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ag._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ag._parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this._persistence.register({[Zs]:[t,e,r]}))}_getSessionId(){var e=this._persistence.props[Zs];return Kr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}destroy(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&Gn&&(Gn.removeEventListener("beforeunload",this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._canUseSessionStorage()&&Ag._remove(this._primary_window_exists_storage_key)},Es(Gn,"beforeunload",this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,n,s]=this._getSessionId(),o=this._getWindowId(),a=li(s)&&Math.abs(r-s)>864e5,l=!1,u=!n,c=!u&&!e&&this._sessionHasBeenIdleTooLong(r,i);u||c||a?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),h_.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),s=r,l=!0):o||(o=this._windowIdGenerator(),l=!0);var d=!!li(i)&&e&&!a?i:r,h=!li(s)?(new Date).getTime():s;return this._setWindowId(o),this._setSessionId(n,d,h),e||this._resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(n,o,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}_resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{var[e]=this._getSessionId();if(this._sessionHasBeenIdleTooLong((new Date).getTime(),e)){var t=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var v_=["$set_once","$set"],g_=hs("[SiteApps]");class f_{constructor(e){this._instance=e,this._bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}_eventCollector(e,t){if(t){var r=this.globalsForEvent(t);this._bufferedInvocations.push(r),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}}get siteAppLoaders(){var e;return null==(e=os._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=()=>{e(),this._bufferedInvocations=[],this._stopBuffering=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))c[p]={id:d[p],type:p,properties:v};var{$set_once:g,$set:f}=e;return{event:r({},i(e,v_),{properties:r({},e.properties,f?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},f)}:{},g?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},g)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;(!t.errored&&this._bufferedInvocations.length&&(g_.info("Processing "+this._bufferedInvocations.length+" events for site app with id "+e.id),this._bufferedInvocations.forEach((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored)))&&(null==(r=this._stopBuffering)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,g_.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:e=>{n(e)}});s&&(t.processEvent=s),i=!0}catch(t){g_.error("Error while initializing PostHog app with config id "+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){g_.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}_setupSiteApps(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}_onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(t)}catch(t){g_.error("Error while processing event "+e.event+" for site app "+r.id,t)}}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",(e=>this._onCapturedEvent(e)))):void g_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._stopBuffering)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var s=function(e){var t;os["__$$ph_site_app_"+e]=n._instance,null==(t=os.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return g_.error("Error while initializing PostHog app with config id "+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else g_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var __=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&jr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>jr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},m_=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),y_="i.posthog.com";class b_{constructor(e){this._regionCache={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+y_,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=m_.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=m_.EU:this._regionCache[this.apiHost]=m_.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===m_.CUSTOM)return this.apiHost+t;var r=y_+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var w_={icontains:(e,t)=>!!Gn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Gn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Gn&&Zu(t.href,e),not_regex:(e,t)=>!!Gn&&!Zu(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class S_{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{S_._logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t._flagToExperiments)S_._logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t._flagToExperiments)||r.set(e.feature_flag_key,e);var i=t._instance.getFeatureFlag(e.feature_flag_key);ii(i)&&e.variants[i]&&t._applyTransforms(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];S_._matchesTestVariant(s)&&t._applyTransforms(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())S_._logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(oi(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();S_._logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!=(t=this._flagToExperiments)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this._flagToExperiments)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this._applyTransforms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=S_.getWindowLocation();if(null!=e&&e.search){var t=Ms(null==e?void 0:e.search,"__experiment_id"),r=Ms(null==e?void 0:e.search,"__experiment_variant");t&&r&&(S_._logInfo("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this._showPreviewWebExperiment(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var r=t.json.experiments||[];return e(r)}})}_showPreviewWebExperiment(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(S_._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this._applyTransforms(i[0].name,t,i[0].variants[t].transforms))}static _matchesTestVariant(e){return!oi(e.conditions)&&(S_._matchUrlConditions(e)&&S_._matchUTMConditions(e))}static _matchUrlConditions(e){var t;if(oi(e.conditions)||oi(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,s=S_.getWindowLocation();return!!s&&(null==(r=e.conditions)||!r.url||w_[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==Gn?void 0:Gn.location}static _matchUTMConditions(e){var t;if(oi(e.conditions)||oi(null==(t=e.conditions)?void 0:t.utm))return!0;var r=sf();if(r.utm_source){var i,n,s,o,a,l,u,c,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==r.utm_term;return d&&p&&v&&h}return!1}static _logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];ds.info("[WebExperiments] "+e,r)}_applyTransforms(e,t,r){this._is_bot()?S_._logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var i;S_._logInfo("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):S_._logInfo("Control variants leave the page unmodified.")}_is_bot(){return Qn&&this._instance?__(Qn,this._instance.config.custom_blocked_useragents):void 0}}var C_=hs("[PostHog ExternalIntegrations]"),I_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class k_{constructor(e){this._instance=e}_loadScript(e,t){var r;null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return C_.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;(!i||null!=(r=os.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e._loadScript(I_[t],(()=>{var r;null==(r=os.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=os.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t])&&(null==(s=os.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[t])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(r)}}}hs("[SessionRecording]");var E_="[SessionRecording]",x_=hs(E_);class T_{get started(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}get status(){return this._lazyLoadedSessionRecording?this._lazyLoadedSessionRecording.status:this._receivedFlags&&!this._isRecordingEnabled?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._receivedFlags=!1,this._hasRequestedConfigRefresh=!1,this._persistFlagsOnSessionListener=void 0,this._instance=e,!this._instance.sessionManager)throw x_.error("started without valid sessionManager"),new Error(E_+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(E_+' cannot be used with cookieless_mode="always"')}get _isRecordingEnabled(){var e,t=!(null==(e=this._instance.get_property(zs))||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Gn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||null==(t=this._lazyLoadedSessionRecording)||!t.isStarted){var r=!ri(Object.assign)&&!ri(Array.from);this._isRecordingEnabled&&r?(this._lazyLoadAndStart(e),x_.info("starting")):this.stopRecording()}}_lazyLoadAndStart(e){var t,r,i;this._isRecordingEnabled&&(null!=os&&null!=(t=os.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=os.__PosthogExtensions__)&&r.initSessionRecording?this._onScriptLoaded(e):null==(i=os.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,(t=>{if(t)return x_.error("could not load recorder",t);this._onScriptLoaded(e)})))}stopRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()}_resetSampling(){var e;null==(e=this._instance.persistence)||e.unregister(Gs)}_persistRemoteConfig(e){if(this._instance.persistence){var t,i,n=this._instance.persistence,s=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,s=oi(i)?null:parseFloat(i);oi(s)&&this._resetSampling();var o=null==t?void 0:t.minimumDurationMilliseconds;n.register({[zs]:r({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:s,minimumDurationMilliseconds:ri(o)?null:o,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};s(),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this._hasRequestedConfigRefresh=!1,this._persistRemoteConfig(e),this._receivedFlags=!0,this.startIfEnabledOrStop()):this._receivedFlags=!0:x_.info("skipping remote config with no sessionRecording",e)}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this._lazyLoadedSessionRecording)&&r.log?this._lazyLoadedSessionRecording.log(e,t):x_.warn("log called before recorder was ready")}get _scriptName(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(zs);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}_isRemoteConfigFresh(){var e,t=this._instance.get_property(zs);if(!t)return!1;var r=null!==(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)&&void 0!==e?e:Date.now();return Date.now()-r<=3e5}_onScriptLoaded(e){var t,r;if(null==(t=os.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(r=os.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this._isRemoteConfigFresh()?this._lazyLoadedSessionRecording.start(e):this._hasRequestedConfigRefresh||(this._hasRequestedConfigRefresh=!0,x_.info("persisted remote config is stale, requesting fresh config before starting"),new n_(this._instance).load())}onRRwebEmit(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this._lazyLoadedSessionRecording||(null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}));null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this._lazyLoadedSessionRecording||(null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}));null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()}overrideTrigger(e){var t,r;this._lazyLoadedSessionRecording||(null==(r=this._instance.persistence)||r.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(t=this._lazyLoadedSessionRecording)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this._lazyLoadedSessionRecording)||!r.tryAddCustomEvent(e,t))}}var M_={},R_=()=>{},A_="posthog",P_=!Uu&&-1===(null==ss?void 0:ss.indexOf("MSIE"))&&-1===(null==ss?void 0:ss.indexOf("Mozilla")),L_=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Is(null==es?void 0:es.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:R_,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:ts&&ii(null==ts?void 0:ts.search)&&-1!==ts.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,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Gn||null==(t=Gn.location)?void 0:t.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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;ds.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:s_},error_tracking:{},_onCapture:R_,__preview_eager_load_replay:!1},(e=>({rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},N_=e=>{var t={};ri(e.process_person)||(t.person_profiles=e.process_person),ri(e.xhr_headers)||(t.request_headers=e.xhr_headers),ri(e.cookie_name)||(t.persistence_name=e.cookie_name),ri(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),ri(e.store_google)||(t.save_campaign_params=e.store_google),ri(e.verbose)||(t.debug=e.verbose);var r=fs({},t,e);return Kr(e.property_blacklist)&&(ri(e.property_denylist)?r.property_denylist=e.property_blacklist:Kr(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:ds.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class O_{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){ds.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class F_{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new O_,this._personProcessingSetOncePropertiesSent=!1,this.version=us.LIB_VERSION,this._internalEventEmitter=new zf,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=L_(),this.SentryIntegration=Wg,this.sentryIntegration=e=>function(e,t){var r=$g(e,t);return{name:jg,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new qf(this),this.toolbar=new Xg(this),this.scrollManager=new u_(this),this.pageViewManager=new wf(this),this.surveys=new Kf(this),this.conversations=new Qf(this),this.logs=new e_(this),this.experiments=new S_(this),this.exceptions=new Cv(this),this.rateLimiter=new r_(this),this.requestRouter=new b_(this),this.consent=new Lg(this),this.externalIntegrations=new k_(this),this.people={set:(e,t,r)=>{var i=ii(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=ii(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>ds.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==A_){var i,n=null!==(i=M_[r])&&void 0!==i?i:new F_;return n._init(e,t,r),M_[r]=n,M_[A_][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n;if(void 0===t&&(t={}),ri(e)||ni(e))return ds.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles&&(this._initialPersonProfilesConfig=t.person_profiles),this.set_config(fs({},L_(t.defaults),N_(t),{name:i,token:e})),this.config.on_xhr_error&&ds.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:su.GZipJS;var s=this._is_persistence_disabled();this.persistence=new Vf(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vf(r({},this.config,{persistence:"sessionStorage"}),s);var o=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new o_((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new l_(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new p_(this),this.sessionPropsManager=new d_(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ds.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this._initExtensions(l)}),0)):(ds.info("Initializing extensions synchronously"),this._initExtensions(l)),us.DEBUG=us.DEBUG||this.config.debug,us.DEBUG&&ds.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:o,s:a}),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var u,c,d=this.config.get_device_id(ru()),h=null!=(u=t.bootstrap)&&u.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(io,null!=(c=t.bootstrap)&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var p,v,g=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter((e=>{var r;return!(null==(r=t.bootstrap)||null==(r=r.featureFlags)||!r[e])})).reduce(((e,r)=>{var i;return e[r]=(null==(i=t.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,e}),{}),f=Object.keys((null==(v=t.bootstrap)?void 0:v.featureFlagPayloads)||{}).filter((e=>g[e])).reduce(((e,r)=>{var i,n;null!=(i=t.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(e[r]=null==(n=t.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:f})}if(l)this.register_once({distinct_id:ho,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(ru());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(io,"anonymous")}return Es(Gn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Vg(this,(()=>this._loaded())):this._loaded(),Jr(this.config._onCapture)&&this.config._onCapture!==R_&&(ds.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&ds.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}_initExtensions(e){var t=performance.now();this.historyAutocapture=new qg(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Jg(this).startIfEnabledOrStop()})),r.push((()=>{var e;this.siteApps=new f_(this),null==(e=this.siteApps)||e.init()})),e||r.push((()=>{this.sessionRecording=new T_(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new fg(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new Wf(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new bf(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new _f(this)})),r.push((()=>{this.exceptionObserver=new Bg(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new Dg(this,Fg),this.deadClicksAutocapture.startIfEnabledOrStop()})),r.push((()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._onRemoteConfig(e)}})),this._processInitTaskQueue(r,t)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this._processInitTaskQueue(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){ds.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&ds.info("PostHog extensions initialized ("+i+"ms)")}_onRemoteConfig(e){var t,r,i,n,s,o,a,l,u;if(!es||!es.body)return ds.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=$r(e.supportedCompression,su.GZipJS)?su.GZipJS:$r(e.supportedCompression,su.Base64)?su.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(e),null==(i=this.sessionRecording)||i.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(s=this.heatmaps)||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(o=this.productTours)||o.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(l=this.exceptionObserver)||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){ds.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=ts&&ts.hostname){var e=ts.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this._captureInitialPageview()}),1),new n_(this).load(),this.featureFlags.flags()}_start_queue_if_opted_in(){var e;this.is_capturing()&&(this.config.request_batching&&(null==(e=this._requestQueue)||e.enable()))}_dom_loaded(){this.is_capturing()&&vs(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null==(e=this._requestQueue)||e.unload(),null==(t=this._retryQueue)||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(P_?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ju(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,s=r({},e);s.timeout=s.timeout||6e4,s.url=ju(s.url,{_:(new Date).getTime().toString(),ver:us.LIB_VERSION,compression:s.compression});var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=zu.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=ks(a,(e=>e.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");l(s)})(r({},e,{callback:t=>{var r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,t));null==e.callback||e.callback(t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],i=[],n=[];vs(e,(e=>{e&&(t=e[0],Kr(t)?n.push(e):Jr(e)?e.call(this):Kr(e)&&"alias"===t?r.push(e):Kr(e)&&-1!==t.indexOf("capture")&&Jr(this[t])?n.push(e):i.push(e))}));var s=function(e,t){vs(e,(function(e){if(Kr(e[0])){var r=t;gs(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(n,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!ri(e)&&ii(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=t&&t.$current_url&&!ii(null==t?void 0:t.$current_url)&&(ds.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),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 a=new Date,l=(null==i?void 0:i.timestamp)||a,u=ru(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,t||{},l,u)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&s&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var d="$groupidentify"!==e,h=this._calculate_set_once_properties(null==i?void 0:i.$set_once,d);if(h&&(c.$set_once=h),(c=Ss(c,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,ri(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===Ol.DISMISSED||e===Ol.SENT){var p=null==t?void 0:t[Fl.SURVEY_ID],v=null==t?void 0:t[Fl.SURVEY_ITERATION];Zl({id:p,current_iteration:v}),c.$set=r({},c.$set,{[$l({id:p,current_iteration:v},e===Ol.SENT?"responded":"dismissed")]:!0})}else e===Ol.SHOWN&&(c.$set=r({},c.$set,{[Fl.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var g=r({},c.properties.$set,c.$set);if(ti(g)||this.setPersonPropertiesForFlags(g),!oi(this.config.before_send)){var f=this._runBeforeSend(c);if(!f)return;c=f}this._internalEventEmitter.emit("eventCaptured",c);var _={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._send_retriable_request(_):this._requestQueue.enqueue(_),c}ds.critical("This capture call is ignored due to client rate limiting.")}}else ds.error("No event name provided to posthog.capture")}else ds.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ii(a.distinct_id)&&!ai(a.distinct_id)||ni(a.distinct_id))&&ds.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=vf(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=d,a.$window_id=h}this.sessionPropsManager&&fs(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&fs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===m_.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||s?"$pageleave"!==e||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=fs(a,u),"$pageview"===e&&es&&(a.title=es.title),!ri(o)){var v=i.getTime()-o;a.$duration=parseFloat((v/1e3).toFixed(3))}ss&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=fs({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Kr(this.config.property_denylist)?gs(this.config.property_denylist,(function(e){delete a[e]})):ds.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(ds.error("sanitize_properties is deprecated. Use before_send instead"),a=g(a,e));var f=this._hasPersonProcessing();return a.$process_person_profile=f,f&&!s&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(e,t){var r;if(void 0===t&&(t=!0),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=fs({},i,n||{},e||{}),o=this.config.sanitize_properties;return o&&(ds.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),ti(s)?void 0:s}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},o=r({},n,e),a=r({},s,t),l={};for(var[u,c]of Object.entries(o)){var d="string"==typeof c;l[u]={key:u,enabled:!!d||Boolean(c),variant:d?c:void 0,reason:void 0,metadata:ri(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(e,t,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,r)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=Yl),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ds.uninitializedWarning("posthog.identify");if(ai(e)&&(e=e.toString(),ds.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))ds.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==ho){if(this._requirePersonProcessing("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(Os)&&(this.unregister(Os),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(io)||"anonymous");e!==n&&o?(this.persistence.set_property(io,"identified"),this.setPersonPropertiesForFlags(r({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this._cachedPersonProperties=Gu(e,t,i),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(to))}}else ds.critical('The string "'+ho+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ds.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var i=Gu(this.get_distinct_id(),e,t);this._cachedPersonProperties!==i?(this.setPersonPropertiesForFlags(r({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=i):ds.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}else ds.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n;if(ds.info("reset"),!this.__loaded)return ds.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(io,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ho,$device_id:null},"");else{var o=this.config.get_device_id(ru());this.register_once({distinct_id:o,$device_id:e?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var n,s=null!==(n=e.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(e,t){return e===this.get_property(Ns)?(ds.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(ri(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Os,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ds.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(ei(e)){var i,n,s,o,a,l,u,c;fs(this.config,N_(e));var d=this._is_persistence_disabled();null==(i=this.persistence)||i.update_config(this.config,t,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vf(r({},this.config,{persistence:"sessionStorage"}),d);var h=this._checkLocalStorageForDebug(this.config.debug);ui(h)&&(this.config.debug=h),ui(this.config.debug)&&(this.config.debug?(us.DEBUG=!0,Eg._is_supported()&&Eg._set("ph_debug","true"),ds.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(us.DEBUG=!1,Eg._is_supported()&&Eg._remove("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(u=this.deadClicksAutocapture)||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}startSessionRecording(e){var t=!0===e,r={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,s,o,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(r.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:A_;return t!==A_&&(t=A_+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(io))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(io))}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&ti(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Os])&&(null==(t=this.persistence)||null==(t=t.props)||!t[uo]))}_shouldCapturePageleave(){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._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(ds.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(uo,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}_sync_opt_out_with_persistence(){var e,t,r,i,n=this._is_persistence_disabled();(null==(e=this.persistence)?void 0:e._disabled)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(t=this.sessionPersistence)?void 0:t._disabled)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(e){var t;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new p_(this),this.pageViewManager=new wf(this),this.persistence&&(this.sessionPropsManager=new d_(this,this.sessionManager,this.persistence)),this.sessionRecording=new T_(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ri(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}else ds.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ho,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this._captureInitialPageview())):ds.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Pg.GRANTED?"granted":e===Pg.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Qn?__(Qn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){es&&("visible"===es.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:es.title},{send_instantly:!0}),this._visibilityStateListener&&(es.removeEventListener("visibilitychange",this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),Es(es,"visibilitychange",this._visibilityStateListener)))}debug(e){!1===e?(null==Gn||Gn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Gn||Gn.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}))}_shouldDisableFlags(){var e,t,r,i,n,s,o,a=this._originalUserConfig||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ds.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):(r="advanced_disable_decide",i=!1,n=ds,s=(t="advanced_disable_flags")in(e=a)&&!oi(e[t]),o=r in e&&!oi(e[r]),s?e[t]:o?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]):i)}_runBeforeSend(e){if(oi(this.config.before_send))return e;var t=Kr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),oi(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return di(e.event)?ds.warn(n+". This can cause unexpected behavior."):ds.info(n),null}r.properties&&!ti(r.properties)||ds.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}_checkLocalStorageForDebug(e){var t=ui(e)&&!e,r=Eg._is_supported()&&"true"===Eg._get("ph_debug");return!t&&(!!r||e)}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=bs(e.prototype[t[r]])}(F_,["identify"]);var D_,H_={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},B_=(D_=M_[A_]=new F_,function(){function e(){e.done||(e.done=!0,P_=!1,gs(M_,(function(e){e._dom_loaded()})))}null!=es&&es.addEventListener?"complete"===es.readyState?e():Es(es,"DOMContentLoaded",e,{capture:!1}):Gn&&ds.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),D_);export{su as Compression,H_ as DEFAULT_PRODUCT_TOUR_APPEARANCE,Dl as DisplaySurveyType,F_ as PostHog,Ol as SurveyEventName,Fl as SurveyEventProperties,xl as SurveyEventType,Ml as SurveyPosition,Ll as SurveyQuestionBranchingType,Pl as SurveyQuestionType,Nl as SurveySchedule,Rl as SurveyTabPosition,Al as SurveyType,Tl as SurveyWidgetType,B_ as default,B_ as posthog,nu as severityLevels};
1
+ function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=Object.defineProperty,u=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),c=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(c||{}),d={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},h={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var p={};function v(e){if(p[e])return p[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in d?d[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in h?h[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return p[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?p[e]=u:t.prototype}catch(e){return t.prototype}}var g={};function _(e,t,r){var i,n=e+"."+String(r);if(g[n])return g[n].call(t);var s=v(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(g[n]=o,o.call(t)):t[r]}var f={};function m(e,t,r){var i=e+"."+String(r);if(f[i])return f[i].bind(t);var n=v(e)[r];return"function"!=typeof n?t[r]:(f[i]=n,n.bind(t))}var y={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return m("Node",e,"contains")(t)},getRootNode:function(e){return m("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return v("MutationObserver").constructor}};function b(e){return e.nodeType===e.ELEMENT_NODE}function w(e){var t=e&&"host"in e&&"mode"in e&&y.host(e)||null;return Boolean(t&&"shadowRoot"in t&&y.shadowRoot(t)===e)}function S(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>I(t,e.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(e){return null}var i}function I(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=C(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?F(r,e.styleSheet.href):r}var i,n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),t?F(n,t):n}function E(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let k=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function x(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=e,a=s||"",l=n&&T(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function T(e){return e.toLowerCase()}var R="__rrweb_original__";function M(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?T(t):null}function A(e,t){var r,i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){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}var P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,L=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,N=/^(data:)([^,]*),(.*)/i;function F(e,t){return(e||"").replace(P,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(L.test(l)||O.test(l))return"url("+u+l+u+")";if(N.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var c=t.split("/"),d=l.split("/");for(var h of(c.pop(),d))"."!==h&&(".."===h?c.pop():c.push(h));return"url("+u+c.join("/")+u+")"}))}var D,H,B=1,q=new RegExp("[^a-z0-9-_:]"),U=-2;function V(){return B++}var j=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/;var z=new WeakMap;function Z(e,t){return t&&""!==t.trim()?Y(e,t):t}function G(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Y(e,t){var r=z.get(e);if(r||(r=e.createElement("a"),z.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function X(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Z(e,i):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(W),!(r>=t.length);){var s=i(j);if(","===s.slice(-1))s=Z(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Z(e,s);for(var a=!1;;){var l=t.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(", ")}(e,i):"style"===r?F(i,Y(e)):"object"===t&&"data"===r?Z(e,i):i:Z(e,i):i}function K(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&J(y.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&J(y.parentNode(e),t,r)}function Q(e,t,r,i){var n;if(b(e)){if(n=e,!y.childNodes(n).length)return!1}else{if(null===y.parentElement(e))return!1;n=y.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(J(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function ee(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:d,dataURLOptions:h={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:_=!1}=t,f=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:c.Document,childNodes:[],compatMode:e.compatMode}:{type:c.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:c.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:f};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,_=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),f=function(e){if(e instanceof HTMLFormElement)return"form";var t=T(e.tagName);return q.test(t)?"div":t}(e),m={},b=e.attributes.length,w=0;w<b;w++){var S=e.attributes[w];K(f,S.name,S.value)||(m[S.name]=X(i,f,T(S.name),S.value))}if("link"===f&&o){var I=function(e){return null==e?void 0:e.href}(e);if(I){var k=E(i,I);if(!k&&I.includes(".css"))k=E(i,window.location.origin+"/"+I.replace(window.location.href,""));var A=null;k&&(A=C(k)),A&&(delete m.rel,delete m.href,m._cssText=A)}}if("style"===f&&e.sheet&&!(e.innerText||y.textContent(e)||"").trim().length){var P=C(e.sheet);P&&(m._cssText=P)}if("input"===f||"textarea"===f||"select"===f){var L=e.value,O=e.checked;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&L?m.value=x({element:e,type:M(e),tagName:f,value:L,maskInputOptions:a,maskInputFn:l}):O&&(m.checked=O)}"option"===f&&(e.selected&&!a.select?m.selected=!0:delete m.selected);if("dialog"===f&&e.open)try{m.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){m.rr_open_mode="modal",m.ph_rr_could_not_detect_modal=!0}if("canvas"===f&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var i=0;i<e.height;i+=50){var n=t.getImageData,s=R in n?n[R]:n;if(new Uint32Array(s.call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(m.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var N=e.toDataURL(u.type,u.quality),F=i.createElement("canvas");F.width=e.width,F.height=e.height,N!==F.toDataURL(u.type,u.quality)&&(m.rr_dataURL=N)}if("img"===f&&d){D||(D=i.createElement("canvas"),H=D.getContext("2d"));var B=e,U=B.currentSrc||B.getAttribute("src")||"<unknown-src>",V=B.crossOrigin,j=()=>{B.removeEventListener("load",j);try{D.width=B.naturalWidth,D.height=B.naturalHeight,H.drawImage(B,0,0),m.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?j():B.addEventListener("load",j));console.warn("Cannot inline img src="+U+"! Error: "+e)}"anonymous"===B.crossOrigin&&(V?m.crossOrigin=V:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?j():B.addEventListener("load",j)}if("audio"===f||"video"===f){var W=m;W.rr_mediaState=e.paused?"paused":"played",W.rr_mediaCurrentTime=e.currentTime,W.rr_mediaPlaybackRate=e.playbackRate,W.rr_mediaMuted=e.muted,W.rr_mediaLoop=e.loop,W.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(m.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(m.rr_scrollTop=e.scrollTop));if(_){var{width:z,height:Z}=e.getBoundingClientRect();m={class:m.class,rr_width:z+"px",rr_height:Z+"px"}}"iframe"!==f||p(m.src)||(e.contentDocument||(m.rr_src=m.src),delete m.src);try{customElements.get(f)&&(r=!0)}catch(e){}return{type:c.Element,tagName:f,attributes:m,childNodes:[],isSVG:G(e)||void 0,needBlock:_,rootId:g,isCustom:r}}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:_,rootId:f});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:s}=t,o=y.parentNode(e),a=o&&o.tagName,l=y.textContent(e),u="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(l=C(o.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=F(l,Y(t.doc))}d&&(l="SCRIPT_PLACEHOLDER");!u&&!d&&l&&i&&(l=n?n(l,y.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:c.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:f});case e.CDATA_SECTION_NODE:return{type:c.CDATA,textContent:"",rootId:f};case e.COMMENT_NODE:return{type:c.Comment,textContent:y.textContent(e)||"",rootId:f};default:return!1}}function te(e){return null==e?"":e.toLowerCase()}function re(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:_=!1,recordCanvas:f=!1,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:R}=t,{preserveWhiteSpace:M=!0}=t;R||(R=Q(e,o,a,void 0===R));var P,L=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:R,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,dataURLOptions:g,inlineImages:_,recordCanvas:f,keepIframeSrcFn:x,newlyAddedElement:T});if(!L)return console.warn(e,"not serialized"),null;P=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===c.Comment)return!0;if(e.type===c.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===A(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(te(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===te(e.attributes.name)||"icon"===te(e.attributes.rel)||"apple-touch-icon"===te(e.attributes.rel)||"shortcut icon"===te(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&te(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(te(e.attributes.property).match(/^(og|twitter|fb):/)||te(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===te(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===te(e.attributes.name)||"googlebot"===te(e.attributes.name)||"bingbot"===te(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===te(e.attributes.name)||"generator"===te(e.attributes.name)||"framework"===te(e.attributes.name)||"publisher"===te(e.attributes.name)||"progid"===te(e.attributes.name)||te(e.attributes.property).match(/^article:/)||te(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===te(e.attributes.name)||"yandex-verification"===te(e.attributes.name)||"csrf-token"===te(e.attributes.name)||"p:domain_verify"===te(e.attributes.name)||"verify-v1"===te(e.attributes.name)||"verification"===te(e.attributes.name)||"shopify-checkout-api-token"===te(e.attributes.name)))return!0}}return!1}(L,v)&&(M||L.type!==c.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?V():U;var O=Object.assign(L,{id:P});if(i.add(e,O),P===U)return null;m&&m(e);var N=!l;if(O.type===c.Element){N=N&&!O.needBlock,delete O.needBlock;var F=y.shadowRoot(e);F&&S(F)&&(O.isShadowHost=!0)}if((O.type===c.Document||O.type===c.Element)&&N){v.headWhitespace&&O.type===c.Element&&"head"===O.tagName&&(M=!1);var D={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:R,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:M,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:x};if(O.type===c.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var H of Array.from(y.childNodes(e))){var B=re(H,D);B&&O.childNodes.push(B)}var q=null;if(b(e)&&(q=y.shadowRoot(e)))for(var j of Array.from(y.childNodes(q))){var W=re(j,D);W&&(S(q)&&(W.isShadow=!0),O.childNodes.push(W))}}var z=y.parentNode(e);return z&&w(z)&&S(z)&&(O.isShadow=!0),O.type===c.Element&&"iframe"===O.tagName&&function(e,t,r){var i=e.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(e){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{s||(t(),s=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),s=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&C){var r=re(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:R,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:M,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:x});r&&C(e,r)}}),I),O.type===c.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===A(O.attributes.href))&&function(e,t,r){var i,n=!1;try{i=e.sheet}catch(e){return}if(!i){var s=setTimeout((()=>{n||(t(),n=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),n=!0,t()}))}}(e,(()=>{if(E){var t=re(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:R,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:h,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:_,recordCanvas:f,preserveWhiteSpace:M,onSerialize:m,onIframeLoad:C,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:k,keepIframeSrcFn:x});t&&E(e,t)}}),k),O}let ie=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))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(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var ne={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var oe={};function ae(e){if(oe[e])return oe[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in ne?ne[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in se?se[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return oe[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?oe[e]=u:r}catch(e){return r}}var le={};function ue(e,t,r){var i,n=e+"."+String(r);if(le[n])return le[n].call(t);var s=ae(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(le[n]=o,o.call(t)):t[r]}var ce={};function de(e,t,r){var i=e+"."+String(r);if(ce[i])return ce[i].bind(t);var n=ae(e)[r];return"function"!=typeof n?t[r]:(ce[i]=n,n.bind(t))}function he(){return ae("MutationObserver").constructor}var pe={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return de("Node",e,"contains")(t)},getRootNode:function(e){return de("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:he};function ve(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}var ge="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.",_e={map:{},getId:()=>(console.error(ge),-1),getNode:()=>(console.error(ge),null),removeNodeFromMap(){console.error(ge)},has:()=>(console.error(ge),!1),reset(){console.error(ge)}};function fe(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)}),u))}}function me(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>me(e,t,s||{},!0)}function ye(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_e=new Proxy(_e,{get:(e,t,r)=>("map"===t&&console.error(ge),Reflect.get(e,t,r))}));var be=Date.now;function we(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=pe.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=pe.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Se(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ce(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:pe.parentElement(e):null}function Ee(e,t,r,i){if(!e)return!1;var n=Ie(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(J(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function ke(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===U}function xe(e,t){if(w(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=pe.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||xe(i,t))}function Te(e){return Boolean(e.changedTouches)}function Re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Me(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ae(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pe.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(be=()=>(new Date).getTime());let Pe=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Le(e){var t,r=null;return"getRootNode"in e&&(null==(t=pe.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pe.host(pe.getRootNode(e))&&(r=pe.host(pe.getRootNode(e))),r}function Oe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Le(r);)r=t;return r}(e);return pe.contains(t,r)}function Ne(e){var t=e.ownerDocument;return!!t&&(pe.contains(t,e)||Oe(e))}var Fe=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Fe||{}),De=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(De||{}),He=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(He||{}),Be=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Be||{}),qe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(qe||{}),Ue=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Ue||{});function $e(e){return"__ln"in e}class Ve{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&$e(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&$e(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}var je,We=(e,t)=>e+"@"+t;class ze{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,"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,"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,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ve,i=e=>{for(var t=e,r=U;r===U;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=pe.parentNode(n);if(s&&Ne(n)&&"TEXTAREA"!==s.tagName){var o=w(s)?this.mirror.getId(Le(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=re(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,inlineImages:this.inlineImages,onSerialize:e=>{Re(e,this.mirror)&&this.iframeManager.addIframe(e),Me(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ae(n)&&this.shadowDomManager.addShadowRoot(pe.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ge(this.removes,s,this.mirror)&&!this.movedSet.has(pe.parentNode(s))||n(s);for(var o of this.addedSet)Ye(this.droppedSet,o)||Ge(this.removes,o,this.mirror)?Ye(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(pe.parentNode(a.value)),c=i(a.value);-1!==u&&-1!==c&&(l=a)}if(!l)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(pe.parentNode(h.value));if(-1===i(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=pe.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var _=pe.host(g);if(-1!==this.mirror.getId(_)){l=h;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var f={texts:this.texts.map((e=>{var t=e.node,r=pe.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+i).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(f.texts.length||f.attributes.length||f.removes.length||f.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.movedMap={},this.mutationCb(f))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(pe.childNodes(e),(e=>pe.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!ke(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=pe.textContent(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Q(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=M(r);n=x({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ee(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!K(r.tagName,i))if(o.attributes[i]=X(this.doc,T(r.tagName),T(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&a.setAttribute("style",e.oldValue),Array.from(r.style))){var u=r.style.getPropertyValue(l),c=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||c!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===c?u:[u,c]:o._unchangedStyles[l]=[u,c]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(o.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(Ee(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),i=w(e.target)?this.mirror.getId(pe.host(e.target)):this.mirror.getId(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||ke(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||xe(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[We(r,i)]?Ze(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!w(e.target)||!S(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(ke(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[We(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ee(e,this.blockClass,this.blockSelector,!1)||(pe.childNodes(e).forEach((e=>this.genAdds(e))),Ae(e)&&pe.childNodes(pe.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}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.shadowDomManager.reset(),this.canvasManager.reset()}}function Ze(e,t){e.delete(t),pe.childNodes(t).forEach((t=>Ze(e,t)))}function Ge(e,t,r){return 0!==e.length&&function(e,t,r){var i,n=pe.parentNode(t),s=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=pe.parentNode(n)};for(;n;)if(i=s())return i.v;return!1}(e,t,r)}function Ye(e,t){return 0!==e.size&&Xe(e,t)}function Xe(e,t){var r=pe.parentNode(t);return!!r&&(!!e.has(r)||Xe(e,r))}var Ke=e=>{if(!je)return e;return function(){try{return e(...arguments)}catch(e){if(je&&!0===je(e))return;throw e}}},Je=[];function Qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function et(e,t){var r=new ze;Je.push(r),r.init(e);var i=new(he())(Ke(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function tt(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(He).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=T(e),l=(e=>i=>{var a=Qe(i);if(!Ee(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Be.Mouse;break;case"touch":l=Be.Touch;break;case"pen":l=Be.Pen}l===Be.Touch?He[e]===He.MouseDown?u="TouchStart":He[e]===He.MouseUp&&(u="TouchEnd"):Be.Pen}else Te(i)&&(l=Be.Touch);null!==l?(c=l,(u.startsWith("Touch")&&l===Be.Touch||u.startsWith("Mouse")&&l===Be.Mouse)&&(l=null)):He[e]===He.Click&&(l=c,c=null);var d=Te(i)?i.changedTouches[0]:i;if(d){var h=n.getId(a),{clientX:p,clientY:v}=d;Ke(t)(r({type:He[u],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(He[e]){case He.MouseDown:case He.MouseUp:a=a.replace("mouse","pointer");break;case He.TouchStart:case He.TouchEnd:return}u.push(ve(a,l,i))})),Ke((()=>{u.forEach((e=>e()))}))}function rt(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e;return ve("scroll",Ke(fe(Ke((e=>{var o=Qe(e);if(o&&!Ee(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=we(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var it=["INPUT","TEXTAREA","SELECT"],nt=new WeakMap;function st(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function ot(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function at(e,t){var r,i,n,{mirror:s,stylesheetManager:o}=e,a=null;a="#document"===t.nodeName?s.getId(t):s.getId(pe.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{o.adoptStyleSheets(e,a)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function lt(e,t){void 0===t&&(t={});var i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),c(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,t),e.recordDOM&&(i=et(e,e.doc));var s=function(e){var{mousemoveCb:t,sampling:r,doc:i,mirror:n}=e;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=fe(Ke((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),c=Ke(fe(Ke((e=>{var t=Qe(e),{clientX:r,clientY:i}=Te(e)?e.changedTouches[0]:e;s||(s=be()),l.push({x:r,y:i,id:n.getId(t),timeOffset:be()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)})),o,{trailing:!1})),d=[ve("mousemove",c,i),ve("touchmove",c,i),ve("drag",c,i)];return Ke((()=>{d.forEach((e=>e()))}))}(e),o=tt(e),a=rt(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return ve("resize",Ke(fe(Ke((()=>{var e=Se(),t=Ce();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:n}),u=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=Qe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=pe.parentElement(t)),t&&n&&!(it.indexOf(n)<0)&&!Ee(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=M(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[n.toLowerCase()]||u[g])&&(d=x({element:t,maskInputOptions:u,tagName:n,type:g,value:d,maskInputFn:c})),v(t,h?{text:d,isChecked:p,userTriggered:r}:{text:d,isChecked:p});var _=t.name;"radio"===g&&_&&p&&i.querySelectorAll('input[type="radio"][name="'+_+'"]').forEach((e=>{if(e!==t){var r=e.value;v(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}function v(e,i){var s=nt.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){nt.set(e,i);var o=n.getId(e);Ke(t)(r({},i,{id:o}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>ve(e,Ke(p),i))),_=i.defaultView;if(!_)return()=>{g.forEach((e=>e()))};var f=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),m=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&g.push(...m.map((e=>me(e[0],e[1],{set(){Ke(p)({target:this,isTrusted:!1})}},!1,_)))),Ke((()=>{g.forEach((e=>e()))}))}(e),c=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ke((e=>fe(Ke((s=>{var o=Qe(s);if(o&&!Ee(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:c,loop:d}=o;t({type:e,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:c,loop:d})}})),s.media||500))),l=[ve("play",a(Ue.Play),o),ve("pause",a(Ue.Pause),o),ve("seeked",a(Ue.Seeked),o),ve("volumechange",a(Ue.VolumeChange),o),ve("ratechange",a(Ue.RateChange),o)];return Ke((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ke(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=ot(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){void 0===r&&(r=this.cssRules.length);var i=e+" { "+t+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var c={};ct("CSSGroupingRule")?c.CSSGroupingRule=s.CSSGroupingRule:(ct("CSSMediaRule")&&(c.CSSMediaRule=s.CSSMediaRule),ct("CSSConditionRule")&&(c.CSSConditionRule=s.CSSConditionRule),ct("CSSSupportsRule")&&(c.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(c).forEach((e=>{var[t,s]=e;d[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=ot(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...st(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=ot(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...st(t),o]}]}),e.apply(t,s)}))})})),Ke((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:n}),h=at(e,e.doc),p=function(e,t){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=e,{win:o}=t,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ke(((e,t,o)=>{var l,[u,c,d]=o;if(n.has(u))return a.apply(t,[u,c,d]);var{id:h,styleId:p}=ot(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||p&&-1!==p)&&r({id:h,styleId:p,set:{property:u,value:c,priority:d},index:st(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ke(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:c,styleId:d}=ot(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||d&&-1!==d)&&r({id:c,styleId:d,remove:{property:u},index:st(t.parentRule)}),e.apply(t,o)}))}),Ke((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:r}=e,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=ye(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ke((()=>{n.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ke((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;u<l;u++){var c=e.getRangeAt(u),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=c;Ee(d,i,n,!0)||Ee(p,i,n,!0)||a.push({start:r.getId(d),startOffset:h,end:r.getId(p),endOffset:v})}s({ranges:a})}}));return a(),ve("selectionchange",a)}(e),_=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?ye(i.customElements,"define",(function(e){return function(t,i,n){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,n])}})):()=>{}}(e),f=[];for(var m of e.plugins)f.push(m.observer(m.callback,n,m.options));return Ke((()=>{Je.forEach((e=>e.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),c(),d(),h(),p(),v(),g(),_(),f.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function ct(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class dt{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var n=i.get(t);return n||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class ht{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new dt(V)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new dt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Fe.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:Fe.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Fe.Meta:case Fe.Load:case Fe.DomContentLoaded:return!1;case Fe.Plugin:return t;case Fe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Fe.IncrementalSnapshot:switch(t.data.source){case De.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.Drag:case De.TouchMove:case De.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(t.data,e,["id"]),t;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case De.Font:return t;case De.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case De.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===c.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class pt{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(S(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=et(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(rt(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(pe.host(e))),this.restoreHandlers.push(at({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(ye(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=pe.shadowRoot(this);return s&&Ne(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_t=0;_t<64;_t++)gt[vt.charCodeAt(_t)]=_t;var ft=new Map;var mt=(e,t,r)=>{if(e&&(wt(e,t)||"object"==typeof e)){var i=function(e,t){var r=ft.get(e);return r||(r=new Map,ft.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function yt(e,t,r){if(e instanceof Array)return e.map((e=>yt(e,t,r)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),i=r.length,n="";for(t=0;t<i;t+=3)n+=vt[r[t]>>2],n+=vt[(3&r[t])<<4|r[t+1]>>4],n+=vt[(15&r[t+1])<<2|r[t+2]>>6],n+=vt[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[yt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var i=e.constructor.name,{src:n}=e;return{rr_type:i,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[yt(e.data,t,r),e.width,e.height]}:wt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mt(e,t,r)}:e}var bt=(e,t,r)=>e.map((e=>yt(e,t,r))),wt=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function St(e,t,r,i){var n=[];try{var s=ye(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!Ee(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}}));n.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function Ct(e,t,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var l=ye(e,a,(function(e){return function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var c=e.apply(this,l);if(mt(c,s,this),"tagName"in this.canvas&&!Ee(this.canvas,i,n,!0)){var d=bt(l,s,this),h={type:t,property:a,args:d};r(this.canvas,h)}return c}}));o.push(l)}catch(i){var u=me(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var It,Et,kt,xt,Tt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Rt="undefined"!=typeof window&&window.Blob&&new Blob([(It=Tt,Uint8Array.from(atob(It),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Mt(e){var t;try{if(!(t=Rt&&(window.URL||window.webkitURL).createObjectURL(Rt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Tt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class At{constructor(e){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,"processMutation",((e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)}));var{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,r,i,n,s){var o=this,a=St(r,i,n,!0),l=new Map,u=new Mt;u.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:i,width:n,height:s}=e.data;this.mutationCb({id:t,type:qe["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var c,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?c=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{Ee(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(r.document),a).forEach(function(){var e=t((function*(e){var t,r=o.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=e.clientWidth||e.width,a=e.clientHeight||e.height,c=yield createImageBitmap(e,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:c,width:n,height:a,dataURLOptions:s.dataURLOptions},[c])}}));return function(t){return e.apply(this,arguments)}}()),c=requestAnimationFrame(p))};c=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=St(e,t,r,!1),n=function(e,t,r,i){var n=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])return 1;var o=ye(t.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return Ee(this.canvas,r,i,!0)||setTimeout((()=>{var r=bt(a,t,this);e(this.canvas,{type:qe["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=me(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:qe["2D"],property:s,args:[t],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,i){var n=[];return n.push(...Ct(t.WebGLRenderingContext.prototype,qe.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...Ct(t.WebGL2RenderingContext.prototype,qe.WebGL2,e,r,i,t)),()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>i(e,s))),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Pt{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Pe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var i={id:t,styleIds:[]},n=[],s=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:I(t,e.href),index:r})))})),i.styleIds.push(t)};for(var o of e)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Lt{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Ot=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Nt=document.createElement("iframe");document.body.appendChild(Nt),Array.from=(null==(n=Nt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Nt)}}catch(e){console.debug("Unable to override Array.from",e)}var Ft,Dt,Ht=new k;function Bt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:_,hooks:f,packFn:m,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:E=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:T=!1,inlineImages:R=!1,plugins:M,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:P=new Set([]),errorHandler:L}=e;je=L;var O=!I||window.parent===window,N=!1;if(!O)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!N)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),Ht.reset();var F,D=!0===h?{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!==p?p:{password:!0},H=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var B=0,q=e=>{for(var t of M||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&!N&&(e=m(e)),e};Et=(e,r)=>{var s,o=e;if(o.timestamp=be(),!(null==(s=Je[0])?void 0:s.isFrozen())||o.type===Fe.FullSnapshot||o.type===Fe.IncrementalSnapshot&&o.data.source===De.Mutation||Je.forEach((e=>e.unfreeze())),O)null==t||t(q(o),r);else if(N){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Fe.FullSnapshot)F=o,B=0;else if(o.type===Fe.IncrementalSnapshot){if(o.data.source===De.Mutation&&o.data.isAttachIframe)return;B++;var l=n&&B>=n,u=i&&o.timestamp-F.timestamp>i;(l||u)&&kt(!0)}};var U=e=>{Et({type:Fe.IncrementalSnapshot,data:r({source:De.Mutation},e)})},V=e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.Scroll},e)}),j=e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.CanvasMutation},e)}),W=new Pt({mutationCb:U,adoptedStyleSheetCb:e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.AdoptedStyleSheet},e)})}),z=new ht({mirror:Ht,mutationCb:U,stylesheetManager:W,recordCrossOriginIframes:I,wrappedEmit:Et});for(var Z of M||[])Z.getMirror&&Z.getMirror({nodeMirror:Ht,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var G=new Lt;xt=new At({recordCanvas:C,mutationCb:j,win:window,blockClass:s,blockSelector:o,mirror:Ht,sampling:y.canvas,dataURLOptions:b});var Y=new pt({mutationCb:U,scrollCb:V,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:_,maskInputFn:g,recordCanvas:C,inlineImages:R,sampling:y,slimDOMOptions:H,iframeManager:z,stylesheetManager:W,canvasManager:xt,keepIframeSrcFn:A,processedNodeManager:G},mirror:Ht});kt=function(e){if(void 0===e&&(e=!1),S){Et({type:Fe.Meta,data:{href:window.location.href,width:Ce(),height:Se()}},e),W.reset(),Y.init(),Je.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new k,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:_,onIframeLoad:f,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w=(()=>!1)}=t||{};return re(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:u,preserveWhiteSpace:g,onSerialize:_,onIframeLoad:f,iframeLoadTimeout:m,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Ht,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:D,maskTextFn:_,maskInputFn:g,slimDOM:H,dataURLOptions:b,recordCanvas:C,inlineImages:R,onSerialize:e=>{Re(e,Ht)&&z.addIframe(e),Me(e,Ht)&&W.trackLinkElement(e),Ae(e)&&Y.addShadowRoot(pe.shadowRoot(e),document)},onIframeLoad:(e,t)=>{z.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");Et({type:Fe.FullSnapshot,data:{node:t,initialOffset:we(window)}},e),Je.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Ht.getId(document))}};try{var X=[],K=e=>{var t;return Ke(lt)({mutationCb:U,mousemoveCb:(e,t)=>Et({type:Fe.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.MouseInteraction},e)}),scrollCb:V,viewportResizeCb:e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.ViewportResize},e)}),inputCb:e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.Input},e)}),mediaInteractionCb:e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.MediaInteraction},e)}),styleSheetRuleCb:e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.StyleSheetRule},e)}),styleDeclarationCb:e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.StyleDeclaration},e)}),canvasMutationCb:j,fontCb:e=>Et({type:Fe.IncrementalSnapshot,data:r({source:De.Font},e)}),selectionCb:e=>{Et({type:Fe.IncrementalSnapshot,data:r({source:De.Selection},e)})},customElementCb:e=>{Et({type:Fe.IncrementalSnapshot,data:r({source:De.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:R,userTriggeredOnInput:x,collectFonts:T,doc:e,maskInputFn:g,maskTextFn:_,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:H,dataURLOptions:b,mirror:Ht,iframeManager:z,stylesheetManager:W,shadowDomManager:Y,processedNodeManager:G,canvasManager:xt,ignoreCSSAttributes:P,plugins:(null==(t=null==M?void 0:M.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>Et({type:Fe.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},f)};z.addLoadListener((e=>{try{X.push(K(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{kt(),X.push(K(document)),Ot=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(X.push(ve("DOMContentLoaded",(()=>{Et({type:Fe.DomContentLoaded,data:{}}),"DOMContentLoaded"===E&&J()}))),X.push(ve("load",(()=>{Et({type:Fe.Load,data:{}}),"load"===E&&J()}),window))),()=>{X.forEach((e=>e())),G.destroy(),Ot=!1,je=void 0}}catch(e){console.warn(e)}}Bt.addCustomEvent=(e,t)=>{if(!Ot)throw new Error("please add custom event after start recording");Et({type:Fe.Custom,data:{tag:e,payload:t}})},Bt.freezePage=()=>{Je.forEach((e=>e.freeze()))},Bt.takeFullSnapshot=e=>{if(!Ot)throw new Error("please take full snapshot after start recording");kt(e)},Bt.mirror=Ht,(Dt=Ft||(Ft={}))[Dt.NotStarted=0]="NotStarted",Dt[Dt.Running=1]="Running",Dt[Dt.Stopped=2]="Stopped";var qt,Ut=Object.defineProperty,$t=(e,t,r)=>((e,t,r)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Vt=Object.defineProperty,jt=(e,t,r)=>((e,t,r)=>t in e?Vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Wt=Object.defineProperty,zt=(e,t,r)=>((e,t,r)=>t in e?Wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Gt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Yt={};function Xt(e){if(Yt[e])return Yt[e];var t=globalThis[e],r=t.prototype,i=e in Zt?Zt[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in Gt?Gt[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return Yt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?Yt[e]=u:r}catch(e){return r}}var Kt={};function Jt(e,t,r){var i,n=e+"."+String(r);if(Kt[n])return Kt[n].call(t);var s=Xt(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Kt[n]=o,o.call(t)):t[r]}var Qt={};function er(e,t,r){var i=e+"."+String(r);if(Qt[i])return Qt[i].bind(t);var n=Xt(e)[r];return"function"!=typeof n?t[r]:(Qt[i]=n,n.bind(t))}var tr={childNodes:function(e){return Jt("Node",e,"childNodes")},parentNode:function(e){return Jt("Node",e,"parentNode")},parentElement:function(e){return Jt("Node",e,"parentElement")},textContent:function(e){return Jt("Node",e,"textContent")},contains:function(e,t){return er("Node",e,"contains")(t)},getRootNode:function(e){return er("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Jt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Jt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Jt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Jt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Xt("MutationObserver").constructor}};class rr{constructor(){zt(this,"idNodeMap",new Map),zt(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ir(tr.parentNode(e),t,r);for(var i=e.classList.length;i--;){var n=e.classList[i];if(t.test(n))return!0}return!!r&&ir(tr.parentNode(e),t,r)}class nr{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof nr))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},or={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={};function lr(e){if(ar[e])return ar[e];var t=globalThis[e],r=t.prototype,i=e in sr?sr[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in or?or[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return ar[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var u=l[e].prototype;return document.body.removeChild(a),u?ar[e]=u:r}catch(e){return r}}var ur={};function cr(e,t,r){var i,n=e+"."+String(r);if(ur[n])return ur[n].call(t);var s=lr(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(ur[n]=o,o.call(t)):t[r]}var dr={};function hr(e,t,r){var i=e+"."+String(r);if(dr[i])return dr[i].bind(t);var n=lr(e)[r];return"function"!=typeof n?t[r]:(dr[i]=n,n.bind(t))}var pr={childNodes:function(e){return cr("Node",e,"childNodes")},parentNode:function(e){return cr("Node",e,"parentNode")},parentElement:function(e){return cr("Node",e,"parentElement")},textContent:function(e){return cr("Node",e,"textContent")},contains:function(e,t){return hr("Node",e,"contains")(t)},getRootNode:function(e){return hr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?cr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?cr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return cr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return cr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return lr("MutationObserver").constructor}};var vr="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.",gr={map:{},getId:()=>(console.error(vr),-1),getNode:()=>(console.error(vr),null),removeNodeFromMap(){console.error(vr)},has:()=>(console.error(vr),!1),reset(){console.error(vr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gr=new Proxy(gr,{get:(e,t,r)=>("map"===t&&console.error(vr),Reflect.get(e,t,r))}));var _r=Date.now;function fr(e){return e?e.nodeType===e.ELEMENT_NODE?e:pr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(_r=()=>(new Date).getTime());function mr(e){var t,r=null;return"getRootNode"in e&&(null==(t=pr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pr.host(pr.getRootNode(e))&&(r=pr.host(pr.getRootNode(e))),r}function yr(e){for(var t,r=e;t=mr(r);)r=t;return r}function br(e){var t=e.ownerDocument;if(!t)return!1;var r=yr(e);return pr.contains(t,r)}for(var wr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){jt(this,"id",1),jt(this,"styleIDMap",new WeakMap),jt(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return gr},closestElementOfNode:fr,getBaseDimension:function e(t,r){var i,n,s=null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=e(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){var i=t[r[0]];return 1===r.length?i:e(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:yr,getShadowHost:mr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=pr.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=pr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof nr&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pr.shadowRoot(e)))},hookSetter:function e(t,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(t,r);return s.Object.defineProperty(t,r,n?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(pr.contains(t,e)||br(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&tr.host(i)||null,Boolean(n&&"shadowRoot"in n&&tr.shadowRoot(n)===i))return!1;var i,n,s=r.getId(t);if(!r.has(s))return!0;var o=pr.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked:function(e,t,r,i){if(!e)return!1;var n=fr(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(ir(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var i=t.children.length-1;i>=0;i--)e(t.children[i],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return _r},on:function(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}},polyfill:function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var i={value:e,parent:r,children:[]};return t[e.node.id]=i,i},i=[];for(var n of e){var{nextId:s,parentId:o}=n;if(s&&s in t){var a=t[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(o in t){var c=t[o];c.children.push(r(n,c))}else i.push(r(n,null))}return i},shadowHostInDom:br,throttle:function(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),c=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(c,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(c,o)}),u))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],i=e.length;i--;){var n=e[i];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Sr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ir=0;Ir<64;Ir++)Cr[Sr.charCodeAt(Ir)]=Ir;var Er;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var kr=document.createElement("iframe");document.body.appendChild(kr),Array.from=(null==(qt=kr.contentWindow)?void 0:qt.Array.from)||Array.from,document.body.removeChild(kr)}}catch(e){console.debug("Unable to override Array.from",e)}new rr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Er||(Er={}));class xr{constructor(e){$t(this,"fileName"),$t(this,"functionName"),$t(this,"lineNumber"),$t(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Tr=/(^|@)\S+:\d+/,Rr=/^\s*at .*(\S+:\d+|\(native\))/m,Mr=/^(eval@)?(\[native code])?$/,Ar={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Rr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Rr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=r?t.replace(r[0],""):t).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 xr({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Mr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new xr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new xr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;n<s;n+=2){var o=t.exec(r[n]);o&&i.push(new xr({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;n<s;n+=2){var o=t.exec(r[n]);o&&i.push(new xr({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Tr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new xr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Pr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;s<i.children.length;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(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Lr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Or(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Lr(e[i])&&Or(e[i],t-1))return!0;return!1}function Nr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Lr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Lr(e)&&Or(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"...");return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var o={};for(var a in t){var l=t[a];Array.isArray(l)?o[a]=Pr(l.length?l[0]:null):o[a]=l}return o}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Fr={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 Dr(e,t,r){var i,n=r?Object.assign({},Fr,r):Fr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?t[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=t.error,s=Ar.parse(i).map((e=>e.toString())),o=[Nr(r,n.stringifyOptions)];e({level:"error",trace:s,payload:o})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var c=t=>{var r,i;t.reason instanceof Error?i=[Nr("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Nr("Uncaught (in promise)",n.stringifyOptions),Nr(t.reason,n.stringifyOptions)]);var s=Ar.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",c),l.push((()=>{t.removeEventListener("unhandledrejection",c)}))}for(var d of n.level)l.push(h(i,d));return()=>{l.forEach((e=>e()))};function h(t,r){var i=this;return t[r]?wr.patch(t,r,(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var c=Ar.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Nr(e,n.stringifyOptions)));++o<n.lengthThreshold?e({level:r,trace:c,payload:d}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Nr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Hr=e=>({name:"rrweb/console@1",observer:Dr,options:e}),Br=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({}),qr=["$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"];function Ur(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}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"],Vr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return $r.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))};function jr(e,t){return-1!==e.indexOf(t)}var Wr=function(e){return e.trim()},zr=function(e){return e.replace(/^\$/,"")};var Zr=Array.isArray,Gr=Object.prototype,Yr=Gr.hasOwnProperty,Xr=Gr.toString,Kr=Zr||function(e){return"[object Array]"===Xr.call(e)},Jr=e=>"function"==typeof e,Qr=e=>Jr(e)&&-1!==e.toString().indexOf("[native code]"),ei=e=>e===Object(e)&&!Kr(e),ti=e=>{if(ei(e)){for(var t in e)if(Yr.call(e,t))return!1;return!0}return!1},ri=e=>void 0===e,ii=e=>"[object String]"==Xr.call(e),ni=e=>ii(e)&&0===e.trim().length,si=e=>null===e,oi=e=>ri(e)||si(e),ai=e=>"[object Number]"==Xr.call(e)&&e==e,li=e=>ai(e)&&e>0,ui=e=>"[object Boolean]"===Xr.call(e),ci=e=>e instanceof FormData,di=e=>jr(qr,e);function hi(e){return null===e||"object"!=typeof e}function pi(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function vi(e){return!ri(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var gi=[!0,"true",1,"1","yes"],_i=e=>jr(gi,e),fi=[!1,"false",0,"0","no"];function mi(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),ai(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),mi(n||r,t,r,i))}class yi{constructor(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=mi(e.bucketSize,0,100,e._logger),this._refillRate=mi(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=mi(e.refillInterval,0,864e5,e._logger)}_applyRefill(e,t){var r=t-e.lastAccess,i=Math.floor(r/this._refillInterval);if(i>0){var n=i*this._refillRate;e.tokens=Math.min(e.tokens+n,this._bucketSize),e.lastAccess=e.lastAccess+i*this._refillInterval}}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this._buckets[i];return n?this._applyRefill(n,r):(n={tokens:this._bucketSize,lastAccess:r},this._buckets[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===n.tokens)}stop(){this._buckets={}}}var bi="Mobile",wi="iOS",Si="Android",Ci="Tablet",Ii=Si+" "+Ci,Ei="iPad",ki="Apple",xi=ki+" Watch",Ti="Safari",Ri="BlackBerry",Mi="Samsung",Ai=Mi+"Browser",Pi=Mi+" Internet",Li="Chrome",Oi=Li+" OS",Ni=Li+" "+wi,Fi="Internet Explorer",Di=Fi+" "+bi,Hi="Opera",Bi=Hi+" Mini",qi="Edge",Ui="Microsoft "+qi,$i="Firefox",Vi=$i+" "+wi,ji="Nintendo",Wi="PlayStation",zi="Xbox",Zi=Si+" "+bi,Gi=bi+" "+Ti,Yi="Windows",Xi=Yi+" Phone",Ki="Nokia",Ji="Ouya",Qi="Generic",en=Qi+" "+bi.toLowerCase(),tn=Qi+" "+Ci.toLowerCase(),rn="Konqueror",nn="(\\d+(\\.\\d+)?)",sn=new RegExp("Version/"+nn),on=new RegExp(zi,"i"),an=new RegExp(Wi+" \\w+","i"),ln=new RegExp(ji+" \\w+","i"),un=new RegExp(Ri+"|PlayBook|BB10","i"),cn={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var dn,hn,pn,vn=(e,t)=>t&&jr(t,ki)||function(e){return jr(e,Ti)&&!jr(e,Li)&&!jr(e,Si)}(e),gn=function(e,t){return t=t||"",jr(e," OPR/")&&jr(e,"Mini")?Bi:jr(e," OPR/")?Hi:un.test(e)?Ri:jr(e,"IE"+bi)||jr(e,"WPDesktop")?Di:jr(e,Ai)?Pi:jr(e,qi)||jr(e,"Edg/")?Ui:jr(e,"FBIOS")?"Facebook "+bi:jr(e,"UCWEB")||jr(e,"UCBrowser")?"UC Browser":jr(e,"CriOS")?Ni:jr(e,"CrMo")||jr(e,Li)?Li:jr(e,Si)&&jr(e,Ti)?Zi:jr(e,"FxiOS")?Vi:jr(e.toLowerCase(),rn.toLowerCase())?rn:vn(e,t)?jr(e,bi)?Gi:Ti:jr(e,$i)?$i:jr(e,"MSIE")||jr(e,"Trident/")?Fi:jr(e,"Gecko")?$i:""},_n={[Di]:[new RegExp("rv:"+nn)],[Ui]:[new RegExp(qi+"?\\/"+nn)],[Li]:[new RegExp("("+Li+"|CrMo)\\/"+nn)],[Ni]:[new RegExp("CriOS\\/"+nn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+nn)],[Ti]:[sn],[Gi]:[sn],[Hi]:[new RegExp("(Opera|OPR)\\/"+nn)],[$i]:[new RegExp($i+"\\/"+nn)],[Vi]:[new RegExp("FxiOS\\/"+nn)],[rn]:[new RegExp("Konqueror[:/]?"+nn,"i")],[Ri]:[new RegExp(Ri+" "+nn),sn],[Zi]:[new RegExp("android\\s"+nn,"i")],[Pi]:[new RegExp(Ai+"\\/"+nn)],[Fi]:[new RegExp("(rv:|MSIE )"+nn)],Mozilla:[new RegExp("rv:"+nn)]},fn=function(e,t){var r=gn(e,t),i=_n[r];if(ri(i))return null;for(var n=0;n<i.length;n++){var s=i[n],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},mn=[[new RegExp(zi+"; "+zi+" (.*?)[);]","i"),e=>[zi,e&&e[1]||""]],[new RegExp(ji,"i"),[ji,""]],[new RegExp(Wi,"i"),[Wi,""]],[un,[Ri,""]],[new RegExp(Yi,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Xi,""];if(new RegExp(bi).test(t)&&!/IEMobile\b/.test(t))return[Yi+" "+bi,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=r[1],n=cn[i]||"";return/arm/i.test(t)&&(n="RT"),[Yi,n]}return[Yi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[wi,t.join(".")]}return[wi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ri(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Si+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Si+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Si,t.join(".")]}return[Si,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Oi,""]],[/Linux|debian/i,["Linux",""]]],yn=function(e){return ln.test(e)?ji:an.test(e)?Wi:on.test(e)?zi:new RegExp(Ji,"i").test(e)?Ji:new RegExp("("+Xi+"|WPDesktop)","i").test(e)?Xi:/iPad/.test(e)?Ei:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?xi:un.test(e)?Ri:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ki,"i").test(e)?Ki:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(bi).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Si:Ii:new RegExp("(pda|"+bi+")","i").test(e)?en:new RegExp(Ci,"i").test(e)&&!new RegExp(Ci+" pc","i").test(e)?tn:""},bn=function(e){var t=yn(e);return t===Ei||t===Ii||"Kobo"===t||"Kindle Fire"===t||t===tn?Ci:t===ji||t===zi||t===Wi||t===Ji?"Console":t===xi?"Wearable":t?bi:"Desktop"},wn=e=>e instanceof Error;function Sn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return pn&&r.length===hn||(hn=r.length,pn=r.reduce(((r,i)=>{dn||(dn={});var n=dn[i];if(n)r[n[0]]=n[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,dn[i]=[l,u];break}}return r}),{})),pn}}class Cn{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Kr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:Sn(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(i<=4){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var In="?";function En(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?In:r,in_app:!0};return ri(i)||(s.lineno=i),ri(n)||(s.colno=n),s}var kn=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:In,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},xn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Rn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Mn=(e,t)=>{var r=xn.exec(e);if(r){var[,i,n,s]=r;return En(t,i,In,+n,+s)}var o=Tn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Rn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=kn(o[1]||In,o[2]);return En(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},An=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Pn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ln=(e,t)=>{var r=An.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Pn.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]||In;return[s,n]=kn(s,n),En(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},On=/\(error: (.*)\)/,Nn=50;function Fn(){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;a<o.length;a++){var l=o[a];if(!(l.length>1024)){var u=On.test(l)?l.replace(On,"$1"):l;if(!u.match(/\S*Error: /)){for(var c of i){var d=c(u,e);if(d){s.push(d);break}}if(s.length>=Nn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Nn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||In});var i}))}(s)}}("web:javascript",Mn,Ln)}class Dn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=ii(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return pi(e,"DOMException")}isDOMError(e){return pi(e,"DOMError")}}class Hn{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Bn{constructor(){}match(e){return pi(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r,i=t.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var qn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Un{match(e){return"string"==typeof e}coerce(e,t){var r,[i,n]=this.getInfos(e);return{type:null!=i?i:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(qn);return i&&(t=i[1],r=i[2]),[t,r]}}var $n=["fatal","error","warning","log","info","debug"];function Vn(e,t){void 0===t&&(t=40);var r=Object.keys(e);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(!(n.length>t))return i===r.length||n.length<=t?n:n.slice(0,t)+"..."}return""}class jn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return vi(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Vn(e)}isSeverityLevel(e){return ii(e)&&!ni(e)&&$n.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var r=e[t];if(wn(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Wn{match(e){return vi(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Vn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class zn{match(e){return hi(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Zn{match(e){return pi(e,"PromiseRejectionEvent")}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return hi(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){if(hi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Gn="undefined"!=typeof window?window:void 0,Yn="undefined"!=typeof globalThis?globalThis:Gn;"undefined"==typeof self&&(Yn.self=Yn),"undefined"==typeof File&&(Yn.File=function(){});var Xn=Array.prototype,Kn=Xn.forEach,Jn=Xn.indexOf,Qn=null==Yn?void 0:Yn.navigator,es=null==Yn?void 0:Yn.document,ts=null==Yn?void 0:Yn.location,rs=null==Yn?void 0:Yn.fetch,is=null!=Yn&&Yn.XMLHttpRequest&&"withCredentials"in new Yn.XMLHttpRequest?Yn.XMLHttpRequest:void 0,ns=null==Yn?void 0:Yn.AbortController,ss=null==Qn?void 0:Qn.userAgent,os=null!=Gn?Gn:{},as=()=>!!Gn.Zone,ls=e=>e instanceof Document,us={DEBUG:!1,LIB_VERSION:"1.348.0"},cs=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={_log:function(t){if(Gn&&(us.DEBUG||os.POSTHOG_DEBUG||r)&&!ri(Gn.console)&&Gn.console){for(var i=("__rrweb_original__"in Gn.console[t]?Gn.console[t].__rrweb_original__:Gn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];i(e,...s)}},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i._log("error",...t)},critical:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:e=>{i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>cs(e+" "+t,r)};return i},ds=cs("[PostHog.js]"),hs=ds.createLogger,ps={};function vs(e,t,r){if(Kr(e))if(Kn&&e.forEach===Kn)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var i=0,n=e.length;i<n;i++)if(i in e&&t.call(r,e[i],i)===ps)return}function gs(e,t,r){if(!oi(e)){if(Kr(e))return vs(e,t,r);if(ci(e)){for(var i of e.entries())if(t.call(r,i[1],i[0])===ps)return}else for(var n in e)if(Yr.call(e,n)&&t.call(r,e[n],n)===ps)return}}var _s=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return vs(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},fs=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return vs(r,(function(t){vs(t,(function(t){e.push(t)}))})),e};function ms(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var ys=function(e){try{return e()}catch(e){return}},bs=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){ds.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ds.critical(e)}}},ws=function(e){var t={};return gs(e,(function(e,r){(ii(e)&&e.length>0||ai(e))&&(t[r]=e)})),t};function Ss(e,t){return r=e,i=e=>ii(e)&&!si(t)?e.slice(0,t):e,n=new Set,function e(t,r){return t!==Object(t)?i?i(t,r):t:n.has(t)?void 0:(n.add(t),Kr(t)?(s=[],vs(t,(t=>{s.push(e(t))}))):(s={},gs(t,((t,r)=>{n.has(t)||(s[r]=e(t,r))}))),s);var s}(r);var r,i,n}var Cs=["herokuapp.com","vercel.app","netlify.app"];function Is(e){var t=null==e?void 0:e.hostname;if(!ii(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of Cs)if(r===i)return!1;return!0}function Es(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function ks(e,t,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:s})}var xs=e=>{var t=null==es?void 0:es.createElement("a");return ri(t)?null:(t.href=e,t)},Ts=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return gs(e,(function(e,t){ri(e)||ri(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},Rs=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Kr(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){ds.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ms=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[0]||"",s=i[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],d=0;d<u.length;d++){var h=u[d].split("=");Kr(h)&&(t.includes(h[0])?c.push(h[0]+"="+r):c.push(u[d]))}var p=l;return null!=a&&(p+="?"+c.join("&")),null!=s&&(p+="#"+s),p},As=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Ps(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return Jr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Ls(e,t){var r,i=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of t.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Os="$people_distinct_id",Ns="__alias",Fs="__timers",Ds="$autocapture_disabled_server_side",Hs="$heatmaps_enabled_server_side",Bs="$exception_capture_enabled_server_side",qs="$error_tracking_suppression_rules",Us="$error_tracking_capture_extension_exceptions",$s="$web_vitals_enabled_server_side",Vs="$dead_clicks_enabled_server_side",js="$product_tours_enabled_server_side",Ws="$web_vitals_allowed_metrics",zs="$session_recording_remote_config",Zs="$sesid",Gs="$session_is_sampled",Ys="$enabled_feature_flags",Xs="$early_access_features",Ks="$feature_flag_details",Js="$stored_person_properties",Qs="$stored_group_properties",eo="$surveys",to="$flag_call_reported",ro="$feature_flag_errors",io="$user_state",no="$client_session_props",so="$capture_rate_limit",oo="$initial_campaign_params",ao="$initial_referrer_info",lo="$initial_person_info",uo="$epp",co="__POSTHOG_TOOLBAR__",ho="$posthog_cookieless",po=[Os,Ns,"__cmpns",Fs,"$session_recording_enabled_server_side",Hs,Zs,Ys,qs,io,Xs,Ks,Qs,Js,eo,to,ro,no,so,oo,ao,uo,lo,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function vo(e){return e instanceof Element&&(e.id===co||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function go(e){return!!e&&1===e.nodeType}function _o(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function fo(e){return!!e&&3===e.nodeType}function mo(e){return!!e&&11===e.nodeType}function yo(e){return e?Wr(e).split(/\s+/):[]}function bo(e){var t=null==Gn?void 0:Gn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function wo(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return yo(t)}function So(e){return oi(e)?null:Wr(e).split(/(\s+)/).filter((e=>Vo(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Co(e){var t="";return No(e)&&!Fo(e)&&e.childNodes&&e.childNodes.length&&gs(e.childNodes,(function(e){var r;fo(e)&&e.textContent&&(t+=null!==(r=So(e.textContent))&&void 0!==r?r:"")})),Wr(t)}function Io(e){return ri(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Eo=["a","button","form","input","select","textarea","label"];function ko(e,t){if(ri(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function xo(e){var t=e.parentNode;return!(!t||!go(t))&&t}var To=["next","previous","prev",">","<"],Ro=10;var Mo=[".ph-no-rageclick",".ph-no-capture"];function Ao(e,t){if(!Gn||Po(e))return!1;var r,i,n;ui(t)?(r=!!t&&Mo,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:Mo,i=null==t?void 0:t.content_ignorelist);if(!1===r)return!1;var{targetElementList:s}=Lo(e,!1);return!function(e,t){if(!1===e||ri(e))return!1;var r;if(!0===e)r=To;else{if(!Kr(e))return!1;if(e.length>Ro)return ds.error("[PostHog] content_ignorelist array cannot exceed "+Ro+" items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>t.includes(e)||i.includes(e)))}))}(i,s.map((e=>{var t;return{safeText:Co(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!ko(s,r)}var Po=e=>!e||_o(e,"html")||!go(e),Lo=(e,t)=>{if(!Gn||Po(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!_o(n,"body");)if(mo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=xo(n);if(!s)break;if(t||Eo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Gn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function Oo(e,t,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!Gn||Po(e))return!1;if(null!=(s=r)&&s.url_allowlist&&!bo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&bo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:c,targetElementList:d}=Lo(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(ri(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var s of e)if(i=n(s))return i.v;return!1}(d,r))return!1;if(!ko(d,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var h=Gn.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return c?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(Eo.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}function No(e){for(var t=e;t.parentNode&&!_o(t,"body");t=t.parentNode){var r=wo(t);if(jr(r,"ph-sensitive")||jr(r,"ph-no-capture"))return!1}if(jr(wo(e),"ph-include"))return!0;var i=e.type||"";if(ii(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";if(ii(n)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Fo(e){return!!(_o(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||_o(e,"select")||_o(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Do="(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})",Ho=new RegExp("^(?:"+Do+")$"),Bo=new RegExp(Do),qo="\\d{3}-?\\d{2}-?\\d{4}",Uo=new RegExp("^("+qo+")$"),$o=new RegExp("("+qo+")");function Vo(e,t){if(void 0===t&&(t=!0),oi(e))return!1;if(ii(e)){if(e=Wr(e),(t?Ho:Bo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Uo:$o).test(e))return!1}return!0}function jo(e){var t=Co(e);return Vo(t=(t+" "+Wo(e)).trim())?t:""}function Wo(e){var t="";return e&&e.childNodes&&e.childNodes.length&&gs(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Co(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Wo(e)).trim())}catch(e){ds.error("[AutoCapture]",e)}})),t}function zo(e){return function(e){var t=e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))n+="."+s.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return ms(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[Zo(t.toString())]=Zo(r.toString())})),n+=":",n+=ms(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Go(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ms(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(e))}function Zo(e){return e.replace(/"|\\"/g,'\\"')}function Go(e){var t=e.attr__class;return t?Kr(t)?t:yo(t):void 0}var Yo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Xo=hs("[Recorder]"),Ko=e=>"navigation"===e.entryType,Jo=e=>"resource"===e.entryType;function Qo(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>Ko(e)||Jo(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>oa({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>Ko(e)||Jo(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>oa({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}function ea(e,t){return!!t&&(ui(t)||t[e])}function ta(e){var{type:t,recordBody:r,headers:i,url:n}=e;function s(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(n))return!1;if(ui(r))return!0;if(Kr(r))return s(r);var o=r[t];return ui(o)?o:s(o)}function ra(e,t,r,i,n,s){return ia.apply(this,arguments)}function ia(){return ia=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return Xo.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Jo(e)&&e.initiatorType===t&&(ri(i)||e.startTime>=i)&&(ri(n)||e.startTime<=n)));return o||(yield new Promise((e=>setTimeout(e,50*s))),ra(e,t,r,i,n,s+1))})),ia.apply(this,arguments)}function na(e){var{body:t,options:r,url:i}=e;if(oi(t))return null;var{hostname:n,isHostDenied:s}=Ls(i,r);if(s)return n+" is in deny list";if(ii(t))return t;if(ls(t))return t.textContent;if(ci(t))return Ts(t);if(ei(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var sa=e=>!si(e)&&("navigation"===e.entryType||"resource"===e.entryType);function oa(e){var{entry:t,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:c}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[r({},t?t.toJSON():{name:u},{startTime:ri(a)?void 0:Math.round(a),endTime:ri(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:i,initiatorType:c||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(sa(t))for(var v of t.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(t.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var aa=["video/","audio/"];function la(e){return new Promise(((t,r)=>{var i=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(i)))}catch(e){clearTimeout(i),t("[SessionReplay] Failed to read body")}}))}function ua(){return ua=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=Ls(i,r);return s?Promise.resolve(n+" is in deny list"):la(t)})),ua.apply(this,arguments)}function ca(){return ca=t((function*(e){var{r:t,options:r,url:i}=e,n=function(e){var t,{r:r,options:i,url:n}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=aa.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Ls(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return si(n)?la(t):Promise.resolve(n)})),ca.apply(this,arguments)}function da(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=ea("request",i.recordHeaders),s=ea("response",i.recordHeaders),o=Ps(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u,c,d=new Request(t,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),n&&(h.requestHeaders=p),ta({type:"request",headers:p,url:t,recordBody:i.recordBody})&&(h.requestBody=yield function(e){return ua.apply(this,arguments)}({r:d,options:i,url:t})),u=r.performance.now(),l=yield o(d),c=r.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),s&&(h.responseHeaders=v),ta({type:"response",headers:v,url:t,recordBody:i.recordBody})&&(h.responseBody=yield function(e){return ca.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{ra(r,"fetch",d.url,u,c).then((t=>{var r,i=oa({entry:t,method:d.method,status:null==(r=l)?void 0:r.status,networkRequest:h,start:u,end:c,url:d.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}var ha=null;function pa(e,t,i){if(!("performance"in t))return()=>{};if(ha)return Xo.warn("Network observer already initialised, doing nothing"),()=>{};var n=i?Object.assign({},Yo,i):Yo,s=t=>{var i=[];t.requests.forEach((e=>{var t=n.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},o=Qo(s,t,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=ea("request",r.recordHeaders),n=ea("response",r.recordHeaders),s=Ps(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,c){void 0===l&&(l=!0);var d,h,p=this,v=new Request(a),g={},_={},f=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(_[e]=t,f(e,t)),i&&(g.requestHeaders=_);var m=p.send.bind(p);p.send=e=>(ta({type:"request",headers:_,url:a,recordBody:r.recordBody})&&(g.requestBody=na({body:e,options:r,url:a})),d=t.performance.now(),m(e));var y=()=>{p.removeEventListener("readystatechange",b),p.removeEventListener("error",y),p.removeEventListener("abort",y),p.removeEventListener("timeout",y)},b=()=>{if(p.readyState===p.DONE){y(),h=t.performance.now();var i={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(g.responseHeaders=i),ta({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(g.responseBody=na({body:p.response,options:r,url:a})),ra(t,"xmlhttprequest",v.url,d,h).then((t=>{var r=oa({entry:t,method:o,status:null==p?void 0:p.status,networkRequest:g,start:d,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};p.addEventListener("readystatechange",b),p.addEventListener("error",y),p.addEventListener("abort",y),p.addEventListener("timeout",y),s.call(p,o,a.toString(),l,u,c)}));return()=>{s()}}(s,t,n),l=da(s,t,n)),ha=()=>{o(),a(),l(),ha=null}}var va=e=>({name:"rrweb/network@1",observer:pa,options:e});os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hr,getRecordNetworkPlugin:va},os.__PosthogExtensions__.rrweb={record:Bt,version:"v2"},os.rrweb={record:Bt,version:"v2"},os.rrwebConsoleRecord={getRecordConsolePlugin:Hr},os.getRecordNetworkPlugin=va;var ga,_a,fa,ma,ya,ba,wa,Sa,Ca,Ia,Ea,ka,xa={},Ta=[],Ra=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ma=Array.isArray;function Aa(e,t){for(var r in t)e[r]=t[r];return e}function Pa(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function La(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?ga.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return Oa(e,o,i,n,null)}function Oa(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++fa:n,__i:-1,__u:0};return null==n&&null!=_a.vnode&&_a.vnode(s),s}function Na(e){return e.children}function Fa(e,t){this.props=e,this.context=t}function Da(e,t){if(null==t)return e.__?Da(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Da(e):null}function Ha(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Ha(e)}}function Ba(e){(!e.__d&&(e.__d=!0)&&ma.push(e)&&!$.__r++||ya!=_a.debounceRendering)&&((ya=_a.debounceRendering)||ba)($)}function $(){for(var e,t,r,i,n,s,o,a=1;ma.length;)ma.length>a&&ma.sort(wa),e=ma.shift(),a=ma.length,e.__d&&(r=void 0,i=void 0,n=(i=(t=e).__v).__e,s=[],o=[],t.__P&&((r=Aa({},i)).__v=i.__v+1,_a.vnode&&_a.vnode(r),za(t.__P,r,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Da(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Ga(s,r,o),i.__e=i.__=null,r.__e!=n&&Ha(r)));$.__r=0}function qa(e,t,r,i,n,s,o,a,l,u,c){var d,h,p,v,g,_,f,m=i&&i.__k||Ta,y=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,c=r.length,d=c,h=0;for(e.__k=new Array(n),s=0;s<n;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=Oa(null,o,null,null,null):Ma(o)?o=e.__k[s]=Oa(Na,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=Oa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+h,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=$a(o,r,l,d))&&(d--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>c?h--:n<c&&h++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?h--:u==l+1?h++:(u>l?h--:h++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;s<c;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Da(a)),Ka(a,a));return i}(r,t,m,l,y),d=0;d<y;d++)null!=(p=r.__k[d])&&(h=-1==p.__i?xa:m[p.__i]||xa,p.__i=d,_=za(e,p,h,n,s,o,a,l,u,c),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Xa(h.ref,null,p),c.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),(f=!!(4&p.__u))||h.__k===p.__k?l=Ua(p,l,e,f):"function"==typeof p.type&&void 0!==_?l=_:v&&(l=v.nextSibling),p.__u&=-7);return r.__e=g,l}function Ua(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=e,t=Ua(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=Da(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function $a(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],c=null!=u&&0==(2&u.__u);if(null===u&&null==a||c&&a==u.key&&l==u.type)return r;if(i>(c?1:0))for(n=r-1,s=r+1;n>=0||s<t.length;)if(null!=(u=t[o=n>=0?n--:s++])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function Va(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Ra.test(t)?r:r+"px"}function ja(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||Va(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||Va(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(Sa,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r.u=i.u:(r.u=Ca,e.addEventListener(t,s?Ea:Ia,s)):e.removeEventListener(t,s?Ea:Ia,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function Wa(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=Ca++;else if(t.t<r.u)return;return r(_a.event?_a.event(t):t)}}}function za(e,t,r,i,n,s,o,a,l,u){var c,d,h,p,v,g,_,f,m,y,b,$,w,S,C,I,E,k=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(c=_a.__b)&&c(t);e:if("function"==typeof k)try{if(f=t.props,m="prototype"in k&&k.prototype.render,y=(c=k.contextType)&&i[c.__c],b=c?y?y.props.value:c.__:i,r.__c?_=(d=t.__c=r.__c).__=d.__E:(m?t.__c=d=new k(f,b):(t.__c=d=new Fa(f,b),d.constructor=k,d.render=Ja),y&&y.sub(d),d.state||(d.state={}),d.__n=i,h=d.__d=!0,d.__h=[],d._sb=[]),m&&null==d.__s&&(d.__s=d.state),m&&null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Aa({},d.__s)),Aa(d.__s,k.getDerivedStateFromProps(f,d.__s))),p=d.props,v=d.state,d.__v=t,h)m&&null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),m&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(m&&null==k.getDerivedStateFromProps&&f!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(f,b),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(f,d.__s,b)){for(t.__v!=r.__v&&(d.props=f,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),$=0;$<d._sb.length;$++)d.__h.push(d._sb[$]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(f,d.__s,b),m&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=b,d.props=f,d.__P=e,d.__e=!1,w=_a.__r,S=0,m){for(d.state=d.__s,d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(i=Aa(Aa({},i),d.getChildContext())),m&&!h&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,v)),I=c,null!=c&&c.type===Na&&null==c.key&&(I=Ya(c.props.children)),a=qa(e,Ma(I)?I:[I],t,r,i,n,s,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),_&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(E=s.length;E--;)Pa(s[E]);Za(t)}else t.__e=r.__e,t.__k=r.__k,e.then||Za(t);_a.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=function(e,t,r,i,n,s,o,a,l){var u,c,d,h,p,v,g,_=r.props||xa,f=t.props,m=t.type;if("svg"==m?n="http://www.w3.org/2000/svg":"math"==m?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!m&&(m?p.localName==m:3==p.nodeType)){e=p,s[u]=null;break}if(null==e){if(null==m)return document.createTextNode(f);e=document.createElementNS(n,m,f.is&&f),a&&(_a.__m&&_a.__m(t,s),a=!1),s=null}if(null==m)_===f||a&&e.data==f||(e.data=f);else{if(s=s&&ga.call(e.childNodes),!a&&null!=s)for(_={},u=0;u<e.attributes.length;u++)_[(p=e.attributes[u]).name]=p.value;for(u in _)if(p=_[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=p;else if(!(u in f)){if("value"==u&&"defaultValue"in f||"checked"==u&&"defaultChecked"in f)continue;ja(e,u,null,p,n)}for(u in f)p=f[u],"children"==u?h=p:"dangerouslySetInnerHTML"==u?c=p:"value"==u?v=p:"checked"==u?g=p:a&&"function"!=typeof p||_[u]===p||ja(e,u,p,_[u],n);if(c)a||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),qa("template"==t.type?e.content:e,Ma(h)?h:[h],t,r,i,"foreignObject"==m?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Da(r,0),a,l),null!=s)for(u=s.length;u--;)Pa(s[u]);a||(u="value","progress"==m&&null==v?e.removeAttribute("value"):null!=v&&(v!==e[u]||"progress"==m&&!v||"option"==m&&v!=_[u])&&ja(e,u,v,_[u],n),u="checked",null!=g&&g!=e[u]&&ja(e,u,g,_[u],n))}return e}(r.__e,t,r,i,n,s,o,l,u);return(c=_a.diffed)&&c(t),128&t.__u?void 0:a}function Za(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Za)}function Ga(e,t,r){for(var i=0;i<r.length;i++)Xa(r[i],r[++i],r[++i]);_a.__c&&_a.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){_a.__e(e,t.__v)}}))}function Ya(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Ma(e)?e.map(Ya):Aa({},e)}function Xa(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){_a.__e(e,r)}}function Ka(e,t,r){var i,n;if(_a.unmount&&_a.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Xa(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){_a.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Ka(i[n],t,r||"function"!=typeof e.type);r||Pa(e.__e),e.__c=e.__=e.__e=void 0}function Ja(e,t,r){return this.constructor(e,r)}function Qa(e,t,r){var i,n,s;t==document&&(t=document.documentElement),_a.__&&_a.__(e,t),i=!1?null:t.__k,n=[],s=[],za(t,e=t.__k=La(Na,null,[e]),i||xa,xa,t.namespaceURI,i?null:t.firstChild?ga.call(t.childNodes):null,n,i?i.__e:t.firstChild,false,s),Ga(n,e,s)}function el(e,t,r){var i,n,s,o,a=Aa({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?ga.call(arguments,2):r),Oa(e.type,a,i||e.key,n||e.ref,null)}ga=Ta.slice,_a={__e:function(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},fa=0,Fa.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Aa({},this.state),"function"==typeof e&&(e=e(Aa({},r),this.props)),e&&Aa(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ba(this))},Fa.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ba(this))},Fa.prototype.render=Na,ma=[],ba="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wa=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,Sa=/(PointerCapture)$|Capture$/i,Ca=0,Ia=Wa(!1),Ea=Wa(!0),ka=0;var tl,rl,il,nl,sl=0,ol=[],al=_a,ll=al.__b,ul=al.__r,cl=al.diffed,dl=al.__c,hl=al.unmount,pl=al.__;function vl(e,t){al.__h&&al.__h(rl,e,sl||t),sl=0;var r=rl.__H||(rl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function gl(e){return sl=1,function(e,t,r){var i=vl(tl++,2);if(i.t=e,!i.__c&&(i.__=[kl(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=rl,!rl.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!s||s.call(this,e,t,r);var o=i.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s&&s.call(this,e,t,r)||o};rl.__f=!0;var s=rl.shouldComponentUpdate,o=rl.componentWillUpdate;rl.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,n(e,t,r),s=i}o&&o.call(this,e,t,r)},rl.shouldComponentUpdate=n}return i.__N||i.__}(kl,e)}function _l(e,t){var r=vl(tl++,3);!al.__s&&El(r.__H,t)&&(r.__=e,r.u=t,rl.__H.__h.push(r))}function fl(e){return sl=5,ml((function(){return{current:e}}),[])}function ml(e,t){var r=vl(tl++,7);return El(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function yl(e){var t=rl.context[e.__c],r=vl(tl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(rl)),t.props.value):e.__}function bl(){for(var e;e=ol.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Cl),e.__H.__h.forEach(Il),e.__H.__h=[]}catch(t){e.__H.__h=[],al.__e(t,e.__v)}}al.__b=function(e){rl=null,ll&&ll(e)},al.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pl&&pl(e,t)},al.__r=function(e){ul&&ul(e),tl=0;var t=(rl=e.__c).__H;t&&(il===rl?(t.__h=[],rl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Cl),t.__h.forEach(Il),t.__h=[],tl=0)),il=rl},al.diffed=function(e){cl&&cl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ol.push(t)&&nl===al.requestAnimationFrame||((nl=al.requestAnimationFrame)||Sl)(bl)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),il=rl=null},al.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Cl),e.__h=e.__h.filter((function(e){return!e.__||Il(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],al.__e(r,e.__v)}})),dl&&dl(e,t)},al.unmount=function(e){hl&&hl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Cl(e)}catch(e){t=e}})),r.__H=void 0,t&&al.__e(t,r.__v))};var wl="function"==typeof requestAnimationFrame;function Sl(e){var t,r=function(){clearTimeout(i),wl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);wl&&(t=requestAnimationFrame(r))}function Cl(e){var t=rl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),rl=t}function Il(e){var t=rl;e.__c=e.__(),rl=t}function El(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function kl(e,t){return"function"==typeof t?t(e):t}var xl=function(e){return e.Activation="events",e.Cancellation="cancelEvents",e}({}),Tl=function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e}({}),Rl=function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e}({}),Ml=function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e}({}),Al=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),Pl=function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e}({}),Ll=function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e}({}),Ol=function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e}({}),Nl=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e}({}),Fl=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e}({}),Dl=function(e){return e.Popover="popover",e.Inline="inline",e}({}),Hl=hs("[Surveys]");function Bl(e){return!(!e.start_date||e.end_date)}function ql(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Ul(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var $l="seenSurvey_",Vl="inProgressSurvey_",jl=(e,t)=>{var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r},Wl=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},zl=e=>Wl($l,e),Zl=e=>{localStorage.getItem(zl(e))||localStorage.setItem(zl(e),"true")},Gl=[Al.Popover,Al.Widget,Al.API],Yl={ignoreConditions:!1,ignoreDelay:!1,displayType:Dl.Popover};Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return ai(e)&&isFinite(e)&&Math.floor(e)===e});var Xl="0123456789abcdef";class Kl{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||t<0||r<0||i<0||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,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 Kl(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Xl.charAt(this.bytes[t]>>>4)+Xl.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Kl(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Jl{constructor(){this._timestamp=0,this._counter=0,this._random=new tu}generate(){var e=this.generateOrAbort();if(ri(e)){this._timestamp=0;var t=this.generateOrAbort();if(ri(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(!(e+1e4>this._timestamp))return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return Kl.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}}var Ql,eu=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Gn&&!ri(Gn.crypto)&&crypto.getRandomValues&&(eu=e=>crypto.getRandomValues(e));class tu{constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}nextUint32(){return this._cursor>=this._buffer.length&&(eu(this._buffer),this._cursor=0),this._buffer[this._cursor++]}}var ru=()=>iu().toString(),iu=()=>(Ql||(Ql=new Jl)).generate(),nu=["fatal","error","warning","log","info","debug"],su=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),ou=Uint8Array,au=Uint16Array,lu=Uint32Array,uu=new ou([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]),cu=new ou([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]),du=new ou([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hu=function(e,t){for(var r=new au(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];var n=new lu(r[30]);for(i=1;i<30;++i)for(var s=r[i];s<r[i+1];++s)n[s]=s-r[i]<<5|i;return[r,n]},pu=hu(uu,2),vu=pu[0],gu=pu[1];vu[28]=258,gu[258]=28;for(var _u=hu(cu,0)[1],fu=new au(32768),mu=0;mu<32768;++mu){var yu=(43690&mu)>>>1|(21845&mu)<<1;yu=(61680&(yu=(52428&yu)>>>2|(13107&yu)<<2))>>>4|(3855&yu)<<4,fu[mu]=((65280&yu)>>>8|(255&yu)<<8)>>>1}var bu=function(e,t,r){for(var i=e.length,n=0,s=new au(t);n<i;++n)++s[e[n]-1];var o,a=new au(t);for(n=0;n<t;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new au(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],d=a[e[n]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)o[fu[d]>>>l]=u}else for(o=new au(i),n=0;n<i;++n)o[n]=fu[a[e[n]-1]++]>>>15-e[n];return o},wu=new ou(288);for(mu=0;mu<144;++mu)wu[mu]=8;for(mu=144;mu<256;++mu)wu[mu]=9;for(mu=256;mu<280;++mu)wu[mu]=7;for(mu=280;mu<288;++mu)wu[mu]=8;var Su=new ou(32);for(mu=0;mu<32;++mu)Su[mu]=5;var Cu=bu(wu,9,0),Iu=bu(Su,5,0),Eu=function(e){return(e/8>>0)+(7&e&&1)},ku=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof au?au:e instanceof lu?lu:ou)(r-t);return i.set(e.subarray(t,r)),i},xu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8},Tu=function(e,t,r){r<<=7&t;var i=t/8>>0;e[i]|=r,e[i+1]|=r>>>8,e[i+2]|=r>>>16},Ru=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new ou(0),0];if(1==n){var o=new ou(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,c=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=n-1;)a=r[r[u].f<r[d].f?u++:d++],l=r[u!=c&&r[u].f<r[d].f?u++:d++],r[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(i=1;i<n;++i)s[i].s>h&&(h=s[i].s);var p=new au(h+1),v=Mu(r[c-1],p,0);if(v>t){i=0;var g=0,_=v-t,f=1<<_;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<n;++i){var m=s[i].s;if(!(p[m]>t))break;g+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=s[i].s;p[y]<t?g-=1<<t-p[y]++-1:++i}for(;i>=0&&g;--i){var b=s[i].s;p[b]==t&&(--p[b],++g)}v=t}return[new ou(p),v]},Mu=function(e,t,r){return-1==e.s?Math.max(Mu(e.l,t,r+1),Mu(e.r,t,r+1)):t[e.s]=r},Au=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new au(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;a<=t;++a)if(e[a]==n&&a!=t)++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=e[a]}return[r.subarray(0,i),t]},Pu=function(e,t){for(var r=0,i=0;i<t.length;++i)r+=e[i]*t[i];return r},Lu=function(e,t,r){var i=r.length,n=Eu(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;s<i;++s)e[n+s+4]=r[s];return 8*(n+4+i)},Ou=function(e,t,r,i,n,s,o,a,l,u,c){xu(t,c++,r),++n[256];for(var d=Ru(n,15),h=d[0],p=d[1],v=Ru(s,15),g=v[0],_=v[1],f=Au(h),m=f[0],y=f[1],b=Au(g),w=b[0],S=b[1],C=new au(19),I=0;I<m.length;++I)C[31&m[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var E=Ru(C,7),k=E[0],x=E[1],T=19;T>4&&!k[du[T-1]];--T);var R,M,A,P,L=u+5<<3,O=Pu(n,wu)+Pu(s,Su)+o,N=Pu(n,h)+Pu(s,g)+o+14+3*T+Pu(C,k)+(2*C[16]+3*C[17]+7*C[18]);if(L<=O&&L<=N)return Lu(t,c,e.subarray(l,l+u));if(xu(t,c,1+(N<O)),c+=2,N<O){R=bu(h,p,0),M=h,A=bu(g,_,0),P=g;var F=bu(k,x,0);xu(t,c,y-257),xu(t,c+5,S-1),xu(t,c+10,T-4),c+=14;for(I=0;I<T;++I)xu(t,c+3*I,k[du[I]]);c+=3*T;for(var D=[m,w],H=0;H<2;++H){var B=D[H];for(I=0;I<B.length;++I){var q=31&B[I];xu(t,c,F[q]),c+=k[q],q>15&&(xu(t,c,B[I]>>>5&127),c+=B[I]>>>12)}}}else R=Cu,M=wu,A=Iu,P=Su;for(I=0;I<a;++I)if(i[I]>255){q=i[I]>>>18&31;Tu(t,c,R[q+257]),c+=M[q+257],q>7&&(xu(t,c,i[I]>>>23&31),c+=uu[q]);var U=31&i[I];Tu(t,c,A[U]),c+=P[U],U>3&&(Tu(t,c,i[I]>>>5&8191),c+=cu[U])}else Tu(t,c,R[i[I]]),c+=M[i[I]];return Tu(t,c,R[256]),c+M[256]},Nu=new lu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fu=function(){for(var e=new lu(256),t=0;t<256;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),Du=function(e,t,r,i,n){return function(e,t,r,i,n,s){var o=e.length,a=new ou(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d<o?u=Lu(l,u,e.subarray(c,d)):(l[c]=s,u=Lu(l,u,e.subarray(c,o)))}else{for(var h=Nu[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,_=new au(32768),f=new au(g+1),m=Math.ceil(r/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new lu(25e3),S=new au(288),C=new au(32),I=0,E=0,k=(c=0,0),x=0,T=0;c<o;++c){var R=b(c),M=32767&c,A=f[R];if(_[M]=A,f[R]=M,x<=c){var P=o-c;if((I>7e3||k>24576)&&P>423){u=Ou(e,l,0,w,S,C,E,k,T,c-T,u),k=I=E=0,T=c;for(var L=0;L<286;++L)S[L]=0;for(L=0;L<30;++L)C[L]=0}var O=2,N=0,F=v,D=M-A&32767;if(P>2&&R==b(c-D))for(var H=Math.min(p,P)-1,B=Math.min(32767,c),q=Math.min(258,P);D<=B&&--F&&M!=A;){if(e[c+O]==e[c+O-D]){for(var U=0;U<q&&e[c+U]==e[c+U-D];++U);if(U>O){if(O=U,N=D,U>H)break;var V=Math.min(D,U-2),j=0;for(L=0;L<V;++L){var W=c-D+L+32768&32767,z=W-_[W]+32768&32767;z>j&&(j=z,A=W)}}}D+=(M=A)-(A=_[M])+32768&32767}if(N){w[k++]=268435456|gu[O]<<18|_u[N];var Z=31&gu[O],G=31&_u[N];E+=uu[Z]+cu[G],++S[257+Z],++C[G],x=c+O,++I}else w[k++]=e[c],++S[e[c]]}}u=Ou(e,l,s,w,S,C,E,k,T,c-T,u)}return ku(a,0,i+Eu(u)+n)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,i,!0)},Hu=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Bu(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p:function(t){for(var r=e,i=0;i<t.length;++i)r=Fu[255&r^t[i]]^r>>>8;e=r},d:function(){return 4294967295^e}}}(),i=e.length;r.p(e);var n=Du(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),s=n.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Hu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;i<=r.length;++i)e[i+10]=r.charCodeAt(i)}}(n,t),Hu(n,s-8,r.d()),Hu(n,s-4,i),n}var qu=function(e){var t,r,i,n,s="";for(t=r=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<i;n++){var o=e.charCodeAt(n),a=null;o<128?r++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),si(a)||(r>t&&(s+=e.substring(t,r)),s+=a,t=r=n+1)}return r>t&&(s+=e.substring(t,e.length)),s},Uu=!!is||!!rs,$u="text/plain",Vu=function(e,t,i){var n;void 0===i&&(i=!0);var[s,o]=e.split("?"),a=r({},t),l=null!==(n=null==o?void 0:o.split("&").map((e=>{var t,[r,n]=e.split("="),s=i&&null!==(t=a[r])&&void 0!==t?t:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],u=Ts(a);return u&&l.push(u),s+"?"+l.join("&")},ju=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Wu=e=>{var{data:t,compression:r}=e;if(t){if(r===su.GZipJS){var i=Bu(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new ou(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;o<r;++o){if(n+5>i.length){var a=new ou(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.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 ku(i,0,n)}(ju(t)),{mtime:0}),n=new Blob([i],{type:$u});return{contentType:$u,body:n,estimatedSize:n.size}}if(r===su.Base64){var s=function(e){var t,r,i,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!e)return e;e=qu(e);do{t=(s=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=s>>12&63,i=s>>6&63,n=63&s,c[l++]=o.charAt(t)+o.charAt(r)+o.charAt(i)+o.charAt(n)}while(a<e.length);switch(u=c.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(ju(t)),o=(e=>"data="+encodeURIComponent("string"==typeof e?e:ju(e)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=ju(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},zu=[];rs&&zu.push({transport:"fetch",method:e=>{var t,i,{contentType:n,body:s,estimatedSize:o}=null!==(t=Wu(e))&&void 0!==t?t:{},a=new Headers;gs(e.headers,(function(e,t){a.append(t,e)})),n&&a.append("Content-Type",n);var l=e.url,u=null;if(ns){var c=new ns;u={signal:c.signal,timeout:setTimeout((()=>c.abort()),e.timeout)}}rs(l,r({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(o||0)<52428.8,body:s,signal:null==(i=u)?void 0:i.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){ds.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{ds.error(t),null==e.callback||e.callback({statusCode:0,error:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),is&&zu.push({transport:"XHR",method:e=>{var t,r=new is;r.open(e.method||"GET",e.url,!0);var{contentType:i,body:n}=null!==(t=Wu(e))&&void 0!==t?t:{};gs(e.headers,(function(e,t){r.setRequestHeader(t,e)})),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(n)}}),null!=Qn&&Qn.sendBeacon&&zu.push({transport:"sendBeacon",method:e=>{var t=Vu(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Wu(e))&&void 0!==r?r:{},s="string"==typeof n?new Blob([n],{type:i}):n;Qn.sendBeacon(t,s)}catch(e){}}});var Zu=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Gu(e,t,r){return ju({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Yu={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Zu(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Zu(t,e))))),icontains:(e,t)=>t.map(Xu).some((t=>e.map(Xu).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Xu).every((t=>e.map(Xu).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},Xu=e=>e.toLowerCase();function Ku(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(ri(n)||si(n))return!1;var s=[String(n)],o=Yu[i.operator];return!!o&&o(i.values,s)}))}var Ju=hs("[Stylesheet Loader]"),Qu=Gn,ec=es;function tc(e){return"$survey_response_"+e}var rc="#020617",ic={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:Rl.Right,widgetType:Tl.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:rc,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function nc(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function sc(e){var t;void 0===e&&(e=ic.backgroundColor),"#"===e[0]&&(t=nc(e)),e.startsWith("rgb")&&(t=e);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"}[e.toLowerCase()];if(r&&(t=nc(r)),!t)return rc;var i=t.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?rc:"white"}return rc}function oc(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=t,null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Ju.error("prepare_external_dependency_stylesheet returned null"),null)})(ec,':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}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) 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:hover{cursor:pointer}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.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)}.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)}}',e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}var ac=(e,t,i)=>{var n=Tc(e),s=ec.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=ec.createElement("div");((e,t,i)=>{var n=r({},ic,i),s=e.style,o=![Rl.Center,Rl.Left,Rl.Right].includes(n.position)||t===Al.Widget&&(null==i?void 0:i.widgetType)===Tl.Tab;s.setProperty("--ph-survey-font-family",function(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?e+", "+t:"-apple-system, "+t}(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)||sc(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",sc(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||sc(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",sc(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)||sc(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,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=oc(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return ec.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},lc=(e,t)=>{if(!t)return null;var r=e[tc(t)];return Kr(r)?[...r]:r},uc=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a}=e;s?(Zl(i),s.capture(Nl.SENT,r({[Fl.SURVEY_NAME]:i.name,[Fl.SURVEY_ID]:i.id,[Fl.SURVEY_ITERATION]:i.current_iteration,[Fl.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Fl.SURVEY_QUESTIONS]:i.questions.map((e=>({id:e.id,question:e.question,response:lc(t,e.id)}))),[Fl.SURVEY_SUBMISSION_ID]:n,[Fl.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},t,a,{$set:{[jl(i,"responded")]:!0}})),o&&(Qu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),xc(i))):Hl.error("[survey sent] event not captured, PostHog instance not found.")},cc=e=>Object.values((null==e?void 0:e.responses)||{}).filter((e=>!oi(e))).length>0,dc=(e,t,i)=>r({[Fl.SURVEY_NAME]:e.name,[Fl.SURVEY_ID]:e.id,[Fl.SURVEY_ITERATION]:e.current_iteration,[Fl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[Fl.SURVEY_PARTIALLY_COMPLETED]:cc(t),sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url()},null==t?void 0:t.responses,{[Fl.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId,[Fl.SURVEY_QUESTIONS]:e.questions.map((e=>({id:e.id,question:e.question,response:lc((null==t?void 0:t.responses)||{},e.id)})))}),hc=(e,t,i)=>{if(t){if(!i){var n=Ec(e);t.capture(Nl.DISMISSED,r({},dc(e,n,t),{$set:{[jl(e,"dismissed")]:!0}})),xc(e),Zl(e),Qu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Hl.error("[survey dismissed] event not captured, PostHog instance not found.")},pc=(e,t)=>{if(t){var r=(e=>Wl("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=Ec(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(Nl.ABANDONED,dc(e,i,t),{transport:"sendBeacon"})}}else Hl.error("[survey abandoned] event not captured, PostHog instance not found.")},vc=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),gc=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,_c=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?gc(e.questions,vc(e.questions)):e.questions,fc=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===Ol.Always||kc(e)},mc=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,Ba(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+ka++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:"",properties:void 0}),yc=()=>yl(mc),bc=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return el(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function wc(e){return null!=e?e:"icontains"}function Sc(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==Qu||null==(r=Qu.location)?void 0:r.href;if(!n)return!1;var s=[e.conditions.url],o=wc(null==(i=e.conditions)?void 0:i.urlMatchType);return Yu[o](s,[n])}var Cc=e=>{var t=""+Vl+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+Vl+e.id+"_"+e.current_iteration),t},Ic=(e,t)=>{try{localStorage.setItem(Cc(e),JSON.stringify(t))}catch(e){Hl.error("Error setting in-progress survey state in localStorage",e)}},Ec=e=>{try{var t=localStorage.getItem(Cc(e));if(t)return JSON.parse(t)}catch(e){Hl.error("Error getting in-progress survey state from localStorage",e)}return null},kc=e=>{var t=Ec(e);return!oi(null==t?void 0:t.surveySubmissionId)},xc=e=>{try{localStorage.removeItem(Cc(e))}catch(e){Hl.error("Error clearing in-progress survey state from localStorage",e)}};function Tc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function Rc(e,t,r){if(void 0===t&&(t=Rl.Right),e===Al.ExternalSurvey)return{};switch(t){case Rl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Rl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Rl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Rl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Rl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Rl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Rl.Left:return{left:"30px"};case Rl.Center:return{left:"50%",transform:"translateX(-50%)"};default:case Rl.Right:return{right:e===Al.Widget&&r===Tl.Tab?"60px":"30px"}}}var Mc=0;function Ac(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Mc,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return _a.vnode&&_a.vnode(u),u}var Pc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Lc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Oc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Nc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Fc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ac("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"})}),Dc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ac("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"})}),Hc=Ac("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ac("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"})}),Bc=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return Ac("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ac("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ac("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:t})]})},qc=Ac("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ac("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ac("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ac("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ac("g",{mask:"url(#mask0_2415_6911)",children:[Ac("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"}),Ac("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"}),Ac("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"}),Ac("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"}),Ac("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"}),Ac("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"})]})]}),Ac("defs",{children:Ac("clipPath",{id:"clip0_2415_6911",children:Ac("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Uc(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return Ac("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",qc]})}function $c(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=e,{isPreviewMode:l}=yl(mc);return Ac("div",{className:"bottom-section",children:[!a&&Ac("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==Gn||Gn.open(s)),l?null==o||o():n()},children:t}),!i.whiteLabel&&Ac(Uc,{urlParams:{utm_source:"survey-footer"}})]})}function Vc(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return Ac("div",{class:"question-header",children:[Ac(t.type===Pl.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&bc({component:La("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function jc(e){var{onClick:t}=e,{isPreviewMode:r}=yl(mc);return Ac("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:Bc({fill:"black"})})}Ac("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ac("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 Wc=Gn;function zc(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=yl(mc);return _l((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return ks(Wc,"keydown",e),()=>{Wc.removeEventListener("keydown",e)}}),[o]),Ac("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ac(jc,{onClick:()=>o()}),Ac("h3",{className:"thank-you-message-header",children:t}),r&&bc({component:La("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Ac($c,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Zc=e=>Kr(e)&&e.every((e=>ii(e)));function Gc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=e,{isPreviewMode:l}=yc(),u=fl(null),[c,d]=gl((()=>ii(a)?a:""));_l((()=>{setTimeout((()=>{var e;l||(null==(e=u.current)||e.focus())}),100)}),[l]);var h="surveyQuestion"+o,p=ml((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case Br.MinLength:if(void 0!==o.value&&s.length<o.value)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Br.MaxLength: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}(c,t.validation,t.optional)),[c,t.validation,t.optional]),v=Ur(t.validation,Br.MinLength),g=Ur(t.validation,Br.MaxLength),_=ml((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(v,g)),[v,g]);return Ac(Na,{children:[Ac("div",{className:"question-container",children:[Ac(Vc,{question:t,forceDisableHtml:r,htmlFor:h}),Ac("textarea",{ref:u,id:h,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:v,maxLength:g,onInput:e=>{d(e.currentTarget.value),e.stopPropagation()},onKeyDown:e=>{e.stopPropagation()},value:c}),_&&Ac("div",{className:"validation-hint",children:_})]}),Ac($c,{text:t.buttonText||"Submit",submitDisabled:!!p,appearance:i,onSubmit:()=>{p||n(c.trim())},onPreviewSubmit:()=>{p||s(c.trim())}})]})}function Yc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=e;return Ac(Na,{children:[Ac("div",{className:"question-container",children:Ac(Vc,{question:t,forceDisableHtml:r})}),Ac($c,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Xc(e){var t,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=r.scale,c=10===r.scale?0:1,[d,h]=gl((()=>ai(l)?l:Kr(l)&&l.length>0&&ai(parseInt(l[0]))?parseInt(l[0]):ii(l)&&ai(parseInt(l))?parseInt(l):null)),p="emoji"===r.display&&2===r.scale,{isPreviewMode:v}=yc(),g=e=>v?a(e):o(e);return Ac(Na,{children:[Ac("div",{className:"question-container",children:[Ac(Vc,{question:r,forceDisableHtml:i}),Ac("div",{className:"rating-section",children:[Ac("div",{className:"rating-options",children:["emoji"===r.display&&Ac("div",{className:"rating-options-emoji"+(p?" rating-options-emoji-2":""),children:null==(t=rd[r.scale])?void 0:t.map(((e,t)=>Ac("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===d?"rating-active":""),value:t+1,type:"button",onClick:()=>{var e=t+1;h(e),r.skipSubmitButton&&g(e)},children:e},t)))}),"number"===r.display&&Ac("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-c+1)+", minmax(0, 1fr))"},children:id(r.scale).map(((e,t)=>Ac(Kc,{displayQuestionIndex:n,active:d===e,appearance:s,num:e,setActiveNumber:e=>{h(e),r.skipSubmitButton&&g(e)}},t)))})]}),!p&&Ac("div",{className:"rating-text",children:[Ac("div",{children:r.lowerBoundLabel}),Ac("div",{children:r.upperBoundLabel})]})]})]}),Ac($c,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:si(d)&&!r.optional,appearance:s,onSubmit:()=>o(d),onPreviewSubmit:()=>a(d),skipSubmitButton:r.skipSubmitButton})]})}function Kc(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return Ac("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick:()=>{n(t)},children:t})}function Jc(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=fl(null),c=ml((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=gc(t,vc(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[d,h]=gl((()=>((e,t)=>ii(e)||Zc(e)?e:t===Pl.SingleChoice?null:[])(l,t.type))),[p,v]=gl((()=>((e,t)=>{if(ii(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Zc(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,c))),{isPreviewMode:g}=yc(),_=t.type===Pl.SingleChoice,f=t.type===Pl.MultipleChoice,m=t.skipSubmitButton&&_&&!t.hasOpenChoice,y=(e,t)=>{if(t){var i=!p.isSelected;return v((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),_&&h(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(_)return h(e),v((e=>r({},e,{isSelected:!1,inputValue:""}))),void(m&&(o(e),g&&a(e)));f&&Kr(d)&&(d.includes(e)?h(d.filter((t=>t!==e))):h([...d,e]))},b=e=>{e.stopPropagation();var t=e.currentTarget.value;v((e=>r({},e,{inputValue:t}))),_&&h(t)},w=e=>{e.stopPropagation(),"Enter"!==e.key||S()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),v((e=>r({},e,{isSelected:!1,inputValue:""}))),_&&h(null))},S=()=>!t.optional&&(!!si(d)||(!(!Kr(d)||p.isSelected||0!==d.length)||!(!p.isSelected||""!==p.inputValue.trim()))),C=()=>{p.isSelected&&f?Kr(d)&&(g?a([...d,p.inputValue]):o([...d,p.inputValue])):g?a(d):o(d)};return Ac(Na,{children:[Ac("div",{className:"question-container",children:[Ac(Vc,{question:t,forceDisableHtml:i}),Ac("fieldset",{className:"multiple-choice-options limit-height",children:[Ac("legend",{className:"sr-only",children:f?" Select all that apply":" Select one"}),c.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?p.isSelected:_?d===e:Kr(d)&&d.includes(e);return Ac("label",{className:i?"choice-option-open":"",children:[Ac("div",{className:"response-choice",children:[Ac("input",{type:_?"radio":"checkbox",name:s,checked:a,onChange:()=>y(e,i),id:s,"aria-controls":o}),Ac("span",{children:i?e+":":e})]}),i&&Ac("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:p.inputValue,onKeyDown:w,onInput:b,onClick:t=>{p.isSelected||y(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),Ac($c,{text:t.buttonText||"Submit",submitDisabled:S(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:m})]})}var Qc=[1,2,3,4,5],ed=[1,2,3,4,5,6,7],td=[0,1,2,3,4,5,6,7,8,9,10],rd={2:[Dc,Hc],3:[Oc,Lc,Pc],5:[Nc,Oc,Lc,Pc,Fc]};function id(e){switch(e){case 5:default:return Qc;case 7:return ed;case 10:return td}}var nd=hs("[Surveys]");function sd(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?Ll.End:s;if(n.branching.type===Ll.End)return Ll.End;if(n.branching.type===Ll.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Ll.ResponseBased){if(n.type===Pl.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===Ll.End?Ll.End:s}}else if(n.type===Pl.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(e<1||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}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(c)){var d=n.branching.responseValues[c];return Number.isInteger(d)?d:d===Ll.End?Ll.End:s}}return s}return nd.warn("Falling back to next question index due to unexpected branching type"),s}var od=Gn,ad=es,ld="ph:show_survey_widget",ud="PHWidgetSurveyClickListener",cd=250,dd=20,hd=12;function pd(e,t){try{var r=e.getBoundingClientRect(),i=od.innerHeight,n=od.innerWidth,s=cd,o=r.left+r.width/2-t/2;o+t>n-dd&&(o=n-t-dd),o<dd&&(o=dd);var a=hd,l=i-r.bottom,u=r.top,c=l<s&&u>l;return{position:"fixed",top:c?"auto":r.bottom+a+"px",left:o+"px",right:"auto",bottom:c?i-r.top+a+"px":"auto",zIndex:ic.zIndex}}catch(e){return Hl.warn("Failed to calculate trigger position:",e),null}}class vd{constructor(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._prefillHandledSurveys=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(eo);if(e)for(var t of e)kc(t)&&pc(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,a=null!=t&&t.position||null!=t&&t.selector?r({},e,{appearance:r({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e;this._clearSurveyTimeout(a.id);var{properties:l,initialResponses:u}=null!=t?t:{},c=!!(u&&Object.keys(u).length>0)&&this._handleInitialResponses(a,u,l);if(!c||null!=(i=a.appearance)&&i.displayThankYouMessage){this._addSurveyToFocus(a);var d={};if((null==(n=a.appearance)?void 0:n.position)===Rl.NextToTrigger&&null!=(s=a.appearance)&&s.widgetSelector){var h,p=ad.querySelector(a.appearance.widgetSelector);if(p)d=pd(p,parseInt((null==(h=a.appearance)?void 0:h.maxWidth)||ic.maxWidth))||{}}var v=(null==(o=a.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:g}=ac(a,this._posthog),_={posthog:this._posthog,survey:a,removeSurveyFromFocus:this._removeSurveyFromFocus,properties:l,style:d,isSurveyCompleted:c,skipShownEvent:null==t?void 0:t.skipShownEvent};if(v<=0)return Qa(Ac(md,r({},_)),g);var f=setTimeout((()=>{if(this._surveyTimeouts.delete(a.id),!Sc(a))return this._removeSurveyFromFocus(a);Qa(Ac(md,r({},_,{survey:r({},a,{appearance:r({},a.appearance,{surveyPopupDelaySeconds:0})})})),g)}),1e3*v);this._surveyTimeouts.set(a.id,f)}},this._handleWidget=e=>{var{shadow:t,isNewlyCreated:r}=ac(e,this._posthog);r&&Qa(Ac(bd,{posthog:this._posthog,survey:e},e.id),t)},this._removeWidgetSelectorListener=e=>{this._removeSurveyFromDom(e);var t=this._widgetSelectorListeners.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(ud),this._widgetSelectorListeners.delete(e.id),Hl.info("Removed click listener for survey "+e.id))},this._manageWidgetSelectorListener=(e,t)=>{var r=ad.querySelector(t),i=this._widgetSelectorListeners.get(e.id);if(r){if(this._handleWidget(e),i){if(r===i.element)return;Hl.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this._removeWidgetSelectorListener(e)}if(!r.hasAttribute(ud)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===Rl.NextToTrigger?pd(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||ic.maxWidth)):{};od.dispatchEvent(new CustomEvent(ld,{detail:{surveyId:e.id,position:n}}))};ks(r,"click",n),r.setAttribute(ud,"true"),this._widgetSelectorListeners.set(e.id,{element:r,listener:n,survey:e}),Hl.info("Attached click listener for feedback button survey "+e.id)}}else i&&this._removeWidgetSelectorListener(e)},this.renderPopover=e=>{var{shadow:t}=ac(e,this._posthog);Qa(Ac(md,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus}),t)},this.renderSurvey=(e,t,r)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this._handleUrlPrefill(e),Qa(Ac(md,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this._removeSurveyFromFocus,isPopup:!1,properties:r}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||i.surveys.getSurveys((r=>{var i=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t._isSurveyConditionMatched(e)&&t._hasActionOrEventTriggeredSurvey(e)&&t._checkFlags(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Al.Popover||e.type===Al.Widget)),i=t._sortSurveysByAppearanceDelay(r),n=new Set;i.forEach((e=>{if(e.type===Al.Widget){var r,i,s,o;if((null==(r=e.appearance)?void 0:r.widgetType)===Tl.Tab)return void t._handleWidget(e);if((null==(i=e.appearance)?void 0:i.widgetType)===Tl.Selector&&null!=(s=e.appearance)&&s.widgetSelector)n.add(e.id),t._manageWidgetSelectorListener(e,null==(o=e.appearance)?void 0:o.widgetSelector)}si(t._surveyInFocus)&&e.type===Al.Popover&&t.handlePopoverSurvey(e)})),t._widgetSelectorListeners.forEach((e=>{var{survey:r}=e;n.has(r.id)||t._removeWidgetSelectorListener(r)}))}),e)},this._addSurveyToFocus=e=>{si(this._surveyInFocus)||Hl.error("Survey "+this._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),this._surveyInFocus=e.id},this._removeSurveyFromFocus=e=>{this._surveyInFocus!==e.id&&Hl.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this._clearSurveyTimeout(e.id),this._surveyInFocus=null,this._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null}_clearSurveyTimeout(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))}cancelSurvey(e){this._surveyTimeouts.has(e)&&(Hl.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null))}_sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var r,i,n=kc(e),s=kc(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===Ol.Always,a=t.schedule===Ol.Always;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}_handleUrlPrefill(e){if(!this._prefillHandledSurveys.has(e.id)){var{params:t}=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!ri(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var c=l.match(/^q(\d+)$/);if(c){var d=parseInt(c[1],10);t[d]||(t[d]=[]),t[d].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(od.location.search);if(0!==Object.keys(t).length){Hl.info("[Survey Prefill] Detected URL prefill parameters");var r=this._processPrefillData(e,t);if(r){var{responses:i,submissionId:n,isSurveyCompleted:s,skippedResponses:o}=r;(Object.keys(o).length>0&&e.enable_partial_responses||s)&&uc({responses:s?i:o,survey:e,surveySubmissionId:n,posthog:this._posthog,isSurveyCompleted:s}),this._prefillHandledSurveys.add(e.id)}}}}_handleInitialResponses(e,t,r){var i={};for(var[n,s]of Object.entries(t)){i[parseInt(n)]=Kr(s)?s.map(String):[String(s)]}Hl.info("[Survey] Processing initial responses");var o=this._processPrefillData(e,i);if(!o)return!1;var{responses:a,submissionId:l,isSurveyCompleted:u}=o;return uc({responses:a,survey:e,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:u,properties:r}),u}_processPrefillData(e,t){try{var r=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=tc(e.id);try{switch(e.type){case Pl.SingleChoice:if(!e.choices||0===e.choices.length)return void ds.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=e.choices.length)return void ds.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Pl.MultipleChoice:if(!e.choices||0===e.choices.length)return void ds.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&t<e.choices.length));if(0===a.length)return void ds.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];l.length<a.length&&ds.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Pl.Rating:var u=parseInt(n[0],10),c=e.scale||10;if(isNaN(u)||u<0||u>c)return void ds.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+c+")");r[s]=u;break;default:ds.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){ds.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(r).length)return Hl.warn("[Survey Prefill] No valid responses after conversion"),null;var i=ru(),n=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:s,skippedResponses:o}=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;i<e.questions.length&&0<s&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=tc(o.id);ri(r[a])||(n[a]=r[a])}var l=sd(e,i,o.id?r[tc(o.id)]:null);if(l===Ll.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,n,r),a=s>=e.questions.length;return Ic(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:s}),Hl.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:s,isSurveyCompleted:a,skippedResponses:o}}catch(e){return Hl.error("[Survey Prefill] Error handling prefill:",e),null}}_isSurveyFeatureFlagEnabled(e,t){if(void 0===t&&(t=void 0),!e)return!0;var r=!!this._posthog.featureFlags.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")}),i=!0;t&&(i=this._posthog.featureFlags.getFeatureFlag(e,{send_event:!1})===t||"any"===t);return r&&i}_isSurveyConditionMatched(e){return!e.conditions||Sc(e)&&function(e){var t,r,i;if(null==(t=e.conditions)||!t.deviceTypes||0===(null==(r=e.conditions)?void 0:r.deviceTypes.length))return!0;if(!ss)return!1;var n=bn(ss);return Yu[wc(null==(i=e.conditions)?void 0:i.deviceTypesMatchType)](e.conditions.deviceTypes,[n])}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==ec||!ec.querySelector(e.conditions.selector))}(e)}_internalFlagCheckSatisfied(e){return fc(e)||this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)||kc(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!Bl(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!Gl.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this._isSurveyFeatureFlagEnabled(e.linked_flag_key,n)?this._isSurveyFeatureFlagEnabled(e.targeting_flag_key)?this._internalFlagCheckSatisfied(e)?(e=>{var t=localStorage.getItem("lastSeenSurveyDate");if(!e||!t)return!0;var r=new Date,i=Math.abs(r.getTime()-new Date(t).getTime());return Math.ceil(i/864e5)>e})(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays)?(e=>!!localStorage.getItem(zl(e))&&!fc(e))(e)?(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="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}_hasActionOrEventTriggeredSurvey(e){var t;if(!ql(e)&&!Ul(e))return!0;var r=null==(t=this._posthog.surveys._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}_checkFlags(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this._isSurveyFeatureFlagEnabled(r)}))}_removeSurveyFromDom(e){try{var t=ad.querySelector(Tc(e,!0));null!=t&&t.shadowRoot&&Qa(null,t.shadowRoot),null==t||t.remove()}catch(t){Hl.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this._addSurveyToFocus,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyInFocus:this._surveyInFocus,surveyTimeouts:this._surveyTimeouts,handleWidget:this._handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this._manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this._sortSurveysByAppearanceDelay,checkFlags:this._checkFlags.bind(this),isSurveyFeatureFlagEnabled:this._isSurveyFeatureFlagEnabled.bind(this)}}}function gd(e,t){if(ad&&od){var r,i=new vd(e);if(e.config.disable_surveys_automatic_display)return Hl.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return Hl.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{ri(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),ks(ad,"visibilitychange",(()=>{ad.hidden?ri(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function _d(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;_l((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var s=()=>{var e,n=t.type===Al.Widget,s=Sc(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===Tl.Tab&&n;if(!s)return Hl.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(Hl.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};ks(od,"popstate",s),ks(od,"hashchange",s);var o=od.history.pushState,a=od.history.replaceState;return od.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.apply(this,t),s()},od.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),s()},()=>{od.removeEventListener("popstate",s),od.removeEventListener("hashchange",s),od.history.pushState=o,od.history.replaceState=a}}}),[n,t,r,i])}function fd(e){switch(void 0===e&&(e=Ml.Right),e){case Ml.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Ml.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Ml.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case Ml.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function md(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,style:d={},previewPageIndex:h,removeSurveyFromFocus:p=(()=>{}),isPopup:v=!0,onPreviewSubmit:g=(()=>{}),onPopupSurveyDismissed:_=(()=>{}),onCloseConfirmationMessage:f=(()=>{}),properties:m,isSurveyCompleted:y,skipShownEvent:b}=e,w=fl(null),S=Number.isInteger(h),C=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:I,isSurveySent:E,hidePopupWithViewTransition:k}=function(e,t,r,i,n,s,o,a){var[l,u]=gl(i||0===r||e.type===Al.ExternalSurvey),[c,d]=gl(!1),h=()=>{var t=()=>{s&&n(e),u(!1)};ad.startViewTransition?ad.startViewTransition((()=>{var e;null==o||null==(e=o.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&h()};return _l((()=>{if(t){if(!i){var n=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return h();d(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{h()}),5e3)}},s=()=>{Sc(e)&&(u(!0),od.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(Nl.SHOWN,{[Fl.SURVEY_NAME]:e.name,[Fl.SURVEY_ID]:e.id,[Fl.SURVEY_ITERATION]:e.current_iteration,[Fl.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(ks(od,"PHSurveyClosed",p),ks(od,"PHSurveySent",n),r>0){var o=setTimeout(s,r);return()=>{clearTimeout(o),od.removeEventListener("PHSurveyClosed",p),od.removeEventListener("PHSurveySent",n)}}return s(),()=>{od.removeEventListener("PHSurveyClosed",p),od.removeEventListener("PHSurveySent",n)}}}else Hl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),_d({survey:e,removeSurveyFromFocus:n,setSurveyVisible:u,isPreviewMode:i}),{isPopupVisible:l,isSurveySent:c,setIsPopupVisible:u,hidePopupWithViewTransition:h}}(l,c,C,S,p,v,w,b),x=E||h===l.questions.length||!0===y,T=ml((()=>{var e=Ec(l);return{isPreviewMode:S,previewPageIndex:h,onPopupSurveyDismissed:()=>{hc(l,c,S),_()},isPopup:v||!1,surveySubmissionId:(null==e?void 0:e.surveySubmissionId)||ru(),onPreviewSubmit:g,posthog:c,properties:m}}),[S,h,v,c,l,_,g,m]);return I?Ac(mc.Provider,{value:T,children:Ac("div",{className:"ph-survey",style:r({},Rc(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),d),ref:w,children:x?Ac(zc,{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||ic,onClose:()=>{k(),f()}}):Ac(yd,{survey:l,forceDisableHtml:!!u,posthog:c})})}):null}function yd(e){var t,{survey:i,forceDisableHtml:n,posthog:s}=e,[o,a]=gl((()=>{var e=Ec(i);return null!=e&&e.responses&&Hl.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:c,onPreviewSubmit:d,surveySubmissionId:h,isPreviewMode:p,properties:v}=yl(mc),[g,_]=gl((()=>{var e=Ec(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),f=ml((()=>_c(i)),[i]);_l((()=>{p&&!ri(l)&&_(l)}),[l,p]);var m=f.at(g);return m?Ac("form",{className:"survey-form",name:"surveyForm",children:[c&&!0!==(null==(t=i.appearance)?void 0:t.hideCancelButton)&&Ac(jc,{onClick:()=>{u()}}),Ac("div",{className:"survey-box",children:wd({question:m,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||ic,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:l}=e;if(s)if(l){var u=tc(l),c=r({},o,{[u]:t});a(c);var d=sd(i,n,t),p=d===Ll.End;p||(_(d),Ic(i,{surveySubmissionId:h,responses:c,lastQuestionIndex:d})),(i.enable_partial_responses||p)&&uc({responses:c,survey:i,surveySubmissionId:h,isSurveyCompleted:p,posthog:s,properties:v})}else Hl.error("onNextButtonClick called without a questionId.");else Hl.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:g,questionId:m.id}),onPreviewSubmit:d,initialValue:m.id?o[tc(m.id)]:void 0})})]}):null}function bd(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:c,readOnly:d}=e,[h,p]=gl(!0),[v,g]=gl(!1),[_,f]=gl({}),m=()=>{g(!v)};if(_l((()=>{var e;if(c){if(!d){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&f({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(Hl.info("Received show event for feedback button survey "+l.id),f(r.detail.position||{}),m())};return ks(od,ld,t),()=>{od.removeEventListener(ld,t)}}}else Hl.error("FeedbackWidget called without a PostHog instance.")}),[c,d,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),_d({survey:l,setSurveyVisible:p}),!h)return null;var y=()=>{l.schedule!==Ol.Always&&p(!1),setTimeout((()=>{g(!1)}),200)};return Ac(Na,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ac("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Ml.Top?"widget-tab-top":""),onClick:m,disabled:d,style:fd(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),v&&Ac(md,{posthog:c,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:y,onCloseConfirmationMessage:y})]})}var wd=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u={forceDisableHtml:i,appearance:s,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{o(e)},initialValue:l,displayQuestionIndex:n};switch(t.type){case Pl.Open:return La(Gc,r({},u,{question:t,key:t.id}));case Pl.Link:return La(Yc,r({},u,{question:t,key:t.id}));case Pl.Rating:return La(Xc,r({},u,{question:t,key:t.id}));case Pl.SingleChoice:case Pl.MultipleChoice:return La(Jc,r({},u,{question:t,key:t.id}));default:return Hl.error("Unsupported question type: "+t.type),null}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.generateSurveys=gd,os.extendPostHogWithSurveys=gd;class Sd{emit(e){}}var Cd=new Sd;var Id=new class{getLogger(e,t,r){return new Sd}};class Ed{constructor(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;var e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Cd}}class kd{getLogger(e,t,r){var i;return null!==(i=this._getDelegateLogger(e,t,r))&&void 0!==i?i:new Ed(this,e,t,r)}_getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Id}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getLogger(e,t,r)}}var xd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Td=Symbol.for("io.opentelemetry.js.api.logs"),Rd=xd;class Md{constructor(){this._proxyLoggerProvider=new kd}static getInstance(){return this._instance||(this._instance=new Md),this._instance}setGlobalLoggerProvider(e){return Rd[Td]?this.getLoggerProvider():(Rd[Td]=(t=1,r=e,i=Id,e=>e===t?r:i),this._proxyLoggerProvider._setDelegate(e),e);var t,r,i}getLoggerProvider(){var e,t;return null!==(t=null===(e=Rd[Td])||void 0===e?void 0:e.call(Rd,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete Rd[Td],this._proxyLoggerProvider=new kd}}var Ad=Md.getInstance();class Pd{constructor(e){this._delegate=void 0,this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class Ld extends Error{constructor(e,t,r){super(e),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=t}}function Od(e){if(Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}class Nd{constructor(e){this._concurrencyLimit=void 0,this._sendingPromises=[],this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);var t=()=>{var t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}awaitAll(){var e=this;return t((function*(){yield Promise.all(e._sendingPromises)}))()}}function Fd(e){return new Nd(e.concurrencyLimit)}var Dd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Hd="1.9.0",Bd=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var qd=function(e){var t=new Set([e]),r=new Set,i=e.match(Bd);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(t){return t===e};function a(e){return r.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var i=e.match(Bd);if(!i)return a(e);var u=+i[1],c=+i[2],d=+i[3];return null!=i[4]||n!==u?a(e):0===n?s===c&&o<=d?l(e):a(e):s<=c?l(e):a(e)}}(Hd),Ud=Hd.split(".")[0],$d=Symbol.for("opentelemetry.js.api."+Ud),Vd=Dd;function jd(e,t,r,i){var n;void 0===i&&(i=!1);var s=Vd[$d]=null!==(n=Vd[$d])&&void 0!==n?n:{version:Hd};if(!i&&s[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}if(s.version!==Hd){o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+Hd);return r.error(o.stack||o.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Hd+"."),!0}function Wd(e){var t,r,i=null===(t=Vd[$d])||void 0===t?void 0:t.version;if(i&&qd(i))return null===(r=Vd[$d])||void 0===r?void 0:r[e]}function zd(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Hd+".");var r=Vd[$d];r&&delete r[e]}var Zd,Gd=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Yd=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},Xd=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Kd("verbose",this._namespace,e)},e}();function Kd(e,t,r){var i=Wd("diag");if(i)return r.unshift(t),i[e].apply(i,Yd([],Gd(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Zd||(Zd={}));var Jd=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},Qd=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},eh=function(){function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=Wd("diag");if(i)return i[e].apply(i,Qd([],Jd(t),!1))}}var t=this;t.setLogger=function(e,r){var i,n,s;if(void 0===r&&(r={logLevel:Zd.INFO}),e===t){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=Wd("diag"),l=function(e,t){function r(r,i){var n=t[r];return"function"==typeof n&&e>=i?n.bind(t):function(){}}return e<Zd.NONE?e=Zd.NONE:e>Zd.ALL&&(e=Zd.ALL),t=t||{},{error:r("error",Zd.ERROR),warn:r("warn",Zd.WARN),info:r("info",Zd.INFO),debug:r("debug",Zd.DEBUG),verbose:r("verbose",Zd.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Zd.INFO,e);if(a&&!r.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),l.warn("Current logger will overwrite one already registered from "+u)}return jd("diag",l,t,!0)},t.disable=function(){zd("diag",t)},t.createComponentLogger=function(e){return new Xd(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function th(e){return Symbol.for(e)}var rh,ih=function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,i){var n=new e(r._currentContext);return n._currentContext.set(t,i),n},r.deleteValue=function(t){var i=new e(r._currentContext);return i._currentContext.delete(t),i}},nh=new ih,sh=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},oh=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},ah=function(){function e(){}return e.prototype.active=function(){return nh},e.prototype.with=function(e,t,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];return t.call.apply(t,oh([r],sh(i),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),lh=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},uh=function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))},ch="context",dh=new ah,hh=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return jd(ch,e,eh.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,r){for(var i,n=[],s=3;s<arguments.length;s++)n[s-3]=arguments[s];return(i=this._getContextManager()).with.apply(i,uh([e,t,r],lh(n),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Wd(ch)||dh},e.prototype.disable=function(){this._getContextManager().disable(),zd(ch,eh.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(rh||(rh={}));var ph="0000000000000000",vh="00000000000000000000000000000000",gh={traceId:vh,spanId:ph,traceFlags:rh.NONE},_h=function(){function e(e){void 0===e&&(e=gh),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),fh=th("OpenTelemetry Context Key SPAN");function mh(e){return e.getValue(fh)||void 0}function yh(){return mh(hh.getInstance().active())}function bh(e,t){return e.setValue(fh,t)}function wh(e){return e.deleteValue(fh)}function Sh(e,t){return bh(e,new _h(t))}function Ch(e){var t;return null===(t=mh(e))||void 0===t?void 0:t.spanContext()}var Ih=/^([0-9a-f]{32})$/i,Eh=/^[0-9a-f]{16}$/i;function kh(e){return r=e.traceId,Ih.test(r)&&r!==vh&&(t=e.spanId,Eh.test(t)&&t!==ph);var t,r}function xh(e){return new _h(e)}var Th=hh.getInstance(),Rh=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=Th.active()),Boolean(null==t?void 0:t.root))return new _h;var i,n=r&&Ch(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&kh(n)?new _h(n):new _h},e.prototype.startActiveSpan=function(e,t,r,i){var n,s,o;if(!(arguments.length<2)){2===arguments.length?o=t:3===arguments.length?(n=t,o=r):(n=t,s=r,o=i);var a=null!=s?s:Th.active(),l=this.startSpan(e,n,a),u=bh(a,l);return Th.with(u,o,void 0,l)}},e}();var Mh=new Rh,Ah=function(){function e(e,t,r,i){this._provider=e,this.name=t,this.version=r,this.options=i}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,i){var n=this._getTracer();return Reflect.apply(n.startActiveSpan,n,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Mh},e}(),Ph=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new Rh},e}()),Lh=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var i;return null!==(i=this.getDelegateTracer(e,t,r))&&void 0!==i?i:new Ah(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Ph},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,r){var i;return null===(i=this._delegate)||void 0===i?void 0:i.getTracer(e,t,r)},e}(),Oh=hh.getInstance(),Nh=eh.instance(),Fh="trace",Dh=function(){function e(){this._proxyTracerProvider=new Lh,this.wrapSpanContext=xh,this.isSpanContextValid=kh,this.deleteSpan=wh,this.getSpan=mh,this.getActiveSpan=yh,this.getSpanContext=Ch,this.setSpan=bh,this.setSpanContext=Sh}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=jd(Fh,this._proxyTracerProvider,eh.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Wd(Fh)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){zd(Fh,eh.instance()),this._proxyTracerProvider=new Lh},e}(),Hh=Dh.getInstance(),Bh=th("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function qh(e){return null==e||(Array.isArray(e)?function(e){var t;for(var r of e)if(null!=r){var i=typeof r;if(i!==t){if(!t){if(Uh(i)){t=i;continue}return!1}return!1}}return!0}(e):Uh(typeof e))}function Uh(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}var $h=e=>{Nh.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach((e=>{if(!t[e]){var i=r[e];i&&(t[e]=String(i))}})),r=Object.getPrototypeOf(r);return t}(e))}(e))};function Vh(e){try{$h(e)}catch(e){}}var jh,Wh=performance,zh="telemetry.sdk.language",Zh="telemetry.sdk.name",Gh="telemetry.sdk.version",Yh={[Zh]:"opentelemetry","process.runtime.name":"browser",[zh]:"webjs",[Gh]:"2.2.0"},Xh=Math.pow(10,6),Kh=Math.pow(10,9);function Jh(e){var t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Xh)]}function Qh(){var e=Wh.timeOrigin;if("number"!=typeof e){var t=Wh;e=t.timing&&t.timing.fetchStart}return e}function ep(e){return function(e,t){var r=[e[0]+t[0],e[1]+t[1]];r[1]>=Kh&&(r[1]-=Kh,r[0]+=1);return r}(Jh(Qh()),Jh("number"==typeof e?e:Wh.now()))}function tp(e){if(t=e,Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return e;if("number"==typeof e)return e<Qh()?ep(e):Jh(e);if(e instanceof Date)return Jh(e.getTime());throw TypeError("Invalid input type");var t}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(jh||(jh={}));var rp="[object Object]",ip="[object Null]",np="[object Undefined]",sp=Function.prototype.toString,op=sp.call(Object),ap=Object.getPrototypeOf,lp=Object.prototype,up=lp.hasOwnProperty,cp=Symbol?Symbol.toStringTag:void 0,dp=lp.toString;function hp(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){if(null==e)return void 0===e?np:ip;return cp&&cp in Object(e)?function(e){var t=up.call(e,cp),r=e[cp],i=!1;try{e[cp]=void 0,i=!0}catch(e){}var n=dp.call(e);i&&(t?e[cp]=r:delete e[cp]);return n}(e):function(e){return dp.call(e)}(e)}(e)!==rp)return!1;var t=ap(e);if(null===t)return!0;var r=up.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&sp.call(r)===op}var pp=20;function vp(e){return fp(e)?e.slice():e}function gp(e,t,r,i){var n;if(void 0===r&&(r=0),!(r>pp)){if(r++,bp(e)||bp(t)||mp(t))n=vp(t);else if(fp(e)){if(n=e.slice(),fp(t))for(var s=0,o=t.length;s<o;s++)n.push(vp(t[s]));else if(yp(t))for(var a=Object.keys(t),l=0,u=a.length;l<u;l++){var c=a[l];n[c]=vp(t[c])}}else if(yp(e))if(yp(t)){if(!function(e,t){if(!hp(e)||!hp(t))return!1;return!0}(e,t))return t;n=Object.assign({},e);for(var d=Object.keys(t),h=0,p=d.length;h<p;h++){var v=d[h],g=t[v];if(bp(g))void 0===g?delete n[v]:n[v]=g;else{var _=n[v],f=g;if(_p(e,v,i)||_p(t,v,i))delete n[v];else{if(yp(_)&&yp(f)){var m=i.get(_)||[],y=i.get(f)||[];m.push({obj:e,key:v}),y.push({obj:t,key:v}),i.set(_,m),i.set(f,y)}n[v]=gp(n[v],g,r,i)}}}}else n=t;return n}}function _p(e,t,r){for(var i=r.get(e[t])||[],n=0,s=i.length;n<s;n++){var o=i[n];if(o.key===t&&o.obj===e)return!0}return!1}function fp(e){return Array.isArray(e)}function mp(e){return"function"==typeof e}function yp(e){return!bp(e)&&!fp(e)&&!mp(e)&&"object"==typeof e}function bp(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class wp extends Error{constructor(e){super(e),Object.setPrototypeOf(this,wp.prototype)}}function Sp(e,t){var r,i=new Promise((function(e,i){r=setTimeout((function(){i(new wp("Operation timed out."))}),t)}));return Promise.race([e,i]).then((e=>(clearTimeout(r),e)),(e=>{throw clearTimeout(r),e}))}class Cp{constructor(){this._promise=void 0,this._resolve=void 0,this._reject=void 0,this._promise=new Promise(((e,t)=>{this._resolve=e,this._reject=t}))}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class Ip{constructor(e,t){this._callback=void 0,this._that=void 0,this._isCalled=!1,this._deferred=new Cp,this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(){if(!this._isCalled){this._isCalled=!0;try{for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Promise.resolve(this._callback.call(this._that,...t)).then((e=>this._deferred.resolve(e)),(e=>this._deferred.reject(e)))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}var Ep={_export:function(e,t){return new Promise((r=>{Oh.with(function(e){return e.setValue(Bh,!0)}(Oh.active()),(()=>{e.export(t,(e=>{r(e)}))}))}))}};function kp(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Nh.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class xp{constructor(e,t,r,i,n){this._transport=void 0,this._serializer=void 0,this._responseHandler=void 0,this._promiseQueue=void 0,this._timeout=void 0,this._diagLogger=void 0,this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=i,this._timeout=n,this._diagLogger=Nh.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())t({code:jh.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this._serializer.serializeRequest(e);null!=r?this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then((e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:jh.FAILED,error:e.error}):"retryable"===e.status?t({code:jh.FAILED,error:new Ld("Export failed with retryable status")}):t({code:jh.FAILED,error:new Ld("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:jh.SUCCESS})}}),(e=>t({code:jh.FAILED,error:e})))):t({code:jh.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this._promiseQueue.awaitAll()}shutdown(){var e=this;return t((function*(){e._diagLogger.debug("shutdown started"),yield e.forceFlush(),e._transport.shutdown()}))()}}function Tp(e,t,r){return i={transport:r,serializer:t,promiseHandler:Fd(e)},n={timeout:e.timeoutMillis},new xp(i.transport,i.serializer,kp(),i.promiseHandler,n.timeout);var i,n}function Rp(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function Mp(e){for(var t=new Uint8Array(e.length/2),r=0,i=0;i<e.length;i+=2){var n=Rp(e.charCodeAt(i)),s=Rp(e.charCodeAt(i+1));t[r++]=n<<4|s}return t}function Ap(e){var t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Pp(e){var t,r=Ap(e);return t=r,{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}var Lp="undefined"!=typeof BigInt?function(e){return Ap(e).toString()}:function(e){return e[0]*Kh+e[1]};function Op(e){return e}function Np(e){if(void 0!==e)return Mp(e)}var Fp={encodeHrTime:Pp,encodeSpanContext:Mp,encodeOptionalSpanContext:Np};function Dp(e,t){return{key:e,value:Hp(t)}}function Hp(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Hp)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((e=>{var[t,r]=e;return Dp(t,r)}))}}:{}}function Bp(e,t){var r=function(e){var t,r;if(void 0===e)return Fp;var i=null===(t=e.useLongBits)||void 0===t||t,n=null!==(r=e.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Pp:Lp,encodeSpanContext:n?Op:Mp,encodeOptionalSpanContext:n?Op:Np}}(t);return{resourceLogs:qp(e,r)}}function qp(e,t){var r=function(e){var t=new Map;for(var r of e){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=t.get(i);a||(a=new Map,t.set(i,a));var l=n+"@"+s+":"+o,u=a.get(l);u||(u=[],a.set(l,u)),u.push(r)}return t}(e);return Array.from(r,(e=>{var[r,i]=e,n=function(e){var t,r={attributes:(t=e.attributes,Object.keys(t).map((e=>Dp(e,t[e])))),droppedAttributesCount:0},i=e.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(e=>{var r,[,i]=e;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((e=>function(e,t){var r,i,n;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:Hp(e.body),eventName:e.eventName,attributes:Up(e.attributes),droppedAttributesCount:e.droppedAttributesCount,flags:null==(r=e.spanContext)?void 0:r.traceFlags,traceId:t.encodeOptionalSpanContext(null==(i=e.spanContext)?void 0:i.traceId),spanId:t.encodeOptionalSpanContext(null==(n=e.spanContext)?void 0:n.spanId)}}(e,t))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}function Up(e){return Object.keys(e).map((t=>Dp(t,e[t])))}var $p=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Vp{static FromAttributeList(e,t){var r=new Vp({},t);return r._rawAttributes=Wp(e),r._asyncAttributesPending=e.filter((e=>{var[t,r]=e;return $p(r)})).length>0,r}constructor(e,t){var r;this._rawAttributes=void 0,this._asyncAttributesPending=!1,this._schemaUrl=void 0,this._memoizedAttributes=void 0;var i=null!==(r=e.attributes)&&void 0!==r?r:{};this._rawAttributes=Object.entries(i).map((e=>{var[t,r]=e;return $p(r)&&(this._asyncAttributesPending=!0),[t,r]})),this._rawAttributes=Wp(this._rawAttributes),this._schemaUrl=function(e){if("string"==typeof e||void 0===e)return e;return void Nh.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(null==t?void 0:t.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}waitForAsyncAttributes(){var e=this;return t((function*(){if(e.asyncAttributesPending){for(var t=0;t<e._rawAttributes.length;t++){var[r,i]=e._rawAttributes[t];e._rawAttributes[t]=[r,$p(i)?yield i:i]}e._asyncAttributesPending=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Nh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;var e={};for(var[t,r]of this._rawAttributes){var i;if($p(r))Nh.debug("Unsettled resource attribute "+t+" skipped");else if(null!=r)null!==(i=e[t])&&void 0!==i||(e[t]=r)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(null==e)return this;var t=function(e,t){var r=null==e?void 0:e.schemaUrl,i=null==t?void 0:t.schemaUrl,n=void 0===r||""===r,s=void 0===i||""===i;if(n)return i;if(s)return r;if(r===i)return r;return void Nh.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,i)}(this,e),r=t?{schemaUrl:t}:void 0;return Vp.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],r)}}function jp(e,t){return Vp.FromAttributeList(Object.entries(e),t)}function Wp(e){return e.map((e=>{var[t,r]=e;return $p(r)?[t,r.catch((e=>{Nh.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,r]}))}var zp={serializeRequest:e=>{var t=Bp(e,{useHex:!0,useLongBits:!1});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};var t=new TextDecoder;return JSON.parse(t.decode(e))}};class Zp{constructor(e){this._transport=void 0,this._transport=e}retry(e,t,r){return new Promise(((i,n)=>{setTimeout((()=>{this._transport.send(e,t).then(i,n)}),r)}))}send(e,r){var i=this;return t((function*(){for(var t=Date.now()+r,n=yield i._transport.send(e,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var l=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var u=null!==(a=n.retryInMillis)&&void 0!==a?a:l,c=t-Date.now();if(u>c)return n;n=yield i.retry(e,c,u)}return n}))()}shutdown(){return this._transport.shutdown()}}function Gp(e){return new Zp(e.transport)}function Yp(e){return[429,502,503,504].includes(e)}function Xp(e){if(null!=e){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var r=new Date(e).getTime()-Date.now();return r>=0?r:0}}class Kp{constructor(e){this._parameters=void 0,this._parameters=e}send(e,r){var i=this;return t((function*(){var t=yield i._parameters.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i._parameters.url),Object.entries(t).forEach((e=>{var[t,r]=e;s.setRequestHeader(t,r)})),s.ontimeout=e=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{s.status>=200&&s.status<=299?(Nh.debug("XHR success"),n({status:"success"})):s.status&&Yp(s.status)?n({status:"retryable",retryInMillis:Xp(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(e)}));return n}))()}shutdown(){}}class Jp{constructor(e){this._params=void 0,this._params=e}send(e){var r=this;return t((function*(){var t=(yield r._params.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r._params.url,new Blob([e],{type:t}))?(Nh.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Qp{constructor(e){this._parameters=void 0,this._parameters=e}send(e,r){var i=this;return t((function*(){var t=new AbortController,n=setTimeout((()=>t.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i._parameters.url),l=yield fetch(a.href,{method:"POST",headers:yield i._parameters.headers(),body:e,signal:t.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return l.status>=200&&l.status<=299?(Nh.debug("response success"),{status:"success"}):Yp(l.status)?{status:"retryable",retryInMillis:Xp(l.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}}catch(e){return"AbortError"===(null==e?void 0:e.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:e})}:{status:"failure",error:new Error("Fetch request errored",{cause:e})}}finally{clearTimeout(n)}}))()}shutdown(){}}function ev(e,t){return Tp(e,t,Gp({transport:(r=e,new Kp(r))}));var r}function tv(e,t){return Tp(e,t,Gp({transport:(r=e,new Qp(r))}));var r}function rv(e,t){return Tp(e,t,Gp({transport:(r={url:e.url,headers:e.headers},new Jp(r))}));var r}function iv(e,i,n){return t((function*(){var t=r({},yield n()),s={};return null!=i&&Object.assign(s,yield i()),null!=e&&Object.assign(s,function(e){var t={};return Object.entries(null!=e?e:{}).forEach((e=>{var[r,i]=e;void 0!==i?t[r]=String(i):Nh.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),t}(yield e())),Object.assign(s,t)}))}function nv(e){if(null!=e)try{var t,r=null==(t=globalThis.location)?void 0:t.href;return new URL(e,r).href}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function sv(e,t,i){var n,s;return r({},function(e,t,r){var i,n,s,o,a,l;return{timeoutMillis:Od(null!==(i=null!==(n=e.timeoutMillis)&&void 0!==n?n:t.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=e.concurrencyLimit)&&void 0!==o?o:t.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(l=e.compression)&&void 0!==l?l:t.compression)&&void 0!==a?a:r.compression}}(e,t,i),{headers:iv(e.headers,t.headers,i.headers),url:null!==(n=null!==(s=nv(e.url))&&void 0!==s?s:t.url)&&void 0!==n?n:i.url})}function ov(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return t((function*(){return e}))}(e.headers)}function av(e,i,n){return sv({url:e.url,timeoutMillis:e.timeoutMillis,headers:ov(e),concurrencyLimit:e.concurrencyLimit},{},function(e,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=t((function*(){return e})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i))}function lv(e,t,r,i){return(e.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?tv:ev:rv)(av(e,r,i),t)}class uv extends Pd{constructor(e){void 0===e&&(e={}),super(lv(e,zp,"v1/logs",{"Content-Type":"application/json"}))}}class cv{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this._severityText=void 0,this._severityNumber=void 0,this._body=void 0,this._eventName=void 0,this.totalAttributesCount=0,this._isReadonly=!1,this._logRecordLimits=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:u={},context:c}=r,d=Date.now();if(this.hrTime=tp(null!=i?i:d),this.hrTimeObserved=tp(null!=n?n:d),c){var h=Hh.getSpanContext(c);h&&kh(h)&&(this.spanContext=h)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=s,this.setAttributes(u)}setAttribute(e,t){return this._isLogRecordReadonly()||null===t?this:0===e.length?(Nh.warn("Invalid attribute key: "+e),this):qh(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(1===this.droppedAttributesCount&&Nh.warn("Dropping extra attributes."),this):(qh(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this)):(Nh.warn("Invalid attribute value set for key: "+e),this)}setAttributes(e){for(var[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){var t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(Nh.warn("Attribute value limit must be positive, got "+t),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e)):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&Nh.warn("Can not execute the operation on emitted log record"),this._isReadonly}}class dv{constructor(e,t){this.instrumentationScope=void 0,this._sharedState=void 0,this.instrumentationScope=e,this._sharedState=t}emit(e){var t=e.context||Oh.active(),i=new cv(this._sharedState,this.instrumentationScope,r({context:t},e));this._sharedState.activeProcessor.onEmit(i,t),i._makeReadonly()}}class hv{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class pv{constructor(e,t){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return t((function*(){var t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map((e=>Sp(e.forceFlush(),t))))}))()}onEmit(e,t){this.processors.forEach((r=>r.onEmit(e,t)))}shutdown(){var e=this;return t((function*(){yield Promise.all(e.processors.map((e=>e.shutdown())))}))()}}class vv{constructor(e,t,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new pv(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new hv}}class gv{constructor(e){var t,r,i;void 0===e&&(e={}),this._shutdownOnce=void 0,this._sharedState=void 0;var n,s,o,a,l,u,c,d=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var i=t.shift(),n=new WeakMap;t.length>0;)i=gp(i,t.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},e),h=null!==(t=e.resource)&&void 0!==t?t:jp({"service.name":"unknown_service",[zh]:Yh[zh],[Zh]:Yh[Zh],[Gh]:Yh[Gh]});this._sharedState=new vv(h,d.forceFlushTimeoutMillis,(n=d.logRecordLimits,{attributeCountLimit:null!==(s=null!==(o=null!==(a=n.attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(l=null!==(u=null!==(c=n.attributeValueLengthLimit)&&void 0!==c?c:void 0)&&void 0!==u?u:void 0)&&void 0!==l?l:1/0}),null!==(r=null==(i=e)?void 0:i.processors)&&void 0!==r?r:[]),this._shutdownOnce=new Ip(this._shutdown,this)}getLogger(e,t,r){if(this._shutdownOnce.isCalled)return Nh.warn("A shutdown LoggerProvider cannot provide a Logger"),Cd;e||Nh.warn("Logger requested without instrumentation scope name.");var i=e||"unknown",n=i+"@"+(t||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this._sharedState.loggers.has(n)||this._sharedState.loggers.set(n,new dv({name:i,version:t,schemaUrl:null==r?void 0:r.schemaUrl},this._sharedState)),this._sharedState.loggers.get(n)}forceFlush(){return this._shutdownOnce.isCalled?(Nh.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Nh.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}class _v{constructor(e,t){var r,i,n,s,o,a,l,u;this._exporter=void 0,this._maxExportBatchSize=void 0,this._maxQueueSize=void 0,this._scheduledDelayMillis=void 0,this._exportTimeoutMillis=void 0,this._isExporting=!1,this._finishedLogRecords=[],this._timer=void 0,this._shutdownOnce=void 0,this._exporter=e,this._maxExportBatchSize=null!==(r=null!==(i=null==t?void 0:t.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this._maxQueueSize=null!==(n=null!==(s=null==t?void 0:t.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this._scheduledDelayMillis=null!==(o=null!==(a=null==t?void 0:t.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this._exportTimeoutMillis=null!==(l=null!==(u=null==t?void 0:t.exportTimeoutMillis)&&void 0!==u?u:void 0)&&void 0!==l?l:3e4,this._shutdownOnce=new Ip(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Nh.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}_shutdown(){var e=this;return t((function*(){e.onShutdown(),yield e._flushAll(),yield e._exporter.shutdown()}))()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise(((e,t)=>{for(var r=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize),n=0;n<i;n++)r.push(this._flushOneBatch());Promise.all(r).then((()=>{e()})).catch(t)}))}_flushOneBatch(){return this._clearTimer(),0===this._finishedLogRecords.length?Promise.resolve():new Promise(((e,t)=>{Sp(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then((()=>e())).catch(t)}))}_maybeStartTimer(){if(!this._isExporting){var e=()=>{this._isExporting=!0,this._flushOneBatch().then((()=>{this._isExporting=!1,this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())})).catch((e=>{this._isExporting=!1,Vh(e)}))};if(this._finishedLogRecords.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout((()=>e()),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){var t=()=>Ep._export(this._exporter,e).then((e=>{var t;e.code!==jh.SUCCESS&&Vh(null!==(t=e.error)&&void 0!==t?t:new Error("BatchLogRecordProcessor: log record export failed (status "+e+")"))})).catch(Vh),r=e.map((e=>e.resource)).filter((e=>e.asyncAttributesPending));return 0===r.length?t():Promise.all(r.map((e=>null==e.waitForAsyncAttributes?void 0:e.waitForAsyncAttributes()))).then(t,Vh)}}class fv extends _v{constructor(e,t){super(e,t),this._visibilityChangeListener=void 0,this._pageHideListener=void 0,this._onInit(t)}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}_onInit(e){!0!==(null==e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}}var mv=1e4,yv=function(e,t,r,i,n,s){if(void 0===t&&(t=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=mv),void 0===s&&(s=new WeakSet),s.has(e))return r[t||"circular"]="[Circular]",r;for(var o in s.add(e),e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=e[o],l=t?t+"."+o:o;if(ei(a))yv(a,l,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=l.length,i<=0||n<=0)return void(r.attributes_truncated=!0);r[l]=a}}return r},bv={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.logs={initializeLogs:e=>{(e=>{var t={"service.name":"posthog-browser-logs",host:os.location.host};if(e.sessionManager){var{sessionId:i,windowId:n}=e.sessionManager.checkAndGetSessionAndWindowId(!0);t=r({},t,{"session.id":i,"window.id":n})}Ad.setGlobalLoggerProvider(new gv({resource:jp(t),processors:[new fv(new uv({url:e.config.api_host+"/i/v1/logs?token="+e.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(e);var t=Ad.getLogger("console"),i={};if(e.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s=os.console[n];os.console[n]=(s=>function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];if(a.length>0){var u=a.map((e=>{return JSON.stringify(e,(t=new WeakSet,(e,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!si(i)){if(t.has(i))return"[Circular]";t.add(i)}return i}));var t})).join(" ");u.length>mv&&(u=u.slice(0,mv)+"...",i.body_truncated="true"),t.emit({severityText:bv[n],body:u,attributes:r({"log.source":"console."+n,distinct_id:e.get_distinct_id(),"location.href":os.location.href},i,ei(a[0])?yv(a[0]):{})}),s.apply(os.console,a)}})(s)};for(var a of["debug","log","warn","error","info"])o(a)}};var wv=hs("[Error tracking]");function Sv(){return new Cn([new Dn,new Zn,new Bn,new Hn,new Wn,new jn,new Un,new zn],Fn())}class Cv{constructor(e){var t,r;this._suppressionRules=[],this._errorPropertiesBuilder=Sv(),this._instance=e,this._suppressionRules=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(qs))&&void 0!==t?t:[]}onRemoteConfig(e){var t,r,i,n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],s=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this._suppressionRules=n,this._instance.persistence&&this._instance.persistence.register({[qs]:this._suppressionRules,[Us]:s})}get _captureExtensionExceptions(){var e,t=!!this._instance.get_property(Us),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return void wv.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return void wv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return void wv.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}_matchesSuppressionRule(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return ii(r)&&r.length>0&&e.$exception_types.push(r),ii(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this._suppressionRules.some((e=>{var r=e.values.map((e=>{var r,i=Yu[e.operator],n=Kr(e.value)?e.value:[e.value],s=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}_isExtensionException(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}_isPostHogException(e){if(e.length>0){var t,r,i,n,s=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],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}_isExceptionList(e){return!oi(e)&&Kr(e)}}var Iv=hs("[ExceptionAutocapture]"),Ev=Sv(),kv={wrapOnError:e=>{var t=Gn;t||Iv.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];var o=n[4],a=n[0],l=Ev.buildFromUnknown(o||a,{mechanism:{handled:!1}});return e(l),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=Gn;t||Iv.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(i){var n,s=Ev.buildFromUnknown(i,{mechanism:{handled:!1}});return e(s),null!==(n=null==r?void 0:r.apply(t,[i]))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError:e=>{var t=console;t||Iv.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=Ev.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(a),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.errorWrappingFunctions=kv,os.posthogErrorWrappingFunctions=kv;var xv=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Kr(e)||e.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}t!==ho&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};os.__PosthogExtensions__=os.__PosthogExtensions__||{};var Tv={_patchFetch:(e,r,i)=>Ps(Gn,"fetch",(n=>function(){var s=t((function*(t,s){var o=new Request(t,s);return xv(e,r,i,o),n(o)}));return function(e,t){return s.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>Ps(Gn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return xv(e,t,r,u),i.call(this,n,u.url,o,a,l)}))};os.__PosthogExtensions__.tracingHeadersPatchFns=Tv,os.postHogTracingHeadersPatchFns=Tv;var Rv=-1,Mv=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Rv=t.timeStamp,e(t))}),!0)},Av=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&(((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},Pv=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Lv=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ov=()=>{var e,t=Lv();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},Nv=function(e,t){void 0===t&&(t=-1);var r=Lv(),i="navigate";return Rv>=0?i="back-forward-cache":r&&(document.prerendering||Ov()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Fv=new WeakMap;function Dv(e,t){return Fv.get(e)||Fv.set(e,new t),Fv.get(e)}class Hv{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&e.startTime-i.startTime<1e3&&e.startTime-r.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var Bv,qv=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},Uv=e=>{var t=!1;return()=>{t||(e(),t=!0)}},$v=-1,Vv=new Set,jv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Wv=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of Vv)t();isFinite($v)||($v="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Wv,!0))}},zv=()=>{if($v<0){var e,t=Ov(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;$v=null!=r?r:jv(),addEventListener("visibilitychange",Wv,!0),addEventListener("prerenderingchange",Wv,!0),Mv((()=>{setTimeout((()=>{$v=jv()}))}))}return{get firstHiddenTime(){return $v},onHidden(e){Vv.add(e)}}},Zv=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},Gv=[1800,3e3],Yv=function(e,t){void 0===t&&(t={}),Zv((()=>{var r,i=zv(),n=Nv("FCP"),s=qv("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<i.firstHiddenTime&&(n.value=Math.max(t.startTime-Ov(),0),n.entries.push(t),r(!0)))}));s&&(r=Av(e,n,Gv,t.reportAllChanges),Mv((i=>{n=Nv("FCP"),r=Av(e,n,Gv,t.reportAllChanges),Pv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Xv=[.1,.25],Kv=0,Jv=1/0,Qv=0,eg=e=>{for(var t of e)t.interactionId&&(Jv=Math.min(Jv,t.interactionId),Qv=Math.max(Qv,t.interactionId),Kv=Qv?(Qv-Jv)/7+1:0)},tg=()=>{var e;return Bv?Kv:null!==(e=performance.interactionCount)&&void 0!==e?e:0},rg=0;class ig{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){rg=tg(),this.u.length=0,this.l.clear()}L(){var e=Math.min(this.u.length-1,Math.floor((tg()-rg)/50));return this.u[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.l.get(e.interactionId);if(i||this.u.length<10||e.duration>r.P){var n;if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var ng=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Uv(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},sg=[200,500];class og{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var ag=[2500,4e3],lg={onLCP:function(e,t){void 0===t&&(t={}),Zv((()=>{var r,i=zv(),n=Nv("LCP"),s=Dv(t,og),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),o.startTime<i.firstHiddenTime&&(n.value=Math.max(o.startTime-Ov(),0),n.entries=[o],r())},a=qv("largest-contentful-paint",o);if(a){r=Av(e,n,ag,t.reportAllChanges);var l=Uv((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(ng(l),removeEventListener(e.type,u,{capture:!0}))};for(var c of["keydown","click","visibilitychange"])addEventListener(c,u,{capture:!0});Mv((i=>{n=Nv("LCP"),r=Av(e,n,ag,t.reportAllChanges),Pv((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS:function(e,t){void 0===t&&(t={});var r=zv();Yv(Uv((()=>{var i,n=Nv("CLS",0),s=Dv(t,Hv),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=qv("layout-shift",o);a&&(i=Av(e,n,Xv,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Mv((()=>{s.i=0,n=Nv("CLS",0),i=Av(e,n,Xv,t.reportAllChanges),Pv((()=>i()))})),setTimeout(i))})))},onFCP:Yv,onINP:function(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=zv();Zv((()=>{var i;"interactionCount"in performance||Bv||(Bv=qv("event",eg,{type:"event",buffered:!0,durationThreshold:0}));var n,s=Nv("INP"),o=Dv(t,ig),a=e=>{ng((()=>{for(var t of e)o.h(t);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},l=qv("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=Av(e,s,sg,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),Mv((()=>{o.v(),s=Nv("INP"),n=Av(e,s,sg,t.reportAllChanges)})))}))}}};os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.postHogWebVitalsCallbacks=lg,os.postHogWebVitalsCallbacks=lg,os.__PosthogExtensions__.loadWebVitalsCallbacks=()=>lg;class ug{constructor(e){this.disabled=!1===e;var t=ei(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var cg="$copy_autocapture",dg=hs("[AutoCapture]");function hg(e,t){return t.length>e?t.slice(0,e)+"...":t}function pg(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!go(t));return t}function vg(e,t,r,i){var n=e.tagName.toLowerCase(),s={tag_name:n};Eo.indexOf(n)>-1&&!r&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=hg(1024,jo(e)):s.$el_text=hg(1024,Co(e)));var o=wo(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e}))),gs(e.attributes,(function(r){var n;if((!Fo(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==i||!i.includes(r.name))&&!t&&Vo(r.value)&&(n=r.name,!ii(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=r.value;"class"===r.name&&(o=yo(o).join(" ")),s["attr__"+r.name]=hg(1024,o)}}));for(var a=1,l=1,u=e;u=pg(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function gg(e,t){for(var r,i,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,u=[e],c=e;c.parentNode&&!_o(c,"body");)mo(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var d,h=[],p={},v=!1,g=!1;if(gs(u,(e=>{var t=No(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&Vo(v)&&v),jr(wo(e),"ph-no-capture")&&(g=!0),h.push(vg(e,s,o,a));var r=function(e){if(!No(e))return{};var t={};return gs(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&Vo(i)&&(t[r]=i)}})),t}(e);_s(p,r)})),g)return{props:{},explicitNoCapture:g};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=jo(e):h[0].$el_text=Co(e)),v){var _,f;h[0].attr__href=v;var m=null==(_=xs(v))?void 0:_.host,y=null==Gn||null==(f=Gn.location)?void 0:f.host;m&&y&&m!==y&&(d=v)}return{props:_s({$event_type:n.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:zo(h)},null!=(r=h[0])&&r.$el_text?{$el_text:null==(i=h[0])?void 0:i.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},p)}}class _g{constructor(e){this._initialized=!1,this._isDisabledServerSide=null,this._elementsChainAsString=!1,this.instance=e,this.rageclicks=new ug(e.config.rageclick),this._elementSelectors=null}get _config(){var e,t,r=ei(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Gn&&es){var e=e=>{e=e||(null==Gn?void 0:Gn.event);try{this._captureEvent(e)}catch(e){dg.error("Failed to capture event",e)}};if(ks(es,"submit",e,{capture:!0}),ks(es,"change",e,{capture:!0}),ks(es,"click",e,{capture:!0}),this._config.capture_copied_text){var t=e=>{e=e||(null==Gn?void 0:Gn.event),this._captureEvent(e,cg)};ks(es,"copy",t,{capture:!0}),ks(es,"cut",t,{capture:!0})}}}else dg.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ds]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null==(t=this._elementSelectors)||t.forEach((t=>{var i=null==es?void 0:es.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Ds],i=this._isDisabledServerSide;if(si(i)&&!ui(r)&&!this.instance._shouldDisableFlags())return!1;var n=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!n}_captureEvent(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Io(e);if(fo(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Ao(i,this.instance.config.rageclick)&&this._captureEvent(e,"$rageclick");var n=t===cg;if(i&&Oo(i,e,this._config,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=gg(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===cg){var l,u=So(null==Gn||null==(l=Gn.getSelection())?void 0:l.toString()),c=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=c}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return Jr(null==es?void 0:es.querySelectorAll)}}var fg={};function mg(e){return function(e,t){var r=fg[e];if(r)return r;var i=t[e];if(Qr(i)&&!as())return fg[e]=i.bind(t);var n=t.document;if(n&&Jr(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[e]&&(i=o[e]),n.head.removeChild(s)}catch(t){ds.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return i&&Jr(i)?fg[e]=i.bind(t):i}("MutationObserver",e)}function yg(e,t){return ai(e)&&e>=t}class bg{_asRequiredConfig(e){var t,r,i,n,s,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(e,t){this._clicks=[],this._defaultConfig=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this._onClick=e=>{var t=function(e){var t=Io(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);si(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&ri(this._checkClickTimer)&&(this._checkClickTimer=os.setTimeout((()=>{this._checkClicks()}),1e3))},this._onScroll=()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{ri(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this._onSelectionChange=()=>{this._lastSelectionChanged=Date.now()},this.instance=e,this._config=this._asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=mg(os);this._mutationObserver=new t((e=>{this._onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this._mutationObserver)||e.disconnect(),this._mutationObserver=void 0,os.removeEventListener("click",this._onClick),os.removeEventListener("scroll",this._onScroll,{capture:!0}),os.removeEventListener("selectionchange",this._onSelectionChange)}_onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){ks(os,"click",this._onClick)}_startScrollObserver(){ks(os,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){ks(os,"selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(!this._config.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(vo(e.node))return!0;var r=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!r||!(!_o(e.node,"html")&&go(e.node)&&!Eo.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var i=yg(t.scrollDelayMs,this._config.scroll_threshold_ms),n=yg(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),s=yg(t.mutationDelayMs,this._config.mutation_threshold_ms),o=yg(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=ai(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=ai(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,u=ai(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||u||(i||s||o||n?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&ri(this._checkClickTimer)&&(this._checkClickTimer=os.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,t){this.instance.capture("$dead_click",r({},t,gg(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}os.__PosthogExtensions__=os.__PosthogExtensions__||{},os.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new bg(e,t);var wg="";var Sg=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Cg(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=es),wg)return wg;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+ru();!wg&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",wg=s)}return wg}(e);if(!r){var i=(e=>{var t=e.match(Sg);return t?t[0]:""})(e);i!==r&&ds.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}var Ig={_is_supported:()=>!!es,_error:function(e){ds.error("cookieStore error: "+e)},_get:function(e){if(es){try{for(var t=e+"=",r=es.cookie.split(";").filter((e=>e.length)),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},_parse:function(e){var t;try{t=JSON.parse(Ig._get(e))||{}}catch(e){}return t},_set:function(e,t,r,i,n){if(es)try{var s="",o="",a=Cg(es.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ds.warn("cookieStore warning: large cookie, len="+u.length),es.cookie=u,u}catch(e){return}},_remove:function(e,t){if(null!=es&&es.cookie)try{Ig._set(e,"",-1,t)}catch(e){return}}},Eg=null,kg={_is_supported:function(){if(!si(Eg))return Eg;var e=!0;if(ri(Gn))e=!1;else try{var t="__mplssupport__";kg._set(t,"xyz"),'"xyz"'!==kg._get(t)&&(e=!1),kg._remove(t)}catch(t){e=!1}return e||ds.error("localStorage unsupported; falling back to cookie store"),Eg=e,e},_error:function(e){ds.error("localStorage error: "+e)},_get:function(e){try{return null==Gn?void 0:Gn.localStorage.getItem(e)}catch(e){kg._error(e)}return null},_parse:function(e){try{return JSON.parse(kg._get(e))||{}}catch(e){}return null},_set:function(e,t){try{null==Gn||Gn.localStorage.setItem(e,JSON.stringify(t))}catch(e){kg._error(e)}},_remove:function(e){try{null==Gn||Gn.localStorage.removeItem(e)}catch(e){kg._error(e)}}},xg=["$device_id","distinct_id",Zs,Gs,uo,lo],Tg={},Rg={_is_supported:function(){return!0},_error:function(e){ds.error("memoryStorage error: "+e)},_get:function(e){return Tg[e]||null},_parse:function(e){return Tg[e]||null},_set:function(e,t){Tg[e]=t},_remove:function(e){delete Tg[e]}},Mg=null,Ag={_is_supported:function(){if(!si(Mg))return Mg;if(Mg=!0,ri(Gn))Mg=!1;else try{var e="__support__";Ag._set(e,"xyz"),'"xyz"'!==Ag._get(e)&&(Mg=!1),Ag._remove(e)}catch(e){Mg=!1}return Mg},_error:function(e){ds.error("sessionStorage error: ",e)},_get:function(e){try{return null==Gn?void 0:Gn.sessionStorage.getItem(e)}catch(e){Ag._error(e)}return null},_parse:function(e){try{return JSON.parse(Ag._get(e))||null}catch(e){}return null},_set:function(e,t){try{null==Gn||Gn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Ag._error(e)}},_remove:function(e){try{null==Gn||Gn.sessionStorage.removeItem(e)}catch(e){Ag._error(e)}}},Pg=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class Lg{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?Pg.DENIED:this._storedConsent}isOptedOut(){return"always"===this._config.cookieless_mode||(this.consent===Pg.DENIED||this.consent===Pg.PENDING&&(this._config.opt_out_capturing_by_default||"on_reject"===this._config.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Pg.DENIED}optInOut(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get _storedConsent(){var e=this._storage._get(this._storageKey);return _i(e)?Pg.GRANTED:jr(fi,e)?Pg.DENIED:Pg.PENDING}get _storage(){if(!this._persistentStore){var e=this._config.opt_out_capturing_persistence_type;this._persistentStore="localStorage"===e?kg:Ig;var t="localStorage"===e?Ig:kg;t._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(_i(t._get(this._storageKey))),t._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&!!Es([null==Qn?void 0:Qn.doNotTrack,null==Qn?void 0:Qn.msDoNotTrack,os.doNotTrack],(e=>_i(e)))}}var Og=hs("[Dead Clicks]"),Ng=()=>!0,Fg=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(Vs)),i=e.instance.config.capture_dead_clicks;return ui(i)?i:!!ei(i)||r};class Dg{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Vs]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabledOrStop()}startIfEnabledOrStop(){this.isEnabled(this)?this._loadScript((()=>{this._start()})):this.stop()}_loadScript(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?Og.error("failed to load script",t):e()}))}_start(){var e;if(es){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=os.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=ei(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=os.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(es),Og.info("starting...")}}else Og.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Og.info("stopping..."))}}var Hg=hs("[ExceptionAutocapture]");class Bg{constructor(e){var t,r,i;this._startCapturing=()=>{var e;if(Gn&&this.isEnabled&&null!=(e=os.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=os.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=os.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=os.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this._unwrapOnError&&this._config.capture_unhandled_errors&&(this._unwrapOnError=t(this.captureException.bind(this))),!this._unwrapUnhandledRejection&&this._config.capture_unhandled_rejections&&(this._unwrapUnhandledRejection=r(this.captureException.bind(this))),!this._unwrapConsoleError&&this._config.capture_console_errors&&(this._unwrapConsoleError=i(this.captureException.bind(this)))}catch(e){Hg.error("failed to start",e),this._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Bs]),this._rateLimiter=new yi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,_logger:Hg}),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}_requiredConfig(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ei(e)?t=r({},t,e):(ri(e)?this._remoteEnabled:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Hg.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()}_loadScript(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Hg.error("failed to load script",t);e()}))}_stopCapturing(){var e,t,r;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(r=this._unwrapConsoleError)||r.call(this),this._unwrapConsoleError=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this._remoteEnabled=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[Bs]:this._remoteEnabled}),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}onConfigChange(){this._config=this._requiredConfig()}captureException(e){var t,r,i=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this._rateLimiter.consumeRateLimit(i)?Hg.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}class qg{constructor(e){var t;this._instance=e,this._lastPathname=(null==Gn||null==(t=Gn.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ds.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,ds.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Gn&&Gn.history){var r=this;null!=(e=Gn.history.pushState)&&e.__posthog_wrapped__||Ps(Gn.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("pushState")})),null!=(t=Gn.history.replaceState)&&t.__posthog_wrapped__||Ps(Gn.history,"replaceState",(e=>function(t,i,n){e.call(this,t,i,n),r._capturePageview("replaceState")})),this._setupPopstateListener()}}_capturePageview(e){try{var t,r=null==Gn||null==(t=Gn.location)?void 0:t.pathname;if(!r)return;r!==this._lastPathname&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._lastPathname=r}catch(t){ds.error("Error capturing "+e+" pageview",t)}}_setupPopstateListener(){if(!this._popstateListener){var e=()=>{this._capturePageview("popstate")};ks(Gn,"popstate",e),this._popstateListener=()=>{Gn&&Gn.removeEventListener("popstate",e)}}}}var Ug=hs("[SegmentIntegration]");function $g(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||ru();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(io,"identified")),t()},n=r.user();"then"in n&&Jr(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Ug.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Ug.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Ug.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}var Vg="posthog-js";function jg(e,t){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,c,d,h;if(!("*"===o||o.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var v=(null==(l=t.exception)?void 0:l.values)||[],g=v.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),_={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=v[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=v[0])?void 0:h.type,$sentry_tags:t.tags};return i&&n&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&e.exceptions.sendExceptionEvent(_),t}}class Wg{constructor(e,t,r,i,n,s){this.name=Vg,this.setupOnce=function(o){o(jg(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var zg=null!=Gn&&Gn.location?As(Gn.location.hash,"__posthog")||As(location.hash,"state"):null,Zg="_postHogToolbarParams",Gg=hs("[Toolbar]"),Yg=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Yg||{});class Xg{constructor(e){this.instance=e}_setToolbarState(e){os.ph_toolbar_state=e}_getToolbarState(){var e;return null!==(e=os.ph_toolbar_state)&&void 0!==e?e:Yg.UNINITIALIZED}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.instance.config.name&&"ph_toolbar_internal"===this.instance.config.name)return!1;if(!Gn||!es)return!1;e=null!=e?e:Gn.location,r=null!=r?r:Gn.history;try{if(!t){try{Gn.localStorage.setItem("test","test"),Gn.localStorage.removeItem("test")}catch(e){return!1}t=null==Gn?void 0:Gn.localStorage}var i,n=zg||As(e.hash,"__posthog")||As(e.hash,"state"),s=n?ys((()=>JSON.parse(atob(decodeURIComponent(n)))))||ys((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(Zg)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=os.ph_load_toolbar||os.ph_load_editor;!oi(t)&&Jr(t)?t(e,this.instance):Gg.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==es||!es.getElementById(co));if(!Gn||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Gn.localStorage.setItem(Zg,JSON.stringify(r({},n,{source:void 0}))),this._getToolbarState()===Yg.LOADED)this._callLoadToolbar(n);else if(this._getToolbarState()===Yg.UNINITIALIZED){var s;this._setToolbarState(Yg.LOADING),null==(s=os.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return Gg.error("[Toolbar] Failed to load",e),void this._setToolbarState(Yg.UNINITIALIZED);this._setToolbarState(Yg.LOADED),this._callLoadToolbar(n)})),ks(Gn,"turbolinks:load",(()=>{this._setToolbarState(Yg.UNINITIALIZED),this.loadToolbar(n)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}var Kg=hs("[TracingHeaders]");class Jg{constructor(e){this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._startCapturing=()=>{var e,t;ri(this._restoreXHRPatch)&&(null==(e=os.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));ri(this._restoreFetchPatch)&&(null==(t=os.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}_loadScript(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return Kg.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var Qg="https?://(.*)",e_=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],t_=fs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],e_),r_="<masked>",i_=["li_fat_id"];function n_(e,t,r){if(!es)return{};var i,n=t?fs([],e_,r||[]):[],s=s_(Ms(es.URL,n,r_),e),o=(i={},gs(i_,(function(e){var t=Ig._get(e);i[e]=t||null})),i);return _s(o,s)}function s_(e,t){var r=t_.concat(t||[]),i={};return gs(r,(function(t){var r=Rs(e,t);i[t]=r||null})),i}function o_(e){var t=function(e){return e?0===e.search(Qg+"google.([^/?]*)")?"google":0===e.search(Qg+"bing.com")?"bing":0===e.search(Qg+"yahoo.com")?"yahoo":0===e.search(Qg+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!si(t)){i.$search_engine=t;var n=es?Rs(es.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function a_(){return navigator.language||navigator.userLanguage}function l_(){return(null==es?void 0:es.referrer)||"$direct"}function u_(e,t){var r=e?fs([],e_,t||[]):[],i=null==ts?void 0:ts.href.substring(0,1e3);return{r:l_().substring(0,1e3),u:i?Ms(i,r,r_):void 0}}function c_(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null==(t=xs(r))?void 0:t.host};if(i){n.$current_url=i;var s=xs(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=s_(i);_s(n,o)}if(r){var a=o_(r);_s(n,a)}return n}function d_(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function h_(){try{return(new Date).getTimezoneOffset()}catch(e){return}}function p_(e,t){if(!ss)return{};var r,i=e?fs([],e_,t||[]):[],[n,s]=function(e){for(var t=0;t<mn.length;t++){var[r,i]=mn[t],n=r.exec(e),s=n&&(Jr(i)?i(n,e):i);if(s)return s}return["",""]}(ss);return _s(ws({$os:n,$os_version:s,$browser:gn(ss,navigator.vendor),$device:yn(ss),$device_type:bn(ss),$timezone:d_(),$timezone_offset:h_()}),{$current_url:Ms(null==ts?void 0:ts.href,i,r_),$host:null==ts?void 0:ts.host,$pathname:null==ts?void 0:ts.pathname,$raw_user_agent:ss.length>1e3?ss.substring(0,997)+"...":ss,$browser_version:fn(ss,navigator.vendor),$browser_language:a_(),$browser_language_prefix:(r=a_(),"string"==typeof r?r.split("-")[0]:void 0),$screen_height:null==Gn?void 0:Gn.screen.height,$screen_width:null==Gn?void 0:Gn.screen.width,$viewport_height:null==Gn?void 0:Gn.innerHeight,$viewport_width:null==Gn?void 0:Gn.innerWidth,$lib:"web",$lib_version:us.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var v_=hs("[Web Vitals]"),g_=9e5;class __{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this._buffer.metrics.length&&(this._instance.capture("$web_vitals",this._buffer.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this._buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(ri(i))v_.error("Could not read session ID. Dropping metrics!");else{this._buffer=this._buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this._currentURL();if(!ri(n))if(oi(null==e?void 0:e.name)||oi(null==e?void 0:e.value))v_.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)v_.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this._buffer.url!==n&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),ri(this._buffer.url)&&(this._buffer.url=n),this._buffer.firstMetricTimestamp=ri(this._buffer.firstMetricTimestamp)?Date.now():this._buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this._buffer.metrics.push(r({},e,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this._buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}},this._startCapturing=()=>{if(!this._initialized){var e,t,r,i,n=os.__PosthogExtensions__;ri(n)||ri(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this._addToBuffer.bind(this)),this._initialized=!0):v_.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[$s]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=ei(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return oi(r)?(null==(t=this._instance.persistence)?void 0:t.props[Ws])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ei(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=ei(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=e&&e}get _maxAllowedValue(){var e=ei(this._instance.config.capture_performance)&&ai(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:g_;return 0<e&&e<=6e4?g_:e}get isEnabled(){var e=null==ts?void 0:ts.protocol;if("http:"!==e&&"https:"!==e)return v_.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=ei(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ui(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ui(t)?t:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(v_.info("enabled, starting..."),this._loadScript(this._startCapturing))}onRemoteConfig(e){var t=ei(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ei(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$s]:t}),this._instance.persistence.register({[Ws]:r})),this._enabledServerSide=t,this.startIfEnabled()}_loadScript(e){var t,r;if(null!=(t=os.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks)e();else{var i=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,i,(t=>{t?v_.error("failed to load script",t):e()}))}}_currentURL(){var e=Gn?Gn.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=t?fs([],e_,r||[]):[];return Ms(e,i,r_)}v_.error("Could not determine current URL")}}var f_=hs("[Heatmaps]");function m_(e){return ei(e)&&"clientX"in e&&"clientY"in e&&ai(e.clientX)&&ai(e.clientY)}class y_{constructor(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[Hs]),this.rageclicks=new ug(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return ei(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return oi(this.instance.config.capture_heatmaps)?oi(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;f_.info("starting..."),this._setupListeners(),this._onVisibilityChange()}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this._removeListeners(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Hs]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this._buffer;return this._buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_onVisibilityChange(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(es)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null}_setupListeners(){Gn&&es&&(this._flushHandler=this._flush.bind(this),ks(Gn,"beforeunload",this._flushHandler),this._onClickHandler=e=>this._onClick(e||(null==Gn?void 0:Gn.event)),ks(es,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=e=>this._onMouseMove(e||(null==Gn?void 0:Gn.event)),ks(es,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Dg(this.instance,Ng,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),ks(es,"visibilitychange",this._onVisibilityChange_handler),this._initialized=!0)}_removeListeners(){var e;Gn&&es&&(this._flushHandler&&Gn.removeEventListener("beforeunload",this._flushHandler),this._onClickHandler&&es.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&es.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&es.removeEventListener("visibilitychange",this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(e,t,r){for(var i=e;i&&go(i)&&!_o(i,"body");){if(i===r)return!1;if(jr(t,null==Gn?void 0:Gn.getComputedStyle(i).position))return!0;i=xo(i)}return!1}(Io(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}_onClick(e,t){var i;if(void 0===t&&(t="click"),!vo(e.target)&&m_(e)){var n=this._getProperties(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(r({},n,{type:"rageclick"})),this._capture(n)}}_onMouseMove(e){!vo(e.target)&&m_(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if(Gn){var t=Gn.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,n=r?fs([],e_,i||[]):[],s=Ms(t,n,r_);this._buffer=this._buffer||{},this._buffer[s]||(this._buffer[s]=[]),this._buffer[s].push(e)}}_flush(){this._buffer&&!ti(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class b_{constructor(e){this._onSessionIdChange=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(ds.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this._currentPageview=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}_setupSessionRotationHandler(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)}destroy(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0}doPageView(e,t){var r,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(r=null==Gn?void 0:Gn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=n;if(!(ri(s)||ri(o)||ri(a)||ri(l)||ri(u)||ri(c))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var d=s<=1?1:mi(o/s,0,1,ds),h=s<=1?1:mi(a/s,0,1,ds),p=l<=1?1:mi(u/l,0,1,ds),v=l<=1?1:mi(c/l,0,1,ds);i=_s(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var w_=hs("[FeatureFlags]"),S_=hs("[FeatureFlags]",{debugEnabled:!0}),C_="errors_while_computing_flags",I_="flag_missing",E_="quota_limited",k_="timeout",x_="connection_error",T_="unknown_error",R_=e=>"api_error_"+e,M_="$active_feature_flags",A_="$override_feature_flags",P_="$feature_flag_payloads",L_="$override_feature_flag_payloads",O_="$feature_flag_request_id",N_="$feature_flag_evaluated_at",F_=e=>{var t={};for(var[r,i]of ms(e||{}))i&&(t[r]=i);return t},D_=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):w_.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},H_=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class B_{constructor(e){this._override_warning=!1,this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsCalled=!1,this._flagsLoadedFromRemote=!1,this._hasLoggedDeprecationWarning=!1,this._instance=e,this.featureFlagEventHandlers=[]}_getValidEvaluationEnvironments(){var e,t=null!==(e=this._instance.config.evaluation_contexts)&&void 0!==e?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this._hasLoggedDeprecationWarning||(w_.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._hasLoggedDeprecationWarning=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||w_.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}_shouldIncludeEvaluationEnvironments(){return this._getValidEvaluationEnvironments().length>0}flags(){if(this._instance.config.__preview_remote_config)this._flagsCalled=!0;else{var e=!this._reloadDebouncer&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this._callFlagsEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Ks),t=this._instance.get_property(A_),i=this._instance.get_property(L_);if(!i&&!t)return e||{};var n=_s({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],c=null==t?void 0:t[o],d=ri(c)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!c,h=ri(c)?u.variant:"string"==typeof c?c:void 0,p=null==i?void 0:i[o],v=r({},u,{enabled:d,variant:d?null!=h?h:null==u?void 0:u.variant:void 0});if(d!==(null==u?void 0:u.enabled)&&(v.original_enabled=null==u?void 0:u.enabled),h!==(null==u?void 0:u.variant)&&(v.original_variant=null==u?void 0:u.variant),p)v.metadata=r({},null==u?void 0:u.metadata,{payload:p,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload});n[o]=v}return this._override_warning||(w_.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this._override_warning=!0),n}getFlagVariants(){var e=this._instance.get_property(Ys),t=this._instance.get_property(A_);if(!t)return e||{};for(var r=_s({},e),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this._override_warning||(w_.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this._instance.get_property(P_),t=this._instance.get_property(L_);if(!t)return e||{};for(var r=_s({},e||{}),i=Object.keys(t),n=0;n<i.length;n++)r[i[n]]=t[i[n]];return this._override_warning||(w_.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this._instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._instance._internalEventEmitter.emit("featureFlagsReloading",!0),this._reloadDebouncer=setTimeout((()=>{this._callFlagsEndpoint()}),5))}_clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callFlagsEndpoint(e){var t;if(this._clearDebouncer(),!this._instance._shouldDisableFlags())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i=this._instance.config.token,n=this._instance.get_property("$device_id"),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==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(Js)||{}),group_properties:this._instance.get_property(Qs)};si(n)||ri(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this._shouldIncludeEvaluationEnvironments()&&(s.evaluation_contexts=this._getValidEvaluationEnvironments());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);o&&(s.timezone=d_()),this._requestInFlight=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this._instance.config.disable_compression?void 0:su.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n,o=!0;(200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),o=!1),this._requestInFlight=!1,this._flagsCalled)||(this._flagsCalled=!0,this._instance._onRemoteConfig(null!==(n=e.json)&&void 0!==n?n:{}));if(!s.disable_flags||this._additionalReloadRequested){this._flagsLoadedFromRemote=!o;var a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?k_:x_):a.push(T_):200!==e.statusCode&&a.push(R_(e.statusCode)),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push(C_);var l=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes(H_.FeatureFlags));if(l&&a.push(E_),null==(i=this._instance.persistence)||i.register({[ro]:a}),l)w_.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{var u;if(!s.disable_flags)this.receivedFeatureFlags(null!==(u=e.json)&&void 0!==u?u:{},o);this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callFlagsEndpoint())}}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}w_.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this._instance.get_property(O_)||void 0,l=this._instance.get_property(N_)||void 0,u=this._instance.get_property(to)||{};if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var c,d,h,p,v,g,_,f,m,y;Kr(u[e])?u[e].push(o):u[e]=[o],null==(c=this._instance.persistence)||c.register({[to]:u});var b=this.getFeatureFlagDetails(e),w=[...null!==(d=this._instance.get_property(ro))&&void 0!==d?d:[]];ri(n)&&w.push(I_);var S={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(h=this._instance.config.bootstrap)||null==(h=h.featureFlags)?void 0:h[e])||null,$feature_flag_bootstrapped_payload:(null==(p=this._instance.config.bootstrap)||null==(p=p.featureFlagPayloads)?void 0:p[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};ri(null==b||null==(v=b.metadata)?void 0:v.version)||(S.$feature_flag_version=b.metadata.version);var C,I=null!==(g=null==b||null==(_=b.reason)?void 0:_.description)&&void 0!==g?g:null==b||null==(f=b.reason)?void 0:f.code;if(I&&(S.$feature_flag_reason=I),null!=b&&null!=(m=b.metadata)&&m.id&&(S.$feature_flag_id=b.metadata.id),ri(null==b?void 0:b.original_variant)&&ri(null==b?void 0:b.original_enabled)||(S.$feature_flag_original_response=ri(b.original_variant)?b.original_enabled:b.original_variant),null!=b&&null!=(y=b.metadata)&&y.original_payload)S.$feature_flag_original_payload=null==b||null==(C=b.metadata)?void 0:C.original_payload;w.length&&(S.$feature_flag_error=w.join(",")),this._instance.capture("$feature_flag_called",S)}if(i){var E=s;if(!ri(s))try{E=JSON.parse(s)}catch(e){}return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:E}}}else w_.warn('getFeatureFlagResult for key "'+e+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(e,t){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this._shouldIncludeEvaluationEnvironments()&&(i.evaluation_contexts=this._getValidEvaluationEnvironments()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:su.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:r=>{var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return ri(r)?void 0:!!r}w_.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t){if(this._instance.persistence){this._hasLoadedFlags=!0;var i=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,i,n,s){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var o=D_(e),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var c=e.requestId,d=e.evaluatedAt;if(Kr(l)){w_.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var p=0;p<l.length;p++)h[l[p]]=!0;t&&t.register({[M_]:l,[Ys]:h})}else{var v=l,g=u,_=a;if(e.errorsWhileComputingFlags)if(a){var f=new Set(Object.keys(a).filter((e=>{var t;return!(null!=(t=a[e])&&t.failed)})));v=r({},i,Object.fromEntries(Object.entries(v).filter((e=>{var[t]=e;return f.has(t)})))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return f.has(t)})))),_=r({},s,Object.fromEntries(Object.entries(_||{}).filter((e=>{var[t]=e;return f.has(t)}))))}else v=r({},i,v),g=r({},n,g),_=r({},s,_);t&&t.register(r({[M_]:Object.keys(F_(v)),[Ys]:v||{},[P_]:g||{},[Ks]:_||{}},c?{[O_]:c}:{},d?{[N_]:d}:{}))}}}(e,this._instance.persistence,i,n,s),this._fireFeatureFlagsCallbacks(t)}}override(e,t){void 0===t&&(t=!1),w_.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return w_.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(A_),this._instance.persistence.unregister(L_),this._fireFeatureFlagsCallbacks(),S_.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,r=e;if(this._override_warning=Boolean(null!==(t=r.suppressWarning)&&void 0!==t&&t),"flags"in r)if(!1===r.flags)this._instance.persistence.unregister(A_),S_.info("Flag overrides cleared");else if(r.flags){if(Kr(r.flags)){for(var i={},n=0;n<r.flags.length;n++)i[r.flags[n]]=!0;this._instance.persistence.register({[A_]:i})}else this._instance.persistence.register({[A_]:r.flags});S_.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this._instance.persistence.unregister(L_),S_.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[L_]:r.payloads}),S_.info("Payload overrides set",{payloads:r.payloads}))),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this._instance.get_property(Xs)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$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(),{[e]:t});null==(n=this._instance.persistence)||n.register({[M_]:Object.keys(F_(l)),[Ys]:l}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this._instance.get_property(Xs),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this._instance.persistence)||r.unregister(Xs),null==(i=this._instance.persistence)||i.register({[Xs]:n}),e(n)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Js)||{};this._instance.register({[Js]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Js)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(Qs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[Qs]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Qs)||{};this._instance.register({[Qs]:r({},t,{[e]:{}})})}else this._instance.unregister(Qs)}reset(){this._hasLoadedFlags=!1,this._requestInFlight=!1,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsCalled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1}}var q_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class U_{constructor(e,t){this._config=e,this.props={},this._campaign_params_saved=!1,this._name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this._storage=this._buildStorage(e),this.load(),e.debug&&ds.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._disabled}_buildStorage(e){-1===q_.indexOf(e.persistence.toLowerCase())&&(ds.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(e){void 0===e&&(e=[]);var t=[...xg,...e];return r({},kg,{_parse:function(e){try{var t={};try{t=Ig._parse(e)||{}}catch(e){}var r=_s(t,JSON.parse(kg._get(e)||"{}"));return kg._set(e,r),r}catch(e){}return null},_set:function(e,r,i,n,s,o){try{kg._set(e,r,void 0,void 0,o);var a={};t.forEach((e=>{r[e]&&(a[e]=r[e])})),Object.keys(a).length&&Ig._set(e,a,i,n,s,o)}catch(e){kg._error(e)}},_remove:function(e,t){try{null==Gn||Gn.localStorage.removeItem(e),Ig._remove(e,t)}catch(e){kg._error(e)}}})}(e.cookie_persisted_properties||[]),i=e.persistence.toLowerCase();return"localstorage"===i&&kg._is_supported()?kg:"localstorage+cookie"===i&&t._is_supported()?t:"sessionstorage"===i&&Ag._is_supported()?Ag:"memory"===i?Rg:"cookie"===i?Ig:t._is_supported()?t:Ig}properties(){var e={};return gs(this.props,(function(t,r){if(r===Ys&&ei(t))for(var i=Object.keys(t),n=0;n<i.length;n++)e["$feature/"+i[n]]=t[i[n]];else o=r,a=!1,(si(s=po)?a:Jn&&s.indexOf===Jn?-1!=s.indexOf(o):(gs(s,(function(e){if(a||(a=e===o))return ps})),a))||(e[r]=t);var s,o,a})),e}load(){if(!this._disabled){var e=this._storage._parse(this._name);e&&(this.props=_s({},e))}}save(){this._disabled||this._storage._set(this._name,this.props,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)}remove(){this._storage._remove(this._name,!1),this._storage._remove(this._name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(ei(e)){ri(t)&&(t="None"),this._expire_days=ri(r)?this._default_expiry:r;var i=!1;if(gs(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(ei(e)){this._expire_days=ri(t)?this._default_expiry:t;var r=!1;if(gs(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this._campaign_params_saved){var e=n_(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);ti(ws(e))||this.register(e),this._campaign_params_saved=!0}}update_search_keyword(){var e;this.register((e=null==es?void 0:es.referrer)?o_(e):{})}update_referrer_info(){var e;this.register_once({$referrer:l_(),$referring_domain:null!=es&&es.referrer&&(null==(e=xs(es.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[oo]||this.props[ao]||this.register_once({[lo]:u_(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};gs([ao,oo],(t=>{var r=this.props[t];r&&gs(r,(function(t,r){e["$initial_"+zr(r)]=t}))}));var t,r,i=this.props[lo];if(i){var n=(t=c_(i),r={},gs(t,(function(e,t){r["$initial_"+zr(t)]=e})),r);_s(e,n)}return e}safe_merge(e){return gs(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var i=this._buildStorage(e),n=this.props;this.clear(),this._storage=i,this.props=n,this.save()}}set_disabled(e){this._disabled=e,this._disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove(),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Fs]||{};r[e]=t,this.props[Fs]=r,this.save()}remove_event_timer(e){var t=(this.props[Fs]||{})[e];return ri(t)||(delete this.props[Fs][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var $_=hs("[Product Tours]"),V_="ph_product_tours";class j_{constructor(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[js]:!(null==e||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,t;this._productTourManager||((e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(js))||this._loadScript((()=>this._startProductTours()))}_loadScript(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?$_.error("Could not load product tours script",t):e()}))}_startProductTours(){var e;!this._productTourManager&&null!=(e=os.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=os.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Kr(this._cachedTours)||t){var r=this._instance.persistence;if(r){var i=r.props[V_];if(Kr(i)&&!t)return this._cachedTours=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return $_.error(n),void e([],{isLoaded:!1,error:n})}var s=Kr(t.json.product_tours)?t.json.product_tours:[];this._cachedTours=s,r&&r.register({[V_]:s}),e(s,{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})}getActiveProductTours(e){oi(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this._productTourManager)||t.showTourById(e)}previewTour(e){this._productTourManager?this._productTourManager.previewTour(e):this._loadScript((()=>{var t;this._startProductTours(),null==(t=this._productTourManager)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this._productTourManager)||e.nextStep()}previousStep(){var e;null==(e=this._productTourManager)||e.previousStep()}clearCache(){var e;this._cachedTours=null,null==(e=this._instance.persistence)||e.unregister(V_)}resetTour(e){var t;null==(t=this._productTourManager)||t.resetTour(e)}resetAllTours(){var e;null==(e=this._productTourManager)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)}}class W_{constructor(){this._events={},this._events={}}on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this._events[e]||[])r(t);for(var i of this._events["*"]||[])i(e,t)}}function z_(e,t,r){if(oi(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class Z_{constructor(e){this._debugEventEmitter=new W_,this._checkStep=(e,t)=>this._checkStepEvent(e,t)&&this._checkStepUrl(e,t)&&this._checkStepElement(e,t)&&this._checkStepProperties(e,t),this._checkStepEvent=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this._actionEvents=new Set,this._actionRegistry=new Set}init(){var e;if(!ri(null==(e=this._instance)?void 0:e._addCaptureHook)){var t;null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,r;if(!ri(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this._actionRegistry)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this._actionEvents)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(null==t?void 0:t.event))&&this._actionRegistry&&(null==(r=this._actionRegistry)?void 0:r.size)>0&&this._actionRegistry.forEach((e=>{this._checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}_checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this._checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}_checkStepUrl(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!z_(i,t.url,t.url_matching||"contains"))return!1}return!0}_checkStepElement(e,t){return!!this._checkStepHref(e,t)&&(!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t))}_checkStepHref(e,t){var r;if(null==t||!t.href)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some((e=>z_(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&z_((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}_checkStepText(e,t){var r;if(null==t||!t.text)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some((e=>z_(e.text,t.text,t.text_matching||"exact")||z_(e.$el_text,t.text,t.text_matching||"exact")));var n,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!oi(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),s=t.text,o=t.text_matching||"exact",n.some((e=>z_(e,s,o))))}_checkStepSelector(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}_getElementsList(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}_checkStepProperties(e,t){return null==t||!t.properties||0===t.properties.length||Ku(t.properties.reduce(((e,t)=>{var r=Kr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class G_{constructor(e){this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map}_doesEventMatchFilter(e,t){return!!e&&Ku(e.propertyFilters,null==t?void 0:t.properties)}_buildEventToItemMap(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}_getMatchingItems(e,t,r){var i=(r===xl.Activation?this._eventToItems:this._cancelEventToItems).get(e),n=[];return this._getItems((e=>{n=e.filter((e=>null==i?void 0:i.includes(e.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this._doesEventMatchFilter(s,t)}))}register(e){var t;ri(null==(t=this._instance)?void 0:t._addCaptureHook)||(this._setupEventBasedItems(e),this._setupActionBasedItems(e))}_setupActionBasedItems(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));if(0!==t.length){if(null==this._actionMatcher){this._actionMatcher=new Z_(this._instance),this._actionMatcher.init();this._actionMatcher._addActionHook((e=>{this.onAction(e)}))}t.forEach((e=>{var t,r,i,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this._actionMatcher)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((t=>{if(t&&t.name){var r=this._actionToItems.get(t.name);r&&r.push(e.id),this._actionToItems.set(t.name,r||[e.id])}})))}))}}_setupEventBasedItems(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));if(0!==r.length||0!==i.length){null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this._eventToItems=this._buildEventToItemMap(e,xl.Activation),this._cancelEventToItems=this._buildEventToItemMap(e,xl.Cancellation)}}onEvent(e,t){var r,i=this._getLogger(),n=this._getActivatedKey(),s=this._getShownEventName(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===e&&t&&o.length>0){var a,l;i.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var c=o.indexOf(u);c>=0&&(o.splice(c,1),this._updateActivatedItems(o))}}else{if(this._cancelEventToItems.has(e)){var d=this._getMatchingItems(e,t,xl.Cancellation);d.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);t>=0&&o.splice(t,1),this._cancelPendingItem(e.id)})),this._updateActivatedItems(o))}if(this._eventToItems.has(e)){i.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var h=this._getMatchingItems(e,t,xl.Activation);this._updateActivatedItems(o.concat(h.map((e=>e.id))||[]))}}}onAction(e){var t,r=this._getActivatedKey(),i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[r])||[];this._actionToItems.has(e)&&this._updateActivatedItems(i.concat(this._actionToItems.get(e)||[]))}_updateActivatedItems(e){var t,r=this._getLogger(),i=this._getActivatedKey(),n=[...new Set(e)].filter((e=>!this._isItemPermanentlyIneligible(e)));r.info("updating activated items",{activatedItems:n}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[i]:n})}getActivatedIds(){var e,t=this._getActivatedKey(),r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return r||[]}getEventToItemsMap(){return this._eventToItems}_getActionMatcher(){return this._actionMatcher}}class Y_ extends G_{constructor(e){super(e)}_getActivatedKey(){return"$surveys_activated"}_getShownEventName(){return Nl.SHOWN}_getItems(e){var t;null==(t=this._instance)||t.getSurveys(e)}_cancelPendingItem(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}_getLogger(){return Hl}_isItemPermanentlyIneligible(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class X_{constructor(e){this._isSurveysEnabled=void 0,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(oi(t))return Hl.warn("Flags not loaded yet. Not loading surveys.");var r=Kr(t);this._isSurveysEnabled=r?t.length>0:t,Hl.info("flags response received, isSurveysEnabled: "+this._isSurveysEnabled),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(null!=r&&r.startsWith($l)||null!=r&&r.startsWith(Vl))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)Hl.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Hl.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Hl.info("Not loading surveys in cookieless mode without consent.");else{var e=null==os?void 0:os.__PosthogExtensions__;if(e){if(!ri(this._isSurveysEnabled)||this._instance.config.advanced_enable_surveys){var t=this._isSurveysEnabled||this._instance.config.advanced_enable_surveys;this._isInitializingSurveys=!0;try{var r=e.generateSurveys;if(r)return void this._completeSurveyInitialization(r,t);var i=e.loadExternalDependency;if(!i)return void this._handleSurveyLoadError("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this._handleSurveyLoadError("Could not load surveys script",r):this._completeSurveyInitialization(e.generateSurveys,t)}))}catch(e){throw this._handleSurveyLoadError("Error initializing surveys",e),e}finally{this._isInitializingSurveys=!1}}}else Hl.error("PostHog Extensions not found.")}}_completeSurveyInitialization(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Y_(this._instance),Hl.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})}_handleSurveyLoadError(e,t){Hl.error(e,t),this._notifySurveyCallbacks({isLoaded:!1,error:e})}onSurveysLoaded(e){return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return Hl.info("Disabled. Not loading surveys."),e([]);var r,i=this._instance.get_property(eo);if(i&&!t)return e(i,{isLoaded:!0});"undefined"!=typeof Promise&&this._getSurveysInFlightPromise?this._getSurveysInFlightPromise.then((t=>{var{surveys:r,context:i}=t;return e(r,i)})):("undefined"!=typeof Promise&&(this._getSurveysInFlightPromise=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{var i;this._getSurveysInFlightPromise=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;Hl.error(s);var o={isLoaded:!1,error:s};return e([],o),void(null==r||r({surveys:[],context:o}))}var a,l=t.json.surveys||[],u=l.filter((e=>Bl(e)&&(ql(e)||Ul(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u));null==(i=this._instance.persistence)||i.register({[eo]:l});var c={isLoaded:!0};e(l,c),null==r||r({surveys:l,context:c})}}))}_notifySurveyCallbacks(e){for(var t of this._surveyCallbacks)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Hl.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!oi(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Hl.warn("init was not called")}_getSurveyById(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}_checkSurveyEligibility(e){if(oi(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(oi(this._surveyManager))return Hl.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this._checkSurveyEligibility(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return oi(this._surveyManager)?(Hl.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var s=this._checkSurveyEligibility(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var i;if(oi(this._surveyManager))Hl.warn("init was not called");else{var n="string"==typeof e?this._getSurveyById(e):e;if(null!=n&&n.id)if(Gl.includes(n.type)){var s=null==es?void 0:es.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Hl.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;Hl.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),Hl.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Hl.warn("Survey element not found")}else Hl.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Hl.warn("Survey not found")}}displaySurvey(e,t){var i;if(oi(this._surveyManager))Hl.warn("init was not called");else{var n=this._getSurveyById(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Dl.Popover&&t.initialResponses&&Hl.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Hl.warn("Survey is not eligible to be displayed: ",o.disabledReason)}t.displayType!==Dl.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else Hl.warn("Survey not found")}}cancelPendingSurvey(e){oi(this._surveyManager)?Hl.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var K_=hs("[Conversations]");class J_{constructor(e){this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;oi(t)||(ui(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null}loadIfEnabled(){if(!this._conversationsManager&&!this._isInitializing&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==os?void 0:os.__PosthogExtensions__;if(e&&!ri(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){this._isInitializing=!0;try{var t=e.initConversations;if(t)return this._completeInitialization(t),void(this._isInitializing=!1);var r=e.loadExternalDependency;if(!r)return void this._handleLoadError("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(t=>{t||!e.initConversations?this._handleLoadError("Could not load conversations script",t):this._completeInitialization(e.initConversations),this._isInitializing=!1}))}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}else K_.error("Conversations enabled but missing token in remote config.")}}_completeInitialization(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),K_.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else K_.error("Cannot complete initialization: remote config is null")}_handleLoadError(e,t){K_.error(e,t),this._conversationsManager=null,this._isInitializing=!1}show(){this._conversationsManager?this._conversationsManager.show():K_.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this._isConversationsEnabled&&!si(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(K_.warn("Conversations not available yet."),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(K_.warn("Conversations not available yet."),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(K_.warn("Conversations not available yet."),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(K_.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}}class Q_{constructor(e){var t;this._isLogsEnabled=!1,this._isLoaded=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0)}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!oi(r)&&r&&(this._isLogsEnabled=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this._isLogsEnabled&&!this._isLoaded){var e=hs("[logs]"),t=null==os?void 0:os.__PosthogExtensions__;if(t){var r=t.loadExternalDependency;r?r(this._instance,"logs",(r=>{var i;r||null==(i=t.logs)||!i.initializeLogs?e.error("Could not load logs script",r):(t.logs.initializeLogs(this._instance),this._isLoaded=!0)})):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var ef=hs("[RateLimiter]");class tf{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{ef.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void ef.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(so))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=a.tokens<1;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(so,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rf=hs("[RemoteConfig]");class nf{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=os._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,r;null!=(t=os.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(rf.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return rf.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void rf.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return rf.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this._onRemoteConfig(e)}));this._onRemoteConfig(e)}))}catch(e){rf.error("Error loading remote config",e)}}_onRemoteConfig(e){e?this._instance.config.__preview_remote_config?(this._instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):rf.info("__preview_remote_config is disabled. Logging config instead",e):rf.error("Failed to fetch remote config from PostHog.")}}var sf=3e3;class of{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=mi((null==t?void 0:t.flush_interval_ms)||sf,250,5e3,ds.createLogger("flush interval"),sf),this._sendRequest=e}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){this._clearFlushTimeout();var e=this._queue.length>0?this._formatQueue():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this._sendRequest(r({},e,{transport:"sendBeacon"}))}))}enable(){this._isPaused=!1,this._setFlushTimeout()}_setFlushTimeout(){var e=this;this._isPaused||(this._flushTimeout=setTimeout((()=>{if(this._clearFlushTimeout(),this._queue.length>0){var t=this._formatQueue(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Kr(r.data)&&gs(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e._sendRequest(r)};for(var i in t)r()}}),this._flushTimeoutMs))}_clearFlushTimeout(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0}_formatQueue(){var e={};return gs(this._queue,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;ri(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this._queue=[],e}}var af=["retriesPerformedSoFar"];class lf{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!ri(Gn)&&"onLine"in Gn.navigator&&(this._areWeOnline=Gn.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},ks(Gn,"online",this._onlineListener),ks(Gn,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,af);li(t)&&(n.url=Vu(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this._enqueue(r({retriesPerformedSoFar:t},n)):null==n.callback||n.callback(e)}}))}_enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=(Math.random()-.5)*(i-r);return Math.ceil(i+n)}(t),i=Date.now()+r;this._queue.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ds.warn(n),this._isPolling||(this._isPolling=!0,this._poll())}_poll(){if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout((()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._poll()}),this._pollIntervalMs)}_flush(){var e=Date.now(),t=[],r=this._queue.filter((r=>r.retryAt<e||(t.push(r),!1)));if(this._queue=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,ri(Gn)||(this._onlineListener&&(Gn.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Gn.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0)),this._queue))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){ds.error(e)}this._queue=[]}}class uf{constructor(e){this._updateScrollData=()=>{var e,t,r,i;this._context||(this._context={});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._context.lastScrollY=Math.ceil(s),this._context.maxScrollY=Math.max(s,null!==(e=this._context.maxScrollY)&&void 0!==e?e:0),this._context.maxScrollHeight=Math.max(o,null!==(t=this._context.maxScrollHeight)&&void 0!==t?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!==(r=this._context.maxContentY)&&void 0!==r?r:0),this._context.maxContentHeight=Math.max(l,null!==(i=this._context.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){ks(Gn,"scroll",this._updateScrollData,{capture:!0}),ks(Gn,"scrollend",this._updateScrollData,{capture:!0}),ks(Gn,"resize",this._updateScrollData)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Gn?void 0:Gn.document.documentElement;var e=Kr(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var r=null==Gn?void 0:Gn.document.querySelector(t);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return Gn&&(Gn.scrollY||Gn.pageYOffset||Gn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return Gn&&(Gn.scrollX||Gn.pageXOffset||Gn.document.documentElement.scrollLeft)||0}}var cf=e=>u_(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class df{constructor(e,t,r,i){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[no]:r})}},this._instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=i||cf,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[no]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?c_(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return gs(ws(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+zr(r)]=t})),e}}var hf=hs("[SessionId]");class pf{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,r){var i;if(this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._eventEmitter=new W_,this._sessionHasBeenIdleTooLong=(e,t)=>!(!li(e)||!li(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||ru,this._windowIdGenerator=r||ru;var n=this._config.persistence_name||this._config.token,s=this._config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*mi(s,60,36e3,hf.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+n+"_window_id",this._primary_window_exists_storage_key="ph_"+n+"_primary_window_exists",this._canUseSessionStorage()){var o=Ag._parse(this._window_id_storage_key),a=Ag._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:Ag._remove(this._window_id_storage_key),Ag._set(this._primary_window_exists_storage_key,!0)}if(null!=(i=this._config.bootstrap)&&i.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this._config.bootstrap.sessionID);this._setSessionId(this._config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){hf.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ri(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&Ag._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ag._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ag._parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this._persistence.register({[Zs]:[t,e,r]}))}_getSessionId(){var e=this._persistence.props[Zs];return Kr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}destroy(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&Gn&&(Gn.removeEventListener("beforeunload",this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._canUseSessionStorage()&&Ag._remove(this._primary_window_exists_storage_key)},ks(Gn,"beforeunload",this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,n,s]=this._getSessionId(),o=this._getWindowId(),a=li(s)&&Math.abs(r-s)>864e5,l=!1,u=!n,c=!u&&!e&&this._sessionHasBeenIdleTooLong(r,i);u||c||a?(n=this._sessionIdGenerator(),o=this._windowIdGenerator(),hf.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}}),s=r,l=!0):o||(o=this._windowIdGenerator(),l=!0);var d=!!li(i)&&e&&!a?i:r,h=!li(s)?(new Date).getTime():s;return this._setWindowId(o),this._setSessionId(n,d,h),e||this._resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(n,o,l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:h,changeReason:l?{noSessionId:u,activityTimeout:c,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}_resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{var[e]=this._getSessionId();if(this._sessionHasBeenIdleTooLong((new Date).getTime(),e)){var t=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var vf=["$set_once","$set"],gf=hs("[SiteApps]");class _f{constructor(e){this._instance=e,this._bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}_eventCollector(e,t){if(t){var r=this.globalsForEvent(t);this._bufferedInvocations.push(r),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}}get siteAppLoaders(){var e;return null==(e=os._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=()=>{e(),this._bufferedInvocations=[],this._stopBuffering=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))c[p]={id:d[p],type:p,properties:v};var{$set_once:g,$set:_}=e;return{event:r({},i(e,vf),{properties:r({},e.properties,_?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},_)}:{},g?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},g)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;(!t.errored&&this._bufferedInvocations.length&&(gf.info("Processing "+this._bufferedInvocations.length+" events for site app with id "+e.id),this._bufferedInvocations.forEach((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored)))&&(null==(r=this._stopBuffering)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,gf.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:e=>{n(e)}});s&&(t.processEvent=s),i=!0}catch(t){gf.error("Error while initializing PostHog app with config id "+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){gf.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}_setupSiteApps(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}_onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(t)}catch(t){gf.error("Error while processing event "+e.event+" for site app "+r.id,t)}}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",(e=>this._onCapturedEvent(e)))):void gf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._stopBuffering)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var s=function(e){var t;os["__$$ph_site_app_"+e]=n._instance,null==(t=os.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return gf.error("Error while initializing PostHog app with config id "+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else gf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var ff=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Vr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>Vr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},mf=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),yf="i.posthog.com";class bf{constructor(e){this._regionCache={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+yf,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=mf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=mf.EU:this._regionCache[this.apiHost]=mf.CUSTOM),this._regionCache[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===mf.CUSTOM)return this.apiHost+t;var r=yf+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var wf={icontains:(e,t)=>!!Gn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Gn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Gn&&Zu(t.href,e),not_regex:(e,t)=>!!Gn&&!Zu(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Sf{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{Sf._logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t._flagToExperiments)Sf._logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t._flagToExperiments)||r.set(e.feature_flag_key,e);var i=t._instance.getFeatureFlag(e.feature_flag_key);ii(i)&&e.variants[i]&&t._applyTransforms(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];Sf._matchesTestVariant(s)&&t._applyTransforms(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())Sf._logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(oi(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Sf._logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!=(t=this._flagToExperiments)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this._flagToExperiments)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this._applyTransforms(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=Sf.getWindowLocation();if(null!=e&&e.search){var t=Rs(null==e?void 0:e.search,"__experiment_id"),r=Rs(null==e?void 0:e.search,"__experiment_variant");t&&r&&(Sf._logInfo("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this._showPreviewWebExperiment(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var r=t.json.experiments||[];return e(r)}})}_showPreviewWebExperiment(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(Sf._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this._applyTransforms(i[0].name,t,i[0].variants[t].transforms))}static _matchesTestVariant(e){return!oi(e.conditions)&&(Sf._matchUrlConditions(e)&&Sf._matchUTMConditions(e))}static _matchUrlConditions(e){var t;if(oi(e.conditions)||oi(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,s=Sf.getWindowLocation();return!!s&&(null==(r=e.conditions)||!r.url||wf[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==Gn?void 0:Gn.location}static _matchUTMConditions(e){var t;if(oi(e.conditions)||oi(null==(t=e.conditions)?void 0:t.utm))return!0;var r=n_();if(r.utm_source){var i,n,s,o,a,l,u,c,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==r.utm_term;return d&&p&&v&&h}return!1}static _logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];ds.info("[WebExperiments] "+e,r)}_applyTransforms(e,t,r){this._is_bot()?Sf._logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var i;Sf._logInfo("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):Sf._logInfo("Control variants leave the page unmodified.")}_is_bot(){return Qn&&this._instance?ff(Qn,this._instance.config.custom_blocked_useragents):void 0}}var Cf=hs("[PostHog ExternalIntegrations]"),If={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Ef{constructor(e){this._instance=e}_loadScript(e,t){var r;null==(r=os.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return Cf.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;(!i||null!=(r=os.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e._loadScript(If[t],(()=>{var r;null==(r=os.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=os.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t])&&(null==(s=os.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[t])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(r)}}}hs("[SessionRecording]");var kf="[SessionRecording]",xf=hs(kf);class Tf{get started(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}get status(){return this._lazyLoadedSessionRecording?this._lazyLoadedSessionRecording.status:this._receivedFlags&&!this._isRecordingEnabled?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this._receivedFlags=!1,this._hasRequestedConfigRefresh=!1,this._persistFlagsOnSessionListener=void 0,this._instance=e,!this._instance.sessionManager)throw xf.error("started without valid sessionManager"),new Error(kf+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(kf+' cannot be used with cookieless_mode="always"')}get _isRecordingEnabled(){var e,t=!(null==(e=this._instance.get_property(zs))||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Gn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._isRecordingEnabled||null==(t=this._lazyLoadedSessionRecording)||!t.isStarted){var r=!ri(Object.assign)&&!ri(Array.from);this._isRecordingEnabled&&r?(this._lazyLoadAndStart(e),xf.info("starting")):this.stopRecording()}}_lazyLoadAndStart(e){var t,r,i;this._isRecordingEnabled&&(null!=os&&null!=(t=os.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=os.__PosthogExtensions__)&&r.initSessionRecording?this._onScriptLoaded(e):null==(i=os.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,(t=>{if(t)return xf.error("could not load recorder",t);this._onScriptLoaded(e)})))}stopRecording(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()}_resetSampling(){var e;null==(e=this._instance.persistence)||e.unregister(Gs)}_persistRemoteConfig(e){if(this._instance.persistence){var t,i,n=this._instance.persistence,s=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,s=oi(i)?null:parseFloat(i);oi(s)&&this._resetSampling();var o=null==t?void 0:t.minimumDurationMilliseconds;n.register({[zs]:r({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:s,minimumDurationMilliseconds:ri(o)?null:o,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};s(),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this._hasRequestedConfigRefresh=!1,this._persistRemoteConfig(e),this._receivedFlags=!0,this.startIfEnabledOrStop()):this._receivedFlags=!0:xf.info("skipping remote config with no sessionRecording",e)}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this._lazyLoadedSessionRecording)&&r.log?this._lazyLoadedSessionRecording.log(e,t):xf.warn("log called before recorder was ready")}get _scriptName(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(zs);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}_isRemoteConfigFresh(){var e,t=this._instance.get_property(zs);if(!t)return!1;var r=null!==(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)&&void 0!==e?e:Date.now();return Date.now()-r<=3e5}_onScriptLoaded(e){var t,r;if(null==(t=os.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(r=os.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this._isRemoteConfigFresh()?this._lazyLoadedSessionRecording.start(e):this._hasRequestedConfigRefresh||(this._hasRequestedConfigRefresh=!0,xf.info("persisted remote config is stale, requesting fresh config before starting"),new nf(this._instance).load())}onRRwebEmit(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this._lazyLoadedSessionRecording||(null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}));null==(e=this._lazyLoadedSessionRecording)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this._lazyLoadedSessionRecording||(null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}));null==(e=this._lazyLoadedSessionRecording)||e.overrideSampling()}overrideTrigger(e){var t,r;this._lazyLoadedSessionRecording||(null==(r=this._instance.persistence)||r.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(t=this._lazyLoadedSessionRecording)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this._lazyLoadedSessionRecording)||!r.tryAddCustomEvent(e,t))}}var Rf={},Mf=()=>{},Af="posthog",Pf=!Uu&&-1===(null==ss?void 0:ss.indexOf("MSIE"))&&-1===(null==ss?void 0:ss.indexOf("Mozilla")),Lf=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Is(null==es?void 0:es.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Mf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:ts&&ii(null==ts?void 0:ts.search)&&-1!==ts.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,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Gn||null==(t=Gn.location)?void 0:t.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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;ds.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:sf},error_tracking:{},_onCapture:Mf,__preview_eager_load_replay:!1},(e=>({rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Of=e=>{var t={};ri(e.process_person)||(t.person_profiles=e.process_person),ri(e.xhr_headers)||(t.request_headers=e.xhr_headers),ri(e.cookie_name)||(t.persistence_name=e.cookie_name),ri(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),ri(e.store_google)||(t.save_campaign_params=e.store_google),ri(e.verbose)||(t.debug=e.verbose);var r=_s({},t,e);return Kr(e.property_blacklist)&&(ri(e.property_denylist)?r.property_denylist=e.property_blacklist:Kr(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:ds.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class Nf{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){ds.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Ff{get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new Nf,this._personProcessingSetOncePropertiesSent=!1,this.version=us.LIB_VERSION,this._internalEventEmitter=new W_,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Lf(),this.SentryIntegration=Wg,this.sentryIntegration=e=>function(e,t){var r=jg(e,t);return{name:Vg,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new B_(this),this.toolbar=new Xg(this),this.scrollManager=new uf(this),this.pageViewManager=new b_(this),this.surveys=new X_(this),this.conversations=new J_(this),this.logs=new Q_(this),this.experiments=new Sf(this),this.exceptions=new Cv(this),this.rateLimiter=new tf(this),this.requestRouter=new bf(this),this.consent=new Lg(this),this.externalIntegrations=new Ef(this),this.people={set:(e,t,r)=>{var i=ii(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=ii(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>ds.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Af){var i,n=null!==(i=Rf[r])&&void 0!==i?i:new Ff;return n._init(e,t,r),Rf[r]=n,Rf[Af][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n;if(void 0===t&&(t={}),ri(e)||ni(e))return ds.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles&&(this._initialPersonProfilesConfig=t.person_profiles),this.set_config(_s({},Lf(t.defaults),Of(t),{name:i,token:e})),this.config.on_xhr_error&&ds.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:su.GZipJS;var s=this._is_persistence_disabled();this.persistence=new U_(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new U_(r({},this.config,{persistence:"sessionStorage"}),s);var o=r({},this.persistence.props),a=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new of((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new lf(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new pf(this),this.sessionPropsManager=new df(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ds.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this._initExtensions(l)}),0)):(ds.info("Initializing extensions synchronously"),this._initExtensions(l)),us.DEBUG=us.DEBUG||this.config.debug,us.DEBUG&&ds.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:o,s:a}),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var u,c,d=this.config.get_device_id(ru()),h=null!=(u=t.bootstrap)&&u.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(io,null!=(c=t.bootstrap)&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var p,v,g=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter((e=>{var r;return!(null==(r=t.bootstrap)||null==(r=r.featureFlags)||!r[e])})).reduce(((e,r)=>{var i;return e[r]=(null==(i=t.bootstrap)||null==(i=i.featureFlags)?void 0:i[r])||!1,e}),{}),_=Object.keys((null==(v=t.bootstrap)?void 0:v.featureFlagPayloads)||{}).filter((e=>g[e])).reduce(((e,r)=>{var i,n;null!=(i=t.bootstrap)&&null!=(i=i.featureFlagPayloads)&&i[r]&&(e[r]=null==(n=t.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[r]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:_})}if(l)this.register_once({distinct_id:ho,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(ru());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(io,"anonymous")}return ks(Gn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?$g(this,(()=>this._loaded())):this._loaded(),Jr(this.config._onCapture)&&this.config._onCapture!==Mf&&(ds.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&ds.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}_initExtensions(e){var t=performance.now();this.historyAutocapture=new qg(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Jg(this).startIfEnabledOrStop()})),r.push((()=>{var e;this.siteApps=new _f(this),null==(e=this.siteApps)||e.init()})),e||r.push((()=>{this.sessionRecording=new Tf(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new _g(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new j_(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new y_(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new __(this)})),r.push((()=>{this.exceptionObserver=new Bg(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new Dg(this,Fg),this.deadClicksAutocapture.startIfEnabledOrStop()})),r.push((()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._onRemoteConfig(e)}})),this._processInitTaskQueue(r,t)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this._processInitTaskQueue(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){ds.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&ds.info("PostHog extensions initialized ("+i+"ms)")}_onRemoteConfig(e){var t,r,i,n,s,o,a,l,u;if(!es||!es.body)return ds.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=jr(e.supportedCompression,su.GZipJS)?su.GZipJS:jr(e.supportedCompression,su.Base64)?su.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null==(r=this.siteApps)||r.onRemoteConfig(e),null==(i=this.sessionRecording)||i.onRemoteConfig(e),null==(n=this.autocapture)||n.onRemoteConfig(e),null==(s=this.heatmaps)||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(o=this.productTours)||o.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(l=this.exceptionObserver)||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){ds.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=ts&&ts.hostname){var e=ts.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this._captureInitialPageview()}),1),new nf(this).load(),this.featureFlags.flags()}_start_queue_if_opted_in(){var e;this.is_capturing()&&(this.config.request_batching&&(null==(e=this._requestQueue)||e.enable()))}_dom_loaded(){this.is_capturing()&&vs(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null==(e=this._requestQueue)||e.unload(),null==(t=this._retryQueue)||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Pf?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Vu(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,s=r({},e);s.timeout=s.timeout||6e4,s.url=Vu(s.url,{_:(new Date).getTime().toString(),ver:us.LIB_VERSION,compression:s.compression});var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=zu.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=Es(a,(e=>e.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");l(s)})(r({},e,{callback:t=>{var r,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null==(r=(i=this.config).on_request_error)||r.call(i,t));null==e.callback||e.callback(t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],i=[],n=[];vs(e,(e=>{e&&(t=e[0],Kr(t)?n.push(e):Jr(e)?e.call(this):Kr(e)&&"alias"===t?r.push(e):Kr(e)&&-1!==t.indexOf("capture")&&Jr(this[t])?n.push(e):i.push(e))}));var s=function(e,t){vs(e,(function(e){if(Kr(e[0])){var r=t;gs(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(n,this)}_hasBootstrappedFeatureFlags(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!ri(e)&&ii(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=t&&t.$current_url&&!ii(null==t?void 0:t.$current_url)&&(ds.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),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 a=new Date,l=(null==i?void 0:i.timestamp)||a,u=ru(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,t||{},l,u)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&s&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var d="$groupidentify"!==e,h=this._calculate_set_once_properties(null==i?void 0:i.$set_once,d);if(h&&(c.$set_once=h),(c=Ss(c,null!=i&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,ri(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===Nl.DISMISSED||e===Nl.SENT){var p=null==t?void 0:t[Fl.SURVEY_ID],v=null==t?void 0:t[Fl.SURVEY_ITERATION];Zl({id:p,current_iteration:v}),c.$set=r({},c.$set,{[jl({id:p,current_iteration:v},e===Nl.SENT?"responded":"dismissed")]:!0})}else e===Nl.SHOWN&&(c.$set=r({},c.$set,{[Fl.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var g=r({},c.properties.$set,c.$set);if(ti(g)||this.setPersonPropertiesForFlags(g),!oi(this.config.before_send)){var _=this._runBeforeSend(c);if(!_)return;c=_}this._internalEventEmitter.emit("eventCaptured",c);var f={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._send_retriable_request(f):this._requestQueue.enqueue(f),c}ds.critical("This capture call is ignored due to client rate limiting.")}}else ds.error("No event name provided to posthog.capture")}else ds.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ii(a.distinct_id)&&!ai(a.distinct_id)||ni(a.distinct_id))&&ds.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=p_(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=d,a.$window_id=h}this.sessionPropsManager&&_s(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&_s(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===mf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==e||s?"$pageleave"!==e||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=_s(a,u),"$pageview"===e&&es&&(a.title=es.title),!ri(o)){var v=i.getTime()-o;a.$duration=parseFloat((v/1e3).toFixed(3))}ss&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=_s({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Kr(this.config.property_denylist)?gs(this.config.property_denylist,(function(e){delete a[e]})):ds.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(ds.error("sanitize_properties is deprecated. Use before_send instead"),a=g(a,e));var _=this._hasPersonProcessing();return a.$process_person_profile=_,_&&!s&&this._requirePersonProcessing("_calculate_event_properties"),a}_calculate_set_once_properties(e,t){var r;if(void 0===t&&(t=!0),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var i=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),s=_s({},i,n||{},e||{}),o=this.config.sanitize_properties;return o&&(ds.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),ti(s)?void 0:s}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var n=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},s=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},o=r({},n,e),a=r({},s,t),l={};for(var[u,c]of Object.entries(o)){var d="string"==typeof c;l[u]={key:u,enabled:!!d||Boolean(c),variant:d?c:void 0,reason:void 0,metadata:ri(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(e,t,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,r)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=Yl),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ds.uninitializedWarning("posthog.identify");if(ai(e)&&(e=e.toString(),ds.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))ds.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==ho){if(this._requirePersonProcessing("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==n&&e!==this.get_property(Ns)&&(this.unregister(Ns),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(io)||"anonymous");e!==n&&o?(this.persistence.set_property(io,"identified"),this.setPersonPropertiesForFlags(r({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this._cachedPersonProperties=Gu(e,t,i),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(to))}}else ds.critical('The string "'+ho+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ds.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var i=Gu(this.get_distinct_id(),e,t);this._cachedPersonProperties!==i?(this.setPersonPropertiesForFlags(r({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=i):ds.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),n[e]===t||i||this.reloadFeatureFlags()}else ds.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n;if(ds.info("reset"),!this.__loaded)return ds.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(i=this.persistence)||i.set_property(io,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ho,$device_id:null},"");else{var o=this.config.get_device_id(ru());this.register_once({distinct_id:o,$device_id:e?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var n,s=null!==(n=e.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(e,t){return e===this.get_property(Os)?(ds.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(ri(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ns,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ds.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(ei(e)){var i,n,s,o,a,l,u,c;_s(this.config,Of(e));var d=this._is_persistence_disabled();null==(i=this.persistence)||i.update_config(this.config,t,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new U_(r({},this.config,{persistence:"sessionStorage"}),d);var h=this._checkLocalStorageForDebug(this.config.debug);ui(h)&&(this.config.debug=h),ui(this.config.debug)&&(this.config.debug?(us.DEBUG=!0,kg._is_supported()&&kg._set("ph_debug","true"),ds.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(us.DEBUG=!1,kg._is_supported()&&kg._remove("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(u=this.deadClicksAutocapture)||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}startSessionRecording(e){var t=!0===e,r={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,n,s,o,a;if(null==(i=this.sessionManager)||i.checkAndGetSessionAndWindowId(),r.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(r.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(r.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(r.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Af;return t!==Af&&(t=Af+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(io))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(io))}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&ti(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ns])&&(null==(t=this.persistence)||null==(t=t.props)||!t[uo]))}_shouldCapturePageleave(){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._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(ds.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(uo,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}_sync_opt_out_with_persistence(){var e,t,r,i,n=this._is_persistence_disabled();(null==(e=this.persistence)?void 0:e._disabled)!==n&&(null==(r=this.persistence)||r.set_disabled(n));(null==(t=this.sessionPersistence)?void 0:t._disabled)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n));return n}opt_in_capturing(e){var t;if("always"!==this.config.cookieless_mode){var r,i,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new pf(this),this.pageViewManager=new b_(this),this.persistence&&(this.sessionPropsManager=new df(this,this.sessionManager,this.persistence)),this.sessionRecording=new Tf(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),ri(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}else ds.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ho,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this._captureInitialPageview())):ds.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Pg.GRANTED?"granted":e===Pg.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Qn?ff(Qn,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){es&&("visible"===es.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:es.title},{send_instantly:!0}),this._visibilityStateListener&&(es.removeEventListener("visibilitychange",this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),ks(es,"visibilitychange",this._visibilityStateListener)))}debug(e){!1===e?(null==Gn||Gn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Gn||Gn.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}))}_shouldDisableFlags(){var e,t,r,i,n,s,o,a=this._originalUserConfig||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ds.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):(r="advanced_disable_decide",i=!1,n=ds,s=(t="advanced_disable_flags")in(e=a)&&!oi(e[t]),o=r in e&&!oi(e[r]),s?e[t]:o?(n&&n.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]):i)}_runBeforeSend(e){if(oi(this.config.before_send))return e;var t=Kr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),oi(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return di(e.event)?ds.warn(n+". This can cause unexpected behavior."):ds.info(n),null}r.properties&&!ti(r.properties)||ds.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}_checkLocalStorageForDebug(e){var t=ui(e)&&!e,r=kg._is_supported()&&"true"===kg._get("ph_debug");return!t&&(!!r||e)}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=bs(e.prototype[t[r]])}(Ff,["identify"]);var Df,Hf={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},Bf=function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e}({}),qf=function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e}({}),Uf=(Df=Rf[Af]=new Ff,function(){function e(){e.done||(e.done=!0,Pf=!1,gs(Rf,(function(e){e._dom_loaded()})))}null!=es&&es.addEventListener?"complete"===es.readyState?e():ks(es,"DOMContentLoaded",e,{capture:!1}):Gn&&ds.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Df);export{su as Compression,Hf as DEFAULT_PRODUCT_TOUR_APPEARANCE,Dl as DisplaySurveyType,Ff as PostHog,Bf as ProductTourEventName,qf as ProductTourEventProperties,Nl as SurveyEventName,Fl as SurveyEventProperties,xl as SurveyEventType,Rl as SurveyPosition,Ll as SurveyQuestionBranchingType,Pl as SurveyQuestionType,Ol as SurveySchedule,Ml as SurveyTabPosition,Al as SurveyType,Tl as SurveyWidgetType,Uf as default,Uf as posthog,nu as severityLevels};
2
2
  //# sourceMappingURL=module.full.no-external.js.map