posthog-js 1.427.3 → 1.428.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 (51) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.js.map +1 -1
  11. package/dist/array.no-external.js +1 -1
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/conversations.js +1 -1
  14. package/dist/conversations.js.map +1 -1
  15. package/dist/customizations.full.js +1 -1
  16. package/dist/customizations.full.js.map +1 -1
  17. package/dist/customizations.js +1 -1
  18. package/dist/customizations.js.map +1 -1
  19. package/dist/dead-clicks-autocapture.js +1 -1
  20. package/dist/dead-clicks-autocapture.js.map +1 -1
  21. package/dist/default-extensions.js +1 -1
  22. package/dist/default-extensions.js.map +1 -1
  23. package/dist/extension-bundles.js +1 -1
  24. package/dist/extension-bundles.js.map +1 -1
  25. package/dist/lazy-recorder.js +1 -1
  26. package/dist/lazy-recorder.js.map +1 -1
  27. package/dist/main.js +1 -1
  28. package/dist/main.js.map +1 -1
  29. package/dist/module.full.js +1 -1
  30. package/dist/module.full.js.map +1 -1
  31. package/dist/module.full.no-external.js +1 -1
  32. package/dist/module.full.no-external.js.map +1 -1
  33. package/dist/module.js +1 -1
  34. package/dist/module.js.map +1 -1
  35. package/dist/module.mjs +1 -1
  36. package/dist/module.mjs.map +1 -1
  37. package/dist/module.no-external.js +1 -1
  38. package/dist/module.no-external.js.map +1 -1
  39. package/dist/module.slim.js +1 -1
  40. package/dist/module.slim.js.map +1 -1
  41. package/dist/module.slim.no-external.js +1 -1
  42. package/dist/module.slim.no-external.js.map +1 -1
  43. package/dist/posthog-recorder.js +1 -1
  44. package/dist/posthog-recorder.js.map +1 -1
  45. package/dist/product-tours.js +1 -1
  46. package/dist/surveys-preview.js +1 -1
  47. package/dist/surveys.js +1 -1
  48. package/lib/package.json +1 -1
  49. package/lib/src/extensions/replay/external/json-ld.js +1 -6
  50. package/lib/src/extensions/replay/external/json-ld.js.map +1 -1
  51. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
- !function(){var e=["retriesPerformedSoFar"],t=["$set_once","$set"];function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function r(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function s(e,t){for(var n=0;t.length>n;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function o(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(null,arguments)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function s(n,i,r,s){var u=Object.create((i&&i.prototype instanceof a?i:a).prototype);return c(u,"_invoke",function(n,i,r){var s,a,u,l=0,c=r||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return s=t,a=0,u=e,h.n=n,o}};function f(n,i){for(a=n,u=i,t=0;!d&&l&&!r&&c.length>t;t++){var r,s=c[t],f=h.p,p=s[2];n>3?(r=p===i)&&(u=s[(a=s[4])?5:(a=3,3)],s[4]=s[5]=e):f>=s[0]&&((r=2>n&&s[1]>f)?(a=0,h.v=i,h.n=s[1]):p>f&&(r=3>n||s[0]>i||i>p)&&(s[4]=n,s[5]=i,h.n=p,a=0))}if(r||n>1)return o;throw d=!0,i}return function(r,c,p){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,p),a=c,u=p;(t=2>a?e:u)||!d;){s||(a?3>a?(a>1&&(h.n=-1),f(a,u)):h.n=u:h.v=u);try{if(l=2,s){if(a||(r="next"),t=s[r]){if(!(t=t.call(s,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,2>a&&(a=0)}else 1===a&&(t=s.return)&&t.call(s),2>a&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);s=e}else if((t=(d=0>h.n)?u:n.call(i,h))!==o)break}catch(t){s=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,r,s),!0),u}var o={};function a(){}function u(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(c(t={},i,function(){return this}),t),f=d.prototype=a.prototype=Object.create(h);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,r,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,c(f,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,r,"GeneratorFunction"),c(f),c(f,r,"Generator"),c(f,i,function(){return this}),c(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:s,m:p}})()}function c(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}c=function(e,t,n,i){function s(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},c(e,t,n,i)}function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return e.length>i?{done:!1,value:e[i++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);t>n;n++)i[n]=e[n];return i}function f(e,t,n,i,r,s,o){try{var a=e[s](o),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function o(e){f(s,i,r,o,a,"next",e)}function a(e){f(s,i,r,o,a,"throw",e)}o(void 0)})}}!function(i,s,a){var c,h,f,_,v,g,m,y,b,w,S,x,k,C,P,E=function(e,t){return function(){return t||(e((t={exports:{}}).exports,t),e=null),t.exports}},F=E(function(e,t){var n=function(e){return e&&e.Math===Math&&e};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}),T=E(function(e,t){t.exports=function(e){try{return!!e()}catch(e){return!0}}}),I=E(function(e,t){t.exports=!T()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),R=E(function(e,t){t.exports=!T()(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}),L=E(function(e,t){var n=R(),i=function(){}.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}}),A=E(function(e){var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t}),M=E(function(e,t){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}}),O=E(function(e,t){var n=R(),i=Function.prototype,r=i.call,s=n&&i.bind.bind(r,r);t.exports=n?s:function(e){return function(){return r.apply(e,arguments)}}}),D=E(function(e,t){var n=O(),i=n({}.toString),r=n("".slice);t.exports=function(e){return r(i(e),8,-1)}}),q=E(function(e,t){var n=O(),i=T(),r=D(),s=Object,o=n("".split);t.exports=i(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===r(e)?o(e,""):s(e)}:s}),B=E(function(e,t){t.exports=function(e){return null==e}}),j=E(function(e,t){var n=B(),i=TypeError;t.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}}),H=E(function(e,t){var n=q(),i=j();t.exports=function(e){return n(i(e))}}),N=E(function(e,t){var n="object"==typeof document&&document.all;t.exports=void 0===n&&void 0!==n?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}}),V=E(function(e,t){var n=N();t.exports=function(e){return"object"==typeof e?null!==e:n(e)}}),z=E(function(e,t){var n=F(),i=N();t.exports=function(e,t){return 2>arguments.length?i(r=n[e])?r:void 0:n[e]&&n[e][t];var r}}),U=E(function(e,t){t.exports=O()({}.isPrototypeOf)}),W=E(function(e,t){var n=F().navigator,i=n&&n.userAgent;t.exports=i?String(i):""}),G=E(function(e,t){var n,i,r=F(),s=W(),o=r.process,a=r.Deno,u=o&&o.versions||a&&a.version,l=u&&u.v8;l&&(i=(n=l.split("."))[0]>0&&4>n[0]?1:+(n[0]+n[1])),!i&&s&&((n=s.match(/Edge\/(\d+)/))&&74>n[1]||(n=s.match(/Chrome\/(\d+)/))&&(i=+n[1])),t.exports=i}),K=E(function(e,t){var n=G(),i=T(),r=F().String;t.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol("symbol detection");return!r(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&41>n})}),Q=E(function(e,t){t.exports=K()&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),Z=E(function(e,t){var n=z(),i=N(),r=U(),s=Q(),o=Object;t.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&r(t.prototype,o(e))}}),J=E(function(e,t){var n=String;t.exports=function(e){try{return n(e)}catch(e){return"Object"}}}),Y=E(function(e,t){var n=N(),i=J(),r=TypeError;t.exports=function(e){if(n(e))return e;throw new r(i(e)+" is not a function")}}),X=E(function(e,t){var n=Y(),i=B();t.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}}),ee=E(function(e,t){var n=L(),i=N(),r=V(),s=TypeError;t.exports=function(e,t){var o,a;if("string"===t&&i(o=e.toString)&&!r(a=n(o,e)))return a;if(i(o=e.valueOf)&&!r(a=n(o,e)))return a;if("string"!==t&&i(o=e.toString)&&!r(a=n(o,e)))return a;throw new s("Can't convert object to primitive value")}}),te=E(function(e,t){t.exports=!1}),ne=E(function(e,t){var n=F(),i=Object.defineProperty;t.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}}),ie=E(function(e,t){var n=te(),i=F(),r=ne(),s="__core-js_shared__",o=t.exports=i[s]||r(s,{});(o.versions||(o.versions=[])).push({version:"3.49.0",mode:n?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),re=E(function(e,t){var n=ie();t.exports=function(e,t){return n[e]||(n[e]=t||{})}}),se=E(function(e,t){var n=j(),i=Object;t.exports=function(e){return i(n(e))}}),oe=E(function(e,t){var n=O(),i=se(),r=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return r(i(e),t)}}),ae=E(function(e,t){var n=O(),i=0,r=Math.random(),s=n(1.1.toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++i+r,36)}}),ue=E(function(e,t){var n=F(),i=re(),r=oe(),s=ae(),o=K(),a=Q(),u=n.Symbol,l=i("wks"),c=a?u.for||u:u&&u.withoutSetter||s;t.exports=function(e){return r(l,e)||(l[e]=o&&r(u,e)?u[e]:c("Symbol."+e)),l[e]}}),le=E(function(e,t){var n=L(),i=V(),r=Z(),s=X(),o=ee(),a=ue(),u=TypeError,l=a("toPrimitive");t.exports=function(e,t){if(!i(e)||r(e))return e;var a,c=s(e,l);if(c){if(void 0===t&&(t="default"),a=n(c,e,t),!i(a)||r(a))return a;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}}),ce=E(function(e,t){var n=le(),i=Z();t.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}}),de=E(function(e,t){var n=F(),i=V(),r=n.document,s=i(r)&&i(r.createElement);t.exports=function(e){return s?r.createElement(e):{}}}),he=E(function(e,t){var n=I(),i=T(),r=de();t.exports=!n&&!i(function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})}),fe=E(function(e){var t=I(),n=L(),i=A(),r=M(),s=H(),o=ce(),a=oe(),u=he(),l=Object.getOwnPropertyDescriptor;e.f=t?l:function(e,t){if(e=s(e),t=o(t),u)try{return l(e,t)}catch(e){}if(a(e,t))return r(!n(i.f,e,t),e[t])}}),pe=E(function(e,t){var n=I(),i=T();t.exports=n&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),_e=E(function(e,t){var n=V(),i=String,r=TypeError;t.exports=function(e){if(n(e))return e;throw new r(i(e)+" is not an object")}}),ve=E(function(e){var t=I(),n=he(),i=pe(),r=_e(),s=ce(),o=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l="enumerable",c="configurable",d="writable";e.f=t?i?function(e,t,n){if(r(e),t=s(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var i=u(e,t);i&&i[d]&&(e[t]=n.value,n={configurable:c in n?n[c]:i[c],enumerable:l in n?n[l]:i[l],writable:!1})}return a(e,t,n)}:a:function(e,t,i){if(r(e),t=s(t),r(i),n)try{return a(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new o("Accessors not supported");return"value"in i&&(e[t]=i.value),e}}),ge=E(function(e,t){var n=I(),i=ve(),r=M();t.exports=n?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}}),me=E(function(e,t){var n=I(),i=oe(),r=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,o=i(r,"name");t.exports={EXISTS:o,PROPER:o&&"something"===function(){}.name,CONFIGURABLE:o&&(!n||n&&s(r,"name").configurable)}}),ye=E(function(e,t){var n=O(),i=N(),r=ie(),s=n(Function.toString);i(r.inspectSource)||(r.inspectSource=function(e){return s(e)}),t.exports=r.inspectSource}),be=E(function(e,t){var n=F(),i=N(),r=n.WeakMap;t.exports=i(r)&&/native code/.test(String(r))}),we=E(function(e,t){var n=re(),i=ae(),r=n("keys");t.exports=function(e){return r[e]||(r[e]=i(e))}}),Se=E(function(e,t){t.exports={}}),xe=E(function(e,t){var n,i,r,s=be(),o=F(),a=V(),u=ge(),l=oe(),c=ie(),d=we(),h=Se(),f="Object already initialized",p=o.TypeError;if(s||c.state){var _=c.state||(c.state=new(0,o.WeakMap));_.get=_.get,_.has=_.has,_.set=_.set,n=function(e,t){if(_.has(e))throw new p(f);return t.facade=e,_.set(e,t),t},i=function(e){return _.get(e)||{}},r=function(e){return _.has(e)}}else{var v=d("state");h[v]=!0,n=function(e,t){if(l(e,v))throw new p(f);return t.facade=e,u(e,v,t),t},i=function(e){return l(e,v)?e[v]:{}},r=function(e){return l(e,v)}}t.exports={set:n,get:i,has:r,enforce:function(e){return r(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var n;if(!a(t)||(n=i(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}),ke=E(function(e,t){var n=O(),i=T(),r=N(),s=oe(),o=I(),a=me().CONFIGURABLE,u=ye(),l=xe(),c=l.enforce,d=l.get,h=String,f=Object.defineProperty,p=n("".slice),_=n("".replace),v=n([].join),g=o&&!i(function(){return 8!==f(function(){},"length",{value:8}).length}),m=String(String).split("String"),y=t.exports=function(e,t,n){"Symbol("===p(h(t),0,7)&&(t="["+_(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!s(e,"name")||a&&e.name!==t)&&(o?f(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&s(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&s(n,"constructor")&&n.constructor?o&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=c(e);return s(i,"source")||(i.source=v(m,"string"==typeof t?t:"")),e};Function.prototype.toString=y(function(){return r(this)&&d(this).source||u(this)},"toString")}),Ce=E(function(e,t){var n=N(),i=ve(),r=ke(),s=ne();t.exports=function(e,t,o,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:t;if(n(o)&&r(o,l,a),a.global)u?e[t]=o:s(t,o);else{try{a.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=o:i.f(e,t,{value:o,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}}),Pe=E(function(e,t){var n=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?i:n)(t)}}),Ee=E(function(e,t){var n=Pe();t.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}}),Fe=E(function(e,t){var n=Ee(),i=Math.max,r=Math.min;t.exports=function(e,t){var s=n(e);return 0>s?i(s+t,0):r(s,t)}}),Te=E(function(e,t){var n=Ee(),i=Math.min;t.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}}),Ie=E(function(e,t){var n=Te();t.exports=function(e){return n(e.length)}}),Re=E(function(e,t){var n=H(),i=Fe(),r=Ie(),s=function(e){return function(t,s,o){var a=n(t),u=r(a);if(0===u)return!e&&-1;var l,c=i(o,u);if(e&&s!=s){for(;u>c;)if((l=a[c++])!=l)return!0}else for(;u>c;c++)if((e||c in a)&&a[c]===s)return e||c||0;return!e&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}}),Le=E(function(e,t){var n=O(),i=oe(),r=H(),s=Re().indexOf,o=Se(),a=n([].push);t.exports=function(e,t){var n,u=r(e),l=0,c=[];for(n in u)!i(o,n)&&i(u,n)&&a(c,n);for(;t.length>l;)i(u,n=t[l++])&&(~s(c,n)||a(c,n));return c}}),Ae=E(function(e,t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),Me=E(function(e){var t=Le(),n=Ae().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}}),Oe=E(function(e){e.f=Object.getOwnPropertySymbols}),$e=E(function(e,t){var n=z(),i=O(),r=Me(),s=Oe(),o=_e(),a=i([].concat);t.exports=n("Reflect","ownKeys")||function(e){var t=r.f(o(e)),n=s.f;return n?a(t,n(e)):t}}),De=E(function(e,t){var n=oe(),i=$e(),r=fe(),s=ve();t.exports=function(e,t,o){for(var a=i(t),u=s.f,l=r.f,c=0;a.length>c;c++){var d=a[c];n(e,d)||o&&n(o,d)||u(e,d,l(t,d))}}}),qe=E(function(e,t){var n=T(),i=N(),r=/#|\.prototype\./,s=function(e,t){var r=a[o(e)];return r===l||r!==u&&(i(t)?n(t):!!t)},o=s.normalize=function(e){return String(e).replace(r,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s}),Be=E(function(e,t){var n=F(),i=fe().f,r=ge(),s=Ce(),o=ne(),a=De(),u=qe();t.exports=function(e,t){var l,c,d,h,f,p=e.target,_=e.global,v=e.stat;if(l=_?n:v?n[p]||o(p,{}):n[p]&&n[p].prototype)for(c in t){if(h=t[c],d=e.dontCallGetSet?(f=i(l,c))&&f.value:l[c],!u(_?c:p+(v?".":"#")+c,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;a(h,d)}(e.sham||d&&d.sham)&&r(h,"sham",!0),s(l,c,h,e)}}}),je=E(function(e,t){t.exports=!T()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),He=E(function(e,t){var n=oe(),i=N(),r=se(),s=we(),o=je(),a=s("IE_PROTO"),u=Object,l=u.prototype;t.exports=o?u.getPrototypeOf:function(e){var t=r(e);if(n(t,a))return t[a];var s=t.constructor;return i(s)&&t instanceof s?s.prototype:t instanceof u?l:null}}),Ne=E(function(e,t){var n=Le(),i=Ae();t.exports=Object.keys||function(e){return n(e,i)}}),Ve=E(function(e,t){var n=I(),i=T(),r=O(),s=He(),o=Ne(),a=H(),u=r(A().f),l=r([].push),c=n&&i(function(){var e=Object.create(null);return e[2]=2,!u(e,2)}),d=function(e){return function(t){for(var i,r=a(t),d=o(r),h=c&&null===s(r),f=d.length,p=0,_=[];f>p;)i=d[p++],n&&!(h?i in r:u(r,i))||l(_,e?[i,r[i]]:r[i]);return _}};t.exports={entries:d(!0),values:d(!1)}}),ze=E(function(){var $=Be(),e=Ve().entries;$({target:"Object",stat:!0},{entries:function(t){return e(t)}})}),Ue=E(function(e,t){t.exports=F()}),We=E(function(e,t){ze(),t.exports=Ue().Object.entries}),Ge=E(function(e,t){t.exports=We()}),Ke=E(function(e,t){t.exports=Ge()}),Qe=E(function(e,t){t.exports=Ke()}),Ze=E(function(e,t){t.exports=Qe()}),Je=E(function(e){var t=I(),n=pe(),i=ve(),r=_e(),s=H(),o=Ne();e.f=t&&!n?Object.defineProperties:function(e,t){r(e);for(var n,a=s(t),u=o(t),l=u.length,c=0;l>c;)i.f(e,n=u[c++],a[n]);return e}}),Ye=E(function(e,t){t.exports=z()("document","documentElement")}),Xe=E(function(e,t){var n,i=_e(),r=Je(),s=Ae(),o=Se(),a=Ye(),u=de(),l=we(),c="prototype",d="script",h=l("IE_PROTO"),f=function(){},p=function(e){return"<"+d+">"+e+"</"+d+">"},_=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;v="undefined"!=typeof document?document.domain&&n?_(n):(t=u("iframe"),i="java"+d+":",t.style.display="none",a.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):_(n);for(var r=s.length;r--;)delete v[c][s[r]];return v()};o[h]=!0,t.exports=Object.create||function(e,t){var n;return null!==e?(f[c]=i(e),n=new f,f[c]=null,n[h]=e):n=v(),void 0===t?n:r.f(n,t)}}),et=E(function(e,t){var n=ue(),i=Xe(),r=ve().f,s=n("unscopables"),o=Array.prototype;void 0===o[s]&&r(o,s,{configurable:!0,value:i(null)}),t.exports=function(e){o[s][e]=!0}}),tt=E(function(e,t){t.exports={}}),nt=E(function(e,t){var n,i,r,s=T(),o=N(),a=V(),u=Xe(),l=He(),c=Ce(),d=ue(),h=te(),f=d("iterator"),p=!1;[].keys&&("next"in(r=[].keys())?(i=l(l(r)))!==Object.prototype&&(n=i):p=!0),!a(n)||s(function(){var e={};return n[f].call(e)!==e})?n={}:h&&(n=u(n)),o(n[f])||c(n,f,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}}),it=E(function(e,t){var n=ve().f,i=oe(),r=ue()("toStringTag");t.exports=function(e,t,s){e&&!s&&(e=e.prototype),e&&!i(e,r)&&n(e,r,{configurable:!0,value:t})}}),rt=E(function(e,t){var n=nt().IteratorPrototype,i=Xe(),r=M(),s=it(),o=tt(),a=function(){return this};t.exports=function(e,t,u,l){var c=t+" Iterator";return e.prototype=i(n,{next:r(+!l,u)}),s(e,c,!1,!0),o[c]=a,e}}),st=E(function(e,t){var n=O(),i=Y();t.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}}),ot=E(function(e,t){var n=V();t.exports=function(e){return n(e)||null===e}}),at=E(function(e,t){var n=ot(),i=String,r=TypeError;t.exports=function(e){if(n(e))return e;throw new r("Can't set "+i(e)+" as a prototype")}}),ut=E(function(e,t){var n=st(),i=V(),r=j(),s=at();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,o={};try{(e=n(Object.prototype,"__proto__","set"))(o,[]),t=o instanceof Array}catch(e){}return function(n,o){return r(n),s(o),i(n)?(t?e(n,o):n.__proto__=o,n):n}}():void 0)}),lt=E(function(e,t){var $=Be(),n=L(),i=te(),r=me(),s=N(),o=rt(),a=He(),u=ut(),l=it(),c=ge(),d=Ce(),h=ue(),f=tt(),p=nt(),_=r.PROPER,v=r.CONFIGURABLE,g=p.IteratorPrototype,m=p.BUGGY_SAFARI_ITERATORS,y=h("iterator"),b="keys",w="values",S="entries",x=function(){return this};t.exports=function(e,t,r,h,p,k,C){o(r,t,h);var P,E,F,T=function(e){if(e===p&&M)return M;if(!m&&e&&e in L)return L[e];switch(e){case b:case w:case S:return function(){return new r(this,e)}}return function(){return new r(this)}},I=t+" Iterator",R=!1,L=e.prototype,A=L[y]||L["@@iterator"]||p&&L[p],M=!m&&A||T(p),O="Array"===t&&L.entries||A;if(O&&(P=a(O.call(new e)))!==Object.prototype&&P.next&&(i||a(P)===g||(u?u(P,g):s(P[y])||d(P,y,x)),l(P,I,!0,!0),i&&(f[I]=x)),_&&p===w&&A&&A.name!==w&&(!i&&v?c(L,"name",w):(R=!0,M=function(){return n(A,this)})),p)if(E={values:T(w),keys:k?M:T(b),entries:T(S)},C)for(F in E)(m||R||!(F in L))&&d(L,F,E[F]);else $({target:t,proto:!0,forced:m||R},E);return i&&!C||L[y]===M||d(L,y,M,{name:p}),f[t]=M,E}}),ct=E(function(e,t){t.exports=function(e,t){return{value:e,done:t}}}),dt=E(function(e,t){var n=H(),i=et(),r=tt(),s=xe(),o=ve().f,a=lt(),u=ct(),l=te(),c=I(),d="Array Iterator",h=s.set,f=s.getterFor(d);t.exports=a(Array,"Array",function(e,t){h(this,{type:d,target:n(e),index:0,kind:t})},function(){var e=f(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,u(void 0,!0);switch(e.kind){case"keys":return u(n,!1);case"values":return u(t[n],!1)}return u([n,t[n]],!1)},"values");var p=r.Arguments=r.Array;if(i("keys"),i("values"),i("entries"),!l&&c&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(e){}}),ht=E(function(e,t){var n=D(),i=O();t.exports=function(e){if("Function"===n(e))return i(e)}}),ft=E(function(e,t){var n=ht(),i=Y(),r=R(),s=n(n.bind);t.exports=function(e,t){return i(e),void 0===t?e:r?s(e,t):function(){return e.apply(t,arguments)}}}),pt=E(function(e,t){var n=ue(),i=tt(),r=n("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(i.Array===e||s[r]===e)}}),_t=E(function(e,t){var n={};n[ue()("toStringTag")]="z",t.exports="[object z]"===String(n)}),vt=E(function(e,t){var n=_t(),i=N(),r=D(),s=ue()("toStringTag"),o=Object,a="Arguments"===r(function(){return arguments}());t.exports=n?r:function(e){var t,n,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=o(e),s))?n:a?r(t):"Object"===(u=r(t))&&i(t.callee)?"Arguments":u}}),gt=E(function(e,t){var n=vt(),i=X(),r=B(),s=tt(),o=ue()("iterator");t.exports=function(e){if(!r(e))return i(e,o)||i(e,"@@iterator")||s[n(e)]}}),mt=E(function(e,t){var n=L(),i=Y(),r=_e(),s=J(),o=gt(),a=TypeError;t.exports=function(e,t){var u=2>arguments.length?o(e):t;if(i(u))return r(n(u,e));throw new a(s(e)+" is not iterable")}}),yt=E(function(e,t){var n=L(),i=_e(),r=X();t.exports=function(e,t,s){var o,a;i(e);try{if(!(o=r(e,"return"))){if("throw"===t)throw s;return s}o=n(o,e)}catch(e){a=!0,o=e}if("throw"===t)throw s;if(a)throw o;return i(o),s}}),bt=E(function(e,t){var n=ft(),i=L(),r=_e(),s=J(),o=pt(),a=Ie(),u=U(),l=mt(),c=gt(),d=yt(),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},p=f.prototype;t.exports=function(e,t,_){var v,g,m,y,b,w,S,x=!(!_||!_.AS_ENTRIES),k=!(!_||!_.IS_RECORD),C=!(!_||!_.IS_ITERATOR),P=!(!_||!_.INTERRUPTED),E=n(t,_&&_.that),F=function(e){var t=v;return v=void 0,t&&d(t,"normal"),new f(!0,e)},T=function(e){return x?(r(e),P?E(e[0],e[1],F):E(e[0],e[1])):P?E(e,F):E(e)};if(k)v=e.iterator;else if(C)v=e;else{if(!(g=c(e)))throw new h(s(e)+" is not iterable");if(o(g)){for(m=0,y=a(e);y>m;m++)if((b=T(e[m]))&&u(p,b))return b;return new f(!1)}v=l(e,g)}for(w=k?e.next:v.next;!(S=i(w,v)).done;){var I=S.value;try{b=T(I)}catch(e){if(!v)throw e;d(v,"throw",e)}if("object"==typeof b&&b&&u(p,b))return b}return new f(!1)}}),wt=E(function(e,t){var n=I(),i=ve(),r=M();t.exports=function(e,t,s){n?i.f(e,t,r(0,s)):e[t]=s}}),St=E(function(){var $=Be(),e=bt(),t=wt();$({target:"Object",stat:!0},{fromEntries:function(n){var i={};return e(n,function(e,n){t(i,e,n)},{AS_ENTRIES:!0}),i}})}),xt=E(function(e,t){dt(),St(),t.exports=Ue().Object.fromEntries}),kt=E(function(e,t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),Ct=E(function(e,t){var n=de()("span").classList,i=n&&n.constructor&&n.constructor.prototype;t.exports=i===Object.prototype?void 0:i}),Pt=E(function(){var e=F(),t=kt(),n=Ct(),i=dt(),r=ge(),s=it(),o=ue()("iterator"),a=i.values,u=function(e,n){if(e){if(e[o]!==a)try{r(e,o,a)}catch(t){e[o]=a}if(s(e,n,!0),t[n])for(var u in i)if(e[u]!==i[u])try{r(e,u,i[u])}catch(t){e[u]=i[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);u(n,"DOMTokenList")}),Et=E(function(e,t){var n=xt();Pt(),t.exports=n}),Ft=E(function(e,t){t.exports=Et()}),Tt=E(function(e,t){t.exports=Ft()}),It=E(function(e,t){t.exports=Tt()}),Rt=E(function(e,t){var n=V(),i=ge();t.exports=function(e,t){n(t)&&"cause"in t&&i(e,"cause",t.cause)}}),Lt=E(function(e,t){var n=O(),i=Error,r=n("".replace),s=String(new i("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,a=o.test(s);t.exports=function(e,t){if(a&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=r(e,o,"");return e}}),At=E(function(e,t){var n=T(),i=M();t.exports=!n(function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)})}),Mt=E(function(e,t){var n=ge(),i=Lt(),r=At(),s=Error.captureStackTrace;t.exports=function(e,t,o,a){r&&(s?s(e,t):n(e,"stack",i(o,a)))}}),Ot=E(function(e,t){var n=vt(),i=String;t.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}}),$t=E(function(e,t){var n=Ot();t.exports=function(e,t){return void 0===e?2>arguments.length?"":t:n(e)}}),Dt=E(function(){var $=Be(),e=U(),t=He(),n=ut(),i=De(),r=Xe(),s=ge(),o=M(),a=Rt(),u=Mt(),l=bt(),c=$t(),d=ue()("toStringTag"),h=Error,f=[].push,p=function(i,o){var v,g=e(_,this);n?v=n(new h,g?t(this):_):(v=g?this:r(_),s(v,d,"Error")),void 0!==o&&s(v,"message",c(o)),u(v,p,v.stack,1),arguments.length>2&&a(v,arguments[2]);var m=[];return l(i,f,{that:m}),s(v,"errors",m),v};n?n(p,h):i(p,h,{name:!0});var _=p.prototype=r(h.prototype,{constructor:o(1,p),message:o(1,""),name:o(1,"AggregateError")});$({global:!0,constructor:!0,arity:2},{AggregateError:p})}),qt=E(function(){Dt()}),Bt=E(function(e,t){var n=_t(),i=vt();t.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}}),jt=E(function(){var e=_t(),t=Ce(),n=Bt();e||t(Object.prototype,"toString",n,{unsafe:!0})}),Ht=E(function(e,t){var n=F(),i=W(),r=D(),s=function(e){return i.slice(0,e.length)===e};t.exports=s("Bun/")?"BUN":s("Cloudflare-Workers")?"CLOUDFLARE":s("Deno/")?"DENO":s("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===r(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"}),Nt=E(function(e,t){t.exports="NODE"===Ht()}),Vt=E(function(e,t){var n=ke(),i=ve();t.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}}),zt=E(function(e,t){var n=z(),i=Vt(),r=ue(),s=I(),o=r("species");t.exports=function(e){var t=n(e);s&&t&&!t[o]&&i(t,o,{configurable:!0,get:function(){return this}})}}),Ut=E(function(e,t){var n=U(),i=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}}),Wt=E(function(e,t){var n=O(),i=T(),r=N(),s=vt(),o=z(),a=ye(),u=function(){},l=o("Reflect","construct"),c=/^\s*(?:class|function)\b/,d=n(c.exec),h=!c.test(u),f=function(e){if(!r(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},p=function(e){if(!r(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!d(c,a(e))}catch(e){return!0}};p.sham=!0,t.exports=!l||i(function(){var e;return f(f.call)||!f(Object)||!f(function(){e=!0})||e})?p:f}),Gt=E(function(e,t){var n=Wt(),i=J(),r=TypeError;t.exports=function(e){if(n(e))return e;throw new r(i(e)+" is not a constructor")}}),Kt=E(function(e,t){var n=_e(),i=Gt(),r=B(),s=ue()("species");t.exports=function(e,t){var o,a=n(e).constructor;return void 0===a||r(o=n(a)[s])?t:i(o)}}),Qt=E(function(e,t){var n=R(),i=Function.prototype,r=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(r):function(){return s.apply(r,arguments)})}),Zt=E(function(e,t){t.exports=O()([].slice)}),Jt=E(function(e,t){var n=TypeError;t.exports=function(e,t){if(t>e)throw new n("Not enough arguments");return e}}),Yt=E(function(e,t){var n=W();t.exports=/ipad|iphone|ipod/i.test(n)&&/applewebkit/i.test(n)}),Xt=E(function(e,t){var n,i,r,s,o=F(),a=Qt(),u=ft(),l=N(),c=oe(),d=T(),h=Ye(),f=Zt(),p=de(),_=Jt(),v=Yt(),g=Nt(),m=o.setImmediate,y=o.clearImmediate,b=o.process,w=o.Dispatch,S=o.Function,x=o.MessageChannel,k=o.String,C=0,P={},E="onreadystatechange";d(function(){n=o.location});var I=function(e){if(c(P,e)){var t=P[e];delete P[e],t()}},R=function(e){return function(){I(e)}},L=function(e){I(e.data)},A=function(e){o.postMessage(k(e),n.protocol+"//"+n.host)};m&&y||(m=function(e){_(arguments.length,1);var t=l(e)?e:S(e),n=f(arguments,1);return P[++C]=function(){a(t,void 0,n)},i(C),C},y=function(e){delete P[e]},g?i=function(e){b.nextTick(R(e))}:w&&w.now?i=function(e){w.now(R(e))}:x&&!v?(s=(r=new x).port2,r.port1.onmessage=L,i=u(s.postMessage,s)):o.addEventListener&&l(o.postMessage)&&!o.importScripts&&n&&"file:"!==n.protocol&&!d(A)?(i=A,o.addEventListener("message",L,!1)):i=E in p("script")?function(e){h.appendChild(p("script"))[E]=function(){h.removeChild(this),I(e)}}:function(e){setTimeout(R(e),0)}),t.exports={set:m,clear:y}}),en=E(function(e,t){var n=F(),i=I(),r=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!i)return n[e];var t=r(n,e);return t&&t.value}}),tn=E(function(e,t){var n=function(){this.head=null,this.tail=null};n.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},t.exports=n}),nn=E(function(e,t){var n=W();t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble}),rn=E(function(e,t){var n=W();t.exports=/web0s(?!.*chrome)/i.test(n)}),sn=E(function(e,t){var n,i,r,s,o,a=F(),u=en(),l=ft(),c=Xt().set,d=tn(),h=Yt(),f=nn(),p=rn(),_=Nt(),v=a.MutationObserver||a.WebKitMutationObserver,g=a.document,m=a.process,y=a.Promise,b=u("queueMicrotask");if(!b){var w=new d,S=function(){var e,t;for(_&&(e=m.domain)&&e.exit();t=w.get();)try{t()}catch(e){throw w.head&&n(),e}e&&e.enter()};h||_||p||!v||!g?!f&&y&&y.resolve?((s=y.resolve(void 0)).constructor=y,o=l(s.then,s),n=function(){o(S)}):_?n=function(){m.nextTick(S)}:(c=l(c,a),n=function(){c(S)}):(i=!0,r=g.createTextNode(""),new v(S).observe(r,{characterData:!0}),n=function(){r.data=i=!i}),b=function(e){w.head||n(),w.add(e)}}t.exports=b}),on=E(function(e,t){t.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}}),an=E(function(e,t){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}}),un=E(function(e,t){t.exports=F().Promise}),ln=E(function(e,t){var n=F(),i=un(),r=N(),s=qe(),o=ye(),a=ue(),u=Ht(),l=te(),c=G(),d=i&&i.prototype,h=a("species"),f=!1,p=r(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:s("Promise",function(){var e=o(i),t=e!==String(i);if(!t&&66===c)return!0;if(l&&(!d.catch||!d.finally))return!0;if(!c||51>c||!/native code/.test(e)){var n=new i(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((n.constructor={})[h]=r,!(f=n.then(function(){})instanceof r))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||p)}),REJECTION_EVENT:p,SUBCLASSING:f}}),cn=E(function(e,t){var n=Y(),i=TypeError,r=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)};t.exports.f=function(e){return new r(e)}}),dn=E(function(){var e,t,n,i,$=Be(),r=te(),s=Nt(),o=F(),a=Ue(),u=L(),l=Ce(),c=ut(),d=it(),h=zt(),f=Y(),p=N(),_=V(),v=Ut(),g=Kt(),m=Xt().set,y=sn(),b=on(),w=an(),S=tn(),x=xe(),k=un(),C=ln(),P=cn(),E="Promise",T=C.CONSTRUCTOR,I=C.REJECTION_EVENT,R=C.SUBCLASSING,A=x.getterFor(E),M=x.set,O=k&&k.prototype,D=k,q=O,B=o.TypeError,j=o.document,H=o.process,z=P.f,U=z,W=!!(j&&j.createEvent&&o.dispatchEvent),G="unhandledrejection",K=function(e){var t;return!(!_(e)||!p(t=e.then))&&t},Q=function(e,t){var n,i,r,s=t.value,o=1===t.state,a=o?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{a?(o||(2===t.rejection&&ne(t),t.rejection=1),!0===a?n=s:(d&&d.enter(),n=a(s),d&&(d.exit(),r=!0)),n===e.promise?c(new B("Promise-chain cycle")):(i=K(n))?u(i,n,l,c):l(n)):c(s)}catch(e){d&&!r&&d.exit(),c(e)}},Z=function(e,t){e.notified||(e.notified=!0,y(function(){for(var n,i=e.reactions;n=i.get();)Q(n,e);e.notified=!1,t&&!e.rejection&&X(e)}))},J=function(e,t,n){var i,r;W?((i=j.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),o.dispatchEvent(i)):i={promise:t,reason:n},!I&&(r=o["on"+e])?r(i):e===G&&b("Unhandled promise rejection",n)},X=function(e){u(m,o,function(){var t,n=e.facade,i=e.value;if(ee(e)&&(t=w(function(){s?H.emit("unhandledRejection",i,n):J(G,n,i)}),e.rejection=s||ee(e)?2:1,t.error))throw t.value})},ee=function(e){return 1!==e.rejection&&!e.parent},ne=function(e){u(m,o,function(){var t=e.facade;s?H.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)})},ie=function(e,t,n){return function(i){e(t,i,n)}},re=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Z(e,!0))},se=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new B("Promise can't be resolved itself");var i=K(t);i?y(function(){var n={done:!1};try{u(i,t,ie(se,n,e),ie(re,n,e))}catch(t){re(n,t,e)}}):(e.value=t,e.state=1,Z(e,!1))}catch(t){re({done:!1},t,e)}}};if(T&&(D=function(t){v(this,q),f(t),u(e,this);var n=A(this);try{t(ie(se,n),ie(re,n))}catch(e){re(n,e)}},(e=function(e){M(this,{type:E,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:null})}).prototype=l(q=D.prototype,"then",function(e,t){var n=A(this),i=z(g(this,D));return n.parent=!0,i.ok=!p(e)||e,i.fail=p(t)&&t,i.domain=s?H.domain:void 0,0===n.state?n.reactions.add(i):y(function(){Q(i,n)}),i.promise}),t=function(){var t=new e,n=A(t);this.promise=t,this.resolve=ie(se,n),this.reject=ie(re,n)},P.f=z=function(e){return e===D||e===n?new t(e):U(e)},!r&&p(k)&&O!==Object.prototype)){i=O.then,R||l(O,"then",function(e,t){var n=this;return new D(function(e,t){u(i,n,e,t)}).then(e,t)},{unsafe:!0});try{delete O.constructor}catch(e){}c&&c(O,q)}$({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:D}),n=a.Promise,d(D,E,!1,!0),h(E)}),hn=E(function(e,t){var n=ue()("iterator"),i=!1;try{var r=0,s={next:function(){return{done:!!r++}},return:function(){i=!0}};s[n]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}t.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var s={};s[n]=function(){return{next:function(){return{done:r=!0}}}},e(s)}catch(e){}return r}}),fn=E(function(e,t){var n=un(),i=hn();t.exports=ln().CONSTRUCTOR||!i(function(e){n.all(e).then(void 0,function(){})})}),pn=E(function(){var $=Be(),e=L(),t=Y(),n=cn(),i=an(),r=bt();$({target:"Promise",stat:!0,forced:fn()},{all:function(s){var o=this,a=n.f(o),u=a.resolve,l=a.reject,c=i(function(){var n=t(o.resolve),i=[],a=0,c=1;r(s,function(t){var r=a++,s=!1;c++,e(n,o,t).then(function(e){s||(s=!0,i[r]=e,--c||u(i))},l)}),--c||u(i)});return c.error&&l(c.value),a.promise}})}),_n=E(function(){var $=Be(),e=te(),t=ln().CONSTRUCTOR,n=un(),i=z(),r=N(),s=Ce(),o=n&&n.prototype;if($({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(e){return this.then(void 0,e)}}),!e&&r(n)){var a=i("Promise").prototype.catch;o.catch!==a&&s(o,"catch",a,{unsafe:!0})}}),vn=E(function(){var $=Be(),e=L(),t=Y(),n=cn(),i=an(),r=bt();$({target:"Promise",stat:!0,forced:fn()},{race:function(s){var o=this,a=n.f(o),u=a.reject,l=i(function(){var n=t(o.resolve);r(s,function(t){e(n,o,t).then(a.resolve,u)})});return l.error&&u(l.value),a.promise}})}),gn=E(function(){var $=Be(),e=cn();$({target:"Promise",stat:!0,forced:ln().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}),mn=E(function(e,t){var n=_e(),i=V(),r=cn();t.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var s=r.f(e);return(0,s.resolve)(t),s.promise}}),yn=E(function(){var $=Be(),e=z(),t=te(),n=un(),i=ln().CONSTRUCTOR,r=mn(),s=e("Promise"),o=t&&!i;$({target:"Promise",stat:!0,forced:t||i},{resolve:function(e){return r(o&&this===s?n:this,e)}})}),bn=E(function(){dn(),pn(),_n(),vn(),gn(),yn()}),wn=E(function(){var $=Be(),e=L(),t=Y(),n=cn(),i=an(),r=bt();$({target:"Promise",stat:!0,forced:fn()},{allSettled:function(s){var o=this,a=n.f(o),u=a.resolve,l=a.reject,c=i(function(){var n=t(o.resolve),i=[],a=0,l=1;r(s,function(t){var r=a++,s=!1;l++,e(n,o,t).then(function(e){s||(s=!0,i[r]={status:"fulfilled",value:e},--l||u(i))},function(e){s||(s=!0,i[r]={status:"rejected",reason:e},--l||u(i))})}),--l||u(i)});return c.error&&l(c.value),a.promise}})}),Sn=E(function(){var $=Be(),e=L(),t=Y(),n=z(),i=cn(),r=an(),s=bt(),o=fn(),a="No one promise resolved";$({target:"Promise",stat:!0,forced:o},{any:function(o){var u=this,l=n("AggregateError"),c=i.f(u),d=c.resolve,h=c.reject,f=r(function(){var n=t(u.resolve),i=[],r=0,c=1,f=!1;s(o,function(t){var s=r++,o=!1;c++,e(n,u,t).then(function(e){o||f||(f=!0,d(e))},function(e){o||f||(o=!0,i[s]=e,--c||h(new l(i,a)))})}),--c||h(new l(i,a))});return f.error&&h(f.value),c.promise}})}),xn=E(function(){var $=Be(),e=F(),t=Qt(),n=Zt(),i=cn(),r=Y(),s=an(),o=e.Promise,a=!1;$({target:"Promise",stat:!0,forced:!o||!o.try||s(function(){o.try(function(e){a=8===e},8)}).error||!a},{try:function(e){var o=arguments.length>1?n(arguments,1):[],a=i.f(this),u=s(function(){return t(r(e),void 0,o)});return(u.error?a.reject:a.resolve)(u.value),a.promise}})}),kn=E(function(){var $=Be(),e=cn();$({target:"Promise",stat:!0},{withResolvers:function(){var t=e.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})}),Cn=E(function(){var $=Be(),e=te(),t=un(),n=T(),i=z(),r=N(),s=Kt(),o=mn(),a=Ce(),u=t&&t.prototype;if($({target:"Promise",proto:!0,real:!0,forced:!!t&&n(function(){u.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=s(this,i("Promise")),n=r(e);return this.then(n?function(n){return o(t,e()).then(function(){return n})}:e,n?function(n){return o(t,e()).then(function(){throw n})}:e)}}),!e&&r(t)){var l=i("Promise").prototype.finally;u.finally!==l&&a(u,"finally",l,{unsafe:!0})}}),Pn=E(function(e,t){var n=O(),i=Ee(),r=Ot(),s=j(),o=n("".charAt),a=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,n){var l,c,d=r(s(t)),h=i(n),f=d.length;return 0>h||h>=f?e?"":void 0:55296>(l=a(d,h))||l>56319||h+1===f||56320>(c=a(d,h+1))||c>57343?e?o(d,h):l:e?u(d,h,h+2):c-56320+(l-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}}),En=E(function(){var e=Pn().charAt,t=Ot(),n=xe(),i=lt(),r=ct(),s="String Iterator",o=n.set,a=n.getterFor(s);i(String,"String",function(e){o(this,{type:s,string:t(e),index:0})},function(){var t,n=a(this),i=n.string,s=n.index;return i.length>s?(t=e(i,s),n.index+=t.length,r(t,!1)):r(void 0,!0)})}),Fn=E(function(e,t){qt(),dt(),jt(),bn(),wn(),Sn(),xn(),kn(),Cn(),En(),t.exports=Ue().Promise}),Tn=E(function(e,t){var n=Fn();Pt(),t.exports=n}),In=E(function(){xn()}),Rn=E(function(){kn()}),Ln=E(function(e,t){var n=Tn();In(),Rn(),t.exports=n}),An=E(function(){qt()}),Mn=E(function(){wn()}),On=E(function(){Sn()}),$n=E(function(e,t){var n=Ln();An(),Mn(),On(),t.exports=n}),Dn=E(function(e,t){t.exports=$n()});Ze(),It(),Dn();var qn,Bn,jn,Hn,Nn={},Vn=[],zn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Un=Array.isArray;function Wn(e,t){for(var n in t)e[n]=t[n];return e}function Gn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Kn(e,t,n){var i,r,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?r=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?c.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return Qn(e,o,i,r,null)}function Qn(e,t,n,i,r){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++f:r,__i:-1,__u:0};return null==r&&null!=h.vnode&&h.vnode(s),s}function Zn(e){return e.children}function Jn(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var n;e.__k.length>t;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?$(e):null}function Yn(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],r=[],s=Wn({},t);s.__v=t.__v+1,h.vnode&&h.vnode(s),li(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,null==n?$(t):n,!!(32&t.__u),r),s.__v=t.__v,s.__.__k[s.__i]=s,di(i,s,r),t.__e=t.__=null,s.__e!=n&&Xn(s)}}function Xn(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Xn(e)}function ei(e){(!e.__d&&(e.__d=!0)&&_.push(e)&&!ti.__r++||v!=h.debounceRendering)&&((v=h.debounceRendering)||g)(ti)}function ti(){try{for(var e,t=1;_.length;)_.length>t&&_.sort(m),e=_.shift(),t=_.length,Yn(e)}finally{_.length=ti.__r=0}}function ni(e,t,n,i,r,s,o,a,u,l,c){var d,h,f,p,_,v,g,m=i&&i.__k||Vn,y=t.length;for(u=ii(n,t,m,u,y),d=0;y>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&m[f.__i]||Nn,f.__i=d,v=li(e,f,h,r,s,o,a,u,l,c),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&pi(h.ref,null,f),c.push(f.ref,f.__c||p,f)),null==_&&null!=p&&(_=p),(g=!!(4&f.__u))||h.__k===f.__k?(u=ri(f,u,e,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==v?u=v:p&&(u=p.nextSibling),f.__u&=-7);return n.__e=_,u}function ii(e,t,n,i,r){var s,o,a,u,l,c=n.length,d=c,h=0;for(e.__k=new Array(r),s=0;r>s;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]=Qn(null,o,null,null,null):Un(o)?o=e.__k[s]=Qn(Zn,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=Qn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,u=s+h,o.__=e,o.__b=e.__b+1,a=null,-1!=(l=o.__i=si(o,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(r>c?h--:c>r&&h++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;c>s;s++)null!=(a=n[s])&&!(2&a.__u)&&(a.__e==i&&(i=$(a)),_i(a,a));return i}function ri(e,t,n,i){var r,s;if("function"==typeof e.type){for(r=e.__k,s=0;r&&r.length>s;s++)r[s]&&(r[s].__=e,t=ri(r[s],t,n,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=$(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function si(e,t,n,i){var r,s,o,a=e.key,u=e.type,l=t[n],c=null!=l&&!(2&l.__u);if(null===l&&null==a||c&&a==l.key&&u==l.type)return n;if(i>(c?1:0))for(r=n-1,s=n+1;r>=0||t.length>s;)if(null!=(l=t[o=0>r?s++:r--])&&!(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function oi(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||zn.test(t)?n:n+"px"}function ai(e,t,n,i,r){var s,o;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||oi(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||oi(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(S,"$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]=n,n?i?n[w]=i[w]:(n[w]=x,e.addEventListener(t,s?C:k,s)):e.removeEventListener(t,s?C:k,s);else{if("http://www.w3.org/2000/svg"==r)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==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function ui(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[b])t[b]=x++;else if(n[w]>t[b])return;return n(h.event?h.event(t):t)}}}function li(e,t,n,i,r,s,o,a,u,l){var c,d,f,p,_,v,g,m,y,b,$,w,S,x,k,C,P=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),s=[a=t.__e=n.__e]),(c=h.__b)&&c(t);e:if("function"==typeof P){d=o.length;try{if(y=t.props,b=P.prototype&&P.prototype.render,$=(c=P.contextType)&&i[c.__c],w=c?$?$.props.value:c.__:i,n.__c?m=(f=t.__c=n.__c).__=f.__E:(b?t.__c=f=new P(y,w):(t.__c=f=new Jn(y,w),f.constructor=P,f.render=vi),$&&$.sub(f),f.state||(f.state={}),f.__n=i,p=f.__d=!0,f.__h=[],f._sb=[]),b&&null==f.__s&&(f.__s=f.state),b&&null!=P.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=Wn({},f.__s)),Wn(f.__s,P.getDerivedStateFromProps(y,f.__s))),_=f.props,v=f.state,f.__v=t,p)b&&null==P.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),b&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(b&&null==P.getDerivedStateFromProps&&y!==_&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,w),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,w)){t.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),Vn.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,w),b&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(_,v,g)})}if(f.context=w,f.props=y,f.__P=e,f.__e=!1,S=h.__r,x=0,b)f.state=f.__s,f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),Vn.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++x);f.state=f.__s,null!=f.getChildContext&&(i=Wn(Wn({},i),f.getChildContext())),b&&!p&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(_,v)),k=null!=c&&c.type===Zn&&null==c.key?hi(c.props.children):c,a=ni(e,Un(k)?k:[k],t,n,i,r,s,o,a,u,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),m&&(f.__E=f.__=null)}catch(e){if(o.length=d,t.__v=null,u||null!=s)if(e.then){for(t.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),t.__e=a}else{if(null!=s)for(C=s.length;C--;)Gn(s[C]);ci(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||ci(t);h.__e(e,t,n)}}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=fi(n.__e,t,n,i,r,s,o,u,l);return(c=h.diffed)&&c(t),128&t.__u?void 0:a}function ci(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ci))}function di(e,t,n){for(var i=0;n.length>i;i++)pi(n[i],n[++i],n[++i]);h.__c&&h.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){h.__e(e,t.__v)}})}function hi(e){return"object"!=typeof e||null==e||e.__b>0?e:Un(e)?e.map(hi):void 0!==e.constructor?null:Wn({},e)}function fi(e,t,n,i,r,s,o,a,u){var l,d,f,p,_,v,g,m=n.props||Nn,y=t.props,b=t.type;if("svg"==b?r="http://www.w3.org/2000/svg":"math"==b?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=s)for(l=0;s.length>l;l++)if((_=s[l])&&"setAttribute"in _==!!b&&(b?_.localName==b:3==_.nodeType)){e=_,s[l]=null;break}if(null==e){if(null==b)return document.createTextNode(y);e=document.createElementNS(r,b,y.is&&y),a&&(h.__m&&h.__m(t,s),a=!1),s=null}if(null==b)m===y||a&&e.data==y||(e.data=y);else{if(s="textarea"==b&&null!=y.defaultValue?null:s&&c.call(e.childNodes),!a&&null!=s)for(m={},l=0;e.attributes.length>l;l++)m[(_=e.attributes[l]).name]=_.value;for(l in m)_=m[l],"dangerouslySetInnerHTML"==l?f=_:"children"==l||l in y||"value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y||ai(e,l,null,_,r);for(l in y)_=y[l],"children"==l?p=_:"dangerouslySetInnerHTML"==l?d=_:"value"==l?v=_:"checked"==l?g=_:a&&"function"!=typeof _||m[l]===_||ai(e,l,_,m[l],r);if(d)a||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=""),ni("template"==t.type?e.content:e,Un(p)?p:[p],t,n,i,"foreignObject"==b?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:n.__k&&$(n,0),a,u),null!=s)for(l=s.length;l--;)Gn(s[l]);a&&"textarea"!=b||(l="value","progress"==b&&null==v?e.removeAttribute("value"):null!=v&&(v!==e[l]||"progress"==b&&!v||"option"==b&&v!=m[l])&&ai(e,l,v,m[l],r),l="checked",null!=g&&g!=e[l]&&ai(e,l,g,m[l],r))}return e}function pi(e,t,n){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){h.__e(e,n)}}function _i(e,t,n){var i,r;if(h.unmount&&h.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||pi(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){h.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(r=0;i.length>r;r++)i[r]&&_i(i[r],t,n||"function"!=typeof e.type);n||Gn(e.__e),e.__c=e.__=e.__e=void 0}function vi(e,t,n){return this.constructor(e,n)}function gi(e,t,n){var i,r,s,o;t==document&&(t=document.documentElement),h.__&&h.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],o=[],li(t,e=(!i&&n||t).__k=Kn(Zn,null,[e]),r||Nn,Nn,t.namespaceURI,!i&&n?[n]:r?null:t.firstChild?c.call(t.childNodes):null,s,!i&&n?n:r?r.__e:t.firstChild,i,o),di(s,e,o),e.props.children=null}c=Vn.slice,h={__e:function(e,t,n,i){for(var r,s,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&null!=s.getDerivedStateFromError&&(r.setState(s.getDerivedStateFromError(e)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),o=r.__d),o)return r.__E=r}catch(t){e=t}throw e}},f=0,Jn.prototype.setState=function(e,t){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Wn({},this.state);"function"==typeof e&&(e=e(Wn({},n),this.props)),e&&Wn(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ei(this))},Jn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ei(this))},Jn.prototype.render=Zn,_=[],g="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,m=function(e,t){return e.__v.__b-t.__v.__b},ti.__r=0,y=Math.random().toString(8),b="__d"+y,w="__a"+y,S=/(PointerCapture)$|Capture$/i,x=0,k=ui(!1),C=ui(!0),P=0;var mi=0,yi=[],bi=h,wi=bi.__b,Si=bi.__r,xi=bi.diffed,ki=bi.__c,Ci=bi.unmount,Pi=bi.__;function Ei(e,t){bi.__h&&bi.__h(Bn,e,mi||t),mi=0;var n=Bn.__H||(Bn.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Fi(e){return mi=1,function(e,t){var n=Ei(qn++,2);if(n.t=e,!n.__c&&(n.__=[Bi(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],i=n.t(t,e);t!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=Bn,!Bn.__f)){var i=function(e,t,i){if(!n.__c.__H)return!0;var s=!1,o=n.__c.props!==e;if(n.__c.__H.__.some(function(e){if(e.__N){s=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),r){var a=r.call(this,e,t,i);return s?a||o:a}return!s||o};Bn.__f=!0;var r=Bn.shouldComponentUpdate,s=Bn.componentWillUpdate;Bn.componentWillUpdate=function(e,t,n){if(this.__e){var o=r;r=void 0,i(e,t,n),r=o}s&&s.call(this,e,t,n)},Bn.shouldComponentUpdate=i}return n.__N||n.__}(Bi,e)}function Ti(e,t){var n=Ei(qn++,3);!bi.__s&&qi(n.__H,t)&&(n.__=e,n.u=t,Bn.__H.__h.push(n))}function Ii(e){return mi=5,Ri(function(){return{current:e}},[])}function Ri(e,t){var n=Ei(qn++,7);return qi(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Li(e){var t,n=Bn.context[e.__c],i=Ei(qn++,9);return i.c=e,n?(null!==(t=i.__)&&void 0!==t||(i.__=!0,n.sub(Bn)),n.props.value):e.__}function Ai(){for(var e;e=yi.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some($i),t.__h.some(Di),t.__h=[]}catch(n){t.__h=[],bi.__e(n,e.__v)}}}bi.__b=function(e){Bn=null,wi&&wi(e)},bi.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Pi&&Pi(e,t)},bi.__r=function(e){Si&&Si(e),qn=0;var t=(Bn=e.__c).__H;t&&(jn===Bn?(t.__h=[],Bn.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.length&&Ai(),qn=0)),jn=Bn},bi.diffed=function(e){xi&&xi(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==yi.push(t)&&Hn===bi.requestAnimationFrame||((Hn=bi.requestAnimationFrame)||Oi)(Ai)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),jn=Bn=null},bi.__c=function(e,t){t.some(function(e){try{e.__h.some($i),e.__h=e.__h.filter(function(e){return!e.__||Di(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],bi.__e(n,e.__v)}}),ki&&ki(e,t)},bi.unmount=function(e){Ci&&Ci(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{$i(e)}catch(e){t=e}}),n.__H=void 0,t&&bi.__e(t,n.__v))};var Mi="function"==typeof requestAnimationFrame;function Oi(e){var t,n=function(){clearTimeout(i),Mi&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);Mi&&(t=requestAnimationFrame(n))}function $i(e){var t=Bn,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Bn=t}function Di(e){var t=Bn;e.__c=e.__(),Bn=t}function qi(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Bi(e,t){return"function"==typeof t?t(e):t}var ji="gzip-js",Hi="base64",Ni="events",Vi="cancelEvents",zi="tab",Ui="left",Wi="center",Gi="right",Ki="next_to_trigger",Qi="popover",Zi="widget",Ji="external_survey",Yi="open",Xi="multiple_choice",er="single_choice",tr="rating",nr="end",ir="always",rr="survey shown",sr="survey dismissed",or="survey sent",ar="$survey_id",ur="$survey_name",lr="$survey_iteration",cr="$survey_iteration_start_date",dr="$survey_submission_id",hr="$survey_language",fr="popover",pr=["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","pinterestbot","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"],_r=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=e.toLowerCase();return pr.concat(t).some(function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)})};function vr(e,t){return-1!==e.indexOf(t)}var gr=function(e){return e.trim()},mr=function(e){return e.replace(/^\$/,"")};function yr(e){var t,n=[];return null!==(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(t))return"[Circular]";n.push(t)}return t}}))&&void 0!==t?t:"null"}var br=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),wr=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Sr="min_length",xr="max_length",kr=["$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"],Cr=["token"],Pr=Object.prototype,Er=Pr.hasOwnProperty,Fr=Pr.toString,Tr=Array.isArray||function(e){return"[object Array]"===Fr.call(e)},Ir=function(e){return"function"==typeof e},Rr=function(e){return e===Object(e)&&!Tr(e)},Lr=function(e){if(Rr(e)){for(var t in e)if(Er.call(e,t))return!1;return!0}return!1},Ar=function(e){return void 0===e},Mr=function(e){return"[object String]"==Fr.call(e)},Or=function(e){return Mr(e)&&0===e.trim().length},$r=function(e){return null===e},Dr=function(e){return Ar(e)||$r(e)},qr=function(e){return"[object Number]"==Fr.call(e)&&e==e},Br=function(e){return qr(e)&&e>0},jr=function(e){return"[object Boolean]"===Fr.call(e)},Hr=function(e){return vr(kr,e)},Nr=function(e){return vr(Cr,e)};function Vr(e){return null===e||"object"!=typeof e}function zr(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Ur(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Gr(e,Error)}}function Wr(e){return"u">typeof Event&&Gr(e,Event)}function Gr(e,t){try{return e instanceof t}catch(e){return!1}}var Kr=[!0,"true",1,"1","yes"],Qr=function(e){return vr(Kr,e)},Zr=[!1,"false",0,"0","no"];function Jr(e,t,n,i,r){return t>n&&(i.warn("min cannot be greater than max."),t=n),qr(e)?e>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(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: "+n+", fallback: "+r),Jr(null!=r?r:n,t,n,i))}var Yr=function(){"use strict";function e(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=Jr(e.bucketSize,0,100,e._logger),this._refillRate=Jr(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=Jr(e.refillInterval,0,864e5,e._logger)}var t=e.prototype;return t._applyRefill=function(e,t){var n=Math.floor((t-e.lastAccess)/this._refillInterval);n>0&&(e.tokens=Math.min(e.tokens+n*this._refillRate,this._bucketSize),e.lastAccess=e.lastAccess+n*this._refillInterval)},t.consumeRateLimit=function(e){var t,n=Date.now(),i=String(e),r=this._buckets[i];return r?this._applyRefill(r,n):this._buckets[i]=r={tokens:this._bucketSize,lastAccess:n},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===r.tokens)},t.stop=function(){this._buckets={}},e}(),Xr="Mobile",es="Android",ts="Tablet",ns="Android Tablet",is="iPad",rs="Apple Watch",ss="Safari",os="BlackBerry",as="Samsung Internet",us="Chrome",ls="Chrome iOS",cs="Internet Explorer",ds="Internet Explorer Mobile",hs="Opera",fs="Microsoft Edge",ps="Firefox",_s="Firefox iOS",vs="Nintendo",gs="PlayStation",ms="Xbox",ys="Android Mobile",bs="Mobile Safari",ws="Windows",Ss="Windows Phone",xs="Nokia",ks="Ouya",Cs="Generic "+Xr.toLowerCase(),Ps="Generic "+ts.toLowerCase(),Es="Konqueror",Fs="Oculus Browser",Ts="Vivaldi",Is="Yandex",Rs="Whale",Ls="DuckDuckGo",As="Pale Moon",Ms="Waterfox",Os="Brave",$s="Claude",Ds="Codex",qs="ChatGPT",Bs="Google Search App",js=new RegExp("Version/(\\d+(\\.\\d+)?)"),Hs=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Ns=new RegExp(ms,"i"),Vs=new RegExp("PlayStation \\w+","i"),zs=new RegExp("Nintendo \\w+","i"),Us=new RegExp("BlackBerry|PlayBook|BB10","i"),Ws={"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"},Gs=function(e,t,n,i){t=t||"";var r=function(e){return null!=e&&e.brave?Os:null}(n);return r||(null!=i&&i.detectGoogleSearchApp&&vr(e,"GSA/")?Bs:vr(e," OPR/")&&vr(e,"Mini")?"Opera Mini":vr(e," OPR/")?hs:Us.test(e)?os:vr(e,"IEMobile")||vr(e,"WPDesktop")?ds:vr(e,"OculusBrowser")?Fs:vr(e,"SamsungBrowser")?as:vr(e,"Edge")||vr(e,"Edg/")?fs:vr(e,"Vivaldi/")?Ts:vr(e,"YaBrowser/")?Is:vr(e,"Whale/")?Rs:vr(e,"DuckDuckGo/")||vr(e,"Ddg/")?Ls:vr(e,"Claude/")?$s:vr(e,"Codex/")?Ds:vr(e,"ChatGPT/")?qs:vr(e,"FBIOS")?"Facebook Mobile":vr(e,"UCWEB")||vr(e,"UCBrowser")?"UC Browser":vr(e,"CriOS")?ls:vr(e,"CrMo")||vr(e,us)?us:vr(e,es)&&vr(e,ss)?ys:vr(e,"FxiOS")?_s:vr(e.toLowerCase(),Es.toLowerCase())?Es:vr(e,"Brave/")?Os:function(e,t){return t&&vr(t,"Apple")||function(e){return vr(e,ss)&&!vr(e,us)&&!vr(e,es)}(e)}(e,t)?vr(e,Xr)?bs:ss:vr(e,"PaleMoon/")?As:vr(e,"Waterfox/")?Ms:vr(e,ps)?ps:vr(e,"MSIE")||vr(e,"Trident/")?cs:vr(e,"Gecko")?ps:"")},Ks=((i={})[ds]=[new RegExp("rv:(\\d+(\\.\\d+)?)")],i[fs]=[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],i[us]=[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],i[ls]=[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],i["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],i[ss]=[js],i[bs]=[js],i[hs]=[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],i[ps]=[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],i[_s]=[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],i[Es]=[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],i[os]=[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),js],i[ys]=[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],i[as]=[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],i[Fs]=[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],i[Ts]=[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],i[Is]=[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],i[Rs]=[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],i[Os]=[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],i[$s]=[Hs],i[Ds]=[Hs],i[qs]=[Hs],i[Ls]=[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],i[As]=[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],i[Ms]=[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],i[Bs]=[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],i[cs]=[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],i.Mozilla=[new RegExp("rv:(\\d+(\\.\\d+)?)")],i),Qs=function(e,t,n,i){var r=Ks[Gs(e,t,n,i)];if(Ar(r))return null;for(var s=0;r.length>s;s++){var o=e.match(r[s]);if(o)return parseFloat(o[o.length-2])}return null},Zs=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),function(e){return[ms,e&&e[1]||""]}],[new RegExp(vs,"i"),[vs,""]],[new RegExp(gs,"i"),[gs,""]],[Us,[os,""]],[new RegExp(ws,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ss,""];if(new RegExp(Xr).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var i=Ws[n[1]]||"";return/arm/i.test(t)&&(i="RT"),[ws,i]}return[ws,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){return e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Ar(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),function(e){return e&&e[2]?[es,[e[2],e[3],e[4]||"0"].join(".")]:[es,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Js=function(e){for(var t=0;Zs.length>t;t++){var n=Zs[t],i=n[1],r=n[0].exec(e),s=r&&(Ir(i)?i(r,e):i);if(s)return s}return["",""]},Ys=function(e){return zs.test(e)?vs:Vs.test(e)?gs:Ns.test(e)?ms:new RegExp(ks,"i").test(e)?ks:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?Ss:/iPad/.test(e)?is:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?rs:Us.test(e)?os:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(xs,"i").test(e)?xs:/(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(Xr).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)?es:ns:new RegExp("(pda|Mobile)","i").test(e)?Cs:new RegExp(ts,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?Ps:""},Xs=function(e,t){var n,i,r,s,o=Ys(e);return o===is||o===ns||"Kobo"===o||"Kindle Fire"===o||o===Ps?ts:o===vs||o===ms||o===gs||o===ks?"Console":o===rs?"Wearable":o?Xr:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(n=null==t?void 0:t.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(r=null==t?void 0:t.screenHeight)&&void 0!==r?r:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?Xr:ts:"Desktop"},eo="[Truncated]",to="[Unserializable]";function no(e){for(var t="",n=0;e.length>n;n++){var i=e.charCodeAt(n);if(55296>i||i>56319)t+=56320>i||i>57343?e[n]:"�";else{var r=e.charCodeAt(n+1);56320>r||r>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}Date,Date;var io,ro,so,oo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ao(e,t){return"string"==typeof(n=e)&&oo.test(n)?e:t();var n}function uo(e,t){var n=new Error(t);try{Object.defineProperty(n,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return n}function lo(e){return e?e.split("#")[0]:e}function co(e,t){var n=setTimeout(e,t);return null!=n&&n.unref&&(null==n||n.unref()),n}function ho(e,t,n){return fo.apply(this,arguments)}function fo(){return(fo=p(l().m(function e(t,n,i){var r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Promise.race([t,new Promise(function(e,t){r=co(function(){try{null==i||i(),e()}catch(e){t(e)}},n)})]);case 1:return e.a(2,e.v);case 2:return e.p=2,clearTimeout(r),e.f(2);case 3:return e.a(2)}},e,null,[[0,,2,3]])}))).apply(this,arguments)}function po(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return so&&n.length===ro?so:(ro=n.length,so=n.reduce(function(n,i){io||(io={});var r=io[i];if(r)n[r[0]]=r[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a,u=null==(a=s[o])?void 0:a.filename,l=t[i];if(u&&l){n[u]=l,io[i]=[u,l];break}}return n},{}))}}var _o=function(){"use strict";function e(e,t,n){void 0===n&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}var t=e.prototype;return t.buildFromUnknown=function(e,t){void 0===t&&(t={});var n=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(n,t,0).apply(e),r=this.buildParsingContext(t),s=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(s,n),$exception_level:"error"}},t.modifyFrames=function(){var e=p(l().m(function e(t){var n,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:n=d(t);case 1:if((i=n()).done){e.n=4;break}if(!((r=i.value).stacktrace&&r.stacktrace.frames&&Tr(r.stacktrace.frames))){e.n=3;break}return e.n=2,this.applyModifiers(r.stacktrace.frames);case 2:r.stacktrace.frames=e.v;case 3:e.n=1;break;case 4:return e.a(2,t)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.coerceFallback=function(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}},t.parseStacktrace=function(e,t){var n,i;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),u({},e,{cause:n,stack:i})},t.applyChunkIds=function(e,t){return e.map(function(e){return e.filename&&t&&(e.chunk_id=t[e.filename]),e})},t.applyCoercers=function(e,t){for(var n,i=d(this.coercers);!(n=i()).done;){var r=n.value;if(r.match(e))return r.coerce(e,t)}return this.coerceFallback(t)},t.applyModifiers=function(){var e=p(l().m(function e(t){var n,i,r,s;return l().w(function(e){for(;;)switch(e.n){case 0:n=t,i=d(this.modifiers);case 1:if((r=i()).done){e.n=4;break}return s=r.value,e.n=2,s(n);case 2:n=e.v;case 3:e.n=1;break;case 4:return e.a(2,n)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.convertToExceptionList=function(e,t){var n,i,r,s={type:e.type,value:e.value,mechanism:{type:null!==(n=t.type)&&void 0!==n?n:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(r=e.synthetic)&&void 0!==r&&r}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var o=[s];return null!=e.cause&&o.push.apply(o,this.convertToExceptionList(e.cause,u({},t,{handled:!0}))),o},t.buildParsingContext=function(e){var t;return{chunkIdMap:po(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}},t.buildCoercingContext=function(e,t,n){var i=this;void 0===n&&(n=0);var r=function(n,r){if(4>=r){var s=i.buildCoercingContext(e,t,r);return i.applyCoercers(n,s)}};return u({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:function(e){return r(e,n)},next:function(e){return r(e,n+1)}})},e}();function vo(e,t,n,i,r){var s={platform:e,filename:t,function:"<anonymous>"===n?"?":n,in_app:!!t&&!t.startsWith("webkit-masked-url://")&&"<anonymous>"!==t};return Ar(i)||(s.lineno=i),Ar(r)||(s.colno=r),s}var go=function(e,t){var n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},mo=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,yo=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bo=/\((\S*)(?::(\d+))(?::(\d+))\)/,wo=function(e,t){var n=mo.exec(e);if(n)return vo(t,n[1],"?",+n[2],+n[3]);var i=yo.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var r=bo.exec(i[2]);r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3])}var s=go(i[1]||"?",i[2]);return vo(t,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},So=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xo=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ko=function(e,t){var n=So.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=xo.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],s=n[1]||"?",o=go(s,r);return vo(t,r=o[1],s=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Co=/\(error: (.*)\)/;var Po=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return this.isDOMException(e)||this.isDOMError(e)},t.coerce=function(e,t){var n=Mr(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}},t.getType=function(e){return this.isDOMError(e)?"DOMError":"DOMException"},t.getValue=function(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t},t.isDOMException=function(e){return zr(e,"DOMException")},t.isDOMError=function(e){return zr(e,"DOMError")},e}(),Eo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Ur(e)},t.coerce=function(e,t){var n,i=this.getStack(e),r=void 0===i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=i?i:null==(n=t.syntheticException)?void 0:n.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:r}},t.getType=function(e){return e.name||e.constructor.name},t.getMessage=function(e,t){var n=e.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)},t.getStack=function(e){return e.stacktrace||e.stack||void 0},e}(),Fo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return!!zr(e,"ErrorEvent")&&(null!=e.error||this._hasUsableMessage(e))},t.coerce=function(e,t){var n;if(null!=e.error)return t.apply(e.error);var i=t.apply(e.message);return u({},i,{stack:null!==(n=this._buildLocationStack(e))&&void 0!==n?n:i.stack,synthetic:!0})},t._hasUsableMessage=function(e){return Mr(e.message)&&e.message.length>0},t._buildLocationStack=function(e){var t,n,i=e,r=null!==(t=i.lineno)&&void 0!==t?t:0,s=null!==(n=i.colno)&&void 0!==n?n:0;if(Mr(i.filename)&&0!==i.filename.length&&0!==r)return"Error\n at "+i.filename+":"+r+":"+s},e}(),To=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Io=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return"string"==typeof e},t.coerce=function(e,t){var n,i=this.getInfos(e),r=i[0],s=i[1];return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},t.getInfos=function(e){var t="Error",n=e,i=e.match(To);return i&&(t=i[1],n=i[2]),[t,n]},e}(),Ro=["fatal","error","warning","log","info","debug"];function Lo(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(t>=r.length)return i===n.length?r:r.length>t?r.slice(0,t)+"...":r}return""}var Ao=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return"object"==typeof e&&null!==e},t.coerce=function(e,t){var n,i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!==(n=this.getStack(e))&&void 0!==n?n:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}},t.getType=function(e){if(Wr(e))return e.constructor.name;var t="name"in e?e.name:void 0;return Mr(t)&&!Or(t)?t:"Error"},t.getValue=function(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 n=this.getObjectClassName(e);return(n&&"Object"!==n?"'"+n+"'":"Object")+" captured as exception with keys: "+Lo(e)},t.isSeverityLevel=function(e){return Mr(e)&&!Or(e)&&Ro.indexOf(e)>=0},t.getStack=function(e){try{return Mr(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:Mr(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}},t.getErrorPropertyFromObject=function(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(Ur(n))return n}},t.getObjectClassName=function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}},e}(),Mo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Wr(e)},t.coerce=function(e,t){var n,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Lo(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Oo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Vr(e)},t.coerce=function(e,t){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),$o=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return zr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)},t.isCustomEventWrappingRejection=function(e){if(!Wr(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}},t.coerce=function(e,t){var n,i=this.getUnhandledRejectionReason(e);return Vr(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}:t.apply(i)},t.getUnhandledRejectionReason=function(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e},e}(),Do="$message",qo="$timestamp",Bo=new Set([Do,qo]),jo={enabled:!0,max_bytes:32768};function Ho(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:jo.enabled,max_bytes:Vo(e.max_bytes,jo.max_bytes)}:u({},jo)}var No=function(){"use strict";function e(e){this._entries=[],this._totalBytes=0,this._config=Ho(e)}var t=e.prototype;return t.setConfig=function(e){this._config=Ho(e),this._trimToMaxBytes()},t.add=function(e){var t=function(e){var t;try{t=yr(e)}catch(e){return}try{var n=JSON.parse(t);if(!Rr(n))return;var i=n,r=i[Do],s=i[qo];if(!Mr(r)||0===r.trim().length)return;if(!Mr(s)&&!qr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var n=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),n=0,i=0;t.length>i;i++)"%"===t[i]?(n+=1,i+=2):n+=1;return n}(t.json);n>this._config.max_bytes||(this._entries.push({step:t.step,bytes:n}),this._totalBytes+=n,this._trimToMaxBytes())}},t.getAttachable=function(){return this._entries.map(function(e){return e.step})},t.clear=function(){this._entries=[],this._totalBytes=0},t.size=function(){return this._entries.length},t._trimToMaxBytes=function(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){var e=this._entries.shift();e&&(this._totalBytes-=e.bytes)}},e}();function Vo(e,t){if(!qr(e)||1/0===e||-1/0===e)return t;var n=Math.floor(e);return 0>n?t:n}var zo=function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function Uo(e){return"string"==typeof e||e}function Wo(e){return"string"==typeof e?e:void 0}var Go,Ko=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain"].concat(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],["$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"]),Qo="NativeGzipValidationError",Zo=function(e){return e.length>=2&&31===e[0]&&139===e[1]},Jo=function(e,t){return e===wr.GZipJS||t===wr.GZipJS||"gzip"===t},Yo=function(e){return!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"")},Xo=function(e){for(var t=function(){if(Go)return Go;Go=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;Go[e]=t>>>0}return Go}(),n=4294967295,i=0;e.length>i;i++)n=t[255&(n^e[i])]^n>>>8;return(4294967295^n)>>>0},ea=function(e){throw uo(Qo,"Native gzip produced invalid output: "+e)},ta=function(){var e=p(l().m(function e(t,n){var i,r,s,o,a;return l().w(function(e){for(;;)switch(e.n){case 0:return 18>t.size&&ea("too-short"),o=Uint8Array,e.n=1,t.slice(0,10).arrayBuffer();case 1:return i=new o(e.v),Zo(i)&&8===i[2]||ea("invalid-header"),a=DataView,e.n=2,t.slice(t.size-8).arrayBuffer();case 2:(r=new a(e.v)).getUint32(0,!0)!==Xo(n)&&ea("invalid-crc"),s=n.length>>>0,r.getUint32(4,!0)!==s&&ea("invalid-size");case 3:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}();function na(e,t,n){return ia.apply(this,arguments)}function ia(){return ia=p(l().m(function e(t,n,i){var r,s,o,a,u,c,d;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return void 0===n&&(n=!0),e.p=1,r=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(r).then(function(){return o.close()}).catch(function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,o.abort(t);case 1:e.n=3;break;case 2:e.p=2;case 3:throw t;case 4:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}()),u=new Response(s.readable).blob(),e.n=2,Promise.all([u,a]);case 2:return c=e.v[0],e.n=3,ta(c,r);case 3:return e.a(2,c);case 4:if(e.p=4,d=e.v,null==i||!i.rethrow){e.n=5;break}throw d;case 5:return n&&console.error("Failed to gzip compress data",d),e.a(2,null)}},e,null,[[1,4]])})),ia.apply(this,arguments)}var ra={}.propertyIsEnumerable;function sa(e,t){try{return ua(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function oa(e,t,n,i){if(0>=n.remainingNodes)return{stringValue:eo};if(n.remainingNodes--,jr(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){var n=e.toString(),i=BigInt("9223372036854775808");return e>=i||-i>e?(null==t||t.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}(e,t);if("number"==typeof e){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};var r=BigInt(e).toString();return e>=0x8000000000000000||-0x8000000000000000>e?(null==t||t.debug("Attribute "+r+" is outside the int64 range; encoding it as a string"),{stringValue:r}):{intValue:r}}return{doubleValue:e}}if("string"==typeof e)return{stringValue:no(e)};if("function"==typeof e)return{stringValue:"[Function]"};if("symbol"==typeof e)return{stringValue:String(e)};if("object"==typeof e&&null!==e){if(n.ancestors.has(e))return{stringValue:"[Circular]"};if(i>=20)return{stringValue:eo};if(e instanceof Date){var s=e.getTime(),o=Number.isFinite(s)?e.toISOString():String(e);return{stringValue:"string"==typeof o?no(o):String(o)}}n.ancestors.add(e);try{try{var a=e.toJSON;if("function"==typeof a)return oa(a.call(e),t,n,i+1)}catch(e){}return Tr(e)?{arrayValue:{values:aa(e,t,n,i+1)}}:{kvlistValue:{values:ua(e,t,n,i+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:no(String(e))}}function aa(e,t,n,i){for(var r=[],s=Math.min(e.length,1e3),o=0;s>o&&n.remainingNodes>0;o++)try{var a=o in e?e[o]:void 0;if(Dr(a))continue;r.push(oa(a,t,n,i))}catch(e){r.push({stringValue:to})}return e.length>o&&r.push({stringValue:eo}),r}function ua(e,t,n,i){var r=[];for(var s in e)if(ra.call(e,s)){if(!s){null==t||t.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>=n.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=e[s];if($r(o)||Ar(o))continue;r.push({key:no(s),value:oa(o,t,n,i)})}catch(e){r.push({key:no(s),value:{stringValue:to}})}}return r}function la(e,t,n){return u({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}var ca={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var da={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},ha=da.info;function fa(e){try{return no(String(e))}catch(e){return to}}function pa(e,t,n,i){var r,s=da[e.level||"info"]||ha,o=s.text,a=s.number,l=(void 0===(r=qr(i)?i:void 0)&&(r=Date.now()),String(r)+"000000"),c={};t.distinctId&&(c.posthogDistinctId=t.distinctId),t.sessionId&&(c.sessionId=t.sessionId),t.windowId&&(c["window.id"]=t.windowId),Dr(t.sessionStartTimestamp)||(c.sessionStartTimestamp=String(t.sessionStartTimestamp)),Dr(t.lastActivityTimestamp)||(c.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(c["url.full"]=t.currentUrl),t.screenName&&(c["screen.name"]=t.screenName),t.appState&&(c["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(c.feature_flags=t.activeFeatureFlags);var h=u({},c),f=e.attributes;if(f){var p=[];try{p=Object.keys(f)}catch(e){p=[]}for(var _,v=d(p);!(_=v()).done;){var g=_.value,m=void 0;try{m=f[g]}catch(e){m=to}Object.defineProperty(h,g,{value:m,enumerable:!0,writable:!0,configurable:!0})}}var y={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:a,severityText:o,body:{stringValue:fa(e.body)},attributes:sa(h,n)};return e.trace_id&&(y.traceId=e.trace_id),e.span_id&&(y.spanId=e.span_id),Ar(e.trace_flags)||(y.flags=e.trace_flags),y}function _a(e,t,n){return la(e,t,n)}function va(e,t,n,i){return{resourceLogs:[{resource:{attributes:sa(t)},scopeLogs:[{scope:{name:n,version:i},logRecords:e}]}]}}var ga=function(){"use strict";function e(e,t,n,i,r,s,o){var a;void 0===s&&(s=function(){return Promise.resolve()}),this._instance=e,this._config=t,this._logger=n,this._getContext=i,this._onReady=r,this._waitForStoragePersist=s,this._scopeName=o,this._flushPromise=null,this._evictedSinceAdvance=0,this._queueGeneration=0,this._consecutiveFlushFailures=0,this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._maxBufferSize=t.maxBufferSize,this._maxQueueSize=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this._flushIntervalMs=t.flushIntervalMs,this._maxBatchRecordsPerPost=t.maxBatchRecordsPerPost,this._rateCapWindowMs=t.rateCapWindowMs,this._maxLogsPerInterval=t.maxLogsPerInterval}var t=e.prototype;return t.clearQueue=function(){this._queueGeneration++,this._instance.setPersistedProperty(br.LogsQueue,[])},t.reset=function(){this._clearFlushTimer(),this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._consecutiveFlushFailures=0,this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost},t.onReconnect=function(){this._consecutiveFlushFailures=0,this._flushInBackground()},t.captureLog=function(e,t){var n,i=this;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var r=this._runBeforeSend(e);if(null!==r)if(r.body){if(this._checkRateLimit()){var s={record:pa(r,null!==(n=null==t?void 0:t.context)&&void 0!==n?n:this._getContext(),this._logger,null==t?void 0:t.occurredAtMs)};this._onReady(function(){return i._enqueue(s)})}}else this._logger.info("Log was rejected in beforeSend function")}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,i=e,r=d(Tr(t)?t:[t]);!(n=r()).done;){var s=n.value;try{var o=s(i);if(!o)return this._logger.info("Log was rejected in beforeSend function"),null;i=o}catch(e){return this._logger.error("Error in beforeSend function for log:",e),null}}return i},t._checkRateLimit=function(){if(void 0===this._maxLogsPerInterval)return!0;var e=Date.now(),t=e-this._intervalWindowStart;return this._rateCapWindowMs>t&&t>=0||(this._intervalWindowStart=e,this._intervalLogCount=0,this._droppedWarned=!1),this._maxLogsPerInterval>this._intervalLogCount?(this._intervalLogCount++,!0):(this._droppedWarned||(this._logger.warn("captureLog dropping logs: exceeded "+this._maxLogsPerInterval+" logs per "+this._rateCapWindowMs+"ms"),this._droppedWarned=!0),!1)},t.flush=function(){var e=p(l().m(function e(){var t=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(!this._instance.isDisabled){e.n=1;break}return e.a(2);case 1:if(!this._flushPromise){e.n=2;break}return e.a(2,this._flushPromise);case 2:return this._flushPromise=this._flushInner().finally(function(){t._flushPromise=null}),e.a(2,this._flushPromise)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._flushInner=function(){var e=p(l().m(function e(){var t,n,i,r,s,o,a,u,c,d,h,f;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._clearFlushTimer(),0!==(n=null!==(t=this._instance.getPersistedProperty(br.LogsQueue))&&void 0!==t?t:[]).length){e.n=1;break}return e.a(2);case 1:i=n.length,r=0;case 2:if(0>=n.length||r>=i){e.n=9;break}return a=this._queueGeneration,this._evictedSinceAdvance=0,u=Math.min(n.length,this._maxBatchRecordsPerPost),c=n.slice(0,u),d=c.map(function(e){return e.record}),h=va(d,this._buildResourceAttributes(),null!==(s=this._scopeName)&&void 0!==s?s:this._instance.getLibraryId(),this._instance.getLibraryVersion()),e.n=3,this._instance._sendLogsBatch(h);case 3:if(f=e.v,this._queueGeneration===a){e.n=4;break}return e.a(2);case 4:if("too-large"!==f.kind||1>=c.length){e.n=5;break}return this._maxBatchRecordsPerPost=Math.max(1,Math.floor(c.length/2)),this._logger.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+this._maxBatchRecordsPerPost),e.a(3,2);case 5:if("retry-later"!==f.kind){e.n=6;break}throw f.error;case 6:return"too-large"===f.kind?this._logger.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===f.kind&&this._config.maxBatchRecordsPerPost>this._maxBatchRecordsPerPost&&(this._maxBatchRecordsPerPost=Math.min(this._config.maxBatchRecordsPerPost,this._maxBatchRecordsPerPost+1)),e.n=7,this._persistQueueAdvance(c.length);case 7:if(n=null!==(o=this._instance.getPersistedProperty(br.LogsQueue))&&void 0!==o?o:[],r+=c.length,"fatal"!==f.kind){e.n=8;break}throw f.error;case 8:e.n=2;break;case 9:return e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._persistQueueAdvance=function(){var e=p(l().m(function e(t){var n,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:return i=Math.max(0,t-this._evictedSinceAdvance),r=null!==(n=this._instance.getPersistedProperty(br.LogsQueue))&&void 0!==n?n:[],this._instance.setPersistedProperty(br.LogsQueue,r.slice(i)),e.n=1,this._waitForStoragePersist();case 1:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t._buildResourceAttributes=function(){return _a(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion())},t._enqueue=function(e){var t;if(!this._instance.optedOut){var n=null!==(t=this._instance.getPersistedProperty(br.LogsQueue))&&void 0!==t?t:[];this._maxQueueSize>n.length||(n.shift(),this._evictedSinceAdvance++,this._logger.info("Logs queue is full, dropping oldest record.")),n.push(e),this._instance.setPersistedProperty(br.LogsQueue,n),this._maxBufferSize>n.length?this._armFlushTimer():this._flushInBackground()}},t._armFlushTimer=function(e){var t=this;void 0===e&&(e=this._flushIntervalMs),this._flushTimer||(this._flushTimer=co(function(){t._flushTimer=void 0,t._flushInBackground()},e))},t._nextFlushDelay=function(){var e=Math.min(Math.max(0,this._consecutiveFlushFailures-1),6);return this._flushIntervalMs*Math.pow(2,e)},t._hasQueuedRecords=function(){var e=this._instance.getPersistedProperty(br.LogsQueue);return!!e&&e.length>0},t.shutdown=function(){var e=p(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._clearFlushTimer(),n=this.flush().catch(function(){}),void 0!==t){e.n=2;break}return e.n=1,n;case 1:return e.a(2,void 0);case 2:return e.n=3,ho(n,t);case 3:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.flushWithTimeout=function(){var e=p(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:return n=this.flush(),e.n=1,ho(n,t,function(){n.catch(function(){})});case 1:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t._flushInBackground=function(){var e=this;this.flush().then(function(){e._consecutiveFlushFailures=0},function(t){e._consecutiveFlushFailures++,e._logger.error("PostHog logs flush failed:",t)}).finally(function(){!e._instance.isDisabled&&e._hasQueuedRecords()&&e._armFlushTimer(e._nextFlushDelay())})},t._clearFlushTimer=function(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)},e}(),ma=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function ya(e){return String(e)+"000000"}function ba(e,t,n,i){var r="";return i&&(r=Object.keys(i).sort().map(function(e){return JSON.stringify(e)+":"+JSON.stringify(i[e])}).join(",")),e+"\0"+t+"\0"+(null!=n?n:"")+"\0"+r}var wa=function(){"use strict";function e(e,t,n){this._instance=e,this._config=t,this._logger=n,this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._generation=0}var t=e.prototype;return t.count=function(e,t,n){void 0===t&&(t=1),this._capture({name:e,type:"count",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.gauge=function(e,t,n){this._capture({name:e,type:"gauge",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.histogram=function(e,t,n){this._capture({name:e,type:"histogram",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.flush=function(){var e=this,t=this._flushPromise,n=function(){var n=p(l().m(function n(){return l().w(function(n){for(;;)switch(n.n){case 0:if(!t){n.n=1;break}return n.n=1,t.catch(function(){});case 1:return n.n=2,e._doFlush();case 2:return n.a(2)}},n)}));return function(){return n.apply(this,arguments)}}()().finally(function(){e._flushPromise===n&&(e._flushPromise=null)});return this._flushPromise=n,n},t.drainWindow=function(){if(0===this._series.size)return null;var e=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(e)},t.reset=function(){this._generation++,this._clearFlushTimer(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set},t._capture=function(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this._runBeforeSend(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this._logger.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var n,i;try{n=t.attributes?u({},t.attributes):void 0,i=ba(t.type,t.name,t.unit,n)}catch(e){return void this._logger.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var r=this._series.get(i);if(!r){if(!this._admitNewSeries())return;r={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this._series.set(i,r)}var s=this._typeByName.get(t.name);void 0===s?this._typeByName.set(t.name,t.type):s===t.type||this._typeCollisionWarned.has(t.name)||(this._typeCollisionWarned.add(t.name),this._logger.warn("Metric name '"+t.name+"' is already used as a "+s+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this._fold(r,t.value),this._armFlushTimer()}else this._logger.warn("Dropping metric '"+t.name+"': value must be a finite number");else this._logger.warn("Dropping metric with empty name")}},t._admitNewSeries=function(){return this._config.maxSeriesPerFlush>this._series.size||(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn("Metric series cap reached ("+this._config.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)},t._fold=function(e,t){var n;switch(e.type){case"count":e.total=(null!==(n=e.total)&&void 0!==n?n:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(ma.length+1).fill(0)});var i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[function(e,t){for(var n=0;t.length>n;n++)if(t[n]>=e)return n;return t.length}(t,ma)]+=1}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,i=e,r=d(Tr(t)?t:[t]);!(n=r()).done;){var s=n.value;try{var o=s(i);if(!o)return this._logger.info("Metric was rejected in beforeSend function"),null;i=o}catch(e){return this._logger.error("Error in beforeSend function for metric:",e),null}}return i},t._armFlushTimer=function(){var e=this;this._flushTimer||(this._flushTimer=co(function(){e._flushTimer=void 0,e.flush().catch(function(t){e._logger.error("Metrics flush failed:",t)})},this._config.flushIntervalMs))},t._clearFlushTimer=function(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)},t._doFlush=function(){var e=p(l().m(function e(){var t,n,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:if(0!==this._series.size){e.n=1;break}return e.a(2);case 1:return t=this._series,this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,n=this._generation,e.n=2,this._instance._sendMetricsBatch(this._buildPayload(t));case 2:if(i=e.v,n===this._generation){e.n=3;break}return e.a(2);case 3:e.n="ok"===(r=i.kind)?4:"retry-later"===r?5:"too-large"===r?6:"fatal"===r?7:8;break;case 4:case 8:return e.a(2);case 5:return this._mergeWindowBack(t),this._armFlushTimer(),e.a(2);case 6:return this._logger.warn("Metrics batch exceeded the server size limit and was dropped"),e.a(2);case 7:return this._logger.error("Failed to send metrics batch:",i.error),e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._buildPayload=function(e){return t=this._buildMetrics(e),n=function(e,t,n){return la(e,t,n)}(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),i=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:sa(n)},scopeMetrics:[{scope:{name:i,version:r},metrics:t}]}]};var t,n,i,r},t._buildMetrics=function(e){for(var t,n=ya(Date.now()),i=new Map,r=d(e.values());!(t=r()).done;){var s,o=t.value,a=ba(o.type,o.name,o.unit,void 0),l=i.get(a);l||(l=u({name:o.name},o.unit&&{unit:o.unit}),"count"===o.type?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===o.type?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},i.set(a,l));var c=sa(null!==(s=o.attributes)&&void 0!==s?s:{},this._logger),h=ya(o.windowStartMs);if("count"===o.type){var f,p={attributes:c,startTimeUnixNano:h,timeUnixNano:n,asDouble:null!==(f=o.total)&&void 0!==f?f:0};l.sum.dataPoints.push(p)}else if("gauge"===o.type){var _,v={attributes:c,timeUnixNano:n,asDouble:null!==(_=o.last)&&void 0!==_?_:0};l.gauge.dataPoints.push(v)}else o.hist&&l.histogram.dataPoints.push({attributes:c,startTimeUnixNano:h,timeUnixNano:n,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:ma})}return Array.from(i.values())},t._mergeWindowBack=function(e){for(var t,n,i,r=d(e);!(i=r()).done;){var s=i.value,o=s[0],a=s[1],u=this._series.get(o);if(u)switch(u.windowStartMs=Math.min(u.windowStartMs,a.windowStartMs),u.type){case"count":u.total=(null!==(t=u.total)&&void 0!==t?t:0)+(null!==(n=a.total)&&void 0!==n?n:0);break;case"gauge":break;case"histogram":if(a.hist)if(u.hist){u.hist.count+=a.hist.count,u.hist.sum+=a.hist.sum,u.hist.min=Math.min(u.hist.min,a.hist.min),u.hist.max=Math.max(u.hist.max,a.hist.max);for(var l=0;u.hist.bucketCounts.length>l;l++)u.hist.bucketCounts[l]+=a.hist.bucketCounts[l]}else u.hist=a.hist}else this._admitNewSeries()&&this._series.set(o,a)}},e}();function Sa(e,t){var n;if(e)return null==(n=e.find(function(e){return e.type===t}))?void 0:n.value}function xa(e){var t=!0;return{dispose:function(){if(t){t=!1;var n=e();n&&Ir(n.then)&&n.then(void 0,function(){})}}}}var ka="0.7.3",Ca={DEBUG:!1,LIB_VERSION:ka,LIB_NAME:"browser-common",JS_SDK_VERSION:ka},Pa="u">typeof window?window:void 0,Ea="u">typeof globalThis?globalThis:Pa,Fa=null==Ea?void 0:Ea.navigator,Ta=null==Ea?void 0:Ea.document,Ia=null==Ea?void 0:Ea.location,Ra=null==Ea?void 0:Ea.fetch,La=null!=Ea&&Ea.XMLHttpRequest&&"withCredentials"in new Ea.XMLHttpRequest?Ea.XMLHttpRequest:void 0,Aa=null==Ea?void 0:Ea.AbortController,Ma=null==Ea?void 0:Ea.CompressionStream,Oa=null==Fa?void 0:Fa.userAgent;function $a(){return!(!Pa||!1===Pa.navigator.onLine)}var Da=function(e,t){var n=(void 0===t?{}:t).debugEnabled,i={_log:function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;i>s;s++)r[s-1]=arguments[s];Pa&&(Ca.DEBUG||Pa.POSTHOG_DEBUG||n)&&!Ar(Pa.console)&&Pa.console&&("__rrweb_original__"in Pa.console[t]?Pa.console[t].__rrweb_original__:Pa.console[t]).apply(void 0,[e].concat(r))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];i._log.apply(i,["debug"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];i._log.apply(i,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];i._log.apply(i,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];i._log.apply(i,["error"].concat(t))},critical:function(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];(t=console).error.apply(t,[e].concat(i))},uninitializedWarning:function(e){i.error("You must initialize PostHog before calling "+e)},createLogger:function(t,n){return Da(e+" "+t,n)}};return i},qa=Da("[PostHog.js]"),Ba=qa.createLogger;function ja(e,t){Tr(e)&&e.forEach(t)}function Ha(e,t){if(!Dr(e))if(Tr(e))e.forEach(t);else if(function(e){return e instanceof FormData}(e))e.forEach(function(e,n){return t(e,n)});else for(var n in e)Er.call(e,n)&&t(e[n],n)}var Na=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];for(var r=0,s=n;s.length>r;r++){var o=s[r];for(var a in o)void 0!==o[a]&&(e[a]=o[a])}return e};function Va(e){for(var t=Object.keys(e),n=t.length,i=new Array(n);n--;)i[n]=[t[n],e[t[n]]];return i}var za=function(e){try{return e()}catch(e){return}},Ua=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){qa.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),qa.critical(e)}}},Wa=function(e){var t={};return Ha(e,function(e,n){(Mr(e)&&e.length>0||qr(e))&&(t[n]=e)}),t};var Ga=["herokuapp.com","vercel.app","netlify.app"];function Ka(e){var t=null==e?void 0:e.hostname;if(!Mr(t))return!1;for(var n=t.split(".").slice(-2).join("."),i=0,r=Ga;r.length>i;i++)if(n===r[i])return!1;return!0}function Qa(e,t,n,i){var r=null!=i?i:{},s=r.capture,o=r.passive;null==e||e.addEventListener(t,n,{capture:void 0!==s&&s,passive:void 0===o||o})}function Za(e){return"ph_toolbar_internal"===e.name}function Ja(e){return"$survey_response_"+e}function Ya(e,t){if(!t)return null;var n=e[Ja(t)];return Tr(n)?[].concat(n):n}function Xa(e,t,n){void 0===e&&(e={});var i={};return t.questions.forEach(function(t){if(!Ar(t.originalQuestionIndex)){var n,r=0===(n=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+n,s=Ya(e,t.id);Ar(s)||(i[r]=s)}}),u({$survey_questions:t.questions.map(function(t){var i,r;return{id:t.id,question:null!==(i=null==n?void 0:n[null!==(r=t.id)&&void 0!==r?r:""])&&void 0!==i?i:t.question,response:Ya(e,t.id)}})},e,i)}function eu(e,t){var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n}function tu(e){return"string"==typeof e&&e.trim()?e.trim():null}function nu(e){return e.toLowerCase()}function iu(e,t,n){if(!e||!t)return null;var i=nu(t),r=Object.keys(e).find(function(e){return nu(e)===i});if(r)return null==n||n.debug("Found exact translation match: "+r),r;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(e).find(function(e){return nu(e)===s});if(o)return null==n||n.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}var ru=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function su(e,t,n){var i,r=iu(e.translations,t,n),s=u({},e),o=!1;if(r){var a,l=null==(a=e.translations)?void 0:a[r];if(l)if(null==n||n.info("Applying survey-level translation for language: "+r),Ar(l.name)||(s.name=l.name,o=!0),s.appearance){for(var c=u({},s.appearance),d=0,h=ru;h.length>d;d++){var f=h[d],p=l[f];Ar(p)||(c[f]=p,o=!0)}s.appearance=c}else(function(e){return ru.some(function(t){return!Ar(e[t])})})(l)&&(o=!0)}var _=e.questions.map(function(e){return function(e,t,n){var i,r=iu(e.translations,t,n);if(!r)return{question:e,matchedKey:null,hasChanges:!1};var s=null==(i=e.translations)?void 0:i[r];if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=u({},e),a=!1;return Ar(s.question)||(o.question=s.question,a=!0),Ar(s.description)||(o.description=s.description,a=!0),Ar(s.buttonText)||(o.buttonText=s.buttonText,a=!0),"link"in o&&!Ar(s.link)&&(o.link=s.link,a=!0),"lowerBoundLabel"in o&&!Ar(s.lowerBoundLabel)&&(o.lowerBoundLabel=s.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!Ar(s.upperBoundLabel)&&(o.upperBoundLabel=s.upperBoundLabel,a=!0),"choices"in o&&function(e){return Tr(e.choices)}(s)&&(o.choices=s.choices,a=!0),{question:a?o:e,matchedKey:a?r:null,hasChanges:a}}(e,t,n)}),v=_.map(function(e){return e.question}),g=_.some(function(e){return e.hasChanges}),m=null;return r||(m=(null==(i=_.find(function(e){return e.matchedKey}))?void 0:i.matchedKey)||null),g&&(s.questions=v,o=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:s,matchedKey:o?r||m:null}}function ou(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function au(e){var t;return ou(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var uu=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}},lu=function(e){return e.toLowerCase()},cu={exact:function(e,t){return t.some(function(t){return e.some(function(e){return t===e})})},is_not:function(e,t){return t.every(function(t){return e.every(function(e){return t!==e})})},regex:function(e,t){return t.some(function(t){return e.some(function(e){return uu(t,e)})})},not_regex:function(e,t){return t.every(function(t){return e.every(function(e){return!uu(t,e)})})},icontains:function(e,t){return t.map(lu).some(function(t){return e.map(lu).some(function(e){return t.includes(e)})})},not_icontains:function(e,t){return t.map(lu).every(function(t){return e.map(lu).every(function(e){return!t.includes(e)})})},gt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n>parseFloat(e)})})},lt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n<parseFloat(e)})})}};function du(e,t){return!e||Object.entries(e).every(function(e){var n=e[1],i=null==t?void 0:t[e[0]];if(null==i)return!1;var r=cu[n.operator];return!!r&&r(n.values,[String(i)])})}var hu=Ba("[Surveys]");function fu(e){return!(!e.start_date||e.end_date)}function pu(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var _u=function(e,t){return""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t)},vu=function(e){return _u("seenSurvey_",e)},gu=function(e){try{var t=vu(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){hu.error("Failed to persist survey seen state",e)}},mu=[Qi,Zi,"api"],yu={ignoreConditions:!1,ignoreDelay:!1,displayType:fr},bu="distinct_id",wu="$device_id",Su="$device_model",xu="__alias",ku="$fbc",Cu="$fbc_persistence",Pu="__timers",Eu="$autocapture_disabled_server_side",Fu="$heatmaps_enabled_server_side",Tu="$exception_capture_enabled_server_side",Iu="$error_tracking_suppression_rules",Ru="$error_tracking_capture_extension_exceptions",Lu="$web_vitals_enabled_server_side",Au="$dead_clicks_enabled_server_side",Mu="$product_tours_enabled_server_side",Ou="$logs_capture_enabled_server_side",$u="$web_vitals_allowed_metrics",Du="$session_recording_remote_config",qu="$replay_sample_rate",Bu="$replay_override_sampling",ju="$replay_override_linked_flag",Hu="$replay_override_url_trigger",Nu="$replay_override_event_trigger",Vu="$sesid",zu="$session_is_sampled",Uu="$enabled_feature_flags",Wu="$active_feature_flags",Gu="$early_access_features",Ku="$feature_flag_details",Qu="$feature_flag_payloads",Zu="$feature_flag_request_id",Ju="$minimal_flag_called_events",Yu="$override_feature_flags",Xu="$override_feature_flag_payloads",el="$stored_person_properties",tl="$stored_group_properties",nl="$groups",il="$surveys",rl="$surveys_loaded_at",sl="$surveys_activated",ol="$surveys_activated_session",al="$surveys_activated_timestamps",ul="ph_product_tours",ll="$flag_call_reported",cl="$flag_call_reported_session_id",dl="$feature_flag_errors",hl="$feature_flag_evaluated_at",fl="$user_state",pl="$client_session_props",_l="$capture_rate_limit",vl="$initial_campaign_params",gl="$initial_referrer_info",ml="$initial_person_info",yl="$epp",bl="$posthog_cookieless",wl="$cookieless_mode",Sl="$sdk_debug_extensions_init_method",xl="$sdk_debug_extensions_init_time_ms",kl="$sdk_debug_recording_script_not_loaded",Cl="PostHog loadExternalDependency extension not found.",Pl="anonymous",El="identified",Fl="identified_only",Tl="visibilitychange",Il="beforeunload",Rl="$pageview",Ll="$pageleave",Al="$identify",Ml="$groupidentify";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return qr(e)&&isFinite(e)&&Math.floor(e)===e});var Ol=function(){"use strict";function e(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}e.fromFieldsV7=function(t,n,i,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>n||0>i||0>r||t>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/256,s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new e(s)};var t=e.prototype;return t.toString=function(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e},t.clone=function(){return new e(this.bytes.slice(0))},t.equals=function(e){return 0===this.compareTo(e)},t.compareTo=function(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0},e}(),$l=function(){"use strict";function e(){this._timestamp=0,this._counter=0,this._random=new Bl}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(!Ar(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(Ar(t))throw new Error("Could not generate UUID after timestamp reset");return t},t.generateOrAbort=function(){var e,t=(e=Date.now(),qr(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0);if(t>this._timestamp)this._timestamp=t,this._resetCounter();else{if(this._timestamp>=t+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return Ol.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())},t._resetCounter=function(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())},e}(),Dl=function(e){if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Pa&&!Ar(Pa.crypto)&&crypto.getRandomValues&&(Dl=function(e){return crypto.getRandomValues(e)});var ql,Bl=function(){"use strict";function e(){this._buffer=new Uint32Array(8),this._cursor=1/0}return e.prototype.nextUint32=function(){return this._buffer.length>this._cursor||(Dl(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),jl=function(){return Hl().toString()},Hl=function(){return(ql||(ql=new $l)).generate()},Nl=function(e,t){try{return JSON.stringify(e,function(e,t){return"bigint"==typeof t?t.toString():t},t)}catch(t){return yr(e)}},Vl=function(e){var t=null==Ta?void 0:Ta.createElement("a");return Ar(t)?null:(t.href=e,t)},zl=function(e,t){for(var n,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;i.length>r;r++){var s=i[r].split("=");if(s[0]===t){n=s;break}}if(!Tr(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch(e){qa.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ul=function(e,t,n){if(!e||!t||!t.length)return e;for(var i=e.split("#"),r=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],u=(o||"").split("&"),l=[],c=0;u.length>c;c++){var d=u[c].split("=");Tr(d)&&(t.includes(d[0])?l.push(d[0]+"="+n):l.push(u[c]))}var h=a;return null!=o&&(h+="?"+l.join("&")),null!=r&&(h+="#"+r),h},Wl=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Gl=function(e,t){return e>=t&&$a()},Kl=function(e,t,n,i){if(0===e){if($a()){var r=t+1;return r===n&&i(),r}return t}return 0};function Ql(e,t,n){return Nl({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}function Zl(e,t){var n,i=null==e||null==(n=e.config)?void 0:n.get_current_url;if(!Ir(i))return t;try{var r=i(t);return Mr(r)&&r?r:t}catch(e){return qa.error("Error in get_current_url, falling back to window.location.href",e),t}}function Jl(e){var t,n=null==Pa||null==(t=Pa.location)?void 0:t.href;return Ar(n)?void 0:Zl(e,n)}var Yl=function(e){if(Ta){try{for(var t=e+"=",n=Ta.cookie.split(";").filter(function(e){return e.length}),i=0;n.length>i;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},Xl="",ec=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var tc=null,nc={_is_supported:function(){if(!$r(tc))return tc;if(tc=!1,Ta)try{var e="__ph_cookie_support_"+jl();nc._set(e,"xyz"),tc='"xyz"'===Yl(e),nc._remove(e)}catch(e){tc=!1}return tc},_error:function(e){qa.error("cookieStore error: "+e)},_get:Yl,_parse:function(e){var t;try{t=JSON.parse(nc._get(e))||{}}catch(e){}return t},_set:function(e,t,n,i,r){if(!Ta)return!1;try{var s="",o="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Ta),Xl)return Xl;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),i=Math.min(n.length,8),r="dmn_chk_"+jl();!Xl&&i--;){var s=n.slice(i).join("."),o=r+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",Xl=s)}return Xl}(e);if(!n){var i=function(e){var t=e.match(ec);return t?t[0]:""}(e);i!==n&&qa.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}(Ta.location.hostname,i);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),s="; expires="+u.toUTCString()}r&&(o="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&qa.warn("cookieStore warning: large cookie, len="+l.length),Ta.cookie=l,!0}catch(e){return!1}},_remove:function(e,t){if(null!=Ta&&Ta.cookie)try{nc._set(e,"",-1,t)}catch(e){return}}},ic=null,rc={_is_supported:function(){if(!$r(ic))return ic;var e=!0;if(Ar(Pa))e=!1;else try{var t="__mplssupport__";rc._set(t,"xyz"),'"xyz"'!==rc._get(t)&&(e=!1),rc._remove(t)}catch(t){e=!1}return e||qa.error("localStorage unsupported; falling back to cookie store"),ic=e,e},_error:function(e){qa.error("localStorage error: "+e)},_get:function(e){try{return null==Pa?void 0:Pa.localStorage.getItem(e)}catch(e){rc._error(e)}return null},_parse:function(e){try{return JSON.parse(rc._get(e))||{}}catch(e){}return null},_set:function(e,t){try{return null==Pa||Pa.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rc._error(e)}return!1},_remove:function(e){try{null==Pa||Pa.localStorage.removeItem(e)}catch(e){rc._error(e)}}},sc=[el,Wu,Uu,Ku,Qu,Zu,hl,dl,ll],oc=[wu,bu,Vu,zu,yl,ml,Cu,fl],ac=function(e){return e+"_cpm"},uc=["__proto__","constructor","prototype"],lc=function(e){if(!Rr(e))return{};var t={};return Object.keys(e).forEach(function(n){-1===uc.indexOf(n)&&(t[n]=e[n])}),t},cc=function(e,t){void 0===t&&(t=[]);var n={};return[].concat(oc,t).forEach(function(t){var i=e[t];Ar(i)||$r(i)||""===i||(n[t]=i)}),n},dc=function(e){for(var t=5381,n=2166136261,i=0;e.length>i;i++){var r=e.charCodeAt(i);t=33*t^r,n=Math.imul(n^r,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},hc=function(e,t){return{p:t,f:dc(JSON.stringify(e))}},fc=function(e,t){if(!t)return{properties:[],isValid:!1};try{var n=nc._parse(ac(e)),i=(null==n?void 0:n.f)===dc(t)&&Tr(n.p);return{properties:i?n.p:[],isValid:i}}catch(e){return{properties:[],isValid:!1}}},pc=function(e,t){return t+"|"+(nc._get(ac(e))||"")},_c={},vc={_is_supported:function(){return!0},_error:function(e){qa.error("memoryStorage error: "+e)},_get:function(e){return e in _c?_c[e]:null},_parse:function(e){return e in _c?_c[e]:null},_set:function(e,t){return _c[e]=t,!0},_remove:function(e){delete _c[e]}},gc=null,mc={_is_supported:function(){if(!$r(gc))return gc;if(gc=!0,Ar(Pa))gc=!1;else try{var e="__support__";mc._set(e,"xyz"),'"xyz"'!==mc._get(e)&&(gc=!1),mc._remove(e)}catch(e){gc=!1}return gc},_error:function(e){qa.error("sessionStorage error: ",e)},_get:function(e){try{return null==Pa?void 0:Pa.sessionStorage.getItem(e)}catch(e){mc._error(e)}return null},_parse:function(e){try{return JSON.parse(mc._get(e))||null}catch(e){}return null},_set:function(e,t){try{return null==Pa||Pa.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){mc._error(e)}return!1},_remove:function(e){try{null==Pa||Pa.sessionStorage.removeItem(e)}catch(e){mc._error(e)}}},yc=Ba("[Stylesheet Loader]"),bc=Pa,wc=Ta,Sc="#020617",xc={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:Gi,widgetType:zi,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:Sc,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},kc=[Wi,Ui,Gi];function Cc(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 Pc(e){var t;void 0===e&&(e=xc.backgroundColor),"#"===e[0]&&(t=Cc(e)),e.startsWith("rgb")&&(t=e);var n={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(n&&(t=Cc(n)),!t)return Sc;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var r=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(r*r*.299+s*s*.587+o*o*.114)>127.5?Sc:"white"}return Sc}var Ec=function(e,t,n){var i=Wc(e),r=wc.querySelector("."+i);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};var s=wc.createElement("div");!function(e,t,n){var i=u({},xc,n),r=e.style,s=!kc.includes(i.position)||t===Zi&&(null==n?void 0:n.widgetType)===zi;r.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}(i.fontFamily)),r.setProperty("--ph-survey-box-padding",i.boxPadding),r.setProperty("--ph-survey-max-width",i.maxWidth),r.setProperty("--ph-survey-z-index",i.zIndex),r.setProperty("--ph-survey-border-color",i.borderColor),s?(r.setProperty("--ph-survey-border-radius",i.borderRadius),r.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(r.setProperty("--ph-survey-border-bottom","none"),r.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),r.setProperty("--ph-survey-background-color",i.backgroundColor),r.setProperty("--ph-survey-box-shadow",i.boxShadow),r.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),r.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),r.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Pc(i.submitButtonColor)),r.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),r.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),r.setProperty("--ph-survey-rating-active-text-color",Pc(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Pc(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",Pc(i.widgetColor)),r.setProperty("--ph-widget-z-index",i.zIndex);var o=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),a=o||i.inputBackground;o||"white"!==i.backgroundColor||(a="#f8f8f8"),r.setProperty("--ph-survey-input-background",a);var l=(null==n?void 0:n.inputTextColor)||Pc(a);r.setProperty("--ph-survey-input-text-color",l),r.setProperty("--ph-survey-rating-text-color",l),r.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),r.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),r.setProperty("--ph-survey-outline-color",i.outlineColor)}(s,e.type,e.appearance),s.className=i;var o=s.attachShadow({mode:"open"}),a=function(e){var t=function(e,t,n){var i=e.createElement("style");i.innerText=t;var r=function(e){var t;return Ir(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet}(n);return r&&(i=r(i)),i||(yc.error("prepare_external_dependency_stylesheet returned null"),null)}(wc,':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:calc(2147480000 + 3645);--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 #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.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){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{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);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.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{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}: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{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;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}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.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;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.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{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.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}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!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}(t);if(a){var l=o.querySelector("style");l&&o.removeChild(l),o.appendChild(a)}return(n||wc.body).appendChild(s),{shadow:o,isNewlyCreated:!0}},Fc=function(e){var t,n,i,r=e.responses,s=e.survey,o=e.surveySubmissionId,a=e.posthog,l=e.isSurveyCompleted,c=e.properties,d=e.surveyLanguage,h=e.questionSnapshots;a?(gu(s),a.capture(or,u(((t={})[ur]=s.name,t[ar]=s.id,t[lr]=s.current_iteration,t[cr]=s.current_iteration_start_date,t[dr]=o,t.$survey_completed=l,t),d&&((n={})[hr]=d,n),{sessionRecordingUrl:null==a.get_session_replay_url?void 0:a.get_session_replay_url()},Xa(r,s,h),c,{$set:(i={},i[eu(s,"responded")]=!0,i)})),l&&(bc.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:s.id}})),Uc(s),a.reloadFeatureFlags())):hu.error("[survey sent] event not captured, PostHog instance not found.")},Tc=function(e,t,n){var i,r,s,o;return u(((i={})[ur]=e.name,i[ar]=e.id,i[lr]=e.current_iteration,i[cr]=e.current_iteration_start_date,i.$survey_partially_completed=(void 0===(o=null==t?void 0:t.responses)&&(o={}),Object.values(o).some(function(e){return!Dr(e)})),i),(null==t?void 0:t.surveyLanguage)&&((r={})[hr]=t.surveyLanguage,r),((s={sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()})[dr]=null==t?void 0:t.surveySubmissionId,s),Xa(null==t?void 0:t.responses,e,null==t?void 0:t.questionSnapshots))},Ic=function(e,t,n,i){var r,s;if(t){if(!n){var o=Vc(e),a=o?o.surveyLanguage:i;t.capture(sr,u({},Tc(e,o,t),a&&((r={})[hr]=a,r),{$set:(s={},s[eu(e,"dismissed")]=!0,s)})),Uc(e),gu(e),bc.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else hu.error("[survey dismissed] event not captured, PostHog instance not found.")},Rc=function(e,t){if(t){var n=function(e){return _u("abandonedSurvey_",e)}(e);try{if("true"===localStorage.getItem(n))return}catch(e){return}var i=Vc(e);if(i){try{localStorage.setItem(n,"true")}catch(e){}t.capture("survey abandoned",Tc(e,i,t),{transport:"sendBeacon"})}}else hu.error("[survey abandoned] event not captured, PostHog instance not found.")},Lc=function(e){return e.map(function(e){return{sort:Math.floor(10*Math.random()),value:e}}).sort(function(e,t){return e.sort-t.sort}).map(function(e){return e.value})},Ac=function(e,t){return e.length===t.length&&e.every(function(e,n){return e===t[n]})?t.reverse():t},Mc=function(e){var t=e.map(function(e){return e.id});return t.every(function(e){return!!e})?t:void 0},Oc=function(e,t){var n;return function(e){return e.questions.some(function(e){var t;return!(null==(t=e.branching)||!t.type)})}(e)?e.questions:t?null!==(n=function(e,t){if(!t||t.length!==e.questions.length)return null;for(var n,i=new Map(e.questions.map(function(e){return[e.id,e]})),r=[],s=d(t);!(n=s()).done;){var o=i.get(n.value);if(!o)return null;r.push(o)}return r}(e,t.questionOrder))&&void 0!==n?n:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Ac(e.questions,Lc(e.questions)):e.questions},$c=function(e){return au(e)||zc(e)},Dc=function(){function e(t){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,ei(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),t.children}return e.__c="__cC"+P++,e.__={isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){},onPreviewBack:function(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null},e.Provider=e.__l=(e.Consumer=function(e,t){return e.children(t)}).contextType=e,e}(),qc=function(){return Li(Dc)},Bc=function(e){var t=e.children,n=e.style;return function(e,t,n){var i,r,s,o,a=Wn({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?r=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?c.call(arguments,2):n),Qn(e.type,a,i||e.key,r||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:n}:{children:t,style:n})};function jc(e,t){var n,i;if(null==(n=e.conditions)||!n.url)return!0;var r,s=Jl(t);return!!s&&cu[r=null==(i=e.conditions)?void 0:i.urlMatchType,null!=r?r:"icontains"]([e.conditions.url],[s])}var Hc=function(e){return _u("inProgressSurvey_",e)},Nc=function(e,t){try{localStorage.setItem(Hc(e),JSON.stringify(t))}catch(e){hu.error("Error setting in-progress survey state in localStorage",e)}},Vc=function(e){try{var t=localStorage.getItem(Hc(e));if(t)return JSON.parse(t)}catch(e){hu.error("Error getting in-progress survey state from localStorage",e)}return null},zc=function(e){var t=Vc(e);return!Dr(null==t?void 0:t.surveySubmissionId)},Uc=function(e){try{localStorage.removeItem(Hc(e))}catch(e){hu.error("Error clearing in-progress survey state from localStorage",e)}};function Wc(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}function Gc(e,t,n){if(void 0===t&&(t=Gi),e===Ji)return{};switch(t){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ui:return{left:"30px"};case Wi:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Zi&&n===zi?"60px":"30px"}}}var Kc=0;function Qc(e,t,n,i,r,s){t||(t={});var o,a,u=t;if("ref"in u)for(a in u={},t)"ref"==a?o=t[a]:u[a]=t[a];var l={type:e,props:u,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Kc,__i:-1,__u:0,__source:r,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return h.vnode&&h.vnode(l),l}var Zc=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("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"})}),Jc=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("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"})}),Yc=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("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"})}),Xc=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("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"})}),ed=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Qc("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"})}),td=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Qc("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"})}),nd=Qc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Qc("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"})}),id=Qc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Qc("g",{"clip-path":"url(#clip0_2415_6911)",children:[Qc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Qc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Qc("g",{mask:"url(#mask0_2415_6911)",children:[Qc("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"}),Qc("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"}),Qc("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"}),Qc("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"}),Qc("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"}),Qc("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"})]})]}),Qc("defs",{children:Qc("clipPath",{id:"clip0_2415_6911",children:Qc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function rd(e){var t=e.urlParams,n=t?Object.entries(t).map(function(e){var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)}).join("&"):"";return Qc("a",{href:"https://posthog.com/surveys"+(n?"?"+n:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",id]})}function sd(e){var t=e.text,n=e.submitDisabled,i=e.appearance,r=e.onSubmit,s=e.link,o=e.onPreviewSubmit,a=e.skipSubmitButton,u=e.canGoBack,l=e.onBack,c=Li(Dc).isPreviewMode,d=!!u&&!!l,h=!a&&Qc("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick:function(){s&&(null==Pa||Pa.open(s)),c?null==o||o():r()},children:t});return Qc("div",{className:"bottom-section",children:[d?Qc("div",{className:"form-buttons form-buttons-with-back",children:[Qc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:i.backButtonText||"Back"}),h]}):h,!i.whiteLabel&&Qc(rd,{urlParams:{utm_source:"survey-footer"}})]})}function od(e){var t=e.question,n=e.forceDisableHtml;return Qc("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Qc(t.type===Yi?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&Bc({component:Kn("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!n&&"text"!==t.descriptionContentType})]})}function ad(e){var t,n,i;return Qc("button",{className:"form-cancel",onClick:e.onClick,disabled:Li(Dc).isPreviewMode,"aria-label":"Close survey",type:"button",children:(t={fill:"black"},n=(void 0===t?{}:t).fill,i=void 0===n?"currentColor":n,Qc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Qc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Qc("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:i})]}))})}var ud=Pa;function ld(e){var t=e.header,n=e.description,i=e.contentType,r=e.forceDisableHtml,s=e.appearance,o=e.onClose,a=Li(Dc).isPopup;return Ti(function(){var e=function(e){"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Qa(ud,"keydown",e),function(){ud.removeEventListener("keydown",e)}},[o]),Qc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Qc(ad,{onClick:function(){return o()}}),Qc("h3",{className:"thank-you-message-header",children:t}),n&&Bc({component:Kn("p",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i}),a&&Qc(sd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:function(){return o()}})]})}function cd(e){var t=e.header,n=e.description,i=e.contentType,r=e.forceDisableHtml,s=e.appearance,o=e.onStart,a=Li(Dc),u=a.onPreviewSubmit,l=a.onPopupSurveyDismissed;return Qc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Qc(ad,{onClick:function(){return l()}}),t&&Qc("h3",{className:"intro-screen-header",children:t}),n&&Bc({component:Kn("p",{className:"intro-screen-body"}),children:n,renderAsHtml:!r&&"text"!==i}),Qc(sd,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:function(){return u(null)}})]})}var dd=function(e){return Tr(e)&&e.every(function(e){return Mr(e)})};function hd(e){var t=e.question,n=e.forceDisableHtml,i=e.appearance,r=e.onSubmit,s=e.onPreviewSubmit,o=e.displayQuestionIndex,a=e.initialValue,u=e.canGoBack,l=e.onBack,c=qc().isPreviewMode,h=Ii(null),f=Fi(function(){return Mr(a)?a:""}),p=f[0],_=f[1],v=null==i?void 0:i.disableAutofocus;Ti(function(){v||setTimeout(function(){var e;c||null==(e=h.current)||e.focus()},100)},[c,v]);var g="surveyQuestion"+o,m=Ri(function(){return function(e,t,n){var i,r,s=e.trim();if(!n&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o,a=d(t);!(o=a()).done;){var u=o.value;switch(u.type){case Sr:if(void 0!==u.value&&u.value>s.length)return null!==(i=u.errorMessage)&&void 0!==i?i:"Please enter at least "+u.value+" characters";break;case xr:if(void 0!==u.value&&s.length>u.value)return null!==(r=u.errorMessage)&&void 0!==r?r:"Please enter no more than "+u.value+" characters"}}return!1}(p,t.validation,t.optional)},[p,t.validation,t.optional]),y=Sa(t.validation,Sr),b=Sa(t.validation,xr),w=Ri(function(){return function(e,t){var n=1===e?void 0:e;return n&&t?"Enter "+n+"-"+t+" characters":n?"Enter at least "+n+" "+(1===n?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(y,b)},[y,b]),S=function(){m||r(p.trim())},x=function(){m||s(p.trim())};return Qc(Zn,{children:[Qc("div",{className:"question-container",children:[Qc(od,{question:t,forceDisableHtml:n,htmlFor:g}),Qc("textarea",{ref:h,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput:function(e){_(e.currentTarget.value),e.stopPropagation()},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||m||(e.preventDefault(),c?x():S())},value:p}),w&&Qc("div",{className:"validation-hint",children:w})]}),Qc(sd,{text:t.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:S,onPreviewSubmit:x,canGoBack:u,onBack:l})]})}function fd(e){var t=e.question,n=e.appearance,i=e.onSubmit,r=e.onPreviewSubmit,s=e.canGoBack,o=e.onBack;return Qc(Zn,{children:[Qc("div",{className:"question-container",children:Qc(od,{question:t,forceDisableHtml:e.forceDisableHtml})}),Qc(sd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:function(){return i("link clicked")},onPreviewSubmit:function(){return r("link clicked")},canGoBack:s,onBack:o})]})}function pd(e){var t,n=e.question,i=e.forceDisableHtml,r=e.displayQuestionIndex,s=e.appearance,o=e.onSubmit,a=e.onPreviewSubmit,u=e.initialValue,l=e.canGoBack,c=e.onBack,d=n.scale,h=10===n.scale?0:1,f=Fi(function(){return qr(u)?u:Tr(u)&&u.length>0&&qr(parseInt(u[0]))?parseInt(u[0]):Mr(u)&&qr(parseInt(u))?parseInt(u):null}),p=f[0],_=f[1],v="emoji"===n.display&&2===n.scale,g=qc().isPreviewMode,m=function(e){return g?a(e):o(e)};return Qc(Zn,{children:[Qc("div",{className:"question-container",children:[Qc(od,{question:n,forceDisableHtml:i}),Qc("div",{className:"rating-section",children:[Qc("div",{className:"rating-options",children:["emoji"===n.display&&Qc("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=bd[n.scale])?void 0:t.map(function(e,t){return Qc("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+r+"-rating-"+t+" "+(t+1===p?"rating-active":""),value:t+1,type:"button",onClick:function(){var e=t+1;_(e),n.skipSubmitButton&&m(e)},children:e},t)})}),"number"===n.display&&Qc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-h+1)+", minmax(0, 1fr))"},children:wd(n.scale).map(function(e,t){return Qc(_d,{displayQuestionIndex:r,active:p===e,appearance:s,num:e,setActiveNumber:function(e){_(e),n.skipSubmitButton&&m(e)}},t)})})]}),!v&&Qc("div",{className:"rating-text",children:[Qc("div",{children:n.lowerBoundLabel}),Qc("div",{children:n.upperBoundLabel})]})]})]}),Qc(sd,{text:n.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:$r(p)&&!n.optional,appearance:s,onSubmit:function(){return o(p)},onPreviewSubmit:function(){return a(p)},skipSubmitButton:n.skipSubmitButton,canGoBack:l,onBack:c})]})}function _d(e){var t=e.num,n=e.setActiveNumber;return Qc("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick:function(){n(t)},children:t})}function vd(e){var t=e.question,n=e.forceDisableHtml,i=e.displayQuestionIndex,r=e.appearance,s=e.onSubmit,o=e.onPreviewSubmit,a=e.initialValue,l=e.canGoBack,c=e.onBack,d=Ii(null),h=Ri(function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var i=Ac(t,Lc(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i}(t)},[t]),f=Fi(function(){return function(e,t){return Mr(e)||dd(e)?e:t===er?null:[]}(a,t.type)}),p=f[0],_=f[1],v=Fi(function(){return function(e,t){if(Mr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(dd(e)){var n=e.find(function(e){return!t.includes(e)});if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}}(a,h)}),g=v[0],m=v[1],y=qc().isPreviewMode,b=t.type===er,w=t.type===Xi,S=t.skipSubmitButton&&b&&!t.hasOpenChoice,x=function(e,t){if(t){var n=!g.isSelected;return m(function(e){return u({},e,{isSelected:n,inputValue:n?e.inputValue:""})}),b&&_(""),void(n&&setTimeout(function(){var e;return null==(e=d.current)?void 0:e.focus()},75))}if(b)return _(e),m(function(e){return u({},e,{isSelected:!1,inputValue:""})}),void(S&&(s(e),y&&o(e)));w&&Tr(p)&&(p.includes(e)?_(p.filter(function(t){return t!==e})):_([].concat(p,[e])))},k=function(e){e.stopPropagation();var t=e.currentTarget.value;m(function(e){return u({},e,{inputValue:t})}),b&&_(t)},C=function(e){e.stopPropagation(),"Enter"!==e.key||P()||(e.preventDefault(),E()),"Escape"===e.key&&(e.preventDefault(),m(function(e){return u({},e,{isSelected:!1,inputValue:""})}),b&&_(null))},P=function(){return!(t.optional||!$r(p)&&(!Tr(p)||g.isSelected||0!==p.length)&&(!g.isSelected||""!==g.inputValue.trim()))},E=function(){g.isSelected&&w?Tr(p)&&(y?o([].concat(p,[g.inputValue])):s([].concat(p,[g.inputValue]))):y?o(p):s(p)};return Qc(Zn,{children:[Qc("div",{className:"question-container",children:[Qc(od,{question:t,forceDisableHtml:n}),Qc("fieldset",{className:"multiple-choice-options limit-height",children:[Qc("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),h.map(function(e,n){var r=!!t.hasOpenChoice&&n===t.choices.length-1,s="surveyQuestion"+i+"Choice"+n,o=s+"Open",a=r?g.isSelected:b?p===e:Tr(p)&&p.includes(e);return Qc("label",{className:r?"choice-option-open":"",children:[Qc("div",{className:"response-choice",children:[Qc("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:function(){return x(e,r)},id:s,"aria-controls":o}),Qc("span",{children:r?e+":":e})]}),r&&Qc("input",{type:"text",ref:d,id:o,name:"question"+i+"Open",value:g.inputValue,onKeyDown:C,onInput:k,onClick:function(t){g.isSelected||x(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},n)})]})]}),Qc(sd,{text:t.buttonText||"Submit",submitDisabled:P(),appearance:r,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:S,canGoBack:l,onBack:c})]})}var gd=[1,2,3,4,5],md=[1,2,3,4,5,6,7],yd=[0,1,2,3,4,5,6,7,8,9,10],bd={2:[td,nd],3:[Yc,Jc,Zc],5:[Xc,Yc,Jc,Zc,ed]};function wd(e){switch(e){case 5:default:return gd;case 7:return md;case 10:return yd}}var Sd=Ba("[Surveys]");function xd(e,t,n){var i,r=e.questions[t],s=t+1;if(null==(i=r.branching)||!i.type)return t===e.questions.length-1?nr:s;if(r.branching.type===nr)return nr;if("specific_question"===r.branching.type){if(Number.isInteger(r.branching.index))return r.branching.index}else if("response_based"===r.branching.type){if(r.type===er){var o,a=r.choices.indexOf(""+n);if(-1===a&&r.hasOpenChoice&&(a=r.choices.length-1),null!=(o=r.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var u=r.branching.responseValues[a];return Number.isInteger(u)?u:u===nr?nr:s}}else if(r.type===tr){var l;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||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(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(n,r.scale);if(null!=(l=r.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=r.branching.responseValues[c];return Number.isInteger(d)?d:d===nr?nr:s}}return s}return Sd.warn("Falling back to next question index due to unexpected branching type"),s}var kd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Cd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat(kd),Pd="<masked>",Ed=["li_fat_id"];function Fd(e,t,n){if(!Ta)return{};var i,r=t?[].concat(kd,n||[]):[],s=Td(Ul(Ta.URL,r,Pd),e);return Na((i={},Ha(Ed,function(e){var t=Yl(e);i[e]=t||null}),i),s)}function Td(e,t){var n=Cd.concat(t||[]),i={};return Ha(n,function(t){var n=zl(e,t);i[t]=n||null}),i}function Id(e){var t=function(e){return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",i={};if(!$r(t)){i.$search_engine=t;var r=Ta?zl(Ta.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function Rd(){return navigator.language||navigator.userLanguage}var Ld="$direct";function Ad(){return(null==Ta?void 0:Ta.referrer)||Ld}function Md(e,t,n){var i;void 0===n&&(n=!1);var r=e?[].concat(kd,t||[]):[],s=null==(i=n?lo(null==Ia?void 0:Ia.href):null==Ia?void 0:Ia.href)?void 0:i.substring(0,1e3);return{r:Ad().substring(0,1e3),u:s?Ul(s,r,Pd):void 0}}function Od(e,t){var n;void 0===t&&(t=!1);var i=e.r,r=e.u,s=t?lo(r):r,o={$referrer:i,$referring_domain:null==i?void 0:i==Ld?Ld:null==(n=Vl(i))?void 0:n.host};if(s){o.$current_url=s;var a=Vl(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,Na(o,Td(s))}return i&&Na(o,Id(i)),o}function $d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Dd(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var qd=Ba("[SurveyTranslations]");function Bd(e,t){var n=function(e){return function(e,t){var n=e.storedPersonProperties,i=e.locale,r=tu(e.overrideLanguage);if(r)return null==t||t.info("Using override display language: "+r),r;var s=function(e){return e&&"object"==typeof e&&"language"in e?tu(e.language):null}(n);if(s)return null==t||t.info("Using person property language: "+s),s;var o=tu(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:Ir(e.get_property)?e.get_property(el):void 0,locale:Rd()},qd)}(t);if(!n)return qd.info("No user language detected"),{survey:e,language:null};var i=su(e,n,qd);return{survey:i.survey,language:i.matchedKey}}var jd=Pa,Hd=Ta,Nd="ph:show_survey_widget",Vd="PHWidgetSurveyClickListener";function zd(e,t){try{var n=e.getBoundingClientRect(),i=jd.innerHeight,r=jd.innerWidth,s=n.left+n.width/2-t/2;s+t>r-20&&(s=r-t-20),20>s&&(s=20);var o=i-n.bottom,a=250>o&&n.top>o;return{position:"fixed",top:a?"auto":n.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-n.top+12+"px":"auto",zIndex:xc.zIndex}}catch(e){return hu.warn("Failed to calculate trigger position:",e),null}}var Ud=function(){"use strict";function e(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._renderedTargets=new Map,this._prefillHandledSurveys=new Set,this._currentLanguage=null,this._surveyIsRendered=!1,this._languageChangeListener=null,this._unsubscribeFeatureFlags=null,this._surveyPopupProps=null,this.handlePageUnload=function(){var e=t._posthog.get_property(il);if(e)for(var n,i=d(e);!(n=i()).done;){var r=n.value;zc(r)&&Rc(r,t._posthog)}},this.handlePopoverSurvey=function(e,n,i){var r,s,o,a,l,c=(void 0===i?{}:i).resumeDelayFromActivation,d=void 0!==c&&c,h=t._translateSurveyForRendering(e),f=h.survey,p=h.language;t._currentLanguage=p,t._surveyPopupProps=null,t._displayOptions=n;var _=t._applyDisplayOverrides(f,n);t._clearSurveyTimeout(_.id);var v=null!=n?n:{},g=v.properties,m=v.initialResponses,y=!(!m||0>=Object.keys(m).length)&&t._handleInitialResponses(_,m,g,p);if(!y||null!=(r=_.appearance)&&r.displayThankYouMessage){t._addSurveyToFocus(_);var b={};if((null==(s=_.appearance)?void 0:s.position)===Ki&&null!=(o=_.appearance)&&o.widgetSelector){var w,S=Hd.querySelector(_.appearance.widgetSelector);S&&(b=zd(S,parseInt((null==(w=_.appearance)?void 0:w.maxWidth)||xc.maxWidth))||{})}var x=(null==(a=_.appearance)?void 0:a.surveyPopupDelaySeconds)||0,k=Ec(_,t._posthog).shadow;t._renderedTargets.set(k,k.host);var C={posthog:t._posthog,survey:_,removeSurveyFromFocus:t._removeSurveyFromFocus,properties:g,style:b,isSurveyCompleted:y,skipShownEvent:null==n?void 0:n.skipShownEvent,surveyLanguage:p};if(t._surveyPopupProps=C,0>=x)return t._surveyIsRendered=!0,gi(Qc(Zd,u({},C)),k);var P=function(){if(!t._shouldDisplaySurvey(_))return hu.info("Survey "+_.id+" no longer eligible when its display delay elapsed; not displaying"),t._removeSurveyFromFocus(_);!function(){t._surveyIsRendered=!0;var i=t._translateSurveyForRendering(e),r=i.survey,s=i.language;t._currentLanguage=s;var o=t._applyDisplayOverrides(r,n),a=u({},C,{survey:o,surveyLanguage:s});t._surveyPopupProps=a,gi(Qc(Zd,u({},a,{survey:u({},o,{appearance:u({},o.appearance,{surveyPopupDelaySeconds:0})})})),k)}()},E=d?null==(l=t._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(_.id):void 0,F=qr(E)?Math.max(0,Date.now()-E):0,T=Math.max(0,1e3*x-F);if(0>=T)return P();var I=jd.setTimeout(function(){t._surveyTimeouts.delete(_.id),P()},T);t._surveyTimeouts.set(_.id,I)}},this._handleWidget=function(e){var n=t._translateSurveyForRendering(e),i=n.survey,r=n.language,s=Ec(i,t._posthog),o=s.shadow,a=s.isNewlyCreated;t._renderedTargets.set(o,o.host),a&&gi(Qc(Yd,{posthog:t._posthog,survey:i,surveyLanguage:r},e.id),o)},this._detachWidgetSelectorListener=function(e){var n=t._widgetSelectorListeners.get(e);n&&(n.element.removeEventListener("click",n.listener),n.element.removeAttribute(Vd),t._widgetSelectorListeners.delete(e),hu.info("Removed click listener for survey "+e))},this._removeWidgetSelectorListener=function(e){t._isWidgetSurveyOpen(e)||(t._removeSurveyFromDom(e),t._detachWidgetSelectorListener(e.id))},this._isWidgetSurveyOpen=function(e){try{var t;return!(null==(t=Hd.querySelector(Wc(e,!0)))||null==(t=t.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this._manageWidgetSelectorListener=function(e,n){var i=Hd.querySelector(n),r=t._widgetSelectorListeners.get(e.id);if(i){if(t._handleWidget(e),r){if(i===r.element)return;hu.info("Selector element changed for survey "+e.id+". Re-attaching listener."),t._detachWidgetSelectorListener(e.id)}if(!i.hasAttribute(Vd)){var s=function(t){var n,i;t.stopPropagation();var r=(null==(n=e.appearance)?void 0:n.position)===Ki?zd(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||xc.maxWidth)):{};jd.dispatchEvent(new CustomEvent(Nd,{detail:{surveyId:e.id,position:r}}))};Qa(i,"click",s),i.setAttribute(Vd,"true"),t._widgetSelectorListeners.set(e.id,{element:i,listener:s,survey:e}),hu.info("Attached click listener for feedback button survey "+e.id)}}else r&&t._removeWidgetSelectorListener(e)},this.renderPopover=function(e){var n=t._translateSurveyForRendering(e),i=n.survey,r=n.language,s=Ec(i,t._posthog).shadow;t._renderedTargets.set(s,s.host),gi(Qc(Zd,{posthog:t._posthog,survey:i,removeSurveyFromFocus:t._removeSurveyFromFocus,surveyLanguage:r}),s)},this.renderSurvey=function(e,n,i){var r,s=t._translateSurveyForRendering(e),o=s.survey,a=s.language,u=!1;null!=(r=t._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(u=t._handleUrlPrefill(o,a,i)),gi(Qc(Zd,{posthog:t._posthog,survey:o,removeSurveyFromFocus:t._removeSurveyFromFocus,isPopup:!1,properties:i,isSurveyCompleted:u,surveyLanguage:a}),n)},this.getActiveMatchingSurveys=function(e,n){var i;void 0===n&&(n=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys(function(n){e(n.filter(function(e){return t._shouldDisplaySurvey(e)}))},n)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys(function(e){for(var n=e.filter(function(e){return e.type===Qi||e.type===Zi}),i=new Set(n.map(function(e){return e.id})),r=0,s=Array.from(t._surveyTimeouts.keys());s.length>r;r++){var o=s[r];i.has(o)||t.cancelSurvey(o)}var a=t._sortSurveysByAppearanceDelay(n),u=new Set;a.forEach(function(e){if(e.type===Zi){var n,i,r,s;if((null==(n=e.appearance)?void 0:n.widgetType)===zi)return void t._handleWidget(e);"selector"===(null==(i=e.appearance)?void 0:i.widgetType)&&null!=(r=e.appearance)&&r.widgetSelector&&(u.add(e.id),t._manageWidgetSelectorListener(e,null==(s=e.appearance)?void 0:s.widgetSelector))}$r(t._surveyInFocus)&&e.type===Qi&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})}),t._widgetSelectorListeners.forEach(function(e){var n=e.survey;u.has(n.id)||t._removeWidgetSelectorListener(n)})},e)},this._addSurveyToFocus=function(e){$r(t._surveyInFocus)||hu.error("Survey "+t._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),t._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){t._surveyInFocus!==e.id&&hu.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),t._clearSurveyTimeout(e.id),t._surveyInFocus=null,t._currentLanguage=null,t._surveyIsRendered=!1,t._surveyPopupProps=null,t._displayOptions=void 0,t._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null,this._languageChangeListener=function(){return t._onLanguageChange()},Qa(jd,"languagechange",this._languageChangeListener),this._unsubscribeFeatureFlags=e.onFeatureFlags(function(){return t._onLanguageChange()})}var t=e.prototype;return t._onLanguageChange=function(){var e,t=this;if(!$r(this._surveyInFocus)){var n=null==(e=this._posthog.get_property(il))?void 0:e.find(function(e){return e.id===t._surveyInFocus});if(n){var i=this._translateSurveyForRendering(n),r=i.survey,s=i.language;if(s!==this._currentLanguage&&(this._currentLanguage=s,this._surveyIsRendered)){var o=this._applyDisplayOverrides(r,this._displayOptions),a=Ec(o,this._posthog).shadow;gi(Qc(Zd,u({},this._surveyPopupProps,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyLanguage:s})),a)}}}},t._applyDisplayOverrides=function(e,t){return null!=t&&t.position||null!=t&&t.selector?u({},e,{appearance:u({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e},t._clearSurveyTimeout=function(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))},t.cancelSurvey=function(e){this._surveyTimeouts.has(e)&&(hu.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null,this._currentLanguage=null,this._surveyIsRendered=!1,this._surveyPopupProps=null,this._displayOptions=void 0))},t.setAutomaticDisplayDispose=function(e){this._automaticDisplayDispose=e},t.dispose=function(){var e,t=this;null==(e=this._automaticDisplayDispose)||e.call(this),this._automaticDisplayDispose=void 0,this._languageChangeListener&&(jd.removeEventListener("languagechange",this._languageChangeListener),this._languageChangeListener=null),this._unsubscribeFeatureFlags&&(this._unsubscribeFeatureFlags(),this._unsubscribeFeatureFlags=null),this._surveyTimeouts.forEach(function(e,n){return t._clearSurveyTimeout(n)}),this._widgetSelectorListeners.forEach(function(e,n){return t._detachWidgetSelectorListener(n)}),this._renderedTargets.forEach(function(e,t){gi(null,t),null==e||e.remove()}),this._renderedTargets.clear(),this._surveyInFocus=null},t._sortSurveysByAppearanceDelay=function(e){return e.sort(function(e,t){var n,i,r=zc(e),s=zc(t);if(r&&!s)return-1;if(!r&&s)return 1;var o=e.schedule===ir,a=t.schedule===ir;return o&&!a?1:!o&&a?-1:((null==(n=e.appearance)?void 0:n.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)})},t._translateSurveyForRendering=function(e){return Bd(e,this._posthog)},t._handleUrlPrefill=function(e,t,n){if(this._prefillHandledSurveys.has(e.id))return!1;var i=function(e){var t={},n=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:n};for(var r,s=d(i.split("&"));!(r=s()).done;){var o=r.value.split("="),a=o[0],u=o[1];if(a&&!Ar(u)){var l=decodeURIComponent(a),c=decodeURIComponent(u);if("auto_submit"!==l||"true"!==c){var h=l.match(/^q(\d+)$/);if(h){var f=parseInt(h[1],10);t[f]||(t[f]=[]),t[f].push(c)}}else n=!0}}return{params:t,autoSubmit:n}}(jd.location.search).params;if(0===Object.keys(i).length)return!1;hu.info("[Survey Prefill] Detected URL prefill parameters");var r=this._processPrefillData(e,i,t);return!!r&&(this._autoSubmitPrefilledResponses(e,r,n,t),this._prefillHandledSurveys.add(e.id),r.isSurveyCompleted)},t._autoSubmitPrefilledResponses=function(e,t,n,i){var r=t.responses,s=t.submissionId,o=t.isSurveyCompleted,a=t.skippedResponses;(Object.keys(a).length>0&&e.enable_partial_responses||o)&&Fc({responses:o?r:a,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:n,surveyLanguage:i})},t._handleInitialResponses=function(e,t,n,i){for(var r={},s=0,o=Object.entries(t);o.length>s;s++){var a=o[s],u=a[1];r[parseInt(a[0])]=Tr(u)?u.map(String):[String(u)]}hu.info("[Survey] Processing initial responses");var l=this._processPrefillData(e,r,i);return!!l&&(this._autoSubmitPrefilledResponses(e,l,n,i),l.isSurveyCompleted)},t._processPrefillData=function(e,t,n){try{var i=function(e,t){var n={};return e.questions.forEach(function(e,i){if(t[i]&&e.id){var r=t[i],s=Ja(e.id);try{switch(e.type){case er:if(!e.choices||0===e.choices.length)return void qa.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(r[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void qa.warn("[Survey Prefill] Invalid choice index for q"+i+": "+r[0]);n[s]=e.choices[o];break;case Xi:if(!e.choices||0===e.choices.length)return void qa.warn("[Survey Prefill] Question "+i+" has no choices");var a=r.map(function(e){return parseInt(e,10)}).filter(function(t){return!isNaN(t)&&t>=0&&e.choices.length>t});if(0===a.length)return void qa.warn("[Survey Prefill] No valid choices for q"+i);var u=[].concat(new Set(a.map(function(t){return e.choices[t]})));a.length>u.length&&qa.warn("[Survey Prefill] Removed duplicate choices for q"+i),n[s]=u;break;case tr:var l=parseInt(r[0],10),c=e.scale||10;if(isNaN(l)||0>l||l>c)return void qa.warn("[Survey Prefill] Invalid rating for q"+i+": "+r[0]+" (scale: 0-"+c+")");n[s]=l;break;default:qa.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){qa.error("[Survey Prefill] Error converting q"+i+":",e)}}}),n}(e,t);if(0===Object.keys(i).length)return hu.warn("[Survey Prefill] No valid responses after conversion"),null;var r=jl(),s=function(e,t,n){for(var i=0,r={},s=[],o=e.questions.length+1,a=0;e.questions.length>i&&o>a&&(a++,t.includes(i));){var u=e.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=Ja(u.id);Ar(n[l])||(r[l]=n[l])}s.push(i);var c=xd(e,i,u.id?n[Ja(u.id)]:null);if(c===nr)return{startQuestionIndex:e.questions.length,skippedResponses:r,skippedIndices:s};i=c}return{startQuestionIndex:i,skippedResponses:r,skippedIndices:s}}(e,Object.keys(t).map(function(e){return parseInt(e,10)}),i),o=s.startQuestionIndex,a=s.skippedResponses,u=s.skippedIndices,l=o>=e.questions.length;return Nc(e,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:Mc(e.questions),visitedIndices:u,surveyLanguage:n}),hu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:a}}catch(e){return hu.error("[Survey Prefill] Error handling prefill:",e),null}},t._isSurveyFeatureFlagEnabled=function(e,t){if(void 0===t&&(t=void 0),!e)return!0;var n=this._featureFlags,i=!(null==n||!n.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),r=!0;return t&&(r=(null==n?void 0:n.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),i&&r},t._isSurveyConditionMatched=function(e){return!e.conditions||jc(e,this._posthog)&&function(e){var t,n;return function(e,t){var n,i,r;if(!e||0===e.length)return!0;if(!Oa)return!1;var s=Xs(Oa,{userAgentDataPlatform:null==Fa||null==(n=Fa.userAgentData)?void 0:n.platform,maxTouchPoints:null==Fa?void 0:Fa.maxTouchPoints,screenWidth:null==Pa||null==(i=Pa.screen)?void 0:i.width,screenHeight:null==Pa||null==(r=Pa.screen)?void 0:r.height,devicePixelRatio:null==Pa?void 0:Pa.devicePixelRatio});return cu[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==wc||!wc.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){var t;return $c(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this._featureFlags)&&t.hasLoadedFlags?{satisfied:this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}},t.checkSurveyEligibility=function(e){var t,n,i={eligible:!0,reason:void 0};if(!fu(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!mu.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 r=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this._isSurveyFeatureFlagEnabled(e.linked_flag_key,r))return i.eligible=!1,i.reason=r?"Survey linked feature flag is not enabled for variant "+r:"Survey linked feature flag is not enabled",i;if(!this._isSurveyFeatureFlagEnabled(e.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this._internalFlagCheckSatisfied(e);return o.satisfied?function(e,t){if(!e||!t)return!0;var n="string"==typeof t?new Date(t):t,i=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(i/864e5)>e}(null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays,rc._get("lastSeenSurveyDate"))?function(e){return!!rc._get(vu(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=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)},t.checkSurveyRenderability=function(e){var t=this.checkSurveyEligibility(e);return t.eligible&&!this._hasActionOrEventTriggeredSurvey(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t},t._hasActionOrEventTriggeredSurvey=function(e){var t;return!ou(e)&&!pu(e)||!(null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)||null==(t=t.getSurveys())||!t.includes(e.id))},t._checkFlags=function(e){var t,n=this;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every(function(e){var t=e.value;return!e.key||!t||n._isSurveyFeatureFlagEnabled(t)})},t._shouldDisplaySurvey=function(e){return this.checkSurveyEligibility(e).eligible&&this._isSurveyConditionMatched(e)&&this._hasActionOrEventTriggeredSurvey(e)&&this._checkFlags(e)},t._removeSurveyFromDom=function(e){try{var t=Hd.querySelector(Wc(e,!0));null!=t&&t.shadowRoot&&(gi(null,t.shadowRoot),this._renderedTargets.delete(t.shadowRoot)),null==t||t.remove()}catch(t){hu.warn("Failed to remove survey "+e.id+" from DOM:",t)}},t.getTestAPI=function(){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),onLanguageChange:this._onLanguageChange.bind(this),currentLanguage:this._currentLanguage,surveyIsRendered:this._surveyIsRendered}},o(e,[{key:"_featureFlags",get:function(){var e,t,n;return null!==(e=null==(t=(n=this._posthog).getExtension)?void 0:t.call(n,"featureFlags"))&&void 0!==e?e:this._posthog.featureFlags}}])}();function Wd(e,t){if(Hd&&jd){var n,i=new Ud(e);if(e.config.disable_surveys_automatic_display)return hu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return hu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var r=function(){Ar(n)&&(n=setInterval(function(){i.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=function(){Ar(n)||(clearInterval(n),n=void 0)};r();var o=function(){Hd.hidden?s():(i.callSurveysAndEvaluateDisplayLogic(!1),r())};return Qa(Hd,"visibilitychange",o),i.setAutomaticDisplayDispose(function(){s(),Hd.removeEventListener("visibilitychange",o)}),i}}function Gd(e){var t=e.survey,n=e.removeSurveyFromFocus,i=void 0===n?function(){}:n,r=e.setSurveyVisible,s=e.isPreviewMode,o=void 0!==s&&s,a=e.posthog;Ti(function(){var e;if(!o&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===Zi,s=jc(t,a),o=(null==(e=t.appearance)?void 0:e.widgetType)===zi&&n;if(!s)return hu.info("Hiding survey "+t.id+" because URL does not match"),r(!1),i(t);o&&(hu.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),r(!0))};Qa(jd,"popstate",n),Qa(jd,"hashchange",n);var s=jd.history.pushState,u=jd.history.replaceState;return jd.history.pushState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];s.apply(this,t),n()},jd.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];u.apply(this,t),n()},function(){jd.removeEventListener("popstate",n),jd.removeEventListener("hashchange",n),jd.history.pushState=s,jd.history.replaceState=u}}},[o,t,i,r,a])}var Kd=200;function Qd(e){switch(void 0===e&&(e="right"),e){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Zd(e){var t,n,i,r,s,o,a,l,c,d,h,f,p=e.survey,_=e.forceDisableHtml,v=e.posthog,g=e.style,m=void 0===g?{}:g,y=e.previewPageIndex,b=e.removeSurveyFromFocus,w=void 0===b?function(){}:b,S=e.isPopup,x=void 0===S||S,k=e.onPreviewSubmit,C=void 0===k?function(){}:k,P=e.onPreviewBack,E=void 0===P?function(){}:P,F=e.onPopupSurveyDismissed,T=void 0===F?function(){}:F,I=e.onCloseConfirmationMessage,R=void 0===I?function(){}:I,L=e.properties,A=e.isSurveyCompleted,M=e.skipShownEvent,O=e.surveyLanguage,D=Ii(null),q=Number.isInteger(y),B=function(e,t,n,i,r,s,o,a,l){var c=Fi(i||0===n||e.type===Ji),d=c[0],h=c[1],f=Fi(!1),p=f[0],_=f[1],v=Ii(!1),g=function(){var t=function(){s&&r(e),h(!1)};if(!v.current){var n=null==o?void 0:o.current;n?(v.current=!0,n.style.transition="opacity "+Kd+"ms ease-out",n.style.opacity="0",setTimeout(function(){v.current=!1,t()},250)):t()}},m=function(t){t.detail.surveyId===e.id&&g()};return Ti(function(){if(t){if(!i){var r,s=function(t){var n,i;if(t.detail.surveyId===e.id){if(null==(n=e.appearance)||!n.displayThankYouMessage)return g();_(!0),null!=(i=e.appearance)&&i.autoDisappear&&(r&&clearTimeout(r),r=setTimeout(g,5e3))}},o=function(){var n,i;if(jc(e,t)){h(!0),jd.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(rr,u(((n={})[ur]=e.name,n[ar]=e.id,n[lr]=e.current_iteration,n[cr]=e.current_iteration_start_date,n),l&&((i={})[hr]=l,i),{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};Qa(jd,"PHSurveyClosed",m),Qa(jd,"PHSurveySent",s);var c=n>0?setTimeout(o,n):void 0;return Ar(c)&&o(),function(){Ar(c)||clearTimeout(c),Ar(r)||clearTimeout(r),jd.removeEventListener("PHSurveyClosed",m),jd.removeEventListener("PHSurveySent",s)}}}else hu.error("usePopupVisibility hook called without a PostHog instance.")},[]),Gd({survey:e,removeSurveyFromFocus:r,setSurveyVisible:h,isPreviewMode:i,posthog:t}),{isPopupVisible:d,isSurveySent:p,setIsPopupVisible:h,hidePopupWithAnimation:g}}(p,v,null!=(t=p.appearance)&&t.surveyPopupDelaySeconds?1e3*p.appearance.surveyPopupDelaySeconds:0,q,w,x,D,M,O),j=B.isPopupVisible,H=B.hidePopupWithAnimation,N=B.isSurveySent||y===p.questions.length||!0===A,V=Fi(!1),z=V[0],U=V[1],W=Ri(function(){return!!Vc(p)},[p]),G=!!(null!=(n=p.appearance)&&n.introScreenHeader||null!=(i=p.appearance)&&i.introScreenDescription),K=q?-1===y:!(null==(r=p.appearance)||!r.displayIntroScreen)&&G&&!z&&!W,Q=Ri(function(){var e,t=(null==(e=Vc(p))?void 0:e.surveySubmissionId)||jl();return{isPreviewMode:q,previewPageIndex:y,onPopupSurveyDismissed:function(){O?Ic(p,v,q,O):Ic(p,v,q),T()},isPopup:x||!1,surveySubmissionId:t,onPreviewSubmit:C,onPreviewBack:E,posthog:v,properties:L,surveyLanguage:O}},[q,y,x,v,p,T,C,E,L,O]);return j?Qc(Dc.Provider,{value:Q,children:Qc("div",{className:"ph-survey",style:u({},Gc(p.type,null==(s=p.appearance)?void 0:s.position,null==(o=p.appearance)?void 0:o.widgetType),m),ref:D,children:N?Qc(ld,{header:(null==(a=p.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(l=p.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!_,contentType:null==(c=p.appearance)?void 0:c.thankYouMessageDescriptionContentType,appearance:p.appearance||xc,onClose:function(){H(),R()}}):K?Qc(cd,{header:(null==(d=p.appearance)?void 0:d.introScreenHeader)||"",description:(null==(h=p.appearance)?void 0:h.introScreenDescription)||"",forceDisableHtml:!!_,contentType:null==(f=p.appearance)?void 0:f.introScreenDescriptionContentType,appearance:p.appearance||xc,onStart:function(){return U(!0)}}):Qc(Jd,{survey:p,forceDisableHtml:!!_,posthog:v})})}):null}function Jd(e){var t,n,i=e.survey,r=e.forceDisableHtml,s=e.posthog,o=Ri(function(){var e=Vc(i);if(!e)return null;var t=qr(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&i.questions.length>e.lastQuestionIndex?e:(Uc(i),null)},[i]),a=Fi(function(){return null!=o&&o.responses&&hu.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}}),l=a[0],c=a[1],d=Li(Dc),h=d.previewPageIndex,f=d.onPopupSurveyDismissed,p=d.isPopup,_=d.onPreviewSubmit,v=d.onPreviewBack,g=d.surveySubmissionId,m=d.isPreviewMode,y=d.properties,b=d.surveyLanguage,w=Fi(function(){var e=null==o?void 0:o.lastQuestionIndex,t=qr(e)&&e>=0&&i.questions.length>e?e:0;return qr(h)&&h>=0?h:t}),S=w[0],x=w[1],k=Fi(function(){var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(function(e){return e>=0&&i.questions.length>e})}),C=k[0],P=k[1],E=Fi(function(){var e,t;return null!==(e=null==(t=Vc(i))?void 0:t.questionSnapshots)&&void 0!==e?e:{}}),F=E[0],T=E[1],I=Ri(function(){return Mc(Oc(i,o))},[i.id,o]),R=Ri(function(){if(!I||new Set(I).size!==I.length)return Oc(i,o);var e=new Map(i.questions.map(function(e){return[e.id,e]})),t=I.map(function(t){return e.get(t)}).filter(function(e){return!!e});return t.length===I.length?t:i.questions},[I,i.questions,i,o]);Ti(function(){!m||Ar(h)||0>h||x(h)},[h,m]);var L=!(null==(t=i.appearance)||!t.allowGoBack)&&(m?(null!=h?h:0)>0:C.length>0),A=R.at(S);return A?Qc("form",{className:"survey-form",name:"surveyForm",children:[p&&!0!==(null==(n=i.appearance)?void 0:n.hideCancelButton)&&Qc(ad,{onClick:function(){f()}}),Qc("div",{className:"survey-box","data-question-index":S,children:Xd({question:A,forceDisableHtml:r,displayQuestionIndex:S,appearance:i.appearance||xc,onSubmit:function(e){return function(e){var t,n,r=e.res,o=e.displayQuestionIndex,a=e.questionId;if(s)if(a){var d=Ja(a),h=u({},l,((t={})[d]=r,t));c(h);var f=R[o],p=null!=f&&f.id?u({},F,((n={})[f.id]=f.question,n)):F;T(p);var _=xd(i,o,r),v=_===nr,m=[].concat(C,[o]);if(v||(P(m),x(_),Nc(i,{surveySubmissionId:g,responses:h,lastQuestionIndex:_,questionOrder:Mc(R),visitedIndices:m,surveyLanguage:b,questionSnapshots:p})),i.enable_partial_responses||v){var w=new Set(m.map(function(e){var t;return null==(t=R[e])?void 0:t.id}).filter(function(e){return!!e}).map(function(e){return Ja(e)}));Fc({responses:Object.fromEntries(Object.entries(h).filter(function(e){return w.has(e[0])})),survey:i,surveySubmissionId:g,isSurveyCompleted:v,posthog:s,properties:y,surveyLanguage:b,questionSnapshots:p})}}else hu.error("onNextButtonClick called without a questionId.");else hu.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:S,questionId:A.id})},onPreviewSubmit:_,initialValue:A.id?l[Ja(A.id)]:void 0,canGoBack:L,onBack:function(){if(m)v();else if(0!==C.length){var e=C[C.length-1],t=C.slice(0,-1);P(t),x(e),Nc(i,{surveySubmissionId:g,responses:l,lastQuestionIndex:e,questionOrder:Mc(R),visitedIndices:t,surveyLanguage:b,questionSnapshots:F})}}})})]}):null}function Yd(e){var t,n,i,r,s,o,a,u=e.survey,l=e.forceDisableHtml,c=e.posthog,d=e.readOnly,h=e.surveyLanguage,f=Fi(!0),p=f[0],_=f[1],v=Fi(!1),g=v[0],m=v[1],y=Fi({}),b=y[0],w=y[1],S=Ii(void 0),x=function(){m(!g)};if(Ti(function(){var e;if(c){if(!d){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&w({top:"50%",bottom:"auto"});var t=function(e){var t,n=e;(null==(t=n.detail)?void 0:t.surveyId)===u.id&&(hu.info("Received show event for feedback button survey "+u.id),w(n.detail.position||{}),x())};return Qa(jd,Nd,t),function(){Ar(S.current)||(clearTimeout(S.current),S.current=void 0),jd.removeEventListener(Nd,t)}}}else hu.error("FeedbackWidget called without a PostHog instance.")},[c,d,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(n=u.appearance)?void 0:n.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Gd({survey:u,setSurveyVisible:_,posthog:c}),!p)return null;var k=function(){u.schedule!==ir&&_(!1),Ar(S.current)||clearTimeout(S.current),S.current=setTimeout(function(){S.current=void 0,m(!1)},200)};return Qc(Zn,{children:["tab"===(null==(r=u.appearance)?void 0:r.widgetType)&&Qc("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=u.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:x,disabled:d,style:Qd(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),g&&Qc(Zd,{posthog:c,survey:u,forceDisableHtml:l,style:b,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:h})]})}var Xd=function(e){var t=e.question,n=e.onSubmit,i=e.onPreviewSubmit,r={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit:function(e){i(e)},onSubmit:function(e){n(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case Yi:return Kn(hd,u({},r,{question:t,key:t.id}));case"link":return Kn(fd,u({},r,{question:t,key:t.id}));case tr:return Kn(pd,u({},r,{question:t,key:t.id}));case er:case Xi:return Kn(vd,u({},r,{question:t,key:t.id}));default:return hu.error("Unsupported question type: "+t.type),null}},eh="undefined"!=typeof globalThis?globalThis:Pa;eh&&"undefined"==typeof self&&(eh.self=eh),eh&&"undefined"==typeof File&&(eh.File=function(){});var th=null!=Pa?Pa:{};th.__PosthogExtensions__=th.__PosthogExtensions__||{},th.__PosthogExtensions__.generateSurveys=Wd,th.extendPostHogWithSurveys=Wd;var nh=function(e){return Ur(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message)},ih=Ba("[Error tracking]"),rh="webkit-masked-url:",sh=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",rh],oh=["__firefox__","__gCrWeb"];function ah(){return new _o([new Po,new $o,new Fo,new Eo,new Mo,new Ao,new Io,new Oo],function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var r=[],s=t.split("\n"),o=i;s.length>o;o++){var a=s[o];if(1024>=a.length){var l=Co.test(a)?a.replace(Co,"$1"):a;if(!l.match(/\S*Error: /)){for(var c=0,d=n;d.length>c;c++){var h=(0,d[c])(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(function(e){return u({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||"?"});var n})}(r)}}("web:javascript",wo,ko))}var uh=function(){"use strict";function e(e){var t,n;this._suppressionRules=[],this._errorPropertiesBuilder=ah(),this._instance=e,this._suppressionRules=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property("$error_tracking_suppression_rules"))&&void 0!==t?t:[],this._exceptionStepsConfig=Ho(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new No(this._exceptionStepsConfig)}var t=e.prototype;return t.onConfigChange=function(){this._exceptionStepsConfig=Ho(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)},t.onRemoteConfig=function(e){var t,n,i,r;if(e.ok){var s=e.config;if("errorTracking"in s){var o=null!==(t=null==(n=s.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[],a=null==(i=s.errorTracking)?void 0:i.captureExtensionExceptions;this._suppressionRules=o,this._instance.persistence&&this._instance.persistence.register(((r={})[Iu]=this._suppressionRules,r[Ru]=a,r))}}},t.buildProperties=function(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})},t.addExceptionStep=function(e,t){if(this._exceptionStepsConfig.enabled)try{var n;if(!Mr(e)||0===e.trim().length)return void ih.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(function(n,i){return Bo.has(i)?(t.push(i),n):(n[i]=e[i],n)},{}),droppedKeys:t}}(this._coerceExceptionStepProperties(t)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&ih.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._exceptionStepsBuffer.add(u(((n={})[Do]=e,n[qo]=(new Date).toISOString(),n),r))}catch(e){ih.error("Failed to add exception step. Ignoring breadcrumb.",e)}},t.sendExceptionEvent=function(e){try{var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return this._addDroppedExceptionStep("Exception dropped: matched a suppression rule"),void ih.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by a browser extension"),void ih.info("Skipping exception capture because it was thrown by an extension");if(!this._captureExtensionExceptions&&this._isInjectedBrowserScriptException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by an injected browser script"),void ih.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by the PostHog SDK"),void ih.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this._exceptionStepsConfig.enabled&&Dr(e.$exception_steps)?this._addBufferedExceptionSteps(e):e,i="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;i&&(n.$release_id=i);try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return r&&this._exceptionStepsBuffer.clear(),r}catch(e){return nh(e)||ih.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void(nh(e)||ih.error("Failed to process exception event. Ignoring this exception.",e))}var s},t._addBufferedExceptionSteps=function(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:u({},e,{$exception_steps:t})}catch(t){return ih.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}},t._addDroppedExceptionStep=function(e){var t;this._exceptionStepsConfig.enabled&&this._exceptionStepsBuffer.add(((t={})[Do]=e,t[qo]=(new Date).toISOString(),t))},t._coerceExceptionStepProperties=function(e){return Rr(e)?u({},e):{}},t._getExceptionStepsConfig=function(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}},t._matchesSuppressionRule=function(e){if(0===e.length)return!1;try{var t=e.reduce(function(e,t){var n=t.type,i=t.value;return Mr(n)&&n.length>0&&e.$exception_types.push(n),Mr(i)&&i.length>0&&e.$exception_values.push(i),e},{$exception_types:[],$exception_values:[]});return this._suppressionRules.some(function(e){var n=e.values.map(function(e){var n=cu[e.operator],i=t[e.key];if(!n||!i)return!1;var r=Tr(e.value)?e.value:[e.value];return r.length>0&&n(r,i)});return"OR"===e.type?n.some(Boolean):n.every(Boolean)})}catch(e){return ih.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}},t._isExtensionException=function(e){var t=e.flatMap(function(e){var t,n;return null!==(t=null==(n=e.stacktrace)?void 0:n.frames)&&void 0!==t?t:[]}),n=t.filter(function(e){var t=e.filename;return!!t&&sh.some(function(e){return t.startsWith(e)})});return 0!==n.length&&(!n.every(function(e){var t=e.filename;return!!t&&t.startsWith(rh)})||e.some(function(e){var t=e.value;return Mr(t)&&t.includes("isolatedAPI.contexts.topHostname")})&&!t.some(function(e){var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(rh))}))},t._isInjectedBrowserScriptException=function(e){return e.some(function(e){var t=e.value;return Mr(t)&&oh.some(function(e){return t.includes(e)})})},t._isPostHogException=function(e){if(e.length>0){var t,n,i,r,s=null!==(t=null==(n=e[0].stacktrace)?void 0:n.frames)&&void 0!==t?t:[];return null!==(i=null==(r=s[s.length-1])||null==(r=r.filename)?void 0:r.includes("posthog.com/static"))&&void 0!==i&&i}return!1},t._isExceptionList=function(e){return!Dr(e)&&Tr(e)},o(e,[{key:"_captureExtensionExceptions",get:function(){var e,t,n=!!this._instance.get_property(Ru);return null!==(e=null!==(t=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==t?t:n)&&void 0!==e&&e}}])}(),lh=Ba("[ExceptionAutocapture]"),ch=ah(),dh=function(e,t){try{return e()}catch(e){return t}},hh=function(e,t){return dh(function(){return e(t())},void 0)},fh=function(e){return dh(function(){return Ir(e)&&Ir(e.call)},!1)},ph=function(e,t){return dh(function(){e[t].__POSTHOG_INSTRUMENTED__=!0},void 0)},_h=function(e,t,n){dh(function(){var n;null==(n=e[t])||delete n.__POSTHOG_INSTRUMENTED__},void 0),dh(function(){e[t]=n},void 0)},vh=function(e){var t=Pa;t||lh.info("window not available, cannot wrap onerror");var n=dh(function(){return t.onerror},void 0);return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),s=0;i>s;s++)r[s]=arguments[s];return hh(e,function(){return ch.buildFromUnknown(function(e){var t=e[0],n=e[1],i=e[2],r=e[3],s=e[4];if(null!=s)return s;if(Mr(t)&&Mr(n)&&n.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:n,lineno:i,colno:r})}catch(e){return t}return t}(r),{mechanism:{handled:!1}})}),!!fh(n)&&null!==(t=n.apply(void 0,r))&&void 0!==t&&t},ph(t,"onerror"),function(){return _h(t,"onerror",n)}},gh=function(e,t){void 0===t&&(t=!1);var n=Pa;n||lh.info("window not available, cannot wrap onUnhandledRejection");var i=dh(function(){return n.onunhandledrejection},void 0);return n.onunhandledrejection=function(n){var r;return hh(e,function(){return ch.buildFromUnknown(n,{mechanism:{handled:!1}})}),fh(i)?null!==(r=i(n))&&void 0!==r&&r:t},ph(n,"onunhandledrejection"),function(){return _h(n,"onunhandledrejection",i)}},mh={wrapOnError:vh,wrapUnhandledRejection:gh,wrapConsoleError:function(e){var t=console;t||lh.info("console not available, cannot wrap console.error");var n=dh(function(){return t.error},void 0);return t.error=function(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];hh(e,function(){var e;e=1==i.length?i[0]:i.join(" ");var t=i.find(function(e){return e instanceof Error});return ch.buildFromUnknown(t||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),fh(n)&&n.apply(void 0,i)},ph(t,"error"),function(){return _h(t,"error",n)}}};th.__PosthogExtensions__=th.__PosthogExtensions__||{},th.__PosthogExtensions__.errorWrappingFunctions=mh,th.posthogErrorWrappingFunctions=mh;var yh=function(e,t){if(Ir(null==e?void 0:e.capture)){var n=null==t?void 0:t.autocaptureExceptions,i=!$r(n)&&"object"==typeof n&&Tr(n.errors_to_ignore)?n.errors_to_ignore.reduce(function(e,t){try{e.push(new RegExp(t))}catch(e){lh.error("Ignoring invalid legacy exception exclusion rule",t,e)}return e},[]):[],r=function(t){try{null==e.capture||e.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(e){lh.error("Failed to capture exception for a legacy client",e)}};vh(function(e){i.some(function(t){return e.$exception_list.some(function(e){return t.test(e.value||"")})})||r(e)}),gh(r,!0)}};th.extendPostHogWithExceptionAutoCapture=yh,th.extendPostHogWithExceptionAutocapture=yh;var bh=function(){},wh=function(e){var t;if(Ir(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function Sh(e,t,n){try{if(!(t in e))return bh;var i={next:e[t]},r=n(function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];return i.next.apply(this,t)});return Ir(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=r,function(){if(e[t]!==r)for(var n=e[t],s=wh(n);s;){if(s.next===r)return void(s.next=i.next);s=wh(n=s.next)}else e[t]=i.next}}catch(e){return bh}}var xh="X-POSTHOG-SESSION-ID",kh="X-POSTHOG-WINDOW-ID",Ch="X-POSTHOG-DISTINCT-ID",Ph=[xh,kh,Ch],Eh=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Fh=function(e,t){return{}.hasOwnProperty.call(e,t)},Th=function(e){return"object"==typeof e&&!$r(e)||Ir(e)},Ih=function(e){return"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e))},Rh=function(e){try{var t;return Ih(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Pa||null==(t=Pa.location)?void 0:t.href).toString()}catch(e){return}},Lh=function(e,t,n,i,r){var s;try{s=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(Tr(e)&&!e.includes(s))return!1;var o=!1;if(n){var a=n.checkAndGetSessionAndWindowId(!0),u=a.windowId;r.set(xh,a.sessionId),r.set(kh,u),o=!0}var l=function(e){return Ir(e)?e():e}(t);return l&&"$posthog_cookieless"!==l&&(r.set(Ch,l),o=!0),o};th.__PosthogExtensions__=th.__PosthogExtensions__||{};var Ah={_patchFetch:function(e,t,n){return Sh(Pa,"fetch",function(i){return function(r,s){var o=arguments.length>1?[r,s]:[r],a=o;try{var l=Rh(r);if(l)if(Ih(r)){var c=new Request(r,s);Lh(e,t,n,c.url,c.headers),a=[c]}else{var d=new Headers(Th(s)?s.headers:void 0);if(Lh(e,t,n,l,d)){var h=function(e,t){if(Ar(e)||$r(e))return{headers:t};if(Th(e)){var n=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(n);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),i}return new Proxy({headers:t},{get:function(e,t){return Fh(e,t)?Reflect.get(e,t):Reflect.get(n,t,n)},has:function(e,t){return Fh(e,t)||t in n},ownKeys:function(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(n).forEach(function(e){return t.add(e)}),Eh.forEach(function(e){e in n&&t.add(e)}),Array.from(t)},getOwnPropertyDescriptor:function(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i)return i;if("string"==typeof t&&Eh.includes(t)&&t in n)return{configurable:!0,enumerable:!0,get:function(){return Reflect.get(n,t,n)}};var r=Reflect.getOwnPropertyDescriptor(n,t);return r?u({},r,{configurable:!0}):void 0},getPrototypeOf:function(){return Object.getPrototypeOf(n)}})}}(s,d);h&&(a=[r,h])}}}catch(e){a=o}return i.apply(this,a)}})},_patchXHR:function(e,t,n){return Sh(Pa.XMLHttpRequest.prototype,"open",function(i){return function(r,s,o,a,u){void 0===o&&(o=!0);var l=this,c=new Headers,d=Rh(s);d&&Lh(e,t,n,d,c);var h=i.call(l,r,s,o,a,u);return Ph.forEach(function(e){var t=c.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}}),h}})}};th.__PosthogExtensions__.tracingHeadersPatchFns=Ah,th.postHogTracingHeadersPatchFns=Ah,Ca.DEBUG=!1,Ca.LIB_VERSION="1.427.3",Ca.LIB_NAME="web";var Mh=Ca,Oh=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.isOptedOut=function(){return"always"===this._config.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this._config.cookieless_mode},t.isOptedIn=function(){return!this.isOptedOut()},t.isExplicitlyOptedOut=function(){return 0===this.consent},t.isRejected=function(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default},t.optInOut=function(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)},t.reset=function(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)},t._getDnt=function(){return!!this._config.respect_dnt&&[null==Fa?void 0:Fa.doNotTrack,null==Fa?void 0:Fa.msDoNotTrack,th.doNotTrack,null==Fa?void 0:Fa.globalPrivacyControl].some(function(e){return Qr(e)})},o(e,[{key:"_config",get:function(){return this._instance.config}},{key:"consent",get:function(){return this._getDnt()?0:this._storedConsent}},{key:"_storageKey",get:function(){var e=this._instance.config,t=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+t:"__ph_opt_in_out_"+t)}},{key:"_storedConsent",get:function(){var e=this._storage._get(this._storageKey);return Qr(e)?1:vr(Zr,e)?0:-1}},{key:"_storage",get:function(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?rc:nc,n=t._is_supported()?t:vc;if(!this._persistentStore||this._persistentStore!==n){this._persistentStore=n;var i="localStorage"===e?nc:rc;i._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(Qr(i._get(this._storageKey))),i._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}();function $h(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Dh(e){return!!e&&1===e.nodeType}function qh(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Bh(e){return!!e&&3===e.nodeType}function jh(e){return!!e&&11===e.nodeType&&Dh(e.host)}function Hh(e){return e?gr(e).split(/\s+/):[]}function Nh(e,t){var n=Jl(t);return!!(n&&e&&e.some(function(e){return n.match(e)}))}function Vh(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 Hh(t)}function zh(e){return Dr(e)?null:gr(e).split(/(\s+)/).filter(function(e){return _f(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Uh(e){var t="";return of(e)&&!af(e)&&e.childNodes&&e.childNodes.length&&Ha(e.childNodes,function(e){var n;Bh(e)&&e.textContent&&(t+=null!==(n=zh(e.textContent))&&void 0!==n?n:"")}),gr(t)}function Wh(e){var t;return Ar(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var Gh=["a","button","form","input","select","textarea","label"];function Kh(e,t){if(Ar(t))return!0;for(var n,i,r=function(){var e=i.value;if(t.some(function(t){return function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch(e){return!1}}(e,t)}))return{v:!0}},s=d(e);!(i=s()).done;)if(n=r())return n.v;return!1}function Qh(e){var t=e.parentNode;return!(!t||!Dh(t))&&t}var Zh=[".ph-no-autocapture","[data-ph-no-autocapture]"],Jh=["next","previous","prev",">","<"],Yh=[].concat(Jh,["+","-","−","–"]),Xh=function(e,t){return/[a-z0-9]/i.test(t)?e.includes(t):e===t},ef=[".ph-no-rageclick",".ph-no-capture"],tf=["","text","search","email","password","url","tel","number"];function nf(e,t){if(!Pa||rf(e))return!1;var n,i,r,s,o;if(jr(t)?(n=!!t&&ef,i=void 0,r=!1):(n=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:ef,i=null==t?void 0:t.content_ignorelist,r=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===n)return!1;if(r&&function(e){return!(!e||!Dh(e))&&(!!qh(e,"textarea")||(qh(e,"input")?vr(tf,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var a=sf(e,!1).targetElementList;return!function(e,t){if(!1===e||Ar(e))return!1;var n;if(!0===e)n=Jh;else{if(!Tr(e))return!1;if(e.length>10)return qa.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;n=e.map(function(e){return e.toLowerCase()})}return t.some(function(e){var t=e.safeText,i=e.ariaLabel;return n.some(function(e){return Xh(t,e)||Xh(i,e)})})}(i,a.map(function(e){var t;return{safeText:Uh(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!Kh(a,n)}var rf=function(e){return!e||qh(e,"html")||!Dh(e)},sf=function(e,t){if(!Pa||rf(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[e],r=e;r.parentNode&&!qh(r,"body");)if(jh(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var s=Qh(r);if(!s)break;if(t||Gh.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var o=Pa.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(n=!0)}catch(e){}i.push(s),r=s}return{parentIsUsefulElement:n,targetElementList:i}};function of(e){for(var t=new Set,n=0,i=e;i.parentNode&&!qh(i,"body");i=i.parentNode){if(n++>=1e3||t.has(i))return!1;t.add(i);var r=Vh(i);if(vr(r,"ph-sensitive")||vr(r,"ph-no-capture"))return!1}if(vr(Vh(e),"ph-include"))return!0;var s=e.type||"";if(Mr(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!Mr(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function af(e){return!!(qh(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||qh(e,"select")||qh(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var uf=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),lf=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,cf=[16,15,14,13],df=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),hf=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ff=/[0-9A-Za-z_]/;function pf(e){for(var t=0,n=!1,i=e.length-1;i>=0;i--){var r=e.charCodeAt(i)-48;n&&(r*=2)>9&&(r-=9),t+=r,n=!n}return t%10==0}function _f(e,t){if(void 0===t&&(t=!0),Dr(e))return!1;if(Mr(e)){if(e=gr(e),t?uf.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(lf.lastIndex=0;t=lf.exec(e);){var n=t[2];if(n)for(var i=n.replace(/[- ]/g,""),r=0;i.length>r;r++)for(var s=0,o=cf;o.length>s;s++){var a=r+o[s];if(i.length>=a){var u=i.slice(r,a);if(uf.test(u)&&pf(u))return!0}}}return!1}(e))return!1;if(t?df.test(e):function(e){var t;for(hf.lastIndex=0;t=hf.exec(e);){var n=t[1],i=t[3];if(!(n&&i&&ff.test(n)&&ff.test(i)))return!0}return!1}(e))return!1}return!0}function vf(e){var t=Uh(e);return _f(t=(t+" "+gf(e)).trim())?t:""}function gf(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Ha(e.childNodes,function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var i=Uh(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+gf(e)).trim())}catch(e){qa.error("[AutoCapture]",e)}}),t}function mf(e){return e.replace(/"|\\"/g,'\\"')}function yf(e){var t=e.attr__class;if(t)return Tr(t)?t:Hh(t)}var bf=Ba("[Dead Clicks]"),wf=function(){return!0},Sf=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(Au)),i=e.instance.config.capture_dead_clicks;return jr(i)?i:!!Rr(i)||n},xf=function(){"use strict";function e(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}var t=e.prototype;return t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register(((t={})[Au]=n.captureDeadClicks,t)),this.startIfEnabledOrStop())}},t.startIfEnabledOrStop=function(){var e=this;this.isEnabled(this)?this._loadScript(function(){e._start()}):this.stop()},t._loadScript=function(e){var t,n;null!=(t=th.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(n=th.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",function(t){t?bf.error("failed to load script",t):e()})},t._start=function(){var e;if(Ta){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=th.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Rr(this.instance.config.capture_dead_clicks)?u({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this._lazyLoadedDeadClicksAutocapture=th.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Ta),bf.info("starting...")}}else bf.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,bf.info("stopping..."))},o(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),kf=Ba("[SegmentIntegration]");function Cf(e,t,n){void 0===n&&(n=!0);var i=e.config.segment;if(!i)return t();!function(e,t,n){var i=e.config.segment;if(!i)return t();var r=function(i){var r=function(){return i.anonymousId()||jl()};e.config.get_device_id=r,n&&i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(fl,El)),t(n?void 0:i.anonymousId()||void 0)},s=i.user();"then"in s&&Ir(s.then)?s.then(r):r(s)}(e,function(n){i.register(function(e,t){"undefined"!=typeof Promise&&Promise.resolve||kf.warn("This browser does not have Promise support, and can not use the segment integration");var n=function(n,i){if(!i)return n;var r=!!t&&n.event.anonymousId===t&&!n.event.userId;r||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(kf.info("No userId set, resetting PostHog"),e.reset()),r||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(kf.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));var s=e.calculateEventProperties(i,n.event.properties);return n.event.properties=Object.assign({},s,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return n(e,e.event.event)},page:function(e){return n(e,Rl)},identify:function(e){return n(e,Al)},screen:function(e){return n(e,"$screen")}}}(e,n)).then(function(){t()},function(e){kf.error("Failed to register the Segment integration",e),t()})},n)}var Pf="posthog-js";function Ef(e,t){var n=void 0===t?{}:t,i=n.organization,r=n.projectId,s=n.prefix,o=n.severityAllowList,a=void 0===o?["error"]:o,l=n.sendExceptionsToPostHog,c=void 0===l||l;return function(t){var n,o,l,d,h,f;if("*"!==a&&!a.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 _=(null==(n=t.exception)?void 0:n.values)||[],v=_.map(function(e){return u({},e,{stacktrace:e.stacktrace?u({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(function(e){return u({},e,{platform:"web:javascript"})})}):void 0})}),g={$exception_message:(null==(o=_[0])?void 0:o.value)||t.message,$exception_type:null==(l=_[0])?void 0:l.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=_[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=_[0])?void 0:h.type,$sentry_tags:t.tags};return i&&r&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),c&&(null==(f=e.exceptions)||f.sendExceptionEvent(g)),t}}var Ff=function(e,t,n,i,r,s){"use strict";this.name=Pf,this.setupOnce=function(o){o(Ef(e,{organization:t,projectId:n,prefix:i,severityAllowList:r,sendExceptionsToPostHog:null==s||s}))}},Tf=function(){"use strict";function e(e){var t=this;this._onSessionIdChange=function(e,n,i){i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(qa.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),t._currentPageview=void 0,t._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}var t=e.prototype;return t._setupSessionRotationHandler=function(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)},t.destroy=function(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0},t.doPageView=function(e,t){var n,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==Pa?void 0:Pa.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i},t.doPageLeave=function(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)},t.doEvent=function(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}},t._previousPageViewProperties=function(e,t){var n=this._currentPageview;if(!n)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:n.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var s=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,u=r.maxContentHeight,l=r.lastContentY,c=r.maxContentY;if(!(Ar(s)||Ar(o)||Ar(a)||Ar(u)||Ar(l)||Ar(c))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c);var d=s>1?Jr(o/s,0,1,qa):1,h=s>1?Jr(a/s,0,1,qa):1,f=u>1?Jr(l/u,0,1,qa):1,p=u>1?Jr(c/u,0,1,qa):1;i=Na(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:l,$prev_pageview_last_content_percentage:f,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:p})}}return n.pathname&&(i.$prev_pageview_pathname=n.pathname),n.timestamp&&(i.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),i},e}(),If=["flags","surveys"],Rf=((s={}).$people_distinct_id={exposure:"hidden"},s[xu]={exposure:"hidden"},s.__cmpns={exposure:"hidden"},s[Pu]={exposure:"hidden"},s[Cu]={exposure:"hidden"},s[Eu]={exposure:"event"},s[Fu]={exposure:"hidden"},s[Ou]={exposure:"hidden"},s[Tu]={exposure:"event"},s[Iu]={exposure:"hidden"},s[Ru]={exposure:"event"},s[Lu]={exposure:"event"},s[Au]={exposure:"event"},s[Mu]={exposure:"hidden"},s[$u]={exposure:"event"},s[Du]={exposure:"hidden"},s.$session_recording_enabled_server_side={exposure:"hidden"},s[Vu]={exposure:"hidden"},s[zu]={exposure:"event"},s[qu]={exposure:"event",shouldSkipFromEventProperties:function(e){return $r(e)}},s.$session_past_minimum_duration={exposure:"event"},s.$session_recording_url_trigger_activated_session={exposure:"event"},s.$session_recording_event_trigger_activated_session={exposure:"event"},s.$debug_first_full_snapshot_timestamp={exposure:"event"},s.$sess_rec_flush_size={exposure:"hidden"},s[Uu]={exposure:"hidden",storageGroup:"flags"},s[Wu]={exposure:"hidden",storageGroup:"flags"},s[Gu]={exposure:"hidden"},s[Ku]={exposure:"hidden",storageGroup:"flags"},s[Qu]={exposure:"hidden",storageGroup:"flags"},s[Zu]={exposure:"hidden",storageGroup:"flags",volatile:!0},s[Ju]={exposure:"hidden",storageGroup:"flags"},s[Yu]={exposure:"hidden"},s[Xu]={exposure:"hidden"},s[el]={exposure:"hidden"},s[tl]={exposure:"hidden"},s[il]={exposure:"hidden",storageGroup:"surveys"},s[rl]={exposure:"hidden",storageGroup:"surveys",volatile:!0},s[sl]={exposure:"event"},s[ol]={exposure:"hidden"},s[al]={exposure:"hidden"},s[ul]={exposure:"hidden"},s.$product_tours_activated={exposure:"hidden"},s.$product_tours_activated_session={exposure:"hidden"},s.$conversations_widget_session_id={exposure:"event"},s.$conversations_ticket_id={exposure:"event"},s.$conversations_widget_state={exposure:"event"},s.$conversations_user_traits={exposure:"event"},s[ll]={exposure:"hidden"},s[cl]={exposure:"hidden"},s[nl]={exposure:"event"},s[dl]={exposure:"hidden"},s[hl]={exposure:"hidden",storageGroup:"flags",volatile:!0},s[fl]={exposure:"hidden"},s[pl]={exposure:"hidden"},s[_l]={exposure:"hidden"},s[vl]={exposure:"hidden"},s[gl]={exposure:"hidden"},s[ml]={exposure:"hidden"},s[yl]={exposure:"hidden"},s[Bu]={exposure:"event"},s[ju]={exposure:"event"},s[Hu]={exposure:"event"},s[Nu]={exposure:"event"},s[Sl]={exposure:"event"},s[xl]={exposure:"event"},s[kl]={exposure:"event"},s.$sdk_debug_replay_event_trigger_status={exposure:"event"},s.$sdk_debug_replay_linked_flag_trigger_status={exposure:"event"},s.$sdk_debug_replay_matched_recording_trigger_groups={exposure:"event"},s.$sdk_debug_replay_pending_trigger_conditions={exposure:"event"},s.$sdk_debug_replay_remote_trigger_matching_config={exposure:"event"},s.$sdk_debug_replay_trigger_groups_count={exposure:"event"},s.$sdk_debug_replay_url_trigger_status={exposure:"event"},s.$session_recording_start_reason={exposure:"event"},s),Lf=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Af=function(e){var t=Rf[e];if(t)return t;for(var n=0,i=Lf;i.length>n;n++){var r=i[n],s=r[1];if(0===e.indexOf(r[0]))return s}},Mf={flags:hl,surveys:rl},Of=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],$f=function(e){return e+"_cookie_identity_change_pending"},Df=function(e){for(var t,n="",i=0,r=d(e);!(t=r()).done;){var s=t.value,o=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+o>1e3)break;n+=s,i+=o}return n},qf="main",Bf=[Uu,Wu,Ku,Qu,Zu,hl,Ju,el],jf=function(e){return-1!==Bf.indexOf(e)},Hf=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){return e===t}},Nf=function(e){if(!e)return{};var t=JSON.parse(e);return Rr(t)?t:{}},Vf=function(e,t){Ha(e,function(n,i){var r=Af(i);r&&"event"!==r.exposure||{}.hasOwnProperty.call(t,i)||delete e[i]})},zf=function(){"use strict";function e(e,t,n){var i=this;if(void 0===n&&(n=!0),this._slotState={},this._splitStorageEligible=!1,this._storesIdentityInCookie=!1,this._splitStorage=!1,this._cookieIdentityChangePending=!1,this._cookieSyncSuppressed=!1,this._pendingCrossTabFeatureFlagChanges=new Map,this._storageMigrationInProgress=!1,this._localIdentityChangePending=!1,this._crossTabFeatureFlagIdentityMismatch=!1,this._facebookClickIdChangePending=!1,this._crossTabFeatureFlagHandlers=new Set,this._config=e,this._ownsSplitStorage=n,this.props={},this._campaign_params_url=void 0,this._name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(e),this._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(),this._markLoadedCrossTabFeatureFlagChangesPending(),e.debug&&qa.info("Persistence loaded",e.persistence,u({},this.props)),this.update_config(e,e,t),this.save(),Pa){var r=function(){return i.flush()};Qa(Pa,"beforeunload",r,{capture:!1}),Qa(Pa,"pagehide",r,{capture:!1}),this._onStorage=function(e){if(i._splitStorageEligible&&(!e.storageArea||e.storageArea===(null==Pa?void 0:Pa.localStorage))&&e.key)if(e.key!==i._name){if(i._splitStorage){var t=If.find(function(t){return e.key===i._groupEntryName(t)});t&&i._syncCrossTabFeatureFlagProperties(e.key,t)}}else i._syncCrossTabFeatureFlagProperties(e.key,qf)},Qa(Pa,"storage",this._onStorage)}}var t=e.prototype;return t.markCrossTabFeatureFlagChanges=function(e){var t=this;Object.entries(e).forEach(function(e){var n=e[0],i=e[1],r=t._pendingCrossTabFeatureFlagChanges.get(n);if(jf(n)&&!0!==r)if(!0!==i){var s=new Set(r||[]);i.forEach(function(e){return s.add(e)}),s.size&&t._setCrossTabFeatureFlagChangesPending(n,s)}else t._setCrossTabFeatureFlagChangesPending(n,!0)})},t.onCrossTabFeatureFlagChange=function(e){var t=this;return this._crossTabFeatureFlagHandlers.add(e),function(){return t._crossTabFeatureFlagHandlers.delete(e)}},t.destroy=function(){this._onStorage&&Pa&&(Pa.removeEventListener("storage",this._onStorage),this._onStorage=void 0),this._crossTabFeatureFlagHandlers.clear()},t._syncCrossTabFeatureFlagProperties=function(e,t,n){if(void 0===n&&(n=!0),this._disabled)return!1;var i,r;try{if(r=rc._get(e),$r(r)){var s=this._slotWriteState(t);return s.storageValue=null,t!==qf&&(s.persisted=!1),!1}i=Nf(r)}catch(e){return!1}var o=t===qf?i:rc._parse(this._name);if(o&&this._hasCrossTabFeatureFlagIdentityMismatch(o))return!1;var a=this._mergeCrossTabFeatureFlagProperties(i,t,n);return t===qf&&this._splitStorage&&!Hf(this._partitionProps().main,i)||this._rememberCrossTabStorageFingerprint(i,t,!0,r),a},t._hasCrossTabFeatureFlagIdentityMismatch=function(e){var t=this.props[bu],n=e[bu];return!Ar(t)&&!Ar(n)&&t!==n},t._rememberCrossTabStorageFingerprint=function(e,t,n,i){var r=this._slotWriteState(t);r.storageValue=i,t!==qf&&(r.persisted=n);try{r.fingerprint=this._entryFingerprint(e,t)}catch(e){r.fingerprint=void 0}},t._mergeCrossTabFeatureFlagProperties=function(e,t,n){var i=this,r=!1;return Bf.forEach(function(n){var s,o=null==(s=Af(n))?void 0:s.storageGroup;if(!(t===qf&&i._splitStorage&&o||t!==qf&&o!==t)){var a=n in e,u=i._mergePendingCrossTabFeatureFlagChanges(n,a?e[n]:void 0),l=i._pendingCrossTabFeatureFlagChanges.has(n)?n in i.props:a;l===n in i.props&&Hf(u,i.props[n])||(l?i._setProp(n,u,!1):i._deleteProp(n,!1),r=!0)}}),r&&n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}),r},t._reconcileCrossTabFeatureFlagPropertiesBeforeWrite=function(){var e=this;if(!this._splitStorageEligible)return!1;try{this._crossTabFeatureFlagIdentityMismatch=!1;var t,n=rc._get(this._name),i=this._slotWriteState(qf),r=!1,s=!1;if(n!==i.storageValue)if($r(n))i.storageValue=null;else{if(t=Nf(n),this._crossTabFeatureFlagIdentityMismatch=!this._localIdentityChangePending&&this._hasCrossTabFeatureFlagIdentityMismatch(t),this._crossTabFeatureFlagIdentityMismatch)return!1;s=this._mergeCrossTabFeatureFlagProperties(t,qf,!1),!this._splitStorage||Hf(this._partitionProps().main,t)?this._rememberCrossTabStorageFingerprint(t,qf,!0,n):i.storageValue=n,r=!0}return this._splitStorage&&If.forEach(function(n){var i=rc._get(e._groupEntryName(n)),o=e._slotWriteState(n),a=t||{},u=r&&Bf.some(function(e){var t;return(null==(t=Af(e))?void 0:t.storageGroup)===n&&e in a});if(i!==o.storageValue||u){if($r(i))return o.storageValue=null,o.persisted=!1,void(u&&(s=e._mergeCrossTabFeatureFlagProperties(a,n,!1)||s));var l=Nf(i);s=e._mergeCrossTabFeatureFlagProperties(l,n,!1)||s,e._rememberCrossTabStorageFingerprint(l,n,!0,i)}}),s}catch(e){return!1}},t._setCrossTabFeatureFlagChangesPending=function(e,t){this._pendingCrossTabFeatureFlagChanges.set(e,t);var n=Af(e);null!=n&&n.volatile||(this._slotWriteState((this._splitStorage?null==n?void 0:n.storageGroup:void 0)||qf).fingerprint=void 0,this._markGroupDirty(e))},t._markAllCrossTabFeatureFlagChangesPending=function(){var e=this;Bf.forEach(function(t){return e._pendingCrossTabFeatureFlagChanges.set(t,!0)})},t._markLoadedCrossTabFeatureFlagChangesPending=function(){var e=this;if(this._splitStorageEligible)try{var t=rc._get(this._name),n=Nf(t);this._slotWriteState(qf).storageValue=t,Bf.forEach(function(t){var i,r=e._splitStorage?null==(i=Af(t))?void 0:i.storageGroup:void 0,s=r?rc._get(e._groupEntryName(r)):null;if(r){var o=e._slotWriteState(r);o.storageValue=s,o.persisted=!$r(s)}var a=r&&!$r(s)?Nf(s):n;t in e.props?e._markPendingCrossTabFeatureFlagChanges(t,a[t],e.props[t]):t in a&&e._setCrossTabFeatureFlagChangesPending(t,!0)})}catch(e){}},t._mergePendingCrossTabFeatureFlagChanges=function(e,t){var n=this._pendingCrossTabFeatureFlagChanges.get(e);if(!n)return t;if(!0===n)return this.props[e];if("$active_feature_flags"===e){var i=new Set(Tr(t)?t:[]),r=new Set(Tr(this.props[e])?this.props[e]:[]);return n.forEach(function(e){return r.has(e)?i.add(e):i.delete(e)}),Array.from(i)}var s=Rr(t)?u({},t):{},o=Rr(this.props[e])?this.props[e]:{};return n.forEach(function(e){e in o?s[e]=o[e]:delete s[e]}),s},t._markPendingCrossTabFeatureFlagChanges=function(e,t,n){if(jf(e)){var i=this._pendingCrossTabFeatureFlagChanges.get(e);if(!0!==i){var r=t;if(this._splitStorageEligible)try{var s,o=this._splitStorage?null==(s=Af(e))?void 0:s.storageGroup:void 0,a=o?this._groupEntryName(o):this._name;r=Nf(rc._get(a))[e]}catch(e){}var u=new Set(i||[]);if("$active_feature_flags"===e){if(!Ar(t)&&!Tr(t)||!Ar(r)&&!Tr(r)||!Tr(n))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var l=new Set(t||[]),c=new Set(r||[]),d=new Set(n);new Set([].concat(l,d)).forEach(function(e){l.has(e)!==d.has(e)&&u.add(e)}),u.forEach(function(e){c.has(e)===d.has(e)&&u.delete(e)})}else{if(!Rr(n))return void(Hf(r,n)?this._pendingCrossTabFeatureFlagChanges.delete(e):this._setCrossTabFeatureFlagChangesPending(e,!0));if(!Ar(t)&&!Rr(t)||Ar(t)&&Lr(n)&&Ar(r))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var h=Rr(t)?t:{},f=Rr(r)?r:{};new Set([].concat(Object.keys(h),Object.keys(n))).forEach(function(e){e in h==e in n&&Hf(h[e],n[e])||u.add(e)}),u.forEach(function(e){e in f==e in n&&Hf(f[e],n[e])&&u.delete(e)})}u.size?this._setCrossTabFeatureFlagChangesPending(e,u):this._pendingCrossTabFeatureFlagChanges.delete(e)}}},t._saveDebounceMs=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return qr(t)&&t>0?t:0},t._rememberCurrentCookieProperties=function(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=cc(e,this._config.cookie_persisted_properties||[]),n=hc(t,this._config.cookie_persisted_properties||[]),i=JSON.stringify(t)+"|"+JSON.stringify(n),r=nc._get(this._name)||void 0;r&&pc(this._name,r)===i&&(this._lastSeenCookiePropertiesFingerprint=i,this._lastSeenMainCookieValue=r)}catch(e){}else try{var s=nc._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=s?pc(this._name,s):void 0,this._lastSeenMainCookieValue=s}catch(e){}},t.syncCookieProperties=function(){return this._syncCookieProperties(this._config)},t._syncCookieProperties=function(e,t){var n,i=this;if(void 0===t&&(t=!1),this._disabled&&!t||this._cookieSyncSuppressed||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{n=nc._get(this._name)||void 0}catch(e){}if(!n||n===this._lastSeenMainCookieValue)return!1;var r,s=pc(this._name,n);try{r=lc(JSON.parse(n))}catch(e){return!1}if((nc._get(this._name)||void 0)!==n)return!1;this._lastSeenCookiePropertiesFingerprint=s,this._lastSeenMainCookieValue=n;var o=fc(this._name,n),a=[].concat(oc,o.properties),u={};if(Object.keys(r).forEach(function(e){var t=r[e];(Ar(t)||$r(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(u[e]=!0,delete r[e])}),Lr(r))return!1;var l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,c=this.props,d=c[bu],h=c[fl],f=Na({},c);[].concat(oc,e.cookie_persisted_properties||[]).forEach(function(e){if(-1!==a.indexOf(e)&&!(e in r)&&!u[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=f[e];(o.isValid||-1===oc.indexOf(e)||!1!==t&&0!==t)&&delete f[e]}}),this.props=Na(f,r),Bf.forEach(function(e){var t=e in i.props;e in c===t&&Hf(c[e],i.props[e])||(t?i._markPendingCrossTabFeatureFlagChanges(e,c[e],i.props[e]):i._setCrossTabFeatureFlagChangesPending(e,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this._setProp(fl,Pl);var p=this.props[bu],_=this.props[fl];return!l||p===d&&_===h||(this._localIdentityChangePending=!0,this._cookieIdentityChangePending=!0,mc._set($f(this._name),!0),this._deleteProp(el),this._deleteProp(Wu),this._deleteProp(Uu),this._deleteProp(Ku),this._deleteProp(Qu),this._deleteProp(Zu),this._deleteProp(hl),this._deleteProp(dl),this._deleteProp(ll),"anonymous"!==_||"identified"!==h&&"anonymous"!==r.$user_state&&(Ar(d)||p===d)||(Vf(this.props,r),this._deleteProp(tl)),"identified"===_?this.props.$user_id=p:delete this.props.$user_id,this._deleteProp(xu)),!0},t.consumeCookieIdentityChange=function(){var e=$f(this._name),t=this._cookieIdentityChangePending||!!mc._get(e);return this._cookieIdentityChangePending=!1,t&&mc._remove(e),t},t._beginCookieSyncSuppression=function(e){return void 0===e&&(e=!1),!(this._cookieSyncSuppressed||this._disabled&&!e||!this._config.cookieWinsOnConflict||"localstorage+cookie"!==this._config.persistence.toLowerCase()||(this._cookieSyncSuppressed=!0,0))},t._publishSuppressedCookieSnapshot=function(){this._cookieSyncSuppressed&&(Ar(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[qf],this._writeNow(!0))},t._endCookieSyncSuppression=function(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():Ar(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}},t.isDisabled=function(){return!!this._disabled},t._buildStorage=function(e){-1===Of.indexOf(e.persistence.toLowerCase())&&(qa.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,n=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var n=[].concat(oc,e);return u({},rc,{_parse:function(e){try{var i,r={};try{i=nc._get(e)||void 0,r=i?lc(JSON.parse(i)):{}}catch(e){}var s,o=JSON.parse(rc._get(e)||"{}");if(t){var a=fc(e,i),u=[].concat(oc,a.properties),l={};Object.keys(r).forEach(function(e){var t=r[e];$r(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(l[e]=t)});var c="distinct_id"in l||"anonymous"===l.$user_state||"identified"===l.$user_state;if(Object.keys(l).length>0){var d,h=o[bu],f=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";n.forEach(function(e){if(-1!==u.indexOf(e)&&!(e in r)&&(c||"distinct_id"!==e&&"$user_state"!==e)){var t=o[e];(a.isValid||-1===oc.indexOf(e)||!1!==t&&0!==t)&&delete o[e]}}),!c||"$user_state"in r||"$user_state"in o||(o[fl]=Pl),!c||("distinct_id"in l?l[bu]:o[bu])===h&&("$user_state"in l?l[fl]:o[fl])===f||(sc.forEach(function(e){return delete o[e]}),"identified"===l.$user_state&&"distinct_id"in l?o.$user_id=l[bu]:delete o.$user_id,"identified"!==l.$user_state&&(delete o[nl],delete o[tl]),delete o.__alias)}s=Na(o,l)}else s=Na(r,o);return rc._set(e,s),s}catch(e){}return null},_set:function(n,i,r,s,o,a){var u=rc._set(n,i,void 0,void 0,a);try{var l=cc(i,e);if(Object.keys(l).length){if(t){var c=ac(n),d=hc(l,e);if(nc._set(c,d,r,s,o,a),nc._get(c)!==JSON.stringify(d)){nc._remove(c,s);var h=cc(i);return nc._set(n,h,r,s,o,a),u}}nc._set(n,l,r,s,o,a)}}catch(e){rc._error(e)}return u},_remove:function(e,t){try{null==Pa||Pa.localStorage.removeItem(e),nc._remove(e,t),nc._remove(ac(e),t)}catch(e){rc._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),i=!1,r=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&rc._is_supported()?(t=rc,r=!0):"localstorage+cookie"===s&&n._is_supported()?(t=n,r=!0,i=!0):"sessionstorage"===s&&mc._is_supported()?t=mc:"memory"===s?t=vc:"cookie"===s&&nc._is_supported()?(t=nc,i=!0):n._is_supported()?(t=n,r=!0,i=!0):nc._is_supported()?(t=nc,i=!0):t=vc,this._splitStorageEligible=r,this._storesIdentityInCookie=i,t},t._groupEntryName=function(e){return this._name+"__"+e},t._resolveSplitStorage=function(e){return this._splitStorageEligible&&!!e.split_storage},t.properties=function(){var e={};return Ha(this.props,function(t,n){var i=Af(n);if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t))return;e[n]=t}}),e},t.load=function(e){var t=this;if(void 0===e&&(e=!1),!this._disabled||e){var n=this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase(),i=n?rc._parse(this._name):null,r={};if(n)try{Ha(r=lc(nc._parse(this._name)),function(e,t){(Ar(e)||$r(e)||""===e)&&delete r[t]})}catch(e){}var s=this._storage._parse(this._name);if(s&&(this.props=Na({},s)),this._splitStorage&&this._loadGroupEntries(),n&&s){var o,a,u=null==i?void 0:i[bu],l=null!==(o=null==i?void 0:i.$user_state)&&void 0!==o?o:"anonymous",c=s[bu],d=null!==(a=s.$user_state)&&void 0!==a?a:"anonymous";if(c!==u||d!==l){this._cookieIdentityChangePending=!0,mc._set($f(this._name),!0);var h=Na({},this.props);sc.forEach(function(e){return delete h[e]}),"anonymous"!==d||"identified"!==l&&"anonymous"!==r.$user_state&&(Ar(u)||c===u)||(Vf(h,r),delete h[tl]),this.props=h;var f=new Set;sc.forEach(function(e){var t,n=null==(t=Af(e))?void 0:t.storageGroup;n&&f.add(n)}),f.forEach(function(e){var n={};Ha(t.props,function(t,i){var r;(null==(r=Af(i))?void 0:r.storageGroup)===e&&(n[i]=t)}),Lr(n)?(rc._remove(t._groupEntryName(e)),t._slotState[e]={}):rc._set(t._groupEntryName(e),n)&&(t._slotState[e]={persisted:!0,fingerprint:t._entryFingerprint(n,e)})})}}mc._get($f(this._name))&&(this._cookieIdentityChangePending=!0)}},t._loadGroupEntries=function(){for(var e=0,t=If;t.length>e;e++){var n=t[e],i=rc._parse(this._groupEntryName(n));if(i&&!Lr(i)){var r=this._slotWriteState(n);r.persisted=!0,this._mainCarriesGroupKey(n)||(r.fingerprint=this._entryFingerprint(i,n)),this._groupEntryIsStale(n,i)||Na(this.props,i)}}},t._mainCarriesGroupKey=function(e){return Object.keys(this.props).some(function(t){var n;return(null==(n=Af(t))?void 0:n.storageGroup)===e})},t._groupEntryIsStale=function(e,t){var n=Mf[e];if(!n)return!1;var i=t[n],r=this.props[n];return qr(i)&&qr(r)&&r>i},t.refreshKey=function(e){var t;if(!(this._disabled||"$fbc_persistence"===e&&this._facebookClickIdChangePending)){var n=this._splitStorage?null==(t=Af(e))?void 0:t.storageGroup:void 0,i=n?rc._parse(this._groupEntryName(n)):this._storage._parse(this._name);if(i&&e in i)this._setProp(e,i[e],!1);else{if(n){var r=this._storage._parse(this._name);if(r&&e in r)return void this._setProp(e,r[e],!1)}this._deleteProp(e,!1)}}},t.save=function(){var e=this;if(!this._disabled){var t=this._saveDebounceMs();t>0?Ar(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout(function(){e._pendingSaveTimer=void 0,e._writeNow()},t)):this._writeNow()}},t.flush=function(){Ar(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())},t._writeNow=function(e){if(void 0===e&&(e=!1),!(this._disabled||this._cookieSyncSuppressed&&!e)){e||(this.syncCookieProperties(),this._facebookClickIdChangePending||this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase()||this.refreshKey(Cu));var t=!e&&!this._storageMigrationInProgress;t||(this._crossTabFeatureFlagIdentityMismatch=!1);var n=!!t&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite();if(this._crossTabFeatureFlagIdentityMismatch)this._config.debug&&qa.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this._splitStorage)return this._writeNowSplit(),void(n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}));var i=this._writeEntry(this._storage,this._name,this.props,qf);"written"===i&&this._rememberCurrentCookieProperties(this.props),"failed"!==i&&(this._pendingCrossTabFeatureFlagChanges.clear(),this._localIdentityChangePending=!1,this._facebookClickIdChangePending=!1),n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()})}}},t._writeNowSplit=function(){var e=this,t=this._partitionProps(),n=t.main,i=t.groups,r=this._writeEntry(this._storage,this._name,n,qf);"written"===r&&this._rememberCurrentCookieProperties(n),"failed"!==r&&(this._localIdentityChangePending=!1,this._facebookClickIdChangePending=!1,Bf.forEach(function(t){var n;null!=(n=Af(t))&&n.storageGroup||e._pendingCrossTabFeatureFlagChanges.delete(t)}));for(var s=function(){var t,n=a[o],r=i[n];if(Lr(r)&&(null==(t=e._slotState[n])||!t.persisted))return Bf.forEach(function(t){var i;(null==(i=Af(t))?void 0:i.storageGroup)===n&&e._pendingCrossTabFeatureFlagChanges.delete(t)}),1;var s=e._writeEntry(rc,e._groupEntryName(n),r,n);"failed"!==s&&Bf.forEach(function(t){var i=Af(t);(null==i?void 0:i.storageGroup)!==n||"written"!==s&&i.volatile||e._pendingCrossTabFeatureFlagChanges.delete(t)})},o=0,a=If;a.length>o;o++)if(s())continue},t._partitionProps=function(){var e={},t={flags:{},surveys:{}};return Ha(this.props,function(n,i){var r,s=null==(r=Af(i))?void 0:r.storageGroup;s?t[s][i]=n:e[i]=n}),{main:e,groups:t}},t._entryFingerprint=function(e,t){if(t===qf)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var n={};return Ha(e,function(e,t){var i;n[t]=null!=(i=Af(t))&&i.volatile?"__volatile__":e}),JSON.stringify(n)},t._writeEntry=function(e,t,n,i){var r,s=this._slotWriteState(i);if(i!==qf&&!s.dirty&&!Ar(s.fingerprint))return"skipped";try{if((r=this._entryFingerprint(n,i))===s.fingerprint)return s.dirty=!1,"skipped"}catch(e){r=void 0}return e._set(t,n,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(s.dirty=!1,i!==qf&&(s.persisted=!0),Ar(r)||(s.fingerprint=r),this._splitStorageEligible&&(s.storageValue=rc._get(t)),"written"):(this._config.debug&&qa.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")},t.remove=function(e){var t=(void 0===e?{}:e).keepGroupEntries,n=void 0!==t&&t;if(this._markAllCrossTabFeatureFlagChangesPending(),Ar(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),this._storage._remove(this._name,!1),this._storage._remove(this._name,!0),!n&&this._ownsSplitStorage)for(var i=0,r=If;r.length>i;i++)rc._remove(this._groupEntryName(r[i]));n?delete this._slotState[qf]:this._slotState={},this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0},t.clear=function(){this.remove(),this.props={}},t.register_once=function(e,t,n){var i=this;if(Rr(e)){this.syncCookieProperties(),Ar(t)&&(t="None"),this._expire_days=Ar(n)?this._default_expiry:n;var r=!1;if(Ha(e,function(e,n){i.props.hasOwnProperty(n)&&i.props[n]!==t||(i._setProp(n,e),r=!0)}),r)return this.save(),!0}return!1},t.register=function(e,t){var n=this;if(Rr(e)){this.syncCookieProperties(),this._expire_days=Ar(t)?this._default_expiry:t;var i=!1;if(Ha(e,function(t,r){e.hasOwnProperty(r)&&(n.props[r]!==t||Rr(t)||Tr(t))&&(n._setProp(r,t),i=!0)}),i)return this.save(),!0}return!1},t.unregister=function(e){this.syncCookieProperties();for(var t,n=!1,i=d("string"==typeof e?[e]:e);!(t=i()).done;){var r=t.value;r in this.props&&(this._deleteProp(r),n=!0)}n&&this.save()},t.update_campaign_params=function(){var e=null==Ta?void 0:Ta.URL;if(e!==this._campaign_params_url){var t=Fd(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),n=!Lr(Wa(t));return n&&this.register(t),this._campaign_params_url=e,n?t:void 0}},t.update_search_keyword=function(){var e;this.register((e=null==Ta?void 0:Ta.referrer)?Id(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:Ad(),$referring_domain:null!=Ta&&Ta.referrer&&(null==(e=Vl(Ta.referrer))?void 0:e.host)||Ld},void 0)},t.set_initial_person_info=function(){var e;if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=Md(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes);this.register_once(((e={})[ml]=this._storesIdentityInCookie?{r:Df(t.r),u:t.u?Df(t.u):void 0}:t,e),void 0)}},t.get_initial_props=function(){var e=this,t={};Ha([gl,vl],function(n){var i=e.props[n];i&&Ha(i,function(e,n){t["$initial_"+mr(n)]=e})});var n=this.props[ml];return n&&Na(t,function(e,t){void 0===t&&(t=!1);var n=Od(e,t),i={};return Ha(n,function(e,t){i["$initial_"+mr(t)]=e}),i}(n,this._config.disable_capture_url_hashes)),t},t.safe_merge=function(e){return Ha(this.props,function(t,n){n in e||(e[n]=t)}),e},t.update_config=function(e,t,n){var i=e.persistence!==t.persistence,r=!function(e,t){if(e.length!==t.length)return!1;var n=[].concat(e).sort(),i=[].concat(t).sort();return n.every(function(e,t){return e===i[t]})}(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=i||r,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!n,l=!!this._disabled&&!a;a||this._syncCookieProperties(t,l),this._config=e,!a&&(i||r||o)&&(this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0,this._syncCookieProperties(u({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var c=s||o?this._buildStorage(e):this._storage;this._truncateExistingPersonInfoForCookie();var d=this._resolveSplitStorage(e),h=s||d!==this._splitStorage,f=!a&&(h||e.cross_subdomain_cookie!==this._cross_subdomain||e.secure_cookie!==this._secure)&&this._beginCookieSyncSuppression(l);this._storageMigrationInProgress=h;try{if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),h){var p=this.props;this.clear(),this._storage=c,this._splitStorage=d,this.props=p,this.save()}else o&&(this._storage=c,a||(delete this._slotState[qf],this._writeNow()))}finally{this._storageMigrationInProgress=!1,f&&this._endCookieSyncSuppression()}},t._truncateExistingPersonInfoForCookie=function(){var e=this.props[ml];if(this._storesIdentityInCookie&&Rr(e)&&"string"==typeof e.r){var t=Df(e.r),n="string"==typeof e.u?Df(e.u):e.u;t===e.r&&n===e.u||this._setProp(ml,u({},e,{r:t,u:n}))}},t.set_disabled=function(e){this._disabled=e,this._disabled?this.remove():this.save()},t.set_cross_subdomain=function(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove({keepGroupEntries:!0}),this.save())},t.set_secure=function(e){e!==this._secure&&(this._secure=e,this.remove({keepGroupEntries:!0}),this.save())},t.set_event_timer=function(e,t){var n=this.props.__timers||{};n[e]=t,this._setProp(Pu,n),this.save()},t.remove_event_timer=function(e){var t=this.props.__timers||{},n=t[e];return Ar(n)||(delete t[e],this._setProp(Pu,t),this.save()),n},t.get_property=function(e){return this.props[e]},t.set_property=function(e,t){this._setProp(e,t),this.save()},t._setProp=function(e,t,n){var i;void 0===n&&(n=!0);var r=this.props[e];this.props[e]=t,n&&("distinct_id"!==e&&"$user_state"!==e||r===t||(this._localIdentityChangePending=!0),"$fbc_persistence"!==e||Hf(r,t)||(this._facebookClickIdChangePending=!0),this._markPendingCrossTabFeatureFlagChanges(e,r,t),null!=(i=Af(e))&&i.volatile||this._markGroupDirty(e))},t._deleteProp=function(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(jf(e)&&this._setCrossTabFeatureFlagChangesPending(e,!0),"$fbc_persistence"===e&&(this._facebookClickIdChangePending=!0),this._markGroupDirty(e))},t._markGroupDirty=function(e){var t,n=null==(t=Af(e))?void 0:t.storageGroup;n&&(this._slotWriteState(n).dirty=!0)},t._slotWriteState=function(e){return this._slotState[e]||(this._slotState[e]={})},e}(),Uf=Ba("[RateLimiter]"),Wf=function(){"use strict";function e(e){var t=this;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=function(e){var n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(function(e){Uf.info((e||"events")+" is quota limited."),t.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void Uf.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}var t=e.prototype;return t.clientRateLimitContext=function(e){var t,n,i;void 0===e&&(e=!1);var r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(t=null==(n=this.instance.persistence)?void 0:n.get_property("$capture_rate_limit"))&&void 0!==t?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>r&&(a.tokens=r);var u=1>a.tokens;if(u||e||(a.tokens=Math.max(0,a.tokens-1)),u&&!e){var l=(qr(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this._captureWarning(l)&&(a.dropped=0)}return this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(_l,a),{isRateLimited:u,remainingTokens:a.tokens}},t._isPropertyAllowed=function(e){var t=this.instance.config.property_denylist;return!Tr(t)||!t.includes(e)},t._triggeringPage=function(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=Ia&&Ia.pathname)return""+(null!==(e=Ia.origin)&&void 0!==e?e:"")+Ia.pathname},t._captureWarning=function(e){var t,n,i=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,s=this._triggeringPage(),o=this._isPropertyAllowed("$session_id")?null==(t=(n=this.instance).get_session_id)?void 0:t.call(n):void 0,a=[e+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+r+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0})},t.isServerRateLimited=function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t},o(e,[{key:"captureEventsPerSecond",get:function(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}},{key:"captureEventsBurstLimit",get:function(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}}])}(),Gf=Ba("[RemoteConfig]"),Kf=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t,n,i=this;null!=(t=th.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=th.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",function(){return e(i.remoteConfig)}):e()},t._loadRemoteConfigJSON=function(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})},t.load=function(){var e=this;try{if(this.remoteConfig)return Gf.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void Gf.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(function(t){if(!t)return Gf.info("No config found after loading remote JS config. Falling back to JSON."),void e._loadRemoteConfigJSON(function(t){e._onRemoteConfig(t.json,t)});e._onRemoteConfig(t)})}catch(e){Gf.error("Error loading remote config",e),this._onRemoteConfig()}},t._onRemoteConfig=function(e,t){!e&&t&&(0===t.statusCode?t.error||Gf.warn("Failed to fetch remote config from PostHog."):Gf.error("Failed to fetch remote config from PostHog."));try{this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1})}catch(e){Gf.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;null==(n=this._instance.featureFlags)||n.ensureFlagsLoaded()}catch(e){Gf.error("Error loading feature flags",e)}},o(e,[{key:"remoteConfig",get:function(){var e;return null==(e=th._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),Qf=Uint8Array,Zf=Uint16Array,Jf=Uint32Array,Yf=new Qf([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]),Xf=new Qf([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]),ep=new Qf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),tp=function(e,t){for(var n=new Zf(31),i=0;31>i;++i)n[i]=t+=1<<e[i-1];var r=new Jf(n[30]);for(i=1;30>i;++i)for(var s=n[i];n[i+1]>s;++s)r[s]=s-n[i]<<5|i;return[n,r]},np=tp(Yf,2),ip=np[1];np[0][28]=258,ip[258]=28;for(var rp=tp(Xf,0)[1],sp=new Zf(32768),op=0;32768>op;++op){var ap=(43690&op)>>>1|(21845&op)<<1;sp[op]=((65280&(ap=(61680&(ap=(52428&ap)>>>2|(13107&ap)<<2))>>>4|(3855&ap)<<4))>>>8|(255&ap)<<8)>>>1}var up=function(e,t,n){for(var i=e.length,r=0,s=new Zf(t);i>r;++r)++s[e[r]-1];var o,a=new Zf(t);for(r=0;t>r;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new Zf(1<<t);var u=15-t;for(r=0;i>r;++r)if(e[r])for(var l=r<<4|e[r],c=t-e[r],d=a[e[r]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)o[sp[d]>>>u]=l}else for(o=new Zf(i),r=0;i>r;++r)o[r]=sp[a[e[r]-1]++]>>>15-e[r];return o},lp=new Qf(288);for(op=0;144>op;++op)lp[op]=8;for(op=144;256>op;++op)lp[op]=9;for(op=256;280>op;++op)lp[op]=7;for(op=280;288>op;++op)lp[op]=8;var cp=new Qf(32);for(op=0;32>op;++op)cp[op]=5;var dp=up(lp,9,0),hp=up(cp,5,0),fp=function(e){return(e/8|0)+(7&e&&1)},pp=function(e,t,n){(null==t||0>t)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof Zf?Zf:e instanceof Jf?Jf:Qf)(n-t);return i.set(e.subarray(t,n)),i},_p=function(e,t,n){var i=t/8|0;e[i]|=n<<=7&t,e[i+1]|=n>>>8},vp=function(e,t,n){var i=t/8|0;e[i]|=n<<=7&t,e[i+1]|=n>>>8,e[i+2]|=n>>>16},gp=function(e,t){for(var n=[],i=0;e.length>i;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,s=n.slice();if(!r)return[new Qf(0),0];if(1==r){var o=new Qf(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=r-1;)a=n[n[d].f>n[l].f?l++:d++],u=n[l!=c&&n[d].f>n[l].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var h=s[0].s;for(i=1;r>i;++i)s[i].s>h&&(h=s[i].s);var f=new Zf(h+1),p=mp(n[c-1],f,0);if(p>t){i=0;var _=0,v=p-t,g=1<<v;for(s.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r>i;++i){var m=s[i].s;if(t>=f[m])break;_+=g-(1<<p-f[m]),f[m]=t}for(_>>>=v;_>0;){var y=s[i].s;t>f[y]?_-=1<<t-f[y]++-1:++i}for(;i>=0&&_;--i){var b=s[i].s;f[b]==t&&(--f[b],++_)}p=t}return[new Qf(f),p]},mp=function(e,t,n){return-1==e.s?Math.max(mp(e.l,t,n+1),mp(e.r,t,n+1)):t[e.s]=n},yp=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Zf(++t),i=0,r=e[0],s=1,o=function(e){n[i++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=e[a]}return[n.subarray(0,i),t]},bp=function(e,t){for(var n=0,i=0;t.length>i;++i)n+=e[i]*t[i];return n},wp=function(e,t,n){var i=n.length,r=fp(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var s=0;i>s;++s)e[r+s+4]=n[s];return 8*(r+4+i)},Sp=function(e,t,n,i,r,s,o,a,u,l,c){_p(t,c++,n),++r[256];for(var d=gp(r,15),h=d[0],f=d[1],p=gp(s,15),_=p[0],v=p[1],g=yp(h),m=g[0],y=g[1],b=yp(_),w=b[0],S=b[1],x=new Zf(19),k=0;m.length>k;++k)x[31&m[k]]++;for(k=0;w.length>k;++k)x[31&w[k]]++;for(var C=gp(x,7),P=C[0],E=C[1],F=19;F>4&&!P[ep[F-1]];--F);var T,I,R,L,A=l+5<<3,M=bp(r,lp)+bp(s,cp)+o,O=bp(r,h)+bp(s,_)+o+14+3*F+bp(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(M>=A&&O>=A)return wp(t,c,e.subarray(u,u+l));if(_p(t,c,1+(M>O)),c+=2,M>O){T=up(h,f,0),I=h,R=up(_,v,0),L=_;var D=up(P,E,0);for(_p(t,c,y-257),_p(t,c+5,S-1),_p(t,c+10,F-4),c+=14,k=0;F>k;++k)_p(t,c+3*k,P[ep[k]]);c+=3*F;for(var q=[m,w],B=0;2>B;++B){var j=q[B];for(k=0;j.length>k;++k)_p(t,c,D[H=31&j[k]]),c+=P[H],H>15&&(_p(t,c,j[k]>>>5&127),c+=j[k]>>>12)}}else T=dp,I=lp,R=hp,L=cp;for(k=0;a>k;++k)if(i[k]>255){var H;vp(t,c,T[257+(H=i[k]>>>18&31)]),c+=I[H+257],H>7&&(_p(t,c,i[k]>>>23&31),c+=Yf[H]);var N=31&i[k];vp(t,c,R[N]),c+=L[N],N>3&&(vp(t,c,i[k]>>>5&8191),c+=Xf[N])}else vp(t,c,T[i[k]]),c+=I[i[k]];return vp(t,c,T[256]),c+I[256]},xp=new Jf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kp=new Qf(0),Cp=function(){for(var e=new Jf(256),t=0;256>t;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Pp=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Ep(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;t.length>i;++i)n=Cp[255&n^t[i]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),i=e.length;n.p(e);var r,s,o,a,u,l=(r=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,n,i,r,s){var o=e.length,a=new Qf(i+o+5*(1+Math.floor(o/7e3))+r),u=a.subarray(i,a.length-r),l=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var d=c+65535;o>d?l=wp(u,l,e.subarray(c,d)):(u[c]=s,l=wp(u,l,e.subarray(c,o)))}else{for(var h=xp[t-1],f=h>>>13,p=8191&h,_=(1<<n)-1,v=new Zf(32768),g=new Zf(_+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new Jf(25e3),S=new Zf(288),x=new Zf(32),k=0,C=0,P=(c=0,0),E=0,F=0;o>c;++c){var T=b(c),I=32767&c,R=g[T];if(v[I]=R,g[T]=I,c>=E){var L=o-c;if((k>7e3||P>24576)&&L>423){l=Sp(e,u,0,w,S,x,C,P,F,c-F,l),P=k=C=0,F=c;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)x[A]=0}var M=2,O=0,D=p,q=I-R&32767;if(L>2&&T==b(c-q))for(var B=Math.min(f,L)-1,j=Math.min(32767,c),H=Math.min(258,L);j>=q&&--D&&I!=R;){if(e[c+M]==e[c+M-q]){for(var N=0;H>N&&e[c+N]==e[c+N-q];++N);if(N>M){if(M=N,O=q,N>B)break;var V=Math.min(q,N-2),z=0;for(A=0;V>A;++A){var U=c-q+A+32768&32767,W=U-v[U]+32768&32767;W>z&&(z=W,R=U)}}}q+=(I=R)-(R=v[I])+32768&32767}if(O){w[P++]=268435456|ip[M]<<18|rp[O];var G=31&ip[M],K=31&rp[O];C+=Yf[G]+Xf[K],++S[257+G],++x[K],E=c+M,++k}else w[P++]=e[c],++S[e[c]]}}l=Sp(e,u,s,w,S,x,C,P,F,c-F,l),s||(l=wp(u,l,kp))}return pp(a,0,i+fp(l)+r)}(r,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,o,a,!u)),c=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Pp(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;n.length>=i;++i)e[i+10]=n.charCodeAt(i)}}(l,t),Pp(l,c-8,n.d()),Pp(l,c-4,i),l}var Fp=!!La||!!Ra,Tp="text/plain",Ip=!1,Rp=function(e,t){var n=e.split("#"),i=n[1],r=n[0].split("?"),s=r[0],o=r[1];if(!o)return e;var a=o.split("&").filter(function(e){return e.split("=")[0]!==t}).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},Lp=function(e,t,n){var i;void 0===n&&(n=!0);var r=e.split("?"),s=r[0],o=r[1],a=u({},t),l=null!==(i=null==o?void 0:o.split("&").map(function(e){var t,i=e.split("="),r=i[0],s=n&&null!==(t=a[r])&&void 0!==t?t:i[1];return delete a[r],r+"="+s}))&&void 0!==i?i:[],c=function(e,t){var n,i;void 0===t&&(t="&");var r=[];return Ha(e,function(e,t){Ar(e)||Ar(t)||"undefined"===t||(n=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),i=encodeURIComponent(t),r[r.length]=i+"="+n)}),r.join(t)}(a);return c&&l.push(c),l.length>0?s+"?"+l.join("&"):s},Ap=function(e){if(e._encodedBody)return e._encodedBody;var t=e.data,n=e.compression;if(t){if(n===ji){var i=Ep(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Qf(e.length+(e.length>>>1)),i=0,r=function(e){n[i++]=e},s=0;t>s;++s){if(i+5>n.length){var o=new Qf(i+8+(t-s<<1));o.set(n),n=o}var a=e.charCodeAt(s);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++s))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return pp(n,0,i)}(Nl(t)),{mtime:0});return{contentType:Tp,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(n===Hi){var r=function(e){return"data="+encodeURIComponent("string"==typeof e?e:Nl(e))}(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})):e}(Nl(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var s=Nl(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},Mp=function(e){var t,n,i=function(){return"sendBeacon"===e.transport?{url:Lp(e.url,{compression:Hi}),encodedBody:Ap(u({},e,{compression:Hi,_encodedBody:void 0}))}:{url:Rp(e.url,"compression"),encodedBody:Ap(u({},e,{compression:void 0,_encodedBody:void 0}))}};try{t=Ap(e)}catch(t){if(Jo(e.compression,zl(e.url,"compression")))return qa.error("Failed to gzip request body, sending uncompressed payload",t),i();throw t}return t&&Jo(e.compression,zl(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?Zo(new Uint8Array(n)):ArrayBuffer.isView(n)&&Zo(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Ip=!0,i()):{url:e.url,encodedBody:t}},Op=function(e){try{return Mp(e)}catch(t){return qa.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},$p=function(){var e=p(l().m(function e(t){var n,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:return n=Nl(t.data),e.n=1,na(n,Mh.DEBUG,{rethrow:!0});case 1:if(i=e.v){e.n=2;break}return e.a(2,t);case 2:return e.n=3,i.arrayBuffer();case 3:return e.a(2,u({},t,{_encodedBody:{contentType:Tp,body:r=e.v,estimatedSize:r.byteLength}}))}},e)}));return function(t){return e.apply(this,arguments)}}(),Dp=/Failed to fetch|NetworkError|Load failed/i,qp=function(e){return"TypeError"===(null==e?void 0:e.name)&&Dp.test((null==e?void 0:e.message)||"")},Bp=function(e){var t=Op(e);if(t){var n=t.url,i=t.encodedBody,r=null!=i?i:{},s=r.contentType,o=r.body,a=r.estimatedSize,l=new Headers;Ha(e.headers,function(e,t){l.append(t,e)}),s&&l.append("Content-Type",s);var c=null,d=!1;if(Aa){var h=new Aa;c={signal:h.signal,timeout:setTimeout(function(){var t;d=!0,h.abort(uo("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))},e.timeout)}}var f=function(t){d&&"AbortError"===(null==t?void 0:t.name)||qp(t)?qa.warn(t):qa.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var p;Ra(n,u({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&!e._keepaliveDisabled&&52428.8>(a||0),body:o,signal:null==(p=c)?void 0:p.signal},e.fetchOptions)).then(function(t){return t.text().then(function(n){var i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){qa.error(e)}null==e.callback||e.callback(i)})}).catch(f).finally(function(){return c?clearTimeout(c.timeout):null})}catch(e){c&&clearTimeout(c.timeout),f(e)}}},jp=function(e){try{var t,n=Mp(e),i=n.url,r=n.encodedBody,s=null!=r?r:{},o=s.body,a=s.estimatedSize;if(!o)return;var l=o instanceof Blob?o:new Blob([o],{type:s.contentType});if(Fa.sendBeacon(i,l))return;var c=Tr(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Tr(c)&&c.length>1&&(null!=a?a:0)>16384){var d=Math.ceil(c.length/2),h=function(t){return Tr(e.data)?t:u({},e.data,{batch:t})};return jp(u({},e,{data:h(c.slice(0,d))})),void jp(u({},e,{data:h(c.slice(d))}))}qa.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to fetch"),Bp(u({},e,{_keepaliveDisabled:!0}))}catch(e){qa.warn("Beacon send failed",e)}},Hp=function(e,t,n,i){var r,s="query"===i?"POST"===t?"sent_at":"_":void 0;return Lp(n===ji?Rp(e,"compression"):e,u({},s?((r={})[s]=Date.now().toString(),r):{},n===ji?{}:{compression:n}))},Np=[];Ra&&Np.push({transport:"fetch",method:Bp}),La&&Np.push({transport:"XHR",method:function(e){var t=Op(e);if(t){var n=new La,i=t.encodedBody;n.open(e.method||"GET",t.url,!0);var r=null!=i?i:{},s=r.contentType,o=r.body;Ha(e.headers,function(e,t){n.setRequestHeader(t,e)}),s&&n.setRequestHeader("Content-Type",s),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=function(){if(4===n.readyState){var t={statusCode:n.status,text:n.responseText};if(200===n.status)try{t.json=JSON.parse(n.responseText)}catch(e){}null==e.callback||e.callback(t)}},n.send(o)}}}),null!=Fa&&Fa.sendBeacon&&Np.push({transport:"sendBeacon",method:jp});var Vp=function(){"use strict";function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=Jr((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,qa.createLogger("flush interval"),3e3),this._sendRequest=e}var t=e.prototype;return t.enqueue=function(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()},t.unload=function(){var e=this;this._clearFlushTimeout();var t=this._queue.length>0?this._formatQueue():{},n=Object.values(t);[].concat(n.filter(function(e){return 0===e.url.indexOf("/e")}),n.filter(function(e){return 0!==e.url.indexOf("/e")})).map(function(t){e._sendRequestSafely(u({},t,{transport:"sendBeacon"}))})},t.enable=function(){this._isPaused=!1,this._setFlushTimeout()},t._setFlushTimeout=function(){var e=this;this._isPaused||(this._flushTimeout=setTimeout(function(){if(e._clearFlushTimeout(),e._queue.length>0){var t=e._formatQueue(),n=function(){var n=t[i],r=(new Date).getTime();n.data&&Tr(n.data)&&Ha(n.data,function(e){e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e._sendRequestSafely(n)};for(var i in t)n()}},this._flushTimeoutMs))},t._sendRequestSafely=function(e){try{this._sendRequest(e)}catch(e){qa.error(e)}},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={};return Ha(this._queue,function(t){var n,i=t,r=(i?i.batchKey:null)||i.url;Ar(e[r])&&(e[r]=u({},i,{data:[]})),null==(n=e[r].data)||n.push(i.data)}),this._queue=[],e},e}(),zp=function(){"use strict";function t(e){var t=this;this._instance=e,this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._queue=[],this._areWeOnline=!0,!Ar(Pa)&&"onLine"in Pa.navigator&&(this._areWeOnline=Pa.navigator.onLine,this._onlineListener=function(){t._areWeOnline=!0,t._flush()},this._offlineListener=function(){t._areWeOnline=!1},Qa(Pa,"online",this._onlineListener),Qa(Pa,"offline",this._offlineListener))}var n=t.prototype;return n.retriableRequest=function(t){var n=this,i=t.retriesPerformedSoFar,s=r(t,e);Br(i)&&(s.url=Lp(s.url,{retry_count:i})),this._instance._send_request(u({},s,{callback:function(e){if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=i?i:0))return void n._enqueue(u({retriesPerformedSoFar:i},s));0===e.statusCode&&qa.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=i?i:0)+" retries.")}null==s.callback||s.callback(e)}}))},n._enqueue=function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,i=Math.min(18e5,t),r=(Math.random()-.5)*(i-n);return Math.ceil(i+r)}(t),i=Date.now()+n;this._queue.push({retryAt:i,requestOptions:e});var r="Enqueued failed request for retry in "+n;navigator.onLine||(r+=" (Browser is offline)"),qa.warn(r),this._isPolling||(this._isPolling=!0,this._poll())},n._poll=function(){var e=this;if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout(function(){e._areWeOnline&&e._queue.length>0&&e._flush(),e._poll()},this._pollIntervalMs)},n._flush=function(){var e=Date.now(),t=[],n=this._queue.filter(function(n){return e>n.retryAt||(t.push(n),!1)});if(this._queue=t,n.length>0)for(var i,r=d(n);!(i=r()).done;)this.retriableRequest(i.value.requestOptions)},n.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,Ar(Pa)||(this._onlineListener&&(Pa.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Pa.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0));for(var e,t=d(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(u({},n,{transport:"sendBeacon"}))}catch(e){qa.error(e)}}this._queue=[]},o(t,[{key:"length",get:function(){return this._queue.length}}])}(),Up=function(){"use strict";function e(e){var t=this;this._instance=e,this._updateScrollData=function(){var e,n,i,r;t._context||(t._context={});var s=t.scrollElement(),o=t.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,u=o+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;t._context.lastScrollY=Math.ceil(o),t._context.maxScrollY=Math.max(o,null!==(e=t._context.maxScrollY)&&void 0!==e?e:0),t._context.maxScrollHeight=Math.max(a,null!==(n=t._context.maxScrollHeight)&&void 0!==n?n:0),t._context.lastContentY=u,t._context.maxContentY=Math.max(u,null!==(i=t._context.maxContentY)&&void 0!==i?i:0),t._context.maxContentHeight=Math.max(l,null!==(r=t._context.maxContentHeight)&&void 0!==r?r:0)}}var t=e.prototype;return t.getContext=function(){return this._context},t.resetContext=function(){var e=this._context;return setTimeout(this._updateScrollData,0),e},t.startMeasuringScrollPosition=function(){Qa(Pa,"scroll",this._updateScrollData,{capture:!0}),Qa(Pa,"scrollend",this._updateScrollData,{capture:!0}),Qa(Pa,"resize",this._updateScrollData)},t.scrollElement=function(){var e;if(!this._scrollRoot)return null==Pa||null==(e=Pa.document)?void 0:e.documentElement;for(var t,n=d(Tr(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]);!(t=n()).done;){var i,r=null==Pa||null==(i=Pa.document)?void 0:i.querySelector(t.value);if(r)return r}},t._scrollPosition=function(e){var t,n,i="y"===e?"scrollTop":"scrollLeft";if(this._scrollRoot){var r=this.scrollElement();return r&&r[i]||0}return Pa?"y"===e?Pa.scrollY||Pa.pageYOffset||(null==(t=Pa.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:Pa.scrollX||Pa.pageXOffset||(null==(n=Pa.document)||null==(n=n.documentElement)?void 0:n.scrollLeft)||0:0},t.scrollY=function(){return this._scrollPosition("y")},t.scrollX=function(){return this._scrollPosition("x")},o(e,[{key:"_scrollRoot",get:function(){return this._instance.config.scroll_root_selector}}])}(),Wp=function(e){return Md(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes)},Gp=function(){"use strict";function e(e,t,n,i){var r=this;this._onSessionIdCallback=function(e){var t,n=r._getStored();if(!n||n.sessionId!==e){var i={sessionId:e,props:r._sessionSourceParamGenerator(r._instance)};r._persistence.register(((t={})[pl]=i,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=i||Wp,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[pl]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?Od(t,this._instance.config.disable_capture_url_hashes):{$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}:{}},t.getSessionProps=function(){var e={};return Ha(Wa(this.getSetOnceProps()),function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+mr(n)]=t}),e},e}(),Kp=function(){"use strict";function e(){this._events={}}var t=e.prototype;return t.on=function(e,t){var n=this;return this._events[e]||(this._events[e]=[]),this._events[e].push(t),function(){n._events[e]=n._events[e].filter(function(e){return e!==t})}},t.emit=function(e,t){for(var n,i=d(this._events[e]||[]);!(n=i()).done;)(0,n.value)(t);for(var r,s=d(this._events["*"]||[]);!(r=s()).done;)(0,r.value)(e,t)},e}(),Qp=Ba("[SessionId]"),Zp=864e5,Jp=function(){"use strict";function e(e,t,n){var i,r=this;if(this._lastPersistedActivityTimestamp=null,this._lastCookieSyncTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new Kp,this._sessionHasBeenIdleTooLong=function(e,t){return!(!Br(e)||!Br(t))&&Math.abs(e-t)>r.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._pendingBootstrapSession=void 0,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||jl,this._windowIdGenerator=n||jl;var s=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*Jr(this._config.session_idle_timeout_seconds||1800,60,36e3,Qp.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var o=mc._parse(this._window_id_storage_key),a=mc._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:mc._remove(this._window_id_storage_key),mc._set(this._primary_window_exists_storage_key,!0)}null!=(i=this._config.bootstrap)&&i.sessionID&&this.setBootstrapSessionId(this._config.bootstrap.sessionID),this._listenToReloadWindow()}var t=e.prototype;return t.on=function(e,t){return this._eventEmitter.on(e,t)},t.onSessionId=function(e){var t=this;return Ar(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(t){return t!==e})}},t._canUseSessionStorage=function(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&mc._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&mc._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?mc._parse(this._window_id_storage_key):null},t._isActivityChangeBelowGranularity=function(e){var t=this._lastPersistedActivityTimestamp;return!$r(t)&&!$r(e)&&5e3>Math.abs(e-t)},t._setSessionId=function(e,t,n){var i,r=t!==this._sessionActivityTimestamp,s=!(e!==this._sessionId||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,s&&!r||s&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register(((i={})[Vu]=[t,e,n],i)))},t._useCrossTabRefreshHardening=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return Br(t)&&t>0},t._refreshSessionIdFromStorage=function(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(Vu):(this._persistence.flush(),this._persistence.load())},t._flushPendingActivityTimestamp=function(){var e,t;if(!$r(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._lastPersistedActivityTimestamp){this._refreshSessionIdFromStorage();var n=this._getSessionId();n[1]===this._sessionId&&n[2]===this._sessionStartTimestamp&&(this._lastPersistedActivityTimestamp=this._sessionActivityTimestamp,this._persistence.register(((t={})[Vu]=[this._sessionActivityTimestamp,null!==(e=this._sessionId)&&void 0!==e?e:null,this._sessionStartTimestamp],t)),this._persistence.flush())}},t._freshestActivityTimestamp=function(){var e=this._getSessionId()[0],t=Br(e)?e:0,n=Br(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)},t._isSessionIdleAfterCrossTabRefresh=function(e){return this._refreshSessionIdFromStorage(),this._sessionHasBeenIdleTooLong(e,this._freshestActivityTimestamp())},t._getSessionId=function(){var e=this._persistence.props[Vu];return Tr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]},t.resetSessionId=function(){this._lastPersistedActivityTimestamp=null,this._pendingBootstrapSession=void 0,clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._setSessionId(null,null,null)},t.setBootstrapSessionId=function(e,t){void 0===t&&(t=!1);var n=function(e,t){void 0===t&&(t=(new Date).getTime());try{var n=function(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)}(e);return n>t+6e4?void Qp.error("Bootstrap sessionID cannot be in the future"):n}catch(e){return void Qp.error("Invalid sessionID in bootstrap",e)}}(e);return!Ar(n)&&(t?this._pendingBootstrapSession={sessionId:e,sessionStartTimestamp:n}:this._setSessionId(e,(new Date).getTime(),n),!0)},t.destroy=function(){this._destroyed=!0,this._flushPendingActivityTimestamp(),clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&Pa&&(Pa.removeEventListener(Il,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]},t._listenToReloadWindow=function(){var e=this;this._beforeUnloadListener=function(){e._flushPendingActivityTimestamp(),e._canUseSessionStorage()&&mc._remove(e._primary_window_exists_storage_key)},Qa(Pa,Il,this._beforeUnloadListener,{capture:!1})},t.checkAndGetSessionAndWindowId=function(e,t,n){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===n&&(n=!1),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),r=this._sessionId;if(n)this._lastCookieSyncTimestamp=i;else if($r(this._lastCookieSyncTimestamp)||this._lastCookieSyncTimestamp>i||i-this._lastCookieSyncTimestamp>=1e3){var s,o;null==(s=(o=this._persistence).syncCookieProperties)||s.call(o),this._lastCookieSyncTimestamp=i}var a=this._getSessionId(),u=a[1],l=a[2],c=!Ar(r)&&u!==r,d=this._freshestActivityTimestamp(),h=this._getWindowId(),f=this._pendingBootstrapSession,p=!!f&&(f.sessionStartTimestamp>i+6e4||i-f.sessionStartTimestamp>Zp),_=f?p:Br(l)&&Math.abs(i-l)>Zp,v=!1,g=c,m=!u||!!f,y=u,b=!m&&!e&&this._sessionHasBeenIdleTooLong(i,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(i))||Qp.info("cross-tab refresh kept the session alive",{sessionId:u});var w=this._getSessionId();u=w[1],l=w[2]}if(m||b||_){g=!1;var S=f&&!p;u=S?f.sessionId:this._sessionIdGenerator(),h=this._windowIdGenerator(),Qp.info("new session ID assigned",{sessionId:u,windowId:h,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_}}),l=S?f.sessionStartTimestamp:i,this._pendingBootstrapSession=void 0,v=!0}else h||(h=this._windowIdGenerator(),v=!0),(g=g||u!==y)&&(Qp.info("adopted cross-tab session id",{sessionId:u,windowId:h}),v=!0);var x=Br(d)&&e&&!_?d:i,k=Br(l)?l:(new Date).getTime();this._setWindowId(h),this._setSessionId(u,x,k),e||this._resetIdleTimer();var C={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_,crossTabAdoption:g};return v&&this._sessionIdChangedHandlers.forEach(function(e){return e(u,h,C)}),{sessionId:u,windowId:h,sessionStartTimestamp:k,changeReason:v?C:void 0,lastActivityTimestamp:d}},t._resetIdleTimer=function(){var e=this;this._destroyed||(clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(function(){if(!e._destroyed)if(e._isSessionIdleAfterCrossTabRefresh((new Date).getTime())){var t=e._sessionId;e.resetSessionId(),e._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}else e._resetIdleTimer()},1.1*this.sessionTimeoutMs))},o(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}}])}(),Yp=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&_r(n,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some(function(e){return _r(null==e?void 0:e.brand,t)}))return!0}catch(e){}return!!e.webdriver};function Xp(){return(Xp=p(l().m(function e(){var t,n,i,r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!=(t=null==Fa?void 0:Fa.userAgentData)&&t.getHighEntropyValues){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,t.getHighEntropyValues(["model"]);case 2:if(null!=(n=e.v)){e.n=3;break}r=void 0,e.n=4;break;case 3:r=n.model;case 4:return e.a(2,Mr(i=r)&&i.length>0?i:void 0);case 5:return e.p=5,qa.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e.v),e.a(2)}},e,null,[[1,5]])}))).apply(this,arguments)}var e_="custom",t_="i.posthog.com",n_=/^\/static\//,i_=["/s/","/e/","/i/"],r_=function(){"use strict";function e(e){this._regionCache={},this.instance=e}var t=e.prototype;return t._staticAssetHostOverride=function(e){if(n_.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}},t._urlKey=function(e){var t=Vl(e);return t?t.protocol+"//"+t.host+t.pathname:void 0},t._prepareEndpoint=function(e,t,n){if("ui"===e)return n;var i=n,r=this.instance.config.rewriteRequestPath;if(r){var s,o=(null==(s=Vl(n))?void 0:s.href)||n;i=r(new URL(o)).toString()}if(r&&"api"===e&&i_.some(function(e){return 0===t.indexOf(e)})){var a=this._urlKey(i);if(a){var u,l=this.apiHost,c=this._ingestionEndpoints;(null==(u=c)?void 0:u.apiHost)===l&&c.rewriteRequestPath===r||(this._ingestionEndpoints=c={apiHost:l,rewriteRequestPath:r,urls:new Set}),c.urls.add(a)}}return i},t.isIngestionEndpoint=function(e){var t=this._ingestionEndpoints,n=this._urlKey(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&t.urls.has(n)},t.endpointFor=function(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this._prepareEndpoint(e,t,this.uiHost+t);if("flags"===e)return this._prepareEndpoint(e,t,this.flagsApiHost+t);if("assets"===e){var n=this._staticAssetHostOverride(t);if(n)return this._prepareEndpoint(e,t,""+n+t)}if(this.region===e_)return this._prepareEndpoint(e,t,this.apiHost+t);var i=t_+t;switch(e){case"assets":return this._prepareEndpoint(e,t,"https://"+this.region+"-assets."+i);case"api":return this._prepareEndpoint(e,t,"https://"+this.region+"."+i)}},o(e,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}},{key:"flagsApiHost",get:function(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}},{key:"uiHost",get:function(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+t_,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(this._regionCache[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":e_),this._regionCache[this.apiHost]}}])}(),s_=Ba("[PostHog ExternalIntegrations]"),o_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},a_=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadScript=function(e,t){var n;null==(n=th.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,function(e){if(e)return s_.error("failed to load script",e);t()})},t.startIfEnabledOrStop=function(){for(var e=this,t=function(){var t,r,s,o=i[n],a=o[0],u=o[1];!u||null!=(t=th.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[a]||e._loadScript(o_[a],function(){var t;null==(t=th.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[a])||t.start(e._instance)}),!u&&null!=(r=th.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[a]&&(null==(s=th.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[a])||s.stop())},n=0,i=Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{});i.length>n;n++){var r;t()}},e}(),u_=function(){"use strict";function e(e,t){this._logger=e,this._client=t,this._extensions=new Map,this._disposed=!1}var t=e.prototype;return t.add=function(){var e=p(l().m(function e(t){var n,i,r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._disposed){e.n=1;break}throw new Error("Cannot add an extension to a disposed ExtensionRuntime");case 1:if(!this._extensions.has(t.name)){e.n=2;break}throw new Error('Browser extension "'+t.name+'" is already registered');case 2:if(this._extensions.set(t.name,t),e.p=3,!(n=t.setup(this._client))){e.n=4;break}return e.n=4,n;case 4:e.n=6;break;case 5:e.p=5,r=e.v,(i=this._extensions.get(t.name)===t)&&this._extensions.delete(t.name),this._logger.error('Failed to set up browser extension "'+t.name+'"',r),i&&this._disposeExtension(t);case 6:return e.a(2)}},e,this,[[3,5]])}));return function(t){return e.apply(this,arguments)}}(),t.getExtension=function(e){return this._extensions.get(e)},t.dispose=function(){if(!this._disposed){this._disposed=!0;var e=Array.from(this._extensions.values()).reverse();this._extensions.clear();for(var t,n=d(e);!(t=n()).done;)this._disposeExtension(t.value)}},t._disposeExtension=function(e){var t=this;try{var n=null==e.dispose?void 0:e.dispose();n&&Ir(n.then)&&n.then(void 0,function(n){t._logger.error('Failed to dispose browser extension "'+e.name+'"',n)})}catch(t){this._logger.error('Failed to dispose browser extension "'+e.name+'"',t)}},e}(),l_=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.initialize=function(){},t.get=function(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);for(var n,i={},r=d(e);!(n=r()).done;){var s=n.value,o=null==t?void 0:t.get_property(s);Ar(o)||(i[s]=o)}return i},t.set=function(e,t){var n,i;null==(n=this._instance.persistence)||n.register("string"==typeof e?((i={})[e]=t,i):e)},t.remove=function(e){var t;null==(t=this._instance.persistence)||t.unregister(e)},e}(),c_="extensionsRemoteConfig",d_=function(){"use strict";function e(e){var t=this;this.instance=e,this._disposed=!1,this._logger=qa,this._latestRemoteConfigResult=e._lastRemoteConfig,this.kv=new l_(e),this.onEvent=function(e){return xa(t.instance.on("eventCaptured",function(n){try{e({event:n.event,properties:n.properties})}catch(e){t._logger.error("Browser extension event listener failed",e)}}))},this.onRemoteConfig=function(e){if(t._disposed)return xa(function(){});var n=function(n){try{e(n)}catch(e){t._logger.error("Browser extension remote config listener failed",e)}},i=t.instance._internalEventEmitter.on(c_,n);return t._latestRemoteConfigResult&&n(t._latestRemoteConfigResult),xa(i)},this._runtime=new u_(qa.createLogger("[BrowserExtensions]"),this)}var t=e.prototype;return t.add=function(e){return this._runtime.add(e)},t.getExtension=function(e){return this._runtime.getExtension(e)},t.capture=function(){var e=p(l().m(function e(t,n,i){return l().w(function(e){for(;;)switch(e.n){case 0:if(i){e.n=1;break}return this.instance.capture(t,n),e.a(2);case 1:this.instance.capture(t,n,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce});case 2:return e.a(2)}},e,this)}));return function(t,n,i){return e.apply(this,arguments)}}(),t.registerDynamicEventProperties=function(e){return xa(this.instance._registerExtensionEventProperties(e))},t.handleRemoteConfig=function(e){this._disposed||(this._latestRemoteConfigResult=e,this.instance._internalEventEmitter.emit(c_,e))},t.sendRequest=function(){var e=p(l().m(function e(t,n){var i,r,s,o=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(void 0===n&&(n={}),r=this.instance.requestRouter.endpointFor(null!==(i=n.target)&&void 0!==i?i:"api",t),s={method:n.method,url:n.query?Lp(r,n.query):r,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,compressionFallback:"flags"===n.target&&"best-available"===n.compression?wr.Base64:void 0,timestampMode:n.sentAt},"sendBeacon"!==n.transport){e.n=1;break}return this.instance._send_request(s),e.a(2,{statusCode:202});case 1:return e.a(2,new Promise(function(e){s.callback=e,o.instance._send_request(s)}))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),t.dispose=function(){this._disposed||(this._disposed=!0,this._runtime.dispose())},o(e,[{key:"logger",get:function(){return this._logger}},{key:"distinctId",get:function(){return this.instance.get_distinct_id()}},{key:"anonymousId",get:function(){var e;return null!==(e=this.instance.get_property("$device_id"))&&void 0!==e?e:this.distinctId}},{key:"deviceId",get:function(){var e=this.instance.get_property(wu);return"string"==typeof e?e:void 0}},{key:"library",get:function(){return{name:Mh.LIB_NAME,version:Mh.LIB_VERSION}}},{key:"initialPersonProperties",get:function(){var e,t;return null!==(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())&&void 0!==e?e:{}}},{key:"groups",get:function(){return this.instance.getGroups()}},{key:"session",get:function(){try{var e,t,n,i,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==r?void 0:r.sessionId)&&void 0!==t?t:"",windowId:null!==(n=null==r?void 0:r.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(i=null==r?void 0:r.sessionStartTimestamp)&&void 0!==i?i:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}},{key:"canCapture",get:function(){return this.instance.is_capturing()}},{key:"projectToken",get:function(){return this.instance.config.token}}])}(),h_={},f_=0,p_=function(){},__='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',v_="Surveys module not available",g_="sanitize_properties is deprecated. Use before_send instead",m_="Invalid value for property_denylist config: ",y_=/^[A-Za-z0-9_-]{1,400}$/,b_=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,w_=["token","distinct_id",wl],S_="posthog",x_=!Fp&&-1===(null==Oa?void 0:Oa.indexOf("MSIE"))&&-1===(null==Oa?void 0:Oa.indexOf("Mozilla")),k_=function(e){var t={};return e&&"unset"!==e?("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0),t):t},C_=function(e){var t;return u({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ka(null==Ta?void 0:Ta.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:p_,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,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Ia&&Mr(null==Ia?void 0:Ia.search)&&-1!==Ia.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Pa||null==(t=Pa.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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:function(e){qa.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Fl,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:p_},function(e){return{rageclick:e&&e>="2026-05-30"?{content_ignorelist:Yh,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:k_(e),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,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}}(e))},P_=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],E_=function(e){for(var t={},n=0,i=P_;i.length>n;n++){var r=i[n],s=r[0],o=r[1];Ar(e[s])||(t[o]=e[s])}var a=Na({},t,e),u=e.__preview_external_dependency_versioned_paths;return Ar(u)||(Ar(e.strict_script_versioning)&&(a.strict_script_versioning=!!u),Mr(u)&&Ar(e.asset_host)&&(a.asset_host=u)),Tr(e.property_blacklist)&&(Ar(e.property_denylist)?a.property_denylist=e.property_blacklist:Tr(e.property_denylist)?a.property_denylist=[].concat(e.property_blacklist,e.property_denylist):qa.error(m_+e.property_denylist)),a},F_=function(){"use strict";return o(function(){this.__forceAllowLocalhost=!1},[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){qa.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),T_=(a=function(){"use strict";function e(){var t,n=this;this.webPerformance=new F_,this._personProcessingSetOncePropertiesSent=!1,this.version=Mh.LIB_VERSION,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new Kp,this._extensions=[],this._extensionEventPropertyProducers=[],this._hasStableInitialDistinctId=!1,this._hasWarnedAboutVolatileIdentity=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=C_(),this.SentryIntegration=Ff,this.sentryIntegration=function(e){return function(e,t){var n=Ef(e,t);return{name:Pf,processEvent:function(e){return n(e)}}}(n,e)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.scrollManager=new Up(this),this.pageViewManager=new Tf(this),this.rateLimiter=new Wf(this),this.requestRouter=new r_(this),this.consent=new Oh(this),this.externalIntegrations=new a_(this);var i=null!==(t=e.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:function(e,t,i){var r,s=Mr(e)?((r={})[e]=t,r):e;n.setPersonProperties(s),null==i||i({})},set_once:function(e,t,i){var r,s=Mr(e)?((r={})[e]=t,r):e;n.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",function(e){return qa.info('send "'+(null==e?void 0:e.event)+'"',e)})}var t=e.prototype;return t._removeExtension=function(e){if(e){var t=this._extensions.indexOf(e);-1!==t&&this._extensions.splice(t,1)}},t._replaceExtension=function(e,t){return this._removeExtension(e),this._extensions.push(t),null==t.initialize||t.initialize(),t},t._inCookielessMode=function(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()},t._warnIfVolatileIdentityWithoutStableId=function(){if(!(this._hasWarnedAboutVolatileIdentity||this.config.reuseAnonymousId||this.config.segment||this._inCookielessMode())){var e,t,n,i="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(i||this.config.disable_persistence)&&(this._hasStableInitialDistinctId||(i?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._hasWarnedAboutVolatileIdentity=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+n)))}},t._healCookielessSentinelDistinctId=function(){if(!this._inCookielessMode()&&"$posthog_cookieless"===this.get_distinct_id()){var e=this.persistence;if(e){this._is_persistence_disabled()||e.load(!0);var t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){var n=this.config.get_device_id(jl());this.register({distinct_id:n,$device_id:n}),e.set_property(fl,Pl)}this._sync_opt_out_with_persistence()}}},t.init=function(t,n,i){if(i&&i!==S_){var r,s=null!==(r=h_[i])&&void 0!==r?r:new e;return s._init(t,n,i),h_[i]=s,h_[S_][i]=s,s}return this._init(t,n,i)},t._init=function(e,t,n){var i,r,s,o=this;void 0===t&&(t={});var a,l=Mr(e)?e.trim():"";if(!l)return qa.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 l!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+l+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=C_(t.defaults),t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles?this._initialPersonProfilesConfig=t.person_profiles:t.process_person&&(this._initialPersonProfilesConfig=t.process_person);var c=C_(t.defaults),d=E_(t),h=Na({},c,d,{name:n,token:l});Rr(c.rageclick)&&Rr(d.rageclick)&&(h.rageclick=Na({},c.rageclick,d.rageclick)),Rr(c.session_recording)&&Rr(d.session_recording)&&(h.session_recording=Na({},c.session_recording,d.session_recording)),this.set_config(h),this.config.on_xhr_error&&qa.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:ji;var f=this._is_persistence_disabled();if(this.persistence=new zf(this.config,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new zf(u({},this.config,{persistence:"sessionStorage"}),f,!1),this._sessionRegisteredPropertiesStorageKey="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!f&&mc._is_supported()){var p=mc._parse(this._sessionRegisteredPropertiesStorageKey);Tr(p)&&p.forEach(function(e){Mr(e)&&o._sessionRegisteredPropKeys.add(e)})}else mc._remove(this._sessionRegisteredPropertiesStorageKey);var _=u({},this.persistence.props),v=u({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new Vp(function(e){return o._send_retriable_request(e)},this.config.request_queue_config),this._retryQueue=new zp(this),this.__request_queue=[];var g=this._inCookielessMode();g||(this.sessionManager=new Jp(this),this.sessionPropsManager=new Gp(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(function(e,t,n){(null!=n&&n.activityTimeout||null!=n&&n.sessionPastMaximumLength||null!=n&&n.crossTabAdoption)&&o._clearSessionRegisteredProps()})),this._enrollFeatureFlags(),this.config.__preview_deferred_init_extensions?(qa.info("Deferring extension initialization to improve startup performance"),setTimeout(function(){o._initExtensions(g)},0)):(qa.info("Initializing extensions synchronously"),this._initExtensions(g)),Mh.DEBUG=Mh.DEBUG||this.config.debug,Mh.DEBUG&&qa.info("Starting in debug mode",{this:this,config:t,thisC:u({},this.config),p:_,s:v}),!this.config.identity_distinct_id||null!=(i=t.bootstrap)&&i.distinctID||(t.bootstrap=u({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var m=null==(r=t.bootstrap)?void 0:r.distinctID;if(this._hasStableInitialDistinctId=!!m&&!Or(m),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var y=t.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(fl);if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"anonymous"===w)this.identify(y);else if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"identified"===w)qa.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var S=this.config.get_device_id(jl()),x=t.bootstrap.isIdentifiedID?S:y;this.persistence.set_property(fl,t.bootstrap.isIdentifiedID?El:Pl),this.register({distinct_id:y,$device_id:x})}}if(g)this.register_once({distinct_id:bl,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(jl());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(fl,Pl)}return Qa(Pa,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?Cf(this,function(){return o._loaded()}):this._loaded(),Ir(this.config._onCapture)&&this.config._onCapture!==p_&&(qa.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",function(e){return o.config._onCapture(e.event,e)})),this.config.ip&&qa.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Xp.apply(this,arguments)}().then(function(e){var t;e&&o.register(((t={})[Su]=e,t))}).catch(p_),this},t._isSharedExtension=function(e){var t=e;return Mr(t.name)&&Ir(t.setup)},t._enrollExtension=function(e,t){var n=this;this._isSharedExtension(e)?t.push(function(){n._getBrowserClientAdapter().add(e).catch(function(){return null==e.dispose?void 0:e.dispose()}).catch(function(t){qa.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this._extensions.push(e)},t._enrollFeatureFlags=function(){var t,n,i,r,s,o,a=this,u=null!==(t=null==(n=this.config.__extensionClasses)?void 0:n.featureFlags)&&void 0!==t?t:null==(i=e.__defaultExtensionClasses)?void 0:i.featureFlags;u&&(this.featureFlags&&this.featureFlags instanceof u||(null==(o=this._featureFlagsReloadingUnsubscribe)||o.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new u(this)),Ir(this.featureFlags.onReloading)&&Ir(this.featureFlags.setup)?this._featureFlagsReloadingUnsubscribe||(this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading(function(){a._internalEventEmitter.emit("featureFlagsReloading",!0)}),this._getBrowserClientAdapter().add(this.featureFlags)):null==(r=(s=this.featureFlags).initialize)||r.call(s))},t._initExtensions=function(t){var n,i,r,s,o,a,l,c=this,d=performance.now(),h=u({},e.__defaultExtensionClasses,this.config.__extensionClasses),f=[];h.exceptions&&this._extensions.push(this.exceptions=null!==(n=this.exceptions)&&void 0!==n?n:new h.exceptions(this)),h.historyAutocapture&&this._extensions.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this._extensions.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this._extensions.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this._extensions.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||f.push(function(){c.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this._enrollExtension(this.autocapture=new h.autocapture(this),f),h.surveys&&this._enrollExtension(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new h.surveys(this),f),h.logs&&this._enrollExtension(this.logs=null!==(r=this.logs)&&void 0!==r?r:new h.logs(this),f),h.metrics&&this._extensions.push(this.metrics=null!==(s=this.metrics)&&void 0!==s?s:new h.metrics(this)),h.conversations&&this._extensions.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this._extensions.push(this.productTours=new h.productTours(this)),h.heatmaps&&this._extensions.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this._extensions.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Sf)),h.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this._extensions.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this._extensions.forEach(function(e){e.initialize&&f.push(function(){null==e.initialize||e.initialize()})}),f.push(function(){if(c._pendingRemoteConfig){var e=c._pendingRemoteConfig;c._pendingRemoteConfig=void 0,c._extensions.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})}}),this._processInitTaskQueue(f,d)},t._processInitTaskQueue=function(e,t){for(var n,i=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(function(){i._processInitTaskQueue(e,t)},0);var r=e.shift();if(r)try{r()}catch(e){qa.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session(((n={})[Sl]=this.config.__preview_deferred_init_extensions?"deferred":"synchronous",n[xl]=s,n)),this.config.__preview_deferred_init_extensions&&qa.info("PostHog extensions initialized ("+s+"ms)")},t._onRemoteConfig=function(e){var t,n=this;if(!Ta||!Ta.body)return qa.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){n._onRemoteConfig(e)},500);if(this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this._lastRemoteConfig=e,this.compression=void 0,e.ok){var i,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=vr(r.supportedCompression,ji)?ji:vr(r.supportedCompression,Hi)?Hi:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:Fl}),null==(t=this._browserClientAdapter)||t.handleRemoteConfig(e),this._extensions.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})},t._loaded=function(){var e=this;try{this.config.loaded(this)}catch(e){qa.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Ia&&Ia.hostname){var t=Ia.hostname,n=this.config.internal_or_test_user_hostname;("string"==typeof n?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(function(){(e.consent.isOptedIn()||e._inCookielessMode())&&e._captureInitialPageview()},1),this._remoteConfigLoader=new Kf(this),this._remoteConfigLoader.load()},t._start_queue_if_opted_in=function(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())},t._dom_loaded=function(){var e=this;this.is_capturing()&&ja(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()},t._handle_unload=function(){var e,t,n,i,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(Ll),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(i=this._requestQueue)||i.unload(),null==(r=this._retryQueue)||r.unload()):this._shouldCapturePageleave()&&this.capture(Ll,null,{transport:"sendBeacon"})},t._send_request=function(e){var t,n=this;this.__loaded?x_?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=u({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(t=this.compression)&&void 0!==t?t:e.compressionFallback:e.compression,(Ar(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,i,r=u({},e);r.timeout=r.timeout||6e4;var s,o,a,l,c,d=null!==(t=r.transport)&&void 0!==t?t:"fetch";"sendBeacon"===d&&Ar(r.compression)&&r.data&&(r.compression=Hi),"POST"===r.method&&r.data&&("capture-body"===r.timestampMode?r.data={api_key:null!==(o=null==(c=(l=(Tr(s=r.data)?s:[s]).map(function(e){return u({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})}))[0])||null==(a=c.properties)?void 0:a.token)&&void 0!==o?o:null==c?void 0:c.token,batch:l,sent_at:(new Date).toISOString()}:"body"===r.timestampMode&&(r.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Tr(e)?e.map(function(e){return u({},e,{sent_at:t})}):u({},e,{sent_at:t})}(r.data))),r.url=Hp(r.url,r.method,r.compression,r.timestampMode);var h=Np.filter(function(e){return!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)}),f=null!==(n=null==(i=function(e,t){for(var n=0;e.length>n;n++)if(t(e[n]))return e[n]}(h,function(e){return e.transport===d}))?void 0:i.method)&&void 0!==n?n:h[0].method;if(!f)throw new Error("No available transport method");var p=function(e){try{f(e)}catch(e){qp(e)?qa.warn(e):qa.error(e),null==r.callback||r.callback({statusCode:0,error:e})}};"sendBeacon"!==d&&r.data&&r.compression===ji&&Ma&&"undefined"!=typeof Promise&&!Ip?$p(r).then(function(e){p(e)}).catch(function(t){if(Yo(t))return Ip=!0,void p(u({},r,{compression:void 0,url:Hp(e.url,e.method,void 0,e.timestampMode)}));(function(e){if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return Yo(e)||t===Qo})(t)&&(Ip=!0),p(r)}):f(r)}(u({},e,{callback:function(t){n.rateLimiter.checkForLimiting(t),400>t.statusCode||null==n.config.on_request_error||n.config.on_request_error(t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))},t._send_retriable_request=function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)},t._execute_array=function(e){var t=this;f_++;try{var n,i=[],r=[],s=[];ja(e,function(e){if(e)if(Tr(n=e[0]))s.push(e);else if(Ir(e))try{e.call(t)}catch(t){qa.error("Error executing queued PostHog call",e,t)}else Tr(e)&&"alias"===n?i.push(e):Tr(e)&&-1!==n.indexOf("capture")&&Ir(t[n])?s.push(e):r.push(e)});var o=function(e,t){ja(e,function(e){try{if(Tr(e[0])){var n=t;Ha(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){qa.error("Error executing queued PostHog call",e,t)}})};o(i,this),o(r,this),o(s,this)}finally{f_--}},t.push=function(t){if(f_>0&&Tr(t)&&Mr(t[0])){var n=e.prototype[t[0]];Ir(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])},t._getPersistedFacebookClickId=function(){var e,t=null==(e=this.persistence)?void 0:e.get_property(Cu);return Mr(t)&&b_.test(t)?{value:t,delivered:!1}:Rr(t)&&Mr(t.value)&&b_.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0},t._updateFacebookClickId=function(e,t,n,i){if(this.persistence){this.persistence.refreshKey(Cu);var r=this._getPersistedFacebookClickId();if(!i){var s;if(n)return Mr(t)&&b_.test(t)?(t!==(null==r?void 0:r.value)&&this.persistence.register(((s={})[Cu]={value:t,delivered:!1},s)),{value:t,pending:t!==(null==r?void 0:r.value)||!r.delivered}):void this.persistence.unregister(Cu);if(Mr(e)&&y_.test(e)){var o;if((null==r?void 0:r.value.split(".")[3])===e)return{value:r.value,pending:!r.delivered};var a="fb.1."+Date.now()+"."+e;return this.persistence.register(((o={})[Cu]={value:a,delivered:!1},o)),{value:a,pending:!0}}return r?{value:r.value,pending:!r.delivered}:void 0}this.persistence.unregister(Cu)}},t._markFacebookClickIdDelivered=function(e){var t;if(this.persistence){this.persistence.refreshKey(Cu);var n=this._getPersistedFacebookClickId();(null==n?void 0:n.value)!==e||n.delivered||this.persistence.register(((t={})[Cu]={value:e,delivered:!0},t))}},t.capture=function(e,t,n){var i,r,s,o,a,l,c,d,h,f,p,_,v=this;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!Ar(e)&&Mr(e)){this._healCookielessSentinelDistinctId();var g=!this.config.opt_out_useragent_filter&&this._is_bot();if(!g||this.config.__preview_capture_bot_pageviews){var m=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==m||!m.isRateLimited){var y;null!=t&&t.$current_url&&!Mr(null==t?void 0:t.$current_url)&&(qa.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=n&&n._originatedFromCaptureException||qa.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(y=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 b=new Date,w=(null==n?void 0:n.timestamp)||b,S=ao(null==n?void 0:n.uuid,jl),x={uuid:S,event:e,properties:this.calculateEventProperties(e,t||{},w,S)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&g&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),m&&(x.properties.$lib_rate_limit_remaining_tokens=m.remainingTokens);var k="$feature_flag_called"===e&&!1===x.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=n&&n.$set&&!k&&(x.$set=null==n?void 0:n.$set);var C=Rr(null==t?void 0:t.$set)?t.$set:void 0,P=!(null==n||!n.$set)&&"$fbc"in n.$set,E=P||!!C&&"$fbc"in C,F=P?null==n||null==(i=n.$set)?void 0:i[ku]:null==C?void 0:C[ku],T=Tr(null==t?void 0:t.$unset)?t.$unset:[],I=(null==n?void 0:n.$unset)||[],R=-1!==T.indexOf("$fbc")||-1!==I.indexOf("$fbc"),L=this._updateFacebookClickId(null==(r=y)?void 0:r.fbclid,F,E,R);L&&!0===x.properties.$process_person_profile&&L.pending&&!E&&!k&&(x.$set=u(((s={})[ku]=L.value,s),x.$set));var A=null==n?void 0:n.$unset;A&&(x.$unset=A);var M=k?void 0:this._calculate_set_once_properties(null==n?void 0:n.$set_once,e!==Ml,e===Al);if(M&&(x.$set_once=M),null!=n&&n._noTruncate||(h=this.config.properties_string_max_length,f=x,p=function(e){return Mr(e)?e.slice(0,h):e},_=new Set,x=function e(t,n){if(t!==Object(t))return p?p(t):t;if(!_.has(t)){var i;if(_.add(t),Tr(t))i=[],ja(t,function(t){i.push(e(t))});else{var r={};Ha(t,function(t,n){_.has(t)||(r[n]=e(t,n))}),i=r}return i}}(f)),x.timestamp=w,Ar(null==n?void 0:n.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=b),k&&(x.properties=function(e,t){void 0===t&&(t=[]);var n={},i=function(t){void 0!==e[t]&&(n[t]=e[t])};return Ko.forEach(i),t.forEach(i),n}(x.properties,w_)),e===sr||e===or){var O,D=null==t?void 0:t[ar],q=null==t?void 0:t[lr];gu({id:D,current_iteration:q}),x.$set=u({},x.$set,((O={})[eu({id:D,current_iteration:q},e===or?"responded":"dismissed")]=!0,O))}else e===rr&&(x.$set=u({},x.$set,((o={}).$survey_last_seen_date=(new Date).toISOString(),o)));if("product tour shown"===e){var B,j=null==t?void 0:t.$product_tour_type;j&&(x.$set=u({},x.$set,((B={})["$product_tour_last_seen_date/"+j]=(new Date).toISOString(),B)))}var H=u({},x.properties.$set,x.$set);if(Lr(H)||this.setPersonPropertiesForFlags(H),!Dr(this.config.before_send)){var N=this._runBeforeSend(x);if(!N)return;(x=N).uuid=ao(x.uuid,jl)}var V=null!==(a=null==(l=x.$set)?void 0:l.$fbc)&&void 0!==a?a:Rr(null==(c=x.properties)?void 0:c.$set)?x.properties.$set.$fbc:void 0,z=null!=L&&L.pending&&V===L.value?L.value:void 0;this._internalEventEmitter.emit("eventCaptured",x);var U=null!==(d=null==n?void 0:n._url)&&void 0!==d?d:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),W=u({method:"POST",url:U,data:x,compression:"best-available",timestampMode:"recordings"===(null==n?void 0:n._batchKey)||/\/s\/(?:\?|$)/.test(U)?"body":"capture-body",batchKey:null==n?void 0:n._batchKey},null!=n&&n.transport?{transport:n.transport}:{},z?{fireCallbackOnDrop:!0,callback:function(e){e.statusCode>=200&&300>e.statusCode&&v._markFacebookClickIdDelivered(z)}}:{});return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly||z?this._send_retriable_request(W):this._requestQueue.enqueue(W),x}qa.critical("This capture call is ignored due to client rate limiting.")}}else qa.error("No event name provided to posthog.capture")}else qa.uninitializedWarning("posthog.capture")},t._addCaptureHook=function(e){return this.on("eventCaptured",function(t){return e(t.event,t)})},t.getExtension=function(e){var t;return null==(t=this._browserClientAdapter)?void 0:t.getExtension(e)},t._getBrowserClientAdapter=function(){var e;return null!==(e=this._browserClientAdapter)&&void 0!==e?e:this._browserClientAdapter=new d_(this)},t._registerExtensionEventProperties=function(e){var t=this;this._extensionEventPropertyProducers.push(e);var n=!0;return function(){if(n){n=!1;var i=t._extensionEventPropertyProducers.indexOf(e);-1!==i&&t._extensionEventPropertyProducers.splice(i,1)}}},t._processCookieIdentityChange=function(e){var t,n,i;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this._cachedPersonProperties=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(i=this.sessionPersistence)||i.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(n=this.featureFlags)||n.reset(),e&&this.reloadFeatureFlags(),!0)},t.calculateEventProperties=function(e,t,n,i,r){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this._processCookieIdentityChange();var s=r?void 0:this.persistence.remove_event_timer(e),o=u({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this._inCookielessMode()&&(o[wl]=!0),"$snapshot"===e){var a=u({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!Mr(o.distinct_id)&&!qr(o.distinct_id)||Or(o.distinct_id))&&qa.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var l,c=function(e,t,n,i){var r,s,o,a;if(void 0===i&&(i=!1),!Oa)return{};var u,l=e?[].concat(kd,t||[]):[],c=Js(Oa),d=c[0],h=c[1],f=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},p={};Ar(n)||(p.detectGoogleSearchApp=n);var _={},v=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,g=null==(s=navigator)?void 0:s.maxTouchPoints,m=null==Pa||null==(o=Pa.screen)?void 0:o.width,y=null==Pa||null==(a=Pa.screen)?void 0:a.height,b=null==Pa?void 0:Pa.devicePixelRatio;Ar(v)||(_.userAgentDataPlatform=v),Ar(g)||(_.maxTouchPoints=g),Ar(m)||(_.screenWidth=m),Ar(y)||(_.screenHeight=y),Ar(b)||(_.devicePixelRatio=b);var w,S=Na(Wa({$os:d,$os_version:h,$browser:Gs(Oa,navigator.vendor,f,p),$device:Ys(Oa),$device_type:Xs(Oa,_),$timezone:$d(),$timezone_offset:Dd()}),{$current_url:Ul(i?lo(null==Ia?void 0:Ia.href):null==Ia?void 0:Ia.href,l,Pd),$host:null==Ia?void 0:Ia.host,$pathname:null==Ia?void 0:Ia.pathname,$raw_user_agent:Oa.length>1e3?Oa.substring(0,997)+"...":Oa,$browser_version:Qs(Oa,navigator.vendor,f,p),$browser_language:Rd(),$browser_language_prefix:(w=Rd(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==Pa?void 0:Pa.screen.height,$screen_width:null==Pa?void 0:Pa.screen.width,$viewport_height:null==Pa?void 0:Pa.innerHeight,$viewport_width:null==Pa?void 0:Pa.innerWidth,$lib:Ca.LIB_NAME,$lib_version:Ca.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ca.SDK_DIST_CHANNEL&&(S.$sdk_dist_channel=Ca.SDK_DIST_CHANNEL),S}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var h=this.sessionManager.checkAndGetSessionAndWindowId(r,n.getTime(),!0),f=h.windowId;o.$session_id=h.sessionId,o.$window_id=f}this.sessionPropsManager&&Na(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&Na(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===e_&&(o.$lib_custom_api_host=this.config.api_host),l="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,i),o=Na(o,l),"$pageview"===e&&Ta&&(o.title=Ta.title),!Ar(s)){var _=n.getTime()-s;o.$duration=parseFloat((_/1e3).toFixed(3))}Oa&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var v=this.persistence.properties(),g=this.sessionPersistence.properties(),m=o.$groups,y=v.$groups;Rr(m)&&!Lr(m)&&(o.$groups=u({},Rr(y)?y:{},m)),Ha(["$referrer","$referring_domain"],function(e){e in v&&delete g[e]});var b={};if(this._extensionEventPropertyProducers.length>0)for(var w,S=d(this._extensionEventPropertyProducers.slice());!(w=S()).done;){var x=w.value;try{Na(b,x())}catch(e){qa.error("Failed to produce browser extension event properties",e)}}(o=Na({},c,v,g,u({},b,o))).$is_identified=this._isIdentified(),Tr(this.config.property_denylist)?Ha(this.config.property_denylist,function(e){delete o[e]}):qa.error(m_+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var k=this.config.sanitize_properties;k&&(qa.error(g_),o=k(o,e));var C=this._hasPersonProcessing();return o.$process_person_profile=C,C&&!r&&this._requirePersonProcessing("_calculate_event_properties"),o},t._calculate_set_once_properties=function(e,t,n){var i;if(void 0===t&&(t=!0),void 0===n&&(n=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!n)return e;var r=Na({},this.persistence.get_initial_props(),(null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(qa.error(g_),r=s(r,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Lr(r)?void 0:r},t.register=function(e,t){var n;null==(n=this.persistence)||n.register(e,t)},t.register_once=function(e,t,n){var i;null==(i=this.persistence)||i.register_once(e,t,n)},t.register_for_session=function(e){var t,n,i=this;null==(t=this.persistence)||t.syncCookieProperties(),this._processCookieIdentityChange(),null==(n=this.sessionPersistence)||n.register(e),Object.keys(e).forEach(function(e){return i._sessionRegisteredPropKeys.add(e)}),this._persistSessionRegisteredPropKeys()},t.unregister=function(e){var t;null==(t=this.persistence)||t.unregister(e)},t.unregister_for_session=function(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this._sessionRegisteredPropKeys.delete(e),this._persistSessionRegisteredPropKeys()},t._register_single=function(e,t){var n;this.register(((n={})[e]=t,n))},t._clearSessionRegisteredProps=function(){var e=this;this._sessionRegisteredPropKeys.forEach(function(t){var n;null==(n=e.sessionPersistence)||n.unregister(t)}),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()},t._persistSessionRegisteredPropKeys=function(){var e;if(this._sessionRegisteredPropertiesStorageKey)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e._disabled||!mc._is_supported())mc._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach(function(e){return t.push(e)}),t.length>0?mc._set(this._sessionRegisteredPropertiesStorageKey,t):mc._remove(this._sessionRegisteredPropertiesStorageKey)}},t.getFeatureFlag=function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlag(e,t)},t.getFeatureFlagPayload=function(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)},t.getFeatureFlagResult=function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlagResult(e,t)},t.getAllFeatureFlags=function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]},t.isFeatureEnabled=function(e,t){var n,i;return null!==(n=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t))&&void 0!==n?n:null==t?void 0:t.defaultValue},t.reloadFeatureFlags=function(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()},t.updateFlags=function(e,t,n){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,n)},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,n)},t.getEarlyAccessFeatures=function(e,t,n){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,n)},t.on=function(e,t){return this._internalEventEmitter.on(e,t)},t.onFeatureFlags=function(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),function(){})},t.onSurveysLoaded=function(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:v_}),function(){})},t.onSessionId=function(e){var t,n;return null!==(t=null==(n=this.sessionManager)?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}},t.getSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:v_})},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:v_})},t.renderSurvey=function(e,t){var n;null==(n=this.surveys)||n.renderSurvey(e,t)},t.displaySurvey=function(e,t){var n;void 0===t&&(t=yu),null==(n=this.surveys)||n.displaySurvey(e,t)},t.cancelPendingSurvey=function(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)},t.canRenderSurvey=function(e){var t,n;return null!==(t=null==(n=this.surveys)?void 0:n.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:v_}},t.canRenderSurveyAsync=function(e,t){var n,i;return void 0===t&&(t=!1),null!==(n=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==n?n:Promise.resolve({visible:!1,disabledReason:v_})},t._validateIdentifyId=function(e){return!e||Or(e)?(qa.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(qa.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(qa.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.'),!1)},t.identify=function(e,t,n){if(!this.__loaded||!this.persistence)return qa.uninitializedWarning("posthog.identify");if(qr(e)&&(e=e.toString(),qa.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){this._healCookielessSentinelDistinctId();var i=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==i,s=this._processCookieIdentityChange(!1),o=this.persistence._beginCookieSyncSuppression(),a=!1;try{var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property("__alias")&&(this.unregister(xu),this.register({distinct_id:e}));var l=(this.persistence.get_property("$user_state")||"anonymous")===Pl,c=e!==u,d=!c&&l;if(c&&l){var h,f=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:u};this.persistence.set_property(fl,El),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture(Al,f,{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=Ql(e,t,n),null==(h=this.featureFlags)||h.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(d){this.persistence.set_property(fl,El);var p=t||{},_=n||{};this.setPersonPropertiesForFlags({$set:p,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$set",{$set:p,$set_once:_}),this._cachedPersonProperties=Ql(e,t,n)}else(t||n)&&this.setPersonProperties(t,n);c||r||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ll)):d&&(t||n)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence._endCookieSyncSuppression(a)}}},t.setPersonProperties=function(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var n=Ql(this.get_distinct_id(),e,t);this._cachedPersonProperties!==n?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=n):qa.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.unsetPersonProperties=function(e){var t,n=(Tr(e)?e:[e]).filter(function(e){return Mr(e)&&e.length>0});0!==n.length&&this._requirePersonProcessing("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(n,!0),this.capture("$set",{$unset:n}),this._cachedPersonProperties=null)},t.group=function(e,t,n){var i,r,s;if(e&&t){null==(i=this.persistence)||i.syncCookieProperties(),this._processCookieIdentityChange();var o=this.getGroups(),a=o[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:u({},o,(r={},r[e]=t,r))}),(a||n)&&this._hasPersonProcessing()){var l={$group_type:e,$group_key:t};n&&(l.$group_set=n),this.capture(Ml,l)}n&&this.setGroupPropertiesForFlags(((s={})[e]=n,s)),a&&!n&&this.reloadFeatureFlags()}else qa.error("posthog.group requires a group type and group key")},t.resetGroups=function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()},t.setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0),null==(n=this.featureFlags)||n.setPersonPropertiesForFlags(e,t)},t.resetPersonPropertiesForFlags=function(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(n=this.featureFlags)||n.setGroupPropertiesForFlags(e,t))},t.resetGroupPropertiesForFlags=function(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)},t.reset=function(e){var t=jr(e)?e:null==e?void 0:e.resetDeviceID,n=jr(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,n)},t._reset=function(e,t,n){var i,r,s,o;if(void 0===t&&(t=!1),qa.info("reset"),!this.__loaded)return qa.uninitializedWarning("posthog.reset");var a=null==n?void 0:n.sessionID;this.config.bootstrap=n||(null==(i=this._originalUserConfig)?void 0:i.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags());var l=this.get_property(wu),c=this.get_property(Su),d=this.get_property(Du);null==(s=this.sessionRecording)||s.flushBeforeIdentityReset();var h=this.is_capturing();this.consent.reset(),t||!h||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var f=null==(o=this.persistence)||null==o._beginCookieSyncSuppression?void 0:o._beginCookieSyncSuppression(),p=!1;try{var _,v,g,m,y,b,w,S,x,k,C,P,E,F;if(null==(_=this.persistence)||_.clear(),null==(v=this.sessionPersistence)||v.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys(),Ar(d)||null==(g=this.persistence)||g.register(((m={})[Du]=d,m)),null==(y=this.surveys)||y.reset(),null==(b=this.featureFlags)||b.reset(),null==(w=this.conversations)||w.reset(),null==(S=this.logs)||S.reset(),null==(x=this.metrics)||x.reset(),null==(k=this.persistence)||k.set_property(fl,Pl),null==(C=this.sessionManager)||C.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:bl,$device_id:null},"");else{var T,I=this.config.get_device_id(jl());this.register_once({distinct_id:I,$device_id:e?I:l},""),e||Ar(c)||this.register(((T={})[Su]=c,T))}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),n)if(void 0===n.distinctID||this._inCookielessMode()||(null==(F=this.persistence)||F.set_property(fl,n.isIdentifiedID?El:Pl),this.register({distinct_id:n.distinctID})),null==(P=this.featureFlags)||P.initialize(),!(Ar(a)||null!=(E=this.sessionManager)&&E.setBootstrapSessionId(a,!0))){var R=u({},n);delete R.sessionID,this.config.bootstrap=R}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,p=!0}finally{var L;f&&(null==(L=this.persistence)||null==L._endCookieSyncSuppression||L._endCookieSyncSuppression(p))}this.reloadFeatureFlags()},t.shutdown=function(){var e=p(l().m(function e(t){var n,i,r,s,o,a,u,c;return l().w(function(e){for(;;)switch(e.n){case 0:if(this.__loaded){e.n=1;break}return qa.uninitializedWarning("posthog.shutdown"),e.a(2);case 1:this._getBrowserClientAdapter().dispose(),null==(n=this.sessionRecording)||n.dispose(),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.metrics)||r.flush("sendBeacon"),null==(s=this._requestQueue)||s.unload(),null==(o=this._retryQueue)||o.unload();try{null==(c=this.featureFlags)||c.destroy()}catch(e){qa.error("Error while destroying feature flags",e)}null==(a=this.persistence)||a.destroy(),null==(u=this.sessionPersistence)||u.destroy();case 2:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.setIdentity=function(e,t){var n;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(n=this.conversations)||n._onIdentityChanged()},t.clearIdentity=function(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e._onIdentityCleared()},t.get_distinct_id=function(){return this.get_property("distinct_id")},t.getGroups=function(){return this.get_property("$groups")||{}},t.get_session_id=function(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""},t.get_session_replay_url=function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&n){var r,s=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!n)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-n)/1e3)-s,0)}return i},t.alias=function(e,t){return e===this.get_property("$people_distinct_id")?(qa.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Ar(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(xu,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(qa.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0},t.set_config=function(e){var t=u({},this.config);if(Rr(e)){var n,i,r,s,o,a,l,c,d,h,f,p,_;Na(this.config,E_(e));var v=this._is_persistence_disabled();null==(n=this.persistence)||n.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new zf(u({},this.config,{persistence:"sessionStorage"}),v,!1);var g=this._checkLocalStorageForDebug(this.config.debug);jr(g)&&(this.config.debug=g),jr(this.config.debug)&&(this.config.debug?(Mh.DEBUG=!0,rc._is_supported()&&rc._set("ph_debug",!0),qa.info("set_config",{config:e,oldConfig:t,newConfig:u({},this.config)})):(Mh.DEBUG=!1,rc._is_supported()&&rc._remove("ph_debug"))),null==(i=this.featureFlags)||null==i.updateConfig||i.updateConfig(this.config,this._shouldDisableFlags()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(c=this.heatmaps)||c.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(d=this.historyAutocapture)||d.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(f=this.deadClicksAutocapture)||f.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(_=this.externalIntegrations)||_.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&Cf(this,p_,!1)}},t._overrideSDKInfo=function(e,t){Mh.LIB_NAME=e,Mh.LIB_VERSION=t},t.startSessionRecording=function(e){var t,n,i,r,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(n=this.sessionRecording)||n.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})},t.stopSessionRecording=function(){this.set_config({disable_session_recording:!0})},t.sessionRecordingStarted=function(){var e;return!(null==(e=this.sessionRecording)||!e.started)},t.captureException=function(e,t){try{if(!this.exceptions)return;var n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(u({},n,t))}catch(e){return}},t.addExceptionStep=function(e,t){var n;null==(n=this.exceptions)||n.addExceptionStep(e,t)},t.captureLog=function(e){var t;null==(t=this.logs)||t.captureLog(e)},t.startExceptionAutocapture=function(e){this.set_config({capture_exceptions:null==e||e})},t.stopExceptionAutocapture=function(){this.set_config({capture_exceptions:!1})},t.loadToolbar=function(e){var t,n;return null!==(t=null==(n=this.toolbar)?void 0:n.loadToolbar(e))&&void 0!==t&&t},t.get_property=function(e){var t;return null==(t=this.persistence)?void 0:t.props[e]},t.getSessionProperty=function(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]},t.toString=function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:S_;return t!==S_&&(t="posthog."+t),t},t._isIdentified=function(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))},t._hasPersonProcessing=function(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Lr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e.__alias)&&(null==(t=this.persistence)||null==(t=t.props)||!t.$epp))},t._shouldCapturePageleave=function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview},t.createPersonProfile=function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})},t.setInternalOrTestUser=function(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})},t._requirePersonProcessing=function(e){return"never"===this.config.person_profiles?(qa.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._warnIfVolatileIdentityWithoutStableId(),this._register_single(yl,!0),!0)},t._is_persistence_disabled=function(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)},t._sync_opt_out_with_persistence=function(){var e,t,n,i,r,s=this._is_persistence_disabled();return this.is_capturing()||null==(e=this.logs)||e._onOptOut(),(null==(t=this.persistence)?void 0:t._disabled)!==s&&(null==(n=this.persistence)||n.set_disabled(s)),(null==(i=this.sessionPersistence)?void 0:i._disabled)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s&&(this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),s},t.opt_in_capturing=function(t){var n,i,r;if("always"!==this.config.cookieless_mode){if(this._inCookielessMode()){var s,o,a,u,l,c;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this._reset(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new Jp(this),this.pageViewManager=new Tf(this),this.persistence&&(this.sessionPropsManager=new Gp(this,this.sessionManager,this.persistence));var d,h=null!==(u=null==(l=this.config.__extensionClasses)?void 0:l.sessionRecording)&&void 0!==u?u:null==(c=e.__defaultExtensionClasses)?void 0:c.sessionRecording;h&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new h(this)),this._lastRemoteConfig&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this._lastRemoteConfig)))}this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(i=this.surveys)||i.loadIfEnabled()),(Ar(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(r=null==t?void 0:t.captureEventName)&&void 0!==r?r:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else qa.warn(__)},t.opt_out_capturing=function(){if("always"!==this.config.cookieless_mode){var e,t,n="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==n||n.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this._reset(!0,!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:bl,$device_id:null}),this._removeExtension(n),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in())}else qa.warn(__)},t.has_opted_in_capturing=function(){return this.consent.isOptedIn()},t.has_opted_out_capturing=function(){return this.consent.isOptedOut()},t.get_explicit_consent_status=function(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"},t.is_capturing=function(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())},t.clear_opt_in_out_capturing=function(){this.consent.reset(),this._sync_opt_out_with_persistence()},t._is_bot=function(){return Fa?Yp(Fa,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Ta&&("visible"===Ta.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(Rl,{title:Ta.title},{send_instantly:!0}),this._visibilityStateListener&&(Ta.removeEventListener(Tl,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),Qa(Ta,Tl,this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==Pa||Pa.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Pa||Pa.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}))},t._shouldDisableFlags=function(){var e=this._originalUserConfig||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(qa.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,n,i,r){var s=t in e&&!Dr(e[t]),o=n in e&&!Dr(e[n]);return s?e[t]:!!o&&(r&&r.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n])}(e,"advanced_disable_flags","advanced_disable_decide",0,qa)},t._runBeforeSend=function(e){var t;if(Dr(this.config.before_send))return e;for(var n,i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Nr),r=e,s=d(Tr(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(n=s()).done;){var o=n.value;try{if(r=o(r),Dr(r)){var a="Event '"+e.event+"' was rejected in beforeSend function";return Hr(e.event)?qa.warn(a+". This can cause unexpected behavior."):qa.info(a),null}r.properties&&!Lr(r.properties)||qa.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return qa.error("Error in beforeSend function for event '"+e.event+"':",t),null}}for(var u,l=d(i);!(u=l()).done;){var c=u.value;if(r.properties&&Dr(r.properties[c]))return qa.warn("Event '"+e.event+"' had its '"+c+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null}return r},t.getPageViewId=function(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId},t.captureTraceFeedback=function(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})},t.captureTraceMetric=function(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})},t._checkLocalStorageForDebug=function(e){var t=jr(e)&&!e,n=rc._is_supported()&&"true"===rc._get("ph_debug");return!t&&(!!n||e)},o(e,[{key:"decideEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"flagsEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"logger",get:function(){var t,n;return null!==(t=null==(n=this.logs)?void 0:n.logger)&&void 0!==t?t:e._noopLogger}}])}(),a.__defaultExtensionClasses={},a._noopLogger=function(){var e=function(){};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}}(),a);!function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Ua(e.prototype[t[n]])}(T_,["identify"]);var I_=function(){"use strict";function e(e){this.disabled=!1===e;var t=Rr(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}return e.prototype.isRageClick=function(e,t,n){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&&this.timeoutMs>n-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1},e}(),R_="$copy_autocapture",L_=Ba("[AutoCapture]");function A_(e,t){return t.length>e?t.slice(0,e)+"...":t}function M_(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Dh(t));return t}function O_(e,t){var n,i,r=t.e,s=t.maskAllElementAttributes,o=t.maskAllText,a=t.elementAttributeIgnoreList,l=t.elementsChainAsString,c=t.disableCaptureUrlHashes;if(!Dh(e))return{props:{}};for(var h=[e],f=new Set([e]),p=e;p.parentNode&&!qh(p,"body")&&1e3>h.length;)if(jh(p.parentNode)){var _=p.parentNode.host;if(f.has(_))break;f.add(_),h.push(_),p=_}else{if(!Dh(p.parentNode))break;if(f.has(p.parentNode))break;f.add(p.parentNode),h.push(p.parentNode),p=p.parentNode}var v,g,m,y=[],b={},w=!1,S=!1;if(Ha(h,function(e){var t=of(e);if(qh(e,"a")){var n=e.getAttribute("href");w=!!(t&&n&&_f(n))&&(c?lo(n):n)}vr(Vh(e),"ph-no-capture")&&(S=!0),y.push(function(e,t,n,i,r){void 0===r&&(r=!1);var s=e.tagName.toLowerCase(),o={tag_name:s};Gh.indexOf(s)>-1&&!n&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?A_(1024,vf(e)):A_(1024,Uh(e)));var a=Vh(e);a.length>0&&(o.classes=a.filter(function(e){return""!==e})),Ha(e.attributes,function(n){var s;if((!af(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==i||!i.includes(n.name))&&!t&&_f(n.value)&&(!Mr(s=n.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=n.value;"class"===n.name&&(a=Hh(a).join(" ")),o["attr__"+n.name]=A_(1024,"href"===n.name&&r?lo(a):a)}});for(var u=1,l=1,c=e;c=M_(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,s,o,a,c)),Ha(function(e){if(!of(e))return{};var t={};return Ha(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&_f(i)&&(t[n]=i)}}),t}(e),function(e,t){({}).hasOwnProperty.call(b,t)||(b[t]=e)})}),S)return{props:{},explicitNoCapture:S};if(o||(y[0].$el_text=qh(e,"a")||qh(e,"button")?vf(e):Uh(e)),w){var x,k;y[0].attr__href=w;var C=null==(x=Vl(w))?void 0:x.host,P=null==Pa||null==(k=Pa.location)?void 0:k.host;C&&P&&C!==P&&(v=w)}return{props:Na((g=r.type,{$event_type:g,$ce_version:1}),l?{}:{$elements:y},{$elements_chain:(m=y,Tr(m)?function(e){return e.map(function(e){var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();for(var r,s=d(e.attr_class);!(r=s()).done;)i+="."+r.value.replace(/"/g,"")}var o=u({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return Va(o).sort(function(e,t){return function(e,t){return t>e?-1:e>t?1:0}(e[0],t[0])}).forEach(function(e){var t=e[1];return a[mf(e[0].toString())]=mf(t.toString())}),(i+=":")+Va(a).map(function(e){return e[0]+'="'+e[1]+'"'}).join("")}).join(";")}(function(e){return e.map(function(e){var t,n,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(n=e.attr__href)?void 0:n.slice(0,2048),attr_class:yf(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Va(e).filter(function(e){return 0===e[0].indexOf("attr__")}).forEach(function(e){return i.attributes[e[0]]=e[1]}),i})}(m)):"")},null!=(n=y[0])&&n.$el_text?{$el_text:null==(i=y[0])?void 0:i.$el_text}:{},v&&"click"===r.type?{$external_click_url:v}:{},b)}}var $_=function(){"use strict";function e(e){this._configSource=e,this.name="autocapture",this._initialized=!1,this._isDisabledServerSide=null,this._hasReceivedConfigResponse=!1,this._elementsChainAsString=!1,this._config={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this._disposed=!1,this._configSource.refresh(this._config),this.rageclicks=new I_(this._config.rageclick),this._elementSelectors=null}var t=e.prototype;return t.setup=function(e){this._compileUrlPatterns(),this._client=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this._disposed?t.dispose():(this._remoteConfigSubscription=t,this.startIfEnabled())},t.dispose=function(){var e;this._disposed||(this._disposed=!0,this._client=void 0,null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,this._removeDomEventHandlers())},t._refreshConfig=function(){return this._configSource.refresh(this._config),this._config},t._compileUrlPatterns=function(){var e,t;return this._refreshConfig(),this._config.url_allowlist=null==(e=this._config.url_allowlist)?void 0:e.map(function(e){return new RegExp(e)}),this._config.url_ignorelist=null==(t=this._config.url_ignorelist)?void 0:t.map(function(e){return new RegExp(e)}),this._config},t._addDomEventHandlers=function(){var e=this;if(this.isBrowserSupported()){if(Pa&&Ta){var t=this._domEventHandler=function(t){t=t||(null==Pa?void 0:Pa.event);try{e._captureEvent(t)}catch(e){L_.error("Failed to capture event",e)}};if(Qa(Ta,"submit",t,{capture:!0}),Qa(Ta,"change",t,{capture:!0}),Qa(Ta,"click",t,{capture:!0}),this._refreshConfig().capture_copied_text){var n=this._copiedTextHandler=function(t){t=t||(null==Pa?void 0:Pa.event);try{e._captureEvent(t,R_)}catch(e){L_.error("Failed to capture clipboard event",e)}};Qa(Ta,"copy",n,{capture:!0}),Qa(Ta,"cut",n,{capture:!0}),Qa(Ta,"paste",n,{capture:!0})}}}else L_.info("Disabling Automatic Event Collection because this browser is not supported")},t._removeDomEventHandlers=function(){this._domEventHandler&&(null==Ta||Ta.removeEventListener("submit",this._domEventHandler,!0),null==Ta||Ta.removeEventListener("change",this._domEventHandler,!0),null==Ta||Ta.removeEventListener("click",this._domEventHandler,!0),this._domEventHandler=void 0),this._copiedTextHandler&&(null==Ta||Ta.removeEventListener("copy",this._copiedTextHandler,!0),null==Ta||Ta.removeEventListener("cut",this._copiedTextHandler,!0),null==Ta||Ta.removeEventListener("paste",this._copiedTextHandler,!0),this._copiedTextHandler=void 0),this._initialized=!1},t.startIfEnabled=function(){!this._disposed&&this._client&&this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)},t.onRemoteConfig=function(e){if(!this._disposed)if(this._hasReceivedConfigResponse=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString);var n,i=t.autocapture_opt_out;jr(i)&&(null==(n=this._client)||n.kv.set(Eu,i),this._isDisabledServerSide=i),this.startIfEnabled()}else this.startIfEnabled()},t.setElementSelectors=function(e){this._elementSelectors=e},t.getElementSelectors=function(e){var t,n=[];return null==(t=this._elementSelectors)||t.forEach(function(t){var i;null==Ta||null==(i=Ta.querySelectorAll(t))||i.forEach(function(i){e===i&&n.push(t)})}),n},t._captureEvent=function(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var n=Wh(e);Bh(n)&&(n=n.parentNode||null);var i,r=this._compileUrlPatterns();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&r.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&nf(n,r.rageclick)&&this._captureEvent(e,"$rageclick");var s=t===R_,o=s?u({},r,{dom_event_allowlist:void 0}):r;if(n&&function(e,t,n,i,r,s){var o;if(!Pa||rf(e))return!1;if(null!=n&&n.url_allowlist&&!Nh(n.url_allowlist,s))return!1;if(null!=n&&n.url_ignorelist&&Nh(n.url_ignorelist,s))return!1;if(null!=n&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some(function(e){return t.type===e}))return!1}var u=sf(e,i),l=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Ar(n))return!0;for(var i,r,s=function(){var e=r.value;if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}},o=d(e);!(r=o()).done;)if(i=s())return i.v;return!1}(c,n))return!1;if(!Kh(c,null==n?void 0:n.css_selector_allowlist))return!1;if(Kh(c,null!==(o=null==n?void 0:n.css_selector_ignorelist)&&void 0!==o?o:Zh))return!1;try{var h=Pa.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return l?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(Gh.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(n,e,o,s,s?["copy","cut","paste"]:void 0,{config:{get_current_url:r.getCurrentUrl}})){var a,l=O_(n,{e:e,maskAllElementAttributes:r.maskAllElementAttributes,maskAllText:r.maskAllText,elementAttributeIgnoreList:r.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString,disableCaptureUrlHashes:r.disableCaptureUrlHashes}),c=l.props;if(l.explicitNoCapture)return!1;var h=this.getElementSelectors(n);if(h&&h.length>0&&(c.$element_selectors=h),t===R_){var f=e.type||"clipboard";if("paste"!==f){var p,_,v=null==Pa||null==(p=Pa.getSelection())?void 0:p.toString(),g=zh(v);if(!g)return!1;c.$selected_content=g,c.$clipboard_text_length=null!==(_=null==v?void 0:v.length)&&void 0!==_?_:0}c.$copy_type=f}return null==(a=this._client)||a.capture(t,c).catch(function(e){return L_.error("Failed to capture event",e)}),!0}}},t.isBrowserSupported=function(){return Ir(null==Ta?void 0:Ta.querySelectorAll)},o(e,[{key:"isEnabled",get:function(){var e,t;if(this._disposed)return!1;var n=null==(e=this._client)?void 0:e.kv.get(Eu),i=this._isDisabledServerSide,r=this._refreshConfig(),s=r.remoteRequestsDisabled&&!this._hasReceivedConfigResponse;if($r(i)&&!jr(n)&&!s)return!1;var o=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!r.enabled&&!o}}])}(),D_=function(){"use strict";function e(e){this._instance=e}return e.prototype.refresh=function(e){var t=this._instance.config,n=Rr(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance._shouldDisableFlags(),e.url_allowlist=null==n?void 0:n.url_allowlist,e.url_ignorelist=null==n?void 0:n.url_ignorelist,e.dom_event_allowlist=null==n?void 0:n.dom_event_allowlist,e.element_allowlist=null==n?void 0:n.element_allowlist,e.css_selector_allowlist=null==n?void 0:n.css_selector_allowlist,e.css_selector_ignorelist=null==n?void 0:n.css_selector_ignorelist,e.element_attribute_ignorelist=null==n?void 0:n.element_attribute_ignorelist,e.capture_copied_text=null==n?void 0:n.capture_copied_text},e}(),q_=function(e){"use strict";function t(t){var n=e.call(this,new D_(t))||this;return n.instance=t,n}return n(t,e),t}($_),B_=Ba("[ExceptionAutocapture]"),j_=function(){"use strict";function e(e){var t,n=this;this._startCapturing=function(){var e;if(Pa&&n.isEnabled&&null!=(e=th.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=th.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=th.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=th.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!n._unwrapOnError&&n._config.capture_unhandled_errors&&(n._unwrapOnError=t(n.captureException.bind(n))),!n._unwrapUnhandledRejection&&n._config.capture_unhandled_rejections&&(n._unwrapUnhandledRejection=i(n.captureException.bind(n))),!n._unwrapConsoleError&&n._config.capture_console_errors&&(n._unwrapConsoleError=r(n.captureException.bind(n)))}catch(e){B_.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Tu]),this._rateLimiter=new Yr(u({},function(e){var t,n,i,r;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(n=e.exceptionRateLimiterRefillRate)&&void 0!==n?n:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(i=null!==(r=e.exceptionRateLimiterBucketSize)&&void 0!==r?r:e.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,_logger:B_})),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}var t=e.prototype;return t._requiredConfig=function(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Rr(e)?t=u({},t,e):(Ar(e)?this._remoteEnabled:e)&&(t=u({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabledOrStop=function(){this.isEnabled?(B_.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()},t._loadScript=function(e){var t,n;null!=(t=th.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(n=th.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",function(t){if(t)return B_.error("failed to load script",t);e()})},t._stopCapturing=function(){var e,t,n;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(n=this._unwrapConsoleError)||n.call(this),this._unwrapConsoleError=void 0},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;"autocaptureExceptions"in n&&(this._remoteEnabled=!!n.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register(((t={})[Tu]=this._remoteEnabled,t)),this._config=this._requiredConfig(),this.startIfEnabledOrStop())}},t.onConfigChange=function(){this._config=this._requiredConfig()},t.captureException=function(e){try{var t,n,i,r=null!==(t=null==e||null==(n=e.$exception_list)||null==(n=n[0])?void 0:n.type)&&void 0!==t?t:"Exception";if(this._rateLimiter.consumeRateLimit(r))return void B_.info("Skipping exception capture because of client rate limiting.",{exception:r});null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}catch(e){}},o(e,[{key:"isEnabled",get:function(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}}])}(),H_=function(){"use strict";function e(e){this._instance=e,this._lastLocation=this._getCurrentLocation()}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){this.isEnabled&&(qa.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())},t.startIfEnabledOrStop=function(){this.stop(),this._lastLocation=this._getCurrentLocation(),this.startIfEnabled()},t.stop=function(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,this._hashchangeListener&&this._hashchangeListener(),this._hashchangeListener=void 0,qa.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){Pa&&Pa.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener(),this._shouldCaptureHashChanges()&&this._setupHashchangeListener())},t._patchHistoryMethod=function(e){var t;if(Pa&&(null==(t=Pa.history[e])||!t.__posthog_wrapped__)){var n=this;Sh(Pa.history,e,function(t){return function(i,r,s){t.call(this,i,r,s),n._capturePageview(e)}})}},t._getCurrentLocation=function(){var e=null==Pa?void 0:Pa.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}},t._getCaptureOptions=function(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:Rr(e)?e:{}},t._shouldCaptureHashChanges=function(e){return void 0===e&&(e=this._getCaptureOptions()),!!e.hash&&!this._instance.config.disable_capture_url_hashes},t._hasLocationChanged=function(e){var t=this._getCaptureOptions(),n=this._lastLocation;return!(!n||!(t.path&&e.pathname!==n.pathname||t.search&&e.search!==n.search||this._shouldCaptureHashChanges(t)&&e.hash!==n.hash))},t._capturePageview=function(e){try{var t=this._getCurrentLocation();if(!t)return;this._hasLocationChanged(t)&&this._instance.capture(Rl,{navigation_type:e}),this._lastLocation=t}catch(t){qa.error("Error capturing "+e+" pageview",t)}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};Qa(Pa,"popstate",t),this._popstateListener=function(){Pa&&Pa.removeEventListener("popstate",t)}}},t._setupHashchangeListener=function(){var e=this;if(!this._hashchangeListener){var t=function(){e._capturePageview("hashchange")};Qa(Pa,"hashchange",t),this._hashchangeListener=function(){Pa&&Pa.removeEventListener("hashchange",t)}}},o(e,[{key:"isEnabled",get:function(){var e=this._getCaptureOptions();return!!(e.path||e.search||this._shouldCaptureHashChanges(e))}}])}(),N_=Ba("[TracingHeaders]"),V_=function(){"use strict";function e(e){var t=this;this._instance=e,this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._hostnamesForPatch=void 0,this._startCapturing=function(){var e,n,i=t._syncHostnamesForPatch();i?(Ar(t._restoreXHRPatch)&&(t._restoreXHRPatch=null==(e=th.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,function(){return t._instance.get_distinct_id()},t._instance.sessionManager)),Ar(t._restoreFetchPatch)&&(t._restoreFetchPatch=null==(n=th.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)?void 0:n._patchFetch(i,function(){return t._instance.get_distinct_id()},t._instance.sessionManager))):t._stopCapturing()}}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t._loadScript=function(e){var t,n;null!=(t=th.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=th.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",function(t){if(t)return N_.error("failed to load script",t);e()})},t._getConfiguredHostnames=function(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers},t._syncHostnamesForPatch=function(){var e,t=this._getConfiguredHostnames();return Tr(t)?(Tr(this._hostnamesForPatch)?(e=this._hostnamesForPatch).splice.apply(e,[0,this._hostnamesForPatch.length].concat(t)):this._hostnamesForPatch=[].concat(t),t.length>0?this._hostnamesForPatch:void 0):(Tr(this._hostnamesForPatch)&&this._hostnamesForPatch.splice(0),this._hostnamesForPatch=t||void 0,this._hostnamesForPatch)},t._stopCapturing=function(){var e,t;null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0},t.startIfEnabledOrStop=function(){this._syncHostnamesForPatch()?this._loadScript(this._startCapturing):this._stopCapturing()},e}(),z_=Ba("[Web Vitals]"),U_=9e5,W_=["CLS","FCP","INP","LCP"],G_=["INP","LCP"],K_=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Q_=function(){"use strict";function e(e){var t,n=this;this._instance=e,this._enabledServerSide=!1,this._initialized=!1,this._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=function(){clearTimeout(n._delayedFlushTimer),n._delayedFlushTimer=void 0,0!==n._buffer.metrics.length&&(n._instance.capture("$web_vitals",u({$current_url:n._buffer.url},n._buffer.metrics.reduce(function(e,t){var n;return u({},e,((n={})["$web_vitals_"+t.name+"_event"]=u({},t),n["$web_vitals_"+t.name+"_value"]=t.value,n))},{}))),n._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=function(e){var t;if(n._buffer=n._buffer||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Dr(null==e?void 0:e.name)||Dr(null==e?void 0:e.value))z_.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,r=n._maskedURL(i);if(!Ar(r)){var s=qr(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+r;if(!n._maxAllowedValue||n._maxAllowedValue>e.value){n._buffer.navigationKey!==s&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,n.flushToCaptureTimeoutMs)),Ar(n._buffer.navigationKey)&&(n._buffer.navigationKey=s,n._buffer.url=r),n._buffer.firstMetricTimestamp=Ar(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp;var o=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=u({},e,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Rr(e.attribution)&&n.attributionMetrics.indexOf(e.name)>-1){for(var l,c={},h=d(K_);!(l=h()).done;){var f=l.value,p="url"===f&&"string"==typeof e.attribution[f]?n._maskedURL(e.attribution[f]):e.attribution[f];Ar(p)||(c[f]=p)}a.attribution=c}else delete a.attribution;Ar(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),n._buffer.metrics.push(a),n._buffer.metrics.length===n.allowedMetrics.length&&n._flushToCapture()}else z_.error("Ignoring metric with value >= "+n._maxAllowedValue,e)}}},this._startCapturing=function(){if(!n._initialized){var e,t,i,r,s=!1,o=th.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[n._callbackFlavor])||("web-vitals"===n._callbackFlavor&&Ar(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ar(l)){var c=l.withoutAttribution,d=n.attributionMetrics;s=!Ar(c),e=d.indexOf("LCP")>-1?l.onLCP:(null==c?void 0:c.onLCP)||l.onLCP,t=d.indexOf("CLS")>-1?l.onCLS:(null==c?void 0:c.onCLS)||l.onCLS,i=d.indexOf("FCP")>-1?l.onFCP:(null==c?void 0:c.onFCP)||l.onFCP,r=d.indexOf("INP")>-1?l.onINP:(null==c?void 0:c.onINP)||l.onINP}if(e&&t&&i&&r){var h={reportSoftNavs:n.useSoftNavs},f=s&&n.attributionMetrics.indexOf("INP")>-1?u({},h,{includeProcessedEventEntries:!1}):h;n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n),h),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n),h),n.allowedMetrics.indexOf("FCP")>-1&&i(n._addToBuffer.bind(n),h),n.allowedMetrics.indexOf("INP")>-1&&r(n._addToBuffer.bind(n),f),n._initialized=!0}else z_.error("web vitals callbacks not loaded - not starting")}},this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[Lu]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(z_.info("enabled, starting..."),this._loadScript(this._startCapturing))},t.onRemoteConfig=function(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var n,i,r=Rr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=Rr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((n={})[Lu]=r,n)),this._instance.persistence.register(((i={})[$u]=s,i))),this._enabledServerSide=r,this.startIfEnabled()}}},t._loadScript=function(e){var t=th.__PosthogExtensions__,n=this._callbackFlavor,i=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=i&&i[n]||"web-vitals"===n&&Ar(i)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,n,function(t){t?z_.error("failed to load script",t):e()})},t._maskedURL=function(e){var t=e||(null==Pa?void 0:Pa.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?lo(t):t;return Ul(n,this._instance.config.mask_personal_data_properties?[].concat(kd,this._instance.config.custom_personal_data_properties||[]):[],Pd)}z_.error("Could not determine current URL")},o(e,[{key:"_perfConfig",get:function(){return this._instance.config.capture_performance}},{key:"allowedMetrics",get:function(){var e,t,n=Rr(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return Dr(n)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||W_:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(Rr(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"attributionMetrics",get:function(){var e=Rr(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return jr(e)?e?W_:[]:Tr(e)?e:G_}},{key:"useAttribution",get:function(){return this.attributionMetrics.length>0}},{key:"useSoftNavs",get:function(){var e;return null!==(e=Rr(this._perfConfig)?this._perfConfig.__preview_web_vitals_soft_navs:void 0)&&void 0!==e&&e}},{key:"_maxAllowedValue",get:function(){var e=Rr(this._perfConfig)&&qr(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:U_;return e>0&&6e4>=e?U_:e}},{key:"isEnabled",get:function(){var e=null==Ia?void 0:Ia.protocol;if("http:"!==e&&"https:"!==e)return z_.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Rr(this._perfConfig)?this._perfConfig.web_vitals:jr(this._perfConfig)?this._perfConfig:void 0;return jr(t)?t:this._enabledServerSide}},{key:"_callbackFlavor",get:function(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}}])}(),Z_="disabled",J_="lazy_loading",Y_=Ba("[SessionRecording]"),X_=function(){"use strict";function e(e){var t=this;if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=Z_,this._persistFlagsOnSessionListener=void 0,this._sessionRecordingDisposed=!1,this._documentWasEverVisible=function(){var e;if(null==Ta||!Ta.visibilityState||"visible"===Ta.visibilityState)return!0;var t=null==Pa||null==(e=Pa.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(function(e){return"visible"===e.name})}(),this._onVisibilityChange=function(){var e;"visible"===(null==Ta?void 0:Ta.visibilityState)&&(t._documentWasEverVisible=!0,null==(e=t._lazyLoadedSessionRecording)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw Y_.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this._config.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=Ta&&Ta.addEventListener&&Qa(Ta,"visibilitychange",this._onVisibilityChange)}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t.dispose=function(e){var t=(void 0===e?{}:e).discardBufferedEvents,n=void 0!==t&&t;this._sessionRecordingDisposed=!0,null==Ta||null==Ta.removeEventListener||Ta.removeEventListener("visibilitychange",this._onVisibilityChange),n?this._discardRecording(!0):this.stopRecording()},t.startIfEnabledOrStop=function(e){var t;if(!(this._sessionRecordingDisposed||this._isRecordingEnabled&&null!=(t=this._lazyLoadedSessionRecording)&&t.isStarted)){var n=!Ar(Object.assign)&&!Ar(Array.from);this._isRecordingEnabled&&n?(this._lazyLoadAndStart(e),Y_.info("starting")):(this._recordingStatus=Z_,this.stopRecording())}},t._lazyLoadAndStart=function(e){var t,n,i=this;if(this._isRecordingEnabled)if("awaiting_config"!==this._recordingStatus&&"missing_config"!==this._recordingStatus&&(this._recordingStatus=J_),null!=th&&null!=(t=th.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=th.__PosthogExtensions__)&&n.initSessionRecording)this._onScriptLoaded(e);else{var r,s=this._instance.sessionManager;null==(r=th.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this._scriptName,function(t){if(!i._sessionRecordingDisposed&&i._isRecordingEnabled&&i._instance.sessionManager===s){var n;if(t)return i._instance.register_for_session(((n={})[kl]=!0,n)),Y_.error("could not load recorder",t);i._onScriptLoaded(e)}else i._recordingStatus=Z_})}},t.stopRecording=function(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()},t._discardRecording=function(e){var t,n;void 0===e&&(e=!1),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=void 0,null==(n=this._lazyLoadedSessionRecording)||n.discard({discardProducerEvents:e})},t._resetSampling=function(){var e,t;null==(e=this._persistence)||e.unregister(zu),null==(t=this._persistence)||t.unregister(qu)},t._validateSampleRate=function(e,t){if(Dr(e))return null;var n,i=qr(e)?e:parseFloat(e);return"number"!=typeof(n=i)||!Number.isFinite(n)||0>n||n>1?(Y_.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i},t._persistRemoteConfig=function(e){var t=this;if(this._persistence){var n,i,r=this._persistence,s=function(){var n,i,s=!1===e.sessionRecording?void 0:e.sessionRecording,o=t._validateSampleRate(null==(n=t._config.session_recording)?void 0:n.sampleRate,"session_recording.sampleRate"),a=t._validateSampleRate(null==s?void 0:s.sampleRate,"remote config sampleRate"),l=null!=o?o:a;Dr(l)&&t._resetSampling();var c=null==s?void 0:s.minimumDurationMilliseconds;r.register(((i={})[Du]=u({cache_timestamp:Date.now(),enabled:!!s},s,{networkPayloadCapture:u({capturePerformance:e.capturePerformance},null==s?void 0:s.networkPayloadCapture),canvasRecording:{enabled:null==s?void 0:s.recordCanvas,fps:null==s?void 0:s.canvasFps,quality:null==s?void 0:s.canvasQuality},sampleRate:l,minimumDurationMilliseconds:Ar(c)?null:c,endpoint:null==s?void 0:s.endpoint,triggerMatchType:null==s?void 0:s.triggerMatchType,masking:null==s?void 0:s.masking,urlTriggers:null==s?void 0:s.urlTriggers,version:null==s?void 0:s.version,triggerGroups:null==s?void 0:s.triggerGroups}),i))};s(),null==(n=this._persistFlagsOnSessionListener)||n.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}},t.onRemoteConfig=function(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this._persistRemoteConfig(t),void this._discardRecording()):(this._persistRemoteConfig(t),void this.startIfEnabledOrStop()):("awaiting_config"===this._recordingStatus&&(this._recordingStatus="missing_config",Y_.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())},t.log=function(e,t){var n;void 0===t&&(t="log"),null!=(n=this._lazyLoadedSessionRecording)&&n.log?this._lazyLoadedSessionRecording.log(e,t):Y_.warn("log called before recorder was ready")},t._isRemoteConfigFresh=function(){var e,t=this._instance.get_property(Du);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return Y_.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!Dr(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp},t._onScriptLoaded=function(e){var t,n,i;if(!this._sessionRecordingDisposed&&this._isRecordingEnabled&&this._instance.sessionManager){var r,s;if(null==(t=th.__PosthogExtensions__)||!t.initSessionRecording)return Y_.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((r={},r[kl]=!0,r));if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(s=th.__PosthogExtensions__)?void 0:s.initSessionRecording(this._instance,this._documentWasEverVisible),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._isRemoteConfigFresh()){if("missing_config"===this._recordingStatus||"awaiting_config"===this._recordingStatus)return;return this._recordingStatus="awaiting_config",Y_.info("persisted remote config is stale, requesting fresh config before starting"),void new Kf(this._instance).load()}this._recordingStatus=J_,null==(n=(i=this._lazyLoadedSessionRecording).setDocumentWasEverVisible)||n.call(i,this._documentWasEverVisible),this._lazyLoadedSessionRecording.start(e)}else this._recordingStatus=Z_},t.onRRwebEmit=function(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)},t.overrideLinkedFlag=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[ju]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideLinkedFlag()},t.overrideSampling=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[Bu]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideSampling()},t.overrideTrigger=function(e){var t,n,i;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register(((n={})["url"===e?Hu:Nu]=!0,n)),null==(i=this._lazyLoadedSessionRecording)||i.overrideTrigger(e)},t.tryAddCustomEvent=function(e,t){var n;return!(null==(n=this._lazyLoadedSessionRecording)||!n.tryAddCustomEvent(e,t))},t.flushBeforeIdentityReset=function(){var e;null==(e=this._lazyLoadedSessionRecording)||null==e.flushBeforeIdentityReset||e.flushBeforeIdentityReset()},o(e,[{key:"_config",get:function(){return this._instance.config}},{key:"_persistence",get:function(){return this._instance.persistence}},{key:"started",get:function(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}},{key:"status",get:function(){var e,t;return"awaiting_config"===this._recordingStatus||"missing_config"===this._recordingStatus?this._recordingStatus:null!==(e=null==(t=this._lazyLoadedSessionRecording)?void 0:t.status)&&void 0!==e?e:this._recordingStatus}},{key:"_isRecordingEnabled",get:function(){var e,t=!(null==(e=this._instance.get_property(Du))||!e.enabled),n=!this._config.disable_session_recording,i=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Pa&&t&&n&&!i}},{key:"_scriptName",get:function(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property("$session_recording_remote_config"))||null==(e=e.scriptConfig)?void 0:e.script)||"lazy-recorder"}},{key:"sdkDebugProperties",get:function(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}}])}(),ev=Ba("[Heatmaps]");function tv(e){return Rr(e)&&"clientX"in e&&"clientY"in e&&qr(e.clientX)&&qr(e.clientY)}var nv=function(){"use strict";function e(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[Fu]),this.rageclicks=new I_(e.config.rageclick)}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;ev.info("starting..."),this._setupListeners(),this._onVisibilityChange()}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this._removeListeners(),this.getAndClearBuffer()}},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;if("heatmaps"in n){var i=!!n.heatmaps;this.instance.persistence&&this.instance.persistence.register(((t={})[Fu]=i,t)),this._enabledServerSide=i,this.startIfEnabled()}}},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t._onDeadClick=function(e){tv(e.originalEvent)&&this._onClick(e.originalEvent,"deadclick")},t._onVisibilityChange=function(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Ta)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null},t._setupListeners=function(){var e=this;Pa&&Ta&&(this._flushHandler=this._flush.bind(this),Qa(Pa,Il,this._flushHandler),this._onClickHandler=function(t){return e._onClick(t||(null==Pa?void 0:Pa.event))},Qa(Ta,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=function(t){return e._onMouseMove(t||(null==Pa?void 0:Pa.event))},Qa(Ta,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new xf(this.instance,wf,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),Qa(Ta,Tl,this._onVisibilityChange_handler),this._initialized=!0)},t._removeListeners=function(){var e;Pa&&Ta&&(this._flushHandler&&Pa.removeEventListener(Il,this._flushHandler),this._onClickHandler&&Ta.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Ta.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Ta.removeEventListener(Tl,this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)},t._getProperties=function(e,t){var n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),s=function(e,t,n){for(var i=e;i&&Dh(i)&&!qh(i,"body");){if(i===n)return!1;var r=void 0;try{var s,o,a;r=null==(s=null!==(o=null==(a=i.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:Pa)?void 0:s.getComputedStyle(i).position}catch(e){return!1}if(vr(t,r))return!0;i=Qh(i)}return!1}(Wh(e),["fixed","sticky"],r);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:n),target_fixed:s,type:t}},t._onClick=function(e,t){var n;if(void 0===t&&(t="click"),!$h(e.target)&&tv(e)){var i=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&nf(Wh(e),this.instance.config.rageclick)&&this._capture(u({},i,{type:"rageclick"})),this._capture(i)}},t._onMouseMove=function(e){var t=this;!$h(e.target)&&tv(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))},t._capture=function(e){if(Pa){var t=this._config.disable_capture_url_hashes?lo(Pa.location.href):Pa.location.href,n=Ul(t,this._config.mask_personal_data_properties?[].concat(kd,this._config.custom_personal_data_properties||[]):[],Pd);this._buffer=this._buffer||{},this._buffer[n]||(this._buffer[n]=[]),this._buffer[n].push(e)}},t._flush=function(){this._buffer&&!Lr(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})},o(e,[{key:"_config",get:function(){return this.instance.config}},{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return Rr(this._config.capture_heatmaps)&&this._config.capture_heatmaps.flush_interval_milliseconds&&(e=this._config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return Dr(this._config.capture_heatmaps)?Dr(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}}])}(),iv=Ba("[Product Tours]"),rv=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(Mu))},sv=function(){"use strict";function e(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;if("productTours"in n){var i,r;if(this._persistence&&this._persistence.register(((t={})[Mu]=!!n.productTours,t)),!rv(this._instance))return!this._productTourManager&&Dr(null==(i=this._persistence)?void 0:i.props.ph_product_tours)||iv.info("product tours disabled; stopping and clearing cached tours"),null==(r=this._productTourManager)||r.stop(),this._productTourManager=null,void this.clearCache();this.loadIfEnabled()}}},t.loadIfEnabled=function(){var e=this;!this._productTourManager&&rv(this._instance)&&this._loadScript(function(){return e._startProductTours()})},t._loadScript=function(e){var t,n;null!=(t=th.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=th.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"product-tours",function(t){t?iv.error("Could not load product tours script",t):e()})},t._startProductTours=function(){var e;!this._productTourManager&&null!=(e=th.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=th.__PosthogExtensions__.generateProductTours(this._instance,!0))},t.getProductTours=function(e,t){var n=this;if(void 0===t&&(t=!1),!Tr(this._cachedTours)||t){var i=this._persistence;if(i){var r=i.props[ul];if(Tr(r)&&!t)return this._cachedTours=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:function(t){var r;if(rv(n._instance)){var s=t.statusCode;if(200!==s||!t.json){var o="Product Tours API could not be loaded, status: "+s;return 0===s?t.error||iv.warn(o):iv.error(o),void e([],{isLoaded:!1,error:o})}var a=Tr(t.json.product_tours)?t.json.product_tours:[];n._cachedTours=a,i&&i.register(((r={})[ul]=a,r)),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})},t.getActiveProductTours=function(e){Dr(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)},t.showProductTour=function(e){var t;null==(t=this._productTourManager)||t.showTourById(e)},t.previewTour=function(e){var t=this;this._productTourManager?this._productTourManager.previewTour(e):this._loadScript(function(){var n;t._startProductTours(),null==(n=t._productTourManager)||n.previewTour(e)})},t.dismissProductTour=function(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")},t.nextStep=function(){var e;null==(e=this._productTourManager)||e.nextStep()},t.previousStep=function(){var e;null==(e=this._productTourManager)||e.previousStep()},t.clearCache=function(){var e;this._cachedTours=null,null==(e=this._persistence)||e.unregister(ul)},t.resetTour=function(e){var t;null==(t=this._productTourManager)||t.resetTour(e)},t.resetAllTours=function(){var e;null==(e=this._productTourManager)||e.resetAllTours()},t.cancelPendingTour=function(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)},o(e,[{key:"_persistence",get:function(){return this._instance.persistence}}])}(),ov=Ba("[SiteApps]"),av="Error while initializing PostHog app with config id ",uv=function(){"use strict";function e(e){this._instance=e,this._siteAppElementPatchCount=0,this._bufferedInvocations=[],this.apps={}}var n=e.prototype;return n._eventCollector=function(e,t){if(t){var n=this.globalsForEvent(t);this._bufferedInvocations.push(n),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}},n.initialize=function(){var e=this;if(this.isEnabled){var t=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=function(){t(),e._bufferedInvocations=[],e._stopBuffering=void 0}}},n.globalsForEvent=function(e){var n,i,s,o,a,l,c;if(!e)throw new Error("Event payload is required");for(var d={},h=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{},p=0,_=Object.entries(f);_.length>p;p++){var v=_[p],g=v[0];d[g]={id:h[g],type:g,properties:v[1]}}var m=e.$set_once,y=e.$set;return{event:u({},r(e,t),{properties:u({},e.properties,y?{$set:u({},null!==(n=null==(i=e.properties)?void 0:i.$set)&&void 0!==n?n:{},y)}:{},m?{$set_once:u({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},m)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(c=e.properties)?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}},n._prepareElementForSiteApp=function(e){var t,n=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===n&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(ov.error("prepare_external_dependency_stylesheet returned null"),null):"script"===n&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(ov.error("prepare_external_dependency_script returned null"),null):e},n._patchSiteAppElementInsertionMethods=function(){var e,t,n,i,r,s,o,a,u=this;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return function(){};var l=null==Ta?void 0:Ta.defaultView,c=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!c)return function(){};if(this._siteAppElementPatchCount++,this._restoreSiteAppElementPatches)return this._releaseSiteAppElementPatches();var d=[],h=this,f=new WeakSet,p=function(e,t,n){if(null!=e&&e[t]){var i=e[t];e[t]=n(i),d.push(function(){e[t]=i})}},_=function(e){if(f.has(e))return e;var t=h._prepareElementForSiteApp(e);return t&&f.add(t),t},v=function(e){return e.map(function(e){return"string"==typeof e?e:_(e)}).filter(function(e){return!$r(e)})};return p(c,"appendChild",function(e){return function(t){var n=_(t);return n?e.call(this,n):t}}),p(c,"insertBefore",function(e){return function(t,n){var i=_(t);return i?e.call(this,i,n):t}}),p(c,"replaceChild",function(e){return function(t,n){var i=_(t);return i?e.call(this,i,n):n}}),[null==(t=l.Element)?void 0:t.prototype,null==(n=l.Document)?void 0:n.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach(function(e){p(e,"append",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,v(n))}}),p(e,"prepend",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,v(n))}})}),[null==(r=l.Element)?void 0:r.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach(function(e){p(e,"before",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,v(n))}}),p(e,"after",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,v(n))}}),p(e,"replaceWith",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];var r=v(n);return n.length&&!r.length?void 0:e.apply(this,r)}})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",function(e){return function(t,n){var i=_(n);return i?e.call(this,t,i):null}}),this._restoreSiteAppElementPatches=function(){d.forEach(function(e){return e()}),u._restoreSiteAppElementPatches=void 0},this._releaseSiteAppElementPatches()},n._releaseSiteAppElementPatches=function(){var e=this,t=!1;return function(){t||(t=!0,e._siteAppElementPatchCount--,0===e._siteAppElementPatchCount&&(null==e._restoreSiteAppElementPatches||e._restoreSiteAppElementPatches()))}},n._runWithPreparedSiteAppElements=function(e,t){void 0===t&&(t=!0);var n=this._patchSiteAppElementInsertionMethods();try{var i=e(n);return t&&n(),i}catch(e){throw n(),e}},n.setupSiteApp=function(e){var t=this,n=this.apps[e.id],i=function(){!n.errored&&t._bufferedInvocations.length&&(ov.info("Processing "+t._bufferedInvocations.length+" events for site app with id "+e.id),t._bufferedInvocations.forEach(function(e){return t._runWithPreparedSiteAppElements(function(){return null==n.processEvent?void 0:n.processEvent(e)})}),n.processedBuffer=!0),Object.values(t.apps).every(function(e){return e.processedBuffer||e.errored})&&(null==t._stopBuffering||t._stopBuffering())},r=!1,s=function(t){n.errored=!t,n.loaded=!0,ov.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),r&&i()};try{var o=this._runWithPreparedSiteAppElements(function(n){return e.init({posthog:t._instance,callback:function(e){n(),s(e)}})},!1).processEvent;o&&(n.processEvent=o),r=!0}catch(t){ov.error(av+e.id,t),s(!1)}if(r&&n.loaded)try{i()}catch(t){ov.error("Error while processing buffered events PostHog app with config id "+e.id,t),n.errored=!0}},n._setupSiteApps=function(){for(var e,t=this.siteAppLoaders||[],n=d(t);!(e=n()).done;){var i=e.value;this.apps[i.id]={id:i.id,loaded:!1,errored:!1,processedBuffer:!1}}for(var r,s=d(t);!(r=s()).done;)this.setupSiteApp(r.value)},n._onCapturedEvent=function(e){var t=this;if(0!==Object.keys(this.apps).length)for(var n=this.globalsForEvent(e),i=function(){var i=s[r];try{t._runWithPreparedSiteAppElements(function(){return null==i.processEvent?void 0:i.processEvent(n)})}catch(t){ov.error("Error while processing event "+e.event+" for site app "+i.id,t)}},r=0,s=Object.values(this.apps);s.length>r;r++)i()},n.onRemoteConfig=function(e){var t,n,i,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",function(e){return r._onCapturedEvent(e)})):void ov.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this._stopBuffering)||n.call(this),e.ok){var s=e.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled)for(var o,a=function(){var e,t=o.value,n=t.id,i=t.url;th["__$$ph_site_app_"+n]=r._instance,null==(e=th.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,function(e){if(e)return ov.error(av+n,e)})},u=d(s.siteApps);!(o=u()).done;)a();else ov.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},o(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps}},{key:"siteAppLoaders",get:function(){var e;return null==(e=th._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),lv=function(e,t){return null!=e&&e.then?e.then(t):t(e)},cv="SDK is not enabled or survey functionality is not yet loaded",dv="Disabled. Not loading surveys.",hv=function(){"use strict";function e(e,t){var n=this;this._configSource=e,this._initialClientState=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._lastSurveyRefreshFailedAt=null,this._disposed=!1,this._renderTimeouts=new Set,this.onRemoteConfig=function(e){if(!n._disposed&&!n._config.disableSurveys){if(!e.ok)return hu.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Dr(t))return hu.warn("Flags not loaded yet. Not loading surveys.");n._isSurveysEnabled=jr(t)?t:t.length>0,hu.info("flags response received, isSurveysEnabled: "+n._isSurveysEnabled),n.loadIfEnabled()}}}var t=e.prototype;return t.setup=function(e){var t=this;if(!this._disposed)return this._initializingClient=e,lv(e.kv.initialize(),function(){if(t._initializingClient===e&&!t._disposed){t._initializingClient=void 0,t._client=e;var n=e.onRemoteConfig(t.onRemoteConfig);t._disposed?n.dispose():(t._remoteConfigSubscription=n,t.loadIfEnabled())}})},t.dispose=function(){var e,t,n;this._disposed||(this._disposed=!0,this._initializingClient=void 0,this._client=void 0,null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(n=this._surveyManager)||null==n.dispose||n.dispose(),this._surveyManager=null,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._renderTimeouts.forEach(function(e){return clearTimeout(e)}),this._renderTimeouts.clear())},t.initialize=function(){this.loadIfEnabled()},t.reset=function(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(null!=i&&i.startsWith("seenSurvey_")||null!=i&&i.startsWith("inProgressSurvey_"))&&t.push(i)}t.forEach(function(e){return localStorage.removeItem(e)})}catch(e){}},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._client){var t=this._config;if(!this._surveyManager)if(this._isInitializingSurveys)hu.info("Already initializing surveys, skipping...");else if(t.disableSurveys)hu.info(dv);else if(t.cookielessMode&&this._configSource.isOptedOut())hu.info("Not loading surveys in cookieless mode without consent.");else{var n=this._configSource.getExtensions();if(n){if(!Ar(this._isSurveysEnabled)||t.advancedEnableSurveys){var i=this._isSurveysEnabled||t.advancedEnableSurveys;this._isInitializingSurveys=!0;try{var r=n.generateSurveys;if(r)return this._completeSurveyInitialization(r,i),void(this._isInitializingSurveys=!1);var s=n.loadExternalDependency;if(!s)return this._handleSurveyLoadError(Cl),void(this._isInitializingSurveys=!1);s(function(t){try{if(e._disposed)return;var n=e._configSource.getExtensions();t||null==n||!n.generateSurveys?e._handleSurveyLoadError("Could not load surveys script",t):e._completeSurveyInitialization(n.generateSurveys,i)}finally{e._isInitializingSurveys=!1}})}catch(e){throw this._isInitializingSurveys=!1,this._handleSurveyLoadError("Error initializing surveys",e),e}}}else hu.error("PostHog Extensions not found.")}}},t._completeSurveyInitialization=function(e,t){this._disposed||(this._surveyManager=e(t),this._surveyEventReceiver=this._configSource.createEventReceiver(),hu.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0}))},t._handleSurveyLoadError=function(e,t){hu.error(e,t),this._notifySurveyCallbacks({isLoaded:!1,error:e})},t.onSurveysLoaded=function(e){var t=this;return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),function(){t._surveyCallbacks=t._surveyCallbacks.filter(function(t){return t!==e})}},t.getSurveys=function(e,t){var n,i=this;void 0===t&&(t=!1);var r=null!==(n=this._client)&&void 0!==n?n:this._initialClientState;if(r&&!this._disposed){if(this._config.disableSurveys)return hu.info(dv),e([]);var s=r.kv.get(il);if(s&&!t)return e(s,{isLoaded:!0}),void(this._shouldBackgroundRefreshSurveys()&&this.getSurveys(function(){},!0));if(this._getSurveysInFlightPromise)this._getSurveysInFlightPromise.then(function(t){i._disposed||e(t.surveys,t.context)}).catch(function(e){return hu.error("Error in survey callback",e)});else{var o=this._sendSurveysRequest("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this._config.requestTimeoutMs}).then(function(e){try{return i._handleSurveyResponse(r,e)}catch(e){return hu.error("Error processing surveys response",e),i._handleSurveyResponse(r,{statusCode:0,error:e})}},function(e){return i._handleSurveyResponse(r,{statusCode:0,error:e})});this._getSurveysInFlightPromise=o;var a=function(){i._getSurveysInFlightPromise===o&&(i._getSurveysInFlightPromise=null)};o.then(function(t){a(),i._disposed||e(t.surveys,t.context)},a).catch(function(e){return hu.error("Error in survey callback",e)})}}},t._sendSurveysRequest=function(e,t){var n=this._client;return n?n.sendRequest(e,t):new Promise(function(e){return e({statusCode:0,error:new Error(cv)})})},t._handleSurveyResponse=function(e,t){var n,i;if(this._disposed)return{surveys:[],context:{isLoaded:!1,error:cv}};var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;return 0!==r?hu.error(s):t.error||hu.warn(s),this._lastSurveyRefreshFailedAt=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this._lastSurveyRefreshFailedAt=null;var o=t.json.surveys||[],a=o.filter(function(e){return fu(e)&&(ou(e)||pu(e))});return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),e.kv.set(((i={})[il]=o,i[rl]=Date.now(),i)),{surveys:o,context:{isLoaded:!0}}},t._shouldBackgroundRefreshSurveys=function(){return this._isSurveyCacheStale()&&!this._getSurveysInFlightPromise&&!this._isSurveyRefreshBackingOff()},t._isSurveyCacheStale=function(){var e,t,n=null==(e=null!==(t=this._client)&&void 0!==t?t:this._initialClientState)?void 0:e.kv.get(rl);return qr(n)&&Date.now()-n>3e5},t._isSurveyRefreshBackingOff=function(){return qr(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt},t.markSurveyAsSeen=function(e,t){var n;gu({id:e,current_iteration:null!==(n=null==t?void 0:t.iteration)&&void 0!==n?n:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}},t._notifySurveyCallbacks=function(e){for(var t,n=d(this._surveyCallbacks);!(t=n()).done;){var i=t.value;try{if(!e.isLoaded)return i([],e);this.getSurveys(i)}catch(e){hu.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!Dr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);hu.warn("init was not called")},t._getSurveyById=function(e){var t=null;return this.getSurveys(function(n){var i;t=null!==(i=n.find(function(t){return t.id===e}))&&void 0!==i?i:null}),t},t._checkSurveyEligibility=function(e){if(Dr(this._surveyManager))return{eligible:!1,reason:cv};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}},t._checkSurveyRenderability=function(e){if(Dr(this._surveyManager))return{eligible:!1,reason:cv};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}},t.canRenderSurvey=function(e){if(Dr(this._surveyManager))return hu.warn("init was not called"),{visible:!1,disabledReason:cv};var t=this._checkSurveyRenderability(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return Dr(this._surveyManager)?(hu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:cv})):new Promise(function(i){n.getSurveys(function(t){var r,s=null!==(r=t.find(function(t){return t.id===e}))&&void 0!==r?r:null;if(s){var o=n._checkSurveyRenderability(s);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})},t.renderSurvey=function(e,t,n){var i,r=this;if(Dr(this._surveyManager))hu.warn("init was not called");else{var s="string"==typeof e?this._getSurveyById(e):e;if(null!=s&&s.id)if(mu.includes(s.type)){var o=null==Ta?void 0:Ta.querySelector(t);if(o)if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds){hu.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(function(){var e,t;r._renderTimeouts.delete(a),r._disposed||(hu.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=r._surveyManager)||t.renderSurvey(s,o,n),hu.info("Survey "+s.id+" rendered"))},1e3*s.appearance.surveyPopupDelaySeconds);this._renderTimeouts.add(a)}else this._surveyManager.renderSurvey(s,o,n);else hu.warn("Survey element not found")}else hu.warn("Surveys of type "+s.type+" cannot be rendered in the app");else hu.warn("Survey not found")}},t.displaySurvey=function(e,t){var n;if(Dr(this._surveyManager))hu.warn("init was not called");else{var i=this._getSurveyById(e);if(i){var r=i;if(null!=(n=i.appearance)&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=u({},i,{appearance:u({},i.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==fr&&t.initialResponses&&hu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this._checkSurveyEligibility(i);if(!s.eligible)return void hu.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else hu.warn("Survey not found")}},t.cancelPendingSurvey=function(e){Dr(this._surveyManager)?hu.warn("init was not called"):this._surveyManager.cancelSurvey(e)},t.handlePageUnload=function(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()},o(e,[{key:"_config",get:function(){return this._configSource.get()}}])}();function fv(e,t,n){if(Dr(e))return!1;switch(n){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}}var pv=function(){"use strict";function e(e){var t=this;this._instance=e,this._actionRegistry=new Set,this._actionEvents=new Set,this._debugEventEmitter=new Kp,this._checkStep=function(e,n){return t._checkStepEvent(e,n)&&t._checkStepUrl(e,n)&&t._checkStepElement(e,n)&&t._checkStepProperties(e,n)},this._checkStepEvent=function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)}}var t=e.prototype;return t.init=function(){var e,t,n=this;Ar(null==(e=this._instance)?void 0:e._addCaptureHook)||(this._captureHookUnsubscribe=null==(t=this._instance)?void 0:t._addCaptureHook(function(e,t){n.on(e,t)}))},t.dispose=function(){var e;null==(e=this._captureHookUnsubscribe)||e.call(this),this._captureHookUnsubscribe=void 0,this._debugEventEmitter=new Kp},t.register=function(e){var t,n,i=this;if(!Ar(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(function(e){var t;i._actionRegistry.add(e),null==(t=e.steps)||t.forEach(function(e){i._actionEvents.add((null==e?void 0:e.event)||"")})}),null!=(n=this._instance)&&n.autocapture)){var r=new Set;this._actionRegistry.forEach(function(e){var t;null==(t=e.steps)||t.forEach(function(e){null!=e&&e.selector&&r.add(e.selector)})}),this._instance.autocapture.setElementSelectors(r)}},t.replace=function(e){this._actionRegistry.clear(),this._actionEvents.clear(),this.register(e)},t.on=function(e,t){var n=this;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(t.event))&&this._actionRegistry.forEach(function(e){n._checkAction(t,e)&&n._debugEventEmitter.emit("actionCaptured",e.name)})},t._addActionHook=function(e){this.onAction("actionCaptured",function(t){return e(t)})},t._checkAction=function(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n,i=d(t.steps);!(n=i()).done;)if(this._checkStep(e,n.value))return!0;return!1},t.onAction=function(e,t){return this._debugEventEmitter.on(e,t)},t._checkStepUrl=function(e,t){if(null!=t&&t.url){var n,i=null==e||null==(n=e.properties)?void 0:n.$current_url;if(!i||"string"!=typeof i)return!1;if(!fv(i,t.url,t.url_matching||"contains"))return!1}return!0},t._checkStepElement=function(e,t){return!!this._checkStepHref(e,t)&&!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t)},t._checkStepHref=function(e,t){var n;if(null==t||!t.href)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some(function(e){return fv(e.href,t.href,t.href_matching||"exact")});var r,s=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!s&&fv((r=s.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")},t._checkStepText=function(e,t){var n;if(null==t||!t.text)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some(function(e){return fv(e.text,t.text,t.text_matching||"exact")||fv(e.$el_text,t.text,t.text_matching||"exact")});var r,s,o,a=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!a&&(r=function(e){for(var t,n=[],i=/(?::|")text="(.*?)"/g;!Dr(t=i.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(a),s=t.text,o=t.text_matching||"exact",r.some(function(e){return fv(e,s,o)}))},t._checkStepSelector=function(e,t){var n,i;if(null==t||!t.selector)return!0;if(null!=e&&null!=(n=e.properties)&&null!=(n=n.$element_selectors)&&n.includes(t.selector))return!0;var r=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&r)try{return new RegExp(t.selector_regex).test(r)}catch(e){return!1}return!1},t._getElementsList=function(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements},t._checkStepProperties=function(e,t){return null==t||!t.properties||0===t.properties.length||du(t.properties.reduce(function(e,t){var n=Tr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:n,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)},e}(),_v=function(e){"use strict";function t(t){return e.call(this,t)||this}n(t,e);var i=t.prototype;return i._getActivatedKey=function(){return sl},i._getActivatedSessionKey=function(){return ol},i._getActivationTimestampsKey=function(){return al},i._writeActivationTimestamps=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[al]=e,n))},i._clearActivationTimestampsStore=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(al)},i._shouldPersistArmedActivation=function(e){var t,n;this._getItems(function(t){n=t.find(function(t){return t.id===e})});var i=null==(t=n)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return qr(i)&&i>0},i._getShownEventName=function(){return rr},i._getItems=function(e){var t;null==(t=this._instance)||t.getSurveys(e)},i._cancelPendingItem=function(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)},i._getLogger=function(){return hu},i._setActivatedItems=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[sl]=e,n))},i._setActivatedSession=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[ol]=e,n))},i._clearActivatedSession=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(ol)},i._isItemPermanentlyIneligible=function(){return!1},i._activationOutcome=function(e,t){var n;return this._getItems(function(e){n=e.find(function(e){return e.id===t})}),!n||au(n)?e===rr?"consume":"ignore":e===rr?"persist":e===sr||e===or?"consume":"ignore"},i.getSurveys=function(){return this.getActivatedIds()},i.getEventToSurveys=function(){return this.getEventToItemsMap()},t}(function(){"use strict";function e(e){var t,n=this;this._pendingActivatedItems=[],this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map,this._sessionIdUnsubscribe=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId(function(e){return n._onSessionIdChanged(e)})}var t=e.prototype;return t._shouldPersistArmedActivation=function(e){return!1},t._getActivationTimestampsKey=function(){return null},t._writeActivationTimestamps=function(e){},t._clearActivationTimestampsStore=function(){},t._doesEventMatchFilter=function(e,t){return!!e&&du(e.propertyFilters,null==t?void 0:t.properties)},t._buildEventToItemMap=function(e,t){var n=new Map;return e.forEach(function(e){var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach(function(t){if(null!=t&&t.name){var i=n.get(t.name)||[];i.push(e.id),n.set(t.name,i)}})}),n},t._getMatchingItems=function(e,t,n){var i=this,r=(n===Ni?this._eventToItems:this._cancelEventToItems).get(e),s=[];return this._getItems(function(e){s=e.filter(function(e){return null==r?void 0:r.includes(e.id)})}),s.filter(function(r){var s,o=null==(s=r.conditions)||null==(s=s[n])||null==(s=s.values)?void 0:s.find(function(t){return t.name===e});return i._doesEventMatchFilter(o,t)})},t.register=function(e){this._register(e,!1)},t.replace=function(e){this._register(e,!0)},t._register=function(e,t){var n;Ar(null==(n=this._instance)?void 0:n._addCaptureHook)||(this._setupEventBasedItems(e,t),this._setupActionBasedItems(e,t))},t._setupActionBasedItems=function(e,t){var n=this,i=e.filter(function(e){var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this._actionToItems.clear(),0!==i.length){this._actionMatcher||(this._actionMatcher=new pv(this._instance),this._actionMatcher.init(),this._actionMatcher._addActionHook(function(e){return n.onAction(e)}));var r=[];i.forEach(function(e){var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(function(t){if(r.push(t),t.name){var i,s=null!==(i=n._actionToItems.get(t.name))&&void 0!==i?i:[];s.includes(e.id)||s.push(e.id),n._actionToItems.set(t.name,s)}})}),t?this._actionMatcher.replace(r):this._actionMatcher.register(r)}else{var s;t&&(null==(s=this._actionMatcher)||s.replace([]))}},t._mergeItemMaps=function(e,t){t.forEach(function(t,n){var i,r=null!==(i=e.get(n))&&void 0!==i?i:[];t.forEach(function(e){r.includes(e)||r.push(e)}),e.set(n,r)})},t._setupEventBasedItems=function(e,t){var n,i,r=this,s=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}),o=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(n=e.conditions)||null==(n=n.cancelEvents)||null==(n=n.values)?void 0:n.length)>0}),a=this._buildEventToItemMap(e,Ni),u=this._buildEventToItemMap(e,Vi);t?(this._eventToItems=a,this._cancelEventToItems=u):(this._mergeItemMaps(this._eventToItems,a),this._mergeItemMaps(this._cancelEventToItems,u)),(0!==s.length||0!==o.length)&&(null!==(n=this._captureHookUnsubscribe)&&void 0!==n||(this._captureHookUnsubscribe=null==(i=this._instance)?void 0:i._addCaptureHook(function(e,t){r.onEvent(e,t)})))},t.onEvent=function(e,t){var n,i,r=this,s=this._getLogger(),o=(null==t||null==(n=t.properties)?void 0:n.$survey_id)||(null==t||null==(i=t.properties)?void 0:i.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){var a=this._activationOutcome(e,o);if("consume"===a)return s.info("event consumed activated item, removing it",{event:e,itemId:o}),void this._deactivateItems([o]);if("persist"===a)return s.info("shown item promoted to persisted activation",{event:e,itemId:o}),this._persistActivation(o),void this._clearActivationTimestamps([o])}if(this._cancelEventToItems.has(e)){var u=this._getMatchingItems(e,t,Vi);u.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map(function(e){return e.id})}),this._deactivateItems(u.map(function(e){return e.id})),u.forEach(function(e){return r._cancelPendingItem(e.id)}))}if(this._eventToItems.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var l=this._getMatchingItems(e,t,Ni);this._activateItems(l.map(function(e){return e.id}))}},t.onAction=function(e){this._actionToItems.has(e)&&this._activateItems(this._actionToItems.get(e)||[])},t._activateItems=function(e){var t;if(0!==e.length){for(var n,i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),r=[],s=d(e);!(n=s()).done;){var o=n.value;i&&this._shouldPersistArmedActivation(o)?this._persistActivation(o)&&this._recordActivationTimestamp(o):r.push(o)}r.length>0&&(this._pendingActivatedItems=[].concat(new Set([].concat(this._pendingActivatedItems,r)))),this._getLogger().info("updating activated items",{activatedItems:this.getActivatedIds()})}},t._persistActivation=function(e){this._pendingActivatedItems=this._pendingActivatedItems.filter(function(t){return t!==e});var t=this._getPersistedActivatedIds();return!t.includes(e)&&(this._setActivatedItems([].concat(t,[e])),this._stampActivationSession(),!0)},t._deactivateItems=function(e){var t=new Set(e);this._pendingActivatedItems=this._pendingActivatedItems.filter(function(e){return!t.has(e)});var n=this._getRawPersistedActivatedIds(),i=n.filter(function(e){return!t.has(e)});i.length!==n.length&&(this._setActivatedItems(i),0===i.length&&this._clearActivationSession()),this._clearActivationTimestamps(e)},t._getRawActivationTimestamps=function(){var e,t=this._getActivationTimestampsKey();if(!t)return{};var n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return n&&"object"==typeof n?n:{}},t._recordActivationTimestamp=function(e){var t;if(this._getActivationTimestampsKey()){var n=this._getRawActivationTimestamps();this._writeActivationTimestamps(u({},n,((t={})[e]=Date.now(),t)))}},t._clearActivationTimestamps=function(e){if(this._getActivationTimestampsKey()){for(var t=this._getRawActivationTimestamps(),n={},i=!1,r=0,s=Object.entries(t);s.length>r;r++){var o=s[r],a=o[0],u=o[1];e.includes(a)?i=!0:n[a]=u}i&&(Lr(n)?this._clearActivationTimestampsStore():this._writeActivationTimestamps(n))}},t._clearAllActivationTimestamps=function(){this._getActivationTimestampsKey()&&this._clearActivationTimestampsStore()},t.getActivationTimestamp=function(e){if(this._getPersistedActivatedIds().includes(e)){var t=this._getRawActivationTimestamps()[e];return qr(t)?t:void 0}},t._getRawPersistedActivatedIds=function(){var e,t=this._getActivatedKey();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]},t._getPersistedActivatedIds=function(){var e,t,n=this._getRawPersistedActivatedIds();if(0===n.length)return[];var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._getActivatedSessionKey()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&i===r?n:[]},t._stampActivationSession=function(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this._setActivatedSession(t)},t._clearActivationSession=function(){this._clearActivatedSession()},t._onSessionIdChanged=function(e){var t,n=this,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._getActivatedSessionKey()];if(i&&i!==e){var r=this._getRawPersistedActivatedIds(),s=this._getRawActivationTimestamps();r.length>0&&(this._setActivatedItems([]),r.filter(function(e){return qr(s[e])}).forEach(function(e){return n._cancelPendingItem(e)})),this._clearActivationSession(),this._clearAllActivationTimestamps()}},t.getActivatedIds=function(){var e=this;return[].concat(new Set([].concat(this._getPersistedActivatedIds(),this._pendingActivatedItems))).filter(function(t){return!e._isItemPermanentlyIneligible(t)})},t.dispose=function(){var e,t,n;null==(e=this._sessionIdUnsubscribe)||e.call(this),this._sessionIdUnsubscribe=void 0,null==(t=this._captureHookUnsubscribe)||t.call(this),this._captureHookUnsubscribe=void 0,null==(n=this._actionMatcher)||n.dispose(),this._actionMatcher=void 0},t.reset=function(){this._pendingActivatedItems=[],this._getRawPersistedActivatedIds().length>0&&this._setActivatedItems([]),this._clearActivationSession(),this._clearAllActivationTimestamps()},t.getEventToItemsMap=function(){return this._eventToItems},t._getActionMatcher=function(){return this._actionMatcher},e}()),vv=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.initialize=function(){},t.get=function(e){if("string"==typeof e)return this._instance.get_property(e);for(var t,n={},i=d(e);!(t=i()).done;){var r=t.value,s=this._instance.get_property(r);Ar(s)||(n[r]=s)}return n},t.set=function(e,t){var n;this._instance.register("string"==typeof e?((n={})[e]=t,n):e)},t.remove=function(e){var t=this;"string"!=typeof e?e.forEach(function(e){return t._instance.unregister(e)}):this._instance.unregister(e)},e}(),gv=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.get=function(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}},t.isOptedOut=function(){return this._instance.consent.isOptedOut()},t.getExtensions=function(){var e=this,t=null==th?void 0:th.__PosthogExtensions__;if(t){var n=t.generateSurveys,i=t.loadExternalDependency;return{generateSurveys:n?function(t){return n(e._instance,t)}:void 0,loadExternalDependency:i?function(t){return i(e._instance,"surveys",t)}:void 0}}},t.createEventReceiver=function(){return new _v(this._instance)},e}(),mv=function(e){"use strict";function t(t){var n,i=e.call(this,new gv(t),(n=t,{get projectToken(){return n.config.token},kv:new vv(n)}))||this;return i._instance=t,i}return n(t,e),t.prototype._sendSurveysRequest=function(e,t){var n=this,i=t.query?Lp(e,t.query):e;return new Promise(function(e){var r;n._instance._send_request({method:t.method,url:n._instance.requestRouter.endpointFor(null!==(r=t.target)&&void 0!==r?r:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})},t}(hv),yv=null!=Pa&&Pa.location?Wl(Pa.location.hash,"__posthog")||Wl(location.hash,"state"):null,bv="_postHogToolbarParams",wv=Ba("[Toolbar]"),Sv=function(){"use strict";function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){th.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=th.ph_toolbar_state)&&void 0!==e?e:0},t.initialize=function(){return this.maybeLoadToolbar()},t.maybeLoadToolbar=function(e,t,n){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),Za(this.instance.config))return!1;if(!Pa||!Ta)return!1;e=null!=e?e:Pa.location,n=null!=n?n:Pa.history;try{if(!t){try{Pa.localStorage.setItem("test","test"),Pa.localStorage.removeItem("test")}catch(e){return!1}t=null==Pa?void 0:Pa.localStorage}var i,r=yv||Wl(e.hash,"__posthog")||Wl(e.hash,"state"),s=r?za(function(){return JSON.parse(atob(decodeURIComponent(r)))})||za(function(){return JSON.parse(decodeURIComponent(r))}):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(bv)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}},t._callLoadToolbar=function(e){var t=th.ph_load_toolbar||th.ph_load_editor;!Dr(t)&&Ir(t)?t(e,this.instance):wv.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Ta||!Ta.getElementById("__POSTHOG_TOOLBAR__"));if(!Pa||n)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=u({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Pa.localStorage.setItem(bv,JSON.stringify(u({},r,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(r);else if(0===this._getToolbarState()){var s;this._setToolbarState(1),null==(s=th.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",function(e){if(e)return wv.error("[Toolbar] Failed to load",e),void t._setToolbarState(0);t._setToolbarState(2),t._callLoadToolbar(r)}),Qa(Pa,"turbolinks:load",function(){t._setToolbarState(0),t.loadToolbar(r)})}return!0},t._loadEditor=function(e){return this.loadToolbar(e)},t.maybeLoadEditor=function(e,t,n){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),this.maybeLoadToolbar(e,t,n)},e}(),xv=Ba("[FeatureFlags]"),kv=function(){"use strict";function e(e,t){void 0===t&&(t=!1),this._loggedEvaluationEnvironmentsDeprecation=!1,this.update(e,t)}var t=e.prototype;return t.update=function(e,t){this._snapshot=function(e,t){var n,i,r,s,o;return{bootstrap:{featureFlags:null==(n=e.bootstrap)?void 0:n.featureFlags,featureFlagPayloads:null==(i=e.bootstrap)?void 0:i.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(r=e.remote_config_refresh_interval_ms)&&void 0!==r?r:3e5,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(s=null!==(o=e.evaluation_contexts)&&void 0!==o?o:e.evaluation_environments)&&void 0!==s?s:[],flagKeys:Tr(e.flag_keys)?e.flag_keys:void 0}}(e,t),!e.evaluation_environments||e.evaluation_contexts||this._loggedEvaluationEnvironmentsDeprecation||(xv.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._loggedEvaluationEnvironmentsDeprecation=!0),Ar(e.flag_keys)||Tr(e.flag_keys)||xv.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")},t.get=function(){return this._snapshot},e}(),Cv=Ba("[FeatureFlags]"),Pv=Ba("[FeatureFlags]",{debugEnabled:!0}),Ev="\" failed. Feature flags didn't load in time.",Fv="connection_error",Tv=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},Iv=function(e){for(var t,n={},i=d(Va(e||{}));!(t=i()).done;){var r=t.value,s=r[1];s&&(n[r[0]]=s)}return n},Rv=function(){"use strict";function e(e){var t=this;this.name="featureFlags",this._override_warning=!1,this.featureFlagEventHandlers=[],this._logger=Cv,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._reloadingHandlers=[],this._hasLoadedFlags=!1,this._requestInFlight=!1,this._requestGeneration=0,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this._staleCacheRefreshTriggered=!1,this._consecutiveStatusZeroFailures=0,this._onOnline=function(){var e=t._hasStatusZeroCircuitBreakerTripped();t._consecutiveStatusZeroFailures=0,e&&t.reloadFeatureFlags()},this._refreshIfDue=function(){var e,n=t._refreshIntervalMs;Ar(n)||t._config.remoteRequestsDisabled||!Ta||"hidden"===Ta.visibilityState||Date.now()-(null!==(e=t._lastRefreshAt)&&void 0!==e?e:0)<n||(t.reloadFeatureFlags(),t._scheduleNextRefresh())},this._onVisibilityChange=function(){"visible"===(null==Ta?void 0:Ta.visibilityState)&&t._refreshIfDue()},"get"in e?this._configSource=e:(this._instance=e,this._mutableConfigSource=new kv(e.config,e._shouldDisableFlags()),this._configSource=this._mutableConfigSource)}var t=e.prototype;return t.updateConfig=function(e,t){var n;null==(n=this._mutableConfigSource)||n.update(e,t),this._client&&this._syncAutomaticRefresh()},t.setup=function(e){var t=this;return this._initializingClient=e,this._logger=e.logger.createLogger("[FeatureFlags]"),lv(e.kv.initialize(),function(){t._initializingClient===e&&(t._initializingClient=void 0,t._client=e,t._finishSetup(e))})},t._finishSetup=function(e){var t,n=this;if(this._client===e)return Pa&&Qa(Pa,"online",this._onOnline),this._syncAutomaticRefresh(),this._dynamicProperties=e.registerDynamicEventProperties(function(){return n._isCacheStale()?n._baseEventProperties:n._eventPropertiesWithFlagValues}),this._crossTabPersistenceUnsubscribe=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange(function(){n._clearBootstrapState(),n._rebuildEventProperties(),n._fireFeatureFlagsCallbacks()}),this._rebuildEventProperties(),this.initialize()},t._syncAutomaticRefresh=function(){var e=this._config.refreshIntervalMs,t=!this._config.remoteRequestsDisabled&&Ta&&!Ar(e)&&e>0?e:void 0;t!==this._refreshIntervalMs&&(this._stopAutomaticRefresh(),Ar(t)||(this._refreshIntervalMs=t,this._scheduleNextRefresh(),null!=Ta&&Ta.addEventListener&&Qa(Ta,Tl,this._onVisibilityChange)))},t._scheduleNextRefresh=function(){Ar(this._refreshIntervalMs)||(Ar(this._refreshInterval)||clearInterval(this._refreshInterval),this._lastRefreshAt=Date.now(),this._refreshInterval=setInterval(this._refreshIfDue,this._refreshIntervalMs))},t._stopAutomaticRefresh=function(){Ar(this._refreshInterval)||(clearInterval(this._refreshInterval),this._refreshInterval=void 0,null==Ta||null==Ta.removeEventListener||Ta.removeEventListener(Tl,this._onVisibilityChange)),this._refreshIntervalMs=void 0,this._lastRefreshAt=void 0},t.destroy=function(){this._dispose()},t.dispose=function(){this._dispose()},t._dispose=function(){var e,t;this._stopAutomaticRefresh(),this._requestGeneration++,this._additionalReloadRequested=!1,this._initializingClient=void 0,this._client&&(this._clearDebouncer(),null==(e=this._dynamicProperties)||e.dispose(),this._dynamicProperties=void 0,null==(t=this._crossTabPersistenceUnsubscribe)||t.call(this),this._crossTabPersistenceUnsubscribe=void 0,this._reloadingHandlers=[],null==Pa||Pa.removeEventListener("online",this._onOnline),this._client=void 0)},t._prop=function(e){var t;return this._bootstrapState&&e in this._bootstrapState?this._bootstrapState[e]:null==(t=this._client)?void 0:t.kv.get(e)},t._clearBootstrapState=function(){return!!this._bootstrapState&&(this._bootstrapState=void 0,!0)},t._fallBackToPersistedFlags=function(){var e;return!Ar(null==(e=this._client)?void 0:e.kv.get("$enabled_feature_flags"))&&this._clearBootstrapState()},t._set=function(e){var t=this;this._persist(function(){var n;return null==(n=t._client)?void 0:n.kv.set(e)})},t._markCrossTabFeatureFlagSnapshot=function(e,t,n){var i,r;if(null!=(i=this._instance)&&i.persistence&&e.$enabled_feature_flags){var s=this._prop("$enabled_feature_flags")||{},o=e.$enabled_feature_flags||{},a=t.flags||t.featureFlags,u=t.flags?Object.entries(t.flags).filter(function(e){var t=e[1];return!(null!=t&&t.failed)}).map(function(e){return e[0]}):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,c=l?u:n&&!Tr(a)?Object.keys(a||{}):Array.from(new Set([].concat(Object.keys(s),Object.keys(o)))),d=this._prop("$feature_flag_payloads")||{},h=e.$feature_flag_payloads||{},f=l||n?c:Array.from(new Set([].concat(Object.keys(d),Object.keys(h)))),p=!l&&!n,_=!!p||c,v=!!p||f,g=((r={})[Wu]=_,r[Uu]=_,r[Qu]=v,r);e.$feature_flag_details&&(g[Ku]=_);for(var m=0,y=[Zu,hl,Ju];y.length>m;m++){var b=y[m];Ar(e[b])||(g[b]=!0)}this._instance.persistence.markCrossTabFeatureFlagChanges(g)}},t._remove=function(e){var t=this;this._persist(function(){var n;return null==(n=t._client)?void 0:n.kv.remove(e)})},t._persist=function(e){try{e()}catch(e){this._logger.error("Failed to update feature flag persistence",e)}},t._rebuildEventProperties=function(){for(var e={},t=0,n=[Wu,Qu,Zu,Yu];n.length>t;t++){var i=n[t],r=this._prop(i);Ar(r)||(e[i]=r)}this._baseEventProperties=e;var s=u({},e),o=this._prop(Uu);if(o)for(var a=0,l=Object.entries(o);l.length>a;a++){var c=l[a];s["$feature/"+c[0]]=c[1]}this._eventPropertiesWithFlagValues=s},t._isCacheStale=function(){var e=this._config.cacheTtlMs;if(!e||0>=e)return!1;var t=this._prop(hl);return"number"!=typeof t||Date.now()-t>e},t._checkAndTriggerStaleRefresh=function(){return!!this._isCacheStale()&&(this._staleCacheRefreshTriggered||this._requestInFlight||(this._staleCacheRefreshTriggered=!0,this._logger.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)},t._getValidEvaluationEnvironments=function(){var e=this,t=this._config.evaluationContexts;return null!=t&&t.length?t.filter(function(t){var n=t&&"string"==typeof t&&t.trim().length>0;return n||e._logger.error("Invalid evaluation context found:",t,"Expected non-empty string"),n}):[]},t._getValidFlagKeys=function(){var e=this,t=this._config.flagKeys;if(!Ar(t))return t.filter(function(t){var n=t&&"string"==typeof t&&t.trim().length>0;return n||e._logger.error("Invalid flag key found:",t,"Expected non-empty string"),n})},t.initialize=function(){var e,t,n=this._config,i=null!==(e=null==(t=n.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var r,s,o=null!==(r=null==(s=n.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==r?r:{},a=Object.keys(i).filter(function(e){return!Ar(i[e])}).reduce(function(e,t){return e[t]=i[t],e},{}),u=Object.keys(o).filter(function(e){return a[e]}).reduce(function(e,t){return e[t]=o[t],e},{});return this._receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u},void 0,{persist:!1})}},t.updateFlags=function(e,t,n){for(var i,r,s=null!=n&&n.merge&&null!==(i=this._prop("$enabled_feature_flags"))&&void 0!==i?i:{},o=null!=n&&n.merge&&null!==(r=this._prop("$feature_flag_payloads"))&&void 0!==r?r:{},a=u({},s,e),l=u({},o,t),c={},d=0,h=Object.entries(a);h.length>d;d++){var f=h[d],p=f[0],_=f[1];c[p]={key:p,enabled:Uo(_),variant:Wo(_),reason:void 0,metadata:Ar(null==l?void 0:l[p])?void 0:{id:0,version:void 0,description:void 0,payload:l[p]}}}this._receivedFeatureFlags({flags:c})},t.getFlags=function(){return Object.keys(this.getFlagVariants())},t.getFlagsWithDetails=function(){var e=this._prop(Ku),t=this._prop(Yu),n=this._prop(Xu);if(!n&&!t)return e||{};for(var i,r=Na({},e||{}),s=d([].concat(new Set([].concat(Object.keys(n||{}),Object.keys(t||{})))));!(i=s()).done;){var o,a,l=i.value,c=r[l],h=null==t?void 0:t[l],f=Ar(h)?null!==(o=null==c?void 0:c.enabled)&&void 0!==o&&o:!!h,p=Ar(h)?null==c?void 0:c.variant:"string"==typeof h?h:void 0,_=null==n?void 0:n[l],v=u({},c,{enabled:f,variant:f?null!=p?p:null==c?void 0:c.variant:void 0});f!==(null==c?void 0:c.enabled)&&(v.original_enabled=null==c?void 0:c.enabled),p!==(null==c?void 0:c.variant)&&(v.original_variant=null==c?void 0:c.variant),_&&(v.metadata=u({},null==c?void 0:c.metadata,{payload:_,original_payload:null==c||null==(a=c.metadata)?void 0:a.payload})),r[l]=v}return this._override_warning||(this._logger.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this._override_warning=!0),r},t.getAllFeatureFlags=function(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(function(n){var i=e[n];return{key:n,enabled:Uo(i),variant:Wo(i),payload:zo(t[n])}})},t.getFlagVariants=function(){var e=this._prop(Uu),t=this._prop(Yu);if(!t)return e||{};for(var n=Na({},e||{}),i=Object.keys(t),r=0;i.length>r;r++)n[i[r]]=t[i[r]];return this._override_warning||(this._logger.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n},t.getFlagPayloads=function(){var e=this._prop(Qu),t=this._prop(Xu);if(!t)return e||{};for(var n=Na({},e||{}),i=Object.keys(t),r=0;i.length>r;r++)n[i[r]]=t[i[r]];return this._override_warning||(this._logger.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this._override_warning=!0),n},t.reloadFeatureFlags=function(){var e=this;this._reloadingDisabled||this._config.featureFlagsDisabled||this._hasStatusZeroCircuitBreakerTripped()||(this._requestInFlight&&(this._additionalReloadRequested=!0),this._reloadDebouncer||(this._reloadingHandlers.slice().forEach(function(t){try{t()}catch(t){e._logger.error("Error while running feature flags reloading callback",t)}}),this._reloadDebouncer=setTimeout(function(){e._callFlagsEndpoint()},5)))},t._clearDebouncer=function(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0},t.onReloading=function(e){var t=this;return this._reloadingHandlers.push(e),function(){t._reloadingHandlers=t._reloadingHandlers.filter(function(t){return t!==e})}},t.ensureFlagsLoaded=function(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()},t.setAnonymousDistinctId=function(e){this.$anon_distinct_id=e},t.setReloadingPaused=function(e){this._reloadingDisabled=e},t.resetFlagCallReported=function(){this._remove(ll)},t._callFlagsEndpoint=function(e){var t=this;this._clearDebouncer();var n=this._client;if(n&&!this._config.remoteRequestsDisabled&&!this._hasStatusZeroCircuitBreakerTripped())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:u({},n.initialPersonProperties,this._prop("$stored_person_properties")||{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this._prop(tl),timezone:$d()};Ar(n.deviceId)||(i.$device_id=n.deviceId),(null!=e&&e.disableFlags||this._config.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this._getValidEvaluationEnvironments();r.length&&(i.evaluation_contexts=r);var s=this._getValidFlagKeys();Ar(s)||(i.flag_keys=s);var o=this._config.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this._requestGeneration;this._requestInFlight=!0;var c=function(){t._additionalReloadRequested&&(t._additionalReloadRequested=!1,t._callFlagsEndpoint())},d=function(e){var n;t._requestInFlight=!1,l===t._requestGeneration?(t._set(((n={})[dl]=[Fv],n)),t._logger.error("Feature flag request failed",e),t._fallBackToPersistedFlags()&&t._fireFeatureFlagsCallbacks(!0),c()):c()};try{n.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this._config.compression,sentAt:"body",timeoutMs:this._config.requestTimeoutMs}).then(function(e){var n,r,s,a=null!==(n=e.json)&&void 0!==n?n:{},u=200!==e.statusCode;if(t._requestInFlight=!1,l===t._requestGeneration){if(t._trackStatusZeroReachability(e.statusCode),u||t._additionalReloadRequested||(t.$anon_distinct_id=void 0),!i.disable_flags||t._additionalReloadRequested){t._flagsLoadedFromRemote=!u;var d=[];e.error?d.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?Fv:"unknown_error"):200!==e.statusCode&&d.push("api_error_"+e.statusCode),a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var h=!(null==(r=a.quotaLimited)||!r.includes("feature_flags"));h&&d.push("quota_limited"),t._set(((s={})[dl]=d,s)),h?t._logger.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."):i.disable_flags||t._receivedFeatureFlags(a,u,{partialResponse:o}),c()}}else c()}).catch(d)}catch(e){d(e)}}},t._hasStatusZeroCircuitBreakerTripped=function(){return Gl(this._consecutiveStatusZeroFailures,3)},t._trackStatusZeroReachability=function(e){var t=this;this._consecutiveStatusZeroFailures=Kl(e,this._consecutiveStatusZeroFailures,3,function(){return t._logger.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")})},t.getFeatureFlag=function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var i=this.getFeatureFlagResult(e,t);return null!==(n=null==i?void 0:i.variant)&&void 0!==n?n:null==i?void 0:i.enabled}}else this._logger.warn('getFeatureFlag for key "'+e+Ev)},t.getFeatureFlagDetails=function(e){return this.getFlagsWithDetails()[e]},t.getFeatureFlagPayload=function(e){var t;return null==(t=this.getFeatureFlagResult(e,{send_event:!1}))?void 0:t.payload},t.getFeatureFlagResult=function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var i,r,s=this.getFlagVariants(),o=e in s,a=s[e],l=this.getFlagPayloads()[e],c=String(a),d=this._prop("$feature_flag_request_id")||void 0,h=this._prop("$feature_flag_evaluated_at")||void 0,f=this._prop("$flag_call_reported")||{};if(this._config.deduplicateCallsPerSession){var p,_=null==(p=this._client)?void 0:p.session.sessionId,v=this._prop(cl);_&&_!==v&&(f={},i=_)}if(t.send_event||!("send_event"in t))if(e in f&&f[e].includes(c))i&&this._set(((r={})[ll]=f,r[cl]=i,r));else{var g,m,y,b,w,S,x,k,C,P,E,F,T,I,R;Tr(f[e])?f[e].push(c):f[e]=[c],this._set(u(((g={})[ll]=f,g),i?((m={})[cl]=i,m):{}));var L=this.getFeatureFlagDetails(e),A=[].concat(null!==(y=this._prop("$feature_flag_errors"))&&void 0!==y?y:[]);Ar(a)&&A.push("flag_missing");var M={$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:null!=l?l:null,$feature_flag_request_id:d,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!==(b=null==(w=this._config.bootstrap)||null==(w=w.featureFlags)?void 0:w[e])&&void 0!==b?b:null,$feature_flag_bootstrapped_payload:null!==(S=null==(x=this._config.bootstrap)||null==(x=x.featureFlagPayloads)?void 0:x[e])&&void 0!==S?S:null,$used_bootstrap_value:!this._flagsLoadedFromRemote};Ar(null==L||null==(k=L.metadata)?void 0:k.has_experiment)||(M.$feature_flag_has_experiment=L.metadata.has_experiment),Ar(null==L||null==(C=L.metadata)?void 0:C.version)||(M.$feature_flag_version=L.metadata.version);var O=null!==(P=null==L||null==(E=L.reason)?void 0:E.description)&&void 0!==P?P:null==L||null==(F=L.reason)?void 0:F.code;O&&(M.$feature_flag_reason=O),null!=L&&null!=(T=L.metadata)&&T.id&&(M.$feature_flag_id=L.metadata.id),Ar(null==L?void 0:L.original_variant)&&Ar(null==L?void 0:L.original_enabled)||(M.$feature_flag_original_response=Ar(L.original_variant)?L.original_enabled:L.original_variant),null!=L&&null!=(I=L.metadata)&&I.original_payload&&(M.$feature_flag_original_payload=null==L||null==(R=L.metadata)?void 0:R.original_payload),A.length&&(M.$feature_flag_error=A.join(",")),this._captureFeatureFlagCalled(M)}else i&&this._set(((n={})[ll]=f,n[cl]=i,n));if(o)return{key:e,enabled:!!a,variant:"string"==typeof a?a:void 0,payload:zo(l)}}}else this._logger.warn('getFeatureFlagResult for key "'+e+Ev)},t._captureFeatureFlagCalled=function(e){var t=this;try{var n;null==(n=this._client)||n.capture("$feature_flag_called",e).catch(function(e){t._logger.error("Failed to capture feature flag call",e)})}catch(e){this._logger.error("Failed to capture feature flag call",e)}},t.getRemoteConfigPayload=function(e,t){this._getRemoteConfigPayload(e,t)},t._getRemoteConfigPayload=function(){var e=p(l().m(function e(t,n){var i,r,s,o,a,u,c,d,h,f;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=this._client){e.n=1;break}return e.a(2);case 1:return r={distinct_id:i.distinctId,token:i.projectToken,person_properties:{$lib:i.library.name,$lib_version:i.library.version}},(s=this._getValidEvaluationEnvironments()).length&&(r.evaluation_contexts=s),o=this._getValidFlagKeys(),Ar(o)||(r.flag_keys=o),e.p=2,e.n=3,i.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:this._config.compression,sentAt:"body",timeoutMs:this._config.requestTimeoutMs});case 3:if(h=u=e.v.json,d=null==h){e.n=4;break}d=null==(u=u.featureFlagPayloads);case 4:if(!d){e.n=5;break}f=void 0,e.n=6;break;case 5:f=u[t];case 6:if(c=f){e.n=7;break}c=void 0;case 7:a=c,e.n=9;break;case 8:return e.p=8,this._logger.error("Remote config feature flag request failed",e.v),e.a(2);case 9:try{n(a)}catch(e){this._logger.error("Remote config feature flag callback failed",e)}case 10:return e.a(2)}},e,this,[[2,8]])}));return function(t,n){return e.apply(this,arguments)}}(),t.isFeatureEnabled=function(e,t){if(void 0===t&&(t={}),t.fresh&&!this._flagsLoadedFromRemote)return t.defaultValue;if(!(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0))return this._logger.warn('isFeatureEnabled for key "'+e+Ev),t.defaultValue;var n=this.getFeatureFlag(e,t);return Ar(n)?t.defaultValue:!!n},t.addFeatureFlagsHandler=function(e){this.featureFlagEventHandlers.push(e)},t.removeFeatureFlagsHandler=function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})},t.receivedFeatureFlags=function(e,t,n){this._receivedFeatureFlags(e,t,n)},t._receivedFeatureFlags=function(e,t,n){if(this._client){this._hasLoadedFlags=!0;var i=function(e,t,n,i,r,s){var o,a,l;void 0===t&&(t={}),void 0===n&&(n={}),void 0===i&&(i={}),void 0===s&&(s=Cv);var c=function(e,t){var n=e.flags;return n?u({},e,{featureFlags:Object.fromEntries(Object.keys(n).map(function(e){var t;return[e,null!==(t=n[e].variant)&&void 0!==t?t:n[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(n).filter(function(e){return n[e].enabled}).filter(function(e){var t;return!Ar(null==(t=n[e].metadata)?void 0:t.payload)}).map(function(e){var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)}(e,s),d=c.flags,h=c.featureFlags,f=c.featureFlagPayloads;if(h){var p=e.requestId,_=e.evaluatedAt;if(Tr(h)){var v;s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var g={};if(h)for(var m=0;h.length>m;m++)g[h[m]]=!0;return(v={})[Wu]=h,v[Uu]=g,v[Ju]=!1,v}var y=h,b=f,w=d;if(null!=r&&r.partialResponse){var S=Object.keys(y),x=b||{};y=u({},t,y),b=u({},n,x),S.forEach(function(e){var t;e in x||null==(t=b)||delete t[e]}),w=u({},i,w)}else if(e.errorsWhileComputingFlags)if(d){var k=new Set(Object.keys(d).filter(function(e){var t;return!(null!=(t=d[e])&&t.failed)}));y=u({},t,Object.fromEntries(Object.entries(y).filter(function(e){return k.has(e[0])})));var C=Object.fromEntries(Object.entries(b||{}).filter(function(e){return k.has(e[0])}));b=u({},n,C),k.forEach(function(e){var t;e in C||null==(t=b)||delete t[e]}),w=u({},i,Object.fromEntries(Object.entries(w||{}).filter(function(e){return k.has(e[0])})))}else y=u({},t,y),b=u({},n,b),w=u({},i,w);return u(((o={})[Wu]=Object.keys(Iv(y)),o[Uu]=y||{},o[Qu]=b||{},o[Ku]=w||{},o[Ju]=!0===e.minimalFlagCalledEvents,o),p?((a={})[Zu]=p,a):{},_?((l={})[hl]=_,l):{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this._logger);if(i)if(!1===(null==n?void 0:n.persist)){var r=!Ar(this._client.kv.get(Uu));this._bootstrapState=i,r||this._set(i)}else this._clearBootstrapState(),this._markCrossTabFeatureFlagSnapshot(i,e,!(null==n||!n.partialResponse)),this._set(i);else t&&this._fallBackToPersistedFlags();t||(this._staleCacheRefreshTriggered=!1),this._fireFeatureFlagsCallbacks(t)}},t.override=function(e,t){void 0===t&&(t=!1),this._logger.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})},t.overrideFeatureFlags=function(e){this._overrideFeatureFlags(e)},t._overrideFeatureFlags=function(e){if(this._client){if(!1===e)return this._remove([Yu,Xu]),this._fireFeatureFlagsCallbacks(),void Pv.info("All overrides cleared");var t,n;if(Tr(e))return this._set(((t={})[Yu]=Tv(e),t)),this._fireFeatureFlagsCallbacks(),void Pv.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var i,r=e;this._override_warning=Boolean(null!==(i=r.suppressWarning)&&void 0!==i&&i);var s={},o=r.flags,a=r.payloads;return o&&(s[Yu]=Tr(o)?Tv(o):o),a&&(s[Xu]=a),Object.keys(s).length&&this._set(s),!1===o&&!1===a?this._remove([Yu,Xu]):!1===o?this._remove(Yu):!1===a&&this._remove(Xu),this._fireFeatureFlagsCallbacks(),!1===o?Pv.info("Flag overrides cleared"):o&&Pv.info("Flag overrides set",{flags:o}),void(!1===a?Pv.info("Payload overrides cleared"):a&&Pv.info("Payload overrides set",{payloads:a}))}if(e&&"object"==typeof e)return this._set(((n={})[Yu]=e,n)),this._fireFeatureFlagsCallbacks(),void Pv.info("Flag overrides set",{flags:e});this._logger.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this._logger.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")},t.onFeatureFlags=function(e){var t=this;if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,r=n.flagVariants;try{e(i,r)}catch(e){this._logger.error("Error while running feature flags callback",e)}}return function(){return t.removeFeatureFlagsHandler(e)}},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var i,r,s,o,a,l=this,c=(this._prop("$early_access_features")||[]).find(function(t){return t.flagKey===e}),d=((i={})["$feature_enrollment/"+e]=t,i),h={$feature_flag:e,$feature_enrollment:t,$set:d};c&&(h.$early_access_feature_name=c.name),n&&(h.$feature_enrollment_stage=n);var f=u({},this.getFlagVariants(),((r={})[e]=t,r));null==(s=this._instance)||null==(s=s.persistence)||s.markCrossTabFeatureFlagChanges(((o={})[Wu]=[e],o[Uu]=[e],o[el]=Object.keys(d),o)),this._set(((a={})[Wu]=Object.keys(Iv(f)),a[Uu]=f,a[el]=u({},this._prop("$stored_person_properties")||{},d),a)),this._fireFeatureFlagsCallbacks();try{var p;null==(p=this._client)||p.capture("$feature_enrollment_update",h).catch(function(e){l._logger.error("Failed to capture early access feature enrollment",e)})}catch(e){this._logger.error("Failed to capture early access feature enrollment",e)}},t.getEarlyAccessFeatures=function(e,t,n){void 0===t&&(t=!1);var i=this._prop(Gu);!i||t?this._getEarlyAccessFeatures(e,n):e(i)},t._getEarlyAccessFeatures=function(){var e=p(l().m(function e(t,n){var i,r,s,o,a;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=this._client){e.n=1;break}return e.a(2);case 1:return r=n?"&"+n.map(function(e){return"stage="+e}).join("&"):"",e.p=2,e.n=3,i.sendRequest("/api/early_access_features/?token="+i.projectToken+r,{target:"api",method:"GET",sentAt:"query"});case 3:if((a=e.v).json){e.n=4;break}return e.a(2);case 4:this._set(((o={})[Gu]=s=a.json.earlyAccessFeatures,o)),e.n=6;break;case 5:return e.p=5,this._logger.error("Early access feature request failed",e.v),e.a(2);case 6:try{t(s)}catch(e){this._logger.error("Early access feature callback failed",e)}case 7:return e.a(2)}},e,this,[[2,5]])}));return function(t,n){return e.apply(this,arguments)}}(),t._prepareFeatureFlagsForCallbacks=function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(e){return t[e]}),flagVariants:Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{})}},t._fireFeatureFlagsCallbacks=function(e){var t=this;this._rebuildEventProperties();var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,r=n.flagVariants;this.featureFlagEventHandlers.forEach(function(n){try{n(i,r,{errorsLoading:e})}catch(e){t._logger.error("Error while running feature flags callback",e)}})},t.setPersonPropertiesForFlags=function(e,t){void 0===t&&(t=!0),this._setPersonPropertiesForFlags(e,t)},t._setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var i=this._prop("$stored_person_properties")||{},r=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._set(((n={})[el]=u({},i,o,r),n)),t&&this.reloadFeatureFlags()},t.unsetPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var i=u({},this._prop("$stored_person_properties")||{});e.forEach(function(e){delete i[e]}),this._set(((n={})[el]=i,n)),t&&this.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(e){void 0===e&&(e=!0),this._remove(el),e&&this.reloadFeatureFlags()},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);for(var i=this._prop("$stored_group_properties")||{},r=u({},i),s=0,o=Object.keys(e);o.length>s;s++){var a=o[s];r[a]=u({},i[a],e[a])}this._set(((n={})[tl]=r,n)),t&&this.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,i=this._prop("$stored_group_properties")||{};this._set(((n={})[tl]=u({},i,((t={})[e]={},t)),n))}else this._remove(tl)},t.reset=function(){this._requestGeneration++,this._additionalReloadRequested=!1,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._bootstrapState=void 0,this._hasLoadedFlags=!1,this._reloadingDisabled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1,this._consecutiveStatusZeroFailures=0},o(e,[{key:"_config",get:function(){return this._configSource.get()}},{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}}])}(),Lv="Refusing to render web experiment since the viewer is a likely bot",Av={icontains:function(e,t){return t.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return-1===t.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return uu(t,e)},not_regex:function(e,t){return!uu(t,e)},exact:function(e,t){return t===e},is_not:function(e,t){return t!==e}},Mv=function(){"use strict";function e(t){var n=this;this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),n.getWebExperiments(function(t){e._logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,t.forEach(function(t){if(t.feature_flag_key){var i;n._flagToExperiments&&(e._logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=n._flagToExperiments)||i.set(t.feature_flag_key,t));var r=n._instance.getFeatureFlag(t.feature_flag_key);Mr(r)&&t.variants[r]&&n._applyTransforms(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var s in t.variants){var o=t.variants[s];e._matchesTestVariant(o,n._instance)&&n._applyTransforms(t.name,s,o.transforms)}})},t)},this._instance.onFeatureFlags(function(e){n.onFeatureFlags(e)})}var t=e.prototype;return t.initialize=function(){},t.onFeatureFlags=function(t){var n=this;if(this._is_bot())e._logInfo(Lv);else if(!this._config.disable_web_experiments){if(Dr(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e._logInfo("applying feature flags",t),t.forEach(function(e){var t;if(n._flagToExperiments&&null!=(t=n._flagToExperiments)&&t.has(e)){var i,r=n._instance.getFeatureFlag(e),s=null==(i=n._flagToExperiments)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&n._applyTransforms(s.name,r,s.variants[r].transforms)}})}},t.previewWebExperiment=function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var i=zl(null==n?void 0:n.search,"__experiment_id"),r=zl(null==n?void 0:n.search,"__experiment_variant");i&&r&&(e._logInfo("previewing web experiments "+i+" && "+r),this.getWebExperiments(function(e){t._showPreviewWebExperiment(parseInt(i),r,e)},!1,!0))}},t.loadIfEnabled=function(){this._config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()},t.getWebExperiments=function(e,t,n){if(this._config.disable_web_experiments&&!n)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._config.token),method:"GET",timestampMode:"query",callback:function(t){return e(200===t.statusCode&&t.json&&t.json.experiments||[])}})},t._showPreviewWebExperiment=function(t,n,i){var r=i.filter(function(e){return e.id===t});r&&r.length>0&&(e._logInfo("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this._applyTransforms(r[0].name,n,r[0].variants[n].transforms))},e._matchesTestVariant=function(t,n){return!Dr(t.conditions)&&e._matchUrlConditions(t,n)&&e._matchUTMConditions(t)},e._matchUrlConditions=function(t,n){var i;if(Dr(t.conditions)||Dr(null==(i=t.conditions)?void 0:i.url))return!0;var r=e.getWindowLocation();if(r){var s,o,a,u=Zl(n,r.href);return null==(s=t.conditions)||!s.url||Av[null!==(o=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==o?o:"icontains"](t.conditions.url,u)}return!1},e.getWindowLocation=function(){return null==Pa?void 0:Pa.location},e._matchUTMConditions=function(e){var t;if(Dr(e.conditions)||Dr(null==(t=e.conditions)?void 0:t.utm))return!0;var n=Fd();if(n.utm_source){var i,r,s,o,a,u,l,c,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==n.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)==n.utm_source,f=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==n.utm_medium,p=null==(l=e.conditions)||null==(l=l.utm)||!l.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==n.utm_term;return d&&f&&p&&h}return!1},e._logInfo=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];qa.info("[WebExperiments] "+e,n)},t._applyTransforms=function(t,n,i){this._is_bot()?e._logInfo(Lv):"control"!==n?i.forEach(function(i){var r;i.selector&&(e._logInfo("applying transform of variant "+n+" for experiment "+t+" ",i),null==(r=document)||null==(r=r.querySelectorAll(i.selector))||r.forEach(function(e){var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)}))}):e._logInfo("Control variants leave the page unmodified.")},t._is_bot=function(){return Fa&&this._instance?Yp(Fa,this._config.custom_blocked_useragents):void 0},o(e,[{key:"_config",get:function(){return this._instance.config}}])}(),Ov=Ba("[Conversations]"),$v="Conversations not available yet.",Dv=function(){"use strict";function e(e){this._instance=e,this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._loadFailed=!1}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){if(!this._instance.config.disable_conversations&&(this._remoteConfigSuccessful=e.ok,e.ok)){var t=e.config.conversations;Dr(t)||(jr(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}},t.reset=function(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null,this._remoteConfigSuccessful=void 0,this._loadFailed=!1},t.loadIfEnabled=function(){var e=this;if(!(this._conversationsManager||this._isInitializing||this._instance.config.disable_conversations||Za(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==th?void 0:th.__PosthogExtensions__;if(t&&!Ar(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){this._isInitializing=!0;try{var n=t.initConversations;if(n)return this._completeInitialization(n),void(this._isInitializing=!1);var i=t.loadExternalDependency;if(!i)return void this._handleLoadError(Cl);i(this._instance,"conversations",function(n){n||!t.initConversations?e._handleLoadError("Could not load conversations script",n):e._completeInitialization(t.initConversations),e._isInitializing=!1})}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}else Ov.error("Conversations enabled but missing token in remote config.")}},t._completeInitialization=function(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),this._loadFailed=!1,Ov.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else Ov.error("Cannot complete initialization: remote config is null")},t._handleLoadError=function(e,t){Ov.error(e,t),this._conversationsManager=null,this._isInitializing=!1,this._loadFailed=!0},t.show=function(){this._conversationsManager?this._conversationsManager.show():Ov.warn("Conversations not loaded yet.")},t.hide=function(){this._conversationsManager&&this._conversationsManager.hide()},t.isAvailable=function(){return!0===this._isConversationsEnabled&&!$r(this._conversationsManager)},t.getUnavailableReason=function(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Za(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this._remoteConfigSuccessful?"remote_config_failed":Ar(this._isConversationsEnabled)?this._remoteConfigSuccessful?"disabled_in_project":"remote_config_pending":this._isConversationsEnabled?Dr(this._remoteConfig)||!this._remoteConfig.token?"missing_token":null!=th&&th.__PosthogExtensions__?this._isInitializing?"initializing":this._loadFailed?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"},t.isVisible=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e},t.sendMessage=function(){var e=p(l().m(function e(t,n,i){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Ov.warn($v),e.a(2,null);case 1:return e.a(2,this._conversationsManager.sendMessage(t,n,i))}},e,this)}));return function(t,n,i){return e.apply(this,arguments)}}(),t.getMessages=function(){var e=p(l().m(function e(t,n){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Ov.warn($v),e.a(2,null);case 1:return e.a(2,this._conversationsManager.getMessages(t,n))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),t.markAsRead=function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Ov.warn($v),e.a(2,null);case 1:return e.a(2,this._conversationsManager.markAsRead(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.getTickets=function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Ov.warn($v),e.a(2,null);case 1:return e.a(2,this._conversationsManager.getTickets(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.requestRestoreLink=function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Ov.warn($v),e.a(2,null);case 1:return e.a(2,this._conversationsManager.requestRestoreLink(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.restoreFromToken=function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Ov.warn($v),e.a(2,null);case 1:return e.a(2,this._conversationsManager.restoreFromToken(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.restoreFromUrlToken=function(){var e=p(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Ov.warn($v),e.a(2,null);case 1:return e.a(2,this._conversationsManager.restoreFromUrlToken())}},e,this)}));return function(){return e.apply(this,arguments)}}(),t.getCurrentTicketId=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null},t.getWidgetSessionId=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null},t._onIdentityChanged=function(){var e;null==(e=this._conversationsManager)||e.setIdentity()},t._onIdentityCleared=function(){var e;null==(e=this._conversationsManager)||e.clearIdentity()},e}();function qv(e,t){var n,i,r,s,o,a,l,c=null!==(n=null==e?void 0:e.flushIntervalMs)&&void 0!==n?n:3e3,d=null!==(i=null==e?void 0:e.maxBufferSize)&&void 0!==i?i:100,h=null!=t&&t.consoleCapture?void 0:null!==(r=null==e?void 0:e.maxLogsPerInterval)&&void 0!==r?r:1e3,f=Ar(h)?Math.max(d,2048):Math.max(d,h),p=u({},function(){var e="",t="";try{var n=null==Fa?void 0:Fa.userAgent;if(n){var i=Js(n);e=i[0],t=i[1]}}catch(e){}return function(e,t){var n=function(e){if(e)return{}.hasOwnProperty.call(ca,e)?ca[e]:e}(e);return u({},n?{"os.name":n}:{},t?{"os.version":t}:{})}(e,t)}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!==(s=null!==(o=null==p?void 0:p["service.name"])&&void 0!==o?o:null==e?void 0:e.serviceName)&&void 0!==s?s:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==p?void 0:p["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(l=null==p?void 0:p["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:c,maxBufferSize:d,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:c,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Bv=["debug","log","warn","error","info"],jv="console",Hv="__posthogHandledLogsRequestError",Nv=function(e,t){var n=e instanceof Error?e:new Error(t);return n[Hv]=!0,n},Vv=function(e){return!!e&&"object"==typeof e&&!0===e[Hv]},zv=function(){"use strict";function e(e){var t,n=this;this._instance=e,this.name="logs",this._isLogsEnabled=!1,this._isLoaded=!1,this._isLoading=!1,this._logger=Ba("[logs]"),this._coreLogger=u({},this._logger,{error:function(){for(var e,t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];i.some(Vv)||(e=n._logger).error.apply(e,i)}}),this._queue=[],this._consoleQueue=[],this._consecutiveStatusZeroFailures=0,this._disposed=!1,this._consoleBuffer=[],this._consoleRecorderUnpatchers=[],this._isRecordingConsole=!1,this._isRecordingConsoleEntry=!1,this._onReconnect=function(){var e,t;n._disposed||(n._consecutiveStatusZeroFailures=0,null==(e=n._core)||e.onReconnect(),null==(t=n._consoleCore)||t.onReconnect())},this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),Pa&&Qa(Pa,"online",this._onReconnect)}var t=e.prototype;return t._buildCore=function(e,t,n,i){var r,s=this,o=qv(null==(r=this._instance)||null==(r=r.config)?void 0:r.logs,n);return[new ga(this._createHost(e,t),o,this._coreLogger,function(){return s._getSdkContext()},function(e){return e()},void 0,i),o]},t._getCore=function(){var e,t=this,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._core||this._resolvedFrom!==n){var i;null==(i=this._core)||i.reset(),this._resolvedFrom=n;var r=this._buildCore(function(){return t._queue},function(e){t._queue=e});this._core=r[0],this._resolvedConfig=r[1]}return this._core},t._getConsoleCore=function(){var e,t=this,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._consoleCore||this._consoleResolvedFrom!==n){var i;null==(i=this._consoleCore)||i.reset(),this._consoleResolvedFrom=n;var r=this._buildCore(function(){return t._consoleQueue},function(e){t._consoleQueue=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},jv);this._consoleCore=r[0],this._consoleResolvedConfig=r[1]}return this._consoleCore},t.setup=function(e){var t,n=this;if(!this._disposed){this._client=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),(this._isLogsEnabled||this._remoteConfigWillArrive()&&this._persistedCaptureHint())&&this._startConsoleRecorder();var i=!1,r=e.onRemoteConfig(function(e){var t;i=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),n.onRemoteConfig(e)});this._disposed?r.dispose():(this._remoteConfigSubscription=r,i||this.loadIfEnabled())}},t.dispose=function(){var e,t,n,i;this._disposed||(this._disposed=!0,this._stopConsoleRecorder(),null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,this._client=void 0,this._isLoading=!1,null==Pa||Pa.removeEventListener("online",this._onReconnect),null==(t=this._consoleLogsDispose)||t.call(this),this._consoleLogsDispose=void 0,null==(n=this._core)||n.reset(),null==(i=this._consoleCore)||i.reset())},t.onRemoteConfig=function(e){var t,n,i;if(!this._disposed){var r=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;Dr(r)?this._stopRecorderStartedByPersistedHint():(null==(n=this._instance)||null==(n=n.persistence)||n.register(((i={})[Ou]=!!r,i)),r?(this._isLogsEnabled=!0,this._isLoaded||this._startConsoleRecorder(),this.loadIfEnabled()):this._stopRecorderStartedByPersistedHint())}},t.reset=function(){var e,t,n,i;this._stopConsoleRecorder(),null==(e=this._core)||e.clearQueue(),this._queue=[],null==(t=this._core)||t.reset(),null==(n=this._consoleCore)||n.clearQueue(),this._consoleQueue=[],null==(i=this._consoleCore)||i.reset(),this._consecutiveStatusZeroFailures=0},t.captureLog=function(e){this._disposed||this._getCore().captureLog(e)},t.captureConsoleLog=function(e){this._disposed||this._getConsoleCore().captureLog(e)},t.captureBufferedConsoleLog=function(e,t,n){this._disposed||this._getConsoleCore().captureLog(e,{context:t,occurredAtMs:n})},t._persistedCaptureHint=function(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[Ou])},t._remoteConfigWillArrive=function(){var e,t;return null==(e=this._instance)||null==e._shouldDisableFlags||!e._shouldDisableFlags()||!(null==(t=th._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)},t._onOptOut=function(){var e;this._stopConsoleRecorder(),null==(e=this._consoleCore)||e.clearQueue(),this._consoleQueue=[]},t._stopRecorderStartedByPersistedHint=function(){this._isLogsEnabled||this._stopConsoleRecorder()},t._startConsoleRecorder=function(){var e,t=this;if(!this._isRecordingConsole&&null!=th&&th.console){for(var n=qv(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,i=function(){var e,i=s[r];try{e=function(e){for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e}(th.console[i])}catch(e){return 0}if(!e)return 0;t._consoleRecorderUnpatchers.push(Sh(th.console,i,function(r){var s=function(){for(var e=arguments.length,s=new Array(e),o=0;e>o;o++)s[o]=arguments[o];try{t._recordConsoleEntry(i,s,n)}catch(e){}return r.apply(th.console,s)};return s.__rrweb_original__=e,s}))},r=0,s=Bv;s.length>r;r++)i();this._isRecordingConsole=!0,this._consoleRecorderTimeout=setTimeout(function(){t._stopConsoleRecorder()},3e4)}},t._recordConsoleEntry=function(e,t,n){var i;if(this._isRecordingConsole&&!this._isRecordingConsoleEntry&&0!==t.length)if(null!=(i=this._instance)&&i.is_capturing()){if(n>this._consoleBuffer.length){this._isRecordingConsoleEntry=!0;try{this._consoleBuffer.push({level:e,args:t,occurredAtMs:Date.now(),context:this._getSdkContext()})}finally{this._isRecordingConsoleEntry=!1}}}else this._stopConsoleRecorder()},t._stopConsoleRecorder=function(){if(this._consoleBuffer=[],this._isRecordingConsole){this._isRecordingConsole=!1,this._consoleRecorderTimeout&&(clearTimeout(this._consoleRecorderTimeout),this._consoleRecorderTimeout=void 0);for(var e,t=d(this._consoleRecorderUnpatchers);!(e=t()).done;)(0,e.value)();this._consoleRecorderUnpatchers=[]}},t._takeConsoleBuffer=function(){var e=this._consoleBuffer;return this._stopConsoleRecorder(),e},t.flushLogs=function(e){var t=this;e?this._flushViaTransport(e):(this._core&&this._core.flush().catch(function(e){return t._logFlushError(e)}),this._consoleCore&&this._consoleCore.flush().catch(function(e){return t._logFlushError(e)}))},t._logFlushError=function(e){Vv(e)||this._logger.error("PostHog logs flush failed:",e)},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._isLogsEnabled&&!this._isLoaded&&!this._isLoading){var t=null==th?void 0:th.__PosthogExtensions__;if(!t)return this._logger.error("PostHog Extensions not found."),void this._stopConsoleRecorder();var n=t.loadExternalDependency;if(!n)return this._logger.error(Cl),void this._stopConsoleRecorder();this._isLoading=!0;try{n(this._instance,"logs",function(n){if(e._isLoading=!1,!e._disposed&&e._isLogsEnabled){var i=t.logs;if(n||null==i||!i.initializeLogs)e._logger.error("Could not load logs script",n),e._stopConsoleRecorder();else{var r,s,o=e._takeConsoleBuffer();e._consoleLogsDispose=i.initializeLogs(null!==(r=e._client)&&void 0!==r?r:e._instance),e._isLoaded=!0,o.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(s=e._client)&&void 0!==s?s:e._instance,o))}}})}catch(e){throw this._isLoading=!1,e}}},t._createHost=function(e,t){var n=this,i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:function(t){return t===br.LogsQueue?e():void 0},setPersistedProperty:function(e,n){e===br.LogsQueue&&t(null!=n?n:[])},_sendLogsBatch:function(e){return n._sendLogsBatch(e)},getLibraryId:function(){return Mh.LIB_NAME},getLibraryVersion:function(){return Mh.LIB_VERSION}}},t._sendLogsBatch=function(e){var t=this;return new Promise(function(n){if(Gl(t._consecutiveStatusZeroFailures,3))n({kind:"fatal",error:Nv(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=function(e){i||(i=!0,clearTimeout(s),n(e))},s=setTimeout(function(){t._logger.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Nv(void 0,"logs request timed out")})},9e4);t._instance._send_request({method:"POST",url:t._logsUrl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:function(e){var n=e.statusCode;if(t._trackEndpointReachability(n),n>=200&&300>n)r({kind:"ok"});else if(413===n)r({kind:"too-large"});else if(0!==n&&408!==n&&429!==n&&500>n)r({kind:"fatal",error:new Error("logs request failed with status "+n)});else{var i;0===n?(e.error||t._logger.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Nv(e.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=e.error)&&void 0!==i?i:new Error("logs request failed with status "+n)})}}})}})},t._trackEndpointReachability=function(e){var t=this;(0!==e||this._instance.__loaded)&&(this._consecutiveStatusZeroFailures=Kl(e,this._consecutiveStatusZeroFailures,3,function(){return t._logger.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")}))},t._flushViaTransport=function(e){var t=this;this._queue.length>0&&this._drainQueueViaTransport(e,this._queue,this._resolvedConfig,Mh.LIB_NAME,function(e){t._queue=e}),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,jv,function(e){t._consoleQueue=e})},t._drainQueueViaTransport=function(e,t,n,i,r){if(0!==t.length){var s=t.map(function(e){return e.record});r([]);var o=va(s,_a(n,Mh.LIB_NAME,Mh.LIB_VERSION),i,Mh.LIB_VERSION);this._instance._send_request({method:"POST",url:this._logsUrl(),data:o,compression:"best-available",batchKey:"logs",transport:e})}},t._logsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)},t._getSdkContext=function(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=n.windowId,r=n.sessionStartTimestamp,s=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=i,Dr(r)||(t.sessionStartTimestamp=r),Dr(s)||(t.lastActivityTimestamp=s)}if(null!=th&&null!=(e=th.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?lo(th.location.href):th.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t},o(e,[{key:"logger",get:function(){var e=this;return this._capture_logger||(this._capture_logger={trace:function(t,n){return e.captureLog({body:t,level:"trace",attributes:n})},debug:function(t,n){return e.captureLog({body:t,level:"debug",attributes:n})},info:function(t,n){return e.captureLog({body:t,level:"info",attributes:n})},warn:function(t,n){return e.captureLog({body:t,level:"warn",attributes:n})},error:function(t,n){return e.captureLog({body:t,level:"error",attributes:n})},fatal:function(t,n){return e.captureLog({body:t,level:"fatal",attributes:n})}}),this._capture_logger}}])}(),Uv=function(){"use strict";function e(e){this._instance=e,this._logger=Ba("[metrics]")}var t=e.prototype;return t.initialize=function(){},t._getCore=function(){var e,t,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this._core&&this._resolvedFrom===n||(null==(t=this._core)||t.reset(),this._resolvedFrom=n,this._core=new wa(this._createHost(),function(e){var t,n,i,r,s,o=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==o?void 0:o["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(n=null==o?void 0:o["service.version"])&&void 0!==n?n:null==e?void 0:e.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==e?void 0:e.environment,resourceAttributes:o,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:1e4,maxSeriesPerFlush:null!==(s=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(n),this._logger)),this._core},t.count=function(e,t,n){void 0===t&&(t=1),this._getCore().count(e,t,n)},t.gauge=function(e,t,n){this._getCore().gauge(e,t,n)},t.histogram=function(e,t,n){this._getCore().histogram(e,t,n)},t.flush=function(e){var t=this;if(!this._core)return Promise.resolve();if(e){var n=this._core.drainWindow();return n&&this._sendMetricsBatch(n,e),Promise.resolve()}return this._core.flush().catch(function(e){return t._logger.error("PostHog metrics flush failed:",e)})},t.reset=function(){var e;null==(e=this._core)||e.reset()},t._createHost=function(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},_sendMetricsBatch:function(e){return t._sendMetricsBatch(e)},getLibraryId:function(){return Mh.LIB_NAME},getLibraryVersion:function(){return Mh.LIB_VERSION}}},t._sendMetricsBatch=function(e,t){var n=this;return new Promise(function(i){var r=!1,s=function(e){r||(r=!0,clearTimeout(o),i(e))},o=setTimeout(function(){return s({kind:"retry-later",error:new Error("metrics request timed out")})},9e4);n._instance._send_request(u({method:"POST",url:n._metricsUrl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback:function(e){var t,n=e.statusCode;s(n>=200&&300>n?{kind:"ok"}:413===n?{kind:"too-large"}:0!==n&&408!==n&&429!==n&&500>n?{kind:"fatal",error:new Error("metrics request failed with status "+n)}:{kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:new Error("metrics request failed with status "+n)})}}))})},t._metricsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)},e}(),Wv={featureFlags:Rv},Gv={sessionRecording:X_},Kv={autocapture:q_,historyAutocapture:H_,heatmaps:nv,deadClicksAutocapture:xf,webVitalsAutocapture:Q_},Qv={exceptionObserver:j_,exceptions:uh},Zv=u({productTours:sv},Wv),Jv={siteApps:uv},Yv={tracingHeaders:V_},Xv=u({surveys:mv},Wv),eg={toolbar:Sv},tg=u({experiments:Mv},Wv),ng=u({},Wv,Gv,Kv,Qv,Zv,Jv,Xv,Yv,eg,tg,{conversations:Dv},{logs:zv},{metrics:Uv});if(T_.__defaultExtensionClasses=u({},ng),function(){Mh.SDK_DIST_CHANNEL="cdn";var e=th.posthog;if(!e||Tr(e._i)){var t=h_[S_]=new T_;if(e){var n=[];Ha(e._i,function(i){if(i&&Tr(i)){var r=t.init(i[0],i[1],i[2]),s=e[i[2]]||e;r.__loaded&&-1===n.indexOf(s)&&(n.push(s),r._execute_array.call(r.people,s.people),r._execute_array(s))}})}t.__SV=1,th.posthog=t,function(){function e(){e.done||(e.done=!0,x_=!1,Ha(h_,function(e){e._dom_loaded()}))}null!=Ta&&Ta.addEventListener?"complete"===Ta.readyState?e():Qa(Ta,"DOMContentLoaded",e,{capture:!1}):Pa&&qa.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}(),"undefined"==typeof performance||"function"!=typeof performance.now){var ig="undefined"!=typeof performance?performance:{};ig.now=ig.now||function(){return Date.now()},"undefined"==typeof performance&&(window.performance=ig)}}()}();
1
+ !function(){var e=["retriesPerformedSoFar"],t=["$set_once","$set"];function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function r(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function s(e,t){for(var n=0;t.length>n;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function o(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},u.apply(null,arguments)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function s(n,i,r,s){var u=Object.create((i&&i.prototype instanceof a?i:a).prototype);return c(u,"_invoke",function(n,i,r){var s,a,u,l=0,c=r||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return s=t,a=0,u=e,h.n=n,o}};function f(n,i){for(a=n,u=i,t=0;!d&&l&&!r&&c.length>t;t++){var r,s=c[t],f=h.p,p=s[2];n>3?(r=p===i)&&(u=s[(a=s[4])?5:(a=3,3)],s[4]=s[5]=e):f>=s[0]&&((r=2>n&&s[1]>f)?(a=0,h.v=i,h.n=s[1]):p>f&&(r=3>n||s[0]>i||i>p)&&(s[4]=n,s[5]=i,h.n=p,a=0))}if(r||n>1)return o;throw d=!0,i}return function(r,c,p){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,p),a=c,u=p;(t=2>a?e:u)||!d;){s||(a?3>a?(a>1&&(h.n=-1),f(a,u)):h.n=u:h.v=u);try{if(l=2,s){if(a||(r="next"),t=s[r]){if(!(t=t.call(s,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,2>a&&(a=0)}else 1===a&&(t=s.return)&&t.call(s),2>a&&(u=TypeError("The iterator does not provide a '"+r+"' method"),a=1);s=e}else if((t=(d=0>h.n)?u:n.call(i,h))!==o)break}catch(t){s=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,r,s),!0),u}var o={};function a(){}function u(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(c(t={},i,function(){return this}),t),f=d.prototype=a.prototype=Object.create(h);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,r,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,c(f,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,r,"GeneratorFunction"),c(f),c(f,r,"Generator"),c(f,i,function(){return this}),c(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:s,m:p}})()}function c(e,t,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}c=function(e,t,n,i){function s(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},c(e,t,n,i)}function d(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return e.length>i?{done:!1,value:e[i++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);t>n;n++)i[n]=e[n];return i}function f(e,t,n,i,r,s,o){try{var a=e[s](o),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var s=e.apply(t,n);function o(e){f(s,i,r,o,a,"next",e)}function a(e){f(s,i,r,o,a,"throw",e)}o(void 0)})}}!function(i,s,a){var c,h,f,_,v,g,m,y,b,w,S,x,k,C,P,E=function(e,t){return function(){return t||(e((t={exports:{}}).exports,t),e=null),t.exports}},F=E(function(e,t){var n=function(e){return e&&e.Math===Math&&e};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}),T=E(function(e,t){t.exports=function(e){try{return!!e()}catch(e){return!0}}}),I=E(function(e,t){t.exports=!T()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),R=E(function(e,t){t.exports=!T()(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}),L=E(function(e,t){var n=R(),i=function(){}.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}}),A=E(function(e){var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!t.call({1:2},1)?function(e){var t=n(this,e);return!!t&&t.enumerable}:t}),O=E(function(e,t){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}}),M=E(function(e,t){var n=R(),i=Function.prototype,r=i.call,s=n&&i.bind.bind(r,r);t.exports=n?s:function(e){return function(){return r.apply(e,arguments)}}}),D=E(function(e,t){var n=M(),i=n({}.toString),r=n("".slice);t.exports=function(e){return r(i(e),8,-1)}}),q=E(function(e,t){var n=M(),i=T(),r=D(),s=Object,o=n("".split);t.exports=i(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===r(e)?o(e,""):s(e)}:s}),B=E(function(e,t){t.exports=function(e){return null==e}}),N=E(function(e,t){var n=B(),i=TypeError;t.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}}),j=E(function(e,t){var n=q(),i=N();t.exports=function(e){return n(i(e))}}),H=E(function(e,t){var n="object"==typeof document&&document.all;t.exports=void 0===n&&void 0!==n?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}}),V=E(function(e,t){var n=H();t.exports=function(e){return"object"==typeof e?null!==e:n(e)}}),z=E(function(e,t){var n=F(),i=H();t.exports=function(e,t){return 2>arguments.length?i(r=n[e])?r:void 0:n[e]&&n[e][t];var r}}),U=E(function(e,t){t.exports=M()({}.isPrototypeOf)}),W=E(function(e,t){var n=F().navigator,i=n&&n.userAgent;t.exports=i?String(i):""}),G=E(function(e,t){var n,i,r=F(),s=W(),o=r.process,a=r.Deno,u=o&&o.versions||a&&a.version,l=u&&u.v8;l&&(i=(n=l.split("."))[0]>0&&4>n[0]?1:+(n[0]+n[1])),!i&&s&&((n=s.match(/Edge\/(\d+)/))&&74>n[1]||(n=s.match(/Chrome\/(\d+)/))&&(i=+n[1])),t.exports=i}),K=E(function(e,t){var n=G(),i=T(),r=F().String;t.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol("symbol detection");return!r(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&41>n})}),Q=E(function(e,t){t.exports=K()&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}),Z=E(function(e,t){var n=z(),i=H(),r=U(),s=Q(),o=Object;t.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&r(t.prototype,o(e))}}),J=E(function(e,t){var n=String;t.exports=function(e){try{return n(e)}catch(e){return"Object"}}}),Y=E(function(e,t){var n=H(),i=J(),r=TypeError;t.exports=function(e){if(n(e))return e;throw new r(i(e)+" is not a function")}}),X=E(function(e,t){var n=Y(),i=B();t.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}}),ee=E(function(e,t){var n=L(),i=H(),r=V(),s=TypeError;t.exports=function(e,t){var o,a;if("string"===t&&i(o=e.toString)&&!r(a=n(o,e)))return a;if(i(o=e.valueOf)&&!r(a=n(o,e)))return a;if("string"!==t&&i(o=e.toString)&&!r(a=n(o,e)))return a;throw new s("Can't convert object to primitive value")}}),te=E(function(e,t){t.exports=!1}),ne=E(function(e,t){var n=F(),i=Object.defineProperty;t.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}}),ie=E(function(e,t){var n=te(),i=F(),r=ne(),s="__core-js_shared__",o=t.exports=i[s]||r(s,{});(o.versions||(o.versions=[])).push({version:"3.49.0",mode:n?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),re=E(function(e,t){var n=ie();t.exports=function(e,t){return n[e]||(n[e]=t||{})}}),se=E(function(e,t){var n=N(),i=Object;t.exports=function(e){return i(n(e))}}),oe=E(function(e,t){var n=M(),i=se(),r=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return r(i(e),t)}}),ae=E(function(e,t){var n=M(),i=0,r=Math.random(),s=n(1.1.toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++i+r,36)}}),ue=E(function(e,t){var n=F(),i=re(),r=oe(),s=ae(),o=K(),a=Q(),u=n.Symbol,l=i("wks"),c=a?u.for||u:u&&u.withoutSetter||s;t.exports=function(e){return r(l,e)||(l[e]=o&&r(u,e)?u[e]:c("Symbol."+e)),l[e]}}),le=E(function(e,t){var n=L(),i=V(),r=Z(),s=X(),o=ee(),a=ue(),u=TypeError,l=a("toPrimitive");t.exports=function(e,t){if(!i(e)||r(e))return e;var a,c=s(e,l);if(c){if(void 0===t&&(t="default"),a=n(c,e,t),!i(a)||r(a))return a;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}}),ce=E(function(e,t){var n=le(),i=Z();t.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}}),de=E(function(e,t){var n=F(),i=V(),r=n.document,s=i(r)&&i(r.createElement);t.exports=function(e){return s?r.createElement(e):{}}}),he=E(function(e,t){var n=I(),i=T(),r=de();t.exports=!n&&!i(function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})}),fe=E(function(e){var t=I(),n=L(),i=A(),r=O(),s=j(),o=ce(),a=oe(),u=he(),l=Object.getOwnPropertyDescriptor;e.f=t?l:function(e,t){if(e=s(e),t=o(t),u)try{return l(e,t)}catch(e){}if(a(e,t))return r(!n(i.f,e,t),e[t])}}),pe=E(function(e,t){var n=I(),i=T();t.exports=n&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),_e=E(function(e,t){var n=V(),i=String,r=TypeError;t.exports=function(e){if(n(e))return e;throw new r(i(e)+" is not an object")}}),ve=E(function(e){var t=I(),n=he(),i=pe(),r=_e(),s=ce(),o=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l="enumerable",c="configurable",d="writable";e.f=t?i?function(e,t,n){if(r(e),t=s(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var i=u(e,t);i&&i[d]&&(e[t]=n.value,n={configurable:c in n?n[c]:i[c],enumerable:l in n?n[l]:i[l],writable:!1})}return a(e,t,n)}:a:function(e,t,i){if(r(e),t=s(t),r(i),n)try{return a(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new o("Accessors not supported");return"value"in i&&(e[t]=i.value),e}}),ge=E(function(e,t){var n=I(),i=ve(),r=O();t.exports=n?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}}),me=E(function(e,t){var n=I(),i=oe(),r=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,o=i(r,"name");t.exports={EXISTS:o,PROPER:o&&"something"===function(){}.name,CONFIGURABLE:o&&(!n||n&&s(r,"name").configurable)}}),ye=E(function(e,t){var n=M(),i=H(),r=ie(),s=n(Function.toString);i(r.inspectSource)||(r.inspectSource=function(e){return s(e)}),t.exports=r.inspectSource}),be=E(function(e,t){var n=F(),i=H(),r=n.WeakMap;t.exports=i(r)&&/native code/.test(String(r))}),we=E(function(e,t){var n=re(),i=ae(),r=n("keys");t.exports=function(e){return r[e]||(r[e]=i(e))}}),Se=E(function(e,t){t.exports={}}),xe=E(function(e,t){var n,i,r,s=be(),o=F(),a=V(),u=ge(),l=oe(),c=ie(),d=we(),h=Se(),f="Object already initialized",p=o.TypeError;if(s||c.state){var _=c.state||(c.state=new(0,o.WeakMap));_.get=_.get,_.has=_.has,_.set=_.set,n=function(e,t){if(_.has(e))throw new p(f);return t.facade=e,_.set(e,t),t},i=function(e){return _.get(e)||{}},r=function(e){return _.has(e)}}else{var v=d("state");h[v]=!0,n=function(e,t){if(l(e,v))throw new p(f);return t.facade=e,u(e,v,t),t},i=function(e){return l(e,v)?e[v]:{}},r=function(e){return l(e,v)}}t.exports={set:n,get:i,has:r,enforce:function(e){return r(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var n;if(!a(t)||(n=i(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}),ke=E(function(e,t){var n=M(),i=T(),r=H(),s=oe(),o=I(),a=me().CONFIGURABLE,u=ye(),l=xe(),c=l.enforce,d=l.get,h=String,f=Object.defineProperty,p=n("".slice),_=n("".replace),v=n([].join),g=o&&!i(function(){return 8!==f(function(){},"length",{value:8}).length}),m=String(String).split("String"),y=t.exports=function(e,t,n){"Symbol("===p(h(t),0,7)&&(t="["+_(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!s(e,"name")||a&&e.name!==t)&&(o?f(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&s(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&s(n,"constructor")&&n.constructor?o&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=c(e);return s(i,"source")||(i.source=v(m,"string"==typeof t?t:"")),e};Function.prototype.toString=y(function(){return r(this)&&d(this).source||u(this)},"toString")}),Ce=E(function(e,t){var n=H(),i=ve(),r=ke(),s=ne();t.exports=function(e,t,o,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:t;if(n(o)&&r(o,l,a),a.global)u?e[t]=o:s(t,o);else{try{a.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=o:i.f(e,t,{value:o,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}}),Pe=E(function(e,t){var n=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?i:n)(t)}}),Ee=E(function(e,t){var n=Pe();t.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}}),Fe=E(function(e,t){var n=Ee(),i=Math.max,r=Math.min;t.exports=function(e,t){var s=n(e);return 0>s?i(s+t,0):r(s,t)}}),Te=E(function(e,t){var n=Ee(),i=Math.min;t.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}}),Ie=E(function(e,t){var n=Te();t.exports=function(e){return n(e.length)}}),Re=E(function(e,t){var n=j(),i=Fe(),r=Ie(),s=function(e){return function(t,s,o){var a=n(t),u=r(a);if(0===u)return!e&&-1;var l,c=i(o,u);if(e&&s!=s){for(;u>c;)if((l=a[c++])!=l)return!0}else for(;u>c;c++)if((e||c in a)&&a[c]===s)return e||c||0;return!e&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}}),Le=E(function(e,t){var n=M(),i=oe(),r=j(),s=Re().indexOf,o=Se(),a=n([].push);t.exports=function(e,t){var n,u=r(e),l=0,c=[];for(n in u)!i(o,n)&&i(u,n)&&a(c,n);for(;t.length>l;)i(u,n=t[l++])&&(~s(c,n)||a(c,n));return c}}),Ae=E(function(e,t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),Oe=E(function(e){var t=Le(),n=Ae().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}}),Me=E(function(e){e.f=Object.getOwnPropertySymbols}),$e=E(function(e,t){var n=z(),i=M(),r=Oe(),s=Me(),o=_e(),a=i([].concat);t.exports=n("Reflect","ownKeys")||function(e){var t=r.f(o(e)),n=s.f;return n?a(t,n(e)):t}}),De=E(function(e,t){var n=oe(),i=$e(),r=fe(),s=ve();t.exports=function(e,t,o){for(var a=i(t),u=s.f,l=r.f,c=0;a.length>c;c++){var d=a[c];n(e,d)||o&&n(o,d)||u(e,d,l(t,d))}}}),qe=E(function(e,t){var n=T(),i=H(),r=/#|\.prototype\./,s=function(e,t){var r=a[o(e)];return r===l||r!==u&&(i(t)?n(t):!!t)},o=s.normalize=function(e){return String(e).replace(r,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s}),Be=E(function(e,t){var n=F(),i=fe().f,r=ge(),s=Ce(),o=ne(),a=De(),u=qe();t.exports=function(e,t){var l,c,d,h,f,p=e.target,_=e.global,v=e.stat;if(l=_?n:v?n[p]||o(p,{}):n[p]&&n[p].prototype)for(c in t){if(h=t[c],d=e.dontCallGetSet?(f=i(l,c))&&f.value:l[c],!u(_?c:p+(v?".":"#")+c,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;a(h,d)}(e.sham||d&&d.sham)&&r(h,"sham",!0),s(l,c,h,e)}}}),Ne=E(function(e,t){t.exports=!T()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),je=E(function(e,t){var n=oe(),i=H(),r=se(),s=we(),o=Ne(),a=s("IE_PROTO"),u=Object,l=u.prototype;t.exports=o?u.getPrototypeOf:function(e){var t=r(e);if(n(t,a))return t[a];var s=t.constructor;return i(s)&&t instanceof s?s.prototype:t instanceof u?l:null}}),He=E(function(e,t){var n=Le(),i=Ae();t.exports=Object.keys||function(e){return n(e,i)}}),Ve=E(function(e,t){var n=I(),i=T(),r=M(),s=je(),o=He(),a=j(),u=r(A().f),l=r([].push),c=n&&i(function(){var e=Object.create(null);return e[2]=2,!u(e,2)}),d=function(e){return function(t){for(var i,r=a(t),d=o(r),h=c&&null===s(r),f=d.length,p=0,_=[];f>p;)i=d[p++],n&&!(h?i in r:u(r,i))||l(_,e?[i,r[i]]:r[i]);return _}};t.exports={entries:d(!0),values:d(!1)}}),ze=E(function(){var $=Be(),e=Ve().entries;$({target:"Object",stat:!0},{entries:function(t){return e(t)}})}),Ue=E(function(e,t){t.exports=F()}),We=E(function(e,t){ze(),t.exports=Ue().Object.entries}),Ge=E(function(e,t){t.exports=We()}),Ke=E(function(e,t){t.exports=Ge()}),Qe=E(function(e,t){t.exports=Ke()}),Ze=E(function(e,t){t.exports=Qe()}),Je=E(function(e){var t=I(),n=pe(),i=ve(),r=_e(),s=j(),o=He();e.f=t&&!n?Object.defineProperties:function(e,t){r(e);for(var n,a=s(t),u=o(t),l=u.length,c=0;l>c;)i.f(e,n=u[c++],a[n]);return e}}),Ye=E(function(e,t){t.exports=z()("document","documentElement")}),Xe=E(function(e,t){var n,i=_e(),r=Je(),s=Ae(),o=Se(),a=Ye(),u=de(),l=we(),c="prototype",d="script",h=l("IE_PROTO"),f=function(){},p=function(e){return"<"+d+">"+e+"</"+d+">"},_=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;v="undefined"!=typeof document?document.domain&&n?_(n):(t=u("iframe"),i="java"+d+":",t.style.display="none",a.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):_(n);for(var r=s.length;r--;)delete v[c][s[r]];return v()};o[h]=!0,t.exports=Object.create||function(e,t){var n;return null!==e?(f[c]=i(e),n=new f,f[c]=null,n[h]=e):n=v(),void 0===t?n:r.f(n,t)}}),et=E(function(e,t){var n=ue(),i=Xe(),r=ve().f,s=n("unscopables"),o=Array.prototype;void 0===o[s]&&r(o,s,{configurable:!0,value:i(null)}),t.exports=function(e){o[s][e]=!0}}),tt=E(function(e,t){t.exports={}}),nt=E(function(e,t){var n,i,r,s=T(),o=H(),a=V(),u=Xe(),l=je(),c=Ce(),d=ue(),h=te(),f=d("iterator"),p=!1;[].keys&&("next"in(r=[].keys())?(i=l(l(r)))!==Object.prototype&&(n=i):p=!0),!a(n)||s(function(){var e={};return n[f].call(e)!==e})?n={}:h&&(n=u(n)),o(n[f])||c(n,f,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}}),it=E(function(e,t){var n=ve().f,i=oe(),r=ue()("toStringTag");t.exports=function(e,t,s){e&&!s&&(e=e.prototype),e&&!i(e,r)&&n(e,r,{configurable:!0,value:t})}}),rt=E(function(e,t){var n=nt().IteratorPrototype,i=Xe(),r=O(),s=it(),o=tt(),a=function(){return this};t.exports=function(e,t,u,l){var c=t+" Iterator";return e.prototype=i(n,{next:r(+!l,u)}),s(e,c,!1,!0),o[c]=a,e}}),st=E(function(e,t){var n=M(),i=Y();t.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}}),ot=E(function(e,t){var n=V();t.exports=function(e){return n(e)||null===e}}),at=E(function(e,t){var n=ot(),i=String,r=TypeError;t.exports=function(e){if(n(e))return e;throw new r("Can't set "+i(e)+" as a prototype")}}),ut=E(function(e,t){var n=st(),i=V(),r=N(),s=at();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,o={};try{(e=n(Object.prototype,"__proto__","set"))(o,[]),t=o instanceof Array}catch(e){}return function(n,o){return r(n),s(o),i(n)?(t?e(n,o):n.__proto__=o,n):n}}():void 0)}),lt=E(function(e,t){var $=Be(),n=L(),i=te(),r=me(),s=H(),o=rt(),a=je(),u=ut(),l=it(),c=ge(),d=Ce(),h=ue(),f=tt(),p=nt(),_=r.PROPER,v=r.CONFIGURABLE,g=p.IteratorPrototype,m=p.BUGGY_SAFARI_ITERATORS,y=h("iterator"),b="keys",w="values",S="entries",x=function(){return this};t.exports=function(e,t,r,h,p,k,C){o(r,t,h);var P,E,F,T=function(e){if(e===p&&O)return O;if(!m&&e&&e in L)return L[e];switch(e){case b:case w:case S:return function(){return new r(this,e)}}return function(){return new r(this)}},I=t+" Iterator",R=!1,L=e.prototype,A=L[y]||L["@@iterator"]||p&&L[p],O=!m&&A||T(p),M="Array"===t&&L.entries||A;if(M&&(P=a(M.call(new e)))!==Object.prototype&&P.next&&(i||a(P)===g||(u?u(P,g):s(P[y])||d(P,y,x)),l(P,I,!0,!0),i&&(f[I]=x)),_&&p===w&&A&&A.name!==w&&(!i&&v?c(L,"name",w):(R=!0,O=function(){return n(A,this)})),p)if(E={values:T(w),keys:k?O:T(b),entries:T(S)},C)for(F in E)(m||R||!(F in L))&&d(L,F,E[F]);else $({target:t,proto:!0,forced:m||R},E);return i&&!C||L[y]===O||d(L,y,O,{name:p}),f[t]=O,E}}),ct=E(function(e,t){t.exports=function(e,t){return{value:e,done:t}}}),dt=E(function(e,t){var n=j(),i=et(),r=tt(),s=xe(),o=ve().f,a=lt(),u=ct(),l=te(),c=I(),d="Array Iterator",h=s.set,f=s.getterFor(d);t.exports=a(Array,"Array",function(e,t){h(this,{type:d,target:n(e),index:0,kind:t})},function(){var e=f(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,u(void 0,!0);switch(e.kind){case"keys":return u(n,!1);case"values":return u(t[n],!1)}return u([n,t[n]],!1)},"values");var p=r.Arguments=r.Array;if(i("keys"),i("values"),i("entries"),!l&&c&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(e){}}),ht=E(function(e,t){var n=D(),i=M();t.exports=function(e){if("Function"===n(e))return i(e)}}),ft=E(function(e,t){var n=ht(),i=Y(),r=R(),s=n(n.bind);t.exports=function(e,t){return i(e),void 0===t?e:r?s(e,t):function(){return e.apply(t,arguments)}}}),pt=E(function(e,t){var n=ue(),i=tt(),r=n("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(i.Array===e||s[r]===e)}}),_t=E(function(e,t){var n={};n[ue()("toStringTag")]="z",t.exports="[object z]"===String(n)}),vt=E(function(e,t){var n=_t(),i=H(),r=D(),s=ue()("toStringTag"),o=Object,a="Arguments"===r(function(){return arguments}());t.exports=n?r:function(e){var t,n,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=o(e),s))?n:a?r(t):"Object"===(u=r(t))&&i(t.callee)?"Arguments":u}}),gt=E(function(e,t){var n=vt(),i=X(),r=B(),s=tt(),o=ue()("iterator");t.exports=function(e){if(!r(e))return i(e,o)||i(e,"@@iterator")||s[n(e)]}}),mt=E(function(e,t){var n=L(),i=Y(),r=_e(),s=J(),o=gt(),a=TypeError;t.exports=function(e,t){var u=2>arguments.length?o(e):t;if(i(u))return r(n(u,e));throw new a(s(e)+" is not iterable")}}),yt=E(function(e,t){var n=L(),i=_e(),r=X();t.exports=function(e,t,s){var o,a;i(e);try{if(!(o=r(e,"return"))){if("throw"===t)throw s;return s}o=n(o,e)}catch(e){a=!0,o=e}if("throw"===t)throw s;if(a)throw o;return i(o),s}}),bt=E(function(e,t){var n=ft(),i=L(),r=_e(),s=J(),o=pt(),a=Ie(),u=U(),l=mt(),c=gt(),d=yt(),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},p=f.prototype;t.exports=function(e,t,_){var v,g,m,y,b,w,S,x=!(!_||!_.AS_ENTRIES),k=!(!_||!_.IS_RECORD),C=!(!_||!_.IS_ITERATOR),P=!(!_||!_.INTERRUPTED),E=n(t,_&&_.that),F=function(e){var t=v;return v=void 0,t&&d(t,"normal"),new f(!0,e)},T=function(e){return x?(r(e),P?E(e[0],e[1],F):E(e[0],e[1])):P?E(e,F):E(e)};if(k)v=e.iterator;else if(C)v=e;else{if(!(g=c(e)))throw new h(s(e)+" is not iterable");if(o(g)){for(m=0,y=a(e);y>m;m++)if((b=T(e[m]))&&u(p,b))return b;return new f(!1)}v=l(e,g)}for(w=k?e.next:v.next;!(S=i(w,v)).done;){var I=S.value;try{b=T(I)}catch(e){if(!v)throw e;d(v,"throw",e)}if("object"==typeof b&&b&&u(p,b))return b}return new f(!1)}}),wt=E(function(e,t){var n=I(),i=ve(),r=O();t.exports=function(e,t,s){n?i.f(e,t,r(0,s)):e[t]=s}}),St=E(function(){var $=Be(),e=bt(),t=wt();$({target:"Object",stat:!0},{fromEntries:function(n){var i={};return e(n,function(e,n){t(i,e,n)},{AS_ENTRIES:!0}),i}})}),xt=E(function(e,t){dt(),St(),t.exports=Ue().Object.fromEntries}),kt=E(function(e,t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),Ct=E(function(e,t){var n=de()("span").classList,i=n&&n.constructor&&n.constructor.prototype;t.exports=i===Object.prototype?void 0:i}),Pt=E(function(){var e=F(),t=kt(),n=Ct(),i=dt(),r=ge(),s=it(),o=ue()("iterator"),a=i.values,u=function(e,n){if(e){if(e[o]!==a)try{r(e,o,a)}catch(t){e[o]=a}if(s(e,n,!0),t[n])for(var u in i)if(e[u]!==i[u])try{r(e,u,i[u])}catch(t){e[u]=i[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);u(n,"DOMTokenList")}),Et=E(function(e,t){var n=xt();Pt(),t.exports=n}),Ft=E(function(e,t){t.exports=Et()}),Tt=E(function(e,t){t.exports=Ft()}),It=E(function(e,t){t.exports=Tt()}),Rt=E(function(e,t){var n=V(),i=ge();t.exports=function(e,t){n(t)&&"cause"in t&&i(e,"cause",t.cause)}}),Lt=E(function(e,t){var n=M(),i=Error,r=n("".replace),s=String(new i("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,a=o.test(s);t.exports=function(e,t){if(a&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=r(e,o,"");return e}}),At=E(function(e,t){var n=T(),i=O();t.exports=!n(function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)})}),Ot=E(function(e,t){var n=ge(),i=Lt(),r=At(),s=Error.captureStackTrace;t.exports=function(e,t,o,a){r&&(s?s(e,t):n(e,"stack",i(o,a)))}}),Mt=E(function(e,t){var n=vt(),i=String;t.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}}),$t=E(function(e,t){var n=Mt();t.exports=function(e,t){return void 0===e?2>arguments.length?"":t:n(e)}}),Dt=E(function(){var $=Be(),e=U(),t=je(),n=ut(),i=De(),r=Xe(),s=ge(),o=O(),a=Rt(),u=Ot(),l=bt(),c=$t(),d=ue()("toStringTag"),h=Error,f=[].push,p=function(i,o){var v,g=e(_,this);n?v=n(new h,g?t(this):_):(v=g?this:r(_),s(v,d,"Error")),void 0!==o&&s(v,"message",c(o)),u(v,p,v.stack,1),arguments.length>2&&a(v,arguments[2]);var m=[];return l(i,f,{that:m}),s(v,"errors",m),v};n?n(p,h):i(p,h,{name:!0});var _=p.prototype=r(h.prototype,{constructor:o(1,p),message:o(1,""),name:o(1,"AggregateError")});$({global:!0,constructor:!0,arity:2},{AggregateError:p})}),qt=E(function(){Dt()}),Bt=E(function(e,t){var n=_t(),i=vt();t.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}}),Nt=E(function(){var e=_t(),t=Ce(),n=Bt();e||t(Object.prototype,"toString",n,{unsafe:!0})}),jt=E(function(e,t){var n=F(),i=W(),r=D(),s=function(e){return i.slice(0,e.length)===e};t.exports=s("Bun/")?"BUN":s("Cloudflare-Workers")?"CLOUDFLARE":s("Deno/")?"DENO":s("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===r(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"}),Ht=E(function(e,t){t.exports="NODE"===jt()}),Vt=E(function(e,t){var n=ke(),i=ve();t.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}}),zt=E(function(e,t){var n=z(),i=Vt(),r=ue(),s=I(),o=r("species");t.exports=function(e){var t=n(e);s&&t&&!t[o]&&i(t,o,{configurable:!0,get:function(){return this}})}}),Ut=E(function(e,t){var n=U(),i=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}}),Wt=E(function(e,t){var n=M(),i=T(),r=H(),s=vt(),o=z(),a=ye(),u=function(){},l=o("Reflect","construct"),c=/^\s*(?:class|function)\b/,d=n(c.exec),h=!c.test(u),f=function(e){if(!r(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},p=function(e){if(!r(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!d(c,a(e))}catch(e){return!0}};p.sham=!0,t.exports=!l||i(function(){var e;return f(f.call)||!f(Object)||!f(function(){e=!0})||e})?p:f}),Gt=E(function(e,t){var n=Wt(),i=J(),r=TypeError;t.exports=function(e){if(n(e))return e;throw new r(i(e)+" is not a constructor")}}),Kt=E(function(e,t){var n=_e(),i=Gt(),r=B(),s=ue()("species");t.exports=function(e,t){var o,a=n(e).constructor;return void 0===a||r(o=n(a)[s])?t:i(o)}}),Qt=E(function(e,t){var n=R(),i=Function.prototype,r=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(r):function(){return s.apply(r,arguments)})}),Zt=E(function(e,t){t.exports=M()([].slice)}),Jt=E(function(e,t){var n=TypeError;t.exports=function(e,t){if(t>e)throw new n("Not enough arguments");return e}}),Yt=E(function(e,t){var n=W();t.exports=/ipad|iphone|ipod/i.test(n)&&/applewebkit/i.test(n)}),Xt=E(function(e,t){var n,i,r,s,o=F(),a=Qt(),u=ft(),l=H(),c=oe(),d=T(),h=Ye(),f=Zt(),p=de(),_=Jt(),v=Yt(),g=Ht(),m=o.setImmediate,y=o.clearImmediate,b=o.process,w=o.Dispatch,S=o.Function,x=o.MessageChannel,k=o.String,C=0,P={},E="onreadystatechange";d(function(){n=o.location});var I=function(e){if(c(P,e)){var t=P[e];delete P[e],t()}},R=function(e){return function(){I(e)}},L=function(e){I(e.data)},A=function(e){o.postMessage(k(e),n.protocol+"//"+n.host)};m&&y||(m=function(e){_(arguments.length,1);var t=l(e)?e:S(e),n=f(arguments,1);return P[++C]=function(){a(t,void 0,n)},i(C),C},y=function(e){delete P[e]},g?i=function(e){b.nextTick(R(e))}:w&&w.now?i=function(e){w.now(R(e))}:x&&!v?(s=(r=new x).port2,r.port1.onmessage=L,i=u(s.postMessage,s)):o.addEventListener&&l(o.postMessage)&&!o.importScripts&&n&&"file:"!==n.protocol&&!d(A)?(i=A,o.addEventListener("message",L,!1)):i=E in p("script")?function(e){h.appendChild(p("script"))[E]=function(){h.removeChild(this),I(e)}}:function(e){setTimeout(R(e),0)}),t.exports={set:m,clear:y}}),en=E(function(e,t){var n=F(),i=I(),r=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!i)return n[e];var t=r(n,e);return t&&t.value}}),tn=E(function(e,t){var n=function(){this.head=null,this.tail=null};n.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},t.exports=n}),nn=E(function(e,t){var n=W();t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble}),rn=E(function(e,t){var n=W();t.exports=/web0s(?!.*chrome)/i.test(n)}),sn=E(function(e,t){var n,i,r,s,o,a=F(),u=en(),l=ft(),c=Xt().set,d=tn(),h=Yt(),f=nn(),p=rn(),_=Ht(),v=a.MutationObserver||a.WebKitMutationObserver,g=a.document,m=a.process,y=a.Promise,b=u("queueMicrotask");if(!b){var w=new d,S=function(){var e,t;for(_&&(e=m.domain)&&e.exit();t=w.get();)try{t()}catch(e){throw w.head&&n(),e}e&&e.enter()};h||_||p||!v||!g?!f&&y&&y.resolve?((s=y.resolve(void 0)).constructor=y,o=l(s.then,s),n=function(){o(S)}):_?n=function(){m.nextTick(S)}:(c=l(c,a),n=function(){c(S)}):(i=!0,r=g.createTextNode(""),new v(S).observe(r,{characterData:!0}),n=function(){r.data=i=!i}),b=function(e){w.head||n(),w.add(e)}}t.exports=b}),on=E(function(e,t){t.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}}),an=E(function(e,t){t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}}),un=E(function(e,t){t.exports=F().Promise}),ln=E(function(e,t){var n=F(),i=un(),r=H(),s=qe(),o=ye(),a=ue(),u=jt(),l=te(),c=G(),d=i&&i.prototype,h=a("species"),f=!1,p=r(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:s("Promise",function(){var e=o(i),t=e!==String(i);if(!t&&66===c)return!0;if(l&&(!d.catch||!d.finally))return!0;if(!c||51>c||!/native code/.test(e)){var n=new i(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((n.constructor={})[h]=r,!(f=n.then(function(){})instanceof r))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||p)}),REJECTION_EVENT:p,SUBCLASSING:f}}),cn=E(function(e,t){var n=Y(),i=TypeError,r=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)};t.exports.f=function(e){return new r(e)}}),dn=E(function(){var e,t,n,i,$=Be(),r=te(),s=Ht(),o=F(),a=Ue(),u=L(),l=Ce(),c=ut(),d=it(),h=zt(),f=Y(),p=H(),_=V(),v=Ut(),g=Kt(),m=Xt().set,y=sn(),b=on(),w=an(),S=tn(),x=xe(),k=un(),C=ln(),P=cn(),E="Promise",T=C.CONSTRUCTOR,I=C.REJECTION_EVENT,R=C.SUBCLASSING,A=x.getterFor(E),O=x.set,M=k&&k.prototype,D=k,q=M,B=o.TypeError,N=o.document,j=o.process,z=P.f,U=z,W=!!(N&&N.createEvent&&o.dispatchEvent),G="unhandledrejection",K=function(e){var t;return!(!_(e)||!p(t=e.then))&&t},Q=function(e,t){var n,i,r,s=t.value,o=1===t.state,a=o?e.ok:e.fail,l=e.resolve,c=e.reject,d=e.domain;try{a?(o||(2===t.rejection&&ne(t),t.rejection=1),!0===a?n=s:(d&&d.enter(),n=a(s),d&&(d.exit(),r=!0)),n===e.promise?c(new B("Promise-chain cycle")):(i=K(n))?u(i,n,l,c):l(n)):c(s)}catch(e){d&&!r&&d.exit(),c(e)}},Z=function(e,t){e.notified||(e.notified=!0,y(function(){for(var n,i=e.reactions;n=i.get();)Q(n,e);e.notified=!1,t&&!e.rejection&&X(e)}))},J=function(e,t,n){var i,r;W?((i=N.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),o.dispatchEvent(i)):i={promise:t,reason:n},!I&&(r=o["on"+e])?r(i):e===G&&b("Unhandled promise rejection",n)},X=function(e){u(m,o,function(){var t,n=e.facade,i=e.value;if(ee(e)&&(t=w(function(){s?j.emit("unhandledRejection",i,n):J(G,n,i)}),e.rejection=s||ee(e)?2:1,t.error))throw t.value})},ee=function(e){return 1!==e.rejection&&!e.parent},ne=function(e){u(m,o,function(){var t=e.facade;s?j.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)})},ie=function(e,t,n){return function(i){e(t,i,n)}},re=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Z(e,!0))},se=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new B("Promise can't be resolved itself");var i=K(t);i?y(function(){var n={done:!1};try{u(i,t,ie(se,n,e),ie(re,n,e))}catch(t){re(n,t,e)}}):(e.value=t,e.state=1,Z(e,!1))}catch(t){re({done:!1},t,e)}}};if(T&&(D=function(t){v(this,q),f(t),u(e,this);var n=A(this);try{t(ie(se,n),ie(re,n))}catch(e){re(n,e)}},(e=function(e){O(this,{type:E,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:null})}).prototype=l(q=D.prototype,"then",function(e,t){var n=A(this),i=z(g(this,D));return n.parent=!0,i.ok=!p(e)||e,i.fail=p(t)&&t,i.domain=s?j.domain:void 0,0===n.state?n.reactions.add(i):y(function(){Q(i,n)}),i.promise}),t=function(){var t=new e,n=A(t);this.promise=t,this.resolve=ie(se,n),this.reject=ie(re,n)},P.f=z=function(e){return e===D||e===n?new t(e):U(e)},!r&&p(k)&&M!==Object.prototype)){i=M.then,R||l(M,"then",function(e,t){var n=this;return new D(function(e,t){u(i,n,e,t)}).then(e,t)},{unsafe:!0});try{delete M.constructor}catch(e){}c&&c(M,q)}$({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:D}),n=a.Promise,d(D,E,!1,!0),h(E)}),hn=E(function(e,t){var n=ue()("iterator"),i=!1;try{var r=0,s={next:function(){return{done:!!r++}},return:function(){i=!0}};s[n]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}t.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var s={};s[n]=function(){return{next:function(){return{done:r=!0}}}},e(s)}catch(e){}return r}}),fn=E(function(e,t){var n=un(),i=hn();t.exports=ln().CONSTRUCTOR||!i(function(e){n.all(e).then(void 0,function(){})})}),pn=E(function(){var $=Be(),e=L(),t=Y(),n=cn(),i=an(),r=bt();$({target:"Promise",stat:!0,forced:fn()},{all:function(s){var o=this,a=n.f(o),u=a.resolve,l=a.reject,c=i(function(){var n=t(o.resolve),i=[],a=0,c=1;r(s,function(t){var r=a++,s=!1;c++,e(n,o,t).then(function(e){s||(s=!0,i[r]=e,--c||u(i))},l)}),--c||u(i)});return c.error&&l(c.value),a.promise}})}),_n=E(function(){var $=Be(),e=te(),t=ln().CONSTRUCTOR,n=un(),i=z(),r=H(),s=Ce(),o=n&&n.prototype;if($({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(e){return this.then(void 0,e)}}),!e&&r(n)){var a=i("Promise").prototype.catch;o.catch!==a&&s(o,"catch",a,{unsafe:!0})}}),vn=E(function(){var $=Be(),e=L(),t=Y(),n=cn(),i=an(),r=bt();$({target:"Promise",stat:!0,forced:fn()},{race:function(s){var o=this,a=n.f(o),u=a.reject,l=i(function(){var n=t(o.resolve);r(s,function(t){e(n,o,t).then(a.resolve,u)})});return l.error&&u(l.value),a.promise}})}),gn=E(function(){var $=Be(),e=cn();$({target:"Promise",stat:!0,forced:ln().CONSTRUCTOR},{reject:function(t){var n=e.f(this);return(0,n.reject)(t),n.promise}})}),mn=E(function(e,t){var n=_e(),i=V(),r=cn();t.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var s=r.f(e);return(0,s.resolve)(t),s.promise}}),yn=E(function(){var $=Be(),e=z(),t=te(),n=un(),i=ln().CONSTRUCTOR,r=mn(),s=e("Promise"),o=t&&!i;$({target:"Promise",stat:!0,forced:t||i},{resolve:function(e){return r(o&&this===s?n:this,e)}})}),bn=E(function(){dn(),pn(),_n(),vn(),gn(),yn()}),wn=E(function(){var $=Be(),e=L(),t=Y(),n=cn(),i=an(),r=bt();$({target:"Promise",stat:!0,forced:fn()},{allSettled:function(s){var o=this,a=n.f(o),u=a.resolve,l=a.reject,c=i(function(){var n=t(o.resolve),i=[],a=0,l=1;r(s,function(t){var r=a++,s=!1;l++,e(n,o,t).then(function(e){s||(s=!0,i[r]={status:"fulfilled",value:e},--l||u(i))},function(e){s||(s=!0,i[r]={status:"rejected",reason:e},--l||u(i))})}),--l||u(i)});return c.error&&l(c.value),a.promise}})}),Sn=E(function(){var $=Be(),e=L(),t=Y(),n=z(),i=cn(),r=an(),s=bt(),o=fn(),a="No one promise resolved";$({target:"Promise",stat:!0,forced:o},{any:function(o){var u=this,l=n("AggregateError"),c=i.f(u),d=c.resolve,h=c.reject,f=r(function(){var n=t(u.resolve),i=[],r=0,c=1,f=!1;s(o,function(t){var s=r++,o=!1;c++,e(n,u,t).then(function(e){o||f||(f=!0,d(e))},function(e){o||f||(o=!0,i[s]=e,--c||h(new l(i,a)))})}),--c||h(new l(i,a))});return f.error&&h(f.value),c.promise}})}),xn=E(function(){var $=Be(),e=F(),t=Qt(),n=Zt(),i=cn(),r=Y(),s=an(),o=e.Promise,a=!1;$({target:"Promise",stat:!0,forced:!o||!o.try||s(function(){o.try(function(e){a=8===e},8)}).error||!a},{try:function(e){var o=arguments.length>1?n(arguments,1):[],a=i.f(this),u=s(function(){return t(r(e),void 0,o)});return(u.error?a.reject:a.resolve)(u.value),a.promise}})}),kn=E(function(){var $=Be(),e=cn();$({target:"Promise",stat:!0},{withResolvers:function(){var t=e.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})}),Cn=E(function(){var $=Be(),e=te(),t=un(),n=T(),i=z(),r=H(),s=Kt(),o=mn(),a=Ce(),u=t&&t.prototype;if($({target:"Promise",proto:!0,real:!0,forced:!!t&&n(function(){u.finally.call({then:function(){}},function(){})})},{finally:function(e){var t=s(this,i("Promise")),n=r(e);return this.then(n?function(n){return o(t,e()).then(function(){return n})}:e,n?function(n){return o(t,e()).then(function(){throw n})}:e)}}),!e&&r(t)){var l=i("Promise").prototype.finally;u.finally!==l&&a(u,"finally",l,{unsafe:!0})}}),Pn=E(function(e,t){var n=M(),i=Ee(),r=Mt(),s=N(),o=n("".charAt),a=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,n){var l,c,d=r(s(t)),h=i(n),f=d.length;return 0>h||h>=f?e?"":void 0:55296>(l=a(d,h))||l>56319||h+1===f||56320>(c=a(d,h+1))||c>57343?e?o(d,h):l:e?u(d,h,h+2):c-56320+(l-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}}),En=E(function(){var e=Pn().charAt,t=Mt(),n=xe(),i=lt(),r=ct(),s="String Iterator",o=n.set,a=n.getterFor(s);i(String,"String",function(e){o(this,{type:s,string:t(e),index:0})},function(){var t,n=a(this),i=n.string,s=n.index;return i.length>s?(t=e(i,s),n.index+=t.length,r(t,!1)):r(void 0,!0)})}),Fn=E(function(e,t){qt(),dt(),Nt(),bn(),wn(),Sn(),xn(),kn(),Cn(),En(),t.exports=Ue().Promise}),Tn=E(function(e,t){var n=Fn();Pt(),t.exports=n}),In=E(function(){xn()}),Rn=E(function(){kn()}),Ln=E(function(e,t){var n=Tn();In(),Rn(),t.exports=n}),An=E(function(){qt()}),On=E(function(){wn()}),Mn=E(function(){Sn()}),$n=E(function(e,t){var n=Ln();An(),On(),Mn(),t.exports=n}),Dn=E(function(e,t){t.exports=$n()});Ze(),It(),Dn();var qn,Bn,Nn,jn,Hn={},Vn=[],zn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Un=Array.isArray;function Wn(e,t){for(var n in t)e[n]=t[n];return e}function Gn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Kn(e,t,n){var i,r,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?r=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?c.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return Qn(e,o,i,r,null)}function Qn(e,t,n,i,r){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++f:r,__i:-1,__u:0};return null==r&&null!=h.vnode&&h.vnode(s),s}function Zn(e){return e.children}function Jn(e,t){this.props=e,this.context=t}function $(e,t){if(null==t)return e.__?$(e.__,e.__i+1):null;for(var n;e.__k.length>t;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?$(e):null}function Yn(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],r=[],s=Wn({},t);s.__v=t.__v+1,h.vnode&&h.vnode(s),li(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,null==n?$(t):n,!!(32&t.__u),r),s.__v=t.__v,s.__.__k[s.__i]=s,di(i,s,r),t.__e=t.__=null,s.__e!=n&&Xn(s)}}function Xn(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Xn(e)}function ei(e){(!e.__d&&(e.__d=!0)&&_.push(e)&&!ti.__r++||v!=h.debounceRendering)&&((v=h.debounceRendering)||g)(ti)}function ti(){try{for(var e,t=1;_.length;)_.length>t&&_.sort(m),e=_.shift(),t=_.length,Yn(e)}finally{_.length=ti.__r=0}}function ni(e,t,n,i,r,s,o,a,u,l,c){var d,h,f,p,_,v,g,m=i&&i.__k||Vn,y=t.length;for(u=ii(n,t,m,u,y),d=0;y>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&m[f.__i]||Hn,f.__i=d,v=li(e,f,h,r,s,o,a,u,l,c),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&pi(h.ref,null,f),c.push(f.ref,f.__c||p,f)),null==_&&null!=p&&(_=p),(g=!!(4&f.__u))||h.__k===f.__k?(u=ri(f,u,e,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==v?u=v:p&&(u=p.nextSibling),f.__u&=-7);return n.__e=_,u}function ii(e,t,n,i,r){var s,o,a,u,l,c=n.length,d=c,h=0;for(e.__k=new Array(r),s=0;r>s;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]=Qn(null,o,null,null,null):Un(o)?o=e.__k[s]=Qn(Zn,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=Qn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,u=s+h,o.__=e,o.__b=e.__b+1,a=null,-1!=(l=o.__i=si(o,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(r>c?h--:c>r&&h++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,o.__u|=4))):e.__k[s]=null;if(d)for(s=0;c>s;s++)null!=(a=n[s])&&!(2&a.__u)&&(a.__e==i&&(i=$(a)),_i(a,a));return i}function ri(e,t,n,i){var r,s;if("function"==typeof e.type){for(r=e.__k,s=0;r&&r.length>s;s++)r[s]&&(r[s].__=e,t=ri(r[s],t,n,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=$(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function si(e,t,n,i){var r,s,o,a=e.key,u=e.type,l=t[n],c=null!=l&&!(2&l.__u);if(null===l&&null==a||c&&a==l.key&&u==l.type)return n;if(i>(c?1:0))for(r=n-1,s=n+1;r>=0||t.length>s;)if(null!=(l=t[o=0>r?s++:r--])&&!(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function oi(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||zn.test(t)?n:n+"px"}function ai(e,t,n,i,r){var s,o;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||oi(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||oi(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(S,"$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]=n,n?i?n[w]=i[w]:(n[w]=x,e.addEventListener(t,s?C:k,s)):e.removeEventListener(t,s?C:k,s);else{if("http://www.w3.org/2000/svg"==r)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==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function ui(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[b])t[b]=x++;else if(n[w]>t[b])return;return n(h.event?h.event(t):t)}}}function li(e,t,n,i,r,s,o,a,u,l){var c,d,f,p,_,v,g,m,y,b,$,w,S,x,k,C,P=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),s=[a=t.__e=n.__e]),(c=h.__b)&&c(t);e:if("function"==typeof P){d=o.length;try{if(y=t.props,b=P.prototype&&P.prototype.render,$=(c=P.contextType)&&i[c.__c],w=c?$?$.props.value:c.__:i,n.__c?m=(f=t.__c=n.__c).__=f.__E:(b?t.__c=f=new P(y,w):(t.__c=f=new Jn(y,w),f.constructor=P,f.render=vi),$&&$.sub(f),f.state||(f.state={}),f.__n=i,p=f.__d=!0,f.__h=[],f._sb=[]),b&&null==f.__s&&(f.__s=f.state),b&&null!=P.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=Wn({},f.__s)),Wn(f.__s,P.getDerivedStateFromProps(y,f.__s))),_=f.props,v=f.state,f.__v=t,p)b&&null==P.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),b&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(b&&null==P.getDerivedStateFromProps&&y!==_&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,w),t.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,w)){t.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),Vn.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,w),b&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(_,v,g)})}if(f.context=w,f.props=y,f.__P=e,f.__e=!1,S=h.__r,x=0,b)f.state=f.__s,f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),Vn.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++x);f.state=f.__s,null!=f.getChildContext&&(i=Wn(Wn({},i),f.getChildContext())),b&&!p&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(_,v)),k=null!=c&&c.type===Zn&&null==c.key?hi(c.props.children):c,a=ni(e,Un(k)?k:[k],t,n,i,r,s,o,a,u,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),m&&(f.__E=f.__=null)}catch(e){if(o.length=d,t.__v=null,u||null!=s)if(e.then){for(t.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),t.__e=a}else{if(null!=s)for(C=s.length;C--;)Gn(s[C]);ci(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||ci(t);h.__e(e,t,n)}}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=fi(n.__e,t,n,i,r,s,o,u,l);return(c=h.diffed)&&c(t),128&t.__u?void 0:a}function ci(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ci))}function di(e,t,n){for(var i=0;n.length>i;i++)pi(n[i],n[++i],n[++i]);h.__c&&h.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){h.__e(e,t.__v)}})}function hi(e){return"object"!=typeof e||null==e||e.__b>0?e:Un(e)?e.map(hi):void 0!==e.constructor?null:Wn({},e)}function fi(e,t,n,i,r,s,o,a,u){var l,d,f,p,_,v,g,m=n.props||Hn,y=t.props,b=t.type;if("svg"==b?r="http://www.w3.org/2000/svg":"math"==b?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=s)for(l=0;s.length>l;l++)if((_=s[l])&&"setAttribute"in _==!!b&&(b?_.localName==b:3==_.nodeType)){e=_,s[l]=null;break}if(null==e){if(null==b)return document.createTextNode(y);e=document.createElementNS(r,b,y.is&&y),a&&(h.__m&&h.__m(t,s),a=!1),s=null}if(null==b)m===y||a&&e.data==y||(e.data=y);else{if(s="textarea"==b&&null!=y.defaultValue?null:s&&c.call(e.childNodes),!a&&null!=s)for(m={},l=0;e.attributes.length>l;l++)m[(_=e.attributes[l]).name]=_.value;for(l in m)_=m[l],"dangerouslySetInnerHTML"==l?f=_:"children"==l||l in y||"value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y||ai(e,l,null,_,r);for(l in y)_=y[l],"children"==l?p=_:"dangerouslySetInnerHTML"==l?d=_:"value"==l?v=_:"checked"==l?g=_:a&&"function"!=typeof _||m[l]===_||ai(e,l,_,m[l],r);if(d)a||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=""),ni("template"==t.type?e.content:e,Un(p)?p:[p],t,n,i,"foreignObject"==b?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:n.__k&&$(n,0),a,u),null!=s)for(l=s.length;l--;)Gn(s[l]);a&&"textarea"!=b||(l="value","progress"==b&&null==v?e.removeAttribute("value"):null!=v&&(v!==e[l]||"progress"==b&&!v||"option"==b&&v!=m[l])&&ai(e,l,v,m[l],r),l="checked",null!=g&&g!=e[l]&&ai(e,l,g,m[l],r))}return e}function pi(e,t,n){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){h.__e(e,n)}}function _i(e,t,n){var i,r;if(h.unmount&&h.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||pi(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){h.__e(e,t)}i.base=i.__P=i.__n=null}if(i=e.__k)for(r=0;i.length>r;r++)i[r]&&_i(i[r],t,n||"function"!=typeof e.type);n||Gn(e.__e),e.__c=e.__=e.__e=void 0}function vi(e,t,n){return this.constructor(e,n)}function gi(e,t,n){var i,r,s,o;t==document&&(t=document.documentElement),h.__&&h.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],o=[],li(t,e=(!i&&n||t).__k=Kn(Zn,null,[e]),r||Hn,Hn,t.namespaceURI,!i&&n?[n]:r?null:t.firstChild?c.call(t.childNodes):null,s,!i&&n?n:r?r.__e:t.firstChild,i,o),di(s,e,o),e.props.children=null}c=Vn.slice,h={__e:function(e,t,n,i){for(var r,s,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((s=r.constructor)&&null!=s.getDerivedStateFromError&&(r.setState(s.getDerivedStateFromError(e)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),o=r.__d),o)return r.__E=r}catch(t){e=t}throw e}},f=0,Jn.prototype.setState=function(e,t){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Wn({},this.state);"function"==typeof e&&(e=e(Wn({},n),this.props)),e&&Wn(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ei(this))},Jn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ei(this))},Jn.prototype.render=Zn,_=[],g="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,m=function(e,t){return e.__v.__b-t.__v.__b},ti.__r=0,y=Math.random().toString(8),b="__d"+y,w="__a"+y,S=/(PointerCapture)$|Capture$/i,x=0,k=ui(!1),C=ui(!0),P=0;var mi=0,yi=[],bi=h,wi=bi.__b,Si=bi.__r,xi=bi.diffed,ki=bi.__c,Ci=bi.unmount,Pi=bi.__;function Ei(e,t){bi.__h&&bi.__h(Bn,e,mi||t),mi=0;var n=Bn.__H||(Bn.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Fi(e){return mi=1,function(e,t){var n=Ei(qn++,2);if(n.t=e,!n.__c&&(n.__=[Bi(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],i=n.t(t,e);t!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=Bn,!Bn.__f)){var i=function(e,t,i){if(!n.__c.__H)return!0;var s=!1,o=n.__c.props!==e;if(n.__c.__H.__.some(function(e){if(e.__N){s=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),r){var a=r.call(this,e,t,i);return s?a||o:a}return!s||o};Bn.__f=!0;var r=Bn.shouldComponentUpdate,s=Bn.componentWillUpdate;Bn.componentWillUpdate=function(e,t,n){if(this.__e){var o=r;r=void 0,i(e,t,n),r=o}s&&s.call(this,e,t,n)},Bn.shouldComponentUpdate=i}return n.__N||n.__}(Bi,e)}function Ti(e,t){var n=Ei(qn++,3);!bi.__s&&qi(n.__H,t)&&(n.__=e,n.u=t,Bn.__H.__h.push(n))}function Ii(e){return mi=5,Ri(function(){return{current:e}},[])}function Ri(e,t){var n=Ei(qn++,7);return qi(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Li(e){var t,n=Bn.context[e.__c],i=Ei(qn++,9);return i.c=e,n?(null!==(t=i.__)&&void 0!==t||(i.__=!0,n.sub(Bn)),n.props.value):e.__}function Ai(){for(var e;e=yi.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some($i),t.__h.some(Di),t.__h=[]}catch(n){t.__h=[],bi.__e(n,e.__v)}}}bi.__b=function(e){Bn=null,wi&&wi(e)},bi.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Pi&&Pi(e,t)},bi.__r=function(e){Si&&Si(e),qn=0;var t=(Bn=e.__c).__H;t&&(Nn===Bn?(t.__h=[],Bn.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.length&&Ai(),qn=0)),Nn=Bn},bi.diffed=function(e){xi&&xi(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==yi.push(t)&&jn===bi.requestAnimationFrame||((jn=bi.requestAnimationFrame)||Mi)(Ai)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),Nn=Bn=null},bi.__c=function(e,t){t.some(function(e){try{e.__h.some($i),e.__h=e.__h.filter(function(e){return!e.__||Di(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],bi.__e(n,e.__v)}}),ki&&ki(e,t)},bi.unmount=function(e){Ci&&Ci(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{$i(e)}catch(e){t=e}}),n.__H=void 0,t&&bi.__e(t,n.__v))};var Oi="function"==typeof requestAnimationFrame;function Mi(e){var t,n=function(){clearTimeout(i),Oi&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);Oi&&(t=requestAnimationFrame(n))}function $i(e){var t=Bn,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Bn=t}function Di(e){var t=Bn;e.__c=e.__(),Bn=t}function qi(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Bi(e,t){return"function"==typeof t?t(e):t}var Ni="gzip-js",ji="base64",Hi="events",Vi="cancelEvents",zi="tab",Ui="left",Wi="center",Gi="right",Ki="next_to_trigger",Qi="popover",Zi="widget",Ji="external_survey",Yi="open",Xi="multiple_choice",er="single_choice",tr="rating",nr="end",ir="always",rr="survey shown",sr="survey dismissed",or="survey sent",ar="$survey_id",ur="$survey_name",lr="$survey_iteration",cr="$survey_iteration_start_date",dr="$survey_submission_id",hr="$survey_language",fr="popover",pr=["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","pinterestbot","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"],_r=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=e.toLowerCase();return pr.concat(t).some(function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)})};function vr(e,t){return-1!==e.indexOf(t)}var gr=function(e){return e.trim()},mr=function(e){return e.replace(/^\$/,"")};function yr(e){var t,n=[];return null!==(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(t))return"[Circular]";n.push(t)}return t}}))&&void 0!==t?t:"null"}var br=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),wr=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Sr="min_length",xr="max_length",kr=["$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"],Cr=["token"],Pr=Object.prototype,Er=Pr.hasOwnProperty,Fr=Pr.toString,Tr=Array.isArray||function(e){return"[object Array]"===Fr.call(e)},Ir=function(e){return"function"==typeof e},Rr=function(e){return e===Object(e)&&!Tr(e)},Lr=function(e){if(Rr(e)){for(var t in e)if(Er.call(e,t))return!1;return!0}return!1},Ar=function(e){return void 0===e},Or=function(e){return"[object String]"==Fr.call(e)},Mr=function(e){return Or(e)&&0===e.trim().length},$r=function(e){return null===e},Dr=function(e){return Ar(e)||$r(e)},qr=function(e){return"[object Number]"==Fr.call(e)&&e==e},Br=function(e){return qr(e)&&e>0},Nr=function(e){return"[object Boolean]"===Fr.call(e)},jr=function(e){return vr(kr,e)},Hr=function(e){return vr(Cr,e)};function Vr(e){return null===e||"object"!=typeof e}function zr(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Ur(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return Gr(e,Error)}}function Wr(e){return"u">typeof Event&&Gr(e,Event)}function Gr(e,t){try{return e instanceof t}catch(e){return!1}}var Kr=[!0,"true",1,"1","yes"],Qr=function(e){return vr(Kr,e)},Zr=[!1,"false",0,"0","no"];function Jr(e,t,n,i,r){return t>n&&(i.warn("min cannot be greater than max."),t=n),qr(e)?e>n?(i.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(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: "+n+", fallback: "+r),Jr(null!=r?r:n,t,n,i))}var Yr=function(){"use strict";function e(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=Jr(e.bucketSize,0,100,e._logger),this._refillRate=Jr(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=Jr(e.refillInterval,0,864e5,e._logger)}var t=e.prototype;return t._applyRefill=function(e,t){var n=Math.floor((t-e.lastAccess)/this._refillInterval);n>0&&(e.tokens=Math.min(e.tokens+n*this._refillRate,this._bucketSize),e.lastAccess=e.lastAccess+n*this._refillInterval)},t.consumeRateLimit=function(e){var t,n=Date.now(),i=String(e),r=this._buckets[i];return r?this._applyRefill(r,n):this._buckets[i]=r={tokens:this._bucketSize,lastAccess:n},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===r.tokens)},t.stop=function(){this._buckets={}},e}(),Xr="Mobile",es="Android",ts="Tablet",ns="Android Tablet",is="iPad",rs="Apple Watch",ss="Safari",os="BlackBerry",as="Samsung Internet",us="Chrome",ls="Chrome iOS",cs="Internet Explorer",ds="Internet Explorer Mobile",hs="Opera",fs="Microsoft Edge",ps="Firefox",_s="Firefox iOS",vs="Nintendo",gs="PlayStation",ms="Xbox",ys="Android Mobile",bs="Mobile Safari",ws="Windows",Ss="Windows Phone",xs="Nokia",ks="Ouya",Cs="Generic "+Xr.toLowerCase(),Ps="Generic "+ts.toLowerCase(),Es="Konqueror",Fs="Oculus Browser",Ts="Vivaldi",Is="Yandex",Rs="Whale",Ls="DuckDuckGo",As="Pale Moon",Os="Waterfox",Ms="Brave",$s="Claude",Ds="Codex",qs="ChatGPT",Bs="Google Search App",Ns=new RegExp("Version/(\\d+(\\.\\d+)?)"),js=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Hs=new RegExp(ms,"i"),Vs=new RegExp("PlayStation \\w+","i"),zs=new RegExp("Nintendo \\w+","i"),Us=new RegExp("BlackBerry|PlayBook|BB10","i"),Ws={"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"},Gs=function(e,t,n,i){t=t||"";var r=function(e){return null!=e&&e.brave?Ms:null}(n);return r||(null!=i&&i.detectGoogleSearchApp&&vr(e,"GSA/")?Bs:vr(e," OPR/")&&vr(e,"Mini")?"Opera Mini":vr(e," OPR/")?hs:Us.test(e)?os:vr(e,"IEMobile")||vr(e,"WPDesktop")?ds:vr(e,"OculusBrowser")?Fs:vr(e,"SamsungBrowser")?as:vr(e,"Edge")||vr(e,"Edg/")?fs:vr(e,"Vivaldi/")?Ts:vr(e,"YaBrowser/")?Is:vr(e,"Whale/")?Rs:vr(e,"DuckDuckGo/")||vr(e,"Ddg/")?Ls:vr(e,"Claude/")?$s:vr(e,"Codex/")?Ds:vr(e,"ChatGPT/")?qs:vr(e,"FBIOS")?"Facebook Mobile":vr(e,"UCWEB")||vr(e,"UCBrowser")?"UC Browser":vr(e,"CriOS")?ls:vr(e,"CrMo")||vr(e,us)?us:vr(e,es)&&vr(e,ss)?ys:vr(e,"FxiOS")?_s:vr(e.toLowerCase(),Es.toLowerCase())?Es:vr(e,"Brave/")?Ms:function(e,t){return t&&vr(t,"Apple")||function(e){return vr(e,ss)&&!vr(e,us)&&!vr(e,es)}(e)}(e,t)?vr(e,Xr)?bs:ss:vr(e,"PaleMoon/")?As:vr(e,"Waterfox/")?Os:vr(e,ps)?ps:vr(e,"MSIE")||vr(e,"Trident/")?cs:vr(e,"Gecko")?ps:"")},Ks=((i={})[ds]=[new RegExp("rv:(\\d+(\\.\\d+)?)")],i[fs]=[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],i[us]=[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],i[ls]=[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],i["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],i[ss]=[Ns],i[bs]=[Ns],i[hs]=[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],i[ps]=[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],i[_s]=[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],i[Es]=[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],i[os]=[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Ns],i[ys]=[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],i[as]=[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],i[Fs]=[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],i[Ts]=[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],i[Is]=[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],i[Rs]=[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],i[Ms]=[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],i[$s]=[js],i[Ds]=[js],i[qs]=[js],i[Ls]=[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],i[As]=[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],i[Os]=[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],i[Bs]=[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],i[cs]=[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],i.Mozilla=[new RegExp("rv:(\\d+(\\.\\d+)?)")],i),Qs=function(e,t,n,i){var r=Ks[Gs(e,t,n,i)];if(Ar(r))return null;for(var s=0;r.length>s;s++){var o=e.match(r[s]);if(o)return parseFloat(o[o.length-2])}return null},Zs=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),function(e){return[ms,e&&e[1]||""]}],[new RegExp(vs,"i"),[vs,""]],[new RegExp(gs,"i"),[gs,""]],[Us,[os,""]],[new RegExp(ws,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ss,""];if(new RegExp(Xr).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var i=Ws[n[1]]||"";return/arm/i.test(t)&&(i="RT"),[ws,i]}return[ws,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){return e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Ar(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),function(e){return e&&e[2]?[es,[e[2],e[3],e[4]||"0"].join(".")]:[es,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Js=function(e){for(var t=0;Zs.length>t;t++){var n=Zs[t],i=n[1],r=n[0].exec(e),s=r&&(Ir(i)?i(r,e):i);if(s)return s}return["",""]},Ys=function(e){return zs.test(e)?vs:Vs.test(e)?gs:Hs.test(e)?ms:new RegExp(ks,"i").test(e)?ks:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?Ss:/iPad/.test(e)?is:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?rs:Us.test(e)?os:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(xs,"i").test(e)?xs:/(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(Xr).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)?es:ns:new RegExp("(pda|Mobile)","i").test(e)?Cs:new RegExp(ts,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?Ps:""},Xs=function(e,t){var n,i,r,s,o=Ys(e);return o===is||o===ns||"Kobo"===o||"Kindle Fire"===o||o===Ps?ts:o===vs||o===ms||o===gs||o===ks?"Console":o===rs?"Wearable":o?Xr:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(n=null==t?void 0:t.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(r=null==t?void 0:t.screenHeight)&&void 0!==r?r:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?Xr:ts:"Desktop"},eo=/\bFBAV\/(\d+(?:\.\d+)*)/i,to=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",eo],[/\bFBAN\/EMA\b/i,"Facebook Lite",eo],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",eo],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],no="[Truncated]",io="[Unserializable]";function ro(e){for(var t="",n=0;e.length>n;n++){var i=e.charCodeAt(n);if(55296>i||i>56319)t+=56320>i||i>57343?e[n]:"�";else{var r=e.charCodeAt(n+1);56320>r||r>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}Date,Date;var so,oo,ao,uo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function lo(e,t){return"string"==typeof(n=e)&&uo.test(n)?e:t();var n}function co(e,t){var n=new Error(t);try{Object.defineProperty(n,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return n}function ho(e){return e?e.split("#")[0]:e}function fo(e,t){var n=setTimeout(e,t);return null!=n&&n.unref&&(null==n||n.unref()),n}function po(e,t,n){return _o.apply(this,arguments)}function _o(){return(_o=p(l().m(function e(t,n,i){var r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Promise.race([t,new Promise(function(e,t){r=fo(function(){try{null==i||i(),e()}catch(e){t(e)}},n)})]);case 1:return e.a(2,e.v);case 2:return e.p=2,clearTimeout(r),e.f(2);case 3:return e.a(2)}},e,null,[[0,,2,3]])}))).apply(this,arguments)}function vo(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return ao&&n.length===oo?ao:(oo=n.length,ao=n.reduce(function(n,i){so||(so={});var r=so[i];if(r)n[r[0]]=r[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a,u=null==(a=s[o])?void 0:a.filename,l=t[i];if(u&&l){n[u]=l,so[i]=[u,l];break}}return n},{}))}}var go=function(){"use strict";function e(e,t,n){void 0===n&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}var t=e.prototype;return t.buildFromUnknown=function(e,t){void 0===t&&(t={});var n=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(n,t,0).apply(e),r=this.buildParsingContext(t),s=this.parseStacktrace(i,r);return{$exception_list:this.convertToExceptionList(s,n),$exception_level:"error"}},t.modifyFrames=function(){var e=p(l().m(function e(t){var n,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:n=d(t);case 1:if((i=n()).done){e.n=4;break}if(!((r=i.value).stacktrace&&r.stacktrace.frames&&Tr(r.stacktrace.frames))){e.n=3;break}return e.n=2,this.applyModifiers(r.stacktrace.frames);case 2:r.stacktrace.frames=e.v;case 3:e.n=1;break;case 4:return e.a(2,t)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.coerceFallback=function(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}},t.parseStacktrace=function(e,t){var n,i;return null!=e.cause&&(n=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),u({},e,{cause:n,stack:i})},t.applyChunkIds=function(e,t){return e.map(function(e){return e.filename&&t&&(e.chunk_id=t[e.filename]),e})},t.applyCoercers=function(e,t){for(var n,i=d(this.coercers);!(n=i()).done;){var r=n.value;if(r.match(e))return r.coerce(e,t)}return this.coerceFallback(t)},t.applyModifiers=function(){var e=p(l().m(function e(t){var n,i,r,s;return l().w(function(e){for(;;)switch(e.n){case 0:n=t,i=d(this.modifiers);case 1:if((r=i()).done){e.n=4;break}return s=r.value,e.n=2,s(n);case 2:n=e.v;case 3:e.n=1;break;case 4:return e.a(2,n)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.convertToExceptionList=function(e,t){var n,i,r,s={type:e.type,value:e.value,mechanism:{type:null!==(n=t.type)&&void 0!==n?n:"generic",handled:null===(i=t.handled)||void 0===i||i,synthetic:null!==(r=e.synthetic)&&void 0!==r&&r}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var o=[s];return null!=e.cause&&o.push.apply(o,this.convertToExceptionList(e.cause,u({},t,{handled:!0}))),o},t.buildParsingContext=function(e){var t;return{chunkIdMap:vo(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}},t.buildCoercingContext=function(e,t,n){var i=this;void 0===n&&(n=0);var r=function(n,r){if(4>=r){var s=i.buildCoercingContext(e,t,r);return i.applyCoercers(n,s)}};return u({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:e,apply:function(e){return r(e,n)},next:function(e){return r(e,n+1)}})},e}();function mo(e,t,n,i,r){var s={platform:e,filename:t,function:"<anonymous>"===n?"?":n,in_app:!!t&&!t.startsWith("webkit-masked-url://")&&"<anonymous>"!==t};return Ar(i)||(s.lineno=i),Ar(r)||(s.colno=r),s}var yo=function(e,t){var n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},bo=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wo=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,So=/\((\S*)(?::(\d+))(?::(\d+))\)/,xo=function(e,t){var n=bo.exec(e);if(n)return mo(t,n[1],"?",+n[2],+n[3]);var i=wo.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){var r=So.exec(i[2]);r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3])}var s=yo(i[1]||"?",i[2]);return mo(t,s[1],s[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},ko=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Co=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Po=function(e,t){var n=ko.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var i=Co.exec(n[3]);i&&(n[1]=n[1]||"eval",n[3]=i[1],n[4]=i[2],n[5]="")}var r=n[3],s=n[1]||"?",o=yo(s,r);return mo(t,r=o[1],s=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Eo=/\(error: (.*)\)/;var Fo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return this.isDOMException(e)||this.isDOMError(e)},t.coerce=function(e,t){var n=Or(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}},t.getType=function(e){return this.isDOMError(e)?"DOMError":"DOMException"},t.getValue=function(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t},t.isDOMException=function(e){return zr(e,"DOMException")},t.isDOMError=function(e){return zr(e,"DOMError")},e}(),To=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Ur(e)},t.coerce=function(e,t){var n,i=this.getStack(e),r=void 0===i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=i?i:null==(n=t.syntheticException)?void 0:n.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:r}},t.getType=function(e){return e.name||e.constructor.name},t.getMessage=function(e,t){var n=e.message;return String(n.error&&"string"==typeof n.error.message?n.error.message:n)},t.getStack=function(e){return e.stacktrace||e.stack||void 0},e}(),Io=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return!!zr(e,"ErrorEvent")&&(null!=e.error||this._hasUsableMessage(e))},t.coerce=function(e,t){var n;if(null!=e.error)return t.apply(e.error);var i=t.apply(e.message);return u({},i,{stack:null!==(n=this._buildLocationStack(e))&&void 0!==n?n:i.stack,synthetic:!0})},t._hasUsableMessage=function(e){return Or(e.message)&&e.message.length>0},t._buildLocationStack=function(e){var t,n,i=e,r=null!==(t=i.lineno)&&void 0!==t?t:0,s=null!==(n=i.colno)&&void 0!==n?n:0;if(Or(i.filename)&&0!==i.filename.length&&0!==r)return"Error\n at "+i.filename+":"+r+":"+s},e}(),Ro=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Lo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return"string"==typeof e},t.coerce=function(e,t){var n,i=this.getInfos(e),r=i[0],s=i[1];return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},t.getInfos=function(e){var t="Error",n=e,i=e.match(Ro);return i&&(t=i[1],n=i[2]),[t,n]},e}(),Ao=["fatal","error","warning","log","info","debug"];function Oo(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(t>=r.length)return i===n.length?r:r.length>t?r.slice(0,t)+"...":r}return""}var Mo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return"object"==typeof e&&null!==e},t.coerce=function(e,t){var n,i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!==(n=this.getStack(e))&&void 0!==n?n:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}},t.getType=function(e){if(Wr(e))return e.constructor.name;var t="name"in e?e.name:void 0;return Or(t)&&!Mr(t)?t:"Error"},t.getValue=function(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 n=this.getObjectClassName(e);return(n&&"Object"!==n?"'"+n+"'":"Object")+" captured as exception with keys: "+Oo(e)},t.isSeverityLevel=function(e){return Or(e)&&!Mr(e)&&Ao.indexOf(e)>=0},t.getStack=function(e){try{return Or(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:Or(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}},t.getErrorPropertyFromObject=function(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(Ur(n))return n}},t.getObjectClassName=function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}},e}(),$o=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Wr(e)},t.coerce=function(e,t){var n,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Oo(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Do=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Vr(e)},t.coerce=function(e,t){var n;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),qo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return zr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)},t.isCustomEventWrappingRejection=function(e){if(!Wr(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}},t.coerce=function(e,t){var n,i=this.getUnhandledRejectionReason(e);return Vr(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}:t.apply(i)},t.getUnhandledRejectionReason=function(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e},e}(),Bo="$message",No="$timestamp",jo=new Set([Bo,No]),Ho={enabled:!0,max_bytes:32768};function Vo(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:Ho.enabled,max_bytes:Uo(e.max_bytes,Ho.max_bytes)}:u({},Ho)}var zo=function(){"use strict";function e(e){this._entries=[],this._totalBytes=0,this._config=Vo(e)}var t=e.prototype;return t.setConfig=function(e){this._config=Vo(e),this._trimToMaxBytes()},t.add=function(e){var t=function(e){var t;try{t=yr(e)}catch(e){return}try{var n=JSON.parse(t);if(!Rr(n))return;var i=n,r=i[Bo],s=i[No];if(!Or(r)||0===r.trim().length)return;if(!Or(s)&&!qr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var n=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),n=0,i=0;t.length>i;i++)"%"===t[i]?(n+=1,i+=2):n+=1;return n}(t.json);n>this._config.max_bytes||(this._entries.push({step:t.step,bytes:n}),this._totalBytes+=n,this._trimToMaxBytes())}},t.getAttachable=function(){return this._entries.map(function(e){return e.step})},t.clear=function(){this._entries=[],this._totalBytes=0},t.size=function(){return this._entries.length},t._trimToMaxBytes=function(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){var e=this._entries.shift();e&&(this._totalBytes-=e.bytes)}},e}();function Uo(e,t){if(!qr(e)||1/0===e||-1/0===e)return t;var n=Math.floor(e);return 0>n?t:n}var Wo=function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function Go(e){return"string"==typeof e||e}function Ko(e){return"string"==typeof e?e:void 0}var Qo,Zo=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain"].concat(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],["$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"]),Jo="NativeGzipValidationError",Yo=function(e){return e.length>=2&&31===e[0]&&139===e[1]},Xo=function(e,t){return e===wr.GZipJS||t===wr.GZipJS||"gzip"===t},ea=function(e){return!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"")},ta=function(e){for(var t=function(){if(Qo)return Qo;Qo=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;Qo[e]=t>>>0}return Qo}(),n=4294967295,i=0;e.length>i;i++)n=t[255&(n^e[i])]^n>>>8;return(4294967295^n)>>>0},na=function(e){throw co(Jo,"Native gzip produced invalid output: "+e)},ia=function(){var e=p(l().m(function e(t,n){var i,r,s,o,a;return l().w(function(e){for(;;)switch(e.n){case 0:return 18>t.size&&na("too-short"),o=Uint8Array,e.n=1,t.slice(0,10).arrayBuffer();case 1:return i=new o(e.v),Yo(i)&&8===i[2]||na("invalid-header"),a=DataView,e.n=2,t.slice(t.size-8).arrayBuffer();case 2:(r=new a(e.v)).getUint32(0,!0)!==ta(n)&&na("invalid-crc"),s=n.length>>>0,r.getUint32(4,!0)!==s&&na("invalid-size");case 3:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}();function ra(e,t,n){return sa.apply(this,arguments)}function sa(){return sa=p(l().m(function e(t,n,i){var r,s,o,a,u,c,d;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return void 0===n&&(n=!0),e.p=1,r=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(r).then(function(){return o.close()}).catch(function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,o.abort(t);case 1:e.n=3;break;case 2:e.p=2;case 3:throw t;case 4:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}()),u=new Response(s.readable).blob(),e.n=2,Promise.all([u,a]);case 2:return c=e.v[0],e.n=3,ia(c,r);case 3:return e.a(2,c);case 4:if(e.p=4,d=e.v,null==i||!i.rethrow){e.n=5;break}throw d;case 5:return n&&console.error("Failed to gzip compress data",d),e.a(2,null)}},e,null,[[1,4]])})),sa.apply(this,arguments)}var oa={}.propertyIsEnumerable;function aa(e,t){try{return ca(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function ua(e,t,n,i){if(0>=n.remainingNodes)return{stringValue:no};if(n.remainingNodes--,Nr(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){var n=e.toString(),i=BigInt("9223372036854775808");return e>=i||-i>e?(null==t||t.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}(e,t);if("number"==typeof e){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};var r=BigInt(e).toString();return e>=0x8000000000000000||-0x8000000000000000>e?(null==t||t.debug("Attribute "+r+" is outside the int64 range; encoding it as a string"),{stringValue:r}):{intValue:r}}return{doubleValue:e}}if("string"==typeof e)return{stringValue:ro(e)};if("function"==typeof e)return{stringValue:"[Function]"};if("symbol"==typeof e)return{stringValue:String(e)};if("object"==typeof e&&null!==e){if(n.ancestors.has(e))return{stringValue:"[Circular]"};if(i>=20)return{stringValue:no};if(e instanceof Date){var s=e.getTime(),o=Number.isFinite(s)?e.toISOString():String(e);return{stringValue:"string"==typeof o?ro(o):String(o)}}n.ancestors.add(e);try{try{var a=e.toJSON;if("function"==typeof a)return ua(a.call(e),t,n,i+1)}catch(e){}return Tr(e)?{arrayValue:{values:la(e,t,n,i+1)}}:{kvlistValue:{values:ca(e,t,n,i+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:ro(String(e))}}function la(e,t,n,i){for(var r=[],s=Math.min(e.length,1e3),o=0;s>o&&n.remainingNodes>0;o++)try{var a=o in e?e[o]:void 0;if(Dr(a))continue;r.push(ua(a,t,n,i))}catch(e){r.push({stringValue:io})}return e.length>o&&r.push({stringValue:no}),r}function ca(e,t,n,i){var r=[];for(var s in e)if(oa.call(e,s)){if(!s){null==t||t.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>=n.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=e[s];if($r(o)||Ar(o))continue;r.push({key:ro(s),value:ua(o,t,n,i)})}catch(e){r.push({key:ro(s),value:{stringValue:io}})}}return r}function da(e,t,n){return u({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":n})}var ha={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var fa={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},pa=fa.info;function _a(e){try{return ro(String(e))}catch(e){return io}}function va(e,t,n,i){var r,s=fa[e.level||"info"]||pa,o=s.text,a=s.number,l=(void 0===(r=qr(i)?i:void 0)&&(r=Date.now()),String(r)+"000000"),c={};t.distinctId&&(c.posthogDistinctId=t.distinctId),t.sessionId&&(c.sessionId=t.sessionId),t.windowId&&(c["window.id"]=t.windowId),Dr(t.sessionStartTimestamp)||(c.sessionStartTimestamp=String(t.sessionStartTimestamp)),Dr(t.lastActivityTimestamp)||(c.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(c["url.full"]=t.currentUrl),t.screenName&&(c["screen.name"]=t.screenName),t.appState&&(c["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(c.feature_flags=t.activeFeatureFlags);var h=u({},c),f=e.attributes;if(f){var p=[];try{p=Object.keys(f)}catch(e){p=[]}for(var _,v=d(p);!(_=v()).done;){var g=_.value,m=void 0;try{m=f[g]}catch(e){m=io}Object.defineProperty(h,g,{value:m,enumerable:!0,writable:!0,configurable:!0})}}var y={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:a,severityText:o,body:{stringValue:_a(e.body)},attributes:aa(h,n)};return e.trace_id&&(y.traceId=e.trace_id),e.span_id&&(y.spanId=e.span_id),Ar(e.trace_flags)||(y.flags=e.trace_flags),y}function ga(e,t,n){return da(e,t,n)}function ma(e,t,n,i){return{resourceLogs:[{resource:{attributes:aa(t)},scopeLogs:[{scope:{name:n,version:i},logRecords:e}]}]}}var ya=function(){"use strict";function e(e,t,n,i,r,s,o){var a;void 0===s&&(s=function(){return Promise.resolve()}),this._instance=e,this._config=t,this._logger=n,this._getContext=i,this._onReady=r,this._waitForStoragePersist=s,this._scopeName=o,this._flushPromise=null,this._evictedSinceAdvance=0,this._queueGeneration=0,this._consecutiveFlushFailures=0,this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._maxBufferSize=t.maxBufferSize,this._maxQueueSize=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this._flushIntervalMs=t.flushIntervalMs,this._maxBatchRecordsPerPost=t.maxBatchRecordsPerPost,this._rateCapWindowMs=t.rateCapWindowMs,this._maxLogsPerInterval=t.maxLogsPerInterval}var t=e.prototype;return t.clearQueue=function(){this._queueGeneration++,this._instance.setPersistedProperty(br.LogsQueue,[])},t.reset=function(){this._clearFlushTimer(),this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._consecutiveFlushFailures=0,this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost},t.onReconnect=function(){this._consecutiveFlushFailures=0,this._flushInBackground()},t.captureLog=function(e,t){var n,i=this;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var r=this._runBeforeSend(e);if(null!==r)if(r.body){if(this._checkRateLimit()){var s={record:va(r,null!==(n=null==t?void 0:t.context)&&void 0!==n?n:this._getContext(),this._logger,null==t?void 0:t.occurredAtMs)};this._onReady(function(){return i._enqueue(s)})}}else this._logger.info("Log was rejected in beforeSend function")}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,i=e,r=d(Tr(t)?t:[t]);!(n=r()).done;){var s=n.value;try{var o=s(i);if(!o)return this._logger.info("Log was rejected in beforeSend function"),null;i=o}catch(e){return this._logger.error("Error in beforeSend function for log:",e),null}}return i},t._checkRateLimit=function(){if(void 0===this._maxLogsPerInterval)return!0;var e=Date.now(),t=e-this._intervalWindowStart;return this._rateCapWindowMs>t&&t>=0||(this._intervalWindowStart=e,this._intervalLogCount=0,this._droppedWarned=!1),this._maxLogsPerInterval>this._intervalLogCount?(this._intervalLogCount++,!0):(this._droppedWarned||(this._logger.warn("captureLog dropping logs: exceeded "+this._maxLogsPerInterval+" logs per "+this._rateCapWindowMs+"ms"),this._droppedWarned=!0),!1)},t.flush=function(){var e=p(l().m(function e(){var t=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(!this._instance.isDisabled){e.n=1;break}return e.a(2);case 1:if(!this._flushPromise){e.n=2;break}return e.a(2,this._flushPromise);case 2:return this._flushPromise=this._flushInner().finally(function(){t._flushPromise=null}),e.a(2,this._flushPromise)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._flushInner=function(){var e=p(l().m(function e(){var t,n,i,r,s,o,a,u,c,d,h,f;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._clearFlushTimer(),0!==(n=null!==(t=this._instance.getPersistedProperty(br.LogsQueue))&&void 0!==t?t:[]).length){e.n=1;break}return e.a(2);case 1:i=n.length,r=0;case 2:if(0>=n.length||r>=i){e.n=9;break}return a=this._queueGeneration,this._evictedSinceAdvance=0,u=Math.min(n.length,this._maxBatchRecordsPerPost),c=n.slice(0,u),d=c.map(function(e){return e.record}),h=ma(d,this._buildResourceAttributes(),null!==(s=this._scopeName)&&void 0!==s?s:this._instance.getLibraryId(),this._instance.getLibraryVersion()),e.n=3,this._instance._sendLogsBatch(h);case 3:if(f=e.v,this._queueGeneration===a){e.n=4;break}return e.a(2);case 4:if("too-large"!==f.kind||1>=c.length){e.n=5;break}return this._maxBatchRecordsPerPost=Math.max(1,Math.floor(c.length/2)),this._logger.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+this._maxBatchRecordsPerPost),e.a(3,2);case 5:if("retry-later"!==f.kind){e.n=6;break}throw f.error;case 6:return"too-large"===f.kind?this._logger.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===f.kind&&this._config.maxBatchRecordsPerPost>this._maxBatchRecordsPerPost&&(this._maxBatchRecordsPerPost=Math.min(this._config.maxBatchRecordsPerPost,this._maxBatchRecordsPerPost+1)),e.n=7,this._persistQueueAdvance(c.length);case 7:if(n=null!==(o=this._instance.getPersistedProperty(br.LogsQueue))&&void 0!==o?o:[],r+=c.length,"fatal"!==f.kind){e.n=8;break}throw f.error;case 8:e.n=2;break;case 9:return e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._persistQueueAdvance=function(){var e=p(l().m(function e(t){var n,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:return i=Math.max(0,t-this._evictedSinceAdvance),r=null!==(n=this._instance.getPersistedProperty(br.LogsQueue))&&void 0!==n?n:[],this._instance.setPersistedProperty(br.LogsQueue,r.slice(i)),e.n=1,this._waitForStoragePersist();case 1:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t._buildResourceAttributes=function(){return ga(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion())},t._enqueue=function(e){var t;if(!this._instance.optedOut){var n=null!==(t=this._instance.getPersistedProperty(br.LogsQueue))&&void 0!==t?t:[];this._maxQueueSize>n.length||(n.shift(),this._evictedSinceAdvance++,this._logger.info("Logs queue is full, dropping oldest record.")),n.push(e),this._instance.setPersistedProperty(br.LogsQueue,n),this._maxBufferSize>n.length?this._armFlushTimer():this._flushInBackground()}},t._armFlushTimer=function(e){var t=this;void 0===e&&(e=this._flushIntervalMs),this._flushTimer||(this._flushTimer=fo(function(){t._flushTimer=void 0,t._flushInBackground()},e))},t._nextFlushDelay=function(){var e=Math.min(Math.max(0,this._consecutiveFlushFailures-1),6);return this._flushIntervalMs*Math.pow(2,e)},t._hasQueuedRecords=function(){var e=this._instance.getPersistedProperty(br.LogsQueue);return!!e&&e.length>0},t.shutdown=function(){var e=p(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._clearFlushTimer(),n=this.flush().catch(function(){}),void 0!==t){e.n=2;break}return e.n=1,n;case 1:return e.a(2,void 0);case 2:return e.n=3,po(n,t);case 3:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.flushWithTimeout=function(){var e=p(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:return n=this.flush(),e.n=1,po(n,t,function(){n.catch(function(){})});case 1:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t._flushInBackground=function(){var e=this;this.flush().then(function(){e._consecutiveFlushFailures=0},function(t){e._consecutiveFlushFailures++,e._logger.error("PostHog logs flush failed:",t)}).finally(function(){!e._instance.isDisabled&&e._hasQueuedRecords()&&e._armFlushTimer(e._nextFlushDelay())})},t._clearFlushTimer=function(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)},e}(),ba=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function wa(e){return String(e)+"000000"}function Sa(e,t,n,i){var r="";return i&&(r=Object.keys(i).sort().map(function(e){return JSON.stringify(e)+":"+JSON.stringify(i[e])}).join(",")),e+"\0"+t+"\0"+(null!=n?n:"")+"\0"+r}var xa=function(){"use strict";function e(e,t,n){this._instance=e,this._config=t,this._logger=n,this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._generation=0}var t=e.prototype;return t.count=function(e,t,n){void 0===t&&(t=1),this._capture({name:e,type:"count",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.gauge=function(e,t,n){this._capture({name:e,type:"gauge",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.histogram=function(e,t,n){this._capture({name:e,type:"histogram",value:t,unit:null==n?void 0:n.unit,attributes:null==n?void 0:n.attributes})},t.flush=function(){var e=this,t=this._flushPromise,n=function(){var n=p(l().m(function n(){return l().w(function(n){for(;;)switch(n.n){case 0:if(!t){n.n=1;break}return n.n=1,t.catch(function(){});case 1:return n.n=2,e._doFlush();case 2:return n.a(2)}},n)}));return function(){return n.apply(this,arguments)}}()().finally(function(){e._flushPromise===n&&(e._flushPromise=null)});return this._flushPromise=n,n},t.drainWindow=function(){if(0===this._series.size)return null;var e=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(e)},t.reset=function(){this._generation++,this._clearFlushTimer(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set},t._capture=function(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this._runBeforeSend(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this._logger.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var n,i;try{n=t.attributes?u({},t.attributes):void 0,i=Sa(t.type,t.name,t.unit,n)}catch(e){return void this._logger.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var r=this._series.get(i);if(!r){if(!this._admitNewSeries())return;r={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this._series.set(i,r)}var s=this._typeByName.get(t.name);void 0===s?this._typeByName.set(t.name,t.type):s===t.type||this._typeCollisionWarned.has(t.name)||(this._typeCollisionWarned.add(t.name),this._logger.warn("Metric name '"+t.name+"' is already used as a "+s+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this._fold(r,t.value),this._armFlushTimer()}else this._logger.warn("Dropping metric '"+t.name+"': value must be a finite number");else this._logger.warn("Dropping metric with empty name")}},t._admitNewSeries=function(){return this._config.maxSeriesPerFlush>this._series.size||(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn("Metric series cap reached ("+this._config.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)},t._fold=function(e,t){var n;switch(e.type){case"count":e.total=(null!==(n=e.total)&&void 0!==n?n:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(ba.length+1).fill(0)});var i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[function(e,t){for(var n=0;t.length>n;n++)if(t[n]>=e)return n;return t.length}(t,ba)]+=1}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,i=e,r=d(Tr(t)?t:[t]);!(n=r()).done;){var s=n.value;try{var o=s(i);if(!o)return this._logger.info("Metric was rejected in beforeSend function"),null;i=o}catch(e){return this._logger.error("Error in beforeSend function for metric:",e),null}}return i},t._armFlushTimer=function(){var e=this;this._flushTimer||(this._flushTimer=fo(function(){e._flushTimer=void 0,e.flush().catch(function(t){e._logger.error("Metrics flush failed:",t)})},this._config.flushIntervalMs))},t._clearFlushTimer=function(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)},t._doFlush=function(){var e=p(l().m(function e(){var t,n,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:if(0!==this._series.size){e.n=1;break}return e.a(2);case 1:return t=this._series,this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,n=this._generation,e.n=2,this._instance._sendMetricsBatch(this._buildPayload(t));case 2:if(i=e.v,n===this._generation){e.n=3;break}return e.a(2);case 3:e.n="ok"===(r=i.kind)?4:"retry-later"===r?5:"too-large"===r?6:"fatal"===r?7:8;break;case 4:case 8:return e.a(2);case 5:return this._mergeWindowBack(t),this._armFlushTimer(),e.a(2);case 6:return this._logger.warn("Metrics batch exceeded the server size limit and was dropped"),e.a(2);case 7:return this._logger.error("Failed to send metrics batch:",i.error),e.a(2)}},e,this)}));return function(){return e.apply(this,arguments)}}(),t._buildPayload=function(e){return t=this._buildMetrics(e),n=function(e,t,n){return da(e,t,n)}(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),i=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:aa(n)},scopeMetrics:[{scope:{name:i,version:r},metrics:t}]}]};var t,n,i,r},t._buildMetrics=function(e){for(var t,n=wa(Date.now()),i=new Map,r=d(e.values());!(t=r()).done;){var s,o=t.value,a=Sa(o.type,o.name,o.unit,void 0),l=i.get(a);l||(l=u({name:o.name},o.unit&&{unit:o.unit}),"count"===o.type?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===o.type?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},i.set(a,l));var c=aa(null!==(s=o.attributes)&&void 0!==s?s:{},this._logger),h=wa(o.windowStartMs);if("count"===o.type){var f,p={attributes:c,startTimeUnixNano:h,timeUnixNano:n,asDouble:null!==(f=o.total)&&void 0!==f?f:0};l.sum.dataPoints.push(p)}else if("gauge"===o.type){var _,v={attributes:c,timeUnixNano:n,asDouble:null!==(_=o.last)&&void 0!==_?_:0};l.gauge.dataPoints.push(v)}else o.hist&&l.histogram.dataPoints.push({attributes:c,startTimeUnixNano:h,timeUnixNano:n,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:ba})}return Array.from(i.values())},t._mergeWindowBack=function(e){for(var t,n,i,r=d(e);!(i=r()).done;){var s=i.value,o=s[0],a=s[1],u=this._series.get(o);if(u)switch(u.windowStartMs=Math.min(u.windowStartMs,a.windowStartMs),u.type){case"count":u.total=(null!==(t=u.total)&&void 0!==t?t:0)+(null!==(n=a.total)&&void 0!==n?n:0);break;case"gauge":break;case"histogram":if(a.hist)if(u.hist){u.hist.count+=a.hist.count,u.hist.sum+=a.hist.sum,u.hist.min=Math.min(u.hist.min,a.hist.min),u.hist.max=Math.max(u.hist.max,a.hist.max);for(var l=0;u.hist.bucketCounts.length>l;l++)u.hist.bucketCounts[l]+=a.hist.bucketCounts[l]}else u.hist=a.hist}else this._admitNewSeries()&&this._series.set(o,a)}},e}();function ka(e,t){var n;if(e)return null==(n=e.find(function(e){return e.type===t}))?void 0:n.value}function Ca(e){var t=!0;return{dispose:function(){if(t){t=!1;var n=e();n&&Ir(n.then)&&n.then(void 0,function(){})}}}}var Pa="0.8.0",Ea={DEBUG:!1,LIB_VERSION:Pa,LIB_NAME:"browser-common",JS_SDK_VERSION:Pa},Fa="u">typeof window?window:void 0,Ta="u">typeof globalThis?globalThis:Fa,Ia=null==Ta?void 0:Ta.navigator,Ra=null==Ta?void 0:Ta.document,La=null==Ta?void 0:Ta.location,Aa=null==Ta?void 0:Ta.fetch,Oa=null!=Ta&&Ta.XMLHttpRequest&&"withCredentials"in new Ta.XMLHttpRequest?Ta.XMLHttpRequest:void 0,Ma=null==Ta?void 0:Ta.AbortController,$a=null==Ta?void 0:Ta.CompressionStream,Da=null==Ia?void 0:Ia.userAgent;function qa(){return!(!Fa||!1===Fa.navigator.onLine)}var Ba=function(e,t){var n=(void 0===t?{}:t).debugEnabled,i={_log:function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;i>s;s++)r[s-1]=arguments[s];Fa&&(Ea.DEBUG||Fa.POSTHOG_DEBUG||n)&&!Ar(Fa.console)&&Fa.console&&("__rrweb_original__"in Fa.console[t]?Fa.console[t].__rrweb_original__:Fa.console[t]).apply(void 0,[e].concat(r))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];i._log.apply(i,["debug"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];i._log.apply(i,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];i._log.apply(i,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];i._log.apply(i,["error"].concat(t))},critical:function(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];(t=console).error.apply(t,[e].concat(i))},uninitializedWarning:function(e){i.error("You must initialize PostHog before calling "+e)},createLogger:function(t,n){return Ba(e+" "+t,n)}};return i},Na=Ba("[PostHog.js]"),ja=Na.createLogger;function Ha(e,t){Tr(e)&&e.forEach(t)}function Va(e,t){if(!Dr(e))if(Tr(e))e.forEach(t);else if(function(e){return e instanceof FormData}(e))e.forEach(function(e,n){return t(e,n)});else for(var n in e)Er.call(e,n)&&t(e[n],n)}var za=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];for(var r=0,s=n;s.length>r;r++){var o=s[r];for(var a in o)void 0!==o[a]&&(e[a]=o[a])}return e};function Ua(e){for(var t=Object.keys(e),n=t.length,i=new Array(n);n--;)i[n]=[t[n],e[t[n]]];return i}var Wa=function(e){try{return e()}catch(e){return}},Ga=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){Na.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Na.critical(e)}}},Ka=function(e){var t={};return Va(e,function(e,n){(Or(e)&&e.length>0||qr(e))&&(t[n]=e)}),t};var Qa=["herokuapp.com","vercel.app","netlify.app"];function Za(e){var t=null==e?void 0:e.hostname;if(!Or(t))return!1;for(var n=t.split(".").slice(-2).join("."),i=0,r=Qa;r.length>i;i++)if(n===r[i])return!1;return!0}function Ja(e,t,n,i){var r=null!=i?i:{},s=r.capture,o=r.passive;null==e||e.addEventListener(t,n,{capture:void 0!==s&&s,passive:void 0===o||o})}function Ya(e){return"ph_toolbar_internal"===e.name}function Xa(e){return"$survey_response_"+e}function eu(e,t){if(!t)return null;var n=e[Xa(t)];return Tr(n)?[].concat(n):n}function tu(e,t,n){void 0===e&&(e={});var i={};return t.questions.forEach(function(t){if(!Ar(t.originalQuestionIndex)){var n,r=0===(n=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+n,s=eu(e,t.id);Ar(s)||(i[r]=s)}}),u({$survey_questions:t.questions.map(function(t){var i,r;return{id:t.id,question:null!==(i=null==n?void 0:n[null!==(r=t.id)&&void 0!==r?r:""])&&void 0!==i?i:t.question,response:eu(e,t.id)}})},e,i)}function nu(e,t){var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n}function iu(e){return"string"==typeof e&&e.trim()?e.trim():null}function ru(e){return e.toLowerCase()}function su(e,t,n){if(!e||!t)return null;var i=ru(t),r=Object.keys(e).find(function(e){return ru(e)===i});if(r)return null==n||n.debug("Found exact translation match: "+r),r;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(e).find(function(e){return ru(e)===s});if(o)return null==n||n.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}var ou=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function au(e,t,n){var i,r=su(e.translations,t,n),s=u({},e),o=!1;if(r){var a,l=null==(a=e.translations)?void 0:a[r];if(l)if(null==n||n.info("Applying survey-level translation for language: "+r),Ar(l.name)||(s.name=l.name,o=!0),s.appearance){for(var c=u({},s.appearance),d=0,h=ou;h.length>d;d++){var f=h[d],p=l[f];Ar(p)||(c[f]=p,o=!0)}s.appearance=c}else(function(e){return ou.some(function(t){return!Ar(e[t])})})(l)&&(o=!0)}var _=e.questions.map(function(e){return function(e,t,n){var i,r=su(e.translations,t,n);if(!r)return{question:e,matchedKey:null,hasChanges:!1};var s=null==(i=e.translations)?void 0:i[r];if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=u({},e),a=!1;return Ar(s.question)||(o.question=s.question,a=!0),Ar(s.description)||(o.description=s.description,a=!0),Ar(s.buttonText)||(o.buttonText=s.buttonText,a=!0),"link"in o&&!Ar(s.link)&&(o.link=s.link,a=!0),"lowerBoundLabel"in o&&!Ar(s.lowerBoundLabel)&&(o.lowerBoundLabel=s.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!Ar(s.upperBoundLabel)&&(o.upperBoundLabel=s.upperBoundLabel,a=!0),"choices"in o&&function(e){return Tr(e.choices)}(s)&&(o.choices=s.choices,a=!0),{question:a?o:e,matchedKey:a?r:null,hasChanges:a}}(e,t,n)}),v=_.map(function(e){return e.question}),g=_.some(function(e){return e.hasChanges}),m=null;return r||(m=(null==(i=_.find(function(e){return e.matchedKey}))?void 0:i.matchedKey)||null),g&&(s.questions=v,o=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:s,matchedKey:o?r||m:null}}function uu(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function lu(e){var t;return uu(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var cu=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}},du=function(e){return e.toLowerCase()},hu={exact:function(e,t){return t.some(function(t){return e.some(function(e){return t===e})})},is_not:function(e,t){return t.every(function(t){return e.every(function(e){return t!==e})})},regex:function(e,t){return t.some(function(t){return e.some(function(e){return cu(t,e)})})},not_regex:function(e,t){return t.every(function(t){return e.every(function(e){return!cu(t,e)})})},icontains:function(e,t){return t.map(du).some(function(t){return e.map(du).some(function(e){return t.includes(e)})})},not_icontains:function(e,t){return t.map(du).every(function(t){return e.map(du).every(function(e){return!t.includes(e)})})},gt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n>parseFloat(e)})})},lt:function(e,t){return t.some(function(t){var n=parseFloat(t);return!isNaN(n)&&e.some(function(e){return n<parseFloat(e)})})}};function fu(e,t){return!e||Object.entries(e).every(function(e){var n=e[1],i=null==t?void 0:t[e[0]];if(null==i)return!1;var r=hu[n.operator];return!!r&&r(n.values,[String(i)])})}var pu=ja("[Surveys]");function _u(e){return!(!e.start_date||e.end_date)}function vu(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var gu=function(e,t){return""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t)},mu=function(e){return gu("seenSurvey_",e)},yu=function(e){try{var t=mu(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){pu.error("Failed to persist survey seen state",e)}},bu=[Qi,Zi,"api"],wu={ignoreConditions:!1,ignoreDelay:!1,displayType:fr},Su="distinct_id",xu="$device_id",ku="$device_model",Cu="__alias",Pu="$fbc",Eu="$fbc_persistence",Fu="__timers",Tu="$autocapture_disabled_server_side",Iu="$heatmaps_enabled_server_side",Ru="$exception_capture_enabled_server_side",Lu="$error_tracking_suppression_rules",Au="$error_tracking_capture_extension_exceptions",Ou="$web_vitals_enabled_server_side",Mu="$dead_clicks_enabled_server_side",$u="$product_tours_enabled_server_side",Du="$logs_capture_enabled_server_side",qu="$web_vitals_allowed_metrics",Bu="$session_recording_remote_config",Nu="$replay_sample_rate",ju="$replay_override_sampling",Hu="$replay_override_linked_flag",Vu="$replay_override_url_trigger",zu="$replay_override_event_trigger",Uu="$sesid",Wu="$session_is_sampled",Gu="$enabled_feature_flags",Ku="$active_feature_flags",Qu="$early_access_features",Zu="$feature_flag_details",Ju="$feature_flag_payloads",Yu="$feature_flag_request_id",Xu="$minimal_flag_called_events",el="$override_feature_flags",tl="$override_feature_flag_payloads",nl="$stored_person_properties",il="$stored_group_properties",rl="$groups",sl="$surveys",ol="$surveys_loaded_at",al="$surveys_activated",ul="$surveys_activated_session",ll="$surveys_activated_timestamps",cl="ph_product_tours",dl="$flag_call_reported",hl="$flag_call_reported_session_id",fl="$feature_flag_errors",pl="$feature_flag_evaluated_at",_l="$user_state",vl="$client_session_props",gl="$capture_rate_limit",ml="$initial_campaign_params",yl="$initial_referrer_info",bl="$initial_person_info",wl="$epp",Sl="$posthog_cookieless",xl="$cookieless_mode",kl="$sdk_debug_extensions_init_method",Cl="$sdk_debug_extensions_init_time_ms",Pl="$sdk_debug_recording_script_not_loaded",El="PostHog loadExternalDependency extension not found.",Fl="anonymous",Tl="identified",Il="identified_only",Rl="visibilitychange",Ll="beforeunload",Al="$pageview",Ol="$pageleave",Ml="$identify",$l="$groupidentify";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return qr(e)&&isFinite(e)&&Math.floor(e)===e});var Dl=function(){"use strict";function e(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}e.fromFieldsV7=function(t,n,i,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>n||0>i||0>r||t>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/256,s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new e(s)};var t=e.prototype;return t.toString=function(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e},t.clone=function(){return new e(this.bytes.slice(0))},t.equals=function(e){return 0===this.compareTo(e)},t.compareTo=function(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0},e}(),ql=function(){"use strict";function e(){this._timestamp=0,this._counter=0,this._random=new jl}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(!Ar(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(Ar(t))throw new Error("Could not generate UUID after timestamp reset");return t},t.generateOrAbort=function(){var e,t=(e=Date.now(),qr(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0);if(t>this._timestamp)this._timestamp=t,this._resetCounter();else{if(this._timestamp>=t+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return Dl.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())},t._resetCounter=function(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())},e}(),Bl=function(e){if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Fa&&!Ar(Fa.crypto)&&crypto.getRandomValues&&(Bl=function(e){return crypto.getRandomValues(e)});var Nl,jl=function(){"use strict";function e(){this._buffer=new Uint32Array(8),this._cursor=1/0}return e.prototype.nextUint32=function(){return this._buffer.length>this._cursor||(Bl(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),Hl=function(){return Vl().toString()},Vl=function(){return(Nl||(Nl=new ql)).generate()},zl=function(e,t){try{return JSON.stringify(e,function(e,t){return"bigint"==typeof t?t.toString():t},t)}catch(t){return yr(e)}},Ul=function(e){var t=null==Ra?void 0:Ra.createElement("a");return Ar(t)?null:(t.href=e,t)},Wl=function(e,t){for(var n,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;i.length>r;r++){var s=i[r].split("=");if(s[0]===t){n=s;break}}if(!Tr(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch(e){Na.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Gl=function(e,t,n){if(!e||!t||!t.length)return e;for(var i=e.split("#"),r=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],u=(o||"").split("&"),l=[],c=0;u.length>c;c++){var d=u[c].split("=");Tr(d)&&(t.includes(d[0])?l.push(d[0]+"="+n):l.push(u[c]))}var h=a;return null!=o&&(h+="?"+l.join("&")),null!=r&&(h+="#"+r),h},Kl=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Ql=function(e,t){return e>=t&&qa()},Zl=function(e,t,n,i){if(0===e){if(qa()){var r=t+1;return r===n&&i(),r}return t}return 0};function Jl(e,t,n){return zl({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}function Yl(e,t){var n,i=null==e||null==(n=e.config)?void 0:n.get_current_url;if(!Ir(i))return t;try{var r=i(t);return Or(r)&&r?r:t}catch(e){return Na.error("Error in get_current_url, falling back to window.location.href",e),t}}function Xl(e){var t,n=null==Fa||null==(t=Fa.location)?void 0:t.href;return Ar(n)?void 0:Yl(e,n)}var ec=function(e){if(Ra){try{for(var t=e+"=",n=Ra.cookie.split(";").filter(function(e){return e.length}),i=0;n.length>i;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},tc="",nc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var ic=null,rc={_is_supported:function(){if(!$r(ic))return ic;if(ic=!1,Ra)try{var e="__ph_cookie_support_"+Hl();rc._set(e,"xyz"),ic='"xyz"'===ec(e),rc._remove(e)}catch(e){ic=!1}return ic},_error:function(e){Na.error("cookieStore error: "+e)},_get:ec,_parse:function(e){var t;try{t=JSON.parse(rc._get(e))||{}}catch(e){}return t},_set:function(e,t,n,i,r){if(!Ra)return!1;try{var s="",o="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Ra),tc)return tc;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),i=Math.min(n.length,8),r="dmn_chk_"+Hl();!tc&&i--;){var s=n.slice(i).join("."),o=r+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",tc=s)}return tc}(e);if(!n){var i=function(e){var t=e.match(nc);return t?t[0]:""}(e);i!==n&&Na.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}(Ra.location.hostname,i);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),s="; expires="+u.toUTCString()}r&&(o="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&Na.warn("cookieStore warning: large cookie, len="+l.length),Ra.cookie=l,!0}catch(e){return!1}},_remove:function(e,t){if(null!=Ra&&Ra.cookie)try{rc._set(e,"",-1,t)}catch(e){return}}},sc=null,oc={_is_supported:function(){if(!$r(sc))return sc;var e=!0;if(Ar(Fa))e=!1;else try{var t="__mplssupport__";oc._set(t,"xyz"),'"xyz"'!==oc._get(t)&&(e=!1),oc._remove(t)}catch(t){e=!1}return e||Na.error("localStorage unsupported; falling back to cookie store"),sc=e,e},_error:function(e){Na.error("localStorage error: "+e)},_get:function(e){try{return null==Fa?void 0:Fa.localStorage.getItem(e)}catch(e){oc._error(e)}return null},_parse:function(e){try{return JSON.parse(oc._get(e))||{}}catch(e){}return null},_set:function(e,t){try{return null==Fa||Fa.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){oc._error(e)}return!1},_remove:function(e){try{null==Fa||Fa.localStorage.removeItem(e)}catch(e){oc._error(e)}}},ac=[nl,Ku,Gu,Zu,Ju,Yu,pl,fl,dl],uc=[xu,Su,Uu,Wu,wl,bl,Eu,_l],lc=function(e){return e+"_cpm"},cc=["__proto__","constructor","prototype"],dc=function(e){if(!Rr(e))return{};var t={};return Object.keys(e).forEach(function(n){-1===cc.indexOf(n)&&(t[n]=e[n])}),t},hc=function(e,t){void 0===t&&(t=[]);var n={};return[].concat(uc,t).forEach(function(t){var i=e[t];Ar(i)||$r(i)||""===i||(n[t]=i)}),n},fc=function(e){for(var t=5381,n=2166136261,i=0;e.length>i;i++){var r=e.charCodeAt(i);t=33*t^r,n=Math.imul(n^r,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},pc=function(e,t){return{p:t,f:fc(JSON.stringify(e))}},_c=function(e,t){if(!t)return{properties:[],isValid:!1};try{var n=rc._parse(lc(e)),i=(null==n?void 0:n.f)===fc(t)&&Tr(n.p);return{properties:i?n.p:[],isValid:i}}catch(e){return{properties:[],isValid:!1}}},vc=function(e,t){return t+"|"+(rc._get(lc(e))||"")},gc={},mc={_is_supported:function(){return!0},_error:function(e){Na.error("memoryStorage error: "+e)},_get:function(e){return e in gc?gc[e]:null},_parse:function(e){return e in gc?gc[e]:null},_set:function(e,t){return gc[e]=t,!0},_remove:function(e){delete gc[e]}},yc=null,bc={_is_supported:function(){if(!$r(yc))return yc;if(yc=!0,Ar(Fa))yc=!1;else try{var e="__support__";bc._set(e,"xyz"),'"xyz"'!==bc._get(e)&&(yc=!1),bc._remove(e)}catch(e){yc=!1}return yc},_error:function(e){Na.error("sessionStorage error: ",e)},_get:function(e){try{return null==Fa?void 0:Fa.sessionStorage.getItem(e)}catch(e){bc._error(e)}return null},_parse:function(e){try{return JSON.parse(bc._get(e))||null}catch(e){}return null},_set:function(e,t){try{return null==Fa||Fa.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){bc._error(e)}return!1},_remove:function(e){try{null==Fa||Fa.sessionStorage.removeItem(e)}catch(e){bc._error(e)}}},wc=ja("[Stylesheet Loader]"),Sc=Fa,xc=Ra,kc="#020617",Cc={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:Gi,widgetType:zi,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:kc,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Pc=[Wi,Ui,Gi];function Ec(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 Fc(e){var t;void 0===e&&(e=Cc.backgroundColor),"#"===e[0]&&(t=Ec(e)),e.startsWith("rgb")&&(t=e);var n={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(n&&(t=Ec(n)),!t)return kc;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var r=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(r*r*.299+s*s*.587+o*o*.114)>127.5?kc:"white"}return kc}var Tc=function(e,t,n){var i=Kc(e),r=xc.querySelector("."+i);if(r&&r.shadowRoot)return{shadow:r.shadowRoot,isNewlyCreated:!1};var s=xc.createElement("div");!function(e,t,n){var i=u({},Cc,n),r=e.style,s=!Pc.includes(i.position)||t===Zi&&(null==n?void 0:n.widgetType)===zi;r.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}(i.fontFamily)),r.setProperty("--ph-survey-box-padding",i.boxPadding),r.setProperty("--ph-survey-max-width",i.maxWidth),r.setProperty("--ph-survey-z-index",i.zIndex),r.setProperty("--ph-survey-border-color",i.borderColor),s?(r.setProperty("--ph-survey-border-radius",i.borderRadius),r.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(r.setProperty("--ph-survey-border-bottom","none"),r.setProperty("--ph-survey-border-radius",i.borderRadius+" "+i.borderRadius+" 0 0")),r.setProperty("--ph-survey-background-color",i.backgroundColor),r.setProperty("--ph-survey-box-shadow",i.boxShadow),r.setProperty("--ph-survey-disabled-button-opacity",i.disabledButtonOpacity),r.setProperty("--ph-survey-submit-button-color",i.submitButtonColor),r.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Fc(i.submitButtonColor)),r.setProperty("--ph-survey-rating-bg-color",i.ratingButtonColor),r.setProperty("--ph-survey-rating-active-bg-color",i.ratingButtonActiveColor),r.setProperty("--ph-survey-rating-active-text-color",Fc(i.ratingButtonActiveColor)),r.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Fc(i.backgroundColor)),r.setProperty("--ph-survey-text-subtle-color",i.textSubtleColor),r.setProperty("--ph-widget-color",i.widgetColor),r.setProperty("--ph-widget-text-color",Fc(i.widgetColor)),r.setProperty("--ph-widget-z-index",i.zIndex);var o=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),a=o||i.inputBackground;o||"white"!==i.backgroundColor||(a="#f8f8f8"),r.setProperty("--ph-survey-input-background",a);var l=(null==n?void 0:n.inputTextColor)||Fc(a);r.setProperty("--ph-survey-input-text-color",l),r.setProperty("--ph-survey-rating-text-color",l),r.setProperty("--ph-survey-scrollbar-thumb-color",i.scrollbarThumbColor),r.setProperty("--ph-survey-scrollbar-track-color",i.scrollbarTrackColor),r.setProperty("--ph-survey-outline-color",i.outlineColor)}(s,e.type,e.appearance),s.className=i;var o=s.attachShadow({mode:"open"}),a=function(e){var t=function(e,t,n){var i=e.createElement("style");i.innerText=t;var r=function(e){var t;return Ir(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet}(n);return r&&(i=r(i)),i||(wc.error("prepare_external_dependency_stylesheet returned null"),null)}(xc,':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:calc(2147480000 + 3645);--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 #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.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){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{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);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.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{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}: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{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;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}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.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;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.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{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.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}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!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}(t);if(a){var l=o.querySelector("style");l&&o.removeChild(l),o.appendChild(a)}return(n||xc.body).appendChild(s),{shadow:o,isNewlyCreated:!0}},Ic=function(e){var t,n,i,r=e.responses,s=e.survey,o=e.surveySubmissionId,a=e.posthog,l=e.isSurveyCompleted,c=e.properties,d=e.surveyLanguage,h=e.questionSnapshots;a?(yu(s),a.capture(or,u(((t={})[ur]=s.name,t[ar]=s.id,t[lr]=s.current_iteration,t[cr]=s.current_iteration_start_date,t[dr]=o,t.$survey_completed=l,t),d&&((n={})[hr]=d,n),{sessionRecordingUrl:null==a.get_session_replay_url?void 0:a.get_session_replay_url()},tu(r,s,h),c,{$set:(i={},i[nu(s,"responded")]=!0,i)})),l&&(Sc.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:s.id}})),Gc(s),a.reloadFeatureFlags())):pu.error("[survey sent] event not captured, PostHog instance not found.")},Rc=function(e,t,n){var i,r,s,o;return u(((i={})[ur]=e.name,i[ar]=e.id,i[lr]=e.current_iteration,i[cr]=e.current_iteration_start_date,i.$survey_partially_completed=(void 0===(o=null==t?void 0:t.responses)&&(o={}),Object.values(o).some(function(e){return!Dr(e)})),i),(null==t?void 0:t.surveyLanguage)&&((r={})[hr]=t.surveyLanguage,r),((s={sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()})[dr]=null==t?void 0:t.surveySubmissionId,s),tu(null==t?void 0:t.responses,e,null==t?void 0:t.questionSnapshots))},Lc=function(e,t,n,i){var r,s;if(t){if(!n){var o=Uc(e),a=o?o.surveyLanguage:i;t.capture(sr,u({},Rc(e,o,t),a&&((r={})[hr]=a,r),{$set:(s={},s[nu(e,"dismissed")]=!0,s)})),Gc(e),yu(e),Sc.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else pu.error("[survey dismissed] event not captured, PostHog instance not found.")},Ac=function(e,t){if(t){var n=function(e){return gu("abandonedSurvey_",e)}(e);try{if("true"===localStorage.getItem(n))return}catch(e){return}var i=Uc(e);if(i){try{localStorage.setItem(n,"true")}catch(e){}t.capture("survey abandoned",Rc(e,i,t),{transport:"sendBeacon"})}}else pu.error("[survey abandoned] event not captured, PostHog instance not found.")},Oc=function(e){return e.map(function(e){return{sort:Math.floor(10*Math.random()),value:e}}).sort(function(e,t){return e.sort-t.sort}).map(function(e){return e.value})},Mc=function(e,t){return e.length===t.length&&e.every(function(e,n){return e===t[n]})?t.reverse():t},$c=function(e){var t=e.map(function(e){return e.id});return t.every(function(e){return!!e})?t:void 0},Dc=function(e,t){var n;return function(e){return e.questions.some(function(e){var t;return!(null==(t=e.branching)||!t.type)})}(e)?e.questions:t?null!==(n=function(e,t){if(!t||t.length!==e.questions.length)return null;for(var n,i=new Map(e.questions.map(function(e){return[e.id,e]})),r=[],s=d(t);!(n=s()).done;){var o=i.get(n.value);if(!o)return null;r.push(o)}return r}(e,t.questionOrder))&&void 0!==n?n:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Mc(e.questions,Oc(e.questions)):e.questions},qc=function(e){return lu(e)||Wc(e)},Bc=function(){function e(t){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,ei(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),t.children}return e.__c="__cC"+P++,e.__={isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){},onPreviewBack:function(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null},e.Provider=e.__l=(e.Consumer=function(e,t){return e.children(t)}).contextType=e,e}(),Nc=function(){return Li(Bc)},jc=function(e){var t=e.children,n=e.style;return function(e,t,n){var i,r,s,o,a=Wn({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?r=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?c.call(arguments,2):n),Qn(e.type,a,i||e.key,r||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:n}:{children:t,style:n})};function Hc(e,t){var n,i;if(null==(n=e.conditions)||!n.url)return!0;var r,s=Xl(t);return!!s&&hu[r=null==(i=e.conditions)?void 0:i.urlMatchType,null!=r?r:"icontains"]([e.conditions.url],[s])}var Vc=function(e){return gu("inProgressSurvey_",e)},zc=function(e,t){try{localStorage.setItem(Vc(e),JSON.stringify(t))}catch(e){pu.error("Error setting in-progress survey state in localStorage",e)}},Uc=function(e){try{var t=localStorage.getItem(Vc(e));if(t)return JSON.parse(t)}catch(e){pu.error("Error getting in-progress survey state from localStorage",e)}return null},Wc=function(e){var t=Uc(e);return!Dr(null==t?void 0:t.surveySubmissionId)},Gc=function(e){try{localStorage.removeItem(Vc(e))}catch(e){pu.error("Error clearing in-progress survey state from localStorage",e)}};function Kc(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}function Qc(e,t,n){if(void 0===t&&(t=Gi),e===Ji)return{};switch(t){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ui:return{left:"30px"};case Wi:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Zi&&n===zi?"60px":"30px"}}}var Zc=0;function Jc(e,t,n,i,r,s){t||(t={});var o,a,u=t;if("ref"in u)for(a in u={},t)"ref"==a?o=t[a]:u[a]=t[a];var l={type:e,props:u,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Zc,__i:-1,__u:0,__source:r,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return h.vnode&&h.vnode(l),l}var Yc=Jc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jc("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"})}),Xc=Jc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jc("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"})}),ed=Jc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jc("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"})}),td=Jc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jc("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),nd=Jc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Jc("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"})}),id=Jc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Jc("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"})}),rd=Jc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Jc("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"})}),sd=Jc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Jc("g",{"clip-path":"url(#clip0_2415_6911)",children:[Jc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Jc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Jc("g",{mask:"url(#mask0_2415_6911)",children:[Jc("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"}),Jc("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"}),Jc("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"}),Jc("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"}),Jc("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"}),Jc("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"})]})]}),Jc("defs",{children:Jc("clipPath",{id:"clip0_2415_6911",children:Jc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function od(e){var t=e.urlParams,n=t?Object.entries(t).map(function(e){var t=e[1];return encodeURIComponent(e[0])+"="+encodeURIComponent(t)}).join("&"):"";return Jc("a",{href:"https://posthog.com/surveys"+(n?"?"+n:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",sd]})}function ad(e){var t=e.text,n=e.submitDisabled,i=e.appearance,r=e.onSubmit,s=e.link,o=e.onPreviewSubmit,a=e.skipSubmitButton,u=e.canGoBack,l=e.onBack,c=Li(Bc).isPreviewMode,d=!!u&&!!l,h=!a&&Jc("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick:function(){s&&(null==Fa||Fa.open(s)),c?null==o||o():r()},children:t});return Jc("div",{className:"bottom-section",children:[d?Jc("div",{className:"form-buttons form-buttons-with-back",children:[Jc("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:i.backButtonText||"Back"}),h]}):h,!i.whiteLabel&&Jc(od,{urlParams:{utm_source:"survey-footer"}})]})}function ud(e){var t=e.question,n=e.forceDisableHtml;return Jc("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[Jc(t.type===Yi?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&jc({component:Kn("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!n&&"text"!==t.descriptionContentType})]})}function ld(e){var t,n,i;return Jc("button",{className:"form-cancel",onClick:e.onClick,disabled:Li(Bc).isPreviewMode,"aria-label":"Close survey",type:"button",children:(t={fill:"black"},n=(void 0===t?{}:t).fill,i=void 0===n?"currentColor":n,Jc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Jc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Jc("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:i})]}))})}var cd=Fa;function dd(e){var t=e.header,n=e.description,i=e.contentType,r=e.forceDisableHtml,s=e.appearance,o=e.onClose,a=Li(Bc).isPopup;return Ti(function(){var e=function(e){"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return Ja(cd,"keydown",e),function(){cd.removeEventListener("keydown",e)}},[o]),Jc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Jc(ld,{onClick:function(){return o()}}),Jc("h3",{className:"thank-you-message-header",children:t}),n&&jc({component:Kn("p",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i}),a&&Jc(ad,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:function(){return o()}})]})}function hd(e){var t=e.header,n=e.description,i=e.contentType,r=e.forceDisableHtml,s=e.appearance,o=e.onStart,a=Li(Bc),u=a.onPreviewSubmit,l=a.onPopupSurveyDismissed;return Jc("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Jc(ld,{onClick:function(){return l()}}),t&&Jc("h3",{className:"intro-screen-header",children:t}),n&&jc({component:Kn("p",{className:"intro-screen-body"}),children:n,renderAsHtml:!r&&"text"!==i}),Jc(ad,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:function(){return u(null)}})]})}var fd=function(e){return Tr(e)&&e.every(function(e){return Or(e)})};function pd(e){var t=e.question,n=e.forceDisableHtml,i=e.appearance,r=e.onSubmit,s=e.onPreviewSubmit,o=e.displayQuestionIndex,a=e.initialValue,u=e.canGoBack,l=e.onBack,c=Nc().isPreviewMode,h=Ii(null),f=Fi(function(){return Or(a)?a:""}),p=f[0],_=f[1],v=null==i?void 0:i.disableAutofocus;Ti(function(){v||setTimeout(function(){var e;c||null==(e=h.current)||e.focus()},100)},[c,v]);var g="surveyQuestion"+o,m=Ri(function(){return function(e,t,n){var i,r,s=e.trim();if(!n&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o,a=d(t);!(o=a()).done;){var u=o.value;switch(u.type){case Sr:if(void 0!==u.value&&u.value>s.length)return null!==(i=u.errorMessage)&&void 0!==i?i:"Please enter at least "+u.value+" characters";break;case xr:if(void 0!==u.value&&s.length>u.value)return null!==(r=u.errorMessage)&&void 0!==r?r:"Please enter no more than "+u.value+" characters"}}return!1}(p,t.validation,t.optional)},[p,t.validation,t.optional]),y=ka(t.validation,Sr),b=ka(t.validation,xr),w=Ri(function(){return function(e,t){var n=1===e?void 0:e;return n&&t?"Enter "+n+"-"+t+" characters":n?"Enter at least "+n+" "+(1===n?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(y,b)},[y,b]),S=function(){m||r(p.trim())},x=function(){m||s(p.trim())};return Jc(Zn,{children:[Jc("div",{className:"question-container",children:[Jc(ud,{question:t,forceDisableHtml:n,htmlFor:g}),Jc("textarea",{ref:h,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput:function(e){_(e.currentTarget.value),e.stopPropagation()},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key||!e.metaKey&&!e.ctrlKey||m||(e.preventDefault(),c?x():S())},value:p}),w&&Jc("div",{className:"validation-hint",children:w})]}),Jc(ad,{text:t.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:S,onPreviewSubmit:x,canGoBack:u,onBack:l})]})}function _d(e){var t=e.question,n=e.appearance,i=e.onSubmit,r=e.onPreviewSubmit,s=e.canGoBack,o=e.onBack;return Jc(Zn,{children:[Jc("div",{className:"question-container",children:Jc(ud,{question:t,forceDisableHtml:e.forceDisableHtml})}),Jc(ad,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:function(){return i("link clicked")},onPreviewSubmit:function(){return r("link clicked")},canGoBack:s,onBack:o})]})}function vd(e){var t,n=e.question,i=e.forceDisableHtml,r=e.displayQuestionIndex,s=e.appearance,o=e.onSubmit,a=e.onPreviewSubmit,u=e.initialValue,l=e.canGoBack,c=e.onBack,d=n.scale,h=10===n.scale?0:1,f=Fi(function(){return qr(u)?u:Tr(u)&&u.length>0&&qr(parseInt(u[0]))?parseInt(u[0]):Or(u)&&qr(parseInt(u))?parseInt(u):null}),p=f[0],_=f[1],v="emoji"===n.display&&2===n.scale,g=Nc().isPreviewMode,m=function(e){return g?a(e):o(e)};return Jc(Zn,{children:[Jc("div",{className:"question-container",children:[Jc(ud,{question:n,forceDisableHtml:i}),Jc("div",{className:"rating-section",children:[Jc("div",{className:"rating-options",children:["emoji"===n.display&&Jc("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Sd[n.scale])?void 0:t.map(function(e,t){return Jc("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+r+"-rating-"+t+" "+(t+1===p?"rating-active":""),value:t+1,type:"button",onClick:function(){var e=t+1;_(e),n.skipSubmitButton&&m(e)},children:e},t)})}),"number"===n.display&&Jc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-h+1)+", minmax(0, 1fr))"},children:xd(n.scale).map(function(e,t){return Jc(gd,{displayQuestionIndex:r,active:p===e,appearance:s,num:e,setActiveNumber:function(e){_(e),n.skipSubmitButton&&m(e)}},t)})})]}),!v&&Jc("div",{className:"rating-text",children:[Jc("div",{children:n.lowerBoundLabel}),Jc("div",{children:n.upperBoundLabel})]})]})]}),Jc(ad,{text:n.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:$r(p)&&!n.optional,appearance:s,onSubmit:function(){return o(p)},onPreviewSubmit:function(){return a(p)},skipSubmitButton:n.skipSubmitButton,canGoBack:l,onBack:c})]})}function gd(e){var t=e.num,n=e.setActiveNumber;return Jc("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+e.displayQuestionIndex+"-rating-"+t+" "+(e.active?"rating-active":""),type:"button",onClick:function(){n(t)},children:t})}function md(e){var t=e.question,n=e.forceDisableHtml,i=e.displayQuestionIndex,r=e.appearance,s=e.onSubmit,o=e.onPreviewSubmit,a=e.initialValue,l=e.canGoBack,c=e.onBack,d=Ii(null),h=Ri(function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var i=Mc(t,Oc(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i}(t)},[t]),f=Fi(function(){return function(e,t){return Or(e)||fd(e)?e:t===er?null:[]}(a,t.type)}),p=f[0],_=f[1],v=Fi(function(){return function(e,t){if(Or(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(fd(e)){var n=e.find(function(e){return!t.includes(e)});if(n)return{isSelected:!0,inputValue:n}}return{isSelected:!1,inputValue:""}}(a,h)}),g=v[0],m=v[1],y=Nc().isPreviewMode,b=t.type===er,w=t.type===Xi,S=t.skipSubmitButton&&b&&!t.hasOpenChoice,x=function(e,t){if(t){var n=!g.isSelected;return m(function(e){return u({},e,{isSelected:n,inputValue:n?e.inputValue:""})}),b&&_(""),void(n&&setTimeout(function(){var e;return null==(e=d.current)?void 0:e.focus()},75))}if(b)return _(e),m(function(e){return u({},e,{isSelected:!1,inputValue:""})}),void(S&&(s(e),y&&o(e)));w&&Tr(p)&&(p.includes(e)?_(p.filter(function(t){return t!==e})):_([].concat(p,[e])))},k=function(e){e.stopPropagation();var t=e.currentTarget.value;m(function(e){return u({},e,{inputValue:t})}),b&&_(t)},C=function(e){e.stopPropagation(),"Enter"!==e.key||P()||(e.preventDefault(),E()),"Escape"===e.key&&(e.preventDefault(),m(function(e){return u({},e,{isSelected:!1,inputValue:""})}),b&&_(null))},P=function(){return!(t.optional||!$r(p)&&(!Tr(p)||g.isSelected||0!==p.length)&&(!g.isSelected||""!==g.inputValue.trim()))},E=function(){g.isSelected&&w?Tr(p)&&(y?o([].concat(p,[g.inputValue])):s([].concat(p,[g.inputValue]))):y?o(p):s(p)};return Jc(Zn,{children:[Jc("div",{className:"question-container",children:[Jc(ud,{question:t,forceDisableHtml:n}),Jc("fieldset",{className:"multiple-choice-options limit-height",children:[Jc("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),h.map(function(e,n){var r=!!t.hasOpenChoice&&n===t.choices.length-1,s="surveyQuestion"+i+"Choice"+n,o=s+"Open",a=r?g.isSelected:b?p===e:Tr(p)&&p.includes(e);return Jc("label",{className:r?"choice-option-open":"",children:[Jc("div",{className:"response-choice",children:[Jc("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:function(){return x(e,r)},id:s,"aria-controls":o}),Jc("span",{children:r?e+":":e})]}),r&&Jc("input",{type:"text",ref:d,id:o,name:"question"+i+"Open",value:g.inputValue,onKeyDown:C,onInput:k,onClick:function(t){g.isSelected||x(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},n)})]})]}),Jc(ad,{text:t.buttonText||"Submit",submitDisabled:P(),appearance:r,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:S,canGoBack:l,onBack:c})]})}var yd=[1,2,3,4,5],bd=[1,2,3,4,5,6,7],wd=[0,1,2,3,4,5,6,7,8,9,10],Sd={2:[id,rd],3:[ed,Xc,Yc],5:[td,ed,Xc,Yc,nd]};function xd(e){switch(e){case 5:default:return yd;case 7:return bd;case 10:return wd}}var kd=ja("[Surveys]");function Cd(e,t,n){var i,r=e.questions[t],s=t+1;if(null==(i=r.branching)||!i.type)return t===e.questions.length-1?nr:s;if(r.branching.type===nr)return nr;if("specific_question"===r.branching.type){if(Number.isInteger(r.branching.index))return r.branching.index}else if("response_based"===r.branching.type){if(r.type===er){var o,a=r.choices.indexOf(""+n);if(-1===a&&r.hasOpenChoice&&(a=r.choices.length-1),null!=(o=r.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var u=r.branching.responseValues[a];return Number.isInteger(u)?u:u===nr?nr:s}}else if(r.type===tr){var l;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var c=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||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(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(n,r.scale);if(null!=(l=r.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=r.branching.responseValues[c];return Number.isInteger(d)?d:d===nr?nr:s}}return s}return kd.warn("Falling back to next question index due to unexpected branching type"),s}var Pd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ed=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat(Pd),Fd="<masked>",Td=["li_fat_id"];function Id(e,t,n){if(!Ra)return{};var i,r=t?[].concat(Pd,n||[]):[],s=Rd(Gl(Ra.URL,r,Fd),e);return za((i={},Va(Td,function(e){var t=ec(e);i[e]=t||null}),i),s)}function Rd(e,t){var n=Ed.concat(t||[]),i={};return Va(n,function(t){var n=Wl(e,t);i[t]=n||null}),i}function Ld(e){var t=function(e){return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(e),n="yahoo"!=t?"q":"p",i={};if(!$r(t)){i.$search_engine=t;var r=Ra?Wl(Ra.referrer,n):"";r.length&&(i.ph_keyword=r)}return i}function Ad(){return navigator.language||navigator.userLanguage}var Od="$direct";function Md(){return(null==Ra?void 0:Ra.referrer)||Od}function $d(e,t,n){var i;void 0===n&&(n=!1);var r=e?[].concat(Pd,t||[]):[],s=null==(i=n?ho(null==La?void 0:La.href):null==La?void 0:La.href)?void 0:i.substring(0,1e3);return{r:Md().substring(0,1e3),u:s?Gl(s,r,Fd):void 0}}function Dd(e,t){var n;void 0===t&&(t=!1);var i=e.r,r=e.u,s=t?ho(r):r,o={$referrer:i,$referring_domain:null==i?void 0:i==Od?Od:null==(n=Ul(i))?void 0:n.host};if(s){o.$current_url=s;var a=Ul(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,za(o,Rd(s))}return i&&za(o,Ld(i)),o}function qd(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Bd(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var Nd=ja("[SurveyTranslations]");function jd(e,t){var n=function(e){return function(e,t){var n=e.storedPersonProperties,i=e.locale,r=iu(e.overrideLanguage);if(r)return null==t||t.info("Using override display language: "+r),r;var s=function(e){return e&&"object"==typeof e&&"language"in e?iu(e.language):null}(n);if(s)return null==t||t.info("Using person property language: "+s),s;var o=iu(i);return o?(null==t||t.info("Using detected locale: "+o),o):(null==t||t.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:Ir(e.get_property)?e.get_property(nl):void 0,locale:Ad()},Nd)}(t);if(!n)return Nd.info("No user language detected"),{survey:e,language:null};var i=au(e,n,Nd);return{survey:i.survey,language:i.matchedKey}}var Hd=Fa,Vd=Ra,zd="ph:show_survey_widget",Ud="PHWidgetSurveyClickListener";function Wd(e,t){try{var n=e.getBoundingClientRect(),i=Hd.innerHeight,r=Hd.innerWidth,s=n.left+n.width/2-t/2;s+t>r-20&&(s=r-t-20),20>s&&(s=20);var o=i-n.bottom,a=250>o&&n.top>o;return{position:"fixed",top:a?"auto":n.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-n.top+12+"px":"auto",zIndex:Cc.zIndex}}catch(e){return pu.warn("Failed to calculate trigger position:",e),null}}var Gd=function(){"use strict";function e(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._renderedTargets=new Map,this._prefillHandledSurveys=new Set,this._currentLanguage=null,this._surveyIsRendered=!1,this._languageChangeListener=null,this._unsubscribeFeatureFlags=null,this._surveyPopupProps=null,this.handlePageUnload=function(){var e=t._posthog.get_property(sl);if(e)for(var n,i=d(e);!(n=i()).done;){var r=n.value;Wc(r)&&Ac(r,t._posthog)}},this.handlePopoverSurvey=function(e,n,i){var r,s,o,a,l,c=(void 0===i?{}:i).resumeDelayFromActivation,d=void 0!==c&&c,h=t._translateSurveyForRendering(e),f=h.survey,p=h.language;t._currentLanguage=p,t._surveyPopupProps=null,t._displayOptions=n;var _=t._applyDisplayOverrides(f,n);t._clearSurveyTimeout(_.id);var v=null!=n?n:{},g=v.properties,m=v.initialResponses,y=!(!m||0>=Object.keys(m).length)&&t._handleInitialResponses(_,m,g,p);if(!y||null!=(r=_.appearance)&&r.displayThankYouMessage){t._addSurveyToFocus(_);var b={};if((null==(s=_.appearance)?void 0:s.position)===Ki&&null!=(o=_.appearance)&&o.widgetSelector){var w,S=Vd.querySelector(_.appearance.widgetSelector);S&&(b=Wd(S,parseInt((null==(w=_.appearance)?void 0:w.maxWidth)||Cc.maxWidth))||{})}var x=(null==(a=_.appearance)?void 0:a.surveyPopupDelaySeconds)||0,k=Tc(_,t._posthog).shadow;t._renderedTargets.set(k,k.host);var C={posthog:t._posthog,survey:_,removeSurveyFromFocus:t._removeSurveyFromFocus,properties:g,style:b,isSurveyCompleted:y,skipShownEvent:null==n?void 0:n.skipShownEvent,surveyLanguage:p};if(t._surveyPopupProps=C,0>=x)return t._surveyIsRendered=!0,gi(Jc(Yd,u({},C)),k);var P=function(){if(!t._shouldDisplaySurvey(_))return pu.info("Survey "+_.id+" no longer eligible when its display delay elapsed; not displaying"),t._removeSurveyFromFocus(_);!function(){t._surveyIsRendered=!0;var i=t._translateSurveyForRendering(e),r=i.survey,s=i.language;t._currentLanguage=s;var o=t._applyDisplayOverrides(r,n),a=u({},C,{survey:o,surveyLanguage:s});t._surveyPopupProps=a,gi(Jc(Yd,u({},a,{survey:u({},o,{appearance:u({},o.appearance,{surveyPopupDelaySeconds:0})})})),k)}()},E=d?null==(l=t._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(_.id):void 0,F=qr(E)?Math.max(0,Date.now()-E):0,T=Math.max(0,1e3*x-F);if(0>=T)return P();var I=Hd.setTimeout(function(){t._surveyTimeouts.delete(_.id),P()},T);t._surveyTimeouts.set(_.id,I)}},this._handleWidget=function(e){var n=t._translateSurveyForRendering(e),i=n.survey,r=n.language,s=Tc(i,t._posthog),o=s.shadow,a=s.isNewlyCreated;t._renderedTargets.set(o,o.host),a&&gi(Jc(eh,{posthog:t._posthog,survey:i,surveyLanguage:r},e.id),o)},this._detachWidgetSelectorListener=function(e){var n=t._widgetSelectorListeners.get(e);n&&(n.element.removeEventListener("click",n.listener),n.element.removeAttribute(Ud),t._widgetSelectorListeners.delete(e),pu.info("Removed click listener for survey "+e))},this._removeWidgetSelectorListener=function(e){t._isWidgetSurveyOpen(e)||(t._removeSurveyFromDom(e),t._detachWidgetSelectorListener(e.id))},this._isWidgetSurveyOpen=function(e){try{var t;return!(null==(t=Vd.querySelector(Kc(e,!0)))||null==(t=t.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this._manageWidgetSelectorListener=function(e,n){var i=Vd.querySelector(n),r=t._widgetSelectorListeners.get(e.id);if(i){if(t._handleWidget(e),r){if(i===r.element)return;pu.info("Selector element changed for survey "+e.id+". Re-attaching listener."),t._detachWidgetSelectorListener(e.id)}if(!i.hasAttribute(Ud)){var s=function(t){var n,i;t.stopPropagation();var r=(null==(n=e.appearance)?void 0:n.position)===Ki?Wd(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Cc.maxWidth)):{};Hd.dispatchEvent(new CustomEvent(zd,{detail:{surveyId:e.id,position:r}}))};Ja(i,"click",s),i.setAttribute(Ud,"true"),t._widgetSelectorListeners.set(e.id,{element:i,listener:s,survey:e}),pu.info("Attached click listener for feedback button survey "+e.id)}}else r&&t._removeWidgetSelectorListener(e)},this.renderPopover=function(e){var n=t._translateSurveyForRendering(e),i=n.survey,r=n.language,s=Tc(i,t._posthog).shadow;t._renderedTargets.set(s,s.host),gi(Jc(Yd,{posthog:t._posthog,survey:i,removeSurveyFromFocus:t._removeSurveyFromFocus,surveyLanguage:r}),s)},this.renderSurvey=function(e,n,i){var r,s=t._translateSurveyForRendering(e),o=s.survey,a=s.language,u=!1;null!=(r=t._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(u=t._handleUrlPrefill(o,a,i)),gi(Jc(Yd,{posthog:t._posthog,survey:o,removeSurveyFromFocus:t._removeSurveyFromFocus,isPopup:!1,properties:i,isSurveyCompleted:u,surveyLanguage:a}),n)},this.getActiveMatchingSurveys=function(e,n){var i;void 0===n&&(n=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys(function(n){e(n.filter(function(e){return t._shouldDisplaySurvey(e)}))},n)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys(function(e){for(var n=e.filter(function(e){return e.type===Qi||e.type===Zi}),i=new Set(n.map(function(e){return e.id})),r=0,s=Array.from(t._surveyTimeouts.keys());s.length>r;r++){var o=s[r];i.has(o)||t.cancelSurvey(o)}var a=t._sortSurveysByAppearanceDelay(n),u=new Set;a.forEach(function(e){if(e.type===Zi){var n,i,r,s;if((null==(n=e.appearance)?void 0:n.widgetType)===zi)return void t._handleWidget(e);"selector"===(null==(i=e.appearance)?void 0:i.widgetType)&&null!=(r=e.appearance)&&r.widgetSelector&&(u.add(e.id),t._manageWidgetSelectorListener(e,null==(s=e.appearance)?void 0:s.widgetSelector))}$r(t._surveyInFocus)&&e.type===Qi&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})}),t._widgetSelectorListeners.forEach(function(e){var n=e.survey;u.has(n.id)||t._removeWidgetSelectorListener(n)})},e)},this._addSurveyToFocus=function(e){$r(t._surveyInFocus)||pu.error("Survey "+t._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),t._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){t._surveyInFocus!==e.id&&pu.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),t._clearSurveyTimeout(e.id),t._surveyInFocus=null,t._currentLanguage=null,t._surveyIsRendered=!1,t._surveyPopupProps=null,t._displayOptions=void 0,t._removeSurveyFromDom(e)},this._posthog=e,this._surveyInFocus=null,this._languageChangeListener=function(){return t._onLanguageChange()},Ja(Hd,"languagechange",this._languageChangeListener),this._unsubscribeFeatureFlags=e.onFeatureFlags(function(){return t._onLanguageChange()})}var t=e.prototype;return t._onLanguageChange=function(){var e,t=this;if(!$r(this._surveyInFocus)){var n=null==(e=this._posthog.get_property(sl))?void 0:e.find(function(e){return e.id===t._surveyInFocus});if(n){var i=this._translateSurveyForRendering(n),r=i.survey,s=i.language;if(s!==this._currentLanguage&&(this._currentLanguage=s,this._surveyIsRendered)){var o=this._applyDisplayOverrides(r,this._displayOptions),a=Tc(o,this._posthog).shadow;gi(Jc(Yd,u({},this._surveyPopupProps,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this._removeSurveyFromFocus,surveyLanguage:s})),a)}}}},t._applyDisplayOverrides=function(e,t){return null!=t&&t.position||null!=t&&t.selector?u({},e,{appearance:u({},e.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):e},t._clearSurveyTimeout=function(e){var t=this._surveyTimeouts.get(e);t&&(clearTimeout(t),this._surveyTimeouts.delete(e))},t.cancelSurvey=function(e){this._surveyTimeouts.has(e)&&(pu.info("Cancelled pending survey "+e),this._clearSurveyTimeout(e),this._surveyInFocus===e&&(this._surveyInFocus=null,this._currentLanguage=null,this._surveyIsRendered=!1,this._surveyPopupProps=null,this._displayOptions=void 0))},t.setAutomaticDisplayDispose=function(e){this._automaticDisplayDispose=e},t.dispose=function(){var e,t=this;null==(e=this._automaticDisplayDispose)||e.call(this),this._automaticDisplayDispose=void 0,this._languageChangeListener&&(Hd.removeEventListener("languagechange",this._languageChangeListener),this._languageChangeListener=null),this._unsubscribeFeatureFlags&&(this._unsubscribeFeatureFlags(),this._unsubscribeFeatureFlags=null),this._surveyTimeouts.forEach(function(e,n){return t._clearSurveyTimeout(n)}),this._widgetSelectorListeners.forEach(function(e,n){return t._detachWidgetSelectorListener(n)}),this._renderedTargets.forEach(function(e,t){gi(null,t),null==e||e.remove()}),this._renderedTargets.clear(),this._surveyInFocus=null},t._sortSurveysByAppearanceDelay=function(e){return e.sort(function(e,t){var n,i,r=Wc(e),s=Wc(t);if(r&&!s)return-1;if(!r&&s)return 1;var o=e.schedule===ir,a=t.schedule===ir;return o&&!a?1:!o&&a?-1:((null==(n=e.appearance)?void 0:n.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)})},t._translateSurveyForRendering=function(e){return jd(e,this._posthog)},t._handleUrlPrefill=function(e,t,n){if(this._prefillHandledSurveys.has(e.id))return!1;var i=function(e){var t={},n=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:n};for(var r,s=d(i.split("&"));!(r=s()).done;){var o=r.value.split("="),a=o[0],u=o[1];if(a&&!Ar(u)){var l=decodeURIComponent(a),c=decodeURIComponent(u);if("auto_submit"!==l||"true"!==c){var h=l.match(/^q(\d+)$/);if(h){var f=parseInt(h[1],10);t[f]||(t[f]=[]),t[f].push(c)}}else n=!0}}return{params:t,autoSubmit:n}}(Hd.location.search).params;if(0===Object.keys(i).length)return!1;pu.info("[Survey Prefill] Detected URL prefill parameters");var r=this._processPrefillData(e,i,t);return!!r&&(this._autoSubmitPrefilledResponses(e,r,n,t),this._prefillHandledSurveys.add(e.id),r.isSurveyCompleted)},t._autoSubmitPrefilledResponses=function(e,t,n,i){var r=t.responses,s=t.submissionId,o=t.isSurveyCompleted,a=t.skippedResponses;(Object.keys(a).length>0&&e.enable_partial_responses||o)&&Ic({responses:o?r:a,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:n,surveyLanguage:i})},t._handleInitialResponses=function(e,t,n,i){for(var r={},s=0,o=Object.entries(t);o.length>s;s++){var a=o[s],u=a[1];r[parseInt(a[0])]=Tr(u)?u.map(String):[String(u)]}pu.info("[Survey] Processing initial responses");var l=this._processPrefillData(e,r,i);return!!l&&(this._autoSubmitPrefilledResponses(e,l,n,i),l.isSurveyCompleted)},t._processPrefillData=function(e,t,n){try{var i=function(e,t){var n={};return e.questions.forEach(function(e,i){if(t[i]&&e.id){var r=t[i],s=Xa(e.id);try{switch(e.type){case er:if(!e.choices||0===e.choices.length)return void Na.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(r[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void Na.warn("[Survey Prefill] Invalid choice index for q"+i+": "+r[0]);n[s]=e.choices[o];break;case Xi:if(!e.choices||0===e.choices.length)return void Na.warn("[Survey Prefill] Question "+i+" has no choices");var a=r.map(function(e){return parseInt(e,10)}).filter(function(t){return!isNaN(t)&&t>=0&&e.choices.length>t});if(0===a.length)return void Na.warn("[Survey Prefill] No valid choices for q"+i);var u=[].concat(new Set(a.map(function(t){return e.choices[t]})));a.length>u.length&&Na.warn("[Survey Prefill] Removed duplicate choices for q"+i),n[s]=u;break;case tr:var l=parseInt(r[0],10),c=e.scale||10;if(isNaN(l)||0>l||l>c)return void Na.warn("[Survey Prefill] Invalid rating for q"+i+": "+r[0]+" (scale: 0-"+c+")");n[s]=l;break;default:Na.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){Na.error("[Survey Prefill] Error converting q"+i+":",e)}}}),n}(e,t);if(0===Object.keys(i).length)return pu.warn("[Survey Prefill] No valid responses after conversion"),null;var r=Hl(),s=function(e,t,n){for(var i=0,r={},s=[],o=e.questions.length+1,a=0;e.questions.length>i&&o>a&&(a++,t.includes(i));){var u=e.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=Xa(u.id);Ar(n[l])||(r[l]=n[l])}s.push(i);var c=Cd(e,i,u.id?n[Xa(u.id)]:null);if(c===nr)return{startQuestionIndex:e.questions.length,skippedResponses:r,skippedIndices:s};i=c}return{startQuestionIndex:i,skippedResponses:r,skippedIndices:s}}(e,Object.keys(t).map(function(e){return parseInt(e,10)}),i),o=s.startQuestionIndex,a=s.skippedResponses,u=s.skippedIndices,l=o>=e.questions.length;return zc(e,{surveySubmissionId:r,responses:i,lastQuestionIndex:o,questionOrder:$c(e.questions),visitedIndices:u,surveyLanguage:n}),pu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:r,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:a}}catch(e){return pu.error("[Survey Prefill] Error handling prefill:",e),null}},t._isSurveyFeatureFlagEnabled=function(e,t){if(void 0===t&&(t=void 0),!e)return!0;var n=this._featureFlags,i=!(null==n||!n.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),r=!0;return t&&(r=(null==n?void 0:n.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),i&&r},t._isSurveyConditionMatched=function(e){return!e.conditions||Hc(e,this._posthog)&&function(e){var t,n;return function(e,t){var n,i,r;if(!e||0===e.length)return!0;if(!Da)return!1;var s=Xs(Da,{userAgentDataPlatform:null==Ia||null==(n=Ia.userAgentData)?void 0:n.platform,maxTouchPoints:null==Ia?void 0:Ia.maxTouchPoints,screenWidth:null==Fa||null==(i=Fa.screen)?void 0:i.width,screenHeight:null==Fa||null==(r=Fa.screen)?void 0:r.height,devicePixelRatio:null==Fa?void 0:Fa.devicePixelRatio});return hu[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(n=e.conditions)?void 0:n.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==xc||!xc.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){var t;return qc(e)?{satisfied:!0}:!e.internal_targeting_flag_key||!function(e){var t;return"recurring"===e.schedule||(null!==(t=e.current_iteration)&&void 0!==t?t:0)>0}(e)||null!=(t=this._featureFlags)&&t.hasLoadedFlags?{satisfied:this._isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}},t.checkSurveyEligibility=function(e){var t,n,i={eligible:!0,reason:void 0};if(!_u(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!bu.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 r=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this._isSurveyFeatureFlagEnabled(e.linked_flag_key,r))return i.eligible=!1,i.reason=r?"Survey linked feature flag is not enabled for variant "+r:"Survey linked feature flag is not enabled",i;if(!this._isSurveyFeatureFlagEnabled(e.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var s,o=this._internalFlagCheckSatisfied(e);return o.satisfied?function(e,t){if(!e||!t)return!0;var n="string"==typeof t?new Date(t):t,i=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(i/864e5)>e}(null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays,oc._get("lastSeenSurveyDate"))?function(e){return!!oc._get(mu(e))&&!qc(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=null!==(s=o.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)},t.checkSurveyRenderability=function(e){var t=this.checkSurveyEligibility(e);return t.eligible&&!this._hasActionOrEventTriggeredSurvey(e)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:t},t._hasActionOrEventTriggeredSurvey=function(e){var t;return!uu(e)&&!vu(e)||!(null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)||null==(t=t.getSurveys())||!t.includes(e.id))},t._checkFlags=function(e){var t,n=this;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every(function(e){var t=e.value;return!e.key||!t||n._isSurveyFeatureFlagEnabled(t)})},t._shouldDisplaySurvey=function(e){return this.checkSurveyEligibility(e).eligible&&this._isSurveyConditionMatched(e)&&this._hasActionOrEventTriggeredSurvey(e)&&this._checkFlags(e)},t._removeSurveyFromDom=function(e){try{var t=Vd.querySelector(Kc(e,!0));null!=t&&t.shadowRoot&&(gi(null,t.shadowRoot),this._renderedTargets.delete(t.shadowRoot)),null==t||t.remove()}catch(t){pu.warn("Failed to remove survey "+e.id+" from DOM:",t)}},t.getTestAPI=function(){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),onLanguageChange:this._onLanguageChange.bind(this),currentLanguage:this._currentLanguage,surveyIsRendered:this._surveyIsRendered}},o(e,[{key:"_featureFlags",get:function(){var e,t,n;return null!==(e=null==(t=(n=this._posthog).getExtension)?void 0:t.call(n,"featureFlags"))&&void 0!==e?e:this._posthog.featureFlags}}])}();function Kd(e,t){if(Vd&&Hd){var n,i=new Gd(e);if(e.config.disable_surveys_automatic_display)return pu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return pu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var r=function(){Ar(n)&&(n=setInterval(function(){i.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=function(){Ar(n)||(clearInterval(n),n=void 0)};r();var o=function(){Vd.hidden?s():(i.callSurveysAndEvaluateDisplayLogic(!1),r())};return Ja(Vd,"visibilitychange",o),i.setAutomaticDisplayDispose(function(){s(),Vd.removeEventListener("visibilitychange",o)}),i}}function Qd(e){var t=e.survey,n=e.removeSurveyFromFocus,i=void 0===n?function(){}:n,r=e.setSurveyVisible,s=e.isPreviewMode,o=void 0!==s&&s,a=e.posthog;Ti(function(){var e;if(!o&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===Zi,s=Hc(t,a),o=(null==(e=t.appearance)?void 0:e.widgetType)===zi&&n;if(!s)return pu.info("Hiding survey "+t.id+" because URL does not match"),r(!1),i(t);o&&(pu.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),r(!0))};Ja(Hd,"popstate",n),Ja(Hd,"hashchange",n);var s=Hd.history.pushState,u=Hd.history.replaceState;return Hd.history.pushState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];s.apply(this,t),n()},Hd.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];u.apply(this,t),n()},function(){Hd.removeEventListener("popstate",n),Hd.removeEventListener("hashchange",n),Hd.history.pushState=s,Hd.history.replaceState=u}}},[o,t,i,r,a])}var Zd=200;function Jd(e){switch(void 0===e&&(e="right"),e){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Yd(e){var t,n,i,r,s,o,a,l,c,d,h,f,p=e.survey,_=e.forceDisableHtml,v=e.posthog,g=e.style,m=void 0===g?{}:g,y=e.previewPageIndex,b=e.removeSurveyFromFocus,w=void 0===b?function(){}:b,S=e.isPopup,x=void 0===S||S,k=e.onPreviewSubmit,C=void 0===k?function(){}:k,P=e.onPreviewBack,E=void 0===P?function(){}:P,F=e.onPopupSurveyDismissed,T=void 0===F?function(){}:F,I=e.onCloseConfirmationMessage,R=void 0===I?function(){}:I,L=e.properties,A=e.isSurveyCompleted,O=e.skipShownEvent,M=e.surveyLanguage,D=Ii(null),q=Number.isInteger(y),B=function(e,t,n,i,r,s,o,a,l){var c=Fi(i||0===n||e.type===Ji),d=c[0],h=c[1],f=Fi(!1),p=f[0],_=f[1],v=Ii(!1),g=function(){var t=function(){s&&r(e),h(!1)};if(!v.current){var n=null==o?void 0:o.current;n?(v.current=!0,n.style.transition="opacity "+Zd+"ms ease-out",n.style.opacity="0",setTimeout(function(){v.current=!1,t()},250)):t()}},m=function(t){t.detail.surveyId===e.id&&g()};return Ti(function(){if(t){if(!i){var r,s=function(t){var n,i;if(t.detail.surveyId===e.id){if(null==(n=e.appearance)||!n.displayThankYouMessage)return g();_(!0),null!=(i=e.appearance)&&i.autoDisappear&&(r&&clearTimeout(r),r=setTimeout(g,5e3))}},o=function(){var n,i;if(Hc(e,t)){h(!0),Hd.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(rr,u(((n={})[ur]=e.name,n[ar]=e.id,n[lr]=e.current_iteration,n[cr]=e.current_iteration_start_date,n),l&&((i={})[hr]=l,i),{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};Ja(Hd,"PHSurveyClosed",m),Ja(Hd,"PHSurveySent",s);var c=n>0?setTimeout(o,n):void 0;return Ar(c)&&o(),function(){Ar(c)||clearTimeout(c),Ar(r)||clearTimeout(r),Hd.removeEventListener("PHSurveyClosed",m),Hd.removeEventListener("PHSurveySent",s)}}}else pu.error("usePopupVisibility hook called without a PostHog instance.")},[]),Qd({survey:e,removeSurveyFromFocus:r,setSurveyVisible:h,isPreviewMode:i,posthog:t}),{isPopupVisible:d,isSurveySent:p,setIsPopupVisible:h,hidePopupWithAnimation:g}}(p,v,null!=(t=p.appearance)&&t.surveyPopupDelaySeconds?1e3*p.appearance.surveyPopupDelaySeconds:0,q,w,x,D,O,M),N=B.isPopupVisible,j=B.hidePopupWithAnimation,H=B.isSurveySent||y===p.questions.length||!0===A,V=Fi(!1),z=V[0],U=V[1],W=Ri(function(){return!!Uc(p)},[p]),G=!!(null!=(n=p.appearance)&&n.introScreenHeader||null!=(i=p.appearance)&&i.introScreenDescription),K=q?-1===y:!(null==(r=p.appearance)||!r.displayIntroScreen)&&G&&!z&&!W,Q=Ri(function(){var e,t=(null==(e=Uc(p))?void 0:e.surveySubmissionId)||Hl();return{isPreviewMode:q,previewPageIndex:y,onPopupSurveyDismissed:function(){M?Lc(p,v,q,M):Lc(p,v,q),T()},isPopup:x||!1,surveySubmissionId:t,onPreviewSubmit:C,onPreviewBack:E,posthog:v,properties:L,surveyLanguage:M}},[q,y,x,v,p,T,C,E,L,M]);return N?Jc(Bc.Provider,{value:Q,children:Jc("div",{className:"ph-survey",style:u({},Qc(p.type,null==(s=p.appearance)?void 0:s.position,null==(o=p.appearance)?void 0:o.widgetType),m),ref:D,children:H?Jc(dd,{header:(null==(a=p.appearance)?void 0:a.thankYouMessageHeader)||"Thank you!",description:(null==(l=p.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!_,contentType:null==(c=p.appearance)?void 0:c.thankYouMessageDescriptionContentType,appearance:p.appearance||Cc,onClose:function(){j(),R()}}):K?Jc(hd,{header:(null==(d=p.appearance)?void 0:d.introScreenHeader)||"",description:(null==(h=p.appearance)?void 0:h.introScreenDescription)||"",forceDisableHtml:!!_,contentType:null==(f=p.appearance)?void 0:f.introScreenDescriptionContentType,appearance:p.appearance||Cc,onStart:function(){return U(!0)}}):Jc(Xd,{survey:p,forceDisableHtml:!!_,posthog:v})})}):null}function Xd(e){var t,n,i=e.survey,r=e.forceDisableHtml,s=e.posthog,o=Ri(function(){var e=Uc(i);if(!e)return null;var t=qr(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&i.questions.length>e.lastQuestionIndex?e:(Gc(i),null)},[i]),a=Fi(function(){return null!=o&&o.responses&&pu.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}}),l=a[0],c=a[1],d=Li(Bc),h=d.previewPageIndex,f=d.onPopupSurveyDismissed,p=d.isPopup,_=d.onPreviewSubmit,v=d.onPreviewBack,g=d.surveySubmissionId,m=d.isPreviewMode,y=d.properties,b=d.surveyLanguage,w=Fi(function(){var e=null==o?void 0:o.lastQuestionIndex,t=qr(e)&&e>=0&&i.questions.length>e?e:0;return qr(h)&&h>=0?h:t}),S=w[0],x=w[1],k=Fi(function(){var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(function(e){return e>=0&&i.questions.length>e})}),C=k[0],P=k[1],E=Fi(function(){var e,t;return null!==(e=null==(t=Uc(i))?void 0:t.questionSnapshots)&&void 0!==e?e:{}}),F=E[0],T=E[1],I=Ri(function(){return $c(Dc(i,o))},[i.id,o]),R=Ri(function(){if(!I||new Set(I).size!==I.length)return Dc(i,o);var e=new Map(i.questions.map(function(e){return[e.id,e]})),t=I.map(function(t){return e.get(t)}).filter(function(e){return!!e});return t.length===I.length?t:i.questions},[I,i.questions,i,o]);Ti(function(){!m||Ar(h)||0>h||x(h)},[h,m]);var L=!(null==(t=i.appearance)||!t.allowGoBack)&&(m?(null!=h?h:0)>0:C.length>0),A=R.at(S);return A?Jc("form",{className:"survey-form",name:"surveyForm",children:[p&&!0!==(null==(n=i.appearance)?void 0:n.hideCancelButton)&&Jc(ld,{onClick:function(){f()}}),Jc("div",{className:"survey-box","data-question-index":S,children:th({question:A,forceDisableHtml:r,displayQuestionIndex:S,appearance:i.appearance||Cc,onSubmit:function(e){return function(e){var t,n,r=e.res,o=e.displayQuestionIndex,a=e.questionId;if(s)if(a){var d=Xa(a),h=u({},l,((t={})[d]=r,t));c(h);var f=R[o],p=null!=f&&f.id?u({},F,((n={})[f.id]=f.question,n)):F;T(p);var _=Cd(i,o,r),v=_===nr,m=[].concat(C,[o]);if(v||(P(m),x(_),zc(i,{surveySubmissionId:g,responses:h,lastQuestionIndex:_,questionOrder:$c(R),visitedIndices:m,surveyLanguage:b,questionSnapshots:p})),i.enable_partial_responses||v){var w=new Set(m.map(function(e){var t;return null==(t=R[e])?void 0:t.id}).filter(function(e){return!!e}).map(function(e){return Xa(e)}));Ic({responses:Object.fromEntries(Object.entries(h).filter(function(e){return w.has(e[0])})),survey:i,surveySubmissionId:g,isSurveyCompleted:v,posthog:s,properties:y,surveyLanguage:b,questionSnapshots:p})}}else pu.error("onNextButtonClick called without a questionId.");else pu.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:S,questionId:A.id})},onPreviewSubmit:_,initialValue:A.id?l[Xa(A.id)]:void 0,canGoBack:L,onBack:function(){if(m)v();else if(0!==C.length){var e=C[C.length-1],t=C.slice(0,-1);P(t),x(e),zc(i,{surveySubmissionId:g,responses:l,lastQuestionIndex:e,questionOrder:$c(R),visitedIndices:t,surveyLanguage:b,questionSnapshots:F})}}})})]}):null}function eh(e){var t,n,i,r,s,o,a,u=e.survey,l=e.forceDisableHtml,c=e.posthog,d=e.readOnly,h=e.surveyLanguage,f=Fi(!0),p=f[0],_=f[1],v=Fi(!1),g=v[0],m=v[1],y=Fi({}),b=y[0],w=y[1],S=Ii(void 0),x=function(){m(!g)};if(Ti(function(){var e;if(c){if(!d){"tab"===(null==(e=u.appearance)?void 0:e.widgetType)&&w({top:"50%",bottom:"auto"});var t=function(e){var t,n=e;(null==(t=n.detail)?void 0:t.surveyId)===u.id&&(pu.info("Received show event for feedback button survey "+u.id),w(n.detail.position||{}),x())};return Ja(Hd,zd,t),function(){Ar(S.current)||(clearTimeout(S.current),S.current=void 0),Hd.removeEventListener(zd,t)}}}else pu.error("FeedbackWidget called without a PostHog instance.")},[c,d,u.id,null==(t=u.appearance)?void 0:t.widgetType,null==(n=u.appearance)?void 0:n.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Qd({survey:u,setSurveyVisible:_,posthog:c}),!p)return null;var k=function(){u.schedule!==ir&&_(!1),Ar(S.current)||clearTimeout(S.current),S.current=setTimeout(function(){S.current=void 0,m(!1)},200)};return Jc(Zn,{children:["tab"===(null==(r=u.appearance)?void 0:r.widgetType)&&Jc("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=u.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:x,disabled:d,style:Jd(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),g&&Jc(Yd,{posthog:c,survey:u,forceDisableHtml:l,style:b,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:h})]})}var th=function(e){var t=e.question,n=e.onSubmit,i=e.onPreviewSubmit,r={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit:function(e){i(e)},onSubmit:function(e){n(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case Yi:return Kn(pd,u({},r,{question:t,key:t.id}));case"link":return Kn(_d,u({},r,{question:t,key:t.id}));case tr:return Kn(vd,u({},r,{question:t,key:t.id}));case er:case Xi:return Kn(md,u({},r,{question:t,key:t.id}));default:return pu.error("Unsupported question type: "+t.type),null}},nh="undefined"!=typeof globalThis?globalThis:Fa;nh&&"undefined"==typeof self&&(nh.self=nh),nh&&"undefined"==typeof File&&(nh.File=function(){});var ih=null!=Fa?Fa:{};ih.__PosthogExtensions__=ih.__PosthogExtensions__||{},ih.__PosthogExtensions__.generateSurveys=Kd,ih.extendPostHogWithSurveys=Kd;var rh=function(e){return Ur(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message)},sh=ja("[Error tracking]"),oh="webkit-masked-url:",ah=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",oh],uh=["__firefox__","__gCrWeb"];function lh(){return new go([new Fo,new qo,new Io,new To,new $o,new Mo,new Lo,new Do],function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];return function(t,i){void 0===i&&(i=0);for(var r=[],s=t.split("\n"),o=i;s.length>o;o++){var a=s[o];if(1024>=a.length){var l=Eo.test(a)?a.replace(Eo,"$1"):a;if(!l.match(/\S*Error: /)){for(var c=0,d=n;d.length>c;c++){var h=(0,d[c])(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(function(e){return u({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||"?"});var n})}(r)}}("web:javascript",xo,Po))}var ch=function(){"use strict";function e(e){var t,n;this._suppressionRules=[],this._errorPropertiesBuilder=lh(),this._instance=e,this._suppressionRules=null!==(t=null==(n=this._instance.persistence)?void 0:n.get_property("$error_tracking_suppression_rules"))&&void 0!==t?t:[],this._exceptionStepsConfig=Vo(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new zo(this._exceptionStepsConfig)}var t=e.prototype;return t.onConfigChange=function(){this._exceptionStepsConfig=Vo(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)},t.onRemoteConfig=function(e){var t,n,i,r;if(e.ok){var s=e.config;if("errorTracking"in s){var o=null!==(t=null==(n=s.errorTracking)?void 0:n.suppressionRules)&&void 0!==t?t:[],a=null==(i=s.errorTracking)?void 0:i.captureExtensionExceptions;this._suppressionRules=o,this._instance.persistence&&this._instance.persistence.register(((r={})[Lu]=this._suppressionRules,r[Au]=a,r))}}},t.buildProperties=function(e,t){return this._errorPropertiesBuilder.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})},t.addExceptionStep=function(e,t){if(this._exceptionStepsConfig.enabled)try{var n;if(!Or(e)||0===e.trim().length)return void sh.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(function(n,i){return jo.has(i)?(t.push(i),n):(n[i]=e[i],n)},{}),droppedKeys:t}}(this._coerceExceptionStepProperties(t)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&sh.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._exceptionStepsBuffer.add(u(((n={})[Bo]=e,n[No]=(new Date).toISOString(),n),r))}catch(e){sh.error("Failed to add exception step. Ignoring breadcrumb.",e)}},t.sendExceptionEvent=function(e){try{var t=e.$exception_list;if(this._isExceptionList(t)){if(this._matchesSuppressionRule(t))return this._addDroppedExceptionStep("Exception dropped: matched a suppression rule"),void sh.info("Skipping exception capture because a suppression rule matched");if(!this._captureExtensionExceptions&&this._isExtensionException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by a browser extension"),void sh.info("Skipping exception capture because it was thrown by an extension");if(!this._captureExtensionExceptions&&this._isInjectedBrowserScriptException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by an injected browser script"),void sh.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this._isPostHogException(t))return this._addDroppedExceptionStep("Exception dropped: thrown by the PostHog SDK"),void sh.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this._exceptionStepsConfig.enabled&&Dr(e.$exception_steps)?this._addBufferedExceptionSteps(e):e,i="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;i&&(n.$release_id=i);try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return r&&this._exceptionStepsBuffer.clear(),r}catch(e){return rh(e)||sh.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void(rh(e)||sh.error("Failed to process exception event. Ignoring this exception.",e))}var s},t._addBufferedExceptionSteps=function(e){try{var t=this._exceptionStepsBuffer.getAttachable();return 0===t.length?e:u({},e,{$exception_steps:t})}catch(t){return sh.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}},t._addDroppedExceptionStep=function(e){var t;this._exceptionStepsConfig.enabled&&this._exceptionStepsBuffer.add(((t={})[Bo]=e,t[No]=(new Date).toISOString(),t))},t._coerceExceptionStepProperties=function(e){return Rr(e)?u({},e):{}},t._getExceptionStepsConfig=function(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}},t._matchesSuppressionRule=function(e){if(0===e.length)return!1;try{var t=e.reduce(function(e,t){var n=t.type,i=t.value;return Or(n)&&n.length>0&&e.$exception_types.push(n),Or(i)&&i.length>0&&e.$exception_values.push(i),e},{$exception_types:[],$exception_values:[]});return this._suppressionRules.some(function(e){var n=e.values.map(function(e){var n=hu[e.operator],i=t[e.key];if(!n||!i)return!1;var r=Tr(e.value)?e.value:[e.value];return r.length>0&&n(r,i)});return"OR"===e.type?n.some(Boolean):n.every(Boolean)})}catch(e){return sh.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}},t._isExtensionException=function(e){var t=e.flatMap(function(e){var t,n;return null!==(t=null==(n=e.stacktrace)?void 0:n.frames)&&void 0!==t?t:[]}),n=t.filter(function(e){var t=e.filename;return!!t&&ah.some(function(e){return t.startsWith(e)})});return 0!==n.length&&(!n.every(function(e){var t=e.filename;return!!t&&t.startsWith(oh)})||e.some(function(e){var t=e.value;return Or(t)&&t.includes("isolatedAPI.contexts.topHostname")})&&!t.some(function(e){var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(oh))}))},t._isInjectedBrowserScriptException=function(e){return e.some(function(e){var t=e.value;return Or(t)&&uh.some(function(e){return t.includes(e)})})},t._isPostHogException=function(e){if(e.length>0){var t,n,i,r,s=null!==(t=null==(n=e[0].stacktrace)?void 0:n.frames)&&void 0!==t?t:[];return null!==(i=null==(r=s[s.length-1])||null==(r=r.filename)?void 0:r.includes("posthog.com/static"))&&void 0!==i&&i}return!1},t._isExceptionList=function(e){return!Dr(e)&&Tr(e)},o(e,[{key:"_captureExtensionExceptions",get:function(){var e,t,n=!!this._instance.get_property(Au);return null!==(e=null!==(t=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==t?t:n)&&void 0!==e&&e}}])}(),dh=ja("[ExceptionAutocapture]"),hh=lh(),fh=function(e,t){try{return e()}catch(e){return t}},ph=function(e,t){return fh(function(){return e(t())},void 0)},_h=function(e){return fh(function(){return Ir(e)&&Ir(e.call)},!1)},vh=function(e,t){return fh(function(){e[t].__POSTHOG_INSTRUMENTED__=!0},void 0)},gh=function(e,t,n){fh(function(){var n;null==(n=e[t])||delete n.__POSTHOG_INSTRUMENTED__},void 0),fh(function(){e[t]=n},void 0)},mh=function(e){var t=Fa;t||dh.info("window not available, cannot wrap onerror");var n=fh(function(){return t.onerror},void 0);return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),s=0;i>s;s++)r[s]=arguments[s];return ph(e,function(){return hh.buildFromUnknown(function(e){var t=e[0],n=e[1],i=e[2],r=e[3],s=e[4];if(null!=s)return s;if(Or(t)&&Or(n)&&n.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:n,lineno:i,colno:r})}catch(e){return t}return t}(r),{mechanism:{handled:!1}})}),!!_h(n)&&null!==(t=n.apply(void 0,r))&&void 0!==t&&t},vh(t,"onerror"),function(){return gh(t,"onerror",n)}},yh=function(e,t){void 0===t&&(t=!1);var n=Fa;n||dh.info("window not available, cannot wrap onUnhandledRejection");var i=fh(function(){return n.onunhandledrejection},void 0);return n.onunhandledrejection=function(n){var r;return ph(e,function(){return hh.buildFromUnknown(n,{mechanism:{handled:!1}})}),_h(i)?null!==(r=i(n))&&void 0!==r&&r:t},vh(n,"onunhandledrejection"),function(){return gh(n,"onunhandledrejection",i)}},bh={wrapOnError:mh,wrapUnhandledRejection:yh,wrapConsoleError:function(e){var t=console;t||dh.info("console not available, cannot wrap console.error");var n=fh(function(){return t.error},void 0);return t.error=function(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];ph(e,function(){var e;e=1==i.length?i[0]:i.join(" ");var t=i.find(function(e){return e instanceof Error});return hh.buildFromUnknown(t||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),_h(n)&&n.apply(void 0,i)},vh(t,"error"),function(){return gh(t,"error",n)}}};ih.__PosthogExtensions__=ih.__PosthogExtensions__||{},ih.__PosthogExtensions__.errorWrappingFunctions=bh,ih.posthogErrorWrappingFunctions=bh;var wh=function(e,t){if(Ir(null==e?void 0:e.capture)){var n=null==t?void 0:t.autocaptureExceptions,i=!$r(n)&&"object"==typeof n&&Tr(n.errors_to_ignore)?n.errors_to_ignore.reduce(function(e,t){try{e.push(new RegExp(t))}catch(e){dh.error("Ignoring invalid legacy exception exclusion rule",t,e)}return e},[]):[],r=function(t){try{null==e.capture||e.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(e){dh.error("Failed to capture exception for a legacy client",e)}};mh(function(e){i.some(function(t){return e.$exception_list.some(function(e){return t.test(e.value||"")})})||r(e)}),yh(r,!0)}};ih.extendPostHogWithExceptionAutoCapture=wh,ih.extendPostHogWithExceptionAutocapture=wh;var Sh=function(){},xh=function(e){var t;if(Ir(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function kh(e,t,n){try{if(!(t in e))return Sh;var i={next:e[t]},r=n(function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];return i.next.apply(this,t)});return Ir(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),e[t]=r,function(){if(e[t]!==r)for(var n=e[t],s=xh(n);s;){if(s.next===r)return void(s.next=i.next);s=xh(n=s.next)}else e[t]=i.next}}catch(e){return Sh}}var Ch="X-POSTHOG-SESSION-ID",Ph="X-POSTHOG-WINDOW-ID",Eh="X-POSTHOG-DISTINCT-ID",Fh=[Ch,Ph,Eh],Th=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Ih=function(e,t){return{}.hasOwnProperty.call(e,t)},Rh=function(e){return"object"==typeof e&&!$r(e)||Ir(e)},Lh=function(e){return"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e))},Ah=function(e){try{var t;return Lh(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Fa||null==(t=Fa.location)?void 0:t.href).toString()}catch(e){return}},Oh=function(e,t,n,i,r){var s;try{s=new URL(i).hostname}catch(e){return!1}if(!e)return!1;if(Tr(e)&&!e.includes(s))return!1;var o=!1;if(n){var a=n.checkAndGetSessionAndWindowId(!0),u=a.windowId;r.set(Ch,a.sessionId),r.set(Ph,u),o=!0}var l=function(e){return Ir(e)?e():e}(t);return l&&"$posthog_cookieless"!==l&&(r.set(Eh,l),o=!0),o};ih.__PosthogExtensions__=ih.__PosthogExtensions__||{};var Mh={_patchFetch:function(e,t,n){return kh(Fa,"fetch",function(i){return function(r,s){var o=arguments.length>1?[r,s]:[r],a=o;try{var l=Ah(r);if(l)if(Lh(r)){var c=new Request(r,s);Oh(e,t,n,c.url,c.headers),a=[c]}else{var d=new Headers(Rh(s)?s.headers:void 0);if(Oh(e,t,n,l,d)){var h=function(e,t){if(Ar(e)||$r(e))return{headers:t};if(Rh(e)){var n=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var i=Object.create(n);return Object.defineProperty(i,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),i}return new Proxy({headers:t},{get:function(e,t){return Ih(e,t)?Reflect.get(e,t):Reflect.get(n,t,n)},has:function(e,t){return Ih(e,t)||t in n},ownKeys:function(e){var t=new Set(Reflect.ownKeys(e));return Reflect.ownKeys(n).forEach(function(e){return t.add(e)}),Th.forEach(function(e){e in n&&t.add(e)}),Array.from(t)},getOwnPropertyDescriptor:function(e,t){var i=Reflect.getOwnPropertyDescriptor(e,t);if(i)return i;if("string"==typeof t&&Th.includes(t)&&t in n)return{configurable:!0,enumerable:!0,get:function(){return Reflect.get(n,t,n)}};var r=Reflect.getOwnPropertyDescriptor(n,t);return r?u({},r,{configurable:!0}):void 0},getPrototypeOf:function(){return Object.getPrototypeOf(n)}})}}(s,d);h&&(a=[r,h])}}}catch(e){a=o}return i.apply(this,a)}})},_patchXHR:function(e,t,n){return kh(Fa.XMLHttpRequest.prototype,"open",function(i){return function(r,s,o,a,u){void 0===o&&(o=!0);var l=this,c=new Headers,d=Ah(s);d&&Oh(e,t,n,d,c);var h=i.call(l,r,s,o,a,u);return Fh.forEach(function(e){var t=c.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}}),h}})}};ih.__PosthogExtensions__.tracingHeadersPatchFns=Mh,ih.postHogTracingHeadersPatchFns=Mh,Ea.DEBUG=!1,Ea.LIB_VERSION="1.428.0",Ea.LIB_NAME="web";var $h=Ea,Dh=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.isOptedOut=function(){return"always"===this._config.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this._config.cookieless_mode},t.isOptedIn=function(){return!this.isOptedOut()},t.isExplicitlyOptedOut=function(){return 0===this.consent},t.isRejected=function(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default},t.optInOut=function(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)},t.reset=function(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)},t._getDnt=function(){return!!this._config.respect_dnt&&[null==Ia?void 0:Ia.doNotTrack,null==Ia?void 0:Ia.msDoNotTrack,ih.doNotTrack,null==Ia?void 0:Ia.globalPrivacyControl].some(function(e){return Qr(e)})},o(e,[{key:"_config",get:function(){return this._instance.config}},{key:"consent",get:function(){return this._getDnt()?0:this._storedConsent}},{key:"_storageKey",get:function(){var e=this._instance.config,t=e.token,n=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(n?n+t:"__ph_opt_in_out_"+t)}},{key:"_storedConsent",get:function(){var e=this._storage._get(this._storageKey);return Qr(e)?1:vr(Zr,e)?0:-1}},{key:"_storage",get:function(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?oc:rc,n=t._is_supported()?t:mc;if(!this._persistentStore||this._persistentStore!==n){this._persistentStore=n;var i="localStorage"===e?rc:oc;i._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(Qr(i._get(this._storageKey))),i._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}();function qh(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Bh(e){return!!e&&1===e.nodeType}function Nh(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function jh(e){return!!e&&3===e.nodeType}function Hh(e){return!!e&&11===e.nodeType&&Bh(e.host)}function Vh(e){return e?gr(e).split(/\s+/):[]}function zh(e,t){var n=Xl(t);return!!(n&&e&&e.some(function(e){return n.match(e)}))}function Uh(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 Vh(t)}function Wh(e){return Dr(e)?null:gr(e).split(/(\s+)/).filter(function(e){return gf(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Gh(e){var t="";return uf(e)&&!lf(e)&&e.childNodes&&e.childNodes.length&&Va(e.childNodes,function(e){var n;jh(e)&&e.textContent&&(t+=null!==(n=Wh(e.textContent))&&void 0!==n?n:"")}),gr(t)}function Kh(e){var t;return Ar(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var Qh=["a","button","form","input","select","textarea","label"];function Zh(e,t){if(Ar(t))return!0;for(var n,i,r=function(){var e=i.value;if(t.some(function(t){return function(e,t){var n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!n&&n.call(e,t)}catch(e){return!1}}(e,t)}))return{v:!0}},s=d(e);!(i=s()).done;)if(n=r())return n.v;return!1}function Jh(e){var t=e.parentNode;return!(!t||!Bh(t))&&t}var Yh=[".ph-no-autocapture","[data-ph-no-autocapture]"],Xh=["next","previous","prev",">","<"],ef=[].concat(Xh,["+","-","−","–"]),tf=function(e,t){return/[a-z0-9]/i.test(t)?e.includes(t):e===t},nf=[".ph-no-rageclick",".ph-no-capture"],rf=["","text","search","email","password","url","tel","number"];function sf(e,t){if(!Fa||of(e))return!1;var n,i,r,s,o;if(Nr(t)?(n=!!t&&nf,i=void 0,r=!1):(n=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:nf,i=null==t?void 0:t.content_ignorelist,r=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===n)return!1;if(r&&function(e){return!(!e||!Bh(e))&&(!!Nh(e,"textarea")||(Nh(e,"input")?vr(rf,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var a=af(e,!1).targetElementList;return!function(e,t){if(!1===e||Ar(e))return!1;var n;if(!0===e)n=Xh;else{if(!Tr(e))return!1;if(e.length>10)return Na.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;n=e.map(function(e){return e.toLowerCase()})}return t.some(function(e){var t=e.safeText,i=e.ariaLabel;return n.some(function(e){return tf(t,e)||tf(i,e)})})}(i,a.map(function(e){var t;return{safeText:Gh(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!Zh(a,n)}var of=function(e){return!e||Nh(e,"html")||!Bh(e)},af=function(e,t){if(!Fa||of(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,i=[e],r=e;r.parentNode&&!Nh(r,"body");)if(Hh(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var s=Jh(r);if(!s)break;if(t||Qh.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var o=Fa.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(n=!0)}catch(e){}i.push(s),r=s}return{parentIsUsefulElement:n,targetElementList:i}};function uf(e){for(var t=new Set,n=0,i=e;i.parentNode&&!Nh(i,"body");i=i.parentNode){if(n++>=1e3||t.has(i))return!1;t.add(i);var r=Uh(i);if(vr(r,"ph-sensitive")||vr(r,"ph-no-capture"))return!1}if(vr(Uh(e),"ph-include"))return!0;var s=e.type||"";if(Or(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!Or(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function lf(e){return!!(Nh(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Nh(e,"select")||Nh(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var cf=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),df=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,hf=[16,15,14,13],ff=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),pf=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),_f=/[0-9A-Za-z_]/;function vf(e){for(var t=0,n=!1,i=e.length-1;i>=0;i--){var r=e.charCodeAt(i)-48;n&&(r*=2)>9&&(r-=9),t+=r,n=!n}return t%10==0}function gf(e,t){if(void 0===t&&(t=!0),Dr(e))return!1;if(Or(e)){if(e=gr(e),t?cf.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(df.lastIndex=0;t=df.exec(e);){var n=t[2];if(n)for(var i=n.replace(/[- ]/g,""),r=0;i.length>r;r++)for(var s=0,o=hf;o.length>s;s++){var a=r+o[s];if(i.length>=a){var u=i.slice(r,a);if(cf.test(u)&&vf(u))return!0}}}return!1}(e))return!1;if(t?ff.test(e):function(e){var t;for(pf.lastIndex=0;t=pf.exec(e);){var n=t[1],i=t[3];if(!(n&&i&&_f.test(n)&&_f.test(i)))return!0}return!1}(e))return!1}return!0}function mf(e){var t=Gh(e);return gf(t=(t+" "+yf(e)).trim())?t:""}function yf(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Va(e.childNodes,function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var i=Gh(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+yf(e)).trim())}catch(e){Na.error("[AutoCapture]",e)}}),t}function bf(e){return e.replace(/"|\\"/g,'\\"')}function wf(e){var t=e.attr__class;if(t)return Tr(t)?t:Vh(t)}var Sf=ja("[Dead Clicks]"),xf=function(){return!0},kf=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(Mu)),i=e.instance.config.capture_dead_clicks;return Nr(i)?i:!!Rr(i)||n},Cf=function(){"use strict";function e(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}var t=e.prototype;return t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register(((t={})[Mu]=n.captureDeadClicks,t)),this.startIfEnabledOrStop())}},t.startIfEnabledOrStop=function(){var e=this;this.isEnabled(this)?this._loadScript(function(){e._start()}):this.stop()},t._loadScript=function(e){var t,n;null!=(t=ih.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(n=ih.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",function(t){t?Sf.error("failed to load script",t):e()})},t._start=function(){var e;if(Ra){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=ih.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Rr(this.instance.config.capture_dead_clicks)?u({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this._lazyLoadedDeadClicksAutocapture=ih.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Ra),Sf.info("starting...")}}else Sf.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Sf.info("stopping..."))},o(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Pf=ja("[SegmentIntegration]");function Ef(e,t,n){void 0===n&&(n=!0);var i=e.config.segment;if(!i)return t();!function(e,t,n){var i=e.config.segment;if(!i)return t();var r=function(i){var r=function(){return i.anonymousId()||Hl()};e.config.get_device_id=r,n&&i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(_l,Tl)),t(n?void 0:i.anonymousId()||void 0)},s=i.user();"then"in s&&Ir(s.then)?s.then(r):r(s)}(e,function(n){i.register(function(e,t){"undefined"!=typeof Promise&&Promise.resolve||Pf.warn("This browser does not have Promise support, and can not use the segment integration");var n=function(n,i){if(!i)return n;var r=!!t&&n.event.anonymousId===t&&!n.event.userId;r||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(Pf.info("No userId set, resetting PostHog"),e.reset()),r||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(Pf.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));var s=e.calculateEventProperties(i,n.event.properties);return n.event.properties=Object.assign({},s,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return n(e,e.event.event)},page:function(e){return n(e,Al)},identify:function(e){return n(e,Ml)},screen:function(e){return n(e,"$screen")}}}(e,n)).then(function(){t()},function(e){Pf.error("Failed to register the Segment integration",e),t()})},n)}var Ff="posthog-js";function Tf(e,t){var n=void 0===t?{}:t,i=n.organization,r=n.projectId,s=n.prefix,o=n.severityAllowList,a=void 0===o?["error"]:o,l=n.sendExceptionsToPostHog,c=void 0===l||l;return function(t){var n,o,l,d,h,f;if("*"!==a&&!a.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 _=(null==(n=t.exception)?void 0:n.values)||[],v=_.map(function(e){return u({},e,{stacktrace:e.stacktrace?u({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(function(e){return u({},e,{platform:"web:javascript"})})}):void 0})}),g={$exception_message:(null==(o=_[0])?void 0:o.value)||t.message,$exception_type:null==(l=_[0])?void 0:l.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=_[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(h=_[0])?void 0:h.type,$sentry_tags:t.tags};return i&&r&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),c&&(null==(f=e.exceptions)||f.sendExceptionEvent(g)),t}}var If=function(e,t,n,i,r,s){"use strict";this.name=Ff,this.setupOnce=function(o){o(Tf(e,{organization:t,projectId:n,prefix:i,severityAllowList:r,sendExceptionsToPostHog:null==s||s}))}},Rf=function(){"use strict";function e(e){var t=this;this._onSessionIdChange=function(e,n,i){i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Na.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),t._currentPageview=void 0,t._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}var t=e.prototype;return t._setupSessionRotationHandler=function(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)},t.destroy=function(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0},t.doPageView=function(e,t){var n,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==Fa?void 0:Fa.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i},t.doPageLeave=function(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)},t.doEvent=function(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}},t._previousPageViewProperties=function(e,t){var n=this._currentPageview;if(!n)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:n.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var s=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,u=r.maxContentHeight,l=r.lastContentY,c=r.maxContentY;if(!(Ar(s)||Ar(o)||Ar(a)||Ar(u)||Ar(l)||Ar(c))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c);var d=s>1?Jr(o/s,0,1,Na):1,h=s>1?Jr(a/s,0,1,Na):1,f=u>1?Jr(l/u,0,1,Na):1,p=u>1?Jr(c/u,0,1,Na):1;i=za(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:l,$prev_pageview_last_content_percentage:f,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:p})}}return n.pathname&&(i.$prev_pageview_pathname=n.pathname),n.timestamp&&(i.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),i},e}(),Lf=["flags","surveys"],Af=((s={}).$people_distinct_id={exposure:"hidden"},s[Cu]={exposure:"hidden"},s.__cmpns={exposure:"hidden"},s[Fu]={exposure:"hidden"},s[Eu]={exposure:"hidden"},s[Tu]={exposure:"event"},s[Iu]={exposure:"hidden"},s[Du]={exposure:"hidden"},s[Ru]={exposure:"event"},s[Lu]={exposure:"hidden"},s[Au]={exposure:"event"},s[Ou]={exposure:"event"},s[Mu]={exposure:"event"},s[$u]={exposure:"hidden"},s[qu]={exposure:"event"},s[Bu]={exposure:"hidden"},s.$session_recording_enabled_server_side={exposure:"hidden"},s[Uu]={exposure:"hidden"},s[Wu]={exposure:"event"},s[Nu]={exposure:"event",shouldSkipFromEventProperties:function(e){return $r(e)}},s.$session_past_minimum_duration={exposure:"event"},s.$session_recording_url_trigger_activated_session={exposure:"event"},s.$session_recording_event_trigger_activated_session={exposure:"event"},s.$debug_first_full_snapshot_timestamp={exposure:"event"},s.$sess_rec_flush_size={exposure:"hidden"},s[Gu]={exposure:"hidden",storageGroup:"flags"},s[Ku]={exposure:"hidden",storageGroup:"flags"},s[Qu]={exposure:"hidden"},s[Zu]={exposure:"hidden",storageGroup:"flags"},s[Ju]={exposure:"hidden",storageGroup:"flags"},s[Yu]={exposure:"hidden",storageGroup:"flags",volatile:!0},s[Xu]={exposure:"hidden",storageGroup:"flags"},s[el]={exposure:"hidden"},s[tl]={exposure:"hidden"},s[nl]={exposure:"hidden"},s[il]={exposure:"hidden"},s[sl]={exposure:"hidden",storageGroup:"surveys"},s[ol]={exposure:"hidden",storageGroup:"surveys",volatile:!0},s[al]={exposure:"event"},s[ul]={exposure:"hidden"},s[ll]={exposure:"hidden"},s[cl]={exposure:"hidden"},s.$product_tours_activated={exposure:"hidden"},s.$product_tours_activated_session={exposure:"hidden"},s.$conversations_widget_session_id={exposure:"event"},s.$conversations_ticket_id={exposure:"event"},s.$conversations_widget_state={exposure:"event"},s.$conversations_user_traits={exposure:"event"},s[dl]={exposure:"hidden"},s[hl]={exposure:"hidden"},s[rl]={exposure:"event"},s[fl]={exposure:"hidden"},s[pl]={exposure:"hidden",storageGroup:"flags",volatile:!0},s[_l]={exposure:"hidden"},s[vl]={exposure:"hidden"},s[gl]={exposure:"hidden"},s[ml]={exposure:"hidden"},s[yl]={exposure:"hidden"},s[bl]={exposure:"hidden"},s[wl]={exposure:"hidden"},s[ju]={exposure:"event"},s[Hu]={exposure:"event"},s[Vu]={exposure:"event"},s[zu]={exposure:"event"},s[kl]={exposure:"event"},s[Cl]={exposure:"event"},s[Pl]={exposure:"event"},s.$sdk_debug_replay_event_trigger_status={exposure:"event"},s.$sdk_debug_replay_linked_flag_trigger_status={exposure:"event"},s.$sdk_debug_replay_matched_recording_trigger_groups={exposure:"event"},s.$sdk_debug_replay_pending_trigger_conditions={exposure:"event"},s.$sdk_debug_replay_remote_trigger_matching_config={exposure:"event"},s.$sdk_debug_replay_trigger_groups_count={exposure:"event"},s.$sdk_debug_replay_url_trigger_status={exposure:"event"},s.$session_recording_start_reason={exposure:"event"},s),Of=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Mf=function(e){var t=Af[e];if(t)return t;for(var n=0,i=Of;i.length>n;n++){var r=i[n],s=r[1];if(0===e.indexOf(r[0]))return s}},$f={flags:pl,surveys:ol},Df=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],qf=function(e){return e+"_cookie_identity_change_pending"},Bf=function(e){for(var t,n="",i=0,r=d(e);!(t=r()).done;){var s=t.value,o=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+o>1e3)break;n+=s,i+=o}return n},Nf="main",jf=[Gu,Ku,Zu,Ju,Yu,pl,Xu,nl],Hf=function(e){return-1!==jf.indexOf(e)},Vf=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){return e===t}},zf=function(e){if(!e)return{};var t=JSON.parse(e);return Rr(t)?t:{}},Uf=function(e,t){Va(e,function(n,i){var r=Mf(i);r&&"event"!==r.exposure||{}.hasOwnProperty.call(t,i)||delete e[i]})},Wf=function(){"use strict";function e(e,t,n){var i=this;if(void 0===n&&(n=!0),this._slotState={},this._splitStorageEligible=!1,this._storesIdentityInCookie=!1,this._splitStorage=!1,this._cookieIdentityChangePending=!1,this._cookieSyncSuppressed=!1,this._pendingCrossTabFeatureFlagChanges=new Map,this._storageMigrationInProgress=!1,this._localIdentityChangePending=!1,this._crossTabFeatureFlagIdentityMismatch=!1,this._facebookClickIdChangePending=!1,this._crossTabFeatureFlagHandlers=new Set,this._config=e,this._ownsSplitStorage=n,this.props={},this._campaign_params_url=void 0,this._name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(e),this._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(),this._markLoadedCrossTabFeatureFlagChangesPending(),e.debug&&Na.info("Persistence loaded",e.persistence,u({},this.props)),this.update_config(e,e,t),this.save(),Fa){var r=function(){return i.flush()};Ja(Fa,"beforeunload",r,{capture:!1}),Ja(Fa,"pagehide",r,{capture:!1}),this._onStorage=function(e){if(i._splitStorageEligible&&(!e.storageArea||e.storageArea===(null==Fa?void 0:Fa.localStorage))&&e.key)if(e.key!==i._name){if(i._splitStorage){var t=Lf.find(function(t){return e.key===i._groupEntryName(t)});t&&i._syncCrossTabFeatureFlagProperties(e.key,t)}}else i._syncCrossTabFeatureFlagProperties(e.key,Nf)},Ja(Fa,"storage",this._onStorage)}}var t=e.prototype;return t.markCrossTabFeatureFlagChanges=function(e){var t=this;Object.entries(e).forEach(function(e){var n=e[0],i=e[1],r=t._pendingCrossTabFeatureFlagChanges.get(n);if(Hf(n)&&!0!==r)if(!0!==i){var s=new Set(r||[]);i.forEach(function(e){return s.add(e)}),s.size&&t._setCrossTabFeatureFlagChangesPending(n,s)}else t._setCrossTabFeatureFlagChangesPending(n,!0)})},t.onCrossTabFeatureFlagChange=function(e){var t=this;return this._crossTabFeatureFlagHandlers.add(e),function(){return t._crossTabFeatureFlagHandlers.delete(e)}},t.destroy=function(){this._onStorage&&Fa&&(Fa.removeEventListener("storage",this._onStorage),this._onStorage=void 0),this._crossTabFeatureFlagHandlers.clear()},t._syncCrossTabFeatureFlagProperties=function(e,t,n){if(void 0===n&&(n=!0),this._disabled)return!1;var i,r;try{if(r=oc._get(e),$r(r)){var s=this._slotWriteState(t);return s.storageValue=null,t!==Nf&&(s.persisted=!1),!1}i=zf(r)}catch(e){return!1}var o=t===Nf?i:oc._parse(this._name);if(o&&this._hasCrossTabFeatureFlagIdentityMismatch(o))return!1;var a=this._mergeCrossTabFeatureFlagProperties(i,t,n);return t===Nf&&this._splitStorage&&!Vf(this._partitionProps().main,i)||this._rememberCrossTabStorageFingerprint(i,t,!0,r),a},t._hasCrossTabFeatureFlagIdentityMismatch=function(e){var t=this.props[Su],n=e[Su];return!Ar(t)&&!Ar(n)&&t!==n},t._rememberCrossTabStorageFingerprint=function(e,t,n,i){var r=this._slotWriteState(t);r.storageValue=i,t!==Nf&&(r.persisted=n);try{r.fingerprint=this._entryFingerprint(e,t)}catch(e){r.fingerprint=void 0}},t._mergeCrossTabFeatureFlagProperties=function(e,t,n){var i=this,r=!1;return jf.forEach(function(n){var s,o=null==(s=Mf(n))?void 0:s.storageGroup;if(!(t===Nf&&i._splitStorage&&o||t!==Nf&&o!==t)){var a=n in e,u=i._mergePendingCrossTabFeatureFlagChanges(n,a?e[n]:void 0),l=i._pendingCrossTabFeatureFlagChanges.has(n)?n in i.props:a;l===n in i.props&&Vf(u,i.props[n])||(l?i._setProp(n,u,!1):i._deleteProp(n,!1),r=!0)}}),r&&n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}),r},t._reconcileCrossTabFeatureFlagPropertiesBeforeWrite=function(){var e=this;if(!this._splitStorageEligible)return!1;try{this._crossTabFeatureFlagIdentityMismatch=!1;var t,n=oc._get(this._name),i=this._slotWriteState(Nf),r=!1,s=!1;if(n!==i.storageValue)if($r(n))i.storageValue=null;else{if(t=zf(n),this._crossTabFeatureFlagIdentityMismatch=!this._localIdentityChangePending&&this._hasCrossTabFeatureFlagIdentityMismatch(t),this._crossTabFeatureFlagIdentityMismatch)return!1;s=this._mergeCrossTabFeatureFlagProperties(t,Nf,!1),!this._splitStorage||Vf(this._partitionProps().main,t)?this._rememberCrossTabStorageFingerprint(t,Nf,!0,n):i.storageValue=n,r=!0}return this._splitStorage&&Lf.forEach(function(n){var i=oc._get(e._groupEntryName(n)),o=e._slotWriteState(n),a=t||{},u=r&&jf.some(function(e){var t;return(null==(t=Mf(e))?void 0:t.storageGroup)===n&&e in a});if(i!==o.storageValue||u){if($r(i))return o.storageValue=null,o.persisted=!1,void(u&&(s=e._mergeCrossTabFeatureFlagProperties(a,n,!1)||s));var l=zf(i);s=e._mergeCrossTabFeatureFlagProperties(l,n,!1)||s,e._rememberCrossTabStorageFingerprint(l,n,!0,i)}}),s}catch(e){return!1}},t._setCrossTabFeatureFlagChangesPending=function(e,t){this._pendingCrossTabFeatureFlagChanges.set(e,t);var n=Mf(e);null!=n&&n.volatile||(this._slotWriteState((this._splitStorage?null==n?void 0:n.storageGroup:void 0)||Nf).fingerprint=void 0,this._markGroupDirty(e))},t._markAllCrossTabFeatureFlagChangesPending=function(){var e=this;jf.forEach(function(t){return e._pendingCrossTabFeatureFlagChanges.set(t,!0)})},t._markLoadedCrossTabFeatureFlagChangesPending=function(){var e=this;if(this._splitStorageEligible)try{var t=oc._get(this._name),n=zf(t);this._slotWriteState(Nf).storageValue=t,jf.forEach(function(t){var i,r=e._splitStorage?null==(i=Mf(t))?void 0:i.storageGroup:void 0,s=r?oc._get(e._groupEntryName(r)):null;if(r){var o=e._slotWriteState(r);o.storageValue=s,o.persisted=!$r(s)}var a=r&&!$r(s)?zf(s):n;t in e.props?e._markPendingCrossTabFeatureFlagChanges(t,a[t],e.props[t]):t in a&&e._setCrossTabFeatureFlagChangesPending(t,!0)})}catch(e){}},t._mergePendingCrossTabFeatureFlagChanges=function(e,t){var n=this._pendingCrossTabFeatureFlagChanges.get(e);if(!n)return t;if(!0===n)return this.props[e];if("$active_feature_flags"===e){var i=new Set(Tr(t)?t:[]),r=new Set(Tr(this.props[e])?this.props[e]:[]);return n.forEach(function(e){return r.has(e)?i.add(e):i.delete(e)}),Array.from(i)}var s=Rr(t)?u({},t):{},o=Rr(this.props[e])?this.props[e]:{};return n.forEach(function(e){e in o?s[e]=o[e]:delete s[e]}),s},t._markPendingCrossTabFeatureFlagChanges=function(e,t,n){if(Hf(e)){var i=this._pendingCrossTabFeatureFlagChanges.get(e);if(!0!==i){var r=t;if(this._splitStorageEligible)try{var s,o=this._splitStorage?null==(s=Mf(e))?void 0:s.storageGroup:void 0,a=o?this._groupEntryName(o):this._name;r=zf(oc._get(a))[e]}catch(e){}var u=new Set(i||[]);if("$active_feature_flags"===e){if(!Ar(t)&&!Tr(t)||!Ar(r)&&!Tr(r)||!Tr(n))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var l=new Set(t||[]),c=new Set(r||[]),d=new Set(n);new Set([].concat(l,d)).forEach(function(e){l.has(e)!==d.has(e)&&u.add(e)}),u.forEach(function(e){c.has(e)===d.has(e)&&u.delete(e)})}else{if(!Rr(n))return void(Vf(r,n)?this._pendingCrossTabFeatureFlagChanges.delete(e):this._setCrossTabFeatureFlagChangesPending(e,!0));if(!Ar(t)&&!Rr(t)||Ar(t)&&Lr(n)&&Ar(r))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var h=Rr(t)?t:{},f=Rr(r)?r:{};new Set([].concat(Object.keys(h),Object.keys(n))).forEach(function(e){e in h==e in n&&Vf(h[e],n[e])||u.add(e)}),u.forEach(function(e){e in f==e in n&&Vf(f[e],n[e])&&u.delete(e)})}u.size?this._setCrossTabFeatureFlagChangesPending(e,u):this._pendingCrossTabFeatureFlagChanges.delete(e)}}},t._saveDebounceMs=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return qr(t)&&t>0?t:0},t._rememberCurrentCookieProperties=function(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=hc(e,this._config.cookie_persisted_properties||[]),n=pc(t,this._config.cookie_persisted_properties||[]),i=JSON.stringify(t)+"|"+JSON.stringify(n),r=rc._get(this._name)||void 0;r&&vc(this._name,r)===i&&(this._lastSeenCookiePropertiesFingerprint=i,this._lastSeenMainCookieValue=r)}catch(e){}else try{var s=rc._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=s?vc(this._name,s):void 0,this._lastSeenMainCookieValue=s}catch(e){}},t.syncCookieProperties=function(){return this._syncCookieProperties(this._config)},t._syncCookieProperties=function(e,t){var n,i=this;if(void 0===t&&(t=!1),this._disabled&&!t||this._cookieSyncSuppressed||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{n=rc._get(this._name)||void 0}catch(e){}if(!n||n===this._lastSeenMainCookieValue)return!1;var r,s=vc(this._name,n);try{r=dc(JSON.parse(n))}catch(e){return!1}if((rc._get(this._name)||void 0)!==n)return!1;this._lastSeenCookiePropertiesFingerprint=s,this._lastSeenMainCookieValue=n;var o=_c(this._name,n),a=[].concat(uc,o.properties),u={};if(Object.keys(r).forEach(function(e){var t=r[e];(Ar(t)||$r(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(u[e]=!0,delete r[e])}),Lr(r))return!1;var l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,c=this.props,d=c[Su],h=c[_l],f=za({},c);[].concat(uc,e.cookie_persisted_properties||[]).forEach(function(e){if(-1!==a.indexOf(e)&&!(e in r)&&!u[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=f[e];(o.isValid||-1===uc.indexOf(e)||!1!==t&&0!==t)&&delete f[e]}}),this.props=za(f,r),jf.forEach(function(e){var t=e in i.props;e in c===t&&Vf(c[e],i.props[e])||(t?i._markPendingCrossTabFeatureFlagChanges(e,c[e],i.props[e]):i._setCrossTabFeatureFlagChangesPending(e,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this._setProp(_l,Fl);var p=this.props[Su],_=this.props[_l];return!l||p===d&&_===h||(this._localIdentityChangePending=!0,this._cookieIdentityChangePending=!0,bc._set(qf(this._name),!0),this._deleteProp(nl),this._deleteProp(Ku),this._deleteProp(Gu),this._deleteProp(Zu),this._deleteProp(Ju),this._deleteProp(Yu),this._deleteProp(pl),this._deleteProp(fl),this._deleteProp(dl),"anonymous"!==_||"identified"!==h&&"anonymous"!==r.$user_state&&(Ar(d)||p===d)||(Uf(this.props,r),this._deleteProp(il)),"identified"===_?this.props.$user_id=p:delete this.props.$user_id,this._deleteProp(Cu)),!0},t.consumeCookieIdentityChange=function(){var e=qf(this._name),t=this._cookieIdentityChangePending||!!bc._get(e);return this._cookieIdentityChangePending=!1,t&&bc._remove(e),t},t._beginCookieSyncSuppression=function(e){return void 0===e&&(e=!1),!(this._cookieSyncSuppressed||this._disabled&&!e||!this._config.cookieWinsOnConflict||"localstorage+cookie"!==this._config.persistence.toLowerCase()||(this._cookieSyncSuppressed=!0,0))},t._publishSuppressedCookieSnapshot=function(){this._cookieSyncSuppressed&&(Ar(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[Nf],this._writeNow(!0))},t._endCookieSyncSuppression=function(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():Ar(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}},t.isDisabled=function(){return!!this._disabled},t._buildStorage=function(e){-1===Df.indexOf(e.persistence.toLowerCase())&&(Na.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,n=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var n=[].concat(uc,e);return u({},oc,{_parse:function(e){try{var i,r={};try{i=rc._get(e)||void 0,r=i?dc(JSON.parse(i)):{}}catch(e){}var s,o=JSON.parse(oc._get(e)||"{}");if(t){var a=_c(e,i),u=[].concat(uc,a.properties),l={};Object.keys(r).forEach(function(e){var t=r[e];$r(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(l[e]=t)});var c="distinct_id"in l||"anonymous"===l.$user_state||"identified"===l.$user_state;if(Object.keys(l).length>0){var d,h=o[Su],f=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";n.forEach(function(e){if(-1!==u.indexOf(e)&&!(e in r)&&(c||"distinct_id"!==e&&"$user_state"!==e)){var t=o[e];(a.isValid||-1===uc.indexOf(e)||!1!==t&&0!==t)&&delete o[e]}}),!c||"$user_state"in r||"$user_state"in o||(o[_l]=Fl),!c||("distinct_id"in l?l[Su]:o[Su])===h&&("$user_state"in l?l[_l]:o[_l])===f||(ac.forEach(function(e){return delete o[e]}),"identified"===l.$user_state&&"distinct_id"in l?o.$user_id=l[Su]:delete o.$user_id,"identified"!==l.$user_state&&(delete o[rl],delete o[il]),delete o.__alias)}s=za(o,l)}else s=za(r,o);return oc._set(e,s),s}catch(e){}return null},_set:function(n,i,r,s,o,a){var u=oc._set(n,i,void 0,void 0,a);try{var l=hc(i,e);if(Object.keys(l).length){if(t){var c=lc(n),d=pc(l,e);if(rc._set(c,d,r,s,o,a),rc._get(c)!==JSON.stringify(d)){rc._remove(c,s);var h=hc(i);return rc._set(n,h,r,s,o,a),u}}rc._set(n,l,r,s,o,a)}}catch(e){oc._error(e)}return u},_remove:function(e,t){try{null==Fa||Fa.localStorage.removeItem(e),rc._remove(e,t),rc._remove(lc(e),t)}catch(e){oc._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),i=!1,r=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&oc._is_supported()?(t=oc,r=!0):"localstorage+cookie"===s&&n._is_supported()?(t=n,r=!0,i=!0):"sessionstorage"===s&&bc._is_supported()?t=bc:"memory"===s?t=mc:"cookie"===s&&rc._is_supported()?(t=rc,i=!0):n._is_supported()?(t=n,r=!0,i=!0):rc._is_supported()?(t=rc,i=!0):t=mc,this._splitStorageEligible=r,this._storesIdentityInCookie=i,t},t._groupEntryName=function(e){return this._name+"__"+e},t._resolveSplitStorage=function(e){return this._splitStorageEligible&&!!e.split_storage},t.properties=function(){var e={};return Va(this.props,function(t,n){var i=Mf(n);if(!i||"event"===i.exposure){if(null!=i&&null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t))return;e[n]=t}}),e},t.load=function(e){var t=this;if(void 0===e&&(e=!1),!this._disabled||e){var n=this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase(),i=n?oc._parse(this._name):null,r={};if(n)try{Va(r=dc(rc._parse(this._name)),function(e,t){(Ar(e)||$r(e)||""===e)&&delete r[t]})}catch(e){}var s=this._storage._parse(this._name);if(s&&(this.props=za({},s)),this._splitStorage&&this._loadGroupEntries(),n&&s){var o,a,u=null==i?void 0:i[Su],l=null!==(o=null==i?void 0:i.$user_state)&&void 0!==o?o:"anonymous",c=s[Su],d=null!==(a=s.$user_state)&&void 0!==a?a:"anonymous";if(c!==u||d!==l){this._cookieIdentityChangePending=!0,bc._set(qf(this._name),!0);var h=za({},this.props);ac.forEach(function(e){return delete h[e]}),"anonymous"!==d||"identified"!==l&&"anonymous"!==r.$user_state&&(Ar(u)||c===u)||(Uf(h,r),delete h[il]),this.props=h;var f=new Set;ac.forEach(function(e){var t,n=null==(t=Mf(e))?void 0:t.storageGroup;n&&f.add(n)}),f.forEach(function(e){var n={};Va(t.props,function(t,i){var r;(null==(r=Mf(i))?void 0:r.storageGroup)===e&&(n[i]=t)}),Lr(n)?(oc._remove(t._groupEntryName(e)),t._slotState[e]={}):oc._set(t._groupEntryName(e),n)&&(t._slotState[e]={persisted:!0,fingerprint:t._entryFingerprint(n,e)})})}}bc._get(qf(this._name))&&(this._cookieIdentityChangePending=!0)}},t._loadGroupEntries=function(){for(var e=0,t=Lf;t.length>e;e++){var n=t[e],i=oc._parse(this._groupEntryName(n));if(i&&!Lr(i)){var r=this._slotWriteState(n);r.persisted=!0,this._mainCarriesGroupKey(n)||(r.fingerprint=this._entryFingerprint(i,n)),this._groupEntryIsStale(n,i)||za(this.props,i)}}},t._mainCarriesGroupKey=function(e){return Object.keys(this.props).some(function(t){var n;return(null==(n=Mf(t))?void 0:n.storageGroup)===e})},t._groupEntryIsStale=function(e,t){var n=$f[e];if(!n)return!1;var i=t[n],r=this.props[n];return qr(i)&&qr(r)&&r>i},t.refreshKey=function(e){var t;if(!(this._disabled||"$fbc_persistence"===e&&this._facebookClickIdChangePending)){var n=this._splitStorage?null==(t=Mf(e))?void 0:t.storageGroup:void 0,i=n?oc._parse(this._groupEntryName(n)):this._storage._parse(this._name);if(i&&e in i)this._setProp(e,i[e],!1);else{if(n){var r=this._storage._parse(this._name);if(r&&e in r)return void this._setProp(e,r[e],!1)}this._deleteProp(e,!1)}}},t.save=function(){var e=this;if(!this._disabled){var t=this._saveDebounceMs();t>0?Ar(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout(function(){e._pendingSaveTimer=void 0,e._writeNow()},t)):this._writeNow()}},t.flush=function(){Ar(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())},t._writeNow=function(e){if(void 0===e&&(e=!1),!(this._disabled||this._cookieSyncSuppressed&&!e)){e||(this.syncCookieProperties(),this._facebookClickIdChangePending||this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase()||this.refreshKey(Eu));var t=!e&&!this._storageMigrationInProgress;t||(this._crossTabFeatureFlagIdentityMismatch=!1);var n=!!t&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite();if(this._crossTabFeatureFlagIdentityMismatch)this._config.debug&&Na.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this._splitStorage)return this._writeNowSplit(),void(n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}));var i=this._writeEntry(this._storage,this._name,this.props,Nf);"written"===i&&this._rememberCurrentCookieProperties(this.props),"failed"!==i&&(this._pendingCrossTabFeatureFlagChanges.clear(),this._localIdentityChangePending=!1,this._facebookClickIdChangePending=!1),n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()})}}},t._writeNowSplit=function(){var e=this,t=this._partitionProps(),n=t.main,i=t.groups,r=this._writeEntry(this._storage,this._name,n,Nf);"written"===r&&this._rememberCurrentCookieProperties(n),"failed"!==r&&(this._localIdentityChangePending=!1,this._facebookClickIdChangePending=!1,jf.forEach(function(t){var n;null!=(n=Mf(t))&&n.storageGroup||e._pendingCrossTabFeatureFlagChanges.delete(t)}));for(var s=function(){var t,n=a[o],r=i[n];if(Lr(r)&&(null==(t=e._slotState[n])||!t.persisted))return jf.forEach(function(t){var i;(null==(i=Mf(t))?void 0:i.storageGroup)===n&&e._pendingCrossTabFeatureFlagChanges.delete(t)}),1;var s=e._writeEntry(oc,e._groupEntryName(n),r,n);"failed"!==s&&jf.forEach(function(t){var i=Mf(t);(null==i?void 0:i.storageGroup)!==n||"written"!==s&&i.volatile||e._pendingCrossTabFeatureFlagChanges.delete(t)})},o=0,a=Lf;a.length>o;o++)if(s())continue},t._partitionProps=function(){var e={},t={flags:{},surveys:{}};return Va(this.props,function(n,i){var r,s=null==(r=Mf(i))?void 0:r.storageGroup;s?t[s][i]=n:e[i]=n}),{main:e,groups:t}},t._entryFingerprint=function(e,t){if(t===Nf)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var n={};return Va(e,function(e,t){var i;n[t]=null!=(i=Mf(t))&&i.volatile?"__volatile__":e}),JSON.stringify(n)},t._writeEntry=function(e,t,n,i){var r,s=this._slotWriteState(i);if(i!==Nf&&!s.dirty&&!Ar(s.fingerprint))return"skipped";try{if((r=this._entryFingerprint(n,i))===s.fingerprint)return s.dirty=!1,"skipped"}catch(e){r=void 0}return e._set(t,n,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(s.dirty=!1,i!==Nf&&(s.persisted=!0),Ar(r)||(s.fingerprint=r),this._splitStorageEligible&&(s.storageValue=oc._get(t)),"written"):(this._config.debug&&Na.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")},t.remove=function(e){var t=(void 0===e?{}:e).keepGroupEntries,n=void 0!==t&&t;if(this._markAllCrossTabFeatureFlagChangesPending(),Ar(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),this._storage._remove(this._name,!1),this._storage._remove(this._name,!0),!n&&this._ownsSplitStorage)for(var i=0,r=Lf;r.length>i;i++)oc._remove(this._groupEntryName(r[i]));n?delete this._slotState[Nf]:this._slotState={},this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0},t.clear=function(){this.remove(),this.props={}},t.register_once=function(e,t,n){var i=this;if(Rr(e)){this.syncCookieProperties(),Ar(t)&&(t="None"),this._expire_days=Ar(n)?this._default_expiry:n;var r=!1;if(Va(e,function(e,n){i.props.hasOwnProperty(n)&&i.props[n]!==t||(i._setProp(n,e),r=!0)}),r)return this.save(),!0}return!1},t.register=function(e,t){var n=this;if(Rr(e)){this.syncCookieProperties(),this._expire_days=Ar(t)?this._default_expiry:t;var i=!1;if(Va(e,function(t,r){e.hasOwnProperty(r)&&(n.props[r]!==t||Rr(t)||Tr(t))&&(n._setProp(r,t),i=!0)}),i)return this.save(),!0}return!1},t.unregister=function(e){this.syncCookieProperties();for(var t,n=!1,i=d("string"==typeof e?[e]:e);!(t=i()).done;){var r=t.value;r in this.props&&(this._deleteProp(r),n=!0)}n&&this.save()},t.update_campaign_params=function(){var e=null==Ra?void 0:Ra.URL;if(e!==this._campaign_params_url){var t=Id(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),n=!Lr(Ka(t));return n&&this.register(t),this._campaign_params_url=e,n?t:void 0}},t.update_search_keyword=function(){var e;this.register((e=null==Ra?void 0:Ra.referrer)?Ld(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:Md(),$referring_domain:null!=Ra&&Ra.referrer&&(null==(e=Ul(Ra.referrer))?void 0:e.host)||Od},void 0)},t.set_initial_person_info=function(){var e;if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=$d(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes);this.register_once(((e={})[bl]=this._storesIdentityInCookie?{r:Bf(t.r),u:t.u?Bf(t.u):void 0}:t,e),void 0)}},t.get_initial_props=function(){var e=this,t={};Va([yl,ml],function(n){var i=e.props[n];i&&Va(i,function(e,n){t["$initial_"+mr(n)]=e})});var n=this.props[bl];return n&&za(t,function(e,t){void 0===t&&(t=!1);var n=Dd(e,t),i={};return Va(n,function(e,t){i["$initial_"+mr(t)]=e}),i}(n,this._config.disable_capture_url_hashes)),t},t.safe_merge=function(e){return Va(this.props,function(t,n){n in e||(e[n]=t)}),e},t.update_config=function(e,t,n){var i=e.persistence!==t.persistence,r=!function(e,t){if(e.length!==t.length)return!1;var n=[].concat(e).sort(),i=[].concat(t).sort();return n.every(function(e,t){return e===i[t]})}(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=i||r,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!n,l=!!this._disabled&&!a;a||this._syncCookieProperties(t,l),this._config=e,!a&&(i||r||o)&&(this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0,this._syncCookieProperties(u({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var c=s||o?this._buildStorage(e):this._storage;this._truncateExistingPersonInfoForCookie();var d=this._resolveSplitStorage(e),h=s||d!==this._splitStorage,f=!a&&(h||e.cross_subdomain_cookie!==this._cross_subdomain||e.secure_cookie!==this._secure)&&this._beginCookieSyncSuppression(l);this._storageMigrationInProgress=h;try{if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),h){var p=this.props;this.clear(),this._storage=c,this._splitStorage=d,this.props=p,this.save()}else o&&(this._storage=c,a||(delete this._slotState[Nf],this._writeNow()))}finally{this._storageMigrationInProgress=!1,f&&this._endCookieSyncSuppression()}},t._truncateExistingPersonInfoForCookie=function(){var e=this.props[bl];if(this._storesIdentityInCookie&&Rr(e)&&"string"==typeof e.r){var t=Bf(e.r),n="string"==typeof e.u?Bf(e.u):e.u;t===e.r&&n===e.u||this._setProp(bl,u({},e,{r:t,u:n}))}},t.set_disabled=function(e){this._disabled=e,this._disabled?this.remove():this.save()},t.set_cross_subdomain=function(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove({keepGroupEntries:!0}),this.save())},t.set_secure=function(e){e!==this._secure&&(this._secure=e,this.remove({keepGroupEntries:!0}),this.save())},t.set_event_timer=function(e,t){var n=this.props.__timers||{};n[e]=t,this._setProp(Fu,n),this.save()},t.remove_event_timer=function(e){var t=this.props.__timers||{},n=t[e];return Ar(n)||(delete t[e],this._setProp(Fu,t),this.save()),n},t.get_property=function(e){return this.props[e]},t.set_property=function(e,t){this._setProp(e,t),this.save()},t._setProp=function(e,t,n){var i;void 0===n&&(n=!0);var r=this.props[e];this.props[e]=t,n&&("distinct_id"!==e&&"$user_state"!==e||r===t||(this._localIdentityChangePending=!0),"$fbc_persistence"!==e||Vf(r,t)||(this._facebookClickIdChangePending=!0),this._markPendingCrossTabFeatureFlagChanges(e,r,t),null!=(i=Mf(e))&&i.volatile||this._markGroupDirty(e))},t._deleteProp=function(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(Hf(e)&&this._setCrossTabFeatureFlagChangesPending(e,!0),"$fbc_persistence"===e&&(this._facebookClickIdChangePending=!0),this._markGroupDirty(e))},t._markGroupDirty=function(e){var t,n=null==(t=Mf(e))?void 0:t.storageGroup;n&&(this._slotWriteState(n).dirty=!0)},t._slotWriteState=function(e){return this._slotState[e]||(this._slotState[e]={})},e}(),Gf=ja("[RateLimiter]"),Kf=function(){"use strict";function e(e){var t=this;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=function(e){var n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(function(e){Gf.info((e||"events")+" is quota limited."),t.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void Gf.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}var t=e.prototype;return t.clientRateLimitContext=function(e){var t,n,i;void 0===e&&(e=!1);var r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(t=null==(n=this.instance.persistence)?void 0:n.get_property("$capture_rate_limit"))&&void 0!==t?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>r&&(a.tokens=r);var u=1>a.tokens;if(u||e||(a.tokens=Math.max(0,a.tokens-1)),u&&!e){var l=(qr(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this._captureWarning(l)&&(a.dropped=0)}return this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(gl,a),{isRateLimited:u,remainingTokens:a.tokens}},t._isPropertyAllowed=function(e){var t=this.instance.config.property_denylist;return!Tr(t)||!t.includes(e)},t._triggeringPage=function(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=La&&La.pathname)return""+(null!==(e=La.origin)&&void 0!==e?e:"")+La.pathname},t._captureWarning=function(e){var t,n,i=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,s=this._triggeringPage(),o=this._isPropertyAllowed("$session_id")?null==(t=(n=this.instance).get_session_id)?void 0:t.call(n):void 0,a=[e+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+r+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0})},t.isServerRateLimited=function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t},o(e,[{key:"captureEventsPerSecond",get:function(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}},{key:"captureEventsBurstLimit",get:function(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}}])}(),Qf=ja("[RemoteConfig]"),Zf=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t,n,i=this;null!=(t=ih.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=ih.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",function(){return e(i.remoteConfig)}):e()},t._loadRemoteConfigJSON=function(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})},t.load=function(){var e=this;try{if(this.remoteConfig)return Qf.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void Qf.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(function(t){if(!t)return Qf.info("No config found after loading remote JS config. Falling back to JSON."),void e._loadRemoteConfigJSON(function(t){e._onRemoteConfig(t.json,t)});e._onRemoteConfig(t)})}catch(e){Qf.error("Error loading remote config",e),this._onRemoteConfig()}},t._onRemoteConfig=function(e,t){!e&&t&&(0===t.statusCode?t.error||Qf.warn("Failed to fetch remote config from PostHog."):Qf.error("Failed to fetch remote config from PostHog."));try{this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1})}catch(e){Qf.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var n;null==(n=this._instance.featureFlags)||n.ensureFlagsLoaded()}catch(e){Qf.error("Error loading feature flags",e)}},o(e,[{key:"remoteConfig",get:function(){var e;return null==(e=ih._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),Jf=Uint8Array,Yf=Uint16Array,Xf=Uint32Array,ep=new Jf([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]),tp=new Jf([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]),np=new Jf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ip=function(e,t){for(var n=new Yf(31),i=0;31>i;++i)n[i]=t+=1<<e[i-1];var r=new Xf(n[30]);for(i=1;30>i;++i)for(var s=n[i];n[i+1]>s;++s)r[s]=s-n[i]<<5|i;return[n,r]},rp=ip(ep,2),sp=rp[1];rp[0][28]=258,sp[258]=28;for(var op=ip(tp,0)[1],ap=new Yf(32768),up=0;32768>up;++up){var lp=(43690&up)>>>1|(21845&up)<<1;ap[up]=((65280&(lp=(61680&(lp=(52428&lp)>>>2|(13107&lp)<<2))>>>4|(3855&lp)<<4))>>>8|(255&lp)<<8)>>>1}var cp=function(e,t,n){for(var i=e.length,r=0,s=new Yf(t);i>r;++r)++s[e[r]-1];var o,a=new Yf(t);for(r=0;t>r;++r)a[r]=a[r-1]+s[r-1]<<1;if(n){o=new Yf(1<<t);var u=15-t;for(r=0;i>r;++r)if(e[r])for(var l=r<<4|e[r],c=t-e[r],d=a[e[r]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)o[ap[d]>>>u]=l}else for(o=new Yf(i),r=0;i>r;++r)o[r]=ap[a[e[r]-1]++]>>>15-e[r];return o},dp=new Jf(288);for(up=0;144>up;++up)dp[up]=8;for(up=144;256>up;++up)dp[up]=9;for(up=256;280>up;++up)dp[up]=7;for(up=280;288>up;++up)dp[up]=8;var hp=new Jf(32);for(up=0;32>up;++up)hp[up]=5;var fp=cp(dp,9,0),pp=cp(hp,5,0),_p=function(e){return(e/8|0)+(7&e&&1)},vp=function(e,t,n){(null==t||0>t)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof Yf?Yf:e instanceof Xf?Xf:Jf)(n-t);return i.set(e.subarray(t,n)),i},gp=function(e,t,n){var i=t/8|0;e[i]|=n<<=7&t,e[i+1]|=n>>>8},mp=function(e,t,n){var i=t/8|0;e[i]|=n<<=7&t,e[i+1]|=n>>>8,e[i+2]|=n>>>16},yp=function(e,t){for(var n=[],i=0;e.length>i;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,s=n.slice();if(!r)return[new Jf(0),0];if(1==r){var o=new Jf(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=r-1;)a=n[n[d].f>n[l].f?l++:d++],u=n[l!=c&&n[d].f>n[l].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var h=s[0].s;for(i=1;r>i;++i)s[i].s>h&&(h=s[i].s);var f=new Yf(h+1),p=bp(n[c-1],f,0);if(p>t){i=0;var _=0,v=p-t,g=1<<v;for(s.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r>i;++i){var m=s[i].s;if(t>=f[m])break;_+=g-(1<<p-f[m]),f[m]=t}for(_>>>=v;_>0;){var y=s[i].s;t>f[y]?_-=1<<t-f[y]++-1:++i}for(;i>=0&&_;--i){var b=s[i].s;f[b]==t&&(--f[b],++_)}p=t}return[new Jf(f),p]},bp=function(e,t,n){return-1==e.s?Math.max(bp(e.l,t,n+1),bp(e.r,t,n+1)):t[e.s]=n},wp=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Yf(++t),i=0,r=e[0],s=1,o=function(e){n[i++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++s;else{if(!r&&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(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=e[a]}return[n.subarray(0,i),t]},Sp=function(e,t){for(var n=0,i=0;t.length>i;++i)n+=e[i]*t[i];return n},xp=function(e,t,n){var i=n.length,r=_p(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var s=0;i>s;++s)e[r+s+4]=n[s];return 8*(r+4+i)},kp=function(e,t,n,i,r,s,o,a,u,l,c){gp(t,c++,n),++r[256];for(var d=yp(r,15),h=d[0],f=d[1],p=yp(s,15),_=p[0],v=p[1],g=wp(h),m=g[0],y=g[1],b=wp(_),w=b[0],S=b[1],x=new Yf(19),k=0;m.length>k;++k)x[31&m[k]]++;for(k=0;w.length>k;++k)x[31&w[k]]++;for(var C=yp(x,7),P=C[0],E=C[1],F=19;F>4&&!P[np[F-1]];--F);var T,I,R,L,A=l+5<<3,O=Sp(r,dp)+Sp(s,hp)+o,M=Sp(r,h)+Sp(s,_)+o+14+3*F+Sp(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(O>=A&&M>=A)return xp(t,c,e.subarray(u,u+l));if(gp(t,c,1+(O>M)),c+=2,O>M){T=cp(h,f,0),I=h,R=cp(_,v,0),L=_;var D=cp(P,E,0);for(gp(t,c,y-257),gp(t,c+5,S-1),gp(t,c+10,F-4),c+=14,k=0;F>k;++k)gp(t,c+3*k,P[np[k]]);c+=3*F;for(var q=[m,w],B=0;2>B;++B){var N=q[B];for(k=0;N.length>k;++k)gp(t,c,D[j=31&N[k]]),c+=P[j],j>15&&(gp(t,c,N[k]>>>5&127),c+=N[k]>>>12)}}else T=fp,I=dp,R=pp,L=hp;for(k=0;a>k;++k)if(i[k]>255){var j;mp(t,c,T[257+(j=i[k]>>>18&31)]),c+=I[j+257],j>7&&(gp(t,c,i[k]>>>23&31),c+=ep[j]);var H=31&i[k];mp(t,c,R[H]),c+=L[H],H>3&&(mp(t,c,i[k]>>>5&8191),c+=tp[H])}else mp(t,c,T[i[k]]),c+=I[i[k]];return mp(t,c,T[256]),c+I[256]},Cp=new Xf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pp=new Jf(0),Ep=function(){for(var e=new Xf(256),t=0;256>t;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Fp=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Tp(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;t.length>i;++i)n=Ep[255&n^t[i]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),i=e.length;n.p(e);var r,s,o,a,u,l=(r=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,n,i,r,s){var o=e.length,a=new Jf(i+o+5*(1+Math.floor(o/7e3))+r),u=a.subarray(i,a.length-r),l=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var d=c+65535;o>d?l=xp(u,l,e.subarray(c,d)):(u[c]=s,l=xp(u,l,e.subarray(c,o)))}else{for(var h=Cp[t-1],f=h>>>13,p=8191&h,_=(1<<n)-1,v=new Yf(32768),g=new Yf(_+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new Xf(25e3),S=new Yf(288),x=new Yf(32),k=0,C=0,P=(c=0,0),E=0,F=0;o>c;++c){var T=b(c),I=32767&c,R=g[T];if(v[I]=R,g[T]=I,c>=E){var L=o-c;if((k>7e3||P>24576)&&L>423){l=kp(e,u,0,w,S,x,C,P,F,c-F,l),P=k=C=0,F=c;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)x[A]=0}var O=2,M=0,D=p,q=I-R&32767;if(L>2&&T==b(c-q))for(var B=Math.min(f,L)-1,N=Math.min(32767,c),j=Math.min(258,L);N>=q&&--D&&I!=R;){if(e[c+O]==e[c+O-q]){for(var H=0;j>H&&e[c+H]==e[c+H-q];++H);if(H>O){if(O=H,M=q,H>B)break;var V=Math.min(q,H-2),z=0;for(A=0;V>A;++A){var U=c-q+A+32768&32767,W=U-v[U]+32768&32767;W>z&&(z=W,R=U)}}}q+=(I=R)-(R=v[I])+32768&32767}if(M){w[P++]=268435456|sp[O]<<18|op[M];var G=31&sp[O],K=31&op[M];C+=ep[G]+tp[K],++S[257+G],++x[K],E=c+O,++k}else w[P++]=e[c],++S[e[c]]}}l=kp(e,u,s,w,S,x,C,P,F,c-F,l),s||(l=xp(u,l,Pp))}return vp(a,0,i+_p(l)+r)}(r,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,o,a,!u)),c=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Fp(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;n.length>=i;++i)e[i+10]=n.charCodeAt(i)}}(l,t),Fp(l,c-8,n.d()),Fp(l,c-4,i),l}var Ip=!!Oa||!!Aa,Rp="text/plain",Lp=!1,Ap=function(e,t){var n=e.split("#"),i=n[1],r=n[0].split("?"),s=r[0],o=r[1];if(!o)return e;var a=o.split("&").filter(function(e){return e.split("=")[0]!==t}).join("&");return s+(a?"?"+a:"")+(i?"#"+i:"")},Op=function(e,t,n){var i;void 0===n&&(n=!0);var r=e.split("?"),s=r[0],o=r[1],a=u({},t),l=null!==(i=null==o?void 0:o.split("&").map(function(e){var t,i=e.split("="),r=i[0],s=n&&null!==(t=a[r])&&void 0!==t?t:i[1];return delete a[r],r+"="+s}))&&void 0!==i?i:[],c=function(e,t){var n,i;void 0===t&&(t="&");var r=[];return Va(e,function(e,t){Ar(e)||Ar(t)||"undefined"===t||(n=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),i=encodeURIComponent(t),r[r.length]=i+"="+n)}),r.join(t)}(a);return c&&l.push(c),l.length>0?s+"?"+l.join("&"):s},Mp=function(e){if(e._encodedBody)return e._encodedBody;var t=e.data,n=e.compression;if(t){if(n===Ni){var i=Tp(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Jf(e.length+(e.length>>>1)),i=0,r=function(e){n[i++]=e},s=0;t>s;++s){if(i+5>n.length){var o=new Jf(i+8+(t-s<<1));o.set(n),n=o}var a=e.charCodeAt(s);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++s))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return vp(n,0,i)}(zl(t)),{mtime:0});return{contentType:Rp,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(n===ji){var r=function(e){return"data="+encodeURIComponent("string"==typeof e?e:zl(e))}(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})):e}(zl(t)));return{contentType:"application/x-www-form-urlencoded",body:r,estimatedSize:new Blob([r]).size}}var s=zl(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},$p=function(e){var t,n,i=function(){return"sendBeacon"===e.transport?{url:Op(e.url,{compression:ji}),encodedBody:Mp(u({},e,{compression:ji,_encodedBody:void 0}))}:{url:Ap(e.url,"compression"),encodedBody:Mp(u({},e,{compression:void 0,_encodedBody:void 0}))}};try{t=Mp(e)}catch(t){if(Xo(e.compression,Wl(e.url,"compression")))return Na.error("Failed to gzip request body, sending uncompressed payload",t),i();throw t}return t&&Xo(e.compression,Wl(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?Yo(new Uint8Array(n)):ArrayBuffer.isView(n)&&Yo(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Lp=!0,i()):{url:e.url,encodedBody:t}},Dp=function(e){try{return $p(e)}catch(t){return Na.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},qp=function(){var e=p(l().m(function e(t){var n,i,r;return l().w(function(e){for(;;)switch(e.n){case 0:return n=zl(t.data),e.n=1,ra(n,$h.DEBUG,{rethrow:!0});case 1:if(i=e.v){e.n=2;break}return e.a(2,t);case 2:return e.n=3,i.arrayBuffer();case 3:return e.a(2,u({},t,{_encodedBody:{contentType:Rp,body:r=e.v,estimatedSize:r.byteLength}}))}},e)}));return function(t){return e.apply(this,arguments)}}(),Bp=/Failed to fetch|NetworkError|Load failed/i,Np=function(e){return"TypeError"===(null==e?void 0:e.name)&&Bp.test((null==e?void 0:e.message)||"")},jp=function(e){var t=Dp(e);if(t){var n=t.url,i=t.encodedBody,r=null!=i?i:{},s=r.contentType,o=r.body,a=r.estimatedSize,l=new Headers;Va(e.headers,function(e,t){l.append(t,e)}),s&&l.append("Content-Type",s);var c=null,d=!1;if(Ma){var h=new Ma;c={signal:h.signal,timeout:setTimeout(function(){var t;d=!0,h.abort(co("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))},e.timeout)}}var f=function(t){d&&"AbortError"===(null==t?void 0:t.name)||Np(t)?Na.warn(t):Na.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var p;Aa(n,u({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&!e._keepaliveDisabled&&52428.8>(a||0),body:o,signal:null==(p=c)?void 0:p.signal},e.fetchOptions)).then(function(t){return t.text().then(function(n){var i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){Na.error(e)}null==e.callback||e.callback(i)})}).catch(f).finally(function(){return c?clearTimeout(c.timeout):null})}catch(e){c&&clearTimeout(c.timeout),f(e)}}},Hp=function(e){try{var t,n=$p(e),i=n.url,r=n.encodedBody,s=null!=r?r:{},o=s.body,a=s.estimatedSize;if(!o)return;var l=o instanceof Blob?o:new Blob([o],{type:s.contentType});if(Ia.sendBeacon(i,l))return;var c=Tr(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Tr(c)&&c.length>1&&(null!=a?a:0)>16384){var d=Math.ceil(c.length/2),h=function(t){return Tr(e.data)?t:u({},e.data,{batch:t})};return Hp(u({},e,{data:h(c.slice(0,d))})),void Hp(u({},e,{data:h(c.slice(d))}))}Na.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to fetch"),jp(u({},e,{_keepaliveDisabled:!0}))}catch(e){Na.warn("Beacon send failed",e)}},Vp=function(e,t,n,i){var r,s="query"===i?"POST"===t?"sent_at":"_":void 0;return Op(n===Ni?Ap(e,"compression"):e,u({},s?((r={})[s]=Date.now().toString(),r):{},n===Ni?{}:{compression:n}))},zp=[];Aa&&zp.push({transport:"fetch",method:jp}),Oa&&zp.push({transport:"XHR",method:function(e){var t=Dp(e);if(t){var n=new Oa,i=t.encodedBody;n.open(e.method||"GET",t.url,!0);var r=null!=i?i:{},s=r.contentType,o=r.body;Va(e.headers,function(e,t){n.setRequestHeader(t,e)}),s&&n.setRequestHeader("Content-Type",s),e.timeout&&(n.timeout=e.timeout),n.onreadystatechange=function(){if(4===n.readyState){var t={statusCode:n.status,text:n.responseText};if(200===n.status)try{t.json=JSON.parse(n.responseText)}catch(e){}null==e.callback||e.callback(t)}},n.send(o)}}}),null!=Ia&&Ia.sendBeacon&&zp.push({transport:"sendBeacon",method:Hp});var Up=function(){"use strict";function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=Jr((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,Na.createLogger("flush interval"),3e3),this._sendRequest=e}var t=e.prototype;return t.enqueue=function(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()},t.unload=function(){var e=this;this._clearFlushTimeout();var t=this._queue.length>0?this._formatQueue():{},n=Object.values(t);[].concat(n.filter(function(e){return 0===e.url.indexOf("/e")}),n.filter(function(e){return 0!==e.url.indexOf("/e")})).map(function(t){e._sendRequestSafely(u({},t,{transport:"sendBeacon"}))})},t.enable=function(){this._isPaused=!1,this._setFlushTimeout()},t._setFlushTimeout=function(){var e=this;this._isPaused||(this._flushTimeout=setTimeout(function(){if(e._clearFlushTimeout(),e._queue.length>0){var t=e._formatQueue(),n=function(){var n=t[i],r=(new Date).getTime();n.data&&Tr(n.data)&&Va(n.data,function(e){e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e._sendRequestSafely(n)};for(var i in t)n()}},this._flushTimeoutMs))},t._sendRequestSafely=function(e){try{this._sendRequest(e)}catch(e){Na.error(e)}},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={};return Va(this._queue,function(t){var n,i=t,r=(i?i.batchKey:null)||i.url;Ar(e[r])&&(e[r]=u({},i,{data:[]})),null==(n=e[r].data)||n.push(i.data)}),this._queue=[],e},e}(),Wp=function(){"use strict";function t(e){var t=this;this._instance=e,this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._queue=[],this._areWeOnline=!0,!Ar(Fa)&&"onLine"in Fa.navigator&&(this._areWeOnline=Fa.navigator.onLine,this._onlineListener=function(){t._areWeOnline=!0,t._flush()},this._offlineListener=function(){t._areWeOnline=!1},Ja(Fa,"online",this._onlineListener),Ja(Fa,"offline",this._offlineListener))}var n=t.prototype;return n.retriableRequest=function(t){var n=this,i=t.retriesPerformedSoFar,s=r(t,e);Br(i)&&(s.url=Op(s.url,{retry_count:i})),this._instance._send_request(u({},s,{callback:function(e){if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=i?i:0))return void n._enqueue(u({retriesPerformedSoFar:i},s));0===e.statusCode&&Na.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=i?i:0)+" retries.")}null==s.callback||s.callback(e)}}))},n._enqueue=function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,i=Math.min(18e5,t),r=(Math.random()-.5)*(i-n);return Math.ceil(i+r)}(t),i=Date.now()+n;this._queue.push({retryAt:i,requestOptions:e});var r="Enqueued failed request for retry in "+n;navigator.onLine||(r+=" (Browser is offline)"),Na.warn(r),this._isPolling||(this._isPolling=!0,this._poll())},n._poll=function(){var e=this;if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout(function(){e._areWeOnline&&e._queue.length>0&&e._flush(),e._poll()},this._pollIntervalMs)},n._flush=function(){var e=Date.now(),t=[],n=this._queue.filter(function(n){return e>n.retryAt||(t.push(n),!1)});if(this._queue=t,n.length>0)for(var i,r=d(n);!(i=r()).done;)this.retriableRequest(i.value.requestOptions)},n.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,Ar(Fa)||(this._onlineListener&&(Fa.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Fa.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0));for(var e,t=d(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(u({},n,{transport:"sendBeacon"}))}catch(e){Na.error(e)}}this._queue=[]},o(t,[{key:"length",get:function(){return this._queue.length}}])}(),Gp=function(){"use strict";function e(e){var t=this;this._instance=e,this._updateScrollData=function(){var e,n,i,r;t._context||(t._context={});var s=t.scrollElement(),o=t.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,u=o+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;t._context.lastScrollY=Math.ceil(o),t._context.maxScrollY=Math.max(o,null!==(e=t._context.maxScrollY)&&void 0!==e?e:0),t._context.maxScrollHeight=Math.max(a,null!==(n=t._context.maxScrollHeight)&&void 0!==n?n:0),t._context.lastContentY=u,t._context.maxContentY=Math.max(u,null!==(i=t._context.maxContentY)&&void 0!==i?i:0),t._context.maxContentHeight=Math.max(l,null!==(r=t._context.maxContentHeight)&&void 0!==r?r:0)}}var t=e.prototype;return t.getContext=function(){return this._context},t.resetContext=function(){var e=this._context;return setTimeout(this._updateScrollData,0),e},t.startMeasuringScrollPosition=function(){Ja(Fa,"scroll",this._updateScrollData,{capture:!0}),Ja(Fa,"scrollend",this._updateScrollData,{capture:!0}),Ja(Fa,"resize",this._updateScrollData)},t.scrollElement=function(){var e;if(!this._scrollRoot)return null==Fa||null==(e=Fa.document)?void 0:e.documentElement;for(var t,n=d(Tr(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]);!(t=n()).done;){var i,r=null==Fa||null==(i=Fa.document)?void 0:i.querySelector(t.value);if(r)return r}},t._scrollPosition=function(e){var t,n,i="y"===e?"scrollTop":"scrollLeft";if(this._scrollRoot){var r=this.scrollElement();return r&&r[i]||0}return Fa?"y"===e?Fa.scrollY||Fa.pageYOffset||(null==(t=Fa.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:Fa.scrollX||Fa.pageXOffset||(null==(n=Fa.document)||null==(n=n.documentElement)?void 0:n.scrollLeft)||0:0},t.scrollY=function(){return this._scrollPosition("y")},t.scrollX=function(){return this._scrollPosition("x")},o(e,[{key:"_scrollRoot",get:function(){return this._instance.config.scroll_root_selector}}])}(),Kp=function(e){return $d(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes)},Qp=function(){"use strict";function e(e,t,n,i){var r=this;this._onSessionIdCallback=function(e){var t,n=r._getStored();if(!n||n.sessionId!==e){var i={sessionId:e,props:r._sessionSourceParamGenerator(r._instance)};r._persistence.register(((t={})[vl]=i,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=i||Kp,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[vl]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?Dd(t,this._instance.config.disable_capture_url_hashes):{$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}:{}},t.getSessionProps=function(){var e={};return Va(Ka(this.getSetOnceProps()),function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+mr(n)]=t}),e},e}(),Zp=function(){"use strict";function e(){this._events={}}var t=e.prototype;return t.on=function(e,t){var n=this;return this._events[e]||(this._events[e]=[]),this._events[e].push(t),function(){n._events[e]=n._events[e].filter(function(e){return e!==t})}},t.emit=function(e,t){for(var n,i=d(this._events[e]||[]);!(n=i()).done;)(0,n.value)(t);for(var r,s=d(this._events["*"]||[]);!(r=s()).done;)(0,r.value)(e,t)},e}(),Jp=ja("[SessionId]"),Yp=864e5,Xp=function(){"use strict";function e(e,t,n){var i,r=this;if(this._lastPersistedActivityTimestamp=null,this._lastCookieSyncTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new Zp,this._sessionHasBeenIdleTooLong=function(e,t){return!(!Br(e)||!Br(t))&&Math.abs(e-t)>r.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._pendingBootstrapSession=void 0,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||Hl,this._windowIdGenerator=n||Hl;var s=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*Jr(this._config.session_idle_timeout_seconds||1800,60,36e3,Jp.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var o=bc._parse(this._window_id_storage_key),a=bc._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:bc._remove(this._window_id_storage_key),bc._set(this._primary_window_exists_storage_key,!0)}null!=(i=this._config.bootstrap)&&i.sessionID&&this.setBootstrapSessionId(this._config.bootstrap.sessionID),this._listenToReloadWindow()}var t=e.prototype;return t.on=function(e,t){return this._eventEmitter.on(e,t)},t.onSessionId=function(e){var t=this;return Ar(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(t){return t!==e})}},t._canUseSessionStorage=function(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&bc._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&bc._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?bc._parse(this._window_id_storage_key):null},t._isActivityChangeBelowGranularity=function(e){var t=this._lastPersistedActivityTimestamp;return!$r(t)&&!$r(e)&&5e3>Math.abs(e-t)},t._setSessionId=function(e,t,n){var i,r=t!==this._sessionActivityTimestamp,s=!(e!==this._sessionId||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,s&&!r||s&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register(((i={})[Uu]=[t,e,n],i)))},t._useCrossTabRefreshHardening=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return Br(t)&&t>0},t._refreshSessionIdFromStorage=function(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(Uu):(this._persistence.flush(),this._persistence.load())},t._flushPendingActivityTimestamp=function(){var e,t;if(!$r(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._lastPersistedActivityTimestamp){this._refreshSessionIdFromStorage();var n=this._getSessionId();n[1]===this._sessionId&&n[2]===this._sessionStartTimestamp&&(this._lastPersistedActivityTimestamp=this._sessionActivityTimestamp,this._persistence.register(((t={})[Uu]=[this._sessionActivityTimestamp,null!==(e=this._sessionId)&&void 0!==e?e:null,this._sessionStartTimestamp],t)),this._persistence.flush())}},t._freshestActivityTimestamp=function(){var e=this._getSessionId()[0],t=Br(e)?e:0,n=Br(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)},t._isSessionIdleAfterCrossTabRefresh=function(e){return this._refreshSessionIdFromStorage(),this._sessionHasBeenIdleTooLong(e,this._freshestActivityTimestamp())},t._getSessionId=function(){var e=this._persistence.props[Uu];return Tr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]},t.resetSessionId=function(){this._lastPersistedActivityTimestamp=null,this._pendingBootstrapSession=void 0,clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._setSessionId(null,null,null)},t.setBootstrapSessionId=function(e,t){void 0===t&&(t=!1);var n=function(e,t){void 0===t&&(t=(new Date).getTime());try{var n=function(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)}(e);return n>t+6e4?void Jp.error("Bootstrap sessionID cannot be in the future"):n}catch(e){return void Jp.error("Invalid sessionID in bootstrap",e)}}(e);return!Ar(n)&&(t?this._pendingBootstrapSession={sessionId:e,sessionStartTimestamp:n}:this._setSessionId(e,(new Date).getTime(),n),!0)},t.destroy=function(){this._destroyed=!0,this._flushPendingActivityTimestamp(),clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&Fa&&(Fa.removeEventListener(Ll,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]},t._listenToReloadWindow=function(){var e=this;this._beforeUnloadListener=function(){e._flushPendingActivityTimestamp(),e._canUseSessionStorage()&&bc._remove(e._primary_window_exists_storage_key)},Ja(Fa,Ll,this._beforeUnloadListener,{capture:!1})},t.checkAndGetSessionAndWindowId=function(e,t,n){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===n&&(n=!1),"always"===this._config.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),r=this._sessionId;if(n)this._lastCookieSyncTimestamp=i;else if($r(this._lastCookieSyncTimestamp)||this._lastCookieSyncTimestamp>i||i-this._lastCookieSyncTimestamp>=1e3){var s,o;null==(s=(o=this._persistence).syncCookieProperties)||s.call(o),this._lastCookieSyncTimestamp=i}var a=this._getSessionId(),u=a[1],l=a[2],c=!Ar(r)&&u!==r,d=this._freshestActivityTimestamp(),h=this._getWindowId(),f=this._pendingBootstrapSession,p=!!f&&(f.sessionStartTimestamp>i+6e4||i-f.sessionStartTimestamp>Yp),_=f?p:Br(l)&&Math.abs(i-l)>Yp,v=!1,g=c,m=!u||!!f,y=u,b=!m&&!e&&this._sessionHasBeenIdleTooLong(i,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(i))||Jp.info("cross-tab refresh kept the session alive",{sessionId:u});var w=this._getSessionId();u=w[1],l=w[2]}if(m||b||_){g=!1;var S=f&&!p;u=S?f.sessionId:this._sessionIdGenerator(),h=this._windowIdGenerator(),Jp.info("new session ID assigned",{sessionId:u,windowId:h,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_}}),l=S?f.sessionStartTimestamp:i,this._pendingBootstrapSession=void 0,v=!0}else h||(h=this._windowIdGenerator(),v=!0),(g=g||u!==y)&&(Jp.info("adopted cross-tab session id",{sessionId:u,windowId:h}),v=!0);var x=Br(d)&&e&&!_?d:i,k=Br(l)?l:(new Date).getTime();this._setWindowId(h),this._setSessionId(u,x,k),e||this._resetIdleTimer();var C={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_,crossTabAdoption:g};return v&&this._sessionIdChangedHandlers.forEach(function(e){return e(u,h,C)}),{sessionId:u,windowId:h,sessionStartTimestamp:k,changeReason:v?C:void 0,lastActivityTimestamp:d}},t._resetIdleTimer=function(){var e=this;this._destroyed||(clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(function(){if(!e._destroyed)if(e._isSessionIdleAfterCrossTabRefresh((new Date).getTime())){var t=e._sessionId;e.resetSessionId(),e._eventEmitter.emit("forcedIdleReset",{idleSessionId:t})}else e._resetIdleTimer()},1.1*this.sessionTimeoutMs))},o(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}}])}(),e_=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&_r(n,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some(function(e){return _r(null==e?void 0:e.brand,t)}))return!0}catch(e){}return!!e.webdriver};function t_(){return(t_=p(l().m(function e(){var t,n,i,r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!=(t=null==Ia?void 0:Ia.userAgentData)&&t.getHighEntropyValues){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,t.getHighEntropyValues(["model"]);case 2:if(null!=(n=e.v)){e.n=3;break}r=void 0,e.n=4;break;case 3:r=n.model;case 4:return e.a(2,Or(i=r)&&i.length>0?i:void 0);case 5:return e.p=5,Na.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e.v),e.a(2)}},e,null,[[1,5]])}))).apply(this,arguments)}var n_="custom",i_="i.posthog.com",r_=/^\/static\//,s_=["/s/","/e/","/i/"],o_=function(){"use strict";function e(e){this._regionCache={},this.instance=e}var t=e.prototype;return t._staticAssetHostOverride=function(e){if(r_.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}},t._urlKey=function(e){var t=Ul(e);return t?t.protocol+"//"+t.host+t.pathname:void 0},t._prepareEndpoint=function(e,t,n){if("ui"===e)return n;var i=n,r=this.instance.config.rewriteRequestPath;if(r){var s,o=(null==(s=Ul(n))?void 0:s.href)||n;i=r(new URL(o)).toString()}if(r&&"api"===e&&s_.some(function(e){return 0===t.indexOf(e)})){var a=this._urlKey(i);if(a){var u,l=this.apiHost,c=this._ingestionEndpoints;(null==(u=c)?void 0:u.apiHost)===l&&c.rewriteRequestPath===r||(this._ingestionEndpoints=c={apiHost:l,rewriteRequestPath:r,urls:new Set}),c.urls.add(a)}}return i},t.isIngestionEndpoint=function(e){var t=this._ingestionEndpoints,n=this._urlKey(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!n&&t.urls.has(n)},t.endpointFor=function(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this._prepareEndpoint(e,t,this.uiHost+t);if("flags"===e)return this._prepareEndpoint(e,t,this.flagsApiHost+t);if("assets"===e){var n=this._staticAssetHostOverride(t);if(n)return this._prepareEndpoint(e,t,""+n+t)}if(this.region===n_)return this._prepareEndpoint(e,t,this.apiHost+t);var i=i_+t;switch(e){case"assets":return this._prepareEndpoint(e,t,"https://"+this.region+"-assets."+i);case"api":return this._prepareEndpoint(e,t,"https://"+this.region+"."+i)}},o(e,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}},{key:"flagsApiHost",get:function(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}},{key:"uiHost",get:function(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+i_,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(this._regionCache[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":n_),this._regionCache[this.apiHost]}}])}(),a_=ja("[PostHog ExternalIntegrations]"),u_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},l_=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadScript=function(e,t){var n;null==(n=ih.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,function(e){if(e)return a_.error("failed to load script",e);t()})},t.startIfEnabledOrStop=function(){for(var e=this,t=function(){var t,r,s,o=i[n],a=o[0],u=o[1];!u||null!=(t=ih.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[a]||e._loadScript(u_[a],function(){var t;null==(t=ih.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[a])||t.start(e._instance)}),!u&&null!=(r=ih.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[a]&&(null==(s=ih.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[a])||s.stop())},n=0,i=Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{});i.length>n;n++){var r;t()}},e}(),c_=function(){"use strict";function e(e,t){this._logger=e,this._client=t,this._extensions=new Map,this._disposed=!1}var t=e.prototype;return t.add=function(){var e=p(l().m(function e(t){var n,i,r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._disposed){e.n=1;break}throw new Error("Cannot add an extension to a disposed ExtensionRuntime");case 1:if(!this._extensions.has(t.name)){e.n=2;break}throw new Error('Browser extension "'+t.name+'" is already registered');case 2:if(this._extensions.set(t.name,t),e.p=3,!(n=t.setup(this._client))){e.n=4;break}return e.n=4,n;case 4:e.n=6;break;case 5:e.p=5,r=e.v,(i=this._extensions.get(t.name)===t)&&this._extensions.delete(t.name),this._logger.error('Failed to set up browser extension "'+t.name+'"',r),i&&this._disposeExtension(t);case 6:return e.a(2)}},e,this,[[3,5]])}));return function(t){return e.apply(this,arguments)}}(),t.getExtension=function(e){return this._extensions.get(e)},t.dispose=function(){if(!this._disposed){this._disposed=!0;var e=Array.from(this._extensions.values()).reverse();this._extensions.clear();for(var t,n=d(e);!(t=n()).done;)this._disposeExtension(t.value)}},t._disposeExtension=function(e){var t=this;try{var n=null==e.dispose?void 0:e.dispose();n&&Ir(n.then)&&n.then(void 0,function(n){t._logger.error('Failed to dispose browser extension "'+e.name+'"',n)})}catch(t){this._logger.error('Failed to dispose browser extension "'+e.name+'"',t)}},e}(),d_=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.initialize=function(){},t.get=function(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);for(var n,i={},r=d(e);!(n=r()).done;){var s=n.value,o=null==t?void 0:t.get_property(s);Ar(o)||(i[s]=o)}return i},t.set=function(e,t){var n,i;null==(n=this._instance.persistence)||n.register("string"==typeof e?((i={})[e]=t,i):e)},t.remove=function(e){var t;null==(t=this._instance.persistence)||t.unregister(e)},e}(),h_="extensionsRemoteConfig",f_=function(){"use strict";function e(e){var t=this;this.instance=e,this._disposed=!1,this._logger=Na,this._latestRemoteConfigResult=e._lastRemoteConfig,this.kv=new d_(e),this.onEvent=function(e){return Ca(t.instance.on("eventCaptured",function(n){try{e({event:n.event,properties:n.properties})}catch(e){t._logger.error("Browser extension event listener failed",e)}}))},this.onRemoteConfig=function(e){if(t._disposed)return Ca(function(){});var n=function(n){try{e(n)}catch(e){t._logger.error("Browser extension remote config listener failed",e)}},i=t.instance._internalEventEmitter.on(h_,n);return t._latestRemoteConfigResult&&n(t._latestRemoteConfigResult),Ca(i)},this._runtime=new c_(Na.createLogger("[BrowserExtensions]"),this)}var t=e.prototype;return t.add=function(e){return this._runtime.add(e)},t.getExtension=function(e){return this._runtime.getExtension(e)},t.capture=function(){var e=p(l().m(function e(t,n,i){return l().w(function(e){for(;;)switch(e.n){case 0:if(i){e.n=1;break}return this.instance.capture(t,n),e.a(2);case 1:this.instance.capture(t,n,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce});case 2:return e.a(2)}},e,this)}));return function(t,n,i){return e.apply(this,arguments)}}(),t.registerDynamicEventProperties=function(e){return Ca(this.instance._registerExtensionEventProperties(e))},t.handleRemoteConfig=function(e){this._disposed||(this._latestRemoteConfigResult=e,this.instance._internalEventEmitter.emit(h_,e))},t.sendRequest=function(){var e=p(l().m(function e(t,n){var i,r,s,o=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(void 0===n&&(n={}),r=this.instance.requestRouter.endpointFor(null!==(i=n.target)&&void 0!==i?i:"api",t),s={method:n.method,url:n.query?Op(r,n.query):r,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,compressionFallback:"flags"===n.target&&"best-available"===n.compression?wr.Base64:void 0,timestampMode:n.sentAt},"sendBeacon"!==n.transport){e.n=1;break}return this.instance._send_request(s),e.a(2,{statusCode:202});case 1:return e.a(2,new Promise(function(e){s.callback=e,o.instance._send_request(s)}))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),t.dispose=function(){this._disposed||(this._disposed=!0,this._runtime.dispose())},o(e,[{key:"logger",get:function(){return this._logger}},{key:"distinctId",get:function(){return this.instance.get_distinct_id()}},{key:"anonymousId",get:function(){var e;return null!==(e=this.instance.get_property("$device_id"))&&void 0!==e?e:this.distinctId}},{key:"deviceId",get:function(){var e=this.instance.get_property(xu);return"string"==typeof e?e:void 0}},{key:"library",get:function(){return{name:$h.LIB_NAME,version:$h.LIB_VERSION}}},{key:"initialPersonProperties",get:function(){var e,t;return null!==(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())&&void 0!==e?e:{}}},{key:"groups",get:function(){return this.instance.getGroups()}},{key:"session",get:function(){try{var e,t,n,i,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==r?void 0:r.sessionId)&&void 0!==t?t:"",windowId:null!==(n=null==r?void 0:r.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(i=null==r?void 0:r.sessionStartTimestamp)&&void 0!==i?i:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}},{key:"canCapture",get:function(){return this.instance.is_capturing()}},{key:"projectToken",get:function(){return this.instance.config.token}}])}(),p_={},__=0,v_=function(){},g_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',m_="Surveys module not available",y_="sanitize_properties is deprecated. Use before_send instead",b_="Invalid value for property_denylist config: ",w_=/^[A-Za-z0-9_-]{1,400}$/,S_=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,x_=["token","distinct_id",xl],k_="posthog",C_=!Ip&&-1===(null==Da?void 0:Da.indexOf("MSIE"))&&-1===(null==Da?void 0:Da.indexOf("Mozilla")),P_=function(e){var t={};return e&&"unset"!==e?("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0),t):t},E_=function(e){var t;return u({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Za(null==Ra?void 0:Ra.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:v_,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,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:La&&Or(null==La?void 0:La.search)&&-1!==La.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Fa||null==(t=Fa.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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:function(e){Na.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Il,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:v_},function(e){return{rageclick:e&&e>="2026-05-30"?{content_ignorelist:ef,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:P_(e),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,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}}(e))},F_=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],T_=function(e){for(var t={},n=0,i=F_;i.length>n;n++){var r=i[n],s=r[0],o=r[1];Ar(e[s])||(t[o]=e[s])}var a=za({},t,e),u=e.__preview_external_dependency_versioned_paths;return Ar(u)||(Ar(e.strict_script_versioning)&&(a.strict_script_versioning=!!u),Or(u)&&Ar(e.asset_host)&&(a.asset_host=u)),Tr(e.property_blacklist)&&(Ar(e.property_denylist)?a.property_denylist=e.property_blacklist:Tr(e.property_denylist)?a.property_denylist=[].concat(e.property_blacklist,e.property_denylist):Na.error(b_+e.property_denylist)),a},I_=function(){"use strict";return o(function(){this.__forceAllowLocalhost=!1},[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Na.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),R_=(a=function(){"use strict";function e(){var t,n=this;this.webPerformance=new I_,this._personProcessingSetOncePropertiesSent=!1,this.version=$h.LIB_VERSION,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new Zp,this._extensions=[],this._extensionEventPropertyProducers=[],this._hasStableInitialDistinctId=!1,this._hasWarnedAboutVolatileIdentity=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=E_(),this.SentryIntegration=If,this.sentryIntegration=function(e){return function(e,t){var n=Tf(e,t);return{name:Ff,processEvent:function(e){return n(e)}}}(n,e)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.scrollManager=new Gp(this),this.pageViewManager=new Rf(this),this.rateLimiter=new Kf(this),this.requestRouter=new o_(this),this.consent=new Dh(this),this.externalIntegrations=new l_(this);var i=null!==(t=e.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:function(e,t,i){var r,s=Or(e)?((r={})[e]=t,r):e;n.setPersonProperties(s),null==i||i({})},set_once:function(e,t,i){var r,s=Or(e)?((r={})[e]=t,r):e;n.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",function(e){return Na.info('send "'+(null==e?void 0:e.event)+'"',e)})}var t=e.prototype;return t._removeExtension=function(e){if(e){var t=this._extensions.indexOf(e);-1!==t&&this._extensions.splice(t,1)}},t._replaceExtension=function(e,t){return this._removeExtension(e),this._extensions.push(t),null==t.initialize||t.initialize(),t},t._inCookielessMode=function(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()},t._warnIfVolatileIdentityWithoutStableId=function(){if(!(this._hasWarnedAboutVolatileIdentity||this.config.reuseAnonymousId||this.config.segment||this._inCookielessMode())){var e,t,n,i="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(i||this.config.disable_persistence)&&(this._hasStableInitialDistinctId||(i?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this._hasWarnedAboutVolatileIdentity=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+n)))}},t._healCookielessSentinelDistinctId=function(){if(!this._inCookielessMode()&&"$posthog_cookieless"===this.get_distinct_id()){var e=this.persistence;if(e){this._is_persistence_disabled()||e.load(!0);var t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){var n=this.config.get_device_id(Hl());this.register({distinct_id:n,$device_id:n}),e.set_property(_l,Fl)}this._sync_opt_out_with_persistence()}}},t.init=function(t,n,i){if(i&&i!==k_){var r,s=null!==(r=p_[i])&&void 0!==r?r:new e;return s._init(t,n,i),p_[i]=s,p_[k_][i]=s,s}return this._init(t,n,i)},t._init=function(e,t,n){var i,r,s,o=this;void 0===t&&(t={});var a,l=Or(e)?e.trim():"";if(!l)return Na.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 l!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+l+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=E_(t.defaults),t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles?this._initialPersonProfilesConfig=t.person_profiles:t.process_person&&(this._initialPersonProfilesConfig=t.process_person);var c=E_(t.defaults),d=T_(t),h=za({},c,d,{name:n,token:l});Rr(c.rageclick)&&Rr(d.rageclick)&&(h.rageclick=za({},c.rageclick,d.rageclick)),Rr(c.session_recording)&&Rr(d.session_recording)&&(h.session_recording=za({},c.session_recording,d.session_recording)),this.set_config(h),this.config.on_xhr_error&&Na.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ni;var f=this._is_persistence_disabled();if(this.persistence=new Wf(this.config,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Wf(u({},this.config,{persistence:"sessionStorage"}),f,!1),this._sessionRegisteredPropertiesStorageKey="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!f&&bc._is_supported()){var p=bc._parse(this._sessionRegisteredPropertiesStorageKey);Tr(p)&&p.forEach(function(e){Or(e)&&o._sessionRegisteredPropKeys.add(e)})}else bc._remove(this._sessionRegisteredPropertiesStorageKey);var _=u({},this.persistence.props),v=u({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new Up(function(e){return o._send_retriable_request(e)},this.config.request_queue_config),this._retryQueue=new Wp(this),this.__request_queue=[];var g=this._inCookielessMode();g||(this.sessionManager=new Xp(this),this.sessionPropsManager=new Qp(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(function(e,t,n){(null!=n&&n.activityTimeout||null!=n&&n.sessionPastMaximumLength||null!=n&&n.crossTabAdoption)&&o._clearSessionRegisteredProps()})),this._enrollFeatureFlags(),this.config.__preview_deferred_init_extensions?(Na.info("Deferring extension initialization to improve startup performance"),setTimeout(function(){o._initExtensions(g)},0)):(Na.info("Initializing extensions synchronously"),this._initExtensions(g)),$h.DEBUG=$h.DEBUG||this.config.debug,$h.DEBUG&&Na.info("Starting in debug mode",{this:this,config:t,thisC:u({},this.config),p:_,s:v}),!this.config.identity_distinct_id||null!=(i=t.bootstrap)&&i.distinctID||(t.bootstrap=u({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var m=null==(r=t.bootstrap)?void 0:r.distinctID;if(this._hasStableInitialDistinctId=!!m&&!Mr(m),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var y=t.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(_l);if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"anonymous"===w)this.identify(y);else if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"identified"===w)Na.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var S=this.config.get_device_id(Hl()),x=t.bootstrap.isIdentifiedID?S:y;this.persistence.set_property(_l,t.bootstrap.isIdentifiedID?Tl:Fl),this.register({distinct_id:y,$device_id:x})}}if(g)this.register_once({distinct_id:Sl,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(Hl());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(_l,Fl)}return Ja(Fa,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?Ef(this,function(){return o._loaded()}):this._loaded(),Ir(this.config._onCapture)&&this.config._onCapture!==v_&&(Na.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",function(e){return o.config._onCapture(e.event,e)})),this.config.ip&&Na.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return t_.apply(this,arguments)}().then(function(e){var t;e&&o.register(((t={})[ku]=e,t))}).catch(v_),this},t._isSharedExtension=function(e){var t=e;return Or(t.name)&&Ir(t.setup)},t._enrollExtension=function(e,t){var n=this;this._isSharedExtension(e)?t.push(function(){n._getBrowserClientAdapter().add(e).catch(function(){return null==e.dispose?void 0:e.dispose()}).catch(function(t){Na.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this._extensions.push(e)},t._enrollFeatureFlags=function(){var t,n,i,r,s,o,a=this,u=null!==(t=null==(n=this.config.__extensionClasses)?void 0:n.featureFlags)&&void 0!==t?t:null==(i=e.__defaultExtensionClasses)?void 0:i.featureFlags;u&&(this.featureFlags&&this.featureFlags instanceof u||(null==(o=this._featureFlagsReloadingUnsubscribe)||o.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new u(this)),Ir(this.featureFlags.onReloading)&&Ir(this.featureFlags.setup)?this._featureFlagsReloadingUnsubscribe||(this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading(function(){a._internalEventEmitter.emit("featureFlagsReloading",!0)}),this._getBrowserClientAdapter().add(this.featureFlags)):null==(r=(s=this.featureFlags).initialize)||r.call(s))},t._initExtensions=function(t){var n,i,r,s,o,a,l,c=this,d=performance.now(),h=u({},e.__defaultExtensionClasses,this.config.__extensionClasses),f=[];h.exceptions&&this._extensions.push(this.exceptions=null!==(n=this.exceptions)&&void 0!==n?n:new h.exceptions(this)),h.historyAutocapture&&this._extensions.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this._extensions.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this._extensions.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this._extensions.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||f.push(function(){c.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this._enrollExtension(this.autocapture=new h.autocapture(this),f),h.surveys&&this._enrollExtension(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new h.surveys(this),f),h.logs&&this._enrollExtension(this.logs=null!==(r=this.logs)&&void 0!==r?r:new h.logs(this),f),h.metrics&&this._extensions.push(this.metrics=null!==(s=this.metrics)&&void 0!==s?s:new h.metrics(this)),h.conversations&&this._extensions.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this._extensions.push(this.productTours=new h.productTours(this)),h.heatmaps&&this._extensions.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this._extensions.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,kf)),h.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this._extensions.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this._extensions.forEach(function(e){e.initialize&&f.push(function(){null==e.initialize||e.initialize()})}),f.push(function(){if(c._pendingRemoteConfig){var e=c._pendingRemoteConfig;c._pendingRemoteConfig=void 0,c._extensions.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})}}),this._processInitTaskQueue(f,d)},t._processInitTaskQueue=function(e,t){for(var n,i=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(function(){i._processInitTaskQueue(e,t)},0);var r=e.shift();if(r)try{r()}catch(e){Na.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session(((n={})[kl]=this.config.__preview_deferred_init_extensions?"deferred":"synchronous",n[Cl]=s,n)),this.config.__preview_deferred_init_extensions&&Na.info("PostHog extensions initialized ("+s+"ms)")},t._onRemoteConfig=function(e){var t,n=this;if(!Ra||!Ra.body)return Na.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){n._onRemoteConfig(e)},500);if(this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this._lastRemoteConfig=e,this.compression=void 0,e.ok){var i,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=vr(r.supportedCompression,Ni)?Ni:vr(r.supportedCompression,ji)?ji:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:Il}),null==(t=this._browserClientAdapter)||t.handleRemoteConfig(e),this._extensions.forEach(function(t){return null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)})},t._loaded=function(){var e=this;try{this.config.loaded(this)}catch(e){Na.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=La&&La.hostname){var t=La.hostname,n=this.config.internal_or_test_user_hostname;("string"==typeof n?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(function(){(e.consent.isOptedIn()||e._inCookielessMode())&&e._captureInitialPageview()},1),this._remoteConfigLoader=new Zf(this),this._remoteConfigLoader.load()},t._start_queue_if_opted_in=function(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())},t._dom_loaded=function(){var e=this;this.is_capturing()&&Ha(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()},t._handle_unload=function(){var e,t,n,i,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(Ol),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(i=this._requestQueue)||i.unload(),null==(r=this._retryQueue)||r.unload()):this._shouldCapturePageleave()&&this.capture(Ol,null,{transport:"sendBeacon"})},t._send_request=function(e){var t,n=this;this.__loaded?C_?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=u({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(t=this.compression)&&void 0!==t?t:e.compressionFallback:e.compression,(Ar(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,i,r=u({},e);r.timeout=r.timeout||6e4;var s,o,a,l,c,d=null!==(t=r.transport)&&void 0!==t?t:"fetch";"sendBeacon"===d&&Ar(r.compression)&&r.data&&(r.compression=ji),"POST"===r.method&&r.data&&("capture-body"===r.timestampMode?r.data={api_key:null!==(o=null==(c=(l=(Tr(s=r.data)?s:[s]).map(function(e){return u({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})}))[0])||null==(a=c.properties)?void 0:a.token)&&void 0!==o?o:null==c?void 0:c.token,batch:l,sent_at:(new Date).toISOString()}:"body"===r.timestampMode&&(r.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Tr(e)?e.map(function(e){return u({},e,{sent_at:t})}):u({},e,{sent_at:t})}(r.data))),r.url=Vp(r.url,r.method,r.compression,r.timestampMode);var h=zp.filter(function(e){return!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)}),f=null!==(n=null==(i=function(e,t){for(var n=0;e.length>n;n++)if(t(e[n]))return e[n]}(h,function(e){return e.transport===d}))?void 0:i.method)&&void 0!==n?n:h[0].method;if(!f)throw new Error("No available transport method");var p=function(e){try{f(e)}catch(e){Np(e)?Na.warn(e):Na.error(e),null==r.callback||r.callback({statusCode:0,error:e})}};"sendBeacon"!==d&&r.data&&r.compression===Ni&&$a&&"undefined"!=typeof Promise&&!Lp?qp(r).then(function(e){p(e)}).catch(function(t){if(ea(t))return Lp=!0,void p(u({},r,{compression:void 0,url:Vp(e.url,e.method,void 0,e.timestampMode)}));(function(e){if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return ea(e)||t===Jo})(t)&&(Lp=!0),p(r)}):f(r)}(u({},e,{callback:function(t){n.rateLimiter.checkForLimiting(t),400>t.statusCode||null==n.config.on_request_error||n.config.on_request_error(t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))},t._send_retriable_request=function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)},t._execute_array=function(e){var t=this;__++;try{var n,i=[],r=[],s=[];Ha(e,function(e){if(e)if(Tr(n=e[0]))s.push(e);else if(Ir(e))try{e.call(t)}catch(t){Na.error("Error executing queued PostHog call",e,t)}else Tr(e)&&"alias"===n?i.push(e):Tr(e)&&-1!==n.indexOf("capture")&&Ir(t[n])?s.push(e):r.push(e)});var o=function(e,t){Ha(e,function(e){try{if(Tr(e[0])){var n=t;Va(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){Na.error("Error executing queued PostHog call",e,t)}})};o(i,this),o(r,this),o(s,this)}finally{__--}},t.push=function(t){if(__>0&&Tr(t)&&Or(t[0])){var n=e.prototype[t[0]];Ir(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])},t._getPersistedFacebookClickId=function(){var e,t=null==(e=this.persistence)?void 0:e.get_property(Eu);return Or(t)&&S_.test(t)?{value:t,delivered:!1}:Rr(t)&&Or(t.value)&&S_.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0},t._updateFacebookClickId=function(e,t,n,i){if(this.persistence){this.persistence.refreshKey(Eu);var r=this._getPersistedFacebookClickId();if(!i){var s;if(n)return Or(t)&&S_.test(t)?(t!==(null==r?void 0:r.value)&&this.persistence.register(((s={})[Eu]={value:t,delivered:!1},s)),{value:t,pending:t!==(null==r?void 0:r.value)||!r.delivered}):void this.persistence.unregister(Eu);if(Or(e)&&w_.test(e)){var o;if((null==r?void 0:r.value.split(".")[3])===e)return{value:r.value,pending:!r.delivered};var a="fb.1."+Date.now()+"."+e;return this.persistence.register(((o={})[Eu]={value:a,delivered:!1},o)),{value:a,pending:!0}}return r?{value:r.value,pending:!r.delivered}:void 0}this.persistence.unregister(Eu)}},t._markFacebookClickIdDelivered=function(e){var t;if(this.persistence){this.persistence.refreshKey(Eu);var n=this._getPersistedFacebookClickId();(null==n?void 0:n.value)!==e||n.delivered||this.persistence.register(((t={})[Eu]={value:e,delivered:!0},t))}},t.capture=function(e,t,n){var i,r,s,o,a,l,c,d,h,f,p,_,v=this;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!Ar(e)&&Or(e)){this._healCookielessSentinelDistinctId();var g=!this.config.opt_out_useragent_filter&&this._is_bot();if(!g||this.config.__preview_capture_bot_pageviews){var m=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==m||!m.isRateLimited){var y;null!=t&&t.$current_url&&!Or(null==t?void 0:t.$current_url)&&(Na.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=n&&n._originatedFromCaptureException||Na.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(y=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 b=new Date,w=(null==n?void 0:n.timestamp)||b,S=lo(null==n?void 0:n.uuid,Hl),x={uuid:S,event:e,properties:this.calculateEventProperties(e,t||{},w,S)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&g&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),m&&(x.properties.$lib_rate_limit_remaining_tokens=m.remainingTokens);var k="$feature_flag_called"===e&&!1===x.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=n&&n.$set&&!k&&(x.$set=null==n?void 0:n.$set);var C=Rr(null==t?void 0:t.$set)?t.$set:void 0,P=!(null==n||!n.$set)&&"$fbc"in n.$set,E=P||!!C&&"$fbc"in C,F=P?null==n||null==(i=n.$set)?void 0:i[Pu]:null==C?void 0:C[Pu],T=Tr(null==t?void 0:t.$unset)?t.$unset:[],I=(null==n?void 0:n.$unset)||[],R=-1!==T.indexOf("$fbc")||-1!==I.indexOf("$fbc"),L=this._updateFacebookClickId(null==(r=y)?void 0:r.fbclid,F,E,R);L&&!0===x.properties.$process_person_profile&&L.pending&&!E&&!k&&(x.$set=u(((s={})[Pu]=L.value,s),x.$set));var A=null==n?void 0:n.$unset;A&&(x.$unset=A);var O=k?void 0:this._calculate_set_once_properties(null==n?void 0:n.$set_once,e!==$l,e===Ml);if(O&&(x.$set_once=O),null!=n&&n._noTruncate||(h=this.config.properties_string_max_length,f=x,p=function(e){return Or(e)?e.slice(0,h):e},_=new Set,x=function e(t,n){if(t!==Object(t))return p?p(t):t;if(!_.has(t)){var i;if(_.add(t),Tr(t))i=[],Ha(t,function(t){i.push(e(t))});else{var r={};Va(t,function(t,n){_.has(t)||(r[n]=e(t,n))}),i=r}return i}}(f)),x.timestamp=w,Ar(null==n?void 0:n.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=b),k&&(x.properties=function(e,t){void 0===t&&(t=[]);var n={},i=function(t){void 0!==e[t]&&(n[t]=e[t])};return Zo.forEach(i),t.forEach(i),n}(x.properties,x_)),e===sr||e===or){var M,D=null==t?void 0:t[ar],q=null==t?void 0:t[lr];yu({id:D,current_iteration:q}),x.$set=u({},x.$set,((M={})[nu({id:D,current_iteration:q},e===or?"responded":"dismissed")]=!0,M))}else e===rr&&(x.$set=u({},x.$set,((o={}).$survey_last_seen_date=(new Date).toISOString(),o)));if("product tour shown"===e){var B,N=null==t?void 0:t.$product_tour_type;N&&(x.$set=u({},x.$set,((B={})["$product_tour_last_seen_date/"+N]=(new Date).toISOString(),B)))}var j=u({},x.properties.$set,x.$set);if(Lr(j)||this.setPersonPropertiesForFlags(j),!Dr(this.config.before_send)){var H=this._runBeforeSend(x);if(!H)return;(x=H).uuid=lo(x.uuid,Hl)}var V=null!==(a=null==(l=x.$set)?void 0:l.$fbc)&&void 0!==a?a:Rr(null==(c=x.properties)?void 0:c.$set)?x.properties.$set.$fbc:void 0,z=null!=L&&L.pending&&V===L.value?L.value:void 0;this._internalEventEmitter.emit("eventCaptured",x);var U=null!==(d=null==n?void 0:n._url)&&void 0!==d?d:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),W=u({method:"POST",url:U,data:x,compression:"best-available",timestampMode:"recordings"===(null==n?void 0:n._batchKey)||/\/s\/(?:\?|$)/.test(U)?"body":"capture-body",batchKey:null==n?void 0:n._batchKey},null!=n&&n.transport?{transport:n.transport}:{},z?{fireCallbackOnDrop:!0,callback:function(e){e.statusCode>=200&&300>e.statusCode&&v._markFacebookClickIdDelivered(z)}}:{});return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly||z?this._send_retriable_request(W):this._requestQueue.enqueue(W),x}Na.critical("This capture call is ignored due to client rate limiting.")}}else Na.error("No event name provided to posthog.capture")}else Na.uninitializedWarning("posthog.capture")},t._addCaptureHook=function(e){return this.on("eventCaptured",function(t){return e(t.event,t)})},t.getExtension=function(e){var t;return null==(t=this._browserClientAdapter)?void 0:t.getExtension(e)},t._getBrowserClientAdapter=function(){var e;return null!==(e=this._browserClientAdapter)&&void 0!==e?e:this._browserClientAdapter=new f_(this)},t._registerExtensionEventProperties=function(e){var t=this;this._extensionEventPropertyProducers.push(e);var n=!0;return function(){if(n){n=!1;var i=t._extensionEventPropertyProducers.indexOf(e);-1!==i&&t._extensionEventPropertyProducers.splice(i,1)}}},t._processCookieIdentityChange=function(e){var t,n,i;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this._cachedPersonProperties=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(i=this.sessionPersistence)||i.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(n=this.featureFlags)||n.reset(),e&&this.reloadFeatureFlags(),!0)},t.calculateEventProperties=function(e,t,n,i,r){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this._processCookieIdentityChange();var s=r?void 0:this.persistence.remove_event_timer(e),o=u({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this._inCookielessMode()&&(o[xl]=!0),"$snapshot"===e){var a=u({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!Or(o.distinct_id)&&!qr(o.distinct_id)||Mr(o.distinct_id))&&Na.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var l,c=function(e,t,n,i){var r,s,o,a;if(void 0===i&&(i=!1),!Da)return{};var u,l=e?[].concat(Pd,t||[]):[],c=Js(Da),d=c[0],h=c[1],f=function(e){for(var t=0;to.length>t;t++){var n,i=to[t],r=i[1],s=i[2],o=e.match(i[0]);if(o)return[r,(null==(n=s&&e.match(s)||o)?void 0:n[1])||""]}return["",""]}(Da),p=f[0],_=f[1],v=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},g={};Ar(n)||(g.detectGoogleSearchApp=n);var m={},y=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,b=null==(s=navigator)?void 0:s.maxTouchPoints,w=null==Fa||null==(o=Fa.screen)?void 0:o.width,S=null==Fa||null==(a=Fa.screen)?void 0:a.height,x=null==Fa?void 0:Fa.devicePixelRatio;Ar(y)||(m.userAgentDataPlatform=y),Ar(b)||(m.maxTouchPoints=b),Ar(w)||(m.screenWidth=w),Ar(S)||(m.screenHeight=S),Ar(x)||(m.devicePixelRatio=x);var k,C=za(Ka({$os:d,$os_version:h,$browser:Gs(Da,navigator.vendor,v,g),$webview_app:p,$webview_app_version:_,$device:Ys(Da),$device_type:Xs(Da,m),$timezone:qd(),$timezone_offset:Bd()}),{$current_url:Gl(i?ho(null==La?void 0:La.href):null==La?void 0:La.href,l,Fd),$host:null==La?void 0:La.host,$pathname:null==La?void 0:La.pathname,$raw_user_agent:Da.length>1e3?Da.substring(0,997)+"...":Da,$browser_version:Qs(Da,navigator.vendor,v,g),$browser_language:Ad(),$browser_language_prefix:(k=Ad(),"string"==typeof k?k.split("-")[0]:void 0),$screen_height:null==Fa?void 0:Fa.screen.height,$screen_width:null==Fa?void 0:Fa.screen.width,$viewport_height:null==Fa?void 0:Fa.innerHeight,$viewport_width:null==Fa?void 0:Fa.innerWidth,$lib:Ea.LIB_NAME,$lib_version:Ea.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Ea.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=Ea.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var h=this.sessionManager.checkAndGetSessionAndWindowId(r,n.getTime(),!0),f=h.windowId;o.$session_id=h.sessionId,o.$window_id=f}this.sessionPropsManager&&za(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&za(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===n_&&(o.$lib_custom_api_host=this.config.api_host),l="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,i),o=za(o,l),"$pageview"===e&&Ra&&(o.title=Ra.title),!Ar(s)){var _=n.getTime()-s;o.$duration=parseFloat((_/1e3).toFixed(3))}Da&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var v=this.persistence.properties(),g=this.sessionPersistence.properties(),m=o.$groups,y=v.$groups;Rr(m)&&!Lr(m)&&(o.$groups=u({},Rr(y)?y:{},m)),Va(["$referrer","$referring_domain"],function(e){e in v&&delete g[e]});var b={};if(this._extensionEventPropertyProducers.length>0)for(var w,S=d(this._extensionEventPropertyProducers.slice());!(w=S()).done;){var x=w.value;try{za(b,x())}catch(e){Na.error("Failed to produce browser extension event properties",e)}}(o=za({},c,v,g,u({},b,o))).$is_identified=this._isIdentified(),Tr(this.config.property_denylist)?Va(this.config.property_denylist,function(e){delete o[e]}):Na.error(b_+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var k=this.config.sanitize_properties;k&&(Na.error(y_),o=k(o,e));var C=this._hasPersonProcessing();return o.$process_person_profile=C,C&&!r&&this._requirePersonProcessing("_calculate_event_properties"),o},t._calculate_set_once_properties=function(e,t,n){var i;if(void 0===t&&(t=!0),void 0===n&&(n=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!n)return e;var r=za({},this.persistence.get_initial_props(),(null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(Na.error(y_),r=s(r,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Lr(r)?void 0:r},t.register=function(e,t){var n;null==(n=this.persistence)||n.register(e,t)},t.register_once=function(e,t,n){var i;null==(i=this.persistence)||i.register_once(e,t,n)},t.register_for_session=function(e){var t,n,i=this;null==(t=this.persistence)||t.syncCookieProperties(),this._processCookieIdentityChange(),null==(n=this.sessionPersistence)||n.register(e),Object.keys(e).forEach(function(e){return i._sessionRegisteredPropKeys.add(e)}),this._persistSessionRegisteredPropKeys()},t.unregister=function(e){var t;null==(t=this.persistence)||t.unregister(e)},t.unregister_for_session=function(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this._sessionRegisteredPropKeys.delete(e),this._persistSessionRegisteredPropKeys()},t._register_single=function(e,t){var n;this.register(((n={})[e]=t,n))},t._clearSessionRegisteredProps=function(){var e=this;this._sessionRegisteredPropKeys.forEach(function(t){var n;null==(n=e.sessionPersistence)||n.unregister(t)}),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()},t._persistSessionRegisteredPropKeys=function(){var e;if(this._sessionRegisteredPropertiesStorageKey)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e._disabled||!bc._is_supported())bc._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach(function(e){return t.push(e)}),t.length>0?bc._set(this._sessionRegisteredPropertiesStorageKey,t):bc._remove(this._sessionRegisteredPropertiesStorageKey)}},t.getFeatureFlag=function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlag(e,t)},t.getFeatureFlagPayload=function(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)},t.getFeatureFlagResult=function(e,t){var n;return null==(n=this.featureFlags)?void 0:n.getFeatureFlagResult(e,t)},t.getAllFeatureFlags=function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]},t.isFeatureEnabled=function(e,t){var n,i;return null!==(n=null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t))&&void 0!==n?n:null==t?void 0:t.defaultValue},t.reloadFeatureFlags=function(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()},t.updateFlags=function(e,t,n){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,n)},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,n)},t.getEarlyAccessFeatures=function(e,t,n){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,n)},t.on=function(e,t){return this._internalEventEmitter.on(e,t)},t.onFeatureFlags=function(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),function(){})},t.onSurveysLoaded=function(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:m_}),function(){})},t.onSessionId=function(e){var t,n;return null!==(t=null==(n=this.sessionManager)?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}},t.getSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:m_})},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:m_})},t.renderSurvey=function(e,t){var n;null==(n=this.surveys)||n.renderSurvey(e,t)},t.displaySurvey=function(e,t){var n;void 0===t&&(t=wu),null==(n=this.surveys)||n.displaySurvey(e,t)},t.cancelPendingSurvey=function(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)},t.canRenderSurvey=function(e){var t,n;return null!==(t=null==(n=this.surveys)?void 0:n.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:m_}},t.canRenderSurveyAsync=function(e,t){var n,i;return void 0===t&&(t=!1),null!==(n=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==n?n:Promise.resolve({visible:!1,disabledReason:m_})},t._validateIdentifyId=function(e){return!e||Mr(e)?(Na.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(Na.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(Na.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.'),!1)},t.identify=function(e,t,n){if(!this.__loaded||!this.persistence)return Na.uninitializedWarning("posthog.identify");if(qr(e)&&(e=e.toString(),Na.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){this._healCookielessSentinelDistinctId();var i=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==i,s=this._processCookieIdentityChange(!1),o=this.persistence._beginCookieSyncSuppression(),a=!1;try{var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property("__alias")&&(this.unregister(Cu),this.register({distinct_id:e}));var l=(this.persistence.get_property("$user_state")||"anonymous")===Fl,c=e!==u,d=!c&&l;if(c&&l){var h,f=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:u};this.persistence.set_property(_l,Tl),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture(Ml,f,{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=Jl(e,t,n),null==(h=this.featureFlags)||h.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(d){this.persistence.set_property(_l,Tl);var p=t||{},_=n||{};this.setPersonPropertiesForFlags({$set:p,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$set",{$set:p,$set_once:_}),this._cachedPersonProperties=Jl(e,t,n)}else(t||n)&&this.setPersonProperties(t,n);c||r||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(dl)):d&&(t||n)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence._endCookieSyncSuppression(a)}}},t.setPersonProperties=function(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var n=Jl(this.get_distinct_id(),e,t);this._cachedPersonProperties!==n?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=n):Na.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.unsetPersonProperties=function(e){var t,n=(Tr(e)?e:[e]).filter(function(e){return Or(e)&&e.length>0});0!==n.length&&this._requirePersonProcessing("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(n,!0),this.capture("$set",{$unset:n}),this._cachedPersonProperties=null)},t.group=function(e,t,n){var i,r,s;if(e&&t){null==(i=this.persistence)||i.syncCookieProperties(),this._processCookieIdentityChange();var o=this.getGroups(),a=o[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:u({},o,(r={},r[e]=t,r))}),(a||n)&&this._hasPersonProcessing()){var l={$group_type:e,$group_key:t};n&&(l.$group_set=n),this.capture($l,l)}n&&this.setGroupPropertiesForFlags(((s={})[e]=n,s)),a&&!n&&this.reloadFeatureFlags()}else Na.error("posthog.group requires a group type and group key")},t.resetGroups=function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()},t.setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0),null==(n=this.featureFlags)||n.setPersonPropertiesForFlags(e,t)},t.resetPersonPropertiesForFlags=function(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(n=this.featureFlags)||n.setGroupPropertiesForFlags(e,t))},t.resetGroupPropertiesForFlags=function(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)},t.reset=function(e){var t=Nr(e)?e:null==e?void 0:e.resetDeviceID,n=Nr(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,n)},t._reset=function(e,t,n){var i,r,s,o;if(void 0===t&&(t=!1),Na.info("reset"),!this.__loaded)return Na.uninitializedWarning("posthog.reset");var a=null==n?void 0:n.sessionID;this.config.bootstrap=n||(null==(i=this._originalUserConfig)?void 0:i.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags());var l=this.get_property(xu),c=this.get_property(ku),d=this.get_property(Bu);null==(s=this.sessionRecording)||s.flushBeforeIdentityReset();var h=this.is_capturing();this.consent.reset(),t||!h||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var f=null==(o=this.persistence)||null==o._beginCookieSyncSuppression?void 0:o._beginCookieSyncSuppression(),p=!1;try{var _,v,g,m,y,b,w,S,x,k,C,P,E,F;if(null==(_=this.persistence)||_.clear(),null==(v=this.sessionPersistence)||v.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys(),Ar(d)||null==(g=this.persistence)||g.register(((m={})[Bu]=d,m)),null==(y=this.surveys)||y.reset(),null==(b=this.featureFlags)||b.reset(),null==(w=this.conversations)||w.reset(),null==(S=this.logs)||S.reset(),null==(x=this.metrics)||x.reset(),null==(k=this.persistence)||k.set_property(_l,Fl),null==(C=this.sessionManager)||C.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Sl,$device_id:null},"");else{var T,I=this.config.get_device_id(Hl());this.register_once({distinct_id:I,$device_id:e?I:l},""),e||Ar(c)||this.register(((T={})[ku]=c,T))}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),n)if(void 0===n.distinctID||this._inCookielessMode()||(null==(F=this.persistence)||F.set_property(_l,n.isIdentifiedID?Tl:Fl),this.register({distinct_id:n.distinctID})),null==(P=this.featureFlags)||P.initialize(),!(Ar(a)||null!=(E=this.sessionManager)&&E.setBootstrapSessionId(a,!0))){var R=u({},n);delete R.sessionID,this.config.bootstrap=R}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,p=!0}finally{var L;f&&(null==(L=this.persistence)||null==L._endCookieSyncSuppression||L._endCookieSyncSuppression(p))}this.reloadFeatureFlags()},t.shutdown=function(){var e=p(l().m(function e(t){var n,i,r,s,o,a,u,c;return l().w(function(e){for(;;)switch(e.n){case 0:if(this.__loaded){e.n=1;break}return Na.uninitializedWarning("posthog.shutdown"),e.a(2);case 1:this._getBrowserClientAdapter().dispose(),null==(n=this.sessionRecording)||n.dispose(),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.metrics)||r.flush("sendBeacon"),null==(s=this._requestQueue)||s.unload(),null==(o=this._retryQueue)||o.unload();try{null==(c=this.featureFlags)||c.destroy()}catch(e){Na.error("Error while destroying feature flags",e)}null==(a=this.persistence)||a.destroy(),null==(u=this.sessionPersistence)||u.destroy();case 2:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.setIdentity=function(e,t){var n;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(n=this.conversations)||n._onIdentityChanged()},t.clearIdentity=function(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e._onIdentityCleared()},t.get_distinct_id=function(){return this.get_property("distinct_id")},t.getGroups=function(){return this.get_property("$groups")||{}},t.get_session_id=function(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""},t.get_session_replay_url=function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&n){var r,s=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!n)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-n)/1e3)-s,0)}return i},t.alias=function(e,t){return e===this.get_property("$people_distinct_id")?(Na.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Ar(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Cu,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Na.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0},t.set_config=function(e){var t=u({},this.config);if(Rr(e)){var n,i,r,s,o,a,l,c,d,h,f,p,_;za(this.config,T_(e));var v=this._is_persistence_disabled();null==(n=this.persistence)||n.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Wf(u({},this.config,{persistence:"sessionStorage"}),v,!1);var g=this._checkLocalStorageForDebug(this.config.debug);Nr(g)&&(this.config.debug=g),Nr(this.config.debug)&&(this.config.debug?($h.DEBUG=!0,oc._is_supported()&&oc._set("ph_debug",!0),Na.info("set_config",{config:e,oldConfig:t,newConfig:u({},this.config)})):($h.DEBUG=!1,oc._is_supported()&&oc._remove("ph_debug"))),null==(i=this.featureFlags)||null==i.updateConfig||i.updateConfig(this.config,this._shouldDisableFlags()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(c=this.heatmaps)||c.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(d=this.historyAutocapture)||d.startIfEnabledOrStop()),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(f=this.deadClicksAutocapture)||f.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(_=this.externalIntegrations)||_.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&Ef(this,v_,!1)}},t._overrideSDKInfo=function(e,t){$h.LIB_NAME=e,$h.LIB_VERSION=t},t.startSessionRecording=function(e){var t,n,i,r,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(n=this.sessionRecording)||n.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})},t.stopSessionRecording=function(){this.set_config({disable_session_recording:!0})},t.sessionRecordingStarted=function(){var e;return!(null==(e=this.sessionRecording)||!e.started)},t.captureException=function(e,t){try{if(!this.exceptions)return;var n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(u({},n,t))}catch(e){return}},t.addExceptionStep=function(e,t){var n;null==(n=this.exceptions)||n.addExceptionStep(e,t)},t.captureLog=function(e){var t;null==(t=this.logs)||t.captureLog(e)},t.startExceptionAutocapture=function(e){this.set_config({capture_exceptions:null==e||e})},t.stopExceptionAutocapture=function(){this.set_config({capture_exceptions:!1})},t.loadToolbar=function(e){var t,n;return null!==(t=null==(n=this.toolbar)?void 0:n.loadToolbar(e))&&void 0!==t&&t},t.get_property=function(e){var t;return null==(t=this.persistence)?void 0:t.props[e]},t.getSessionProperty=function(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]},t.toString=function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:k_;return t!==k_&&(t="posthog."+t),t},t._isIdentified=function(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))},t._hasPersonProcessing=function(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Lr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e.__alias)&&(null==(t=this.persistence)||null==(t=t.props)||!t.$epp))},t._shouldCapturePageleave=function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview},t.createPersonProfile=function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})},t.setInternalOrTestUser=function(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})},t._requirePersonProcessing=function(e){return"never"===this.config.person_profiles?(Na.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._warnIfVolatileIdentityWithoutStableId(),this._register_single(wl,!0),!0)},t._is_persistence_disabled=function(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)},t._sync_opt_out_with_persistence=function(){var e,t,n,i,r,s=this._is_persistence_disabled();return this.is_capturing()||null==(e=this.logs)||e._onOptOut(),(null==(t=this.persistence)?void 0:t._disabled)!==s&&(null==(n=this.persistence)||n.set_disabled(s)),(null==(i=this.sessionPersistence)?void 0:i._disabled)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s&&(this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),s},t.opt_in_capturing=function(t){var n,i,r;if("always"!==this.config.cookieless_mode){if(this._inCookielessMode()){var s,o,a,u,l,c;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this._reset(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new Xp(this),this.pageViewManager=new Rf(this),this.persistence&&(this.sessionPropsManager=new Qp(this,this.sessionManager,this.persistence));var d,h=null!==(u=null==(l=this.config.__extensionClasses)?void 0:l.sessionRecording)&&void 0!==u?u:null==(c=e.__defaultExtensionClasses)?void 0:c.sessionRecording;h&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new h(this)),this._lastRemoteConfig&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this._lastRemoteConfig)))}this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(i=this.surveys)||i.loadIfEnabled()),(Ar(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(r=null==t?void 0:t.captureEventName)&&void 0!==r?r:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else Na.warn(g_)},t.opt_out_capturing=function(){if("always"!==this.config.cookieless_mode){var e,t,n="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==n||n.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this._reset(!0,!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Sl,$device_id:null}),this._removeExtension(n),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in())}else Na.warn(g_)},t.has_opted_in_capturing=function(){return this.consent.isOptedIn()},t.has_opted_out_capturing=function(){return this.consent.isOptedOut()},t.get_explicit_consent_status=function(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"},t.is_capturing=function(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())},t.clear_opt_in_out_capturing=function(){this.consent.reset(),this._sync_opt_out_with_persistence()},t._is_bot=function(){return Ia?e_(Ia,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Ra&&("visible"===Ra.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(Al,{title:Ra.title},{send_instantly:!0}),this._visibilityStateListener&&(Ra.removeEventListener(Rl,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),Ja(Ra,Rl,this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==Fa||Fa.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Fa||Fa.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}))},t._shouldDisableFlags=function(){var e=this._originalUserConfig||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Na.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,n,i,r){var s=t in e&&!Dr(e[t]),o=n in e&&!Dr(e[n]);return s?e[t]:!!o&&(r&&r.warn("Config field '"+n+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[n])}(e,"advanced_disable_flags","advanced_disable_decide",0,Na)},t._runBeforeSend=function(e){var t;if(Dr(this.config.before_send))return e;for(var n,i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Hr),r=e,s=d(Tr(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(n=s()).done;){var o=n.value;try{if(r=o(r),Dr(r)){var a="Event '"+e.event+"' was rejected in beforeSend function";return jr(e.event)?Na.warn(a+". This can cause unexpected behavior."):Na.info(a),null}r.properties&&!Lr(r.properties)||Na.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return Na.error("Error in beforeSend function for event '"+e.event+"':",t),null}}for(var u,l=d(i);!(u=l()).done;){var c=u.value;if(r.properties&&Dr(r.properties[c]))return Na.warn("Event '"+e.event+"' had its '"+c+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null}return r},t.getPageViewId=function(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId},t.captureTraceFeedback=function(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})},t.captureTraceMetric=function(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})},t._checkLocalStorageForDebug=function(e){var t=Nr(e)&&!e,n=oc._is_supported()&&"true"===oc._get("ph_debug");return!t&&(!!n||e)},o(e,[{key:"decideEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"flagsEndpointWasHit",get:function(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"logger",get:function(){var t,n;return null!==(t=null==(n=this.logs)?void 0:n.logger)&&void 0!==t?t:e._noopLogger}}])}(),a.__defaultExtensionClasses={},a._noopLogger=function(){var e=function(){};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}}(),a);!function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Ga(e.prototype[t[n]])}(R_,["identify"]);var L_=function(){"use strict";function e(e){this.disabled=!1===e;var t=Rr(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}return e.prototype.isRageClick=function(e,t,n){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&&this.timeoutMs>n-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1},e}(),A_="$copy_autocapture",O_=ja("[AutoCapture]");function M_(e,t){return t.length>e?t.slice(0,e)+"...":t}function $_(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bh(t));return t}function D_(e,t){var n,i,r=t.e,s=t.maskAllElementAttributes,o=t.maskAllText,a=t.elementAttributeIgnoreList,l=t.elementsChainAsString,c=t.disableCaptureUrlHashes;if(!Bh(e))return{props:{}};for(var h=[e],f=new Set([e]),p=e;p.parentNode&&!Nh(p,"body")&&1e3>h.length;)if(Hh(p.parentNode)){var _=p.parentNode.host;if(f.has(_))break;f.add(_),h.push(_),p=_}else{if(!Bh(p.parentNode))break;if(f.has(p.parentNode))break;f.add(p.parentNode),h.push(p.parentNode),p=p.parentNode}var v,g,m,y=[],b={},w=!1,S=!1;if(Va(h,function(e){var t=uf(e);if(Nh(e,"a")){var n=e.getAttribute("href");w=!!(t&&n&&gf(n))&&(c?ho(n):n)}vr(Uh(e),"ph-no-capture")&&(S=!0),y.push(function(e,t,n,i,r){void 0===r&&(r=!1);var s=e.tagName.toLowerCase(),o={tag_name:s};Qh.indexOf(s)>-1&&!n&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?M_(1024,mf(e)):M_(1024,Gh(e)));var a=Uh(e);a.length>0&&(o.classes=a.filter(function(e){return""!==e})),Va(e.attributes,function(n){var s;if((!lf(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==i||!i.includes(n.name))&&!t&&gf(n.value)&&(!Or(s=n.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=n.value;"class"===n.name&&(a=Vh(a).join(" ")),o["attr__"+n.name]=M_(1024,"href"===n.name&&r?ho(a):a)}});for(var u=1,l=1,c=e;c=$_(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,s,o,a,c)),Va(function(e){if(!uf(e))return{};var t={};return Va(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&gf(i)&&(t[n]=i)}}),t}(e),function(e,t){({}).hasOwnProperty.call(b,t)||(b[t]=e)})}),S)return{props:{},explicitNoCapture:S};if(o||(y[0].$el_text=Nh(e,"a")||Nh(e,"button")?mf(e):Gh(e)),w){var x,k;y[0].attr__href=w;var C=null==(x=Ul(w))?void 0:x.host,P=null==Fa||null==(k=Fa.location)?void 0:k.host;C&&P&&C!==P&&(v=w)}return{props:za((g=r.type,{$event_type:g,$ce_version:1}),l?{}:{$elements:y},{$elements_chain:(m=y,Tr(m)?function(e){return e.map(function(e){var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();for(var r,s=d(e.attr_class);!(r=s()).done;)i+="."+r.value.replace(/"/g,"")}var o=u({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return Ua(o).sort(function(e,t){return function(e,t){return t>e?-1:e>t?1:0}(e[0],t[0])}).forEach(function(e){var t=e[1];return a[bf(e[0].toString())]=bf(t.toString())}),(i+=":")+Ua(a).map(function(e){return e[0]+'="'+e[1]+'"'}).join("")}).join(";")}(function(e){return e.map(function(e){var t,n,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(n=e.attr__href)?void 0:n.slice(0,2048),attr_class:wf(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Ua(e).filter(function(e){return 0===e[0].indexOf("attr__")}).forEach(function(e){return i.attributes[e[0]]=e[1]}),i})}(m)):"")},null!=(n=y[0])&&n.$el_text?{$el_text:null==(i=y[0])?void 0:i.$el_text}:{},v&&"click"===r.type?{$external_click_url:v}:{},b)}}var q_=function(){"use strict";function e(e){this._configSource=e,this.name="autocapture",this._initialized=!1,this._isDisabledServerSide=null,this._hasReceivedConfigResponse=!1,this._elementsChainAsString=!1,this._config={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this._disposed=!1,this._configSource.refresh(this._config),this.rageclicks=new L_(this._config.rageclick),this._elementSelectors=null}var t=e.prototype;return t.setup=function(e){this._compileUrlPatterns(),this._client=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this._disposed?t.dispose():(this._remoteConfigSubscription=t,this.startIfEnabled())},t.dispose=function(){var e;this._disposed||(this._disposed=!0,this._client=void 0,null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,this._removeDomEventHandlers())},t._refreshConfig=function(){return this._configSource.refresh(this._config),this._config},t._compileUrlPatterns=function(){var e,t;return this._refreshConfig(),this._config.url_allowlist=null==(e=this._config.url_allowlist)?void 0:e.map(function(e){return new RegExp(e)}),this._config.url_ignorelist=null==(t=this._config.url_ignorelist)?void 0:t.map(function(e){return new RegExp(e)}),this._config},t._addDomEventHandlers=function(){var e=this;if(this.isBrowserSupported()){if(Fa&&Ra){var t=this._domEventHandler=function(t){t=t||(null==Fa?void 0:Fa.event);try{e._captureEvent(t)}catch(e){O_.error("Failed to capture event",e)}};if(Ja(Ra,"submit",t,{capture:!0}),Ja(Ra,"change",t,{capture:!0}),Ja(Ra,"click",t,{capture:!0}),this._refreshConfig().capture_copied_text){var n=this._copiedTextHandler=function(t){t=t||(null==Fa?void 0:Fa.event);try{e._captureEvent(t,A_)}catch(e){O_.error("Failed to capture clipboard event",e)}};Ja(Ra,"copy",n,{capture:!0}),Ja(Ra,"cut",n,{capture:!0}),Ja(Ra,"paste",n,{capture:!0})}}}else O_.info("Disabling Automatic Event Collection because this browser is not supported")},t._removeDomEventHandlers=function(){this._domEventHandler&&(null==Ra||Ra.removeEventListener("submit",this._domEventHandler,!0),null==Ra||Ra.removeEventListener("change",this._domEventHandler,!0),null==Ra||Ra.removeEventListener("click",this._domEventHandler,!0),this._domEventHandler=void 0),this._copiedTextHandler&&(null==Ra||Ra.removeEventListener("copy",this._copiedTextHandler,!0),null==Ra||Ra.removeEventListener("cut",this._copiedTextHandler,!0),null==Ra||Ra.removeEventListener("paste",this._copiedTextHandler,!0),this._copiedTextHandler=void 0),this._initialized=!1},t.startIfEnabled=function(){!this._disposed&&this._client&&this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)},t.onRemoteConfig=function(e){if(!this._disposed)if(this._hasReceivedConfigResponse=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString);var n,i=t.autocapture_opt_out;Nr(i)&&(null==(n=this._client)||n.kv.set(Tu,i),this._isDisabledServerSide=i),this.startIfEnabled()}else this.startIfEnabled()},t.setElementSelectors=function(e){this._elementSelectors=e},t.getElementSelectors=function(e){var t,n=[];return null==(t=this._elementSelectors)||t.forEach(function(t){var i;null==Ra||null==(i=Ra.querySelectorAll(t))||i.forEach(function(i){e===i&&n.push(t)})}),n},t._captureEvent=function(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var n=Kh(e);jh(n)&&(n=n.parentNode||null);var i,r=this._compileUrlPatterns();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&r.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&sf(n,r.rageclick)&&this._captureEvent(e,"$rageclick");var s=t===A_,o=s?u({},r,{dom_event_allowlist:void 0}):r;if(n&&function(e,t,n,i,r,s){var o;if(!Fa||of(e))return!1;if(null!=n&&n.url_allowlist&&!zh(n.url_allowlist,s))return!1;if(null!=n&&n.url_ignorelist&&zh(n.url_ignorelist,s))return!1;if(null!=n&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some(function(e){return t.type===e}))return!1}var u=af(e,i),l=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Ar(n))return!0;for(var i,r,s=function(){var e=r.value;if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}},o=d(e);!(r=o()).done;)if(i=s())return i.v;return!1}(c,n))return!1;if(!Zh(c,null==n?void 0:n.css_selector_allowlist))return!1;if(Zh(c,null!==(o=null==n?void 0:n.css_selector_ignorelist)&&void 0!==o?o:Yh))return!1;try{var h=Fa.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return l?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(Qh.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(n,e,o,s,s?["copy","cut","paste"]:void 0,{config:{get_current_url:r.getCurrentUrl}})){var a,l=D_(n,{e:e,maskAllElementAttributes:r.maskAllElementAttributes,maskAllText:r.maskAllText,elementAttributeIgnoreList:r.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString,disableCaptureUrlHashes:r.disableCaptureUrlHashes}),c=l.props;if(l.explicitNoCapture)return!1;var h=this.getElementSelectors(n);if(h&&h.length>0&&(c.$element_selectors=h),t===A_){var f=e.type||"clipboard";if("paste"!==f){var p,_,v=null==Fa||null==(p=Fa.getSelection())?void 0:p.toString(),g=Wh(v);if(!g)return!1;c.$selected_content=g,c.$clipboard_text_length=null!==(_=null==v?void 0:v.length)&&void 0!==_?_:0}c.$copy_type=f}return null==(a=this._client)||a.capture(t,c).catch(function(e){return O_.error("Failed to capture event",e)}),!0}}},t.isBrowserSupported=function(){return Ir(null==Ra?void 0:Ra.querySelectorAll)},o(e,[{key:"isEnabled",get:function(){var e,t;if(this._disposed)return!1;var n=null==(e=this._client)?void 0:e.kv.get(Tu),i=this._isDisabledServerSide,r=this._refreshConfig(),s=r.remoteRequestsDisabled&&!this._hasReceivedConfigResponse;if($r(i)&&!Nr(n)&&!s)return!1;var o=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!r.enabled&&!o}}])}(),B_=function(){"use strict";function e(e){this._instance=e}return e.prototype.refresh=function(e){var t=this._instance.config,n=Rr(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance._shouldDisableFlags(),e.url_allowlist=null==n?void 0:n.url_allowlist,e.url_ignorelist=null==n?void 0:n.url_ignorelist,e.dom_event_allowlist=null==n?void 0:n.dom_event_allowlist,e.element_allowlist=null==n?void 0:n.element_allowlist,e.css_selector_allowlist=null==n?void 0:n.css_selector_allowlist,e.css_selector_ignorelist=null==n?void 0:n.css_selector_ignorelist,e.element_attribute_ignorelist=null==n?void 0:n.element_attribute_ignorelist,e.capture_copied_text=null==n?void 0:n.capture_copied_text},e}(),N_=function(e){"use strict";function t(t){var n=e.call(this,new B_(t))||this;return n.instance=t,n}return n(t,e),t}(q_),j_=ja("[ExceptionAutocapture]"),H_=function(){"use strict";function e(e){var t,n=this;this._startCapturing=function(){var e;if(Fa&&n.isEnabled&&null!=(e=ih.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=ih.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=ih.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=ih.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!n._unwrapOnError&&n._config.capture_unhandled_errors&&(n._unwrapOnError=t(n.captureException.bind(n))),!n._unwrapUnhandledRejection&&n._config.capture_unhandled_rejections&&(n._unwrapUnhandledRejection=i(n.captureException.bind(n))),!n._unwrapConsoleError&&n._config.capture_console_errors&&(n._unwrapConsoleError=r(n.captureException.bind(n)))}catch(e){j_.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[Ru]),this._rateLimiter=new Yr(u({},function(e){var t,n,i,r;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(n=e.exceptionRateLimiterRefillRate)&&void 0!==n?n:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(i=null!==(r=e.exceptionRateLimiterBucketSize)&&void 0!==r?r:e.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10}}(this._instance.config.error_tracking),{refillInterval:1e4,_logger:j_})),this._config=this._requiredConfig(),this.startIfEnabledOrStop()}var t=e.prototype;return t._requiredConfig=function(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Rr(e)?t=u({},t,e):(Ar(e)?this._remoteEnabled:e)&&(t=u({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabledOrStop=function(){this.isEnabled?(j_.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()},t._loadScript=function(e){var t,n;null!=(t=ih.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(n=ih.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",function(t){if(t)return j_.error("failed to load script",t);e()})},t._stopCapturing=function(){var e,t,n;null==(e=this._unwrapOnError)||e.call(this),this._unwrapOnError=void 0,null==(t=this._unwrapUnhandledRejection)||t.call(this),this._unwrapUnhandledRejection=void 0,null==(n=this._unwrapConsoleError)||n.call(this),this._unwrapConsoleError=void 0},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;"autocaptureExceptions"in n&&(this._remoteEnabled=!!n.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register(((t={})[Ru]=this._remoteEnabled,t)),this._config=this._requiredConfig(),this.startIfEnabledOrStop())}},t.onConfigChange=function(){this._config=this._requiredConfig()},t.captureException=function(e){try{var t,n,i,r=null!==(t=null==e||null==(n=e.$exception_list)||null==(n=n[0])?void 0:n.type)&&void 0!==t?t:"Exception";if(this._rateLimiter.consumeRateLimit(r))return void j_.info("Skipping exception capture because of client rate limiting.",{exception:r});null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}catch(e){}},o(e,[{key:"isEnabled",get:function(){return this._config.capture_console_errors||this._config.capture_unhandled_errors||this._config.capture_unhandled_rejections}}])}(),V_=function(){"use strict";function e(e){this._instance=e,this._lastLocation=this._getCurrentLocation()}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){this.isEnabled&&(Na.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())},t.startIfEnabledOrStop=function(){this.stop(),this._lastLocation=this._getCurrentLocation(),this.startIfEnabled()},t.stop=function(){this._popstateListener&&this._popstateListener(),this._popstateListener=void 0,this._hashchangeListener&&this._hashchangeListener(),this._hashchangeListener=void 0,Na.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){Fa&&Fa.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener(),this._shouldCaptureHashChanges()&&this._setupHashchangeListener())},t._patchHistoryMethod=function(e){var t;if(Fa&&(null==(t=Fa.history[e])||!t.__posthog_wrapped__)){var n=this;kh(Fa.history,e,function(t){return function(i,r,s){t.call(this,i,r,s),n._capturePageview(e)}})}},t._getCurrentLocation=function(){var e=null==Fa?void 0:Fa.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}},t._getCaptureOptions=function(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:Rr(e)?e:{}},t._shouldCaptureHashChanges=function(e){return void 0===e&&(e=this._getCaptureOptions()),!!e.hash&&!this._instance.config.disable_capture_url_hashes},t._hasLocationChanged=function(e){var t=this._getCaptureOptions(),n=this._lastLocation;return!(!n||!(t.path&&e.pathname!==n.pathname||t.search&&e.search!==n.search||this._shouldCaptureHashChanges(t)&&e.hash!==n.hash))},t._capturePageview=function(e){try{var t=this._getCurrentLocation();if(!t)return;this._hasLocationChanged(t)&&this._instance.capture(Al,{navigation_type:e}),this._lastLocation=t}catch(t){Na.error("Error capturing "+e+" pageview",t)}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};Ja(Fa,"popstate",t),this._popstateListener=function(){Fa&&Fa.removeEventListener("popstate",t)}}},t._setupHashchangeListener=function(){var e=this;if(!this._hashchangeListener){var t=function(){e._capturePageview("hashchange")};Ja(Fa,"hashchange",t),this._hashchangeListener=function(){Fa&&Fa.removeEventListener("hashchange",t)}}},o(e,[{key:"isEnabled",get:function(){var e=this._getCaptureOptions();return!!(e.path||e.search||this._shouldCaptureHashChanges(e))}}])}(),z_=ja("[TracingHeaders]"),U_=function(){"use strict";function e(e){var t=this;this._instance=e,this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0,this._hostnamesForPatch=void 0,this._startCapturing=function(){var e,n,i=t._syncHostnamesForPatch();i?(Ar(t._restoreXHRPatch)&&(t._restoreXHRPatch=null==(e=ih.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,function(){return t._instance.get_distinct_id()},t._instance.sessionManager)),Ar(t._restoreFetchPatch)&&(t._restoreFetchPatch=null==(n=ih.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)?void 0:n._patchFetch(i,function(){return t._instance.get_distinct_id()},t._instance.sessionManager))):t._stopCapturing()}}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t._loadScript=function(e){var t,n;null!=(t=ih.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=ih.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",function(t){if(t)return z_.error("failed to load script",t);e()})},t._getConfiguredHostnames=function(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers},t._syncHostnamesForPatch=function(){var e,t=this._getConfiguredHostnames();return Tr(t)?(Tr(this._hostnamesForPatch)?(e=this._hostnamesForPatch).splice.apply(e,[0,this._hostnamesForPatch.length].concat(t)):this._hostnamesForPatch=[].concat(t),t.length>0?this._hostnamesForPatch:void 0):(Tr(this._hostnamesForPatch)&&this._hostnamesForPatch.splice(0),this._hostnamesForPatch=t||void 0,this._hostnamesForPatch)},t._stopCapturing=function(){var e,t;null==(e=this._restoreXHRPatch)||e.call(this),null==(t=this._restoreFetchPatch)||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0},t.startIfEnabledOrStop=function(){this._syncHostnamesForPatch()?this._loadScript(this._startCapturing):this._stopCapturing()},e}(),W_=ja("[Web Vitals]"),G_=9e5,K_=["CLS","FCP","INP","LCP"],Q_=["INP","LCP"],Z_=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],J_=function(){"use strict";function e(e){var t,n=this;this._instance=e,this._enabledServerSide=!1,this._initialized=!1,this._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this._flushToCapture=function(){clearTimeout(n._delayedFlushTimer),n._delayedFlushTimer=void 0,0!==n._buffer.metrics.length&&(n._instance.capture("$web_vitals",u({$current_url:n._buffer.url},n._buffer.metrics.reduce(function(e,t){var n;return u({},e,((n={})["$web_vitals_"+t.name+"_event"]=u({},t),n["$web_vitals_"+t.name+"_value"]=t.value,n))},{}))),n._buffer={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._addToBuffer=function(e){var t;if(n._buffer=n._buffer||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Dr(null==e?void 0:e.name)||Dr(null==e?void 0:e.value))W_.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,r=n._maskedURL(i);if(!Ar(r)){var s=qr(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+r;if(!n._maxAllowedValue||n._maxAllowedValue>e.value){n._buffer.navigationKey!==s&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,n.flushToCaptureTimeoutMs)),Ar(n._buffer.navigationKey)&&(n._buffer.navigationKey=s,n._buffer.url=r),n._buffer.firstMetricTimestamp=Ar(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp;var o=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=u({},e,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Rr(e.attribution)&&n.attributionMetrics.indexOf(e.name)>-1){for(var l,c={},h=d(Z_);!(l=h()).done;){var f=l.value,p="url"===f&&"string"==typeof e.attribution[f]?n._maskedURL(e.attribution[f]):e.attribution[f];Ar(p)||(c[f]=p)}a.attribution=c}else delete a.attribution;Ar(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),n._buffer.metrics.push(a),n._buffer.metrics.length===n.allowedMetrics.length&&n._flushToCapture()}else W_.error("Ignoring metric with value >= "+n._maxAllowedValue,e)}}},this._startCapturing=function(){if(!n._initialized){var e,t,i,r,s=!1,o=ih.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[n._callbackFlavor])||("web-vitals"===n._callbackFlavor&&Ar(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ar(l)){var c=l.withoutAttribution,d=n.attributionMetrics;s=!Ar(c),e=d.indexOf("LCP")>-1?l.onLCP:(null==c?void 0:c.onLCP)||l.onLCP,t=d.indexOf("CLS")>-1?l.onCLS:(null==c?void 0:c.onCLS)||l.onCLS,i=d.indexOf("FCP")>-1?l.onFCP:(null==c?void 0:c.onFCP)||l.onFCP,r=d.indexOf("INP")>-1?l.onINP:(null==c?void 0:c.onINP)||l.onINP}if(e&&t&&i&&r){var h={reportSoftNavs:n.useSoftNavs},f=s&&n.attributionMetrics.indexOf("INP")>-1?u({},h,{includeProcessedEventEntries:!1}):h;n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n),h),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n),h),n.allowedMetrics.indexOf("FCP")>-1&&i(n._addToBuffer.bind(n),h),n.allowedMetrics.indexOf("INP")>-1&&r(n._addToBuffer.bind(n),f),n._initialized=!0}else W_.error("web vitals callbacks not loaded - not starting")}},this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[Ou]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(W_.info("enabled, starting..."),this._loadScript(this._startCapturing))},t.onRemoteConfig=function(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var n,i,r=Rr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=Rr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((n={})[Ou]=r,n)),this._instance.persistence.register(((i={})[qu]=s,i))),this._enabledServerSide=r,this.startIfEnabled()}}},t._loadScript=function(e){var t=ih.__PosthogExtensions__,n=this._callbackFlavor,i=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=i&&i[n]||"web-vitals"===n&&Ar(i)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,n,function(t){t?W_.error("failed to load script",t):e()})},t._maskedURL=function(e){var t=e||(null==Fa?void 0:Fa.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?ho(t):t;return Gl(n,this._instance.config.mask_personal_data_properties?[].concat(Pd,this._instance.config.custom_personal_data_properties||[]):[],Fd)}W_.error("Could not determine current URL")},o(e,[{key:"_perfConfig",get:function(){return this._instance.config.capture_performance}},{key:"allowedMetrics",get:function(){var e,t,n=Rr(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return Dr(n)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||K_:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(Rr(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"attributionMetrics",get:function(){var e=Rr(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return Nr(e)?e?K_:[]:Tr(e)?e:Q_}},{key:"useAttribution",get:function(){return this.attributionMetrics.length>0}},{key:"useSoftNavs",get:function(){var e;return null!==(e=Rr(this._perfConfig)?this._perfConfig.__preview_web_vitals_soft_navs:void 0)&&void 0!==e&&e}},{key:"_maxAllowedValue",get:function(){var e=Rr(this._perfConfig)&&qr(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:G_;return e>0&&6e4>=e?G_:e}},{key:"isEnabled",get:function(){var e=null==La?void 0:La.protocol;if("http:"!==e&&"https:"!==e)return W_.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Rr(this._perfConfig)?this._perfConfig.web_vitals:Nr(this._perfConfig)?this._perfConfig:void 0;return Nr(t)?t:this._enabledServerSide}},{key:"_callbackFlavor",get:function(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}}])}(),Y_="disabled",X_="lazy_loading",ev=ja("[SessionRecording]"),tv=function(){"use strict";function e(e){var t=this;if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=Y_,this._persistFlagsOnSessionListener=void 0,this._sessionRecordingDisposed=!1,this._documentWasEverVisible=function(){var e;if(null==Ra||!Ra.visibilityState||"visible"===Ra.visibilityState)return!0;var t=null==Fa||null==(e=Fa.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(function(e){return"visible"===e.name})}(),this._onVisibilityChange=function(){var e;"visible"===(null==Ra?void 0:Ra.visibilityState)&&(t._documentWasEverVisible=!0,null==(e=t._lazyLoadedSessionRecording)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw ev.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this._config.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=Ra&&Ra.addEventListener&&Ja(Ra,"visibilitychange",this._onVisibilityChange)}var t=e.prototype;return t.initialize=function(){this.startIfEnabledOrStop()},t.dispose=function(e){var t=(void 0===e?{}:e).discardBufferedEvents,n=void 0!==t&&t;this._sessionRecordingDisposed=!0,null==Ra||null==Ra.removeEventListener||Ra.removeEventListener("visibilitychange",this._onVisibilityChange),n?this._discardRecording(!0):this.stopRecording()},t.startIfEnabledOrStop=function(e){var t;if(!(this._sessionRecordingDisposed||this._isRecordingEnabled&&null!=(t=this._lazyLoadedSessionRecording)&&t.isStarted)){var n=!Ar(Object.assign)&&!Ar(Array.from);this._isRecordingEnabled&&n?(this._lazyLoadAndStart(e),ev.info("starting")):(this._recordingStatus=Y_,this.stopRecording())}},t._lazyLoadAndStart=function(e){var t,n,i=this;if(this._isRecordingEnabled)if("awaiting_config"!==this._recordingStatus&&"missing_config"!==this._recordingStatus&&(this._recordingStatus=X_),null!=ih&&null!=(t=ih.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=ih.__PosthogExtensions__)&&n.initSessionRecording)this._onScriptLoaded(e);else{var r,s=this._instance.sessionManager;null==(r=ih.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this._scriptName,function(t){if(!i._sessionRecordingDisposed&&i._isRecordingEnabled&&i._instance.sessionManager===s){var n;if(t)return i._instance.register_for_session(((n={})[Pl]=!0,n)),ev.error("could not load recorder",t);i._onScriptLoaded(e)}else i._recordingStatus=Y_})}},t.stopRecording=function(){var e,t;null==(e=this._persistFlagsOnSessionListener)||e.call(this),this._persistFlagsOnSessionListener=void 0,null==(t=this._lazyLoadedSessionRecording)||t.stop()},t._discardRecording=function(e){var t,n;void 0===e&&(e=!1),null==(t=this._persistFlagsOnSessionListener)||t.call(this),this._persistFlagsOnSessionListener=void 0,null==(n=this._lazyLoadedSessionRecording)||n.discard({discardProducerEvents:e})},t._resetSampling=function(){var e,t;null==(e=this._persistence)||e.unregister(Wu),null==(t=this._persistence)||t.unregister(Nu)},t._validateSampleRate=function(e,t){if(Dr(e))return null;var n,i=qr(e)?e:parseFloat(e);return"number"!=typeof(n=i)||!Number.isFinite(n)||0>n||n>1?(ev.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i},t._persistRemoteConfig=function(e){var t=this;if(this._persistence){var n,i,r=this._persistence,s=function(){var n,i,s=!1===e.sessionRecording?void 0:e.sessionRecording,o=t._validateSampleRate(null==(n=t._config.session_recording)?void 0:n.sampleRate,"session_recording.sampleRate"),a=t._validateSampleRate(null==s?void 0:s.sampleRate,"remote config sampleRate"),l=null!=o?o:a;Dr(l)&&t._resetSampling();var c=null==s?void 0:s.minimumDurationMilliseconds;r.register(((i={})[Bu]=u({cache_timestamp:Date.now(),enabled:!!s},s,{networkPayloadCapture:u({capturePerformance:e.capturePerformance},null==s?void 0:s.networkPayloadCapture),canvasRecording:{enabled:null==s?void 0:s.recordCanvas,fps:null==s?void 0:s.canvasFps,quality:null==s?void 0:s.canvasQuality},sampleRate:l,minimumDurationMilliseconds:Ar(c)?null:c,endpoint:null==s?void 0:s.endpoint,triggerMatchType:null==s?void 0:s.triggerMatchType,masking:null==s?void 0:s.masking,urlTriggers:null==s?void 0:s.urlTriggers,version:null==s?void 0:s.version,triggerGroups:null==s?void 0:s.triggerGroups}),i))};s(),null==(n=this._persistFlagsOnSessionListener)||n.call(this),this._persistFlagsOnSessionListener=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}},t.onRemoteConfig=function(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this._persistRemoteConfig(t),void this._discardRecording()):(this._persistRemoteConfig(t),void this.startIfEnabledOrStop()):("awaiting_config"===this._recordingStatus&&(this._recordingStatus="missing_config",ev.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())},t.log=function(e,t){var n;void 0===t&&(t="log"),null!=(n=this._lazyLoadedSessionRecording)&&n.log?this._lazyLoadedSessionRecording.log(e,t):ev.warn("log called before recorder was ready")},t._isRemoteConfigFresh=function(){var e,t=this._instance.get_property(Bu);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return ev.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!Dr(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp},t._onScriptLoaded=function(e){var t,n,i;if(!this._sessionRecordingDisposed&&this._isRecordingEnabled&&this._instance.sessionManager){var r,s;if(null==(t=ih.__PosthogExtensions__)||!t.initSessionRecording)return ev.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((r={},r[Pl]=!0,r));if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(s=ih.__PosthogExtensions__)?void 0:s.initSessionRecording(this._instance,this._documentWasEverVisible),this._lazyLoadedSessionRecording._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this._isRemoteConfigFresh()){if("missing_config"===this._recordingStatus||"awaiting_config"===this._recordingStatus)return;return this._recordingStatus="awaiting_config",ev.info("persisted remote config is stale, requesting fresh config before starting"),void new Zf(this._instance).load()}this._recordingStatus=X_,null==(n=(i=this._lazyLoadedSessionRecording).setDocumentWasEverVisible)||n.call(i,this._documentWasEverVisible),this._lazyLoadedSessionRecording.start(e)}else this._recordingStatus=Y_},t.onRRwebEmit=function(e){var t;null==(t=this._lazyLoadedSessionRecording)||null==t.onRRwebEmit||t.onRRwebEmit(e)},t.overrideLinkedFlag=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[Hu]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideLinkedFlag()},t.overrideSampling=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[ju]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideSampling()},t.overrideTrigger=function(e){var t,n,i;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register(((n={})["url"===e?Vu:zu]=!0,n)),null==(i=this._lazyLoadedSessionRecording)||i.overrideTrigger(e)},t.tryAddCustomEvent=function(e,t){var n;return!(null==(n=this._lazyLoadedSessionRecording)||!n.tryAddCustomEvent(e,t))},t.flushBeforeIdentityReset=function(){var e;null==(e=this._lazyLoadedSessionRecording)||null==e.flushBeforeIdentityReset||e.flushBeforeIdentityReset()},o(e,[{key:"_config",get:function(){return this._instance.config}},{key:"_persistence",get:function(){return this._instance.persistence}},{key:"started",get:function(){var e;return!(null==(e=this._lazyLoadedSessionRecording)||!e.isStarted)}},{key:"status",get:function(){var e,t;return"awaiting_config"===this._recordingStatus||"missing_config"===this._recordingStatus?this._recordingStatus:null!==(e=null==(t=this._lazyLoadedSessionRecording)?void 0:t.status)&&void 0!==e?e:this._recordingStatus}},{key:"_isRecordingEnabled",get:function(){var e,t=!(null==(e=this._instance.get_property(Bu))||!e.enabled),n=!this._config.disable_session_recording,i=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Fa&&t&&n&&!i}},{key:"_scriptName",get:function(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property("$session_recording_remote_config"))||null==(e=e.scriptConfig)?void 0:e.script)||"lazy-recorder"}},{key:"sdkDebugProperties",get:function(){var e;return(null==(e=this._lazyLoadedSessionRecording)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}}])}(),nv=ja("[Heatmaps]");function iv(e){return Rr(e)&&"clientX"in e&&"clientY"in e&&qr(e.clientX)&&qr(e.clientY)}var rv=function(){"use strict";function e(e){var t;this._enabledServerSide=!1,this._initialized=!1,this._flushInterval=null,this.instance=e,this._enabledServerSide=!(null==(t=this.instance.persistence)||!t.props[Iu]),this.rageclicks=new L_(e.config.rageclick)}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;nv.info("starting..."),this._setupListeners(),this._onVisibilityChange()}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this._removeListeners(),this.getAndClearBuffer()}},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;if("heatmaps"in n){var i=!!n.heatmaps;this.instance.persistence&&this.instance.persistence.register(((t={})[Iu]=i,t)),this._enabledServerSide=i,this.startIfEnabled()}}},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t._onDeadClick=function(e){iv(e.originalEvent)&&this._onClick(e.originalEvent,"deadclick")},t._onVisibilityChange=function(){this._flushInterval&&clearInterval(this._flushInterval),this._flushInterval=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Ra)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null},t._setupListeners=function(){var e=this;Fa&&Ra&&(this._flushHandler=this._flush.bind(this),Ja(Fa,Ll,this._flushHandler),this._onClickHandler=function(t){return e._onClick(t||(null==Fa?void 0:Fa.event))},Ja(Ra,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=function(t){return e._onMouseMove(t||(null==Fa?void 0:Fa.event))},Ja(Ra,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Cf(this.instance,xf,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),Ja(Ra,Rl,this._onVisibilityChange_handler),this._initialized=!0)},t._removeListeners=function(){var e;Fa&&Ra&&(this._flushHandler&&Fa.removeEventListener(Ll,this._flushHandler),this._onClickHandler&&Ra.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Ra.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Ra.removeEventListener(Rl,this._onVisibilityChange_handler),clearTimeout(this._mouseMoveTimeout),null==(e=this._deadClicksCapture)||e.stop(),this._initialized=!1)},t._getProperties=function(e,t){var n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),s=function(e,t,n){for(var i=e;i&&Bh(i)&&!Nh(i,"body");){if(i===n)return!1;var r=void 0;try{var s,o,a;r=null==(s=null!==(o=null==(a=i.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:Fa)?void 0:s.getComputedStyle(i).position}catch(e){return!1}if(vr(t,r))return!0;i=Jh(i)}return!1}(Kh(e),["fixed","sticky"],r);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:n),target_fixed:s,type:t}},t._onClick=function(e,t){var n;if(void 0===t&&(t="click"),!qh(e.target)&&iv(e)){var i=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&sf(Kh(e),this.instance.config.rageclick)&&this._capture(u({},i,{type:"rageclick"})),this._capture(i)}},t._onMouseMove=function(e){var t=this;!qh(e.target)&&iv(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))},t._capture=function(e){if(Fa){var t=this._config.disable_capture_url_hashes?ho(Fa.location.href):Fa.location.href,n=Gl(t,this._config.mask_personal_data_properties?[].concat(Pd,this._config.custom_personal_data_properties||[]):[],Fd);this._buffer=this._buffer||{},this._buffer[n]||(this._buffer[n]=[]),this._buffer[n].push(e)}},t._flush=function(){this._buffer&&!Lr(this._buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})},o(e,[{key:"_config",get:function(){return this.instance.config}},{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return Rr(this._config.capture_heatmaps)&&this._config.capture_heatmaps.flush_interval_milliseconds&&(e=this._config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return Dr(this._config.capture_heatmaps)?Dr(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}}])}(),sv=ja("[Product Tours]"),ov=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property($u))},av=function(){"use strict";function e(e){this._productTourManager=null,this._cachedTours=null,this._instance=e}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){var t;if(e.ok){var n=e.config;if("productTours"in n){var i,r;if(this._persistence&&this._persistence.register(((t={})[$u]=!!n.productTours,t)),!ov(this._instance))return!this._productTourManager&&Dr(null==(i=this._persistence)?void 0:i.props.ph_product_tours)||sv.info("product tours disabled; stopping and clearing cached tours"),null==(r=this._productTourManager)||r.stop(),this._productTourManager=null,void this.clearCache();this.loadIfEnabled()}}},t.loadIfEnabled=function(){var e=this;!this._productTourManager&&ov(this._instance)&&this._loadScript(function(){return e._startProductTours()})},t._loadScript=function(e){var t,n;null!=(t=ih.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=ih.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"product-tours",function(t){t?sv.error("Could not load product tours script",t):e()})},t._startProductTours=function(){var e;!this._productTourManager&&null!=(e=ih.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=ih.__PosthogExtensions__.generateProductTours(this._instance,!0))},t.getProductTours=function(e,t){var n=this;if(void 0===t&&(t=!1),!Tr(this._cachedTours)||t){var i=this._persistence;if(i){var r=i.props[cl];if(Tr(r)&&!t)return this._cachedTours=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:function(t){var r;if(ov(n._instance)){var s=t.statusCode;if(200!==s||!t.json){var o="Product Tours API could not be loaded, status: "+s;return 0===s?t.error||sv.warn(o):sv.error(o),void e([],{isLoaded:!1,error:o})}var a=Tr(t.json.product_tours)?t.json.product_tours:[];n._cachedTours=a,i&&i.register(((r={})[cl]=a,r)),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})},t.getActiveProductTours=function(e){Dr(this._productTourManager)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this._productTourManager.getActiveProductTours(e)},t.showProductTour=function(e){var t;null==(t=this._productTourManager)||t.showTourById(e)},t.previewTour=function(e){var t=this;this._productTourManager?this._productTourManager.previewTour(e):this._loadScript(function(){var n;t._startProductTours(),null==(n=t._productTourManager)||n.previewTour(e)})},t.dismissProductTour=function(){var e;null==(e=this._productTourManager)||e.dismissTour("user_clicked_skip")},t.nextStep=function(){var e;null==(e=this._productTourManager)||e.nextStep()},t.previousStep=function(){var e;null==(e=this._productTourManager)||e.previousStep()},t.clearCache=function(){var e;this._cachedTours=null,null==(e=this._persistence)||e.unregister(cl)},t.resetTour=function(e){var t;null==(t=this._productTourManager)||t.resetTour(e)},t.resetAllTours=function(){var e;null==(e=this._productTourManager)||e.resetAllTours()},t.cancelPendingTour=function(e){var t;null==(t=this._productTourManager)||t.cancelPendingTour(e)},o(e,[{key:"_persistence",get:function(){return this._instance.persistence}}])}(),uv=ja("[SiteApps]"),lv="Error while initializing PostHog app with config id ",cv=function(){"use strict";function e(e){this._instance=e,this._siteAppElementPatchCount=0,this._bufferedInvocations=[],this.apps={}}var n=e.prototype;return n._eventCollector=function(e,t){if(t){var n=this.globalsForEvent(t);this._bufferedInvocations.push(n),this._bufferedInvocations.length>1e3&&(this._bufferedInvocations=this._bufferedInvocations.slice(10))}},n.initialize=function(){var e=this;if(this.isEnabled){var t=this._instance._addCaptureHook(this._eventCollector.bind(this));this._stopBuffering=function(){t(),e._bufferedInvocations=[],e._stopBuffering=void 0}}},n.globalsForEvent=function(e){var n,i,s,o,a,l,c;if(!e)throw new Error("Event payload is required");for(var d={},h=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{},p=0,_=Object.entries(f);_.length>p;p++){var v=_[p],g=v[0];d[g]={id:h[g],type:g,properties:v[1]}}var m=e.$set_once,y=e.$set;return{event:u({},r(e,t),{properties:u({},e.properties,y?{$set:u({},null!==(n=null==(i=e.properties)?void 0:i.$set)&&void 0!==n?n:{},y)}:{},m?{$set_once:u({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},m)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(c=e.properties)?void 0:c.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}},n._prepareElementForSiteApp=function(e){var t,n=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===n&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(uv.error("prepare_external_dependency_stylesheet returned null"),null):"script"===n&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(uv.error("prepare_external_dependency_script returned null"),null):e},n._patchSiteAppElementInsertionMethods=function(){var e,t,n,i,r,s,o,a,u=this;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return function(){};var l=null==Ra?void 0:Ra.defaultView,c=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!c)return function(){};if(this._siteAppElementPatchCount++,this._restoreSiteAppElementPatches)return this._releaseSiteAppElementPatches();var d=[],h=this,f=new WeakSet,p=function(e,t,n){if(null!=e&&e[t]){var i=e[t];e[t]=n(i),d.push(function(){e[t]=i})}},_=function(e){if(f.has(e))return e;var t=h._prepareElementForSiteApp(e);return t&&f.add(t),t},v=function(e){return e.map(function(e){return"string"==typeof e?e:_(e)}).filter(function(e){return!$r(e)})};return p(c,"appendChild",function(e){return function(t){var n=_(t);return n?e.call(this,n):t}}),p(c,"insertBefore",function(e){return function(t,n){var i=_(t);return i?e.call(this,i,n):t}}),p(c,"replaceChild",function(e){return function(t,n){var i=_(t);return i?e.call(this,i,n):n}}),[null==(t=l.Element)?void 0:t.prototype,null==(n=l.Document)?void 0:n.prototype,null==(i=l.DocumentFragment)?void 0:i.prototype].forEach(function(e){p(e,"append",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,v(n))}}),p(e,"prepend",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,v(n))}})}),[null==(r=l.Element)?void 0:r.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach(function(e){p(e,"before",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,v(n))}}),p(e,"after",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];return e.apply(this,v(n))}}),p(e,"replaceWith",function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;t>i;i++)n[i]=arguments[i];var r=v(n);return n.length&&!r.length?void 0:e.apply(this,r)}})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",function(e){return function(t,n){var i=_(n);return i?e.call(this,t,i):null}}),this._restoreSiteAppElementPatches=function(){d.forEach(function(e){return e()}),u._restoreSiteAppElementPatches=void 0},this._releaseSiteAppElementPatches()},n._releaseSiteAppElementPatches=function(){var e=this,t=!1;return function(){t||(t=!0,e._siteAppElementPatchCount--,0===e._siteAppElementPatchCount&&(null==e._restoreSiteAppElementPatches||e._restoreSiteAppElementPatches()))}},n._runWithPreparedSiteAppElements=function(e,t){void 0===t&&(t=!0);var n=this._patchSiteAppElementInsertionMethods();try{var i=e(n);return t&&n(),i}catch(e){throw n(),e}},n.setupSiteApp=function(e){var t=this,n=this.apps[e.id],i=function(){!n.errored&&t._bufferedInvocations.length&&(uv.info("Processing "+t._bufferedInvocations.length+" events for site app with id "+e.id),t._bufferedInvocations.forEach(function(e){return t._runWithPreparedSiteAppElements(function(){return null==n.processEvent?void 0:n.processEvent(e)})}),n.processedBuffer=!0),Object.values(t.apps).every(function(e){return e.processedBuffer||e.errored})&&(null==t._stopBuffering||t._stopBuffering())},r=!1,s=function(t){n.errored=!t,n.loaded=!0,uv.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),r&&i()};try{var o=this._runWithPreparedSiteAppElements(function(n){return e.init({posthog:t._instance,callback:function(e){n(),s(e)}})},!1).processEvent;o&&(n.processEvent=o),r=!0}catch(t){uv.error(lv+e.id,t),s(!1)}if(r&&n.loaded)try{i()}catch(t){uv.error("Error while processing buffered events PostHog app with config id "+e.id,t),n.errored=!0}},n._setupSiteApps=function(){for(var e,t=this.siteAppLoaders||[],n=d(t);!(e=n()).done;){var i=e.value;this.apps[i.id]={id:i.id,loaded:!1,errored:!1,processedBuffer:!1}}for(var r,s=d(t);!(r=s()).done;)this.setupSiteApp(r.value)},n._onCapturedEvent=function(e){var t=this;if(0!==Object.keys(this.apps).length)for(var n=this.globalsForEvent(e),i=function(){var i=s[r];try{t._runWithPreparedSiteAppElements(function(){return null==i.processEvent?void 0:i.processEvent(n)})}catch(t){uv.error("Error while processing event "+e.event+" for site app "+i.id,t)}},r=0,s=Object.values(this.apps);s.length>r;r++)i()},n.onRemoteConfig=function(e){var t,n,i,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",function(e){return r._onCapturedEvent(e)})):void uv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(n=this._stopBuffering)||n.call(this),e.ok){var s=e.config;if(null!=(i=s.siteApps)&&i.length)if(this.isEnabled)for(var o,a=function(){var e,t=o.value,n=t.id,i=t.url;ih["__$$ph_site_app_"+n]=r._instance,null==(e=ih.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,function(e){if(e)return uv.error(lv+n,e)})},u=d(s.siteApps);!(o=u()).done;)a();else uv.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},o(e,[{key:"isEnabled",get:function(){return!!this._instance.config.opt_in_site_apps}},{key:"siteAppLoaders",get:function(){var e;return null==(e=ih._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),dv=function(e,t){return null!=e&&e.then?e.then(t):t(e)},hv="SDK is not enabled or survey functionality is not yet loaded",fv="Disabled. Not loading surveys.",pv=function(){"use strict";function e(e,t){var n=this;this._configSource=e,this._initialClientState=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this._isInitializingSurveys=!1,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._lastSurveyRefreshFailedAt=null,this._disposed=!1,this._renderTimeouts=new Set,this.onRemoteConfig=function(e){if(!n._disposed&&!n._config.disableSurveys){if(!e.ok)return pu.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Dr(t))return pu.warn("Flags not loaded yet. Not loading surveys.");n._isSurveysEnabled=Nr(t)?t:t.length>0,pu.info("flags response received, isSurveysEnabled: "+n._isSurveysEnabled),n.loadIfEnabled()}}}var t=e.prototype;return t.setup=function(e){var t=this;if(!this._disposed)return this._initializingClient=e,dv(e.kv.initialize(),function(){if(t._initializingClient===e&&!t._disposed){t._initializingClient=void 0,t._client=e;var n=e.onRemoteConfig(t.onRemoteConfig);t._disposed?n.dispose():(t._remoteConfigSubscription=n,t.loadIfEnabled())}})},t.dispose=function(){var e,t,n;this._disposed||(this._disposed=!0,this._initializingClient=void 0,this._client=void 0,null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(n=this._surveyManager)||null==n.dispose||n.dispose(),this._surveyManager=null,this._surveyCallbacks=[],this._getSurveysInFlightPromise=null,this._renderTimeouts.forEach(function(e){return clearTimeout(e)}),this._renderTimeouts.clear())},t.initialize=function(){this.loadIfEnabled()},t.reset=function(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var i=localStorage.key(n);(null!=i&&i.startsWith("seenSurvey_")||null!=i&&i.startsWith("inProgressSurvey_"))&&t.push(i)}t.forEach(function(e){return localStorage.removeItem(e)})}catch(e){}},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._client){var t=this._config;if(!this._surveyManager)if(this._isInitializingSurveys)pu.info("Already initializing surveys, skipping...");else if(t.disableSurveys)pu.info(fv);else if(t.cookielessMode&&this._configSource.isOptedOut())pu.info("Not loading surveys in cookieless mode without consent.");else{var n=this._configSource.getExtensions();if(n){if(!Ar(this._isSurveysEnabled)||t.advancedEnableSurveys){var i=this._isSurveysEnabled||t.advancedEnableSurveys;this._isInitializingSurveys=!0;try{var r=n.generateSurveys;if(r)return this._completeSurveyInitialization(r,i),void(this._isInitializingSurveys=!1);var s=n.loadExternalDependency;if(!s)return this._handleSurveyLoadError(El),void(this._isInitializingSurveys=!1);s(function(t){try{if(e._disposed)return;var n=e._configSource.getExtensions();t||null==n||!n.generateSurveys?e._handleSurveyLoadError("Could not load surveys script",t):e._completeSurveyInitialization(n.generateSurveys,i)}finally{e._isInitializingSurveys=!1}})}catch(e){throw this._isInitializingSurveys=!1,this._handleSurveyLoadError("Error initializing surveys",e),e}}}else pu.error("PostHog Extensions not found.")}}},t._completeSurveyInitialization=function(e,t){this._disposed||(this._surveyManager=e(t),this._surveyEventReceiver=this._configSource.createEventReceiver(),pu.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0}))},t._handleSurveyLoadError=function(e,t){pu.error(e,t),this._notifySurveyCallbacks({isLoaded:!1,error:e})},t.onSurveysLoaded=function(e){var t=this;return this._surveyCallbacks.push(e),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),function(){t._surveyCallbacks=t._surveyCallbacks.filter(function(t){return t!==e})}},t.getSurveys=function(e,t){var n,i=this;void 0===t&&(t=!1);var r=null!==(n=this._client)&&void 0!==n?n:this._initialClientState;if(r&&!this._disposed){if(this._config.disableSurveys)return pu.info(fv),e([]);var s=r.kv.get(sl);if(s&&!t)return e(s,{isLoaded:!0}),void(this._shouldBackgroundRefreshSurveys()&&this.getSurveys(function(){},!0));if(this._getSurveysInFlightPromise)this._getSurveysInFlightPromise.then(function(t){i._disposed||e(t.surveys,t.context)}).catch(function(e){return pu.error("Error in survey callback",e)});else{var o=this._sendSurveysRequest("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this._config.requestTimeoutMs}).then(function(e){try{return i._handleSurveyResponse(r,e)}catch(e){return pu.error("Error processing surveys response",e),i._handleSurveyResponse(r,{statusCode:0,error:e})}},function(e){return i._handleSurveyResponse(r,{statusCode:0,error:e})});this._getSurveysInFlightPromise=o;var a=function(){i._getSurveysInFlightPromise===o&&(i._getSurveysInFlightPromise=null)};o.then(function(t){a(),i._disposed||e(t.surveys,t.context)},a).catch(function(e){return pu.error("Error in survey callback",e)})}}},t._sendSurveysRequest=function(e,t){var n=this._client;return n?n.sendRequest(e,t):new Promise(function(e){return e({statusCode:0,error:new Error(hv)})})},t._handleSurveyResponse=function(e,t){var n,i;if(this._disposed)return{surveys:[],context:{isLoaded:!1,error:hv}};var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;return 0!==r?pu.error(s):t.error||pu.warn(s),this._lastSurveyRefreshFailedAt=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this._lastSurveyRefreshFailedAt=null;var o=t.json.surveys||[],a=o.filter(function(e){return _u(e)&&(uu(e)||vu(e))});return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),e.kv.set(((i={})[sl]=o,i[ol]=Date.now(),i)),{surveys:o,context:{isLoaded:!0}}},t._shouldBackgroundRefreshSurveys=function(){return this._isSurveyCacheStale()&&!this._getSurveysInFlightPromise&&!this._isSurveyRefreshBackingOff()},t._isSurveyCacheStale=function(){var e,t,n=null==(e=null!==(t=this._client)&&void 0!==t?t:this._initialClientState)?void 0:e.kv.get(ol);return qr(n)&&Date.now()-n>3e5},t._isSurveyRefreshBackingOff=function(){return qr(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt},t.markSurveyAsSeen=function(e,t){var n;yu({id:e,current_iteration:null!==(n=null==t?void 0:t.iteration)&&void 0!==n?n:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}},t._notifySurveyCallbacks=function(e){for(var t,n=d(this._surveyCallbacks);!(t=n()).done;){var i=t.value;try{if(!e.isLoaded)return i([],e);this.getSurveys(i)}catch(e){pu.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!Dr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);pu.warn("init was not called")},t._getSurveyById=function(e){var t=null;return this.getSurveys(function(n){var i;t=null!==(i=n.find(function(t){return t.id===e}))&&void 0!==i?i:null}),t},t._checkSurveyEligibility=function(e){if(Dr(this._surveyManager))return{eligible:!1,reason:hv};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}},t._checkSurveyRenderability=function(e){if(Dr(this._surveyManager))return{eligible:!1,reason:hv};var t="string"==typeof e?this._getSurveyById(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}},t.canRenderSurvey=function(e){if(Dr(this._surveyManager))return pu.warn("init was not called"),{visible:!1,disabledReason:hv};var t=this._checkSurveyRenderability(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return Dr(this._surveyManager)?(pu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:hv})):new Promise(function(i){n.getSurveys(function(t){var r,s=null!==(r=t.find(function(t){return t.id===e}))&&void 0!==r?r:null;if(s){var o=n._checkSurveyRenderability(s);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})},t.renderSurvey=function(e,t,n){var i,r=this;if(Dr(this._surveyManager))pu.warn("init was not called");else{var s="string"==typeof e?this._getSurveyById(e):e;if(null!=s&&s.id)if(bu.includes(s.type)){var o=null==Ra?void 0:Ra.querySelector(t);if(o)if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds){pu.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(function(){var e,t;r._renderTimeouts.delete(a),r._disposed||(pu.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=r._surveyManager)||t.renderSurvey(s,o,n),pu.info("Survey "+s.id+" rendered"))},1e3*s.appearance.surveyPopupDelaySeconds);this._renderTimeouts.add(a)}else this._surveyManager.renderSurvey(s,o,n);else pu.warn("Survey element not found")}else pu.warn("Surveys of type "+s.type+" cannot be rendered in the app");else pu.warn("Survey not found")}},t.displaySurvey=function(e,t){var n;if(Dr(this._surveyManager))pu.warn("init was not called");else{var i=this._getSurveyById(e);if(i){var r=i;if(null!=(n=i.appearance)&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=u({},i,{appearance:u({},i.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==fr&&t.initialResponses&&pu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this._checkSurveyEligibility(i);if(!s.eligible)return void pu.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else pu.warn("Survey not found")}},t.cancelPendingSurvey=function(e){Dr(this._surveyManager)?pu.warn("init was not called"):this._surveyManager.cancelSurvey(e)},t.handlePageUnload=function(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()},o(e,[{key:"_config",get:function(){return this._configSource.get()}}])}();function _v(e,t,n){if(Dr(e))return!1;switch(n){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}}var vv=function(){"use strict";function e(e){var t=this;this._instance=e,this._actionRegistry=new Set,this._actionEvents=new Set,this._debugEventEmitter=new Zp,this._checkStep=function(e,n){return t._checkStepEvent(e,n)&&t._checkStepUrl(e,n)&&t._checkStepElement(e,n)&&t._checkStepProperties(e,n)},this._checkStepEvent=function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)}}var t=e.prototype;return t.init=function(){var e,t,n=this;Ar(null==(e=this._instance)?void 0:e._addCaptureHook)||(this._captureHookUnsubscribe=null==(t=this._instance)?void 0:t._addCaptureHook(function(e,t){n.on(e,t)}))},t.dispose=function(){var e;null==(e=this._captureHookUnsubscribe)||e.call(this),this._captureHookUnsubscribe=void 0,this._debugEventEmitter=new Zp},t.register=function(e){var t,n,i=this;if(!Ar(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(function(e){var t;i._actionRegistry.add(e),null==(t=e.steps)||t.forEach(function(e){i._actionEvents.add((null==e?void 0:e.event)||"")})}),null!=(n=this._instance)&&n.autocapture)){var r=new Set;this._actionRegistry.forEach(function(e){var t;null==(t=e.steps)||t.forEach(function(e){null!=e&&e.selector&&r.add(e.selector)})}),this._instance.autocapture.setElementSelectors(r)}},t.replace=function(e){this._actionRegistry.clear(),this._actionEvents.clear(),this.register(e)},t.on=function(e,t){var n=this;null!=t&&0!=e.length&&(this._actionEvents.has(e)||this._actionEvents.has(t.event))&&this._actionRegistry.forEach(function(e){n._checkAction(t,e)&&n._debugEventEmitter.emit("actionCaptured",e.name)})},t._addActionHook=function(e){this.onAction("actionCaptured",function(t){return e(t)})},t._checkAction=function(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var n,i=d(t.steps);!(n=i()).done;)if(this._checkStep(e,n.value))return!0;return!1},t.onAction=function(e,t){return this._debugEventEmitter.on(e,t)},t._checkStepUrl=function(e,t){if(null!=t&&t.url){var n,i=null==e||null==(n=e.properties)?void 0:n.$current_url;if(!i||"string"!=typeof i)return!1;if(!_v(i,t.url,t.url_matching||"contains"))return!1}return!0},t._checkStepElement=function(e,t){return!!this._checkStepHref(e,t)&&!!this._checkStepText(e,t)&&!!this._checkStepSelector(e,t)},t._checkStepHref=function(e,t){var n;if(null==t||!t.href)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some(function(e){return _v(e.href,t.href,t.href_matching||"exact")});var r,s=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!s&&_v((r=s.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")},t._checkStepText=function(e,t){var n;if(null==t||!t.text)return!0;var i=this._getElementsList(e);if(i.length>0)return i.some(function(e){return _v(e.text,t.text,t.text_matching||"exact")||_v(e.$el_text,t.text,t.text_matching||"exact")});var r,s,o,a=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!a&&(r=function(e){for(var t,n=[],i=/(?::|")text="(.*?)"/g;!Dr(t=i.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(a),s=t.text,o=t.text_matching||"exact",r.some(function(e){return _v(e,s,o)}))},t._checkStepSelector=function(e,t){var n,i;if(null==t||!t.selector)return!0;if(null!=e&&null!=(n=e.properties)&&null!=(n=n.$element_selectors)&&n.includes(t.selector))return!0;var r=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&r)try{return new RegExp(t.selector_regex).test(r)}catch(e){return!1}return!1},t._getElementsList=function(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements},t._checkStepProperties=function(e,t){return null==t||!t.properties||0===t.properties.length||fu(t.properties.reduce(function(e,t){var n=Tr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:n,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)},e}(),gv=function(e){"use strict";function t(t){return e.call(this,t)||this}n(t,e);var i=t.prototype;return i._getActivatedKey=function(){return al},i._getActivatedSessionKey=function(){return ul},i._getActivationTimestampsKey=function(){return ll},i._writeActivationTimestamps=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[ll]=e,n))},i._clearActivationTimestampsStore=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(ll)},i._shouldPersistArmedActivation=function(e){var t,n;this._getItems(function(t){n=t.find(function(t){return t.id===e})});var i=null==(t=n)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return qr(i)&&i>0},i._getShownEventName=function(){return rr},i._getItems=function(e){var t;null==(t=this._instance)||t.getSurveys(e)},i._cancelPendingItem=function(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)},i._getLogger=function(){return pu},i._setActivatedItems=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[al]=e,n))},i._setActivatedSession=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[ul]=e,n))},i._clearActivatedSession=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(ul)},i._isItemPermanentlyIneligible=function(){return!1},i._activationOutcome=function(e,t){var n;return this._getItems(function(e){n=e.find(function(e){return e.id===t})}),!n||lu(n)?e===rr?"consume":"ignore":e===rr?"persist":e===sr||e===or?"consume":"ignore"},i.getSurveys=function(){return this.getActivatedIds()},i.getEventToSurveys=function(){return this.getEventToItemsMap()},t}(function(){"use strict";function e(e){var t,n=this;this._pendingActivatedItems=[],this._instance=e,this._eventToItems=new Map,this._cancelEventToItems=new Map,this._actionToItems=new Map,this._sessionIdUnsubscribe=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId(function(e){return n._onSessionIdChanged(e)})}var t=e.prototype;return t._shouldPersistArmedActivation=function(e){return!1},t._getActivationTimestampsKey=function(){return null},t._writeActivationTimestamps=function(e){},t._clearActivationTimestampsStore=function(){},t._doesEventMatchFilter=function(e,t){return!!e&&fu(e.propertyFilters,null==t?void 0:t.properties)},t._buildEventToItemMap=function(e,t){var n=new Map;return e.forEach(function(e){var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach(function(t){if(null!=t&&t.name){var i=n.get(t.name)||[];i.push(e.id),n.set(t.name,i)}})}),n},t._getMatchingItems=function(e,t,n){var i=this,r=(n===Hi?this._eventToItems:this._cancelEventToItems).get(e),s=[];return this._getItems(function(e){s=e.filter(function(e){return null==r?void 0:r.includes(e.id)})}),s.filter(function(r){var s,o=null==(s=r.conditions)||null==(s=s[n])||null==(s=s.values)?void 0:s.find(function(t){return t.name===e});return i._doesEventMatchFilter(o,t)})},t.register=function(e){this._register(e,!1)},t.replace=function(e){this._register(e,!0)},t._register=function(e,t){var n;Ar(null==(n=this._instance)?void 0:n._addCaptureHook)||(this._setupEventBasedItems(e,t),this._setupActionBasedItems(e,t))},t._setupActionBasedItems=function(e,t){var n=this,i=e.filter(function(e){var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this._actionToItems.clear(),0!==i.length){this._actionMatcher||(this._actionMatcher=new vv(this._instance),this._actionMatcher.init(),this._actionMatcher._addActionHook(function(e){return n.onAction(e)}));var r=[];i.forEach(function(e){var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(function(t){if(r.push(t),t.name){var i,s=null!==(i=n._actionToItems.get(t.name))&&void 0!==i?i:[];s.includes(e.id)||s.push(e.id),n._actionToItems.set(t.name,s)}})}),t?this._actionMatcher.replace(r):this._actionMatcher.register(r)}else{var s;t&&(null==(s=this._actionMatcher)||s.replace([]))}},t._mergeItemMaps=function(e,t){t.forEach(function(t,n){var i,r=null!==(i=e.get(n))&&void 0!==i?i:[];t.forEach(function(e){r.includes(e)||r.push(e)}),e.set(n,r)})},t._setupEventBasedItems=function(e,t){var n,i,r=this,s=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.events)&&(null==(n=e.conditions)||null==(n=n.events)||null==(n=n.values)?void 0:n.length)>0}),o=e.filter(function(e){var t,n;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(n=e.conditions)||null==(n=n.cancelEvents)||null==(n=n.values)?void 0:n.length)>0}),a=this._buildEventToItemMap(e,Hi),u=this._buildEventToItemMap(e,Vi);t?(this._eventToItems=a,this._cancelEventToItems=u):(this._mergeItemMaps(this._eventToItems,a),this._mergeItemMaps(this._cancelEventToItems,u)),(0!==s.length||0!==o.length)&&(null!==(n=this._captureHookUnsubscribe)&&void 0!==n||(this._captureHookUnsubscribe=null==(i=this._instance)?void 0:i._addCaptureHook(function(e,t){r.onEvent(e,t)})))},t.onEvent=function(e,t){var n,i,r=this,s=this._getLogger(),o=(null==t||null==(n=t.properties)?void 0:n.$survey_id)||(null==t||null==(i=t.properties)?void 0:i.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){var a=this._activationOutcome(e,o);if("consume"===a)return s.info("event consumed activated item, removing it",{event:e,itemId:o}),void this._deactivateItems([o]);if("persist"===a)return s.info("shown item promoted to persisted activation",{event:e,itemId:o}),this._persistActivation(o),void this._clearActivationTimestamps([o])}if(this._cancelEventToItems.has(e)){var u=this._getMatchingItems(e,t,Vi);u.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:u.map(function(e){return e.id})}),this._deactivateItems(u.map(function(e){return e.id})),u.forEach(function(e){return r._cancelPendingItem(e.id)}))}if(this._eventToItems.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this._eventToItems.get(e)});var l=this._getMatchingItems(e,t,Hi);this._activateItems(l.map(function(e){return e.id}))}},t.onAction=function(e){this._actionToItems.has(e)&&this._activateItems(this._actionToItems.get(e)||[])},t._activateItems=function(e){var t;if(0!==e.length){for(var n,i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),r=[],s=d(e);!(n=s()).done;){var o=n.value;i&&this._shouldPersistArmedActivation(o)?this._persistActivation(o)&&this._recordActivationTimestamp(o):r.push(o)}r.length>0&&(this._pendingActivatedItems=[].concat(new Set([].concat(this._pendingActivatedItems,r)))),this._getLogger().info("updating activated items",{activatedItems:this.getActivatedIds()})}},t._persistActivation=function(e){this._pendingActivatedItems=this._pendingActivatedItems.filter(function(t){return t!==e});var t=this._getPersistedActivatedIds();return!t.includes(e)&&(this._setActivatedItems([].concat(t,[e])),this._stampActivationSession(),!0)},t._deactivateItems=function(e){var t=new Set(e);this._pendingActivatedItems=this._pendingActivatedItems.filter(function(e){return!t.has(e)});var n=this._getRawPersistedActivatedIds(),i=n.filter(function(e){return!t.has(e)});i.length!==n.length&&(this._setActivatedItems(i),0===i.length&&this._clearActivationSession()),this._clearActivationTimestamps(e)},t._getRawActivationTimestamps=function(){var e,t=this._getActivationTimestampsKey();if(!t)return{};var n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return n&&"object"==typeof n?n:{}},t._recordActivationTimestamp=function(e){var t;if(this._getActivationTimestampsKey()){var n=this._getRawActivationTimestamps();this._writeActivationTimestamps(u({},n,((t={})[e]=Date.now(),t)))}},t._clearActivationTimestamps=function(e){if(this._getActivationTimestampsKey()){for(var t=this._getRawActivationTimestamps(),n={},i=!1,r=0,s=Object.entries(t);s.length>r;r++){var o=s[r],a=o[0],u=o[1];e.includes(a)?i=!0:n[a]=u}i&&(Lr(n)?this._clearActivationTimestampsStore():this._writeActivationTimestamps(n))}},t._clearAllActivationTimestamps=function(){this._getActivationTimestampsKey()&&this._clearActivationTimestampsStore()},t.getActivationTimestamp=function(e){if(this._getPersistedActivatedIds().includes(e)){var t=this._getRawActivationTimestamps()[e];return qr(t)?t:void 0}},t._getRawPersistedActivatedIds=function(){var e,t=this._getActivatedKey();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]},t._getPersistedActivatedIds=function(){var e,t,n=this._getRawPersistedActivatedIds();if(0===n.length)return[];var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._getActivatedSessionKey()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&i===r?n:[]},t._stampActivationSession=function(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this._setActivatedSession(t)},t._clearActivationSession=function(){this._clearActivatedSession()},t._onSessionIdChanged=function(e){var t,n=this,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._getActivatedSessionKey()];if(i&&i!==e){var r=this._getRawPersistedActivatedIds(),s=this._getRawActivationTimestamps();r.length>0&&(this._setActivatedItems([]),r.filter(function(e){return qr(s[e])}).forEach(function(e){return n._cancelPendingItem(e)})),this._clearActivationSession(),this._clearAllActivationTimestamps()}},t.getActivatedIds=function(){var e=this;return[].concat(new Set([].concat(this._getPersistedActivatedIds(),this._pendingActivatedItems))).filter(function(t){return!e._isItemPermanentlyIneligible(t)})},t.dispose=function(){var e,t,n;null==(e=this._sessionIdUnsubscribe)||e.call(this),this._sessionIdUnsubscribe=void 0,null==(t=this._captureHookUnsubscribe)||t.call(this),this._captureHookUnsubscribe=void 0,null==(n=this._actionMatcher)||n.dispose(),this._actionMatcher=void 0},t.reset=function(){this._pendingActivatedItems=[],this._getRawPersistedActivatedIds().length>0&&this._setActivatedItems([]),this._clearActivationSession(),this._clearAllActivationTimestamps()},t.getEventToItemsMap=function(){return this._eventToItems},t._getActionMatcher=function(){return this._actionMatcher},e}()),mv=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.initialize=function(){},t.get=function(e){if("string"==typeof e)return this._instance.get_property(e);for(var t,n={},i=d(e);!(t=i()).done;){var r=t.value,s=this._instance.get_property(r);Ar(s)||(n[r]=s)}return n},t.set=function(e,t){var n;this._instance.register("string"==typeof e?((n={})[e]=t,n):e)},t.remove=function(e){var t=this;"string"!=typeof e?e.forEach(function(e){return t._instance.unregister(e)}):this._instance.unregister(e)},e}(),yv=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t.get=function(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}},t.isOptedOut=function(){return this._instance.consent.isOptedOut()},t.getExtensions=function(){var e=this,t=null==ih?void 0:ih.__PosthogExtensions__;if(t){var n=t.generateSurveys,i=t.loadExternalDependency;return{generateSurveys:n?function(t){return n(e._instance,t)}:void 0,loadExternalDependency:i?function(t){return i(e._instance,"surveys",t)}:void 0}}},t.createEventReceiver=function(){return new gv(this._instance)},e}(),bv=function(e){"use strict";function t(t){var n,i=e.call(this,new yv(t),(n=t,{get projectToken(){return n.config.token},kv:new mv(n)}))||this;return i._instance=t,i}return n(t,e),t.prototype._sendSurveysRequest=function(e,t){var n=this,i=t.query?Op(e,t.query):e;return new Promise(function(e){var r;n._instance._send_request({method:t.method,url:n._instance.requestRouter.endpointFor(null!==(r=t.target)&&void 0!==r?r:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})},t}(pv),wv=null!=Fa&&Fa.location?Kl(Fa.location.hash,"__posthog")||Kl(location.hash,"state"):null,Sv="_postHogToolbarParams",xv=ja("[Toolbar]"),kv=function(){"use strict";function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){ih.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=ih.ph_toolbar_state)&&void 0!==e?e:0},t.initialize=function(){return this.maybeLoadToolbar()},t.maybeLoadToolbar=function(e,t,n){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),Ya(this.instance.config))return!1;if(!Fa||!Ra)return!1;e=null!=e?e:Fa.location,n=null!=n?n:Fa.history;try{if(!t){try{Fa.localStorage.setItem("test","test"),Fa.localStorage.removeItem("test")}catch(e){return!1}t=null==Fa?void 0:Fa.localStorage}var i,r=wv||Kl(e.hash,"__posthog")||Kl(e.hash,"state"),s=r?Wa(function(){return JSON.parse(atob(decodeURIComponent(r)))})||Wa(function(){return JSON.parse(decodeURIComponent(r))}):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(Sv)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}},t._callLoadToolbar=function(e){var t=ih.ph_load_toolbar||ih.ph_load_editor;!Dr(t)&&Ir(t)?t(e,this.instance):xv.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Ra||!Ra.getElementById("__POSTHOG_TOOLBAR__"));if(!Fa||n)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=u({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Fa.localStorage.setItem(Sv,JSON.stringify(u({},r,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(r);else if(0===this._getToolbarState()){var s;this._setToolbarState(1),null==(s=ih.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",function(e){if(e)return xv.error("[Toolbar] Failed to load",e),void t._setToolbarState(0);t._setToolbarState(2),t._callLoadToolbar(r)}),Ja(Fa,"turbolinks:load",function(){t._setToolbarState(0),t.loadToolbar(r)})}return!0},t._loadEditor=function(e){return this.loadToolbar(e)},t.maybeLoadEditor=function(e,t,n){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===n&&(n=void 0),this.maybeLoadToolbar(e,t,n)},e}(),Cv=ja("[FeatureFlags]"),Pv=function(){"use strict";function e(e,t){void 0===t&&(t=!1),this._loggedEvaluationEnvironmentsDeprecation=!1,this.update(e,t)}var t=e.prototype;return t.update=function(e,t){this._snapshot=function(e,t){var n,i,r,s,o;return{bootstrap:{featureFlags:null==(n=e.bootstrap)?void 0:n.featureFlags,featureFlagPayloads:null==(i=e.bootstrap)?void 0:i.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(r=e.remote_config_refresh_interval_ms)&&void 0!==r?r:3e5,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(s=null!==(o=e.evaluation_contexts)&&void 0!==o?o:e.evaluation_environments)&&void 0!==s?s:[],flagKeys:Tr(e.flag_keys)?e.flag_keys:void 0}}(e,t),!e.evaluation_environments||e.evaluation_contexts||this._loggedEvaluationEnvironmentsDeprecation||(Cv.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._loggedEvaluationEnvironmentsDeprecation=!0),Ar(e.flag_keys)||Tr(e.flag_keys)||Cv.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")},t.get=function(){return this._snapshot},e}(),Ev=ja("[FeatureFlags]"),Fv=ja("[FeatureFlags]",{debugEnabled:!0}),Tv="\" failed. Feature flags didn't load in time.",Iv="connection_error",Rv=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},Lv=function(e){for(var t,n={},i=d(Ua(e||{}));!(t=i()).done;){var r=t.value,s=r[1];s&&(n[r[0]]=s)}return n},Av=function(){"use strict";function e(e){var t=this;this.name="featureFlags",this._override_warning=!1,this.featureFlagEventHandlers=[],this._logger=Ev,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._reloadingHandlers=[],this._hasLoadedFlags=!1,this._requestInFlight=!1,this._requestGeneration=0,this._reloadingDisabled=!1,this._additionalReloadRequested=!1,this._flagsLoadedFromRemote=!1,this._staleCacheRefreshTriggered=!1,this._consecutiveStatusZeroFailures=0,this._onOnline=function(){var e=t._hasStatusZeroCircuitBreakerTripped();t._consecutiveStatusZeroFailures=0,e&&t.reloadFeatureFlags()},this._refreshIfDue=function(){var e,n=t._refreshIntervalMs;Ar(n)||t._config.remoteRequestsDisabled||!Ra||"hidden"===Ra.visibilityState||Date.now()-(null!==(e=t._lastRefreshAt)&&void 0!==e?e:0)<n||(t.reloadFeatureFlags(),t._scheduleNextRefresh())},this._onVisibilityChange=function(){"visible"===(null==Ra?void 0:Ra.visibilityState)&&t._refreshIfDue()},"get"in e?this._configSource=e:(this._instance=e,this._mutableConfigSource=new Pv(e.config,e._shouldDisableFlags()),this._configSource=this._mutableConfigSource)}var t=e.prototype;return t.updateConfig=function(e,t){var n;null==(n=this._mutableConfigSource)||n.update(e,t),this._client&&this._syncAutomaticRefresh()},t.setup=function(e){var t=this;return this._initializingClient=e,this._logger=e.logger.createLogger("[FeatureFlags]"),dv(e.kv.initialize(),function(){t._initializingClient===e&&(t._initializingClient=void 0,t._client=e,t._finishSetup(e))})},t._finishSetup=function(e){var t,n=this;if(this._client===e)return Fa&&Ja(Fa,"online",this._onOnline),this._syncAutomaticRefresh(),this._dynamicProperties=e.registerDynamicEventProperties(function(){return n._isCacheStale()?n._baseEventProperties:n._eventPropertiesWithFlagValues}),this._crossTabPersistenceUnsubscribe=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange(function(){n._clearBootstrapState(),n._rebuildEventProperties(),n._fireFeatureFlagsCallbacks()}),this._rebuildEventProperties(),this.initialize()},t._syncAutomaticRefresh=function(){var e=this._config.refreshIntervalMs,t=!this._config.remoteRequestsDisabled&&Ra&&!Ar(e)&&e>0?e:void 0;t!==this._refreshIntervalMs&&(this._stopAutomaticRefresh(),Ar(t)||(this._refreshIntervalMs=t,this._scheduleNextRefresh(),null!=Ra&&Ra.addEventListener&&Ja(Ra,Rl,this._onVisibilityChange)))},t._scheduleNextRefresh=function(){Ar(this._refreshIntervalMs)||(Ar(this._refreshInterval)||clearInterval(this._refreshInterval),this._lastRefreshAt=Date.now(),this._refreshInterval=setInterval(this._refreshIfDue,this._refreshIntervalMs))},t._stopAutomaticRefresh=function(){Ar(this._refreshInterval)||(clearInterval(this._refreshInterval),this._refreshInterval=void 0,null==Ra||null==Ra.removeEventListener||Ra.removeEventListener(Rl,this._onVisibilityChange)),this._refreshIntervalMs=void 0,this._lastRefreshAt=void 0},t.destroy=function(){this._dispose()},t.dispose=function(){this._dispose()},t._dispose=function(){var e,t;this._stopAutomaticRefresh(),this._requestGeneration++,this._additionalReloadRequested=!1,this._initializingClient=void 0,this._client&&(this._clearDebouncer(),null==(e=this._dynamicProperties)||e.dispose(),this._dynamicProperties=void 0,null==(t=this._crossTabPersistenceUnsubscribe)||t.call(this),this._crossTabPersistenceUnsubscribe=void 0,this._reloadingHandlers=[],null==Fa||Fa.removeEventListener("online",this._onOnline),this._client=void 0)},t._prop=function(e){var t;return this._bootstrapState&&e in this._bootstrapState?this._bootstrapState[e]:null==(t=this._client)?void 0:t.kv.get(e)},t._clearBootstrapState=function(){return!!this._bootstrapState&&(this._bootstrapState=void 0,!0)},t._fallBackToPersistedFlags=function(){var e;return!Ar(null==(e=this._client)?void 0:e.kv.get("$enabled_feature_flags"))&&this._clearBootstrapState()},t._set=function(e){var t=this;this._persist(function(){var n;return null==(n=t._client)?void 0:n.kv.set(e)})},t._markCrossTabFeatureFlagSnapshot=function(e,t,n){var i,r;if(null!=(i=this._instance)&&i.persistence&&e.$enabled_feature_flags){var s=this._prop("$enabled_feature_flags")||{},o=e.$enabled_feature_flags||{},a=t.flags||t.featureFlags,u=t.flags?Object.entries(t.flags).filter(function(e){var t=e[1];return!(null!=t&&t.failed)}).map(function(e){return e[0]}):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,c=l?u:n&&!Tr(a)?Object.keys(a||{}):Array.from(new Set([].concat(Object.keys(s),Object.keys(o)))),d=this._prop("$feature_flag_payloads")||{},h=e.$feature_flag_payloads||{},f=l||n?c:Array.from(new Set([].concat(Object.keys(d),Object.keys(h)))),p=!l&&!n,_=!!p||c,v=!!p||f,g=((r={})[Ku]=_,r[Gu]=_,r[Ju]=v,r);e.$feature_flag_details&&(g[Zu]=_);for(var m=0,y=[Yu,pl,Xu];y.length>m;m++){var b=y[m];Ar(e[b])||(g[b]=!0)}this._instance.persistence.markCrossTabFeatureFlagChanges(g)}},t._remove=function(e){var t=this;this._persist(function(){var n;return null==(n=t._client)?void 0:n.kv.remove(e)})},t._persist=function(e){try{e()}catch(e){this._logger.error("Failed to update feature flag persistence",e)}},t._rebuildEventProperties=function(){for(var e={},t=0,n=[Ku,Ju,Yu,el];n.length>t;t++){var i=n[t],r=this._prop(i);Ar(r)||(e[i]=r)}this._baseEventProperties=e;var s=u({},e),o=this._prop(Gu);if(o)for(var a=0,l=Object.entries(o);l.length>a;a++){var c=l[a];s["$feature/"+c[0]]=c[1]}this._eventPropertiesWithFlagValues=s},t._isCacheStale=function(){var e=this._config.cacheTtlMs;if(!e||0>=e)return!1;var t=this._prop(pl);return"number"!=typeof t||Date.now()-t>e},t._checkAndTriggerStaleRefresh=function(){return!!this._isCacheStale()&&(this._staleCacheRefreshTriggered||this._requestInFlight||(this._staleCacheRefreshTriggered=!0,this._logger.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)},t._getValidEvaluationEnvironments=function(){var e=this,t=this._config.evaluationContexts;return null!=t&&t.length?t.filter(function(t){var n=t&&"string"==typeof t&&t.trim().length>0;return n||e._logger.error("Invalid evaluation context found:",t,"Expected non-empty string"),n}):[]},t._getValidFlagKeys=function(){var e=this,t=this._config.flagKeys;if(!Ar(t))return t.filter(function(t){var n=t&&"string"==typeof t&&t.trim().length>0;return n||e._logger.error("Invalid flag key found:",t,"Expected non-empty string"),n})},t.initialize=function(){var e,t,n=this._config,i=null!==(e=null==(t=n.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var r,s,o=null!==(r=null==(s=n.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==r?r:{},a=Object.keys(i).filter(function(e){return!Ar(i[e])}).reduce(function(e,t){return e[t]=i[t],e},{}),u=Object.keys(o).filter(function(e){return a[e]}).reduce(function(e,t){return e[t]=o[t],e},{});return this._receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u},void 0,{persist:!1})}},t.updateFlags=function(e,t,n){for(var i,r,s=null!=n&&n.merge&&null!==(i=this._prop("$enabled_feature_flags"))&&void 0!==i?i:{},o=null!=n&&n.merge&&null!==(r=this._prop("$feature_flag_payloads"))&&void 0!==r?r:{},a=u({},s,e),l=u({},o,t),c={},d=0,h=Object.entries(a);h.length>d;d++){var f=h[d],p=f[0],_=f[1];c[p]={key:p,enabled:Go(_),variant:Ko(_),reason:void 0,metadata:Ar(null==l?void 0:l[p])?void 0:{id:0,version:void 0,description:void 0,payload:l[p]}}}this._receivedFeatureFlags({flags:c})},t.getFlags=function(){return Object.keys(this.getFlagVariants())},t.getFlagsWithDetails=function(){var e=this._prop(Zu),t=this._prop(el),n=this._prop(tl);if(!n&&!t)return e||{};for(var i,r=za({},e||{}),s=d([].concat(new Set([].concat(Object.keys(n||{}),Object.keys(t||{})))));!(i=s()).done;){var o,a,l=i.value,c=r[l],h=null==t?void 0:t[l],f=Ar(h)?null!==(o=null==c?void 0:c.enabled)&&void 0!==o&&o:!!h,p=Ar(h)?null==c?void 0:c.variant:"string"==typeof h?h:void 0,_=null==n?void 0:n[l],v=u({},c,{enabled:f,variant:f?null!=p?p:null==c?void 0:c.variant:void 0});f!==(null==c?void 0:c.enabled)&&(v.original_enabled=null==c?void 0:c.enabled),p!==(null==c?void 0:c.variant)&&(v.original_variant=null==c?void 0:c.variant),_&&(v.metadata=u({},null==c?void 0:c.metadata,{payload:_,original_payload:null==c||null==(a=c.metadata)?void 0:a.payload})),r[l]=v}return this._override_warning||(this._logger.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this._override_warning=!0),r},t.getAllFeatureFlags=function(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(function(n){var i=e[n];return{key:n,enabled:Go(i),variant:Ko(i),payload:Wo(t[n])}})},t.getFlagVariants=function(){var e=this._prop(Gu),t=this._prop(el);if(!t)return e||{};for(var n=za({},e||{}),i=Object.keys(t),r=0;i.length>r;r++)n[i[r]]=t[i[r]];return this._override_warning||(this._logger.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n},t.getFlagPayloads=function(){var e=this._prop(Ju),t=this._prop(tl);if(!t)return e||{};for(var n=za({},e||{}),i=Object.keys(t),r=0;i.length>r;r++)n[i[r]]=t[i[r]];return this._override_warning||(this._logger.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this._override_warning=!0),n},t.reloadFeatureFlags=function(){var e=this;this._reloadingDisabled||this._config.featureFlagsDisabled||this._hasStatusZeroCircuitBreakerTripped()||(this._requestInFlight&&(this._additionalReloadRequested=!0),this._reloadDebouncer||(this._reloadingHandlers.slice().forEach(function(t){try{t()}catch(t){e._logger.error("Error while running feature flags reloading callback",t)}}),this._reloadDebouncer=setTimeout(function(){e._callFlagsEndpoint()},5)))},t._clearDebouncer=function(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0},t.onReloading=function(e){var t=this;return this._reloadingHandlers.push(e),function(){t._reloadingHandlers=t._reloadingHandlers.filter(function(t){return t!==e})}},t.ensureFlagsLoaded=function(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()},t.setAnonymousDistinctId=function(e){this.$anon_distinct_id=e},t.setReloadingPaused=function(e){this._reloadingDisabled=e},t.resetFlagCallReported=function(){this._remove(dl)},t._callFlagsEndpoint=function(e){var t=this;this._clearDebouncer();var n=this._client;if(n&&!this._config.remoteRequestsDisabled&&!this._hasStatusZeroCircuitBreakerTripped())if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i={token:n.projectToken,distinct_id:n.distinctId,groups:n.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:u({},n.initialPersonProperties,this._prop("$stored_person_properties")||{},{$lib:n.library.name,$lib_version:n.library.version}),group_properties:this._prop(il),timezone:qd()};Ar(n.deviceId)||(i.$device_id=n.deviceId),(null!=e&&e.disableFlags||this._config.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this._getValidEvaluationEnvironments();r.length&&(i.evaluation_contexts=r);var s=this._getValidFlagKeys();Ar(s)||(i.flag_keys=s);var o=this._config.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this._requestGeneration;this._requestInFlight=!0;var c=function(){t._additionalReloadRequested&&(t._additionalReloadRequested=!1,t._callFlagsEndpoint())},d=function(e){var n;t._requestInFlight=!1,l===t._requestGeneration?(t._set(((n={})[fl]=[Iv],n)),t._logger.error("Feature flag request failed",e),t._fallBackToPersistedFlags()&&t._fireFeatureFlagsCallbacks(!0),c()):c()};try{n.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this._config.compression,sentAt:"body",timeoutMs:this._config.requestTimeoutMs}).then(function(e){var n,r,s,a=null!==(n=e.json)&&void 0!==n?n:{},u=200!==e.statusCode;if(t._requestInFlight=!1,l===t._requestGeneration){if(t._trackStatusZeroReachability(e.statusCode),u||t._additionalReloadRequested||(t.$anon_distinct_id=void 0),!i.disable_flags||t._additionalReloadRequested){t._flagsLoadedFromRemote=!u;var d=[];e.error?d.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?Iv:"unknown_error"):200!==e.statusCode&&d.push("api_error_"+e.statusCode),a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var h=!(null==(r=a.quotaLimited)||!r.includes("feature_flags"));h&&d.push("quota_limited"),t._set(((s={})[fl]=d,s)),h?t._logger.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."):i.disable_flags||t._receivedFeatureFlags(a,u,{partialResponse:o}),c()}}else c()}).catch(d)}catch(e){d(e)}}},t._hasStatusZeroCircuitBreakerTripped=function(){return Ql(this._consecutiveStatusZeroFailures,3)},t._trackStatusZeroReachability=function(e){var t=this;this._consecutiveStatusZeroFailures=Zl(e,this._consecutiveStatusZeroFailures,3,function(){return t._logger.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")})},t.getFeatureFlag=function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var i=this.getFeatureFlagResult(e,t);return null!==(n=null==i?void 0:i.variant)&&void 0!==n?n:null==i?void 0:i.enabled}}else this._logger.warn('getFeatureFlag for key "'+e+Tv)},t.getFeatureFlagDetails=function(e){return this.getFlagsWithDetails()[e]},t.getFeatureFlagPayload=function(e){var t;return null==(t=this.getFeatureFlagResult(e,{send_event:!1}))?void 0:t.payload},t.getFeatureFlagResult=function(e,t){var n;if(void 0===t&&(t={}),!t.fresh||this._flagsLoadedFromRemote)if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){if(!this._checkAndTriggerStaleRefresh()){var i,r,s=this.getFlagVariants(),o=e in s,a=s[e],l=this.getFlagPayloads()[e],c=String(a),d=this._prop("$feature_flag_request_id")||void 0,h=this._prop("$feature_flag_evaluated_at")||void 0,f=this._prop("$flag_call_reported")||{};if(this._config.deduplicateCallsPerSession){var p,_=null==(p=this._client)?void 0:p.session.sessionId,v=this._prop(hl);_&&_!==v&&(f={},i=_)}if(t.send_event||!("send_event"in t))if(e in f&&f[e].includes(c))i&&this._set(((r={})[dl]=f,r[hl]=i,r));else{var g,m,y,b,w,S,x,k,C,P,E,F,T,I,R;Tr(f[e])?f[e].push(c):f[e]=[c],this._set(u(((g={})[dl]=f,g),i?((m={})[hl]=i,m):{}));var L=this.getFeatureFlagDetails(e),A=[].concat(null!==(y=this._prop("$feature_flag_errors"))&&void 0!==y?y:[]);Ar(a)&&A.push("flag_missing");var O={$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:null!=l?l:null,$feature_flag_request_id:d,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!==(b=null==(w=this._config.bootstrap)||null==(w=w.featureFlags)?void 0:w[e])&&void 0!==b?b:null,$feature_flag_bootstrapped_payload:null!==(S=null==(x=this._config.bootstrap)||null==(x=x.featureFlagPayloads)?void 0:x[e])&&void 0!==S?S:null,$used_bootstrap_value:!this._flagsLoadedFromRemote};Ar(null==L||null==(k=L.metadata)?void 0:k.has_experiment)||(O.$feature_flag_has_experiment=L.metadata.has_experiment),Ar(null==L||null==(C=L.metadata)?void 0:C.version)||(O.$feature_flag_version=L.metadata.version);var M=null!==(P=null==L||null==(E=L.reason)?void 0:E.description)&&void 0!==P?P:null==L||null==(F=L.reason)?void 0:F.code;M&&(O.$feature_flag_reason=M),null!=L&&null!=(T=L.metadata)&&T.id&&(O.$feature_flag_id=L.metadata.id),Ar(null==L?void 0:L.original_variant)&&Ar(null==L?void 0:L.original_enabled)||(O.$feature_flag_original_response=Ar(L.original_variant)?L.original_enabled:L.original_variant),null!=L&&null!=(I=L.metadata)&&I.original_payload&&(O.$feature_flag_original_payload=null==L||null==(R=L.metadata)?void 0:R.original_payload),A.length&&(O.$feature_flag_error=A.join(",")),this._captureFeatureFlagCalled(O)}else i&&this._set(((n={})[dl]=f,n[hl]=i,n));if(o)return{key:e,enabled:!!a,variant:"string"==typeof a?a:void 0,payload:Wo(l)}}}else this._logger.warn('getFeatureFlagResult for key "'+e+Tv)},t._captureFeatureFlagCalled=function(e){var t=this;try{var n;null==(n=this._client)||n.capture("$feature_flag_called",e).catch(function(e){t._logger.error("Failed to capture feature flag call",e)})}catch(e){this._logger.error("Failed to capture feature flag call",e)}},t.getRemoteConfigPayload=function(e,t){this._getRemoteConfigPayload(e,t)},t._getRemoteConfigPayload=function(){var e=p(l().m(function e(t,n){var i,r,s,o,a,u,c,d,h,f;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=this._client){e.n=1;break}return e.a(2);case 1:return r={distinct_id:i.distinctId,token:i.projectToken,person_properties:{$lib:i.library.name,$lib_version:i.library.version}},(s=this._getValidEvaluationEnvironments()).length&&(r.evaluation_contexts=s),o=this._getValidFlagKeys(),Ar(o)||(r.flag_keys=o),e.p=2,e.n=3,i.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:this._config.compression,sentAt:"body",timeoutMs:this._config.requestTimeoutMs});case 3:if(h=u=e.v.json,d=null==h){e.n=4;break}d=null==(u=u.featureFlagPayloads);case 4:if(!d){e.n=5;break}f=void 0,e.n=6;break;case 5:f=u[t];case 6:if(c=f){e.n=7;break}c=void 0;case 7:a=c,e.n=9;break;case 8:return e.p=8,this._logger.error("Remote config feature flag request failed",e.v),e.a(2);case 9:try{n(a)}catch(e){this._logger.error("Remote config feature flag callback failed",e)}case 10:return e.a(2)}},e,this,[[2,8]])}));return function(t,n){return e.apply(this,arguments)}}(),t.isFeatureEnabled=function(e,t){if(void 0===t&&(t={}),t.fresh&&!this._flagsLoadedFromRemote)return t.defaultValue;if(!(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0))return this._logger.warn('isFeatureEnabled for key "'+e+Tv),t.defaultValue;var n=this.getFeatureFlag(e,t);return Ar(n)?t.defaultValue:!!n},t.addFeatureFlagsHandler=function(e){this.featureFlagEventHandlers.push(e)},t.removeFeatureFlagsHandler=function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})},t.receivedFeatureFlags=function(e,t,n){this._receivedFeatureFlags(e,t,n)},t._receivedFeatureFlags=function(e,t,n){if(this._client){this._hasLoadedFlags=!0;var i=function(e,t,n,i,r,s){var o,a,l;void 0===t&&(t={}),void 0===n&&(n={}),void 0===i&&(i={}),void 0===s&&(s=Ev);var c=function(e,t){var n=e.flags;return n?u({},e,{featureFlags:Object.fromEntries(Object.keys(n).map(function(e){var t;return[e,null!==(t=n[e].variant)&&void 0!==t?t:n[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(n).filter(function(e){return n[e].enabled}).filter(function(e){var t;return!Ar(null==(t=n[e].metadata)?void 0:t.payload)}).map(function(e){var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)}(e,s),d=c.flags,h=c.featureFlags,f=c.featureFlagPayloads;if(h){var p=e.requestId,_=e.evaluatedAt;if(Tr(h)){var v;s.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var g={};if(h)for(var m=0;h.length>m;m++)g[h[m]]=!0;return(v={})[Ku]=h,v[Gu]=g,v[Xu]=!1,v}var y=h,b=f,w=d;if(null!=r&&r.partialResponse){var S=Object.keys(y),x=b||{};y=u({},t,y),b=u({},n,x),S.forEach(function(e){var t;e in x||null==(t=b)||delete t[e]}),w=u({},i,w)}else if(e.errorsWhileComputingFlags)if(d){var k=new Set(Object.keys(d).filter(function(e){var t;return!(null!=(t=d[e])&&t.failed)}));y=u({},t,Object.fromEntries(Object.entries(y).filter(function(e){return k.has(e[0])})));var C=Object.fromEntries(Object.entries(b||{}).filter(function(e){return k.has(e[0])}));b=u({},n,C),k.forEach(function(e){var t;e in C||null==(t=b)||delete t[e]}),w=u({},i,Object.fromEntries(Object.entries(w||{}).filter(function(e){return k.has(e[0])})))}else y=u({},t,y),b=u({},n,b),w=u({},i,w);return u(((o={})[Ku]=Object.keys(Lv(y)),o[Gu]=y||{},o[Ju]=b||{},o[Zu]=w||{},o[Xu]=!0===e.minimalFlagCalledEvents,o),p?((a={})[Yu]=p,a):{},_?((l={})[pl]=_,l):{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this._logger);if(i)if(!1===(null==n?void 0:n.persist)){var r=!Ar(this._client.kv.get(Gu));this._bootstrapState=i,r||this._set(i)}else this._clearBootstrapState(),this._markCrossTabFeatureFlagSnapshot(i,e,!(null==n||!n.partialResponse)),this._set(i);else t&&this._fallBackToPersistedFlags();t||(this._staleCacheRefreshTriggered=!1),this._fireFeatureFlagsCallbacks(t)}},t.override=function(e,t){void 0===t&&(t=!1),this._logger.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})},t.overrideFeatureFlags=function(e){this._overrideFeatureFlags(e)},t._overrideFeatureFlags=function(e){if(this._client){if(!1===e)return this._remove([el,tl]),this._fireFeatureFlagsCallbacks(),void Fv.info("All overrides cleared");var t,n;if(Tr(e))return this._set(((t={})[el]=Rv(e),t)),this._fireFeatureFlagsCallbacks(),void Fv.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var i,r=e;this._override_warning=Boolean(null!==(i=r.suppressWarning)&&void 0!==i&&i);var s={},o=r.flags,a=r.payloads;return o&&(s[el]=Tr(o)?Rv(o):o),a&&(s[tl]=a),Object.keys(s).length&&this._set(s),!1===o&&!1===a?this._remove([el,tl]):!1===o?this._remove(el):!1===a&&this._remove(tl),this._fireFeatureFlagsCallbacks(),!1===o?Fv.info("Flag overrides cleared"):o&&Fv.info("Flag overrides set",{flags:o}),void(!1===a?Fv.info("Payload overrides cleared"):a&&Fv.info("Payload overrides set",{payloads:a}))}if(e&&"object"==typeof e)return this._set(((n={})[el]=e,n)),this._fireFeatureFlagsCallbacks(),void Fv.info("Flag overrides set",{flags:e});this._logger.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this._logger.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")},t.onFeatureFlags=function(e){var t=this;if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,r=n.flagVariants;try{e(i,r)}catch(e){this._logger.error("Error while running feature flags callback",e)}}return function(){return t.removeFeatureFlagsHandler(e)}},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var i,r,s,o,a,l=this,c=(this._prop("$early_access_features")||[]).find(function(t){return t.flagKey===e}),d=((i={})["$feature_enrollment/"+e]=t,i),h={$feature_flag:e,$feature_enrollment:t,$set:d};c&&(h.$early_access_feature_name=c.name),n&&(h.$feature_enrollment_stage=n);var f=u({},this.getFlagVariants(),((r={})[e]=t,r));null==(s=this._instance)||null==(s=s.persistence)||s.markCrossTabFeatureFlagChanges(((o={})[Ku]=[e],o[Gu]=[e],o[nl]=Object.keys(d),o)),this._set(((a={})[Ku]=Object.keys(Lv(f)),a[Gu]=f,a[nl]=u({},this._prop("$stored_person_properties")||{},d),a)),this._fireFeatureFlagsCallbacks();try{var p;null==(p=this._client)||p.capture("$feature_enrollment_update",h).catch(function(e){l._logger.error("Failed to capture early access feature enrollment",e)})}catch(e){this._logger.error("Failed to capture early access feature enrollment",e)}},t.getEarlyAccessFeatures=function(e,t,n){void 0===t&&(t=!1);var i=this._prop(Qu);!i||t?this._getEarlyAccessFeatures(e,n):e(i)},t._getEarlyAccessFeatures=function(){var e=p(l().m(function e(t,n){var i,r,s,o,a;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=this._client){e.n=1;break}return e.a(2);case 1:return r=n?"&"+n.map(function(e){return"stage="+e}).join("&"):"",e.p=2,e.n=3,i.sendRequest("/api/early_access_features/?token="+i.projectToken+r,{target:"api",method:"GET",sentAt:"query"});case 3:if((a=e.v).json){e.n=4;break}return e.a(2);case 4:this._set(((o={})[Qu]=s=a.json.earlyAccessFeatures,o)),e.n=6;break;case 5:return e.p=5,this._logger.error("Early access feature request failed",e.v),e.a(2);case 6:try{t(s)}catch(e){this._logger.error("Early access feature callback failed",e)}case 7:return e.a(2)}},e,this,[[2,5]])}));return function(t,n){return e.apply(this,arguments)}}(),t._prepareFeatureFlagsForCallbacks=function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(e){return t[e]}),flagVariants:Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{})}},t._fireFeatureFlagsCallbacks=function(e){var t=this;this._rebuildEventProperties();var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,r=n.flagVariants;this.featureFlagEventHandlers.forEach(function(n){try{n(i,r,{errorsLoading:e})}catch(e){t._logger.error("Error while running feature flags callback",e)}})},t.setPersonPropertiesForFlags=function(e,t){void 0===t&&(t=!0),this._setPersonPropertiesForFlags(e,t)},t._setPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var i=this._prop("$stored_person_properties")||{},r=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._set(((n={})[nl]=u({},i,o,r),n)),t&&this.reloadFeatureFlags()},t.unsetPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var i=u({},this._prop("$stored_person_properties")||{});e.forEach(function(e){delete i[e]}),this._set(((n={})[nl]=i,n)),t&&this.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(e){void 0===e&&(e=!0),this._remove(nl),e&&this.reloadFeatureFlags()},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);for(var i=this._prop("$stored_group_properties")||{},r=u({},i),s=0,o=Object.keys(e);o.length>s;s++){var a=o[s];r[a]=u({},i[a],e[a])}this._set(((n={})[il]=r,n)),t&&this.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,i=this._prop("$stored_group_properties")||{};this._set(((n={})[il]=u({},i,((t={})[e]={},t)),n))}else this._remove(il)},t.reset=function(){this._requestGeneration++,this._additionalReloadRequested=!1,this._baseEventProperties={},this._eventPropertiesWithFlagValues={},this._bootstrapState=void 0,this._hasLoadedFlags=!1,this._reloadingDisabled=!1,this._flagsLoadedFromRemote=!1,this.$anon_distinct_id=void 0,this._clearDebouncer(),this._override_warning=!1,this._consecutiveStatusZeroFailures=0},o(e,[{key:"_config",get:function(){return this._configSource.get()}},{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}}])}(),Ov="Refusing to render web experiment since the viewer is a likely bot",Mv={icontains:function(e,t){return t.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return-1===t.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return cu(t,e)},not_regex:function(e,t){return!cu(t,e)},exact:function(e,t){return t===e},is_not:function(e,t){return t!==e}},$v=function(){"use strict";function e(t){var n=this;this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),n.getWebExperiments(function(t){e._logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,t.forEach(function(t){if(t.feature_flag_key){var i;n._flagToExperiments&&(e._logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=n._flagToExperiments)||i.set(t.feature_flag_key,t));var r=n._instance.getFeatureFlag(t.feature_flag_key);Or(r)&&t.variants[r]&&n._applyTransforms(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var s in t.variants){var o=t.variants[s];e._matchesTestVariant(o,n._instance)&&n._applyTransforms(t.name,s,o.transforms)}})},t)},this._instance.onFeatureFlags(function(e){n.onFeatureFlags(e)})}var t=e.prototype;return t.initialize=function(){},t.onFeatureFlags=function(t){var n=this;if(this._is_bot())e._logInfo(Ov);else if(!this._config.disable_web_experiments){if(Dr(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e._logInfo("applying feature flags",t),t.forEach(function(e){var t;if(n._flagToExperiments&&null!=(t=n._flagToExperiments)&&t.has(e)){var i,r=n._instance.getFeatureFlag(e),s=null==(i=n._flagToExperiments)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&n._applyTransforms(s.name,r,s.variants[r].transforms)}})}},t.previewWebExperiment=function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var i=Wl(null==n?void 0:n.search,"__experiment_id"),r=Wl(null==n?void 0:n.search,"__experiment_variant");i&&r&&(e._logInfo("previewing web experiments "+i+" && "+r),this.getWebExperiments(function(e){t._showPreviewWebExperiment(parseInt(i),r,e)},!1,!0))}},t.loadIfEnabled=function(){this._config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()},t.getWebExperiments=function(e,t,n){if(this._config.disable_web_experiments&&!n)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._config.token),method:"GET",timestampMode:"query",callback:function(t){return e(200===t.statusCode&&t.json&&t.json.experiments||[])}})},t._showPreviewWebExperiment=function(t,n,i){var r=i.filter(function(e){return e.id===t});r&&r.length>0&&(e._logInfo("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this._applyTransforms(r[0].name,n,r[0].variants[n].transforms))},e._matchesTestVariant=function(t,n){return!Dr(t.conditions)&&e._matchUrlConditions(t,n)&&e._matchUTMConditions(t)},e._matchUrlConditions=function(t,n){var i;if(Dr(t.conditions)||Dr(null==(i=t.conditions)?void 0:i.url))return!0;var r=e.getWindowLocation();if(r){var s,o,a,u=Yl(n,r.href);return null==(s=t.conditions)||!s.url||Mv[null!==(o=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==o?o:"icontains"](t.conditions.url,u)}return!1},e.getWindowLocation=function(){return null==Fa?void 0:Fa.location},e._matchUTMConditions=function(e){var t;if(Dr(e.conditions)||Dr(null==(t=e.conditions)?void 0:t.utm))return!0;var n=Id();if(n.utm_source){var i,r,s,o,a,u,l,c,d=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==n.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)==n.utm_source,f=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==n.utm_medium,p=null==(l=e.conditions)||null==(l=l.utm)||!l.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==n.utm_term;return d&&f&&p&&h}return!1},e._logInfo=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];Na.info("[WebExperiments] "+e,n)},t._applyTransforms=function(t,n,i){this._is_bot()?e._logInfo(Ov):"control"!==n?i.forEach(function(i){var r;i.selector&&(e._logInfo("applying transform of variant "+n+" for experiment "+t+" ",i),null==(r=document)||null==(r=r.querySelectorAll(i.selector))||r.forEach(function(e){var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)}))}):e._logInfo("Control variants leave the page unmodified.")},t._is_bot=function(){return Ia&&this._instance?e_(Ia,this._config.custom_blocked_useragents):void 0},o(e,[{key:"_config",get:function(){return this._instance.config}}])}(),Dv=ja("[Conversations]"),qv="Conversations not available yet.",Bv=function(){"use strict";function e(e){this._instance=e,this._isConversationsEnabled=void 0,this._conversationsManager=null,this._isInitializing=!1,this._remoteConfig=null,this._loadFailed=!1}var t=e.prototype;return t.initialize=function(){this.loadIfEnabled()},t.onRemoteConfig=function(e){if(!this._instance.config.disable_conversations&&(this._remoteConfigSuccessful=e.ok,e.ok)){var t=e.config.conversations;Dr(t)||(Nr(t)?this._isConversationsEnabled=t:(this._isConversationsEnabled=t.enabled,this._remoteConfig=t),this.loadIfEnabled())}},t.reset=function(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this._isConversationsEnabled=void 0,this._remoteConfig=null,this._remoteConfigSuccessful=void 0,this._loadFailed=!1},t.loadIfEnabled=function(){var e=this;if(!(this._conversationsManager||this._isInitializing||this._instance.config.disable_conversations||Ya(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==ih?void 0:ih.__PosthogExtensions__;if(t&&!Ar(this._isConversationsEnabled)&&this._isConversationsEnabled)if(this._remoteConfig&&this._remoteConfig.token){this._isInitializing=!0;try{var n=t.initConversations;if(n)return this._completeInitialization(n),void(this._isInitializing=!1);var i=t.loadExternalDependency;if(!i)return void this._handleLoadError(El);i(this._instance,"conversations",function(n){n||!t.initConversations?e._handleLoadError("Could not load conversations script",n):e._completeInitialization(t.initConversations),e._isInitializing=!1})}catch(e){this._handleLoadError("Error initializing conversations",e),this._isInitializing=!1}}else Dv.error("Conversations enabled but missing token in remote config.")}},t._completeInitialization=function(e){if(this._remoteConfig)try{this._conversationsManager=e(this._remoteConfig,this._instance),this._loadFailed=!1,Dv.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else Dv.error("Cannot complete initialization: remote config is null")},t._handleLoadError=function(e,t){Dv.error(e,t),this._conversationsManager=null,this._isInitializing=!1,this._loadFailed=!0},t.show=function(){this._conversationsManager?this._conversationsManager.show():Dv.warn("Conversations not loaded yet.")},t.hide=function(){this._conversationsManager&&this._conversationsManager.hide()},t.isAvailable=function(){return!0===this._isConversationsEnabled&&!$r(this._conversationsManager)},t.getUnavailableReason=function(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Ya(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this._remoteConfigSuccessful?"remote_config_failed":Ar(this._isConversationsEnabled)?this._remoteConfigSuccessful?"disabled_in_project":"remote_config_pending":this._isConversationsEnabled?Dr(this._remoteConfig)||!this._remoteConfig.token?"missing_token":null!=ih&&ih.__PosthogExtensions__?this._isInitializing?"initializing":this._loadFailed?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"},t.isVisible=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e},t.sendMessage=function(){var e=p(l().m(function e(t,n,i){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Dv.warn(qv),e.a(2,null);case 1:return e.a(2,this._conversationsManager.sendMessage(t,n,i))}},e,this)}));return function(t,n,i){return e.apply(this,arguments)}}(),t.getMessages=function(){var e=p(l().m(function e(t,n){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Dv.warn(qv),e.a(2,null);case 1:return e.a(2,this._conversationsManager.getMessages(t,n))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}(),t.markAsRead=function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Dv.warn(qv),e.a(2,null);case 1:return e.a(2,this._conversationsManager.markAsRead(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.getTickets=function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Dv.warn(qv),e.a(2,null);case 1:return e.a(2,this._conversationsManager.getTickets(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.requestRestoreLink=function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Dv.warn(qv),e.a(2,null);case 1:return e.a(2,this._conversationsManager.requestRestoreLink(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.restoreFromToken=function(){var e=p(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Dv.warn(qv),e.a(2,null);case 1:return e.a(2,this._conversationsManager.restoreFromToken(t))}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.restoreFromUrlToken=function(){var e=p(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return Dv.warn(qv),e.a(2,null);case 1:return e.a(2,this._conversationsManager.restoreFromUrlToken())}},e,this)}));return function(){return e.apply(this,arguments)}}(),t.getCurrentTicketId=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null},t.getWidgetSessionId=function(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null},t._onIdentityChanged=function(){var e;null==(e=this._conversationsManager)||e.setIdentity()},t._onIdentityCleared=function(){var e;null==(e=this._conversationsManager)||e.clearIdentity()},e}();function Nv(e,t){var n,i,r,s,o,a,l,c=null!==(n=null==e?void 0:e.flushIntervalMs)&&void 0!==n?n:3e3,d=null!==(i=null==e?void 0:e.maxBufferSize)&&void 0!==i?i:100,h=null!=t&&t.consoleCapture?void 0:null!==(r=null==e?void 0:e.maxLogsPerInterval)&&void 0!==r?r:1e3,f=Ar(h)?Math.max(d,2048):Math.max(d,h),p=u({},function(){var e="",t="";try{var n=null==Ia?void 0:Ia.userAgent;if(n){var i=Js(n);e=i[0],t=i[1]}}catch(e){}return function(e,t){var n=function(e){if(e)return{}.hasOwnProperty.call(ha,e)?ha[e]:e}(e);return u({},n?{"os.name":n}:{},t?{"os.version":t}:{})}(e,t)}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!==(s=null!==(o=null==p?void 0:p["service.name"])&&void 0!==o?o:null==e?void 0:e.serviceName)&&void 0!==s?s:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(a=null==p?void 0:p["service.version"])&&void 0!==a?a:null==e?void 0:e.serviceVersion,environment:null!==(l=null==p?void 0:p["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:c,maxBufferSize:d,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:c,maxLogsPerInterval:h,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var jv=["debug","log","warn","error","info"],Hv="console",Vv="__posthogHandledLogsRequestError",zv=function(e,t){var n=e instanceof Error?e:new Error(t);return n[Vv]=!0,n},Uv=function(e){return!!e&&"object"==typeof e&&!0===e[Vv]},Wv=function(){"use strict";function e(e){var t,n=this;this._instance=e,this.name="logs",this._isLogsEnabled=!1,this._isLoaded=!1,this._isLoading=!1,this._logger=ja("[logs]"),this._coreLogger=u({},this._logger,{error:function(){for(var e,t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];i.some(Uv)||(e=n._logger).error.apply(e,i)}}),this._queue=[],this._consoleQueue=[],this._consecutiveStatusZeroFailures=0,this._disposed=!1,this._consoleBuffer=[],this._consoleRecorderUnpatchers=[],this._isRecordingConsole=!1,this._isRecordingConsoleEntry=!1,this._onReconnect=function(){var e,t;n._disposed||(n._consecutiveStatusZeroFailures=0,null==(e=n._core)||e.onReconnect(),null==(t=n._consoleCore)||t.onReconnect())},this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),Fa&&Ja(Fa,"online",this._onReconnect)}var t=e.prototype;return t._buildCore=function(e,t,n,i){var r,s=this,o=Nv(null==(r=this._instance)||null==(r=r.config)?void 0:r.logs,n);return[new ya(this._createHost(e,t),o,this._coreLogger,function(){return s._getSdkContext()},function(e){return e()},void 0,i),o]},t._getCore=function(){var e,t=this,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._core||this._resolvedFrom!==n){var i;null==(i=this._core)||i.reset(),this._resolvedFrom=n;var r=this._buildCore(function(){return t._queue},function(e){t._queue=e});this._core=r[0],this._resolvedConfig=r[1]}return this._core},t._getConsoleCore=function(){var e,t=this,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this._consoleCore||this._consoleResolvedFrom!==n){var i;null==(i=this._consoleCore)||i.reset(),this._consoleResolvedFrom=n;var r=this._buildCore(function(){return t._consoleQueue},function(e){t._consoleQueue=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Hv);this._consoleCore=r[0],this._consoleResolvedConfig=r[1]}return this._consoleCore},t.setup=function(e){var t,n=this;if(!this._disposed){this._client=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this._isLogsEnabled=!0),(this._isLogsEnabled||this._remoteConfigWillArrive()&&this._persistedCaptureHint())&&this._startConsoleRecorder();var i=!1,r=e.onRemoteConfig(function(e){var t;i=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),n.onRemoteConfig(e)});this._disposed?r.dispose():(this._remoteConfigSubscription=r,i||this.loadIfEnabled())}},t.dispose=function(){var e,t,n,i;this._disposed||(this._disposed=!0,this._stopConsoleRecorder(),null==(e=this._remoteConfigSubscription)||e.dispose(),this._remoteConfigSubscription=void 0,this._client=void 0,this._isLoading=!1,null==Fa||Fa.removeEventListener("online",this._onReconnect),null==(t=this._consoleLogsDispose)||t.call(this),this._consoleLogsDispose=void 0,null==(n=this._core)||n.reset(),null==(i=this._consoleCore)||i.reset())},t.onRemoteConfig=function(e){var t,n,i;if(!this._disposed){var r=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;Dr(r)?this._stopRecorderStartedByPersistedHint():(null==(n=this._instance)||null==(n=n.persistence)||n.register(((i={})[Du]=!!r,i)),r?(this._isLogsEnabled=!0,this._isLoaded||this._startConsoleRecorder(),this.loadIfEnabled()):this._stopRecorderStartedByPersistedHint())}},t.reset=function(){var e,t,n,i;this._stopConsoleRecorder(),null==(e=this._core)||e.clearQueue(),this._queue=[],null==(t=this._core)||t.reset(),null==(n=this._consoleCore)||n.clearQueue(),this._consoleQueue=[],null==(i=this._consoleCore)||i.reset(),this._consecutiveStatusZeroFailures=0},t.captureLog=function(e){this._disposed||this._getCore().captureLog(e)},t.captureConsoleLog=function(e){this._disposed||this._getConsoleCore().captureLog(e)},t.captureBufferedConsoleLog=function(e,t,n){this._disposed||this._getConsoleCore().captureLog(e,{context:t,occurredAtMs:n})},t._persistedCaptureHint=function(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[Du])},t._remoteConfigWillArrive=function(){var e,t;return null==(e=this._instance)||null==e._shouldDisableFlags||!e._shouldDisableFlags()||!(null==(t=ih._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)},t._onOptOut=function(){var e;this._stopConsoleRecorder(),null==(e=this._consoleCore)||e.clearQueue(),this._consoleQueue=[]},t._stopRecorderStartedByPersistedHint=function(){this._isLogsEnabled||this._stopConsoleRecorder()},t._startConsoleRecorder=function(){var e,t=this;if(!this._isRecordingConsole&&null!=ih&&ih.console){for(var n=Nv(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,i=function(){var e,i=s[r];try{e=function(e){for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e}(ih.console[i])}catch(e){return 0}if(!e)return 0;t._consoleRecorderUnpatchers.push(kh(ih.console,i,function(r){var s=function(){for(var e=arguments.length,s=new Array(e),o=0;e>o;o++)s[o]=arguments[o];try{t._recordConsoleEntry(i,s,n)}catch(e){}return r.apply(ih.console,s)};return s.__rrweb_original__=e,s}))},r=0,s=jv;s.length>r;r++)i();this._isRecordingConsole=!0,this._consoleRecorderTimeout=setTimeout(function(){t._stopConsoleRecorder()},3e4)}},t._recordConsoleEntry=function(e,t,n){var i;if(this._isRecordingConsole&&!this._isRecordingConsoleEntry&&0!==t.length)if(null!=(i=this._instance)&&i.is_capturing()){if(n>this._consoleBuffer.length){this._isRecordingConsoleEntry=!0;try{this._consoleBuffer.push({level:e,args:t,occurredAtMs:Date.now(),context:this._getSdkContext()})}finally{this._isRecordingConsoleEntry=!1}}}else this._stopConsoleRecorder()},t._stopConsoleRecorder=function(){if(this._consoleBuffer=[],this._isRecordingConsole){this._isRecordingConsole=!1,this._consoleRecorderTimeout&&(clearTimeout(this._consoleRecorderTimeout),this._consoleRecorderTimeout=void 0);for(var e,t=d(this._consoleRecorderUnpatchers);!(e=t()).done;)(0,e.value)();this._consoleRecorderUnpatchers=[]}},t._takeConsoleBuffer=function(){var e=this._consoleBuffer;return this._stopConsoleRecorder(),e},t.flushLogs=function(e){var t=this;e?this._flushViaTransport(e):(this._core&&this._core.flush().catch(function(e){return t._logFlushError(e)}),this._consoleCore&&this._consoleCore.flush().catch(function(e){return t._logFlushError(e)}))},t._logFlushError=function(e){Uv(e)||this._logger.error("PostHog logs flush failed:",e)},t.loadIfEnabled=function(){var e=this;if(!this._disposed&&this._isLogsEnabled&&!this._isLoaded&&!this._isLoading){var t=null==ih?void 0:ih.__PosthogExtensions__;if(!t)return this._logger.error("PostHog Extensions not found."),void this._stopConsoleRecorder();var n=t.loadExternalDependency;if(!n)return this._logger.error(El),void this._stopConsoleRecorder();this._isLoading=!0;try{n(this._instance,"logs",function(n){if(e._isLoading=!1,!e._disposed&&e._isLogsEnabled){var i=t.logs;if(n||null==i||!i.initializeLogs)e._logger.error("Could not load logs script",n),e._stopConsoleRecorder();else{var r,s,o=e._takeConsoleBuffer();e._consoleLogsDispose=i.initializeLogs(null!==(r=e._client)&&void 0!==r?r:e._instance),e._isLoaded=!0,o.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(s=e._client)&&void 0!==s?s:e._instance,o))}}})}catch(e){throw this._isLoading=!1,e}}},t._createHost=function(e,t){var n=this,i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:function(t){return t===br.LogsQueue?e():void 0},setPersistedProperty:function(e,n){e===br.LogsQueue&&t(null!=n?n:[])},_sendLogsBatch:function(e){return n._sendLogsBatch(e)},getLibraryId:function(){return $h.LIB_NAME},getLibraryVersion:function(){return $h.LIB_VERSION}}},t._sendLogsBatch=function(e){var t=this;return new Promise(function(n){if(Ql(t._consecutiveStatusZeroFailures,3))n({kind:"fatal",error:zv(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=function(e){i||(i=!0,clearTimeout(s),n(e))},s=setTimeout(function(){t._logger.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:zv(void 0,"logs request timed out")})},9e4);t._instance._send_request({method:"POST",url:t._logsUrl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:function(e){var n=e.statusCode;if(t._trackEndpointReachability(n),n>=200&&300>n)r({kind:"ok"});else if(413===n)r({kind:"too-large"});else if(0!==n&&408!==n&&429!==n&&500>n)r({kind:"fatal",error:new Error("logs request failed with status "+n)});else{var i;0===n?(e.error||t._logger.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:zv(e.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=e.error)&&void 0!==i?i:new Error("logs request failed with status "+n)})}}})}})},t._trackEndpointReachability=function(e){var t=this;(0!==e||this._instance.__loaded)&&(this._consecutiveStatusZeroFailures=Zl(e,this._consecutiveStatusZeroFailures,3,function(){return t._logger.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")}))},t._flushViaTransport=function(e){var t=this;this._queue.length>0&&this._drainQueueViaTransport(e,this._queue,this._resolvedConfig,$h.LIB_NAME,function(e){t._queue=e}),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,Hv,function(e){t._consoleQueue=e})},t._drainQueueViaTransport=function(e,t,n,i,r){if(0!==t.length){var s=t.map(function(e){return e.record});r([]);var o=ma(s,ga(n,$h.LIB_NAME,$h.LIB_VERSION),i,$h.LIB_VERSION);this._instance._send_request({method:"POST",url:this._logsUrl(),data:o,compression:"best-available",batchKey:"logs",transport:e})}},t._logsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)},t._getSdkContext=function(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),i=n.windowId,r=n.sessionStartTimestamp,s=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=i,Dr(r)||(t.sessionStartTimestamp=r),Dr(s)||(t.lastActivityTimestamp=s)}if(null!=ih&&null!=(e=ih.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?ho(ih.location.href):ih.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(t.activeFeatureFlags=o)}return t},o(e,[{key:"logger",get:function(){var e=this;return this._capture_logger||(this._capture_logger={trace:function(t,n){return e.captureLog({body:t,level:"trace",attributes:n})},debug:function(t,n){return e.captureLog({body:t,level:"debug",attributes:n})},info:function(t,n){return e.captureLog({body:t,level:"info",attributes:n})},warn:function(t,n){return e.captureLog({body:t,level:"warn",attributes:n})},error:function(t,n){return e.captureLog({body:t,level:"error",attributes:n})},fatal:function(t,n){return e.captureLog({body:t,level:"fatal",attributes:n})}}),this._capture_logger}}])}(),Gv=function(){"use strict";function e(e){this._instance=e,this._logger=ja("[metrics]")}var t=e.prototype;return t.initialize=function(){},t._getCore=function(){var e,t,n=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this._core&&this._resolvedFrom===n||(null==(t=this._core)||t.reset(),this._resolvedFrom=n,this._core=new xa(this._createHost(),function(e){var t,n,i,r,s,o=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==o?void 0:o["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(n=null==o?void 0:o["service.version"])&&void 0!==n?n:null==e?void 0:e.serviceVersion,environment:null!==(i=null==o?void 0:o["deployment.environment"])&&void 0!==i?i:null==e?void 0:e.environment,resourceAttributes:o,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:1e4,maxSeriesPerFlush:null!==(s=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(n),this._logger)),this._core},t.count=function(e,t,n){void 0===t&&(t=1),this._getCore().count(e,t,n)},t.gauge=function(e,t,n){this._getCore().gauge(e,t,n)},t.histogram=function(e,t,n){this._getCore().histogram(e,t,n)},t.flush=function(e){var t=this;if(!this._core)return Promise.resolve();if(e){var n=this._core.drainWindow();return n&&this._sendMetricsBatch(n,e),Promise.resolve()}return this._core.flush().catch(function(e){return t._logger.error("PostHog metrics flush failed:",e)})},t.reset=function(){var e;null==(e=this._core)||e.reset()},t._createHost=function(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},_sendMetricsBatch:function(e){return t._sendMetricsBatch(e)},getLibraryId:function(){return $h.LIB_NAME},getLibraryVersion:function(){return $h.LIB_VERSION}}},t._sendMetricsBatch=function(e,t){var n=this;return new Promise(function(i){var r=!1,s=function(e){r||(r=!0,clearTimeout(o),i(e))},o=setTimeout(function(){return s({kind:"retry-later",error:new Error("metrics request timed out")})},9e4);n._instance._send_request(u({method:"POST",url:n._metricsUrl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback:function(e){var t,n=e.statusCode;s(n>=200&&300>n?{kind:"ok"}:413===n?{kind:"too-large"}:0!==n&&408!==n&&429!==n&&500>n?{kind:"fatal",error:new Error("metrics request failed with status "+n)}:{kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:new Error("metrics request failed with status "+n)})}}))})},t._metricsUrl=function(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)},e}(),Kv={featureFlags:Av},Qv={sessionRecording:tv},Zv={autocapture:N_,historyAutocapture:V_,heatmaps:rv,deadClicksAutocapture:Cf,webVitalsAutocapture:J_},Jv={exceptionObserver:H_,exceptions:ch},Yv=u({productTours:av},Kv),Xv={siteApps:cv},eg={tracingHeaders:U_},tg=u({surveys:bv},Kv),ng={toolbar:kv},ig=u({experiments:$v},Kv),rg=u({},Kv,Qv,Zv,Jv,Yv,Xv,tg,eg,ng,ig,{conversations:Bv},{logs:Wv},{metrics:Gv});if(R_.__defaultExtensionClasses=u({},rg),function(){$h.SDK_DIST_CHANNEL="cdn";var e=ih.posthog;if(!e||Tr(e._i)){var t=p_[k_]=new R_;if(e){var n=[];Va(e._i,function(i){if(i&&Tr(i)){var r=t.init(i[0],i[1],i[2]),s=e[i[2]]||e;r.__loaded&&-1===n.indexOf(s)&&(n.push(s),r._execute_array.call(r.people,s.people),r._execute_array(s))}})}t.__SV=1,ih.posthog=t,function(){function e(){e.done||(e.done=!0,C_=!1,Va(p_,function(e){e._dom_loaded()}))}null!=Ra&&Ra.addEventListener?"complete"===Ra.readyState?e():Ja(Ra,"DOMContentLoaded",e,{capture:!1}):Fa&&Na.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}(),"undefined"==typeof performance||"function"!=typeof performance.now){var sg="undefined"!=typeof performance?performance:{};sg.now=sg.now||function(){return Date.now()},"undefined"==typeof performance&&(window.performance=sg)}}()}();
2
2
  //# sourceMappingURL=array.full.es5.js.map