posthog-js 1.434.12 → 1.434.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.cjs +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.cjs +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.no-external.cjs +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/rrweb.js +1 -1
- package/dist/rrweb.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +7 -7
package/dist/array.full.es5.js
CHANGED
|
@@ -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,r(e,t)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function s(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}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 r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(null,arguments)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,i,s){var u=Object.create((r&&r.prototype instanceof a?r:a).prototype);return c(u,"_invoke",function(n,r,i){var s,a,u,l=0,c=i||[],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,r){for(a=n,u=r,t=0;!d&&l&&!i&&c.length>t;t++){var i,s=c[t],f=h.p,p=s[2];n>3?(i=p===r)&&(u=s[(a=s[4])?5:(a=3,3)],s[4]=s[5]=e):f>=s[0]&&((i=2>n&&s[1]>f)?(a=0,h.v=r,h.n=s[1]):p>f&&(i=3>n||s[0]>r||r>p)&&(s[4]=n,s[5]=r,h.n=p,a=0))}if(i||n>1)return o;throw d=!0,r}return function(i,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||(i="next"),t=s[i]){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 '"+i+"' method"),a=1);s=e}else if((t=(d=0>h.n)?u:n.call(r,h))!==o)break}catch(t){s=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,i,s),!0),u}var o={};function a(){}function u(){}function d(){}t=Object.getPrototypeOf;var h=[][r]?t(t([][r]())):(c(t={},r,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,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,c(f,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,i,"GeneratorFunction"),c(f),c(f,i,"Generator"),c(f,r,function(){return this}),c(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:s,m:p}})()}function c(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}c=function(e,t,n,r){function s(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},c(e,t,n,r)}function d(e,t,n,r,i,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(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(e){d(s,r,i,o,a,"next",e)}function a(e){d(s,r,i,o,a,"throw",e)}o(void 0)})}}function f(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 p(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)?p(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return e.length>r?{done:!1,value:e[r++]}:{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 p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}!function(r,s,a){var c,d,p,_,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")()}),I=E(function(e,t){t.exports=function(e){try{return!!e()}catch(e){return!0}}}),T=E(function(e,t){t.exports=!I()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),R=E(function(e,t){t.exports=!I()(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}),M=E(function(e,t){var n=R(),r=function(){}.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}}),L=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}),A=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(),r=Function.prototype,i=r.call,s=n&&r.bind.bind(i,i);t.exports=n?s:function(e){return function(){return i.apply(e,arguments)}}}),D=E(function(e,t){var n=O(),r=n({}.toString),i=n("".slice);t.exports=function(e){return i(r(e),8,-1)}}),q=E(function(e,t){var n=O(),r=I(),i=D(),s=Object,o=n("".split);t.exports=r(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===i(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(),r=TypeError;t.exports=function(e){if(n(e))throw new r("Can't call method on "+e);return e}}),H=E(function(e,t){var n=q(),r=N();t.exports=function(e){return n(r(e))}}),j=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}}),U=E(function(e,t){var n=j();t.exports=function(e){return"object"==typeof e?null!==e:n(e)}}),z=E(function(e,t){var n=F(),r=j();t.exports=function(e,t){return 2>arguments.length?r(i=n[e])?i:void 0:n[e]&&n[e][t];var i}}),V=E(function(e,t){t.exports=O()({}.isPrototypeOf)}),W=E(function(e,t){var n=F().navigator,r=n&&n.userAgent;t.exports=r?String(r):""}),G=E(function(e,t){var n,r,i=F(),s=W(),o=i.process,a=i.Deno,u=o&&o.versions||a&&a.version,l=u&&u.v8;l&&(r=(n=l.split("."))[0]>0&&4>n[0]?1:+(n[0]+n[1])),!r&&s&&((n=s.match(/Edge\/(\d+)/))&&74>n[1]||(n=s.match(/Chrome\/(\d+)/))&&(r=+n[1])),t.exports=r}),K=E(function(e,t){var n=G(),r=I(),i=F().String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol("symbol detection");return!i(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(),r=j(),i=V(),s=Q(),o=Object;t.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&i(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=j(),r=J(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not a function")}}),X=E(function(e,t){var n=Y(),r=B();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}}),ee=E(function(e,t){var n=M(),r=j(),i=U(),s=TypeError;t.exports=function(e,t){var o,a;if("string"===t&&r(o=e.toString)&&!i(a=n(o,e)))return a;if(r(o=e.valueOf)&&!i(a=n(o,e)))return a;if("string"!==t&&r(o=e.toString)&&!i(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(),r=Object.defineProperty;t.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}}),re=E(function(e,t){var n=te(),r=F(),i=ne(),s="__core-js_shared__",o=t.exports=r[s]||i(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"})}),ie=E(function(e,t){var n=re();t.exports=function(e,t){return n[e]||(n[e]=t||{})}}),se=E(function(e,t){var n=N(),r=Object;t.exports=function(e){return r(n(e))}}),oe=E(function(e,t){var n=O(),r=se(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}}),ae=E(function(e,t){var n=O(),r=0,i=Math.random(),s=n(1.1.toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+i,36)}}),ue=E(function(e,t){var n=F(),r=ie(),i=oe(),s=ae(),o=K(),a=Q(),u=n.Symbol,l=r("wks"),c=a?u.for||u:u&&u.withoutSetter||s;t.exports=function(e){return i(l,e)||(l[e]=o&&i(u,e)?u[e]:c("Symbol."+e)),l[e]}}),le=E(function(e,t){var n=M(),r=U(),i=Z(),s=X(),o=ee(),a=ue(),u=TypeError,l=a("toPrimitive");t.exports=function(e,t){if(!r(e)||i(e))return e;var a,c=s(e,l);if(c){if(void 0===t&&(t="default"),a=n(c,e,t),!r(a)||i(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(),r=Z();t.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}}),de=E(function(e,t){var n=F(),r=U(),i=n.document,s=r(i)&&r(i.createElement);t.exports=function(e){return s?i.createElement(e):{}}}),he=E(function(e,t){var n=T(),r=I(),i=de();t.exports=!n&&!r(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}),fe=E(function(e){var t=T(),n=M(),r=L(),i=A(),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 i(!n(r.f,e,t),e[t])}}),pe=E(function(e,t){var n=T(),r=I();t.exports=n&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),_e=E(function(e,t){var n=U(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not an object")}}),ve=E(function(e){var t=T(),n=he(),r=pe(),i=_e(),s=ce(),o=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l="enumerable",c="configurable",d="writable";e.f=t?r?function(e,t,n){if(i(e),t=s(t),i(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var r=u(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:c in n?n[c]:r[c],enumerable:l in n?n[l]:r[l],writable:!1})}return a(e,t,n)}:a:function(e,t,r){if(i(e),t=s(t),i(r),n)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new o("Accessors not supported");return"value"in r&&(e[t]=r.value),e}}),ge=E(function(e,t){var n=T(),r=ve(),i=A();t.exports=n?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}}),me=E(function(e,t){var n=T(),r=oe(),i=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,o=r(i,"name");t.exports={EXISTS:o,PROPER:o&&"something"===function(){}.name,CONFIGURABLE:o&&(!n||n&&s(i,"name").configurable)}}),ye=E(function(e,t){var n=O(),r=j(),i=re(),s=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return s(e)}),t.exports=i.inspectSource}),be=E(function(e,t){var n=F(),r=j(),i=n.WeakMap;t.exports=r(i)&&/native code/.test(String(i))}),we=E(function(e,t){var n=ie(),r=ae(),i=n("keys");t.exports=function(e){return i[e]||(i[e]=r(e))}}),Se=E(function(e,t){t.exports={}}),xe=E(function(e,t){var n,r,i,s=be(),o=F(),a=U(),u=ge(),l=oe(),c=re(),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},r=function(e){return _.get(e)||{}},i=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},r=function(e){return l(e,v)?e[v]:{}},i=function(e){return l(e,v)}}t.exports={set:n,get:r,has:i,enforce:function(e){return i(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var n;if(!a(t)||(n=r(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}),ke=E(function(e,t){var n=O(),r=I(),i=j(),s=oe(),o=T(),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&&!r(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 r=c(e);return s(r,"source")||(r.source=v(m,"string"==typeof t?t:"")),e};Function.prototype.toString=y(function(){return i(this)&&d(this).source||u(this)},"toString")}),Ce=E(function(e,t){var n=j(),r=ve(),i=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)&&i(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:r.f(e,t,{value:o,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}}),Pe=E(function(e,t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r: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(),r=Math.max,i=Math.min;t.exports=function(e,t){var s=n(e);return 0>s?r(s+t,0):i(s,t)}}),Ie=E(function(e,t){var n=Ee(),r=Math.min;t.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}}),Te=E(function(e,t){var n=Ie();t.exports=function(e){return n(e.length)}}),Re=E(function(e,t){var n=H(),r=Fe(),i=Te(),s=function(e){return function(t,s,o){var a=n(t),u=i(a);if(0===u)return!e&&-1;var l,c=r(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)}}),Me=E(function(e,t){var n=O(),r=oe(),i=H(),s=Re().indexOf,o=Se(),a=n([].push);t.exports=function(e,t){var n,u=i(e),l=0,c=[];for(n in u)!r(o,n)&&r(u,n)&&a(c,n);for(;t.length>l;)r(u,n=t[l++])&&(~s(c,n)||a(c,n));return c}}),Le=E(function(e,t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),Ae=E(function(e){var t=Me(),n=Le().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}}),Oe=E(function(e){e.f=Object.getOwnPropertySymbols}),De=E(function(e,t){var n=z(),r=O(),i=Ae(),s=Oe(),o=_e(),a=r([].concat);t.exports=n("Reflect","ownKeys")||function(e){var t=i.f(o(e)),n=s.f;return n?a(t,n(e)):t}}),$e=E(function(e,t){var n=oe(),r=De(),i=fe(),s=ve();t.exports=function(e,t,o){for(var a=r(t),u=s.f,l=i.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=I(),r=j(),i=/#|\.prototype\./,s=function(e,t){var i=a[o(e)];return i===l||i!==u&&(r(t)?n(t):!!t)},o=s.normalize=function(e){return String(e).replace(i,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s}),Be=E(function(e,t){var n=F(),r=fe().f,i=ge(),s=Ce(),o=ne(),a=$e(),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=r(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)&&i(h,"sham",!0),s(l,c,h,e)}}}),Ne=E(function(e,t){t.exports=!I()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),He=E(function(e,t){var n=oe(),r=j(),i=se(),s=we(),o=Ne(),a=s("IE_PROTO"),u=Object,l=u.prototype;t.exports=o?u.getPrototypeOf:function(e){var t=i(e);if(n(t,a))return t[a];var s=t.constructor;return r(s)&&t instanceof s?s.prototype:t instanceof u?l:null}}),je=E(function(e,t){var n=Me(),r=Le();t.exports=Object.keys||function(e){return n(e,r)}}),Ue=E(function(e,t){var n=T(),r=I(),i=O(),s=He(),o=je(),a=H(),u=i(L().f),l=i([].push),c=n&&r(function(){var e=Object.create(null);return e[2]=2,!u(e,2)}),d=function(e){return function(t){for(var r,i=a(t),d=o(i),h=c&&null===s(i),f=d.length,p=0,_=[];f>p;)r=d[p++],n&&!(h?r in i:u(i,r))||l(_,e?[r,i[r]]:i[r]);return _}};t.exports={entries:d(!0),values:d(!1)}}),ze=E(function(){var $=Be(),e=Ue().entries;$({target:"Object",stat:!0},{entries:function(t){return e(t)}})}),Ve=E(function(e,t){t.exports=F()}),We=E(function(e,t){ze(),t.exports=Ve().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=T(),n=pe(),r=ve(),i=_e(),s=H(),o=je();e.f=t&&!n?Object.defineProperties:function(e,t){i(e);for(var n,a=s(t),u=o(t),l=u.length,c=0;l>c;)r.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,r=_e(),i=Je(),s=Le(),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,r;v="undefined"!=typeof document?document.domain&&n?_(n):(t=u("iframe"),r="java"+d+":",t.style.display="none",a.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):_(n);for(var i=s.length;i--;)delete v[c][s[i]];return v()};o[h]=!0,t.exports=Object.create||function(e,t){var n;return null!==e?(f[c]=r(e),n=new f,f[c]=null,n[h]=e):n=v(),void 0===t?n:i.f(n,t)}}),et=E(function(e,t){var n=ue(),r=Xe(),i=ve().f,s=n("unscopables"),o=Array.prototype;void 0===o[s]&&i(o,s,{configurable:!0,value:r(null)}),t.exports=function(e){o[s][e]=!0}}),tt=E(function(e,t){t.exports={}}),nt=E(function(e,t){var n,r,i,s=I(),o=j(),a=U(),u=Xe(),l=He(),c=Ce(),d=ue(),h=te(),f=d("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(r=l(l(i)))!==Object.prototype&&(n=r):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}}),rt=E(function(e,t){var n=ve().f,r=oe(),i=ue()("toStringTag");t.exports=function(e,t,s){e&&!s&&(e=e.prototype),e&&!r(e,i)&&n(e,i,{configurable:!0,value:t})}}),it=E(function(e,t){var n=nt().IteratorPrototype,r=Xe(),i=A(),s=rt(),o=tt(),a=function(){return this};t.exports=function(e,t,u,l){var c=t+" Iterator";return e.prototype=r(n,{next:i(+!l,u)}),s(e,c,!1,!0),o[c]=a,e}}),st=E(function(e,t){var n=O(),r=Y();t.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}}),ot=E(function(e,t){var n=U();t.exports=function(e){return n(e)||null===e}}),at=E(function(e,t){var n=ot(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i("Can't set "+r(e)+" as a prototype")}}),ut=E(function(e,t){var n=st(),r=U(),i=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 i(n),s(o),r(n)?(t?e(n,o):n.__proto__=o,n):n}}():void 0)}),lt=E(function(e,t){var $=Be(),n=M(),r=te(),i=me(),s=j(),o=it(),a=He(),u=ut(),l=rt(),c=ge(),d=Ce(),h=ue(),f=tt(),p=nt(),_=i.PROPER,v=i.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,i,h,p,k,C){o(i,t,h);var P,E,F,I=function(e){if(e===p&&A)return A;if(!m&&e&&e in M)return M[e];switch(e){case b:case w:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},T=t+" Iterator",R=!1,M=e.prototype,L=M[y]||M["@@iterator"]||p&&M[p],A=!m&&L||I(p),O="Array"===t&&M.entries||L;if(O&&(P=a(O.call(new e)))!==Object.prototype&&P.next&&(r||a(P)===g||(u?u(P,g):s(P[y])||d(P,y,x)),l(P,T,!0,!0),r&&(f[T]=x)),_&&p===w&&L&&L.name!==w&&(!r&&v?c(M,"name",w):(R=!0,A=function(){return n(L,this)})),p)if(E={values:I(w),keys:k?A:I(b),entries:I(S)},C)for(F in E)(m||R||!(F in M))&&d(M,F,E[F]);else $({target:t,proto:!0,forced:m||R},E);return r&&!C||M[y]===A||d(M,y,A,{name:p}),f[t]=A,E}}),ct=E(function(e,t){t.exports=function(e,t){return{value:e,done:t}}}),dt=E(function(e,t){var n=H(),r=et(),i=tt(),s=xe(),o=ve().f,a=lt(),u=ct(),l=te(),c=T(),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=i.Arguments=i.Array;if(r("keys"),r("values"),r("entries"),!l&&c&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(e){}}),ht=E(function(e,t){var n=D(),r=O();t.exports=function(e){if("Function"===n(e))return r(e)}}),ft=E(function(e,t){var n=ht(),r=Y(),i=R(),s=n(n.bind);t.exports=function(e,t){return r(e),void 0===t?e:i?s(e,t):function(){return e.apply(t,arguments)}}}),pt=E(function(e,t){var n=ue(),r=tt(),i=n("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(r.Array===e||s[i]===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(),r=j(),i=D(),s=ue()("toStringTag"),o=Object,a="Arguments"===i(function(){return arguments}());t.exports=n?i: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?i(t):"Object"===(u=i(t))&&r(t.callee)?"Arguments":u}}),gt=E(function(e,t){var n=vt(),r=X(),i=B(),s=tt(),o=ue()("iterator");t.exports=function(e){if(!i(e))return r(e,o)||r(e,"@@iterator")||s[n(e)]}}),mt=E(function(e,t){var n=M(),r=Y(),i=_e(),s=J(),o=gt(),a=TypeError;t.exports=function(e,t){var u=2>arguments.length?o(e):t;if(r(u))return i(n(u,e));throw new a(s(e)+" is not iterable")}}),yt=E(function(e,t){var n=M(),r=_e(),i=X();t.exports=function(e,t,s){var o,a;r(e);try{if(!(o=i(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 r(o),s}}),bt=E(function(e,t){var n=ft(),r=M(),i=_e(),s=J(),o=pt(),a=Te(),u=V(),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)},I=function(e){return x?(i(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=I(e[m]))&&u(p,b))return b;return new f(!1)}v=l(e,g)}for(w=k?e.next:v.next;!(S=r(w,v)).done;){var T=S.value;try{b=I(T)}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=T(),r=ve(),i=A();t.exports=function(e,t,s){n?r.f(e,t,i(0,s)):e[t]=s}}),St=E(function(){var $=Be(),e=bt(),t=wt();$({target:"Object",stat:!0},{fromEntries:function(n){var r={};return e(n,function(e,n){t(r,e,n)},{AS_ENTRIES:!0}),r}})}),xt=E(function(e,t){dt(),St(),t.exports=Ve().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,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r}),Pt=E(function(){var e=F(),t=kt(),n=Ct(),r=dt(),i=ge(),s=rt(),o=ue()("iterator"),a=r.values,u=function(e,n){if(e){if(e[o]!==a)try{i(e,o,a)}catch(t){e[o]=a}if(s(e,n,!0),t[n])for(var u in r)if(e[u]!==r[u])try{i(e,u,r[u])}catch(t){e[u]=r[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()}),It=E(function(e,t){t.exports=Ft()}),Tt=E(function(e,t){t.exports=It()}),Rt=E(function(e,t){var n=U(),r=ge();t.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}}),Mt=E(function(e,t){var n=O(),r=Error,i=n("".replace),s=String(new r("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,a=o.test(s);t.exports=function(e,t){if(a&&"string"==typeof e&&!r.prepareStackTrace)for(;t--;)e=i(e,o,"");return e}}),Lt=E(function(e,t){var n=I(),r=A();t.exports=!n(function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)})}),At=E(function(e,t){var n=ge(),r=Mt(),i=Lt(),s=Error.captureStackTrace;t.exports=function(e,t,o,a){i&&(s?s(e,t):n(e,"stack",r(o,a)))}}),Ot=E(function(e,t){var n=vt(),r=String;t.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return r(e)}}),Dt=E(function(e,t){var n=Ot();t.exports=function(e,t){return void 0===e?2>arguments.length?"":t:n(e)}}),$t=E(function(){var $=Be(),e=V(),t=He(),n=ut(),r=$e(),i=Xe(),s=ge(),o=A(),a=Rt(),u=At(),l=bt(),c=Dt(),d=ue()("toStringTag"),h=Error,f=[].push,p=function(r,o){var v,g=e(_,this);n?v=n(new h,g?t(this):_):(v=g?this:i(_),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(r,f,{that:m}),s(v,"errors",m),v};n?n(p,h):r(p,h,{name:!0});var _=p.prototype=i(h.prototype,{constructor:o(1,p),message:o(1,""),name:o(1,"AggregateError")});$({global:!0,constructor:!0,arity:2},{AggregateError:p})}),qt=E(function(){$t()}),Bt=E(function(e,t){var n=_t(),r=vt();t.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}}),Nt=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(),r=W(),i=D(),s=function(e){return r.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"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"}),jt=E(function(e,t){t.exports="NODE"===Ht()}),Ut=E(function(e,t){var n=ke(),r=ve();t.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}}),zt=E(function(e,t){var n=z(),r=Ut(),i=ue(),s=T(),o=i("species");t.exports=function(e){var t=n(e);s&&t&&!t[o]&&r(t,o,{configurable:!0,get:function(){return this}})}}),Vt=E(function(e,t){var n=V(),r=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new r("Incorrect invocation")}}),Wt=E(function(e,t){var n=O(),r=I(),i=j(),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(!i(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},p=function(e){if(!i(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||r(function(){var e;return f(f.call)||!f(Object)||!f(function(){e=!0})||e})?p:f}),Gt=E(function(e,t){var n=Wt(),r=J(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not a constructor")}}),Kt=E(function(e,t){var n=_e(),r=Gt(),i=B(),s=ue()("species");t.exports=function(e,t){var o,a=n(e).constructor;return void 0===a||i(o=n(a)[s])?t:r(o)}}),Qt=E(function(e,t){var n=R(),r=Function.prototype,i=r.apply,s=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(i):function(){return s.apply(i,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,r,i,s,o=F(),a=Qt(),u=ft(),l=j(),c=oe(),d=I(),h=Ye(),f=Zt(),p=de(),_=Jt(),v=Yt(),g=jt(),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 T=function(e){if(c(P,e)){var t=P[e];delete P[e],t()}},R=function(e){return function(){T(e)}},M=function(e){T(e.data)},L=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)},r(C),C},y=function(e){delete P[e]},g?r=function(e){b.nextTick(R(e))}:w&&w.now?r=function(e){w.now(R(e))}:x&&!v?(s=(i=new x).port2,i.port1.onmessage=M,r=u(s.postMessage,s)):o.addEventListener&&l(o.postMessage)&&!o.importScripts&&n&&"file:"!==n.protocol&&!d(L)?(r=L,o.addEventListener("message",M,!1)):r=E in p("script")?function(e){h.appendChild(p("script"))[E]=function(){h.removeChild(this),T(e)}}:function(e){setTimeout(R(e),0)}),t.exports={set:m,clear:y}}),en=E(function(e,t){var n=F(),r=T(),i=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!r)return n[e];var t=i(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,r,i,s,o,a=F(),u=en(),l=ft(),c=Xt().set,d=tn(),h=Yt(),f=nn(),p=rn(),_=jt(),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)}):(r=!0,i=g.createTextNode(""),new v(S).observe(i,{characterData:!0}),n=function(){i.data=r=!r}),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(),r=un(),i=j(),s=qe(),o=ye(),a=ue(),u=Ht(),l=te(),c=G(),d=r&&r.prototype,h=a("species"),f=!1,p=i(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:s("Promise",function(){var e=o(r),t=e!==String(r);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 r(function(e){e(1)}),i=function(e){e(function(){},function(){})};if((n.constructor={})[h]=i,!(f=n.then(function(){})instanceof i))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||p)}),REJECTION_EVENT:p,SUBCLASSING:f}}),cn=E(function(e,t){var n=Y(),r=TypeError,i=function(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw new r("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)};t.exports.f=function(e){return new i(e)}}),dn=E(function(){var e,t,n,r,$=Be(),i=te(),s=jt(),o=F(),a=Ve(),u=M(),l=Ce(),c=ut(),d=rt(),h=zt(),f=Y(),p=j(),_=U(),v=Vt(),g=Kt(),m=Xt().set,y=sn(),b=on(),w=an(),S=tn(),x=xe(),k=un(),C=ln(),P=cn(),E="Promise",I=C.CONSTRUCTOR,T=C.REJECTION_EVENT,R=C.SUBCLASSING,L=x.getterFor(E),A=x.set,O=k&&k.prototype,D=k,q=O,B=o.TypeError,N=o.document,H=o.process,z=P.f,V=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,r,i,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(),i=!0)),n===e.promise?c(new B("Promise-chain cycle")):(r=K(n))?u(r,n,l,c):l(n)):c(s)}catch(e){d&&!i&&d.exit(),c(e)}},Z=function(e,t){e.notified||(e.notified=!0,y(function(){for(var n,r=e.reactions;n=r.get();)Q(n,e);e.notified=!1,t&&!e.rejection&&X(e)}))},J=function(e,t,n){var r,i;W?((r=N.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),o.dispatchEvent(r)):r={promise:t,reason:n},!T&&(i=o["on"+e])?i(r):e===G&&b("Unhandled promise rejection",n)},X=function(e){u(m,o,function(){var t,n=e.facade,r=e.value;if(ee(e)&&(t=w(function(){s?H.emit("unhandledRejection",r,n):J(G,n,r)}),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)})},re=function(e,t,n){return function(r){e(t,r,n)}},ie=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 r=K(t);r?y(function(){var n={done:!1};try{u(r,t,re(se,n,e),re(ie,n,e))}catch(t){ie(n,t,e)}}):(e.value=t,e.state=1,Z(e,!1))}catch(t){ie({done:!1},t,e)}}};if(I&&(D=function(t){v(this,q),f(t),u(e,this);var n=L(this);try{t(re(se,n),re(ie,n))}catch(e){ie(n,e)}},(e=function(e){A(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=L(this),r=z(g(this,D));return n.parent=!0,r.ok=!p(e)||e,r.fail=p(t)&&t,r.domain=s?H.domain:void 0,0===n.state?n.reactions.add(r):y(function(){Q(r,n)}),r.promise}),t=function(){var t=new e,n=L(t);this.promise=t,this.resolve=re(se,n),this.reject=re(ie,n)},P.f=z=function(e){return e===D||e===n?new t(e):V(e)},!i&&p(k)&&O!==Object.prototype)){r=O.then,R||l(O,"then",function(e,t){var n=this;return new D(function(e,t){u(r,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:I},{Promise:D}),n=a.Promise,d(D,E,!1,!0),h(E)}),hn=E(function(e,t){var n=ue()("iterator"),r=!1;try{var i=0,s={next:function(){return{done:!!i++}},return:function(){r=!0}};s[n]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}t.exports=function(e,t){try{if(!t&&!r)return!1}catch(e){return!1}var i=!1;try{var s={};s[n]=function(){return{next:function(){return{done:i=!0}}}},e(s)}catch(e){}return i}}),fn=E(function(e,t){var n=un(),r=hn();t.exports=ln().CONSTRUCTOR||!r(function(e){n.all(e).then(void 0,function(){})})}),pn=E(function(){var $=Be(),e=M(),t=Y(),n=cn(),r=an(),i=bt();$({target:"Promise",stat:!0,forced:fn()},{all:function(s){var o=this,a=n.f(o),u=a.resolve,l=a.reject,c=r(function(){var n=t(o.resolve),r=[],a=0,c=1;i(s,function(t){var i=a++,s=!1;c++,e(n,o,t).then(function(e){s||(s=!0,r[i]=e,--c||u(r))},l)}),--c||u(r)});return c.error&&l(c.value),a.promise}})}),_n=E(function(){var $=Be(),e=te(),t=ln().CONSTRUCTOR,n=un(),r=z(),i=j(),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&&i(n)){var a=r("Promise").prototype.catch;o.catch!==a&&s(o,"catch",a,{unsafe:!0})}}),vn=E(function(){var $=Be(),e=M(),t=Y(),n=cn(),r=an(),i=bt();$({target:"Promise",stat:!0,forced:fn()},{race:function(s){var o=this,a=n.f(o),u=a.reject,l=r(function(){var n=t(o.resolve);i(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(),r=U(),i=cn();t.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var s=i.f(e);return(0,s.resolve)(t),s.promise}}),yn=E(function(){var $=Be(),e=z(),t=te(),n=un(),r=ln().CONSTRUCTOR,i=mn(),s=e("Promise"),o=t&&!r;$({target:"Promise",stat:!0,forced:t||r},{resolve:function(e){return i(o&&this===s?n:this,e)}})}),bn=E(function(){dn(),pn(),_n(),vn(),gn(),yn()}),wn=E(function(){var $=Be(),e=M(),t=Y(),n=cn(),r=an(),i=bt();$({target:"Promise",stat:!0,forced:fn()},{allSettled:function(s){var o=this,a=n.f(o),u=a.resolve,l=a.reject,c=r(function(){var n=t(o.resolve),r=[],a=0,l=1;i(s,function(t){var i=a++,s=!1;l++,e(n,o,t).then(function(e){s||(s=!0,r[i]={status:"fulfilled",value:e},--l||u(r))},function(e){s||(s=!0,r[i]={status:"rejected",reason:e},--l||u(r))})}),--l||u(r)});return c.error&&l(c.value),a.promise}})}),Sn=E(function(){var $=Be(),e=M(),t=Y(),n=z(),r=cn(),i=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=r.f(u),d=c.resolve,h=c.reject,f=i(function(){var n=t(u.resolve),r=[],i=0,c=1,f=!1;s(o,function(t){var s=i++,o=!1;c++,e(n,u,t).then(function(e){o||f||(f=!0,d(e))},function(e){o||f||(o=!0,r[s]=e,--c||h(new l(r,a)))})}),--c||h(new l(r,a))});return f.error&&h(f.value),c.promise}})}),xn=E(function(){var $=Be(),e=F(),t=Qt(),n=Zt(),r=cn(),i=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=r.f(this),u=s(function(){return t(i(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=I(),r=z(),i=j(),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,r("Promise")),n=i(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&&i(t)){var l=r("Promise").prototype.finally;u.finally!==l&&a(u,"finally",l,{unsafe:!0})}}),Pn=E(function(e,t){var n=O(),r=Ee(),i=Ot(),s=N(),o=n("".charAt),a=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,n){var l,c,d=i(s(t)),h=r(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(),r=lt(),i=ct(),s="String Iterator",o=n.set,a=n.getterFor(s);r(String,"String",function(e){o(this,{type:s,string:t(e),index:0})},function(){var t,n=a(this),r=n.string,s=n.index;return r.length>s?(t=e(r,s),n.index+=t.length,i(t,!1)):i(void 0,!0)})}),Fn=E(function(e,t){qt(),dt(),Nt(),bn(),wn(),Sn(),xn(),kn(),Cn(),En(),t.exports=Ve().Promise}),In=E(function(e,t){var n=Fn();Pt(),t.exports=n}),Tn=E(function(){xn()}),Rn=E(function(){kn()}),Mn=E(function(e,t){var n=In();Tn(),Rn(),t.exports=n}),Ln=E(function(){qt()}),An=E(function(){wn()}),On=E(function(){Sn()}),Dn=E(function(e,t){var n=Mn();Ln(),An(),On(),t.exports=n}),$n=E(function(e,t){t.exports=Dn()});Ze(),Tt(),$n();var qn,Bn,Nn,Hn,jn={},Un=[],zn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Vn=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 r,i,s,o={};for(s in t)"key"==s?r=t[s]:"ref"==s?i=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,r,i,null)}function Qn(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++p:i,__i:-1,__u:0};return null==i&&null!=d.vnode&&d.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,r=[],i=[],s=Wn({},t);s.__v=t.__v+1,d.vnode&&d.vnode(s),lr(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?$(t):n,!!(32&t.__u),i),s.__v=t.__v,s.__.__k[s.__i]=s,dr(r,s,i),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 er(e){(!e.__d&&(e.__d=!0)&&_.push(e)&&!tr.__r++||v!=d.debounceRendering)&&((v=d.debounceRendering)||g)(tr)}function tr(){try{for(var e,t=1;_.length;)_.length>t&&_.sort(m),e=_.shift(),t=_.length,Yn(e)}finally{_.length=tr.__r=0}}function nr(e,t,n,r,i,s,o,a,u,l,c){var d,h,f,p,_,v,g,m=r&&r.__k||Un,y=t.length;for(u=rr(n,t,m,u,y),d=0;y>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&m[f.__i]||jn,f.__i=d,v=lr(e,f,h,i,s,o,a,u,l,c),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&pr(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=ir(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 rr(e,t,n,r,i){var s,o,a,u,l,c=n.length,d=c,h=0;for(e.__k=new Array(i),s=0;i>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):Vn(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=sr(o,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(i>c?h--:c>i&&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==r&&(r=$(a)),_r(a,a));return r}function ir(e,t,n,r){var i,s;if("function"==typeof e.type){for(i=e.__k,s=0;i&&i.length>s;s++)i[s]&&(i[s].__=e,t=ir(i[s],t,n,r));return t}e.__e!=t&&(r&&(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 sr(e,t,n,r){var i,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(r>(c?1:0))for(i=n-1,s=n+1;i>=0||t.length>s;)if(null!=(l=t[o=0>i?s++:i--])&&!(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function or(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 ar(e,t,n,r,i){var s,o;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||or(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||or(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?r?n[w]=r[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"==i)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 ur(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(d.event?d.event(t):t)}}}function lr(e,t,n,r,i,s,o,a,u,l){var c,h,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=d.__b)&&c(t);e:if("function"==typeof P){h=o.length;try{if(y=t.props,b=P.prototype&&P.prototype.render,$=(c=P.contextType)&&r[c.__c],w=c?$?$.props.value:c.__:r,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=vr),$&&$.sub(f),f.state||(f.state={}),f.__n=r,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)}),Un.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=d.__r,x=0,b)f.state=f.__s,f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),Un.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&&(r=Wn(Wn({},r),f.getChildContext())),b&&!p&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(_,v)),k=null!=c&&c.type===Zn&&null==c.key?hr(c.props.children):c,a=nr(e,Vn(k)?k:[k],t,n,r,i,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=h,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]);cr(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||cr(t);d.__e(e,t,n)}}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=fr(n.__e,t,n,r,i,s,o,u,l);return(c=d.diffed)&&c(t),128&t.__u?void 0:a}function cr(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(cr))}function dr(e,t,n){for(var r=0;n.length>r;r++)pr(n[r],n[++r],n[++r]);d.__c&&d.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){d.__e(e,t.__v)}})}function hr(e){return"object"!=typeof e||null==e||e.__b>0?e:Vn(e)?e.map(hr):void 0!==e.constructor?null:Wn({},e)}function fr(e,t,n,r,i,s,o,a,u){var l,h,f,p,_,v,g,m=n.props||jn,y=t.props,b=t.type;if("svg"==b?i="http://www.w3.org/2000/svg":"math"==b?i="http://www.w3.org/1998/Math/MathML":i||(i="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(i,b,y.is&&y),a&&(d.__m&&d.__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||ar(e,l,null,_,i);for(l in y)_=y[l],"children"==l?p=_:"dangerouslySetInnerHTML"==l?h=_:"value"==l?v=_:"checked"==l?g=_:a&&"function"!=typeof _||m[l]===_||ar(e,l,_,m[l],i);if(h)a||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(f&&(e.innerHTML=""),nr("template"==t.type?e.content:e,Vn(p)?p:[p],t,n,r,"foreignObject"==b?"http://www.w3.org/1999/xhtml":i,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])&&ar(e,l,v,m[l],i),l="checked",null!=g&&g!=e[l]&&ar(e,l,g,m[l],i))}return e}function pr(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){d.__e(e,n)}}function _r(e,t,n){var r,i;if(d.unmount&&d.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||pr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){d.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;r.length>i;i++)r[i]&&_r(r[i],t,n||"function"!=typeof e.type);n||Gn(e.__e),e.__c=e.__=e.__e=void 0}function vr(e,t,n){return this.constructor(e,n)}function gr(e,t,n){var r,i,s,o;t==document&&(t=document.documentElement),d.__&&d.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,s=[],o=[],lr(t,e=(!r&&n||t).__k=Kn(Zn,null,[e]),i||jn,jn,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?c.call(t.childNodes):null,s,!r&&n?n:i?i.__e:t.firstChild,r,o),dr(s,e,o),e.props.children=null}c=Un.slice,d={__e:function(e,t,n,r){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},p=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),er(this))},Jn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),er(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},tr.__r=0,y=Math.random().toString(8),b="__d"+y,w="__a"+y,S=/(PointerCapture)$|Capture$/i,x=0,k=ur(!1),C=ur(!0),P=0;var mr=0,yr=[],br=d,wr=br.__b,Sr=br.__r,xr=br.diffed,kr=br.__c,Cr=br.unmount,Pr=br.__;function Er(e,t){br.__h&&br.__h(Bn,e,mr||t),mr=0;var n=Bn.__H||(Bn.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Fr(e){return mr=1,function(e,t){var n=Er(qn++,2);if(n.t=e,!n.__c&&(n.__=[Br(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=Bn,!Bn.__f)){var r=function(e,t,r){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)}}),i){var a=i.call(this,e,t,r);return s?a||o:a}return!s||o};Bn.__f=!0;var i=Bn.shouldComponentUpdate,s=Bn.componentWillUpdate;Bn.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}s&&s.call(this,e,t,n)},Bn.shouldComponentUpdate=r}return n.__N||n.__}(Br,e)}function Ir(e,t){var n=Er(qn++,3);!br.__s&&qr(n.__H,t)&&(n.__=e,n.u=t,Bn.__H.__h.push(n))}function Tr(e){return mr=5,Rr(function(){return{current:e}},[])}function Rr(e,t){var n=Er(qn++,7);return qr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Mr(e){var t,n=Bn.context[e.__c],r=Er(qn++,9);return r.c=e,n?(null!==(t=r.__)&&void 0!==t||(r.__=!0,n.sub(Bn)),n.props.value):e.__}function Lr(){for(var e;e=yr.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Dr),t.__h.some($r),t.__h=[]}catch(n){t.__h=[],br.__e(n,e.__v)}}}br.__b=function(e){Bn=null,wr&&wr(e)},br.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Pr&&Pr(e,t)},br.__r=function(e){Sr&&Sr(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&&Lr(),qn=0)),Nn=Bn},br.diffed=function(e){xr&&xr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==yr.push(t)&&Hn===br.requestAnimationFrame||((Hn=br.requestAnimationFrame)||Or)(Lr)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),Nn=Bn=null},br.__c=function(e,t){t.some(function(e){try{e.__h.some(Dr),e.__h=e.__h.filter(function(e){return!e.__||$r(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],br.__e(n,e.__v)}}),kr&&kr(e,t)},br.unmount=function(e){Cr&&Cr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Dr(e)}catch(e){t=e}}),n.__H=void 0,t&&br.__e(t,n.__v))};var Ar="function"==typeof requestAnimationFrame;function Or(e){var t,n=function(){clearTimeout(r),Ar&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ar&&(t=requestAnimationFrame(n))}function Dr(e){var t=Bn,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Bn=t}function $r(e){var t=Bn;e.__c=e.__(),Bn=t}function qr(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Br(e,t){return"function"==typeof t?t(e):t}var Nr="gzip-js",Hr="base64",jr="events",Ur="cancelEvents",zr="tab",Vr="left",Wr="center",Gr="right",Kr="next_to_trigger",Qr="popover",Zr="widget",Jr="external_survey",Yr="open",Xr="multiple_choice",ei="single_choice",ti="rating",ni="end",ri="always",ii="survey shown",si="survey dismissed",oi="survey sent",ai="$survey_id",ui="$survey_name",li="$survey_iteration",ci="$survey_iteration_start_date",di="$survey_language",hi="popover",fi=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.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),pi=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),_i="min_length",vi="max_length",gi=["$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"],mi=["token"];function yi(e,t){return-1!==e.indexOf(t)}var bi=function(e){return e.trim()},wi=function(e){return e.replace(/^\$/,"")};function Si(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 xi=Object.prototype,ki=xi.hasOwnProperty,Ci=xi.toString,Pi=Array.isArray||function(e){return"[object Array]"===Ci.call(e)},Ei=function(e){return"function"==typeof e},Fi=function(e){return e===Object(e)&&!Pi(e)},Ii=function(e){if(Fi(e)){for(var t in e)if(ki.call(e,t))return!1;return!0}return!1},Ti=function(e){return void 0===e},Ri=function(e){return"[object String]"==Ci.call(e)},Mi=function(e){return Ri(e)&&0===e.trim().length},Li=function(e){return null===e},Ai=function(e){return Ti(e)||Li(e)},Oi=function(e){return"[object Number]"==Ci.call(e)&&e==e},Di=function(e){return Oi(e)&&e>0},$i=function(e){return"[object Boolean]"===Ci.call(e)},qi=function(e){return yi(gi,e)},Bi=function(e){return yi(mi,e)};function Ni(e){return null===e||"object"!=typeof e}function Hi(e,t){return{}.toString.call(e)==="[object "+t+"]"}function ji(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 zi(e,Error)}}function Ui(e){return"u">typeof Event&&zi(e,Event)}function zi(e,t){try{return e instanceof t}catch(e){return!1}}var Vi=[!0,"true",1,"1","yes"],Wi=function(e){return yi(Vi,e)},Gi=[!1,"false",0,"0","no"],Ki=["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"],Qi=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=e.toLowerCase();return Ki.concat(t).some(function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)})};function Zi(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),Oi(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),Zi(null!=i?i:n,t,n,r))}var Ji=function(){"use strict";function e(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=Zi(e.bucketSize,0,100,e._logger),this._refillRate=Zi(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=Zi(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(),r=String(e),i=this._buckets[r];return i?this._applyRefill(i,n):this._buckets[r]=i={tokens:this._bucketSize,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===i.tokens)},t.stop=function(){this._buckets={}},e}(),Yi="Mobile",Xi="Android",es="Tablet",ts="Android Tablet",ns="iPad",rs="Apple Watch",is="Safari",ss="BlackBerry",os="Samsung Internet",as="Chrome",us="Chrome iOS",ls="Internet Explorer",cs="Internet Explorer Mobile",ds="Opera",hs="Microsoft Edge",fs="Firefox",ps="Firefox iOS",_s="Nintendo",vs="PlayStation",gs="Xbox",ms="Android Mobile",ys="Mobile Safari",bs="Windows",ws="Windows Phone",Ss="Nokia",xs="Ouya",ks="Generic "+Yi.toLowerCase(),Cs="Generic "+es.toLowerCase(),Ps="Konqueror",Es="Oculus Browser",Fs="Vivaldi",Is="Yandex",Ts="Whale",Rs="DuckDuckGo",Ms="Pale Moon",Ls="Waterfox",As="Brave",Os="Claude",Ds="Codex",$s="ChatGPT",qs="Google Search App",Bs=new RegExp("Version/(\\d+(\\.\\d+)?)"),Ns=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Hs=new RegExp(gs,"i"),js=new RegExp("PlayStation \\w+","i"),Us=new RegExp("Nintendo \\w+","i"),zs=new RegExp("BlackBerry|PlayBook|BB10","i"),Vs={"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"},Ws=function(e,t,n,r){t=t||"";var i=function(e){return null!=e&&e.brave?As:null}(n);return i||(null!=r&&r.detectGoogleSearchApp&&yi(e,"GSA/")?qs:yi(e," OPR/")&&yi(e,"Mini")?"Opera Mini":yi(e," OPR/")?ds:zs.test(e)?ss:yi(e,"IEMobile")||yi(e,"WPDesktop")?cs:yi(e,"OculusBrowser")?Es:yi(e,"SamsungBrowser")?os:yi(e,"Edge")||yi(e,"Edg/")?hs:yi(e,"Vivaldi/")?Fs:yi(e,"YaBrowser/")?Is:yi(e,"Whale/")?Ts:yi(e,"DuckDuckGo/")||yi(e,"Ddg/")?Rs:yi(e,"Claude/")?Os:yi(e,"Codex/")?Ds:yi(e,"ChatGPT/")?$s:yi(e,"FBIOS")?"Facebook Mobile":yi(e,"UCWEB")||yi(e,"UCBrowser")?"UC Browser":yi(e,"CriOS")?us:yi(e,"CrMo")||yi(e,as)?as:yi(e,Xi)&&yi(e,is)?ms:yi(e,"FxiOS")?ps:yi(e.toLowerCase(),Ps.toLowerCase())?Ps:yi(e,"Brave/")?As:function(e,t){return t&&yi(t,"Apple")||function(e){return yi(e,is)&&!yi(e,as)&&!yi(e,Xi)}(e)}(e,t)?yi(e,Yi)?ys:is:yi(e,"PaleMoon/")?Ms:yi(e,"Waterfox/")?Ls:yi(e,fs)?fs:yi(e,"MSIE")||yi(e,"Trident/")?ls:yi(e,"Gecko")?fs:"")},Gs=((r={})[cs]=[new RegExp("rv:(\\d+(\\.\\d+)?)")],r[hs]=[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],r[as]=[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],r[us]=[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],r["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],r[is]=[Bs],r[ys]=[Bs],r[ds]=[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],r[fs]=[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],r[ps]=[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],r[Ps]=[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],r[ss]=[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Bs],r[ms]=[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],r[os]=[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],r[Es]=[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],r[Fs]=[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],r[Is]=[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],r[Ts]=[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],r[As]=[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],r[Os]=[Ns],r[Ds]=[Ns],r[$s]=[Ns],r[Rs]=[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],r[Ms]=[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],r[Ls]=[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],r[qs]=[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],r[ls]=[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],r.Mozilla=[new RegExp("rv:(\\d+(\\.\\d+)?)")],r),Ks=function(e,t,n,r){var i=Gs[Ws(e,t,n,r)];if(Ti(i))return null;for(var s=0;i.length>s;s++){var o=e.match(i[s]);if(o)return parseFloat(o[o.length-2])}return null},Qs=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),function(e){return[gs,e&&e[1]||""]}],[new RegExp(_s,"i"),[_s,""]],[new RegExp(vs,"i"),[vs,""]],[zs,[ss,""]],[new RegExp(bs,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[ws,""];if(new RegExp(Yi).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=Vs[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[bs,r]}return[bs,""]}],[/((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=Ti(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),function(e){return e&&e[2]?[Xi,[e[2],e[3],e[4]||"0"].join(".")]:[Xi,""]}],[/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",""]]],Zs=function(e){for(var t=0;Qs.length>t;t++){var n=Qs[t],r=n[1],i=n[0].exec(e),s=i&&(Ei(r)?r(i,e):r);if(s)return s}return["",""]},Js=function(e){return Us.test(e)?_s:js.test(e)?vs:Hs.test(e)?gs:new RegExp(xs,"i").test(e)?xs:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?ws:/iPad/.test(e)?ns:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?rs:zs.test(e)?ss:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ss,"i").test(e)?Ss:/(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(Yi).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Xi:ts:new RegExp("(pda|Mobile)","i").test(e)?ks:new RegExp(es,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?Cs:""},Ys=function(e,t){var n,r,i,s,o=Js(e);return o===ns||o===ts||"Kobo"===o||"Kindle Fire"===o||o===Cs?es:o===_s||o===gs||o===vs||o===xs?"Console":o===rs?"Wearable":o?Yi:"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!==(r=null==t?void 0:t.screenWidth)&&void 0!==r?r:0,null!==(i=null==t?void 0:t.screenHeight)&&void 0!==i?i:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?Yi:es:"Desktop"},Xs=/\bFBAV\/(\d+(?:\.\d+)*)/i,eo=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Xs],[/\bFBAN\/EMA\b/i,"Facebook Lite",Xs],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Xs],[/\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"]],to="[Truncated]",no="[Unserializable]";function ro(e){for(var t="",n=0;e.length>n;n++){var r=e.charCodeAt(n);if(55296>r||r>56319)t+=56320>r||r>57343?e[n]:"�";else{var i=e.charCodeAt(n+1);56320>i||i>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}function io(e,t){if(!t)return e;var n=[];try{n=Object.keys(t)}catch(e){n=[]}for(var r,i=f(n);!(r=i()).done;){var s=r.value,o=void 0;try{o=t[s]}catch(e){o=no}Object.defineProperty(e,s,{value:o,enumerable:!0,writable:!0,configurable:!0})}return e}Date,Date;var so,oo,ao,uo=3e5,lo=function(){"use strict";function e(){this._until=0,this._installedAt=0}var t=e.prototype;return t.record=function(e){if("too-large"!==e.kind)if("retry-later"===e.kind){if(e.retryAfterMs){var t=this.isOpen(),n=Date.now(),r=Math.min(e.retryAfterMs,uo);if(!t)return this._installedAt=n,void(this._until=n+r);this._until=Math.max(this._until,Math.min(n+r,this._installedAt+uo))}}else this.reset()},t.remainingMs=function(){var e=Date.now();if(this._installedAt-5e3>e)return this.reset(),0;var t=Math.min(uo,Math.max(0,this._until-e));return 0===t&&this.reset(),t},t.isOpen=function(){return this.remainingMs()>0},t.reset=function(){this._until=0,this._installedAt=0},e}(),co=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ho(e,t){return"string"==typeof(n=e)&&co.test(n)?e:t();var n}function fo(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 po(e){return e?e.split("#")[0]:e}function _o(e){try{return e()}catch(e){return}}function vo(e,t){var n=setTimeout(e,t);return null!=n&&n.unref&&(null==n||n.unref()),n}function go(e,t,n){return mo.apply(this,arguments)}function mo(){return(mo=h(l().m(function e(t,n,r){var i;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){i=vo(function(){try{null==r||r(),e()}catch(e){t(e)}},n)})]);case 1:return e.a(2,e.v);case 2:return e.p=2,clearTimeout(i),e.f(2);case 3:return e.a(2)}},e,null,[[0,,2,3]])}))).apply(this,arguments)}function yo(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,r){so||(so={});var i=so[r];if(i)n[i[0]]=i[1];else for(var s=e(r),o=s.length-1;o>=0;o--){var a,u=null==(a=s[o])?void 0:a.filename,l=t[r];if(u&&l){n[u]=l,so[r]=[u,l];break}}return n},{}))}}var bo=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"},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),s=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(s,n),$exception_level:"error"}},t.modifyFrames=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:n=f(t);case 1:if((r=n()).done){e.n=4;break}if(!((i=r.value).stacktrace&&i.stacktrace.frames&&Pi(i.stacktrace.frames))){e.n=3;break}return e.n=2,this.applyModifiers(i.stacktrace.frames);case 2:i.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,r,i,s=this;if(null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack)try{i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch(e){}return u({},e,{cause:r,stack:i,errors:null==(n=e.errors)?void 0:n.map(function(e){return s.parseStacktrace(e,t)})})},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,r=f(this.coercers);!(n=r()).done;){var i=n.value;if(i.match(e))return i.coerce(e,t)}return this.coerceFallback(t)},t.applyModifiers=function(){var e=h(l().m(function e(t){var n,r,i,s;return l().w(function(e){for(;;)switch(e.n){case 0:n=t,r=f(this.modifiers);case 1:if((i=r()).done){e.n=4;break}return s=i.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=[],r=function(e,i,s){var o=n.length,a=void 0===i?u({type:"string"==typeof t.type&&t.type.length>0?t.type:"generic"},"boolean"==typeof t.handled?{handled:t.handled}:void 0===t.handled?{handled:!0}:{},{synthetic:"boolean"==typeof t.synthetic?t.synthetic:e.synthetic,exception_id:o}):{type:"chained",source:s,synthetic:e.synthetic,exception_id:o,parent_id:i},l={type:e.type,value:e.value,mechanism:a};e.stack&&(l.stacktrace={type:"raw",frames:e.stack}),n.push(l),e.cause&&r(e.cause,o,"cause");for(var c,d=f(null!==(h=e.errors)&&void 0!==h?h:[]);!(c=d()).done;){var h;r(c.value,o,"member")}};return r(e),n},t.buildParsingContext=function(e){var t;return{chunkIdMap:yo(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}},t.getAggregateErrors=function(e){try{if(ji(e))for(var t=Object.getPrototypeOf(e),n=0;t&&100>n;n++){var r,i=null==(r=Object.getOwnPropertyDescriptor(t,"constructor"))?void 0:r.value;if("function"==typeof i&&"AggregateError"===i.name){var s=e.errors;return Pi(s)?s:void 0}t=Object.getPrototypeOf(t)}}catch(e){}},t.buildCoercingContext=function(e,t,n){var r=this;void 0===n&&(n=0);var i=0,s=0,o=!1,a=new Set,l=[],c={},d=function(e,t,n){void 0===n&&(n=0);var d=h(t,n),f=d.apply;if(d.apply=function(t){l.push(e);try{return f(t)}finally{l.pop()}},n>4||n>0&&-1!==l.indexOf(e))return r.coerceFallback(d);var p="object"==typeof e&&null!==e||"function"==typeof e;if(!(0===n&&i>=50||p&&a.has(e))){p&&a.add(e),0===n&&i++;var _,v,g=r.getAggregateErrors(e);o||(o=!!g);try{if(!(_=r.applyCoercers(e,d)))throw c}catch(e){if(e===c)return void(0===n&&i--);if(!o)throw e;_=r.coerceFallback(d)}if(!g||i>=50)return _;try{v=g.length}catch(e){return _}if(!Number.isInteger(v)||0>v||v>4294967295)return _;for(var m=[],y=0;50>i&&1e3>s&&v>y;y++){s++;var b=void 0;try{b=d.next(g[y])}catch(e){i++,b=r.coerceFallback(h(t+1))}b&&m.push(b)}return u({},_,{errors:m})}},h=function(n,r){return void 0===r&&(r=0),u({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:0==n?e:{},apply:function(e){var t=d(e,n,r+1);if(!t)throw c;return t},next:function(e){return d(e,n+1)}})},f=h(n);return u({},f,{apply:function(e){var t;return null!==(t=d(e,n))&&void 0!==t?t:r.coerceFallback(f)}})},e}(),wo=/^([a-z][a-z0-9.+-]+):/i,So=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function xo(e){if(!e||"<anonymous>"===e)return!1;var t=wo.exec(e);return!t||So.includes(t[1].toLowerCase())}function ko(e,t,n,r,i){var s={platform:e,filename:t,function:"<anonymous>"===n?"?":n,in_app:xo(t)};return Ti(r)||(s.lineno=r),Ti(i)||(s.colno=i),s}var Co=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Po=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Eo=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Fo=/\((\S*)(?::(\d+))(?::(\d+))\)/,Io=function(e,t){var n=Po.exec(e);if(n)return ko(t,n[1],"?",+n[2],+n[3]);var r=Eo.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var i=Fo.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var s=Co(r[1]||"?",r[2]);return ko(t,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},To=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ro=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mo=function(e,t){var n=To.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Ro.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||"?",o=Co(s,i);return ko(t,i=o[1],s=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Lo=/\(error: (.*)\)/;function Ao(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function Oo(e){for(var t=1;10>=t;t++){var n=e.length-2*t;if(0>n)break;for(var r=!0,i=0;t>i;i++)if(!Ao(e[n+i],e[n+t+i])){r=!1;break}if(r){for(var s=0;t>s;s++)e[n+s]=e[n+t+s];return e.length=n+t,{start:n,length:t}}}}function Do(e,t){var n=t.start+t.length,r=qo(e,t);r&&e.splice(n+r===e.length?n:t.start,r)}function $o(e,t){for(var n=t.start;n>0&&Ao(e[n-1],e[n-1+t.length]);)n--;return t.start-n}function qo(e,t){for(var n=t.start+t.length,r=n;e.length>r&&Ao(e[r],e[r-t.length]);)r++;return r-n}function Bo(e,t){for(var n,r=t[0],i=e.length-(r?$o(e,r):0),s=f(t);!(n=s()).done;)i-=qo(e,n.value);return i}function No(e,t,n){for(var r=0;e.length>r;r++){var i=e[(t+r)%e.length],s=e[(n+r)%e.length];if(i!==s)return s>i}return!1}var Ho=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=Ri(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 Hi(e,"DOMException")},t.isDOMError=function(e){return Hi(e,"DOMError")},e}(),jo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return ji(e)},t.coerce=function(e,t){var n,r=this.getStack(e),i=void 0===r?null==(n=t.syntheticException)?void 0:n.stack:void 0,s=!!i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=r?r:i,cause:e.cause?t.next(e.cause):void 0,synthetic:s}},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){try{var t=e.stacktrace;if("string"==typeof t&&t.length>0)return t;var n=e.stack;return"string"==typeof n&&n.length>0?n:void 0}catch(e){return}},e}(),Uo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return!!Hi(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 r=t.apply(e.message);return u({},r,{stack:null!==(n=this._buildLocationStack(e))&&void 0!==n?n:r.stack,synthetic:!0})},t._hasUsableMessage=function(e){return Ri(e.message)&&e.message.length>0},t._buildLocationStack=function(e){var t,n,r=e,i=null!==(t=r.lineno)&&void 0!==t?t:0,s=null!==(n=r.colno)&&void 0!==n?n:0;if(Ri(r.filename)&&0!==r.filename.length&&0!==i)return"Error\n at "+r.filename+":"+i+":"+s},e}(),zo=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Vo=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,r=this.getInfos(e),i=r[0],s=r[1];return{type:null!=i?i:"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,r=e.match(zo);return r&&(t=r[1],n=r[2]),[t,n]},e}(),Wo=["fatal","error","warning","log","info","debug"];function Go(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+"...":i}return""}var Ko=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,r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null!==(n=this.getStack(e))&&void 0!==n?n:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}},t.getType=function(e){if(Ui(e))return e.constructor.name;var t="name"in e?e.name:void 0;return Ri(t)&&!Mi(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: "+Go(e)},t.isSeverityLevel=function(e){return Ri(e)&&!Mi(e)&&Wo.indexOf(e)>=0},t.getStack=function(e){try{return Ri(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:Ri(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(ji(n))return n}},t.getObjectClassName=function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}},e}(),Qo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Ui(e)},t.coerce=function(e,t){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Go(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Zo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Ni(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}(),Jo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Hi(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)},t.isCustomEventWrappingRejection=function(e){if(!Ui(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,r=this.getUnhandledRejectionReason(e);return Ni(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}:t.apply(r)},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}(),Yo="$message",Xo="$timestamp",ea=new Set([Yo,Xo]),ta={enabled:!0,max_bytes:32768};function na(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:ta.enabled,max_bytes:ia(e.max_bytes,ta.max_bytes)}:u({},ta)}var ra=function(){"use strict";function e(e){this._entries=[],this._totalBytes=0,this._config=na(e)}var t=e.prototype;return t.setConfig=function(e){this._config=na(e),this._trimToMaxBytes()},t.add=function(e){var t=function(e){var t;try{t=Si(e)}catch(e){return}try{var n=JSON.parse(t);if(!Fi(n))return;var r=n,i=r[Yo],s=r[Xo];if(!Ri(i)||0===i.trim().length)return;if(!Ri(s)&&!Oi(s))return;return{step:r,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,r=0;t.length>r;r++)"%"===t[r]?(n+=1,r+=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 ia(e,t){if(!Oi(e)||1/0===e||-1/0===e)return t;var n=Math.floor(e);return 0>n?t:n}var sa=function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function oa(e){return"string"==typeof e||e}function aa(e){return"string"==typeof e?e:void 0}var ua,la=["$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"]),ca="NativeGzipValidationError",da=function(e){return e.length>=2&&31===e[0]&&139===e[1]},ha=function(e,t){return e===pi.GZipJS||t===pi.GZipJS||"gzip"===t},fa=function(e){return!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"")},pa=function(e){for(var t=function(){if(ua)return ua;ua=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;ua[e]=t>>>0}return ua}(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0},_a=function(e){throw fo(ca,"Native gzip produced invalid output: "+e)},va=function(){var e=h(l().m(function e(t,n){var r,i,s,o,a;return l().w(function(e){for(;;)switch(e.n){case 0:return 18>t.size&&_a("too-short"),o=Uint8Array,e.n=1,t.slice(0,10).arrayBuffer();case 1:return r=new o(e.v),da(r)&&8===r[2]||_a("invalid-header"),a=DataView,e.n=2,t.slice(t.size-8).arrayBuffer();case 2:(i=new a(e.v)).getUint32(0,!0)!==pa(n)&&_a("invalid-crc"),s=n.length>>>0,i.getUint32(4,!0)!==s&&_a("invalid-size");case 3:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}();function ga(e,t,n){return ma.apply(this,arguments)}function ma(){return ma=h(l().m(function e(t,n,r){var i,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,i=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(i).then(function(){return o.close()}).catch(function(){var e=h(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,va(c,i);case 3:return e.a(2,c);case 4:if(e.p=4,d=e.v,null==r||!r.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]])})),ma.apply(this,arguments)}var ya={}.propertyIsEnumerable;function ba(e,t){try{return xa(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function wa(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:to};if(n.remainingNodes--,$i(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){var n=e.toString(),r=BigInt("9223372036854775808");return e>=r||-r>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 i=BigInt(e).toString();return e>=0x8000000000000000||-0x8000000000000000>e?(null==t||t.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}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(r>=20)return{stringValue:to};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 wa(a.call(e),t,n,r+1)}catch(e){}return Pi(e)?{arrayValue:{values:Sa(e,t,n,r+1)}}:{kvlistValue:{values:xa(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:ro(String(e))}}function Sa(e,t,n,r){for(var i=[],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(Ai(a))continue;i.push(wa(a,t,n,r))}catch(e){i.push({stringValue:no})}return e.length>o&&i.push({stringValue:to}),i}function xa(e,t,n,r){var i=[];for(var s in e)if(ya.call(e,s)){if(!s){null==t||t.debug("Dropping an attribute with an empty key");continue}if(i.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(Li(o)||Ti(o))continue;i.push({key:ro(s),value:wa(o,t,n,r)})}catch(e){i.push({key:ro(s),value:{stringValue:no}})}}return i}function ka(e,t,n){return u({},io({},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=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Pa(e,t){for(var n=io({},e),r={},i=0,s=Ca;s.length>i;i++){var o=s[i];({}).hasOwnProperty.call(n,o)&&(r[o]=n[o],delete n[o])}return[].concat(ba(n,t),ba(r,t))}var Ea={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","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}},Ia=Fa.info;function Ta(e){try{return ro(String(e))}catch(e){return no}}function Ra(e,t,n,r){var i,s=Fa[e.level||"info"]||Ia,o=s.text,a=s.number,l=(void 0===(i=Oi(r)?r:void 0)&&(i=Date.now()),String(i)+"000000"),c={};t.distinctId&&(c.posthogDistinctId=t.distinctId),t.sessionId&&(c.sessionId=t.sessionId),t.windowId&&(c["window.id"]=t.windowId),Ai(t.sessionStartTimestamp)||(c.sessionStartTimestamp=String(t.sessionStartTimestamp)),Ai(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 d=u({},c),h=e.attributes;if(h){var p=[];try{p=Object.keys(h)}catch(e){p=[]}for(var _,v=f(p);!(_=v()).done;){var g=_.value,m=void 0;try{m=h[g]}catch(e){m=no}Object.defineProperty(d,g,{value:m,enumerable:!0,writable:!0,configurable:!0})}}var y={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:a,severityText:o,body:{stringValue:Ta(e.body)},attributes:ba(d,n)};return e.trace_id&&(y.traceId=e.trace_id),e.span_id&&(y.spanId=e.span_id),Ti(e.trace_flags)||(y.flags=e.trace_flags),y}function Ma(e,t,n){return ka(e,t,n)}function La(e,t,n,r){return{resourceLogs:[{resource:{attributes:Pa(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var Aa=function(){"use strict";function e(e){this._onFire=e,this._firesAt=0}var t=e.prototype;return t.arm=function(e){var t=this;this.clear(),this._firesAt=Date.now()+e,this._timer=vo(function(){t._timer=void 0,t._onFire()},e)},t.armNoEarlierThan=function(e){this._timer&&Date.now()+e<=this._firesAt||this.arm(e)},t.clear=function(){this._timer&&(clearTimeout(this._timer),this._timer=void 0)},o(e,[{key:"pending",get:function(){return!!this._timer}}])}();function Oa(){return.75+.5*Math.random()}function Da(e,t,n,r){var i=e*Math.pow(2,Math.min(Math.max(0,t-1),6));return Math.round((void 0===r?i:Math.min(i,Math.max(r,e)))*n)}var $a=function(){"use strict";function e(e,t,n,r,i,s,o){var a,u=this;void 0===s&&(s=function(){return Promise.resolve()}),this._instance=e,this._config=t,this._logger=n,this._getContext=r,this._onReady=i,this._waitForStoragePersist=s,this._scopeName=o,this._flushTimer=new Aa(function(){return u._flushInBackground()}),this._flushPromise=null,this._evictedSinceAdvance=0,this._queueGeneration=0,this._retryAfter=new lo,this._consecutiveFlushFailures=0,this._flushJitter=1,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(fi.LogsQueue,[])},t.reset=function(){this._flushTimer.clear(),this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._consecutiveFlushFailures=0,this._flushJitter=1,this._retryAfter.reset(),this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost},t.onReconnect=function(){this._consecutiveFlushFailures=0,this._flushJitter=1,this._retryAfter.isOpen()?this._hasQueuedRecords()&&this._armFlushTimer():this._flushInBackground()},t.captureLog=function(e,t){var n,r=this;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var i=this._runBeforeSend(e);if(null!==i)if(i.body){if(this._checkRateLimit()){var s={record:Ra(i,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 r._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,r=e,i=f(Pi(t)?t:[t]);!(n=i()).done;){var s=n.value;try{var o=s(r);if(!o)return this._logger.info("Log was rejected in beforeSend function"),null;r=o}catch(e){return this._logger.error("Error in beforeSend function for log:",e),null}}return r},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=h(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=h(l().m(function e(){var t,n,r,i,s,o,a,u,c,d,h,f;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),0!==(n=null!==(t=this._instance.getPersistedProperty(fi.LogsQueue))&&void 0!==t?t:[]).length){e.n=1;break}return e.a(2);case 1:r=n.length,i=0;case 2:if(0>=n.length||i>=r){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=La(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("Logs batch of size "+c.length+" was too large for the ingestion endpoint, reducing batch size to "+this._maxBatchRecordsPerPost),e.a(3,2);case 5:if(this._retryAfter.record(f),this._flushTimer.pending&&this._flushTimer.arm(Math.max(this._flushIntervalMs,this._retryAfter.remainingMs())),"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 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(fi.LogsQueue))&&void 0!==o?o:[],i+=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=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:return r=Math.max(0,t-this._evictedSinceAdvance),i=null!==(n=this._instance.getPersistedProperty(fi.LogsQueue))&&void 0!==n?n:[],this._instance.setPersistedProperty(fi.LogsQueue,i.slice(r)),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 Ma(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(fi.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(fi.LogsQueue,n),this._maxBufferSize>n.length||this._retryAfter.isOpen()?this._armFlushTimer():this._flushInBackground()}},t._armFlushTimer=function(){this._flushTimer.pending||this._flushTimer.arm(Math.max(this._flushIntervalMs,this._retryAfter.remainingMs()))},t._nextFlushDelay=function(){return Math.max(Da(this._flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())},t._hasQueuedRecords=function(){var e=this._instance.getPersistedProperty(fi.LogsQueue);return!!e&&e.length>0},t.shutdown=function(){var e=h(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),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,go(n,t);case 3:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.flushWithTimeout=function(){var e=h(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,go(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,e._flushJitter=1},function(t){e._consecutiveFlushFailures++,e._flushJitter=Oa(),e._logger.error("PostHog logs flush failed:",t)}).finally(function(){!e._instance.isDisabled&&e._hasQueuedRecords()&&e._flushTimer.armNoEarlierThan(e._nextFlushDelay())})},e}(),qa=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Ba(e){return String(e)+"000000"}function Na(e,t,n,r){var i="";return r&&(i=Object.keys(r).sort().map(function(e){return JSON.stringify(e)+":"+JSON.stringify(r[e])}).join(",")),e+"\0"+t+"\0"+(null!=n?n:"")+"\0"+i}var Ha=function(){"use strict";function e(e,t,n){var r=this;this._instance=e,this._config=t,this._logger=n,this._series=new Map,this._flushTimer=new Aa(function(){return r.flush().catch(function(e){r._logger.error("Metrics flush failed:",e)})}),this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._retryAfter=new lo,this._consecutiveFlushFailures=0,this._flushJitter=1,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=h(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._retryAfter.reset(),this._consecutiveFlushFailures=0,this._flushJitter=1,this._flushTimer.clear(),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,r;try{n=t.attributes?u({},t.attributes):void 0,r=Na(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 i=this._series.get(r);if(!i){if(!this._admitNewSeries())return;i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this._series.set(r,i)}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(i,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(qa.length+1).fill(0)});var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(e,t){for(var n=0;t.length>n;n++)if(t[n]>=e)return n;return t.length}(t,qa)]+=1}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,r=e,i=f(Pi(t)?t:[t]);!(n=i()).done;){var s=n.value;try{var o=s(r);if(!o)return this._logger.info("Metric was rejected in beforeSend function"),null;r=o}catch(e){return this._logger.error("Error in beforeSend function for metric:",e),null}}return r},t._armFlushTimer=function(){this._flushTimer.pending||this._flushTimer.arm(this._nextFlushDelay())},t._nextFlushDelay=function(){return Math.max(Da(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())},t._doFlush=function(){var e=h(l().m(function e(){var t,n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),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(r=e.v,n===this._generation){e.n=3;break}return e.a(2);case 3:this._retryAfter.record(r),"retry-later"===r.kind?(this._consecutiveFlushFailures++,this._flushJitter=Oa()):(this._consecutiveFlushFailures=0,this._flushJitter=1),this._flushTimer.pending&&this._flushTimer.arm(this._nextFlushDelay()),e.n="ok"===(i=r.kind)?4:"retry-later"===i?5:"too-large"===i?6:"fatal"===i?7:8;break;case 4:case 8:return e.a(2);case 5:return this._mergeWindowBack(t),this._flushTimer.armNoEarlierThan(this._nextFlushDelay()),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:",r.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 ka(e,t,n)}(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Pa(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i},t._buildMetrics=function(e){for(var t,n=Ba(Date.now()),r=new Map,i=f(e.values());!(t=i()).done;){var s,o=t.value,a=Na(o.type,o.name,o.unit,void 0),l=r.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:[]},r.set(a,l));var c=ba(null!==(s=o.attributes)&&void 0!==s?s:{},this._logger),d=Ba(o.windowStartMs);if("count"===o.type){var h,p={attributes:c,startTimeUnixNano:d,timeUnixNano:n,asDouble:null!==(h=o.total)&&void 0!==h?h: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:d,timeUnixNano:n,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:qa})}return Array.from(r.values())},t._mergeWindowBack=function(e){for(var t,n,r,i=f(e);!(r=i()).done;){var s=r.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 ja(e,t){var n;if(e)return null==(n=e.find(function(e){return e.type===t}))?void 0:n.value}function Ua(e){var t=!0;return{dispose:function(){if(t){t=!1;var n=e();n&&Ei(n.then)&&n.then(void 0,function(){})}}}}var za="0.9.0",Va={DEBUG:!1,LIB_VERSION:za,LIB_NAME:"browser-common",JS_SDK_VERSION:za},Wa="u">typeof window?window:void 0,Ga="u">typeof globalThis?globalThis:Wa,Ka=null==Ga?void 0:Ga.navigator,Qa=null==Ga?void 0:Ga.document,Za=null==Ga?void 0:Ga.location,Ja=null==Ga?void 0:Ga.fetch,Ya=null!=Ga&&Ga.XMLHttpRequest&&"withCredentials"in new Ga.XMLHttpRequest?Ga.XMLHttpRequest:void 0,Xa=null==Ga?void 0:Ga.AbortController,eu=null==Ga?void 0:Ga.CompressionStream,tu=null==Ka?void 0:Ka.userAgent;function nu(){return!(!Wa||!1===Wa.navigator.onLine)}var ru=function(e,t){var n=(void 0===t?{}:t).debugEnabled,r={_log:function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;r>s;s++)i[s-1]=arguments[s];Wa&&(Va.DEBUG||Wa.POSTHOG_DEBUG||n)&&!Ti(Wa.console)&&Wa.console&&("__rrweb_original__"in Wa.console[t]?Wa.console[t].__rrweb_original__:Wa.console[t]).apply(void 0,[e].concat(i))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["debug"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["error"].concat(t))},critical:function(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];(t=console).error.apply(t,[e].concat(r))},uninitializedWarning:function(e){r.error("You must initialize PostHog before calling "+e)},createLogger:function(t,n){return ru(e+" "+t,n)}};return r},iu=ru("[PostHog.js]"),su=iu.createLogger;function ou(e,t){Pi(e)&&e.forEach(t)}function au(e,t){if(!Ai(e))if(Pi(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)ki.call(e,n)&&t(e[n],n)}var uu=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i=0,s=n;s.length>i;i++){var o=s[i];for(var a in o)void 0!==o[a]&&(e[a]=o[a])}return e};function lu(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var cu=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){iu.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),iu.critical(e)}}},du=function(e){var t={};return au(e,function(e,n){(Ri(e)&&e.length>0||Oi(e))&&(t[n]=e)}),t};function hu(e){for(var t=u({},e),n=0,r=["name","message","stack","cause","errors"];r.length>n;n++){var i=r[n];try{i in e&&(t[i]=e[i])}catch(e){}}return t}var fu=["herokuapp.com","vercel.app","netlify.app"];function pu(e){var t=null==e?void 0:e.hostname;if(!Ri(t))return!1;for(var n=t.split(".").slice(-2).join("."),r=0,i=fu;i.length>r;r++)if(n===i[r])return!1;return!0}function _u(e,t,n,r){var i=null!=r?r:{},s=i.capture,o=i.passive;null==e||e.addEventListener(t,n,{capture:void 0!==s&&s,passive:void 0===o||o})}function vu(e){return"ph_toolbar_internal"===e.name}function gu(e){return"$survey_response_"+e}function mu(e,t){if(!t)return null;var n=e[gu(t)];return Pi(n)?[].concat(n):n}function yu(e){var t,n=e.event,r=e.survey,i=e.responses,s=void 0===i?{}:i,o=e.submissionId,a=e.completed,l=e.surveyLanguage,c=e.questionSnapshots;return u({},!Ti(o)&&{$survey_submission_id:o},"sent"===n?!Ti(a)&&{$survey_completed:a}:{$survey_partially_completed:bu(s)},l&&((t={}).$survey_language=l,t),function(e,t,n){void 0===e&&(e={});var r={};return t.questions.forEach(function(t){if(!Ti(t.originalQuestionIndex)){var n,i=0===(n=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+n,s=mu(e,t.id);Ti(s)||(r[i]=s)}}),u({$survey_questions:t.questions.map(function(t){var r,i;return{id:t.id,question:null!==(r=null==n?void 0:n[null!==(i=t.id)&&void 0!==i?i:""])&&void 0!==r?r:t.question,response:mu(e,t.id)}})},e,r)}(s,r,c))}function bu(e){return void 0===e&&(e={}),Object.values(e).some(function(e){return!Ai(e)})}function wu(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 Su(e){return"string"==typeof e&&e.trim()?e.trim():null}function xu(e){return e.toLowerCase()}function ku(e,t,n){if(!e||!t)return null;var r=xu(t),i=Object.keys(e).find(function(e){return xu(e)===r});if(i)return null==n||n.debug("Found exact translation match: "+i),i;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(e).find(function(e){return xu(e)===s});if(o)return null==n||n.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}var Cu=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Pu(e,t,n){var r,i=ku(e.translations,t,n),s=u({},e),o=!1;if(i){var a,l=null==(a=e.translations)?void 0:a[i];if(l)if(null==n||n.info("Applying survey-level translation for language: "+i),Ti(l.name)||(s.name=l.name,o=!0),s.appearance){for(var c=u({},s.appearance),d=0,h=Cu;h.length>d;d++){var f=h[d],p=l[f];Ti(p)||(c[f]=p,o=!0)}s.appearance=c}else(function(e){return Cu.some(function(t){return!Ti(e[t])})})(l)&&(o=!0)}var _=e.questions.map(function(e){return function(e,t,n){var r,i=ku(e.translations,t,n);if(!i)return{question:e,matchedKey:null,hasChanges:!1};var s=null==(r=e.translations)?void 0:r[i];if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=u({},e),a=!1;return Ti(s.question)||(o.question=s.question,a=!0),Ti(s.description)||(o.description=s.description,a=!0),Ti(s.buttonText)||(o.buttonText=s.buttonText,a=!0),"link"in o&&!Ti(s.link)&&(o.link=s.link,a=!0),"lowerBoundLabel"in o&&!Ti(s.lowerBoundLabel)&&(o.lowerBoundLabel=s.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!Ti(s.upperBoundLabel)&&(o.upperBoundLabel=s.upperBoundLabel,a=!0),"choices"in o&&function(e){return Pi(e.choices)}(s)&&(o.choices=s.choices,a=!0),{question:a?o:e,matchedKey:a?i:null,hasChanges:a}}(e,t,n)}),v=_.map(function(e){return e.question}),g=_.some(function(e){return e.hasChanges}),m=null;return i||(m=(null==(r=_.find(function(e){return e.matchedKey}))?void 0:r.matchedKey)||null),g&&(s.questions=v,o=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:s,matchedKey:o?i||m:null}}function Eu(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Fu(e){var t;return Eu(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var Iu=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}},Tu=function(e){return e.toLowerCase()},Ru={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 Iu(t,e)})})},not_regex:function(e,t){return t.every(function(t){return e.every(function(e){return!Iu(t,e)})})},icontains:function(e,t){return t.map(Tu).some(function(t){return e.map(Tu).some(function(e){return t.includes(e)})})},not_icontains:function(e,t){return t.map(Tu).every(function(t){return e.map(Tu).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 Mu(e,t){return!e||Object.entries(e).every(function(e){var n=e[1],r=null==t?void 0:t[e[0]];if(null==r)return!1;var i=Ru[n.operator];return!!i&&i(n.values.map(String),[String(r)])})}var Lu=function(e){for(var t=[].concat(e),n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),i=[t[r],t[n]];t[n]=i[0],t[r]=i[1]}return t},Au=su("[Surveys]"),Ou="PostHog is not capturing, so a survey response cannot be recorded";function Du(e){return Ei(e.is_capturing)?e.is_capturing():!e.has_opted_out_capturing()}function $u(e){return!(!e.start_date||e.end_date)}function qu(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Bu=function(e,t){return""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t)},Nu=function(e){return Bu("seenSurvey_",e)},Hu=function(e){try{var t=Nu(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Au.error("Failed to persist survey seen state",e)}},ju=[Qr,Zr,"api"],Uu={ignoreConditions:!1,ignoreDelay:!1,displayType:hi},zu="distinct_id",Vu="$device_id",Wu="$device_model",Gu="__alias",Ku="$fbc",Qu="$fbc_persistence",Zu="$fbp",Ju="$fbp_persistence",Yu="__timers",Xu="$autocapture_disabled_server_side",el="$heatmaps_enabled_server_side",tl="$exception_capture_enabled_server_side",nl="$error_tracking_suppression_rules",rl="$error_tracking_capture_extension_exceptions",il="$web_vitals_enabled_server_side",sl="$dead_clicks_enabled_server_side",ol="$product_tours_enabled_server_side",al="$logs_capture_enabled_server_side",ul="$web_vitals_allowed_metrics",ll="$session_recording_remote_config",cl="$replay_sample_rate",dl="$replay_override_sampling",hl="$replay_override_linked_flag",fl="$replay_override_url_trigger",pl="$replay_override_event_trigger",_l="$sesid",vl="$session_is_sampled",gl="$enabled_feature_flags",ml="$active_feature_flags",yl="$early_access_features",bl="$feature_flag_details",wl="$feature_flag_payloads",Sl="$feature_flag_request_id",xl="$minimal_flag_called_events",kl="$override_feature_flags",Cl="$override_feature_flag_payloads",Pl="$stored_person_properties",El="$stored_group_properties",Fl="$groups",Il="$surveys",Tl="$surveys_loaded_at",Rl="$surveys_activated",Ml="$surveys_activated_session",Ll="$surveys_activated_timestamps",Al="ph_product_tours",Ol="$flag_call_reported",Dl="$flag_call_reported_session_id",$l="$feature_flag_errors",ql="$feature_flag_evaluated_at",Bl="$user_state",Nl="$client_session_props",Hl="$capture_rate_limit",jl="$initial_campaign_params",Ul="$initial_referrer_info",zl="$initial_person_info",Vl="$epp",Wl="$posthog_cookieless",Gl="$cookieless_mode",Kl="$sdk_debug_extensions_init_method",Ql="$sdk_debug_extensions_init_time_ms",Zl="$sdk_debug_recording_script_not_loaded",Jl="$sdk_debug_replay_stale_config",Yl="PostHog loadExternalDependency extension not found.",Xl="anonymous",ec="identified",tc="identified_only",nc="visibilitychange",rc="beforeunload",ic="$pageview",sc="$pageleave",oc="$identify",ac="$groupidentify";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Oi(e)&&isFinite(e)&&Math.floor(e)===e});var uc=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,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>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|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,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}(),lc=function(){"use strict";function e(){this._timestamp=0,this._counter=0,this._random=new hc}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(!Ti(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(Ti(t))throw new Error("Could not generate UUID after timestamp reset");return t},t.generateOrAbort=function(){var e=function(){var e=Date.now();return Oi(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0}();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(this._timestamp>=e+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return uc.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}(),cc=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};Wa&&!Ti(Wa.crypto)&&crypto.getRandomValues&&(cc=function(e){return crypto.getRandomValues(e)});var dc,hc=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||(cc(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),fc=function(){return pc().toString()},pc=function(){return(dc||(dc=new lc)).generate()},_c=function(e,t){try{var n;return JSON.stringify(e,function(e,t){return ji(t)?(null!=n||(n=new WeakMap),n.has(t)||n.set(t,hu(t)),n.get(t)):"bigint"==typeof t?t.toString():t},t)}catch(t){return Si(e)}},vc=function(e){var t=null==Qa?void 0:Qa.createElement("a");return Ti(t)?null:(t.href=e,t)},gc=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var s=r[i].split("=");if(s[0]===t){n=s;break}}if(!Pi(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch(e){iu.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},mc=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],u=(o||"").split("&"),l=[],c=0;u.length>c;c++){var d=u[c].split("=");Pi(d)&&(t.includes(d[0])?l.push(d[0]+"="+n):l.push(u[c]))}var h=a;return null!=o&&(h+="?"+l.join("&")),null!=i&&(h+="#"+i),h},yc=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},bc=function(e,t){return e>=t&&nu()},wc=function(e,t,n,r){if(0===e){if(nu()){var i=t+1;return i===n&&r(),i}return t}return 0};function Sc(e,t,n){return _c({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}function xc(e,t){var n,r=null==e||null==(n=e.config)?void 0:n.get_current_url;if(!Ei(r))return t;try{var i=r(t);return Ri(i)&&i?i:t}catch(e){return iu.error("Error in get_current_url, falling back to window.location.href",e),t}}function kc(e){var t,n=null==Wa||null==(t=Wa.location)?void 0:t.href;return Ti(n)?void 0:xc(e,n)}var Cc=function(e){if(Qa){try{for(var t=e+"=",n=Qa.cookie.split(";").filter(function(e){return e.length}),r=0;n.length>r;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},Pc="",Ec=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Fc=null,Ic={_is_supported:function(){if(!Li(Fc))return Fc;if(Fc=!1,Qa)try{var e="__ph_cookie_support_"+fc();Ic._set(e,"xyz"),Fc='"xyz"'===Cc(e),Ic._remove(e)}catch(e){Fc=!1}return Fc},_error:function(e){iu.error("cookieStore error: "+e)},_get:Cc,_parse:function(e){var t;try{t=JSON.parse(Ic._get(e))||{}}catch(e){}return t},_set:function(e,t,n,r,i){if(!Qa)return!1;try{var s="",o="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Qa),Pc)return Pc;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+fc();!Pc&&r--;){var s=n.slice(r).join("."),o=i+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(i)&&(t.cookie=o+";max-age=0",Pc=s)}return Pc}(e);if(!n){var r=function(e){var t=e.match(Ec);return t?t[0]:""}(e);r!==n&&iu.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}(Qa.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),s="; expires="+u.toUTCString()}i&&(o="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&iu.warn("cookieStore warning: large cookie, len="+l.length),Qa.cookie=l,!0}catch(e){return!1}},_remove:function(e,t){if(null!=Qa&&Qa.cookie&&(!t||!Li(Cc(e))))try{Ic._set(e,"",-1,t)}catch(e){return}}},Tc=null,Rc={_is_supported:function(){if(!Li(Tc))return Tc;var e=!0;if(Ti(Wa))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||iu.error("localStorage unsupported; falling back to cookie store"),Tc=e,e},_error:function(e){iu.error("localStorage error: "+e)},_get:function(e){try{return null==Wa?void 0:Wa.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==Wa||Wa.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Rc._error(e)}return!1},_remove:function(e){try{null==Wa||Wa.localStorage.removeItem(e)}catch(e){Rc._error(e)}}},Mc=[Pl,ml,gl,bl,wl,Sl,ql,$l,Ol],Lc=[Vu,zu,_l,vl,Vl,zl,Qu,Bl],Ac=function(e){return e+"_cpm"},Oc=["__proto__","constructor","prototype"],Dc=function(e){if(!Fi(e))return{};var t={};return Object.keys(e).forEach(function(n){-1===Oc.indexOf(n)&&(t[n]=e[n])}),t},$c=function(e,t){void 0===t&&(t=[]);var n={};return[].concat(Lc,t).forEach(function(t){var r=e[t];Ti(r)||Li(r)||""===r||(n[t]=r)}),n},qc=function(e){for(var t=5381,n=2166136261,r=0;e.length>r;r++){var i=e.charCodeAt(r);t=33*t^i,n=Math.imul(n^i,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},Bc=function(e,t){return{p:t,f:qc(JSON.stringify(e))}},Nc=function(e,t){if(!t)return{properties:[],isValid:!1};try{var n=Ic._parse(Ac(e)),r=(null==n?void 0:n.f)===qc(t)&&Pi(n.p);return{properties:r?n.p:[],isValid:r}}catch(e){return{properties:[],isValid:!1}}},Hc=function(e,t){return t+"|"+(Ic._get(Ac(e))||"")},jc={},Uc={_is_supported:function(){return!0},_error:function(e){iu.error("memoryStorage error: "+e)},_get:function(e){return e in jc?jc[e]:null},_parse:function(e){return e in jc?jc[e]:null},_set:function(e,t){return jc[e]=t,!0},_remove:function(e){delete jc[e]}},zc=null,Vc={_is_supported:function(){if(!Li(zc))return zc;if(zc=!0,Ti(Wa))zc=!1;else try{var e="__support__";Vc._set(e,"xyz"),'"xyz"'!==Vc._get(e)&&(zc=!1),Vc._remove(e)}catch(e){zc=!1}return zc},_error:function(e){iu.error("sessionStorage error: ",e)},_get:function(e){try{return null==Wa?void 0:Wa.sessionStorage.getItem(e)}catch(e){Vc._error(e)}return null},_parse:function(e){try{return JSON.parse(Vc._get(e))||null}catch(e){}return null},_set:function(e,t){try{return null==Wa||Wa.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Vc._error(e)}return!1},_remove:function(e){try{null==Wa||Wa.sessionStorage.removeItem(e)}catch(e){Vc._error(e)}}},Wc=su("[Stylesheet Loader]"),Gc=Wa,Kc=Qa,Qc="#020617",Zc={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Gr,widgetType:zr,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:Qc,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Jc=[Wr,Vr,Gr];function Yc(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 Xc(e){var t;void 0===e&&(e=Zc.backgroundColor),"#"===e[0]&&(t=Yc(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=Yc(n)),!t)return Qc;var r=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(i*i*.299+s*s*.587+o*o*.114)>127.5?Qc:"white"}return Qc}var ed=function(e,t,n){var r=md(e),i=Kc.querySelector("."+r);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};var s=Kc.createElement("div");!function(e,t,n){var r=u({},Zc,n),i=e.style,s=!Jc.includes(r.position)||t===Zr&&(null==n?void 0:n.widgetType)===zr;i.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}(r.fontFamily)),i.setProperty("--ph-survey-box-padding",r.boxPadding),i.setProperty("--ph-survey-max-width",r.maxWidth),i.setProperty("--ph-survey-z-index",r.zIndex),i.setProperty("--ph-survey-border-color",r.borderColor),s?(i.setProperty("--ph-survey-border-radius",r.borderRadius),i.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(i.setProperty("--ph-survey-border-bottom","none"),i.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),i.setProperty("--ph-survey-background-color",r.backgroundColor),i.setProperty("--ph-survey-box-shadow",r.boxShadow),i.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),i.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),i.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Xc(r.submitButtonColor)),i.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),i.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),i.setProperty("--ph-survey-rating-active-text-color",Xc(r.ratingButtonActiveColor)),i.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Xc(r.backgroundColor)),i.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),i.setProperty("--ph-widget-color",r.widgetColor),i.setProperty("--ph-widget-text-color",Xc(r.widgetColor)),i.setProperty("--ph-widget-z-index",r.zIndex);var o=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),a=o||r.inputBackground;o||"white"!==r.backgroundColor||(a="#f8f8f8"),i.setProperty("--ph-survey-input-background",a);var l=(null==n?void 0:n.inputTextColor)||Xc(a);i.setProperty("--ph-survey-input-text-color",l),i.setProperty("--ph-survey-rating-text-color",l),i.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),i.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),i.setProperty("--ph-survey-outline-color",r.outlineColor)}(s,e.type,e.appearance),s.className=r;var o=s.attachShadow({mode:"open"}),a=function(e){var t=function(e,t,n){var r=e.createElement("style");r.innerText=t;var i=function(e){var t;return Ei(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet}(n);return i&&(r=i(r)),r||(Wc.error("prepare_external_dependency_stylesheet returned null"),null)}(Kc,':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||Kc.body).appendChild(s),{shadow:o,isNewlyCreated:!0}},td=function(e){var t,n,r=e.responses,i=e.survey,s=e.surveySubmissionId,o=e.posthog,a=e.isSurveyCompleted,l=e.properties,c=e.surveyLanguage,d=e.questionSnapshots;o?Du(o)&&(Hu(i),o.capture(oi,u(((t={})[ui]=i.name,t[ai]=i.id,t[li]=i.current_iteration,t[ci]=i.current_iteration_start_date,t.sessionRecordingUrl=null==o.get_session_replay_url?void 0:o.get_session_replay_url(),t),yu({event:"sent",survey:i,responses:r,submissionId:s,completed:a,surveyLanguage:c,questionSnapshots:d}),l,{$set:(n={},n[wu(i,"responded")]=!0,n)})),a&&(Gc.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),gd(i),o.reloadFeatureFlags())):Au.error("[survey sent] event not captured, PostHog instance not found.")},nd=function(e,t,n,r){var i;return u(((i={})[ui]=t.name,i[ai]=t.id,i[li]=t.current_iteration,i[ci]=t.current_iteration_start_date,i.sessionRecordingUrl=null==r.get_session_replay_url?void 0:r.get_session_replay_url(),i),yu({event:e,survey:t,responses:null==n?void 0:n.responses,submissionId:null==n?void 0:n.surveySubmissionId,surveyLanguage:null==n?void 0:n.surveyLanguage,questionSnapshots:null==n?void 0:n.questionSnapshots}))},rd=function(e,t,n,r){var i,s;if(t){if(!n){var o=_d(e),a=o?o.surveyLanguage:r;t.capture(si,u({},nd("dismissed",e,o,t),a&&((i={})[di]=a,i),{$set:(s={},s[wu(e,"dismissed")]=!0,s)})),gd(e),Hu(e),Gc.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Au.error("[survey dismissed] event not captured, PostHog instance not found.")},id=function(e,t){if(t){var n=function(e){return Bu("abandonedSurvey_",e)}(e);try{if("true"===localStorage.getItem(n))return}catch(e){return}var r=_d(e);if(r){try{localStorage.setItem(n,"true")}catch(e){}t.capture("survey abandoned",nd("abandoned",e,r,t),{transport:"sendBeacon"})}}else Au.error("[survey abandoned] event not captured, PostHog instance not found.")},sd=function(e){var t=e.map(function(e){return e.id});return t.every(function(e){return!!e})?t:void 0},od=function(e,t){var n,r,i;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,r=new Map(e.questions.map(function(e){return[e.id,e]})),i=[],s=f(t);!(n=s()).done;){var o=r.get(n.value);if(!o)return null;i.push(o)}return i}(e,t.questionOrder))&&void 0!==n?n:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?(r=e.questions,i=Lu(e.questions),r.length===i.length&&r.every(function(e,t){return e===i[t]})?i.reverse():i):e.questions},ad=function(e){return Fu(e)||vd(e)},ud=function(){function e(t){var n,r;return this.getChildContext||(n=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,er(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}(),ld=function(){return Mr(ud)},cd=function(e){var t=e.children,n=e.style;return function(e,t,n){var r,i,s,o,a=Wn({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?r=t[s]:"ref"==s?i=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,r||e.key,i||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:n}:{children:t,style:n})};function dd(e,t){var n,r;if(null==(n=e.conditions)||!n.url)return!0;var i,s=kc(t);return!!s&&Ru[i=null==(r=e.conditions)?void 0:r.urlMatchType,null!=i?i:"icontains"]([e.conditions.url],[s])}var hd=function(e){return Bu("inProgressSurvey_",e)},fd={},pd=function(e,t){var n=hd(e);try{localStorage.setItem(n,JSON.stringify(t)),delete fd[n]}catch(e){Au.error("Error setting in-progress survey state in localStorage",e),fd[n]=t}},_d=function(e){var t=hd(e),n=fd[t];if(n)return n;try{var r=localStorage.getItem(t);if(r)return JSON.parse(r)}catch(e){Au.error("Error getting in-progress survey state from localStorage",e)}return null},vd=function(e){var t=_d(e);return!Ai(null==t?void 0:t.surveySubmissionId)},gd=function(e){var t=hd(e);delete fd[t];try{localStorage.removeItem(t)}catch(e){Au.error("Error clearing in-progress survey state from localStorage",e)}};function md(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}function yd(e,t,n){if(void 0===t&&(t=Gr),e===Jr)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 Vr:return{left:"30px"};case Wr:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Zr&&n===zr?"60px":"30px"}}}var bd=0;function wd(e,t,n,r,i,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:--bd,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return d.vnode&&d.vnode(l),l}var Sd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),xd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),kd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),Cd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),Pd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),Ed=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:wd("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"})}),Fd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:wd("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=wd("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wd("g",{"clip-path":"url(#clip0_2415_6911)",children:[wd("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:wd("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),wd("g",{mask:"url(#mask0_2415_6911)",children:[wd("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"}),wd("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"}),wd("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"}),wd("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"}),wd("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"}),wd("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"})]})]}),wd("defs",{children:wd("clipPath",{id:"clip0_2415_6911",children:wd("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Td(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 wd("a",{href:"https://posthog.com/surveys"+(n?"?"+n:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Id]})}function Rd(e){var t=e.text,n=e.submitDisabled,r=e.appearance,i=e.onSubmit,s=e.link,o=e.onPreviewSubmit,a=e.skipSubmitButton,u=e.canGoBack,l=e.onBack,c=Mr(ud).isPreviewMode,d=!!u&&!!l,h=!a&&wd("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick:function(){s&&(null==Wa||Wa.open(s)),c?null==o||o():i()},children:t});return wd("div",{className:"bottom-section",children:[d?wd("div",{className:"form-buttons form-buttons-with-back",children:[wd("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:r.backButtonText||"Back"}),h]}):h,!r.whiteLabel&&wd(Td,{urlParams:{utm_source:"survey-footer"}})]})}function Md(e){var t=e.question,n=e.forceDisableHtml;return wd("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[wd(t.type===Yr?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&cd({component:Kn("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!n&&"text"!==t.descriptionContentType})]})}function Ld(e){var t,n,r;return wd("button",{className:"form-cancel",onClick:e.onClick,disabled:Mr(ud).isPreviewMode,"aria-label":"Close survey",type:"button",children:(t={fill:"black"},n=(void 0===t?{}:t).fill,r=void 0===n?"currentColor":n,wd("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[wd("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),wd("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]}))})}var Ad=Wa;function Od(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,s=e.appearance,o=e.onClose,a=Mr(ud).isPopup;return Ir(function(){var e=function(e){"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return _u(Ad,"keydown",e),function(){Ad.removeEventListener("keydown",e)}},[o]),wd("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&wd(Ld,{onClick:function(){return o()}}),wd("h3",{className:"thank-you-message-header",children:t}),n&&cd({component:Kn("p",{className:"thank-you-message-body"}),children:n,renderAsHtml:!i&&"text"!==r}),a&&wd(Rd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:function(){return o()}})]})}function Dd(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,s=e.appearance,o=e.onStart,a=Mr(ud),u=a.onPreviewSubmit,l=a.onPopupSurveyDismissed;return wd("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&wd(Ld,{onClick:function(){return l()}}),t&&wd("h3",{className:"intro-screen-header",children:t}),n&&cd({component:Kn("p",{className:"intro-screen-body"}),children:n,renderAsHtml:!i&&"text"!==r}),wd(Rd,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:function(){return u(null)}})]})}var $d=function(e){return Pi(e)&&e.every(function(e){return Ri(e)})};function qd(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,s=e.onPreviewSubmit,o=e.displayQuestionIndex,a=e.initialValue,u=e.canGoBack,l=e.onBack,c=ld().isPreviewMode,d=Tr(null),h=Fr(function(){return Ri(a)?a:""}),p=h[0],_=h[1],v=null==r?void 0:r.disableAutofocus;Ir(function(){v||setTimeout(function(){var e;c||null==(e=d.current)||e.focus()},100)},[c,v]);var g="surveyQuestion"+o,m=Rr(function(){return function(e,t,n){var r,i,s=e.trim();if(!n&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o,a=f(t);!(o=a()).done;){var u=o.value;switch(u.type){case _i:if(void 0!==u.value&&u.value>s.length)return null!==(r=u.errorMessage)&&void 0!==r?r:"Please enter at least "+u.value+" characters";break;case vi:if(void 0!==u.value&&s.length>u.value)return null!==(i=u.errorMessage)&&void 0!==i?i:"Please enter no more than "+u.value+" characters"}}return!1}(p,t.validation,t.optional)},[p,t.validation,t.optional]),y=ja(t.validation,_i),b=ja(t.validation,vi),w=Rr(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||i(p.trim())},x=function(){m||s(p.trim())};return wd(Zn,{children:[wd("div",{className:"question-container",children:[wd(Md,{question:t,forceDisableHtml:n,htmlFor:g}),wd("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.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&&wd("div",{className:"validation-hint",children:w})]}),wd(Rd,{text:t.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:S,onPreviewSubmit:x,canGoBack:u,onBack:l})]})}function Bd(e){var t=e.question,n=e.appearance,r=e.onSubmit,i=e.onPreviewSubmit,s=e.canGoBack,o=e.onBack;return wd(Zn,{children:[wd("div",{className:"question-container",children:wd(Md,{question:t,forceDisableHtml:e.forceDisableHtml})}),wd(Rd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:function(){return r("link clicked")},onPreviewSubmit:function(){return i("link clicked")},canGoBack:s,onBack:o})]})}function Nd(e){var t,n=e.question,r=e.forceDisableHtml,i=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=Fr(function(){return Oi(u)?u:Pi(u)&&u.length>0&&Oi(parseInt(u[0]))?parseInt(u[0]):Ri(u)&&Oi(parseInt(u))?parseInt(u):null}),p=f[0],_=f[1],v="emoji"===n.display&&2===n.scale,g=ld().isPreviewMode,m=function(e){return g?a(e):o(e)};return wd(Zn,{children:[wd("div",{className:"question-container",children:[wd(Md,{question:n,forceDisableHtml:r}),wd("div",{className:"rating-section",children:[wd("div",{className:"rating-options",children:["emoji"===n.display&&wd("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Wd[n.scale])?void 0:t.map(function(e,t){return wd("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+i+"-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&&wd("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-h+1)+", minmax(0, 1fr))"},children:Gd(n.scale).map(function(e,t){return wd(Hd,{displayQuestionIndex:i,active:p===e,appearance:s,num:e,setActiveNumber:function(e){_(e),n.skipSubmitButton&&m(e)}},t)})})]}),!v&&wd("div",{className:"rating-text",children:[wd("div",{children:n.lowerBoundLabel}),wd("div",{children:n.upperBoundLabel})]})]})]}),wd(Rd,{text:n.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Li(p)&&!n.optional,appearance:s,onSubmit:function(){return o(p)},onPreviewSubmit:function(){return a(p)},skipSubmitButton:n.skipSubmitButton,canGoBack:l,onBack:c})]})}function Hd(e){var t=e.num,n=e.setActiveNumber;return wd("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 jd(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,s=e.onSubmit,o=e.onPreviewSubmit,a=e.initialValue,l=e.canGoBack,c=e.onBack,d=Tr(null),h=Rr(function(){return function(e){var t;if(!e.shuffleOptions)return e.choices;var n,r,i=[].concat(e.choices),s=e.hasOpenChoice&&null!==(t=i.pop())&&void 0!==t?t:null,o=(n=i,(r=Lu(i)).length>1&&n.every(function(e,t){return e===r[t]})?r.reverse():r);return Li(s)||o.push(s),o}(t)},[t]),f=Fr(function(){return function(e,t){return Ri(e)||$d(e)?e:t===ei?null:[]}(a,t.type)}),p=f[0],_=f[1],v=Fr(function(){return function(e,t){if(Ri(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if($d(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=ld().isPreviewMode,b=t.type===ei,w=t.type===Xr,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&&Pi(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||!Li(p)&&(!Pi(p)||g.isSelected||0!==p.length)&&(!g.isSelected||""!==g.inputValue.trim()))},E=function(){g.isSelected&&w?Pi(p)&&(y?o([].concat(p,[g.inputValue])):s([].concat(p,[g.inputValue]))):y?o(p):s(p)};return wd(Zn,{children:[wd("div",{className:"question-container",children:[wd(Md,{question:t,forceDisableHtml:n}),wd("fieldset",{className:"multiple-choice-options limit-height",children:[wd("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),h.map(function(e,n){var i=!!t.hasOpenChoice&&n===t.choices.length-1,s="surveyQuestion"+r+"Choice"+n,o=s+"Open",a=i?g.isSelected:b?p===e:Pi(p)&&p.includes(e);return wd("label",{className:i?"choice-option-open":"",children:[wd("div",{className:"response-choice",children:[wd("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:function(){return x(e,i)},id:s,"aria-controls":o}),wd("span",{children:i?e+":":e})]}),i&&wd("input",{type:"text",ref:d,id:o,name:"question"+r+"Open",value:g.inputValue,onKeyDown:C,onInput:k,onClick:function(t){g.isSelected||x(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},n)})]})]}),wd(Rd,{text:t.buttonText||"Submit",submitDisabled:P(),appearance:i,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:S,canGoBack:l,onBack:c})]})}var Ud=[1,2,3,4,5],zd=[1,2,3,4,5,6,7],Vd=[0,1,2,3,4,5,6,7,8,9,10],Wd={2:[Ed,Fd],3:[kd,xd,Sd],5:[Cd,kd,xd,Sd,Pd]};function Gd(e){switch(e){case 5:default:return Ud;case 7:return zd;case 10:return Vd}}var Kd=su("[Surveys]");function Qd(e,t,n){var r,i=e.questions[t],s=t+1;if(null==(r=i.branching)||!r.type)return t===e.questions.length-1?ni:s;if(i.branching.type===ni)return ni;if("specific_question"===i.branching.type){if(Number.isInteger(i.branching.index))return i.branching.index}else if("response_based"===i.branching.type){if(i.type===ei){var o,a=i.choices.indexOf(""+n);if(-1===a&&i.hasOpenChoice&&(a=i.choices.length-1),null!=(o=i.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var u=i.branching.responseValues[a];return Number.isInteger(u)?u:u===ni?ni:s}}else if(i.type===ti){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,i.scale);if(null!=(l=i.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=i.branching.responseValues[c];return Number.isInteger(d)?d:d===ni?ni:s}}return s}return Kd.warn("Falling back to next question index due to unexpected branching type"),s}var Zd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Jd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat(Zd),Yd="<masked>",Xd=["li_fat_id"];function eh(e,t,n){if(!Qa)return{};var r,i=t?[].concat(Zd,n||[]):[],s=th(mc(Qa.URL,i,Yd),e);return uu((r={},au(Xd,function(e){var t=Cc(e);r[e]=t||null}),r),s)}function th(e,t){var n=Jd.concat(t||[]),r={};return au(n,function(t){var n=gc(e,t);r[t]=n||null}),r}function nh(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",r={};if(!Li(t)){r.$search_engine=t;var i=Qa?gc(Qa.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function rh(){return navigator.language||navigator.userLanguage}var ih="$direct";function sh(){return(null==Qa?void 0:Qa.referrer)||ih}function oh(e,t,n){var r;void 0===n&&(n=!1);var i=e?[].concat(Zd,t||[]):[],s=null==(r=n?po(null==Za?void 0:Za.href):null==Za?void 0:Za.href)?void 0:r.substring(0,1e3);return{r:sh().substring(0,1e3),u:s?mc(s,i,Yd):void 0}}function ah(e,t){var n;void 0===t&&(t=!1);var r=e.r,i=e.u,s=t?po(i):i,o={$referrer:r,$referring_domain:null==r?void 0:r==ih?ih:null==(n=vc(r))?void 0:n.host};if(s){o.$current_url=s;var a=vc(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,uu(o,th(s))}return r&&uu(o,nh(r)),o}function uh(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function lh(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var ch=su("[SurveyTranslations]");function dh(e,t){var n=function(e){return function(e,t){var n=e.storedPersonProperties,r=e.locale,i=Su(e.overrideLanguage);if(i)return null==t||t.info("Using override display language: "+i),i;var s=function(e){return e&&"object"==typeof e&&"language"in e?Su(e.language):null}(n);if(s)return null==t||t.info("Using person property language: "+s),s;var o=Su(r);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:Ei(e.get_property)?e.get_property(Pl):void 0,locale:rh()},ch)}(t);if(!n)return ch.info("No user language detected"),{survey:e,language:null};var r=Pu(e,n,ch);return{survey:r.survey,language:r.matchedKey}}var hh=Wa,fh=Qa,ph="ph:show_survey_widget",_h="PHWidgetSurveyClickListener";function vh(e,t){try{var n=e.getBoundingClientRect(),r=hh.innerHeight,i=hh.innerWidth,s=n.left+n.width/2-t/2;s+t>i-20&&(s=i-t-20),20>s&&(s=20);var o=r-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?r-n.top+12+"px":"auto",zIndex:Zc.zIndex}}catch(e){return Au.warn("Failed to calculate trigger position:",e),null}}var gh=function(){"use strict";function e(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._renderedTabWidgets=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._loggedFeatureFlagsDisabledWarning=!1,this.handlePageUnload=function(){var e=t._posthog.get_property(Il);if(e)for(var n,r=f(e);!(n=r()).done;){var i=n.value;vd(i)&&id(i,t._posthog)}},this.handlePopoverSurvey=function(e,n,r){var i,s,o,a,l,c=(void 0===r?{}:r).resumeDelayFromActivation,d=void 0!==c&&c;if(Du(t._posthog)){var 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!=(i=_.appearance)&&i.displayThankYouMessage){t._addSurveyToFocus(_);var b={};if((null==(s=_.appearance)?void 0:s.position)===Kr&&null!=(o=_.appearance)&&o.widgetSelector){var w,S=fh.querySelector(_.appearance.widgetSelector);S&&(b=vh(S,parseInt((null==(w=_.appearance)?void 0:w.maxWidth)||Zc.maxWidth))||{})}var x=(null==(a=_.appearance)?void 0:a.surveyPopupDelaySeconds)||0,k=ed(_,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,gr(wd(Sh,u({},C)),k);var P=function(){if(!Du(t._posthog)||!t._shouldDisplaySurvey(_))return Au.info("Survey "+_.id+" no longer eligible when its display delay elapsed; not displaying"),t._removeSurveyFromFocus(_);!function(){t._surveyIsRendered=!0;var r=t._translateSurveyForRendering(e),i=r.survey,s=r.language;t._currentLanguage=s;var o=t._applyDisplayOverrides(i,n),a=u({},C,{survey:o,surveyLanguage:s});t._surveyPopupProps=a,gr(wd(Sh,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=Oi(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*x-F);if(0>=I)return P();var T=hh.setTimeout(function(){t._surveyTimeouts.delete(_.id),P()},I);t._surveyTimeouts.set(_.id,T)}}},this._handleWidget=function(e){var n,r=t._translateSurveyForRendering(e),i=r.survey,s=r.language,o=ed(i,t._posthog),a=o.shadow,u=o.isNewlyCreated;t._renderedTargets.set(a,a.host),(null==(n=e.appearance)?void 0:n.widgetType)===zr&&t._renderedTabWidgets.set(e.id,e),u&&gr(wd(kh,{posthog:t._posthog,survey:i,surveyLanguage:s},e.id),a)},this._detachWidgetSelectorListener=function(e){var n=t._widgetSelectorListeners.get(e);n&&(n.element.removeEventListener("click",n.listener),n.element.removeAttribute(_h),t._widgetSelectorListeners.delete(e),Au.info("Removed click listener for survey "+e))},this._removeWidgetSelectorListener=function(e){t._isWidgetSurveyOpen(e)||(t._removeSurveyFromDom(e),t._detachWidgetSelectorListener(e.id))},this._removeTabWidget=function(e){t._isWidgetSurveyOpen(e)||(t._removeSurveyFromDom(e),t._renderedTabWidgets.delete(e.id))},this._isWidgetSurveyOpen=function(e){try{var t;return!(null==(t=fh.querySelector(md(e,!0)))||null==(t=t.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this._manageWidgetSelectorListener=function(e,n){var r=fh.querySelector(n),i=t._widgetSelectorListeners.get(e.id);if(r){if(t._handleWidget(e),i){if(r===i.element)return;Au.info("Selector element changed for survey "+e.id+". Re-attaching listener."),t._detachWidgetSelectorListener(e.id)}if(!r.hasAttribute(_h)){var s=function(t){var n,r;t.stopPropagation();var i=(null==(n=e.appearance)?void 0:n.position)===Kr?vh(t.currentTarget,parseInt((null==(r=e.appearance)?void 0:r.maxWidth)||Zc.maxWidth)):{};hh.dispatchEvent(new CustomEvent(ph,{detail:{surveyId:e.id,position:i}}))};_u(r,"click",s),r.setAttribute(_h,"true"),t._widgetSelectorListeners.set(e.id,{element:r,listener:s,survey:e}),Au.info("Attached click listener for feedback button survey "+e.id)}}else i&&t._removeWidgetSelectorListener(e)},this.renderPopover=function(e){if(Du(t._posthog)){var n=t._translateSurveyForRendering(e),r=n.survey,i=n.language,s=ed(r,t._posthog).shadow;t._renderedTargets.set(s,s.host),gr(wd(Sh,{posthog:t._posthog,survey:r,removeSurveyFromFocus:t._removeSurveyFromFocus,surveyLanguage:i}),s)}},this.renderSurvey=function(e,n,r){var i;if(Du(t._posthog)){var s=t._translateSurveyForRendering(e),o=s.survey,a=s.language,u=!1;null!=(i=t._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(u=t._handleUrlPrefill(o,a,r)),gr(wd(Sh,{posthog:t._posthog,survey:o,removeSurveyFromFocus:t._removeSurveyFromFocus,isPopup:!1,properties:r,isSurveyCompleted:u,surveyLanguage:a}),n)}},this.getActiveMatchingSurveys=function(e,n){var r;void 0===n&&(n=!1),null==(r=t._posthog)||null==(r=r.surveys)||r.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=Du(t._posthog),r=e.filter(function(e){return n&&(e.type===Qr||e.type===Zr)}),i=new Set(r.map(function(e){return e.id})),s=0,o=Array.from(t._surveyTimeouts.keys());o.length>s;s++){var a=o[s];i.has(a)||t.cancelSurvey(a)}var u=t._sortSurveysByAppearanceDelay(r),l=new Set,c=new Set;u.forEach(function(e){if(e.type===Zr){var n,r,i,s;if((null==(n=e.appearance)?void 0:n.widgetType)===zr)return c.add(e.id),void t._handleWidget(e);"selector"===(null==(r=e.appearance)?void 0:r.widgetType)&&null!=(i=e.appearance)&&i.widgetSelector&&(l.add(e.id),t._manageWidgetSelectorListener(e,null==(s=e.appearance)?void 0:s.widgetSelector))}Li(t._surveyInFocus)&&e.type===Qr&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})}),t._widgetSelectorListeners.forEach(function(e){var n=e.survey;l.has(n.id)||t._removeWidgetSelectorListener(n)}),t._renderedTabWidgets.forEach(function(e,n){c.has(n)||t._removeTabWidget(e)})},e)},this._addSurveyToFocus=function(e){Li(t._surveyInFocus)||Au.error("Survey "+t._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),t._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){t._surveyInFocus!==e.id&&Au.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()},_u(hh,"languagechange",this._languageChangeListener),this._unsubscribeFeatureFlags=e.onFeatureFlags(function(){return t._onLanguageChange()})}var t=e.prototype;return t._onLanguageChange=function(){var e,t=this;if(!Li(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 r=this._translateSurveyForRendering(n),i=r.survey,s=r.language;if(s!==this._currentLanguage&&(this._currentLanguage=s,this._surveyIsRendered)){var o=this._applyDisplayOverrides(i,this._displayOptions),a=ed(o,this._posthog).shadow;gr(wd(Sh,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)&&(Au.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.clearInMemoryInProgressSurveyState=function(){!function(){for(var e=0,t=Object.keys(fd);t.length>e;e++)delete fd[t[e]]}()},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&&(hh.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){gr(null,t),null==e||e.remove()}),this._renderedTargets.clear(),this._renderedTabWidgets.clear(),this._surveyInFocus=null},t._sortSurveysByAppearanceDelay=function(e){return e.sort(function(e,t){var n,r,i=vd(e),s=vd(t);if(i&&!s)return-1;if(!i&&s)return 1;var o=e.schedule===ri,a=t.schedule===ri;return o&&!a?1:!o&&a?-1:((null==(n=e.appearance)?void 0:n.surveyPopupDelaySeconds)||0)-((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})},t._translateSurveyForRendering=function(e){return dh(e,this._posthog)},t._handleUrlPrefill=function(e,t,n){if(this._prefillHandledSurveys.has(e.id))return!1;var r=function(e){var t={},n=!1,r=e.replace(/^\?/,"");if(!r)return{params:t,autoSubmit:n};for(var i,s=f(r.split("&"));!(i=s()).done;){var o=i.value.split("="),a=o[0],u=o[1];if(a&&!Ti(u)){var l=decodeURIComponent(a),c=decodeURIComponent(u);if("auto_submit"!==l||"true"!==c){var d=l.match(/^q(\d+)$/);if(d){var h=parseInt(d[1],10);t[h]||(t[h]=[]),t[h].push(c)}}else n=!0}}return{params:t,autoSubmit:n}}(hh.location.search).params;if(0===Object.keys(r).length)return!1;Au.info("[Survey Prefill] Detected URL prefill parameters");var i=this._processPrefillData(e,r,t);return!!i&&(this._autoSubmitPrefilledResponses(e,i,n,t),this._prefillHandledSurveys.add(e.id),i.isSurveyCompleted)},t._autoSubmitPrefilledResponses=function(e,t,n,r){var i=t.responses,s=t.submissionId,o=t.isSurveyCompleted,a=t.skippedResponses;(Object.keys(a).length>0&&e.enable_partial_responses||o)&&td({responses:o?i:a,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:n,surveyLanguage:r})},t._handleInitialResponses=function(e,t,n,r){for(var i={},s=0,o=Object.entries(t);o.length>s;s++){var a=o[s],u=a[1];i[parseInt(a[0])]=Pi(u)?u.map(String):[String(u)]}Au.info("[Survey] Processing initial responses");var l=this._processPrefillData(e,i,r);return!!l&&(this._autoSubmitPrefilledResponses(e,l,n,r),l.isSurveyCompleted)},t._processPrefillData=function(e,t,n){try{var r=function(e,t){var n={};return e.questions.forEach(function(e,r){if(t[r]&&e.id){var i=t[r],s=gu(e.id);try{switch(e.type){case ei:if(!e.choices||0===e.choices.length)return void iu.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(i[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void iu.warn("[Survey Prefill] Invalid choice index for q"+r+": "+i[0]);n[s]=e.choices[o];break;case Xr:if(!e.choices||0===e.choices.length)return void iu.warn("[Survey Prefill] Question "+r+" has no choices");var a=i.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 iu.warn("[Survey Prefill] No valid choices for q"+r);var u=[].concat(new Set(a.map(function(t){return e.choices[t]})));a.length>u.length&&iu.warn("[Survey Prefill] Removed duplicate choices for q"+r),n[s]=u;break;case ti:var l=parseInt(i[0],10),c=e.scale||10;if(isNaN(l)||0>l||l>c)return void iu.warn("[Survey Prefill] Invalid rating for q"+r+": "+i[0]+" (scale: 0-"+c+")");n[s]=l;break;default:iu.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){iu.error("[Survey Prefill] Error converting q"+r+":",e)}}}),n}(e,t);if(0===Object.keys(r).length)return Au.warn("[Survey Prefill] No valid responses after conversion"),null;var i=fc(),s=function(e,t,n){for(var r=0,i={},s=[],o=e.questions.length+1,a=0;e.questions.length>r&&o>a&&(a++,t.includes(r));){var u=e.questions[r];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=gu(u.id);Ti(n[l])||(i[l]=n[l])}s.push(r);var c=Qd(e,r,u.id?n[gu(u.id)]:null);if(c===ni)return{startQuestionIndex:e.questions.length,skippedResponses:i,skippedIndices:s};r=c}return{startQuestionIndex:r,skippedResponses:i,skippedIndices:s}}(e,Object.keys(t).map(function(e){return parseInt(e,10)}),r),o=s.startQuestionIndex,a=s.skippedResponses,u=s.skippedIndices,l=o>=e.questions.length;return pd(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:o,questionOrder:sd(e.questions),visitedIndices:u,surveyLanguage:n}),Au.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:a}}catch(e){return Au.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,r=!(null==n||!n.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),i=!0;t&&(i=(null==n?void 0:n.getFeatureFlag(e,{send_event:!1}))===t||"any"===t);var s=r&&i;return s||this._warnIfFeatureFlagsDisabled(e),s},t._warnIfFeatureFlagsDisabled=function(e){var t;!this._loggedFeatureFlagsDisabledWarning&&null!=(t=this._posthog.config)&&t.advanced_disable_feature_flags&&(this._loggedFeatureFlagsDisabledWarning=!0,Au.warn('Survey feature flag "'+e+'" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.'))},t._isSurveyConditionMatched=function(e){return!e.conditions||dd(e,this._posthog)&&function(e){var t,n;return function(e,t){var n,r,i;if(!e||0===e.length)return!0;if(!tu)return!1;var s=Ys(tu,{userAgentDataPlatform:null==Ka||null==(n=Ka.userAgentData)?void 0:n.platform,maxTouchPoints:null==Ka?void 0:Ka.maxTouchPoints,screenWidth:null==Wa||null==(r=Wa.screen)?void 0:r.width,screenHeight:null==Wa||null==(i=Wa.screen)?void 0:i.height,devicePixelRatio:null==Wa?void 0:Wa.devicePixelRatio});return Ru[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==Kc||!Kc.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){var t;return ad(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)}:(this._warnIfFeatureFlagsDisabled(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,r={eligible:!0,reason:void 0};if(!$u(e))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+e.end_date,r;if(!ju.includes(e.type))return r.eligible=!1,r.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",r;var i=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this._isSurveyFeatureFlagEnabled(e.linked_flag_key,i))return r.eligible=!1,r.reason=i?"Survey linked feature flag is not enabled for variant "+i:"Survey linked feature flag is not enabled",r;if(!this._isSurveyFeatureFlagEnabled(e.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;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,r=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(r/864e5)>e}(null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays,Rc._get("lastSeenSurveyDate"))?function(e){return!!Rc._get(Nu(e))&&!ad(e)}(e)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.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",r)},t.checkSurveyCaptureEligibility=function(){return Du(this._posthog)?{eligible:!0}:{eligible:!1,reason:Ou}},t.checkSurveyDisplayEligibility=function(e){var t=this.checkSurveyCaptureEligibility();return t.eligible?this.checkSurveyEligibility(e):t},t.checkSurveyRenderability=function(e){var t=this.checkSurveyDisplayEligibility(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!Eu(e)&&!qu(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=fh.querySelector(md(e,!0));null!=t&&t.shadowRoot&&(gr(null,t.shadowRoot),this._renderedTargets.delete(t.shadowRoot)),null==t||t.remove()}catch(t){Au.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 mh(e,t){if(fh&&hh){var n,r=new gh(e);if(e.config.disable_surveys_automatic_display)return Au.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===t)return Au.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var i=function(){Ti(n)&&(n=setInterval(function(){r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=function(){Ti(n)||(clearInterval(n),n=void 0)};i();var o=function(){fh.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),i())};return _u(fh,"visibilitychange",o),r.setAutomaticDisplayDispose(function(){s(),fh.removeEventListener("visibilitychange",o)}),r}}function yh(e){var t=e.survey,n=e.removeSurveyFromFocus,r=void 0===n?function(){}:n,i=e.setSurveyVisible,s=e.isPreviewMode,o=void 0!==s&&s,a=e.posthog;Ir(function(){var e;if(!o&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===Zr,s=dd(t,a),o=(null==(e=t.appearance)?void 0:e.widgetType)===zr&&n;if(!s)return Au.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(Au.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};_u(hh,"popstate",n),_u(hh,"hashchange",n);var s=hh.history.pushState,u=hh.history.replaceState;return hh.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];s.apply(this,t),n()},hh.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];u.apply(this,t),n()},function(){hh.removeEventListener("popstate",n),hh.removeEventListener("hashchange",n),hh.history.pushState=s,hh.history.replaceState=u}}},[o,t,r,i,a])}var bh=200;function wh(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 Sh(e){var t,n,r,i,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,I=void 0===F?function(){}:F,T=e.onCloseConfirmationMessage,R=void 0===T?function(){}:T,M=e.properties,L=e.isSurveyCompleted,A=e.skipShownEvent,O=e.surveyLanguage,D=Tr(null),q=Number.isInteger(y),B=function(e,t,n,r,i,s,o,a,l){var c=Fr(r||0===n||e.type===Jr),d=c[0],h=c[1],f=Fr(!1),p=f[0],_=f[1],v=Tr(!1),g=function(){var t=function(){s&&i(e),h(!1)};if(!v.current){var n=null==o?void 0:o.current;n?(v.current=!0,n.style.transition="opacity "+bh+"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 Ir(function(){if(t){if(!r){var i,s=function(t){var n,r;if(t.detail.surveyId===e.id){if(null==(n=e.appearance)||!n.displayThankYouMessage)return g();_(!0),null!=(r=e.appearance)&&r.autoDisappear&&(i&&clearTimeout(i),i=setTimeout(g,5e3))}},o=function(){var n,r;if(dd(e,t)){h(!0),hh.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(ii,u(((n={})[ui]=e.name,n[ai]=e.id,n[li]=e.current_iteration,n[ci]=e.current_iteration_start_date,n),l&&((r={})[di]=l,r),{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};_u(hh,"PHSurveyClosed",m),_u(hh,"PHSurveySent",s);var c=n>0?setTimeout(o,n):void 0;return Ti(c)&&o(),function(){Ti(c)||clearTimeout(c),Ti(i)||clearTimeout(i),hh.removeEventListener("PHSurveyClosed",m),hh.removeEventListener("PHSurveySent",s)}}}else Au.error("usePopupVisibility hook called without a PostHog instance.")},[]),yh({survey:e,removeSurveyFromFocus:i,setSurveyVisible:h,isPreviewMode:r,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,A,O),N=B.isPopupVisible,H=B.hidePopupWithAnimation,j=B.isSurveySent||y===p.questions.length||!0===L,U=Fr(!1),z=U[0],V=U[1],W=Rr(function(){return!!_d(p)},[p]),G=!!(null!=(n=p.appearance)&&n.introScreenHeader||null!=(r=p.appearance)&&r.introScreenDescription),K=q?-1===y:!(null==(i=p.appearance)||!i.displayIntroScreen)&&G&&!z&&!W,Q=Rr(function(){var e,t=(null==(e=_d(p))?void 0:e.surveySubmissionId)||fc();return{isPreviewMode:q,previewPageIndex:y,onPopupSurveyDismissed:function(){O?rd(p,v,q,O):rd(p,v,q),I()},isPopup:x||!1,surveySubmissionId:t,onPreviewSubmit:C,onPreviewBack:E,posthog:v,properties:M,surveyLanguage:O}},[q,y,x,v,p,I,C,E,M,O]);return N?wd(ud.Provider,{value:Q,children:wd("div",{className:"ph-survey",style:u({},yd(p.type,null==(s=p.appearance)?void 0:s.position,null==(o=p.appearance)?void 0:o.widgetType),m),ref:D,children:j?wd(Od,{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||Zc,onClose:function(){H(),R()}}):K?wd(Dd,{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||Zc,onStart:function(){return V(!0)}}):wd(xh,{survey:p,forceDisableHtml:!!_,posthog:v})})}):null}function xh(e){var t,n,r=e.survey,i=e.forceDisableHtml,s=e.posthog,o=Rr(function(){var e=_d(r);if(!e)return null;var t=Oi(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&r.questions.length>e.lastQuestionIndex?e:(gd(r),null)},[r]),a=Fr(function(){return null!=o&&o.responses&&Au.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}}),l=a[0],c=a[1],d=Fr(!1),h=d[0],f=d[1],p=Mr(ud),_=p.previewPageIndex,v=p.onPopupSurveyDismissed,g=p.isPopup,m=p.onPreviewSubmit,y=p.onPreviewBack,b=p.surveySubmissionId,w=p.isPreviewMode,S=p.properties,x=p.surveyLanguage,k=Fr(function(){var e=null==o?void 0:o.lastQuestionIndex,t=Oi(e)&&e>=0&&r.questions.length>e?e:0;return Oi(_)&&_>=0?_:t}),C=k[0],P=k[1],E=Fr(function(){var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(function(e){return e>=0&&r.questions.length>e})}),F=E[0],I=E[1],T=Fr(function(){var e,t;return null!==(e=null==(t=_d(r))?void 0:t.questionSnapshots)&&void 0!==e?e:{}}),R=T[0],M=T[1],L=Rr(function(){return sd(od(r,o))},[r.id,o]),A=Rr(function(){if(!L||new Set(L).size!==L.length)return od(r,o);var e=new Map(r.questions.map(function(e){return[e.id,e]})),t=L.map(function(t){return e.get(t)}).filter(function(e){return!!e});return t.length===L.length?t:r.questions},[L,r.questions,r,o]);Ir(function(){!w||Ti(_)||0>_||P(_)},[_,w]);var O=!(null==(t=r.appearance)||!t.allowGoBack)&&(w?(null!=_?_:0)>0:F.length>0),D=A.at(C);return D?wd("form",{className:"survey-form",name:"surveyForm",children:[g&&!0!==(null==(n=r.appearance)?void 0:n.hideCancelButton)&&wd(Ld,{onClick:function(){v()}}),wd("div",{className:"survey-box","data-question-index":C,children:[h&&wd("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Ch({question:D,forceDisableHtml:i,displayQuestionIndex:C,appearance:r.appearance||Zc,onSubmit:function(e){return function(e){var t=e.res,n=e.displayQuestionIndex,i=e.questionId;if(s)if(Du(s))if(f(!1),i){var o=function(e,t,n,r){var i,s,o=e.questionSnapshots,a=void 0===o?{}:o;return{responses:u({},e.responses,(i={},i[gu(t)]=n,i)),questionSnapshots:null!=r&&r.id?u({},a,(s={},s[r.id]=r.question,s)):a}}({responses:l,questionSnapshots:R},i,t,A[n]),a=o.responses,d=o.questionSnapshots;c(a),M(d);var h=Qd(r,n,t),p=h===ni,_=[].concat(F,[n]);if(p||(I(_),P(h),pd(r,{surveySubmissionId:b,responses:a,lastQuestionIndex:h,questionOrder:sd(A),visitedIndices:_,surveyLanguage:x,questionSnapshots:d})),r.enable_partial_responses||p){var v=new Set(_.map(function(e){var t;return null==(t=A[e])?void 0:t.id}).filter(function(e){return!!e}).map(function(e){return gu(e)}));td({responses:Object.fromEntries(Object.entries(a).filter(function(e){return v.has(e[0])})),survey:r,surveySubmissionId:b,isSurveyCompleted:p,posthog:s,properties:S,surveyLanguage:x,questionSnapshots:d})}}else Au.error("onNextButtonClick called without a questionId.");else f(!0);else Au.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:C,questionId:D.id})},onPreviewSubmit:m,initialValue:D.id?l[gu(D.id)]:void 0,canGoBack:O,onBack:function(){if(w)y();else if(0!==F.length){var e=F[F.length-1],t=F.slice(0,-1);I(t),P(e),pd(r,{surveySubmissionId:b,responses:l,lastQuestionIndex:e,questionOrder:sd(A),visitedIndices:t,surveyLanguage:x,questionSnapshots:R})}}})]})]}):null}function kh(e){var t,n,r,i,s,o,a,u=e.survey,l=e.forceDisableHtml,c=e.posthog,d=e.readOnly,h=e.surveyLanguage,f=Fr(!0),p=f[0],_=f[1],v=Fr(!1),g=v[0],m=v[1],y=Fr({}),b=y[0],w=y[1],S=Tr(void 0),x=function(){(g||!c||d||Du(c))&&m(!g)};if(Ir(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&&(Au.info("Received show event for feedback button survey "+u.id),w(n.detail.position||{}),x())};return _u(hh,ph,t),function(){Ti(S.current)||(clearTimeout(S.current),S.current=void 0),hh.removeEventListener(ph,t)}}}else Au.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==(r=u.appearance)?void 0:r.borderColor]),yh({survey:u,setSurveyVisible:_,posthog:c}),!p)return null;var k=function(){u.schedule!==ri&&_(!1),Ti(S.current)||clearTimeout(S.current),S.current=setTimeout(function(){S.current=void 0,m(!1)},200)};return wd(Zn,{children:["tab"===(null==(i=u.appearance)?void 0:i.widgetType)&&wd("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=u.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:x,disabled:d,style:wh(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),g&&wd(Sh,{posthog:c,survey:u,forceDisableHtml:l,style:b,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:h})]})}var Ch=function(e){var t=e.question,n=e.onSubmit,r=e.onPreviewSubmit,i={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit:function(e){r(e)},onSubmit:function(e){n(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case Yr:return Kn(qd,u({},i,{question:t,key:t.id}));case"link":return Kn(Bd,u({},i,{question:t,key:t.id}));case ti:return Kn(Nd,u({},i,{question:t,key:t.id}));case ei:case Xr:return Kn(jd,u({},i,{question:t,key:t.id}));default:return Au.error("Unsupported question type: "+t.type),null}},Ph="undefined"!=typeof globalThis?globalThis:Wa;Ph&&"undefined"==typeof self&&(Ph.self=Ph),Ph&&"undefined"==typeof File&&(Ph.File=function(){});var Eh=null!=Wa?Wa:{};Eh.__PosthogExtensions__=Eh.__PosthogExtensions__||{},Eh.__PosthogExtensions__.generateSurveys=mh,Eh.extendPostHogWithSurveys=mh;var Fh=function(e){return ji(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message)},Ih=su("[Error tracking]"),Th="webkit-masked-url:",Rh=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],Mh=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Th],Lh=["__firefox__","__gCrWeb"];function Ah(){return new bo([new Ho,new Jo,new Uo,new jo,new Qo,new Ko,new Vo,new Zo],function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var i=[],s=t.split("\n"),o=Math.min(s.length,r+1e3),a=[],l=r;o>l;l++){var c=s[l];if(1024>=c.length){var d=Lo.test(c)?c.replace(Lo,"$1"):c;if(!d.match(/\S*Error: /)){for(var h=0,p=n;p.length>h;h++){var _=(0,p[h])(d,e);if(_){i.push(_);var v=Oo(i);if(v){for(var g=a.length-1;g>=0;g--){var m=a[g];if(v.start>=m.start+m.length)break;a.pop()}a.push(v)}break}}if(Bo(i,a)>=50)break}}}var y=[].concat(a).sort(function(e,t){return t.start-e.start}),b=y[y.length-1];if(b){var w=$o(i,b);i.splice(b.start-w,w);for(var S,x=f(y);!(S=x()).done;)S.value.start-=w}for(var k,C=f(y);!(k=C()).done;)Do(i,k.value);return a.some(function(e){return 0===e.start&&i.length===e.length})&&function(e){for(var t=e.map(function(e){return e.function+"|"+e.filename+"|"+e.lineno+"|"+e.colno+"|"+e.module}),n=0,r=1;t.length>r;r++)No(t,r,n)&&(n=r);e.push.apply(e,e.splice(0,n))}(i),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})}(i)}}("web:javascript",Io,Mo))}var Oh=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=na(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new ra(this._exceptionStepsConfig)}var t=e.prototype;return t.onConfigChange=function(){this._exceptionStepsConfig=na(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)},t.onRemoteConfig=function(e){var t,n,r,i;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==(r=s.errorTracking)?void 0:r.captureExtensionExceptions;this._suppressionRules=o,this._instance.persistence&&this._instance.persistence.register(((i={})[nl]=this._suppressionRules,i[rl]=a,i))}}},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(!Ri(e)||0===e.trim().length)return void Ih.warn("Ignoring exception step because message must be a non-empty string");var r=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(function(n,r){return ea.has(r)?(t.push(r),n):(n[r]=e[r],n)},{}),droppedKeys:t}}(this._coerceExceptionStepProperties(t)),i=r.sanitizedProperties,s=r.droppedKeys;s.length>0&&Ih.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._exceptionStepsBuffer.add(u(((n={})[Yo]=e,n[Xo]=(new Date).toISOString(),n),i))}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&&Ai(e.$exception_steps)?this._addBufferedExceptionSteps(e):e,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(n.$release_id=r);try{var i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return i&&this._exceptionStepsBuffer.clear(),i}catch(e){return Fh(e)||Ih.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void(Fh(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={})[Yo]=e,t[Xo]=(new Date).toISOString(),t))},t._coerceExceptionStepProperties=function(e){return Fi(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,r=t.value;return Ri(n)&&n.length>0&&e.$exception_types.push(n),Ri(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this._suppressionRules.some(function(e){var n=e.values.map(function(e){var n=Ru[e.operator],r=t[e.key];if(!n||!r)return!1;var i=Pi(e.value)?e.value:[e.value];return i.length>0&&n(i,r)});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&&Mh.some(function(e){return t.startsWith(e)})});return 0!==n.length&&(!n.every(function(e){var t=e.filename;return!!t&&t.startsWith(Th)})||e.some(function(e){var t=e.value;return"NoResponse"===e.type||Ri(t)&&Rh.some(function(e){var n=e.value;return e.exact?t===n:t.includes(n)})})&&!t.some(function(e){var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(Th))}))},t._isInjectedBrowserScriptException=function(e){return e.some(function(e){var t=e.value;return Ri(t)&&Lh.some(function(e){return t.includes(e)})})},t._isPostHogException=function(e){if(e.length>0){var t,n,r,i,s=null!==(t=null==(n=e[0].stacktrace)?void 0:n.frames)&&void 0!==t?t:[];return null!==(r=null==(i=s[s.length-1])||null==(i=i.filename)?void 0:i.includes("posthog.com/static"))&&void 0!==r&&r}return!1},t._isExceptionList=function(e){return!Ai(e)&&Pi(e)},o(e,[{key:"_captureExtensionExceptions",get:function(){var e,t,n=!!this._instance.get_property(rl);return null!==(e=null!==(t=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==t?t:n)&&void 0!==e&&e}}])}(),Dh=su("[ExceptionAutocapture]"),$h=Ah(),qh=function(e,t){try{return e()}catch(e){return t}},Bh=function(e,t){return qh(function(){return e(t())},void 0)},Nh=function(e){return qh(function(){return Ei(e)&&Ei(e.call)},!1)},Hh=function(e,t){return qh(function(){e[t].__POSTHOG_INSTRUMENTED__=!0},void 0)},jh=function(e,t,n){qh(function(){var n;null==(n=e[t])||delete n.__POSTHOG_INSTRUMENTED__},void 0),qh(function(){e[t]=n},void 0)},Uh=function(e){var t=Wa;t||Dh.info("window not available, cannot wrap onerror");var n=qh(function(){return t.onerror},void 0);return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),s=0;r>s;s++)i[s]=arguments[s];return Bh(e,function(){return $h.buildFromUnknown(function(e){var t=e[0],n=e[1],r=e[2],i=e[3],s=e[4];if(null!=s)return s;if(Ri(t)&&Ri(n)&&n.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:n,lineno:r,colno:i})}catch(e){return t}return t}(i),{mechanism:{handled:!1}})}),!!Nh(n)&&null!==(t=n.apply(void 0,i))&&void 0!==t&&t},Hh(t,"onerror"),function(){return jh(t,"onerror",n)}},zh=function(e,t){void 0===t&&(t=!1);var n=Wa;n||Dh.info("window not available, cannot wrap onUnhandledRejection");var r=qh(function(){return n.onunhandledrejection},void 0);return n.onunhandledrejection=function(n){var i;return Bh(e,function(){return $h.buildFromUnknown(n,{mechanism:{handled:!1}})}),Nh(r)?null!==(i=r(n))&&void 0!==i&&i:t},Hh(n,"onunhandledrejection"),function(){return jh(n,"onunhandledrejection",r)}},Vh={wrapOnError:Uh,wrapUnhandledRejection:zh,wrapConsoleError:function(e){var t=console;t||Dh.info("console not available, cannot wrap console.error");var n=qh(function(){return t.error},void 0);return t.error=function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];qh(function(){return r.length>1&&Ri(r[0])&&(/^\[PostHog\.js\](?: |$)/.test(r[0])||"rrweb logger error:"===r[0])},!1)||Bh(e,function(){var e;e=1==r.length?r[0]:r.join(" ");var t=r.find(function(e){return e instanceof Error});return $h.buildFromUnknown(t||e,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Nh(n)&&n.apply(void 0,r)},Hh(t,"error"),function(){return jh(t,"error",n)}}};Eh.__PosthogExtensions__=Eh.__PosthogExtensions__||{},Eh.__PosthogExtensions__.errorWrappingFunctions=Vh,Eh.posthogErrorWrappingFunctions=Vh;var Wh=function(e,t){if(Ei(null==e?void 0:e.capture)){var n=null==t?void 0:t.autocaptureExceptions,r=!Li(n)&&"object"==typeof n&&Pi(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},[]):[],i=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)}};Uh(function(e){r.some(function(t){return e.$exception_list.some(function(e){return t.test(e.value||"")})})||i(e)}),zh(i,!0)}};Eh.extendPostHogWithExceptionAutoCapture=Wh,Eh.extendPostHogWithExceptionAutocapture=Wh;var Gh=function(){},Kh=function(e){var t;if(Ei(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function Qh(e,t,n){try{if(!(t in e))return Gh;var r={next:e[t]},i=n(function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];return r.next.apply(this,t)});return Ei(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=i,function(){if(e[t]!==i)for(var n=e[t],s=Kh(n);s;){if(s.next===i)return void(s.next=r.next);s=Kh(n=s.next)}else e[t]=r.next}}catch(e){return Gh}}var Zh="X-POSTHOG-SESSION-ID",Jh="X-POSTHOG-WINDOW-ID",Yh="X-POSTHOG-DISTINCT-ID",Xh=[Zh,Jh,Yh],ef=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],tf=function(e,t){return{}.hasOwnProperty.call(e,t)},nf=function(e){return"object"==typeof e&&!Li(e)||Ei(e)},rf=function(e){return"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e))},sf=function(e){try{var t;return rf(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Wa||null==(t=Wa.location)?void 0:t.href).toString()}catch(e){return}},of=function(e,t,n,r,i){var s;try{s=new URL(r).hostname}catch(e){return!1}if(!e)return!1;if(Pi(e)&&!e.includes(s))return!1;var o=!1;if(n){var a=n.checkAndGetSessionAndWindowId(!0),u=a.windowId;i.set(Zh,a.sessionId),i.set(Jh,u),o=!0}var l=function(e){return Ei(e)?e():e}(t);return l&&"$posthog_cookieless"!==l&&(i.set(Yh,l),o=!0),o};Eh.__PosthogExtensions__=Eh.__PosthogExtensions__||{};var af={_patchFetch:function(e,t,n){return Qh(Wa,"fetch",function(r){return function(i,s){var o=arguments.length>1?[i,s]:[i],a=o;try{var l=sf(i);if(l)if(rf(i)){var c=new Request(i,s);of(e,t,n,c.url,c.headers),a=[c]}else{var d=new Headers(nf(s)?s.headers:void 0);if(of(e,t,n,l,d)){var h=function(e,t){if(Ti(e)||Li(e))return{headers:t};if(nf(e)){var n=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(n);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),r}return new Proxy({headers:t},{get:function(e,t){return tf(e,t)?Reflect.get(e,t):Reflect.get(n,t,n)},has:function(e,t){return tf(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)}),ef.forEach(function(e){e in n&&t.add(e)}),Array.from(t)},getOwnPropertyDescriptor:function(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r)return r;if("string"==typeof t&&ef.includes(t)&&t in n)return{configurable:!0,enumerable:!0,get:function(){return Reflect.get(n,t,n)}};var i=Reflect.getOwnPropertyDescriptor(n,t);return i?u({},i,{configurable:!0}):void 0},getPrototypeOf:function(){return Object.getPrototypeOf(n)}})}}(s,d);h&&(a=[i,h])}}}catch(e){a=o}return r.apply(this,a)}})},_patchXHR:function(e,t,n){return Qh(Wa.XMLHttpRequest.prototype,"open",function(r){return function(i,s,o,a,u){void 0===o&&(o=!0);var l=this,c=new Headers,d=sf(s);d&&of(e,t,n,d,c);var h=r.call(l,i,s,o,a,u);return Xh.forEach(function(e){var t=c.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}}),h}})}};Eh.__PosthogExtensions__.tracingHeadersPatchFns=af,Eh.postHogTracingHeadersPatchFns=af,Va.DEBUG=!1,Va.LIB_VERSION="1.434.12",Va.LIB_NAME="web";var uf=Va,lf=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==Ka?void 0:Ka.doNotTrack,null==Ka?void 0:Ka.msDoNotTrack,Eh.doNotTrack,null==Ka?void 0:Ka.globalPrivacyControl].some(function(e){return Wi(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 Wi(e)?1:yi(Gi,e)?0:-1}},{key:"_storage",get:function(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?Rc:Ic,n=t._is_supported()?t:Uc;if(!this._persistentStore||this._persistentStore!==n){this._persistentStore=n;var r="localStorage"===e?Ic:Rc;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(Wi(r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}();function cf(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function df(e){return!!e&&1===e.nodeType}function hf(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ff(e){return!!e&&3===e.nodeType}function pf(e){return!!e&&11===e.nodeType&&df(e.host)}function _f(e){return e?bi(e).split(/\s+/):[]}function vf(e,t){var n=kc(t);return!!(n&&e&&e.some(function(e){return n.match(e)}))}function gf(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 _f(t)}function mf(e){return Ai(e)?null:bi(e).split(/(\s+)/).filter(function(e){return Uf(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function yf(e){var t="";return Af(e)&&!Of(e)&&e.childNodes&&e.childNodes.length&&au(e.childNodes,function(e){var n;ff(e)&&e.textContent&&(t+=null!==(n=mf(e.textContent))&&void 0!==n?n:"")}),bi(t)}function bf(e){var t;return Ti(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var wf=["a","button","form","input","select","textarea","label"];function Sf(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}}function xf(e,t){if(Ti(t))return!0;for(var n,r,i=function(){var e=r.value;if(t.some(function(t){return Sf(e,t)}))return{v:!0}},s=f(e);!(r=s()).done;)if(n=i())return n.v;return!1}function kf(e){var t=e.parentNode;return!(!t||!df(t))&&t}var Cf=[".ph-no-autocapture","[data-ph-no-autocapture]"],Pf=["next","previous","prev",">","<"],Ef=[].concat(Pf,["+","-","−","–"]),Ff=function(e,t){return/[a-z0-9]/i.test(t)?e.includes(t):e===t},If=[".ph-no-rageclick",".ph-no-capture"],Tf=["","text","search","email","password","url","tel","number"];function Rf(e,t){if(!Wa||Mf(e))return!1;var n,r,i,s,o;if($i(t)?(n=!!t&&If,r=void 0,i=!1):(n=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:If,r=null==t?void 0:t.content_ignorelist,i=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===n)return!1;if(i&&function(e){return!(!e||!df(e))&&(!!hf(e,"textarea")||(hf(e,"input")?yi(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=Lf(e,!1).targetElementList;return!function(e,t){if(!1===e||Ti(e))return!1;var n;if(!0===e)n=Pf;else{if(!Pi(e))return!1;if(e.length>10)return iu.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,r=e.ariaLabel;return n.some(function(e){return Ff(t,e)||Ff(r,e)})})}(r,a.map(function(e){var t;return{safeText:yf(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!xf(a,n)}var Mf=function(e){return!e||hf(e,"html")||!df(e)},Lf=function(e,t){if(!Wa||Mf(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!hf(i,"body");)if(pf(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=kf(i);if(!s)break;if(t||wf.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var o=Wa.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(n=!0)}catch(e){}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function Af(e){for(var t=new Set,n=0,r=e;r.parentNode&&!hf(r,"body");r=r.parentNode){if(n++>=1e3||t.has(r))return!1;t.add(r);var i=gf(r);if(yi(i,"ph-sensitive")||yi(i,"ph-no-capture"))return!1}if(yi(gf(e),"ph-include"))return!0;var s=e.type||"";if(Ri(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!Ri(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 Of(e){return!!(hf(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||hf(e,"select")||hf(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Df=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}))$"),$f=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,qf=[16,15,14,13],Bf=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Nf=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Hf=/[0-9A-Za-z_]/;function jf(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function Uf(e,t){if(void 0===t&&(t=!0),Ai(e))return!1;if(Ri(e)){if(e=bi(e),t?Df.test((e||"").replace(/[- ]/g,"")):function(e){var t;for($f.lastIndex=0;t=$f.exec(e);){var n=t[2];if(n)for(var r=n.replace(/[- ]/g,""),i=0;r.length>i;i++)for(var s=0,o=qf;o.length>s;s++){var a=i+o[s];if(r.length>=a){var u=r.slice(i,a);if(Df.test(u)&&jf(u))return!0}}}return!1}(e))return!1;if(t?Bf.test(e):function(e){var t;for(Nf.lastIndex=0;t=Nf.exec(e);){var n=t[1],r=t[3];if(!(n&&r&&Hf.test(n)&&Hf.test(r)))return!0}return!1}(e))return!1}return!0}function zf(e){var t=yf(e);return Uf(t=(t+" "+Vf(e)).trim())?t:""}function Vf(e){var t="";return e&&e.childNodes&&e.childNodes.length&&au(e.childNodes,function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=yf(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Vf(e)).trim())}catch(e){iu.error("[AutoCapture]",e)}}),t}function Wf(e){return e.replace(/"|\\"/g,'\\"')}function Gf(e){var t=e.attr__class;if(t)return Pi(t)?t:_f(t)}var Kf=su("[Dead Clicks]"),Qf=function(){return!0},Zf=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(sl)),r=e.instance.config.capture_dead_clicks;return $i(r)?r:!!Fi(r)||n},Jf=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={})[sl]=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=Eh.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",function(t){t?Kf.error("failed to load script",t):e()})},t._start=function(){var e;if(Qa){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=Eh.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Fi(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=Eh.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Qa),Kf.info("starting...")}}else Kf.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Kf.info("stopping..."))},o(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Yf=su("[SegmentIntegration]");function Xf(e,t,n){void 0===n&&(n=!0);var r=e.config.segment;if(!r)return t();var i,s=function(e){return Ei(e.register)}(i=r)?{analytics:i}:i,o=s.analytics,a=s.filterProperties;!function(e,t,n,r){var i=function(t){var i=function(){return t.anonymousId()||fc()};e.config.get_device_id=i,r&&t.id()&&(e.register({distinct_id:t.id(),$device_id:i()}),e.persistence.set_property(Bl,ec)),n(r?void 0:t.anonymousId()||void 0)},s=t.user();"then"in s&&Ei(s.then)?s.then(i):i(s)}(e,o,function(n){o.register(function(e,t,n){var r=(void 0===n?{}:n).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Yf.warn("This browser does not have Promise support, and can not use the segment integration");var i=function(n,i){if(!i)return n;var s=!!t&&n.event.anonymousId===t&&!n.event.userId;s||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(Yf.info("No userId set, resetting PostHog"),e.reset()),s||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(Yf.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));var o=e.calculateEventProperties(i,n.event.properties);if(!Ai(r)){for(var a=n.event.properties||{},l={},c=0,d=Object.keys(o);d.length>c;c++){var h=d[c];ki.call(a,h)||(l[h]=o[h])}var p=function(e,t){for(var n,r=Pi(e)?e:[e],i=u({},t),s=f(r);!(n=s()).done;){var o=n.value;try{if(i=o(i),Ai(i))return null}catch(e){return Yf.error("Error in Segment filterProperties:",e),null}}return i}(r,l);if(Ai(p))return n;o=p}return n.event.properties=Object.assign({},o,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 i(e,e.event.event)},page:function(e){return i(e,ic)},identify:function(e){return i(e,oc)},screen:function(e){return i(e,"$screen")}}}(e,n,{filterProperties:a})).then(function(){t()},function(e){Yf.error("Failed to register the Segment integration",e),t()})},n)}var ep="posthog-js";function tp(e,t){var n=void 0===t?{}:t,r=n.organization,i=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 r&&i&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+t.event_id),c&&(null==(f=e.exceptions)||f.sendExceptionEvent(g)),t}}var np=function(e,t,n,r,i,s){"use strict";this.name=ep,this.setupOnce=function(o){o(tp(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:null==s||s}))}},rp=function(){"use strict";function e(e){var t=this;this._onSessionIdChange=function(e,n,r){r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(iu.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),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,r=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==Wa?void 0:Wa.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r},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 r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var s=i.maxScrollHeight,o=i.lastScrollY,a=i.maxScrollY,u=i.maxContentHeight,l=i.lastContentY,c=i.maxContentY;if(!(Ti(s)||Ti(o)||Ti(a)||Ti(u)||Ti(l)||Ti(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?Zi(o/s,0,1,iu):1,h=s>1?Zi(a/s,0,1,iu):1,f=u>1?Zi(l/u,0,1,iu):1,p=u>1?Zi(c/u,0,1,iu):1;r=uu(r,{$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&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r},e}(),ip=["flags","surveys"],sp=((s={}).$people_distinct_id={exposure:"hidden"},s[Gu]={exposure:"hidden"},s.__cmpns={exposure:"hidden"},s[Yu]={exposure:"hidden"},s[Qu]={exposure:"hidden"},s[Ju]={exposure:"hidden"},s[Xu]={exposure:"event"},s[el]={exposure:"hidden"},s[al]={exposure:"hidden"},s[tl]={exposure:"event"},s[nl]={exposure:"hidden"},s[rl]={exposure:"event"},s[il]={exposure:"event"},s[sl]={exposure:"event"},s[ol]={exposure:"hidden"},s[ul]={exposure:"event"},s[ll]={exposure:"hidden"},s.$session_recording_enabled_server_side={exposure:"hidden"},s[_l]={exposure:"hidden"},s[vl]={exposure:"event"},s[cl]={exposure:"event",shouldSkipFromEventProperties:function(e){return Li(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[gl]={exposure:"hidden",storageGroup:"flags"},s[ml]={exposure:"hidden",storageGroup:"flags"},s[yl]={exposure:"hidden"},s[bl]={exposure:"hidden",storageGroup:"flags"},s[wl]={exposure:"hidden",storageGroup:"flags"},s[Sl]={exposure:"hidden",storageGroup:"flags",volatile:!0},s[xl]={exposure:"hidden",storageGroup:"flags"},s[kl]={exposure:"hidden"},s[Cl]={exposure:"hidden"},s[Pl]={exposure:"hidden"},s[El]={exposure:"hidden"},s[Il]={exposure:"hidden",storageGroup:"surveys"},s[Tl]={exposure:"hidden",storageGroup:"surveys",volatile:!0},s[Rl]={exposure:"event"},s[Ml]={exposure:"hidden"},s[Ll]={exposure:"hidden"},s[Al]={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[Ol]={exposure:"hidden"},s[Dl]={exposure:"hidden"},s[Fl]={exposure:"event"},s[$l]={exposure:"hidden"},s[ql]={exposure:"hidden",storageGroup:"flags",volatile:!0},s[Bl]={exposure:"hidden"},s[Nl]={exposure:"hidden"},s[Hl]={exposure:"hidden"},s[jl]={exposure:"hidden"},s[Ul]={exposure:"hidden"},s[zl]={exposure:"hidden"},s[Vl]={exposure:"hidden"},s[dl]={exposure:"event"},s[hl]={exposure:"event"},s[fl]={exposure:"event"},s[pl]={exposure:"event"},s[Kl]={exposure:"event"},s[Ql]={exposure:"event"},s[Zl]={exposure:"event"},s[Jl]={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),op=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ap=function(e){var t=sp[e];if(t)return t;for(var n=0,r=op;r.length>n;n++){var i=r[n],s=i[1];if(0===e.indexOf(i[0]))return s}},up={flags:ql,surveys:Tl},lp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],cp=function(e){return e+"_cookie_identity_change_pending"},dp=function(e){for(var t,n="",r=0,i=f(e);!(t=i()).done;){var s=t.value,o=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(r+o>1e3)break;n+=s,r+=o}return n},hp="main",fp=[gl,ml,bl,wl,Sl,ql,xl,Pl],pp=function(e){return-1!==fp.indexOf(e)},_p=[Qu,Ju],vp=function(e){return-1!==_p.indexOf(e)},gp=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){return e===t}},mp=function(e){if(!e)return{};var t=JSON.parse(e);return Fi(t)?t:{}},yp=function(e,t){au(e,function(n,r){var i=ap(r);i&&"event"!==i.exposure||{}.hasOwnProperty.call(t,r)||delete e[r]})},bp=function(){"use strict";function e(e,t,n){var r=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._metaIdentifierChangePending=new Set,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&&iu.info("Persistence loaded",e.persistence,u({},this.props)),this.update_config(e,e,t),this.save(),Wa){var i=function(){return r.flush()};_u(Wa,"beforeunload",i,{capture:!1}),_u(Wa,"pagehide",i,{capture:!1}),this._onStorage=function(e){if(r._splitStorageEligible&&(!e.storageArea||e.storageArea===(null==Wa?void 0:Wa.localStorage))&&e.key)if(e.key!==r._name){if(r._splitStorage){var t=ip.find(function(t){return e.key===r._groupEntryName(t)});t&&r._syncCrossTabFeatureFlagProperties(e.key,t)}}else r._syncCrossTabFeatureFlagProperties(e.key,hp)},_u(Wa,"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],r=e[1],i=t._pendingCrossTabFeatureFlagChanges.get(n);if(pp(n)&&!0!==i)if(!0!==r){var s=new Set(i||[]);r.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&&Wa&&(Wa.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 r,i;try{if(i=Rc._get(e),Li(i)){var s=this._slotWriteState(t);return s.storageValue=null,t!==hp&&(s.persisted=!1),!1}r=mp(i)}catch(e){return!1}var o=t===hp?r:Rc._parse(this._name);if(o&&this._hasCrossTabFeatureFlagIdentityMismatch(o))return!1;var a=this._mergeCrossTabFeatureFlagProperties(r,t,n);return t===hp&&this._splitStorage&&!gp(this._partitionProps().main,r)||this._rememberCrossTabStorageFingerprint(r,t,!0,i),a},t._hasCrossTabFeatureFlagIdentityMismatch=function(e){var t=this.props[zu],n=e[zu];return!Ti(t)&&!Ti(n)&&t!==n},t._rememberCrossTabStorageFingerprint=function(e,t,n,r){var i=this._slotWriteState(t);i.storageValue=r,t!==hp&&(i.persisted=n);try{i.fingerprint=this._entryFingerprint(e,t)}catch(e){i.fingerprint=void 0}},t._mergeCrossTabFeatureFlagProperties=function(e,t,n){var r=this,i=!1;return fp.forEach(function(n){var s,o=null==(s=ap(n))?void 0:s.storageGroup;if(!(t===hp&&r._splitStorage&&o||t!==hp&&o!==t)){var a=n in e,u=r._mergePendingCrossTabFeatureFlagChanges(n,a?e[n]:void 0),l=r._pendingCrossTabFeatureFlagChanges.has(n)?n in r.props:a;l===n in r.props&&gp(u,r.props[n])||(l?r._setProp(n,u,!1):r._deleteProp(n,!1),i=!0)}}),i&&n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}),i},t._reconcileCrossTabFeatureFlagPropertiesBeforeWrite=function(){var e=this;if(!this._splitStorageEligible)return!1;try{this._crossTabFeatureFlagIdentityMismatch=!1;var t,n=Rc._get(this._name),r=this._slotWriteState(hp),i=!1,s=!1;if(n!==r.storageValue)if(Li(n))r.storageValue=null;else{if(t=mp(n),this._crossTabFeatureFlagIdentityMismatch=!this._localIdentityChangePending&&this._hasCrossTabFeatureFlagIdentityMismatch(t),this._crossTabFeatureFlagIdentityMismatch)return!1;s=this._mergeCrossTabFeatureFlagProperties(t,hp,!1),!this._splitStorage||gp(this._partitionProps().main,t)?this._rememberCrossTabStorageFingerprint(t,hp,!0,n):r.storageValue=n,i=!0}return this._splitStorage&&ip.forEach(function(n){var r=Rc._get(e._groupEntryName(n)),o=e._slotWriteState(n),a=t||{},u=i&&fp.some(function(e){var t;return(null==(t=ap(e))?void 0:t.storageGroup)===n&&e in a});if(r!==o.storageValue||u){if(Li(r))return o.storageValue=null,o.persisted=!1,void(u&&(s=e._mergeCrossTabFeatureFlagProperties(a,n,!1)||s));var l=mp(r);s=e._mergeCrossTabFeatureFlagProperties(l,n,!1)||s,e._rememberCrossTabStorageFingerprint(l,n,!0,r)}}),s}catch(e){return!1}},t._setCrossTabFeatureFlagChangesPending=function(e,t){this._pendingCrossTabFeatureFlagChanges.set(e,t);var n=ap(e);null!=n&&n.volatile||(this._slotWriteState((this._splitStorage?null==n?void 0:n.storageGroup:void 0)||hp).fingerprint=void 0,this._markGroupDirty(e))},t._markAllCrossTabFeatureFlagChangesPending=function(){var e=this;fp.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=mp(t);this._slotWriteState(hp).storageValue=t,fp.forEach(function(t){var r,i=e._splitStorage?null==(r=ap(t))?void 0:r.storageGroup:void 0,s=i?Rc._get(e._groupEntryName(i)):null;if(i){var o=e._slotWriteState(i);o.storageValue=s,o.persisted=!Li(s)}var a=i&&!Li(s)?mp(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 r=new Set(Pi(t)?t:[]),i=new Set(Pi(this.props[e])?this.props[e]:[]);return n.forEach(function(e){return i.has(e)?r.add(e):r.delete(e)}),Array.from(r)}var s=Fi(t)?u({},t):{},o=Fi(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(pp(e)){var r=this._pendingCrossTabFeatureFlagChanges.get(e);if(!0!==r){var i=t;if(this._splitStorageEligible)try{var s,o=this._splitStorage?null==(s=ap(e))?void 0:s.storageGroup:void 0,a=o?this._groupEntryName(o):this._name;i=mp(Rc._get(a))[e]}catch(e){}var u=new Set(r||[]);if("$active_feature_flags"===e){if(!Ti(t)&&!Pi(t)||!Ti(i)&&!Pi(i)||!Pi(n))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var l=new Set(t||[]),c=new Set(i||[]),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(!Fi(n))return void(gp(i,n)?this._pendingCrossTabFeatureFlagChanges.delete(e):this._setCrossTabFeatureFlagChangesPending(e,!0));if(!Ti(t)&&!Fi(t)||Ti(t)&&Ii(n)&&Ti(i))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var h=Fi(t)?t:{},f=Fi(i)?i:{};new Set([].concat(Object.keys(h),Object.keys(n))).forEach(function(e){e in h==e in n&&gp(h[e],n[e])||u.add(e)}),u.forEach(function(e){e in f==e in n&&gp(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 Oi(t)&&t>0?t:0},t._rememberCurrentCookieProperties=function(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=$c(e,this._config.cookie_persisted_properties||[]),n=Bc(t,this._config.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(n),i=Ic._get(this._name)||void 0;i&&Hc(this._name,i)===r&&(this._lastSeenCookiePropertiesFingerprint=r,this._lastSeenMainCookieValue=i)}catch(e){}else try{var s=Ic._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=s?Hc(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,r=this;if(void 0===t&&(t=!1),this._disabled&&!t||this._cookieSyncSuppressed||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{n=Ic._get(this._name)||void 0}catch(e){}if(!n||n===this._lastSeenMainCookieValue)return!1;var i,s=Hc(this._name,n);try{i=Dc(JSON.parse(n))}catch(e){return!1}if((Ic._get(this._name)||void 0)!==n)return!1;this._lastSeenCookiePropertiesFingerprint=s,this._lastSeenMainCookieValue=n;var o=Nc(this._name,n),a=[].concat(Lc,o.properties),u={};if(Object.keys(i).forEach(function(e){var t=i[e];(Ti(t)||Li(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(u[e]=!0,delete i[e])}),Ii(i))return!1;var l="distinct_id"in i||"anonymous"===i.$user_state||"identified"===i.$user_state,c=this.props,d=c[zu],h=c[Bl],f=uu({},c);[].concat(Lc,e.cookie_persisted_properties||[]).forEach(function(e){if(-1!==a.indexOf(e)&&!(e in i)&&!u[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=f[e];(o.isValid||-1===Lc.indexOf(e)||!1!==t&&0!==t)&&delete f[e]}}),this.props=uu(f,i),fp.forEach(function(e){var t=e in r.props;e in c===t&&gp(c[e],r.props[e])||(t?r._markPendingCrossTabFeatureFlagChanges(e,c[e],r.props[e]):r._setCrossTabFeatureFlagChangesPending(e,!0))}),!l||"$user_state"in i||"$user_state"in this.props||this._setProp(Bl,Xl);var p=this.props[zu],_=this.props[Bl];return!l||p===d&&_===h||(this._localIdentityChangePending=!0,this._cookieIdentityChangePending=!0,Vc._set(cp(this._name),!0),this._deleteProp(Pl),this._deleteProp(ml),this._deleteProp(gl),this._deleteProp(bl),this._deleteProp(wl),this._deleteProp(Sl),this._deleteProp(ql),this._deleteProp($l),this._deleteProp(Ol),"anonymous"!==_||"identified"!==h&&"anonymous"!==i.$user_state&&(Ti(d)||p===d)||(yp(this.props,i),this._deleteProp(El)),"identified"===_?this.props.$user_id=p:delete this.props.$user_id,this._deleteProp(Gu)),!0},t.consumeCookieIdentityChange=function(){var e=cp(this._name),t=this._cookieIdentityChangePending||!!Vc._get(e);return this._cookieIdentityChangePending=!1,t&&Vc._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&&(Ti(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[hp],this._writeNow(!0))},t._endCookieSyncSuppression=function(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():Ti(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}},t.isDisabled=function(){return!!this._disabled},t._buildStorage=function(e){-1===lp.indexOf(e.persistence.toLowerCase())&&(iu.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(Lc,e);return u({},Rc,{_parse:function(e){try{var r,i={};try{r=Ic._get(e)||void 0,i=r?Dc(JSON.parse(r)):{}}catch(e){}var s,o=JSON.parse(Rc._get(e)||"{}");if(t){var a=Nc(e,r),u=[].concat(Lc,a.properties),l={};Object.keys(i).forEach(function(e){var t=i[e];Li(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[zu],f=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";n.forEach(function(e){if(-1!==u.indexOf(e)&&!(e in i)&&(c||"distinct_id"!==e&&"$user_state"!==e)){var t=o[e];(a.isValid||-1===Lc.indexOf(e)||!1!==t&&0!==t)&&delete o[e]}}),!c||"$user_state"in i||"$user_state"in o||(o[Bl]=Xl),!c||("distinct_id"in l?l[zu]:o[zu])===h&&("$user_state"in l?l[Bl]:o[Bl])===f||(Mc.forEach(function(e){return delete o[e]}),"identified"===l.$user_state&&"distinct_id"in l?o.$user_id=l[zu]:delete o.$user_id,"identified"!==l.$user_state&&(delete o[Fl],delete o[El]),delete o.__alias)}s=uu(o,l)}else s=uu(i,o);return Rc._set(e,s),s}catch(e){}return null},_set:function(n,r,i,s,o,a){var u=Rc._set(n,r,void 0,void 0,a);try{var l=$c(r,e);if(Object.keys(l).length){if(t){var c=Ac(n),d=Bc(l,e);if(Ic._set(c,d,i,s,o,a),Ic._get(c)!==JSON.stringify(d)){Ic._remove(c,s);var h=$c(r);return Ic._set(n,h,i,s,o,a),u}}Ic._set(n,l,i,s,o,a)}}catch(e){Rc._error(e)}return u},_remove:function(e,t){try{null==Wa||Wa.localStorage.removeItem(e),Ic._remove(e,t),Ic._remove(Ac(e),t)}catch(e){Rc._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),r=!1,i=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&Rc._is_supported()?(t=Rc,i=!0):"localstorage+cookie"===s&&n._is_supported()?(t=n,i=!0,r=!0):"sessionstorage"===s&&Vc._is_supported()?t=Vc:"memory"===s?t=Uc:"cookie"===s&&Ic._is_supported()?(t=Ic,r=!0):n._is_supported()?(t=n,i=!0,r=!0):Ic._is_supported()?(t=Ic,r=!0):t=Uc,this._splitStorageEligible=i,this._storesIdentityInCookie=r,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 au(this.props,function(t,n){var r=ap(n);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.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(),r=n?Rc._parse(this._name):null,i={};if(n)try{au(i=Dc(Ic._parse(this._name)),function(e,t){(Ti(e)||Li(e)||""===e)&&delete i[t]})}catch(e){}var s=this._storage._parse(this._name);if(s&&(this.props=uu({},s)),this._splitStorage&&this._loadGroupEntries(),n&&s){var o,a,u=null==r?void 0:r[zu],l=null!==(o=null==r?void 0:r.$user_state)&&void 0!==o?o:"anonymous",c=s[zu],d=null!==(a=s.$user_state)&&void 0!==a?a:"anonymous";if(c!==u||d!==l){this._cookieIdentityChangePending=!0,Vc._set(cp(this._name),!0);var h=uu({},this.props);Mc.forEach(function(e){return delete h[e]}),"anonymous"!==d||"identified"!==l&&"anonymous"!==i.$user_state&&(Ti(u)||c===u)||(yp(h,i),delete h[El]),this.props=h;var f=new Set;Mc.forEach(function(e){var t,n=null==(t=ap(e))?void 0:t.storageGroup;n&&f.add(n)}),f.forEach(function(e){var n={};au(t.props,function(t,r){var i;(null==(i=ap(r))?void 0:i.storageGroup)===e&&(n[r]=t)}),Ii(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)})})}}Vc._get(cp(this._name))&&(this._cookieIdentityChangePending=!0)}},t._loadGroupEntries=function(){for(var e=0,t=ip;t.length>e;e++){var n=t[e],r=Rc._parse(this._groupEntryName(n));if(r&&!Ii(r)){var i=this._slotWriteState(n);i.persisted=!0,this._mainCarriesGroupKey(n)||(i.fingerprint=this._entryFingerprint(r,n)),this._groupEntryIsStale(n,r)||uu(this.props,r)}}},t._mainCarriesGroupKey=function(e){return Object.keys(this.props).some(function(t){var n;return(null==(n=ap(t))?void 0:n.storageGroup)===e})},t._groupEntryIsStale=function(e,t){var n=up[e];if(!n)return!1;var r=t[n],i=this.props[n];return Oi(r)&&Oi(i)&&i>r},t.refreshKey=function(e){var t;if(!this._disabled&&!this._metaIdentifierChangePending.has(e)){var n=this._splitStorage?null==(t=ap(e))?void 0:t.storageGroup:void 0,r=n?Rc._parse(this._groupEntryName(n)):this._storage._parse(this._name);if(r&&e in r)this._setProp(e,r[e],!1);else{if(n){var i=this._storage._parse(this._name);if(i&&e in i)return void this._setProp(e,i[e],!1)}this._deleteProp(e,!1)}}},t.save=function(){var e=this;if(!this._disabled){var t=this._saveDebounceMs();t>0?Ti(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout(function(){e._pendingSaveTimer=void 0,e._writeNow()},t)):this._writeNow()}},t.flush=function(){Ti(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())},t._writeNow=function(e){var t=this;if(void 0===e&&(e=!1),!(this._disabled||this._cookieSyncSuppressed&&!e)){e||(this.syncCookieProperties(),this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase()||_p.forEach(function(e){return t.refreshKey(e)}));var n=!e&&!this._storageMigrationInProgress;n||(this._crossTabFeatureFlagIdentityMismatch=!1);var r=!!n&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite();if(this._crossTabFeatureFlagIdentityMismatch)this._config.debug&&iu.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this._splitStorage)return this._writeNowSplit(),void(r&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}));var i=this._writeEntry(this._storage,this._name,this.props,hp);"written"===i&&this._rememberCurrentCookieProperties(this.props),"failed"!==i&&(this._pendingCrossTabFeatureFlagChanges.clear(),this._localIdentityChangePending=!1,this._metaIdentifierChangePending.clear()),r&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()})}}},t._writeNowSplit=function(){var e=this,t=this._partitionProps(),n=t.main,r=t.groups,i=this._writeEntry(this._storage,this._name,n,hp);"written"===i&&this._rememberCurrentCookieProperties(n),"failed"!==i&&(this._localIdentityChangePending=!1,this._metaIdentifierChangePending.clear(),fp.forEach(function(t){var n;null!=(n=ap(t))&&n.storageGroup||e._pendingCrossTabFeatureFlagChanges.delete(t)}));for(var s=function(){var t,n=a[o],i=r[n];if(Ii(i)&&(null==(t=e._slotState[n])||!t.persisted))return fp.forEach(function(t){var r;(null==(r=ap(t))?void 0:r.storageGroup)===n&&e._pendingCrossTabFeatureFlagChanges.delete(t)}),1;var s=e._writeEntry(Rc,e._groupEntryName(n),i,n);"failed"!==s&&fp.forEach(function(t){var r=ap(t);(null==r?void 0:r.storageGroup)!==n||"written"!==s&&r.volatile||e._pendingCrossTabFeatureFlagChanges.delete(t)})},o=0,a=ip;a.length>o;o++)if(s())continue},t._partitionProps=function(){var e={},t={flags:{},surveys:{}};return au(this.props,function(n,r){var i,s=null==(i=ap(r))?void 0:i.storageGroup;s?t[s][r]=n:e[r]=n}),{main:e,groups:t}},t._entryFingerprint=function(e,t){if(t===hp)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var n={};return au(e,function(e,t){var r;n[t]=null!=(r=ap(t))&&r.volatile?"__volatile__":e}),JSON.stringify(n)},t._writeEntry=function(e,t,n,r){var i,s=this._slotWriteState(r);if(r!==hp&&!s.dirty&&!Ti(s.fingerprint))return"skipped";try{if((i=this._entryFingerprint(n,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(e){i=void 0}return e._set(t,n,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(s.dirty=!1,r!==hp&&(s.persisted=!0),Ti(i)||(s.fingerprint=i),this._splitStorageEligible&&(s.storageValue=Rc._get(t)),"written"):(this._config.debug&&iu.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(),Ti(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 r=0,i=ip;i.length>r;r++)Rc._remove(this._groupEntryName(i[r]));n?delete this._slotState[hp]: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 r=this;if(Fi(e)){this.syncCookieProperties(),Ti(t)&&(t="None"),this._expire_days=Ti(n)?this._default_expiry:n;var i=!1;if(au(e,function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r._setProp(n,e),i=!0)}),i)return this.save(),!0}return!1},t.register=function(e,t){var n=this;if(Fi(e)){this.syncCookieProperties(),this._expire_days=Ti(t)?this._default_expiry:t;var r=!1;if(au(e,function(t,i){e.hasOwnProperty(i)&&(n.props[i]!==t||Fi(t)||Pi(t))&&(n._setProp(i,t),r=!0)}),r)return this.save(),!0}return!1},t.unregister=function(e){this.syncCookieProperties();for(var t,n=!1,r=f("string"==typeof e?[e]:e);!(t=r()).done;){var i=t.value;i in this.props&&(this._deleteProp(i),n=!0)}n&&this.save()},t.update_campaign_params=function(){var e=null==Qa?void 0:Qa.URL;if(e!==this._campaign_params_url){var t=eh(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),n=!Ii(du(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==Qa?void 0:Qa.referrer)?nh(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:sh(),$referring_domain:null!=Qa&&Qa.referrer&&(null==(e=vc(Qa.referrer))?void 0:e.host)||ih},void 0)},t.set_initial_person_info=function(){var e;if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=oh(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes);this.register_once(((e={})[zl]=this._storesIdentityInCookie?{r:dp(t.r),u:t.u?dp(t.u):void 0}:t,e),void 0)}},t.get_initial_props=function(){var e=this,t={};au([Ul,jl],function(n){var r=e.props[n];r&&au(r,function(e,n){t["$initial_"+wi(n)]=e})});var n=this.props[zl];return n&&uu(t,function(e,t){void 0===t&&(t=!1);var n=ah(e,t),r={};return au(n,function(e,t){r["$initial_"+wi(t)]=e}),r}(n,this._config.disable_capture_url_hashes)),t},t.safe_merge=function(e){return au(this.props,function(t,n){n in e||(e[n]=t)}),e},t.update_config=function(e,t,n){var r=e.persistence!==t.persistence,i=!function(e,t){if(e.length!==t.length)return!1;var n=[].concat(e).sort(),r=[].concat(t).sort();return n.every(function(e,t){return e===r[t]})}(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=r||i,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!n,l=!!this._disabled&&!a;a||this._syncCookieProperties(t,l),this._config=e,!a&&(r||i||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[hp],this._writeNow()))}finally{this._storageMigrationInProgress=!1,f&&this._endCookieSyncSuppression()}},t._truncateExistingPersonInfoForCookie=function(){var e=this.props[zl];if(this._storesIdentityInCookie&&Fi(e)&&"string"==typeof e.r){var t=dp(e.r),n="string"==typeof e.u?dp(e.u):e.u;t===e.r&&n===e.u||this._setProp(zl,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(Yu,n),this.save()},t.remove_event_timer=function(e){var t=this.props.__timers||{},n=t[e];return Ti(n)||(delete t[e],this._setProp(Yu,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 r;void 0===n&&(n=!0);var i=this.props[e];this.props[e]=t,n&&("distinct_id"!==e&&"$user_state"!==e||i===t||(this._localIdentityChangePending=!0),vp(e)&&!gp(i,t)&&this._metaIdentifierChangePending.add(e),this._markPendingCrossTabFeatureFlagChanges(e,i,t),null!=(r=ap(e))&&r.volatile||this._markGroupDirty(e))},t._deleteProp=function(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(pp(e)&&this._setCrossTabFeatureFlagChangesPending(e,!0),vp(e)&&this._metaIdentifierChangePending.add(e),this._markGroupDirty(e))},t._markGroupDirty=function(e){var t,n=null==(t=ap(e))?void 0:t.storageGroup;n&&(this._slotWriteState(n).dirty=!0)},t._slotWriteState=function(e){return this._slotState[e]||(this._slotState[e]={})},e}(),wp=su("[RateLimiter]"),Sp=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){wp.info((e||"events")+" is quota limited."),t.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void wp.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,r;void 0===e&&(e=!1);var i=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:i,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>i&&(a.tokens=i);var u=1>a.tokens;if(u||e||(a.tokens=Math.max(0,a.tokens-1)),u&&!e){var l=(Oi(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this._captureWarning(l)&&(a.dropped=0)}return this.lastEventRateLimited=u,null==(r=this.instance.persistence)||r.set_property(Hl,a),{isRateLimited:u,remainingTokens:a.tokens}},t._isPropertyAllowed=function(e){var t=this.instance.config.property_denylist;return!Pi(t)||!t.includes(e)},t._triggeringPage=function(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=Za&&Za.pathname)return""+(null!==(e=Za.origin)&&void 0!==e?e:"")+Za.pathname},t._captureWarning=function(e){var t,n,r=this.captureEventsBurstLimit,i=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 "+i+" events per second and "+r+" 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)}}])}(),xp=su("[RemoteConfig]"),kp=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t,n,r=this;null!=(t=Eh.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",function(){return e(r.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 xp.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void xp.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(function(t){if(!t)return xp.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){xp.error("Error loading remote config",e),this._onRemoteConfig()}},t._onRemoteConfig=function(e,t){!e&&t&&(0===t.statusCode?t.error||xp.warn("Failed to fetch remote config from PostHog."):xp.error("Failed to fetch remote config from PostHog."));try{this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1})}catch(e){xp.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){xp.error("Error loading feature flags",e)}},o(e,[{key:"remoteConfig",get:function(){var e;return null==(e=Eh._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),Cp=Uint8Array,Pp=Uint16Array,Ep=Uint32Array,Fp=new Cp([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]),Ip=new Cp([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]),Tp=new Cp([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rp=function(e,t){for(var n=new Pp(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new Ep(n[30]);for(r=1;30>r;++r)for(var s=n[r];n[r+1]>s;++s)i[s]=s-n[r]<<5|r;return[n,i]},Mp=Rp(Fp,2),Lp=Mp[1];Mp[0][28]=258,Lp[258]=28;for(var Ap=Rp(Ip,0)[1],Op=new Pp(32768),Dp=0;32768>Dp;++Dp){var $p=(43690&Dp)>>>1|(21845&Dp)<<1;Op[Dp]=((65280&($p=(61680&($p=(52428&$p)>>>2|(13107&$p)<<2))>>>4|(3855&$p)<<4))>>>8|(255&$p)<<8)>>>1}var qp=function(e,t,n){for(var r=e.length,i=0,s=new Pp(t);r>i;++i)++s[e[i]-1];var o,a=new Pp(t);for(i=0;t>i;++i)a[i]=a[i-1]+s[i-1]<<1;if(n){o=new Pp(1<<t);var u=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=a[e[i]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)o[Op[d]>>>u]=l}else for(o=new Pp(r),i=0;r>i;++i)o[i]=Op[a[e[i]-1]++]>>>15-e[i];return o},Bp=new Cp(288);for(Dp=0;144>Dp;++Dp)Bp[Dp]=8;for(Dp=144;256>Dp;++Dp)Bp[Dp]=9;for(Dp=256;280>Dp;++Dp)Bp[Dp]=7;for(Dp=280;288>Dp;++Dp)Bp[Dp]=8;var Np=new Cp(32);for(Dp=0;32>Dp;++Dp)Np[Dp]=5;var Hp=qp(Bp,9,0),jp=qp(Np,5,0),Up=function(e){return(e/8|0)+(7&e&&1)},zp=function(e,t,n){(null==t||0>t)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Pp?Pp:e instanceof Ep?Ep:Cp)(n-t);return r.set(e.subarray(t,n)),r},Vp=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Wp=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Gp=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new Cp(0),0];if(1==i){var o=new Cp(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!=i-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(r=1;i>r;++r)s[r].s>h&&(h=s[r].s);var f=new Pp(h+1),p=Kp(n[c-1],f,0);if(p>t){r=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});i>r;++r){var m=s[r].s;if(t>=f[m])break;_+=g-(1<<p-f[m]),f[m]=t}for(_>>>=v;_>0;){var y=s[r].s;t>f[y]?_-=1<<t-f[y]++-1:++r}for(;r>=0&&_;--r){var b=s[r].s;f[b]==t&&(--f[b],++_)}p=t}return[new Cp(f),p]},Kp=function(e,t,n){return-1==e.s?Math.max(Kp(e.l,t,n+1),Kp(e.r,t,n+1)):t[e.s]=n},Qp=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Pp(++t),r=0,i=e[0],s=1,o=function(e){n[r++]=e},a=1;t>=a;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&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(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},Zp=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Jp=function(e,t,n){var r=n.length,i=Up(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;r>s;++s)e[i+s+4]=n[s];return 8*(i+4+r)},Yp=function(e,t,n,r,i,s,o,a,u,l,c){Vp(t,c++,n),++i[256];for(var d=Gp(i,15),h=d[0],f=d[1],p=Gp(s,15),_=p[0],v=p[1],g=Qp(h),m=g[0],y=g[1],b=Qp(_),w=b[0],S=b[1],x=new Pp(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[Tp[F-1]];--F);var I,T,R,M,L=l+5<<3,A=Zp(i,Bp)+Zp(s,Np)+o,O=Zp(i,h)+Zp(s,_)+o+14+3*F+Zp(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(A>=L&&O>=L)return Jp(t,c,e.subarray(u,u+l));if(Vp(t,c,1+(A>O)),c+=2,A>O){I=qp(h,f,0),T=h,R=qp(_,v,0),M=_;var D=qp(P,E,0);for(Vp(t,c,y-257),Vp(t,c+5,S-1),Vp(t,c+10,F-4),c+=14,k=0;F>k;++k)Vp(t,c+3*k,P[Tp[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)Vp(t,c,D[H=31&N[k]]),c+=P[H],H>15&&(Vp(t,c,N[k]>>>5&127),c+=N[k]>>>12)}}else I=Hp,T=Bp,R=jp,M=Np;for(k=0;a>k;++k)if(r[k]>255){var H;Wp(t,c,I[257+(H=r[k]>>>18&31)]),c+=T[H+257],H>7&&(Vp(t,c,r[k]>>>23&31),c+=Fp[H]);var j=31&r[k];Wp(t,c,R[j]),c+=M[j],j>3&&(Wp(t,c,r[k]>>>5&8191),c+=Ip[j])}else Wp(t,c,I[r[k]]),c+=T[r[k]];return Wp(t,c,I[256]),c+T[256]},Xp=new Ep([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),e_=new Cp(0),t_=function(){for(var e=new Ep(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),n_=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function r_(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;t.length>r;++r)n=t_[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,s,o,a,u,l=(i=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,n,r,i,s){var o=e.length,a=new Cp(r+o+5*(1+Math.floor(o/7e3))+i),u=a.subarray(r,a.length-i),l=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var d=c+65535;o>d?l=Jp(u,l,e.subarray(c,d)):(u[c]=s,l=Jp(u,l,e.subarray(c,o)))}else{for(var h=Xp[t-1],f=h>>>13,p=8191&h,_=(1<<n)-1,v=new Pp(32768),g=new Pp(_+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 Ep(25e3),S=new Pp(288),x=new Pp(32),k=0,C=0,P=(c=0,0),E=0,F=0;o>c;++c){var I=b(c),T=32767&c,R=g[I];if(v[T]=R,g[I]=T,c>=E){var M=o-c;if((k>7e3||P>24576)&&M>423){l=Yp(e,u,0,w,S,x,C,P,F,c-F,l),P=k=C=0,F=c;for(var L=0;286>L;++L)S[L]=0;for(L=0;30>L;++L)x[L]=0}var A=2,O=0,D=p,q=T-R&32767;if(M>2&&I==b(c-q))for(var B=Math.min(f,M)-1,N=Math.min(32767,c),H=Math.min(258,M);N>=q&&--D&&T!=R;){if(e[c+A]==e[c+A-q]){for(var j=0;H>j&&e[c+j]==e[c+j-q];++j);if(j>A){if(A=j,O=q,j>B)break;var U=Math.min(q,j-2),z=0;for(L=0;U>L;++L){var V=c-q+L+32768&32767,W=V-v[V]+32768&32767;W>z&&(z=W,R=V)}}}q+=(T=R)-(R=v[T])+32768&32767}if(O){w[P++]=268435456|Lp[A]<<18|Ap[O];var G=31&Lp[A],K=31&Ap[O];C+=Fp[G]+Ip[K],++S[257+G],++x[K],E=c+A,++k}else w[P++]=e[c],++S[e[c]]}}l=Yp(e,u,s,w,S,x,C,P,F,c-F,l),s||(l=Jp(u,l,e_))}return zp(a,0,r+Up(l)+i)}(i,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.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&&n_(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),n_(l,c-8,n.d()),n_(l,c-4,r),l}var i_=!!Ya||!!Ja,s_=new WeakMap,o_="text/plain",a_=0,u_=!1,l_=function(e,t){var n=e.split("#"),r=n[1],i=n[0].split("?"),s=i[0],o=i[1];if(!o)return e;var a=o.split("&").filter(function(e){return e.split("=")[0]!==t}).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},c_=function(e,t,n){var r;void 0===n&&(n=!0);var i=e.split("?"),s=i[0],o=i[1],a=u({},t),l=null!==(r=null==o?void 0:o.split("&").map(function(e){var t,r=e.split("="),i=r[0],s=n&&null!==(t=a[i])&&void 0!==t?t:r[1];return delete a[i],i+"="+s}))&&void 0!==r?r:[],c=function(e,t){var n,r;void 0===t&&(t="&");var i=[];return au(e,function(e,t){Ti(e)||Ti(t)||"undefined"===t||(n=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+"="+n)}),i.join(t)}(a);return c&&l.push(c),l.length>0?s+"?"+l.join("&"):s},d_=function(e){if(e._encodedBody)return e._encodedBody;var t=e.data,n=e.compression;if(t){if(n===Nr){var r=r_(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Cp(e.length+(e.length>>>1)),r=0,i=function(e){n[r++]=e},s=0;t>s;++s){if(r+5>n.length){var o=new Cp(r+8+(t-s<<1));o.set(n),n=o}var a=e.charCodeAt(s);128>a?i(a):2048>a?(i(192|a>>>6),i(128|63&a)):a>55295&&57344>a?(i(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++s))>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|63&a)):(i(224|a>>>12),i(128|a>>>6&63),i(128|63&a))}return zp(n,0,r)}(_c(t)),{mtime:0});return{contentType:o_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Hr){var i=function(e){return"data="+encodeURIComponent("string"==typeof e?e:_c(e))}(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})):e}(_c(t)));return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=_c(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},h_=function(e){var t,n,r=function(){return"sendBeacon"===e.transport?{url:c_(e.url,{compression:Hr}),encodedBody:d_(u({},e,{compression:Hr,_encodedBody:void 0}))}:{url:l_(e.url,"compression"),encodedBody:d_(u({},e,{compression:void 0,_encodedBody:void 0}))}};try{t=d_(e)}catch(t){if(ha(e.compression,gc(e.url,"compression")))return iu.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&ha(e.compression,gc(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?da(new Uint8Array(n)):ArrayBuffer.isView(n)&&da(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(u_=!0,r()):{url:e.url,encodedBody:t}},f_=function(e){try{return h_(e)}catch(t){return iu.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},p_=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:return n=_c(t.data),e.n=1,ga(n,uf.DEBUG,{rethrow:!0});case 1:if(r=e.v){e.n=2;break}return e.a(2,t);case 2:return e.n=3,r.arrayBuffer();case 3:return e.a(2,u({},t,{_encodedBody:{contentType:o_,body:i=e.v,estimatedSize:i.byteLength}}))}},e)}));return function(t){return e.apply(this,arguments)}}(),__=/Failed to fetch|NetworkError|Load failed/i,v_=function(e){return"TypeError"===(null==e?void 0:e.name)&&__.test((null==e?void 0:e.message)||"")},g_=function(e){try{var t=function(e,t){if(void 0===t&&(t=Date.now()),"string"==typeof e&&e){var n=e.trim(),r=/^\d+\s*,/.test(n)?n.slice(0,n.indexOf(",")).trim():n;if(/^\d+$/.test(r)){var i=1e3*Math.min(Number(r),300);return i>0?i:void 0}if(/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(r)){var s=/^\w{3} \w{3} /.test(r)?r+" GMT":r,o=Date.parse(s)-t;if(Number.isFinite(o)&&o>0)return Math.min(o,uo)}}}(e());return Ti(t)?void 0:Math.min(t,3e4)}catch(e){return}},m_=function(e){var t=f_(e);if(t){var n=new Ya;s_.set(n,!0);var r=t.encodedBody;n.open(e.method||"GET",t.url,!0);var i=null!=r?r:{},s=i.contentType,o=i.body;au(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,g_(function(){return n.getResponseHeader("Retry-After")}))}},n.send(o)}},y_=function(e){var t=f_(e);if(t){var n=t.url,r=t.encodedBody,i=null!=r?r:{},s=i.contentType,o=i.body,a=i.estimatedSize,l=new Headers;au(e.headers,function(e,t){l.append(t,e)}),s&&l.append("Content-Type",s);var c=null,d=!1;if(Xa){var h=new Xa;c={signal:h.signal,timeout:setTimeout(function(){d=!0;try{h.abort(fo("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}catch(e){p(e)}var t},e.timeout)}}var f=!1,p=function(t){f||(f=!0,d&&"AbortError"===(null==t?void 0:t.name)||v_(t)?iu.warn(t):iu.error(t),null==e.callback||e.callback({statusCode:0,error:t}))},_=0,v=function(){a_-=_,_=0,c&&clearTimeout(c.timeout)};try{var g,m=u({method:(null==e?void 0:e.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:o,signal:null==(g=c)?void 0:g.signal},e.fetchOptions),y=null!=a?a:Ti(o)?0:void 0;m.keepalive="POST"===m.method&&!e._keepaliveDisabled&&!1!==m.keepalive&&m.body===o&&!Ti(y)&&y>=0&&52428.8>a_+y,m.keepalive&&(a_+=_=y),Ja(n,m).then(function(t){return t.text().then(function(n){if(!f){var r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){iu.error(e)}f=!0,v(),null==e.callback||e.callback(r,g_(function(){return t.headers.get("Retry-After")}))}})}).catch(function(e){v(),p(e)}).finally(v)}catch(e){v(),p(e)}}},b_=function(e){try{var t,n=h_(e),r=n.url,i=n.encodedBody,s=null!=i?i:{},o=s.body,a=s.estimatedSize;if(!o)return;var l=o instanceof Blob?o:new Blob([o],{type:s.contentType});if(Ka.sendBeacon(r,l))return;var c=Pi(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Pi(c)&&c.length>1&&(null!=a?a:0)>16384){var d=Math.ceil(c.length/2),h=function(t){return Pi(e.data)?t:u({},e.data,{batch:t})};return b_(u({},e,{data:h(c.slice(0,d))})),void b_(u({},e,{data:h(c.slice(d))}))}iu.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to "+(Ja?"fetch":"XHR")),Ja?y_(u({},e,{_keepaliveDisabled:!0})):m_(e)}catch(e){iu.warn("Beacon send failed",e)}},w_=function(e,t,n,r){var i,s="query"===r?"POST"===t?"sent_at":"_":void 0;return c_(n===Nr?l_(e,"compression"):e,u({},s?((i={})[s]=Date.now().toString(),i):{},n===Nr?{}:{compression:n}))},S_=function(){var e=[];return Ja&&e.push({transport:"fetch",method:y_}),Ya&&e.push({transport:"XHR",method:m_}),null!=Ka&&Ka.sendBeacon&&e.push({transport:"sendBeacon",method:b_}),e}(),x_=!i_&&-1===(null==tu?void 0:tu.indexOf("MSIE"))&&-1===(null==tu?void 0:tu.indexOf("Mozilla"));function k_(e,t,n){var r;n&&(t=u({},t,{callback:function(e){return n(e)}})),e.__loaded?x_?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=u({},e.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(r=e.compression)&&void 0!==r?r:t.compressionFallback:t.compression,(Ti(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,function(e,t){var n,r,i,s=u({},e,{callback:null!=t?t:function(t){return null==e.callback?void 0:e.callback(t)}});s.timeout=s.timeout||6e4;var o,a,l,c,d,h=null!==(n=s.transport)&&void 0!==n?n:"fetch";"sendBeacon"===h&&Ti(s.compression)&&s.data&&(s.compression=Hr),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(d=(c=(Pi(o=s.data)?o:[o]).map(function(e){return u({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})}))[0])||null==(l=d.properties)?void 0:l.token)&&void 0!==a?a:null==d?void 0:d.token,batch:c,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Pi(e)?e.map(function(e){return u({},e,{sent_at:t})}):u({},e,{sent_at:t})}(s.data))),s.url=w_(s.url,s.method,s.compression,s.timestampMode);var f=S_.filter(function(e){return!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)}),p=null!==(r=null==(i=function(e,t){for(var n=0;e.length>n;n++)if(t(e[n]))return e[n]}(f,function(e){return e.transport===h}))?void 0:i.method)&&void 0!==r?r:f[0].method;if(!p)throw new Error("No available transport method");var _=function(e){try{p(e)}catch(e){v_(e)?iu.warn(e):iu.error(e),null==s.callback||s.callback({statusCode:0,error:e})}};"sendBeacon"!==h&&!s.preferSyncCompression&&s.data&&s.compression===Nr&&eu&&"undefined"!=typeof Promise&&!u_?p_(s).then(function(e){_(e)}).catch(function(t){if(fa(t))return u_=!0,void _(u({},s,{compression:void 0,url:w_(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 fa(e)||t===ca})(t)&&(u_=!0),_(s)}):_(s)}(t,function(r,i){e.rateLimiter.checkForLimiting(r),400>r.statusCode||null==e.config.on_request_error||e.config.on_request_error(r),n?n(r,i):null==t.callback||t.callback(r)})):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}var C_=function(){"use strict";function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=Zi((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,iu.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(t,"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();for(var n in t)e._sendRequestSafely(t[n])}},this._flushTimeoutMs))},t._sendRequestSafely=function(e,t){try{this._sendRequest(e,t)}catch(e){iu.error(e)}},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={};return au(this._queue,function(t){var n,r=t,i=((r?r.batchKey:null)||r.url)+(r.batchGroup?":"+r.batchGroup:"");Ti(e[i])&&(e[i]=u({},r,{data:[]})),null==(n=e[i].data)||n.push(r.data)}),this._queue=[],e},e}(),P_=function(){"use strict";function t(e){this._instance=e,this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._queue=[],this._areWeOnline=!0,this.resume()}var n=t.prototype;return n.resume=function(){var e=this;if(!Ti(Wa)&&"onLine"in Wa.navigator){if(this._areWeOnline=Wa.navigator.onLine,this._onlineListener)return;this._onlineListener=function(){e._areWeOnline=!0,e._flush()},this._offlineListener=function(){e._areWeOnline=!1},_u(Wa,"online",this._onlineListener),_u(Wa,"offline",this._offlineListener)}},n.retriableRequest=function(t,n){var r=this,s=t.retriesPerformedSoFar,o=i(t,e);Di(s)&&(o.url=c_(o.url,{retry_count:s})),k_(this._instance,n?u({},o,{transport:n}):o,function(e,t){if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=s?s:0))return void r._enqueue(u({retriesPerformedSoFar:s},o),t);0===e.statusCode&&iu.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!=s?s:0)+" retries.")}null==o.callback||o.callback(e)})},n._enqueue=function(e,t){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=Math.max(function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(n),null!=t?t:0),i=Date.now()+r;this._queue.push({retryAt:i,requestOptions:e});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),iu.warn(s),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 r,i=f(n);!(r=i()).done;)this.retriableRequest(r.value.requestOptions)},n.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,Ti(Wa)||(this._onlineListener&&(Wa.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Wa.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0));for(var e,t=f(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(u({},n,{transport:"sendBeacon"}))}catch(e){iu.error(e)}}this._queue=[]},o(t,[{key:"length",get:function(){return this._queue.length}}])}(),E_=function(){"use strict";function e(e){var t=this;this._instance=e,this._updateScrollData=function(){var e,n,r,i;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!==(r=t._context.maxContentY)&&void 0!==r?r:0),t._context.maxContentHeight=Math.max(l,null!==(i=t._context.maxContentHeight)&&void 0!==i?i:0)}}var t=e.prototype;return t.getContext=function(){return this._context},t.resetContext=function(){var e=this._context;return this._context=void 0,setTimeout(this._updateScrollData,0),e},t.startMeasuringScrollPosition=function(){_u(Wa,"scroll",this._updateScrollData,{capture:!0}),_u(Wa,"scrollend",this._updateScrollData,{capture:!0}),_u(Wa,"resize",this._updateScrollData)},t.scrollElement=function(){var e;if(!this._scrollRoot)return null==Wa||null==(e=Wa.document)?void 0:e.documentElement;for(var t,n=f(Pi(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]);!(t=n()).done;){var r,i=null==Wa||null==(r=Wa.document)?void 0:r.querySelector(t.value);if(i)return i}},t._scrollPosition=function(e){var t,n,r="y"===e?"scrollTop":"scrollLeft";if(this._scrollRoot){var i=this.scrollElement();return i&&i[r]||0}return Wa?"y"===e?Wa.scrollY||Wa.pageYOffset||(null==(t=Wa.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:Wa.scrollX||Wa.pageXOffset||(null==(n=Wa.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}}])}(),F_=function(e){return oh(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)},I_=function(){"use strict";function e(e,t,n,r){var i=this;this._onSessionIdCallback=function(e){var t,n=i._getStored();if(!n||n.sessionId!==e){var r={sessionId:e,props:i._sessionSourceParamGenerator(i._instance)};i._persistence.register(((t={})[Nl]=r,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||F_,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[Nl]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?ah(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 au(du(this.getSetOnceProps()),function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+wi(n)]=t}),e},e}(),T_=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,r=f(this._events[e]||[]);!(n=r()).done;)(0,n.value)(t);for(var i,s=f(this._events["*"]||[]);!(i=s()).done;)(0,i.value)(e,t)},e}(),R_=su("[SessionId]"),M_=864e5,L_=function(){"use strict";function e(e,t,n){var r,i=this;if(this._lastPersistedActivityTimestamp=null,this._lastCookieSyncTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new T_,this._sessionHasBeenIdleTooLong=function(e,t){return!(!Di(e)||!Di(t))&&Math.abs(e-t)>i.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||fc,this._windowIdGenerator=n||fc;var s=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*Zi(this._config.session_idle_timeout_seconds||1800,60,36e3,R_.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=Vc._parse(this._window_id_storage_key),a=Vc._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:Vc._remove(this._window_id_storage_key),Vc._set(this._primary_window_exists_storage_key,!0)}null!=(r=this._config.bootstrap)&&r.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 Ti(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&&Vc._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Vc._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Vc._parse(this._window_id_storage_key):null},t._isActivityChangeBelowGranularity=function(e){var t=this._lastPersistedActivityTimestamp;return!Li(t)&&!Li(e)&&5e3>Math.abs(e-t)},t._setSessionId=function(e,t,n){var r,i=t!==this._sessionActivityTimestamp,s=!(e!==this._sessionId||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,s&&!i||s&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register(((r={})[_l]=[t,e,n],r)))},t._useCrossTabRefreshHardening=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return Di(t)&&t>0},t._refreshSessionIdFromStorage=function(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(_l):(this._persistence.flush(),this._persistence.load())},t._flushPendingActivityTimestamp=function(){var e,t;if(!Li(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={})[_l]=[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=Di(e)?e:0,n=Di(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[_l];return Pi(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 R_.error("Bootstrap sessionID cannot be in the future"):n}catch(e){return void R_.error("Invalid sessionID in bootstrap",e)}}(e);return!Ti(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&&Wa&&(Wa.removeEventListener(rc,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]},t._listenToReloadWindow=function(){var e=this;this._beforeUnloadListener=function(){e._flushPendingActivityTimestamp(),e._canUseSessionStorage()&&Vc._remove(e._primary_window_exists_storage_key)},_u(Wa,rc,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 r=t||(new Date).getTime(),i=this._sessionId;if(n)this._lastCookieSyncTimestamp=r;else if(Li(this._lastCookieSyncTimestamp)||this._lastCookieSyncTimestamp>r||r-this._lastCookieSyncTimestamp>=1e3){var s,o;null==(s=(o=this._persistence).syncCookieProperties)||s.call(o),this._lastCookieSyncTimestamp=r}var a=this._getSessionId(),u=a[1],l=a[2],c=!Ti(i)&&u!==i,d=this._freshestActivityTimestamp(),h=this._getWindowId(),f=this._pendingBootstrapSession,p=!!f&&(f.sessionStartTimestamp>r+6e4||r-f.sessionStartTimestamp>M_),_=f?p:Di(l)&&Math.abs(r-l)>M_,v=!1,g=c,m=!u||!!f,y=u,b=!m&&!e&&this._sessionHasBeenIdleTooLong(r,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(r))||R_.info("cross-tab refresh kept the session alive",{sessionId:u});var w=this._getSessionId();u=w[1],l=w[2],b||(m=!u||!!f)}if(m||b||_){g=!1;var S=f&&!p;u=S?f.sessionId:this._sessionIdGenerator(),h=this._windowIdGenerator(),R_.info("new session ID assigned",{sessionId:u,windowId:h,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_}}),l=S?f.sessionStartTimestamp:r,this._pendingBootstrapSession=void 0,v=!0}else h||(h=this._windowIdGenerator(),v=!0),(g=g||u!==y)&&(R_.info("adopted cross-tab session id",{sessionId:u,windowId:h}),v=!0);var x=Di(d)&&e&&!_?d:r,k=Di(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}}])}(),A_=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Qi(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(function(e){return Qi(null==e?void 0:e.brand,t)}))return!0}catch(e){}return!!e.webdriver};function O_(){return(O_=h(l().m(function e(){var t,n,r,i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!=(t=null==Ka?void 0:Ka.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}i=void 0,e.n=4;break;case 3:i=n.model;case 4:return e.a(2,Ri(r=i)&&r.length>0?r:void 0);case 5:return e.p=5,iu.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e.v),e.a(2)}},e,null,[[1,5]])}))).apply(this,arguments)}var D_="custom",$_="i.posthog.com",q_=/^\/static\//,B_=["/s/","/e/","/i/"],N_=function(){"use strict";function e(e){this._regionCache={},this.instance=e}var t=e.prototype;return t._staticAssetHostOverride=function(e){if(q_.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=vc(e);return t?t.protocol+"//"+t.host+t.pathname:void 0},t._prepareEndpoint=function(e,t,n){if("ui"===e)return n;var r=n,i=this.instance.config.rewriteRequestPath;if(i){var s,o=(null==(s=vc(n))?void 0:s.href)||n;r=i(new URL(o)).toString()}if(i&&"api"===e&&B_.some(function(e){return 0===t.indexOf(e)})){var a=this._urlKey(r);if(a){var u,l=this.apiHost,c=this._ingestionEndpoints;(null==(u=c)?void 0:u.apiHost)===l&&c.rewriteRequestPath===i||(this._ingestionEndpoints=c={apiHost:l,rewriteRequestPath:i,urls:new Set}),c.urls.add(a)}}return r},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===D_)return this._prepareEndpoint(e,t,this.apiHost+t);var r=$_+t;switch(e){case"assets":return this._prepareEndpoint(e,t,"https://"+this.region+"-assets."+r);case"api":return this._prepareEndpoint(e,t,"https://"+this.region+"."+r)}},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("."+$_,".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":D_),this._regionCache[this.apiHost]}}])}(),H_=su("[PostHog ExternalIntegrations]"),j_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},U_=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadScript=function(e,t){var n;null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,function(e){if(e)return H_.error("failed to load script",e);t()})},t.startIfEnabledOrStop=function(){for(var e=this,t=function(){var t,i,s,o=r[n],a=o[0],u=o[1];!u||null!=(t=Eh.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[a]||e._loadScript(j_[a],function(){var t;null==(t=Eh.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[a])||t.start(e._instance)}),!u&&null!=(i=Eh.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[a]&&(null==(s=Eh.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[a])||s.stop())},n=0,r=Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{});r.length>n;n++){var i;t()}},e}(),z_=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=h(l().m(function e(t){var n,r,i;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,i=e.v,(r=this._extensions.get(t.name)===t)&&this._extensions.delete(t.name),this._logger.error('Failed to set up browser extension "'+t.name+'"',i),r&&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=f(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&&Ei(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}(),V_=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,r={},i=f(e);!(n=i()).done;){var s=n.value,o=null==t?void 0:t.get_property(s);Ti(o)||(r[s]=o)}return r},t.set=function(e,t){var n,r;null==(n=this._instance.persistence)||n.register("string"==typeof e?((r={})[e]=t,r):e)},t.remove=function(e){var t;null==(t=this._instance.persistence)||t.unregister(e)},e}(),W_="extensionsRemoteConfig",G_=function(){"use strict";function e(e){var t=this;this.instance=e,this._disposed=!1,this._logger=iu,this._latestRemoteConfigResult=e._lastRemoteConfig,this.kv=new V_(e),this.onEvent=function(e){return Ua(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 Ua(function(){});var n=function(n){try{e(n)}catch(e){t._logger.error("Browser extension remote config listener failed",e)}},r=t.instance._internalEventEmitter.on(W_,n);return t._latestRemoteConfigResult&&n(t._latestRemoteConfigResult),Ua(r)},this._runtime=new z_(iu.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(e,t,n){n?this.instance.capture(e,t,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):this.instance.capture(e,t)},t.registerDynamicEventProperties=function(e){return Ua(this.instance._registerExtensionEventProperties(e))},t.handleRemoteConfig=function(e){this._disposed||(this._latestRemoteConfigResult=e,this.instance._internalEventEmitter.emit(W_,e))},t.sendRequest=function(){var e=h(l().m(function e(t,n){var r,i,s,o=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(void 0===n&&(n={}),i=this.instance.requestRouter.endpointFor(null!==(r=n.target)&&void 0!==r?r:"api",t),s={method:n.method,url:n.query?c_(i,n.query):i,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?pi.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(Vu);return"string"==typeof e?e:void 0}},{key:"library",get:function(){return{name:uf.LIB_NAME,version:uf.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,r,i=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==i?void 0:i.sessionId)&&void 0!==t?t:"",windowId:null!==(n=null==i?void 0:i.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(r=null==i?void 0:i.sessionStartTimestamp)&&void 0!==r?r: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}}])}(),K_={},Q_=0,Z_=function(){},J_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Y_="Surveys module not available",X_="sanitize_properties is deprecated. Use before_send instead",ev="Invalid value for property_denylist config: ",tv=/^[A-Za-z0-9_-]{1,400}$/,nv=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,rv=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,iv=["token","distinct_id",Gl],sv="posthog",ov=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},av=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:pu(null==Qa?void 0:Qa.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Z_,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:Za&&Ri(null==Za?void 0:Za.search)&&-1!==Za.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==Wa||null==(t=Wa.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,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error:function(e){iu.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:tc,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Z_},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:ov(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))},uv=[["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"]],lv=function(e){for(var t={},n=0,r=uv;r.length>n;n++){var i=r[n],s=i[0],o=i[1];Ti(e[s])||(t[o]=e[s])}var a=uu({},t,e),u=e.__preview_external_dependency_versioned_paths;return Ti(u)||(Ti(e.strict_script_versioning)&&(a.strict_script_versioning=!!u),Ri(u)&&Ti(e.asset_host)&&(a.asset_host=u)),Pi(e.property_blacklist)&&(Ti(e.property_denylist)?a.property_denylist=e.property_blacklist:Pi(e.property_denylist)?a.property_denylist=[].concat(e.property_blacklist,e.property_denylist):iu.error(ev+e.property_denylist)),a},cv=function(){"use strict";return o(function(){this.__forceAllowLocalhost=!1},[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){iu.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),dv=(a=function(){"use strict";function e(){var t,n=this;this._isPageUnloading=!1,this._isShutdown=!1,this.webPerformance=new cv,this._personProcessingSetOncePropertiesSent=!1,this.version=uf.LIB_VERSION,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new T_,this._extensions=[],this._extensionEventPropertyProducers=[],this._hasStableInitialDistinctId=!1,this._hasWarnedAboutVolatileIdentity=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=av(),this.SentryIntegration=np,this.sentryIntegration=function(e){return function(e,t){var n=tp(e,t);return{name:ep,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 E_(this),this.pageViewManager=new rp(this),this.rateLimiter=new Sp(this),this.requestRouter=new N_(this),this.consent=new lf(this),this.externalIntegrations=new U_(this);var r=null!==(t=e.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.metrics=r.metrics&&new r.metrics(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:function(e,t,r){var i,s=Ri(e)?((i={})[e]=t,i):e;n.setPersonProperties(s),null==r||r({})},set_once:function(e,t,r){var i,s=Ri(e)?((i={})[e]=t,i):e;n.setPersonProperties(void 0,s),null==r||r({})}},this.on("eventCaptured",function(e){return iu.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,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this._hasStableInitialDistinctId||(r?(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(fc());this.register({distinct_id:n,$device_id:n}),e.set_property(Bl,Xl)}this._sync_opt_out_with_persistence()}}},t.init=function(t,n,r){if(r&&r!==sv){var i,s=null!==(i=K_[r])&&void 0!==i?i:new e;return s._init(t,n,r),K_[r]=s,K_[sv][r]=s,s}return this._init(t,n,r)},t._init=function(e,t,n){var r,i,s,o=this;void 0===t&&(t={});var a,l=Ri(e)?e.trim():"";if(!l)return iu.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=av(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=av(t.defaults),d=lv(t),h=uu({},c,d,{name:n,token:l});Fi(c.rageclick)&&Fi(d.rageclick)&&(h.rageclick=uu({},c.rageclick,d.rageclick)),Fi(c.session_recording)&&Fi(d.session_recording)&&(h.session_recording=uu({},c.session_recording,d.session_recording)),this.set_config(h),this.config.on_xhr_error&&iu.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Nr;var f=this._is_persistence_disabled();if(this.persistence=new bp(this.config,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new bp(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&&Vc._is_supported()){var p=Vc._parse(this._sessionRegisteredPropertiesStorageKey);Pi(p)&&p.forEach(function(e){Ri(e)&&o._sessionRegisteredPropKeys.add(e)})}else Vc._remove(this._sessionRegisteredPropertiesStorageKey);var _=u({},this.persistence.props),v=u({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new C_(function(e,t){return o._send_retriable_request(e,t)},this.config.request_queue_config),this._retryQueue=new P_(this),this.__request_queue=[];var g=this._inCookielessMode();g||(this.sessionManager=new L_(this),this.sessionPropsManager=new I_(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?(iu.info("Deferring extension initialization to improve startup performance"),setTimeout(function(){o._initExtensions(g)},0)):(iu.info("Initializing extensions synchronously"),this._initExtensions(g)),uf.DEBUG=uf.DEBUG||this.config.debug,uf.DEBUG&&iu.info("Starting in debug mode",{this:this,config:t,thisC:u({},this.config),p:_,s:v}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=u({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var m=null==(i=t.bootstrap)?void 0:i.distinctID;if(this._hasStableInitialDistinctId=!!m&&!Mi(m),null!=(s=t.bootstrap)&&s.distinctID){var y=t.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(Bl);if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"anonymous"===w)this.identify(y);else if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"identified"===w)iu.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(fc()),x=t.bootstrap.isIdentifiedID?S:y;this.persistence.set_property(Bl,t.bootstrap.isIdentifiedID?ec:Xl),this.register({distinct_id:y,$device_id:x})}}if(g)this.register_once({distinct_id:Wl,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(fc());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Bl,Xl)}return _u(Wa,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),_u(Wa,"pageshow",function(){var e;o._isPageUnloading=!1,o._isShutdown||null==(e=o._retryQueue)||e.resume()}),t.segment?Xf(this,function(){return o._loaded()}):this._loaded(),Ei(this.config._onCapture)&&this.config._onCapture!==Z_&&(iu.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",function(e){return o.config._onCapture(e.event,e)})),this.config.ip&&iu.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 O_.apply(this,arguments)}().then(function(e){var t;e&&o.register(((t={})[Wu]=e,t))}).catch(Z_),this},t._isSharedExtension=function(e){var t=e;return Ri(t.name)&&Ei(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){iu.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this._extensions.push(e)},t._enrollFeatureFlags=function(){var t,n,r,i,s,o,a=this,u=null!==(t=null==(n=this.config.__extensionClasses)?void 0:n.featureFlags)&&void 0!==t?t:null==(r=e.__defaultExtensionClasses)?void 0:r.featureFlags;u&&(this.featureFlags&&this.featureFlags instanceof u||(null==(o=this._featureFlagsReloadingUnsubscribe)||o.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new u(this)),Ei(this.featureFlags.onReloading)&&Ei(this.featureFlags.setup)?this._featureFlagsReloadingUnsubscribe||(this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading(function(){a._internalEventEmitter.emit("featureFlagsReloading",!0)}),this._getBrowserClientAdapter().add(this.featureFlags)):null==(i=(s=this.featureFlags).initialize)||i.call(s))},t._initExtensions=function(t){var n,r,i,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!==(r=this.surveys)&&void 0!==r?r:new h.surveys(this),f),h.logs&&this._enrollExtension(this.logs=null!==(i=this.logs)&&void 0!==i?i: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,Zf)),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,r=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(function(){r._processInitTaskQueue(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){iu.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[Ql]=s,n)),this.config.__preview_deferred_init_extensions&&iu.info("PostHog extensions initialized ("+s+"ms)")},t._onRemoteConfig=function(e){var t,n=this;if(!Qa||!Qa.body)return iu.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 r,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=yi(i.supportedCompression,Nr)?Nr:yi(i.supportedCompression,Hr)?Hr:void 0),null!=(r=i.analytics)&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:tc}),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){iu.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Za&&Za.hostname){var t=Za.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 kp(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()&&ou(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,r,i;this._isPageUnloading=!0,null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(sc),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(r=this._requestQueue)||r.unload(),null==(i=this._retryQueue)||i.unload()):this._shouldCapturePageleave()&&this.capture(sc,null,{transport:"sendBeacon"})},t._send_request=function(e){k_(this,e)},t._send_retriable_request=function(e,t){this._retryQueue?this._retryQueue.retriableRequest(e,t):this._send_request(t?u({},e,{transport:t}):e)},t._execute_array=function(e){var t=this;Q_++;try{var n,r=[],i=[],s=[];ou(e,function(e){if(e)if(Pi(n=e[0]))s.push(e);else if(Ei(e))try{e.call(t)}catch(t){iu.error("Error executing queued PostHog call",e,t)}else Pi(e)&&"alias"===n?r.push(e):Pi(e)&&-1!==n.indexOf("capture")&&Ei(t[n])?s.push(e):i.push(e)});var o=function(e,t){ou(e,function(e){try{if(Pi(e[0])){var n=t;au(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){iu.error("Error executing queued PostHog call",e,t)}})};o(r,this),o(i,this),o(s,this)}finally{Q_--}},t.push=function(t){if(Q_>0&&Pi(t)&&Ri(t[0])){var n=e.prototype[t[0]];Ei(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])},t._getPersistedMetaIdentifier=function(e){var t,n=null==(t=this.persistence)?void 0:t.get_property(e.persistenceKey);return Ri(n)&&e.pattern.test(n)?{value:n,delivered:!1}:Fi(n)&&Ri(n.value)&&e.pattern.test(n.value)?{value:n.value,delivered:!0===n.delivered}:void 0},t._storeMetaIdentifier=function(e,t,n){return t===(null==n?void 0:n.value)?{value:t,pending:!n.delivered}:(e.register(t,!1),{value:t,pending:!0})},t._readMetaCookie=function(e){if(this.config.save_campaign_params&&!this._inCookielessMode()){var t=Cc(e.cookieName);return Ri(t)&&e.pattern.test(t)?t:void 0}},t._updateFacebookClickId=function(e,t,n,r){if(this.persistence){var i=this._facebookClickIdChannel;this.persistence.refreshKey(i.persistenceKey);var s=this._getPersistedMetaIdentifier(i);if(!r){if(n)return Ri(t)&&nv.test(t)?this._storeMetaIdentifier(i,t,s):void i.unregister();var o=Ri(e)&&tv.test(e)?e:void 0,a=this._readMetaCookie(i);return a&&function(e,t,n){var r=e.split(".");if(t)return r[3]===t;if(!n)return!0;var i=n.value.split(".");return r[3]===i[3]||Number(r[2])>Number(i[2])}(a,o,s)?this._storeMetaIdentifier(i,a,s):o?(null==s?void 0:s.value.split(".")[3])===o?{value:s.value,pending:!s.delivered}:this._storeMetaIdentifier(i,"fb.1."+Date.now()+"."+o,s):s?{value:s.value,pending:!s.delivered}:void 0}i.unregister()}},t._updateFacebookBrowserId=function(e,t,n){if(this.persistence){var r=this._facebookBrowserIdChannel;this.persistence.refreshKey(r.persistenceKey);var i=this._getPersistedMetaIdentifier(r);if(!n){if(t)return Ri(e)&&rv.test(e)?this._storeMetaIdentifier(r,e,i):void r.unregister();var s=this._readMetaCookie(r);return s?this._storeMetaIdentifier(r,s,i):i?{value:i.value,pending:!i.delivered}:void 0}r.unregister()}},t._markMetaIdentifierDelivered=function(e,t){if(this.persistence){this.persistence.refreshKey(e.persistenceKey);var n=this._getPersistedMetaIdentifier(e);(null==n?void 0:n.value)!==t||n.delivered||e.register(t,!0)}},t.capture=function(e,t,n){var r,i,s,o,a,l,c,d,h=this;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!Ti(e)&&Ri(e)){this._healCookielessSentinelDistinctId();var p=!this.config.opt_out_useragent_filter&&this._is_bot();if(!p||this.config.__preview_capture_bot_pageviews){var _=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==_||!_.isRateLimited){var v;null!=t&&t.$current_url&&!Ri(null==t?void 0:t.$current_url)&&(iu.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||iu.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&&(v=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var g=new Date,m=(null==n?void 0:n.timestamp)||g,y=ho(null==n?void 0:n.uuid,fc),b={uuid:y,event:e,properties:this.calculateEventProperties(e,t||{},m,y)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&p&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),_&&(b.properties.$lib_rate_limit_remaining_tokens=_.remainingTokens);var w="$feature_flag_called"===e&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=n&&n.$set&&!w&&(b.$set=null==n?void 0:n.$set);for(var S=Fi(null==t?void 0:t.$set)?t.$set:void 0,x=Pi(null==t?void 0:t.$unset)?t.$unset:[],k=(null==n?void 0:n.$unset)||[],C=function(e){var t,r=!(null==n||!n.$set)&&e in n.$set;return{hasProvided:r||!!S&&e in S,provided:r?null==n||null==(t=n.$set)?void 0:t[e]:null==S?void 0:S[e],unset:-1!==x.indexOf(e)||-1!==k.indexOf(e)}},P=C(Ku),E=C(Zu),F=[{channel:this._facebookClickIdChannel,hasProvided:P.hasProvided,update:this._updateFacebookClickId(null==(r=v)?void 0:r.fbclid,P.provided,P.hasProvided,P.unset)},{channel:this._facebookBrowserIdChannel,hasProvided:E.hasProvided,update:this._updateFacebookBrowserId(E.provided,E.hasProvided,E.unset)}],I=0,T=F;T.length>I;I++){var R,M=T[I],L=M.update;L&&!0===b.properties.$process_person_profile&&L.pending&&!M.hasProvided&&!w&&(b.$set=u(((R={})[M.channel.property]=L.value,R),b.$set))}var A=null==n?void 0:n.$unset;A&&(b.$unset=A);var O=w?void 0:this._calculate_set_once_properties(null==n?void 0:n.$set_once,e!==ac,e===oc);if(O&&(b.$set_once=O),null!=n&&n._noTruncate||(a=this.config.properties_string_max_length,l=b,c=function(e){return Ri(e)?e.slice(0,a):e},d=new Set,b=function e(t,n){if(t!==Object(t))return c?c(t):t;if(!d.has(t)){var r;if(d.add(t),Pi(t))r=[],ou(t,function(t){r.push(e(t))});else{var i={};au(ji(t)?hu(t):t,function(t,n){d.has(t)||(i[n]=e(t,n))}),r=i}return r}}(l)),b.timestamp=m,Ti(null==n?void 0:n.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),w&&(b.properties=function(e,t){void 0===t&&(t=[]);var n={},r=function(t){void 0!==e[t]&&(n[t]=e[t])};return la.forEach(r),t.forEach(r),n}(b.properties,iv)),e===si||e===oi){var D,q=null==t?void 0:t[ai],B=null==t?void 0:t[li];Hu({id:q,current_iteration:B}),b.$set=u({},b.$set,((D={})[wu({id:q,current_iteration:B},e===oi?"responded":"dismissed")]=!0,D))}else e===ii&&(b.$set=u({},b.$set,((i={}).$survey_last_seen_date=(new Date).toISOString(),i)));if("product tour shown"===e){var N,H=null==t?void 0:t.$product_tour_type;H&&(b.$set=u({},b.$set,((N={})["$product_tour_last_seen_date/"+H]=(new Date).toISOString(),N)))}var j=u({},b.properties.$set,b.$set);if(Ii(j)||this.setPersonPropertiesForFlags(j),!Ai(this.config.before_send)){var U=this._runBeforeSend(b);if(!U)return;(b=U).uuid=ho(b.uuid,fc)}var z=F.filter(function(e){var t,n,r,i=e.channel,s=e.update,o=null!==(t=null==(n=b.$set)?void 0:n[i.property])&&void 0!==t?t:Fi(null==(r=b.properties)?void 0:r.$set)?b.properties.$set[i.property]:void 0;return(null==s?void 0:s.pending)&&o===s.value});this._internalEventEmitter.emit("eventCaptured",b);var V,W,G=null!==(s=null==n?void 0:n._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),K="recordings"===(null==n?void 0:n._batchKey)||/\/s\/(?:\?|$)/.test(G),Q=u({method:"POST",url:G,data:b,compression:"best-available",preferSyncCompression:null==n?void 0:n.send_instantly,timestampMode:K?"body":"capture-body",batchKey:null==n?void 0:n._batchKey},K&&null!=(o=b.properties)&&o.$session_id?{batchGroup:b.properties.$session_id+(b.properties.$window_id?"-"+b.properties.$window_id:"")}:{},null!=n&&n.transport?{transport:n.transport}:{},z.length?{fireCallbackOnDrop:!0,callback:function(e){if(e.statusCode>=200&&300>e.statusCode)for(var t,n=f(z);!(t=n()).done;){var r=t.value;h._markMetaIdentifierDelivered(r.channel,r.update.value)}}}:{});return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly||z.length?(!Q.transport&&!Q.callback&&Ii(null!==(V=this.config.request_headers)&&void 0!==V?V:{})&&this._isPageUnloading&&(W="sendBeacon"),this._send_retriable_request(Q,W)):this._requestQueue.enqueue(Q),b}iu.critical("This capture call is ignored due to client rate limiting.")}}else iu.error("No event name provided to posthog.capture")}else iu.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 G_(this)},t._registerExtensionEventProperties=function(e){var t=this;this._extensionEventPropertyProducers.push(e);var n=!0;return function(){if(n){n=!1;var r=t._extensionEventPropertyProducers.indexOf(e);-1!==r&&t._extensionEventPropertyProducers.splice(r,1)}}},t._processCookieIdentityChange=function(e){var t,n,r;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this._cachedPersonProperties=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(n=this.featureFlags)||n.reset(),e&&this.reloadFeatureFlags(),!0)},t.calculateEventProperties=function(e,t,n,r,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this._processCookieIdentityChange();var s=i?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[Gl]=!0),"$snapshot"===e){var a=u({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!Ri(o.distinct_id)&&!Oi(o.distinct_id)||Mi(o.distinct_id))&&iu.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var l,c=function(e,t,n,r){var i,s,o,a;if(void 0===r&&(r=!1),!tu)return{};var u,l=e?[].concat(Zd,t||[]):[],c=Zs(tu),d=c[0],h=c[1],f=function(e){for(var t=0;eo.length>t;t++){var n,r=eo[t],i=r[1],s=r[2],o=e.match(r[0]);if(o)return[i,(null==(n=s&&e.match(s)||o)?void 0:n[1])||""]}return["",""]}(tu),p=f[0],_=f[1],v=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},g={};Ti(n)||(g.detectGoogleSearchApp=n);var m={},y=null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,b=null==(s=navigator)?void 0:s.maxTouchPoints,w=null==Wa||null==(o=Wa.screen)?void 0:o.width,S=null==Wa||null==(a=Wa.screen)?void 0:a.height,x=null==Wa?void 0:Wa.devicePixelRatio;Ti(y)||(m.userAgentDataPlatform=y),Ti(b)||(m.maxTouchPoints=b),Ti(w)||(m.screenWidth=w),Ti(S)||(m.screenHeight=S),Ti(x)||(m.devicePixelRatio=x);var k,C=uu(du({$os:d,$os_version:h,$browser:Ws(tu,navigator.vendor,v,g),$webview_app:p,$webview_app_version:_,$device:Js(tu),$device_type:Ys(tu,m),$timezone:uh(),$timezone_offset:lh()}),{$current_url:mc(r?po(null==Za?void 0:Za.href):null==Za?void 0:Za.href,l,Yd),$host:null==Za?void 0:Za.host,$pathname:null==Za?void 0:Za.pathname,$raw_user_agent:tu.length>1e3?tu.substring(0,997)+"...":tu,$browser_version:Ks(tu,navigator.vendor,v,g),$browser_language:rh(),$browser_language_prefix:(k=rh(),"string"==typeof k?k.split("-")[0]:void 0),$screen_height:null==Wa?void 0:Wa.screen.height,$screen_width:null==Wa?void 0:Wa.screen.width,$viewport_height:null==Wa?void 0:Wa.innerHeight,$viewport_width:null==Wa?void 0:Wa.innerWidth,$lib:Va.LIB_NAME,$lib_version:Va.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Va.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=Va.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 d=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime(),!0),h=d.windowId;o.$session_id=d.sessionId,o.$window_id=h}this.sessionPropsManager&&uu(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&uu(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===D_&&(o.$lib_custom_api_host=this.config.api_host),l="$pageview"!==e||i?"$pageleave"!==e||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),o=uu(o,l),"$pageview"===e&&Qa&&(o.title=Qa.title),!Ti(s)){var _=n.getTime()-s;o.$duration=parseFloat((_/1e3).toFixed(3))}tu&&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;Fi(m)&&!Ii(m)&&(o.$groups=u({},Fi(y)?y:{},m)),au(["$referrer","$referring_domain"],function(e){e in v&&delete g[e]});var b={};if(this._extensionEventPropertyProducers.length>0)for(var w,S=f(this._extensionEventPropertyProducers.slice());!(w=S()).done;){var x=w.value;try{uu(b,x())}catch(e){iu.error("Failed to produce browser extension event properties",e)}}(o=uu({},c,v,g,u({},b,o))).$is_identified=this._isIdentified(),Pi(this.config.property_denylist)?au(this.config.property_denylist,function(e){delete o[e]}):iu.error(ev+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var k=this.config.sanitize_properties;k&&(iu.error(X_),o=k(o,e));var C=this._hasPersonProcessing();return o.$process_person_profile=C,C&&!i&&this._requirePersonProcessing("_calculate_event_properties"),o},t._calculate_set_once_properties=function(e,t,n){var r;if(void 0===t&&(t=!0),void 0===n&&(n=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!n)return e;var i=uu({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(iu.error(X_),i=s(i,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Ii(i)?void 0:i},t.register=function(e,t){var n;null==(n=this.persistence)||n.register(e,t)},t.register_once=function(e,t,n){var r;null==(r=this.persistence)||r.register_once(e,t,n)},t.register_for_session=function(e){var t,n,r=this;null==(t=this.persistence)||t.syncCookieProperties(),this._processCookieIdentityChange(),null==(n=this.sessionPersistence)||n.register(e),Object.keys(e).forEach(function(e){return r._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||!Vc._is_supported())Vc._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach(function(e){return t.push(e)}),t.length>0?Vc._set(this._sessionRegisteredPropertiesStorageKey,t):Vc._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,r;return null!==(n=null==(r=this.featureFlags)?void 0:r.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 r;null==(r=this.featureFlags)||r.updateFlags(e,t,n)},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,n)},t.getEarlyAccessFeatures=function(e,t,n){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.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:Y_}),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:Y_})},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Y_})},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=Uu),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:Y_}},t.canRenderSurveyAsync=function(e,t){var n,r;return void 0===t&&(t=!1),null!==(n=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))&&void 0!==n?n:Promise.resolve({visible:!1,disabledReason:Y_})},t._validateIdentifyId=function(e){return!e||Mi(e)?(iu.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(iu.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())||(iu.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 iu.uninitializedWarning("posthog.identify");if(Oi(e)&&(e=e.toString(),iu.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 r=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,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(Gu),this.register({distinct_id:e}));var l=(this.persistence.get_property("$user_state")||"anonymous")===Xl,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(Bl,ec),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$identify",f,{$set:t||{},$set_once:n||{}})&&(this._cachedPersonProperties=Sc(e,t,n)),null==(h=this.featureFlags)||h.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(d){this.persistence.set_property(Bl,ec);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=Sc(e,t,n))}else(t||n)&&this.setPersonProperties(t,n);c||i||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Ol)):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=Sc(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)):iu.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.unsetPersonProperties=function(e){var t,n=(Pi(e)?e:[e]).filter(function(e){return Ri(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 r,i,s;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this._processCookieIdentityChange();var o=this.getGroups(),a=o[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:u({},o,(i={},i[e]=t,i))}),(a||n)&&this._hasPersonProcessing()){var l={$group_type:e,$group_key:t};n&&(l.$group_set=n),this.capture(ac,l)}n&&this.setGroupPropertiesForFlags(((s={})[e]=n,s)),a&&!n&&this.reloadFeatureFlags()}else iu.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=$i(e)?e:null==e?void 0:e.resetDeviceID,n=$i(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,n)},t._reset=function(e,t,n){var r,i,s,o;if(void 0===t&&(t=!1),iu.info("reset"),!this.__loaded)return iu.uninitializedWarning("posthog.reset");var a=null==n?void 0:n.sessionID;this.config.bootstrap=n||(null==(r=this._originalUserConfig)?void 0:r.bootstrap)||{},null==(i=this.featureFlags)||null==i.updateConfig||i.updateConfig(this.config,this._shouldDisableFlags());var l=this.get_property(Vu),c=this.get_property(Wu),d=this.get_property(ll);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(),Ti(d)||null==(g=this.persistence)||g.register(((m={})[ll]=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(Bl,Xl),null==(C=this.sessionManager)||C.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Wl,$device_id:null},"");else{var I,T=this.config.get_device_id(fc());this.register_once({distinct_id:T,$device_id:e?T:l},""),e||Ti(c)||this.register(((I={})[Wu]=c,I))}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),n)if(n.distinctID&&!this._inCookielessMode()&&(null==(F=this.persistence)||F.set_property(Bl,n.isIdentifiedID?ec:Xl),this.register({distinct_id:n.distinctID})),null==(P=this.featureFlags)||P.initialize(),!(Ai(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 M;f&&(null==(M=this.persistence)||null==M._endCookieSyncSuppression||M._endCookieSyncSuppression(p))}this.reloadFeatureFlags()},t.shutdown=function(){var e=h(l().m(function e(t){var n,r,i,s,o,a,u,c,d;return l().w(function(e){for(;;)switch(e.n){case 0:if(this.__loaded){e.n=1;break}return iu.uninitializedWarning("posthog.shutdown"),e.a(2);case 1:this._isShutdown=!0,this._getBrowserClientAdapter().dispose(),null==(n=this.sessionRecording)||n.dispose(),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.metrics)||i.flush("sendBeacon"),null==(s=this.metrics)||s.dispose(),null==(o=this._requestQueue)||o.unload(),null==(a=this._retryQueue)||a.unload();try{null==(d=this.featureFlags)||d.destroy()}catch(e){iu.error("Error while destroying feature flags",e)}null==(u=this.persistence)||u.destroy(),null==(c=this.sessionPersistence)||c.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,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&n){var i,s=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!n)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-n)/1e3)-s,0)}return r},t.alias=function(e,t){return e===this.get_property("$people_distinct_id")?(iu.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Ti(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Gu,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(iu.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(Fi(e)){var n,r,i,s,o,a,l,c,d,h,f,p,_,v;uu(this.config,lv(e));var g=this._is_persistence_disabled();null==(n=this.persistence)||n.update_config(this.config,t,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new bp(u({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this._checkLocalStorageForDebug(this.config.debug);$i(m)&&(this.config.debug=m),$i(this.config.debug)&&(this.config.debug?(uf.DEBUG=!0,Rc._is_supported()&&Rc._set("ph_debug",!0),iu.info("set_config",{config:e,oldConfig:t,newConfig:u({},this.config)})):(uf.DEBUG=!1,Rc._is_supported()&&Rc._remove("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(i=this.exceptionObserver)||i.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.metrics)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(c=this.autocapture)||c.startIfEnabled(),null==(d=this.heatmaps)||d.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(h=this.historyAutocapture)||h.startIfEnabledOrStop()),null==(f=this.exceptionObserver)||f.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(_=this.surveys)||_.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&Xf(this,Z_,!1)}},t._overrideSDKInfo=function(e,t){uf.LIB_NAME=e,uf.LIB_VERSION=t},t.startSessionRecording=function(e){var t,n,r,i,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==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(i=this.sessionRecording)||i.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:sv;return t!==sv&&(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()&&Ii(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?(iu.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._warnIfVolatileIdentityWithoutStableId(),this._register_single(Vl,!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,r,i,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==(r=this.sessionPersistence)?void 0:r._disabled)!==s&&(null==(i=this.sessionPersistence)||i.set_disabled(s)),s&&(this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),s},t.opt_in_capturing=function(t){var n,r,i;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 L_(this),this.pageViewManager=new rp(this),this.persistence&&(this.sessionPropsManager=new I_(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==(r=this.surveys)||r.loadIfEnabled()),(Ti(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(i=null==t?void 0:t.captureEventName)&&void 0!==i?i:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else iu.warn(J_)},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:Wl,$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 iu.warn(J_)},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 Ka?A_(Ka,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Qa&&("visible"===Qa.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(ic,{title:Qa.title},{send_instantly:!0}),this._visibilityStateListener&&(Qa.removeEventListener(nc,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),_u(Qa,nc,this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==Wa||Wa.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Wa||Wa.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?(iu.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,r,i){var s=t in e&&!Ai(e[t]),o=n in e&&!Ai(e[n]);return s?e[t]:!!o&&(i&&i.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,iu)},t._runBeforeSend=function(e){var t;if(Ai(this.config.before_send))return e;for(var n,r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Bi),i=e,s=f(Pi(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(n=s()).done;){var o=n.value;try{if(i=o(i),Ai(i)){var a="Event '"+e.event+"' was rejected in beforeSend function";return qi(e.event)?iu.warn(a+". This can cause unexpected behavior."):iu.info(a),null}i.properties&&!Ii(i.properties)||iu.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return iu.error("Error in beforeSend function for event '"+e.event+"':",t),null}}for(var u,l=f(r);!(u=l()).done;){var c=u.value;if(i.properties&&Ai(i.properties[c]))return iu.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 i},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=$i(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:"_facebookClickIdChannel",get:function(){var e=this;return{property:Ku,persistenceKey:Qu,cookieName:"_fbc",pattern:nv,register:function(t,n){var r,i;return null==(r=e.persistence)?void 0:r.register(((i={})[Qu]={value:t,delivered:n},i))},unregister:function(){var t;return null==(t=e.persistence)?void 0:t.unregister(Qu)}}}},{key:"_facebookBrowserIdChannel",get:function(){var e=this;return{property:Zu,persistenceKey:Ju,cookieName:"_fbp",pattern:rv,register:function(t,n){var r,i;return null==(r=e.persistence)?void 0:r.register(((i={})[Ju]={value:t,delivered:n},i))},unregister:function(){var t;return null==(t=e.persistence)?void 0:t.unregister(Ju)}}}},{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]]=cu(e.prototype[t[n]])}(dv,["identify"]);var hv=function(){"use strict";function e(e){this.disabled=!1===e;var t=Fi(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 r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.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}(),fv="$copy_autocapture",pv=su("[AutoCapture]");function _v(e,t){return t.length>e?t.slice(0,e)+"...":t}function vv(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!df(t));return t}function gv(e,t){var n,r,i=t.e,s=t.maskAllElementAttributes,o=t.maskAllText,a=t.elementAttributeIgnoreList,l=t.elementsChainAsString,c=t.disableCaptureUrlHashes;if(!df(e))return{props:{}};for(var d=[e],h=new Set([e]),p=e;p.parentNode&&!hf(p,"body")&&1e3>d.length;)if(pf(p.parentNode)){var _=p.parentNode.host;if(h.has(_))break;h.add(_),d.push(_),p=_}else{if(!df(p.parentNode))break;if(h.has(p.parentNode))break;h.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}var v="click"===i.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?d.findIndex(function(e){return hf(e,"button")||hf(e,"a")}):-1;v>0&&(o=o||d.slice(0,v+1).some(function(e){return!Af(e)||Of(e)}));var g,m,y,b=[],w={},S=!1,x=!1;if(au(d,function(e){var t=Af(e);if(hf(e,"a")&&!s&&(null==a||!a.includes("href"))){var n=e.getAttribute("href");S=!!(t&&n&&Uf(n))&&(c?po(n):n)}yi(gf(e),"ph-no-capture")&&(x=!0),b.push(function(e,t,n,r,i){void 0===i&&(i=!1);var s=e.tagName.toLowerCase(),o={tag_name:s};wf.indexOf(s)>-1&&!n&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?_v(1024,zf(e)):_v(1024,yf(e)));var a=gf(e);t||null!=r&&r.includes("class")||0>=a.length||(o.classes=a.filter(function(e){return""!==e})),au(e.attributes,function(n){var s;if((!Of(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==r||!r.includes(n.name))&&!t&&Uf(n.value)&&(!Ri(s=n.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=n.value;"class"===n.name&&(a=_f(a).join(" ")),o["attr__"+n.name]=_v(1024,"href"===n.name&&i?po(a):a)}});for(var u=1,l=1,c=e;c=vv(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,s,o,a,c)),au(function(e){if(!Af(e))return{};var t={};return au(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&Uf(r)&&(t[n]=r)}}),t}(e),function(e,t){({}).hasOwnProperty.call(w,t)||(w[t]=e)})}),x)return{props:{},explicitNoCapture:x};if(v>0&&(e=d[v],b.splice(0,v)),o||(b[0].$el_text=hf(e,"a")||hf(e,"button")?zf(e):yf(e)),S){var k,C;b[0].attr__href=S;var P=null==(k=vc(S))?void 0:k.host,E=null==Wa||null==(C=Wa.location)?void 0:C.host;P&&E&&P!==E&&(g=S)}return{props:uu((m=i.type,{$event_type:m,$ce_version:1}),l?{}:{$elements:b},{$elements_chain:(y=b,Pi(y)?function(e){return e.map(function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();for(var i,s=f(e.attr_class);!(i=s()).done;)r+="."+i.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 lu(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[Wf(e[0].toString())]=Wf(t.toString())}),(r+=":")+lu(a).map(function(e){return e[0]+'="'+e[1]+'"'}).join("")}).join(";")}(function(e){return e.map(function(e){var t,n,r={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:Gf(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return lu(e).filter(function(e){return 0===e[0].indexOf("attr__")}).forEach(function(e){return r.attributes[e[0]]=e[1]}),r})}(y)):"")},null!=(n=b[0])&&n.$el_text?{$el_text:null==(r=b[0])?void 0:r.$el_text}:{},g&&"click"===i.type?{$external_click_url:g}:{},w),target:e}}var mv=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 hv(this._config.rageclick),this._elementSelectors=null}var t=e.prototype;return t._clearPointer=function(){this._pointerDown=void 0,clearTimeout(this._pointerExpiry),this._pointerExpiry=void 0},t._isExcludedPointerTarget=function(e){var t;if(!Af(e))return!0;for(var n,r=null!==(t=this._refreshConfig().css_selector_ignorelist)&&void 0!==t?t:Cf,i=new Set,s=e,o=function(){if(i.size>=1e3||i.has(s))return{v:!0};i.add(s);var e=s,t=gf(e);if(yi(t,"ph-no-capture")||yi(t,"ph-sensitive")||Of(e)||r.some(function(t){return Sf(e,t)}))return{v:!0};var n=s.parentNode;s=pf(n)?n.host:n&&df(n)?n:null};s;)if(n=o())return n.v;return!1},t._trackPointer=function(e){var t=this;if(this.isEnabled&&"pointercancel"!==e.type)if("pointerdown"!==e.type){var n=this._pointerDown;n&&(e.pointerId!==n.id||Math.abs(e.clientX-n.x)>5||Math.abs(e.clientY-n.y)>5?this._clearPointer():"pointerup"===e.type&&(n.released=!0,this._pointerExpiry=setTimeout(function(){return t._clearPointer()},0)))}else{var r;this._clearPointer();var i=bf(e);e.isPrimary&&0===e.button&&!e.ctrlKey&&i&&df(i)&&(this._pointerDown={target:i,excluded:this._isExcludedPointerTarget(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(r=this._client)?void 0:r.distinctId})}else this._clearPointer()},t._recoverClickTarget=function(e){var t,n=this._pointerDown;this._clearPointer();var r=bf(e);if(null!=n&&n.released&&n.target.isConnected&&n.distinctId===(null==(t=this._client)?void 0:t.distinctId)&&e.pointerId===n.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-n.x)&&5>=Math.abs(e.clientY-n.y)&&r&&(hf(r,"html")||hf(r,"body"))){var i;if(n.excluded)return null;var s=null!==(i=this._refreshConfig().css_selector_ignorelist)&&void 0!==i?i:Cf;return[r,null==Qa?void 0:Qa.documentElement,null==Qa?void 0:Qa.body].some(function(e){if(!e)return!1;var t=gf(e);return yi(t,"ph-no-capture")||yi(t,"ph-sensitive")||!Af(e)||Of(e)||s.some(function(t){return Sf(e,t)})})?null:n.target}},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(Wa&&Qa){var t=this._domEventHandler=function(t){t=t||(null==Wa?void 0:Wa.event);try{if("blur"===t.type)return void e._clearPointer();if(0===t.type.indexOf("pointer"))return void e._trackPointer(t);var n="click"===t.type?e._recoverClickTarget(t):void 0;if(Li(n))return;e._captureEvent(t,"$autocapture",n)}catch(e){pv.error("Failed to capture event",e)}};if(_u(Wa,"blur",t),_u(Qa,"submit",t,{capture:!0}),_u(Qa,"change",t,{capture:!0}),_u(Qa,"click",t,{capture:!0}),au(["pointerdown","pointermove","pointerup","pointercancel"],function(e){_u(Qa,e,t,{capture:!0})}),this._refreshConfig().capture_copied_text){var n=this._copiedTextHandler=function(t){t=t||(null==Wa?void 0:Wa.event);try{e._captureEvent(t,fv)}catch(e){pv.error("Failed to capture clipboard event",e)}};_u(Qa,"copy",n,{capture:!0}),_u(Qa,"cut",n,{capture:!0}),_u(Qa,"paste",n,{capture:!0})}}}else pv.info("Disabling Automatic Event Collection because this browser is not supported")},t._removeDomEventHandlers=function(){var e=this;this._clearPointer(),this._domEventHandler&&(null==Wa||Wa.removeEventListener("blur",this._domEventHandler),au(["pointerdown","pointermove","pointerup","pointercancel"],function(t){null==Qa||Qa.removeEventListener(t,e._domEventHandler,!0)}),null==Qa||Qa.removeEventListener("submit",this._domEventHandler,!0),null==Qa||Qa.removeEventListener("change",this._domEventHandler,!0),null==Qa||Qa.removeEventListener("click",this._domEventHandler,!0),this._domEventHandler=void 0),this._copiedTextHandler&&(null==Qa||Qa.removeEventListener("copy",this._copiedTextHandler,!0),null==Qa||Qa.removeEventListener("cut",this._copiedTextHandler,!0),null==Qa||Qa.removeEventListener("paste",this._copiedTextHandler,!0),this._copiedTextHandler=void 0),this._initialized=!1},t.startIfEnabled=function(){this.isEnabled||this._clearPointer(),!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,r=t.autocapture_opt_out;$i(r)&&(null==(n=this._client)||n.kv.set(Xu,r),this._isDisabledServerSide=r),this.startIfEnabled()}else this.startIfEnabled()},t.setElementSelectors=function(e){this._elementSelectors=e},t.getElementSelectors=function(e,t){var n,r=[];return null==(n=this._elementSelectors)||n.forEach(function(n){var i;null==Qa||null==(i=Qa.querySelectorAll(n))||i.forEach(function(i){e!==i&&t!==i||yi(r,n)||r.push(n)})}),r},t._captureEvent=function(e,t,n){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r=n||bf(e);ff(r)&&(r=r.parentNode||null);var i,s=this._compileUrlPatterns();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&s.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Rf(r,s.rageclick)&&this._captureEvent(e,"$rageclick",n);var o=t===fv,a=o?u({},s,{dom_event_allowlist:void 0}):s;if(r&&function(e,t,n,r,i,s){var o;if(!Wa||Mf(e))return!1;if(null!=n&&n.url_allowlist&&!vf(n.url_allowlist,s))return!1;if(null!=n&&n.url_ignorelist&&vf(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=Lf(e,r),l=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Ti(n))return!0;for(var r,i,s=function(){var e=i.value;if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}},o=f(e);!(i=o()).done;)if(r=s())return r.v;return!1}(c,n))return!1;if(!xf(c,null==n?void 0:n.css_selector_allowlist))return!1;if(xf(c,null!==(o=null==n?void 0:n.css_selector_ignorelist)&&void 0!==o?o:Cf))return!1;try{var d=Wa.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return l?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(wf.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,a,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var l,c=gv(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),d=c.props;if(c.explicitNoCapture)return!1;var h=this.getElementSelectors(r,c.target);if(h&&h.length>0&&(d.$element_selectors=h),t===fv){var p=e.type||"clipboard";if("paste"!==p){var _,v,g=null==Wa||null==(_=Wa.getSelection())?void 0:_.toString(),m=mf(g);if(!m)return!1;d.$selected_content=m,d.$clipboard_text_length=null!==(v=null==g?void 0:g.length)&&void 0!==v?v:0}d.$copy_type=p}return null==(l=this._client)||l.capture(t,d),!0}}else this._clearPointer()},t.isBrowserSupported=function(){return Ei(null==Qa?void 0:Qa.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(Xu),r=this._isDisabledServerSide,i=this._refreshConfig();if(!i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse)return!1;var s=i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse;if(Li(r)&&!$i(n)&&!s)return!1;var o=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!i.enabled&&!o}}])}(),yv=function(){"use strict";function e(e){this._instance=e}return e.prototype.refresh=function(e){var t=this._instance.config,n=Fi(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}(),bv=function(e){"use strict";function t(t){var n=e.call(this,new yv(t))||this;return n.instance=t,n}return n(t,e),t}(mv),wv=su("[ExceptionAutocapture]"),Sv=function(){"use strict";function e(e){var t,n=this;this._startCapturing=function(){var e;if(Wa&&n.isEnabled&&null!=(e=Eh.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=Eh.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Eh.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Eh.__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=r(n.captureException.bind(n))),!n._unwrapConsoleError&&n._config.capture_console_errors&&(n._unwrapConsoleError=i(n.captureException.bind(n)))}catch(e){wv.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[tl]),this._rateLimiter=new Ji(u({},function(e){var t,n,r,i;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!==(r=null!==(i=e.exceptionRateLimiterBucketSize)&&void 0!==i?i:e.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,_logger:wv})),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 Fi(e)?t=u({},t,e):(Ti(e)?this._remoteEnabled:e)&&(t=u({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabledOrStop=function(){this.isEnabled?(wv.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()},t._loadScript=function(e){var t,n;null!=(t=Eh.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",function(t){if(t)return wv.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={})[tl]=this._remoteEnabled,t)),this._config=this._requiredConfig(),this.startIfEnabledOrStop())}},t.onConfigChange=function(){this._config=this._requiredConfig()},t.captureException=function(e){try{var t,n,r,i=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(i))return void wv.info("Skipping exception capture because of client rate limiting.",{exception:i});null==(r=this._instance.exceptions)||r.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}}])}(),xv=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&&(iu.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,iu.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){Wa&&Wa.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener(),this._shouldCaptureHashChanges()&&this._setupHashchangeListener())},t._patchHistoryMethod=function(e){var t;if(Wa&&(null==(t=Wa.history[e])||!t.__posthog_wrapped__)){var n=this;Qh(Wa.history,e,function(t){return function(r,i,s){t.call(this,r,i,s),n._capturePageview(e)}})}},t._getCurrentLocation=function(){var e=null==Wa?void 0:Wa.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}:Fi(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(ic,{navigation_type:e}),this._lastLocation=t}catch(t){iu.error("Error capturing "+e+" pageview",t)}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};_u(Wa,"popstate",t),this._popstateListener=function(){Wa&&Wa.removeEventListener("popstate",t)}}},t._setupHashchangeListener=function(){var e=this;if(!this._hashchangeListener){var t=function(){e._capturePageview("hashchange")};_u(Wa,"hashchange",t),this._hashchangeListener=function(){Wa&&Wa.removeEventListener("hashchange",t)}}},o(e,[{key:"isEnabled",get:function(){var e=this._getCaptureOptions();return!!(e.path||e.search||this._shouldCaptureHashChanges(e))}}])}(),kv=su("[TracingHeaders]"),Cv=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,r=t._syncHostnamesForPatch();r?(Ti(t._restoreXHRPatch)&&(t._restoreXHRPatch=null==(e=Eh.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,function(){return t._instance.get_distinct_id()},t._instance.sessionManager)),Ti(t._restoreFetchPatch)&&(t._restoreFetchPatch=null==(n=Eh.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)?void 0:n._patchFetch(r,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=Eh.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",function(t){if(t)return kv.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 Pi(t)?(Pi(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):(Pi(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}(),Pv=su("[Web Vitals]"),Ev=9e5,Fv=["CLS","FCP","INP","LCP"],Iv=["INP","LCP"],Tv=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Rv=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},Ai(null==e?void 0:e.name)||Ai(null==e?void 0:e.value))Pv.error("Invalid metric received",e);else{var r="string"==typeof e.navigationURL?e.navigationURL:void 0,i=n._maskedURL(r);if(!Ti(i)){var s=Oi(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+i;if(!n._maxAllowedValue||n._maxAllowedValue>e.value){n._buffer.navigationKey!==s&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,n.flushToCaptureTimeoutMs)),Ti(n._buffer.navigationKey)&&(n._buffer.navigationKey=s,n._buffer.url=i),n._buffer.firstMetricTimestamp=Ti(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp;var o=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=u({},e,r?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});if(delete a.entries,Fi(e.attribution)&&n.attributionMetrics.indexOf(e.name)>-1){for(var l,c={},d=f(Tv);!(l=d()).done;){var h=l.value,p="url"===h&&"string"==typeof e.attribution[h]?n._maskedURL(e.attribution[h]):e.attribution[h];Ti(p)||(c[h]=p)}a.attribution=c}else delete a.attribution;Ti(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 Pv.error("Ignoring metric with value >= "+n._maxAllowedValue,e)}}},this._startCapturing=function(){if(!n._initialized){var e,t,r,i,s=!1,o=Eh.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[n._callbackFlavor])||("web-vitals"===n._callbackFlavor&&Ti(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ti(l)){var c=l.withoutAttribution,d=n.attributionMetrics;s=!Ti(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,r=d.indexOf("FCP")>-1?l.onFCP:(null==c?void 0:c.onFCP)||l.onFCP,i=d.indexOf("INP")>-1?l.onINP:(null==c?void 0:c.onINP)||l.onINP}if(e&&t&&r&&i){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&&r(n._addToBuffer.bind(n),h),n.allowedMetrics.indexOf("INP")>-1&&i(n._addToBuffer.bind(n),f),n._initialized=!0}else Pv.error("web vitals callbacks not loaded - not starting")}},this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[il]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(Pv.info("enabled, starting..."),this._loadScript(this._startCapturing))},t.onRemoteConfig=function(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var n,r,i=Fi(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=Fi(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((n={})[il]=i,n)),this._instance.persistence.register(((r={})[ul]=s,r))),this._enabledServerSide=i,this.startIfEnabled()}}},t._loadScript=function(e){var t=Eh.__PosthogExtensions__,n=this._callbackFlavor,r=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=r&&r[n]||"web-vitals"===n&&Ti(r)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,n,function(t){t?Pv.error("failed to load script",t):e()})},t._maskedURL=function(e){var t=e||(null==Wa?void 0:Wa.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?po(t):t;return mc(n,this._instance.config.mask_personal_data_properties?[].concat(Zd,this._instance.config.custom_personal_data_properties||[]):[],Yd)}Pv.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=Fi(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return Ai(n)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||Fv:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(Fi(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"attributionMetrics",get:function(){var e=Fi(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return $i(e)?e?Fv:[]:Pi(e)?e:Iv}},{key:"useAttribution",get:function(){return this.attributionMetrics.length>0}},{key:"useSoftNavs",get:function(){var e;return null!==(e=Fi(this._perfConfig)?this._perfConfig.__preview_web_vitals_soft_navs:void 0)&&void 0!==e&&e}},{key:"_maxAllowedValue",get:function(){var e=Fi(this._perfConfig)&&Oi(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:Ev;return e>0&&6e4>=e?Ev:e}},{key:"isEnabled",get:function(){var e=null==Za?void 0:Za.protocol;if("http:"!==e&&"https:"!==e)return Pv.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Fi(this._perfConfig)?this._perfConfig.web_vitals:$i(this._perfConfig)?this._perfConfig:void 0;return $i(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"}}])}(),Mv="disabled",Lv="lazy_loading",Av=su("[SessionRecording]"),Ov=function(){"use strict";function e(e){var t=this;if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=Mv,this._persistFlagsOnSessionListener=void 0,this._sessionRecordingDisposed=!1,this._documentWasEverVisible=function(){var e;if(null==Qa||!Qa.visibilityState||"visible"===Qa.visibilityState)return!0;var t=null==Wa||null==(e=Wa.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==Qa?void 0:Qa.visibilityState)&&(t._documentWasEverVisible=!0,null==(e=t._lazyLoadedSessionRecording)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw Av.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!=Qa&&Qa.addEventListener&&_u(Qa,"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==Qa||null==Qa.removeEventListener||Qa.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=!Ti(Object.assign)&&!Ti(Array.from);this._isRecordingEnabled&&n?(this._lazyLoadAndStart(e),Av.info("starting")):(this._recordingStatus=Mv,this.stopRecording())}},t._lazyLoadAndStart=function(e){var t,n,r=this;if(this._isRecordingEnabled)if("awaiting_config"!==this._recordingStatus&&"missing_config"!==this._recordingStatus&&(this._recordingStatus=Lv),null!=Eh&&null!=(t=Eh.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=Eh.__PosthogExtensions__)&&n.initSessionRecording)this._onScriptLoaded(e);else{var i,s=this._instance.sessionManager;null==(i=Eh.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,function(t){if(!r._sessionRecordingDisposed&&r._isRecordingEnabled&&r._instance.sessionManager===s){var n;if(t)return r._instance.register_for_session(((n={})[Zl]=!0,n)),Av.error("could not load recorder",t);r._onScriptLoaded(e)}else r._recordingStatus=Mv})}},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(vl),null==(t=this._persistence)||t.unregister(cl)},t._validateSampleRate=function(e,t){if(Ai(e))return null;var n,r=Oi(e)?e:parseFloat(e);return"number"!=typeof(n=r)||!Number.isFinite(n)||0>n||n>1?(Av.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r},t._persistRemoteConfig=function(e){var t=this;if(this._persistence){var n,r,i=this._persistence,s=function(){var n,r,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;Ai(l)&&t._resetSampling();var c=null==s?void 0:s.minimumDurationMilliseconds;i.register(((r={})[ll]=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:Ti(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}),r))};s(),null==(n=this._persistFlagsOnSessionListener)||n.call(this),this._persistFlagsOnSessionListener=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(s)}},t.onRemoteConfig=function(e){var t=e.ok?e.config:void 0;if(t&&"sessionRecording"in t){if(!1===t.sessionRecording)return this._persistRemoteConfig(t),void this._discardRecording();this._persistRemoteConfig(t),this.startIfEnabledOrStop()}else{var n;"awaiting_config"===this._recordingStatus&&(this._recordingStatus="missing_config",this._instance.register_for_session(((n={})[Jl]=!0,n)),Av.warn("config refresh failed, recording will not start until page reload")),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):Av.warn("log called before recorder was ready")},t._isRemoteConfigFresh=function(){var e,t=this._instance.get_property(ll);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return Av.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!Ai(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp},t._onScriptLoaded=function(e){var t,n,r;if(!this._sessionRecordingDisposed&&this._isRecordingEnabled&&this._instance.sessionManager){var i,s;if(null==(t=Eh.__PosthogExtensions__)||!t.initSessionRecording)return Av.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((i={},i[Zl]=!0,i));if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(s=Eh.__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",Av.info("persisted remote config is stale, requesting fresh config before starting"),void new kp(this._instance).load()}this._recordingStatus=Lv,null==(n=(r=this._lazyLoadedSessionRecording).setDocumentWasEverVisible)||n.call(r,this._documentWasEverVisible),this._lazyLoadedSessionRecording.start(e)}else this._recordingStatus=Mv},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={})[hl]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideLinkedFlag()},t.overrideSampling=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[dl]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideSampling()},t.overrideTrigger=function(e){var t,n,r;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register(((n={})["url"===e?fl:pl]=!0,n)),null==(r=this._lazyLoadedSessionRecording)||r.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(ll))||!e.enabled),n=!this._config.disable_session_recording,r=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Wa&&t&&n&&!r}},{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}}}])}(),Dv=su("[Heatmaps]");function $v(e){return Fi(e)&&"clientX"in e&&"clientY"in e&&Oi(e.clientX)&&Oi(e.clientY)}var qv=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[el]),this.rageclicks=new hv(e.config.rageclick)}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;Dv.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 r=!!n.heatmaps;this.instance.persistence&&this.instance.persistence.register(((t={})[el]=r,t)),this._enabledServerSide=r,this.startIfEnabled()}}},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t._onDeadClick=function(e){$v(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)}(Qa)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null},t._setupListeners=function(){var e=this;Wa&&Qa&&(this._flushHandler=this._flush.bind(this),_u(Wa,rc,this._flushHandler),this._onClickHandler=function(t){return e._onClick(t||(null==Wa?void 0:Wa.event))},_u(Qa,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=function(t){return e._onMouseMove(t||(null==Wa?void 0:Wa.event))},_u(Qa,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Jf(this.instance,Qf,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),_u(Qa,nc,this._onVisibilityChange_handler),this._initialized=!0)},t._removeListeners=function(){var e;Wa&&Qa&&(this._flushHandler&&Wa.removeEventListener(rc,this._flushHandler),this._onClickHandler&&Qa.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Qa.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Qa.removeEventListener(nc,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(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(e,t,n){for(var r=e;r&&df(r)&&!hf(r,"body");){if(r===n)return!1;var i=void 0;try{var s,o,a;i=null==(s=null!==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:Wa)?void 0:s.getComputedStyle(r).position}catch(e){return!1}if(yi(t,i))return!0;r=kf(r)}return!1}(bf(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}},t._onClick=function(e,t){var n;if(void 0===t&&(t="click"),!cf(e.target)&&$v(e)){var r=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&Rf(bf(e),this.instance.config.rageclick)&&this._capture(u({},r,{type:"rageclick"})),this._capture(r)}},t._onMouseMove=function(e){var t=this;!cf(e.target)&&$v(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))},t._capture=function(e){if(Wa){var t=this._config.disable_capture_url_hashes?po(Wa.location.href):Wa.location.href,n=mc(t,this._config.mask_personal_data_properties?[].concat(Zd,this._config.custom_personal_data_properties||[]):[],Yd);this._buffer=this._buffer||{},this._buffer[n]||(this._buffer[n]=[]),this._buffer[n].push(e)}},t._flush=function(){this._buffer&&!Ii(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 Fi(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 Ai(this._config.capture_heatmaps)?Ai(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}}])}(),Bv=su("[Product Tours]"),Nv=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(ol))},Hv=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 r,i;if(this._persistence&&this._persistence.register(((t={})[ol]=!!n.productTours,t)),!Nv(this._instance))return!this._productTourManager&&Ai(null==(r=this._persistence)?void 0:r.props.ph_product_tours)||Bv.info("product tours disabled; stopping and clearing cached tours"),null==(i=this._productTourManager)||i.stop(),this._productTourManager=null,void this.clearCache();this.loadIfEnabled()}}},t.loadIfEnabled=function(){var e=this;!this._productTourManager&&Nv(this._instance)&&this._loadScript(function(){return e._startProductTours()})},t._loadScript=function(e){var t,n;null!=(t=Eh.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"product-tours",function(t){t?Bv.error("Could not load product tours script",t):e()})},t._startProductTours=function(){var e;!this._productTourManager&&null!=(e=Eh.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=Eh.__PosthogExtensions__.generateProductTours(this._instance,!0))},t.getProductTours=function(e,t){var n=this;if(void 0===t&&(t=!1),!Pi(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[Al];if(Pi(i)&&!t)return this._cachedTours=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:function(t){var i;if(Nv(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||Bv.warn(o):Bv.error(o),void e([],{isLoaded:!1,error:o})}var a=Pi(t.json.product_tours)?t.json.product_tours:[];n._cachedTours=a,r&&r.register(((i={})[Al]=a,i)),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})},t.getActiveProductTours=function(e){Ai(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(Al)},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}}])}(),jv=su("[SiteApps]"),Uv="Error while initializing PostHog app with config id ",zv=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,r,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({},i(e,t),{properties:u({},e.properties,y?{$set:u({},null!==(n=null==(r=e.properties)?void 0:r.$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)||(jv.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)||(jv.error("prepare_external_dependency_script returned null"),null):e},n._patchSiteAppElementInsertionMethods=function(){var e,t,n,r,i,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==Qa?void 0:Qa.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 r=e[t];e[t]=n(r),d.push(function(){e[t]=r})}},_=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!Li(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 r=_(t);return r?e.call(this,r,n):t}}),p(c,"replaceChild",function(e){return function(t,n){var r=_(t);return r?e.call(this,r,n):n}}),[null==(t=l.Element)?void 0:t.prototype,null==(n=l.Document)?void 0:n.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach(function(e){p(e,"append",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"prepend",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}})}),[null==(i=l.Element)?void 0:i.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),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"after",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"replaceWith",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=v(n);return n.length&&!i.length?void 0:e.apply(this,i)}})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",function(e){return function(t,n){var r=_(n);return r?e.call(this,t,r):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 r=e(n);return t&&n(),r}catch(e){throw n(),e}},n.setupSiteApp=function(e){var t=this,n=this.apps[e.id],r=function(){!n.errored&&t._bufferedInvocations.length&&(jv.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())},i=!1,s=function(t){n.errored=!t,n.loaded=!0,jv.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),i&&r()};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),i=!0}catch(t){jv.error(Uv+e.id,t),s(!1)}if(i&&n.loaded)try{r()}catch(t){jv.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=f(t);!(e=n()).done;){var r=e.value;this.apps[r.id]={id:r.id,loaded:!1,errored:!1,processedBuffer:!1}}for(var i,s=f(t);!(i=s()).done;)this.setupSiteApp(i.value)},n._onCapturedEvent=function(e){var t=this;if(0!==Object.keys(this.apps).length)for(var n=this.globalsForEvent(e),r=function(){var r=s[i];try{t._runWithPreparedSiteAppElements(function(){return null==r.processEvent?void 0:r.processEvent(n)})}catch(t){jv.error("Error while processing event "+e.event+" for site app "+r.id,t)}},i=0,s=Object.values(this.apps);s.length>i;i++)r()},n.onRemoteConfig=function(e){var t,n,r,i=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",function(e){return i._onCapturedEvent(e)})):void jv.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!=(r=s.siteApps)&&r.length)if(this.isEnabled)for(var o,a=function(){var e,t=o.value,n=t.id,r=t.url;Eh["__$$ph_site_app_"+n]=i._instance,null==(e=Eh.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(i._instance,r,function(e){if(e)return jv.error(Uv+n,e)})},u=f(s.siteApps);!(o=u()).done;)a();else jv.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=Eh._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),Vv=function(e,t){return null!=e&&e.then?e.then(t):t(e)},Wv="SDK is not enabled or survey functionality is not yet loaded",Gv="Disabled. Not loading surveys.",Kv=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 Au.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Ai(t))return Au.warn("Flags not loaded yet. Not loading surveys.");n._isSurveysEnabled=$i(t)?t:t.length>0,Au.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,Vv(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(){var e;null==(e=this._surveyManager)||null==e.clearInMemoryInProgressSurveyState||e.clearInMemoryInProgressSurveyState();try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith("seenSurvey_")||null!=i&&i.startsWith("inProgressSurvey_"))&&n.push(i)}n.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)Au.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Au.info(Gv);else if(t.cookielessMode&&this._configSource.isOptedOut())Au.info("Not loading surveys in cookieless mode without consent.");else{var n=this._configSource.getExtensions();if(n){if(!Ti(this._isSurveysEnabled)||t.advancedEnableSurveys){var r=this._isSurveysEnabled||t.advancedEnableSurveys;this._isInitializingSurveys=!0;try{var i=n.generateSurveys;if(i)return this._completeSurveyInitialization(i,r),void(this._isInitializingSurveys=!1);var s=n.loadExternalDependency;if(!s)return this._handleSurveyLoadError(Yl),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,r)}finally{e._isInitializingSurveys=!1}})}catch(e){throw this._isInitializingSurveys=!1,this._handleSurveyLoadError("Error initializing surveys",e),e}}}else Au.error("PostHog Extensions not found.")}}},t._completeSurveyInitialization=function(e,t){this._disposed||(this._surveyManager=e(t),this._surveyEventReceiver=this._configSource.createEventReceiver(),Au.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0}))},t._handleSurveyLoadError=function(e,t){Au.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,r=this;void 0===t&&(t=!1);var i=null!==(n=this._client)&&void 0!==n?n:this._initialClientState;if(i&&!this._disposed){if(this._config.disableSurveys)return Au.info(Gv),e([]);var s=i.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){r._disposed||e(t.surveys,t.context)}).catch(function(e){return Au.error("Error in survey callback",e)});else{var o=this._sendSurveysRequest("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this._config.requestTimeoutMs}).then(function(e){try{return r._handleSurveyResponse(i,e)}catch(e){return Au.error("Error processing surveys response",e),r._handleSurveyResponse(i,{statusCode:0,error:e})}},function(e){return r._handleSurveyResponse(i,{statusCode:0,error:e})});this._getSurveysInFlightPromise=o;var a=function(){r._getSurveysInFlightPromise===o&&(r._getSurveysInFlightPromise=null)};o.then(function(t){a(),r._disposed||e(t.surveys,t.context)},a).catch(function(e){return Au.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(Wv)})})},t._handleSurveyResponse=function(e,t){var n,r;if(this._disposed)return{surveys:[],context:{isLoaded:!1,error:Wv}};var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return 0!==i?Au.error(s):t.error||Au.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)&&(Eu(e)||qu(e))});return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),e.kv.set(((r={})[Il]=o,r[Tl]=Date.now(),r)),{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(Tl);return Oi(n)&&Date.now()-n>3e5},t._isSurveyRefreshBackingOff=function(){return Oi(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt},t.markSurveyAsSeen=function(e,t){var n;Hu({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=f(this._surveyCallbacks);!(t=n()).done;){var r=t.value;try{if(!e.isLoaded)return r([],e);this.getSurveys(r)}catch(e){Au.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!Ai(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Au.warn("init was not called")},t._getSurveyById=function(e){var t=null;return this.getSurveys(function(n){var r;t=null!==(r=n.find(function(t){return t.id===e}))&&void 0!==r?r:null}),t},t._checkSurveyEligibility=function(e){if(Ai(this._surveyManager))return{eligible:!1,reason:Wv};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(!this._configSource.isCapturing())return{eligible:!1,reason:Ou};if(Ai(this._surveyManager))return{eligible:!1,reason:Wv};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(Ai(this._surveyManager))return Au.warn("init was not called"),{visible:!1,disabledReason:Wv};var t=this._checkSurveyRenderability(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return Ai(this._surveyManager)?(Au.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Wv})):new Promise(function(r){n.getSurveys(function(t){var i,s=null!==(i=t.find(function(t){return t.id===e}))&&void 0!==i?i:null;if(s){var o=n._checkSurveyRenderability(s);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})},t.renderSurvey=function(e,t,n){var r,i=this;if(this._configSource.isCapturing())if(Ai(this._surveyManager))Au.warn("init was not called");else{var s="string"==typeof e?this._getSurveyById(e):e;if(null!=s&&s.id)if(ju.includes(s.type)){var o=null==Qa?void 0:Qa.querySelector(t);if(o)if(null!=(r=s.appearance)&&r.surveyPopupDelaySeconds){Au.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(function(){var e,t;i._renderTimeouts.delete(a),!i._disposed&&i._configSource.isCapturing()&&(Au.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=i._surveyManager)||t.renderSurvey(s,o,n),Au.info("Survey "+s.id+" rendered"))},1e3*s.appearance.surveyPopupDelaySeconds);this._renderTimeouts.add(a)}else this._surveyManager.renderSurvey(s,o,n);else Au.warn("Survey element not found")}else Au.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Au.warn("Survey not found")}},t.displaySurvey=function(e,t){var n;if(this._configSource.isCapturing())if(Ai(this._surveyManager))Au.warn("init was not called");else{var r=this._getSurveyById(e);if(r){var i=r;if(null!=(n=r.appearance)&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=u({},r,{appearance:u({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==hi&&t.initialResponses&&Au.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this._checkSurveyEligibility(r);if(!s.eligible)return void Au.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else Au.warn("Survey not found")}},t.cancelPendingSurvey=function(e){Ai(this._surveyManager)?Au.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 Qv(e,t,n){if(Ai(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var Zv=function(){"use strict";function e(e){var t=this;this._instance=e,this._actionRegistry=new Set,this._actionEvents=new Set,this._debugEventEmitter=new T_,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;Ti(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 T_},t.register=function(e){var t,n,r=this;if(!Ti(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(function(e){var t;r._actionRegistry.add(e),null==(t=e.steps)||t.forEach(function(e){r._actionEvents.add((null==e?void 0:e.event)||"")})}),null!=(n=this._instance)&&n.autocapture)){var i=new Set;this._actionRegistry.forEach(function(e){var t;null==(t=e.steps)||t.forEach(function(e){null!=e&&e.selector&&i.add(e.selector)})}),this._instance.autocapture.setElementSelectors(i)}},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,r=f(t.steps);!(n=r()).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,r=null==e||null==(n=e.properties)?void 0:n.$current_url;if(!r||"string"!=typeof r)return!1;if(!Qv(r,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 r=this._getElementsList(e);if(r.length>0)return r.some(function(e){return Qv(e.href,t.href,t.href_matching||"exact")});var i,s=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!s&&Qv((i=s.match(/(?::|")href="(.*?)"/))?i[1]:"",t.href,t.href_matching||"exact")},t._checkStepText=function(e,t){var n;if(null==t||!t.text)return!0;var r=this._getElementsList(e);if(r.length>0)return r.some(function(e){return Qv(e.text,t.text,t.text_matching||"exact")||Qv(e.$el_text,t.text,t.text_matching||"exact")});var i,s,o,a=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!a&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!Ai(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(a),s=t.text,o=t.text_matching||"exact",i.some(function(e){return Qv(e,s,o)}))},t._checkStepSelector=function(e,t){var n,r;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 i=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&i)try{return new RegExp(t.selector_regex).test(i)}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||Mu(t.properties.reduce(function(e,t){var n=Pi(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}(),Jv=function(e){"use strict";function t(t){return e.call(this,t)||this}n(t,e);var r=t.prototype;return r._getActivatedKey=function(){return Rl},r._getActivatedSessionKey=function(){return Ml},r._getActivationTimestampsKey=function(){return Ll},r._writeActivationTimestamps=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Ll]=e,n))},r._clearActivationTimestampsStore=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Ll)},r._shouldPersistArmedActivation=function(e){var t,n;this._getItems(function(t){n=t.find(function(t){return t.id===e})});var r=null==(t=n)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return Oi(r)&&r>0},r._getShownEventName=function(){return ii},r._getItems=function(e){var t;null==(t=this._instance)||t.getSurveys(e)},r._cancelPendingItem=function(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)},r._getLogger=function(){return Au},r._setActivatedItems=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Rl]=e,n))},r._setActivatedSession=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Ml]=e,n))},r._clearActivatedSession=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Ml)},r._isItemPermanentlyIneligible=function(){return!1},r._activationOutcome=function(e,t){var n;return this._getItems(function(e){n=e.find(function(e){return e.id===t})}),!n||Fu(n)?e===ii?"consume":"ignore":e===ii?"persist":e===si||e===oi?"consume":"ignore"},r.getSurveys=function(){return this.getActivatedIds()},r.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&&Mu(e.propertyFilters,null==t?void 0:t.properties)},t._buildEventToItemMap=function(e,t){var n=new Map;return e.forEach(function(e){var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(function(t){if(null!=t&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}})}),n},t._getMatchingItems=function(e,t,n){var r=this,i=(n===jr?this._eventToItems:this._cancelEventToItems).get(e),s=[];return this._getItems(function(e){s=e.filter(function(e){return null==i?void 0:i.includes(e.id)})}),s.filter(function(i){var s,o=null==(s=i.conditions)||null==(s=s[n])||null==(s=s.values)?void 0:s.find(function(t){return t.name===e});return r._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;Ti(null==(n=this._instance)?void 0:n._addCaptureHook)||(this._setupEventBasedItems(e,t),this._setupActionBasedItems(e,t))},t._setupActionBasedItems=function(e,t){var n=this,r=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!==r.length){this._actionMatcher||(this._actionMatcher=new Zv(this._instance),this._actionMatcher.init(),this._actionMatcher._addActionHook(function(e){return n.onAction(e)}));var i=[];r.forEach(function(e){var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(function(t){if(i.push(t),t.name){var r,s=null!==(r=n._actionToItems.get(t.name))&&void 0!==r?r:[];s.includes(e.id)||s.push(e.id),n._actionToItems.set(t.name,s)}})}),t?this._actionMatcher.replace(i):this._actionMatcher.register(i)}else{var s;t&&(null==(s=this._actionMatcher)||s.replace([]))}},t._mergeItemMaps=function(e,t){t.forEach(function(t,n){var r,i=null!==(r=e.get(n))&&void 0!==r?r:[];t.forEach(function(e){i.includes(e)||i.push(e)}),e.set(n,i)})},t._setupEventBasedItems=function(e,t){var n,r,i=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,jr),u=this._buildEventToItemMap(e,Ur);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==(r=this._instance)?void 0:r._addCaptureHook(function(e,t){i.onEvent(e,t)})))},t.onEvent=function(e,t){var n,r,i=this,s=this._getLogger(),o=(null==t||null==(n=t.properties)?void 0:n.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$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,Ur);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 i._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,jr);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,r=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),i=[],s=f(e);!(n=s()).done;){var o=n.value;r&&this._shouldPersistArmedActivation(o)?this._persistActivation(o)&&this._recordActivationTimestamp(o):i.push(o)}i.length>0&&(this._pendingActivatedItems=[].concat(new Set([].concat(this._pendingActivatedItems,i)))),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(),r=n.filter(function(e){return!t.has(e)});r.length!==n.length&&(this._setActivatedItems(r),0===r.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={},r=!1,i=0,s=Object.entries(t);s.length>i;i++){var o=s[i],a=o[0],u=o[1];e.includes(a)?r=!0:n[a]=u}r&&(Ii(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 Oi(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 r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._getActivatedSessionKey()],i=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return i&&r===i?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,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._getActivatedSessionKey()];if(r&&r!==e){var i=this._getRawPersistedActivatedIds(),s=this._getRawActivationTimestamps();i.length>0&&(this._setActivatedItems([]),i.filter(function(e){return Oi(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}()),Yv=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={},r=f(e);!(t=r()).done;){var i=t.value,s=this._instance.get_property(i);Ti(s)||(n[i]=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}(),Xv=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.isCapturing=function(){return this._instance.is_capturing()},t.getExtensions=function(){var e=this,t=null==Eh?void 0:Eh.__PosthogExtensions__;if(t){var n=t.generateSurveys,r=t.loadExternalDependency;return{generateSurveys:n?function(t){return n(e._instance,t)}:void 0,loadExternalDependency:r?function(t){return r(e._instance,"surveys",t)}:void 0}}},t.createEventReceiver=function(){return new Jv(this._instance)},e}(),eg=function(e){"use strict";function t(t){var n,r=e.call(this,new Xv(t),(n=t,{get projectToken(){return n.config.token},kv:new Yv(n)}))||this;return r._instance=t,r}return n(t,e),t.prototype._sendSurveysRequest=function(e,t){var n=this,r=t.query?c_(e,t.query):e;return new Promise(function(e){var i;n._instance._send_request({method:t.method,url:n._instance.requestRouter.endpointFor(null!==(i=t.target)&&void 0!==i?i:"api",r),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})},t}(Kv),tg=null!=Wa&&Wa.location?yc(Wa.location.hash,"__posthog")||yc(location.hash,"state"):null,ng="_postHogToolbarParams",rg=su("[Toolbar]"),ig=function(){"use strict";function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){Eh.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=Eh.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),vu(this.instance.config))return!1;if(!Wa||!Qa)return!1;e=null!=e?e:Wa.location,n=null!=n?n:Wa.history;try{if(!t){try{Wa.localStorage.setItem("test","test"),Wa.localStorage.removeItem("test")}catch(e){return!1}t=null==Wa?void 0:Wa.localStorage}var r,i=tg||yc(e.hash,"__posthog")||yc(e.hash,"state"),s=i?_o(function(){return JSON.parse(atob(decodeURIComponent(i)))})||_o(function(){return JSON.parse(decodeURIComponent(i))}):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(ng)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}},t._callLoadToolbar=function(e){var t=Eh.ph_load_toolbar||Eh.ph_load_editor;!Ai(t)&&Ei(t)?t(e,this.instance):rg.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Qa||!Qa.getElementById("__POSTHOG_TOOLBAR__"));if(!Wa||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=u({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Wa.localStorage.setItem(ng,JSON.stringify(u({},i,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(i);else if(0===this._getToolbarState()){var s;this._setToolbarState(1),null==(s=Eh.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",function(e){if(e)return rg.error("[Toolbar] Failed to load",e),void t._setToolbarState(0);t._setToolbarState(2),t._callLoadToolbar(i)}),_u(Wa,"turbolinks:load",function(){t._setToolbarState(0),t.loadToolbar(i)})}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}(),sg=su("[FeatureFlags]"),og=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,r,i,s,o,a,u,l;return{bootstrap:{featureFlags:null!==(n=null==(r=e.bootstrap)?void 0:r.featureFlags)&&void 0!==n?n:void 0,featureFlagPayloads:null!==(i=null==(s=e.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==i?i:void 0},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!==(o=e.remote_config_refresh_interval_ms)&&void 0!==o?o:3e5,idleRefreshBackoff:Ti(e.remote_config_refresh_interval_ms),requestTimeoutMs:e.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,null!==(a=e.feature_flag_request_max_retries)&&void 0!==a?a:1),compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(u=null!==(l=e.evaluation_contexts)&&void 0!==l?l:e.evaluation_environments)&&void 0!==u?u:[],flagKeys:Pi(e.flag_keys)?e.flag_keys:void 0}}(e,t),!e.evaluation_environments||e.evaluation_contexts||this._loggedEvaluationEnvironmentsDeprecation||(sg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._loggedEvaluationEnvironmentsDeprecation=!0),Ti(e.flag_keys)||Pi(e.flag_keys)||sg.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")},t.get=function(){return this._snapshot},e}(),ag=su("[FeatureFlags]"),ug=su("[FeatureFlags]",{debugEnabled:!0}),lg="\" failed. Feature flags didn't load in time.",cg=[502,504],dg=["click","keydown","wheel","touchstart","pointerdown"],hg="connection_error",fg=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},pg=function(e){for(var t,n={},r=f(lu(e||{}));!(t=r()).done;){var i=t.value,s=i[1];s&&(n[i[0]]=s)}return n},_g=function(){"use strict";function e(e){var t=this;this.name="featureFlags",this._override_warning=!1,this.featureFlagEventHandlers=[],this._logger=ag,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._hadUserInteraction=!1,this._onOnline=function(){var e=t._hasStatusZeroCircuitBreakerTripped();t._consecutiveStatusZeroFailures=0,e&&t.reloadFeatureFlags()},this._refreshIfDue=function(){var e,n,r=t._refreshIntervalMs,i=null!==(e=t._dueRefreshIntervalMs)&&void 0!==e?e:r;Ti(r)||Ti(i)||t._config.remoteRequestsDisabled||!Qa||"hidden"===Qa.visibilityState||Date.now()-(null!==(n=t._lastRefreshAt)&&void 0!==n?n:0)<i||(t._dueRefreshIntervalMs=t._hadUserInteraction||!t._config.idleRefreshBackoff?r:Math.min(2*i,36e5),t._hadUserInteraction=!1,t.reloadFeatureFlags(),t._scheduleNextRefresh())},this._onUserInteraction=function(){t._hadUserInteraction&&t._dueRefreshIntervalMs===t._refreshIntervalMs||t._resumeConfiguredInterval()},this._onVisibilityChange=function(){"visible"===(null==Qa?void 0:Qa.visibilityState)&&t._resumeConfiguredInterval()},"get"in e?this._configSource=e:(this._instance=e,this._mutableConfigSource=new og(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]"),Vv(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 Wa&&_u(Wa,"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._resumeConfiguredInterval=function(){this._hadUserInteraction=!0,this._dueRefreshIntervalMs=this._refreshIntervalMs,this._refreshIfDue()},t._syncAutomaticRefresh=function(){var e=this,t=this._config.refreshIntervalMs,n=!this._config.remoteRequestsDisabled&&Qa&&!Ti(t)&&t>0?t:void 0;this._config.idleRefreshBackoff||(this._dueRefreshIntervalMs=n),n!==this._refreshIntervalMs&&(this._stopAutomaticRefresh(),Ti(n)||(this._refreshIntervalMs=n,this._dueRefreshIntervalMs=n,this._scheduleNextRefresh(),null!=Qa&&Qa.addEventListener&&(_u(Qa,nc,this._onVisibilityChange),ou(dg,function(t){_u(Qa,t,e._onUserInteraction,{capture:!0})}))))},t._scheduleNextRefresh=function(){Ti(this._refreshIntervalMs)||(Ti(this._refreshInterval)||clearInterval(this._refreshInterval),this._lastRefreshAt=Date.now(),this._refreshInterval=setInterval(this._refreshIfDue,this._refreshIntervalMs))},t._stopAutomaticRefresh=function(){var e=this;Ti(this._refreshInterval)||(clearInterval(this._refreshInterval),this._refreshInterval=void 0,null==Qa||null==Qa.removeEventListener||Qa.removeEventListener(nc,this._onVisibilityChange),ou(dg,function(t){null==Qa||null==Qa.removeEventListener||Qa.removeEventListener(t,e._onUserInteraction,{capture:!0})})),this._refreshIntervalMs=void 0,this._dueRefreshIntervalMs=void 0,this._hadUserInteraction=!1,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==Wa||Wa.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!Ti(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 r,i;if(null!=(r=this._instance)&&r.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&&!Pi(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=((i={})[ml]=_,i[gl]=_,i[wl]=v,i);e.$feature_flag_details&&(g[bl]=_);for(var m=0,y=[Sl,ql,xl];y.length>m;m++){var b=y[m];Ti(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=[ml,wl,Sl,kl];n.length>t;t++){var r=n[t],i=this._prop(r);Ti(i)||(e[r]=i)}this._baseEventProperties=e;var s=u({},e),o=this._prop(gl);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(ql);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(!Ti(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,r=null!==(e=null==(t=n.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(r).length){var i,s,o=null!==(i=null==(s=n.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==i?i:{},a=Object.keys(r).filter(function(e){return!Ti(r[e])}).reduce(function(e,t){return e[t]=r[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 r,i,s=null!=n&&n.merge&&null!==(r=this._prop("$enabled_feature_flags"))&&void 0!==r?r:{},o=null!=n&&n.merge&&null!==(i=this._prop("$feature_flag_payloads"))&&void 0!==i?i:{},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:oa(_),variant:aa(_),reason:void 0,metadata:Ti(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(bl),t=this._prop(kl),n=this._prop(Cl);if(!n&&!t)return e||{};for(var r,i=uu({},e||{}),s=f([].concat(new Set([].concat(Object.keys(n||{}),Object.keys(t||{})))));!(r=s()).done;){var o,a,l=r.value,c=i[l],d=null==t?void 0:t[l],h=Ti(d)?null!==(o=null==c?void 0:c.enabled)&&void 0!==o&&o:!!d,p=Ti(d)?null==c?void 0:c.variant:"string"==typeof d?d:void 0,_=null==n?void 0:n[l],v=u({},c,{enabled:h,variant:h?null!=p?p:null==c?void 0:c.variant:void 0});h!==(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})),i[l]=v}return this._override_warning||(this._logger.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this._override_warning=!0),i},t.getAllFeatureFlags=function(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(function(n){var r=e[n];return{key:n,enabled:oa(r),variant:aa(r),payload:sa(t[n])}})},t.getFlagVariants=function(){var e=this._prop(gl),t=this._prop(kl);if(!t)return e||{};for(var n=uu({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];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(wl),t=this._prop(Cl);if(!t)return e||{};for(var n=uu({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];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(Ol)},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 r={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(El),timezone:uh()};Ti(n.deviceId)||(r.$device_id=n.deviceId),(null!=e&&e.disableFlags||this._config.featureFlagsDisabled)&&(r.disable_flags=!0);var i=this._getValidEvaluationEnvironments();i.length&&(r.evaluation_contexts=i);var s=this._getValidFlagKeys();Ti(s)||(r.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={})[$l]=[hg],n)),t._logger.error("Feature flag request failed",e),t._fallBackToPersistedFlags()&&t._fireFeatureFlagsCallbacks(!0),c()):c()},h=this._config.requestMaxRetries,f=function(){if(l!==t._requestGeneration||!t._client||t._config.remoteRequestsDisabled)return t._requestInFlight=!1,void c();try{n.sendRequest(a,{target:"flags",method:"POST",body:r,compression:t._config.compression,sentAt:"body",timeoutMs:t._config.requestTimeoutMs}).then(function(e){if(function(e){return cg.includes(e.statusCode)||function(e){return 0===e.statusCode&&e.error instanceof Error&&"AbortError"===e.error.name}(e)}(e)&&h>0&&l===t._requestGeneration)return h--,void setTimeout(f,500);!function(e){var n,i,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),!r.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?hg:"unknown_error"):200!==e.statusCode&&d.push("api_error_"+e.statusCode),a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var h=!(null==(i=a.quotaLimited)||!i.includes("feature_flags"));h&&d.push("quota_limited"),t._set(((s={})[$l]=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."):r.disable_flags||t._receivedFeatureFlags(a,u,{partialResponse:o}),c()}}else c()}(e)}).catch(d)}catch(e){d(e)}};f()}},t._hasStatusZeroCircuitBreakerTripped=function(){return bc(this._consecutiveStatusZeroFailures,3)},t._trackStatusZeroReachability=function(e){var t=this;this._consecutiveStatusZeroFailures=wc(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 r=this.getFeatureFlagResult(e,t);return null!==(n=null==r?void 0:r.variant)&&void 0!==n?n:null==r?void 0:r.enabled}}else this._logger.warn('getFeatureFlag for key "'+e+lg)},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 r,i,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(Dl);_&&_!==v&&(f={},r=_)}if(t.send_event||!("send_event"in t))if(e in f&&f[e].includes(c))r&&this._set(((i={})[Ol]=f,i[Dl]=r,i));else{var g,m,y,b,w,S,x,k,C,P,E,F,I,T,R;Pi(f[e])?f[e].push(c):f[e]=[c],this._set(u(((g={})[Ol]=f,g),r?((m={})[Dl]=r,m):{}));var M=this.getFeatureFlagDetails(e),L=[].concat(null!==(y=this._prop("$feature_flag_errors"))&&void 0!==y?y:[]);Ti(a)&&L.push("flag_missing");var A={$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};Ti(null==M||null==(k=M.metadata)?void 0:k.has_experiment)||(A.$feature_flag_has_experiment=M.metadata.has_experiment),Ti(null==M||null==(C=M.metadata)?void 0:C.version)||(A.$feature_flag_version=M.metadata.version);var O=null!==(P=null==M||null==(E=M.reason)?void 0:E.description)&&void 0!==P?P:null==M||null==(F=M.reason)?void 0:F.code;O&&(A.$feature_flag_reason=O),null!=M&&null!=(I=M.metadata)&&I.id&&(A.$feature_flag_id=M.metadata.id),Ti(null==M?void 0:M.original_variant)&&Ti(null==M?void 0:M.original_enabled)||(A.$feature_flag_original_response=Ti(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(T=M.metadata)&&T.original_payload&&(A.$feature_flag_original_payload=null==M||null==(R=M.metadata)?void 0:R.original_payload),L.length&&(A.$feature_flag_error=L.join(",")),this._captureFeatureFlagCalled(A)}else r&&this._set(((n={})[Ol]=f,n[Dl]=r,n));if(o)return{key:e,enabled:!!a,variant:"string"==typeof a?a:void 0,payload:sa(l)}}}else this._logger.warn('getFeatureFlagResult for key "'+e+lg)},t._captureFeatureFlagCalled=function(e){try{var t;null==(t=this._client)||t.capture("$feature_flag_called",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=h(l().m(function e(t,n){var r,i,s,o,a,u,c,d,h,f;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=this._client){e.n=1;break}return e.a(2);case 1:return i={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},(s=this._getValidEvaluationEnvironments()).length&&(i.evaluation_contexts=s),o=this._getValidFlagKeys(),Ti(o)||(i.flag_keys=o),e.p=2,e.n=3,r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,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+lg),t.defaultValue;var n=this.getFeatureFlag(e,t);return Ti(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 r=function(e,t,n,r,i,s){var o,a,l;void 0===t&&(t={}),void 0===n&&(n={}),void 0===r&&(r={}),void 0===s&&(s=ag);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!Ti(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(Pi(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={})[ml]=h,v[gl]=g,v[xl]=!1,v}var y=h,b=f,w=d;if(null!=i&&i.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({},r,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({},r,Object.fromEntries(Object.entries(w||{}).filter(function(e){return k.has(e[0])})))}else y=u({},t,y),b=u({},n,b),w=u({},r,w);return u(((o={})[ml]=Object.keys(pg(y)),o[gl]=y||{},o[wl]=b||{},o[bl]=w||{},o[xl]=!0===e.minimalFlagCalledEvents,o),p?((a={})[Sl]=p,a):{},_?((l={})[ql]=_,l):{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this._logger);if(r)if(!1===(null==n?void 0:n.persist)){var i=!Ti(this._client.kv.get(gl));this._bootstrapState=r,i||this._set(r)}else this._clearBootstrapState(),this._markCrossTabFeatureFlagSnapshot(r,e,!(null==n||!n.partialResponse)),this._set(r);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([kl,Cl]),this._fireFeatureFlagsCallbacks(),void ug.info("All overrides cleared");var t,n;if(Pi(e))return this._set(((t={})[kl]=fg(e),t)),this._fireFeatureFlagsCallbacks(),void ug.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;this._override_warning=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r);var s={},o=i.flags,a=i.payloads;return o&&(s[kl]=Pi(o)?fg(o):o),a&&(s[Cl]=a),Object.keys(s).length&&this._set(s),!1===o&&!1===a?this._remove([kl,Cl]):!1===o?this._remove(kl):!1===a&&this._remove(Cl),this._fireFeatureFlagsCallbacks(),!1===o?ug.info("Flag overrides cleared"):o&&ug.info("Flag overrides set",{flags:o}),void(!1===a?ug.info("Payload overrides cleared"):a&&ug.info("Payload overrides set",{payloads:a}))}if(e&&"object"==typeof e)return this._set(((n={})[kl]=e,n)),this._fireFeatureFlagsCallbacks(),void ug.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(),r=n.flags,i=n.flagVariants;try{e(r,i)}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 r,i,s,o,a,l=(this._prop("$early_access_features")||[]).find(function(t){return t.flagKey===e}),c=((r={})["$feature_enrollment/"+e]=t,r),d={$feature_flag:e,$feature_enrollment:t,$set:c};l&&(d.$early_access_feature_name=l.name),n&&(d.$feature_enrollment_stage=n);var h=u({},this.getFlagVariants(),((i={})[e]=t,i));null==(s=this._instance)||null==(s=s.persistence)||s.markCrossTabFeatureFlagChanges(((o={})[ml]=[e],o[gl]=[e],o[Pl]=Object.keys(c),o)),this._set(((a={})[ml]=Object.keys(pg(h)),a[gl]=h,a[Pl]=u({},this._prop("$stored_person_properties")||{},c),a)),this._fireFeatureFlagsCallbacks();try{var f;null==(f=this._client)||f.capture("$feature_enrollment_update",d)}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 r=this._prop(yl);!r||t?this._getEarlyAccessFeatures(e,n):e(r)},t._getEarlyAccessFeatures=function(){var e=h(l().m(function e(t,n){var r,i,s,o,a;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=this._client){e.n=1;break}return e.a(2);case 1:return i=n?"&"+n.map(function(e){return"stage="+e}).join("&"):"",e.p=2,e.n=3,r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{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={})[yl]=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(),r=n.flags,i=n.flagVariants;this.featureFlagEventHandlers.forEach(function(n){try{n(r,i,{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 r=this._prop("$stored_person_properties")||{},i=(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 r||(o[a]=s[a]));this._set(((n={})[Pl]=u({},r,o,i),n)),t&&this.reloadFeatureFlags()},t.unsetPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=u({},this._prop("$stored_person_properties")||{});e.forEach(function(e){delete r[e]}),this._set(((n={})[Pl]=r,n)),t&&this.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(e){void 0===e&&(e=!0),this._remove(Pl),e&&this.reloadFeatureFlags()},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);for(var r=this._prop("$stored_group_properties")||{},i=u({},r),s=0,o=Object.keys(e);o.length>s;s++){var a=o[s];i[a]=u({},r[a],e[a])}this._set(((n={})[El]=i,n)),t&&this.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,r=this._prop("$stored_group_properties")||{};this._set(((n={})[El]=u({},r,((t={})[e]={},t)),n))}else this._remove(El)},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}}])}(),vg="Refusing to render web experiment since the viewer is a likely bot",gg={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 Iu(t,e)},not_regex:function(e,t){return!Iu(t,e)},exact:function(e,t){return t===e},is_not:function(e,t){return t!==e}},mg=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 r;n._flagToExperiments&&(e._logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=n._flagToExperiments)||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);Ri(i)&&t.variants[i]&&n._applyTransforms(t.name,i,t.variants[i].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(vg);else if(!this._config.disable_web_experiments){if(Ai(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 r,i=n._instance.getFeatureFlag(e),s=null==(r=n._flagToExperiments)?void 0:r.get(e);i&&null!=s&&s.variants[i]&&n._applyTransforms(s.name,i,s.variants[i].transforms)}})}},t.previewWebExperiment=function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var r=gc(null==n?void 0:n.search,"__experiment_id"),i=gc(null==n?void 0:n.search,"__experiment_variant");r&&i&&(e._logInfo("previewing web experiments "+r+" && "+i),this.getWebExperiments(function(e){t._showPreviewWebExperiment(parseInt(r),i,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 r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);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,r){var i=r.filter(function(e){return e.id===t});i&&i.length>0&&(e._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this._applyTransforms(i[0].name,n,i[0].variants[n].transforms))},e._matchesTestVariant=function(t,n){return!Ai(t.conditions)&&e._matchUrlConditions(t,n)&&e._matchUTMConditions(t)},e._matchUrlConditions=function(t,n){var r;if(Ai(t.conditions)||Ai(null==(r=t.conditions)?void 0:r.url))return!0;var i=e.getWindowLocation();if(i){var s,o,a,u=xc(n,i.href);return null==(s=t.conditions)||!s.url||gg[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==Wa?void 0:Wa.location},e._matchUTMConditions=function(e){var t;if(Ai(e.conditions)||Ai(null==(t=e.conditions)?void 0:t.utm))return!0;var n=eh();if(n.utm_source){var r,i,s,o,a,u,l,c,d=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.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),r=1;t>r;r++)n[r-1]=arguments[r];iu.info("[WebExperiments] "+e,n)},t._applyTransforms=function(t,n,r){this._is_bot()?e._logInfo(vg):"control"!==n?r.forEach(function(r){var i;r.selector&&(e._logInfo("applying transform of variant "+n+" for experiment "+t+" ",r),null==(i=document)||null==(i=i.querySelectorAll(r.selector))||i.forEach(function(e){var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}):e._logInfo("Control variants leave the page unmodified.")},t._is_bot=function(){return Ka&&this._instance?A_(Ka,this._config.custom_blocked_useragents):void 0},o(e,[{key:"_config",get:function(){return this._instance.config}}])}(),yg=su("[Conversations]"),bg="Conversations not available yet.",wg=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;Ai(t)||($i(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||vu(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Eh?void 0:Eh.__PosthogExtensions__;if(t&&!Ti(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 r=t.loadExternalDependency;if(!r)return void this._handleLoadError(Yl);r(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 yg.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,yg.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else yg.error("Cannot complete initialization: remote config is null")},t._handleLoadError=function(e,t){yg.error(e,t),this._conversationsManager=null,this._isInitializing=!1,this._loadFailed=!0},t.show=function(){this._conversationsManager?this._conversationsManager.show():yg.warn("Conversations not loaded yet.")},t.hide=function(){this._conversationsManager&&this._conversationsManager.hide()},t.isAvailable=function(){return!0===this._isConversationsEnabled&&!Li(this._conversationsManager)},t.getUnavailableReason=function(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":vu(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this._remoteConfigSuccessful?"remote_config_failed":Ti(this._isConversationsEnabled)?this._remoteConfigSuccessful?"disabled_in_project":"remote_config_pending":this._isConversationsEnabled?Ai(this._remoteConfig)||!this._remoteConfig.token?"missing_token":null!=Eh&&Eh.__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=h(l().m(function e(t,n,r){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),e.a(2,null);case 1:return e.a(2,this._conversationsManager.sendMessage(t,n,r))}},e,this)}));return function(t,n,r){return e.apply(this,arguments)}}(),t.getMessages=function(){var e=h(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 yg.warn(bg),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=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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 Sg(e,t){var n,r,i,s,o,a,l,c=null!==(n=null==e?void 0:e.flushIntervalMs)&&void 0!==n?n:3e3,d=null!==(r=null==e?void 0:e.maxBufferSize)&&void 0!==r?r:100,h=null!=t&&t.consoleCapture?void 0:null!==(i=null==e?void 0:e.maxLogsPerInterval)&&void 0!==i?i:1e3,f=Ti(h)?Math.max(d,2048):Math.max(d,h),p=u({},function(){var e="",t="";try{var n=null==Ka?void 0:Ka.userAgent;if(n){var r=Zs(n);e=r[0],t=r[1]}}catch(e){}return function(e,t){var n=function(e){if(e)return{}.hasOwnProperty.call(Ea,e)?Ea[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 xg=["debug","log","warn","error","info"],kg="console",Cg="__posthogHandledLogsRequestError",Pg=function(e,t){var n=e instanceof Error?e:new Error(t);return n[Cg]=!0,n},Eg=function(e){return!!e&&"object"==typeof e&&!0===e[Cg]},Fg=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=su("[logs]"),this._coreLogger=u({},this._logger,{error:function(){for(var e,t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];r.some(Eg)||(e=n._logger).error.apply(e,r)}}),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),Wa&&_u(Wa,"online",this._onReconnect)}var t=e.prototype;return t._buildCore=function(e,t,n,r){var i,s=this,o=Sg(null==(i=this._instance)||null==(i=i.config)?void 0:i.logs,n);return[new $a(this._createHost(e,t),o,this._coreLogger,function(){return s._getSdkContext()},function(e){return e()},void 0,r),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 r;null==(r=this._core)||r.reset(),this._resolvedFrom=n;var i=this._buildCore(function(){return t._queue},function(e){t._queue=e});this._core=i[0],this._resolvedConfig=i[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 r;null==(r=this._consoleCore)||r.reset(),this._consoleResolvedFrom=n;var i=this._buildCore(function(){return t._consoleQueue},function(e){t._consoleQueue=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},kg);this._consoleCore=i[0],this._consoleResolvedConfig=i[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 r=!1,i=e.onRemoteConfig(function(e){var t;r=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),n.onRemoteConfig(e)});this._disposed?i.dispose():(this._remoteConfigSubscription=i,r||this.loadIfEnabled())}},t.dispose=function(){var e,t,n,r;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==Wa||Wa.removeEventListener("online",this._onReconnect),null==(t=this._consoleLogsDispose)||t.call(this),this._consoleLogsDispose=void 0,null==(n=this._core)||n.reset(),null==(r=this._consoleCore)||r.reset())},t.onRemoteConfig=function(e){var t,n,r;if(!this._disposed){var i=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;Ai(i)?this._stopRecorderStartedByPersistedHint():(null==(n=this._instance)||null==(n=n.persistence)||n.register(((r={})[al]=!!i,r)),i?(this._isLogsEnabled=!0,this._isLoaded||this._startConsoleRecorder(),this.loadIfEnabled()):this._stopRecorderStartedByPersistedHint())}},t.reset=function(){var e,t,n,r;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==(r=this._consoleCore)||r.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[al])},t._remoteConfigWillArrive=function(){var e,t;return null==(e=this._instance)||null==e._shouldDisableFlags||!e._shouldDisableFlags()||!(null==(t=Eh._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!=Eh&&Eh.console){var n=Sg(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,r=!0;this._consoleRecorderUnpatchers.push(function(){r=!1});for(var i=function(){var e,i=o[s];try{e=function(e){for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e}(Eh.console[i])}catch(e){return 0}if(!e)return 0;t._consoleRecorderUnpatchers.push(Qh(Eh.console,i,function(s){var o=function(){for(var e=arguments.length,o=new Array(e),a=0;e>a;a++)o[a]=arguments[a];try{r&&t._recordConsoleEntry(i,o,n)}catch(e){}return s.apply(Eh.console,o)};return o.__rrweb_original__=e,o}))},s=0,o=xg;o.length>s;s++)i();this._isRecordingConsole=!0,this._consoleRecorderTimeout=setTimeout(function(){t._stopConsoleRecorder()},3e4)}},t._recordConsoleEntry=function(e,t,n){var r;if(this._isRecordingConsole&&!this._isRecordingConsoleEntry&&0!==t.length)if(null!=(r=this._instance)&&r.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=f(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){Eg(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==Eh?void 0:Eh.__PosthogExtensions__;if(!t)return this._logger.error("PostHog Extensions not found."),void this._stopConsoleRecorder();var n=t.loadExternalDependency;if(!n)return this._logger.error(Yl),void this._stopConsoleRecorder();this._isLoading=!0;try{n(this._instance,"logs",function(n){if(e._isLoading=!1,!e._disposed&&e._isLogsEnabled){var r=t.logs;if(n||null==r||!r.initializeLogs)e._logger.error("Could not load logs script",n),e._stopConsoleRecorder();else{var i,s,o=e._takeConsoleBuffer();e._consoleLogsDispose=r.initializeLogs(null!==(i=e._client)&&void 0!==i?i:e._instance),e._isLoaded=!0,o.length>0&&(null==r.replayConsoleBuffer||r.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,r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:function(t){return t===fi.LogsQueue?e():void 0},setPersistedProperty:function(e,n){e===fi.LogsQueue&&t(null!=n?n:[])},_sendLogsBatch:function(e){return n._sendLogsBatch(e)},getLibraryId:function(){return uf.LIB_NAME},getLibraryVersion:function(){return uf.LIB_VERSION}}},t._sendLogsBatch=function(e){var t=this;return new Promise(function(n){if(bc(t._consecutiveStatusZeroFailures,3))n({kind:"fatal",error:Pg(void 0,"logs endpoint is unreachable, dropping batch")});else{var r=!1,i=function(e){r||(r=!0,clearTimeout(s),n(e))},s=setTimeout(function(){t._logger.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:Pg(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)i({kind:"ok"});else if(413===n)i({kind:"too-large"});else if(0!==n&&408!==n&&429!==n&&500>n)i({kind:"fatal",error:new Error("logs request failed with status "+n)});else{var r;0===n?(e.error||t._logger.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:Pg(e.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+n)})}}})}})},t._trackEndpointReachability=function(e){var t=this;(0!==e||this._instance.__loaded)&&(this._consecutiveStatusZeroFailures=wc(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,uf.LIB_NAME,function(e){t._queue=e}),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,kg,function(e){t._consoleQueue=e})},t._drainQueueViaTransport=function(e,t,n,r,i){if(0!==t.length){var s=t.map(function(e){return e.record});i([]);var o=La(s,Ma(n,uf.LIB_NAME,uf.LIB_VERSION),r,uf.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),r=n.windowId,i=n.sessionStartTimestamp,s=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=r,Ai(i)||(t.sessionStartTimestamp=i),Ai(s)||(t.lastActivityTimestamp=s)}if(null!=Eh&&null!=(e=Eh.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?po(Eh.location.href):Eh.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}}])}(),Ig=su("[NetworkMetrics]"),Tg=function(){var e;return null!=Wa&&null!=(e=Wa.performance)&&e.now?Wa.performance.now():Date.now()},Rg={"http:":80,"https:":443},Mg=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),Lg=function(e,t){var n,r=String(t);return{method:String(e).toUpperCase(),url:(null==(n=vc(r))?void 0:n.href)||r}},Ag=function(e,t,n,r,i,s,o){void 0===o&&(o=!1);try{var a,l=i();if(!l)return;var c=n||void 0,d=Tg()-r,h=vc(t.url);if(h&&"http:"!==h.protocol&&"https:"!==h.protocol)return;var f={url:(null==h?void 0:h.href)||t.url,method:t.method},p=Ei(l.name)?l.name(f):Ri(l.name)?l.name:"http.client.request.duration";if(!p)return;var _=o&&!c?void 0:function(e,t){return e?400>e?void 0:String(e):(null==t?void 0:t.name)||"_OTHER"}(c,s),v=u({},u({"http.request.method":m=Mg.has(g=f.method)?g:"_OTHER"},"_OTHER"===m&&g!==m?{"http.request.method_original":g}:{}),h?function(e){return{"server.address":e.hostname.startsWith("[")&&e.hostname.endsWith("]")?e.hostname.slice(1,-1):e.hostname,"server.port":Number(e.port)||Rg[e.protocol],"url.scheme":e.protocol.slice(0,-1),"url.template":(t=e.pathname,t.split("/").map(function(e){return function(e){return/^\d+$/.test(e)||e.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(e)}(e)?":id":e}).join("/"))};var t}(h):{},c?{"http.response.status_code":c}:{},_?{"error.type":_}:{},null==l.attributes?void 0:l.attributes(f,{status:c,durationMs:d}));null==(a=e.metrics)||a.histogram(p,d,{unit:"ms",attributes:v})}catch(e){Ig.error("Failed to record network metric",e)}var g,m},Og=function(){},Dg=function(e){var t=!0,n=function(){return t?function(e){var t,n=null==(t=e.config.metrics)?void 0:t.network;return!0===n?{}:n||void 0}(e):void 0},r=function(e,t){return Ei(null==Wa?void 0:Wa.fetch)?Qh(Wa,"fetch",function(n){return function(){for(var r=Tg(),i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];var a=n.apply(this,s);if(!t())return a;try{var u,l,c,d=s[0],h=s[1],f=Lg(null!==(u=null!==(l=null==h?void 0:h.method)&&void 0!==l?l:null==d?void 0:d.method)&&void 0!==u?u:"GET",null!==(c=null==d?void 0:d.url)&&void 0!==c?c:d);return a.then(function(n){return Ag(e,f,null==n?void 0:n.status,r,t,void 0,!0),n},function(n){throw Ag(e,f,void 0,r,t,n),n})}catch(e){return Ig.error("Failed to observe fetch",e),a}}}):Og}(e,n),i=function(e,t){var n,r=null==Wa||null==(n=Wa.XMLHttpRequest)?void 0:n.prototype;if(!r)return Og;var i=new WeakMap,s=Qh(r,"open",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];try{(function(e){return s_.has(e)})(this)||i.set(this,Lg(n[0],n[1]))}catch(e){Ig.error("Failed to observe XHR open",e)}return e.apply(this,n)}}),o=Qh(r,"send",function(n){return function(){var r,s=this;try{var o=i.get(this);if(o&&t()){var a=Tg();_u(this,"loadend",r=function(){s.removeEventListener("loadend",r),Ag(e,o,s.status,a,t)})}}catch(e){Ig.error("Failed to observe XHR send",e)}try{for(var u=arguments.length,l=new Array(u),c=0;u>c;c++)l[c]=arguments[c];return n.apply(this,l)}catch(e){throw r&&this.removeEventListener("loadend",r),e}}});return function(){s(),o()}}(e,n);return function(){t=!1,r(),i()}},$g=function(){"use strict";function e(e){this._instance=e,this._logger=su("[metrics]"),this._disposed=!1}var t=e.prototype;return t.initialize=function(){this.onConfigChange()},t.onConfigChange=function(){var e;if(!this._disposed){var t=!(null==(e=this._instance.config.metrics)||!e.network);t&&!this._stopNetworkMetrics?this._stopNetworkMetrics=Dg(this._instance):!t&&this._stopNetworkMetrics&&(this._stopNetworkMetrics(),this._stopNetworkMetrics=void 0)}},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 Ha(this._createHost(),function(e){var t,n,r,i,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!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==e?void 0:e.environment,resourceAttributes:o,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(i=null==e?void 0:e.flushIntervalMs)&&void 0!==i?i: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.dispose=function(){var e,t;this._disposed=!0,null==(e=this._stopNetworkMetrics)||e.call(this),this._stopNetworkMetrics=void 0,null==(t=this._core)||t.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 uf.LIB_NAME},getLibraryVersion:function(){return uf.LIB_VERSION}}},t._sendMetricsBatch=function(e,t){var n=this;return new Promise(function(r){var i=!1,s=function(e){i||(i=!0,clearTimeout(o),r(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}(),qg={featureFlags:_g},Bg={sessionRecording:Ov},Ng={autocapture:bv,historyAutocapture:xv,heatmaps:qv,deadClicksAutocapture:Jf,webVitalsAutocapture:Rv},Hg={exceptionObserver:Sv,exceptions:Oh},jg=u({productTours:Hv},qg),Ug={siteApps:zv},zg={tracingHeaders:Cv},Vg=u({surveys:eg},qg),Wg={toolbar:ig},Gg=u({experiments:mg},qg),Kg=u({},qg,Bg,Ng,Hg,jg,Ug,Vg,zg,Wg,Gg,{conversations:wg},{logs:Fg},{metrics:$g});if(dv.__defaultExtensionClasses=u({},Kg),function(){uf.SDK_DIST_CHANNEL="cdn";var e=Eh.posthog;if(!e||Pi(e._i)||!Ei(e.init)){var t=K_[sv]=new dv;if(e){var n=[];au(e._i,function(r){if(r&&Pi(r)){var i=t.init(r[0],r[1],r[2]),s=e[r[2]]||e;i.__loaded&&-1===n.indexOf(s)&&(n.push(s),i._execute_array.call(i.people,s.people),i._execute_array(s))}})}t.__SV=1,Eh.posthog=t,function(){function e(){e.done||(e.done=!0,x_=!1,au(K_,function(e){e._dom_loaded()}))}null!=Qa&&Qa.addEventListener?"complete"===Qa.readyState?e():_u(Qa,"DOMContentLoaded",e,{capture:!1}):Wa&&iu.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}(),"undefined"==typeof performance||"function"!=typeof performance.now){var Qg="undefined"!=typeof performance?performance:{};Qg.now=Qg.now||function(){return Date.now()},"undefined"==typeof performance&&(window.performance=Qg)}}()}();
|
|
1
|
+
!function(){var e=["retriesPerformedSoFar"],t=["$set_once","$set"];function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function s(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}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 r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(null,arguments)}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,i,s){var u=Object.create((r&&r.prototype instanceof a?r:a).prototype);return c(u,"_invoke",function(n,r,i){var s,a,u,l=0,c=i||[],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,r){for(a=n,u=r,t=0;!d&&l&&!i&&c.length>t;t++){var i,s=c[t],f=h.p,p=s[2];n>3?(i=p===r)&&(u=s[(a=s[4])?5:(a=3,3)],s[4]=s[5]=e):f>=s[0]&&((i=2>n&&s[1]>f)?(a=0,h.v=r,h.n=s[1]):p>f&&(i=3>n||s[0]>r||r>p)&&(s[4]=n,s[5]=r,h.n=p,a=0))}if(i||n>1)return o;throw d=!0,r}return function(i,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||(i="next"),t=s[i]){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 '"+i+"' method"),a=1);s=e}else if((t=(d=0>h.n)?u:n.call(r,h))!==o)break}catch(t){s=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,i,s),!0),u}var o={};function a(){}function u(){}function d(){}t=Object.getPrototypeOf;var h=[][r]?t(t([][r]())):(c(t={},r,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,i,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,c(f,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,i,"GeneratorFunction"),c(f),c(f,i,"Generator"),c(f,r,function(){return this}),c(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:s,m:p}})()}function c(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}c=function(e,t,n,r){function s(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},c(e,t,n,r)}function d(e,t,n,r,i,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(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(e){d(s,r,i,o,a,"next",e)}function a(e){d(s,r,i,o,a,"throw",e)}o(void 0)})}}function f(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 p(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)?p(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return e.length>r?{done:!1,value:e[r++]}:{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 p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}!function(r,s,a){var c,d,p,_,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")()}),I=E(function(e,t){t.exports=function(e){try{return!!e()}catch(e){return!0}}}),T=E(function(e,t){t.exports=!I()(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}),R=E(function(e,t){t.exports=!I()(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}),M=E(function(e,t){var n=R(),r=function(){}.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}}),L=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}),A=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(),r=Function.prototype,i=r.call,s=n&&r.bind.bind(i,i);t.exports=n?s:function(e){return function(){return i.apply(e,arguments)}}}),D=E(function(e,t){var n=O(),r=n({}.toString),i=n("".slice);t.exports=function(e){return i(r(e),8,-1)}}),q=E(function(e,t){var n=O(),r=I(),i=D(),s=Object,o=n("".split);t.exports=r(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===i(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(),r=TypeError;t.exports=function(e){if(n(e))throw new r("Can't call method on "+e);return e}}),H=E(function(e,t){var n=q(),r=N();t.exports=function(e){return n(r(e))}}),j=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}}),U=E(function(e,t){var n=j();t.exports=function(e){return"object"==typeof e?null!==e:n(e)}}),z=E(function(e,t){var n=F(),r=j();t.exports=function(e,t){return 2>arguments.length?r(i=n[e])?i:void 0:n[e]&&n[e][t];var i}}),V=E(function(e,t){t.exports=O()({}.isPrototypeOf)}),W=E(function(e,t){var n=F().navigator,r=n&&n.userAgent;t.exports=r?String(r):""}),G=E(function(e,t){var n,r,i=F(),s=W(),o=i.process,a=i.Deno,u=o&&o.versions||a&&a.version,l=u&&u.v8;l&&(r=(n=l.split("."))[0]>0&&4>n[0]?1:+(n[0]+n[1])),!r&&s&&((n=s.match(/Edge\/(\d+)/))&&74>n[1]||(n=s.match(/Chrome\/(\d+)/))&&(r=+n[1])),t.exports=r}),K=E(function(e,t){var n=G(),r=I(),i=F().String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol("symbol detection");return!i(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(),r=j(),i=V(),s=Q(),o=Object;t.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&i(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=j(),r=J(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not a function")}}),X=E(function(e,t){var n=Y(),r=B();t.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}}),ee=E(function(e,t){var n=M(),r=j(),i=U(),s=TypeError;t.exports=function(e,t){var o,a;if("string"===t&&r(o=e.toString)&&!i(a=n(o,e)))return a;if(r(o=e.valueOf)&&!i(a=n(o,e)))return a;if("string"!==t&&r(o=e.toString)&&!i(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(),r=Object.defineProperty;t.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}}),re=E(function(e,t){var n=te(),r=F(),i=ne(),s="__core-js_shared__",o=t.exports=r[s]||i(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"})}),ie=E(function(e,t){var n=re();t.exports=function(e,t){return n[e]||(n[e]=t||{})}}),se=E(function(e,t){var n=N(),r=Object;t.exports=function(e){return r(n(e))}}),oe=E(function(e,t){var n=O(),r=se(),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return i(r(e),t)}}),ae=E(function(e,t){var n=O(),r=0,i=Math.random(),s=n(1.1.toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+i,36)}}),ue=E(function(e,t){var n=F(),r=ie(),i=oe(),s=ae(),o=K(),a=Q(),u=n.Symbol,l=r("wks"),c=a?u.for||u:u&&u.withoutSetter||s;t.exports=function(e){return i(l,e)||(l[e]=o&&i(u,e)?u[e]:c("Symbol."+e)),l[e]}}),le=E(function(e,t){var n=M(),r=U(),i=Z(),s=X(),o=ee(),a=ue(),u=TypeError,l=a("toPrimitive");t.exports=function(e,t){if(!r(e)||i(e))return e;var a,c=s(e,l);if(c){if(void 0===t&&(t="default"),a=n(c,e,t),!r(a)||i(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(),r=Z();t.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}}),de=E(function(e,t){var n=F(),r=U(),i=n.document,s=r(i)&&r(i.createElement);t.exports=function(e){return s?i.createElement(e):{}}}),he=E(function(e,t){var n=T(),r=I(),i=de();t.exports=!n&&!r(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})}),fe=E(function(e){var t=T(),n=M(),r=L(),i=A(),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 i(!n(r.f,e,t),e[t])}}),pe=E(function(e,t){var n=T(),r=I();t.exports=n&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}),_e=E(function(e,t){var n=U(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not an object")}}),ve=E(function(e){var t=T(),n=he(),r=pe(),i=_e(),s=ce(),o=TypeError,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l="enumerable",c="configurable",d="writable";e.f=t?r?function(e,t,n){if(i(e),t=s(t),i(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var r=u(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:c in n?n[c]:r[c],enumerable:l in n?n[l]:r[l],writable:!1})}return a(e,t,n)}:a:function(e,t,r){if(i(e),t=s(t),i(r),n)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new o("Accessors not supported");return"value"in r&&(e[t]=r.value),e}}),ge=E(function(e,t){var n=T(),r=ve(),i=A();t.exports=n?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}}),me=E(function(e,t){var n=T(),r=oe(),i=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,o=r(i,"name");t.exports={EXISTS:o,PROPER:o&&"something"===function(){}.name,CONFIGURABLE:o&&(!n||n&&s(i,"name").configurable)}}),ye=E(function(e,t){var n=O(),r=j(),i=re(),s=n(Function.toString);r(i.inspectSource)||(i.inspectSource=function(e){return s(e)}),t.exports=i.inspectSource}),be=E(function(e,t){var n=F(),r=j(),i=n.WeakMap;t.exports=r(i)&&/native code/.test(String(i))}),we=E(function(e,t){var n=ie(),r=ae(),i=n("keys");t.exports=function(e){return i[e]||(i[e]=r(e))}}),Se=E(function(e,t){t.exports={}}),xe=E(function(e,t){var n,r,i,s=be(),o=F(),a=U(),u=ge(),l=oe(),c=re(),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},r=function(e){return _.get(e)||{}},i=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},r=function(e){return l(e,v)?e[v]:{}},i=function(e){return l(e,v)}}t.exports={set:n,get:r,has:i,enforce:function(e){return i(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var n;if(!a(t)||(n=r(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return n}}}}),ke=E(function(e,t){var n=O(),r=I(),i=j(),s=oe(),o=T(),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&&!r(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 r=c(e);return s(r,"source")||(r.source=v(m,"string"==typeof t?t:"")),e};Function.prototype.toString=y(function(){return i(this)&&d(this).source||u(this)},"toString")}),Ce=E(function(e,t){var n=j(),r=ve(),i=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)&&i(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:r.f(e,t,{value:o,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}}),Pe=E(function(e,t){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?r: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(),r=Math.max,i=Math.min;t.exports=function(e,t){var s=n(e);return 0>s?r(s+t,0):i(s,t)}}),Ie=E(function(e,t){var n=Ee(),r=Math.min;t.exports=function(e){var t=n(e);return t>0?r(t,9007199254740991):0}}),Te=E(function(e,t){var n=Ie();t.exports=function(e){return n(e.length)}}),Re=E(function(e,t){var n=H(),r=Fe(),i=Te(),s=function(e){return function(t,s,o){var a=n(t),u=i(a);if(0===u)return!e&&-1;var l,c=r(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)}}),Me=E(function(e,t){var n=O(),r=oe(),i=H(),s=Re().indexOf,o=Se(),a=n([].push);t.exports=function(e,t){var n,u=i(e),l=0,c=[];for(n in u)!r(o,n)&&r(u,n)&&a(c,n);for(;t.length>l;)r(u,n=t[l++])&&(~s(c,n)||a(c,n));return c}}),Le=E(function(e,t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),Ae=E(function(e){var t=Me(),n=Le().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,n)}}),Oe=E(function(e){e.f=Object.getOwnPropertySymbols}),De=E(function(e,t){var n=z(),r=O(),i=Ae(),s=Oe(),o=_e(),a=r([].concat);t.exports=n("Reflect","ownKeys")||function(e){var t=i.f(o(e)),n=s.f;return n?a(t,n(e)):t}}),$e=E(function(e,t){var n=oe(),r=De(),i=fe(),s=ve();t.exports=function(e,t,o){for(var a=r(t),u=s.f,l=i.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=I(),r=j(),i=/#|\.prototype\./,s=function(e,t){var i=a[o(e)];return i===l||i!==u&&(r(t)?n(t):!!t)},o=s.normalize=function(e){return String(e).replace(i,".").toLowerCase()},a=s.data={},u=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s}),Be=E(function(e,t){var n=F(),r=fe().f,i=ge(),s=Ce(),o=ne(),a=$e(),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=r(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)&&i(h,"sham",!0),s(l,c,h,e)}}}),Ne=E(function(e,t){t.exports=!I()(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),He=E(function(e,t){var n=oe(),r=j(),i=se(),s=we(),o=Ne(),a=s("IE_PROTO"),u=Object,l=u.prototype;t.exports=o?u.getPrototypeOf:function(e){var t=i(e);if(n(t,a))return t[a];var s=t.constructor;return r(s)&&t instanceof s?s.prototype:t instanceof u?l:null}}),je=E(function(e,t){var n=Me(),r=Le();t.exports=Object.keys||function(e){return n(e,r)}}),Ue=E(function(e,t){var n=T(),r=I(),i=O(),s=He(),o=je(),a=H(),u=i(L().f),l=i([].push),c=n&&r(function(){var e=Object.create(null);return e[2]=2,!u(e,2)}),d=function(e){return function(t){for(var r,i=a(t),d=o(i),h=c&&null===s(i),f=d.length,p=0,_=[];f>p;)r=d[p++],n&&!(h?r in i:u(i,r))||l(_,e?[r,i[r]]:i[r]);return _}};t.exports={entries:d(!0),values:d(!1)}}),ze=E(function(){var $=Be(),e=Ue().entries;$({target:"Object",stat:!0},{entries:function(t){return e(t)}})}),Ve=E(function(e,t){t.exports=F()}),We=E(function(e,t){ze(),t.exports=Ve().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=T(),n=pe(),r=ve(),i=_e(),s=H(),o=je();e.f=t&&!n?Object.defineProperties:function(e,t){i(e);for(var n,a=s(t),u=o(t),l=u.length,c=0;l>c;)r.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,r=_e(),i=Je(),s=Le(),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,r;v="undefined"!=typeof document?document.domain&&n?_(n):(t=u("iframe"),r="java"+d+":",t.style.display="none",a.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):_(n);for(var i=s.length;i--;)delete v[c][s[i]];return v()};o[h]=!0,t.exports=Object.create||function(e,t){var n;return null!==e?(f[c]=r(e),n=new f,f[c]=null,n[h]=e):n=v(),void 0===t?n:i.f(n,t)}}),et=E(function(e,t){var n=ue(),r=Xe(),i=ve().f,s=n("unscopables"),o=Array.prototype;void 0===o[s]&&i(o,s,{configurable:!0,value:r(null)}),t.exports=function(e){o[s][e]=!0}}),tt=E(function(e,t){t.exports={}}),nt=E(function(e,t){var n,r,i,s=I(),o=j(),a=U(),u=Xe(),l=He(),c=Ce(),d=ue(),h=te(),f=d("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(r=l(l(i)))!==Object.prototype&&(n=r):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}}),rt=E(function(e,t){var n=ve().f,r=oe(),i=ue()("toStringTag");t.exports=function(e,t,s){e&&!s&&(e=e.prototype),e&&!r(e,i)&&n(e,i,{configurable:!0,value:t})}}),it=E(function(e,t){var n=nt().IteratorPrototype,r=Xe(),i=A(),s=rt(),o=tt(),a=function(){return this};t.exports=function(e,t,u,l){var c=t+" Iterator";return e.prototype=r(n,{next:i(+!l,u)}),s(e,c,!1,!0),o[c]=a,e}}),st=E(function(e,t){var n=O(),r=Y();t.exports=function(e,t,i){try{return n(r(Object.getOwnPropertyDescriptor(e,t)[i]))}catch(e){}}}),ot=E(function(e,t){var n=U();t.exports=function(e){return n(e)||null===e}}),at=E(function(e,t){var n=ot(),r=String,i=TypeError;t.exports=function(e){if(n(e))return e;throw new i("Can't set "+r(e)+" as a prototype")}}),ut=E(function(e,t){var n=st(),r=U(),i=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 i(n),s(o),r(n)?(t?e(n,o):n.__proto__=o,n):n}}():void 0)}),lt=E(function(e,t){var $=Be(),n=M(),r=te(),i=me(),s=j(),o=it(),a=He(),u=ut(),l=rt(),c=ge(),d=Ce(),h=ue(),f=tt(),p=nt(),_=i.PROPER,v=i.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,i,h,p,k,C){o(i,t,h);var P,E,F,I=function(e){if(e===p&&A)return A;if(!m&&e&&e in M)return M[e];switch(e){case b:case w:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},T=t+" Iterator",R=!1,M=e.prototype,L=M[y]||M["@@iterator"]||p&&M[p],A=!m&&L||I(p),O="Array"===t&&M.entries||L;if(O&&(P=a(O.call(new e)))!==Object.prototype&&P.next&&(r||a(P)===g||(u?u(P,g):s(P[y])||d(P,y,x)),l(P,T,!0,!0),r&&(f[T]=x)),_&&p===w&&L&&L.name!==w&&(!r&&v?c(M,"name",w):(R=!0,A=function(){return n(L,this)})),p)if(E={values:I(w),keys:k?A:I(b),entries:I(S)},C)for(F in E)(m||R||!(F in M))&&d(M,F,E[F]);else $({target:t,proto:!0,forced:m||R},E);return r&&!C||M[y]===A||d(M,y,A,{name:p}),f[t]=A,E}}),ct=E(function(e,t){t.exports=function(e,t){return{value:e,done:t}}}),dt=E(function(e,t){var n=H(),r=et(),i=tt(),s=xe(),o=ve().f,a=lt(),u=ct(),l=te(),c=T(),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=i.Arguments=i.Array;if(r("keys"),r("values"),r("entries"),!l&&c&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(e){}}),ht=E(function(e,t){var n=D(),r=O();t.exports=function(e){if("Function"===n(e))return r(e)}}),ft=E(function(e,t){var n=ht(),r=Y(),i=R(),s=n(n.bind);t.exports=function(e,t){return r(e),void 0===t?e:i?s(e,t):function(){return e.apply(t,arguments)}}}),pt=E(function(e,t){var n=ue(),r=tt(),i=n("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(r.Array===e||s[i]===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(),r=j(),i=D(),s=ue()("toStringTag"),o=Object,a="Arguments"===i(function(){return arguments}());t.exports=n?i: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?i(t):"Object"===(u=i(t))&&r(t.callee)?"Arguments":u}}),gt=E(function(e,t){var n=vt(),r=X(),i=B(),s=tt(),o=ue()("iterator");t.exports=function(e){if(!i(e))return r(e,o)||r(e,"@@iterator")||s[n(e)]}}),mt=E(function(e,t){var n=M(),r=Y(),i=_e(),s=J(),o=gt(),a=TypeError;t.exports=function(e,t){var u=2>arguments.length?o(e):t;if(r(u))return i(n(u,e));throw new a(s(e)+" is not iterable")}}),yt=E(function(e,t){var n=M(),r=_e(),i=X();t.exports=function(e,t,s){var o,a;r(e);try{if(!(o=i(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 r(o),s}}),bt=E(function(e,t){var n=ft(),r=M(),i=_e(),s=J(),o=pt(),a=Te(),u=V(),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)},I=function(e){return x?(i(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=I(e[m]))&&u(p,b))return b;return new f(!1)}v=l(e,g)}for(w=k?e.next:v.next;!(S=r(w,v)).done;){var T=S.value;try{b=I(T)}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=T(),r=ve(),i=A();t.exports=function(e,t,s){n?r.f(e,t,i(0,s)):e[t]=s}}),St=E(function(){var $=Be(),e=bt(),t=wt();$({target:"Object",stat:!0},{fromEntries:function(n){var r={};return e(n,function(e,n){t(r,e,n)},{AS_ENTRIES:!0}),r}})}),xt=E(function(e,t){dt(),St(),t.exports=Ve().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,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r}),Pt=E(function(){var e=F(),t=kt(),n=Ct(),r=dt(),i=ge(),s=rt(),o=ue()("iterator"),a=r.values,u=function(e,n){if(e){if(e[o]!==a)try{i(e,o,a)}catch(t){e[o]=a}if(s(e,n,!0),t[n])for(var u in r)if(e[u]!==r[u])try{i(e,u,r[u])}catch(t){e[u]=r[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()}),It=E(function(e,t){t.exports=Ft()}),Tt=E(function(e,t){t.exports=It()}),Rt=E(function(e,t){var n=U(),r=ge();t.exports=function(e,t){n(t)&&"cause"in t&&r(e,"cause",t.cause)}}),Mt=E(function(e,t){var n=O(),r=Error,i=n("".replace),s=String(new r("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,a=o.test(s);t.exports=function(e,t){if(a&&"string"==typeof e&&!r.prepareStackTrace)for(;t--;)e=i(e,o,"");return e}}),Lt=E(function(e,t){var n=I(),r=A();t.exports=!n(function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",r(1,7)),7!==e.stack)})}),At=E(function(e,t){var n=ge(),r=Mt(),i=Lt(),s=Error.captureStackTrace;t.exports=function(e,t,o,a){i&&(s?s(e,t):n(e,"stack",r(o,a)))}}),Ot=E(function(e,t){var n=vt(),r=String;t.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return r(e)}}),Dt=E(function(e,t){var n=Ot();t.exports=function(e,t){return void 0===e?2>arguments.length?"":t:n(e)}}),$t=E(function(){var $=Be(),e=V(),t=He(),n=ut(),r=$e(),i=Xe(),s=ge(),o=A(),a=Rt(),u=At(),l=bt(),c=Dt(),d=ue()("toStringTag"),h=Error,f=[].push,p=function(r,o){var v,g=e(_,this);n?v=n(new h,g?t(this):_):(v=g?this:i(_),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(r,f,{that:m}),s(v,"errors",m),v};n?n(p,h):r(p,h,{name:!0});var _=p.prototype=i(h.prototype,{constructor:o(1,p),message:o(1,""),name:o(1,"AggregateError")});$({global:!0,constructor:!0,arity:2},{AggregateError:p})}),qt=E(function(){$t()}),Bt=E(function(e,t){var n=_t(),r=vt();t.exports=n?{}.toString:function(){return"[object "+r(this)+"]"}}),Nt=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(),r=W(),i=D(),s=function(e){return r.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"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"}),jt=E(function(e,t){t.exports="NODE"===Ht()}),Ut=E(function(e,t){var n=ke(),r=ve();t.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}}),zt=E(function(e,t){var n=z(),r=Ut(),i=ue(),s=T(),o=i("species");t.exports=function(e){var t=n(e);s&&t&&!t[o]&&r(t,o,{configurable:!0,get:function(){return this}})}}),Vt=E(function(e,t){var n=V(),r=TypeError;t.exports=function(e,t){if(n(t,e))return e;throw new r("Incorrect invocation")}}),Wt=E(function(e,t){var n=O(),r=I(),i=j(),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(!i(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},p=function(e){if(!i(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||r(function(){var e;return f(f.call)||!f(Object)||!f(function(){e=!0})||e})?p:f}),Gt=E(function(e,t){var n=Wt(),r=J(),i=TypeError;t.exports=function(e){if(n(e))return e;throw new i(r(e)+" is not a constructor")}}),Kt=E(function(e,t){var n=_e(),r=Gt(),i=B(),s=ue()("species");t.exports=function(e,t){var o,a=n(e).constructor;return void 0===a||i(o=n(a)[s])?t:r(o)}}),Qt=E(function(e,t){var n=R(),r=Function.prototype,i=r.apply,s=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(i):function(){return s.apply(i,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,r,i,s,o=F(),a=Qt(),u=ft(),l=j(),c=oe(),d=I(),h=Ye(),f=Zt(),p=de(),_=Jt(),v=Yt(),g=jt(),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 T=function(e){if(c(P,e)){var t=P[e];delete P[e],t()}},R=function(e){return function(){T(e)}},M=function(e){T(e.data)},L=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)},r(C),C},y=function(e){delete P[e]},g?r=function(e){b.nextTick(R(e))}:w&&w.now?r=function(e){w.now(R(e))}:x&&!v?(s=(i=new x).port2,i.port1.onmessage=M,r=u(s.postMessage,s)):o.addEventListener&&l(o.postMessage)&&!o.importScripts&&n&&"file:"!==n.protocol&&!d(L)?(r=L,o.addEventListener("message",M,!1)):r=E in p("script")?function(e){h.appendChild(p("script"))[E]=function(){h.removeChild(this),T(e)}}:function(e){setTimeout(R(e),0)}),t.exports={set:m,clear:y}}),en=E(function(e,t){var n=F(),r=T(),i=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!r)return n[e];var t=i(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,r,i,s,o,a=F(),u=en(),l=ft(),c=Xt().set,d=tn(),h=Yt(),f=nn(),p=rn(),_=jt(),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)}):(r=!0,i=g.createTextNode(""),new v(S).observe(i,{characterData:!0}),n=function(){i.data=r=!r}),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(),r=un(),i=j(),s=qe(),o=ye(),a=ue(),u=Ht(),l=te(),c=G(),d=r&&r.prototype,h=a("species"),f=!1,p=i(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:s("Promise",function(){var e=o(r),t=e!==String(r);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 r(function(e){e(1)}),i=function(e){e(function(){},function(){})};if((n.constructor={})[h]=i,!(f=n.then(function(){})instanceof i))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||p)}),REJECTION_EVENT:p,SUBCLASSING:f}}),cn=E(function(e,t){var n=Y(),r=TypeError,i=function(e){var t,i;this.promise=new e(function(e,n){if(void 0!==t||void 0!==i)throw new r("Bad Promise constructor");t=e,i=n}),this.resolve=n(t),this.reject=n(i)};t.exports.f=function(e){return new i(e)}}),dn=E(function(){var e,t,n,r,$=Be(),i=te(),s=jt(),o=F(),a=Ve(),u=M(),l=Ce(),c=ut(),d=rt(),h=zt(),f=Y(),p=j(),_=U(),v=Vt(),g=Kt(),m=Xt().set,y=sn(),b=on(),w=an(),S=tn(),x=xe(),k=un(),C=ln(),P=cn(),E="Promise",I=C.CONSTRUCTOR,T=C.REJECTION_EVENT,R=C.SUBCLASSING,L=x.getterFor(E),A=x.set,O=k&&k.prototype,D=k,q=O,B=o.TypeError,N=o.document,H=o.process,z=P.f,V=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,r,i,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(),i=!0)),n===e.promise?c(new B("Promise-chain cycle")):(r=K(n))?u(r,n,l,c):l(n)):c(s)}catch(e){d&&!i&&d.exit(),c(e)}},Z=function(e,t){e.notified||(e.notified=!0,y(function(){for(var n,r=e.reactions;n=r.get();)Q(n,e);e.notified=!1,t&&!e.rejection&&X(e)}))},J=function(e,t,n){var r,i;W?((r=N.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),o.dispatchEvent(r)):r={promise:t,reason:n},!T&&(i=o["on"+e])?i(r):e===G&&b("Unhandled promise rejection",n)},X=function(e){u(m,o,function(){var t,n=e.facade,r=e.value;if(ee(e)&&(t=w(function(){s?H.emit("unhandledRejection",r,n):J(G,n,r)}),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)})},re=function(e,t,n){return function(r){e(t,r,n)}},ie=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 r=K(t);r?y(function(){var n={done:!1};try{u(r,t,re(se,n,e),re(ie,n,e))}catch(t){ie(n,t,e)}}):(e.value=t,e.state=1,Z(e,!1))}catch(t){ie({done:!1},t,e)}}};if(I&&(D=function(t){v(this,q),f(t),u(e,this);var n=L(this);try{t(re(se,n),re(ie,n))}catch(e){ie(n,e)}},(e=function(e){A(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=L(this),r=z(g(this,D));return n.parent=!0,r.ok=!p(e)||e,r.fail=p(t)&&t,r.domain=s?H.domain:void 0,0===n.state?n.reactions.add(r):y(function(){Q(r,n)}),r.promise}),t=function(){var t=new e,n=L(t);this.promise=t,this.resolve=re(se,n),this.reject=re(ie,n)},P.f=z=function(e){return e===D||e===n?new t(e):V(e)},!i&&p(k)&&O!==Object.prototype)){r=O.then,R||l(O,"then",function(e,t){var n=this;return new D(function(e,t){u(r,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:I},{Promise:D}),n=a.Promise,d(D,E,!1,!0),h(E)}),hn=E(function(e,t){var n=ue()("iterator"),r=!1;try{var i=0,s={next:function(){return{done:!!i++}},return:function(){r=!0}};s[n]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}t.exports=function(e,t){try{if(!t&&!r)return!1}catch(e){return!1}var i=!1;try{var s={};s[n]=function(){return{next:function(){return{done:i=!0}}}},e(s)}catch(e){}return i}}),fn=E(function(e,t){var n=un(),r=hn();t.exports=ln().CONSTRUCTOR||!r(function(e){n.all(e).then(void 0,function(){})})}),pn=E(function(){var $=Be(),e=M(),t=Y(),n=cn(),r=an(),i=bt();$({target:"Promise",stat:!0,forced:fn()},{all:function(s){var o=this,a=n.f(o),u=a.resolve,l=a.reject,c=r(function(){var n=t(o.resolve),r=[],a=0,c=1;i(s,function(t){var i=a++,s=!1;c++,e(n,o,t).then(function(e){s||(s=!0,r[i]=e,--c||u(r))},l)}),--c||u(r)});return c.error&&l(c.value),a.promise}})}),_n=E(function(){var $=Be(),e=te(),t=ln().CONSTRUCTOR,n=un(),r=z(),i=j(),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&&i(n)){var a=r("Promise").prototype.catch;o.catch!==a&&s(o,"catch",a,{unsafe:!0})}}),vn=E(function(){var $=Be(),e=M(),t=Y(),n=cn(),r=an(),i=bt();$({target:"Promise",stat:!0,forced:fn()},{race:function(s){var o=this,a=n.f(o),u=a.reject,l=r(function(){var n=t(o.resolve);i(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(),r=U(),i=cn();t.exports=function(e,t){if(n(e),r(t)&&t.constructor===e)return t;var s=i.f(e);return(0,s.resolve)(t),s.promise}}),yn=E(function(){var $=Be(),e=z(),t=te(),n=un(),r=ln().CONSTRUCTOR,i=mn(),s=e("Promise"),o=t&&!r;$({target:"Promise",stat:!0,forced:t||r},{resolve:function(e){return i(o&&this===s?n:this,e)}})}),bn=E(function(){dn(),pn(),_n(),vn(),gn(),yn()}),wn=E(function(){var $=Be(),e=M(),t=Y(),n=cn(),r=an(),i=bt();$({target:"Promise",stat:!0,forced:fn()},{allSettled:function(s){var o=this,a=n.f(o),u=a.resolve,l=a.reject,c=r(function(){var n=t(o.resolve),r=[],a=0,l=1;i(s,function(t){var i=a++,s=!1;l++,e(n,o,t).then(function(e){s||(s=!0,r[i]={status:"fulfilled",value:e},--l||u(r))},function(e){s||(s=!0,r[i]={status:"rejected",reason:e},--l||u(r))})}),--l||u(r)});return c.error&&l(c.value),a.promise}})}),Sn=E(function(){var $=Be(),e=M(),t=Y(),n=z(),r=cn(),i=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=r.f(u),d=c.resolve,h=c.reject,f=i(function(){var n=t(u.resolve),r=[],i=0,c=1,f=!1;s(o,function(t){var s=i++,o=!1;c++,e(n,u,t).then(function(e){o||f||(f=!0,d(e))},function(e){o||f||(o=!0,r[s]=e,--c||h(new l(r,a)))})}),--c||h(new l(r,a))});return f.error&&h(f.value),c.promise}})}),xn=E(function(){var $=Be(),e=F(),t=Qt(),n=Zt(),r=cn(),i=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=r.f(this),u=s(function(){return t(i(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=I(),r=z(),i=j(),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,r("Promise")),n=i(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&&i(t)){var l=r("Promise").prototype.finally;u.finally!==l&&a(u,"finally",l,{unsafe:!0})}}),Pn=E(function(e,t){var n=O(),r=Ee(),i=Ot(),s=N(),o=n("".charAt),a=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,n){var l,c,d=i(s(t)),h=r(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(),r=lt(),i=ct(),s="String Iterator",o=n.set,a=n.getterFor(s);r(String,"String",function(e){o(this,{type:s,string:t(e),index:0})},function(){var t,n=a(this),r=n.string,s=n.index;return r.length>s?(t=e(r,s),n.index+=t.length,i(t,!1)):i(void 0,!0)})}),Fn=E(function(e,t){qt(),dt(),Nt(),bn(),wn(),Sn(),xn(),kn(),Cn(),En(),t.exports=Ve().Promise}),In=E(function(e,t){var n=Fn();Pt(),t.exports=n}),Tn=E(function(){xn()}),Rn=E(function(){kn()}),Mn=E(function(e,t){var n=In();Tn(),Rn(),t.exports=n}),Ln=E(function(){qt()}),An=E(function(){wn()}),On=E(function(){Sn()}),Dn=E(function(e,t){var n=Mn();Ln(),An(),On(),t.exports=n}),$n=E(function(e,t){t.exports=Dn()});Ze(),Tt(),$n();var qn,Bn,Nn,Hn,jn={},Un=[],zn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Vn=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 r,i,s,o={};for(s in t)"key"==s?r=t[s]:"ref"==s?i=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,r,i,null)}function Qn(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++p:i,__i:-1,__u:0};return null==i&&null!=d.vnode&&d.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,r=[],i=[],s=Wn({},t);s.__v=t.__v+1,d.vnode&&d.vnode(s),lr(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,null==n?$(t):n,!!(32&t.__u),i),s.__v=t.__v,s.__.__k[s.__i]=s,dr(r,s,i),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 er(e){(!e.__d&&(e.__d=!0)&&_.push(e)&&!tr.__r++||v!=d.debounceRendering)&&((v=d.debounceRendering)||g)(tr)}function tr(){try{for(var e,t=1;_.length;)_.length>t&&_.sort(m),e=_.shift(),t=_.length,Yn(e)}finally{_.length=tr.__r=0}}function nr(e,t,n,r,i,s,o,a,u,l,c){var d,h,f,p,_,v,g,m=r&&r.__k||Un,y=t.length;for(u=rr(n,t,m,u,y),d=0;y>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&m[f.__i]||jn,f.__i=d,v=lr(e,f,h,i,s,o,a,u,l,c),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&pr(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=ir(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 rr(e,t,n,r,i){var s,o,a,u,l,c=n.length,d=c,h=0;for(e.__k=new Array(i),s=0;i>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):Vn(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=sr(o,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(i>c?h--:c>i&&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==r&&(r=$(a)),_r(a,a));return r}function ir(e,t,n,r){var i,s;if("function"==typeof e.type){for(i=e.__k,s=0;i&&i.length>s;s++)i[s]&&(i[s].__=e,t=ir(i[s],t,n,r));return t}e.__e!=t&&(r&&(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 sr(e,t,n,r){var i,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(r>(c?1:0))for(i=n-1,s=n+1;i>=0||t.length>s;)if(null!=(l=t[o=0>i?s++:i--])&&!(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function or(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 ar(e,t,n,r,i){var s,o;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||or(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||or(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?r?n[w]=r[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"==i)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 ur(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(d.event?d.event(t):t)}}}function lr(e,t,n,r,i,s,o,a,u,l){var c,h,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=d.__b)&&c(t);e:if("function"==typeof P){h=o.length;try{if(y=t.props,b=P.prototype&&P.prototype.render,$=(c=P.contextType)&&r[c.__c],w=c?$?$.props.value:c.__:r,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=vr),$&&$.sub(f),f.state||(f.state={}),f.__n=r,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)}),Un.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=d.__r,x=0,b)f.state=f.__s,f.__d=!1,S&&S(t),c=f.render(f.props,f.state,f.context),Un.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&&(r=Wn(Wn({},r),f.getChildContext())),b&&!p&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(_,v)),k=null!=c&&c.type===Zn&&null==c.key?hr(c.props.children):c,a=nr(e,Vn(k)?k:[k],t,n,r,i,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=h,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]);cr(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),e.then||cr(t);d.__e(e,t,n)}}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=fr(n.__e,t,n,r,i,s,o,u,l);return(c=d.diffed)&&c(t),128&t.__u?void 0:a}function cr(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(cr))}function dr(e,t,n){for(var r=0;n.length>r;r++)pr(n[r],n[++r],n[++r]);d.__c&&d.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){d.__e(e,t.__v)}})}function hr(e){return"object"!=typeof e||null==e||e.__b>0?e:Vn(e)?e.map(hr):void 0!==e.constructor?null:Wn({},e)}function fr(e,t,n,r,i,s,o,a,u){var l,h,f,p,_,v,g,m=n.props||jn,y=t.props,b=t.type;if("svg"==b?i="http://www.w3.org/2000/svg":"math"==b?i="http://www.w3.org/1998/Math/MathML":i||(i="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(i,b,y.is&&y),a&&(d.__m&&d.__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||ar(e,l,null,_,i);for(l in y)_=y[l],"children"==l?p=_:"dangerouslySetInnerHTML"==l?h=_:"value"==l?v=_:"checked"==l?g=_:a&&"function"!=typeof _||m[l]===_||ar(e,l,_,m[l],i);if(h)a||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(f&&(e.innerHTML=""),nr("template"==t.type?e.content:e,Vn(p)?p:[p],t,n,r,"foreignObject"==b?"http://www.w3.org/1999/xhtml":i,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])&&ar(e,l,v,m[l],i),l="checked",null!=g&&g!=e[l]&&ar(e,l,g,m[l],i))}return e}function pr(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){d.__e(e,n)}}function _r(e,t,n){var r,i;if(d.unmount&&d.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||pr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){d.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;r.length>i;i++)r[i]&&_r(r[i],t,n||"function"!=typeof e.type);n||Gn(e.__e),e.__c=e.__=e.__e=void 0}function vr(e,t,n){return this.constructor(e,n)}function gr(e,t,n){var r,i,s,o;t==document&&(t=document.documentElement),d.__&&d.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,s=[],o=[],lr(t,e=(!r&&n||t).__k=Kn(Zn,null,[e]),i||jn,jn,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?c.call(t.childNodes):null,s,!r&&n?n:i?i.__e:t.firstChild,r,o),dr(s,e,o),e.props.children=null}c=Un.slice,d={__e:function(e,t,n,r){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},p=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),er(this))},Jn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),er(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},tr.__r=0,y=Math.random().toString(8),b="__d"+y,w="__a"+y,S=/(PointerCapture)$|Capture$/i,x=0,k=ur(!1),C=ur(!0),P=0;var mr=0,yr=[],br=d,wr=br.__b,Sr=br.__r,xr=br.diffed,kr=br.__c,Cr=br.unmount,Pr=br.__;function Er(e,t){br.__h&&br.__h(Bn,e,mr||t),mr=0;var n=Bn.__H||(Bn.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Fr(e){return mr=1,function(e,t){var n=Er(qn++,2);if(n.t=e,!n.__c&&(n.__=[Br(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=Bn,!Bn.__f)){var r=function(e,t,r){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)}}),i){var a=i.call(this,e,t,r);return s?a||o:a}return!s||o};Bn.__f=!0;var i=Bn.shouldComponentUpdate,s=Bn.componentWillUpdate;Bn.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}s&&s.call(this,e,t,n)},Bn.shouldComponentUpdate=r}return n.__N||n.__}(Br,e)}function Ir(e,t){var n=Er(qn++,3);!br.__s&&qr(n.__H,t)&&(n.__=e,n.u=t,Bn.__H.__h.push(n))}function Tr(e){return mr=5,Rr(function(){return{current:e}},[])}function Rr(e,t){var n=Er(qn++,7);return qr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Mr(e){var t,n=Bn.context[e.__c],r=Er(qn++,9);return r.c=e,n?(null!==(t=r.__)&&void 0!==t||(r.__=!0,n.sub(Bn)),n.props.value):e.__}function Lr(){for(var e;e=yr.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Dr),t.__h.some($r),t.__h=[]}catch(n){t.__h=[],br.__e(n,e.__v)}}}br.__b=function(e){Bn=null,wr&&wr(e)},br.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Pr&&Pr(e,t)},br.__r=function(e){Sr&&Sr(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&&Lr(),qn=0)),Nn=Bn},br.diffed=function(e){xr&&xr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==yr.push(t)&&Hn===br.requestAnimationFrame||((Hn=br.requestAnimationFrame)||Or)(Lr)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),Nn=Bn=null},br.__c=function(e,t){t.some(function(e){try{e.__h.some(Dr),e.__h=e.__h.filter(function(e){return!e.__||$r(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],br.__e(n,e.__v)}}),kr&&kr(e,t)},br.unmount=function(e){Cr&&Cr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Dr(e)}catch(e){t=e}}),n.__H=void 0,t&&br.__e(t,n.__v))};var Ar="function"==typeof requestAnimationFrame;function Or(e){var t,n=function(){clearTimeout(r),Ar&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ar&&(t=requestAnimationFrame(n))}function Dr(e){var t=Bn,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Bn=t}function $r(e){var t=Bn;e.__c=e.__(),Bn=t}function qr(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Br(e,t){return"function"==typeof t?t(e):t}var Nr="gzip-js",Hr="base64",jr="events",Ur="cancelEvents",zr="tab",Vr="left",Wr="center",Gr="right",Kr="next_to_trigger",Qr="popover",Zr="widget",Jr="external_survey",Yr="open",Xr="multiple_choice",ei="single_choice",ti="rating",ni="end",ri="always",ii="survey shown",si="survey dismissed",oi="survey sent",ai="$survey_id",ui="$survey_name",li="$survey_iteration",ci="$survey_iteration_start_date",di="$survey_language",hi="popover",fi=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.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),pi=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),_i="min_length",vi="max_length",gi=["$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"],mi=["token"];function yi(e,t){return-1!==e.indexOf(t)}var bi=function(e){return e.trim()},wi=function(e){return e.replace(/^\$/,"")};function Si(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 xi=Object.prototype,ki=xi.hasOwnProperty,Ci=xi.toString,Pi=Array.isArray||function(e){return"[object Array]"===Ci.call(e)},Ei=function(e){return"function"==typeof e},Fi=function(e){return e===Object(e)&&!Pi(e)},Ii=function(e){if(Fi(e)){for(var t in e)if(ki.call(e,t))return!1;return!0}return!1},Ti=function(e){return void 0===e},Ri=function(e){return"[object String]"==Ci.call(e)},Mi=function(e){return Ri(e)&&0===e.trim().length},Li=function(e){return null===e},Ai=function(e){return Ti(e)||Li(e)},Oi=function(e){return"[object Number]"==Ci.call(e)&&e==e},Di=function(e){return Oi(e)&&e>0},$i=function(e){return"[object Boolean]"===Ci.call(e)},qi=function(e){return yi(gi,e)},Bi=function(e){return yi(mi,e)};function Ni(e){return null===e||"object"!=typeof e}function Hi(e,t){return{}.toString.call(e)==="[object "+t+"]"}function ji(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 zi(e,Error)}}function Ui(e){return"u">typeof Event&&zi(e,Event)}function zi(e,t){try{return e instanceof t}catch(e){return!1}}var Vi=[!0,"true",1,"1","yes"],Wi=function(e){return yi(Vi,e)},Gi=[!1,"false",0,"0","no"],Ki=["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"],Qi=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var n=e.toLowerCase();return Ki.concat(t).some(function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)})};function Zi(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),Oi(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),Zi(null!=i?i:n,t,n,r))}var Ji=function(){"use strict";function e(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=Zi(e.bucketSize,0,100,e._logger),this._refillRate=Zi(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=Zi(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(),r=String(e),i=this._buckets[r];return i?this._applyRefill(i,n):this._buckets[r]=i={tokens:this._bucketSize,lastAccess:n},0===i.tokens||(i.tokens--,0===i.tokens&&(null==(t=this._onBucketRateLimited)||t.call(this,e)),0===i.tokens)},t.stop=function(){this._buckets={}},e}(),Yi="Mobile",Xi="Android",es="Tablet",ts="Android Tablet",ns="iPad",rs="Apple Watch",is="Safari",ss="BlackBerry",os="Samsung Internet",as="Chrome",us="Chrome iOS",ls="Internet Explorer",cs="Internet Explorer Mobile",ds="Opera",hs="Microsoft Edge",fs="Firefox",ps="Firefox iOS",_s="Nintendo",vs="PlayStation",gs="Xbox",ms="Android Mobile",ys="Mobile Safari",bs="Windows",ws="Windows Phone",Ss="Nokia",xs="Ouya",ks="Generic "+Yi.toLowerCase(),Cs="Generic "+es.toLowerCase(),Ps="Konqueror",Es="Oculus Browser",Fs="Vivaldi",Is="Yandex",Ts="Whale",Rs="DuckDuckGo",Ms="Pale Moon",Ls="Waterfox",As="Brave",Os="Claude",Ds="Codex",$s="ChatGPT",qs="Google Search App",Bs=new RegExp("Version/(\\d+(\\.\\d+)?)"),Ns=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Hs=new RegExp(gs,"i"),js=new RegExp("PlayStation \\w+","i"),Us=new RegExp("Nintendo \\w+","i"),zs=new RegExp("BlackBerry|PlayBook|BB10","i"),Vs={"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"},Ws=function(e,t,n,r){t=t||"";var i=function(e){return null!=e&&e.brave?As:null}(n);return i||(null!=r&&r.detectGoogleSearchApp&&yi(e,"GSA/")?qs:yi(e," OPR/")&&yi(e,"Mini")?"Opera Mini":yi(e," OPR/")?ds:zs.test(e)?ss:yi(e,"IEMobile")||yi(e,"WPDesktop")?cs:yi(e,"OculusBrowser")?Es:yi(e,"SamsungBrowser")?os:yi(e,"Edge")||yi(e,"Edg/")?hs:yi(e,"Vivaldi/")?Fs:yi(e,"YaBrowser/")?Is:yi(e,"Whale/")?Ts:yi(e,"DuckDuckGo/")||yi(e,"Ddg/")?Rs:yi(e,"Claude/")?Os:yi(e,"Codex/")?Ds:yi(e,"ChatGPT/")?$s:yi(e,"FBIOS")?"Facebook Mobile":yi(e,"UCWEB")||yi(e,"UCBrowser")?"UC Browser":yi(e,"CriOS")?us:yi(e,"CrMo")||yi(e,as)?as:yi(e,Xi)&&yi(e,is)?ms:yi(e,"FxiOS")?ps:yi(e.toLowerCase(),Ps.toLowerCase())?Ps:yi(e,"Brave/")?As:function(e,t){return t&&yi(t,"Apple")||function(e){return yi(e,is)&&!yi(e,as)&&!yi(e,Xi)}(e)}(e,t)?yi(e,Yi)?ys:is:yi(e,"PaleMoon/")?Ms:yi(e,"Waterfox/")?Ls:yi(e,fs)?fs:yi(e,"MSIE")||yi(e,"Trident/")?ls:yi(e,"Gecko")?fs:"")},Gs=((r={})[cs]=[new RegExp("rv:(\\d+(\\.\\d+)?)")],r[hs]=[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],r[as]=[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],r[us]=[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],r["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],r[is]=[Bs],r[ys]=[Bs],r[ds]=[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],r[fs]=[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],r[ps]=[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],r[Ps]=[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],r[ss]=[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Bs],r[ms]=[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],r[os]=[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],r[Es]=[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],r[Fs]=[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],r[Is]=[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],r[Ts]=[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],r[As]=[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],r[Os]=[Ns],r[Ds]=[Ns],r[$s]=[Ns],r[Rs]=[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],r[Ms]=[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],r[Ls]=[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],r[qs]=[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],r[ls]=[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],r.Mozilla=[new RegExp("rv:(\\d+(\\.\\d+)?)")],r),Ks=function(e,t,n,r){var i=Gs[Ws(e,t,n,r)];if(Ti(i))return null;for(var s=0;i.length>s;s++){var o=e.match(i[s]);if(o)return parseFloat(o[o.length-2])}return null},Qs=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),function(e){return[gs,e&&e[1]||""]}],[new RegExp(_s,"i"),[_s,""]],[new RegExp(vs,"i"),[vs,""]],[zs,[ss,""]],[new RegExp(bs,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[ws,""];if(new RegExp(Yi).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=Vs[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[bs,r]}return[bs,""]}],[/((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=Ti(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),function(e){return e&&e[2]?[Xi,[e[2],e[3],e[4]||"0"].join(".")]:[Xi,""]}],[/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",""]]],Zs=function(e){for(var t=0;Qs.length>t;t++){var n=Qs[t],r=n[1],i=n[0].exec(e),s=i&&(Ei(r)?r(i,e):r);if(s)return s}return["",""]},Js=function(e){return Us.test(e)?_s:js.test(e)?vs:Hs.test(e)?gs:new RegExp(xs,"i").test(e)?xs:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?ws:/iPad/.test(e)?ns:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?rs:zs.test(e)?ss:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ss,"i").test(e)?Ss:/(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(Yi).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Xi:ts:new RegExp("(pda|Mobile)","i").test(e)?ks:new RegExp(es,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?Cs:""},Ys=function(e,t){var n,r,i,s,o=Js(e);return o===ns||o===ts||"Kobo"===o||"Kindle Fire"===o||o===Cs?es:o===_s||o===gs||o===vs||o===xs?"Console":o===rs?"Wearable":o?Yi:"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!==(r=null==t?void 0:t.screenWidth)&&void 0!==r?r:0,null!==(i=null==t?void 0:t.screenHeight)&&void 0!==i?i:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?Yi:es:"Desktop"},Xs=/\bFBAV\/(\d+(?:\.\d+)*)/i,eo=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Xs],[/\bFBAN\/EMA\b/i,"Facebook Lite",Xs],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Xs],[/\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"]],to="[Truncated]",no="[Unserializable]";function ro(e){for(var t="",n=0;e.length>n;n++){var r=e.charCodeAt(n);if(55296>r||r>56319)t+=56320>r||r>57343?e[n]:"�";else{var i=e.charCodeAt(n+1);56320>i||i>57343?t+="�":(t+=e[n]+e[n+1],n++)}}return t}function io(e,t){if(!t)return e;var n=[];try{n=Object.keys(t)}catch(e){n=[]}for(var r,i=f(n);!(r=i()).done;){var s=r.value,o=void 0;try{o=t[s]}catch(e){o=no}Object.defineProperty(e,s,{value:o,enumerable:!0,writable:!0,configurable:!0})}return e}Date,Date;var so,oo,ao,uo=3e5,lo=function(){"use strict";function e(){this._until=0,this._installedAt=0}var t=e.prototype;return t.record=function(e){if("too-large"!==e.kind)if("retry-later"===e.kind){if(e.retryAfterMs){var t=this.isOpen(),n=Date.now(),r=Math.min(e.retryAfterMs,uo);if(!t)return this._installedAt=n,void(this._until=n+r);this._until=Math.max(this._until,Math.min(n+r,this._installedAt+uo))}}else this.reset()},t.remainingMs=function(){var e=Date.now();if(this._installedAt-5e3>e)return this.reset(),0;var t=Math.min(uo,Math.max(0,this._until-e));return 0===t&&this.reset(),t},t.isOpen=function(){return this.remainingMs()>0},t.reset=function(){this._until=0,this._installedAt=0},e}(),co=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ho(e,t){return"string"==typeof(n=e)&&co.test(n)?e:t();var n}function fo(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 po(e){return e?e.split("#")[0]:e}function _o(e){try{return e()}catch(e){return}}function vo(e,t){var n=setTimeout(e,t);return null!=n&&n.unref&&(null==n||n.unref()),n}function go(e,t,n){return mo.apply(this,arguments)}function mo(){return(mo=h(l().m(function e(t,n,r){var i;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){i=vo(function(){try{null==r||r(),e()}catch(e){t(e)}},n)})]);case 1:return e.a(2,e.v);case 2:return e.p=2,clearTimeout(i),e.f(2);case 3:return e.a(2)}},e,null,[[0,,2,3]])}))).apply(this,arguments)}function yo(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,r){so||(so={});var i=so[r];if(i)n[i[0]]=i[1];else for(var s=e(r),o=s.length-1;o>=0;o--){var a,u=null==(a=s[o])?void 0:a.filename,l=t[r];if(u&&l){n[u]=l,so[r]=[u,l];break}}return n},{}))}}var bo=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"},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),s=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(s,n),$exception_level:"error"}},t.modifyFrames=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:n=f(t);case 1:if((r=n()).done){e.n=4;break}if(!((i=r.value).stacktrace&&i.stacktrace.frames&&Pi(i.stacktrace.frames))){e.n=3;break}return e.n=2,this.applyModifiers(i.stacktrace.frames);case 2:i.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,r,i,s=this;if(null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack)try{i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch(e){}return u({},e,{cause:r,stack:i,errors:null==(n=e.errors)?void 0:n.map(function(e){return s.parseStacktrace(e,t)})})},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,r=f(this.coercers);!(n=r()).done;){var i=n.value;if(i.match(e))return i.coerce(e,t)}return this.coerceFallback(t)},t.applyModifiers=function(){var e=h(l().m(function e(t){var n,r,i,s;return l().w(function(e){for(;;)switch(e.n){case 0:n=t,r=f(this.modifiers);case 1:if((i=r()).done){e.n=4;break}return s=i.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=[],r=function(e,i,s){var o=n.length,a=void 0===i?u({type:"string"==typeof t.type&&t.type.length>0?t.type:"generic"},"boolean"==typeof t.handled?{handled:t.handled}:void 0===t.handled?{handled:!0}:{},{synthetic:"boolean"==typeof t.synthetic?t.synthetic:e.synthetic,exception_id:o}):{type:"chained",source:s,synthetic:e.synthetic,exception_id:o,parent_id:i},l={type:e.type,value:e.value,mechanism:a};e.stack&&(l.stacktrace={type:"raw",frames:e.stack}),n.push(l),e.cause&&r(e.cause,o,"cause");for(var c,d=f(null!==(h=e.errors)&&void 0!==h?h:[]);!(c=d()).done;){var h;r(c.value,o,"member")}};return r(e),n},t.buildParsingContext=function(e){var t;return{chunkIdMap:yo(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}},t.getAggregateErrors=function(e){try{if(ji(e))for(var t=Object.getPrototypeOf(e),n=0;t&&100>n;n++){var r,i=null==(r=Object.getOwnPropertyDescriptor(t,"constructor"))?void 0:r.value;if("function"==typeof i&&"AggregateError"===i.name){var s=e.errors;return Pi(s)?s:void 0}t=Object.getPrototypeOf(t)}}catch(e){}},t.buildCoercingContext=function(e,t,n){var r=this;void 0===n&&(n=0);var i=0,s=0,o=!1,a=new Set,l=[],c={},d=function(e,t,n){void 0===n&&(n=0);var d=h(t,n),f=d.apply;if(d.apply=function(t){l.push(e);try{return f(t)}finally{l.pop()}},n>4||n>0&&-1!==l.indexOf(e))return r.coerceFallback(d);var p="object"==typeof e&&null!==e||"function"==typeof e;if(!(0===n&&i>=50||p&&a.has(e))){p&&a.add(e),0===n&&i++;var _,v,g=r.getAggregateErrors(e);o||(o=!!g);try{if(!(_=r.applyCoercers(e,d)))throw c}catch(e){if(e===c)return void(0===n&&i--);if(!o)throw e;_=r.coerceFallback(d)}if(!g||i>=50)return _;try{v=g.length}catch(e){return _}if(!Number.isInteger(v)||0>v||v>4294967295)return _;for(var m=[],y=0;50>i&&1e3>s&&v>y;y++){s++;var b=void 0;try{b=d.next(g[y])}catch(e){i++,b=r.coerceFallback(h(t+1))}b&&m.push(b)}return u({},_,{errors:m})}},h=function(n,r){return void 0===r&&(r=0),u({},t,{syntheticException:0==n?t.syntheticException:void 0,mechanism:0==n?e:{},apply:function(e){var t=d(e,n,r+1);if(!t)throw c;return t},next:function(e){return d(e,n+1)}})},f=h(n);return u({},f,{apply:function(e){var t;return null!==(t=d(e,n))&&void 0!==t?t:r.coerceFallback(f)}})},e}(),wo=/^([a-z][a-z0-9.+-]+):/i,So=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function xo(e){if(!e||"<anonymous>"===e)return!1;var t=wo.exec(e);return!t||So.includes(t[1].toLowerCase())}function ko(e,t,n,r,i){var s={platform:e,filename:t,function:"<anonymous>"===n?"?":n,in_app:xo(t)};return Ti(r)||(s.lineno=r),Ti(i)||(s.colno=i),s}var Co=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Po=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Eo=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Fo=/\((\S*)(?::(\d+))(?::(\d+))\)/,Io=function(e,t){var n=Po.exec(e);if(n)return ko(t,n[1],"?",+n[2],+n[3]);var r=Eo.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var i=Fo.exec(r[2]);i&&(r[2]=i[1],r[3]=i[2],r[4]=i[3])}var s=Co(r[1]||"?",r[2]);return ko(t,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},To=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ro=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mo=function(e,t){var n=To.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Ro.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||"?",o=Co(s,i);return ko(t,i=o[1],s=o[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Lo=/\(error: (.*)\)/;function Ao(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function Oo(e){for(var t=1;10>=t;t++){var n=e.length-2*t;if(0>n)break;for(var r=!0,i=0;t>i;i++)if(!Ao(e[n+i],e[n+t+i])){r=!1;break}if(r){for(var s=0;t>s;s++)e[n+s]=e[n+t+s];return e.length=n+t,{start:n,length:t}}}}function Do(e,t){var n=t.start+t.length,r=qo(e,t);r&&e.splice(n+r===e.length?n:t.start,r)}function $o(e,t){for(var n=t.start;n>0&&Ao(e[n-1],e[n-1+t.length]);)n--;return t.start-n}function qo(e,t){for(var n=t.start+t.length,r=n;e.length>r&&Ao(e[r],e[r-t.length]);)r++;return r-n}function Bo(e,t){for(var n,r=t[0],i=e.length-(r?$o(e,r):0),s=f(t);!(n=s()).done;)i-=qo(e,n.value);return i}function No(e,t,n){for(var r=0;e.length>r;r++){var i=e[(t+r)%e.length],s=e[(n+r)%e.length];if(i!==s)return s>i}return!1}var Ho=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=Ri(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 Hi(e,"DOMException")},t.isDOMError=function(e){return Hi(e,"DOMError")},e}(),jo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return ji(e)},t.coerce=function(e,t){var n,r=this.getStack(e),i=void 0===r?null==(n=t.syntheticException)?void 0:n.stack:void 0,s=!!i;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=r?r:i,cause:e.cause?t.next(e.cause):void 0,synthetic:s}},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){try{var t=e.stacktrace;if("string"==typeof t&&t.length>0)return t;var n=e.stack;return"string"==typeof n&&n.length>0?n:void 0}catch(e){return}},e}(),Uo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return!!Hi(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 r=t.apply(e.message);return u({},r,{stack:null!==(n=this._buildLocationStack(e))&&void 0!==n?n:r.stack,synthetic:!0})},t._hasUsableMessage=function(e){return Ri(e.message)&&e.message.length>0},t._buildLocationStack=function(e){var t,n,r=e,i=null!==(t=r.lineno)&&void 0!==t?t:0,s=null!==(n=r.colno)&&void 0!==n?n:0;if(Ri(r.filename)&&0!==r.filename.length&&0!==i)return"Error\n at "+r.filename+":"+i+":"+s},e}(),zo=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Vo=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,r=this.getInfos(e),i=r[0],s=r[1];return{type:null!=i?i:"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,r=e.match(zo);return r&&(t=r[1],n=r[2]),[t,n]},e}(),Wo=["fatal","error","warning","log","info","debug"];function Go(e,t){void 0===t&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+"...":i}return""}var Ko=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,r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null!==(n=this.getStack(e))&&void 0!==n?n:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}},t.getType=function(e){if(Ui(e))return e.constructor.name;var t="name"in e?e.name:void 0;return Ri(t)&&!Mi(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: "+Go(e)},t.isSeverityLevel=function(e){return Ri(e)&&!Mi(e)&&Wo.indexOf(e)>=0},t.getStack=function(e){try{return Ri(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:Ri(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(ji(n))return n}},t.getObjectClassName=function(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}},e}(),Qo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Ui(e)},t.coerce=function(e,t){var n,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Go(e),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}},e}(),Zo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Ni(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}(),Jo=function(){"use strict";function e(){}var t=e.prototype;return t.match=function(e){return Hi(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)},t.isCustomEventWrappingRejection=function(e){if(!Ui(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,r=this.getUnhandledRejectionReason(e);return Ni(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(n=t.syntheticException)?void 0:n.stack,synthetic:!0}:t.apply(r)},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}(),Yo="$message",Xo="$timestamp",ea=new Set([Yo,Xo]),ta={enabled:!0,max_bytes:32768};function na(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:ta.enabled,max_bytes:ia(e.max_bytes,ta.max_bytes)}:u({},ta)}var ra=function(){"use strict";function e(e){this._entries=[],this._totalBytes=0,this._config=na(e)}var t=e.prototype;return t.setConfig=function(e){this._config=na(e),this._trimToMaxBytes()},t.add=function(e){var t=function(e){var t;try{t=Si(e)}catch(e){return}try{var n=JSON.parse(t);if(!Fi(n))return;var r=n,i=r[Yo],s=r[Xo];if(!Ri(i)||0===i.trim().length)return;if(!Ri(s)&&!Oi(s))return;return{step:r,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,r=0;t.length>r;r++)"%"===t[r]?(n+=1,r+=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 ia(e,t){if(!Oi(e)||1/0===e||-1/0===e)return t;var n=Math.floor(e);return 0>n?t:n}var sa=function(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function oa(e){return"string"==typeof e||e}function aa(e){return"string"==typeof e?e:void 0}var ua,la=["$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"]),ca="NativeGzipValidationError",da=function(e){return e.length>=2&&31===e[0]&&139===e[1]},ha=function(e,t){return e===pi.GZipJS||t===pi.GZipJS||"gzip"===t},fa=function(e){return!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"")},pa=function(e){for(var t=function(){if(ua)return ua;ua=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;ua[e]=t>>>0}return ua}(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0},_a=function(e){throw fo(ca,"Native gzip produced invalid output: "+e)},va=function(){var e=h(l().m(function e(t,n){var r,i,s,o,a;return l().w(function(e){for(;;)switch(e.n){case 0:return 18>t.size&&_a("too-short"),o=Uint8Array,e.n=1,t.slice(0,10).arrayBuffer();case 1:return r=new o(e.v),da(r)&&8===r[2]||_a("invalid-header"),a=DataView,e.n=2,t.slice(t.size-8).arrayBuffer();case 2:(i=new a(e.v)).getUint32(0,!0)!==pa(n)&&_a("invalid-crc"),s=n.length>>>0,i.getUint32(4,!0)!==s&&_a("invalid-size");case 3:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}();function ga(e,t,n){return ma.apply(this,arguments)}function ma(){return ma=h(l().m(function e(t,n,r){var i,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,i=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(i).then(function(){return o.close()}).catch(function(){var e=h(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,va(c,i);case 3:return e.a(2,c);case 4:if(e.p=4,d=e.v,null==r||!r.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]])})),ma.apply(this,arguments)}var ya={}.propertyIsEnumerable;function ba(e,t){try{return xa(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function wa(e,t,n,r){if(0>=n.remainingNodes)return{stringValue:to};if(n.remainingNodes--,$i(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){var n=e.toString(),r=BigInt("9223372036854775808");return e>=r||-r>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 i=BigInt(e).toString();return e>=0x8000000000000000||-0x8000000000000000>e?(null==t||t.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}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(r>=20)return{stringValue:to};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 wa(a.call(e),t,n,r+1)}catch(e){}return Pi(e)?{arrayValue:{values:Sa(e,t,n,r+1)}}:{kvlistValue:{values:xa(e,t,n,r+1)}}}finally{n.ancestors.delete(e)}}return{stringValue:ro(String(e))}}function Sa(e,t,n,r){for(var i=[],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(Ai(a))continue;i.push(wa(a,t,n,r))}catch(e){i.push({stringValue:no})}return e.length>o&&i.push({stringValue:to}),i}function xa(e,t,n,r){var i=[];for(var s in e)if(ya.call(e,s)){if(!s){null==t||t.debug("Dropping an attribute with an empty key");continue}if(i.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(Li(o)||Ti(o))continue;i.push({key:ro(s),value:wa(o,t,n,r)})}catch(e){i.push({key:ro(s),value:{stringValue:no}})}}return i}function ka(e,t,n){return u({},io({},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=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Pa(e,t){for(var n=io({},e),r={},i=0,s=Ca;s.length>i;i++){var o=s[i];({}).hasOwnProperty.call(n,o)&&(r[o]=n[o],delete n[o])}return[].concat(ba(n,t),ba(r,t))}var Ea={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","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}},Ia=Fa.info;function Ta(e){try{return ro(String(e))}catch(e){return no}}function Ra(e,t,n,r){var i,s=Fa[e.level||"info"]||Ia,o=s.text,a=s.number,l=(void 0===(i=Oi(r)?r:void 0)&&(i=Date.now()),String(i)+"000000"),c={};t.distinctId&&(c.posthogDistinctId=t.distinctId),t.sessionId&&(c.sessionId=t.sessionId),t.windowId&&(c["window.id"]=t.windowId),Ai(t.sessionStartTimestamp)||(c.sessionStartTimestamp=String(t.sessionStartTimestamp)),Ai(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 d=u({},c),h=e.attributes;if(h){var p=[];try{p=Object.keys(h)}catch(e){p=[]}for(var _,v=f(p);!(_=v()).done;){var g=_.value,m=void 0;try{m=h[g]}catch(e){m=no}Object.defineProperty(d,g,{value:m,enumerable:!0,writable:!0,configurable:!0})}}var y={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:a,severityText:o,body:{stringValue:Ta(e.body)},attributes:ba(d,n)};return e.trace_id&&(y.traceId=e.trace_id),e.span_id&&(y.spanId=e.span_id),Ti(e.trace_flags)||(y.flags=e.trace_flags),y}function Ma(e,t,n){return ka(e,t,n)}function La(e,t,n,r){return{resourceLogs:[{resource:{attributes:Pa(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}var Aa=function(){"use strict";function e(e){this._onFire=e,this._firesAt=0}var t=e.prototype;return t.arm=function(e){var t=this;this.clear(),this._firesAt=Date.now()+e,this._timer=vo(function(){t._timer=void 0,t._onFire()},e)},t.armNoEarlierThan=function(e){this._timer&&Date.now()+e<=this._firesAt||this.arm(e)},t.clear=function(){this._timer&&(clearTimeout(this._timer),this._timer=void 0)},o(e,[{key:"pending",get:function(){return!!this._timer}}])}();function Oa(){return.75+.5*Math.random()}function Da(e,t,n,r){var i=e*Math.pow(2,Math.min(Math.max(0,t-1),6));return Math.round((void 0===r?i:Math.min(i,Math.max(r,e)))*n)}var $a=function(){"use strict";function e(e,t,n,r,i,s,o){var a,u=this;void 0===s&&(s=function(){return Promise.resolve()}),this._instance=e,this._config=t,this._logger=n,this._getContext=r,this._onReady=i,this._waitForStoragePersist=s,this._scopeName=o,this._flushTimer=new Aa(function(){return u._flushInBackground()}),this._flushPromise=null,this._evictedSinceAdvance=0,this._queueGeneration=0,this._retryAfter=new lo,this._consecutiveFlushFailures=0,this._flushJitter=1,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(fi.LogsQueue,[])},t.reset=function(){this._flushTimer.clear(),this._intervalWindowStart=0,this._intervalLogCount=0,this._droppedWarned=!1,this._consecutiveFlushFailures=0,this._flushJitter=1,this._retryAfter.reset(),this._maxBatchRecordsPerPost=this._config.maxBatchRecordsPerPost},t.onReconnect=function(){this._consecutiveFlushFailures=0,this._flushJitter=1,this._retryAfter.isOpen()?this._hasQueuedRecords()&&this._armFlushTimer():this._flushInBackground()},t.captureLog=function(e,t){var n,r=this;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var i=this._runBeforeSend(e);if(null!==i)if(i.body){if(this._checkRateLimit()){var s={record:Ra(i,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 r._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,r=e,i=f(Pi(t)?t:[t]);!(n=i()).done;){var s=n.value;try{var o=s(r);if(!o)return this._logger.info("Log was rejected in beforeSend function"),null;r=o}catch(e){return this._logger.error("Error in beforeSend function for log:",e),null}}return r},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=h(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=h(l().m(function e(){var t,n,r,i,s,o,a,u,c,d,h,f;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),0!==(n=null!==(t=this._instance.getPersistedProperty(fi.LogsQueue))&&void 0!==t?t:[]).length){e.n=1;break}return e.a(2);case 1:r=n.length,i=0;case 2:if(0>=n.length||i>=r){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=La(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("Logs batch of size "+c.length+" was too large for the ingestion endpoint, reducing batch size to "+this._maxBatchRecordsPerPost),e.a(3,2);case 5:if(this._retryAfter.record(f),this._flushTimer.pending&&this._flushTimer.arm(Math.max(this._flushIntervalMs,this._retryAfter.remainingMs())),"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 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(fi.LogsQueue))&&void 0!==o?o:[],i+=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=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:return r=Math.max(0,t-this._evictedSinceAdvance),i=null!==(n=this._instance.getPersistedProperty(fi.LogsQueue))&&void 0!==n?n:[],this._instance.setPersistedProperty(fi.LogsQueue,i.slice(r)),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 Ma(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(fi.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(fi.LogsQueue,n),this._maxBufferSize>n.length||this._retryAfter.isOpen()?this._armFlushTimer():this._flushInBackground()}},t._armFlushTimer=function(){this._flushTimer.pending||this._flushTimer.arm(Math.max(this._flushIntervalMs,this._retryAfter.remainingMs()))},t._nextFlushDelay=function(){return Math.max(Da(this._flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())},t._hasQueuedRecords=function(){var e=this._instance.getPersistedProperty(fi.LogsQueue);return!!e&&e.length>0},t.shutdown=function(){var e=h(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),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,go(n,t);case 3:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}(),t.flushWithTimeout=function(){var e=h(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,go(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,e._flushJitter=1},function(t){e._consecutiveFlushFailures++,e._flushJitter=Oa(),e._logger.error("PostHog logs flush failed:",t)}).finally(function(){!e._instance.isDisabled&&e._hasQueuedRecords()&&e._flushTimer.armNoEarlierThan(e._nextFlushDelay())})},e}(),qa=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Ba(e){return String(e)+"000000"}function Na(e,t,n,r){var i="";return r&&(i=Object.keys(r).sort().map(function(e){return JSON.stringify(e)+":"+JSON.stringify(r[e])}).join(",")),e+"\0"+t+"\0"+(null!=n?n:"")+"\0"+i}var Ha=function(){"use strict";function e(e,t,n){var r=this;this._instance=e,this._config=t,this._logger=n,this._series=new Map,this._flushTimer=new Aa(function(){return r.flush().catch(function(e){r._logger.error("Metrics flush failed:",e)})}),this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._retryAfter=new lo,this._consecutiveFlushFailures=0,this._flushJitter=1,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=h(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._retryAfter.reset(),this._consecutiveFlushFailures=0,this._flushJitter=1,this._flushTimer.clear(),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,r;try{n=t.attributes?u({},t.attributes):void 0,r=Na(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 i=this._series.get(r);if(!i){if(!this._admitNewSeries())return;i={name:t.name,type:t.type,unit:t.unit,attributes:n,windowStartMs:Date.now()},this._series.set(r,i)}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(i,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(qa.length+1).fill(0)});var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(e,t){for(var n=0;t.length>n;n++)if(t[n]>=e)return n;return t.length}(t,qa)]+=1}},t._runBeforeSend=function(e){var t=this._config.beforeSend;if(!t)return e;for(var n,r=e,i=f(Pi(t)?t:[t]);!(n=i()).done;){var s=n.value;try{var o=s(r);if(!o)return this._logger.info("Metric was rejected in beforeSend function"),null;r=o}catch(e){return this._logger.error("Error in beforeSend function for metric:",e),null}}return r},t._armFlushTimer=function(){this._flushTimer.pending||this._flushTimer.arm(this._nextFlushDelay())},t._nextFlushDelay=function(){return Math.max(Da(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())},t._doFlush=function(){var e=h(l().m(function e(){var t,n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:if(this._flushTimer.clear(),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(r=e.v,n===this._generation){e.n=3;break}return e.a(2);case 3:this._retryAfter.record(r),"retry-later"===r.kind?(this._consecutiveFlushFailures++,this._flushJitter=Oa()):(this._consecutiveFlushFailures=0,this._flushJitter=1),this._flushTimer.pending&&this._flushTimer.arm(this._nextFlushDelay()),e.n="ok"===(i=r.kind)?4:"retry-later"===i?5:"too-large"===i?6:"fatal"===i?7:8;break;case 4:case 8:return e.a(2);case 5:return this._mergeWindowBack(t),this._flushTimer.armNoEarlierThan(this._nextFlushDelay()),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:",r.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 ka(e,t,n)}(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Pa(n)},scopeMetrics:[{scope:{name:r,version:i},metrics:t}]}]};var t,n,r,i},t._buildMetrics=function(e){for(var t,n=Ba(Date.now()),r=new Map,i=f(e.values());!(t=i()).done;){var s,o=t.value,a=Na(o.type,o.name,o.unit,void 0),l=r.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:[]},r.set(a,l));var c=ba(null!==(s=o.attributes)&&void 0!==s?s:{},this._logger),d=Ba(o.windowStartMs);if("count"===o.type){var h,p={attributes:c,startTimeUnixNano:d,timeUnixNano:n,asDouble:null!==(h=o.total)&&void 0!==h?h: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:d,timeUnixNano:n,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:qa})}return Array.from(r.values())},t._mergeWindowBack=function(e){for(var t,n,r,i=f(e);!(r=i()).done;){var s=r.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 ja(e,t){var n;if(e)return null==(n=e.find(function(e){return e.type===t}))?void 0:n.value}function Ua(e){var t=!0;return{dispose:function(){if(t){t=!1;var n=e();n&&Ei(n.then)&&n.then(void 0,function(){})}}}}var za="0.9.0",Va={DEBUG:!1,LIB_VERSION:za,LIB_NAME:"browser-common",JS_SDK_VERSION:za},Wa="u">typeof window?window:void 0,Ga="u">typeof globalThis?globalThis:Wa,Ka=null==Ga?void 0:Ga.navigator,Qa=null==Ga?void 0:Ga.document,Za=null==Ga?void 0:Ga.location,Ja=null==Ga?void 0:Ga.fetch,Ya=null!=Ga&&Ga.XMLHttpRequest&&"withCredentials"in new Ga.XMLHttpRequest?Ga.XMLHttpRequest:void 0,Xa=null==Ga?void 0:Ga.AbortController,eu=null==Ga?void 0:Ga.CompressionStream,tu=null==Ka?void 0:Ka.userAgent;function nu(){return!(!Wa||!1===Wa.navigator.onLine)}var ru=function(e,t){var n=(void 0===t?{}:t).debugEnabled,r={_log:function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;r>s;s++)i[s-1]=arguments[s];Wa&&(Va.DEBUG||Wa.POSTHOG_DEBUG||n)&&!Ti(Wa.console)&&Wa.console&&("__rrweb_original__"in Wa.console[t]?Wa.console[t].__rrweb_original__:Wa.console[t]).apply(void 0,[e].concat(i))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["debug"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];r._log.apply(r,["error"].concat(t))},critical:function(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];(t=console).error.apply(t,[e].concat(r))},uninitializedWarning:function(e){r.error("You must initialize PostHog before calling "+e)},createLogger:function(t,n){return ru(e+" "+t,n)}};return r},iu=ru("[PostHog.js]"),su=iu.createLogger;function ou(e,t){Pi(e)&&e.forEach(t)}function au(e,t){if(!Ai(e))if(Pi(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)ki.call(e,n)&&t(e[n],n)}var uu=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i=0,s=n;s.length>i;i++){var o=s[i];for(var a in o)void 0!==o[a]&&(e[a]=o[a])}return e};function lu(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var cu=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){iu.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),iu.critical(e)}}},du=function(e){var t={};return au(e,function(e,n){(Ri(e)&&e.length>0||Oi(e))&&(t[n]=e)}),t};function hu(e){for(var t=u({},e),n=0,r=["name","message","stack","cause","errors"];r.length>n;n++){var i=r[n];try{i in e&&(t[i]=e[i])}catch(e){}}return t}var fu=["herokuapp.com","vercel.app","netlify.app"];function pu(e){var t=null==e?void 0:e.hostname;if(!Ri(t))return!1;for(var n=t.split(".").slice(-2).join("."),r=0,i=fu;i.length>r;r++)if(n===i[r])return!1;return!0}function _u(e,t,n,r){var i=null!=r?r:{},s=i.capture,o=i.passive;null==e||e.addEventListener(t,n,{capture:void 0!==s&&s,passive:void 0===o||o})}function vu(e){return"ph_toolbar_internal"===e.name}function gu(e){return"$survey_response_"+e}function mu(e,t){if(!t)return null;var n=e[gu(t)];return Pi(n)?[].concat(n):n}function yu(e){var t,n=e.event,r=e.survey,i=e.responses,s=void 0===i?{}:i,o=e.submissionId,a=e.completed,l=e.surveyLanguage,c=e.questionSnapshots;return u({},!Ti(o)&&{$survey_submission_id:o},"sent"===n?!Ti(a)&&{$survey_completed:a}:{$survey_partially_completed:bu(s)},l&&((t={}).$survey_language=l,t),function(e,t,n){void 0===e&&(e={});var r={};return t.questions.forEach(function(t){if(!Ti(t.originalQuestionIndex)){var n,i=0===(n=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+n,s=mu(e,t.id);Ti(s)||(r[i]=s)}}),u({$survey_questions:t.questions.map(function(t){var r,i;return{id:t.id,question:null!==(r=null==n?void 0:n[null!==(i=t.id)&&void 0!==i?i:""])&&void 0!==r?r:t.question,response:mu(e,t.id)}})},e,r)}(s,r,c))}function bu(e){return void 0===e&&(e={}),Object.values(e).some(function(e){return!Ai(e)})}function wu(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 Su(e){return"string"==typeof e&&e.trim()?e.trim():null}function xu(e){return e.toLowerCase()}function ku(e,t,n){if(!e||!t)return null;var r=xu(t),i=Object.keys(e).find(function(e){return xu(e)===r});if(i)return null==n||n.debug("Found exact translation match: "+i),i;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(e).find(function(e){return xu(e)===s});if(o)return null==n||n.debug("Found base language translation match: "+o+" (from "+t+")"),o}return null}var Cu=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Pu(e,t,n){var r,i=ku(e.translations,t,n),s=u({},e),o=!1;if(i){var a,l=null==(a=e.translations)?void 0:a[i];if(l)if(null==n||n.info("Applying survey-level translation for language: "+i),Ti(l.name)||(s.name=l.name,o=!0),s.appearance){for(var c=u({},s.appearance),d=0,h=Cu;h.length>d;d++){var f=h[d],p=l[f];Ti(p)||(c[f]=p,o=!0)}s.appearance=c}else(function(e){return Cu.some(function(t){return!Ti(e[t])})})(l)&&(o=!0)}var _=e.questions.map(function(e){return function(e,t,n){var r,i=ku(e.translations,t,n);if(!i)return{question:e,matchedKey:null,hasChanges:!1};var s=null==(r=e.translations)?void 0:r[i];if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=u({},e),a=!1;return Ti(s.question)||(o.question=s.question,a=!0),Ti(s.description)||(o.description=s.description,a=!0),Ti(s.buttonText)||(o.buttonText=s.buttonText,a=!0),"link"in o&&!Ti(s.link)&&(o.link=s.link,a=!0),"lowerBoundLabel"in o&&!Ti(s.lowerBoundLabel)&&(o.lowerBoundLabel=s.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!Ti(s.upperBoundLabel)&&(o.upperBoundLabel=s.upperBoundLabel,a=!0),"choices"in o&&function(e){return Pi(e.choices)}(s)&&(o.choices=s.choices,a=!0),{question:a?o:e,matchedKey:a?i:null,hasChanges:a}}(e,t,n)}),v=_.map(function(e){return e.question}),g=_.some(function(e){return e.hasChanges}),m=null;return i||(m=(null==(r=_.find(function(e){return e.matchedKey}))?void 0:r.matchedKey)||null),g&&(s.questions=v,o=!0,null==n||n.info("Applied question-level translations for language: "+t)),{survey:s,matchedKey:o?i||m:null}}function Eu(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function Fu(e){var t;return Eu(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}var Iu=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}},Tu=function(e){return e.toLowerCase()},Ru={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 Iu(t,e)})})},not_regex:function(e,t){return t.every(function(t){return e.every(function(e){return!Iu(t,e)})})},icontains:function(e,t){return t.map(Tu).some(function(t){return e.map(Tu).some(function(e){return t.includes(e)})})},not_icontains:function(e,t){return t.map(Tu).every(function(t){return e.map(Tu).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 Mu(e,t){return!e||Object.entries(e).every(function(e){var n=e[1],r=null==t?void 0:t[e[0]];if(null==r)return!1;var i=Ru[n.operator];return!!i&&i(n.values.map(String),[String(r)])})}var Lu=function(e){for(var t=[].concat(e),n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),i=[t[r],t[n]];t[n]=i[0],t[r]=i[1]}return t},Au=su("[Surveys]"),Ou="PostHog is not capturing, so a survey response cannot be recorded";function Du(e){return Ei(e.is_capturing)?e.is_capturing():!e.has_opted_out_capturing()}function $u(e){return!(!e.start_date||e.end_date)}function qu(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var Bu=function(e,t){return""+e+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t)},Nu=function(e){return Bu("seenSurvey_",e)},Hu=function(e){try{var t=Nu(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Au.error("Failed to persist survey seen state",e)}},ju=[Qr,Zr,"api"],Uu={ignoreConditions:!1,ignoreDelay:!1,displayType:hi},zu="distinct_id",Vu="$device_id",Wu="$device_model",Gu="__alias",Ku="$fbc",Qu="$fbc_persistence",Zu="$fbp",Ju="$fbp_persistence",Yu="__timers",Xu="$autocapture_disabled_server_side",el="$heatmaps_enabled_server_side",tl="$exception_capture_enabled_server_side",nl="$error_tracking_suppression_rules",rl="$error_tracking_capture_extension_exceptions",il="$web_vitals_enabled_server_side",sl="$dead_clicks_enabled_server_side",ol="$product_tours_enabled_server_side",al="$logs_capture_enabled_server_side",ul="$web_vitals_allowed_metrics",ll="$session_recording_remote_config",cl="$replay_sample_rate",dl="$replay_override_sampling",hl="$replay_override_linked_flag",fl="$replay_override_url_trigger",pl="$replay_override_event_trigger",_l="$sesid",vl="$session_is_sampled",gl="$enabled_feature_flags",ml="$active_feature_flags",yl="$early_access_features",bl="$feature_flag_details",wl="$feature_flag_payloads",Sl="$feature_flag_request_id",xl="$minimal_flag_called_events",kl="$override_feature_flags",Cl="$override_feature_flag_payloads",Pl="$stored_person_properties",El="$stored_group_properties",Fl="$groups",Il="$surveys",Tl="$surveys_loaded_at",Rl="$surveys_activated",Ml="$surveys_activated_session",Ll="$surveys_activated_timestamps",Al="ph_product_tours",Ol="$flag_call_reported",Dl="$flag_call_reported_session_id",$l="$feature_flag_errors",ql="$feature_flag_evaluated_at",Bl="$user_state",Nl="$client_session_props",Hl="$capture_rate_limit",jl="$initial_campaign_params",Ul="$initial_referrer_info",zl="$initial_person_info",Vl="$epp",Wl="$posthog_cookieless",Gl="$cookieless_mode",Kl="$sdk_debug_extensions_init_method",Ql="$sdk_debug_extensions_init_time_ms",Zl="$sdk_debug_recording_script_not_loaded",Jl="$sdk_debug_replay_stale_config",Yl="PostHog loadExternalDependency extension not found.",Xl="anonymous",ec="identified",tc="identified_only",nc="visibilitychange",rc="beforeunload",ic="$pageview",sc="$pageleave",oc="$identify",ac="$groupidentify";Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Oi(e)&&isFinite(e)&&Math.floor(e)===e});var uc=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,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>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|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,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}(),lc=function(){"use strict";function e(){this._timestamp=0,this._counter=0,this._random=new hc}var t=e.prototype;return t.generate=function(){var e=this.generateOrAbort();if(!Ti(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(Ti(t))throw new Error("Could not generate UUID after timestamp reset");return t},t.generateOrAbort=function(){var e=function(){var e=Date.now();return Oi(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0}();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(this._timestamp>=e+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return uc.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}(),cc=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};Wa&&!Ti(Wa.crypto)&&crypto.getRandomValues&&(cc=function(e){return crypto.getRandomValues(e)});var dc,hc=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||(cc(this._buffer),this._cursor=0),this._buffer[this._cursor++]},e}(),fc=function(){return pc().toString()},pc=function(){return(dc||(dc=new lc)).generate()},_c=function(e,t){try{var n;return JSON.stringify(e,function(e,t){return ji(t)?(null!=n||(n=new WeakMap),n.has(t)||n.set(t,hu(t)),n.get(t)):"bigint"==typeof t?t.toString():t},t)}catch(t){return Si(e)}},vc=function(e){var t=null==Qa?void 0:Qa.createElement("a");return Ti(t)?null:(t.href=e,t)},gc=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var s=r[i].split("=");if(s[0]===t){n=s;break}}if(!Pi(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch(e){iu.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},mc=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],u=(o||"").split("&"),l=[],c=0;u.length>c;c++){var d=u[c].split("=");Pi(d)&&(t.includes(d[0])?l.push(d[0]+"="+n):l.push(u[c]))}var h=a;return null!=o&&(h+="?"+l.join("&")),null!=i&&(h+="#"+i),h},yc=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},bc=function(e,t){return e>=t&&nu()},wc=function(e,t,n,r){if(0===e){if(nu()){var i=t+1;return i===n&&r(),i}return t}return 0};function Sc(e,t,n){return _c({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}function xc(e,t){var n,r=null==e||null==(n=e.config)?void 0:n.get_current_url;if(!Ei(r))return t;try{var i=r(t);return Ri(i)&&i?i:t}catch(e){return iu.error("Error in get_current_url, falling back to window.location.href",e),t}}function kc(e){var t,n=null==Wa||null==(t=Wa.location)?void 0:t.href;return Ti(n)?void 0:xc(e,n)}var Cc=function(e){if(Qa){try{for(var t=e+"=",n=Qa.cookie.split(";").filter(function(e){return e.length}),r=0;n.length>r;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},Pc="",Ec=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Fc=null,Ic={_is_supported:function(){if(!Li(Fc))return Fc;if(Fc=!1,Qa)try{var e="__ph_cookie_support_"+fc();Ic._set(e,"xyz"),Fc='"xyz"'===Cc(e),Ic._remove(e)}catch(e){Fc=!1}return Fc},_error:function(e){iu.error("cookieStore error: "+e)},_get:Cc,_parse:function(e){var t;try{t=JSON.parse(Ic._get(e))||{}}catch(e){}return t},_set:function(e,t,n,r,i){if(!Qa)return!1;try{var s="",o="",a=function(e,t){if(t){var n=function(e,t){if(void 0===t&&(t=Qa),Pc)return Pc;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+fc();!Pc&&r--;){var s=n.slice(r).join("."),o=i+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(i)&&(t.cookie=o+";max-age=0",Pc=s)}return Pc}(e);if(!n){var r=function(e){var t=e.match(Ec);return t?t[0]:""}(e);r!==n&&iu.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}(Qa.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+864e5*n),s="; expires="+u.toUTCString()}i&&(o="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&iu.warn("cookieStore warning: large cookie, len="+l.length),Qa.cookie=l,!0}catch(e){return!1}},_remove:function(e,t){if(null!=Qa&&Qa.cookie&&(!t||!Li(Cc(e))))try{Ic._set(e,"",-1,t)}catch(e){return}}},Tc=null,Rc={_is_supported:function(){if(!Li(Tc))return Tc;var e=!0;if(Ti(Wa))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||iu.error("localStorage unsupported; falling back to cookie store"),Tc=e,e},_error:function(e){iu.error("localStorage error: "+e)},_get:function(e){try{return null==Wa?void 0:Wa.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==Wa||Wa.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Rc._error(e)}return!1},_remove:function(e){try{null==Wa||Wa.localStorage.removeItem(e)}catch(e){Rc._error(e)}}},Mc=[Pl,ml,gl,bl,wl,Sl,ql,$l,Ol],Lc=[Vu,zu,_l,vl,Vl,zl,Qu,Bl],Ac=function(e){return e+"_cpm"},Oc=["__proto__","constructor","prototype"],Dc=function(e){if(!Fi(e))return{};var t={};return Object.keys(e).forEach(function(n){-1===Oc.indexOf(n)&&(t[n]=e[n])}),t},$c=function(e,t){void 0===t&&(t=[]);var n={};return[].concat(Lc,t).forEach(function(t){var r=e[t];Ti(r)||Li(r)||""===r||(n[t]=r)}),n},qc=function(e){for(var t=5381,n=2166136261,r=0;e.length>r;r++){var i=e.charCodeAt(r);t=33*t^i,n=Math.imul(n^i,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(n>>>0).toString(36)},Bc=function(e,t){return{p:t,f:qc(JSON.stringify(e))}},Nc=function(e,t){if(!t)return{properties:[],isValid:!1};try{var n=Ic._parse(Ac(e)),r=(null==n?void 0:n.f)===qc(t)&&Pi(n.p);return{properties:r?n.p:[],isValid:r}}catch(e){return{properties:[],isValid:!1}}},Hc=function(e,t){return t+"|"+(Ic._get(Ac(e))||"")},jc={},Uc={_is_supported:function(){return!0},_error:function(e){iu.error("memoryStorage error: "+e)},_get:function(e){return e in jc?jc[e]:null},_parse:function(e){return e in jc?jc[e]:null},_set:function(e,t){return jc[e]=t,!0},_remove:function(e){delete jc[e]}},zc=null,Vc={_is_supported:function(){if(!Li(zc))return zc;if(zc=!0,Ti(Wa))zc=!1;else try{var e="__support__";Vc._set(e,"xyz"),'"xyz"'!==Vc._get(e)&&(zc=!1),Vc._remove(e)}catch(e){zc=!1}return zc},_error:function(e){iu.error("sessionStorage error: ",e)},_get:function(e){try{return null==Wa?void 0:Wa.sessionStorage.getItem(e)}catch(e){Vc._error(e)}return null},_parse:function(e){try{return JSON.parse(Vc._get(e))||null}catch(e){}return null},_set:function(e,t){try{return null==Wa||Wa.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Vc._error(e)}return!1},_remove:function(e){try{null==Wa||Wa.sessionStorage.removeItem(e)}catch(e){Vc._error(e)}}},Wc=su("[Stylesheet Loader]"),Gc=Wa,Kc=Qa,Qc="#020617",Zc={fontFamily:"inherit",backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:Gr,widgetType:zr,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:Qc,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Jc=[Wr,Vr,Gr];function Yc(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 Xc(e){var t;void 0===e&&(e=Zc.backgroundColor),"#"===e[0]&&(t=Yc(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=Yc(n)),!t)return Qc;var r=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(i*i*.299+s*s*.587+o*o*.114)>127.5?Qc:"white"}return Qc}var ed=function(e,t,n){var r=md(e),i=Kc.querySelector("."+r);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};var s=Kc.createElement("div");!function(e,t,n){var r=u({},Zc,n),i=e.style,s=!Jc.includes(r.position)||t===Zr&&(null==n?void 0:n.widgetType)===zr;i.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}(r.fontFamily)),i.setProperty("--ph-survey-box-padding",r.boxPadding),i.setProperty("--ph-survey-max-width",r.maxWidth),i.setProperty("--ph-survey-z-index",r.zIndex),i.setProperty("--ph-survey-border-color",r.borderColor),s?(i.setProperty("--ph-survey-border-radius",r.borderRadius),i.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(i.setProperty("--ph-survey-border-bottom","none"),i.setProperty("--ph-survey-border-radius",r.borderRadius+" "+r.borderRadius+" 0 0")),i.setProperty("--ph-survey-background-color",r.backgroundColor),i.setProperty("--ph-survey-box-shadow",r.boxShadow),i.setProperty("--ph-survey-disabled-button-opacity",r.disabledButtonOpacity),i.setProperty("--ph-survey-submit-button-color",r.submitButtonColor),i.setProperty("--ph-survey-submit-button-text-color",(null==n?void 0:n.submitButtonTextColor)||Xc(r.submitButtonColor)),i.setProperty("--ph-survey-rating-bg-color",r.ratingButtonColor),i.setProperty("--ph-survey-rating-active-bg-color",r.ratingButtonActiveColor),i.setProperty("--ph-survey-rating-active-text-color",Xc(r.ratingButtonActiveColor)),i.setProperty("--ph-survey-text-primary-color",(null==n?void 0:n.textColor)||Xc(r.backgroundColor)),i.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),i.setProperty("--ph-widget-color",r.widgetColor),i.setProperty("--ph-widget-text-color",Xc(r.widgetColor)),i.setProperty("--ph-widget-z-index",r.zIndex);var o=(null==n?void 0:n.inputBackground)||(null==n?void 0:n.inputBackgroundColor),a=o||r.inputBackground;o||"white"!==r.backgroundColor||(a="#f8f8f8"),i.setProperty("--ph-survey-input-background",a);var l=(null==n?void 0:n.inputTextColor)||Xc(a);i.setProperty("--ph-survey-input-text-color",l),i.setProperty("--ph-survey-rating-text-color",l),i.setProperty("--ph-survey-scrollbar-thumb-color",r.scrollbarThumbColor),i.setProperty("--ph-survey-scrollbar-track-color",r.scrollbarTrackColor),i.setProperty("--ph-survey-outline-color",r.outlineColor)}(s,e.type,e.appearance),s.className=r;var o=s.attachShadow({mode:"open"}),a=function(e){var t=function(e,t,n){var r=e.createElement("style");r.innerText=t;var i=function(e){var t;return Ei(e)?e:null==e||null==(t=e.config)?void 0:t.prepare_external_dependency_stylesheet}(n);return i&&(r=i(r)),r||(Wc.error("prepare_external_dependency_stylesheet returned null"),null)}(Kc,':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||Kc.body).appendChild(s),{shadow:o,isNewlyCreated:!0}},td=function(e){var t,n,r=e.responses,i=e.survey,s=e.surveySubmissionId,o=e.posthog,a=e.isSurveyCompleted,l=e.properties,c=e.surveyLanguage,d=e.questionSnapshots;o?Du(o)&&(Hu(i),o.capture(oi,u(((t={})[ui]=i.name,t[ai]=i.id,t[li]=i.current_iteration,t[ci]=i.current_iteration_start_date,t.sessionRecordingUrl=null==o.get_session_replay_url?void 0:o.get_session_replay_url(),t),yu({event:"sent",survey:i,responses:r,submissionId:s,completed:a,surveyLanguage:c,questionSnapshots:d}),l,{$set:(n={},n[wu(i,"responded")]=!0,n)})),a&&(Gc.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),gd(i),o.reloadFeatureFlags())):Au.error("[survey sent] event not captured, PostHog instance not found.")},nd=function(e,t,n,r){var i;return u(((i={})[ui]=t.name,i[ai]=t.id,i[li]=t.current_iteration,i[ci]=t.current_iteration_start_date,i.sessionRecordingUrl=null==r.get_session_replay_url?void 0:r.get_session_replay_url(),i),yu({event:e,survey:t,responses:null==n?void 0:n.responses,submissionId:null==n?void 0:n.surveySubmissionId,surveyLanguage:null==n?void 0:n.surveyLanguage,questionSnapshots:null==n?void 0:n.questionSnapshots}))},rd=function(e,t,n,r){var i,s;if(t){if(!n){var o=_d(e),a=o?o.surveyLanguage:r;t.capture(si,u({},nd("dismissed",e,o,t),a&&((i={})[di]=a,i),{$set:(s={},s[wu(e,"dismissed")]=!0,s)})),gd(e),Hu(e),Gc.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else Au.error("[survey dismissed] event not captured, PostHog instance not found.")},id=function(e,t){if(t){var n=function(e){return Bu("abandonedSurvey_",e)}(e);try{if("true"===localStorage.getItem(n))return}catch(e){return}var r=_d(e);if(r){try{localStorage.setItem(n,"true")}catch(e){}t.capture("survey abandoned",nd("abandoned",e,r,t),{transport:"sendBeacon"})}}else Au.error("[survey abandoned] event not captured, PostHog instance not found.")},sd=function(e){var t=e.map(function(e){return e.id});return t.every(function(e){return!!e})?t:void 0},od=function(e,t){var n,r,i;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,r=new Map(e.questions.map(function(e){return[e.id,e]})),i=[],s=f(t);!(n=s()).done;){var o=r.get(n.value);if(!o)return null;i.push(o)}return i}(e,t.questionOrder))&&void 0!==n?n:e.questions:e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?(r=e.questions,i=Lu(e.questions),r.length===i.length&&r.every(function(e,t){return e===i[t]})?i.reverse():i):e.questions},ad=function(e){return Fu(e)||vd(e)},ud=function(){function e(t){var n,r;return this.getChildContext||(n=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,er(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}(),ld=function(){return Mr(ud)},cd=function(e){var t=e.children,n=e.style;return function(e,t,n){var r,i,s,o,a=Wn({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?r=t[s]:"ref"==s?i=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,r||e.key,i||e.ref,null)}(e.component,e.renderAsHtml?{dangerouslySetInnerHTML:{__html:t},style:n}:{children:t,style:n})};function dd(e,t){var n,r;if(null==(n=e.conditions)||!n.url)return!0;var i,s=kc(t);return!!s&&Ru[i=null==(r=e.conditions)?void 0:r.urlMatchType,null!=i?i:"icontains"]([e.conditions.url],[s])}var hd=function(e){return Bu("inProgressSurvey_",e)},fd={},pd=function(e,t){var n=hd(e);try{localStorage.setItem(n,JSON.stringify(t)),delete fd[n]}catch(e){Au.error("Error setting in-progress survey state in localStorage",e),fd[n]=t}},_d=function(e){var t=hd(e),n=fd[t];if(n)return n;try{var r=localStorage.getItem(t);if(r)return JSON.parse(r)}catch(e){Au.error("Error getting in-progress survey state from localStorage",e)}return null},vd=function(e){var t=_d(e);return!Ai(null==t?void 0:t.surveySubmissionId)},gd=function(e){var t=hd(e);delete fd[t];try{localStorage.removeItem(t)}catch(e){Au.error("Error clearing in-progress survey state from localStorage",e)}};function md(e,t){void 0===t&&(t=!1);var n="PostHogSurvey-"+e.id;return t?"."+n:n}function yd(e,t,n){if(void 0===t&&(t=Gr),e===Jr)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 Vr:return{left:"30px"};case Wr:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Zr&&n===zr?"60px":"30px"}}}var bd=0;function wd(e,t,n,r,i,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:--bd,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return d.vnode&&d.vnode(l),l}var Sd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),xd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),kd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),Cd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),Pd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:wd("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"})}),Ed=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:wd("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"})}),Fd=wd("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:wd("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=wd("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[wd("g",{"clip-path":"url(#clip0_2415_6911)",children:[wd("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:wd("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),wd("g",{mask:"url(#mask0_2415_6911)",children:[wd("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"}),wd("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"}),wd("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"}),wd("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"}),wd("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"}),wd("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"})]})]}),wd("defs",{children:wd("clipPath",{id:"clip0_2415_6911",children:wd("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Td(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 wd("a",{href:"https://posthog.com/surveys"+(n?"?"+n:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Id]})}function Rd(e){var t=e.text,n=e.submitDisabled,r=e.appearance,i=e.onSubmit,s=e.link,o=e.onPreviewSubmit,a=e.skipSubmitButton,u=e.canGoBack,l=e.onBack,c=Mr(ud).isPreviewMode,d=!!u&&!!l,h=!a&&wd("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",onClick:function(){s&&(null==Wa||Wa.open(s)),c?null==o||o():i()},children:t});return wd("div",{className:"bottom-section",children:[d?wd("div",{className:"form-buttons form-buttons-with-back",children:[wd("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:l,children:r.backButtonText||"Back"}),h]}):h,!r.whiteLabel&&wd(Td,{urlParams:{utm_source:"survey-footer"}})]})}function Md(e){var t=e.question,n=e.forceDisableHtml;return wd("div",{class:t.question||t.description?"question-header":"question-header question-header--empty",children:[wd(t.type===Yr?"label":"h3",{className:"survey-question",htmlFor:e.htmlFor,children:t.question}),t.description&&cd({component:Kn("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!n&&"text"!==t.descriptionContentType})]})}function Ld(e){var t,n,r;return wd("button",{className:"form-cancel",onClick:e.onClick,disabled:Mr(ud).isPreviewMode,"aria-label":"Close survey",type:"button",children:(t={fill:"black"},n=(void 0===t?{}:t).fill,r=void 0===n?"currentColor":n,wd("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[wd("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),wd("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:r})]}))})}var Ad=Wa;function Od(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,s=e.appearance,o=e.onClose,a=Mr(ud).isPopup;return Ir(function(){var e=function(e){"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return _u(Ad,"keydown",e),function(){Ad.removeEventListener("keydown",e)}},[o]),wd("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&wd(Ld,{onClick:function(){return o()}}),wd("h3",{className:"thank-you-message-header",children:t}),n&&cd({component:Kn("p",{className:"thank-you-message-body"}),children:n,renderAsHtml:!i&&"text"!==r}),a&&wd(Rd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:function(){return o()}})]})}function Dd(e){var t=e.header,n=e.description,r=e.contentType,i=e.forceDisableHtml,s=e.appearance,o=e.onStart,a=Mr(ud),u=a.onPreviewSubmit,l=a.onPopupSurveyDismissed;return wd("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&wd(Ld,{onClick:function(){return l()}}),t&&wd("h3",{className:"intro-screen-header",children:t}),n&&cd({component:Kn("p",{className:"intro-screen-body"}),children:n,renderAsHtml:!i&&"text"!==r}),wd(Rd,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:function(){return u(null)}})]})}var $d=function(e){return Pi(e)&&e.every(function(e){return Ri(e)})};function qd(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,s=e.onPreviewSubmit,o=e.displayQuestionIndex,a=e.initialValue,u=e.canGoBack,l=e.onBack,c=ld().isPreviewMode,d=Tr(null),h=Fr(function(){return Ri(a)?a:""}),p=h[0],_=h[1],v=null==r?void 0:r.disableAutofocus;Ir(function(){v||setTimeout(function(){var e;c||null==(e=d.current)||e.focus()},100)},[c,v]);var g="surveyQuestion"+o,m=Rr(function(){return function(e,t,n){var r,i,s=e.trim();if(!n&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o,a=f(t);!(o=a()).done;){var u=o.value;switch(u.type){case _i:if(void 0!==u.value&&u.value>s.length)return null!==(r=u.errorMessage)&&void 0!==r?r:"Please enter at least "+u.value+" characters";break;case vi:if(void 0!==u.value&&s.length>u.value)return null!==(i=u.errorMessage)&&void 0!==i?i:"Please enter no more than "+u.value+" characters"}}return!1}(p,t.validation,t.optional)},[p,t.validation,t.optional]),y=ja(t.validation,_i),b=ja(t.validation,vi),w=Rr(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||i(p.trim())},x=function(){m||s(p.trim())};return wd(Zn,{children:[wd("div",{className:"question-container",children:[wd(Md,{question:t,forceDisableHtml:n,htmlFor:g}),wd("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.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&&wd("div",{className:"validation-hint",children:w})]}),wd(Rd,{text:t.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:S,onPreviewSubmit:x,canGoBack:u,onBack:l})]})}function Bd(e){var t=e.question,n=e.appearance,r=e.onSubmit,i=e.onPreviewSubmit,s=e.canGoBack,o=e.onBack;return wd(Zn,{children:[wd("div",{className:"question-container",children:wd(Md,{question:t,forceDisableHtml:e.forceDisableHtml})}),wd(Rd,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:function(){return r("link clicked")},onPreviewSubmit:function(){return i("link clicked")},canGoBack:s,onBack:o})]})}function Nd(e){var t,n=e.question,r=e.forceDisableHtml,i=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=Fr(function(){return Oi(u)?u:Pi(u)&&u.length>0&&Oi(parseInt(u[0]))?parseInt(u[0]):Ri(u)&&Oi(parseInt(u))?parseInt(u):null}),p=f[0],_=f[1],v="emoji"===n.display&&2===n.scale,g=ld().isPreviewMode,m=function(e){return g?a(e):o(e)};return wd(Zn,{children:[wd("div",{className:"question-container",children:[wd(Md,{question:n,forceDisableHtml:r}),wd("div",{className:"rating-section",children:[wd("div",{className:"rating-options",children:["emoji"===n.display&&wd("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Wd[n.scale])?void 0:t.map(function(e,t){return wd("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+i+"-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&&wd("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-h+1)+", minmax(0, 1fr))"},children:Gd(n.scale).map(function(e,t){return wd(Hd,{displayQuestionIndex:i,active:p===e,appearance:s,num:e,setActiveNumber:function(e){_(e),n.skipSubmitButton&&m(e)}},t)})})]}),!v&&wd("div",{className:"rating-text",children:[wd("div",{children:n.lowerBoundLabel}),wd("div",{children:n.upperBoundLabel})]})]})]}),wd(Rd,{text:n.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Li(p)&&!n.optional,appearance:s,onSubmit:function(){return o(p)},onPreviewSubmit:function(){return a(p)},skipSubmitButton:n.skipSubmitButton,canGoBack:l,onBack:c})]})}function Hd(e){var t=e.num,n=e.setActiveNumber;return wd("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 jd(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,s=e.onSubmit,o=e.onPreviewSubmit,a=e.initialValue,l=e.canGoBack,c=e.onBack,d=Tr(null),h=Rr(function(){return function(e){var t;if(!e.shuffleOptions)return e.choices;var n,r,i=[].concat(e.choices),s=e.hasOpenChoice&&null!==(t=i.pop())&&void 0!==t?t:null,o=(n=i,(r=Lu(i)).length>1&&n.every(function(e,t){return e===r[t]})?r.reverse():r);return Li(s)||o.push(s),o}(t)},[t]),f=Fr(function(){return function(e,t){return Ri(e)||$d(e)?e:t===ei?null:[]}(a,t.type)}),p=f[0],_=f[1],v=Fr(function(){return function(e,t){if(Ri(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if($d(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=ld().isPreviewMode,b=t.type===ei,w=t.type===Xr,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&&Pi(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||!Li(p)&&(!Pi(p)||g.isSelected||0!==p.length)&&(!g.isSelected||""!==g.inputValue.trim()))},E=function(){g.isSelected&&w?Pi(p)&&(y?o([].concat(p,[g.inputValue])):s([].concat(p,[g.inputValue]))):y?o(p):s(p)};return wd(Zn,{children:[wd("div",{className:"question-container",children:[wd(Md,{question:t,forceDisableHtml:n}),wd("fieldset",{className:"multiple-choice-options limit-height",children:[wd("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),h.map(function(e,n){var i=!!t.hasOpenChoice&&n===t.choices.length-1,s="surveyQuestion"+r+"Choice"+n,o=s+"Open",a=i?g.isSelected:b?p===e:Pi(p)&&p.includes(e);return wd("label",{className:i?"choice-option-open":"",children:[wd("div",{className:"response-choice",children:[wd("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:function(){return x(e,i)},id:s,"aria-controls":o}),wd("span",{children:i?e+":":e})]}),i&&wd("input",{type:"text",ref:d,id:o,name:"question"+r+"Open",value:g.inputValue,onKeyDown:C,onInput:k,onClick:function(t){g.isSelected||x(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},n)})]})]}),wd(Rd,{text:t.buttonText||"Submit",submitDisabled:P(),appearance:i,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:S,canGoBack:l,onBack:c})]})}var Ud=[1,2,3,4,5],zd=[1,2,3,4,5,6,7],Vd=[0,1,2,3,4,5,6,7,8,9,10],Wd={2:[Ed,Fd],3:[kd,xd,Sd],5:[Cd,kd,xd,Sd,Pd]};function Gd(e){switch(e){case 5:default:return Ud;case 7:return zd;case 10:return Vd}}var Kd=su("[Surveys]");function Qd(e,t,n){var r,i=e.questions[t],s=t+1;if(null==(r=i.branching)||!r.type)return t===e.questions.length-1?ni:s;if(i.branching.type===ni)return ni;if("specific_question"===i.branching.type){if(Number.isInteger(i.branching.index))return i.branching.index}else if("response_based"===i.branching.type){if(i.type===ei){var o,a=i.choices.indexOf(""+n);if(-1===a&&i.hasOpenChoice&&(a=i.choices.length-1),null!=(o=i.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var u=i.branching.responseValues[a];return Number.isInteger(u)?u:u===ni?ni:s}}else if(i.type===ti){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,i.scale);if(null!=(l=i.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(c)){var d=i.branching.responseValues[c];return Number.isInteger(d)?d:d===ni?ni:s}}return s}return Kd.warn("Falling back to next question index due to unexpected branching type"),s}var Zd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Jd=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"].concat(Zd),Yd="<masked>",Xd=["li_fat_id"];function eh(e,t,n){if(!Qa)return{};var r,i=t?[].concat(Zd,n||[]):[],s=th(mc(Qa.URL,i,Yd),e);return uu((r={},au(Xd,function(e){var t=Cc(e);r[e]=t||null}),r),s)}function th(e,t){var n=Jd.concat(t||[]),r={};return au(n,function(t){var n=gc(e,t);r[t]=n||null}),r}function nh(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",r={};if(!Li(t)){r.$search_engine=t;var i=Qa?gc(Qa.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function rh(){return navigator.language||navigator.userLanguage}var ih="$direct";function sh(){return(null==Qa?void 0:Qa.referrer)||ih}function oh(e,t,n){var r;void 0===n&&(n=!1);var i=e?[].concat(Zd,t||[]):[],s=null==(r=n?po(null==Za?void 0:Za.href):null==Za?void 0:Za.href)?void 0:r.substring(0,1e3);return{r:sh().substring(0,1e3),u:s?mc(s,i,Yd):void 0}}function ah(e,t){var n;void 0===t&&(t=!1);var r=e.r,i=e.u,s=t?po(i):i,o={$referrer:r,$referring_domain:null==r?void 0:r==ih?ih:null==(n=vc(r))?void 0:n.host};if(s){o.$current_url=s;var a=vc(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,uu(o,th(s))}return r&&uu(o,nh(r)),o}function uh(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function lh(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var ch=su("[SurveyTranslations]");function dh(e,t){var n=function(e){return function(e,t){var n=e.storedPersonProperties,r=e.locale,i=Su(e.overrideLanguage);if(i)return null==t||t.info("Using override display language: "+i),i;var s=function(e){return e&&"object"==typeof e&&"language"in e?Su(e.language):null}(n);if(s)return null==t||t.info("Using person property language: "+s),s;var o=Su(r);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:Ei(e.get_property)?e.get_property(Pl):void 0,locale:rh()},ch)}(t);if(!n)return ch.info("No user language detected"),{survey:e,language:null};var r=Pu(e,n,ch);return{survey:r.survey,language:r.matchedKey}}var hh=Wa,fh=Qa,ph="ph:show_survey_widget",_h="PHWidgetSurveyClickListener";function vh(e,t){try{var n=e.getBoundingClientRect(),r=hh.innerHeight,i=hh.innerWidth,s=n.left+n.width/2-t/2;s+t>i-20&&(s=i-t-20),20>s&&(s=20);var o=r-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?r-n.top+12+"px":"auto",zIndex:Zc.zIndex}}catch(e){return Au.warn("Failed to calculate trigger position:",e),null}}var gh=function(){"use strict";function e(e){var t=this;this._surveyTimeouts=new Map,this._widgetSelectorListeners=new Map,this._renderedTabWidgets=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._loggedFeatureFlagsDisabledWarning=!1,this.handlePageUnload=function(){var e=t._posthog.get_property(Il);if(e)for(var n,r=f(e);!(n=r()).done;){var i=n.value;vd(i)&&id(i,t._posthog)}},this.handlePopoverSurvey=function(e,n,r){var i,s,o,a,l,c=(void 0===r?{}:r).resumeDelayFromActivation,d=void 0!==c&&c;if(Du(t._posthog)){var 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!=(i=_.appearance)&&i.displayThankYouMessage){t._addSurveyToFocus(_);var b={};if((null==(s=_.appearance)?void 0:s.position)===Kr&&null!=(o=_.appearance)&&o.widgetSelector){var w,S=fh.querySelector(_.appearance.widgetSelector);S&&(b=vh(S,parseInt((null==(w=_.appearance)?void 0:w.maxWidth)||Zc.maxWidth))||{})}var x=(null==(a=_.appearance)?void 0:a.surveyPopupDelaySeconds)||0,k=ed(_,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,gr(wd(Sh,u({},C)),k);var P=function(){if(!Du(t._posthog)||!t._shouldDisplaySurvey(_))return Au.info("Survey "+_.id+" no longer eligible when its display delay elapsed; not displaying"),t._removeSurveyFromFocus(_);!function(){t._surveyIsRendered=!0;var r=t._translateSurveyForRendering(e),i=r.survey,s=r.language;t._currentLanguage=s;var o=t._applyDisplayOverrides(i,n),a=u({},C,{survey:o,surveyLanguage:s});t._surveyPopupProps=a,gr(wd(Sh,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=Oi(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*x-F);if(0>=I)return P();var T=hh.setTimeout(function(){t._surveyTimeouts.delete(_.id),P()},I);t._surveyTimeouts.set(_.id,T)}}},this._handleWidget=function(e){var n,r=t._translateSurveyForRendering(e),i=r.survey,s=r.language,o=ed(i,t._posthog),a=o.shadow,u=o.isNewlyCreated;t._renderedTargets.set(a,a.host),(null==(n=e.appearance)?void 0:n.widgetType)===zr&&t._renderedTabWidgets.set(e.id,e),u&&gr(wd(kh,{posthog:t._posthog,survey:i,surveyLanguage:s},e.id),a)},this._detachWidgetSelectorListener=function(e){var n=t._widgetSelectorListeners.get(e);n&&(n.element.removeEventListener("click",n.listener),n.element.removeAttribute(_h),t._widgetSelectorListeners.delete(e),Au.info("Removed click listener for survey "+e))},this._removeWidgetSelectorListener=function(e){t._isWidgetSurveyOpen(e)||(t._removeSurveyFromDom(e),t._detachWidgetSelectorListener(e.id))},this._removeTabWidget=function(e){t._isWidgetSurveyOpen(e)||(t._removeSurveyFromDom(e),t._renderedTabWidgets.delete(e.id))},this._isWidgetSurveyOpen=function(e){try{var t;return!(null==(t=fh.querySelector(md(e,!0)))||null==(t=t.shadowRoot)||!t.querySelector(".ph-survey"))}catch(e){return!1}},this._manageWidgetSelectorListener=function(e,n){var r=fh.querySelector(n),i=t._widgetSelectorListeners.get(e.id);if(r){if(t._handleWidget(e),i){if(r===i.element)return;Au.info("Selector element changed for survey "+e.id+". Re-attaching listener."),t._detachWidgetSelectorListener(e.id)}if(!r.hasAttribute(_h)){var s=function(t){var n,r;t.stopPropagation();var i=(null==(n=e.appearance)?void 0:n.position)===Kr?vh(t.currentTarget,parseInt((null==(r=e.appearance)?void 0:r.maxWidth)||Zc.maxWidth)):{};hh.dispatchEvent(new CustomEvent(ph,{detail:{surveyId:e.id,position:i}}))};_u(r,"click",s),r.setAttribute(_h,"true"),t._widgetSelectorListeners.set(e.id,{element:r,listener:s,survey:e}),Au.info("Attached click listener for feedback button survey "+e.id)}}else i&&t._removeWidgetSelectorListener(e)},this.renderPopover=function(e){if(Du(t._posthog)){var n=t._translateSurveyForRendering(e),r=n.survey,i=n.language,s=ed(r,t._posthog).shadow;t._renderedTargets.set(s,s.host),gr(wd(Sh,{posthog:t._posthog,survey:r,removeSurveyFromFocus:t._removeSurveyFromFocus,surveyLanguage:i}),s)}},this.renderSurvey=function(e,n,r){var i;if(Du(t._posthog)){var s=t._translateSurveyForRendering(e),o=s.survey,a=s.language,u=!1;null!=(i=t._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(u=t._handleUrlPrefill(o,a,r)),gr(wd(Sh,{posthog:t._posthog,survey:o,removeSurveyFromFocus:t._removeSurveyFromFocus,isPopup:!1,properties:r,isSurveyCompleted:u,surveyLanguage:a}),n)}},this.getActiveMatchingSurveys=function(e,n){var r;void 0===n&&(n=!1),null==(r=t._posthog)||null==(r=r.surveys)||r.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=Du(t._posthog),r=e.filter(function(e){return n&&(e.type===Qr||e.type===Zr)}),i=new Set(r.map(function(e){return e.id})),s=0,o=Array.from(t._surveyTimeouts.keys());o.length>s;s++){var a=o[s];i.has(a)||t.cancelSurvey(a)}var u=t._sortSurveysByAppearanceDelay(r),l=new Set,c=new Set;u.forEach(function(e){if(e.type===Zr){var n,r,i,s;if((null==(n=e.appearance)?void 0:n.widgetType)===zr)return c.add(e.id),void t._handleWidget(e);"selector"===(null==(r=e.appearance)?void 0:r.widgetType)&&null!=(i=e.appearance)&&i.widgetSelector&&(l.add(e.id),t._manageWidgetSelectorListener(e,null==(s=e.appearance)?void 0:s.widgetSelector))}Li(t._surveyInFocus)&&e.type===Qr&&t.handlePopoverSurvey(e,void 0,{resumeDelayFromActivation:!0})}),t._widgetSelectorListeners.forEach(function(e){var n=e.survey;l.has(n.id)||t._removeWidgetSelectorListener(n)}),t._renderedTabWidgets.forEach(function(e,n){c.has(n)||t._removeTabWidget(e)})},e)},this._addSurveyToFocus=function(e){Li(t._surveyInFocus)||Au.error("Survey "+t._surveyInFocus+" already in focus. Cannot add survey "+e.id+"."),t._surveyInFocus=e.id},this._removeSurveyFromFocus=function(e){t._surveyInFocus!==e.id&&Au.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()},_u(hh,"languagechange",this._languageChangeListener),this._unsubscribeFeatureFlags=e.onFeatureFlags(function(){return t._onLanguageChange()})}var t=e.prototype;return t._onLanguageChange=function(){var e,t=this;if(!Li(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 r=this._translateSurveyForRendering(n),i=r.survey,s=r.language;if(s!==this._currentLanguage&&(this._currentLanguage=s,this._surveyIsRendered)){var o=this._applyDisplayOverrides(i,this._displayOptions),a=ed(o,this._posthog).shadow;gr(wd(Sh,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)&&(Au.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.clearInMemoryInProgressSurveyState=function(){!function(){for(var e=0,t=Object.keys(fd);t.length>e;e++)delete fd[t[e]]}()},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&&(hh.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){gr(null,t),null==e||e.remove()}),this._renderedTargets.clear(),this._renderedTabWidgets.clear(),this._surveyInFocus=null},t._sortSurveysByAppearanceDelay=function(e){return e.sort(function(e,t){var n,r,i=vd(e),s=vd(t);if(i&&!s)return-1;if(!i&&s)return 1;var o=e.schedule===ri,a=t.schedule===ri;return o&&!a?1:!o&&a?-1:((null==(n=e.appearance)?void 0:n.surveyPopupDelaySeconds)||0)-((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})},t._translateSurveyForRendering=function(e){return dh(e,this._posthog)},t._handleUrlPrefill=function(e,t,n){if(this._prefillHandledSurveys.has(e.id))return!1;var r=function(e){var t={},n=!1,r=e.replace(/^\?/,"");if(!r)return{params:t,autoSubmit:n};for(var i,s=f(r.split("&"));!(i=s()).done;){var o=i.value.split("="),a=o[0],u=o[1];if(a&&!Ti(u)){var l=decodeURIComponent(a),c=decodeURIComponent(u);if("auto_submit"!==l||"true"!==c){var d=l.match(/^q(\d+)$/);if(d){var h=parseInt(d[1],10);t[h]||(t[h]=[]),t[h].push(c)}}else n=!0}}return{params:t,autoSubmit:n}}(hh.location.search).params;if(0===Object.keys(r).length)return!1;Au.info("[Survey Prefill] Detected URL prefill parameters");var i=this._processPrefillData(e,r,t);return!!i&&(this._autoSubmitPrefilledResponses(e,i,n,t),this._prefillHandledSurveys.add(e.id),i.isSurveyCompleted)},t._autoSubmitPrefilledResponses=function(e,t,n,r){var i=t.responses,s=t.submissionId,o=t.isSurveyCompleted,a=t.skippedResponses;(Object.keys(a).length>0&&e.enable_partial_responses||o)&&td({responses:o?i:a,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:n,surveyLanguage:r})},t._handleInitialResponses=function(e,t,n,r){for(var i={},s=0,o=Object.entries(t);o.length>s;s++){var a=o[s],u=a[1];i[parseInt(a[0])]=Pi(u)?u.map(String):[String(u)]}Au.info("[Survey] Processing initial responses");var l=this._processPrefillData(e,i,r);return!!l&&(this._autoSubmitPrefilledResponses(e,l,n,r),l.isSurveyCompleted)},t._processPrefillData=function(e,t,n){try{var r=function(e,t){var n={};return e.questions.forEach(function(e,r){if(t[r]&&e.id){var i=t[r],s=gu(e.id);try{switch(e.type){case ei:if(!e.choices||0===e.choices.length)return void iu.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(i[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void iu.warn("[Survey Prefill] Invalid choice index for q"+r+": "+i[0]);n[s]=e.choices[o];break;case Xr:if(!e.choices||0===e.choices.length)return void iu.warn("[Survey Prefill] Question "+r+" has no choices");var a=i.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 iu.warn("[Survey Prefill] No valid choices for q"+r);var u=[].concat(new Set(a.map(function(t){return e.choices[t]})));a.length>u.length&&iu.warn("[Survey Prefill] Removed duplicate choices for q"+r),n[s]=u;break;case ti:var l=parseInt(i[0],10),c=e.scale||10;if(isNaN(l)||0>l||l>c)return void iu.warn("[Survey Prefill] Invalid rating for q"+r+": "+i[0]+" (scale: 0-"+c+")");n[s]=l;break;default:iu.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){iu.error("[Survey Prefill] Error converting q"+r+":",e)}}}),n}(e,t);if(0===Object.keys(r).length)return Au.warn("[Survey Prefill] No valid responses after conversion"),null;var i=fc(),s=function(e,t,n){for(var r=0,i={},s=[],o=e.questions.length+1,a=0;e.questions.length>r&&o>a&&(a++,t.includes(r));){var u=e.questions[r];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=gu(u.id);Ti(n[l])||(i[l]=n[l])}s.push(r);var c=Qd(e,r,u.id?n[gu(u.id)]:null);if(c===ni)return{startQuestionIndex:e.questions.length,skippedResponses:i,skippedIndices:s};r=c}return{startQuestionIndex:r,skippedResponses:i,skippedIndices:s}}(e,Object.keys(t).map(function(e){return parseInt(e,10)}),r),o=s.startQuestionIndex,a=s.skippedResponses,u=s.skippedIndices,l=o>=e.questions.length;return pd(e,{surveySubmissionId:i,responses:r,lastQuestionIndex:o,questionOrder:sd(e.questions),visitedIndices:u,surveyLanguage:n}),Au.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:i,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:a}}catch(e){return Au.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,r=!(null==n||!n.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),i=!0;t&&(i=(null==n?void 0:n.getFeatureFlag(e,{send_event:!1}))===t||"any"===t);var s=r&&i;return s||this._warnIfFeatureFlagsDisabled(e),s},t._warnIfFeatureFlagsDisabled=function(e){var t;!this._loggedFeatureFlagsDisabledWarning&&null!=(t=this._posthog.config)&&t.advanced_disable_feature_flags&&(this._loggedFeatureFlagsDisabledWarning=!0,Au.warn('Survey feature flag "'+e+'" evaluated to false because advanced_disable_feature_flags is set. PostHog creates an internal targeting flag for almost every survey, so no survey can display while flags are disabled. To keep surveys working, replace advanced_disable_feature_flags with advanced_only_evaluate_survey_feature_flags, which evaluates survey flags only.'))},t._isSurveyConditionMatched=function(e){return!e.conditions||dd(e,this._posthog)&&function(e){var t,n;return function(e,t){var n,r,i;if(!e||0===e.length)return!0;if(!tu)return!1;var s=Ys(tu,{userAgentDataPlatform:null==Ka||null==(n=Ka.userAgentData)?void 0:n.platform,maxTouchPoints:null==Ka?void 0:Ka.maxTouchPoints,screenWidth:null==Wa||null==(r=Wa.screen)?void 0:r.width,screenHeight:null==Wa||null==(i=Wa.screen)?void 0:i.height,devicePixelRatio:null==Wa?void 0:Wa.devicePixelRatio});return Ru[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==Kc||!Kc.querySelector(e.conditions.selector))}(e)},t._internalFlagCheckSatisfied=function(e){var t;return ad(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)}:(this._warnIfFeatureFlagsDisabled(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,r={eligible:!0,reason:void 0};if(!$u(e))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+e.end_date,r;if(!ju.includes(e.type))return r.eligible=!1,r.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",r;var i=null==(t=e.conditions)?void 0:t.linkedFlagVariant;if(!this._isSurveyFeatureFlagEnabled(e.linked_flag_key,i))return r.eligible=!1,r.reason=i?"Survey linked feature flag is not enabled for variant "+i:"Survey linked feature flag is not enabled",r;if(!this._isSurveyFeatureFlagEnabled(e.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;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,r=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(r/864e5)>e}(null==(n=e.conditions)?void 0:n.seenSurveyWaitPeriodInDays,Rc._get("lastSeenSurveyDate"))?function(e){return!!Rc._get(Nu(e))&&!ad(e)}(e)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.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",r)},t.checkSurveyCaptureEligibility=function(){return Du(this._posthog)?{eligible:!0}:{eligible:!1,reason:Ou}},t.checkSurveyDisplayEligibility=function(e){var t=this.checkSurveyCaptureEligibility();return t.eligible?this.checkSurveyEligibility(e):t},t.checkSurveyRenderability=function(e){var t=this.checkSurveyDisplayEligibility(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!Eu(e)&&!qu(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=fh.querySelector(md(e,!0));null!=t&&t.shadowRoot&&(gr(null,t.shadowRoot),this._renderedTargets.delete(t.shadowRoot)),null==t||t.remove()}catch(t){Au.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 mh(e,t){if(fh&&hh){var n,r=new gh(e);if(e.config.disable_surveys_automatic_display)return Au.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===t)return Au.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var i=function(){Ti(n)&&(n=setInterval(function(){r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=function(){Ti(n)||(clearInterval(n),n=void 0)};i();var o=function(){fh.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),i())};return _u(fh,"visibilitychange",o),r.setAutomaticDisplayDispose(function(){s(),fh.removeEventListener("visibilitychange",o)}),r}}function yh(e){var t=e.survey,n=e.removeSurveyFromFocus,r=void 0===n?function(){}:n,i=e.setSurveyVisible,s=e.isPreviewMode,o=void 0!==s&&s,a=e.posthog;Ir(function(){var e;if(!o&&null!=(e=t.conditions)&&e.url){var n=function(){var e,n=t.type===Zr,s=dd(t,a),o=(null==(e=t.appearance)?void 0:e.widgetType)===zr&&n;if(!s)return Au.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(Au.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};_u(hh,"popstate",n),_u(hh,"hashchange",n);var s=hh.history.pushState,u=hh.history.replaceState;return hh.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];s.apply(this,t),n()},hh.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];u.apply(this,t),n()},function(){hh.removeEventListener("popstate",n),hh.removeEventListener("hashchange",n),hh.history.pushState=s,hh.history.replaceState=u}}},[o,t,r,i,a])}var bh=200;function wh(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 Sh(e){var t,n,r,i,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,I=void 0===F?function(){}:F,T=e.onCloseConfirmationMessage,R=void 0===T?function(){}:T,M=e.properties,L=e.isSurveyCompleted,A=e.skipShownEvent,O=e.surveyLanguage,D=Tr(null),q=Number.isInteger(y),B=function(e,t,n,r,i,s,o,a,l){var c=Fr(r||0===n||e.type===Jr),d=c[0],h=c[1],f=Fr(!1),p=f[0],_=f[1],v=Tr(!1),g=function(){var t=function(){s&&i(e),h(!1)};if(!v.current){var n=null==o?void 0:o.current;n?(v.current=!0,n.style.transition="opacity "+bh+"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 Ir(function(){if(t){if(!r){var i,s=function(t){var n,r;if(t.detail.surveyId===e.id){if(null==(n=e.appearance)||!n.displayThankYouMessage)return g();_(!0),null!=(r=e.appearance)&&r.autoDisappear&&(i&&clearTimeout(i),i=setTimeout(g,5e3))}},o=function(){var n,r;if(dd(e,t)){h(!0),hh.dispatchEvent(new Event("PHSurveyShown")),a||t.capture(ii,u(((n={})[ui]=e.name,n[ai]=e.id,n[li]=e.current_iteration,n[ci]=e.current_iteration_start_date,n),l&&((r={})[di]=l,r),{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}};_u(hh,"PHSurveyClosed",m),_u(hh,"PHSurveySent",s);var c=n>0?setTimeout(o,n):void 0;return Ti(c)&&o(),function(){Ti(c)||clearTimeout(c),Ti(i)||clearTimeout(i),hh.removeEventListener("PHSurveyClosed",m),hh.removeEventListener("PHSurveySent",s)}}}else Au.error("usePopupVisibility hook called without a PostHog instance.")},[]),yh({survey:e,removeSurveyFromFocus:i,setSurveyVisible:h,isPreviewMode:r,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,A,O),N=B.isPopupVisible,H=B.hidePopupWithAnimation,j=B.isSurveySent||y===p.questions.length||!0===L,U=Fr(!1),z=U[0],V=U[1],W=Rr(function(){return!!_d(p)},[p]),G=!!(null!=(n=p.appearance)&&n.introScreenHeader||null!=(r=p.appearance)&&r.introScreenDescription),K=q?-1===y:!(null==(i=p.appearance)||!i.displayIntroScreen)&&G&&!z&&!W,Q=Rr(function(){var e,t=(null==(e=_d(p))?void 0:e.surveySubmissionId)||fc();return{isPreviewMode:q,previewPageIndex:y,onPopupSurveyDismissed:function(){O?rd(p,v,q,O):rd(p,v,q),I()},isPopup:x||!1,surveySubmissionId:t,onPreviewSubmit:C,onPreviewBack:E,posthog:v,properties:M,surveyLanguage:O}},[q,y,x,v,p,I,C,E,M,O]);return N?wd(ud.Provider,{value:Q,children:wd("div",{className:"ph-survey",style:u({},yd(p.type,null==(s=p.appearance)?void 0:s.position,null==(o=p.appearance)?void 0:o.widgetType),m),ref:D,children:j?wd(Od,{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||Zc,onClose:function(){H(),R()}}):K?wd(Dd,{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||Zc,onStart:function(){return V(!0)}}):wd(xh,{survey:p,forceDisableHtml:!!_,posthog:v})})}):null}function xh(e){var t,n,r=e.survey,i=e.forceDisableHtml,s=e.posthog,o=Rr(function(){var e=_d(r);if(!e)return null;var t=Oi(e.lastQuestionIndex);return!t||t&&e.lastQuestionIndex>=0&&r.questions.length>e.lastQuestionIndex?e:(gd(r),null)},[r]),a=Fr(function(){return null!=o&&o.responses&&Au.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}}),l=a[0],c=a[1],d=Fr(!1),h=d[0],f=d[1],p=Mr(ud),_=p.previewPageIndex,v=p.onPopupSurveyDismissed,g=p.isPopup,m=p.onPreviewSubmit,y=p.onPreviewBack,b=p.surveySubmissionId,w=p.isPreviewMode,S=p.properties,x=p.surveyLanguage,k=Fr(function(){var e=null==o?void 0:o.lastQuestionIndex,t=Oi(e)&&e>=0&&r.questions.length>e?e:0;return Oi(_)&&_>=0?_:t}),C=k[0],P=k[1],E=Fr(function(){var e;return(null!==(e=null==o?void 0:o.visitedIndices)&&void 0!==e?e:[]).filter(function(e){return e>=0&&r.questions.length>e})}),F=E[0],I=E[1],T=Fr(function(){var e,t;return null!==(e=null==(t=_d(r))?void 0:t.questionSnapshots)&&void 0!==e?e:{}}),R=T[0],M=T[1],L=Rr(function(){return sd(od(r,o))},[r.id,o]),A=Rr(function(){if(!L||new Set(L).size!==L.length)return od(r,o);var e=new Map(r.questions.map(function(e){return[e.id,e]})),t=L.map(function(t){return e.get(t)}).filter(function(e){return!!e});return t.length===L.length?t:r.questions},[L,r.questions,r,o]);Ir(function(){!w||Ti(_)||0>_||P(_)},[_,w]);var O=!(null==(t=r.appearance)||!t.allowGoBack)&&(w?(null!=_?_:0)>0:F.length>0),D=A.at(C);return D?wd("form",{className:"survey-form",name:"surveyForm",children:[g&&!0!==(null==(n=r.appearance)?void 0:n.hideCancelButton)&&wd(Ld,{onClick:function(){v()}}),wd("div",{className:"survey-box","data-question-index":C,children:[h&&wd("p",{role:"alert",children:"Your response could not be sent. Please try again later."}),Ch({question:D,forceDisableHtml:i,displayQuestionIndex:C,appearance:r.appearance||Zc,onSubmit:function(e){return function(e){var t=e.res,n=e.displayQuestionIndex,i=e.questionId;if(s)if(Du(s))if(f(!1),i){var o=function(e,t,n,r){var i,s,o=e.questionSnapshots,a=void 0===o?{}:o;return{responses:u({},e.responses,(i={},i[gu(t)]=n,i)),questionSnapshots:null!=r&&r.id?u({},a,(s={},s[r.id]=r.question,s)):a}}({responses:l,questionSnapshots:R},i,t,A[n]),a=o.responses,d=o.questionSnapshots;c(a),M(d);var h=Qd(r,n,t),p=h===ni,_=[].concat(F,[n]);if(p||(I(_),P(h),pd(r,{surveySubmissionId:b,responses:a,lastQuestionIndex:h,questionOrder:sd(A),visitedIndices:_,surveyLanguage:x,questionSnapshots:d})),r.enable_partial_responses||p){var v=new Set(_.map(function(e){var t;return null==(t=A[e])?void 0:t.id}).filter(function(e){return!!e}).map(function(e){return gu(e)}));td({responses:Object.fromEntries(Object.entries(a).filter(function(e){return v.has(e[0])})),survey:r,surveySubmissionId:b,isSurveyCompleted:p,posthog:s,properties:S,surveyLanguage:x,questionSnapshots:d})}}else Au.error("onNextButtonClick called without a questionId.");else f(!0);else Au.error("onNextButtonClick called without a PostHog instance.")}({res:e,displayQuestionIndex:C,questionId:D.id})},onPreviewSubmit:m,initialValue:D.id?l[gu(D.id)]:void 0,canGoBack:O,onBack:function(){if(w)y();else if(0!==F.length){var e=F[F.length-1],t=F.slice(0,-1);I(t),P(e),pd(r,{surveySubmissionId:b,responses:l,lastQuestionIndex:e,questionOrder:sd(A),visitedIndices:t,surveyLanguage:x,questionSnapshots:R})}}})]})]}):null}function kh(e){var t,n,r,i,s,o,a,u=e.survey,l=e.forceDisableHtml,c=e.posthog,d=e.readOnly,h=e.surveyLanguage,f=Fr(!0),p=f[0],_=f[1],v=Fr(!1),g=v[0],m=v[1],y=Fr({}),b=y[0],w=y[1],S=Tr(void 0),x=function(){(g||!c||d||Du(c))&&m(!g)};if(Ir(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&&(Au.info("Received show event for feedback button survey "+u.id),w(n.detail.position||{}),x())};return _u(hh,ph,t),function(){Ti(S.current)||(clearTimeout(S.current),S.current=void 0),hh.removeEventListener(ph,t)}}}else Au.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==(r=u.appearance)?void 0:r.borderColor]),yh({survey:u,setSurveyVisible:_,posthog:c}),!p)return null;var k=function(){u.schedule!==ri&&_(!1),Ti(S.current)||clearTimeout(S.current),S.current=setTimeout(function(){S.current=void 0,m(!1)},200)};return wd(Zn,{children:["tab"===(null==(i=u.appearance)?void 0:i.widgetType)&&wd("button",{className:"ph-survey-widget-tab "+("top"===(null==(s=u.appearance)?void 0:s.tabPosition)?"widget-tab-top":""),onClick:x,disabled:d,style:wh(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),g&&wd(Sh,{posthog:c,survey:u,forceDisableHtml:l,style:b,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:h})]})}var Ch=function(e){var t=e.question,n=e.onSubmit,r=e.onPreviewSubmit,i={forceDisableHtml:e.forceDisableHtml,appearance:e.appearance,onPreviewSubmit:function(e){r(e)},onSubmit:function(e){n(e)},initialValue:e.initialValue,displayQuestionIndex:e.displayQuestionIndex,canGoBack:e.canGoBack,onBack:e.onBack};switch(t.type){case Yr:return Kn(qd,u({},i,{question:t,key:t.id}));case"link":return Kn(Bd,u({},i,{question:t,key:t.id}));case ti:return Kn(Nd,u({},i,{question:t,key:t.id}));case ei:case Xr:return Kn(jd,u({},i,{question:t,key:t.id}));default:return Au.error("Unsupported question type: "+t.type),null}},Ph="undefined"!=typeof globalThis?globalThis:Wa;Ph&&"undefined"==typeof self&&(Ph.self=Ph),Ph&&"undefined"==typeof File&&(Ph.File=function(){});var Eh=null!=Wa?Wa:{};Eh.__PosthogExtensions__=Eh.__PosthogExtensions__||{},Eh.__PosthogExtensions__.generateSurveys=mh,Eh.extendPostHogWithSurveys=mh;var Fh=function(e){return ji(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message)},Ih=su("[Error tracking]"),Th="webkit-masked-url:",Rh=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],Mh=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Th],Lh=["__firefox__","__gCrWeb"];function Ah(){return new bo([new Ho,new Jo,new Uo,new jo,new Qo,new Ko,new Vo,new Zo],function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var i=[],s=t.split("\n"),o=Math.min(s.length,r+1e3),a=[],l=r;o>l;l++){var c=s[l];if(1024>=c.length){var d=Lo.test(c)?c.replace(Lo,"$1"):c;if(!d.match(/\S*Error: /)){for(var h=0,p=n;p.length>h;h++){var _=(0,p[h])(d,e);if(_){i.push(_);var v=Oo(i);if(v){for(var g=a.length-1;g>=0;g--){var m=a[g];if(v.start>=m.start+m.length)break;a.pop()}a.push(v)}break}}if(Bo(i,a)>=50)break}}}var y=[].concat(a).sort(function(e,t){return t.start-e.start}),b=y[y.length-1];if(b){var w=$o(i,b);i.splice(b.start-w,w);for(var S,x=f(y);!(S=x()).done;)S.value.start-=w}for(var k,C=f(y);!(k=C()).done;)Do(i,k.value);return a.some(function(e){return 0===e.start&&i.length===e.length})&&function(e){for(var t=e.map(function(e){return e.function+"|"+e.filename+"|"+e.lineno+"|"+e.colno+"|"+e.module}),n=0,r=1;t.length>r;r++)No(t,r,n)&&(n=r);e.push.apply(e,e.splice(0,n))}(i),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})}(i)}}("web:javascript",Io,Mo))}var Oh=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=na(this._getExceptionStepsConfig()),this._exceptionStepsBuffer=new ra(this._exceptionStepsConfig)}var t=e.prototype;return t.onConfigChange=function(){this._exceptionStepsConfig=na(this._getExceptionStepsConfig()),this._exceptionStepsBuffer.setConfig(this._exceptionStepsConfig)},t.onRemoteConfig=function(e){var t,n,r,i;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==(r=s.errorTracking)?void 0:r.captureExtensionExceptions;this._suppressionRules=o,this._instance.persistence&&this._instance.persistence.register(((i={})[nl]=this._suppressionRules,i[rl]=a,i))}}},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(!Ri(e)||0===e.trim().length)return void Ih.warn("Ignoring exception step because message must be a non-empty string");var r=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(function(n,r){return ea.has(r)?(t.push(r),n):(n[r]=e[r],n)},{}),droppedKeys:t}}(this._coerceExceptionStepProperties(t)),i=r.sanitizedProperties,s=r.droppedKeys;s.length>0&&Ih.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._exceptionStepsBuffer.add(u(((n={})[Yo]=e,n[Xo]=(new Date).toISOString(),n),i))}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&&Ai(e.$exception_steps)?this._addBufferedExceptionSteps(e):e,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(n.$release_id=r);try{var i=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_originatedFromCaptureException:!0});return i&&this._exceptionStepsBuffer.clear(),i}catch(e){return Fh(e)||Ih.error("Failed to capture exception event. Dropping this exception.",e),void this._exceptionStepsBuffer.clear()}}catch(e){return void(Fh(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={})[Yo]=e,t[Xo]=(new Date).toISOString(),t))},t._coerceExceptionStepProperties=function(e){return Fi(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,r=t.value;return Ri(n)&&n.length>0&&e.$exception_types.push(n),Ri(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this._suppressionRules.some(function(e){var n=e.values.map(function(e){var n=Ru[e.operator],r=t[e.key];if(!n||!r)return!1;var i=Pi(e.value)?e.value:[e.value];return i.length>0&&n(i,r)});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&&Mh.some(function(e){return t.startsWith(e)})});return 0!==n.length&&(!n.every(function(e){var t=e.filename;return!!t&&t.startsWith(Th)})||e.some(function(e){var t=e.value;return"NoResponse"===e.type||Ri(t)&&Rh.some(function(e){var n=e.value;return e.exact?t===n:t.includes(n)})})&&!t.some(function(e){var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(Th))}))},t._isInjectedBrowserScriptException=function(e){return e.some(function(e){var t=e.value;return Ri(t)&&Lh.some(function(e){return t.includes(e)})})},t._isPostHogException=function(e){if(e.length>0){var t,n,r,i,s=null!==(t=null==(n=e[0].stacktrace)?void 0:n.frames)&&void 0!==t?t:[];return null!==(r=null==(i=s[s.length-1])||null==(i=i.filename)?void 0:i.includes("posthog.com/static"))&&void 0!==r&&r}return!1},t._isExceptionList=function(e){return!Ai(e)&&Pi(e)},o(e,[{key:"_captureExtensionExceptions",get:function(){var e,t,n=!!this._instance.get_property(rl);return null!==(e=null!==(t=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==t?t:n)&&void 0!==e&&e}}])}(),Dh=su("[ExceptionAutocapture]"),$h=Ah(),qh=function(e,t){try{return e()}catch(e){return t}},Bh=function(e,t){return qh(function(){return e(t())},void 0)},Nh=function(e){return qh(function(){return Ei(e)&&Ei(e.call)},!1)},Hh=function(e,t){return qh(function(){e[t].__POSTHOG_INSTRUMENTED__=!0},void 0)},jh=function(e,t,n){qh(function(){var n;null==(n=e[t])||delete n.__POSTHOG_INSTRUMENTED__},void 0),qh(function(){e[t]=n},void 0)},Uh=function(e){var t=Wa;t||Dh.info("window not available, cannot wrap onerror");var n=qh(function(){return t.onerror},void 0);return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),s=0;r>s;s++)i[s]=arguments[s];return Bh(e,function(){return $h.buildFromUnknown(function(e){var t=e[0],n=e[1],r=e[2],i=e[3],s=e[4];if(null!=s)return s;if(Ri(t)&&Ri(n)&&n.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:t,filename:n,lineno:r,colno:i})}catch(e){return t}return t}(i),{mechanism:{handled:!1}})}),!!Nh(n)&&null!==(t=n.apply(void 0,i))&&void 0!==t&&t},Hh(t,"onerror"),function(){return jh(t,"onerror",n)}},zh=function(e,t){void 0===t&&(t=!1);var n=Wa;n||Dh.info("window not available, cannot wrap onUnhandledRejection");var r=qh(function(){return n.onunhandledrejection},void 0);return n.onunhandledrejection=function(n){var i;return Bh(e,function(){return $h.buildFromUnknown(n,{mechanism:{handled:!1}})}),Nh(r)?null!==(i=r(n))&&void 0!==i&&i:t},Hh(n,"onunhandledrejection"),function(){return jh(n,"onunhandledrejection",r)}},Vh={wrapOnError:Uh,wrapUnhandledRejection:zh,wrapConsoleError:function(e){var t=console;t||Dh.info("console not available, cannot wrap console.error");var n=qh(function(){return t.error},void 0);return t.error=function(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];qh(function(){return r.length>1&&Ri(r[0])&&(/^\[PostHog\.js\](?: |$)/.test(r[0])||"rrweb logger error:"===r[0])},!1)||Bh(e,function(){var e;e=1==r.length?r[0]:r.join(" ");var t=r.find(function(e){return e instanceof Error});return $h.buildFromUnknown(t||e,{mechanism:{handled:!0,type:"onconsole"},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Nh(n)&&n.apply(void 0,r)},Hh(t,"error"),function(){return jh(t,"error",n)}}};Eh.__PosthogExtensions__=Eh.__PosthogExtensions__||{},Eh.__PosthogExtensions__.errorWrappingFunctions=Vh,Eh.posthogErrorWrappingFunctions=Vh;var Wh=function(e,t){if(Ei(null==e?void 0:e.capture)){var n=null==t?void 0:t.autocaptureExceptions,r=!Li(n)&&"object"==typeof n&&Pi(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},[]):[],i=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)}};Uh(function(e){r.some(function(t){return e.$exception_list.some(function(e){return t.test(e.value||"")})})||i(e)}),zh(i,!0)}};Eh.extendPostHogWithExceptionAutoCapture=Wh,Eh.extendPostHogWithExceptionAutocapture=Wh;var Gh=function(){},Kh=function(e){var t;if(Ei(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function Qh(e,t,n){try{if(!(t in e))return Gh;var r={next:e[t]},i=n(function(){for(var e=arguments.length,t=new Array(e),n=0;e>n;n++)t[n]=arguments[n];return r.next.apply(this,t)});return Ei(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=i,function(){if(e[t]!==i)for(var n=e[t],s=Kh(n);s;){if(s.next===i)return void(s.next=r.next);s=Kh(n=s.next)}else e[t]=r.next}}catch(e){return Gh}}var Zh="X-POSTHOG-SESSION-ID",Jh="X-POSTHOG-WINDOW-ID",Yh="X-POSTHOG-DISTINCT-ID",Xh=[Zh,Jh,Yh],ef=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],tf=function(e,t){return{}.hasOwnProperty.call(e,t)},nf=function(e){return"object"==typeof e&&!Li(e)||Ei(e)},rf=function(e){return"undefined"!=typeof Request&&(e instanceof Request||"[object Request]"==={}.toString.call(e))},sf=function(e){try{var t;return rf(e)?e.url:new URL(e instanceof URL?e.toString():String(e),null==Wa||null==(t=Wa.location)?void 0:t.href).toString()}catch(e){return}},of=function(e,t,n,r,i){var s;try{s=new URL(r).hostname}catch(e){return!1}if(!e)return!1;if(Pi(e)&&!e.includes(s))return!1;var o=!1;if(n){var a=n.checkAndGetSessionAndWindowId(!0),u=a.windowId;i.set(Zh,a.sessionId),i.set(Jh,u),o=!0}var l=function(e){return Ei(e)?e():e}(t);return l&&"$posthog_cookieless"!==l&&(i.set(Yh,l),o=!0),o};Eh.__PosthogExtensions__=Eh.__PosthogExtensions__||{};var af={_patchFetch:function(e,t,n){return Qh(Wa,"fetch",function(r){return function(i,s){var o=arguments.length>1?[i,s]:[i],a=o;try{var l=sf(i);if(l)if(rf(i)){var c=new Request(i,s);of(e,t,n,c.url,c.headers),a=[c]}else{var d=new Headers(nf(s)?s.headers:void 0);if(of(e,t,n,l,d)){var h=function(e,t){if(Ti(e)||Li(e))return{headers:t};if(nf(e)){var n=e;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var r=Object.create(n);return Object.defineProperty(r,"headers",{configurable:!0,enumerable:!0,value:t,writable:!0}),r}return new Proxy({headers:t},{get:function(e,t){return tf(e,t)?Reflect.get(e,t):Reflect.get(n,t,n)},has:function(e,t){return tf(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)}),ef.forEach(function(e){e in n&&t.add(e)}),Array.from(t)},getOwnPropertyDescriptor:function(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r)return r;if("string"==typeof t&&ef.includes(t)&&t in n)return{configurable:!0,enumerable:!0,get:function(){return Reflect.get(n,t,n)}};var i=Reflect.getOwnPropertyDescriptor(n,t);return i?u({},i,{configurable:!0}):void 0},getPrototypeOf:function(){return Object.getPrototypeOf(n)}})}}(s,d);h&&(a=[i,h])}}}catch(e){a=o}return r.apply(this,a)}})},_patchXHR:function(e,t,n){return Qh(Wa.XMLHttpRequest.prototype,"open",function(r){return function(i,s,o,a,u){void 0===o&&(o=!0);var l=this,c=new Headers,d=sf(s);d&&of(e,t,n,d,c);var h=r.call(l,i,s,o,a,u);return Xh.forEach(function(e){var t=c.get(e);if(t)try{l.setRequestHeader(e,t)}catch(e){}}),h}})}};Eh.__PosthogExtensions__.tracingHeadersPatchFns=af,Eh.postHogTracingHeadersPatchFns=af,Va.DEBUG=!1,Va.LIB_VERSION="1.434.13",Va.LIB_NAME="web";var uf=Va,lf=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==Ka?void 0:Ka.doNotTrack,null==Ka?void 0:Ka.msDoNotTrack,Eh.doNotTrack,null==Ka?void 0:Ka.globalPrivacyControl].some(function(e){return Wi(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 Wi(e)?1:yi(Gi,e)?0:-1}},{key:"_storage",get:function(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?Rc:Ic,n=t._is_supported()?t:Uc;if(!this._persistentStore||this._persistentStore!==n){this._persistentStore=n;var r="localStorage"===e?Ic:Rc;r._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(Wi(r._get(this._storageKey))),r._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}}])}();function cf(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function df(e){return!!e&&1===e.nodeType}function hf(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ff(e){return!!e&&3===e.nodeType}function pf(e){return!!e&&11===e.nodeType&&df(e.host)}function _f(e){return e?bi(e).split(/\s+/):[]}function vf(e,t){var n=kc(t);return!!(n&&e&&e.some(function(e){return n.match(e)}))}function gf(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 _f(t)}function mf(e){return Ai(e)?null:bi(e).split(/(\s+)/).filter(function(e){return Uf(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function yf(e){var t="";return Af(e)&&!Of(e)&&e.childNodes&&e.childNodes.length&&au(e.childNodes,function(e){var n;ff(e)&&e.textContent&&(t+=null!==(n=mf(e.textContent))&&void 0!==n?n:"")}),bi(t)}function bf(e){var t;return Ti(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var wf=["a","button","form","input","select","textarea","label"];function Sf(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}}function xf(e,t){if(Ti(t))return!0;for(var n,r,i=function(){var e=r.value;if(t.some(function(t){return Sf(e,t)}))return{v:!0}},s=f(e);!(r=s()).done;)if(n=i())return n.v;return!1}function kf(e){var t=e.parentNode;return!(!t||!df(t))&&t}var Cf=[".ph-no-autocapture","[data-ph-no-autocapture]"],Pf=["next","previous","prev",">","<"],Ef=[].concat(Pf,["+","-","−","–"]),Ff=function(e,t){return/[a-z0-9]/i.test(t)?e.includes(t):e===t},If=[".ph-no-rageclick",".ph-no-capture"],Tf=["","text","search","email","password","url","tel","number"];function Rf(e,t){if(!Wa||Mf(e))return!1;var n,r,i,s,o;if($i(t)?(n=!!t&&If,r=void 0,i=!1):(n=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:If,r=null==t?void 0:t.content_ignorelist,i=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===n)return!1;if(i&&function(e){return!(!e||!df(e))&&(!!hf(e,"textarea")||(hf(e,"input")?yi(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=Lf(e,!1).targetElementList;return!function(e,t){if(!1===e||Ti(e))return!1;var n;if(!0===e)n=Pf;else{if(!Pi(e))return!1;if(e.length>10)return iu.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,r=e.ariaLabel;return n.some(function(e){return Ff(t,e)||Ff(r,e)})})}(r,a.map(function(e){var t;return{safeText:yf(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!xf(a,n)}var Mf=function(e){return!e||hf(e,"html")||!df(e)},Lf=function(e,t){if(!Wa||Mf(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!hf(i,"body");)if(pf(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=kf(i);if(!s)break;if(t||wf.indexOf(s.tagName.toLowerCase())>-1)n=!0;else try{var o=Wa.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(n=!0)}catch(e){}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function Af(e){for(var t=new Set,n=0,r=e;r.parentNode&&!hf(r,"body");r=r.parentNode){if(n++>=1e3||t.has(r))return!1;t.add(r);var i=gf(r);if(yi(i,"ph-sensitive")||yi(i,"ph-no-capture"))return!1}if(yi(gf(e),"ph-include"))return!0;var s=e.type||"";if(Ri(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=e.name||e.id||"";return!Ri(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 Of(e){return!!(hf(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||hf(e,"select")||hf(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Df=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}))$"),$f=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,qf=[16,15,14,13],Bf=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Nf=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Hf=/[0-9A-Za-z_]/;function jf(e){for(var t=0,n=!1,r=e.length-1;r>=0;r--){var i=e.charCodeAt(r)-48;n&&(i*=2)>9&&(i-=9),t+=i,n=!n}return t%10==0}function Uf(e,t){if(void 0===t&&(t=!0),Ai(e))return!1;if(Ri(e)){if(e=bi(e),t?Df.test((e||"").replace(/[- ]/g,"")):function(e){var t;for($f.lastIndex=0;t=$f.exec(e);){var n=t[2];if(n)for(var r=n.replace(/[- ]/g,""),i=0;r.length>i;i++)for(var s=0,o=qf;o.length>s;s++){var a=i+o[s];if(r.length>=a){var u=r.slice(i,a);if(Df.test(u)&&jf(u))return!0}}}return!1}(e))return!1;if(t?Bf.test(e):function(e){var t;for(Nf.lastIndex=0;t=Nf.exec(e);){var n=t[1],r=t[3];if(!(n&&r&&Hf.test(n)&&Hf.test(r)))return!0}return!1}(e))return!1}return!0}function zf(e){var t=yf(e);return Uf(t=(t+" "+Vf(e)).trim())?t:""}function Vf(e){var t="";return e&&e.childNodes&&e.childNodes.length&&au(e.childNodes,function(e){var n;if(e&&"span"===(null==(n=e.tagName)?void 0:n.toLowerCase()))try{var r=yf(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Vf(e)).trim())}catch(e){iu.error("[AutoCapture]",e)}}),t}function Wf(e){return e.replace(/"|\\"/g,'\\"')}function Gf(e){var t=e.attr__class;if(t)return Pi(t)?t:_f(t)}var Kf=su("[Dead Clicks]"),Qf=function(){return!0},Zf=function(e){var t,n=!(null==(t=e.instance.persistence)||!t.get_property(sl)),r=e.instance.config.capture_dead_clicks;return $i(r)?r:!!Fi(r)||n},Jf=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={})[sl]=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=Eh.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",function(t){t?Kf.error("failed to load script",t):e()})},t._start=function(){var e;if(Qa){if(!this._lazyLoadedDeadClicksAutocapture&&null!=(e=Eh.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Fi(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=Eh.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Qa),Kf.info("starting...")}}else Kf.error("`document` not found. Cannot start.")},t.stop=function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Kf.info("stopping..."))},o(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}}])}(),Yf=su("[SegmentIntegration]");function Xf(e,t,n){void 0===n&&(n=!0);var r=e.config.segment;if(!r)return t();var i,s=function(e){return Ei(e.register)}(i=r)?{analytics:i}:i,o=s.analytics,a=s.filterProperties;!function(e,t,n,r){var i=function(t){var i=function(){return t.anonymousId()||fc()};e.config.get_device_id=i,r&&t.id()&&(e.register({distinct_id:t.id(),$device_id:i()}),e.persistence.set_property(Bl,ec)),n(r?void 0:t.anonymousId()||void 0)},s=t.user();"then"in s&&Ei(s.then)?s.then(i):i(s)}(e,o,function(n){o.register(function(e,t,n){var r=(void 0===n?{}:n).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Yf.warn("This browser does not have Promise support, and can not use the segment integration");var i=function(n,i){if(!i)return n;var s=!!t&&n.event.anonymousId===t&&!n.event.userId;s||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(Yf.info("No userId set, resetting PostHog"),e.reset()),s||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(Yf.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));var o=e.calculateEventProperties(i,n.event.properties);if(!Ai(r)){for(var a=n.event.properties||{},l={},c=0,d=Object.keys(o);d.length>c;c++){var h=d[c];ki.call(a,h)||(l[h]=o[h])}var p=function(e,t){for(var n,r=Pi(e)?e:[e],i=u({},t),s=f(r);!(n=s()).done;){var o=n.value;try{if(i=o(i),Ai(i))return null}catch(e){return Yf.error("Error in Segment filterProperties:",e),null}}return i}(r,l);if(Ai(p))return n;o=p}return n.event.properties=Object.assign({},o,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 i(e,e.event.event)},page:function(e){return i(e,ic)},identify:function(e){return i(e,oc)},screen:function(e){return i(e,"$screen")}}}(e,n,{filterProperties:a})).then(function(){t()},function(e){Yf.error("Failed to register the Segment integration",e),t()})},n)}var ep="posthog-js";function tp(e,t){var n=void 0===t?{}:t,r=n.organization,i=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 r&&i&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+i+"&query="+t.event_id),c&&(null==(f=e.exceptions)||f.sendExceptionEvent(g)),t}}var np=function(e,t,n,r,i,s){"use strict";this.name=ep,this.setupOnce=function(o){o(tp(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:null==s||s}))}},rp=function(){"use strict";function e(e){var t=this;this._onSessionIdChange=function(e,n,r){r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(iu.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),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,r=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==Wa?void 0:Wa.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r},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 r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var s=i.maxScrollHeight,o=i.lastScrollY,a=i.maxScrollY,u=i.maxContentHeight,l=i.lastContentY,c=i.maxContentY;if(!(Ti(s)||Ti(o)||Ti(a)||Ti(u)||Ti(l)||Ti(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?Zi(o/s,0,1,iu):1,h=s>1?Zi(a/s,0,1,iu):1,f=u>1?Zi(l/u,0,1,iu):1,p=u>1?Zi(c/u,0,1,iu):1;r=uu(r,{$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&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r},e}(),ip=["flags","surveys"],sp=((s={}).$people_distinct_id={exposure:"hidden"},s[Gu]={exposure:"hidden"},s.__cmpns={exposure:"hidden"},s[Yu]={exposure:"hidden"},s[Qu]={exposure:"hidden"},s[Ju]={exposure:"hidden"},s[Xu]={exposure:"event"},s[el]={exposure:"hidden"},s[al]={exposure:"hidden"},s[tl]={exposure:"event"},s[nl]={exposure:"hidden"},s[rl]={exposure:"event"},s[il]={exposure:"event"},s[sl]={exposure:"event"},s[ol]={exposure:"hidden"},s[ul]={exposure:"event"},s[ll]={exposure:"hidden"},s.$session_recording_enabled_server_side={exposure:"hidden"},s[_l]={exposure:"hidden"},s[vl]={exposure:"event"},s[cl]={exposure:"event",shouldSkipFromEventProperties:function(e){return Li(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[gl]={exposure:"hidden",storageGroup:"flags"},s[ml]={exposure:"hidden",storageGroup:"flags"},s[yl]={exposure:"hidden"},s[bl]={exposure:"hidden",storageGroup:"flags"},s[wl]={exposure:"hidden",storageGroup:"flags"},s[Sl]={exposure:"hidden",storageGroup:"flags",volatile:!0},s[xl]={exposure:"hidden",storageGroup:"flags"},s[kl]={exposure:"hidden"},s[Cl]={exposure:"hidden"},s[Pl]={exposure:"hidden"},s[El]={exposure:"hidden"},s[Il]={exposure:"hidden",storageGroup:"surveys"},s[Tl]={exposure:"hidden",storageGroup:"surveys",volatile:!0},s[Rl]={exposure:"event"},s[Ml]={exposure:"hidden"},s[Ll]={exposure:"hidden"},s[Al]={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[Ol]={exposure:"hidden"},s[Dl]={exposure:"hidden"},s[Fl]={exposure:"event"},s[$l]={exposure:"hidden"},s[ql]={exposure:"hidden",storageGroup:"flags",volatile:!0},s[Bl]={exposure:"hidden"},s[Nl]={exposure:"hidden"},s[Hl]={exposure:"hidden"},s[jl]={exposure:"hidden"},s[Ul]={exposure:"hidden"},s[zl]={exposure:"hidden"},s[Vl]={exposure:"hidden"},s[dl]={exposure:"event"},s[hl]={exposure:"event"},s[fl]={exposure:"event"},s[pl]={exposure:"event"},s[Kl]={exposure:"event"},s[Ql]={exposure:"event"},s[Zl]={exposure:"event"},s[Jl]={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),op=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ap=function(e){var t=sp[e];if(t)return t;for(var n=0,r=op;r.length>n;n++){var i=r[n],s=i[1];if(0===e.indexOf(i[0]))return s}},up={flags:ql,surveys:Tl},lp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],cp=function(e){return e+"_cookie_identity_change_pending"},dp=function(e){for(var t,n="",r=0,i=f(e);!(t=i()).done;){var s=t.value,o=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(r+o>1e3)break;n+=s,r+=o}return n},hp="main",fp=[gl,ml,bl,wl,Sl,ql,xl,Pl],pp=function(e){return-1!==fp.indexOf(e)},_p=[Qu,Ju],vp=function(e){return-1!==_p.indexOf(e)},gp=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){return e===t}},mp=function(e){if(!e)return{};var t=JSON.parse(e);return Fi(t)?t:{}},yp=function(e,t){au(e,function(n,r){var i=ap(r);i&&"event"!==i.exposure||{}.hasOwnProperty.call(t,r)||delete e[r]})},bp=function(){"use strict";function e(e,t,n){var r=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._metaIdentifierChangePending=new Set,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&&iu.info("Persistence loaded",e.persistence,u({},this.props)),this.update_config(e,e,t),this.save(),Wa){var i=function(){return r.flush()};_u(Wa,"beforeunload",i,{capture:!1}),_u(Wa,"pagehide",i,{capture:!1}),this._onStorage=function(e){if(r._splitStorageEligible&&(!e.storageArea||e.storageArea===(null==Wa?void 0:Wa.localStorage))&&e.key)if(e.key!==r._name){if(r._splitStorage){var t=ip.find(function(t){return e.key===r._groupEntryName(t)});t&&r._syncCrossTabFeatureFlagProperties(e.key,t)}}else r._syncCrossTabFeatureFlagProperties(e.key,hp)},_u(Wa,"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],r=e[1],i=t._pendingCrossTabFeatureFlagChanges.get(n);if(pp(n)&&!0!==i)if(!0!==r){var s=new Set(i||[]);r.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&&Wa&&(Wa.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 r,i;try{if(i=Rc._get(e),Li(i)){var s=this._slotWriteState(t);return s.storageValue=null,t!==hp&&(s.persisted=!1),!1}r=mp(i)}catch(e){return!1}var o=t===hp?r:Rc._parse(this._name);if(o&&this._hasCrossTabFeatureFlagIdentityMismatch(o))return!1;var a=this._mergeCrossTabFeatureFlagProperties(r,t,n);return t===hp&&this._splitStorage&&!gp(this._partitionProps().main,r)||this._rememberCrossTabStorageFingerprint(r,t,!0,i),a},t._hasCrossTabFeatureFlagIdentityMismatch=function(e){var t=this.props[zu],n=e[zu];return!Ti(t)&&!Ti(n)&&t!==n},t._rememberCrossTabStorageFingerprint=function(e,t,n,r){var i=this._slotWriteState(t);i.storageValue=r,t!==hp&&(i.persisted=n);try{i.fingerprint=this._entryFingerprint(e,t)}catch(e){i.fingerprint=void 0}},t._mergeCrossTabFeatureFlagProperties=function(e,t,n){var r=this,i=!1;return fp.forEach(function(n){var s,o=null==(s=ap(n))?void 0:s.storageGroup;if(!(t===hp&&r._splitStorage&&o||t!==hp&&o!==t)){var a=n in e,u=r._mergePendingCrossTabFeatureFlagChanges(n,a?e[n]:void 0),l=r._pendingCrossTabFeatureFlagChanges.has(n)?n in r.props:a;l===n in r.props&&gp(u,r.props[n])||(l?r._setProp(n,u,!1):r._deleteProp(n,!1),i=!0)}}),i&&n&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}),i},t._reconcileCrossTabFeatureFlagPropertiesBeforeWrite=function(){var e=this;if(!this._splitStorageEligible)return!1;try{this._crossTabFeatureFlagIdentityMismatch=!1;var t,n=Rc._get(this._name),r=this._slotWriteState(hp),i=!1,s=!1;if(n!==r.storageValue)if(Li(n))r.storageValue=null;else{if(t=mp(n),this._crossTabFeatureFlagIdentityMismatch=!this._localIdentityChangePending&&this._hasCrossTabFeatureFlagIdentityMismatch(t),this._crossTabFeatureFlagIdentityMismatch)return!1;s=this._mergeCrossTabFeatureFlagProperties(t,hp,!1),!this._splitStorage||gp(this._partitionProps().main,t)?this._rememberCrossTabStorageFingerprint(t,hp,!0,n):r.storageValue=n,i=!0}return this._splitStorage&&ip.forEach(function(n){var r=Rc._get(e._groupEntryName(n)),o=e._slotWriteState(n),a=t||{},u=i&&fp.some(function(e){var t;return(null==(t=ap(e))?void 0:t.storageGroup)===n&&e in a});if(r!==o.storageValue||u){if(Li(r))return o.storageValue=null,o.persisted=!1,void(u&&(s=e._mergeCrossTabFeatureFlagProperties(a,n,!1)||s));var l=mp(r);s=e._mergeCrossTabFeatureFlagProperties(l,n,!1)||s,e._rememberCrossTabStorageFingerprint(l,n,!0,r)}}),s}catch(e){return!1}},t._setCrossTabFeatureFlagChangesPending=function(e,t){this._pendingCrossTabFeatureFlagChanges.set(e,t);var n=ap(e);null!=n&&n.volatile||(this._slotWriteState((this._splitStorage?null==n?void 0:n.storageGroup:void 0)||hp).fingerprint=void 0,this._markGroupDirty(e))},t._markAllCrossTabFeatureFlagChangesPending=function(){var e=this;fp.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=mp(t);this._slotWriteState(hp).storageValue=t,fp.forEach(function(t){var r,i=e._splitStorage?null==(r=ap(t))?void 0:r.storageGroup:void 0,s=i?Rc._get(e._groupEntryName(i)):null;if(i){var o=e._slotWriteState(i);o.storageValue=s,o.persisted=!Li(s)}var a=i&&!Li(s)?mp(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 r=new Set(Pi(t)?t:[]),i=new Set(Pi(this.props[e])?this.props[e]:[]);return n.forEach(function(e){return i.has(e)?r.add(e):r.delete(e)}),Array.from(r)}var s=Fi(t)?u({},t):{},o=Fi(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(pp(e)){var r=this._pendingCrossTabFeatureFlagChanges.get(e);if(!0!==r){var i=t;if(this._splitStorageEligible)try{var s,o=this._splitStorage?null==(s=ap(e))?void 0:s.storageGroup:void 0,a=o?this._groupEntryName(o):this._name;i=mp(Rc._get(a))[e]}catch(e){}var u=new Set(r||[]);if("$active_feature_flags"===e){if(!Ti(t)&&!Pi(t)||!Ti(i)&&!Pi(i)||!Pi(n))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var l=new Set(t||[]),c=new Set(i||[]),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(!Fi(n))return void(gp(i,n)?this._pendingCrossTabFeatureFlagChanges.delete(e):this._setCrossTabFeatureFlagChangesPending(e,!0));if(!Ti(t)&&!Fi(t)||Ti(t)&&Ii(n)&&Ti(i))return void this._setCrossTabFeatureFlagChangesPending(e,!0);var h=Fi(t)?t:{},f=Fi(i)?i:{};new Set([].concat(Object.keys(h),Object.keys(n))).forEach(function(e){e in h==e in n&&gp(h[e],n[e])||u.add(e)}),u.forEach(function(e){e in f==e in n&&gp(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 Oi(t)&&t>0?t:0},t._rememberCurrentCookieProperties=function(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=$c(e,this._config.cookie_persisted_properties||[]),n=Bc(t,this._config.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(n),i=Ic._get(this._name)||void 0;i&&Hc(this._name,i)===r&&(this._lastSeenCookiePropertiesFingerprint=r,this._lastSeenMainCookieValue=i)}catch(e){}else try{var s=Ic._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=s?Hc(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,r=this;if(void 0===t&&(t=!1),this._disabled&&!t||this._cookieSyncSuppressed||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{n=Ic._get(this._name)||void 0}catch(e){}if(!n||n===this._lastSeenMainCookieValue)return!1;var i,s=Hc(this._name,n);try{i=Dc(JSON.parse(n))}catch(e){return!1}if((Ic._get(this._name)||void 0)!==n)return!1;this._lastSeenCookiePropertiesFingerprint=s,this._lastSeenMainCookieValue=n;var o=Nc(this._name,n),a=[].concat(Lc,o.properties),u={};if(Object.keys(i).forEach(function(e){var t=i[e];(Ti(t)||Li(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(u[e]=!0,delete i[e])}),Ii(i))return!1;var l="distinct_id"in i||"anonymous"===i.$user_state||"identified"===i.$user_state,c=this.props,d=c[zu],h=c[Bl],f=uu({},c);[].concat(Lc,e.cookie_persisted_properties||[]).forEach(function(e){if(-1!==a.indexOf(e)&&!(e in i)&&!u[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=f[e];(o.isValid||-1===Lc.indexOf(e)||!1!==t&&0!==t)&&delete f[e]}}),this.props=uu(f,i),fp.forEach(function(e){var t=e in r.props;e in c===t&&gp(c[e],r.props[e])||(t?r._markPendingCrossTabFeatureFlagChanges(e,c[e],r.props[e]):r._setCrossTabFeatureFlagChangesPending(e,!0))}),!l||"$user_state"in i||"$user_state"in this.props||this._setProp(Bl,Xl);var p=this.props[zu],_=this.props[Bl];return!l||p===d&&_===h||(this._localIdentityChangePending=!0,this._cookieIdentityChangePending=!0,Vc._set(cp(this._name),!0),this._deleteProp(Pl),this._deleteProp(ml),this._deleteProp(gl),this._deleteProp(bl),this._deleteProp(wl),this._deleteProp(Sl),this._deleteProp(ql),this._deleteProp($l),this._deleteProp(Ol),"anonymous"!==_||"identified"!==h&&"anonymous"!==i.$user_state&&(Ti(d)||p===d)||(yp(this.props,i),this._deleteProp(El)),"identified"===_?this.props.$user_id=p:delete this.props.$user_id,this._deleteProp(Gu)),!0},t.consumeCookieIdentityChange=function(){var e=cp(this._name),t=this._cookieIdentityChangePending||!!Vc._get(e);return this._cookieIdentityChangePending=!1,t&&Vc._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&&(Ti(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[hp],this._writeNow(!0))},t._endCookieSyncSuppression=function(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():Ti(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}},t.isDisabled=function(){return!!this._disabled},t._buildStorage=function(e){-1===lp.indexOf(e.persistence.toLowerCase())&&(iu.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(Lc,e);return u({},Rc,{_parse:function(e){try{var r,i={};try{r=Ic._get(e)||void 0,i=r?Dc(JSON.parse(r)):{}}catch(e){}var s,o=JSON.parse(Rc._get(e)||"{}");if(t){var a=Nc(e,r),u=[].concat(Lc,a.properties),l={};Object.keys(i).forEach(function(e){var t=i[e];Li(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[zu],f=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";n.forEach(function(e){if(-1!==u.indexOf(e)&&!(e in i)&&(c||"distinct_id"!==e&&"$user_state"!==e)){var t=o[e];(a.isValid||-1===Lc.indexOf(e)||!1!==t&&0!==t)&&delete o[e]}}),!c||"$user_state"in i||"$user_state"in o||(o[Bl]=Xl),!c||("distinct_id"in l?l[zu]:o[zu])===h&&("$user_state"in l?l[Bl]:o[Bl])===f||(Mc.forEach(function(e){return delete o[e]}),"identified"===l.$user_state&&"distinct_id"in l?o.$user_id=l[zu]:delete o.$user_id,"identified"!==l.$user_state&&(delete o[Fl],delete o[El]),delete o.__alias)}s=uu(o,l)}else s=uu(i,o);return Rc._set(e,s),s}catch(e){}return null},_set:function(n,r,i,s,o,a){var u=Rc._set(n,r,void 0,void 0,a);try{var l=$c(r,e);if(Object.keys(l).length){if(t){var c=Ac(n),d=Bc(l,e);if(Ic._set(c,d,i,s,o,a),Ic._get(c)!==JSON.stringify(d)){Ic._remove(c,s);var h=$c(r);return Ic._set(n,h,i,s,o,a),u}}Ic._set(n,l,i,s,o,a)}}catch(e){Rc._error(e)}return u},_remove:function(e,t){try{null==Wa||Wa.localStorage.removeItem(e),Ic._remove(e,t),Ic._remove(Ac(e),t)}catch(e){Rc._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),r=!1,i=!1,s=e.persistence.toLowerCase();return"localstorage"===s&&Rc._is_supported()?(t=Rc,i=!0):"localstorage+cookie"===s&&n._is_supported()?(t=n,i=!0,r=!0):"sessionstorage"===s&&Vc._is_supported()?t=Vc:"memory"===s?t=Uc:"cookie"===s&&Ic._is_supported()?(t=Ic,r=!0):n._is_supported()?(t=n,i=!0,r=!0):Ic._is_supported()?(t=Ic,r=!0):t=Uc,this._splitStorageEligible=i,this._storesIdentityInCookie=r,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 au(this.props,function(t,n){var r=ap(n);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.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(),r=n?Rc._parse(this._name):null,i={};if(n)try{au(i=Dc(Ic._parse(this._name)),function(e,t){(Ti(e)||Li(e)||""===e)&&delete i[t]})}catch(e){}var s=this._storage._parse(this._name);if(s&&(this.props=uu({},s)),this._splitStorage&&this._loadGroupEntries(),n&&s){var o,a,u=null==r?void 0:r[zu],l=null!==(o=null==r?void 0:r.$user_state)&&void 0!==o?o:"anonymous",c=s[zu],d=null!==(a=s.$user_state)&&void 0!==a?a:"anonymous";if(c!==u||d!==l){this._cookieIdentityChangePending=!0,Vc._set(cp(this._name),!0);var h=uu({},this.props);Mc.forEach(function(e){return delete h[e]}),"anonymous"!==d||"identified"!==l&&"anonymous"!==i.$user_state&&(Ti(u)||c===u)||(yp(h,i),delete h[El]),this.props=h;var f=new Set;Mc.forEach(function(e){var t,n=null==(t=ap(e))?void 0:t.storageGroup;n&&f.add(n)}),f.forEach(function(e){var n={};au(t.props,function(t,r){var i;(null==(i=ap(r))?void 0:i.storageGroup)===e&&(n[r]=t)}),Ii(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)})})}}Vc._get(cp(this._name))&&(this._cookieIdentityChangePending=!0)}},t._loadGroupEntries=function(){for(var e=0,t=ip;t.length>e;e++){var n=t[e],r=Rc._parse(this._groupEntryName(n));if(r&&!Ii(r)){var i=this._slotWriteState(n);i.persisted=!0,this._mainCarriesGroupKey(n)||(i.fingerprint=this._entryFingerprint(r,n)),this._groupEntryIsStale(n,r)||uu(this.props,r)}}},t._mainCarriesGroupKey=function(e){return Object.keys(this.props).some(function(t){var n;return(null==(n=ap(t))?void 0:n.storageGroup)===e})},t._groupEntryIsStale=function(e,t){var n=up[e];if(!n)return!1;var r=t[n],i=this.props[n];return Oi(r)&&Oi(i)&&i>r},t.refreshKey=function(e){var t;if(!this._disabled&&!this._metaIdentifierChangePending.has(e)){var n=this._splitStorage?null==(t=ap(e))?void 0:t.storageGroup:void 0,r=n?Rc._parse(this._groupEntryName(n)):this._storage._parse(this._name);if(r&&e in r)this._setProp(e,r[e],!1);else{if(n){var i=this._storage._parse(this._name);if(i&&e in i)return void this._setProp(e,i[e],!1)}this._deleteProp(e,!1)}}},t.save=function(){var e=this;if(!this._disabled){var t=this._saveDebounceMs();t>0?Ti(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout(function(){e._pendingSaveTimer=void 0,e._writeNow()},t)):this._writeNow()}},t.flush=function(){Ti(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())},t._writeNow=function(e){var t=this;if(void 0===e&&(e=!1),!(this._disabled||this._cookieSyncSuppressed&&!e)){e||(this.syncCookieProperties(),this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase()||_p.forEach(function(e){return t.refreshKey(e)}));var n=!e&&!this._storageMigrationInProgress;n||(this._crossTabFeatureFlagIdentityMismatch=!1);var r=!!n&&this._reconcileCrossTabFeatureFlagPropertiesBeforeWrite();if(this._crossTabFeatureFlagIdentityMismatch)this._config.debug&&iu.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this._splitStorage)return this._writeNowSplit(),void(r&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()}));var i=this._writeEntry(this._storage,this._name,this.props,hp);"written"===i&&this._rememberCurrentCookieProperties(this.props),"failed"!==i&&(this._pendingCrossTabFeatureFlagChanges.clear(),this._localIdentityChangePending=!1,this._metaIdentifierChangePending.clear()),r&&this._crossTabFeatureFlagHandlers.forEach(function(e){return e()})}}},t._writeNowSplit=function(){var e=this,t=this._partitionProps(),n=t.main,r=t.groups,i=this._writeEntry(this._storage,this._name,n,hp);"written"===i&&this._rememberCurrentCookieProperties(n),"failed"!==i&&(this._localIdentityChangePending=!1,this._metaIdentifierChangePending.clear(),fp.forEach(function(t){var n;null!=(n=ap(t))&&n.storageGroup||e._pendingCrossTabFeatureFlagChanges.delete(t)}));for(var s=function(){var t,n=a[o],i=r[n];if(Ii(i)&&(null==(t=e._slotState[n])||!t.persisted))return fp.forEach(function(t){var r;(null==(r=ap(t))?void 0:r.storageGroup)===n&&e._pendingCrossTabFeatureFlagChanges.delete(t)}),1;var s=e._writeEntry(Rc,e._groupEntryName(n),i,n);"failed"!==s&&fp.forEach(function(t){var r=ap(t);(null==r?void 0:r.storageGroup)!==n||"written"!==s&&r.volatile||e._pendingCrossTabFeatureFlagChanges.delete(t)})},o=0,a=ip;a.length>o;o++)if(s())continue},t._partitionProps=function(){var e={},t={flags:{},surveys:{}};return au(this.props,function(n,r){var i,s=null==(i=ap(r))?void 0:i.storageGroup;s?t[s][r]=n:e[r]=n}),{main:e,groups:t}},t._entryFingerprint=function(e,t){if(t===hp)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var n={};return au(e,function(e,t){var r;n[t]=null!=(r=ap(t))&&r.volatile?"__volatile__":e}),JSON.stringify(n)},t._writeEntry=function(e,t,n,r){var i,s=this._slotWriteState(r);if(r!==hp&&!s.dirty&&!Ti(s.fingerprint))return"skipped";try{if((i=this._entryFingerprint(n,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(e){i=void 0}return e._set(t,n,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(s.dirty=!1,r!==hp&&(s.persisted=!0),Ti(i)||(s.fingerprint=i),this._splitStorageEligible&&(s.storageValue=Rc._get(t)),"written"):(this._config.debug&&iu.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(),Ti(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 r=0,i=ip;i.length>r;r++)Rc._remove(this._groupEntryName(i[r]));n?delete this._slotState[hp]: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 r=this;if(Fi(e)){this.syncCookieProperties(),Ti(t)&&(t="None"),this._expire_days=Ti(n)?this._default_expiry:n;var i=!1;if(au(e,function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r._setProp(n,e),i=!0)}),i)return this.save(),!0}return!1},t.register=function(e,t){var n=this;if(Fi(e)){this.syncCookieProperties(),this._expire_days=Ti(t)?this._default_expiry:t;var r=!1;if(au(e,function(t,i){e.hasOwnProperty(i)&&(n.props[i]!==t||Fi(t)||Pi(t))&&(n._setProp(i,t),r=!0)}),r)return this.save(),!0}return!1},t.unregister=function(e){this.syncCookieProperties();for(var t,n=!1,r=f("string"==typeof e?[e]:e);!(t=r()).done;){var i=t.value;i in this.props&&(this._deleteProp(i),n=!0)}n&&this.save()},t.update_campaign_params=function(){var e=null==Qa?void 0:Qa.URL;if(e!==this._campaign_params_url){var t=eh(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties),n=!Ii(du(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==Qa?void 0:Qa.referrer)?nh(e):{})},t.update_referrer_info=function(){var e;this.register_once({$referrer:sh(),$referring_domain:null!=Qa&&Qa.referrer&&(null==(e=vc(Qa.referrer))?void 0:e.host)||ih},void 0)},t.set_initial_person_info=function(){var e;if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=oh(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes);this.register_once(((e={})[zl]=this._storesIdentityInCookie?{r:dp(t.r),u:t.u?dp(t.u):void 0}:t,e),void 0)}},t.get_initial_props=function(){var e=this,t={};au([Ul,jl],function(n){var r=e.props[n];r&&au(r,function(e,n){t["$initial_"+wi(n)]=e})});var n=this.props[zl];return n&&uu(t,function(e,t){void 0===t&&(t=!1);var n=ah(e,t),r={};return au(n,function(e,t){r["$initial_"+wi(t)]=e}),r}(n,this._config.disable_capture_url_hashes)),t},t.safe_merge=function(e){return au(this.props,function(t,n){n in e||(e[n]=t)}),e},t.update_config=function(e,t,n){var r=e.persistence!==t.persistence,i=!function(e,t){if(e.length!==t.length)return!1;var n=[].concat(e).sort(),r=[].concat(t).sort();return n.every(function(e,t){return e===r[t]})}(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=r||i,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!n,l=!!this._disabled&&!a;a||this._syncCookieProperties(t,l),this._config=e,!a&&(r||i||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[hp],this._writeNow()))}finally{this._storageMigrationInProgress=!1,f&&this._endCookieSyncSuppression()}},t._truncateExistingPersonInfoForCookie=function(){var e=this.props[zl];if(this._storesIdentityInCookie&&Fi(e)&&"string"==typeof e.r){var t=dp(e.r),n="string"==typeof e.u?dp(e.u):e.u;t===e.r&&n===e.u||this._setProp(zl,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(Yu,n),this.save()},t.remove_event_timer=function(e){var t=this.props.__timers||{},n=t[e];return Ti(n)||(delete t[e],this._setProp(Yu,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 r;void 0===n&&(n=!0);var i=this.props[e];this.props[e]=t,n&&("distinct_id"!==e&&"$user_state"!==e||i===t||(this._localIdentityChangePending=!0),vp(e)&&!gp(i,t)&&this._metaIdentifierChangePending.add(e),this._markPendingCrossTabFeatureFlagChanges(e,i,t),null!=(r=ap(e))&&r.volatile||this._markGroupDirty(e))},t._deleteProp=function(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(pp(e)&&this._setCrossTabFeatureFlagChangesPending(e,!0),vp(e)&&this._metaIdentifierChangePending.add(e),this._markGroupDirty(e))},t._markGroupDirty=function(e){var t,n=null==(t=ap(e))?void 0:t.storageGroup;n&&(this._slotWriteState(n).dirty=!0)},t._slotWriteState=function(e){return this._slotState[e]||(this._slotState[e]={})},e}(),wp=su("[RateLimiter]"),Sp=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){wp.info((e||"events")+" is quota limited."),t.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void wp.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,r;void 0===e&&(e=!1);var i=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:i,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>i&&(a.tokens=i);var u=1>a.tokens;if(u||e||(a.tokens=Math.max(0,a.tokens-1)),u&&!e){var l=(Oi(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this._captureWarning(l)&&(a.dropped=0)}return this.lastEventRateLimited=u,null==(r=this.instance.persistence)||r.set_property(Hl,a),{isRateLimited:u,remainingTokens:a.tokens}},t._isPropertyAllowed=function(e){var t=this.instance.config.property_denylist;return!Pi(t)||!t.includes(e)},t._triggeringPage=function(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=Za&&Za.pathname)return""+(null!==(e=Za.origin)&&void 0!==e?e:"")+Za.pathname},t._captureWarning=function(e){var t,n,r=this.captureEventsBurstLimit,i=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 "+i+" events per second and "+r+" 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)}}])}(),xp=su("[RemoteConfig]"),kp=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadRemoteConfigJs=function(e){var t,n,r=this;null!=(t=Eh.__PosthogExtensions__)&&t.loadExternalDependency?null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"remote-config",function(){return e(r.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 xp.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void xp.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(function(t){if(!t)return xp.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){xp.error("Error loading remote config",e),this._onRemoteConfig()}},t._onRemoteConfig=function(e,t){!e&&t&&(0===t.statusCode?t.error||xp.warn("Failed to fetch remote config from PostHog."):xp.error("Failed to fetch remote config from PostHog."));try{this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1})}catch(e){xp.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){xp.error("Error loading feature flags",e)}},o(e,[{key:"remoteConfig",get:function(){var e;return null==(e=Eh._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}}])}(),Cp=Uint8Array,Pp=Uint16Array,Ep=Uint32Array,Fp=new Cp([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]),Ip=new Cp([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]),Tp=new Cp([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rp=function(e,t){for(var n=new Pp(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new Ep(n[30]);for(r=1;30>r;++r)for(var s=n[r];n[r+1]>s;++s)i[s]=s-n[r]<<5|r;return[n,i]},Mp=Rp(Fp,2),Lp=Mp[1];Mp[0][28]=258,Lp[258]=28;for(var Ap=Rp(Ip,0)[1],Op=new Pp(32768),Dp=0;32768>Dp;++Dp){var $p=(43690&Dp)>>>1|(21845&Dp)<<1;Op[Dp]=((65280&($p=(61680&($p=(52428&$p)>>>2|(13107&$p)<<2))>>>4|(3855&$p)<<4))>>>8|(255&$p)<<8)>>>1}var qp=function(e,t,n){for(var r=e.length,i=0,s=new Pp(t);r>i;++i)++s[e[i]-1];var o,a=new Pp(t);for(i=0;t>i;++i)a[i]=a[i-1]+s[i-1]<<1;if(n){o=new Pp(1<<t);var u=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=a[e[i]-1]++<<c,h=d|(1<<c)-1;h>=d;++d)o[Op[d]>>>u]=l}else for(o=new Pp(r),i=0;r>i;++i)o[i]=Op[a[e[i]-1]++]>>>15-e[i];return o},Bp=new Cp(288);for(Dp=0;144>Dp;++Dp)Bp[Dp]=8;for(Dp=144;256>Dp;++Dp)Bp[Dp]=9;for(Dp=256;280>Dp;++Dp)Bp[Dp]=7;for(Dp=280;288>Dp;++Dp)Bp[Dp]=8;var Np=new Cp(32);for(Dp=0;32>Dp;++Dp)Np[Dp]=5;var Hp=qp(Bp,9,0),jp=qp(Np,5,0),Up=function(e){return(e/8|0)+(7&e&&1)},zp=function(e,t,n){(null==t||0>t)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Pp?Pp:e instanceof Ep?Ep:Cp)(n-t);return r.set(e.subarray(t,n)),r},Vp=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Wp=function(e,t,n){var r=t/8|0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Gp=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new Cp(0),0];if(1==i){var o=new Cp(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!=i-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(r=1;i>r;++r)s[r].s>h&&(h=s[r].s);var f=new Pp(h+1),p=Kp(n[c-1],f,0);if(p>t){r=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});i>r;++r){var m=s[r].s;if(t>=f[m])break;_+=g-(1<<p-f[m]),f[m]=t}for(_>>>=v;_>0;){var y=s[r].s;t>f[y]?_-=1<<t-f[y]++-1:++r}for(;r>=0&&_;--r){var b=s[r].s;f[b]==t&&(--f[b],++_)}p=t}return[new Cp(f),p]},Kp=function(e,t,n){return-1==e.s?Math.max(Kp(e.l,t,n+1),Kp(e.r,t,n+1)):t[e.s]=n},Qp=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Pp(++t),r=0,i=e[0],s=1,o=function(e){n[r++]=e},a=1;t>=a;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&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(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},Zp=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Jp=function(e,t,n){var r=n.length,i=Up(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;r>s;++s)e[i+s+4]=n[s];return 8*(i+4+r)},Yp=function(e,t,n,r,i,s,o,a,u,l,c){Vp(t,c++,n),++i[256];for(var d=Gp(i,15),h=d[0],f=d[1],p=Gp(s,15),_=p[0],v=p[1],g=Qp(h),m=g[0],y=g[1],b=Qp(_),w=b[0],S=b[1],x=new Pp(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[Tp[F-1]];--F);var I,T,R,M,L=l+5<<3,A=Zp(i,Bp)+Zp(s,Np)+o,O=Zp(i,h)+Zp(s,_)+o+14+3*F+Zp(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(A>=L&&O>=L)return Jp(t,c,e.subarray(u,u+l));if(Vp(t,c,1+(A>O)),c+=2,A>O){I=qp(h,f,0),T=h,R=qp(_,v,0),M=_;var D=qp(P,E,0);for(Vp(t,c,y-257),Vp(t,c+5,S-1),Vp(t,c+10,F-4),c+=14,k=0;F>k;++k)Vp(t,c+3*k,P[Tp[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)Vp(t,c,D[H=31&N[k]]),c+=P[H],H>15&&(Vp(t,c,N[k]>>>5&127),c+=N[k]>>>12)}}else I=Hp,T=Bp,R=jp,M=Np;for(k=0;a>k;++k)if(r[k]>255){var H;Wp(t,c,I[257+(H=r[k]>>>18&31)]),c+=T[H+257],H>7&&(Vp(t,c,r[k]>>>23&31),c+=Fp[H]);var j=31&r[k];Wp(t,c,R[j]),c+=M[j],j>3&&(Wp(t,c,r[k]>>>5&8191),c+=Ip[j])}else Wp(t,c,I[r[k]]),c+=T[r[k]];return Wp(t,c,I[256]),c+T[256]},Xp=new Ep([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),e_=new Cp(0),t_=function(){for(var e=new Ep(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),n_=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function r_(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;t.length>r;++r)n=t_[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,s,o,a,u,l=(i=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,n,r,i,s){var o=e.length,a=new Cp(r+o+5*(1+Math.floor(o/7e3))+i),u=a.subarray(r,a.length-i),l=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var d=c+65535;o>d?l=Jp(u,l,e.subarray(c,d)):(u[c]=s,l=Jp(u,l,e.subarray(c,o)))}else{for(var h=Xp[t-1],f=h>>>13,p=8191&h,_=(1<<n)-1,v=new Pp(32768),g=new Pp(_+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 Ep(25e3),S=new Pp(288),x=new Pp(32),k=0,C=0,P=(c=0,0),E=0,F=0;o>c;++c){var I=b(c),T=32767&c,R=g[I];if(v[T]=R,g[I]=T,c>=E){var M=o-c;if((k>7e3||P>24576)&&M>423){l=Yp(e,u,0,w,S,x,C,P,F,c-F,l),P=k=C=0,F=c;for(var L=0;286>L;++L)S[L]=0;for(L=0;30>L;++L)x[L]=0}var A=2,O=0,D=p,q=T-R&32767;if(M>2&&I==b(c-q))for(var B=Math.min(f,M)-1,N=Math.min(32767,c),H=Math.min(258,M);N>=q&&--D&&T!=R;){if(e[c+A]==e[c+A-q]){for(var j=0;H>j&&e[c+j]==e[c+j-q];++j);if(j>A){if(A=j,O=q,j>B)break;var U=Math.min(q,j-2),z=0;for(L=0;U>L;++L){var V=c-q+L+32768&32767,W=V-v[V]+32768&32767;W>z&&(z=W,R=V)}}}q+=(T=R)-(R=v[T])+32768&32767}if(O){w[P++]=268435456|Lp[A]<<18|Ap[O];var G=31&Lp[A],K=31&Ap[O];C+=Fp[G]+Ip[K],++S[257+G],++x[K],E=c+A,++k}else w[P++]=e[c],++S[e[c]]}}l=Yp(e,u,s,w,S,x,C,P,F,c-F,l),s||(l=Jp(u,l,e_))}return zp(a,0,r+Up(l)+i)}(i,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.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&&n_(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),n_(l,c-8,n.d()),n_(l,c-4,r),l}var i_=!!Ya||!!Ja,s_=new WeakMap,o_="text/plain",a_=0,u_=!1,l_=function(e,t){var n=e.split("#"),r=n[1],i=n[0].split("?"),s=i[0],o=i[1];if(!o)return e;var a=o.split("&").filter(function(e){return e.split("=")[0]!==t}).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},c_=function(e,t,n){var r;void 0===n&&(n=!0);var i=e.split("?"),s=i[0],o=i[1],a=u({},t),l=null!==(r=null==o?void 0:o.split("&").map(function(e){var t,r=e.split("="),i=r[0],s=n&&null!==(t=a[i])&&void 0!==t?t:r[1];return delete a[i],i+"="+s}))&&void 0!==r?r:[],c=function(e,t){var n,r;void 0===t&&(t="&");var i=[];return au(e,function(e,t){Ti(e)||Ti(t)||"undefined"===t||(n=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+"="+n)}),i.join(t)}(a);return c&&l.push(c),l.length>0?s+"?"+l.join("&"):s},d_=function(e){if(e._encodedBody)return e._encodedBody;var t=e.data,n=e.compression;if(t){if(n===Nr){var r=r_(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Cp(e.length+(e.length>>>1)),r=0,i=function(e){n[r++]=e},s=0;t>s;++s){if(r+5>n.length){var o=new Cp(r+8+(t-s<<1));o.set(n),n=o}var a=e.charCodeAt(s);128>a?i(a):2048>a?(i(192|a>>>6),i(128|63&a)):a>55295&&57344>a?(i(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++s))>>>18),i(128|a>>>12&63),i(128|a>>>6&63),i(128|63&a)):(i(224|a>>>12),i(128|a>>>6&63),i(128|63&a))}return zp(n,0,r)}(_c(t)),{mtime:0});return{contentType:o_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Hr){var i=function(e){return"data="+encodeURIComponent("string"==typeof e?e:_c(e))}(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))})):e}(_c(t)));return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=_c(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},h_=function(e){var t,n,r=function(){return"sendBeacon"===e.transport?{url:c_(e.url,{compression:Hr}),encodedBody:d_(u({},e,{compression:Hr,_encodedBody:void 0}))}:{url:l_(e.url,"compression"),encodedBody:d_(u({},e,{compression:void 0,_encodedBody:void 0}))}};try{t=d_(e)}catch(t){if(ha(e.compression,gc(e.url,"compression")))return iu.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&ha(e.compression,gc(e.url,"compression"))&&!((n=t.body)instanceof ArrayBuffer?da(new Uint8Array(n)):ArrayBuffer.isView(n)&&da(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(u_=!0,r()):{url:e.url,encodedBody:t}},f_=function(e){try{return h_(e)}catch(t){return iu.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},p_=function(){var e=h(l().m(function e(t){var n,r,i;return l().w(function(e){for(;;)switch(e.n){case 0:return n=_c(t.data),e.n=1,ga(n,uf.DEBUG,{rethrow:!0});case 1:if(r=e.v){e.n=2;break}return e.a(2,t);case 2:return e.n=3,r.arrayBuffer();case 3:return e.a(2,u({},t,{_encodedBody:{contentType:o_,body:i=e.v,estimatedSize:i.byteLength}}))}},e)}));return function(t){return e.apply(this,arguments)}}(),__=/Failed to fetch|NetworkError|Load failed/i,v_=function(e){return"TypeError"===(null==e?void 0:e.name)&&__.test((null==e?void 0:e.message)||"")},g_=function(e){try{var t=function(e,t){if(void 0===t&&(t=Date.now()),"string"==typeof e&&e){var n=e.trim(),r=/^\d+\s*,/.test(n)?n.slice(0,n.indexOf(",")).trim():n;if(/^\d+$/.test(r)){var i=1e3*Math.min(Number(r),300);return i>0?i:void 0}if(/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(r)){var s=/^\w{3} \w{3} /.test(r)?r+" GMT":r,o=Date.parse(s)-t;if(Number.isFinite(o)&&o>0)return Math.min(o,uo)}}}(e());return Ti(t)?void 0:Math.min(t,3e4)}catch(e){return}},m_=function(e){var t=f_(e);if(t){var n=new Ya;s_.set(n,!0);var r=t.encodedBody;n.open(e.method||"GET",t.url,!0);var i=null!=r?r:{},s=i.contentType,o=i.body;au(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,g_(function(){return n.getResponseHeader("Retry-After")}))}},n.send(o)}},y_=function(e){var t=f_(e);if(t){var n=t.url,r=t.encodedBody,i=null!=r?r:{},s=i.contentType,o=i.body,a=i.estimatedSize,l=new Headers;au(e.headers,function(e,t){l.append(t,e)}),s&&l.append("Content-Type",s);var c=null,d=!1;if(Xa){var h=new Xa;c={signal:h.signal,timeout:setTimeout(function(){d=!0;try{h.abort(fo("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}catch(e){p(e)}var t},e.timeout)}}var f=!1,p=function(t){f||(f=!0,d&&"AbortError"===(null==t?void 0:t.name)||v_(t)?iu.warn(t):iu.error(t),null==e.callback||e.callback({statusCode:0,error:t}))},_=0,v=function(){a_-=_,_=0,c&&clearTimeout(c.timeout)};try{var g,m=u({method:(null==e?void 0:e.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:o,signal:null==(g=c)?void 0:g.signal},e.fetchOptions),y=null!=a?a:Ti(o)?0:void 0;m.keepalive="POST"===m.method&&!e._keepaliveDisabled&&!1!==m.keepalive&&m.body===o&&!Ti(y)&&y>=0&&52428.8>a_+y,m.keepalive&&(a_+=_=y),Ja(n,m).then(function(t){return t.text().then(function(n){if(!f){var r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){iu.error(e)}f=!0,v(),null==e.callback||e.callback(r,g_(function(){return t.headers.get("Retry-After")}))}})}).catch(function(e){v(),p(e)}).finally(v)}catch(e){v(),p(e)}}},b_=function(e){try{var t,n=h_(e),r=n.url,i=n.encodedBody,s=null!=i?i:{},o=s.body,a=s.estimatedSize;if(!o)return;var l=o instanceof Blob?o:new Blob([o],{type:s.contentType});if(Ka.sendBeacon(r,l))return;var c=Pi(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(Pi(c)&&c.length>1&&(null!=a?a:0)>16384){var d=Math.ceil(c.length/2),h=function(t){return Pi(e.data)?t:u({},e.data,{batch:t})};return b_(u({},e,{data:h(c.slice(0,d))})),void b_(u({},e,{data:h(c.slice(d))}))}iu.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to "+(Ja?"fetch":"XHR")),Ja?y_(u({},e,{_keepaliveDisabled:!0})):m_(e)}catch(e){iu.warn("Beacon send failed",e)}},w_=function(e,t,n,r){var i,s="query"===r?"POST"===t?"sent_at":"_":void 0;return c_(n===Nr?l_(e,"compression"):e,u({},s?((i={})[s]=Date.now().toString(),i):{},n===Nr?{}:{compression:n}))},S_=function(){var e=[];return Ja&&e.push({transport:"fetch",method:y_}),Ya&&e.push({transport:"XHR",method:m_}),null!=Ka&&Ka.sendBeacon&&e.push({transport:"sendBeacon",method:b_}),e}(),x_=!i_&&-1===(null==tu?void 0:tu.indexOf("MSIE"))&&-1===(null==tu?void 0:tu.indexOf("Mozilla"));function k_(e,t,n){var r;n&&(t=u({},t,{callback:function(e){return n(e)}})),e.__loaded?x_?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=u({},e.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(r=e.compression)&&void 0!==r?r:t.compressionFallback:t.compression,(Ti(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,function(e,t){var n,r,i,s=u({},e,{callback:null!=t?t:function(t){return null==e.callback?void 0:e.callback(t)}});s.timeout=s.timeout||6e4;var o,a,l,c,d,h=null!==(n=s.transport)&&void 0!==n?n:"fetch";"sendBeacon"===h&&Ti(s.compression)&&s.data&&(s.compression=Hr),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(d=(c=(Pi(o=s.data)?o:[o]).map(function(e){return u({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})}))[0])||null==(l=d.properties)?void 0:l.token)&&void 0!==a?a:null==d?void 0:d.token,batch:c,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),Pi(e)?e.map(function(e){return u({},e,{sent_at:t})}):u({},e,{sent_at:t})}(s.data))),s.url=w_(s.url,s.method,s.compression,s.timestampMode);var f=S_.filter(function(e){return!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)}),p=null!==(r=null==(i=function(e,t){for(var n=0;e.length>n;n++)if(t(e[n]))return e[n]}(f,function(e){return e.transport===h}))?void 0:i.method)&&void 0!==r?r:f[0].method;if(!p)throw new Error("No available transport method");var _=function(e){try{p(e)}catch(e){v_(e)?iu.warn(e):iu.error(e),null==s.callback||s.callback({statusCode:0,error:e})}};"sendBeacon"!==h&&!s.preferSyncCompression&&s.data&&s.compression===Nr&&eu&&"undefined"!=typeof Promise&&!u_?p_(s).then(function(e){_(e)}).catch(function(t){if(fa(t))return u_=!0,void _(u({},s,{compression:void 0,url:w_(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 fa(e)||t===ca})(t)&&(u_=!0),_(s)}):_(s)}(t,function(r,i){e.rateLimiter.checkForLimiting(r),400>r.statusCode||null==e.config.on_request_error||e.config.on_request_error(r),n?n(r,i):null==t.callback||t.callback(r)})):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}var C_=function(){"use strict";function e(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=Zi((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,iu.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(t,"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();for(var n in t)e._sendRequestSafely(t[n])}},this._flushTimeoutMs))},t._sendRequestSafely=function(e,t){try{this._sendRequest(e,t)}catch(e){iu.error(e)}},t._clearFlushTimeout=function(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0},t._formatQueue=function(){var e={};return au(this._queue,function(t){var n,r=t,i=((r?r.batchKey:null)||r.url)+(r.batchGroup?":"+r.batchGroup:"");Ti(e[i])&&(e[i]=u({},r,{data:[]})),null==(n=e[i].data)||n.push(r.data)}),this._queue=[],e},e}(),P_=function(){"use strict";function t(e){this._instance=e,this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._queue=[],this._areWeOnline=!0,this.resume()}var n=t.prototype;return n.resume=function(){var e=this;if(!Ti(Wa)&&"onLine"in Wa.navigator){if(this._areWeOnline=Wa.navigator.onLine,this._onlineListener)return;this._onlineListener=function(){e._areWeOnline=!0,e._flush()},this._offlineListener=function(){e._areWeOnline=!1},_u(Wa,"online",this._onlineListener),_u(Wa,"offline",this._offlineListener)}},n.retriableRequest=function(t,n){var r=this,s=t.retriesPerformedSoFar,o=i(t,e);Di(s)&&(o.url=c_(o.url,{retry_count:s})),k_(this._instance,n?u({},o,{transport:n}):o,function(e,t){if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=s?s:0))return void r._enqueue(u({retriesPerformedSoFar:s},o),t);0===e.statusCode&&iu.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!=s?s:0)+" retries.")}null==o.callback||o.callback(e)})},n._enqueue=function(e,t){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=Math.max(function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(n),null!=t?t:0),i=Date.now()+r;this._queue.push({retryAt:i,requestOptions:e});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),iu.warn(s),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 r,i=f(n);!(r=i()).done;)this.retriableRequest(r.value.requestOptions)},n.unload=function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,Ti(Wa)||(this._onlineListener&&(Wa.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(Wa.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0));for(var e,t=f(this._queue);!(e=t()).done;){var n=e.value.requestOptions;try{this._instance._send_request(u({},n,{transport:"sendBeacon"}))}catch(e){iu.error(e)}}this._queue=[]},o(t,[{key:"length",get:function(){return this._queue.length}}])}(),E_=function(){"use strict";function e(e){var t=this;this._instance=e,this._updateScrollData=function(){var e,n,r,i;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!==(r=t._context.maxContentY)&&void 0!==r?r:0),t._context.maxContentHeight=Math.max(l,null!==(i=t._context.maxContentHeight)&&void 0!==i?i:0)}}var t=e.prototype;return t.getContext=function(){return this._context},t.resetContext=function(){var e=this._context;return this._context=void 0,setTimeout(this._updateScrollData,0),e},t.startMeasuringScrollPosition=function(){_u(Wa,"scroll",this._updateScrollData,{capture:!0}),_u(Wa,"scrollend",this._updateScrollData,{capture:!0}),_u(Wa,"resize",this._updateScrollData)},t.scrollElement=function(){var e;if(!this._scrollRoot)return null==Wa||null==(e=Wa.document)?void 0:e.documentElement;for(var t,n=f(Pi(this._scrollRoot)?this._scrollRoot:[this._scrollRoot]);!(t=n()).done;){var r,i=null==Wa||null==(r=Wa.document)?void 0:r.querySelector(t.value);if(i)return i}},t._scrollPosition=function(e){var t,n,r="y"===e?"scrollTop":"scrollLeft";if(this._scrollRoot){var i=this.scrollElement();return i&&i[r]||0}return Wa?"y"===e?Wa.scrollY||Wa.pageYOffset||(null==(t=Wa.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:Wa.scrollX||Wa.pageXOffset||(null==(n=Wa.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}}])}(),F_=function(e){return oh(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)},I_=function(){"use strict";function e(e,t,n,r){var i=this;this._onSessionIdCallback=function(e){var t,n=i._getStored();if(!n||n.sessionId!==e){var r={sessionId:e,props:i._sessionSourceParamGenerator(i._instance)};i._persistence.register(((t={})[Nl]=r,t))}},this._instance=e,this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||F_,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}var t=e.prototype;return t._getStored=function(){return this._persistence.props[Nl]},t.getSetOnceProps=function(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?ah(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 au(du(this.getSetOnceProps()),function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_"+wi(n)]=t}),e},e}(),T_=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,r=f(this._events[e]||[]);!(n=r()).done;)(0,n.value)(t);for(var i,s=f(this._events["*"]||[]);!(i=s()).done;)(0,i.value)(e,t)},e}(),R_=su("[SessionId]"),M_=864e5,L_=function(){"use strict";function e(e,t,n){var r,i=this;if(this._lastPersistedActivityTimestamp=null,this._lastCookieSyncTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new T_,this._sessionHasBeenIdleTooLong=function(e,t){return!(!Di(e)||!Di(t))&&Math.abs(e-t)>i.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||fc,this._windowIdGenerator=n||fc;var s=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*Zi(this._config.session_idle_timeout_seconds||1800,60,36e3,R_.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=Vc._parse(this._window_id_storage_key),a=Vc._parse(this._primary_window_exists_storage_key);o&&!a?this._windowId=o:Vc._remove(this._window_id_storage_key),Vc._set(this._primary_window_exists_storage_key,!0)}null!=(r=this._config.bootstrap)&&r.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 Ti(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&&Vc._is_supported()},t._setWindowId=function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Vc._set(this._window_id_storage_key,e))},t._getWindowId=function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Vc._parse(this._window_id_storage_key):null},t._isActivityChangeBelowGranularity=function(e){var t=this._lastPersistedActivityTimestamp;return!Li(t)&&!Li(e)&&5e3>Math.abs(e-t)},t._setSessionId=function(e,t,n){var r,i=t!==this._sessionActivityTimestamp,s=!(e!==this._sessionId||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,s&&!i||s&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register(((r={})[_l]=[t,e,n],r)))},t._useCrossTabRefreshHardening=function(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return Di(t)&&t>0},t._refreshSessionIdFromStorage=function(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(_l):(this._persistence.flush(),this._persistence.load())},t._flushPendingActivityTimestamp=function(){var e,t;if(!Li(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={})[_l]=[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=Di(e)?e:0,n=Di(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[_l];return Pi(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 R_.error("Bootstrap sessionID cannot be in the future"):n}catch(e){return void R_.error("Invalid sessionID in bootstrap",e)}}(e);return!Ti(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&&Wa&&(Wa.removeEventListener(rc,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]},t._listenToReloadWindow=function(){var e=this;this._beforeUnloadListener=function(){e._flushPendingActivityTimestamp(),e._canUseSessionStorage()&&Vc._remove(e._primary_window_exists_storage_key)},_u(Wa,rc,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 r=t||(new Date).getTime(),i=this._sessionId;if(n)this._lastCookieSyncTimestamp=r;else if(Li(this._lastCookieSyncTimestamp)||this._lastCookieSyncTimestamp>r||r-this._lastCookieSyncTimestamp>=1e3){var s,o;null==(s=(o=this._persistence).syncCookieProperties)||s.call(o),this._lastCookieSyncTimestamp=r}var a=this._getSessionId(),u=a[1],l=a[2],c=!Ti(i)&&u!==i,d=this._freshestActivityTimestamp(),h=this._getWindowId(),f=this._pendingBootstrapSession,p=!!f&&(f.sessionStartTimestamp>r+6e4||r-f.sessionStartTimestamp>M_),_=f?p:Di(l)&&Math.abs(r-l)>M_,v=!1,g=c,m=!u||!!f,y=u,b=!m&&!e&&this._sessionHasBeenIdleTooLong(r,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(r))||R_.info("cross-tab refresh kept the session alive",{sessionId:u});var w=this._getSessionId();u=w[1],l=w[2],b||(m=!u||!!f)}if(m||b||_){g=!1;var S=f&&!p;u=S?f.sessionId:this._sessionIdGenerator(),h=this._windowIdGenerator(),R_.info("new session ID assigned",{sessionId:u,windowId:h,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_}}),l=S?f.sessionStartTimestamp:r,this._pendingBootstrapSession=void 0,v=!0}else h||(h=this._windowIdGenerator(),v=!0),(g=g||u!==y)&&(R_.info("adopted cross-tab session id",{sessionId:u,windowId:h}),v=!0);var x=Di(d)&&e&&!_?d:r,k=Di(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}}])}(),A_=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Qi(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(function(e){return Qi(null==e?void 0:e.brand,t)}))return!0}catch(e){}return!!e.webdriver};function O_(){return(O_=h(l().m(function e(){var t,n,r,i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!=(t=null==Ka?void 0:Ka.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}i=void 0,e.n=4;break;case 3:i=n.model;case 4:return e.a(2,Ri(r=i)&&r.length>0?r:void 0);case 5:return e.p=5,iu.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e.v),e.a(2)}},e,null,[[1,5]])}))).apply(this,arguments)}var D_="custom",$_="i.posthog.com",q_=/^\/static\//,B_=["/s/","/e/","/i/"],N_=function(){"use strict";function e(e){this._regionCache={},this.instance=e}var t=e.prototype;return t._staticAssetHostOverride=function(e){if(q_.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=vc(e);return t?t.protocol+"//"+t.host+t.pathname:void 0},t._prepareEndpoint=function(e,t,n){if("ui"===e)return n;var r=n,i=this.instance.config.rewriteRequestPath;if(i){var s,o=(null==(s=vc(n))?void 0:s.href)||n;r=i(new URL(o)).toString()}if(i&&"api"===e&&B_.some(function(e){return 0===t.indexOf(e)})){var a=this._urlKey(r);if(a){var u,l=this.apiHost,c=this._ingestionEndpoints;(null==(u=c)?void 0:u.apiHost)===l&&c.rewriteRequestPath===i||(this._ingestionEndpoints=c={apiHost:l,rewriteRequestPath:i,urls:new Set}),c.urls.add(a)}}return r},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===D_)return this._prepareEndpoint(e,t,this.apiHost+t);var r=$_+t;switch(e){case"assets":return this._prepareEndpoint(e,t,"https://"+this.region+"-assets."+r);case"api":return this._prepareEndpoint(e,t,"https://"+this.region+"."+r)}},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("."+$_,".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":D_),this._regionCache[this.apiHost]}}])}(),H_=su("[PostHog ExternalIntegrations]"),j_={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},U_=function(){"use strict";function e(e){this._instance=e}var t=e.prototype;return t._loadScript=function(e,t){var n;null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,e,function(e){if(e)return H_.error("failed to load script",e);t()})},t.startIfEnabledOrStop=function(){for(var e=this,t=function(){var t,i,s,o=r[n],a=o[0],u=o[1];!u||null!=(t=Eh.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[a]||e._loadScript(j_[a],function(){var t;null==(t=Eh.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[a])||t.start(e._instance)}),!u&&null!=(i=Eh.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[a]&&(null==(s=Eh.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[a])||s.stop())},n=0,r=Object.entries(null!==(i=this._instance.config.integrations)&&void 0!==i?i:{});r.length>n;n++){var i;t()}},e}(),z_=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=h(l().m(function e(t){var n,r,i;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,i=e.v,(r=this._extensions.get(t.name)===t)&&this._extensions.delete(t.name),this._logger.error('Failed to set up browser extension "'+t.name+'"',i),r&&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=f(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&&Ei(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}(),V_=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,r={},i=f(e);!(n=i()).done;){var s=n.value,o=null==t?void 0:t.get_property(s);Ti(o)||(r[s]=o)}return r},t.set=function(e,t){var n,r;null==(n=this._instance.persistence)||n.register("string"==typeof e?((r={})[e]=t,r):e)},t.remove=function(e){var t;null==(t=this._instance.persistence)||t.unregister(e)},e}(),W_="extensionsRemoteConfig",G_=function(){"use strict";function e(e){var t=this;this.instance=e,this._disposed=!1,this._logger=iu,this._latestRemoteConfigResult=e._lastRemoteConfig,this.kv=new V_(e),this.onEvent=function(e){return Ua(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 Ua(function(){});var n=function(n){try{e(n)}catch(e){t._logger.error("Browser extension remote config listener failed",e)}},r=t.instance._internalEventEmitter.on(W_,n);return t._latestRemoteConfigResult&&n(t._latestRemoteConfigResult),Ua(r)},this._runtime=new z_(iu.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(e,t,n){n?this.instance.capture(e,t,{timestamp:n.timestamp,uuid:n.uuid,$set:n.set,$set_once:n.setOnce}):this.instance.capture(e,t)},t.registerDynamicEventProperties=function(e){return Ua(this.instance._registerExtensionEventProperties(e))},t.handleRemoteConfig=function(e){this._disposed||(this._latestRemoteConfigResult=e,this.instance._internalEventEmitter.emit(W_,e))},t.sendRequest=function(){var e=h(l().m(function e(t,n){var r,i,s,o=this;return l().w(function(e){for(;;)switch(e.n){case 0:if(void 0===n&&(n={}),i=this.instance.requestRouter.endpointFor(null!==(r=n.target)&&void 0!==r?r:"api",t),s={method:n.method,url:n.query?c_(i,n.query):i,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?pi.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(Vu);return"string"==typeof e?e:void 0}},{key:"library",get:function(){return{name:uf.LIB_NAME,version:uf.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,r,i=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==i?void 0:i.sessionId)&&void 0!==t?t:"",windowId:null!==(n=null==i?void 0:i.windowId)&&void 0!==n?n:"",sessionStartTimestamp:null!==(r=null==i?void 0:i.sessionStartTimestamp)&&void 0!==r?r: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}}])}(),K_={},Q_=0,Z_=function(){},J_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Y_="Surveys module not available",X_="sanitize_properties is deprecated. Use before_send instead",ev="Invalid value for property_denylist config: ",tv=/^[A-Za-z0-9_-]{1,400}$/,nv=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,rv=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,iv=["token","distinct_id",Gl],sv="posthog",ov=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},av=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:pu(null==Qa?void 0:Qa.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Z_,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:Za&&Ri(null==Za?void 0:Za.search)&&-1!==Za.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==Wa||null==(t=Wa.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,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error:function(e){iu.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:tc,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Z_},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:ov(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))},uv=[["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"]],lv=function(e){for(var t={},n=0,r=uv;r.length>n;n++){var i=r[n],s=i[0],o=i[1];Ti(e[s])||(t[o]=e[s])}var a=uu({},t,e),u=e.__preview_external_dependency_versioned_paths;return Ti(u)||(Ti(e.strict_script_versioning)&&(a.strict_script_versioning=!!u),Ri(u)&&Ti(e.asset_host)&&(a.asset_host=u)),Pi(e.property_blacklist)&&(Ti(e.property_denylist)?a.property_denylist=e.property_blacklist:Pi(e.property_denylist)?a.property_denylist=[].concat(e.property_blacklist,e.property_denylist):iu.error(ev+e.property_denylist)),a},cv=function(){"use strict";return o(function(){this.__forceAllowLocalhost=!1},[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){iu.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}])}(),dv=(a=function(){"use strict";function e(){var t,n=this;this._isPageUnloading=!1,this._isShutdown=!1,this.webPerformance=new cv,this._personProcessingSetOncePropertiesSent=!1,this.version=uf.LIB_VERSION,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new T_,this._extensions=[],this._extensionEventPropertyProducers=[],this._hasStableInitialDistinctId=!1,this._hasWarnedAboutVolatileIdentity=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=av(),this.SentryIntegration=np,this.sentryIntegration=function(e){return function(e,t){var n=tp(e,t);return{name:ep,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 E_(this),this.pageViewManager=new rp(this),this.rateLimiter=new Sp(this),this.requestRouter=new N_(this),this.consent=new lf(this),this.externalIntegrations=new U_(this);var r=null!==(t=e.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.metrics=r.metrics&&new r.metrics(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:function(e,t,r){var i,s=Ri(e)?((i={})[e]=t,i):e;n.setPersonProperties(s),null==r||r({})},set_once:function(e,t,r){var i,s=Ri(e)?((i={})[e]=t,i):e;n.setPersonProperties(void 0,s),null==r||r({})}},this.on("eventCaptured",function(e){return iu.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,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this._hasStableInitialDistinctId||(r?(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(fc());this.register({distinct_id:n,$device_id:n}),e.set_property(Bl,Xl)}this._sync_opt_out_with_persistence()}}},t.init=function(t,n,r){if(r&&r!==sv){var i,s=null!==(i=K_[r])&&void 0!==i?i:new e;return s._init(t,n,r),K_[r]=s,K_[sv][r]=s,s}return this._init(t,n,r)},t._init=function(e,t,n){var r,i,s,o=this;void 0===t&&(t={});var a,l=Ri(e)?e.trim():"";if(!l)return iu.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=av(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=av(t.defaults),d=lv(t),h=uu({},c,d,{name:n,token:l});Fi(c.rageclick)&&Fi(d.rageclick)&&(h.rageclick=uu({},c.rageclick,d.rageclick)),Fi(c.session_recording)&&Fi(d.session_recording)&&(h.session_recording=uu({},c.session_recording,d.session_recording)),this.set_config(h),this.config.on_xhr_error&&iu.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Nr;var f=this._is_persistence_disabled();if(this.persistence=new bp(this.config,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new bp(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&&Vc._is_supported()){var p=Vc._parse(this._sessionRegisteredPropertiesStorageKey);Pi(p)&&p.forEach(function(e){Ri(e)&&o._sessionRegisteredPropKeys.add(e)})}else Vc._remove(this._sessionRegisteredPropertiesStorageKey);var _=u({},this.persistence.props),v=u({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new C_(function(e,t){return o._send_retriable_request(e,t)},this.config.request_queue_config),this._retryQueue=new P_(this),this.__request_queue=[];var g=this._inCookielessMode();g||(this.sessionManager=new L_(this),this.sessionPropsManager=new I_(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?(iu.info("Deferring extension initialization to improve startup performance"),setTimeout(function(){o._initExtensions(g)},0)):(iu.info("Initializing extensions synchronously"),this._initExtensions(g)),uf.DEBUG=uf.DEBUG||this.config.debug,uf.DEBUG&&iu.info("Starting in debug mode",{this:this,config:t,thisC:u({},this.config),p:_,s:v}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=u({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var m=null==(i=t.bootstrap)?void 0:i.distinctID;if(this._hasStableInitialDistinctId=!!m&&!Mi(m),null!=(s=t.bootstrap)&&s.distinctID){var y=t.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(Bl);if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"anonymous"===w)this.identify(y);else if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"identified"===w)iu.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(fc()),x=t.bootstrap.isIdentifiedID?S:y;this.persistence.set_property(Bl,t.bootstrap.isIdentifiedID?ec:Xl),this.register({distinct_id:y,$device_id:x})}}if(g)this.register_once({distinct_id:Wl,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(fc());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Bl,Xl)}return _u(Wa,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),_u(Wa,"pageshow",function(){var e;o._isPageUnloading=!1,o._isShutdown||null==(e=o._retryQueue)||e.resume()}),t.segment?Xf(this,function(){return o._loaded()}):this._loaded(),Ei(this.config._onCapture)&&this.config._onCapture!==Z_&&(iu.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",function(e){return o.config._onCapture(e.event,e)})),this.config.ip&&iu.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 O_.apply(this,arguments)}().then(function(e){var t;e&&o.register(((t={})[Wu]=e,t))}).catch(Z_),this},t._isSharedExtension=function(e){var t=e;return Ri(t.name)&&Ei(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){iu.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this._extensions.push(e)},t._enrollFeatureFlags=function(){var t,n,r,i,s,o,a=this,u=null!==(t=null==(n=this.config.__extensionClasses)?void 0:n.featureFlags)&&void 0!==t?t:null==(r=e.__defaultExtensionClasses)?void 0:r.featureFlags;u&&(this.featureFlags&&this.featureFlags instanceof u||(null==(o=this._featureFlagsReloadingUnsubscribe)||o.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new u(this)),Ei(this.featureFlags.onReloading)&&Ei(this.featureFlags.setup)?this._featureFlagsReloadingUnsubscribe||(this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading(function(){a._internalEventEmitter.emit("featureFlagsReloading",!0)}),this._getBrowserClientAdapter().add(this.featureFlags)):null==(i=(s=this.featureFlags).initialize)||i.call(s))},t._initExtensions=function(t){var n,r,i,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!==(r=this.surveys)&&void 0!==r?r:new h.surveys(this),f),h.logs&&this._enrollExtension(this.logs=null!==(i=this.logs)&&void 0!==i?i: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,Zf)),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,r=this;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(function(){r._processInitTaskQueue(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){iu.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[Ql]=s,n)),this.config.__preview_deferred_init_extensions&&iu.info("PostHog extensions initialized ("+s+"ms)")},t._onRemoteConfig=function(e){var t,n=this;if(!Qa||!Qa.body)return iu.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 r,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=yi(i.supportedCompression,Nr)?Nr:yi(i.supportedCompression,Hr)?Hr:void 0),null!=(r=i.analytics)&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:tc}),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){iu.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=Za&&Za.hostname){var t=Za.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 kp(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()&&ou(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,r,i;this._isPageUnloading=!0,null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(sc),null==(n=this.logs)||n.flushLogs("sendBeacon"),null==(r=this._requestQueue)||r.unload(),null==(i=this._retryQueue)||i.unload()):this._shouldCapturePageleave()&&this.capture(sc,null,{transport:"sendBeacon"})},t._send_request=function(e){k_(this,e)},t._send_retriable_request=function(e,t){this._retryQueue?this._retryQueue.retriableRequest(e,t):this._send_request(t?u({},e,{transport:t}):e)},t._execute_array=function(e){var t=this;Q_++;try{var n,r=[],i=[],s=[];ou(e,function(e){if(e)if(Pi(n=e[0]))s.push(e);else if(Ei(e))try{e.call(t)}catch(t){iu.error("Error executing queued PostHog call",e,t)}else Pi(e)&&"alias"===n?r.push(e):Pi(e)&&-1!==n.indexOf("capture")&&Ei(t[n])?s.push(e):i.push(e)});var o=function(e,t){ou(e,function(e){try{if(Pi(e[0])){var n=t;au(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){iu.error("Error executing queued PostHog call",e,t)}})};o(r,this),o(i,this),o(s,this)}finally{Q_--}},t.push=function(t){if(Q_>0&&Pi(t)&&Ri(t[0])){var n=e.prototype[t[0]];Ei(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])},t._getPersistedMetaIdentifier=function(e){var t,n=null==(t=this.persistence)?void 0:t.get_property(e.persistenceKey);return Ri(n)&&e.pattern.test(n)?{value:n,delivered:!1}:Fi(n)&&Ri(n.value)&&e.pattern.test(n.value)?{value:n.value,delivered:!0===n.delivered}:void 0},t._storeMetaIdentifier=function(e,t,n){return t===(null==n?void 0:n.value)?{value:t,pending:!n.delivered}:(e.register(t,!1),{value:t,pending:!0})},t._readMetaCookie=function(e){if(this.config.save_campaign_params&&!this._inCookielessMode()){var t=Cc(e.cookieName);return Ri(t)&&e.pattern.test(t)?t:void 0}},t._updateFacebookClickId=function(e,t,n,r){if(this.persistence){var i=this._facebookClickIdChannel;this.persistence.refreshKey(i.persistenceKey);var s=this._getPersistedMetaIdentifier(i);if(!r){if(n)return Ri(t)&&nv.test(t)?this._storeMetaIdentifier(i,t,s):void i.unregister();var o=Ri(e)&&tv.test(e)?e:void 0,a=this._readMetaCookie(i);return a&&function(e,t,n){var r=e.split(".");if(t)return r[3]===t;if(!n)return!0;var i=n.value.split(".");return r[3]===i[3]||Number(r[2])>Number(i[2])}(a,o,s)?this._storeMetaIdentifier(i,a,s):o?(null==s?void 0:s.value.split(".")[3])===o?{value:s.value,pending:!s.delivered}:this._storeMetaIdentifier(i,"fb.1."+Date.now()+"."+o,s):s?{value:s.value,pending:!s.delivered}:void 0}i.unregister()}},t._updateFacebookBrowserId=function(e,t,n){if(this.persistence){var r=this._facebookBrowserIdChannel;this.persistence.refreshKey(r.persistenceKey);var i=this._getPersistedMetaIdentifier(r);if(!n){if(t)return Ri(e)&&rv.test(e)?this._storeMetaIdentifier(r,e,i):void r.unregister();var s=this._readMetaCookie(r);return s?this._storeMetaIdentifier(r,s,i):i?{value:i.value,pending:!i.delivered}:void 0}r.unregister()}},t._markMetaIdentifierDelivered=function(e,t){if(this.persistence){this.persistence.refreshKey(e.persistenceKey);var n=this._getPersistedMetaIdentifier(e);(null==n?void 0:n.value)!==t||n.delivered||e.register(t,!0)}},t.capture=function(e,t,n){var r,i,s,o,a,l,c,d,h=this;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!Ti(e)&&Ri(e)){this._healCookielessSentinelDistinctId();var p=!this.config.opt_out_useragent_filter&&this._is_bot();if(!p||this.config.__preview_capture_bot_pageviews){var _=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==_||!_.isRateLimited){var v;null!=t&&t.$current_url&&!Ri(null==t?void 0:t.$current_url)&&(iu.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||iu.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&&(v=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var g=new Date,m=(null==n?void 0:n.timestamp)||g,y=ho(null==n?void 0:n.uuid,fc),b={uuid:y,event:e,properties:this.calculateEventProperties(e,t||{},m,y)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&p&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),_&&(b.properties.$lib_rate_limit_remaining_tokens=_.remainingTokens);var w="$feature_flag_called"===e&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=n&&n.$set&&!w&&(b.$set=null==n?void 0:n.$set);for(var S=Fi(null==t?void 0:t.$set)?t.$set:void 0,x=Pi(null==t?void 0:t.$unset)?t.$unset:[],k=(null==n?void 0:n.$unset)||[],C=function(e){var t,r=!(null==n||!n.$set)&&e in n.$set;return{hasProvided:r||!!S&&e in S,provided:r?null==n||null==(t=n.$set)?void 0:t[e]:null==S?void 0:S[e],unset:-1!==x.indexOf(e)||-1!==k.indexOf(e)}},P=C(Ku),E=C(Zu),F=[{channel:this._facebookClickIdChannel,hasProvided:P.hasProvided,update:this._updateFacebookClickId(null==(r=v)?void 0:r.fbclid,P.provided,P.hasProvided,P.unset)},{channel:this._facebookBrowserIdChannel,hasProvided:E.hasProvided,update:this._updateFacebookBrowserId(E.provided,E.hasProvided,E.unset)}],I=0,T=F;T.length>I;I++){var R,M=T[I],L=M.update;L&&!0===b.properties.$process_person_profile&&L.pending&&!M.hasProvided&&!w&&(b.$set=u(((R={})[M.channel.property]=L.value,R),b.$set))}var A=null==n?void 0:n.$unset;A&&(b.$unset=A);var O=w?void 0:this._calculate_set_once_properties(null==n?void 0:n.$set_once,e!==ac,e===oc);if(O&&(b.$set_once=O),null!=n&&n._noTruncate||(a=this.config.properties_string_max_length,l=b,c=function(e){return Ri(e)?e.slice(0,a):e},d=new Set,b=function e(t,n){if(t!==Object(t))return c?c(t):t;if(!d.has(t)){var r;if(d.add(t),Pi(t))r=[],ou(t,function(t){r.push(e(t))});else{var i={};au(ji(t)?hu(t):t,function(t,n){d.has(t)||(i[n]=e(t,n))}),r=i}return r}}(l)),b.timestamp=m,Ti(null==n?void 0:n.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),w&&(b.properties=function(e,t){void 0===t&&(t=[]);var n={},r=function(t){void 0!==e[t]&&(n[t]=e[t])};return la.forEach(r),t.forEach(r),n}(b.properties,iv)),e===si||e===oi){var D,q=null==t?void 0:t[ai],B=null==t?void 0:t[li];Hu({id:q,current_iteration:B}),b.$set=u({},b.$set,((D={})[wu({id:q,current_iteration:B},e===oi?"responded":"dismissed")]=!0,D))}else e===ii&&(b.$set=u({},b.$set,((i={}).$survey_last_seen_date=(new Date).toISOString(),i)));if("product tour shown"===e){var N,H=null==t?void 0:t.$product_tour_type;H&&(b.$set=u({},b.$set,((N={})["$product_tour_last_seen_date/"+H]=(new Date).toISOString(),N)))}var j=u({},b.properties.$set,b.$set);if(Ii(j)||this.setPersonPropertiesForFlags(j),!Ai(this.config.before_send)){var U=this._runBeforeSend(b);if(!U)return;(b=U).uuid=ho(b.uuid,fc)}var z=F.filter(function(e){var t,n,r,i=e.channel,s=e.update,o=null!==(t=null==(n=b.$set)?void 0:n[i.property])&&void 0!==t?t:Fi(null==(r=b.properties)?void 0:r.$set)?b.properties.$set[i.property]:void 0;return(null==s?void 0:s.pending)&&o===s.value});this._internalEventEmitter.emit("eventCaptured",b);var V,W,G=null!==(s=null==n?void 0:n._url)&&void 0!==s?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),K="recordings"===(null==n?void 0:n._batchKey)||/\/s\/(?:\?|$)/.test(G),Q=u({method:"POST",url:G,data:b,compression:"best-available",preferSyncCompression:null==n?void 0:n.send_instantly,timestampMode:K?"body":"capture-body",batchKey:null==n?void 0:n._batchKey},K&&null!=(o=b.properties)&&o.$session_id?{batchGroup:b.properties.$session_id+(b.properties.$window_id?"-"+b.properties.$window_id:"")}:{},null!=n&&n.transport?{transport:n.transport}:{},z.length?{fireCallbackOnDrop:!0,callback:function(e){if(e.statusCode>=200&&300>e.statusCode)for(var t,n=f(z);!(t=n()).done;){var r=t.value;h._markMetaIdentifierDelivered(r.channel,r.update.value)}}}:{});return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly||z.length?(!Q.transport&&!Q.callback&&Ii(null!==(V=this.config.request_headers)&&void 0!==V?V:{})&&this._isPageUnloading&&(W="sendBeacon"),this._send_retriable_request(Q,W)):this._requestQueue.enqueue(Q),b}iu.critical("This capture call is ignored due to client rate limiting.")}}else iu.error("No event name provided to posthog.capture")}else iu.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 G_(this)},t._registerExtensionEventProperties=function(e){var t=this;this._extensionEventPropertyProducers.push(e);var n=!0;return function(){if(n){n=!1;var r=t._extensionEventPropertyProducers.indexOf(e);-1!==r&&t._extensionEventPropertyProducers.splice(r,1)}}},t._processCookieIdentityChange=function(e){var t,n,r;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this._cachedPersonProperties=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(n=this.featureFlags)||n.reset(),e&&this.reloadFeatureFlags(),!0)},t.calculateEventProperties=function(e,t,n,r,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this._processCookieIdentityChange();var s=i?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[Gl]=!0),"$snapshot"===e){var a=u({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!Ri(o.distinct_id)&&!Oi(o.distinct_id)||Mi(o.distinct_id))&&iu.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var l,c=function(e,t,n,r){var i,s,o,a;if(void 0===r&&(r=!1),!tu)return{};var u,l=e?[].concat(Zd,t||[]):[],c=Zs(tu),d=c[0],h=c[1],f=function(e){for(var t=0;eo.length>t;t++){var n,r=eo[t],i=r[1],s=r[2],o=e.match(r[0]);if(o)return[i,(null==(n=s&&e.match(s)||o)?void 0:n[1])||""]}return["",""]}(tu),p=f[0],_=f[1],v=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},g={};Ti(n)||(g.detectGoogleSearchApp=n);var m={},y=null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,b=null==(s=navigator)?void 0:s.maxTouchPoints,w=null==Wa||null==(o=Wa.screen)?void 0:o.width,S=null==Wa||null==(a=Wa.screen)?void 0:a.height,x=null==Wa?void 0:Wa.devicePixelRatio;Ti(y)||(m.userAgentDataPlatform=y),Ti(b)||(m.maxTouchPoints=b),Ti(w)||(m.screenWidth=w),Ti(S)||(m.screenHeight=S),Ti(x)||(m.devicePixelRatio=x);var k,C=uu(du({$os:d,$os_version:h,$browser:Ws(tu,navigator.vendor,v,g),$webview_app:p,$webview_app_version:_,$device:Js(tu),$device_type:Ys(tu,m),$timezone:uh(),$timezone_offset:lh()}),{$current_url:mc(r?po(null==Za?void 0:Za.href):null==Za?void 0:Za.href,l,Yd),$host:null==Za?void 0:Za.host,$pathname:null==Za?void 0:Za.pathname,$raw_user_agent:tu.length>1e3?tu.substring(0,997)+"...":tu,$browser_version:Ks(tu,navigator.vendor,v,g),$browser_language:rh(),$browser_language_prefix:(k=rh(),"string"==typeof k?k.split("-")[0]:void 0),$screen_height:null==Wa?void 0:Wa.screen.height,$screen_width:null==Wa?void 0:Wa.screen.width,$viewport_height:null==Wa?void 0:Wa.innerHeight,$viewport_width:null==Wa?void 0:Wa.innerWidth,$lib:Va.LIB_NAME,$lib_version:Va.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Va.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=Va.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 d=this.sessionManager.checkAndGetSessionAndWindowId(i,n.getTime(),!0),h=d.windowId;o.$session_id=d.sessionId,o.$window_id=h}this.sessionPropsManager&&uu(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&uu(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===D_&&(o.$lib_custom_api_host=this.config.api_host),l="$pageview"!==e||i?"$pageleave"!==e||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,r),o=uu(o,l),"$pageview"===e&&Qa&&(o.title=Qa.title),!Ti(s)){var _=n.getTime()-s;o.$duration=parseFloat((_/1e3).toFixed(3))}tu&&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;Fi(m)&&!Ii(m)&&(o.$groups=u({},Fi(y)?y:{},m)),au(["$referrer","$referring_domain"],function(e){e in v&&delete g[e]});var b={};if(this._extensionEventPropertyProducers.length>0)for(var w,S=f(this._extensionEventPropertyProducers.slice());!(w=S()).done;){var x=w.value;try{uu(b,x())}catch(e){iu.error("Failed to produce browser extension event properties",e)}}(o=uu({},c,v,g,u({},b,o))).$is_identified=this._isIdentified(),Pi(this.config.property_denylist)?au(this.config.property_denylist,function(e){delete o[e]}):iu.error(ev+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var k=this.config.sanitize_properties;k&&(iu.error(X_),o=k(o,e));var C=this._hasPersonProcessing();return o.$process_person_profile=C,C&&!i&&this._requirePersonProcessing("_calculate_event_properties"),o},t._calculate_set_once_properties=function(e,t,n){var r;if(void 0===t&&(t=!0),void 0===n&&(n=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!n)return e;var i=uu({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),s=this.config.sanitize_properties;return s&&(iu.error(X_),i=s(i,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Ii(i)?void 0:i},t.register=function(e,t){var n;null==(n=this.persistence)||n.register(e,t)},t.register_once=function(e,t,n){var r;null==(r=this.persistence)||r.register_once(e,t,n)},t.register_for_session=function(e){var t,n,r=this;null==(t=this.persistence)||t.syncCookieProperties(),this._processCookieIdentityChange(),null==(n=this.sessionPersistence)||n.register(e),Object.keys(e).forEach(function(e){return r._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||!Vc._is_supported())Vc._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach(function(e){return t.push(e)}),t.length>0?Vc._set(this._sessionRegisteredPropertiesStorageKey,t):Vc._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,r;return null!==(n=null==(r=this.featureFlags)?void 0:r.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 r;null==(r=this.featureFlags)||r.updateFlags(e,t,n)},t.updateEarlyAccessFeatureEnrollment=function(e,t,n){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,n)},t.getEarlyAccessFeatures=function(e,t,n){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.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:Y_}),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:Y_})},t.getActiveMatchingSurveys=function(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Y_})},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=Uu),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:Y_}},t.canRenderSurveyAsync=function(e,t){var n,r;return void 0===t&&(t=!1),null!==(n=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))&&void 0!==n?n:Promise.resolve({visible:!1,disabledReason:Y_})},t._validateIdentifyId=function(e){return!e||Mi(e)?(iu.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(iu.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())||(iu.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 iu.uninitializedWarning("posthog.identify");if(Oi(e)&&(e=e.toString(),iu.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 r=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,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(Gu),this.register({distinct_id:e}));var l=(this.persistence.get_property("$user_state")||"anonymous")===Xl,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(Bl,ec),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$identify",f,{$set:t||{},$set_once:n||{}})&&(this._cachedPersonProperties=Sc(e,t,n)),null==(h=this.featureFlags)||h.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:u)}else if(d){this.persistence.set_property(Bl,ec);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=Sc(e,t,n))}else(t||n)&&this.setPersonProperties(t,n);c||i||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Ol)):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=Sc(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)):iu.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}},t.unsetPersonProperties=function(e){var t,n=(Pi(e)?e:[e]).filter(function(e){return Ri(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 r,i,s;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this._processCookieIdentityChange();var o=this.getGroups(),a=o[e]!==t;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:u({},o,(i={},i[e]=t,i))}),(a||n)&&this._hasPersonProcessing()){var l={$group_type:e,$group_key:t};n&&(l.$group_set=n),this.capture(ac,l)}n&&this.setGroupPropertiesForFlags(((s={})[e]=n,s)),a&&!n&&this.reloadFeatureFlags()}else iu.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=$i(e)?e:null==e?void 0:e.resetDeviceID,n=$i(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,n)},t._reset=function(e,t,n){var r,i,s,o;if(void 0===t&&(t=!1),iu.info("reset"),!this.__loaded)return iu.uninitializedWarning("posthog.reset");var a=null==n?void 0:n.sessionID;this.config.bootstrap=n||(null==(r=this._originalUserConfig)?void 0:r.bootstrap)||{},null==(i=this.featureFlags)||null==i.updateConfig||i.updateConfig(this.config,this._shouldDisableFlags());var l=this.get_property(Vu),c=this.get_property(Wu),d=this.get_property(ll);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(),Ti(d)||null==(g=this.persistence)||g.register(((m={})[ll]=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(Bl,Xl),null==(C=this.sessionManager)||C.resetSessionId(),this._cachedPersonProperties=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Wl,$device_id:null},"");else{var I,T=this.config.get_device_id(fc());this.register_once({distinct_id:T,$device_id:e?T:l},""),e||Ti(c)||this.register(((I={})[Wu]=c,I))}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),n)if(n.distinctID&&!this._inCookielessMode()&&(null==(F=this.persistence)||F.set_property(Bl,n.isIdentifiedID?ec:Xl),this.register({distinct_id:n.distinctID})),null==(P=this.featureFlags)||P.initialize(),!(Ai(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 M;f&&(null==(M=this.persistence)||null==M._endCookieSyncSuppression||M._endCookieSyncSuppression(p))}this.reloadFeatureFlags()},t.shutdown=function(){var e=h(l().m(function e(t){var n,r,i,s,o,a,u,c,d;return l().w(function(e){for(;;)switch(e.n){case 0:if(this.__loaded){e.n=1;break}return iu.uninitializedWarning("posthog.shutdown"),e.a(2);case 1:this._isShutdown=!0,this._getBrowserClientAdapter().dispose(),null==(n=this.sessionRecording)||n.dispose(),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(i=this.metrics)||i.flush("sendBeacon"),null==(s=this.metrics)||s.dispose(),null==(o=this._requestQueue)||o.unload(),null==(a=this._retryQueue)||a.unload();try{null==(d=this.featureFlags)||d.destroy()}catch(e){iu.error("Error while destroying feature flags",e)}null==(u=this.persistence)||u.destroy(),null==(c=this.sessionPersistence)||c.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,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&n){var i,s=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!n)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-n)/1e3)-s,0)}return r},t.alias=function(e,t){return e===this.get_property("$people_distinct_id")?(iu.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Ti(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Gu,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(iu.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(Fi(e)){var n,r,i,s,o,a,l,c,d,h,f,p,_,v;uu(this.config,lv(e));var g=this._is_persistence_disabled();null==(n=this.persistence)||n.update_config(this.config,t,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new bp(u({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this._checkLocalStorageForDebug(this.config.debug);$i(m)&&(this.config.debug=m),$i(this.config.debug)&&(this.config.debug?(uf.DEBUG=!0,Rc._is_supported()&&Rc._set("ph_debug",!0),iu.info("set_config",{config:e,oldConfig:t,newConfig:u({},this.config)})):(uf.DEBUG=!1,Rc._is_supported()&&Rc._remove("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(i=this.exceptionObserver)||i.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.metrics)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(c=this.autocapture)||c.startIfEnabled(),null==(d=this.heatmaps)||d.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(h=this.historyAutocapture)||h.startIfEnabledOrStop()),null==(f=this.exceptionObserver)||f.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(_=this.surveys)||_.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&Xf(this,Z_,!1)}},t._overrideSDKInfo=function(e,t){uf.LIB_NAME=e,uf.LIB_VERSION=t},t.startSessionRecording=function(e){var t,n,r,i,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==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(i=this.sessionRecording)||i.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:sv;return t!==sv&&(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()&&Ii(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?(iu.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._warnIfVolatileIdentityWithoutStableId(),this._register_single(Vl,!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,r,i,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==(r=this.sessionPersistence)?void 0:r._disabled)!==s&&(null==(i=this.sessionPersistence)||i.set_disabled(s)),s&&(this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),s},t.opt_in_capturing=function(t){var n,r,i;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 L_(this),this.pageViewManager=new rp(this),this.persistence&&(this.sessionPropsManager=new I_(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==(r=this.surveys)||r.loadIfEnabled()),(Ti(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(i=null==t?void 0:t.captureEventName)&&void 0!==i?i:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else iu.warn(J_)},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:Wl,$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 iu.warn(J_)},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 Ka?A_(Ka,this.config.custom_blocked_useragents):void 0},t._captureInitialPageview=function(){Qa&&("visible"===Qa.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(ic,{title:Qa.title},{send_instantly:!0}),this._visibilityStateListener&&(Qa.removeEventListener(nc,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),_u(Qa,nc,this._visibilityStateListener)))},t.debug=function(e){!1===e?(null==Wa||Wa.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Wa||Wa.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?(iu.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,r,i){var s=t in e&&!Ai(e[t]),o=n in e&&!Ai(e[n]);return s?e[t]:!!o&&(i&&i.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,iu)},t._runBeforeSend=function(e){var t;if(Ai(this.config.before_send))return e;for(var n,r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Bi),i=e,s=f(Pi(this.config.before_send)?this.config.before_send:[this.config.before_send]);!(n=s()).done;){var o=n.value;try{if(i=o(i),Ai(i)){var a="Event '"+e.event+"' was rejected in beforeSend function";return qi(e.event)?iu.warn(a+". This can cause unexpected behavior."):iu.info(a),null}i.properties&&!Ii(i.properties)||iu.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return iu.error("Error in beforeSend function for event '"+e.event+"':",t),null}}for(var u,l=f(r);!(u=l()).done;){var c=u.value;if(i.properties&&Ai(i.properties[c]))return iu.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 i},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=$i(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:"_facebookClickIdChannel",get:function(){var e=this;return{property:Ku,persistenceKey:Qu,cookieName:"_fbc",pattern:nv,register:function(t,n){var r,i;return null==(r=e.persistence)?void 0:r.register(((i={})[Qu]={value:t,delivered:n},i))},unregister:function(){var t;return null==(t=e.persistence)?void 0:t.unregister(Qu)}}}},{key:"_facebookBrowserIdChannel",get:function(){var e=this;return{property:Zu,persistenceKey:Ju,cookieName:"_fbp",pattern:rv,register:function(t,n){var r,i;return null==(r=e.persistence)?void 0:r.register(((i={})[Ju]={value:t,delivered:n},i))},unregister:function(){var t;return null==(t=e.persistence)?void 0:t.unregister(Ju)}}}},{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]]=cu(e.prototype[t[n]])}(dv,["identify"]);var hv=function(){"use strict";function e(e){this.disabled=!1===e;var t=Fi(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 r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.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}(),fv="$copy_autocapture",pv=su("[AutoCapture]");function _v(e,t){return t.length>e?t.slice(0,e)+"...":t}function vv(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!df(t));return t}function gv(e,t){var n,r,i=t.e,s=t.maskAllElementAttributes,o=t.maskAllText,a=t.elementAttributeIgnoreList,l=t.elementsChainAsString,c=t.disableCaptureUrlHashes;if(!df(e))return{props:{}};for(var d=[e],h=new Set([e]),p=e;p.parentNode&&!hf(p,"body")&&1e3>d.length;)if(pf(p.parentNode)){var _=p.parentNode.host;if(h.has(_))break;h.add(_),d.push(_),p=_}else{if(!df(p.parentNode))break;if(h.has(p.parentNode))break;h.add(p.parentNode),d.push(p.parentNode),p=p.parentNode}var v="click"===i.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?d.findIndex(function(e){return hf(e,"button")||hf(e,"a")}):-1;v>0&&(o=o||d.slice(0,v+1).some(function(e){return!Af(e)||Of(e)}));var g,m,y,b=[],w={},S=!1,x=!1;if(au(d,function(e){var t=Af(e);if(hf(e,"a")&&!s&&(null==a||!a.includes("href"))){var n=e.getAttribute("href");S=!!(t&&n&&Uf(n))&&(c?po(n):n)}yi(gf(e),"ph-no-capture")&&(x=!0),b.push(function(e,t,n,r,i){void 0===i&&(i=!1);var s=e.tagName.toLowerCase(),o={tag_name:s};wf.indexOf(s)>-1&&!n&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?_v(1024,zf(e)):_v(1024,yf(e)));var a=gf(e);t||null!=r&&r.includes("class")||0>=a.length||(o.classes=a.filter(function(e){return""!==e})),au(e.attributes,function(n){var s;if((!Of(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==r||!r.includes(n.name))&&!t&&Uf(n.value)&&(!Ri(s=n.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=n.value;"class"===n.name&&(a=_f(a).join(" ")),o["attr__"+n.name]=_v(1024,"href"===n.name&&i?po(a):a)}});for(var u=1,l=1,c=e;c=vv(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}(e,s,o,a,c)),au(function(e){if(!Af(e))return{};var t={};return au(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&Uf(r)&&(t[n]=r)}}),t}(e),function(e,t){({}).hasOwnProperty.call(w,t)||(w[t]=e)})}),x)return{props:{},explicitNoCapture:x};if(v>0&&(e=d[v],b.splice(0,v)),o||(b[0].$el_text=hf(e,"a")||hf(e,"button")?zf(e):yf(e)),S){var k,C;b[0].attr__href=S;var P=null==(k=vc(S))?void 0:k.host,E=null==Wa||null==(C=Wa.location)?void 0:C.host;P&&E&&P!==E&&(g=S)}return{props:uu((m=i.type,{$event_type:m,$ce_version:1}),l?{}:{$elements:b},{$elements_chain:(y=b,Pi(y)?function(e){return e.map(function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();for(var i,s=f(e.attr_class);!(i=s()).done;)r+="."+i.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 lu(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[Wf(e[0].toString())]=Wf(t.toString())}),(r+=":")+lu(a).map(function(e){return e[0]+'="'+e[1]+'"'}).join("")}).join(";")}(function(e){return e.map(function(e){var t,n,r={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:Gf(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return lu(e).filter(function(e){return 0===e[0].indexOf("attr__")}).forEach(function(e){return r.attributes[e[0]]=e[1]}),r})}(y)):"")},null!=(n=b[0])&&n.$el_text?{$el_text:null==(r=b[0])?void 0:r.$el_text}:{},g&&"click"===i.type?{$external_click_url:g}:{},w),target:e}}var mv=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 hv(this._config.rageclick),this._elementSelectors=null}var t=e.prototype;return t._clearPointer=function(){this._pointerDown=void 0,clearTimeout(this._pointerExpiry),this._pointerExpiry=void 0},t._isExcludedPointerTarget=function(e){var t;if(!Af(e))return!0;for(var n,r=null!==(t=this._refreshConfig().css_selector_ignorelist)&&void 0!==t?t:Cf,i=new Set,s=e,o=function(){if(i.size>=1e3||i.has(s))return{v:!0};i.add(s);var e=s,t=gf(e);if(yi(t,"ph-no-capture")||yi(t,"ph-sensitive")||Of(e)||r.some(function(t){return Sf(e,t)}))return{v:!0};var n=s.parentNode;s=pf(n)?n.host:n&&df(n)?n:null};s;)if(n=o())return n.v;return!1},t._trackPointer=function(e){var t=this;if(this.isEnabled&&"pointercancel"!==e.type)if("pointerdown"!==e.type){var n=this._pointerDown;n&&(e.pointerId!==n.id||Math.abs(e.clientX-n.x)>5||Math.abs(e.clientY-n.y)>5?this._clearPointer():"pointerup"===e.type&&(n.released=!0,this._pointerExpiry=setTimeout(function(){return t._clearPointer()},0)))}else{var r;this._clearPointer();var i=bf(e);e.isPrimary&&0===e.button&&!e.ctrlKey&&i&&df(i)&&(this._pointerDown={target:i,excluded:this._isExcludedPointerTarget(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(r=this._client)?void 0:r.distinctId})}else this._clearPointer()},t._recoverClickTarget=function(e){var t,n=this._pointerDown;this._clearPointer();var r=bf(e);if(null!=n&&n.released&&n.target.isConnected&&n.distinctId===(null==(t=this._client)?void 0:t.distinctId)&&e.pointerId===n.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-n.x)&&5>=Math.abs(e.clientY-n.y)&&r&&(hf(r,"html")||hf(r,"body"))){var i;if(n.excluded)return null;var s=null!==(i=this._refreshConfig().css_selector_ignorelist)&&void 0!==i?i:Cf;return[r,null==Qa?void 0:Qa.documentElement,null==Qa?void 0:Qa.body].some(function(e){if(!e)return!1;var t=gf(e);return yi(t,"ph-no-capture")||yi(t,"ph-sensitive")||!Af(e)||Of(e)||s.some(function(t){return Sf(e,t)})})?null:n.target}},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(Wa&&Qa){var t=this._domEventHandler=function(t){t=t||(null==Wa?void 0:Wa.event);try{if("blur"===t.type)return void e._clearPointer();if(0===t.type.indexOf("pointer"))return void e._trackPointer(t);var n="click"===t.type?e._recoverClickTarget(t):void 0;if(Li(n))return;e._captureEvent(t,"$autocapture",n)}catch(e){pv.error("Failed to capture event",e)}};if(_u(Wa,"blur",t),_u(Qa,"submit",t,{capture:!0}),_u(Qa,"change",t,{capture:!0}),_u(Qa,"click",t,{capture:!0}),au(["pointerdown","pointermove","pointerup","pointercancel"],function(e){_u(Qa,e,t,{capture:!0})}),this._refreshConfig().capture_copied_text){var n=this._copiedTextHandler=function(t){t=t||(null==Wa?void 0:Wa.event);try{e._captureEvent(t,fv)}catch(e){pv.error("Failed to capture clipboard event",e)}};_u(Qa,"copy",n,{capture:!0}),_u(Qa,"cut",n,{capture:!0}),_u(Qa,"paste",n,{capture:!0})}}}else pv.info("Disabling Automatic Event Collection because this browser is not supported")},t._removeDomEventHandlers=function(){var e=this;this._clearPointer(),this._domEventHandler&&(null==Wa||Wa.removeEventListener("blur",this._domEventHandler),au(["pointerdown","pointermove","pointerup","pointercancel"],function(t){null==Qa||Qa.removeEventListener(t,e._domEventHandler,!0)}),null==Qa||Qa.removeEventListener("submit",this._domEventHandler,!0),null==Qa||Qa.removeEventListener("change",this._domEventHandler,!0),null==Qa||Qa.removeEventListener("click",this._domEventHandler,!0),this._domEventHandler=void 0),this._copiedTextHandler&&(null==Qa||Qa.removeEventListener("copy",this._copiedTextHandler,!0),null==Qa||Qa.removeEventListener("cut",this._copiedTextHandler,!0),null==Qa||Qa.removeEventListener("paste",this._copiedTextHandler,!0),this._copiedTextHandler=void 0),this._initialized=!1},t.startIfEnabled=function(){this.isEnabled||this._clearPointer(),!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,r=t.autocapture_opt_out;$i(r)&&(null==(n=this._client)||n.kv.set(Xu,r),this._isDisabledServerSide=r),this.startIfEnabled()}else this.startIfEnabled()},t.setElementSelectors=function(e){this._elementSelectors=e},t.getElementSelectors=function(e,t){var n,r=[];return null==(n=this._elementSelectors)||n.forEach(function(n){var i;null==Qa||null==(i=Qa.querySelectorAll(n))||i.forEach(function(i){e!==i&&t!==i||yi(r,n)||r.push(n)})}),r},t._captureEvent=function(e,t,n){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r=n||bf(e);ff(r)&&(r=r.parentNode||null);var i,s=this._compileUrlPatterns();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&s.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Rf(r,s.rageclick)&&this._captureEvent(e,"$rageclick",n);var o=t===fv,a=o?u({},s,{dom_event_allowlist:void 0}):s;if(r&&function(e,t,n,r,i,s){var o;if(!Wa||Mf(e))return!1;if(null!=n&&n.url_allowlist&&!vf(n.url_allowlist,s))return!1;if(null!=n&&n.url_ignorelist&&vf(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=Lf(e,r),l=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Ti(n))return!0;for(var r,i,s=function(){var e=i.value;if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}},o=f(e);!(i=o()).done;)if(r=s())return r.v;return!1}(c,n))return!1;if(!xf(c,null==n?void 0:n.css_selector_allowlist))return!1;if(xf(c,null!==(o=null==n?void 0:n.css_selector_ignorelist)&&void 0!==o?o:Cf))return!1;try{var d=Wa.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return l?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(wf.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,a,o,o?["copy","cut","paste"]:void 0,{config:{get_current_url:s.getCurrentUrl}})){var l,c=gv(r,{e:e,maskAllElementAttributes:s.maskAllElementAttributes,maskAllText:s.maskAllText,elementAttributeIgnoreList:s.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString,disableCaptureUrlHashes:s.disableCaptureUrlHashes}),d=c.props;if(c.explicitNoCapture)return!1;var h=this.getElementSelectors(r,c.target);if(h&&h.length>0&&(d.$element_selectors=h),t===fv){var p=e.type||"clipboard";if("paste"!==p){var _,v,g=null==Wa||null==(_=Wa.getSelection())?void 0:_.toString(),m=mf(g);if(!m)return!1;d.$selected_content=m,d.$clipboard_text_length=null!==(v=null==g?void 0:g.length)&&void 0!==v?v:0}d.$copy_type=p}return null==(l=this._client)||l.capture(t,d),!0}}else this._clearPointer()},t.isBrowserSupported=function(){return Ei(null==Qa?void 0:Qa.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(Xu),r=this._isDisabledServerSide,i=this._refreshConfig();if(!i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse)return!1;var s=i.remoteRequestsDisabled&&!this._hasReceivedConfigResponse;if(Li(r)&&!$i(n)&&!s)return!1;var o=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!i.enabled&&!o}}])}(),yv=function(){"use strict";function e(e){this._instance=e}return e.prototype.refresh=function(e){var t=this._instance.config,n=Fi(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}(),bv=function(e){"use strict";function t(t){var n=e.call(this,new yv(t))||this;return n.instance=t,n}return n(t,e),t}(mv),wv=su("[ExceptionAutocapture]"),Sv=function(){"use strict";function e(e){var t,n=this;this._startCapturing=function(){var e;if(Wa&&n.isEnabled&&null!=(e=Eh.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=Eh.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Eh.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Eh.__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=r(n.captureException.bind(n))),!n._unwrapConsoleError&&n._config.capture_console_errors&&(n._unwrapConsoleError=i(n.captureException.bind(n)))}catch(e){wv.error("failed to start",e),n._stopCapturing()}}},this._instance=e,this._remoteEnabled=!(null==(t=this._instance.persistence)||!t.props[tl]),this._rateLimiter=new Ji(u({},function(e){var t,n,r,i;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!==(r=null!==(i=e.exceptionRateLimiterBucketSize)&&void 0!==i?i:e.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,_logger:wv})),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 Fi(e)?t=u({},t,e):(Ti(e)?this._remoteEnabled:e)&&(t=u({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t},t.startIfEnabledOrStop=function(){this.isEnabled?(wv.info("enabled"),this._stopCapturing(),this._loadScript(this._startCapturing)):this._stopCapturing()},t._loadScript=function(e){var t,n;null!=(t=Eh.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"exception-autocapture",function(t){if(t)return wv.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={})[tl]=this._remoteEnabled,t)),this._config=this._requiredConfig(),this.startIfEnabledOrStop())}},t.onConfigChange=function(){this._config=this._requiredConfig()},t.captureException=function(e){try{var t,n,r,i=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(i))return void wv.info("Skipping exception capture because of client rate limiting.",{exception:i});null==(r=this._instance.exceptions)||r.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}}])}(),xv=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&&(iu.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,iu.info("History API monitoring stopped")},t.monitorHistoryChanges=function(){Wa&&Wa.history&&(this._patchHistoryMethod("pushState"),this._patchHistoryMethod("replaceState"),this._setupPopstateListener(),this._shouldCaptureHashChanges()&&this._setupHashchangeListener())},t._patchHistoryMethod=function(e){var t;if(Wa&&(null==(t=Wa.history[e])||!t.__posthog_wrapped__)){var n=this;Qh(Wa.history,e,function(t){return function(r,i,s){t.call(this,r,i,s),n._capturePageview(e)}})}},t._getCurrentLocation=function(){var e=null==Wa?void 0:Wa.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}:Fi(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(ic,{navigation_type:e}),this._lastLocation=t}catch(t){iu.error("Error capturing "+e+" pageview",t)}},t._setupPopstateListener=function(){var e=this;if(!this._popstateListener){var t=function(){e._capturePageview("popstate")};_u(Wa,"popstate",t),this._popstateListener=function(){Wa&&Wa.removeEventListener("popstate",t)}}},t._setupHashchangeListener=function(){var e=this;if(!this._hashchangeListener){var t=function(){e._capturePageview("hashchange")};_u(Wa,"hashchange",t),this._hashchangeListener=function(){Wa&&Wa.removeEventListener("hashchange",t)}}},o(e,[{key:"isEnabled",get:function(){var e=this._getCaptureOptions();return!!(e.path||e.search||this._shouldCaptureHashChanges(e))}}])}(),kv=su("[TracingHeaders]"),Cv=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,r=t._syncHostnamesForPatch();r?(Ti(t._restoreXHRPatch)&&(t._restoreXHRPatch=null==(e=Eh.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,function(){return t._instance.get_distinct_id()},t._instance.sessionManager)),Ti(t._restoreFetchPatch)&&(t._restoreFetchPatch=null==(n=Eh.__PosthogExtensions__)||null==(n=n.tracingHeadersPatchFns)?void 0:n._patchFetch(r,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=Eh.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"tracing-headers",function(t){if(t)return kv.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 Pi(t)?(Pi(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):(Pi(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}(),Pv=su("[Web Vitals]"),Ev=9e5,Fv=["CLS","FCP","INP","LCP"],Iv=["INP","LCP"],Tv=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Rv=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},Ai(null==e?void 0:e.name)||Ai(null==e?void 0:e.value))Pv.error("Invalid metric received",e);else{var r="string"==typeof e.navigationURL?e.navigationURL:void 0,i=n._maskedURL(r);if(!Ti(i)){var s=Oi(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+i;if(!n._maxAllowedValue||n._maxAllowedValue>e.value){n._buffer.navigationKey!==s&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,n.flushToCaptureTimeoutMs)),Ti(n._buffer.navigationKey)&&(n._buffer.navigationKey=s,n._buffer.url=i),n._buffer.firstMetricTimestamp=Ti(n._buffer.firstMetricTimestamp)?Date.now():n._buffer.firstMetricTimestamp;var o=null==(t=n._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=u({},e,r?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});if(delete a.entries,Fi(e.attribution)&&n.attributionMetrics.indexOf(e.name)>-1){for(var l,c={},d=f(Tv);!(l=d()).done;){var h=l.value,p="url"===h&&"string"==typeof e.attribution[h]?n._maskedURL(e.attribution[h]):e.attribution[h];Ti(p)||(c[h]=p)}a.attribution=c}else delete a.attribution;Ti(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 Pv.error("Ignoring metric with value >= "+n._maxAllowedValue,e)}}},this._startCapturing=function(){if(!n._initialized){var e,t,r,i,s=!1,o=Eh.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[n._callbackFlavor])||("web-vitals"===n._callbackFlavor&&Ti(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ti(l)){var c=l.withoutAttribution,d=n.attributionMetrics;s=!Ti(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,r=d.indexOf("FCP")>-1?l.onFCP:(null==c?void 0:c.onFCP)||l.onFCP,i=d.indexOf("INP")>-1?l.onINP:(null==c?void 0:c.onINP)||l.onINP}if(e&&t&&r&&i){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&&r(n._addToBuffer.bind(n),h),n.allowedMetrics.indexOf("INP")>-1&&i(n._addToBuffer.bind(n),f),n._initialized=!0}else Pv.error("web vitals callbacks not loaded - not starting")}},this._enabledServerSide=!(null==(t=this._instance.persistence)||!t.props[il]),this.startIfEnabled()}var t=e.prototype;return t.startIfEnabled=function(){this.isEnabled&&!this._initialized&&(Pv.info("enabled, starting..."),this._loadScript(this._startCapturing))},t.onRemoteConfig=function(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var n,r,i=Fi(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=Fi(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register(((n={})[il]=i,n)),this._instance.persistence.register(((r={})[ul]=s,r))),this._enabledServerSide=i,this.startIfEnabled()}}},t._loadScript=function(e){var t=Eh.__PosthogExtensions__,n=this._callbackFlavor,r=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=r&&r[n]||"web-vitals"===n&&Ti(r)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,n,function(t){t?Pv.error("failed to load script",t):e()})},t._maskedURL=function(e){var t=e||(null==Wa?void 0:Wa.location.href);if(t){var n=this._instance.config.disable_capture_url_hashes?po(t):t;return mc(n,this._instance.config.mask_personal_data_properties?[].concat(Zd,this._instance.config.custom_personal_data_properties||[]):[],Yd)}Pv.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=Fi(this._perfConfig)?null==(e=this._perfConfig)?void 0:e.web_vitals_allowed_metrics:void 0;return Ai(n)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||Fv:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(Fi(this._perfConfig)?this._perfConfig.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"attributionMetrics",get:function(){var e=Fi(this._perfConfig)?this._perfConfig.web_vitals_attribution:void 0;return $i(e)?e?Fv:[]:Pi(e)?e:Iv}},{key:"useAttribution",get:function(){return this.attributionMetrics.length>0}},{key:"useSoftNavs",get:function(){var e;return null!==(e=Fi(this._perfConfig)?this._perfConfig.__preview_web_vitals_soft_navs:void 0)&&void 0!==e&&e}},{key:"_maxAllowedValue",get:function(){var e=Fi(this._perfConfig)&&Oi(this._perfConfig.__web_vitals_max_value)?this._perfConfig.__web_vitals_max_value:Ev;return e>0&&6e4>=e?Ev:e}},{key:"isEnabled",get:function(){var e=null==Za?void 0:Za.protocol;if("http:"!==e&&"https:"!==e)return Pv.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Fi(this._perfConfig)?this._perfConfig.web_vitals:$i(this._perfConfig)?this._perfConfig:void 0;return $i(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"}}])}(),Mv="disabled",Lv="lazy_loading",Av=su("[SessionRecording]"),Ov=function(){"use strict";function e(e){var t=this;if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this._recordingStatus=Mv,this._persistFlagsOnSessionListener=void 0,this._sessionRecordingDisposed=!1,this._documentWasEverVisible=function(){var e;if(null==Qa||!Qa.visibilityState||"visible"===Qa.visibilityState)return!0;var t=null==Wa||null==(e=Wa.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==Qa?void 0:Qa.visibilityState)&&(t._documentWasEverVisible=!0,null==(e=t._lazyLoadedSessionRecording)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw Av.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!=Qa&&Qa.addEventListener&&_u(Qa,"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==Qa||null==Qa.removeEventListener||Qa.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=!Ti(Object.assign)&&!Ti(Array.from);this._isRecordingEnabled&&n?(this._lazyLoadAndStart(e),Av.info("starting")):(this._recordingStatus=Mv,this.stopRecording())}},t._lazyLoadAndStart=function(e){var t,n,r=this;if(this._isRecordingEnabled)if("awaiting_config"!==this._recordingStatus&&"missing_config"!==this._recordingStatus&&(this._recordingStatus=Lv),null!=Eh&&null!=(t=Eh.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(n=Eh.__PosthogExtensions__)&&n.initSessionRecording)this._onScriptLoaded(e);else{var i,s=this._instance.sessionManager;null==(i=Eh.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this._scriptName,function(t){if(!r._sessionRecordingDisposed&&r._isRecordingEnabled&&r._instance.sessionManager===s){var n;if(t)return r._instance.register_for_session(((n={})[Zl]=!0,n)),Av.error("could not load recorder",t);r._onScriptLoaded(e)}else r._recordingStatus=Mv})}},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(vl),null==(t=this._persistence)||t.unregister(cl)},t._validateSampleRate=function(e,t){if(Ai(e))return null;var n,r=Oi(e)?e:parseFloat(e);return"number"!=typeof(n=r)||!Number.isFinite(n)||0>n||n>1?(Av.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r},t._persistRemoteConfig=function(e){var t=this;if(this._persistence){var n,r,i=this._persistence,s=function(){var n,r,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;Ai(l)&&t._resetSampling();var c=null==s?void 0:s.minimumDurationMilliseconds;i.register(((r={})[ll]=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:Ti(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}),r))};s(),null==(n=this._persistFlagsOnSessionListener)||n.call(this),this._persistFlagsOnSessionListener=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(s)}},t.onRemoteConfig=function(e){var t=e.ok?e.config:void 0;if(t&&"sessionRecording"in t){if(!1===t.sessionRecording)return this._persistRemoteConfig(t),void this._discardRecording();this._persistRemoteConfig(t),this.startIfEnabledOrStop()}else{var n;"awaiting_config"===this._recordingStatus&&(this._recordingStatus="missing_config",this._instance.register_for_session(((n={})[Jl]=!0,n)),Av.warn("config refresh failed, recording will not start until page reload")),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):Av.warn("log called before recorder was ready")},t._isRemoteConfigFresh=function(){var e,t=this._instance.get_property(ll);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return Av.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!Ai(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp},t._onScriptLoaded=function(e){var t,n,r;if(!this._sessionRecordingDisposed&&this._isRecordingEnabled&&this._instance.sessionManager){var i,s;if(null==(t=Eh.__PosthogExtensions__)||!t.initSessionRecording)return Av.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session((i={},i[Zl]=!0,i));if(this._lazyLoadedSessionRecording||(this._lazyLoadedSessionRecording=null==(s=Eh.__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",Av.info("persisted remote config is stale, requesting fresh config before starting"),void new kp(this._instance).load()}this._recordingStatus=Lv,null==(n=(r=this._lazyLoadedSessionRecording).setDocumentWasEverVisible)||n.call(r,this._documentWasEverVisible),this._lazyLoadedSessionRecording.start(e)}else this._recordingStatus=Mv},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={})[hl]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideLinkedFlag()},t.overrideSampling=function(){var e,t,n;this._lazyLoadedSessionRecording||null==(e=this._persistence)||e.register(((t={})[dl]=!0,t)),null==(n=this._lazyLoadedSessionRecording)||n.overrideSampling()},t.overrideTrigger=function(e){var t,n,r;this._lazyLoadedSessionRecording||null==(t=this._persistence)||t.register(((n={})["url"===e?fl:pl]=!0,n)),null==(r=this._lazyLoadedSessionRecording)||r.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(ll))||!e.enabled),n=!this._config.disable_session_recording,r=this._config.disable_session_recording||this._instance.consent.isOptedOut();return Wa&&t&&n&&!r}},{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}}}])}(),Dv=su("[Heatmaps]");function $v(e){return Fi(e)&&"clientX"in e&&"clientY"in e&&Oi(e.clientX)&&Oi(e.clientY)}var qv=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[el]),this.rageclicks=new hv(e.config.rageclick)}var t=e.prototype;return t.initialize=function(){this.startIfEnabled()},t.startIfEnabled=function(){if(this.isEnabled){if(this._initialized)return;Dv.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 r=!!n.heatmaps;this.instance.persistence&&this.instance.persistence.register(((t={})[el]=r,t)),this._enabledServerSide=r,this.startIfEnabled()}}},t.getAndClearBuffer=function(){var e=this._buffer;return this._buffer=void 0,e},t._onDeadClick=function(e){$v(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)}(Qa)?setInterval(this._flush.bind(this),this.flushIntervalMilliseconds):null},t._setupListeners=function(){var e=this;Wa&&Qa&&(this._flushHandler=this._flush.bind(this),_u(Wa,rc,this._flushHandler),this._onClickHandler=function(t){return e._onClick(t||(null==Wa?void 0:Wa.event))},_u(Qa,"click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler=function(t){return e._onMouseMove(t||(null==Wa?void 0:Wa.event))},_u(Qa,"mousemove",this._onMouseMoveHandler,{capture:!0}),this._deadClicksCapture=new Jf(this.instance,Qf,this._onDeadClick.bind(this)),this._deadClicksCapture.startIfEnabledOrStop(),this._onVisibilityChange_handler=this._onVisibilityChange.bind(this),_u(Qa,nc,this._onVisibilityChange_handler),this._initialized=!0)},t._removeListeners=function(){var e;Wa&&Qa&&(this._flushHandler&&Wa.removeEventListener(rc,this._flushHandler),this._onClickHandler&&Qa.removeEventListener("click",this._onClickHandler,{capture:!0}),this._onMouseMoveHandler&&Qa.removeEventListener("mousemove",this._onMouseMoveHandler,{capture:!0}),this._onVisibilityChange_handler&&Qa.removeEventListener(nc,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(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(e,t,n){for(var r=e;r&&df(r)&&!hf(r,"body");){if(r===n)return!1;var i=void 0;try{var s,o,a;i=null==(s=null!==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:Wa)?void 0:s.getComputedStyle(r).position}catch(e){return!1}if(yi(t,i))return!0;r=kf(r)}return!1}(bf(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}},t._onClick=function(e,t){var n;if(void 0===t&&(t="click"),!cf(e.target)&&$v(e)){var r=this._getProperties(e,t);null!=(n=this.rageclicks)&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&Rf(bf(e),this.instance.config.rageclick)&&this._capture(u({},r,{type:"rageclick"})),this._capture(r)}},t._onMouseMove=function(e){var t=this;!cf(e.target)&&$v(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))},t._capture=function(e){if(Wa){var t=this._config.disable_capture_url_hashes?po(Wa.location.href):Wa.location.href,n=mc(t,this._config.mask_personal_data_properties?[].concat(Zd,this._config.custom_personal_data_properties||[]):[],Yd);this._buffer=this._buffer||{},this._buffer[n]||(this._buffer[n]=[]),this._buffer[n].push(e)}},t._flush=function(){this._buffer&&!Ii(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 Fi(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 Ai(this._config.capture_heatmaps)?Ai(this._config.enable_heatmaps)?this._enabledServerSide:this._config.enable_heatmaps:!1!==this._config.capture_heatmaps}}])}(),Bv=su("[Product Tours]"),Nv=function(e){var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(ol))},Hv=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 r,i;if(this._persistence&&this._persistence.register(((t={})[ol]=!!n.productTours,t)),!Nv(this._instance))return!this._productTourManager&&Ai(null==(r=this._persistence)?void 0:r.props.ph_product_tours)||Bv.info("product tours disabled; stopping and clearing cached tours"),null==(i=this._productTourManager)||i.stop(),this._productTourManager=null,void this.clearCache();this.loadIfEnabled()}}},t.loadIfEnabled=function(){var e=this;!this._productTourManager&&Nv(this._instance)&&this._loadScript(function(){return e._startProductTours()})},t._loadScript=function(e){var t,n;null!=(t=Eh.__PosthogExtensions__)&&t.generateProductTours?e():null==(n=Eh.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,"product-tours",function(t){t?Bv.error("Could not load product tours script",t):e()})},t._startProductTours=function(){var e;!this._productTourManager&&null!=(e=Eh.__PosthogExtensions__)&&e.generateProductTours&&(this._productTourManager=Eh.__PosthogExtensions__.generateProductTours(this._instance,!0))},t.getProductTours=function(e,t){var n=this;if(void 0===t&&(t=!1),!Pi(this._cachedTours)||t){var r=this._persistence;if(r){var i=r.props[Al];if(Pi(i)&&!t)return this._cachedTours=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:function(t){var i;if(Nv(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||Bv.warn(o):Bv.error(o),void e([],{isLoaded:!1,error:o})}var a=Pi(t.json.product_tours)?t.json.product_tours:[];n._cachedTours=a,r&&r.register(((i={})[Al]=a,i)),e(a,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this._cachedTours,{isLoaded:!0})},t.getActiveProductTours=function(e){Ai(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(Al)},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}}])}(),jv=su("[SiteApps]"),Uv="Error while initializing PostHog app with config id ",zv=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,r,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({},i(e,t),{properties:u({},e.properties,y?{$set:u({},null!==(n=null==(r=e.properties)?void 0:r.$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)||(jv.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)||(jv.error("prepare_external_dependency_script returned null"),null):e},n._patchSiteAppElementInsertionMethods=function(){var e,t,n,r,i,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==Qa?void 0:Qa.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 r=e[t];e[t]=n(r),d.push(function(){e[t]=r})}},_=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!Li(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 r=_(t);return r?e.call(this,r,n):t}}),p(c,"replaceChild",function(e){return function(t,n){var r=_(t);return r?e.call(this,r,n):n}}),[null==(t=l.Element)?void 0:t.prototype,null==(n=l.Document)?void 0:n.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach(function(e){p(e,"append",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"prepend",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}})}),[null==(i=l.Element)?void 0:i.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),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"after",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,v(n))}}),p(e,"replaceWith",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=v(n);return n.length&&!i.length?void 0:e.apply(this,i)}})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",function(e){return function(t,n){var r=_(n);return r?e.call(this,t,r):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 r=e(n);return t&&n(),r}catch(e){throw n(),e}},n.setupSiteApp=function(e){var t=this,n=this.apps[e.id],r=function(){!n.errored&&t._bufferedInvocations.length&&(jv.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())},i=!1,s=function(t){n.errored=!t,n.loaded=!0,jv.info("Site app with id "+e.id+" "+(t?"loaded":"errored")),i&&r()};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),i=!0}catch(t){jv.error(Uv+e.id,t),s(!1)}if(i&&n.loaded)try{r()}catch(t){jv.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=f(t);!(e=n()).done;){var r=e.value;this.apps[r.id]={id:r.id,loaded:!1,errored:!1,processedBuffer:!1}}for(var i,s=f(t);!(i=s()).done;)this.setupSiteApp(i.value)},n._onCapturedEvent=function(e){var t=this;if(0!==Object.keys(this.apps).length)for(var n=this.globalsForEvent(e),r=function(){var r=s[i];try{t._runWithPreparedSiteAppElements(function(){return null==r.processEvent?void 0:r.processEvent(n)})}catch(t){jv.error("Error while processing event "+e.event+" for site app "+r.id,t)}},i=0,s=Object.values(this.apps);s.length>i;i++)r()},n.onRemoteConfig=function(e){var t,n,r,i=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this._setupSiteApps(),void this._instance.on("eventCaptured",function(e){return i._onCapturedEvent(e)})):void jv.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!=(r=s.siteApps)&&r.length)if(this.isEnabled)for(var o,a=function(){var e,t=o.value,n=t.id,r=t.url;Eh["__$$ph_site_app_"+n]=i._instance,null==(e=Eh.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(i._instance,r,function(e){if(e)return jv.error(Uv+n,e)})},u=f(s.siteApps);!(o=u()).done;)a();else jv.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=Eh._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}}])}(),Vv=function(e,t){return null!=e&&e.then?e.then(t):t(e)},Wv="SDK is not enabled or survey functionality is not yet loaded",Gv="Disabled. Not loading surveys.",Kv=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 Au.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Ai(t))return Au.warn("Flags not loaded yet. Not loading surveys.");n._isSurveysEnabled=$i(t)?t:t.length>0,Au.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,Vv(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(){var e;null==(e=this._surveyManager)||null==e.clearInMemoryInProgressSurveyState||e.clearInMemoryInProgressSurveyState();try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var n=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);(null!=i&&i.startsWith("seenSurvey_")||null!=i&&i.startsWith("inProgressSurvey_"))&&n.push(i)}n.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)Au.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Au.info(Gv);else if(t.cookielessMode&&this._configSource.isOptedOut())Au.info("Not loading surveys in cookieless mode without consent.");else{var n=this._configSource.getExtensions();if(n){if(!Ti(this._isSurveysEnabled)||t.advancedEnableSurveys){var r=this._isSurveysEnabled||t.advancedEnableSurveys;this._isInitializingSurveys=!0;try{var i=n.generateSurveys;if(i)return this._completeSurveyInitialization(i,r),void(this._isInitializingSurveys=!1);var s=n.loadExternalDependency;if(!s)return this._handleSurveyLoadError(Yl),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,r)}finally{e._isInitializingSurveys=!1}})}catch(e){throw this._isInitializingSurveys=!1,this._handleSurveyLoadError("Error initializing surveys",e),e}}}else Au.error("PostHog Extensions not found.")}}},t._completeSurveyInitialization=function(e,t){this._disposed||(this._surveyManager=e(t),this._surveyEventReceiver=this._configSource.createEventReceiver(),Au.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0}))},t._handleSurveyLoadError=function(e,t){Au.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,r=this;void 0===t&&(t=!1);var i=null!==(n=this._client)&&void 0!==n?n:this._initialClientState;if(i&&!this._disposed){if(this._config.disableSurveys)return Au.info(Gv),e([]);var s=i.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){r._disposed||e(t.surveys,t.context)}).catch(function(e){return Au.error("Error in survey callback",e)});else{var o=this._sendSurveysRequest("/api/surveys/",{method:"GET",query:{token:i.projectToken},sentAt:"query",timeoutMs:this._config.requestTimeoutMs}).then(function(e){try{return r._handleSurveyResponse(i,e)}catch(e){return Au.error("Error processing surveys response",e),r._handleSurveyResponse(i,{statusCode:0,error:e})}},function(e){return r._handleSurveyResponse(i,{statusCode:0,error:e})});this._getSurveysInFlightPromise=o;var a=function(){r._getSurveysInFlightPromise===o&&(r._getSurveysInFlightPromise=null)};o.then(function(t){a(),r._disposed||e(t.surveys,t.context)},a).catch(function(e){return Au.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(Wv)})})},t._handleSurveyResponse=function(e,t){var n,r;if(this._disposed)return{surveys:[],context:{isLoaded:!1,error:Wv}};var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return 0!==i?Au.error(s):t.error||Au.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)&&(Eu(e)||qu(e))});return a.length>0&&(null==(n=this._surveyEventReceiver)||n.register(a)),e.kv.set(((r={})[Il]=o,r[Tl]=Date.now(),r)),{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(Tl);return Oi(n)&&Date.now()-n>3e5},t._isSurveyRefreshBackingOff=function(){return Oi(this._lastSurveyRefreshFailedAt)&&3e5>Date.now()-this._lastSurveyRefreshFailedAt},t.markSurveyAsSeen=function(e,t){var n;Hu({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=f(this._surveyCallbacks);!(t=n()).done;){var r=t.value;try{if(!e.isLoaded)return r([],e);this.getSurveys(r)}catch(e){Au.error("Error in survey callback",e)}}},t.getActiveMatchingSurveys=function(e,t){if(void 0===t&&(t=!1),!Ai(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Au.warn("init was not called")},t._getSurveyById=function(e){var t=null;return this.getSurveys(function(n){var r;t=null!==(r=n.find(function(t){return t.id===e}))&&void 0!==r?r:null}),t},t._checkSurveyEligibility=function(e){if(Ai(this._surveyManager))return{eligible:!1,reason:Wv};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(!this._configSource.isCapturing())return{eligible:!1,reason:Ou};if(Ai(this._surveyManager))return{eligible:!1,reason:Wv};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(Ai(this._surveyManager))return Au.warn("init was not called"),{visible:!1,disabledReason:Wv};var t=this._checkSurveyRenderability(e);return{visible:t.eligible,disabledReason:t.reason}},t.canRenderSurveyAsync=function(e,t){var n=this;return Ai(this._surveyManager)?(Au.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Wv})):new Promise(function(r){n.getSurveys(function(t){var i,s=null!==(i=t.find(function(t){return t.id===e}))&&void 0!==i?i:null;if(s){var o=n._checkSurveyRenderability(s);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})},t.renderSurvey=function(e,t,n){var r,i=this;if(this._configSource.isCapturing())if(Ai(this._surveyManager))Au.warn("init was not called");else{var s="string"==typeof e?this._getSurveyById(e):e;if(null!=s&&s.id)if(ju.includes(s.type)){var o=null==Qa?void 0:Qa.querySelector(t);if(o)if(null!=(r=s.appearance)&&r.surveyPopupDelaySeconds){Au.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(function(){var e,t;i._renderTimeouts.delete(a),!i._disposed&&i._configSource.isCapturing()&&(Au.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=i._surveyManager)||t.renderSurvey(s,o,n),Au.info("Survey "+s.id+" rendered"))},1e3*s.appearance.surveyPopupDelaySeconds);this._renderTimeouts.add(a)}else this._surveyManager.renderSurvey(s,o,n);else Au.warn("Survey element not found")}else Au.warn("Surveys of type "+s.type+" cannot be rendered in the app");else Au.warn("Survey not found")}},t.displaySurvey=function(e,t){var n;if(this._configSource.isCapturing())if(Ai(this._surveyManager))Au.warn("init was not called");else{var r=this._getSurveyById(e);if(r){var i=r;if(null!=(n=r.appearance)&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=u({},r,{appearance:u({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==hi&&t.initialResponses&&Au.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var s=this._checkSurveyEligibility(r);if(!s.eligible)return void Au.warn("Survey is not eligible to be displayed: ",s.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else Au.warn("Survey not found")}},t.cancelPendingSurvey=function(e){Ai(this._surveyManager)?Au.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 Qv(e,t,n){if(Ai(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var Zv=function(){"use strict";function e(e){var t=this;this._instance=e,this._actionRegistry=new Set,this._actionEvents=new Set,this._debugEventEmitter=new T_,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;Ti(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 T_},t.register=function(e){var t,n,r=this;if(!Ti(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(function(e){var t;r._actionRegistry.add(e),null==(t=e.steps)||t.forEach(function(e){r._actionEvents.add((null==e?void 0:e.event)||"")})}),null!=(n=this._instance)&&n.autocapture)){var i=new Set;this._actionRegistry.forEach(function(e){var t;null==(t=e.steps)||t.forEach(function(e){null!=e&&e.selector&&i.add(e.selector)})}),this._instance.autocapture.setElementSelectors(i)}},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,r=f(t.steps);!(n=r()).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,r=null==e||null==(n=e.properties)?void 0:n.$current_url;if(!r||"string"!=typeof r)return!1;if(!Qv(r,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 r=this._getElementsList(e);if(r.length>0)return r.some(function(e){return Qv(e.href,t.href,t.href_matching||"exact")});var i,s=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!s&&Qv((i=s.match(/(?::|")href="(.*?)"/))?i[1]:"",t.href,t.href_matching||"exact")},t._checkStepText=function(e,t){var n;if(null==t||!t.text)return!0;var r=this._getElementsList(e);if(r.length>0)return r.some(function(e){return Qv(e.text,t.text,t.text_matching||"exact")||Qv(e.$el_text,t.text,t.text_matching||"exact")});var i,s,o,a=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!a&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!Ai(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(a),s=t.text,o=t.text_matching||"exact",i.some(function(e){return Qv(e,s,o)}))},t._checkStepSelector=function(e,t){var n,r;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 i=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&i)try{return new RegExp(t.selector_regex).test(i)}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||Mu(t.properties.reduce(function(e,t){var n=Pi(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}(),Jv=function(e){"use strict";function t(t){return e.call(this,t)||this}n(t,e);var r=t.prototype;return r._getActivatedKey=function(){return Rl},r._getActivatedSessionKey=function(){return Ml},r._getActivationTimestampsKey=function(){return Ll},r._writeActivationTimestamps=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Ll]=e,n))},r._clearActivationTimestampsStore=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Ll)},r._shouldPersistArmedActivation=function(e){var t,n;this._getItems(function(t){n=t.find(function(t){return t.id===e})});var r=null==(t=n)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return Oi(r)&&r>0},r._getShownEventName=function(){return ii},r._getItems=function(e){var t;null==(t=this._instance)||t.getSurveys(e)},r._cancelPendingItem=function(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)},r._getLogger=function(){return Au},r._setActivatedItems=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Rl]=e,n))},r._setActivatedSession=function(e){var t,n;null==(t=this._instance)||null==(t=t.persistence)||t.register(((n={})[Ml]=e,n))},r._clearActivatedSession=function(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Ml)},r._isItemPermanentlyIneligible=function(){return!1},r._activationOutcome=function(e,t){var n;return this._getItems(function(e){n=e.find(function(e){return e.id===t})}),!n||Fu(n)?e===ii?"consume":"ignore":e===ii?"persist":e===si||e===oi?"consume":"ignore"},r.getSurveys=function(){return this.getActivatedIds()},r.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&&Mu(e.propertyFilters,null==t?void 0:t.properties)},t._buildEventToItemMap=function(e,t){var n=new Map;return e.forEach(function(e){var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(function(t){if(null!=t&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}})}),n},t._getMatchingItems=function(e,t,n){var r=this,i=(n===jr?this._eventToItems:this._cancelEventToItems).get(e),s=[];return this._getItems(function(e){s=e.filter(function(e){return null==i?void 0:i.includes(e.id)})}),s.filter(function(i){var s,o=null==(s=i.conditions)||null==(s=s[n])||null==(s=s.values)?void 0:s.find(function(t){return t.name===e});return r._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;Ti(null==(n=this._instance)?void 0:n._addCaptureHook)||(this._setupEventBasedItems(e,t),this._setupActionBasedItems(e,t))},t._setupActionBasedItems=function(e,t){var n=this,r=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!==r.length){this._actionMatcher||(this._actionMatcher=new Zv(this._instance),this._actionMatcher.init(),this._actionMatcher._addActionHook(function(e){return n.onAction(e)}));var i=[];r.forEach(function(e){var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(function(t){if(i.push(t),t.name){var r,s=null!==(r=n._actionToItems.get(t.name))&&void 0!==r?r:[];s.includes(e.id)||s.push(e.id),n._actionToItems.set(t.name,s)}})}),t?this._actionMatcher.replace(i):this._actionMatcher.register(i)}else{var s;t&&(null==(s=this._actionMatcher)||s.replace([]))}},t._mergeItemMaps=function(e,t){t.forEach(function(t,n){var r,i=null!==(r=e.get(n))&&void 0!==r?r:[];t.forEach(function(e){i.includes(e)||i.push(e)}),e.set(n,i)})},t._setupEventBasedItems=function(e,t){var n,r,i=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,jr),u=this._buildEventToItemMap(e,Ur);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==(r=this._instance)?void 0:r._addCaptureHook(function(e,t){i.onEvent(e,t)})))},t.onEvent=function(e,t){var n,r,i=this,s=this._getLogger(),o=(null==t||null==(n=t.properties)?void 0:n.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$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,Ur);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 i._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,jr);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,r=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),i=[],s=f(e);!(n=s()).done;){var o=n.value;r&&this._shouldPersistArmedActivation(o)?this._persistActivation(o)&&this._recordActivationTimestamp(o):i.push(o)}i.length>0&&(this._pendingActivatedItems=[].concat(new Set([].concat(this._pendingActivatedItems,i)))),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(),r=n.filter(function(e){return!t.has(e)});r.length!==n.length&&(this._setActivatedItems(r),0===r.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={},r=!1,i=0,s=Object.entries(t);s.length>i;i++){var o=s[i],a=o[0],u=o[1];e.includes(a)?r=!0:n[a]=u}r&&(Ii(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 Oi(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 r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._getActivatedSessionKey()],i=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return i&&r===i?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,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._getActivatedSessionKey()];if(r&&r!==e){var i=this._getRawPersistedActivatedIds(),s=this._getRawActivationTimestamps();i.length>0&&(this._setActivatedItems([]),i.filter(function(e){return Oi(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}()),Yv=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={},r=f(e);!(t=r()).done;){var i=t.value,s=this._instance.get_property(i);Ti(s)||(n[i]=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}(),Xv=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.isCapturing=function(){return this._instance.is_capturing()},t.getExtensions=function(){var e=this,t=null==Eh?void 0:Eh.__PosthogExtensions__;if(t){var n=t.generateSurveys,r=t.loadExternalDependency;return{generateSurveys:n?function(t){return n(e._instance,t)}:void 0,loadExternalDependency:r?function(t){return r(e._instance,"surveys",t)}:void 0}}},t.createEventReceiver=function(){return new Jv(this._instance)},e}(),eg=function(e){"use strict";function t(t){var n,r=e.call(this,new Xv(t),(n=t,{get projectToken(){return n.config.token},kv:new Yv(n)}))||this;return r._instance=t,r}return n(t,e),t.prototype._sendSurveysRequest=function(e,t){var n=this,r=t.query?c_(e,t.query):e;return new Promise(function(e){var i;n._instance._send_request({method:t.method,url:n._instance.requestRouter.endpointFor(null!==(i=t.target)&&void 0!==i?i:"api",r),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})},t}(Kv),tg=null!=Wa&&Wa.location?yc(Wa.location.hash,"__posthog")||yc(location.hash,"state"):null,ng="_postHogToolbarParams",rg=su("[Toolbar]"),ig=function(){"use strict";function e(e){this.instance=e}var t=e.prototype;return t._setToolbarState=function(e){Eh.ph_toolbar_state=e},t._getToolbarState=function(){var e;return null!==(e=Eh.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),vu(this.instance.config))return!1;if(!Wa||!Qa)return!1;e=null!=e?e:Wa.location,n=null!=n?n:Wa.history;try{if(!t){try{Wa.localStorage.setItem("test","test"),Wa.localStorage.removeItem("test")}catch(e){return!1}t=null==Wa?void 0:Wa.localStorage}var r,i=tg||yc(e.hash,"__posthog")||yc(e.hash,"state"),s=i?_o(function(){return JSON.parse(atob(decodeURIComponent(i)))})||_o(function(){return JSON.parse(decodeURIComponent(i))}):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(ng)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}},t._callLoadToolbar=function(e){var t=Eh.ph_load_toolbar||Eh.ph_load_editor;!Ai(t)&&Ei(t)?t(e,this.instance):rg.warn("No toolbar load function found")},t.loadToolbar=function(e){var t=this,n=!(null==Qa||!Qa.getElementById("__POSTHOG_TOOLBAR__"));if(!Wa||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=u({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Wa.localStorage.setItem(ng,JSON.stringify(u({},i,{source:void 0}))),2===this._getToolbarState())this._callLoadToolbar(i);else if(0===this._getToolbarState()){var s;this._setToolbarState(1),null==(s=Eh.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",function(e){if(e)return rg.error("[Toolbar] Failed to load",e),void t._setToolbarState(0);t._setToolbarState(2),t._callLoadToolbar(i)}),_u(Wa,"turbolinks:load",function(){t._setToolbarState(0),t.loadToolbar(i)})}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}(),sg=su("[FeatureFlags]"),og=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,r,i,s,o,a,u,l;return{bootstrap:{featureFlags:null!==(n=null==(r=e.bootstrap)?void 0:r.featureFlags)&&void 0!==n?n:void 0,featureFlagPayloads:null!==(i=null==(s=e.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==i?i:void 0},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!==(o=e.remote_config_refresh_interval_ms)&&void 0!==o?o:3e5,idleRefreshBackoff:Ti(e.remote_config_refresh_interval_ms),requestTimeoutMs:e.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,null!==(a=e.feature_flag_request_max_retries)&&void 0!==a?a:1),compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(u=null!==(l=e.evaluation_contexts)&&void 0!==l?l:e.evaluation_environments)&&void 0!==u?u:[],flagKeys:Pi(e.flag_keys)?e.flag_keys:void 0}}(e,t),!e.evaluation_environments||e.evaluation_contexts||this._loggedEvaluationEnvironmentsDeprecation||(sg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this._loggedEvaluationEnvironmentsDeprecation=!0),Ti(e.flag_keys)||Pi(e.flag_keys)||sg.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")},t.get=function(){return this._snapshot},e}(),ag=su("[FeatureFlags]"),ug=su("[FeatureFlags]",{debugEnabled:!0}),lg="\" failed. Feature flags didn't load in time.",cg=[502,504],dg=["click","keydown","wheel","touchstart","pointerdown"],hg="connection_error",fg=function(e){for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},pg=function(e){for(var t,n={},r=f(lu(e||{}));!(t=r()).done;){var i=t.value,s=i[1];s&&(n[i[0]]=s)}return n},_g=function(){"use strict";function e(e){var t=this;this.name="featureFlags",this._override_warning=!1,this.featureFlagEventHandlers=[],this._logger=ag,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._hadUserInteraction=!1,this._onOnline=function(){var e=t._hasStatusZeroCircuitBreakerTripped();t._consecutiveStatusZeroFailures=0,e&&t.reloadFeatureFlags()},this._refreshIfDue=function(){var e,n,r=t._refreshIntervalMs,i=null!==(e=t._dueRefreshIntervalMs)&&void 0!==e?e:r;Ti(r)||Ti(i)||t._config.remoteRequestsDisabled||!Qa||"hidden"===Qa.visibilityState||Date.now()-(null!==(n=t._lastRefreshAt)&&void 0!==n?n:0)<i||(t._dueRefreshIntervalMs=t._hadUserInteraction||!t._config.idleRefreshBackoff?r:Math.min(2*i,36e5),t._hadUserInteraction=!1,t.reloadFeatureFlags(),t._scheduleNextRefresh())},this._onUserInteraction=function(){t._hadUserInteraction&&t._dueRefreshIntervalMs===t._refreshIntervalMs||t._resumeConfiguredInterval()},this._onVisibilityChange=function(){"visible"===(null==Qa?void 0:Qa.visibilityState)&&t._resumeConfiguredInterval()},"get"in e?this._configSource=e:(this._instance=e,this._mutableConfigSource=new og(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]"),Vv(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 Wa&&_u(Wa,"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._resumeConfiguredInterval=function(){this._hadUserInteraction=!0,this._dueRefreshIntervalMs=this._refreshIntervalMs,this._refreshIfDue()},t._syncAutomaticRefresh=function(){var e=this,t=this._config.refreshIntervalMs,n=!this._config.remoteRequestsDisabled&&Qa&&!Ti(t)&&t>0?t:void 0;this._config.idleRefreshBackoff||(this._dueRefreshIntervalMs=n),n!==this._refreshIntervalMs&&(this._stopAutomaticRefresh(),Ti(n)||(this._refreshIntervalMs=n,this._dueRefreshIntervalMs=n,this._scheduleNextRefresh(),null!=Qa&&Qa.addEventListener&&(_u(Qa,nc,this._onVisibilityChange),ou(dg,function(t){_u(Qa,t,e._onUserInteraction,{capture:!0})}))))},t._scheduleNextRefresh=function(){Ti(this._refreshIntervalMs)||(Ti(this._refreshInterval)||clearInterval(this._refreshInterval),this._lastRefreshAt=Date.now(),this._refreshInterval=setInterval(this._refreshIfDue,this._refreshIntervalMs))},t._stopAutomaticRefresh=function(){var e=this;Ti(this._refreshInterval)||(clearInterval(this._refreshInterval),this._refreshInterval=void 0,null==Qa||null==Qa.removeEventListener||Qa.removeEventListener(nc,this._onVisibilityChange),ou(dg,function(t){null==Qa||null==Qa.removeEventListener||Qa.removeEventListener(t,e._onUserInteraction,{capture:!0})})),this._refreshIntervalMs=void 0,this._dueRefreshIntervalMs=void 0,this._hadUserInteraction=!1,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==Wa||Wa.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!Ti(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 r,i;if(null!=(r=this._instance)&&r.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&&!Pi(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=((i={})[ml]=_,i[gl]=_,i[wl]=v,i);e.$feature_flag_details&&(g[bl]=_);for(var m=0,y=[Sl,ql,xl];y.length>m;m++){var b=y[m];Ti(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=[ml,wl,Sl,kl];n.length>t;t++){var r=n[t],i=this._prop(r);Ti(i)||(e[r]=i)}this._baseEventProperties=e;var s=u({},e),o=this._prop(gl);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(ql);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(!Ti(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,r=null!==(e=null==(t=n.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(r).length){var i,s,o=null!==(i=null==(s=n.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==i?i:{},a=Object.keys(r).filter(function(e){return!Ti(r[e])}).reduce(function(e,t){return e[t]=r[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 r,i,s=null!=n&&n.merge&&null!==(r=this._prop("$enabled_feature_flags"))&&void 0!==r?r:{},o=null!=n&&n.merge&&null!==(i=this._prop("$feature_flag_payloads"))&&void 0!==i?i:{},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:oa(_),variant:aa(_),reason:void 0,metadata:Ti(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(bl),t=this._prop(kl),n=this._prop(Cl);if(!n&&!t)return e||{};for(var r,i=uu({},e||{}),s=f([].concat(new Set([].concat(Object.keys(n||{}),Object.keys(t||{})))));!(r=s()).done;){var o,a,l=r.value,c=i[l],d=null==t?void 0:t[l],h=Ti(d)?null!==(o=null==c?void 0:c.enabled)&&void 0!==o&&o:!!d,p=Ti(d)?null==c?void 0:c.variant:"string"==typeof d?d:void 0,_=null==n?void 0:n[l],v=u({},c,{enabled:h,variant:h?null!=p?p:null==c?void 0:c.variant:void 0});h!==(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})),i[l]=v}return this._override_warning||(this._logger.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this._override_warning=!0),i},t.getAllFeatureFlags=function(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(function(n){var r=e[n];return{key:n,enabled:oa(r),variant:aa(r),payload:sa(t[n])}})},t.getFlagVariants=function(){var e=this._prop(gl),t=this._prop(kl);if(!t)return e||{};for(var n=uu({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];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(wl),t=this._prop(Cl);if(!t)return e||{};for(var n=uu({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];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(Ol)},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 r={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(El),timezone:uh()};Ti(n.deviceId)||(r.$device_id=n.deviceId),(null!=e&&e.disableFlags||this._config.featureFlagsDisabled)&&(r.disable_flags=!0);var i=this._getValidEvaluationEnvironments();i.length&&(r.evaluation_contexts=i);var s=this._getValidFlagKeys();Ti(s)||(r.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={})[$l]=[hg],n)),t._logger.error("Feature flag request failed",e),t._fallBackToPersistedFlags()&&t._fireFeatureFlagsCallbacks(!0),c()):c()},h=this._config.requestMaxRetries,f=function(){if(l!==t._requestGeneration||!t._client||t._config.remoteRequestsDisabled)return t._requestInFlight=!1,void c();try{n.sendRequest(a,{target:"flags",method:"POST",body:r,compression:t._config.compression,sentAt:"body",timeoutMs:t._config.requestTimeoutMs}).then(function(e){if(function(e){return cg.includes(e.statusCode)||function(e){return 0===e.statusCode&&e.error instanceof Error&&"AbortError"===e.error.name}(e)}(e)&&h>0&&l===t._requestGeneration)return h--,void setTimeout(f,500);!function(e){var n,i,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),!r.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?hg:"unknown_error"):200!==e.statusCode&&d.push("api_error_"+e.statusCode),a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var h=!(null==(i=a.quotaLimited)||!i.includes("feature_flags"));h&&d.push("quota_limited"),t._set(((s={})[$l]=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."):r.disable_flags||t._receivedFeatureFlags(a,u,{partialResponse:o}),c()}}else c()}(e)}).catch(d)}catch(e){d(e)}};f()}},t._hasStatusZeroCircuitBreakerTripped=function(){return bc(this._consecutiveStatusZeroFailures,3)},t._trackStatusZeroReachability=function(e){var t=this;this._consecutiveStatusZeroFailures=wc(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 r=this.getFeatureFlagResult(e,t);return null!==(n=null==r?void 0:r.variant)&&void 0!==n?n:null==r?void 0:r.enabled}}else this._logger.warn('getFeatureFlag for key "'+e+lg)},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 r,i,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(Dl);_&&_!==v&&(f={},r=_)}if(t.send_event||!("send_event"in t))if(e in f&&f[e].includes(c))r&&this._set(((i={})[Ol]=f,i[Dl]=r,i));else{var g,m,y,b,w,S,x,k,C,P,E,F,I,T,R;Pi(f[e])?f[e].push(c):f[e]=[c],this._set(u(((g={})[Ol]=f,g),r?((m={})[Dl]=r,m):{}));var M=this.getFeatureFlagDetails(e),L=[].concat(null!==(y=this._prop("$feature_flag_errors"))&&void 0!==y?y:[]);Ti(a)&&L.push("flag_missing");var A={$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};Ti(null==M||null==(k=M.metadata)?void 0:k.has_experiment)||(A.$feature_flag_has_experiment=M.metadata.has_experiment),Ti(null==M||null==(C=M.metadata)?void 0:C.version)||(A.$feature_flag_version=M.metadata.version);var O=null!==(P=null==M||null==(E=M.reason)?void 0:E.description)&&void 0!==P?P:null==M||null==(F=M.reason)?void 0:F.code;O&&(A.$feature_flag_reason=O),null!=M&&null!=(I=M.metadata)&&I.id&&(A.$feature_flag_id=M.metadata.id),Ti(null==M?void 0:M.original_variant)&&Ti(null==M?void 0:M.original_enabled)||(A.$feature_flag_original_response=Ti(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(T=M.metadata)&&T.original_payload&&(A.$feature_flag_original_payload=null==M||null==(R=M.metadata)?void 0:R.original_payload),L.length&&(A.$feature_flag_error=L.join(",")),this._captureFeatureFlagCalled(A)}else r&&this._set(((n={})[Ol]=f,n[Dl]=r,n));if(o)return{key:e,enabled:!!a,variant:"string"==typeof a?a:void 0,payload:sa(l)}}}else this._logger.warn('getFeatureFlagResult for key "'+e+lg)},t._captureFeatureFlagCalled=function(e){try{var t;null==(t=this._client)||t.capture("$feature_flag_called",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=h(l().m(function e(t,n){var r,i,s,o,a,u,c,d,h,f;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=this._client){e.n=1;break}return e.a(2);case 1:return i={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},(s=this._getValidEvaluationEnvironments()).length&&(i.evaluation_contexts=s),o=this._getValidFlagKeys(),Ti(o)||(i.flag_keys=o),e.p=2,e.n=3,r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:i,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+lg),t.defaultValue;var n=this.getFeatureFlag(e,t);return Ti(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 r=function(e,t,n,r,i,s){var o,a,l;void 0===t&&(t={}),void 0===n&&(n={}),void 0===r&&(r={}),void 0===s&&(s=ag);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!Ti(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(Pi(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={})[ml]=h,v[gl]=g,v[xl]=!1,v}var y=h,b=f,w=d;if(null!=i&&i.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({},r,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({},r,Object.fromEntries(Object.entries(w||{}).filter(function(e){return k.has(e[0])})))}else y=u({},t,y),b=u({},n,b),w=u({},r,w);return u(((o={})[ml]=Object.keys(pg(y)),o[gl]=y||{},o[wl]=b||{},o[bl]=w||{},o[xl]=!0===e.minimalFlagCalledEvents,o),p?((a={})[Sl]=p,a):{},_?((l={})[ql]=_,l):{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this._logger);if(r)if(!1===(null==n?void 0:n.persist)){var i=!Ti(this._client.kv.get(gl));this._bootstrapState=r,i||this._set(r)}else this._clearBootstrapState(),this._markCrossTabFeatureFlagSnapshot(r,e,!(null==n||!n.partialResponse)),this._set(r);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([kl,Cl]),this._fireFeatureFlagsCallbacks(),void ug.info("All overrides cleared");var t,n;if(Pi(e))return this._set(((t={})[kl]=fg(e),t)),this._fireFeatureFlagsCallbacks(),void ug.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;this._override_warning=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r);var s={},o=i.flags,a=i.payloads;return o&&(s[kl]=Pi(o)?fg(o):o),a&&(s[Cl]=a),Object.keys(s).length&&this._set(s),!1===o&&!1===a?this._remove([kl,Cl]):!1===o?this._remove(kl):!1===a&&this._remove(Cl),this._fireFeatureFlagsCallbacks(),!1===o?ug.info("Flag overrides cleared"):o&&ug.info("Flag overrides set",{flags:o}),void(!1===a?ug.info("Payload overrides cleared"):a&&ug.info("Payload overrides set",{payloads:a}))}if(e&&"object"==typeof e)return this._set(((n={})[kl]=e,n)),this._fireFeatureFlagsCallbacks(),void ug.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(),r=n.flags,i=n.flagVariants;try{e(r,i)}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 r,i,s,o,a,l=(this._prop("$early_access_features")||[]).find(function(t){return t.flagKey===e}),c=((r={})["$feature_enrollment/"+e]=t,r),d={$feature_flag:e,$feature_enrollment:t,$set:c};l&&(d.$early_access_feature_name=l.name),n&&(d.$feature_enrollment_stage=n);var h=u({},this.getFlagVariants(),((i={})[e]=t,i));null==(s=this._instance)||null==(s=s.persistence)||s.markCrossTabFeatureFlagChanges(((o={})[ml]=[e],o[gl]=[e],o[Pl]=Object.keys(c),o)),this._set(((a={})[ml]=Object.keys(pg(h)),a[gl]=h,a[Pl]=u({},this._prop("$stored_person_properties")||{},c),a)),this._fireFeatureFlagsCallbacks();try{var f;null==(f=this._client)||f.capture("$feature_enrollment_update",d)}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 r=this._prop(yl);!r||t?this._getEarlyAccessFeatures(e,n):e(r)},t._getEarlyAccessFeatures=function(){var e=h(l().m(function e(t,n){var r,i,s,o,a;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=this._client){e.n=1;break}return e.a(2);case 1:return i=n?"&"+n.map(function(e){return"stage="+e}).join("&"):"",e.p=2,e.n=3,r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{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={})[yl]=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(),r=n.flags,i=n.flagVariants;this.featureFlagEventHandlers.forEach(function(n){try{n(r,i,{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 r=this._prop("$stored_person_properties")||{},i=(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 r||(o[a]=s[a]));this._set(((n={})[Pl]=u({},r,o,i),n)),t&&this.reloadFeatureFlags()},t.unsetPersonPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);var r=u({},this._prop("$stored_person_properties")||{});e.forEach(function(e){delete r[e]}),this._set(((n={})[Pl]=r,n)),t&&this.reloadFeatureFlags()},t.resetPersonPropertiesForFlags=function(e){void 0===e&&(e=!0),this._remove(Pl),e&&this.reloadFeatureFlags()},t.setGroupPropertiesForFlags=function(e,t){var n;void 0===t&&(t=!0);for(var r=this._prop("$stored_group_properties")||{},i=u({},r),s=0,o=Object.keys(e);o.length>s;s++){var a=o[s];i[a]=u({},r[a],e[a])}this._set(((n={})[El]=i,n)),t&&this.reloadFeatureFlags()},t.resetGroupPropertiesForFlags=function(e){if(e){var t,n,r=this._prop("$stored_group_properties")||{};this._set(((n={})[El]=u({},r,((t={})[e]={},t)),n))}else this._remove(El)},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}}])}(),vg="Refusing to render web experiment since the viewer is a likely bot",gg={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 Iu(t,e)},not_regex:function(e,t){return!Iu(t,e)},exact:function(e,t){return t===e},is_not:function(e,t){return t!==e}},mg=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 r;n._flagToExperiments&&(e._logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=n._flagToExperiments)||r.set(t.feature_flag_key,t));var i=n._instance.getFeatureFlag(t.feature_flag_key);Ri(i)&&t.variants[i]&&n._applyTransforms(t.name,i,t.variants[i].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(vg);else if(!this._config.disable_web_experiments){if(Ai(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 r,i=n._instance.getFeatureFlag(e),s=null==(r=n._flagToExperiments)?void 0:r.get(e);i&&null!=s&&s.variants[i]&&n._applyTransforms(s.name,i,s.variants[i].transforms)}})}},t.previewWebExperiment=function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var r=gc(null==n?void 0:n.search,"__experiment_id"),i=gc(null==n?void 0:n.search,"__experiment_variant");r&&i&&(e._logInfo("previewing web experiments "+r+" && "+i),this.getWebExperiments(function(e){t._showPreviewWebExperiment(parseInt(r),i,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 r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);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,r){var i=r.filter(function(e){return e.id===t});i&&i.length>0&&(e._logInfo("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this._applyTransforms(i[0].name,n,i[0].variants[n].transforms))},e._matchesTestVariant=function(t,n){return!Ai(t.conditions)&&e._matchUrlConditions(t,n)&&e._matchUTMConditions(t)},e._matchUrlConditions=function(t,n){var r;if(Ai(t.conditions)||Ai(null==(r=t.conditions)?void 0:r.url))return!0;var i=e.getWindowLocation();if(i){var s,o,a,u=xc(n,i.href);return null==(s=t.conditions)||!s.url||gg[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==Wa?void 0:Wa.location},e._matchUTMConditions=function(e){var t;if(Ai(e.conditions)||Ai(null==(t=e.conditions)?void 0:t.utm))return!0;var n=eh();if(n.utm_source){var r,i,s,o,a,u,l,c,d=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.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),r=1;t>r;r++)n[r-1]=arguments[r];iu.info("[WebExperiments] "+e,n)},t._applyTransforms=function(t,n,r){this._is_bot()?e._logInfo(vg):"control"!==n?r.forEach(function(r){var i;r.selector&&(e._logInfo("applying transform of variant "+n+" for experiment "+t+" ",r),null==(i=document)||null==(i=i.querySelectorAll(r.selector))||i.forEach(function(e){var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}):e._logInfo("Control variants leave the page unmodified.")},t._is_bot=function(){return Ka&&this._instance?A_(Ka,this._config.custom_blocked_useragents):void 0},o(e,[{key:"_config",get:function(){return this._instance.config}}])}(),yg=su("[Conversations]"),bg="Conversations not available yet.",wg=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;Ai(t)||($i(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||vu(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Eh?void 0:Eh.__PosthogExtensions__;if(t&&!Ti(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 r=t.loadExternalDependency;if(!r)return void this._handleLoadError(Yl);r(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 yg.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,yg.info("Conversations loaded successfully")}catch(e){this._handleLoadError("Error completing conversations initialization",e)}else yg.error("Cannot complete initialization: remote config is null")},t._handleLoadError=function(e,t){yg.error(e,t),this._conversationsManager=null,this._isInitializing=!1,this._loadFailed=!0},t.show=function(){this._conversationsManager?this._conversationsManager.show():yg.warn("Conversations not loaded yet.")},t.hide=function(){this._conversationsManager&&this._conversationsManager.hide()},t.isAvailable=function(){return!0===this._isConversationsEnabled&&!Li(this._conversationsManager)},t.getUnavailableReason=function(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":vu(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this._remoteConfigSuccessful?"remote_config_failed":Ti(this._isConversationsEnabled)?this._remoteConfigSuccessful?"disabled_in_project":"remote_config_pending":this._isConversationsEnabled?Ai(this._remoteConfig)||!this._remoteConfig.token?"missing_token":null!=Eh&&Eh.__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=h(l().m(function e(t,n,r){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),e.a(2,null);case 1:return e.a(2,this._conversationsManager.sendMessage(t,n,r))}},e,this)}));return function(t,n,r){return e.apply(this,arguments)}}(),t.getMessages=function(){var e=h(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 yg.warn(bg),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=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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=h(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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=h(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(this._conversationsManager){e.n=1;break}return yg.warn(bg),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 Sg(e,t){var n,r,i,s,o,a,l,c=null!==(n=null==e?void 0:e.flushIntervalMs)&&void 0!==n?n:3e3,d=null!==(r=null==e?void 0:e.maxBufferSize)&&void 0!==r?r:100,h=null!=t&&t.consoleCapture?void 0:null!==(i=null==e?void 0:e.maxLogsPerInterval)&&void 0!==i?i:1e3,f=Ti(h)?Math.max(d,2048):Math.max(d,h),p=u({},function(){var e="",t="";try{var n=null==Ka?void 0:Ka.userAgent;if(n){var r=Zs(n);e=r[0],t=r[1]}}catch(e){}return function(e,t){var n=function(e){if(e)return{}.hasOwnProperty.call(Ea,e)?Ea[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 xg=["debug","log","warn","error","info"],kg="console",Cg="__posthogHandledLogsRequestError",Pg=function(e,t){var n=e instanceof Error?e:new Error(t);return n[Cg]=!0,n},Eg=function(e){return!!e&&"object"==typeof e&&!0===e[Cg]},Fg=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=su("[logs]"),this._coreLogger=u({},this._logger,{error:function(){for(var e,t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];r.some(Eg)||(e=n._logger).error.apply(e,r)}}),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),Wa&&_u(Wa,"online",this._onReconnect)}var t=e.prototype;return t._buildCore=function(e,t,n,r){var i,s=this,o=Sg(null==(i=this._instance)||null==(i=i.config)?void 0:i.logs,n);return[new $a(this._createHost(e,t),o,this._coreLogger,function(){return s._getSdkContext()},function(e){return e()},void 0,r),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 r;null==(r=this._core)||r.reset(),this._resolvedFrom=n;var i=this._buildCore(function(){return t._queue},function(e){t._queue=e});this._core=i[0],this._resolvedConfig=i[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 r;null==(r=this._consoleCore)||r.reset(),this._consoleResolvedFrom=n;var i=this._buildCore(function(){return t._consoleQueue},function(e){t._consoleQueue=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},kg);this._consoleCore=i[0],this._consoleResolvedConfig=i[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 r=!1,i=e.onRemoteConfig(function(e){var t;r=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),n.onRemoteConfig(e)});this._disposed?i.dispose():(this._remoteConfigSubscription=i,r||this.loadIfEnabled())}},t.dispose=function(){var e,t,n,r;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==Wa||Wa.removeEventListener("online",this._onReconnect),null==(t=this._consoleLogsDispose)||t.call(this),this._consoleLogsDispose=void 0,null==(n=this._core)||n.reset(),null==(r=this._consoleCore)||r.reset())},t.onRemoteConfig=function(e){var t,n,r;if(!this._disposed){var i=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;Ai(i)?this._stopRecorderStartedByPersistedHint():(null==(n=this._instance)||null==(n=n.persistence)||n.register(((r={})[al]=!!i,r)),i?(this._isLogsEnabled=!0,this._isLoaded||this._startConsoleRecorder(),this.loadIfEnabled()):this._stopRecorderStartedByPersistedHint())}},t.reset=function(){var e,t,n,r;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==(r=this._consoleCore)||r.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[al])},t._remoteConfigWillArrive=function(){var e,t;return null==(e=this._instance)||null==e._shouldDisableFlags||!e._shouldDisableFlags()||!(null==(t=Eh._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!=Eh&&Eh.console){var n=Sg(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,r=!0;this._consoleRecorderUnpatchers.push(function(){r=!1});for(var i=function(){var e,i=o[s];try{e=function(e){for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e}(Eh.console[i])}catch(e){return 0}if(!e)return 0;t._consoleRecorderUnpatchers.push(Qh(Eh.console,i,function(s){var o=function(){for(var e=arguments.length,o=new Array(e),a=0;e>a;a++)o[a]=arguments[a];try{r&&t._recordConsoleEntry(i,o,n)}catch(e){}return s.apply(Eh.console,o)};return o.__rrweb_original__=e,o}))},s=0,o=xg;o.length>s;s++)i();this._isRecordingConsole=!0,this._consoleRecorderTimeout=setTimeout(function(){t._stopConsoleRecorder()},3e4)}},t._recordConsoleEntry=function(e,t,n){var r;if(this._isRecordingConsole&&!this._isRecordingConsoleEntry&&0!==t.length)if(null!=(r=this._instance)&&r.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=f(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){Eg(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==Eh?void 0:Eh.__PosthogExtensions__;if(!t)return this._logger.error("PostHog Extensions not found."),void this._stopConsoleRecorder();var n=t.loadExternalDependency;if(!n)return this._logger.error(Yl),void this._stopConsoleRecorder();this._isLoading=!0;try{n(this._instance,"logs",function(n){if(e._isLoading=!1,!e._disposed&&e._isLogsEnabled){var r=t.logs;if(n||null==r||!r.initializeLogs)e._logger.error("Could not load logs script",n),e._stopConsoleRecorder();else{var i,s,o=e._takeConsoleBuffer();e._consoleLogsDispose=r.initializeLogs(null!==(i=e._client)&&void 0!==i?i:e._instance),e._isLoaded=!0,o.length>0&&(null==r.replayConsoleBuffer||r.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,r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:function(t){return t===fi.LogsQueue?e():void 0},setPersistedProperty:function(e,n){e===fi.LogsQueue&&t(null!=n?n:[])},_sendLogsBatch:function(e){return n._sendLogsBatch(e)},getLibraryId:function(){return uf.LIB_NAME},getLibraryVersion:function(){return uf.LIB_VERSION}}},t._sendLogsBatch=function(e){var t=this;return new Promise(function(n){if(bc(t._consecutiveStatusZeroFailures,3))n({kind:"fatal",error:Pg(void 0,"logs endpoint is unreachable, dropping batch")});else{var r=!1,i=function(e){r||(r=!0,clearTimeout(s),n(e))},s=setTimeout(function(){t._logger.warn("Logs request timed out before receiving a response"),i({kind:"retry-later",error:Pg(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)i({kind:"ok"});else if(413===n)i({kind:"too-large"});else if(0!==n&&408!==n&&429!==n&&500>n)i({kind:"fatal",error:new Error("logs request failed with status "+n)});else{var r;0===n?(e.error||t._logger.warn("Logs request failed before receiving an HTTP response"),i({kind:"retry-later",error:Pg(e.error,"logs request failed before receiving an HTTP response")})):i({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+n)})}}})}})},t._trackEndpointReachability=function(e){var t=this;(0!==e||this._instance.__loaded)&&(this._consecutiveStatusZeroFailures=wc(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,uf.LIB_NAME,function(e){t._queue=e}),this._consoleQueue.length>0&&this._drainQueueViaTransport(e,this._consoleQueue,this._consoleResolvedConfig,kg,function(e){t._consoleQueue=e})},t._drainQueueViaTransport=function(e,t,n,r,i){if(0!==t.length){var s=t.map(function(e){return e.record});i([]);var o=La(s,Ma(n,uf.LIB_NAME,uf.LIB_VERSION),r,uf.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),r=n.windowId,i=n.sessionStartTimestamp,s=n.lastActivityTimestamp;t.sessionId=n.sessionId,t.windowId=r,Ai(i)||(t.sessionStartTimestamp=i),Ai(s)||(t.lastActivityTimestamp=s)}if(null!=Eh&&null!=(e=Eh.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?po(Eh.location.href):Eh.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}}])}(),Ig=su("[NetworkMetrics]"),Tg=function(){var e;return null!=Wa&&null!=(e=Wa.performance)&&e.now?Wa.performance.now():Date.now()},Rg={"http:":80,"https:":443},Mg=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),Lg=function(e,t){var n,r=String(t);return{method:String(e).toUpperCase(),url:(null==(n=vc(r))?void 0:n.href)||r}},Ag=function(e,t,n,r,i,s,o){void 0===o&&(o=!1);try{var a,l=i();if(!l)return;var c=n||void 0,d=Tg()-r,h=vc(t.url);if(h&&"http:"!==h.protocol&&"https:"!==h.protocol)return;var f={url:(null==h?void 0:h.href)||t.url,method:t.method},p=Ei(l.name)?l.name(f):Ri(l.name)?l.name:"http.client.request.duration";if(!p)return;var _=o&&!c?void 0:function(e,t){return e?400>e?void 0:String(e):(null==t?void 0:t.name)||"_OTHER"}(c,s),v=u({},u({"http.request.method":m=Mg.has(g=f.method)?g:"_OTHER"},"_OTHER"===m&&g!==m?{"http.request.method_original":g}:{}),h?function(e){return{"server.address":e.hostname.startsWith("[")&&e.hostname.endsWith("]")?e.hostname.slice(1,-1):e.hostname,"server.port":Number(e.port)||Rg[e.protocol],"url.scheme":e.protocol.slice(0,-1),"url.template":(t=e.pathname,t.split("/").map(function(e){return function(e){return/^\d+$/.test(e)||e.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(e)}(e)?":id":e}).join("/"))};var t}(h):{},c?{"http.response.status_code":c}:{},_?{"error.type":_}:{},null==l.attributes?void 0:l.attributes(f,{status:c,durationMs:d}));null==(a=e.metrics)||a.histogram(p,d,{unit:"ms",attributes:v})}catch(e){Ig.error("Failed to record network metric",e)}var g,m},Og=function(){},Dg=function(e){var t=!0,n=function(){return t?function(e){var t,n=null==(t=e.config.metrics)?void 0:t.network;return!0===n?{}:n||void 0}(e):void 0},r=function(e,t){return Ei(null==Wa?void 0:Wa.fetch)?Qh(Wa,"fetch",function(n){return function(){for(var r=Tg(),i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];var a=n.apply(this,s);if(!t())return a;try{var u,l,c,d=s[0],h=s[1],f=Lg(null!==(u=null!==(l=null==h?void 0:h.method)&&void 0!==l?l:null==d?void 0:d.method)&&void 0!==u?u:"GET",null!==(c=null==d?void 0:d.url)&&void 0!==c?c:d);return a.then(function(n){return Ag(e,f,null==n?void 0:n.status,r,t,void 0,!0),n},function(n){throw Ag(e,f,void 0,r,t,n),n})}catch(e){return Ig.error("Failed to observe fetch",e),a}}}):Og}(e,n),i=function(e,t){var n,r=null==Wa||null==(n=Wa.XMLHttpRequest)?void 0:n.prototype;if(!r)return Og;var i=new WeakMap,s=Qh(r,"open",function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];try{(function(e){return s_.has(e)})(this)||i.set(this,Lg(n[0],n[1]))}catch(e){Ig.error("Failed to observe XHR open",e)}return e.apply(this,n)}}),o=Qh(r,"send",function(n){return function(){var r,s=this;try{var o=i.get(this);if(o&&t()){var a=Tg();_u(this,"loadend",r=function(){s.removeEventListener("loadend",r),Ag(e,o,s.status,a,t)})}}catch(e){Ig.error("Failed to observe XHR send",e)}try{for(var u=arguments.length,l=new Array(u),c=0;u>c;c++)l[c]=arguments[c];return n.apply(this,l)}catch(e){throw r&&this.removeEventListener("loadend",r),e}}});return function(){s(),o()}}(e,n);return function(){t=!1,r(),i()}},$g=function(){"use strict";function e(e){this._instance=e,this._logger=su("[metrics]"),this._disposed=!1}var t=e.prototype;return t.initialize=function(){this.onConfigChange()},t.onConfigChange=function(){var e;if(!this._disposed){var t=!(null==(e=this._instance.config.metrics)||!e.network);t&&!this._stopNetworkMetrics?this._stopNetworkMetrics=Dg(this._instance):!t&&this._stopNetworkMetrics&&(this._stopNetworkMetrics(),this._stopNetworkMetrics=void 0)}},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 Ha(this._createHost(),function(e){var t,n,r,i,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!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==e?void 0:e.environment,resourceAttributes:o,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(i=null==e?void 0:e.flushIntervalMs)&&void 0!==i?i: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.dispose=function(){var e,t;this._disposed=!0,null==(e=this._stopNetworkMetrics)||e.call(this),this._stopNetworkMetrics=void 0,null==(t=this._core)||t.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 uf.LIB_NAME},getLibraryVersion:function(){return uf.LIB_VERSION}}},t._sendMetricsBatch=function(e,t){var n=this;return new Promise(function(r){var i=!1,s=function(e){i||(i=!0,clearTimeout(o),r(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}(),qg={featureFlags:_g},Bg={sessionRecording:Ov},Ng={autocapture:bv,historyAutocapture:xv,heatmaps:qv,deadClicksAutocapture:Jf,webVitalsAutocapture:Rv},Hg={exceptionObserver:Sv,exceptions:Oh},jg=u({productTours:Hv},qg),Ug={siteApps:zv},zg={tracingHeaders:Cv},Vg=u({surveys:eg},qg),Wg={toolbar:ig},Gg=u({experiments:mg},qg),Kg=u({},qg,Bg,Ng,Hg,jg,Ug,Vg,zg,Wg,Gg,{conversations:wg},{logs:Fg},{metrics:$g});if(dv.__defaultExtensionClasses=u({},Kg),function(){uf.SDK_DIST_CHANNEL="cdn";var e=Eh.posthog;if(!e||Pi(e._i)||!Ei(e.init)){var t=K_[sv]=new dv;if(e){var n=[];au(e._i,function(r){if(r&&Pi(r)){var i=t.init(r[0],r[1],r[2]),s=e[r[2]]||e;i.__loaded&&-1===n.indexOf(s)&&(n.push(s),i._execute_array.call(i.people,s.people),i._execute_array(s))}})}t.__SV=1,Eh.posthog=t,function(){function e(){e.done||(e.done=!0,x_=!1,au(K_,function(e){e._dom_loaded()}))}null!=Qa&&Qa.addEventListener?"complete"===Qa.readyState?e():_u(Qa,"DOMContentLoaded",e,{capture:!1}):Wa&&iu.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}(),"undefined"==typeof performance||"function"!=typeof performance.now){var Qg="undefined"!=typeof performance?performance:{};Qg.now=Qg.now||function(){return Date.now()},"undefined"==typeof performance&&(window.performance=Qg)}}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.es5.js.map
|