posthog-js 1.235.0 → 1.235.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +1 -0
- package/dist/module.full.d.ts +1 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +1 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +1 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/src/extensions/replay/sessionrecording.d.ts +2 -1
- package/dist/surveys-preview.d.ts +1 -0
- package/lib/package.json +1 -1
- package/lib/src/extensions/replay/sessionrecording.d.ts +2 -1
- package/lib/src/extensions/replay/sessionrecording.js +19 -0
- package/lib/src/extensions/replay/sessionrecording.js.map +1 -1
- package/lib/src/posthog-core.js +1 -3
- package/lib/src/posthog-core.js.map +1 -1
- package/package.json +1 -1
package/dist/array.full.es5.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var e,t,n,i,r,o,s,a,u,l,c,d,f,v,h,p,g,_,m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(){return t?e:(t=1,e=function(e){try{return!!e()}catch(e){return!0}})}function b(){if(i)return n;i=1;var e=y();return n=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function k(){if(o)return r;o=1;var e=b(),t=Function.prototype,n=t.call,i=e&&t.bind.bind(n,n);return r=e?i:function(e){return function(){return n.apply(e,arguments)}},r}function w(){if(a)return s;a=1;var e=k(),t=e({}.toString),n=e("".slice);return s=function(e){return n(t(e),8,-1)}}function S(){return d?c:(d=1,c=function(e){return null==e})}function x(){if(v)return f;v=1;var e=S(),t=TypeError;return f=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function E(){if(p)return h;p=1;var e=function(){if(l)return u;l=1;var e=k(),t=y(),n=w(),i=Object,r=e("".split);return u=t((function(){return!i("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?r(e,""):i(e)}:i}(),t=x();return h=function(n){return e(t(n))}}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(){T=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var r=t&&t.prototype instanceof d?t:d,o=Object.create(r.prototype),s=new S(i||[]);return o._invoke=function(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return E()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=b(s,n);if(a){if(a===c)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=l(e,t,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(e,n,s),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function d(){}function f(){}function v(){}var h={};a(h,r,(function(){return this}));var p=Object.getPrototypeOf,g=p&&p(p(x([])));g&&g!==t&&n.call(g,r)&&(h=g);var _=v.prototype=d.prototype=Object.create(h);function m(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function i(r,o,s,a){var u=l(e[r],e,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,s,a)}),(function(e){i("throw",e,s,a)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,a)}))}a(u.arg)}var r;this._invoke=function(e,n){function o(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,c;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=v,a(_,"constructor",v),a(v,"constructor",f),f.displayName=a(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,a(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},m(y.prototype),a(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new y(u(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},m(_),a(_,s,"Generator"),a(_,r,(function(){return this})),a(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=x,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;w(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function F(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function L(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);s=!0);}catch(e){a=!0,r=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw r}}return o}(e,t)||D(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e){return function(e){if(Array.isArray(e))return N(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||D(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.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)?N(e,t):void 0}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=D(e))||t){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function j(){if(_)return g;_=1;var e=function(e){return e&&e.Math===Math&&e};return g=e("object"==("undefined"==typeof globalThis?"undefined":I(globalThis))&&globalThis)||e("object"==("undefined"==typeof window?"undefined":I(window))&&window)||e("object"==("undefined"==typeof self?"undefined":I(self))&&self)||e("object"==I(m)&&m)||e("object"==I(g)&&g)||function(){return this}()||Function("return this")()}var B,U,z,V,W,G,Z,Q,Y,J,X,K,ee,te,ne,ie,re,oe,se,ae,ue,le,ce,de,fe,ve,he,pe,ge,_e={exports:{}};function me(){return U?B:(U=1,B=!1)}function ye(){if(V)return z;V=1;var e=j(),t=Object.defineProperty;return z=function(n,i){try{t(e,n,{value:i,configurable:!0,writable:!0})}catch(t){e[n]=i}return i}}function be(){if(W)return _e.exports;W=1;var e=me(),t=j(),n=ye(),i="__core-js_shared__",r=_e.exports=t[i]||n(i,{});return(r.versions||(r.versions=[])).push({version:"3.38.1",mode:e?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"}),_e.exports}function ke(){if(Z)return G;Z=1;var e=be();return G=function(t,n){return e[t]||(e[t]=n||{})}}function we(){if(Y)return Q;Y=1;var e=x(),t=Object;return Q=function(n){return t(e(n))}}function Se(){if(X)return J;X=1;var e=k(),t=we(),n=e({}.hasOwnProperty);return J=Object.hasOwn||function(e,i){return n(t(e),i)}}function xe(){if(ee)return K;ee=1;var e=k(),t=0,n=Math.random(),i=e(1..toString);return K=function(e){return"Symbol("+(void 0===e?"":e)+")_"+i(++t+n,36)}}function Ee(){if(re)return ie;re=1;var e,t,n=j(),i=function(){if(ne)return te;ne=1;var e=j().navigator,t=e&&e.userAgent;return te=t?String(t):""}(),r=n.process,o=n.Deno,s=r&&r.versions||o&&o.version,a=s&&s.v8;return a&&(t=(e=a.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&i&&(!(e=i.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=i.match(/Chrome\/(\d+)/))&&(t=+e[1]),ie=t}function Ce(){if(se)return oe;se=1;var e=Ee(),t=y(),n=j().String;return oe=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))}function Pe(){if(ue)return ae;ue=1;var e=Ce();return ae=e&&!Symbol.sham&&"symbol"==I(Symbol.iterator)}function Te(){if(ce)return le;ce=1;var e=j(),t=ke(),n=Se(),i=xe(),r=Ce(),o=Pe(),s=e.Symbol,a=t("wks"),u=o?s.for||s:s&&s.withoutSetter||i;return le=function(e){return n(a,e)||(a[e]=r&&n(s,e)?s[e]:u("Symbol."+e)),a[e]},le}function Ie(){if(fe)return de;fe=1;var e="object"==("undefined"==typeof document?"undefined":I(document))&&document.all;return de=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function Fe(){if(he)return ve;he=1;var e=Ie();return ve=function(t){return"object"==I(t)?null!==t:e(t)}}function Re(){if(ge)return pe;ge=1;var e=Fe(),t=String,n=TypeError;return pe=function(i){if(e(i))return i;throw new n(t(i)+" is not an object")}}var Oe,Le,Me,Ae,qe={};function $e(){if(Le)return Oe;Le=1;var e=y();return Oe=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function De(){if(Ae)return Me;Ae=1;var e=$e(),t=y();return Me=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}var Ne,He,je,Be,Ue,ze,Ve,We,Ge,Ze,Qe,Ye,Je,Xe,Ke,et,tt,nt,it,rt,ot,st,at,ut,lt,ct,dt,ft,vt,ht,pt,gt,_t,mt,yt,bt,kt,wt,St,xt,Et,Ct,Pt,Tt,It,Ft,Rt,Ot,Lt,Mt,At,qt,$t,Dt,Nt,Ht,jt,Bt,Ut,zt,Vt,Wt,Gt,Zt,Qt={};function Yt(){if(He)return Ne;He=1;var e=j(),t=Fe(),n=e.document,i=t(n)&&t(n.createElement);return Ne=function(e){return i?n.createElement(e):{}}}function Jt(){if(Be)return je;Be=1;var e=$e(),t=y(),n=Yt();return je=!e&&!t((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function Xt(){if(ze)return Ue;ze=1;var e=b(),t=Function.prototype.call;return Ue=e?t.bind(t):function(){return t.apply(t,arguments)},Ue}function Kt(){if(We)return Ve;We=1;var e=j(),t=Ie();return Ve=function(n,i){return arguments.length<2?(r=e[n],t(r)?r:void 0):e[n]&&e[n][i];var r},Ve}function en(){if(Ze)return Ge;Ze=1;var e=k();return Ge=e({}.isPrototypeOf)}function tn(){if(Ye)return Qe;Ye=1;var e=Kt(),t=Ie(),n=en(),i=Pe(),r=Object;return Qe=i?function(e){return"symbol"==I(e)}:function(i){var o=e("Symbol");return t(o)&&n(o.prototype,r(i))}}function nn(){if(Xe)return Je;Xe=1;var e=String;return Je=function(t){try{return e(t)}catch(e){return"Object"}}}function rn(){if(et)return Ke;et=1;var e=Ie(),t=nn(),n=TypeError;return Ke=function(i){if(e(i))return i;throw new n(t(i)+" is not a function")}}function on(){if(nt)return tt;nt=1;var e=rn(),t=S();return tt=function(n,i){var r=n[i];return t(r)?void 0:e(r)},tt}function sn(){if(rt)return it;rt=1;var e=Xt(),t=Ie(),n=Fe(),i=TypeError;return it=function(r,o){var s,a;if("string"===o&&t(s=r.toString)&&!n(a=e(s,r)))return a;if(t(s=r.valueOf)&&!n(a=e(s,r)))return a;if("string"!==o&&t(s=r.toString)&&!n(a=e(s,r)))return a;throw new i("Can't convert object to primitive value")}}function an(){if(st)return ot;st=1;var e=Xt(),t=Fe(),n=tn(),i=on(),r=sn(),o=Te(),s=TypeError,a=o("toPrimitive");return ot=function(o,u){if(!t(o)||n(o))return o;var l,c=i(o,a);if(c){if(void 0===u&&(u="default"),l=e(c,o,u),!t(l)||n(l))return l;throw new s("Can't convert object to primitive value")}return void 0===u&&(u="number"),r(o,u)}}function un(){if(ut)return at;ut=1;var e=an(),t=tn();return at=function(n){var i=e(n,"string");return t(i)?i:i+""}}function ln(){if(lt)return Qt;lt=1;var e=$e(),t=Jt(),n=De(),i=Re(),r=un(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Qt.f=e?n?function(e,t,n){if(i(e),t=r(t),i(n),"function"==typeof e&&"prototype"===t&&"value"in n&&c in n&&!n[c]){var o=a(e,t);o&&o[c]&&(e[t]=n.value,n={configurable:l in n?n[l]:o[l],enumerable:u in n?n[u]:o[u],writable:!1})}return s(e,t,n)}:s:function(e,n,a){if(i(e),n=r(n),i(a),t)try{return s(e,n,a)}catch(e){}if("get"in a||"set"in a)throw new o("Accessors not supported");return"value"in a&&(e[n]=a.value),e},Qt}function cn(){if(vt)return ft;vt=1;var e=function(){if(dt)return ct;dt=1;var e=Math.ceil,t=Math.floor;return ct=Math.trunc||function(n){var i=+n;return(i>0?t:e)(i)},ct}();return ft=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function dn(){if(pt)return ht;pt=1;var e=cn(),t=Math.max,n=Math.min;return ht=function(i,r){var o=e(i);return o<0?t(o+r,0):n(o,r)}}function fn(){if(_t)return gt;_t=1;var e=cn(),t=Math.min;return gt=function(n){var i=e(n);return i>0?t(i,9007199254740991):0}}function vn(){if(yt)return mt;yt=1;var e=fn();return mt=function(t){return e(t.length)}}function hn(){return St?wt:(St=1,wt={})}function pn(){if(Et)return xt;Et=1;var e=k(),t=Se(),n=E(),i=function(){if(kt)return bt;kt=1;var e=E(),t=dn(),n=vn(),i=function(i){return function(r,o,s){var a=e(r),u=n(a);if(0===u)return!i&&-1;var l,c=t(s,u);if(i&&o!=o){for(;u>c;)if((l=a[c++])!=l)return!0}else for(;u>c;c++)if((i||c in a)&&a[c]===o)return i||c||0;return!i&&-1}};return bt={includes:i(!0),indexOf:i(!1)}}().indexOf,r=hn(),o=e([].push);return xt=function(e,s){var a,u=n(e),l=0,c=[];for(a in u)!t(r,a)&&t(u,a)&&o(c,a);for(;s.length>l;)t(u,a=s[l++])&&(~i(c,a)||o(c,a));return c},xt}function gn(){return Pt?Ct:(Pt=1,Ct=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function _n(){if(It)return Tt;It=1;var e=pn(),t=gn();return Tt=Object.keys||function(n){return e(n,t)},Tt}function mn(){if(Ot)return Rt;Ot=1;var e=Kt();return Rt=e("document","documentElement")}function yn(){if(Mt)return Lt;Mt=1;var e=ke(),t=xe(),n=e("keys");return Lt=function(e){return n[e]||(n[e]=t(e))}}function bn(){if(qt)return At;qt=1;var e,t=Re(),n=function(){if(Ft)return qe;Ft=1;var e=$e(),t=De(),n=ln(),i=Re(),r=E(),o=_n();return qe.f=e&&!t?Object.defineProperties:function(e,t){i(e);for(var s,a=r(t),u=o(t),l=u.length,c=0;l>c;)n.f(e,s=u[c++],a[s]);return e},qe}(),i=gn(),r=hn(),o=mn(),s=Yt(),a=yn(),u="prototype",l="script",c=a("IE_PROTO"),d=function(){},f=function(e){return"<"+l+">"+e+"</"+l+">"},v=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,r;h="undefined"!=typeof document?document.domain&&e?v(e):(n=s("iframe"),r="java"+l+":",n.style.display="none",o.appendChild(n),n.src=String(r),(t=n.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F):v(e);for(var a=i.length;a--;)delete h[u][i[a]];return h()};return r[c]=!0,At=Object.create||function(e,i){var r;return null!==e?(d[u]=t(e),r=new d,d[u]=null,r[c]=e):r=h(),void 0===i?r:n.f(r,i)},At}function kn(){if(Dt)return $t;Dt=1;var e=Te(),t=bn(),n=ln().f,i=e("unscopables"),r=Array.prototype;return void 0===r[i]&&n(r,i,{configurable:!0,value:t(null)}),$t=function(e){r[i][e]=!0}}function wn(){return Ht?Nt:(Ht=1,Nt={})}function Sn(){return zt?Ut:(zt=1,Ut=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function xn(){if(Wt)return Vt;Wt=1;var e=$e(),t=ln(),n=Sn();return Vt=e?function(e,i,r){return t.f(e,i,n(1,r))}:function(e,t,n){return e[t]=n,e}}function En(){if(Zt)return Gt;Zt=1;var e,t,n,i=function(){if(Bt)return jt;Bt=1;var e=j(),t=Ie(),n=e.WeakMap;return jt=t(n)&&/native code/.test(String(n))}(),r=j(),o=Fe(),s=xn(),a=Se(),u=be(),l=yn(),c=hn(),d="Object already initialized",f=r.TypeError,v=r.WeakMap;if(i||u.state){var h=u.state||(u.state=new v);h.get=h.get,h.has=h.has,h.set=h.set,e=function(e,t){if(h.has(e))throw new f(d);return t.facade=e,h.set(e,t),t},t=function(e){return h.get(e)||{}},n=function(e){return h.has(e)}}else{var p=l("state");c[p]=!0,e=function(e,t){if(a(e,p))throw new f(d);return t.facade=e,s(e,p,t),t},t=function(e){return a(e,p)?e[p]:{}},n=function(e){return a(e,p)}}return Gt={set:e,get:t,has:n,enforce:function(i){return n(i)?t(i):e(i,{})},getterFor:function(e){return function(n){var i;if(!o(n)||(i=t(n)).type!==e)throw new f("Incompatible receiver, "+e+" required");return i}}}}var Cn,Pn,Tn={},In={};function Fn(){if(Pn)return Tn;Pn=1;var e=$e(),t=Xt(),n=function(){if(Cn)return In;Cn=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return In.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,In}(),i=Sn(),r=E(),o=un(),s=Se(),a=Jt(),u=Object.getOwnPropertyDescriptor;return Tn.f=e?u:function(e,l){if(e=r(e),l=o(l),a)try{return u(e,l)}catch(e){}if(s(e,l))return i(!t(n.f,e,l),e[l])},Tn}var Rn,On,Ln,Mn,An,qn,$n,Dn={exports:{}};function Nn(){if(On)return Rn;On=1;var e=$e(),t=Se(),n=Function.prototype,i=e&&Object.getOwnPropertyDescriptor,r=t(n,"name"),o=r&&"something"===function(){}.name,s=r&&(!e||e&&i(n,"name").configurable);return Rn={EXISTS:r,PROPER:o,CONFIGURABLE:s}}function Hn(){if(Mn)return Ln;Mn=1;var e=k(),t=Ie(),n=be(),i=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return i(e)}),Ln=n.inspectSource}function jn(){if(An)return Dn.exports;An=1;var e=k(),t=y(),n=Ie(),i=Se(),r=$e(),o=Nn().CONFIGURABLE,s=Hn(),a=En(),u=a.enforce,l=a.get,c=String,d=Object.defineProperty,f=e("".slice),v=e("".replace),h=e([].join),p=r&&!t((function(){return 8!==d((function(){}),"length",{value:8}).length})),g=String(String).split("String"),_=Dn.exports=function(e,t,n){"Symbol("===f(c(t),0,7)&&(t="["+v(c(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!i(e,"name")||o&&e.name!==t)&&(r?d(e,"name",{value:t,configurable:!0}):e.name=t),p&&n&&i(n,"arity")&&e.length!==n.arity&&d(e,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?r&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=u(e);return i(s,"source")||(s.source=h(g,"string"==typeof t?t:"")),e};return Function.prototype.toString=_((function(){return n(this)&&l(this).source||s(this)}),"toString"),Dn.exports}function Bn(){if($n)return qn;$n=1;var e=Ie(),t=ln(),n=jn(),i=ye();return qn=function(r,o,s,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:o;if(e(s)&&n(s,l,a),a.global)u?r[o]=s:i(o,s);else{try{a.unsafe?r[o]&&(u=!0):delete r[o]}catch(e){}u?r[o]=s:t.f(r,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return r},qn}var Un,zn={};var Vn,Wn,Gn,Zn,Qn,Yn,Jn,Xn,Kn,ei,ti,ni,ii,ri,oi,si,ai,ui,li,ci,di,fi,vi,hi,pi,gi,_i,mi,yi,bi,ki,wi,Si,xi={};function Ei(){if(Gn)return Wn;Gn=1;var e=Kt(),t=k(),n=function(){if(Un)return zn;Un=1;var e=pn(),t=gn().concat("length","prototype");return zn.f=Object.getOwnPropertyNames||function(n){return e(n,t)},zn}(),i=(Vn||(Vn=1,xi.f=Object.getOwnPropertySymbols),xi),r=Re(),o=t([].concat);return Wn=e("Reflect","ownKeys")||function(e){var t=n.f(r(e)),s=i.f;return s?o(t,s(e)):t}}function Ci(){if(Qn)return Zn;Qn=1;var e=Se(),t=Ei(),n=Fn(),i=ln();return Zn=function(r,o,s){for(var a=t(o),u=i.f,l=n.f,c=0;c<a.length;c++){var d=a[c];e(r,d)||s&&e(s,d)||u(r,d,l(o,d))}},Zn}function Pi(){if(Kn)return Xn;Kn=1;var e=j(),t=Fn().f,n=xn(),i=Bn(),r=ye(),o=Ci(),s=function(){if(Jn)return Yn;Jn=1;var e=y(),t=Ie(),n=/#|\.prototype\./,i=function(n,i){var u=o[r(n)];return u===a||u!==s&&(t(i)?e(i):!!i)},r=i.normalize=function(e){return String(e).replace(n,".").toLowerCase()},o=i.data={},s=i.NATIVE="N",a=i.POLYFILL="P";return Yn=i}();return Xn=function(a,u){var l,c,d,f,v,h=a.target,p=a.global,g=a.stat;if(l=p?e:g?e[h]||r(h,{}):e[h]&&e[h].prototype)for(c in u){if(f=u[c],d=a.dontCallGetSet?(v=t(l,c))&&v.value:l[c],!s(p?c:h+(g?".":"#")+c,a.forced)&&void 0!==d){if(I(f)==I(d))continue;o(f,d)}(a.sham||d&&d.sham)&&n(f,"sham",!0),i(l,c,f,a)}}}function Ti(){if(ii)return ni;ii=1;var e=Se(),t=Ie(),n=we(),i=yn(),r=function(){if(ti)return ei;ti=1;var e=y();return ei=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ei}(),o=i("IE_PROTO"),s=Object,a=s.prototype;return ni=r?s.getPrototypeOf:function(i){var r=n(i);if(e(r,o))return r[o];var u=r.constructor;return t(u)&&r instanceof u?u.prototype:r instanceof s?a:null},ni}function Ii(){if(oi)return ri;oi=1;var e,t,n,i=y(),r=Ie(),o=Fe(),s=bn(),a=Ti(),u=Bn(),l=Te(),c=me(),d=l("iterator"),f=!1;return[].keys&&("next"in(n=[].keys())?(t=a(a(n)))!==Object.prototype&&(e=t):f=!0),!o(e)||i((function(){var t={};return e[d].call(t)!==t}))?e={}:c&&(e=s(e)),r(e[d])||u(e,d,(function(){return this})),ri={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:f}}function Fi(){if(ai)return si;ai=1;var e=ln().f,t=Se(),n=Te()("toStringTag");return si=function(i,r,o){i&&!o&&(i=i.prototype),i&&!t(i,n)&&e(i,n,{configurable:!0,value:r})}}function Ri(){if(vi)return fi;vi=1;var e=Fe();return fi=function(t){return e(t)||null===t}}function Oi(){if(pi)return hi;pi=1;var e=Ri(),t=String,n=TypeError;return hi=function(i){if(e(i))return i;throw new n("Can't set "+t(i)+" as a prototype")}}function Li(){if(_i)return gi;_i=1;var e=function(){if(di)return ci;di=1;var e=k(),t=rn();return ci=function(n,i,r){try{return e(t(Object.getOwnPropertyDescriptor(n,i)[r]))}catch(e){}}}(),t=Fe(),n=x(),i=Oi();return gi=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,s={};try{(r=e(Object.prototype,"__proto__","set"))(s,[]),o=s instanceof Array}catch(e){}return function(e,s){return n(e),i(s),t(e)?(o?r(e,s):e.__proto__=s,e):e}}():void 0),gi}function Mi(){if(yi)return mi;yi=1;var e=Pi(),t=Xt(),n=me(),i=Nn(),r=Ie(),o=function(){if(li)return ui;li=1;var e=Ii().IteratorPrototype,t=bn(),n=Sn(),i=Fi(),r=wn(),o=function(){return this};return ui=function(s,a,u,l){var c=a+" Iterator";return s.prototype=t(e,{next:n(+!l,u)}),i(s,c,!1,!0),r[c]=o,s},ui}(),s=Ti(),a=Li(),u=Fi(),l=xn(),c=Bn(),d=Te(),f=wn(),v=Ii(),h=i.PROPER,p=i.CONFIGURABLE,g=v.IteratorPrototype,_=v.BUGGY_SAFARI_ITERATORS,m=d("iterator"),y="keys",b="values",k="entries",w=function(){return this};return mi=function(i,d,v,S,x,E,C){o(v,d,S);var P,T,I,F=function(e){if(e===x&&A)return A;if(!_&&e&&e in L)return L[e];switch(e){case y:case b:case k:return function(){return new v(this,e)}}return function(){return new v(this)}},R=d+" Iterator",O=!1,L=i.prototype,M=L[m]||L["@@iterator"]||x&&L[x],A=!_&&M||F(x),q="Array"===d&&L.entries||M;if(q&&(P=s(q.call(new i)))!==Object.prototype&&P.next&&(n||s(P)===g||(a?a(P,g):r(P[m])||c(P,m,w)),u(P,R,!0,!0),n&&(f[R]=w)),h&&x===b&&M&&M.name!==b&&(!n&&p?l(L,"name",b):(O=!0,A=function(){return t(M,this)})),x)if(T={values:F(b),keys:E?A:F(y),entries:F(k)},C)for(I in T)(_||O||!(I in L))&&c(L,I,T[I]);else e({target:d,proto:!0,forced:_||O},T);return n&&!C||L[m]===A||c(L,m,A,{name:x}),f[d]=A,T},mi}function Ai(){return ki?bi:(ki=1,bi=function(e,t){return{value:e,done:t}})}function qi(){if(Si)return wi;Si=1;var e=E(),t=kn(),n=wn(),i=En(),r=ln().f,o=Mi(),s=Ai(),a=me(),u=$e(),l="Array Iterator",c=i.set,d=i.getterFor(l);wi=o(Array,"Array",(function(t,n){c(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var e=d(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,s(void 0,!0);switch(e.kind){case"keys":return s(n,!1);case"values":return s(t[n],!1)}return s([n,t[n]],!1)}),"values");var f=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!a&&u&&"values"!==f.name)try{r(f,"name",{value:"values"})}catch(e){}return wi}var $i,Di,Ni,Hi,ji,Bi,Ui,zi,Vi,Wi,Gi,Zi,Qi,Yi,Ji,Xi,Ki,er,tr,nr,ir,rr,or,sr,ar,ur={};function lr(){if(Hi)return Ni;Hi=1;var e=function(){if(Di)return $i;Di=1;var e=w(),t=k();return $i=function(n){if("Function"===e(n))return t(n)}}(),t=rn(),n=b(),i=e(e.bind);return Ni=function(e,r){return t(e),void 0===r?e:n?i(e,r):function(){return e.apply(r,arguments)}},Ni}function cr(){if(Bi)return ji;Bi=1;var e=Te(),t=wn(),n=e("iterator"),i=Array.prototype;return ji=function(e){return void 0!==e&&(t.Array===e||i[n]===e)}}function dr(){if(Wi)return Vi;Wi=1;var e=function(){if(zi)return Ui;zi=1;var e={};return e[Te()("toStringTag")]="z",Ui="[object z]"===String(e)}(),t=Ie(),n=w(),i=Te()("toStringTag"),r=Object,o="Arguments"===n(function(){return arguments}());return Vi=e?n:function(e){var s,a,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(a=function(e,t){try{return e[t]}catch(e){}}(s=r(e),i))?a:o?n(s):"Object"===(u=n(s))&&t(s.callee)?"Arguments":u},Vi}function fr(){if(Zi)return Gi;Zi=1;var e=dr(),t=on(),n=S(),i=wn(),r=Te()("iterator");return Gi=function(o){if(!n(o))return t(o,r)||t(o,"@@iterator")||i[e(o)]}}function vr(){if(Yi)return Qi;Yi=1;var e=Xt(),t=rn(),n=Re(),i=nn(),r=fr(),o=TypeError;return Qi=function(s,a){var u=arguments.length<2?r(s):a;if(t(u))return n(e(u,s));throw new o(i(s)+" is not iterable")},Qi}function hr(){if(Xi)return Ji;Xi=1;var e=Xt(),t=Re(),n=on();return Ji=function(i,r,o){var s,a;t(i);try{if(!(s=n(i,"return"))){if("throw"===r)throw o;return o}s=e(s,i)}catch(e){a=!0,s=e}if("throw"===r)throw o;if(a)throw s;return t(s),o}}function pr(){if(er)return Ki;er=1;var e=lr(),t=Xt(),n=Re(),i=nn(),r=cr(),o=vn(),s=en(),a=vr(),u=fr(),l=hr(),c=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return Ki=function(v,h,p){var g,_,m,y,b,k,w,S=p&&p.that,x=!(!p||!p.AS_ENTRIES),E=!(!p||!p.IS_RECORD),C=!(!p||!p.IS_ITERATOR),P=!(!p||!p.INTERRUPTED),T=e(h,S),F=function(e){return g&&l(g,"normal",e),new d(!0,e)},R=function(e){return x?(n(e),P?T(e[0],e[1],F):T(e[0],e[1])):P?T(e,F):T(e)};if(E)g=v.iterator;else if(C)g=v;else{if(!(_=u(v)))throw new c(i(v)+" is not iterable");if(r(_)){for(m=0,y=o(v);y>m;m++)if((b=R(v[m]))&&s(f,b))return b;return new d(!1)}g=a(v,_)}for(k=E?v.next:g.next;!(w=t(k,g)).done;){try{b=R(w.value)}catch(e){l(g,"throw",e)}if("object"==I(b)&&b&&s(f,b))return b}return new d(!1)}}function gr(){if(nr)return tr;nr=1;var e=$e(),t=ln(),n=Sn();return tr=function(i,r,o){e?t.f(i,r,n(0,o)):i[r]=o}}function _r(){if(or)return rr;or=1;var e=j();return rr=e}function mr(){if(ar)return sr;ar=1,qi(),function(){if(ir)return ur;ir=1;var e=Pi(),t=pr(),n=gr();e({target:"Object",stat:!0},{fromEntries:function(e){var i={};return t(e,(function(e,t){n(i,e,t)}),{AS_ENTRIES:!0}),i}})}();var e=_r();return sr=e.Object.fromEntries}var yr,br,kr,wr,Sr,xr,Er,Cr,Pr,Tr,Ir,Fr,Rr={};function Or(){if(Sr)return Rr;Sr=1;var e=j(),t=br?yr:(br=1,yr={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}),n=function(){if(wr)return kr;wr=1;var e=Yt()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return kr=t===Object.prototype?void 0:t}(),i=qi(),r=xn(),o=Fi(),s=Te()("iterator"),a=i.values,u=function(e,n){if(e){if(e[s]!==a)try{r(e,s,a)}catch(t){e[s]=a}if(o(e,n,!0),t[n])for(var u in i)if(e[u]!==i[u])try{r(e,u,i[u])}catch(t){e[u]=i[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);return u(n,"DOMTokenList"),Rr}function Lr(){if(Pr)return Cr;Pr=1;var e=function(){if(Er)return xr;Er=1;var e=mr();return Or(),xr=e}();return Cr=e}Fr||(Fr=1,function(){if(Ir)return Tr;Ir=1;var e=Lr();Tr=e}());var Mr,Ar,qr,$r,Dr,Nr,Hr,jr,Br,Ur,zr,Vr,Wr,Gr="$people_distinct_id",Zr="__alias",Qr="__timers",Yr="$autocapture_disabled_server_side",Jr="$heatmaps_enabled_server_side",Xr="$exception_capture_enabled_server_side",Kr="$web_vitals_enabled_server_side",eo="$dead_clicks_enabled_server_side",to="$web_vitals_allowed_metrics",no="$session_recording_enabled_server_side",io="$console_log_recording_enabled_server_side",ro="$session_recording_network_payload_capture",oo="$session_recording_masking",so="$session_recording_canvas_recording",ao="$replay_sample_rate",uo="$replay_minimum_duration",lo="$replay_script_config",co="$sesid",fo="$session_is_sampled",vo="$session_recording_url_trigger_activated_session",ho="$session_recording_event_trigger_activated_session",po="$enabled_feature_flags",go="$early_access_features",_o="$feature_flag_details",mo="$stored_person_properties",yo="$stored_group_properties",bo="$surveys",ko="$surveys_activated",wo="$flag_call_reported",So="$user_state",xo="$client_session_props",Eo="$capture_rate_limit",Co="$initial_campaign_params",Po="$initial_referrer_info",To="$initial_person_info",Io="$epp",Fo="__POSTHOG_TOOLBAR__",Ro="$posthog_cookieless",Oo=[Gr,Zr,"__cmpns",Qr,no,Jr,co,po,So,go,_o,yo,mo,bo,wo,xo,Eo,Co,Po,Io],Lo={},Mo=[],Ao=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qo=Array.isArray;function $o(e,t){for(var n in t)e[n]=t[n];return e}function Do(e){var t=e.parentNode;t&&t.removeChild(e)}function No(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Mr.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Ho(e,s,i,r,null)}function Ho(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++qr:r,__i:-1,__u:0};return null==r&&null!=Ar.vnode&&Ar.vnode(o),o}function jo(e){return e.children}function Bo(e,t){this.props=e,this.context=t}function Uo(e,t){if(null==t)return e.__?Uo(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Uo(e):null}function zo(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return zo(e)}}function Vo(e){(!e.__d&&(e.__d=!0)&&$r.push(e)&&!Wo.__r++||Dr!==Ar.debounceRendering)&&((Dr=Ar.debounceRendering)||Nr)(Wo)}function Wo(){var e,t,n,i,r,o,s,a,u;for($r.sort(Hr);e=$r.shift();)e.__d&&(t=$r.length,i=void 0,o=(r=(n=e).__v).__e,a=[],u=[],(s=n.__P)&&((i=$o({},r)).__v=r.__v+1,Ar.vnode&&Ar.vnode(i),es(s,i,r,n.__n,void 0!==s.ownerSVGElement,32&r.__u?[o]:null,a,null==o?Uo(r):o,!!(32&r.__u),u),i.__.__k[i.__i]=i,ts(a,i,u),i.__e!=o&&zo(i)),$r.length>t&&$r.sort(Hr));Wo.__r=0}function Go(e,t,n,i,r,o,s,a,u,l,c){var d,f,v,h,p,g=i&&i.__k||Mo,_=t.length;for(n.__d=u,function(e,t,n){var i,r,o,s,a,u=t.length,l=n.length,c=l,d=0;for(e.__k=[],i=0;i<u;i++)null!=(r=e.__k[i]=null==(r=t[i])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?Ho(null,r,null,null,r):qo(r)?Ho(jo,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?Ho(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=Qo(r,n,s=i+d,c),r.__i=a,o=null,-1!==a&&(c--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__u|=65536)):a!==s&&(a===s+1?d++:a>s?c>u-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==i+d&&(r.__u|=65536))):(o=n[i])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Uo(o)),rs(o,o,!1),n[i]=null,c--);if(c)for(i=0;i<l;i++)null!=(o=n[i])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Uo(o)),rs(o,o))}(n,t,g),u=n.__d,d=0;d<_;d++)null!=(v=n.__k[d])&&"boolean"!=typeof v&&"function"!=typeof v&&(f=-1===v.__i?Lo:g[v.__i]||Lo,v.__i=d,es(e,v,f,r,o,s,a,u,l,c),h=v.__e,v.ref&&f.ref!=v.ref&&(f.ref&&is(f.ref,null,v),c.push(v.ref,v.__c||h,v)),null==p&&null!=h&&(p=h),65536&v.__u||f.__k===v.__k?u=Zo(v,u,e):"function"==typeof v.type&&void 0!==v.__d?u=v.__d:h&&(u=h.nextSibling),v.__d=void 0,v.__u&=-196609);n.__d=u,n.__e=p}function Zo(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Zo(i[r],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Qo(e,t,n,i){var r=e.key,o=e.type,s=n-1,a=n+1,u=t[n];if(null===u||u&&r==u.key&&o===u.type)return n;if(i>(null!=u&&0==(131072&u.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((u=t[s])&&0==(131072&u.__u)&&r==u.key&&o===u.type)return s;s--}if(a<t.length){if((u=t[a])&&0==(131072&u.__u)&&r==u.key&&o===u.type)return a;a++}}return-1}function Yo(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ao.test(t)?n:n+"px"}function Jo(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Yo(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Yo(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,o?Ko:Xo,o)):e.removeEventListener(t,o?Ko:Xo,o);else{if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&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,n))}}function Xo(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Ar.event?Ar.event(e):e)}function Ko(e){return this.l[e.type+!0](Ar.event?Ar.event(e):e)}function es(e,t,n,i,r,o,s,a,u,l){var c,d,f,v,h,p,g,_,m,y,b,k,w,S,x,E=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=Ar.__b)&&c(t);e:if("function"==typeof E)try{if(_=t.props,m=(c=E.contextType)&&i[c.__c],y=c?m?m.props.value:c.__:i,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?t.__c=d=new E(_,y):(t.__c=d=new Bo(_,y),d.constructor=E,d.render=os),m&&m.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=i,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=$o({},d.__s)),$o(d.__s,E.getDerivedStateFromProps(_,d.__s))),v=d.props,h=d.state,d.__v=t,f)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&_!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,h,p)}))}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,k=Ar.__r,w=0,"prototype"in E&&E.prototype.render){for(d.state=d.__s,d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(i=$o($o({},i),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(p=d.getSnapshotBeforeUpdate(v,h)),Go(e,qo(x=null!=c&&c.type===jo&&null==c.key?c.props.children:c)?x:[x],t,n,i,r,o,s,a,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,u||null!=o?(t.__e=a,t.__u|=u?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Ar.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ns(n.__e,t,n,i,r,o,s,u,l);(c=Ar.diffed)&&c(t)}function ts(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)is(n[i],n[++i],n[++i]);Ar.__c&&Ar.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Ar.__e(e,t.__v)}}))}function ns(e,t,n,i,r,o,s,a,u){var l,c,d,f,v,h,p,g=n.props,_=t.props,m=t.type;if("svg"===m&&(r=!0),null!=o)for(l=0;l<o.length;l++)if((v=o[l])&&"setAttribute"in v==!!m&&(m?v.localName===m:3===v.nodeType)){e=v,o[l]=null;break}if(null==e){if(null===m)return document.createTextNode(_);e=r?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,_.is&&_),o=null,a=!1}if(null===m)g===_||a&&e.data===_||(e.data=_);else{if(o=o&&Mr.call(e.childNodes),g=n.props||Lo,!a&&null!=o)for(g={},l=0;l<e.attributes.length;l++)g[(v=e.attributes[l]).name]=v.value;for(l in g)v=g[l],"children"==l||("dangerouslySetInnerHTML"==l?d=v:"key"===l||l in _||Jo(e,l,null,v,r));for(l in _)v=_[l],"children"==l?f=v:"dangerouslySetInnerHTML"==l?c=v:"value"==l?h=v:"checked"==l?p=v:"key"===l||a&&"function"!=typeof v||g[l]===v||Jo(e,l,v,g[l],r);if(c)a||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Go(e,qo(f)?f:[f],t,n,i,r&&"foreignObject"!==m,o,s,o?o[0]:n.__k&&Uo(n,0),a,u),null!=o)for(l=o.length;l--;)null!=o[l]&&Do(o[l]);a||(l="value",void 0!==h&&(h!==e[l]||"progress"===m&&!h||"option"===m&&h!==g[l])&&Jo(e,l,h,g[l],!1),l="checked",void 0!==p&&p!==e[l]&&Jo(e,l,p,g[l],!1))}return e}function is(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Ar.__e(e,n)}}function rs(e,t,n){var i,r;if(Ar.unmount&&Ar.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||is(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Ar.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&rs(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Do(e.__e),e.__=e.__e=e.__d=void 0}function os(e,t,n){return this.constructor(e,n)}function ss(e,t,n){var i,r,o,s;Ar.__&&Ar.__(e,t),r=(i="function"==typeof n)?null:t.__k,o=[],s=[],es(t,e=(!i&&n||t).__k=No(jo,null,[e]),r||Lo,Lo,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Mr.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i,s),ts(o,e,s)}function as(e,t,n){var i,r,o,s,a=$o({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?Mr.call(arguments,2):n),Ho(e.type,a,i||e.key,r||e.ref,null)}Mr=Mo.slice,Ar={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},qr=0,Bo.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=$o({},this.state),"function"==typeof e&&(e=e($o({},n),this.props)),e&&$o(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Vo(this))},Bo.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Vo(this))},Bo.prototype.render=jo,$r=[],Nr="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hr=function(e,t){return e.__v.__b-t.__v.__b},Wo.__r=0,jr=0,function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}(Br||(Br={})),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Ur||(Ur={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(zr||(zr={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Vr||(Vr={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(Wr||(Wr={}));var us,ls="undefined"!=typeof window?window:void 0,cs="undefined"!=typeof globalThis?globalThis:ls,ds=Array.prototype,fs=ds.forEach,vs=ds.indexOf,hs=null==cs?void 0:cs.navigator,ps=null==cs?void 0:cs.document,gs=null==cs?void 0:cs.location,_s=null==cs?void 0:cs.fetch,ms=null!=cs&&cs.XMLHttpRequest&&"withCredentials"in new cs.XMLHttpRequest?cs.XMLHttpRequest:void 0,ys=null==cs?void 0:cs.AbortController,bs=null==hs?void 0:hs.userAgent,ks=null!=ls?ls:{},ws={DEBUG:!1,LIB_VERSION:"1.235.0"},Ss="$copy_autocapture",xs=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(us||(us={}));var Es=["fatal","error","warning","log","info","debug"];function Cs(e,t){return-1!==e.indexOf(t)}var Ps=function(e){return e.trim()},Ts=function(e){return e.replace(/^\$/,"")};var Is=Array.isArray,Fs=Object.prototype,Rs=Fs.hasOwnProperty,Os=Fs.toString,Ls=Is||function(e){return"[object Array]"===Os.call(e)},Ms=function(e){return"function"==typeof e},As=function(e){return e===Object(e)&&!Ls(e)},qs=function(e){if(As(e)){for(var t in e)if(Rs.call(e,t))return!1;return!0}return!1},$s=function(e){return void 0===e},Ds=function(e){return"[object String]"==Os.call(e)},Ns=function(e){return Ds(e)&&0===e.trim().length},Hs=function(e){return null===e},js=function(e){return $s(e)||Hs(e)},Bs=function(e){return"[object Number]"==Os.call(e)},Us=function(e){return"[object Boolean]"===Os.call(e)},zs=function(e){return e instanceof FormData},Vs=function(e){return Cs(xs,e)},Ws=function e(t){var n={_log:function(e){if(ls&&(ws.DEBUG||ks.POSTHOG_DEBUG)&&!$s(ls.console)&&ls.console){for(var n=("__rrweb_original__"in ls.console[e]?ls.console[e].__rrweb_original__:ls.console[e]),i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(void 0,[t].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n._log.apply(n,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n._log.apply(n,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n._log.apply(n,["error"].concat(t))},critical:function(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];(e=console).error.apply(e,[t].concat(i))},uninitializedWarning:function(e){n.error("You must initialize PostHog before calling ".concat(e))},createLogger:function(n){return e("".concat(t," ").concat(n))}};return n}("[PostHog.js]"),Gs=Ws.createLogger,Zs=Gs("[Stylesheet Loader]"),Qs=function(e,t,n){var i,r=e.createElement("style");return r.innerText=t,null!=n&&null!==(i=n.config)&&void 0!==i&&i.prepare_external_dependency_stylesheet&&(r=n.config.prepare_external_dependency_stylesheet(r)),r||(Zs.error("prepare_external_dependency_stylesheet returned null"),null)},Ys=ls,Js=ps,Xs="seenSurvey_",Ks=Gs("[Surveys]"),ea=2147483647;function ta(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?"".concat(e,", ").concat(t):"-apple-system, ".concat(t)}var na=function(e){return"\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: ".concat(ta(null==e?void 0:e.fontFamily),";\n text-align: left;\n max-width: ").concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||ea.toString()),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n\n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: ").concat((null==e?void 0:e.disabledButtonOpacity)||"0.6",";\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: ").concat(ta(null==e?void 0:e.fontFamily),";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(ra((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .limit-height {\n max-height: 300px;\n overflow: auto;\n scrollbar-width: thin;\n scrollbar-color: ").concat((null==e?void 0:e.borderColor)||"#c9c6c6"," ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ").replace(/[\n\r\t]+/g," ").replace(/\s{2,}/g," ").trim()};function ia(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function ra(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sa;"#"===t[0]&&(e=ia(t)),t.startsWith("rgb")&&(e=t);var n=function(e){return{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()]}(t);if(n&&(e=ia(n)),!e)return"black";var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var r=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(r*r*.299+o*o*.587+s*s*.114)>127.5?"black":"white"}return"black"}var oa={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},sa="#eeeded",aa=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i?(localStorage.setItem(va(n),"true"),i.capture("survey sent",P(P({$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((function(e,t){return{id:e.id,question:e.question,index:t}})),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},t),{},{$set:M({},ha(n,"responded"),!0)})),Ys.dispatchEvent(new Event("PHSurveySent"))):Ks.error("[survey sent] event not captured, PostHog instance not found.")},ua=function(e,t,n){var i;t?n||(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(i=t.get_session_replay_url)||void 0===i?void 0:i.call(t),$set:M({},ha(e,"dismissed"),!0)}),localStorage.setItem(va(e),"true"),Ys.dispatchEvent(new Event("PHSurveyClosed"))):Ks.error("[survey dismissed] event not captured, PostHog instance not found.")},la=function(e){return e.map((function(e){return{sort:Math.floor(10*Math.random()),value:e}})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.value}))},ca=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},da=function(e){return e.appearance&&e.appearance.shuffleQuestions?ca(e.questions,la(e.questions)):e.questions},fa=function(e){var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!function(e){var t,n,i,r,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0}(e))||e.schedule===Wr.Always},va=function(e){var t="".concat(Xs).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(Xs).concat(e.id,"_").concat(e.current_iteration)),t},ha=function(e,t){var n="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(n="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),n},pa=function(e,t){var n={__c:t="__cC"+jr++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Vo(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){}}),ga=function(e){var t=e.component,n=e.children,i=e.renderAsHtml,r=e.style;return as(t,i?{dangerouslySetInnerHTML:{__html:n},style:r}:{children:n,style:r})},_a={};function ma(e,t,n){if(Ls(e))if(fs&&e.forEach===fs)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===_a)return}function ya(e,t,n){if(!js(e)){if(Ls(e))return ma(e,t,n);if(zs(e)){var i,r=H(e.entries());try{for(r.s();!(i=r.n()).done;){var o=i.value;if(t.call(n,o[1],o[0])===_a)return}}catch(e){r.e(e)}finally{r.f()}}else for(var s in e)if(Rs.call(e,s)&&t.call(n,e[s],s)===_a)return}}var ba=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return ma(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},ka=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return ma(n,(function(t){ma(t,(function(t){e.push(t)}))})),e};function wa(e){for(var t=Object.keys(e),n=t.length,i=new Array(n);n--;)i[n]=[t[n],e[t[n]]];return i}var Sa=function(e){try{return e()}catch(e){return}},xa=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){Ws.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ws.critical(e)}}},Ea=function(e){var t={};return ya(e,(function(e,n){Ds(e)&&e.length>0&&(t[n]=e)})),t};function Ca(e,t){return n=e,i=function(e){return Ds(e)&&!Hs(t)?e.slice(0,t):e},r=new Set,function e(t,n){return t!==Object(t)?i?i(t,n):t:r.has(t)?void 0:(r.add(t),Ls(t)?(o=[],ma(t,(function(t){o.push(e(t))}))):(o={},ya(t,(function(t,n){r.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,i,r}var Pa=["herokuapp.com","vercel.app","netlify.app"];function Ta(e){var t=null==e?void 0:e.hostname;if(!Ds(t))return!1;var n,i=t.split(".").slice(-2).join("."),r=H(Pa);try{for(r.s();!(n=r.n()).done;){if(i===n.value)return!1}}catch(e){r.e(e)}finally{r.f()}return!0}function Ia(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Fa(e,t,n,i){var r=null!=i?i:{},o=r.capture,s=void 0!==o&&o,a=r.passive,u=void 0===a||a;null==e||e.addEventListener(t,n,{capture:s,passive:u})}var Ra,Oa=["localhost","127.0.0.1"],La=function(e){var t=null==ps?void 0:ps.createElement("a");return $s(t)?null:(t.href=e,t)},Ma=function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",r=[];return ya(e,(function(e,i){$s(e)||$s(i)||"undefined"===i||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+t)})),r.join(i)},Aa=function(e,t){for(var n,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var o=i[r].split("=");if(o[0]===t){n=o;break}}if(!Ls(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){Ws.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},qa=function(e,t,n){if(!e||!t||!t.length)return e;for(var i=e.split("#"),r=i[0]||"",o=i[1],s=r.split("?"),a=s[1],u=s[0],l=(a||"").split("&"),c=[],d=0;d<l.length;d++){var f=l[d].split("=");Ls(f)&&(t.includes(f[0])?c.push(f[0]+"="+n):c.push(l[d]))}var v=u;return null!=a&&(v+="?"+c.join("&")),null!=o&&(v+="#"+o),v},$a=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Da="Mobile",Na="iOS",Ha="Android",ja="Tablet",Ba=Ha+" "+ja,Ua="iPad",za="Apple",Va=za+" Watch",Wa="Safari",Ga="BlackBerry",Za="Samsung",Qa=Za+"Browser",Ya=Za+" Internet",Ja="Chrome",Xa=Ja+" OS",Ka=Ja+" "+Na,eu="Internet Explorer",tu=eu+" "+Da,nu="Opera",iu=nu+" Mini",ru="Edge",ou="Microsoft "+ru,su="Firefox",au=su+" "+Na,uu="Nintendo",lu="PlayStation",cu="Xbox",du=Ha+" "+Da,fu=Da+" "+Wa,vu="Windows",hu=vu+" Phone",pu="Nokia",gu="Ouya",_u="Generic",mu=_u+" "+Da.toLowerCase(),yu=_u+" "+ja.toLowerCase(),bu="Konqueror",ku="(\\d+(\\.\\d+)?)",wu=new RegExp("Version/"+ku),Su=new RegExp(cu,"i"),xu=new RegExp(lu+" \\w+","i"),Eu=new RegExp(uu+" \\w+","i"),Cu=new RegExp(Ga+"|PlayBook|BB10","i"),Pu={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Tu=function(e,t){return t&&Cs(t,za)||function(e){return Cs(e,Wa)&&!Cs(e,Ja)&&!Cs(e,Ha)}(e)},Iu=function(e,t){return t=t||"",Cs(e," OPR/")&&Cs(e,"Mini")?iu:Cs(e," OPR/")?nu:Cu.test(e)?Ga:Cs(e,"IE"+Da)||Cs(e,"WPDesktop")?tu:Cs(e,Qa)?Ya:Cs(e,ru)||Cs(e,"Edg/")?ou:Cs(e,"FBIOS")?"Facebook "+Da:Cs(e,"UCWEB")||Cs(e,"UCBrowser")?"UC Browser":Cs(e,"CriOS")?Ka:Cs(e,"CrMo")||Cs(e,Ja)?Ja:Cs(e,Ha)&&Cs(e,Wa)?du:Cs(e,"FxiOS")?au:Cs(e.toLowerCase(),bu.toLowerCase())?bu:Tu(e,t)?Cs(e,Da)?fu:Wa:Cs(e,su)?su:Cs(e,"MSIE")||Cs(e,"Trident/")?eu:Cs(e,"Gecko")?su:""},Fu=(M(Ra={},tu,[new RegExp("rv:"+ku)]),M(Ra,ou,[new RegExp(ru+"?\\/"+ku)]),M(Ra,Ja,[new RegExp("("+Ja+"|CrMo)\\/"+ku)]),M(Ra,Ka,[new RegExp("CriOS\\/"+ku)]),M(Ra,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+ku)]),M(Ra,Wa,[wu]),M(Ra,fu,[wu]),M(Ra,nu,[new RegExp("(Opera|OPR)\\/"+ku)]),M(Ra,su,[new RegExp(su+"\\/"+ku)]),M(Ra,au,[new RegExp("FxiOS\\/"+ku)]),M(Ra,bu,[new RegExp("Konqueror[:/]?"+ku,"i")]),M(Ra,Ga,[new RegExp(Ga+" "+ku),wu]),M(Ra,du,[new RegExp("android\\s"+ku,"i")]),M(Ra,Ya,[new RegExp(Qa+"\\/"+ku)]),M(Ra,eu,[new RegExp("(rv:|MSIE )"+ku)]),M(Ra,"Mozilla",[new RegExp("rv:"+ku)]),Ra),Ru=[[new RegExp(cu+"; "+cu+" (.*?)[);]","i"),function(e){return[cu,e&&e[1]||""]}],[new RegExp(uu,"i"),[uu,""]],[new RegExp(lu,"i"),[lu,""]],[Cu,[Ga,""]],[new RegExp(vu,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[hu,""];if(new RegExp(Da).test(t)&&!/IEMobile\b/.test(t))return[vu+" "+Da,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var i=n[1],r=Pu[i]||"";return/arm/i.test(t)&&(r="RT"),[vu,r]}return[vu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Na,t.join(".")]}return[Na,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=$s(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Ha+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ha+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Ha,t.join(".")]}return[Ha,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Xa,""]],[/Linux|debian/i,["Linux",""]]],Ou=function(e){return Eu.test(e)?uu:xu.test(e)?lu:Su.test(e)?cu:new RegExp(gu,"i").test(e)?gu:new RegExp("("+hu+"|WPDesktop)","i").test(e)?hu:/iPad/.test(e)?Ua:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Va:Cu.test(e)?Ga:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(pu,"i").test(e)?pu:/(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(Da).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)?Ha:Ba:Ha:new RegExp("(pda|"+Da+")","i").test(e)?mu:new RegExp(ja,"i").test(e)&&!new RegExp(ja+" pc","i").test(e)?yu:""},Lu="https?://(.*)",Mu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],Au=ka(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Mu),qu="<masked>",$u={campaignParams:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.customTrackedParams,n=e.maskPersonalDataProperties,i=e.customPersonalDataProperties;if(!ps)return{};var r=n?ka([],Mu,i||[]):[];return this._campaignParamsFromUrl(qa(ps.URL,r,qu),t)},_campaignParamsFromUrl:function(e,t){var n=Au.concat(t||[]),i={};return ya(n,(function(t){var n=Aa(e,t);i[t]=n||null})),i},_searchEngine:function(e){return e?0===e.search(Lu+"google.([^/?]*)")?"google":0===e.search(Lu+"bing.com")?"bing":0===e.search(Lu+"yahoo.com")?"yahoo":0===e.search(Lu+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=$u._searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(!Hs(t)){i.$search_engine=t;var r=ps?Aa(ps.referrer,n):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var e=null==ps?void 0:ps.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:Iu,browserVersion:function(e,t){var n=Iu(e,t),i=Fu[n];if($s(i))return null;for(var r=0;r<i.length;r++){var o=i[r],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return"string"==typeof e?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<Ru.length;t++){var n=q(Ru[t],2),i=n[0],r=n[1],o=i.exec(e),s=o&&(Ms(r)?r(o,e):r);if(s)return s}return["",""]},device:Ou,deviceType:function(e){var t=Ou(e);return t===Ua||t===Ba||"Kobo"===t||"Kindle Fire"===t||t===yu?ja:t===uu||t===cu||t===lu||t===gu?"Console":t===Va?"Wearable":t?Da:"Desktop"},referrer:function(){return(null==ps?void 0:ps.referrer)||"$direct"},referringDomain:function(){var e;return null!=ps&&ps.referrer&&(null===(e=La(ps.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},personInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maskPersonalDataProperties,n=e.customPersonalDataProperties,i=t?ka([],Mu,n||[]):[],r=null==gs?void 0:gs.href.substring(0,1e3);return{r:this.referrer().substring(0,1e3),u:r?qa(r,i,qu):void 0}},personPropsFromInfo:function(e){var t,n=e.r,i=e.u,r={$referrer:n,$referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=La(n))||void 0===t?void 0:t.host};if(i){r.$current_url=i;var o=La(i);r.$host=null==o?void 0:o.host,r.$pathname=null==o?void 0:o.pathname;var s=this._campaignParamsFromUrl(i);ba(r,s)}if(n){var a=this._searchInfoFromReferrer(n);ba(r,a)}return r},initialPersonPropsFromInfo:function(e){var t=this.personPropsFromInfo(e),n={};return ya(t,(function(e,t){n["$initial_".concat(Ts(t))]=e})),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},timezoneOffset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}},properties:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maskPersonalDataProperties,n=e.customPersonalDataProperties;if(!bs)return{};var i=t?ka([],Mu,n||[]):[],r=q($u.os(bs),2),o=r[0],s=r[1];return ba(Ea({$os:o,$os_version:s,$browser:$u.browser(bs,navigator.vendor),$device:$u.device(bs),$device_type:$u.deviceType(bs),$timezone:$u.timezone(),$timezone_offset:$u.timezoneOffset()}),{$current_url:qa(null==gs?void 0:gs.href,i,qu),$host:null==gs?void 0:gs.host,$pathname:null==gs?void 0:gs.pathname,$raw_user_agent:bs.length>1e3?bs.substring(0,997)+"...":bs,$browser_version:$u.browserVersion(bs,navigator.vendor),$browser_language:$u.browserLanguage(),$browser_language_prefix:$u.browserLanguagePrefix(),$screen_height:null==ls?void 0:ls.screen.height,$screen_width:null==ls?void 0:ls.screen.width,$viewport_height:null==ls?void 0:ls.innerHeight,$viewport_width:null==ls?void 0:ls.innerWidth,$lib:"web",$lib_version:ws.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!bs)return{};var e=q($u.os(bs),2),t=e[0],n=e[1];return ba(Ea({$os:t,$os_version:n,$browser:$u.browser(bs,navigator.vendor)}),{$browser_version:$u.browserVersion(bs,navigator.vendor)})}},Du=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}},Nu=function(){function e(){R(this,e),M(this,"events",{}),this.events={}}return L(e,[{key:"on",value: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}))}}},{key:"emit",value:function(e,t){var n,i=H(this.events[e]||[]);try{for(i.s();!(n=i.n()).done;){(0,n.value)(t)}}catch(e){i.e(e)}finally{i.f()}var r,o=H(this.events["*"]||[]);try{for(o.s();!(r=o.n()).done;){(0,r.value)(e,t)}}catch(e){o.e(e)}finally{o.f()}}}]),e}(),Hu=function(){function e(t){var n=this;R(this,e),M(this,"_debugEventEmitter",new Nu),M(this,"checkStep",(function(e,t){return n.checkStepEvent(e,t)&&n.checkStepUrl(e,t)&&n.checkStepElement(e,t)})),M(this,"checkStepEvent",(function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)})),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}return L(e,[{key:"init",value:function(){var e,t=this;if(!$s(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var n;null===(n=this.instance)||void 0===n||n._addCaptureHook((function(e,n){t.on(e,n)}))}}},{key:"register",value:function(e){var t,n,i=this;if(!$s(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((function(e){var t,n;null===(t=i.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((function(e){var t;null===(t=i.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var r,o=new Set;e.forEach((function(e){var t;null===(t=e.steps)||void 0===t||t.forEach((function(e){null!=e&&e.selector&&o.add(null==e?void 0:e.selector)}))})),null===(r=this.instance)||void 0===r||r.autocapture.setElementSelectors(o)}}},{key:"on",value:function(e,t){var n,i=this;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((function(e){i.checkAction(t,e)&&i._debugEventEmitter.emit("actionCaptured",e.name)}))}},{key:"_addActionHook",value:function(e){this.onAction("actionCaptured",(function(t){return e(t)}))}},{key:"checkAction",value:function(e,t){if(null==(null==t?void 0:t.steps))return!1;var n,i=H(t.steps);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(this.checkStep(e,r))return!0}}catch(e){i.e(e)}finally{i.f()}return!1}},{key:"onAction",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"checkStepUrl",value:function(t,n){if(null!=n&&n.url){var i,r=null==t||null===(i=t.properties)||void 0===i?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!e.matchString(r,null==n?void 0:n.url,(null==n?void 0:n.url_matching)||"contains"))return!1}return!0}},{key:"checkStepElement",value:function(t,n){if((null!=n&&n.href||null!=n&&n.tag_name||null!=n&&n.text)&&!this.getElementsList(t).some((function(t){return!(null!=n&&n.href&&!e.matchString(t.href||"",null==n?void 0:n.href,(null==n?void 0:n.href_matching)||"exact"))&&((null==n||!n.tag_name||t.tag_name===(null==n?void 0:n.tag_name))&&!(null!=n&&n.text&&!e.matchString(t.text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")&&!e.matchString(t.$el_text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")))})))return!1;if(null!=n&&n.selector){var i,r=null==t||null===(i=t.properties)||void 0===i?void 0:i.$element_selectors;if(!r)return!1;if(!r.includes(null==n?void 0:n.selector))return!1}return!0}},{key:"getElementsList",value:function(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}],[{key:"matchString",value:function(t,n,i){switch(i){case"regex":return!!ls&&Du(t,n);case"exact":return n===t;case"contains":var r=e.escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Du(t,r);default:return!1}}},{key:"escapeStringRegexp",value:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}}]),e}(),ju=function(){function e(t){R(this,e),this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return L(e,[{key:"register",value:function(e){var t;$s(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}},{key:"setupActionBasedSurveys",value:function(e){var t=this,n=e.filter((function(e){var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(i=n.actions)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0}));if(0!==n.length){if(null==this.actionMatcher){this.actionMatcher=new Hu(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((function(e){t.onAction(e)}))}n.forEach((function(e){var n,i,r,o,s,a,u,l,c,d;e.conditions&&null!==(n=e.conditions)&&void 0!==n&&n.actions&&null!==(i=e.conditions)&&void 0!==i&&null!==(r=i.actions)&&void 0!==r&&r.values&&(null===(o=e.conditions)||void 0===o||null===(s=o.actions)||void 0===s||null===(a=s.values)||void 0===a?void 0:a.length)>0&&(null===(u=t.actionMatcher)||void 0===u||u.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(d=c.values)||void 0===d||d.forEach((function(n){if(n&&n.name){var i=t.actionToSurveys.get(n.name);i&&i.push(e.id),t.actionToSurveys.set(n.name,i||[e.id])}})))}))}}},{key:"setupEventBasedSurveys",value:function(e){var t,n=this;if(0!==e.filter((function(e){var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook((function(e,t){n.onEvent(e,t)})),e.forEach((function(e){var t,i,r;null===(t=e.conditions)||void 0===t||null===(i=t.events)||void 0===i||null===(r=i.values)||void 0===r||r.forEach((function(t){if(t&&t.name){var i=n.eventToSurveys.get(t.name);i&&i.push(e.id),n.eventToSurveys.set(t.name,i||[e.id])}}))}))}}},{key:"onEvent",value:function(t,n){var i,r,o=(null===(i=this.instance)||void 0===i||null===(r=i.persistence)||void 0===r?void 0:r.props[ko])||[];if(e.SURVEY_SHOWN_EVENT_NAME==t&&n&&o.length>0){var s,a=null==n||null===(s=n.properties)||void 0===s?void 0:s.$survey_id;if(a){var u=o.indexOf(a);u>=0&&(o.splice(u,1),this._updateActivatedSurveys(o))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(o.concat(this.eventToSurveys.get(t)||[]))}},{key:"onAction",value:function(e){var t,n,i=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[ko])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(e)||[]))}},{key:"_updateActivatedSurveys",value:function(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register(M({},ko,$(new Set(e))))}},{key:"getSurveys",value:function(){var e,t,n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[ko];return n||[]}},{key:"getEventToSurveys",value:function(){return this.eventToSurveys}},{key:"_getActionMatcher",value:function(){return this.actionMatcher}}]),e}();M(ju,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Bu=Gs("[Surveys]"),Uu={icontains:function(e,t){return e.some((function(e){return t.toLowerCase().includes(e.toLowerCase())}))},not_icontains:function(e,t){return e.every((function(e){return!t.toLowerCase().includes(e.toLowerCase())}))},regex:function(e,t){return e.some((function(e){return Du(t,e)}))},not_regex:function(e,t){return e.every((function(e){return!Du(t,e)}))},exact:function(e,t){return e.some((function(e){return t===e}))},is_not:function(e,t){return e.every((function(e){return t!==e}))}};function zu(e){return null!=e?e:"icontains"}function Vu(e){var t,n,i;if(null===(t=e.conditions)||void 0===t||!t.url)return!0;var r=null==ls||null===(n=ls.location)||void 0===n?void 0:n.href;if(!r)return!1;var o=[e.conditions.url];return Uu[zu(null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)](o,r)}var Wu,Gu,Zu,Qu,Yu=function(){function e(t){R(this,e),M(this,"_isFetchingSurveys",!1),M(this,"_isInitializingSurveys",!1),M(this,"_surveyCallbacks",[]),this.instance=t,this._surveyEventReceiver=null}return L(e,[{key:"onRemoteConfig",value:function(e){var t=e.surveys;if(js(t))return Bu.warn("Decide not loaded yet. Not loading surveys.");var n=Ls(t);this._hasSurveys=n?t.length>0:t,Bu.info("decide response received, hasSurveys: ".concat(this._hasSurveys)),this._hasSurveys&&this.loadIfEnabled()}},{key:"reset",value:function(){localStorage.removeItem("lastSeenSurveyDate");var e=function(){for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);null!=n&&n.startsWith(Xs)&&e.push(n)}return e}();e.forEach((function(e){return localStorage.removeItem(e)}))}},{key:"loadIfEnabled",value:function(){var e=this;if(!this._surveyManager)if(this._isInitializingSurveys)Bu.info("Already initializing surveys, skipping...");else if(this.instance.config.disable_surveys)Bu.info("Disabled. Not loading surveys.");else{var t=null==ks?void 0:ks.__PosthogExtensions__;if(t)if(this._hasSurveys){this._isInitializingSurveys=!0;try{var n=t.generateSurveys;if(n)this._surveyManager=n(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new ju(this.instance),Bu.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0});else{var i=t.loadExternalDependency;if(i)i(this.instance,"surveys",(function(n){if(n||!t.generateSurveys)return Bu.error("Could not load surveys script",n),void(e._isInitializingSurveys=!1);e._surveyManager=t.generateSurveys(e.instance),e._isInitializingSurveys=!1,e._surveyEventReceiver=new ju(e.instance),Bu.info("Surveys loaded successfully"),e._notifySurveyCallbacks({isLoaded:!0})}));else{var r="PostHog loadExternalDependency extension not found. Cannot load remote config.";Bu.error(r),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:r})}}}catch(e){throw Bu.error("Error initializing surveys",e),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:"Error initializing surveys"}),e}}else Bu.info("No surveys to load.");else Bu.error("PostHog Extensions not found.")}}},{key:"onSurveysLoaded",value: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}))}}},{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return Bu.info("Disabled. Not loading surveys."),e([]);var i=this.instance.get_property(bo);if(i&&!n)return e(i,{isLoaded:!0});if(this._isFetchingSurveys)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this._isFetchingSurveys=!0,this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",timeout:this.instance.config.surveys_request_timeout_ms,callback:function(n){var i;t._isFetchingSurveys=!1;var r=n.statusCode;if(200!==r||!n.json){var o="Surveys API could not be loaded, status: ".concat(r);return Bu.error(o),e([],{isLoaded:!1,error:o})}var s,a=n.json.surveys||[],u=a.filter((function(e){var t,n,i,r,o,s,a,u,l,c,d,f;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(u=e.conditions)||void 0===u||null===(l=u.actions)||void 0===l?void 0:l.values)&&(null===(c=e.conditions)||void 0===c||null===(d=c.actions)||void 0===d||null===(f=d.values)||void 0===f?void 0:f.length)>0}));u.length>0&&(null===(s=t._surveyEventReceiver)||void 0===s||s.register(u));return null===(i=t.instance.persistence)||void 0===i||i.register(M({},bo,a)),e(a,{isLoaded:!0})}})}catch(e){throw this._isFetchingSurveys=!1,e}}},{key:"_notifySurveyCallbacks",value:function(e){var t,n=H(this._surveyCallbacks);try{for(n.s();!(t=n.n()).done;){var i=t.value;try{e.isLoaded?this.getSurveys(i):i([],e)}catch(e){Bu.error("Error in survey callback",e)}}}catch(e){n.e(e)}finally{n.f()}}},{key:"isSurveyFeatureFlagEnabled",value:function(e){return!e||this.instance.featureFlags.isFeatureEnabled(e)}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var i,r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t;if(!e.conditions)return!0;var n=Vu(e),i=null===(t=e.conditions)||void 0===t||!t.selector||(null==ps?void 0:ps.querySelector(e.conditions.selector)),r=function(e){var t,n,i;if(null===(t=e.conditions)||void 0===t||!t.deviceTypes||0===(null===(n=e.conditions)||void 0===n?void 0:n.deviceTypes.length))return!0;if(!bs)return!1;var r=$u.deviceType(bs);return Uu[zu(null===(i=e.conditions)||void 0===i?void 0:i.deviceTypesMatchType)](e.conditions.deviceTypes,r)}(e);return n&&i&&r})),o=null===(i=t._surveyEventReceiver)||void 0===i?void 0:i.getSurveys(),s=r.filter((function(e){var n,i,r,s,a,u,l,c,d;if(!(e.linked_flag_key||e.targeting_flag_key||e.internal_targeting_flag_key||null!==(n=e.feature_flag_keys)&&void 0!==n&&n.length))return!0;var f=t.isSurveyFeatureFlagEnabled(e.linked_flag_key),v=t.isSurveyFeatureFlagEnabled(e.targeting_flag_key),h=(null!==(i=null===(r=e.conditions)||void 0===r||null===(s=r.events)||void 0===s||null===(a=s.values)||void 0===a?void 0:a.length)&&void 0!==i?i:0)>0,p=(null!==(u=null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(d=c.values)||void 0===d?void 0:d.length)&&void 0!==u?u:0)>0,g=!h&&!p||(null==o?void 0:o.includes(e.id)),_=t._canActivateRepeatedly(e)||t.isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key),m=t.checkFlags(e);return f&&v&&_&&g&&m}));return e(s)}),n)}},{key:"checkFlags",value:function(e){var t,n=this;return null===(t=e.feature_flag_keys)||void 0===t||!t.length||e.feature_flag_keys.every((function(e){var t=e.key,i=e.value;return!t||!i||n.instance.featureFlags.isFeatureEnabled(i)}))}},{key:"_canActivateRepeatedly",value:function(e){var t;return js(null===(t=ks.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(Bu.warn("init was not called"),!1):ks.__PosthogExtensions__.canActivateRepeatedly(e)}},{key:"canRenderSurvey",value:function(e){var t=this;if(js(this._surveyManager))return Bu.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=null;return this.getSurveys((function(i){var r=i.filter((function(t){return t.id===e}))[0];n=r?P({},t._surveyManager.canRenderSurvey(r)):{visible:!1,disabledReason:"Survey not found"}})),n}},{key:"renderSurvey",value:function(e,t){var n=this;js(this._surveyManager)?Bu.warn("init was not called"):this.getSurveys((function(i){var r=i.filter((function(t){return t.id===e}))[0];n._surveyManager.renderSurvey(r,null==ps?void 0:ps.querySelector(t))}))}}]),e}(),Ju=0,Xu=[],Ku=[],el=Ar.__b,tl=Ar.__r,nl=Ar.diffed,il=Ar.__c,rl=Ar.unmount;function ol(e,t){Ar.__h&&Ar.__h(Gu,e,Ju||t),Ju=0;var n=Gu.__H||(Gu.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Ku}),n.__[e]}function sl(e){return Ju=1,function(e,t,n){var i=ol(Wu++,2);if(i.t=e,!i.__c&&(i.__=[_l(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Gu,!Gu.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};Gu.u=!0;var o=Gu.shouldComponentUpdate,s=Gu.componentWillUpdate;Gu.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}s&&s.call(this,e,t,n)},Gu.shouldComponentUpdate=r}return i.__N||i.__}(_l,e)}function al(e,t){var n=ol(Wu++,3);!Ar.__s&&gl(n.__H,t)&&(n.__=e,n.i=t,Gu.__H.__h.push(n))}function ul(e){return Ju=5,ll((function(){return{current:e}}),[])}function ll(e,t){var n=ol(Wu++,7);return gl(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function cl(e){var t=Gu.context[e.__c],n=ol(Wu++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Gu)),t.props.value):e.__}function dl(){for(var e;e=Xu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(hl),e.__H.__h.forEach(pl),e.__H.__h=[]}catch(t){e.__H.__h=[],Ar.__e(t,e.__v)}}Ar.__b=function(e){Gu=null,el&&el(e)},Ar.__r=function(e){tl&&tl(e),Wu=0;var t=(Gu=e.__c).__H;t&&(Zu===Gu?(t.__h=[],Gu.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Ku,e.__N=e.i=void 0}))):(t.__h.forEach(hl),t.__h.forEach(pl),t.__h=[],Wu=0)),Zu=Gu},Ar.diffed=function(e){nl&&nl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Xu.push(t)&&Qu===Ar.requestAnimationFrame||((Qu=Ar.requestAnimationFrame)||vl)(dl)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Ku&&(e.__=e.__V),e.i=void 0,e.__V=Ku}))),Zu=Gu=null},Ar.__c=function(e,t){t.some((function(e){try{e.__h.forEach(hl),e.__h=e.__h.filter((function(e){return!e.__||pl(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Ar.__e(n,e.__v)}})),il&&il(e,t)},Ar.unmount=function(e){rl&&rl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{hl(e)}catch(e){t=e}})),n.__H=void 0,t&&Ar.__e(t,n.__v))};var fl="function"==typeof requestAnimationFrame;function vl(e){var t,n=function(){clearTimeout(i),fl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);fl&&(t=requestAnimationFrame(n))}function hl(e){var t=Gu,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Gu=t}function pl(e){var t=Gu;e.__c=e.__(),Gu=t}function gl(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function _l(e,t){return"function"==typeof t?t(e):t}var ml=ps;function yl(e,t){var n,i=ml.createElement("div");i.className="PostHogWidget".concat(e.id);var r,o=i.attachShadow({mode:"open"}),s=(r=null===(n=e.appearance)||void 0===n?void 0:n.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(r||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: ").concat(ea,";\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n ")),a=Qs(ml,s,t);return a&&o.append(a),ml.body.appendChild(i),o}var bl=0;function kl(e,t,n,i,r,o){var s,a,u={};for(a in t)"ref"==a?s=t[a]:u[a]=t[a];var l={type:e,props:u,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--bl,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===u[a]&&(u[a]=s[a]);return Ar.vnode&&Ar.vnode(l),l}var wl=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),Sl=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),xl=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),El=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),Cl=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),Pl=kl("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:kl("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:"black"})}),Tl=kl("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[kl("g",{"clip-path":"url(#clip0_2415_6911)",children:[kl("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:kl("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),kl("g",{mask:"url(#mask0_2415_6911)",children:[kl("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"}),kl("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"}),kl("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"}),kl("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"}),kl("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"}),kl("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"})]})]}),kl("defs",{children:kl("clipPath",{id:"clip0_2415_6911",children:kl("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Il=kl("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:kl("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function Fl(){return kl("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Tl]})}function Rl(e){var t=e.text,n=e.submitDisabled,i=e.appearance,r=e.onSubmit,o=e.link,s=e.onPreviewSubmit,a=cl(pa),u=a.isPreviewMode,l=a.isPopup,c=i.submitButtonTextColor||ra(i.submitButtonColor||oa.submitButtonColor);return kl("div",{className:"bottom-section",children:[kl("div",{className:"buttons",children:kl("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",style:l?{color:c}:{},onClick:function(){o&&(null==ls||ls.open(o)),u?null==s||s():r()},children:t})}),!i.whiteLabel&&kl(Fl,{})]})}function Ol(e){var t=e.question,n=e.description,i=e.descriptionContentType,r=e.backgroundColor,o=e.forceDisableHtml;return kl("div",{style:cl(pa).isPopup?{backgroundColor:r||oa.backgroundColor}:{},children:[kl("div",{className:"survey-question",children:t}),n&&ga({component:No("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==i})]})}function Ll(e){return kl("div",{className:"cancel-btn-wrapper",children:kl("button",{className:"form-cancel",onClick:e.onClick,disabled:cl(pa).isPreviewMode,"aria-label":"Close survey",role:"button",children:Pl})})}function Ml(e){var t=e.header,n=e.description,i=e.contentType,r=e.forceDisableHtml,o=e.appearance,s=e.onClose,a=e.styleOverrides,u=ra(o.backgroundColor||oa.backgroundColor),l=cl(pa).isPopup;return kl("div",{className:"thank-you-message",style:P({},a),children:kl("div",{className:"thank-you-message-container",children:[l&&kl(Ll,{onClick:function(){return s()}}),kl("h3",{className:"thank-you-message-header",style:{color:u},children:t}),n&&ga({component:No("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i,style:{color:u}}),l&&kl(Rl,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:function(){return s()}})]})})}function Al(e){var t,n=ul(null),i=q(sl(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black"),2),r=i[0],o=i[1];return al((function(){if(n.current){var e=function(e){var t=Ys.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";var i=parseInt(n[1]),r=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(i*i*.299+r*r*.587+o*o*.114)>127.5?"black":"white"}(n.current);o(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function ql(e){var t=e.question,n=e.forceDisableHtml,i=e.appearance,r=e.onSubmit,o=e.onPreviewSubmit,s=q(sl(""),2),a=s[0],u=s[1];return kl("div",{children:[kl(Ol,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:i.backgroundColor,forceDisableHtml:n}),kl("textarea",{rows:4,placeholder:null==i?void 0:i.placeholder,onInput:function(e){return u(e.currentTarget.value)}}),kl(Rl,{text:t.buttonText||"Submit",submitDisabled:!a&&!t.optional,appearance:i,onSubmit:function(){return r(a)},onPreviewSubmit:function(){return o(a)}})]})}function $l(e){var t=e.question,n=e.forceDisableHtml,i=e.appearance,r=e.onSubmit,o=e.onPreviewSubmit;return kl(jo,{children:[kl(Ol,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),kl(Rl,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:function(){return r("link clicked")},onPreviewSubmit:function(){return o("link clicked")}})]})}function Dl(e){var t=e.question,n=e.forceDisableHtml,i=e.displayQuestionIndex,r=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=t.scale,u=10===t.scale?0:1,l=q(sl(null),2),c=l[0],d=l[1];return kl(jo,{children:[kl(Ol,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),kl("div",{className:"rating-section",children:[kl("div",{className:"rating-options",children:["emoji"===t.display&&kl("div",{className:"rating-options-emoji",children:(3===t.scale?Bl:Ul).map((function(e,t){var n=t+1===c;return kl("button",{className:"ratings-emoji question-".concat(i,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:function(){d(t+1)},style:{fill:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:e},t)}))}),"number"===t.display&&kl("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-u+1,", minmax(0, 1fr))")},children:Gl(t.scale).map((function(e,t){return kl(Nl,{displayQuestionIndex:i,active:c===e,appearance:r,num:e,setActiveNumber:function(e){d(e)}},t)}))})]}),kl("div",{className:"rating-text",children:[kl("div",{children:t.lowerBoundLabel}),kl("div",{children:t.upperBoundLabel})]})]}),kl(Rl,{text:t.buttonText||(null==r?void 0:r.submitButtonText)||"Submit",submitDisabled:Hs(c)&&!t.optional,appearance:r,onSubmit:function(){return o(c)},onPreviewSubmit:function(){return s(c)}})]})}function Nl(e){var t=e.num,n=e.active,i=e.displayQuestionIndex,r=e.appearance,o=e.setActiveNumber,s=Al({appearance:r,defaultTextColor:"black",forceUpdate:n}),a=s.textColor;return kl("button",{ref:s.ref,className:"ratings-number question-".concat(i,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:function(){o(t)},style:{color:a,backgroundColor:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:t})}function Hl(e,t,n,i){if(i)return!1;if(Hs(e))return!0;if(Ls(e)){if(!t&&0===e.length)return!0;if(t&&!n&&0===e.length)return!0}return!1}function jl(e){var t=e.question,n=e.forceDisableHtml,i=e.displayQuestionIndex,r=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=ul(null),u=ll((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var i=ca(t,la(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i}(t)}),[t]),l=q(sl(t.type===zr.MultipleChoice?[]:null),2),c=l[0],d=l[1],f=q(sl(!1),2),v=f[0],h=f[1],p=q(sl(""),2),g=p[0],_=p[1],m=t.type===zr.SingleChoice?"radio":"checkbox",y=function(e,n){return n?(h(!v),void(v||setTimeout((function(){var e;return null===(e=a.current)||void 0===e?void 0:e.focus()}),0))):t.type===zr.SingleChoice?(d(e),void h(!1)):void(t.type===zr.MultipleChoice&&Ls(c)&&(c.includes(e)?d(c.filter((function(t){return t!==e}))):d([].concat($(c),[e]))))};return kl("div",{children:[kl(Ol,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),kl("div",{className:"multiple-choice-options limit-height",children:u.map((function(e,n){var r=!!t.hasOpenChoice&&n===t.choices.length-1,o="choice-option".concat(r?" choice-option-open":""),s=r?v:t.type===zr.SingleChoice?c===e:Ls(c)&&c.includes(e);return kl("div",{className:o,children:[kl("input",{type:m,id:"surveyQuestion".concat(i,"Choice").concat(n),name:"question".concat(i),checked:s,onClick:function(){return y(e,r)}}),kl("label",{htmlFor:"surveyQuestion".concat(i,"Choice").concat(n),style:{color:"black"},children:r?kl(jo,{children:[kl("span",{children:[e,":"]}),kl("input",{type:"text",ref:a,id:"surveyQuestion".concat(i,"Choice").concat(n,"Open"),name:"question".concat(i),value:g,onInput:function(e){return n=e.currentTarget.value,_(n),void(t.type===zr.SingleChoice&&d(n));var n},onClick:function(t){v||y(e,!0),t.stopPropagation()}})]}):e}),kl("span",{className:"choice-check",style:{color:"black"},children:Il})]},n)}))}),kl(Rl,{text:t.buttonText||"Submit",submitDisabled:Hl(c,v,g,!!t.optional),appearance:r,onSubmit:function(){v&&t.type===zr.MultipleChoice?Ls(c)&&o([].concat($(c),[g])):o(c)},onPreviewSubmit:function(){v&&t.type===zr.MultipleChoice?Ls(c)&&s([].concat($(c),[g])):s(c)}})]})}var Bl=[xl,Sl,wl],Ul=[El,xl,Sl,wl,Cl],zl=[1,2,3,4,5],Vl=[1,2,3,4,5,6,7],Wl=[0,1,2,3,4,5,6,7,8,9,10];function Gl(e){switch(e){case 5:default:return zl;case 7:return Vl;case 10:return Wl}}var Zl=Gs("[Surveys]"),Ql=ls,Yl=ps;function Jl(e){return".PostHogWidget".concat(e)}var Xl="ph:show_survey_widget";function Kl(e,t,n){var i,r=e.questions[t],o=t+1;if(null===(i=r.branching)||void 0===i||!i.type)return t===e.questions.length-1?Vr.End:o;if(r.branching.type===Vr.End)return Vr.End;if(r.branching.type===Vr.SpecificQuestion){if(Number.isInteger(r.branching.index))return r.branching.index}else if(r.branching.type===Vr.ResponseBased){if(r.type===zr.SingleChoice){var s,a,u=r.choices.indexOf("".concat(n));if(null!==(s=r.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(u)){var l=r.branching.responseValues[u];return Number.isInteger(l)?l:l===Vr.End?Vr.End:o}}else if(r.type===zr.Rating){var c,d;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var f=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(n,r.scale);if(null!==(c=r.branching)&&void 0!==c&&null!==(d=c.responseValues)&&void 0!==d&&d.hasOwnProperty(f)){var v=r.branching.responseValues[f];return Number.isInteger(v)?v:v===Vr.End?Vr.End:o}}return o}return Zl.warn("Falling back to next question index due to unexpected branching type"),o}var ec=function(){function e(t){var n=this;R(this,e),M(this,"surveyTimeouts",new Map),M(this,"widgetSelectorListeners",new Map),M(this,"canShowNextEventBasedSurvey",(function(){var e,t=Yl.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),M(this,"handlePopoverSurvey",(function(e){var t,i=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays;if(function(e,t){if(!t||!e)return!0;var n=new Date,i=Math.abs(n.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t}(localStorage.getItem("lastSeenSurveyDate"),i)){var r=function(e){return!!localStorage.getItem(va(e))&&!fa(e)}(e);if(!r){var o;n.clearSurveyTimeout(e.id),n.addSurveyToFocus(e.id);var s=(null===(o=e.appearance)||void 0===o?void 0:o.surveyPopupDelaySeconds)||0,a=function(e,t,n,i){var r=Js.createElement("div");r.className="PostHogSurvey".concat(t);var o=r.attachShadow({mode:"open"});if(e){var s=Qs(Js,e,i);s&&o.appendChild(s)}return Js.body.appendChild(r),o}(na(null==e?void 0:e.appearance),e.id,0,n.posthog);if(s<=0)return ss(kl(ic,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a);var u=setTimeout((function(){if(!Vu(e))return n.removeSurveyFromFocus(e.id);ss(kl(ic,{posthog:n.posthog,survey:P(P({},e),{},{appearance:P(P({},e.appearance),{},{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}),1e3*s);n.surveyTimeouts.set(e.id,u)}}})),M(this,"handleWidget",(function(e){if(0===Yl.querySelectorAll(Jl(e.id)).length){var t=yl(e,n.posthog),i=na(e.appearance),r=Qs(Yl,i,n.posthog);r&&t.appendChild(r),ss(kl(oc,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus},"feedback-survey-"+e.id),t)}})),M(this,"removeWidgetSelectorListener",(function(e){var t=n.widgetSelectorListeners.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute("PHWidgetSurveyClickListener"),n.widgetSelectorListeners.delete(e),Zl.info("Removed click listener for survey ".concat(e)))})),M(this,"manageWidgetSelectorListener",(function(e){var t,i=null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector;if(i){var r=Yl.querySelector(i),o=n.widgetSelectorListeners.get(e.id);if(r){if(n.handleWidget(e),o){if(r===o.element)return;Zl.info("Selector element changed for survey ".concat(e.id,". Re-attaching listener.")),n.removeWidgetSelectorListener(e.id)}if(!r.hasAttribute("PHWidgetSurveyClickListener")){var s=function(t){var n,i;t.stopPropagation();var r=t.currentTarget.getBoundingClientRect(),o=Ql.innerHeight,s=Ql.innerWidth,a=parseInt((null===(n=e.appearance)||void 0===n?void 0:n.maxWidth)||"300"),u=r.left+r.width/2-a/2;u+a>s-20&&(u=s-a-20),u<20&&(u=20);var l=o-r.bottom,c=r.top,d=l<250&&c>l,f={position:"fixed",top:d?"auto":"".concat(r.bottom+12,"px"),left:"".concat(u,"px"),right:"auto",bottom:d?"".concat(o-r.top+12,"px"):"auto",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderBottom:"1.5px solid ".concat((null===(i=e.appearance)||void 0===i?void 0:i.borderColor)||"#c9c6c6"),borderRadius:"10px",zIndex:ea};Ql.dispatchEvent(new CustomEvent(Xl,{detail:{surveyId:e.id,position:f}}))};Fa(r,"click",s),r.setAttribute("PHWidgetSurveyClickListener","true"),n.widgetSelectorListeners.set(e.id,{element:r,listener:s}),Zl.info("Attached click listener for survey ".concat(e.id))}}else o&&n.removeWidgetSelectorListener(e.id)}})),M(this,"canRenderSurvey",(function(e){var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=Ur.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),M(this,"renderSurvey",(function(e,t){ss(kl(ic,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),M(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=n.posthog)||void 0===e||e.getActiveMatchingSurveys((function(e){var t=e.filter((function(e){return"api"!==e.type})),i=n.sortSurveysByAppearanceDelay(t),r=new Set;i.forEach((function(e){var t,i,o;e.type===Ur.Widget&&((null===(t=e.appearance)||void 0===t?void 0:t.widgetType)===Br.Tab?n.handleWidget(e):(null===(i=e.appearance)||void 0===i?void 0:i.widgetType)===Br.Selector&&null!==(o=e.appearance)&&void 0!==o&&o.widgetSelector&&(r.add(e.id),n.manageWidgetSelectorListener(e)));Hs(n.surveyInFocus)&&e.type===Ur.Popover&&n.canShowNextEventBasedSurvey()&&n.handlePopoverSurvey(e)})),n.widgetSelectorListeners.forEach((function(e,t){r.has(t)||n.removeWidgetSelectorListener(t)}))}),t)})),M(this,"addSurveyToFocus",(function(e){Hs(n.surveyInFocus)||Zl.error("Survey ".concat($(n.surveyInFocus)," already in focus. Cannot add survey ").concat(e,".")),n.surveyInFocus=e})),M(this,"removeSurveyFromFocus",(function(e){n.surveyInFocus!==e&&Zl.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),n.clearSurveyTimeout(e),n.surveyInFocus=null})),this.posthog=t,this.surveyInFocus=null}return L(e,[{key:"clearSurveyTimeout",value:function(e){var t=this.surveyTimeouts.get(e);t&&(clearTimeout(t),this.surveyTimeouts.delete(e))}},{key:"sortSurveysByAppearanceDelay",value:function(e){return e.sort((function(e,t){var n,i,r=e.schedule===Wr.Always,o=t.schedule===Wr.Always;return r&&!o?1:!r&&o?-1:((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=t.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)}))}},{key:"getTestAPI",value:function(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,surveyTimeouts:this.surveyTimeouts,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}]),e}();function tc(e){if(Yl&&Ql){var t=new ec(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((function(){t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function nc(e){var t=e.survey,n=e.removeSurveyFromFocus,i=e.setSurveyVisible,r=e.isPreviewMode,o=void 0!==r&&r;al((function(){var e;if(!o&&null!==(e=t.conditions)&&void 0!==e&&e.url){var r=function(){if(!Vu(t))return i(!1),n(t.id)};Fa(Ql,"popstate",r),Fa(Ql,"hashchange",r);var s=Ql.history.pushState,a=Ql.history.replaceState;return Ql.history.pushState=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];s.apply(this,t),r()},Ql.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a.apply(this,t),r()},function(){Ql.removeEventListener("popstate",r),Ql.removeEventListener("hashchange",r),Ql.history.pushState=s,Ql.history.replaceState=a}}}),[o,t,n,i])}function ic(e){var t,n,i,r,o,s,a=e.survey,u=e.forceDisableHtml,l=e.posthog,c=e.style,d=e.previewPageIndex,f=e.removeSurveyFromFocus,v=e.isPopup,h=e.onPreviewSubmit,p=void 0===h?function(){}:h,g=e.onPopupSurveyDismissed,_=void 0===g?function(){}:g,m=e.onCloseConfirmationMessage,y=void 0===m?function(){}:m,b=Number.isInteger(d),k=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,w=function(e,t,n,i,r){var o=q(sl(i||0===n),2),s=o[0],a=o[1],u=q(sl(!1),2),l=u[0],c=u[1];return al((function(){if(t){if(!i){var o=function(){r(e.id),a(!1)},s=function(){var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(c(!0),r(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((function(){a(!1)}),5e3)):(r(e.id),a(!1))},u=function(){var n;Vu(e)&&(a(!0),Ql.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()),setTimeout((function(){var t,n,i=null===(t=Yl.querySelector(Jl(e.id)))||void 0===t||null===(n=t.shadowRoot)||void 0===n?void 0:n.querySelector('textarea, input[type="text"]');i&&i.focus()}),100))};if(Fa(Ql,"PHSurveyClosed",o),Fa(Ql,"PHSurveySent",s),n>0){var l=setTimeout(u,n);return function(){clearTimeout(l),Ql.removeEventListener("PHSurveyClosed",o),Ql.removeEventListener("PHSurveySent",s)}}return u(),function(){Ql.removeEventListener("PHSurveyClosed",o),Ql.removeEventListener("PHSurveySent",s)}}}else Zl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),nc({survey:e,removeSurveyFromFocus:r,setSurveyVisible:a,isPreviewMode:i}),{isPopupVisible:s,isSurveySent:l,setIsPopupVisible:a}}(a,l,k,b,f),S=w.isPopupVisible,x=w.isSurveySent,E=w.setIsPopupVisible,C=x||d===a.questions.length,T=null!==(n=c)&&void 0!==n&&n.left&&Bs(null===(i=c)||void 0===i?void 0:i.left)?{left:c.left-40}:{};return b&&((c=c||{}).left="unset",c.right="unset",c.transform="unset"),S?kl(pa.Provider,{value:{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:function(){ua(a,l,b),_()},isPopup:v||!1,onPreviewSubmit:p},children:C?kl(Ml,{header:(null===(r=a.appearance)||void 0===r?void 0:r.thankYouMessageHeader)||"Thank you!",description:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||oa,styleOverrides:P(P({},c),T),onClose:function(){E(!1),y()}}):kl(rc,{survey:a,forceDisableHtml:!!u,posthog:l,styleOverrides:c})}):null}function rc(e){var t,n,i=e.survey,r=e.forceDisableHtml,o=e.posthog,s=e.styleOverrides,a=ra((null===(t=i.appearance)||void 0===t?void 0:t.backgroundColor)||oa.backgroundColor),u=q(sl({}),2),l=u[0],c=u[1],d=cl(pa),f=d.previewPageIndex,v=d.onPopupSurveyDismissed,h=d.isPopup,p=d.onPreviewSubmit,g=q(sl(f||0),2),_=g[0],m=g[1],y=ll((function(){return da(i)}),[i]);al((function(){m(null!=f?f:0)}),[f]);return kl("form",{className:"survey-form",style:h?P({color:a,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor},s):{},children:y.map((function(e,t){var n;return _===t&&kl("div",{className:"survey-box",style:h?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||oa.backgroundColor}:{},children:[h&&kl(Ll,{onClick:function(){v()}}),sc({question:e,forceDisableHtml:r,displayQuestionIndex:t,appearance:i.appearance||oa,onSubmit:function(n){return function(e){var t=e.res,n=e.displayQuestionIndex,r=e.questionId;if(o)if(r){var s=function(e){return"$survey_response_".concat(e)}(r);c(P(P({},l),{},M({},s,t)));var a=Kl(i,n,t);a===Vr.End?aa(P(P({},l),{},M({},s,t)),i,o):m(a)}else Zl.error("onNextButtonClick called without a questionId.");else Zl.error("onNextButtonClick called without a PostHog instance.")}({res:n,displayQuestionIndex:t,questionId:e.id})},onPreviewSubmit:p})]})}))})}function oc(e){var t,n,i,r,o,s=e.survey,a=e.forceDisableHtml,u=e.posthog,l=e.readOnly,c=e.removeSurveyFromFocus,d=q(sl(!0),2),f=d[0],v=d[1],h=q(sl(!1),2),p=h[0],g=h[1],_=q(sl({}),2),m=_[0],y=_[1],b=ul(null);if(al((function(){var e;if(u){if(!l){if("tab"===(null===(e=s.appearance)||void 0===e?void 0:e.widgetType)&&b.current){var t,n=b.current.getBoundingClientRect();y({top:"50%",left:parseInt("".concat(n.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(t=s.appearance)||void 0===t?void 0:t.borderColor)||"#c9c6c6")})}var i=function(e){var t,n=e;(null===(t=n.detail)||void 0===t?void 0:t.surveyId)===s.id&&(Zl.info("Received show event for survey ".concat(s.id)),y(n.detail.position||{}),g(!0))};return Fa(Ql,Xl,i),function(){Ql.removeEventListener(Xl,i)}}}else Zl.error("FeedbackWidget called without a PostHog instance.")}),[u,l,s.id,null===(t=s.appearance)||void 0===t?void 0:t.widgetType,null===(n=s.appearance)||void 0===n?void 0:n.widgetSelector,null===(i=s.appearance)||void 0===i?void 0:i.borderColor]),nc({survey:s,removeSurveyFromFocus:c,setSurveyVisible:v}),!f)return null;var k=function(){g(!1)};return kl(jo,{children:["tab"===(null===(r=s.appearance)||void 0===r?void 0:r.widgetType)&&kl("div",{className:"ph-survey-widget-tab",ref:b,onClick:function(){return!l&&g(!p)},style:{color:ra(s.appearance.widgetColor)},children:[kl("div",{className:"ph-survey-widget-tab-icon"}),(null===(o=s.appearance)||void 0===o?void 0:o.widgetLabel)||""]}),p&&kl(ic,{posthog:u,survey:s,forceDisableHtml:a,style:m,removeSurveyFromFocus:c,isPopup:!0,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k},"feedback-widget-survey")]})}var sc=function(e){var t,n,i=e.question,r=e.forceDisableHtml,o=e.displayQuestionIndex,s=e.appearance,a=e.onSubmit,u=e.onPreviewSubmit,l=(M(t={},zr.Open,ql),M(t,zr.Link,$l),M(t,zr.Rating,Dl),M(t,zr.SingleChoice,jl),M(t,zr.MultipleChoice,jl),t),c={question:i,forceDisableHtml:r,appearance:s,onPreviewSubmit:function(e){u(e)},onSubmit:function(e){a(e)}},d=(M(n={},zr.Open,{}),M(n,zr.Link,{}),M(n,zr.Rating,{displayQuestionIndex:o}),M(n,zr.SingleChoice,{displayQuestionIndex:o}),M(n,zr.MultipleChoice,{displayQuestionIndex:o}),n),f=l[i.type],v=P(P({},c),d[i.type]);return kl(f,P({},v))};function ac(e){return!$s(Event)&&uc(e,Event)}function uc(e,t){try{return e instanceof t}catch(e){return!1}}function lc(e){return Hs(e)||!As(e)&&!Ms(e)}function cc(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function dc(e){return cc(e,"DOMError")}ks.__PosthogExtensions__=ks.__PosthogExtensions__||{},ks.__PosthogExtensions__.canActivateRepeatedly=fa,ks.__PosthogExtensions__.generateSurveys=tc,ks.extendPostHogWithSurveys=tc;var fc=/\(error: (.*)\)/,vc=50,hc="?";function pc(e,t,n,i){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?hc:t,in_app:!0};return $s(n)||(r.lineno=n),$s(i)||(r.colno=i),r}var gc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_c=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mc=/\((\S*)(?::(\d+))(?::(\d+))\)/,yc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,bc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kc=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=e.split("\n"),o=t;o<r.length;o++){var s=r[o];if(!(s.length>1024)){var a=fc.test(s)?s.replace(fc,"$1"):s;if(!a.match(/\S*Error: /)){var u,l=H(i);try{for(l.s();!(u=l.n()).done;){var c=(0,u.value)(a);if(c){n.push(c);break}}}catch(e){l.e(e)}finally{l.f()}if(n.length>=vc)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,vc).map((function(e){return P(P({},e),{},{filename:e.filename||wc(t).filename,function:e.function||hc})}))}(n)}}.apply(void 0,[[30,function(e){var t=gc.exec(e);if(t){var n=q(t,4),i=n[1],r=n[2],o=n[3];return pc(i,hc,+r,+o)}var s=_c.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=mc.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var u=q(Cc(s[1]||hc,s[2]),2),l=u[0];return pc(u[1],l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}}],[50,function(e){var t=yc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=bc.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var i=t[3],r=t[1]||hc,o=q(Cc(r,i),2);return r=o[0],pc(i=o[1],r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function wc(e){return e[e.length-1]||{}}var Sc,xc,Ec,Cc=function(e,t){var n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:hc,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]};var Pc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Tc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.stacktrace||e.stack||"",i=function(e){if(e&&Ic.test(e.message))return 1;return 0}(e);try{var r=kc,o=function(e,t){var n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var n=Object.keys(t);return Ec&&n.length===xc||(xc=n.length,Ec=n.reduce((function(n,i){Sc||(Sc={});var r=Sc[i];if(r)n[r[0]]=r[1];else for(var o=e(i),s=o.length-1;s>=0;s--){var a=o[s],u=null==a?void 0:a.filename,l=t[i];if(u&&l){n[u]=l,Sc[i]=[u,l];break}}return n}),{})),Ec}(t);return e.forEach((function(e){e.filename&&(e.chunk_id=n[e.filename])})),e}(r(n,i),r);return o.slice(0,o.length-t)}catch(e){}return[]}var Ic=/Minified React error #\d+;/i;function Fc(e,t){var n,i,r=Tc(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(i=null==t?void 0:t.synthetic)&&void 0!==i&&i;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return String(t.error.message);return String(t)}(e),stacktrace:{frames:r,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function Rc(e,t){var n,i,r,o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var u=Tc(t.syntheticException,1);u.length&&(a.stacktrace={frames:u,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Oc(e){return Ds(e)&&!Ns(e)&&Es.indexOf(e)>=0}function Lc(e,t){var n,i,r=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:ac(e)?e.constructor.name:"Error",a="Non-Error 'exception' captured with keys: ".concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>t))return i===n.length||r.length<=t?r:"".concat(r.slice(0,t),"...")}return""}(e)),u={type:s,value:a,mechanism:{handled:r,synthetic:o}};if(null!=t&&t.syntheticException){var l=Tc(null==t?void 0:t.syntheticException,1);l.length&&(u.stacktrace={frames:l,type:"raw"})}return{$exception_list:[u],$exception_level:Oc(e.level)?e.level:"error"}}function Mc(e,t){var n=e.error,i=e.event,r={$exception_list:[]},o=n||i;if(dc(o)||function(e){return cc(e,"DOMException")}(o)){var s=o;if(function(e){return"stack"in e}(o))r=Fc(o,t);else{var a=s.name||(dc(s)?"DOMError":"DOMException"),u=s.message?"".concat(a,": ").concat(s.message):a,l=dc(s)?"DOMError":"DOMException";r=Rc(u,P(P({},t),{},{overrideExceptionType:l,defaultExceptionMessage:u}))}return"code"in s&&(r.$exception_DOMException_code="".concat(s.code)),r}if(function(e){return cc(e,"ErrorEvent")}(o)&&o.error)return Fc(o.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return uc(e,Error)}}(o))return Fc(o,t);if(function(e){return cc(e,"Object")}(o)||ac(o))return Lc(o,t);if($s(n)&&Ds(i)){var c="Error",d=i,f=i.match(Pc);return f&&(c=f[1],d=f[2]),Rc(d,P(P({},t),{},{overrideExceptionType:c,defaultExceptionMessage:d}))}return Rc(o,t)}function Ac(e){var t=function(e){if(lc(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(q(e,1)[0]);return lc(t)?Rc("Non-Error promise rejection captured with value: ".concat(String(t)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Mc({event:t},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(t)})}var qc=Gs("[ExceptionAutocapture]"),$c={wrapOnError:function(e){var t=ls;t||qc.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var s=Mc({event:r[0],error:r[4]});return e(s),null!==(t=null==n?void 0:n.apply(void 0,r))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:function(e){var t=ls;t||qc.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var i,r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=Ac(o);return e(a),null!==(i=null==n?void 0:n.apply(t,o))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}},wrapConsoleError:function(e){var t=console;t||qc.info("console not available, cannot wrap console.error");var n=t.error;return t.error=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=i.join(" "),s=i.find((function(e){return e instanceof Error})),a=s?Mc({event:o,error:s}):Mc({event:o},{syntheticException:new Error("PostHog syntheticException")});return e(a),null==n?void 0:n.apply(void 0,i)},t.error.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.error)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.error=n}}};function Dc(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);return Ms(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,function(){e[t]=i}}catch(e){return function(){}}}ks.__PosthogExtensions__=ks.__PosthogExtensions__||{},ks.__PosthogExtensions__.errorWrappingFunctions=$c,ks.posthogErrorWrappingFunctions=$c;var Nc=function(e,t){if(e){var n=e.checkAndGetSessionAndWindowId(!0),i=n.sessionId,r=n.windowId;t.headers.set("X-POSTHOG-SESSION-ID",i),t.headers.set("X-POSTHOG-WINDOW-ID",r)}};ks.__PosthogExtensions__=ks.__PosthogExtensions__||{};var Hc={_patchFetch:function(e){return Dc(ls,"fetch",(function(t){return function(){var n,i=(n=T().mark((function n(i,r){var o;return T().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=new Request(i,r),Nc(e,o),n.abrupt("return",t(o));case 3:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(i,r){var o=n.apply(e,t);function s(e){F(o,i,r,s,a,"next",e)}function a(e){F(o,i,r,s,a,"throw",e)}s(void 0)}))});return function(e,t){return i.apply(this,arguments)}}()}))},_patchXHR:function(e){return Dc(ls.XMLHttpRequest.prototype,"open",(function(t){return function(n,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(i);return Nc(e,a),t.call(this,n,a.url,r,o,s)}}))}};function jc(e){var t;return e instanceof Element&&(e.id===Fo||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container")))}function Bc(e){return!!e&&1===e.nodeType}function Uc(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function zc(e){return!!e&&3===e.nodeType}function Vc(e){return!!e&&11===e.nodeType}function Wc(e){return e?Ps(e).split(/\s+/):[]}function Gc(e){var t=null==ls?void 0:ls.location.href;return!!(t&&e&&e.some((function(e){return t.match(e)})))}function Zc(e){var t="";switch(I(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 Wc(t)}function Qc(e){return js(e)?null:Ps(e).split(/(\s+)/).filter((function(e){return ld(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Yc(e){var t="";return td(e)&&!nd(e)&&e.childNodes&&e.childNodes.length&&ya(e.childNodes,(function(e){var n;zc(e)&&e.textContent&&(t+=null!==(n=Qc(e.textContent))&&void 0!==n?n:"")})),Ps(t)}function Jc(e){return $s(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}ks.__PosthogExtensions__.tracingHeadersPatchFns=Hc,ks.postHogTracingHeadersPatchFns=Hc;var Xc=["a","button","form","input","select","textarea","label"];function Kc(e){var t=e.parentNode;return!(!t||!Bc(t))&&t}function ed(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!ls||!e||Uc(e,"html")||!Bc(e))return!1;if(null!=n&&n.url_allowlist&&!Gc(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&Gc(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}for(var s=!1,a=[e],u=!0,l=e;l.parentNode&&!Uc(l,"body");)if(Vc(l.parentNode))a.push(l.parentNode.host),l=l.parentNode.host;else{if(!(u=Kc(l)))break;if(i||Xc.indexOf(u.tagName.toLowerCase())>-1)s=!0;else{var c=ls.getComputedStyle(u);c&&"pointer"===c.getPropertyValue("cursor")&&(s=!0)}a.push(u),l=u}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if($s(n))return!0;var i,r=H(e);try{var o=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(r.s();!(i=r.n()).done;){var s=o();if("object"===I(s))return s.v}}catch(e){r.e(e)}finally{r.f()}return!1}(a,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if($s(n))return!0;var i,r=H(e);try{var o=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(r.s();!(i=r.n()).done;){var s=o();if("object"===I(s))return s.v}}catch(e){r.e(e)}finally{r.f()}return!1}(a,n))return!1;var d=ls.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return s?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(Xc.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}function td(e){for(var t=e;t.parentNode&&!Uc(t,"body");t=t.parentNode){var n=Zc(t);if(Cs(n,"ph-sensitive")||Cs(n,"ph-no-capture"))return!1}if(Cs(Zc(e),"ph-include"))return!0;var i=e.type||"";if(Ds(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";if(Ds(r)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function nd(e){return!!(Uc(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Uc(e,"select")||Uc(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var id="(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})",rd=new RegExp("^(?:".concat(id,")$")),od=new RegExp(id),sd="\\d{3}-?\\d{2}-?\\d{4}",ad=new RegExp("^(".concat(sd,")$")),ud=new RegExp("(".concat(sd,")"));function ld(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(js(e))return!1;if(Ds(e)){if(e=Ps(e),(t?rd:od).test((e||"").replace(/[- ]/g,"")))return!1;if((t?ad:ud).test(e))return!1}return!0}function cd(e){var t=Yc(e);return ld(t="".concat(t," ").concat(dd(e)).trim())?t:""}function dd(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ya(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var i=Yc(e);t="".concat(t," ").concat(i).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(dd(e)).trim())}catch(e){Ws.error("[AutoCapture]",e)}})),t}function fd(e){return function(e){var t=e.map((function(e){var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var r,o=H(e.attr_class);try{for(o.s();!(r=o.n()).done;){var s=r.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){o.e(e)}finally{o.f()}}var a=P(P(P(P({},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),u={};return wa(a).sort((function(e,t){var n=q(e,1)[0],i=q(t,1)[0];return n.localeCompare(i)})).forEach((function(e){var t=q(e,2),n=t[0],i=t[1];return u[vd(n.toString())]=vd(i.toString())})),i+=":",i+=wa(a).map((function(e){var t=q(e,2),n=t[0],i=t[1];return"".concat(n,'="').concat(i,'"')})).join("")}));return t.join(";")}(function(e){return e.map((function(e){var t,n,i={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:hd(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return wa(e).filter((function(e){return 0===q(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=q(e,2),n=t[0],r=t[1];return i.attributes[n]=r})),i}))}(e))}function vd(e){return e.replace(/"|\\"/g,'\\"')}function hd(e){var t=e.attr__class;return t?Ls(t)?t:Wc(t):void 0}var pd=function(){function e(){R(this,e),this.clicks=[]}return L(e,[{key:"isRageClick",value:function(e,t,n){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),gd=Gs("[AutoCapture]");function _d(e,t){return t.length>e?t.slice(0,e)+"...":t}function md(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bc(t));return t}function yd(e,t,n,i){var r=e.tagName.toLowerCase(),o={tag_name:r};Xc.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?o.$el_text=_d(1024,cd(e)):o.$el_text=_d(1024,Yc(e)));var s=Zc(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),ya(e.attributes,(function(n){var r;if((!nd(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==i||!i.includes(n.name))&&!t&&ld(n.value)&&(r=n.name,!Ds(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var s=n.value;"class"===n.name&&(s=Wc(s).join(" ")),o["attr__"+n.name]=_d(1024,s)}}));for(var a=1,u=1,l=e;l=md(l);)a++,l.tagName===e.tagName&&u++;return o.nth_child=a,o.nth_of_type=u,o}function bd(e,t){for(var n,i,r=t.e,o=t.maskAllElementAttributes,s=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString,l=[e],c=e;c.parentNode&&!Uc(c,"body");)Vc(c.parentNode)?(l.push(c.parentNode.host),c=c.parentNode.host):(l.push(c.parentNode),c=c.parentNode);var d,f=[],v={},h=!1,p=!1;if(ya(l,(function(e){var t=td(e);"a"===e.tagName.toLowerCase()&&(h=e.getAttribute("href"),h=t&&h&&ld(h)&&h),Cs(Zc(e),"ph-no-capture")&&(p=!0),f.push(yd(e,o,s,a));var n=function(e){if(!td(e))return{};var t={};return ya(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&ld(i)&&(t[n]=i)}})),t}(e);ba(v,n)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?f[0].$el_text=cd(e):f[0].$el_text=Yc(e)),h){var g,_;f[0].attr__href=h;var m=null===(g=La(h))||void 0===g?void 0:g.host,y=null==ls||null===(_=ls.location)||void 0===_?void 0:_.host;m&&y&&m!==y&&(d=h)}return{props:ba({$event_type:r.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:fd(f)},null!==(n=f[0])&&void 0!==n&&n.$el_text?{$el_text:null===(i=f[0])||void 0===i?void 0:i.$el_text}:{},d&&"click"===r.type?{$external_click_url:d}:{},v)}}var kd=function(){function e(t){R(this,e),M(this,"_initialized",!1),M(this,"_isDisabledServerSide",null),M(this,"rageclicks",new pd),M(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}return L(e,[{key:"config",get:function(){var e,t,n=As(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((function(e){return new RegExp(e)})),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((function(e){return new RegExp(e)})),n}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(ls&&ps){var t=function(t){t=t||(null==ls?void 0:ls.event);try{e._captureEvent(t)}catch(e){gd.error("Failed to capture event",e)}};if(Fa(ps,"submit",t,{capture:!0}),Fa(ps,"change",t,{capture:!0}),Fa(ps,"click",t,{capture:!0}),this.config.capture_copied_text){var n=function(t){t=t||(null==ls?void 0:ls.event),e._captureEvent(t,Ss)};Fa(ps,"copy",n,{capture:!0}),Fa(ps,"cut",n,{capture:!0})}}}else gd.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"onRemoteConfig",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(M({},Yr,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"setElementSelectors",value:function(e){this._elementSelectors=e}},{key:"getElementSelectors",value:function(e){var t,n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((function(t){var i=null==ps?void 0:ps.querySelectorAll(t);null==i||i.forEach((function(i){e===i&&n.push(t)}))})),n}},{key:"isEnabled",get:function(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[Yr],i=this._isDisabledServerSide;if(Hs(i)&&!Us(n)&&!this.instance.config.advanced_disable_decide)return!1;var r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}},{key:"_captureEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var n,i=Jc(e);if(zc(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var r=t===Ss;if(i&&ed(i,e,this.config,r,r?["copy","cut"]:void 0)){var o=bd(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString}),s=o.props;if(o.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===Ss){var u,l=Qc(null==ls||null===(u=ls.getSelection())||void 0===u?void 0:u.toString()),c=e.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=c}return this.instance.capture(t,s),!0}}}},{key:"isBrowserSupported",value:function(){return Ms(null==ps?void 0:ps.querySelectorAll)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Bs(e)&&isFinite(e)&&Math.floor(e)===e});var wd="0123456789abcdef",Sd=function(){function e(t){if(R(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return L(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+wd.charAt(this.bytes[t]>>>4)+wd.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,i,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||t<0||n<0||i<0||r<0||t>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new e(o)}}]),e}(),xd=function(){function e(){R(this,e),M(this,"timestamp",0),M(this,"counter",0),M(this,"random",new Pd)}return L(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if($s(e)){this.timestamp=0;var t=this.generateOrAbort();if($s(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Sd.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),Ed=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ls&&!$s(ls.crypto)&&crypto.getRandomValues&&(Ed=function(e){return crypto.getRandomValues(e)});var Cd,Pd=function(){function e(){R(this,e),M(this,"buffer",new Uint32Array(8)),M(this,"cursor",1/0)}return L(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Ed(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),Td=function(){return Id().toString()},Id=function(){return(Cd||(Cd=new xd)).generate()},Fd="Thu, 01 Jan 1970 00:00:00 GMT",Rd="";var Od=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ld(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ps;if(Rd)return Rd;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),i=Math.min(n.length,8),r="dmn_chk_"+Td(),o=new RegExp("(^|;)\\s*"+r+"=1");!Rd&&i--;){var s=n.slice(i).join("."),a=r+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+Fd,Rd=s)}return Rd}(e);if(!n){var i=function(e){var t=e.match(Od);return t?t[0]:""}(e);i!==n&&Ws.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var Md,Ad={is_supported:function(){return!!ps},error:function(e){Ws.error("cookieStore error: "+e)},get:function(e){if(ps){try{for(var t=e+"=",n=ps.cookie.split(";").filter((function(e){return e.length})),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(Ad.get(e))||{}}catch(e){}return t},set:function(e,t,n,i,r){if(ps)try{var o="",s="",a=Ld(ps.location.hostname,i);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}r&&(s="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&Ws.warn("cookieStore warning: large cookie, len="+l.length),ps.cookie=l,l}catch(e){return}},remove:function(e,t){try{Ad.set(e,"",-1,t)}catch(e){return}}},qd=null,$d={is_supported:function(){if(!Hs(qd))return qd;var e=!0;if($s(ls))e=!1;else try{var t="__mplssupport__";$d.set(t,"xyz"),'"xyz"'!==$d.get(t)&&(e=!1),$d.remove(t)}catch(t){e=!1}return e||Ws.error("localStorage unsupported; falling back to cookie store"),qd=e,e},error:function(e){Ws.error("localStorage error: "+e)},get:function(e){try{return null==ls?void 0:ls.localStorage.getItem(e)}catch(e){$d.error(e)}return null},parse:function(e){try{return JSON.parse($d.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==ls||ls.localStorage.setItem(e,JSON.stringify(t))}catch(e){$d.error(e)}},remove:function(e){try{null==ls||ls.localStorage.removeItem(e)}catch(e){$d.error(e)}}},Dd=["distinct_id",co,fo,Io,To],Nd=P(P({},$d),{},{parse:function(e){try{var t={};try{t=Ad.parse(e)||{}}catch(e){}var n=ba(t,JSON.parse($d.get(e)||"{}"));return $d.set(e,n),n}catch(e){}return null},set:function(e,t,n,i,r,o){try{$d.set(e,t,void 0,void 0,o);var s={};Dd.forEach((function(e){t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Ad.set(e,s,n,i,r,o)}catch(e){$d.error(e)}},remove:function(e,t){try{null==ls||ls.localStorage.removeItem(e),Ad.remove(e,t)}catch(e){$d.error(e)}}}),Hd={},jd={is_supported:function(){return!0},error:function(e){Ws.error("memoryStorage error: "+e)},get:function(e){return Hd[e]||null},parse:function(e){return Hd[e]||null},set:function(e,t){Hd[e]=t},remove:function(e){delete Hd[e]}},Bd=null,Ud={is_supported:function(){if(!Hs(Bd))return Bd;if(Bd=!0,$s(ls))Bd=!1;else try{var e="__support__";Ud.set(e,"xyz"),'"xyz"'!==Ud.get(e)&&(Bd=!1),Ud.remove(e)}catch(e){Bd=!1}return Bd},error:function(e){Ws.error("sessionStorage error: ",e)},get:function(e){try{return null==ls?void 0:ls.sessionStorage.getItem(e)}catch(e){Ud.error(e)}return null},parse:function(e){try{return JSON.parse(Ud.get(e))||null}catch(e){}return null},set:function(e,t){try{null==ls||ls.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Ud.error(e)}},remove:function(e){try{null==ls||ls.sessionStorage.removeItem(e)}catch(e){Ud.error(e)}}};!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(Md||(Md={}));var zd=function(){function e(t){R(this,e),this.instance=t}return L(e,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Md.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Md.DENIED||this.consent===Md.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return"1"===e?Md.GRANTED:"0"===e?Md.DENIED:Md.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?$d:Ad;var t="localStorage"===e?Ad:$d;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!Ia([null==hs?void 0:hs.doNotTrack,null==hs?void 0:hs.msDoNotTrack,ks.doNotTrack],(function(e){return Cs([!0,1,"1","yes"],e)}))}}]),e}(),Vd=Gs("[Dead Clicks]"),Wd=function(){return!0},Gd=function(e){var t,n=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(eo)),i=e.instance.config.capture_dead_clicks;return Us(i)?i:n},Zd=function(){function e(t,n,i){R(this,e),this.instance=t,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}return L(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}},{key:"onRemoteConfig",value:function(e){this.instance.persistence&&this.instance.persistence.register(M({},eo,null==e?void 0:e.captureDeadClicks)),this.startIfEnabled()}},{key:"startIfEnabled",value:function(){var e=this;this.isEnabled(this)&&this.loadScript((function(){e.start()}))}},{key:"loadScript",value:function(e){var t,n,i;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.initDeadClicksAutocapture&&e(),null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"dead-clicks-autocapture",(function(t){t?Vd.error("failed to load script",t):e()}))}},{key:"start",value:function(){var e;if(ps){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=ks.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=As(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=ks.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(ps),Vd.info("starting...")}}else Vd.error("`document` not found. Cannot start.")}},{key:"stop",value:function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Vd.info("stopping..."))}}]),e}(),Qd=Gs("[ExceptionAutocapture]"),Yd=function(){function e(t){var n,i=this;R(this,e),M(this,"startCapturing",(function(){var e;if(ls&&i.isEnabled&&null!==(e=ks.__PosthogExtensions__)&&void 0!==e&&e.errorWrappingFunctions){var t=ks.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=ks.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=ks.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!i.unwrapOnError&&i.config.capture_unhandled_errors&&(i.unwrapOnError=t(i.captureException.bind(i))),!i.unwrapUnhandledRejection&&i.config.capture_unhandled_rejections&&(i.unwrapUnhandledRejection=n(i.captureException.bind(i))),!i.unwrapConsoleError&&i.config.capture_console_errors&&(i.unwrapConsoleError=r(i.captureException.bind(i)))}catch(e){Qd.error("failed to start",e),i.stopCapturing()}}})),this.instance=t,this.remoteEnabled=!(null===(n=this.instance.persistence)||void 0===n||!n.props[Xr]),this.config=this.requiredConfig(),this.startIfEnabled()}return L(e,[{key:"requiredConfig",value:function(){var e=this.instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return As(e)?t=P(P({},t),e):($s(e)?this.remoteEnabled:e)&&(t=P(P({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}},{key:"isEnabled",get:function(){return this.config.capture_console_errors||this.config.capture_unhandled_errors||this.config.capture_unhandled_rejections}},{key:"startIfEnabled",value:function(){this.isEnabled&&(Qd.info("enabled"),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){var t,n,i;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.errorWrappingFunctions&&e(),null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"exception-autocapture",(function(t){if(t)return Qd.error("failed to load script",t);e()}))}},{key:"stopCapturing",value:function(){var e,t,n;null===(e=this.unwrapOnError)||void 0===e||e.call(this),this.unwrapOnError=void 0,null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this),this.unwrapUnhandledRejection=void 0,null===(n=this.unwrapConsoleError)||void 0===n||n.call(this),this.unwrapConsoleError=void 0}},{key:"onRemoteConfig",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.config=this.requiredConfig(),this.instance.persistence&&this.instance.persistence.register(M({},Xr,this.remoteEnabled)),this.startIfEnabled()}},{key:"captureException",value:function(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}}]),e}();function Jd(e){var t,n;return(null===(t=JSON.stringify(e,(n=[],function(e,t){if(As(t)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}return t})))||void 0===t?void 0:t.length)||0}function Xd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),i=e.data.slice(0,n),r=e.data.slice(n);return[Xd({size:Jd(i),data:i,sessionId:e.sessionId,windowId:e.windowId}),Xd({size:Jd(r),data:r,sessionId:e.sessionId,windowId:e.windowId})].flatMap((function(e){return e}))}return[e]}var Kd=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Kd||{}),ef=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(ef||{}),tf="[SessionRecording]",nf="redacted",rf={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},of=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],sf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],af=["/s/","/e/","/i/"];function uf(e,t,n,i){if(js(e))return e;var r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Ds(r)&&(r=parseInt(r)),r>n?tf+" ".concat(i," body too large to record (").concat(r," bytes)"):e}function lf(e,t){if(js(e))return e;var n=e;return ld(n,!1)||(n=tf+" "+t+" body "+nf),ya(sf,(function(e){var i,r;null!==(i=n)&&void 0!==i&&i.length&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(e))&&(n=tf+" "+t+" body "+nf+" as might contain: "+e)})),n}var cf=function(e,t){var n,i,r,o={payloadSizeLimitBytes:rf.payloadSizeLimitBytes,performanceEntryTypeToObserve:$(rf.performanceEntryTypeToObserve),payloadHostDenyList:[].concat($(t.payloadHostDenyList||[]),$(rf.payloadHostDenyList))},s=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,u=!1!==e.capture_performance&&t.recordPerformance,l=(n=o,r=Math.min(1e6,null!==(i=n.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=uf(e.requestBody,e.requestHeaders,r,"Request")),null!=e&&e.responseBody&&(e.responseBody=uf(e.responseBody,e.responseHeaders,r,"Response")),e}),c=function(t){return l(function(e,t){var n,i=La(e.name),r=0===t.indexOf("http")?null===(n=La(t))||void 0===n?void 0:n.pathname:t;"/"===r&&(r="");var o=null==i?void 0:i.pathname.replace(r||"","");if(!(i&&o&&af.some((function(e){return 0===o.indexOf(e)}))))return e}((i=(n=t).requestHeaders,js(i)||ya(Object.keys(null!=i?i:{}),(function(e){of.includes(e.toLowerCase())&&(i[e]=nf)})),n),e.api_host));var n,i},d=Ms(e.session_recording.maskNetworkRequestFn);return d&&Ms(e.session_recording.maskCapturedNetworkRequestFn)&&Ws.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var n=e.session_recording.maskNetworkRequestFn({url:t.name});return P(P({},t),{},{name:null==n?void 0:n.url})}),o.maskRequestFn=Ms(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,i,r,o=c(t);return o&&null!==(n=null===(i=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===i?void 0:i.call(r,o))&&void 0!==n?n:void 0}:function(e){return function(e){if(!$s(e))return e.requestBody=lf(e.requestBody,"Request"),e.responseBody=lf(e.responseBody,"Response"),e}(c(e))},P(P(P({},rf),o),{},{recordHeaders:s,recordBody:a,recordPerformance:u,recordInitialRequests:u})};function df(e,t,n,i,r){return t>n&&(Ws.warn("min cannot be greater than max."),t=n),Bs(e)?e>n?(i&&Ws.warn(i+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(i&&Ws.warn(i+" cannot be less than min: "+t+". Using min value instead."),t):e:(i&&Ws.warn(i+" must be a number. using max or fallback. max: "+n+", fallback: "+r),df(r||n,t,n,i))}var ff=L((function e(t){var n,i,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,e),M(this,"bucketSize",100),M(this,"refillRate",10),M(this,"mutationBuckets",{}),M(this,"loggedTracker",{}),M(this,"refillBuckets",(function(){Object.keys(r.mutationBuckets).forEach((function(e){r.mutationBuckets[e]=r.mutationBuckets[e]+r.refillRate,r.mutationBuckets[e]>=r.bucketSize&&delete r.mutationBuckets[e]}))})),M(this,"getNodeOrRelevantParent",(function(e){var t=r.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[r.rrweb.mirror.getId(n),n]}return[e,t]})),M(this,"numberOfChanges",(function(e){var t,n,i,r,o,s,a,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(i=null===(r=e.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==a?a:0)})),M(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=r.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,i,o=q(r.getNodeOrRelevantParent(e.id),2),s=o[0],a=o[1];if(0===r.mutationBuckets[s])return!1;(r.mutationBuckets[s]=null!==(t=r.mutationBuckets[s])&&void 0!==t?t:r.bucketSize,r.mutationBuckets[s]=Math.max(r.mutationBuckets[s]-1,0),0===r.mutationBuckets[s])&&(r.loggedTracker[s]||(r.loggedTracker[s]=!0,null===(n=(i=r.options).onBlockedNode)||void 0===n||n.call(i,s,a)));return e})));var i=r.numberOfChanges(t);return 0!==i||n===i?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=df(null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=df(null!==(i=this.options.bucketSize)&&void 0!==i?i:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((function(){r.refillBuckets()}),1e3)})),vf=Uint8Array,hf=Uint16Array,pf=Uint32Array,gf=new vf([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]),_f=new vf([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]),mf=new vf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yf=function(e,t){for(var n=new hf(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var r=new pf(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},bf=yf(gf,2),kf=bf[0],wf=bf[1];kf[28]=258,wf[258]=28;for(var Sf=yf(_f,0)[1],xf=new hf(32768),Ef=0;Ef<32768;++Ef){var Cf=(43690&Ef)>>>1|(21845&Ef)<<1;Cf=(61680&(Cf=(52428&Cf)>>>2|(13107&Cf)<<2))>>>4|(3855&Cf)<<4,xf[Ef]=((65280&Cf)>>>8|(255&Cf)<<8)>>>1}var Pf=function(e,t,n){for(var i=e.length,r=0,o=new hf(t);r<i;++r)++o[e[r]-1];var s,a=new hf(t);for(r=0;r<t;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new hf(1<<t);var u=15-t;for(r=0;r<i;++r)if(e[r])for(var l=r<<4|e[r],c=t-e[r],d=a[e[r]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)s[xf[d]>>>u]=l}else for(s=new hf(i),r=0;r<i;++r)s[r]=xf[a[e[r]-1]++]>>>15-e[r];return s},Tf=new vf(288);for(Ef=0;Ef<144;++Ef)Tf[Ef]=8;for(Ef=144;Ef<256;++Ef)Tf[Ef]=9;for(Ef=256;Ef<280;++Ef)Tf[Ef]=7;for(Ef=280;Ef<288;++Ef)Tf[Ef]=8;var If=new vf(32);for(Ef=0;Ef<32;++Ef)If[Ef]=5;var Ff=Pf(Tf,9,0),Rf=Pf(If,5,0),Of=function(e){return(e/8>>0)+(7&e&&1)},Lf=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof hf?hf:e instanceof pf?pf:vf)(n-t);return i.set(e.subarray(t,n)),i},Mf=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8},Af=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},qf=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,o=n.slice();if(!r)return[new vf(0),0];if(1==r){var s=new vf(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=r-1;)a=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(i=1;i<r;++i)o[i].s>f&&(f=o[i].s);var v=new hf(f+1),h=$f(n[c-1],v,0);if(h>t){i=0;var p=0,g=h-t,_=1<<g;for(o.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));i<r;++i){var m=o[i].s;if(!(v[m]>t))break;p+=_-(1<<h-v[m]),v[m]=t}for(p>>>=g;p>0;){var y=o[i].s;v[y]<t?p-=1<<t-v[y]++-1:++i}for(;i>=0&&p;--i){var b=o[i].s;v[b]==t&&(--v[b],++p)}h=t}return[new vf(v),h]},$f=function e(t,n,i){return-1==t.s?Math.max(e(t.l,n,i+1),e(t.r,n,i+1)):n[t.s]=i},Df=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new hf(++t),i=0,r=e[0],o=1,s=function(e){n[i++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=e[a]}return[n.subarray(0,i),t]},Nf=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},Hf=function(e,t,n){var i=n.length,r=Of(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var o=0;o<i;++o)e[r+o+4]=n[o];return 8*(r+4+i)},jf=function(e,t,n,i,r,o,s,a,u,l,c){Mf(t,c++,n),++r[256];for(var d=qf(r,15),f=d[0],v=d[1],h=qf(o,15),p=h[0],g=h[1],_=Df(f),m=_[0],y=_[1],b=Df(p),k=b[0],w=b[1],S=new hf(19),x=0;x<m.length;++x)S[31&m[x]]++;for(x=0;x<k.length;++x)S[31&k[x]]++;for(var E=qf(S,7),C=E[0],P=E[1],T=19;T>4&&!C[mf[T-1]];--T);var I,F,R,O,L=l+5<<3,M=Nf(r,Tf)+Nf(o,If)+s,A=Nf(r,f)+Nf(o,p)+s+14+3*T+Nf(S,C)+(2*S[16]+3*S[17]+7*S[18]);if(L<=M&&L<=A)return Hf(t,c,e.subarray(u,u+l));if(Mf(t,c,1+(A<M)),c+=2,A<M){I=Pf(f,v,0),F=f,R=Pf(p,g,0),O=p;var q=Pf(C,P,0);Mf(t,c,y-257),Mf(t,c+5,w-1),Mf(t,c+10,T-4),c+=14;for(x=0;x<T;++x)Mf(t,c+3*x,C[mf[x]]);c+=3*T;for(var $=[m,k],D=0;D<2;++D){var N=$[D];for(x=0;x<N.length;++x){var H=31&N[x];Mf(t,c,q[H]),c+=C[H],H>15&&(Mf(t,c,N[x]>>>5&127),c+=N[x]>>>12)}}}else I=Ff,F=Tf,R=Rf,O=If;for(x=0;x<a;++x)if(i[x]>255){H=i[x]>>>18&31;Af(t,c,I[H+257]),c+=F[H+257],H>7&&(Mf(t,c,i[x]>>>23&31),c+=gf[H]);var j=31&i[x];Af(t,c,R[j]),c+=O[j],j>3&&(Af(t,c,i[x]>>>5&8191),c+=_f[j])}else Af(t,c,I[i[x]]),c+=F[i[x]];return Af(t,c,I[256]),c+F[256]},Bf=new pf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Uf=function(){for(var e=new pf(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),zf=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;i<t.length;++i)n=Uf[255&n^t[i]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Vf=function(e,t,n,i,r){return function(e,t,n,i,r,o){var s=e.length,a=new vf(i+s+5*(1+Math.floor(s/7e3))+r),u=a.subarray(i,a.length-r),l=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var d=c+65535;d<s?l=Hf(u,l,e.subarray(c,d)):(u[c]=o,l=Hf(u,l,e.subarray(c,s)))}else{for(var f=Bf[t-1],v=f>>>13,h=8191&f,p=(1<<n)-1,g=new hf(32768),_=new hf(p+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&p},k=new pf(25e3),w=new hf(288),S=new hf(32),x=0,E=0,C=(c=0,0),P=0,T=0;c<s;++c){var I=b(c),F=32767&c,R=_[I];if(g[F]=R,_[I]=F,P<=c){var O=s-c;if((x>7e3||C>24576)&&O>423){l=jf(e,u,0,k,w,S,E,C,T,c-T,l),C=x=E=0,T=c;for(var L=0;L<286;++L)w[L]=0;for(L=0;L<30;++L)S[L]=0}var M=2,A=0,q=h,$=F-R&32767;if(O>2&&I==b(c-$))for(var D=Math.min(v,O)-1,N=Math.min(32767,c),H=Math.min(258,O);$<=N&&--q&&F!=R;){if(e[c+M]==e[c+M-$]){for(var j=0;j<H&&e[c+j]==e[c+j-$];++j);if(j>M){if(M=j,A=$,j>D)break;var B=Math.min($,j-2),U=0;for(L=0;L<B;++L){var z=c-$+L+32768&32767,V=z-g[z]+32768&32767;V>U&&(U=V,R=z)}}}$+=(F=R)-(R=g[F])+32768&32767}if(A){k[C++]=268435456|wf[M]<<18|Sf[A];var W=31&wf[M],G=31&Sf[A];E+=gf[W]+_f[G],++w[257+W],++S[G],P=c+M,++x}else k[C++]=e[c],++w[e[c]]}}l=jf(e,u,o,k,w,S,E,C,T,c-T,l)}return Lf(a,0,i+Of(l)+r)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,i,!r)},Wf=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Gf=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Wf(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}},Zf=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Qf(e,t){void 0===t&&(t={});var n=zf(),i=e.length;n.p(e);var r=Vf(e,t,Zf(t),8),o=r.length;return Gf(r,t),Wf(r,o-8,n.d()),Wf(r,o-4,i),r}function Yf(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new vf(e.length+(e.length>>>1)),r=0,o=function(e){i[r++]=e},s=0;s<n;++s){if(r+5>i.length){var a=new vf(r+8+(n-s<<1));a.set(i),i=a}var u=e.charCodeAt(s);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Lf(i,0,r)}function Jf(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%100<df(100*t,0,100)}var Xf="[SessionRecording]",Kf=Gs(Xf);function ev(){var e,t;return null==ks||null===(e=ks.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}var tv=3e5,nv=[ef.MouseMove,ef.MouseInteraction,ef.Scroll,ef.ViewportResize,ef.Input,ef.TouchMove,ef.MediaInteraction,ef.Drag],iv=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}};function rv(e){return function(e,t){for(var n="",i=0;i<e.length;){var r=e[i++];r<128||t?n+=String.fromCharCode(r):r<224?n+=String.fromCharCode((31&r)<<6|63&e[i++]):r<240?n+=String.fromCharCode((15&r)<<12|(63&e[i++])<<6|63&e[i++]):(r=((15&r)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}(Qf(Yf(JSON.stringify(e))),!0)}function ov(e){return e.type===Kd.Custom&&"sessionIdle"===e.data.tag}function sv(e,t){return t.some((function(t){return"regex"===t.matching&&new RegExp(t.url).test(e)}))}var av=function(){function e(t){var n=this;if(R(this,e),M(this,"queuedRRWebEvents",[]),M(this,"isIdle","unknown"),M(this,"_linkedFlagSeen",!1),M(this,"_lastActivityTimestamp",Date.now()),M(this,"_linkedFlag",null),M(this,"_removePageViewCaptureHook",void 0),M(this,"_onSessionIdListener",void 0),M(this,"_persistDecideOnSessionListener",void 0),M(this,"_samplingSessionListener",void 0),M(this,"_urlTriggers",[]),M(this,"_urlBlocklist",[]),M(this,"_urlBlocked",!1),M(this,"_eventTriggers",[]),M(this,"_removeEventTriggerCaptureHook",void 0),M(this,"_forceAllowLocalhostNetworkCapture",!1),M(this,"_onBeforeUnload",(function(){n._flushBuffer()})),M(this,"_onOffline",(function(){n._tryAddCustomEvent("browser offline",{})})),M(this,"_onOnline",(function(){n._tryAddCustomEvent("browser online",{})})),M(this,"_onVisibilityChange",(function(){if(null!=ps&&ps.visibilityState){var e="window "+ps.visibilityState;n._tryAddCustomEvent(e,{})}})),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Kf.error("started without valid sessionManager"),new Error(Xf+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(Xf+" cannot be used with __preview_experimental_cookieless_mode.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,o=i.windowId;this.sessionId=r,this.windowId=o,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Kf.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}return L(e,[{key:"sessionIdleThresholdMilliseconds",get:function(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Xf+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:tv}},{key:"isSampled",get:function(){var e=this.instance.get_property(fo);return Us(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],i=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-i:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(no),t=!this.instance.config.disable_session_recording;return ls&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(io),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e,t,n,i,r,o,s=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(so),u=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,l=null!==(n=null!==(i=null==s?void 0:s.canvasFps)&&void 0!==i?i:null==a?void 0:a.fps)&&void 0!==n?n:4,c=null!==(r=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==r?r:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:u,fps:df(l,0,12,"canvas recording fps",4),quality:df(c,0,1,"canvas recording quality",.4)}}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(ro),i={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},r=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),s=As(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Us(s)?s:null==n?void 0:n.capturePerformance);return r||o||a?{recordHeaders:r,recordBody:o,recordPerformance:a}:void 0}},{key:"masking",get:function(){var e,t,n,i,r,o,s=this.instance.get_property(oo),a={maskAllInputs:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.maskTextSelector,blockSelector:null===(n=this.instance.config.session_recording)||void 0===n?void 0:n.blockSelector},u=null!==(i=null==a?void 0:a.maskAllInputs)&&void 0!==i?i:null==s?void 0:s.maskAllInputs,l=null!==(r=null==a?void 0:a.maskTextSelector)&&void 0!==r?r:null==s?void 0:s.maskTextSelector,c=null!==(o=null==a?void 0:a.blockSelector)&&void 0!==o?o:null==s?void 0:s.blockSelector;return $s(u)&&$s(l)&&$s(c)?void 0:{maskAllInputs:null==u||u,maskTextSelector:l,blockSelector:c}}},{key:"sampleRate",get:function(){var e=this.instance.get_property(ao);return Bs(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(uo);return Bs(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?!1===this.isSampled?"disabled":this._urlBlocked?"paused":js(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":Us(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"urlTriggerStatus",get:function(){var e;return 0===this._urlTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(vo))===this.sessionId?"trigger_activated":"trigger_pending"}},{key:"eventTriggerStatus",get:function(){var e;return 0===this._eventTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(ho))===this.sessionId?"trigger_activated":"trigger_pending"}},{key:"triggerStatus",get:function(){var e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}},{key:"startIfEnabledOrStop",value:function(e){var t=this;this.isRecordingEnabled?(this._startCapture(e),Fa(ls,"beforeunload",this._onBeforeUnload),Fa(ls,"offline",this._onOffline),Fa(ls,"online",this._onOnline),Fa(ls,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),js(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",(function(e){try{if("$pageview"===e.event){var n=null!=e&&e.properties.$current_url?t._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n})}}catch(e){Kf.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((function(e,n,i){var r,o,s,a;i&&(t._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:n,changeReason:i}),null===(r=t.instance)||void 0===r||null===(o=r.persistence)||void 0===o||o.unregister(ho),null===(s=t.instance)||void 0===s||null===(a=s.persistence)||void 0===a||a.unregister(vo))})))):this.stopRecording()}},{key:"stopRecording",value:function(){var e,t,n,i;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==ls||ls.removeEventListener("beforeunload",this._onBeforeUnload),null==ls||ls.removeEventListener("offline",this._onOffline),null==ls||ls.removeEventListener("online",this._onOnline),null==ls||ls.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._removeEventTriggerCaptureHook)||void 0===t||t.call(this),this._removeEventTriggerCaptureHook=void 0,null===(n=this._onSessionIdListener)||void 0===n||n.call(this),this._onSessionIdListener=void 0,null===(i=this._samplingSessionListener)||void 0===i||i.call(this),this._samplingSessionListener=void 0,Kf.info("stopped"))}},{key:"_resetSampling",value:function(){var e;null===(e=this.instance.persistence)||void 0===e||e.unregister(fo)}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e,i=this.sampleRate;if(Bs(i)){var r=this.isSampled,o=n||!Us(r),s=o?Jf(e,i):r;o&&(s?this._reportStarted("sampled"):Kf.warn("Sample rate (".concat(i,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:s})),null===(t=this.instance.persistence)||void 0===t||t.register(M({},fo,s))}else this._resetSampling()}},{key:"onRemoteConfig",value:function(e){var t,n,i,r,o,s,a=this;(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint);if(this._setupSampling(),!js(this._linkedFlag)&&!this._linkedFlagSeen){var u=Ds(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=Ds(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((function(e,t){var n=As(t)&&u in t,i=l?t[u]===l:n;i&&a._reportStarted("linked_flag_matched",{linkedFlag:u,linkedVariant:l}),a._linkedFlagSeen=i}))}null!==(i=e.sessionRecording)&&void 0!==i&&i.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!==(r=e.sessionRecording)&&void 0!==r&&r.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!==(o=e.sessionRecording)&&void 0!==o&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;Bs(this.sampleRate)&&js(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((function(t){e.makeSamplingDecision(t)})))}},{key:"_persistRemoteConfig",value:function(e){var t=this;if(this.instance.persistence){var n,i=this.instance.persistence,r=function(){var n,r,o,s,a,u,l,c,d,f,v=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate,h=js(v)?null:parseFloat(v);js(h)&&t._resetSampling();var p=null===(r=e.sessionRecording)||void 0===r?void 0:r.minimumDurationMilliseconds;i.register((M(f={},no,!!e.sessionRecording),M(f,io,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),M(f,ro,P({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture)),M(f,oo,null===(a=e.sessionRecording)||void 0===a?void 0:a.masking),M(f,so,{enabled:null===(u=e.sessionRecording)||void 0===u?void 0:u.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality}),M(f,ao,h),M(f,uo,$s(p)?null:p),M(f,lo,null===(d=e.sessionRecording)||void 0===d?void 0:d.scriptConfig),f))};r(),null===(n=this._persistDecideOnSessionListener)||void 0===n||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(r)}}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}},{key:"_startCapture",value:function(e){var t=this;if(!$s(Object.assign)&&!$s(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var n,i;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),ev())this._onScriptLoaded();else null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,this.scriptName,(function(e){if(e)return Kf.error("could not load recorder",e);t._onScriptLoaded()}));Kf.info("starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}},{key:"scriptName",get:function(){var e,t,n;return(null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t||null===(n=t.get_property(lo))||void 0===n?void 0:n.script)||"recorder"}},{key:"isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==nv.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle)){var i="unknown"===this.isIdle;this.isIdle=!1,i||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)}if(!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=r.windowId,s=r.sessionId,a=this.sessionId!==s,u=this.windowId!==o;this.windowId=o,this.sessionId=s,a||u?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Kf.warn("could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){return this._tryRRWebMethod(iv((function(){return ev().addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){return this._tryRRWebMethod(iv((function(){return ev().takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){for(var e,t,n,i,r=this,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},s=this.instance.config.session_recording,a=0,u=Object.entries(s||{});a<u.length;a++){var l=q(u[a],2),c=l[0],d=l[1];c in o&&("maskInputOptions"===c?o.maskInputOptions=P({password:!0},d):o[c]=d)}(this.canvasRecording&&this.canvasRecording.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.canvasRecording.fps},o.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.masking)&&(o.maskAllInputs=null===(t=this.masking.maskAllInputs)||void 0===t||t,o.maskTextSelector=null!==(n=this.masking.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(i=this.masking.blockSelector)&&void 0!==i?i:void 0);var f=ev();if(f){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new ff(f,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:function(e,t){var n="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");Kf.info(n,{node:t}),r.log(Xf+" "+n,"warn")}});var v=this._gatherRRWebPlugins();this.stopRrweb=f(P({emit:function(e){r.onRRwebEmit(e)},plugins:v},o)),this._lastActivityTimestamp=Date.now(),this.isIdle=Us(this.isIdle)?this.isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:o,activePlugins:v.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Kf.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!0!==this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),t))}}},{key:"_gatherRRWebPlugins",value:function(){var e,t,n,i,r=[],o=null===(e=ks.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&r.push(o());var s=null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.rrwebPlugins)||void 0===i?void 0:i.getRecordNetworkPlugin;this.networkPayloadCapture&&Ms(s)&&(!Oa.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(s(cf(this.instance.config,this.networkPayloadCapture))):Kf.info("NetworkCapture not started because we are on localhost."));return r}},{key:"onRRwebEmit",value:function(e){var t;if(this._processQueuedEvents(),e&&As(e)){if(e.type===Kd.Meta){var n=this._maskUrl(e.data.href);if(this._lastHref=n,!n)return;e.data.href=n}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),!this._urlBlocked||function(e){return e.type===Kd.Custom&&"recording paused"===e.data.tag}(e)){e.type===Kd.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Kd.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(e){var t=e;if(t&&As(t)&&6===t.type&&As(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],i=0;i<t.data.payload.payload.length;i++)t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?n.push(t.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[i]);return t.data.payload.payload=n,e}return e}(i);if(this._updateWindowAndSessionIds(r),!0!==this.isIdle||ov(r)){if(ov(r)){var o=r.data.payload;if(o){var s=o.lastActivityTimestamp,a=o.threshold;r.timestamp=s+a}}var u=null===(t=this.instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(Jd(e)<1024)return e;try{if(e.type===Kd.FullSnapshot)return P(P({},e),{},{data:rv(e.data),cv:"2024-10"});if(e.type===Kd.IncrementalSnapshot&&e.data.source===ef.Mutation)return P(P({},e),{},{cv:"2024-10",data:P(P({},e.data),{},{texts:rv(e.data.texts),attributes:rv(e.data.attributes),removes:rv(e.data.removes),adds:rv(e.data.adds)})});if(e.type===Kd.IncrementalSnapshot&&e.data.source===ef.StyleSheetRule)return P(P({},e),{},{cv:"2024-10",data:P(P({},e.data),{},{adds:e.data.adds?rv(e.data.adds):void 0,removes:e.data.removes?rv(e.data.removes):void 0})})}catch(e){Kf.error("could not compress event - will use uncompressed event",e)}return e}(r):r,l={$snapshot_bytes:Jd(u),$snapshot_data:u,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(l):this.clearBuffer()}}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&ls){var e=this._maskUrl(ls.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=$(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(t){Date.now()-t.enqueuedAt<=2e3&&e._tryRRWebMethod(t)}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,i={url:e};return null===(n=i=t.maskNetworkRequestFn(i))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,i=Bs(n)&&n>=0,r=Bs(t)&&i&&n<t;if("buffering"===this.status||"paused"===this.status||"disabled"===this.status||r)return this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&Xd(this.buffer).forEach((function(t){e._captureSnapshot({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:ws.LIB_VERSION})}));return this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,i=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}},{key:"_checkUrlTriggerConditions",value:function(){if(void 0!==ls&&ls.location.href){var e=ls.location.href,t=this._urlBlocked,n=sv(e,this._urlBlocklist);n&&!t?this._pauseRecording():!n&&t&&this._resumeRecording(),sv(e,this._urlTriggers)&&this._activateTrigger("url")}}},{key:"_activateTrigger",value:function(e){var t,n;"trigger_pending"===this.triggerStatus&&(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register(M({},"url"===e?vo:ho,this.sessionId)),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}},{key:"_pauseRecording",value:function(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Kf.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}},{key:"_resumeRecording",value:function(){this._urlBlocked&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Kf.info("recording resumed"))}},{key:"_addEventTriggerListener",value:function(){var e=this;0!==this._eventTriggers.length&&js(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(function(t){try{e._eventTriggers.includes(t.event)&&e._activateTrigger("event")}catch(e){Kf.error("Could not activate event trigger",e)}})))}},{key:"overrideLinkedFlag",value:function(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}},{key:"overrideSampling",value:function(){var e;null===(e=this.instance.persistence)||void 0===e||e.register(M({},fo,!0)),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}},{key:"overrideTrigger",value:function(e){this._activateTrigger(e)}},{key:"_reportStarted",value:function(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Kf.info(e.replace("_"," "),t),Cs(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}]),e}(),uv=Gs("[SegmentIntegration]");function lv(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var i=function(n){var i=function(){return n.anonymousId()||Td()};e.config.get_device_id=i,n.id()&&(e.register({distinct_id:n.id(),$device_id:i()}),e.persistence.set_property(So,"identified")),t()},r=n.user();"then"in r&&Ms(r.then)?r.then((function(e){return i(e)})):i(r)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||uv.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){var i;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(uv.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(uv.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e._calculate_event_properties(n,null!==(i=t.event.properties)&&void 0!==i?i:{},new Date);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(e)).then((function(){t()}))}))}var cv="posthog-js";function dv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.organization,i=t.projectId,r=t.prefix,o=t.severityAllowList,s=void 0===o?["error"]:o;return function(t){var o,a,u,l,c;if(!("*"===s||s.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null===(o=t.exception)||void 0===o?void 0:o.values)||[],v=f.map((function(e){return P(P({},e),{},{stacktrace:e.stacktrace?P(P({},e.stacktrace),{},{type:"raw",frames:(e.stacktrace.frames||[]).map((function(e){return P(P({},e),{},{platform:"web:javascript"})}))}):void 0})})),h={$exception_message:(null===(a=f[0])||void 0===a?void 0:a.value)||t.message,$exception_type:null===(u=f[0])||void 0===u?void 0:u.type,$exception_personURL:d,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null===(l=f[0])||void 0===l?void 0:l.value)||t.message,$sentry_exception_type:null===(c=f[0])||void 0===c?void 0:c.type,$sentry_tags:t.tags};return n&&i&&(h.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+t.event_id),e.exceptions.sendExceptionEvent(h),t}}var fv,vv=L((function e(t,n,i,r,o){R(this,e),this.name=cv,this.setupOnce=function(e){e(dv(t,{organization:n,projectId:i,prefix:r,severityAllowList:o}))}})),hv=null!=ls&&ls.location?$a(ls.location.hash,"__posthog")||$a(location.hash,"state"):null,pv="_postHogToolbarParams",gv=Gs("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(fv||(fv={}));var _v=function(){function e(t){R(this,e),this.instance=t}return L(e,[{key:"setToolbarState",value:function(e){ks.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return null!==(e=ks.ph_toolbar_state)&&void 0!==e?e:fv.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!ls||!ps)return!1;n=null!==(e=n)&&void 0!==e?e:ls.location,r=null!==(t=r)&&void 0!==t?t:ls.history;try{if(!i){try{ls.localStorage.setItem("test","test"),ls.localStorage.removeItem("test")}catch(e){return!1}i=null==ls?void 0:ls.localStorage}var o,s=hv||$a(n.hash,"__posthog")||$a(n.hash,"state"),a=s?Sa((function(){return JSON.parse(atob(decodeURIComponent(s)))}))||Sa((function(){return JSON.parse(decodeURIComponent(s))})):null;return a&&"ph_authorize"===a.action?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?n.hash=a.desiredHash:r?r.replaceState(r.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(i.getItem(pv)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"_callLoadToolbar",value:function(e){var t=ks.ph_load_toolbar||ks.ph_load_editor;!js(t)&&Ms(t)?t(e,this.instance):gv.warn("No toolbar load function found")}},{key:"loadToolbar",value:function(e){var t=this,n=!(null==ps||!ps.getElementById(Fo));if(!ls||n)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=P(P({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(ls.localStorage.setItem(pv,JSON.stringify(P(P({},r),{},{source:void 0}))),this.getToolbarState()===fv.LOADED)this._callLoadToolbar(r);else if(this.getToolbarState()===fv.UNINITIALIZED){var o,s;this.setToolbarState(fv.LOADING),null===(o=ks.__PosthogExtensions__)||void 0===o||null===(s=o.loadExternalDependency)||void 0===s||s.call(o,this.instance,"toolbar",(function(e){if(e)return gv.error("[Toolbar] Failed to load",e),void t.setToolbarState(fv.UNINITIALIZED);t.setToolbarState(fv.LOADED),t._callLoadToolbar(r)})),Fa(ls,"turbolinks:load",(function(){t.setToolbarState(fv.UNINITIALIZED),t.loadToolbar(r)}))}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),mv=Gs("[TracingHeaders]"),yv=function(){function e(t){var n=this;R(this,e),M(this,"_restoreXHRPatch",void 0),M(this,"_restoreFetchPatch",void 0),M(this,"_startCapturing",(function(){var e,t,i,r;$s(n._restoreXHRPatch)&&(null===(e=ks.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(n.instance.sessionManager));$s(n._restoreFetchPatch)&&(null===(i=ks.__PosthogExtensions__)||void 0===i||null===(r=i.tracingHeadersPatchFns)||void 0===r||r._patchFetch(n.instance.sessionManager))})),this.instance=t}return L(e,[{key:"_loadScript",value:function(e){var t,n,i;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"tracing-headers",(function(t){if(t)return mv.error("failed to load script",t);e()}))}},{key:"startIfEnabledOrStop",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),e}(),bv=Gs("[Web Vitals]"),kv=9e5,wv=function(){function e(t){var n,i=this;R(this,e),M(this,"_enabledServerSide",!1),M(this,"_initialized",!1),M(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),M(this,"_flushToCapture",(function(){clearTimeout(i._delayedFlushTimer),0!==i.buffer.metrics.length&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce((function(e,t){var n;return P(P({},e),{},(M(n={},"$web_vitals_".concat(t.name,"_event"),P({},t)),M(n,"$web_vitals_".concat(t.name,"_value"),t.value),n))}),{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),M(this,"_addToBuffer",(function(e){var t,n=null===(t=i.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);if($s(n))bv.error("Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=i._currentURL();if(!$s(r))if(js(null==e?void 0:e.name)||js(null==e?void 0:e.value))bv.error("Invalid metric received",e);else if(i._maxAllowedValue&&e.value>=i._maxAllowedValue)bv.error("Ignoring metric with value >= "+i._maxAllowedValue,e);else i.buffer.url!==r&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,i.flushToCaptureTimeoutMs)),$s(i.buffer.url)&&(i.buffer.url=r),i.buffer.firstMetricTimestamp=$s(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),i.buffer.metrics.push(P(P({},e),{},{$current_url:r,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),i.buffer.metrics.length===i.allowedMetrics.length&&i._flushToCapture()}})),M(this,"_startCapturing",(function(){var e,t,n,r,o=ks.__PosthogExtensions__;if(!$s(o)&&!$s(o.postHogWebVitalsCallbacks)){var s=o.postHogWebVitalsCallbacks;e=s.onLCP,t=s.onCLS,n=s.onFCP,r=s.onINP}e&&t&&n&&r?(i.allowedMetrics.indexOf("LCP")>-1&&e(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("CLS")>-1&&t(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("FCP")>-1&&n(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("INP")>-1&&r(i._addToBuffer.bind(i)),i._initialized=!0):bv.error("web vitals callbacks not loaded - not starting")})),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[Kr]),this.startIfEnabled()}return L(e,[{key:"allowedMetrics",get:function(){var e,t,n=As(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return $s(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[to])||["CLS","FCP","INP","LCP"]:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(As(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"_maxAllowedValue",get:function(){var e=As(this.instance.config.capture_performance)&&Bs(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:kv;return 0<e&&e<=6e4?kv:e}},{key:"isEnabled",get:function(){var e=null==gs?void 0:gs.protocol;if("http:"!==e&&"https:"!==e)return bv.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=As(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Us(t)?t:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(bv.info("enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"onRemoteConfig",value:function(e){var t=As(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=As(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register(M({},Kr,t)),this.instance.persistence.register(M({},to,n))),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){var t,n,i;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"web-vitals",(function(t){t?bv.error("failed to load script",t):e()}))}},{key:"_currentURL",value:function(){var e=ls?ls.location.href:void 0;return e||bv.error("Could not determine current URL"),e}}]),e}(),Sv=Gs("[Heatmaps]");function xv(e){return As(e)&&"clientX"in e&&"clientY"in e&&Bs(e.clientX)&&Bs(e.clientY)}var Ev,Cv=function(){function e(t){var n;R(this,e),M(this,"rageclicks",new pd),M(this,"_enabledServerSide",!1),M(this,"_initialized",!1),M(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[Jr])}return L(e,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return As(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return $s(this.instance.config.capture_heatmaps)?$s(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}},{key:"startIfEnabled",value:function(){if(this.isEnabled){if(this._initialized)return;Sv.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null===(t=this.deadClicksCapture)||void 0===t||t.stop(),this.getAndClearBuffer()}}},{key:"onRemoteConfig",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(M({},Jr,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_onDeadClick",value:function(e){this._onClick(e.originalEvent,"deadclick")}},{key:"_setupListeners",value:function(){var e=this;ls&&ps&&(Fa(ls,"beforeunload",this.flush.bind(this)),Fa(ps,"click",(function(t){return e._onClick(t||(null==ls?void 0:ls.event))}),{capture:!0}),Fa(ps,"mousemove",(function(t){return e._onMouseMove(t||(null==ls?void 0:ls.event))}),{capture:!0}),this.deadClicksCapture=new Zd(this.instance,Wd,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var i=e;i&&Bc(i)&&!Uc(i,"body");){if(i===n)return!1;if(Cs(t,null==ls?void 0:ls.getComputedStyle(i).position))return!0;i=Kc(i)}return!1}(Jc(e),["fixed","sticky"],r);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:n),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(!jc(e.target)&&xv(e)){var i=this._getProperties(e,n);null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(P(P({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;!jc(e.target)&&xv(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))}},{key:"_capture",value:function(e){if(ls){var t=ls.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}},{key:"flush",value:function(){this.buffer&&!qs(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),e}(),Pv=function(){function e(t){R(this,e),this._instance=t}return L(e,[{key:"doPageView",value:function(e,t){var n,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==ls?void 0:ls.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}},{key:"doPageLeave",value:function(e){var t;return this._previousPageViewProperties(e,null===(t=this._currentPageview)||void 0===t?void 0:t.pageViewId)}},{key:"doEvent",value:function(){var e;return{$pageview_id:null===(e=this._currentPageview)||void 0===e?void 0:e.pageViewId}}},{key:"_previousPageViewProperties",value:function(e,t){var n=this._currentPageview;if(!n)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:n.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var o=r.maxScrollHeight,s=r.lastScrollY,a=r.maxScrollY,u=r.maxContentHeight,l=r.lastContentY,c=r.maxContentY;if(!($s(o)||$s(s)||$s(a)||$s(u)||$s(l)||$s(c))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c);var d=o<=1?1:df(s/o,0,1),f=o<=1?1:df(a/o,0,1),v=u<=1?1:df(l/u,0,1),h=u<=1?1:df(c/u,0,1);i=ba(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:h})}}return n.pathname&&(i.$prev_pageview_pathname=n.pathname),n.timestamp&&(i.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),i}}]),e}(),Tv=function(){function e(t){R(this,e),this.instance=t}return L(e,[{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}]),e}(),Iv=Gs("[FeatureFlags]"),Fv="$active_feature_flags",Rv="$override_feature_flags",Ov="$feature_flag_payloads",Lv="$override_feature_flag_payloads",Mv="$feature_flag_request_id",Av=function(e){var t,n={},i=H(wa(e||{}));try{for(i.s();!(t=i.n()).done;){var r=q(t.value,2),o=r[0],s=r[1];s&&(n[o]=s)}}catch(e){i.e(e)}finally{i.f()}return n},qv=function(e){var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((function(e){var n;return[e,null!==(n=t[e].variant)&&void 0!==n?n:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((function(e){return t[e].enabled})).filter((function(e){var n;return null===(n=t[e].metadata)||void 0===n?void 0:n.payload})).map((function(e){var n;return[e,null===(n=t[e].metadata)||void 0===n?void 0:n.payload]})))):Iv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};!function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"}(Ev||(Ev={}));var $v=function(){function e(t){R(this,e),M(this,"_override_warning",!1),M(this,"_hasLoadedFlags",!1),M(this,"_requestInFlight",!1),M(this,"_reloadingDisabled",!1),M(this,"_additionalReloadRequested",!1),M(this,"_decideCalled",!1),M(this,"_flagsLoadedFromRemote",!1),this.instance=t,this.featureFlagEventHandlers=[]}return L(e,[{key:"decide",value:function(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}},{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}},{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagsWithDetails",value:function(){var e=this.instance.get_property(_o),t=this.instance.get_property(Rv),n=this.instance.get_property(Lv);if(!n&&!t)return e||{};var i,r=ba({},e||{}),o=H($(new Set([].concat($(Object.keys(n||{})),$(Object.keys(t||{}))))));try{for(o.s();!(i=o.n()).done;){var s,a,u=i.value,l=r[u],c=null==t?void 0:t[u],d=$s(c)?null!==(s=null==l?void 0:l.enabled)&&void 0!==s&&s:!!c,f=$s(c)?l.variant:"string"==typeof c?c:void 0,v=null==n?void 0:n[u],h=P(P({},l),{},{enabled:d,variant:d?null!=f?f:null==l?void 0:l.variant:void 0});if(d!==(null==l?void 0:l.enabled)&&(h.original_enabled=null==l?void 0:l.enabled),f!==(null==l?void 0:l.variant)&&(h.original_variant=null==l?void 0:l.variant),v)h.metadata=P(P({},null==l?void 0:l.metadata),{},{payload:v,original_payload:null==l||null===(a=l.metadata)||void 0===a?void 0:a.payload});r[u]=h}}catch(e){o.e(e)}finally{o.f()}return this._override_warning||(Iv.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this._override_warning=!0),r}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(po),t=this.instance.get_property(Rv);if(!t)return e||{};for(var n=ba({},e),i=Object.keys(t),r=0;r<i.length;r++)n[i[r]]=t[i[r]];return this._override_warning||(Iv.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){var e=this.instance.get_property(Ov),t=this.instance.get_property(Lv);if(!t)return e||{};for(var n=ba({},e||{}),i=Object.keys(t),r=0;r<i.length;r++)n[i[r]]=t[i[r]];return this._override_warning||(Iv.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this._override_warning=!0),n}},{key:"reloadFeatureFlags",value:function(){var e=this;this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((function(){e._callDecideEndpoint()}),5))}},{key:"clearDebouncer",value:function(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}},{key:"ensureFlagsLoaded",value:function(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this._reloadingDisabled=e}},{key:"_callDecideEndpoint",value:function(e){var t,n=this;if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:P(P({},(null===(t=this.instance.persistence)||void 0===t?void 0:t.get_initial_props())||{}),this.instance.get_property(mo)||{}),group_properties:this.instance.get_property(yo)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var r=this.instance.config.__preview_flags_v2&&this.instance.config.__preview_remote_config;r&&(i.timezone=$u.timezone()),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api",r?"/flags/?v=2":"/decide/?v=4"),data:i,compression:this.instance.config.disable_compression?void 0:us.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(e){var t,r,o,s=!0;(200===e.statusCode&&(n._additionalReloadRequested||(n.$anon_distinct_id=void 0),s=!1),n._requestInFlight=!1,n._decideCalled)||(n._decideCalled=!0,n.instance._onRemoteConfig(null!==(o=e.json)&&void 0!==o?o:{}));i.disable_flags&&!n._additionalReloadRequested||(n._flagsLoadedFromRemote=!s,e.json&&null!==(t=e.json.quotaLimited)&&void 0!==t&&t.includes(Ev.FeatureFlags)?Iv.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."):(n.receivedFeatureFlags(null!==(r=e.json)&&void 0!==r?r:{},s),n._additionalReloadRequested&&(n._additionalReloadRequested=!1,n._callDecideEndpoint())))}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],i="".concat(n),r=this.instance.get_property(Mv)||void 0,o=this.instance.get_property(wo)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(i))){var s,a,u,l,c,d,f,v,h,p,g;Ls(o[e])?o[e].push(i):o[e]=[i],null===(s=this.instance.persistence)||void 0===s||s.register(M({},wo,o));var _=this.getFeatureFlagDetails(e),m={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_bootstrapped_response:(null===(a=this.instance.config.bootstrap)||void 0===a||null===(u=a.featureFlags)||void 0===u?void 0:u[e])||null,$feature_flag_bootstrapped_payload:(null===(l=this.instance.config.bootstrap)||void 0===l||null===(c=l.featureFlagPayloads)||void 0===c?void 0:c[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};$s(null==_||null===(d=_.metadata)||void 0===d?void 0:d.version)||(m.$feature_flag_version=_.metadata.version);var y,b=null!==(f=null==_||null===(v=_.reason)||void 0===v?void 0:v.description)&&void 0!==f?f:null==_||null===(h=_.reason)||void 0===h?void 0:h.code;if(b&&(m.$feature_flag_reason=b),null!=_&&null!==(p=_.metadata)&&void 0!==p&&p.id&&(m.$feature_flag_id=_.metadata.id),$s(null==_?void 0:_.original_variant)&&$s(null==_?void 0:_.original_enabled)||(m.$feature_flag_original_response=$s(_.original_variant)?_.original_enabled:_.original_variant),null!=_&&null!==(g=_.metadata)&&void 0!==g&&g.original_payload)m.$feature_flag_original_payload=null==_||null===(y=_.metadata)||void 0===y?void 0:y.original_payload;this.instance.capture("$feature_flag_called",m)}return n}Iv.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagDetails",value:function(e){return this.getFlagsWithDetails()[e]}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"getRemoteConfigPayload",value:function(e,t){var n=this.instance.config.token;this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this.instance.get_distinct_id(),token:n},compression:this.instance.config.disable_compression?void 0:us.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(n){var i,r=null===(i=n.json)||void 0===i?void 0:i.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Iv.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),i=this.getFlagPayloads(),r=this.getFlagsWithDetails();!function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=qv(e),a=s.flags,u=s.featureFlags,l=s.featureFlagPayloads;if(u){var c=e.requestId;if(Ls(u)){var d;Iv.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(u)for(var v=0;v<u.length;v++)f[u[v]]=!0;t&&t.register((M(d={},Fv,u),M(d,po,f),d))}else{var h=u,p=l,g=a;e.errorsWhileComputingFlags&&(h=P(P({},i),h),p=P(P({},r),p),g=P(P({},o),g)),t&&t.register(P((M(n={},Fv,Object.keys(Av(h))),M(n,po,h||{}),M(n,Ov,p||{}),M(n,_o,g||{}),n),c?M({},Mv,c):{}))}}}(e,this.instance.persistence,n,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Iv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}},{key:"overrideFeatureFlags",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return Iv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.instance.persistence.unregister(Rv),this.instance.persistence.unregister(Lv),void this._fireFeatureFlagsCallbacks();if(e&&"object"===I(e)&&("flags"in e||"payloads"in e)){var t,n=e;if(this._override_warning=Boolean(null!==(t=n.suppressWarning)&&void 0!==t&&t),"flags"in n)if(!1===n.flags)this.instance.persistence.unregister(Rv);else if(n.flags)if(Ls(n.flags)){for(var i={},r=0;r<n.flags.length;r++)i[n.flags[r]]=!0;this.instance.persistence.register(M({},Rv,i))}else this.instance.persistence.register(M({},Rv,n.flags));return"payloads"in n&&(!1===n.payloads?this.instance.persistence.unregister(Lv):n.payloads&&this.instance.persistence.register(M({},Lv,n.payloads))),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,r=n.flagVariants;e(i,r)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var n,i,r=(this.instance.get_property(go)||[]).find((function(t){return t.flagKey===e})),o=M({},"$feature_enrollment/".concat(e),t),s={$feature_flag:e,$feature_enrollment:t,$set:o};r&&(s.$early_access_feature_name=r.name),this.instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(o,!1);var a=P(P({},this.getFlagVariants()),{},M({},e,t));null===(n=this.instance.persistence)||void 0===n||n.register((M(i={},Fv,Object.keys(Av(a))),M(i,po,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this.instance.get_property(go),o=i?"&".concat(i.map((function(e){return"stage=".concat(e)})).join("&")):"";if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token).concat(o)),method:"GET",callback:function(n){var i;if(n.json){var r=n.json.earlyAccessFeatures;return null===(i=t.instance.persistence)||void 0===i||i.register(M({},go,r)),e(r)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,i=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,i,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(mo)||{};this.instance.register(M({},mo,P(P({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(mo)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(yo)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((function(t){n[t]=P(P({},n[t]),e[t]),delete e[t]})),this.instance.register(M({},yo,P(P({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(yo)||{};this.instance.register(M({},yo,P(P({},t),{},M({},e,{}))))}else this.instance.unregister(yo)}}]),e}(),Dv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Nv=function(){function e(t){R(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(t),this.storage=this.buildStorage(t),this.load(),t.debug&&Ws.info("Persistence loaded",t.persistence,P({},this.props)),this.update_config(t,t),this.save()}return L(e,[{key:"buildStorage",value:function(e){-1===Dv.indexOf(e.persistence.toLowerCase())&&(Ws.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&$d.is_supported()?$d:"localstorage+cookie"===t&&Nd.is_supported()?Nd:"sessionstorage"===t&&Ud.is_supported()?Ud:"memory"===t?jd:"cookie"===t?Ad:Nd.is_supported()?Nd:Ad}},{key:"properties",value:function(){var e={};return ya(this.props,(function(t,n){if(n===po&&As(t))for(var i=Object.keys(t),r=0;r<i.length;r++)e["$feature/".concat(i[r])]=t[i[r]];else s=n,a=!1,(Hs(o=Oo)?a:vs&&o.indexOf===vs?-1!=o.indexOf(s):(ya(o,(function(e){if(a||(a=e===s))return _a})),a))||(e[n]=t);var o,s,a})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=ba({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var i=this;if(As(e)){$s(t)&&(t="None"),this.expire_days=$s(n)?this.default_expiry:n;var r=!1;if(ya(e,(function(e,n){i.props.hasOwnProperty(n)&&i.props[n]!==t||(i.props[n]=e,r=!0)})),r)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(As(e)){this.expire_days=$s(t)?this.default_expiry:t;var i=!1;if(ya(e,(function(t,r){e.hasOwnProperty(r)&&n.props[r]!==t&&(n.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){if(!this.campaign_params_saved){var e=$u.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});qs(Ea(e))||this.register(e),this.campaign_params_saved=!0}}},{key:"update_search_keyword",value:function(){this.register($u.searchInfo())}},{key:"update_referrer_info",value:function(){this.register_once($u.referrerInfo(),void 0)}},{key:"set_initial_person_info",value:function(){this.props[Co]||this.props[Po]||this.register_once(M({},To,$u.personInfo({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties})),void 0)}},{key:"get_referrer_info",value:function(){return Ea({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};ya([Po,Co],(function(n){var i=e.props[n];i&&ya(i,(function(e,n){t["$initial_"+Ts(n)]=e}))}));var n=this.props[To];if(n){var i=$u.initialPersonPropsFromInfo(n);ba(t,i)}return t}},{key:"safe_merge",value:function(e){return ya(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),i=this.props;this.clear(),this.storage=n,this.props=i,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Qr]||{};n[e]=t,this.props[Qr]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Qr]||{})[e];return $s(t)||(delete this.props[Qr][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),e}(),Hv=Gs("[RateLimiter]"),jv=function(){function e(t){var n,i,r=this;R(this,e),M(this,"serverLimits",{}),M(this,"lastEventRateLimited",!1),M(this,"checkForLimiting",(function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){Hv.info("".concat(e||"events"," is quota limited.")),r.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void Hv.warn('could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=t,this.captureEventsPerSecond=(null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(i=t.config.rate_limiting)||void 0===i?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return L(e,[{key:"clientRateLimitContext",value:function(){var e,t,n,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Eo))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:r};o.tokens+=(r-o.last)/1e3*this.captureEventsPerSecond,o.last=r,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||i||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(n=this.instance.persistence)||void 0===n||n.set_property(Eo,o),{isRateLimited:s,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),Bv=Gs("[RemoteConfig]"),Uv=function(){function e(t){R(this,e),this.instance=t}return L(e,[{key:"remoteConfig",get:function(){var e,t;return null===(e=ks._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.config}},{key:"_loadRemoteConfigJs",value:function(e){var t,n,i,r=this;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.loadExternalDependency?null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"remote-config",(function(){return e(r.remoteConfig)})):(Bv.error("PostHog Extensions not found. Cannot load remote config."),e())}},{key:"_loadRemoteConfigJSON",value:function(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:function(t){e(t.json)}})}},{key:"load",value:function(){var e=this;try{if(this.remoteConfig)return Bv.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void Bv.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((function(t){if(!t)return Bv.info("No config found after loading remote JS config. Falling back to JSON."),void e._loadRemoteConfigJSON((function(t){e.onRemoteConfig(t)}));e.onRemoteConfig(t)}))}catch(e){Bv.error("Error loading remote config",e)}}},{key:"onRemoteConfig",value:function(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):Bv.info("__preview_remote_config is disabled. Logging config instead",e):Bv.error("Failed to fetch remote config from PostHog.")}}]),e}();var zv=function(e){var t,n,i,r,o="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<i;r++){var s=e.charCodeAt(r),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),Hs(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=r+1)}return n>t&&(o+=e.substring(t,e.length)),o},Vv=!!ms||!!_s,Wv="text/plain",Gv=function(e,t){var n=q(e.split("?"),2),i=n[0],r=n[1],o=P({},t);null==r||r.split("&").forEach((function(e){var t=q(e.split("="),1)[0];delete o[t]}));var s=Ma(o);return s=s?(r?r+"&":"")+s:r,"".concat(i,"?").concat(s)},Zv=function(e,t){return JSON.stringify(e,(function(e,t){return"bigint"==typeof t?t.toString():t}),t)},Qv=function(e){var t=e.data,n=e.compression;if(t){if(n===us.GZipJS){var i=Qf(Yf(Zv(t)),{mtime:0}),r=new Blob([i],{type:Wv});return{contentType:Wv,body:r,estimatedSize:r.size}}if(n===us.Base64){var o=function(e){var t,n,i,r,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",c=[];if(!e)return e;e=zv(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,i=o>>6&63,r=63&o,c[u++]=s.charAt(t)+s.charAt(n)+s.charAt(i)+s.charAt(r)}while(a<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(Zv(t)),s=function(e){return"data="+encodeURIComponent("string"==typeof e?e:Zv(e))}(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Zv(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Yv=[];_s&&Yv.push({transport:"fetch",method:function(e){var t,n,i=null!==(t=Qv(e))&&void 0!==t?t:{},r=i.contentType,o=i.body,s=i.estimatedSize,a=new Headers;ya(e.headers,(function(e,t){a.append(t,e)})),r&&a.append("Content-Type",r);var u=e.url,l=null;if(ys){var c=new ys;l={signal:c.signal,timeout:setTimeout((function(){return c.abort()}),e.timeout)}}_s(u,P({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null===(n=l)||void 0===n?void 0:n.signal},e.fetchOptions)).then((function(t){return t.text().then((function(n){var i,r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){Ws.error(e)}null===(i=e.callback)||void 0===i||i.call(e,r)}))})).catch((function(t){var n;Ws.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return l?clearTimeout(l.timeout):null}))}}),ms&&Yv.push({transport:"XHR",method:function(e){var t,n=new ms;n.open(e.method||"GET",e.url,!0);var i=null!==(t=Qv(e))&&void 0!==t?t:{},r=i.contentType,o=i.body;ya(e.headers,(function(e,t){n.setRequestHeader(t,e)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.send(o)}}),null!=hs&&hs.sendBeacon&&Yv.push({transport:"sendBeacon",method:function(e){var t=Gv(e.url,{beacon:"1"});try{var n,i=null!==(n=Qv(e))&&void 0!==n?n:{},r=i.contentType,o=i.body,s="string"==typeof o?new Blob([o],{type:r}):o;hs.sendBeacon(t,s)}catch(e){}}});var Jv=3e3,Xv=function(){function e(t,n){R(this,e),M(this,"isPaused",!0),M(this,"queue",[]),this.flushTimeoutMs=df((null==n?void 0:n.flush_interval_ms)||Jv,250,5e3,"flush interval",Jv),this.sendRequest=t}return L(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},n=Object.values(t),i=[].concat($(n.filter((function(e){return 0===e.url.indexOf("/e")}))),$(n.filter((function(e){return 0!==e.url.indexOf("/e")}))));i.map((function(t){e.sendRequest(P(P({},t),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var i=t[n],r=(new Date).getTime();i.data&&Ls(i.data)&&ya(i.data,(function(e){e.offset=Math.abs(e.timestamp-r),delete e.timestamp})),e.sendRequest(i)};for(var i in t)n(i)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return ya(this.queue,(function(t){var n,i=t,r=(i?i.batchKey:null)||i.url;$s(e[r])&&(e[r]=P(P({},i),{},{data:[]})),null===(n=e[r].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}]),e}(),Kv=["retriesPerformedSoFar"];var eh,th=function(){function e(t){var n=this;R(this,e),M(this,"isPolling",!1),M(this,"pollIntervalMs",3e3),M(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!$s(ls)&&"onLine"in ls.navigator&&(this.areWeOnline=ls.navigator.onLine,Fa(ls,"online",(function(){n.areWeOnline=!0,n.flush()})),Fa(ls,"offline",(function(){n.areWeOnline=!1})))}return L(e,[{key:"retriableRequest",value:function(e){var t=this,n=e.retriesPerformedSoFar,i=A(e,Kv);Bs(n)&&n>0&&(i.url=Gv(i.url,{retry_count:n})),this.instance._send_request(P(P({},i),{},{callback:function(e){var r;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?t.enqueue(P({retriesPerformedSoFar:n},i)):null===(r=i.callback)||void 0===r||r.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,i=Math.min(18e5,t),r=(Math.random()-.5)*(i-n);return Math.ceil(i+r)}(t),i=Date.now()+n;this.queue.push({retryAt:i,requestOptions:e});var r="Enqueued failed request for retry in ".concat(n);navigator.onLine||(r+=" (Browser is offline)"),Ws.warn(r),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var i,r=H(n);try{for(r.s();!(i=r.n()).done;){var o=i.value.requestOptions;this.retriableRequest(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=H(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestOptions;try{this.instance._send_request(P(P({},n),{},{transport:"sendBeacon"}))}catch(e){Ws.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}}]),e}(),nh=function(){function e(t){var n=this;R(this,e),M(this,"_updateScrollData",(function(){var e,t,i,r;n.context||(n.context={});var o=n.scrollElement(),s=n.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=s+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;n.context.lastScrollY=Math.ceil(s),n.context.maxScrollY=Math.max(s,null!==(e=n.context.maxScrollY)&&void 0!==e?e:0),n.context.maxScrollHeight=Math.max(a,null!==(t=n.context.maxScrollHeight)&&void 0!==t?t:0),n.context.lastContentY=u,n.context.maxContentY=Math.max(u,null!==(i=n.context.maxContentY)&&void 0!==i?i:0),n.context.maxContentHeight=Math.max(l,null!==(r=n.context.maxContentHeight)&&void 0!==r?r:0)})),this.instance=t}return L(e,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){Fa(ls,"scroll",this._updateScrollData,{capture:!0}),Fa(ls,"scrollend",this._updateScrollData,{capture:!0}),Fa(ls,"resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return null==ls?void 0:ls.document.documentElement;var e,t=H(Ls(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,i=null==ls?void 0:ls.document.querySelector(n);if(i)return i}}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return ls&&(ls.scrollY||ls.pageYOffset||ls.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return ls&&(ls.scrollX||ls.pageXOffset||ls.document.documentElement.scrollLeft)||0}}]),e}(),ih=function(e){return $u.personInfo({maskPersonalDataProperties:null==e?void 0:e.config.mask_personal_data_properties,customPersonalDataProperties:null==e?void 0:e.config.custom_personal_data_properties})},rh=function(){function e(t,n,i,r){var o=this;R(this,e),M(this,"_onSessionIdCallback",(function(e){var t=o._getStored();if(!t||t.sessionId!==e){var n={sessionId:e,props:o._sessionSourceParamGenerator(o.instance)};o._persistence.register(M({},xo,n))}})),this.instance=t,this._sessionIdManager=n,this._persistence=i,this._sessionSourceParamGenerator=r||ih,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return L(e,[{key:"_getStored",value:function(){return this._persistence.props[xo]}},{key:"getSetOnceProps",value:function(){var e,t=null===(e=this._getStored())||void 0===e?void 0:e.props;return t?"r"in t?$u.personPropsFromInfo(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}},{key:"getSessionProps",value:function(){var e={};return ya(Ea(this.getSetOnceProps()),(function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_".concat(Ts(n))]=t})),e}}]),e}(),oh=Gs("[SessionId]"),sh=function(){function e(t,n,i){var r;if(R(this,e),M(this,"_sessionIdChangedHandlers",[]),!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=t.config,this.persistence=t.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Td,this._windowIdGenerator=i||Td;var o=this.config.persistence_name||this.config.token,s=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*df(s,60,36e3,"session_idle_timeout_seconds",1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=Ud.parse(this._window_id_storage_key),u=Ud.parse(this._primary_window_exists_storage_key);a&&!u?this._windowId=a:Ud.remove(this._window_id_storage_key),Ud.set(this._primary_window_exists_storage_key,!0)}if(null!==(r=this.config.bootstrap)&&void 0!==r&&r.sessionID)try{var l=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)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){oh.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}return L(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}},{key:"onSessionId",value:function(e){var t=this;return $s(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Ud.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ud.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ud.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(M({},co,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[co];return Ls(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;Fa(ls,"beforeunload",(function(){e._canUseSessionStorage()&&Ud.remove(e._primary_window_exists_storage_key)}),{capture:!1})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||(new Date).getTime(),i=q(this._getSessionId(),3),r=i[0],o=i[1],s=i[2],a=this._getWindowId(),u=Bs(s)&&s>0&&Math.abs(n-s)>864e5,l=!1,c=!o,d=!e&&Math.abs(n-r)>this.sessionTimeoutMs;c||d||u?(o=this._sessionIdGenerator(),a=this._windowIdGenerator(),oh.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}}),s=n,l=!0):a||(a=this._windowIdGenerator(),l=!0);var f=0===r||!e||u?n:r,v=0===s?(new Date).getTime():s;return this._setWindowId(a),this._setSessionId(o,f,v),e||this.resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((function(e){return e(o,a,l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0)})),{sessionId:o,windowId:a,sessionStartTimestamp:v,changeReason:l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0,lastActivityTimestamp:r}}},{key:"resetIdleTimer",value:function(){var e=this;clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((function(){e.resetSessionId()}),1.1*this.sessionTimeoutMs)}}]),e}(),ah=["$set_once","$set"],uh=Gs("[SiteApps]"),lh=function(){function e(t){R(this,e),this.instance=t,this.bufferedInvocations=[],this.apps={}}return L(e,[{key:"isEnabled",get:function(){return!!this.instance.config.opt_in_site_apps}},{key:"eventCollector",value:function(e,t){if(t){var n=this.globalsForEvent(t);this.bufferedInvocations.push(n),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}},{key:"siteAppLoaders",get:function(){var e,t;return null===(e=ks._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.siteApps}},{key:"init",value: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}}}},{key:"globalsForEvent",value:function(e){var t,n,i,r,o,s,a;if(!e)throw new Error("Event payload is required");for(var u={},l=this.instance.get_property("$groups")||[],c=this.instance.get_property("$stored_group_properties")||{},d=0,f=Object.entries(c);d<f.length;d++){var v=q(f[d],2),h=v[0],p=v[1];u[h]={id:l[h],type:h,properties:p}}var g=e.$set_once,_=e.$set;return{event:P(P({},A(e,ah)),{},{properties:P(P(P({},e.properties),_?{$set:P(P({},null!==(t=null===(n=e.properties)||void 0===n?void 0:n.$set)&&void 0!==t?t:{}),_)}:{}),g?{$set_once:P(P({},null!==(i=null===(r=e.properties)||void 0===r?void 0:r.$set_once)&&void 0!==i?i:{}),g)}:{}),elements_chain:null!==(o=null===(s=e.properties)||void 0===s?void 0:s.$elements_chain)&&void 0!==o?o:"",distinct_id:null===(a=e.properties)||void 0===a?void 0:a.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}},{key:"setupSiteApp",value:function(e){var t=this,n=this.apps[e.id],i=function(){var i;(!n.errored&&t.bufferedInvocations.length&&(uh.info("Processing ".concat(t.bufferedInvocations.length," events for site app with id ").concat(e.id)),t.bufferedInvocations.forEach((function(e){var t;return null===(t=n.processEvent)||void 0===t?void 0:t.call(n,e)})),n.processedBuffer=!0),Object.values(t.apps).every((function(e){return e.processedBuffer||e.errored})))&&(null===(i=t.stopBuffering)||void 0===i||i.call(t))},r=!1,o=function(t){n.errored=!t,n.loaded=!0,uh.info("Site app with id ".concat(e.id," ").concat(t?"loaded":"errored")),r&&i()};try{var s=e.init({posthog:this.instance,callback:function(e){o(e)}}).processEvent;s&&(n.processEvent=s),r=!0}catch(t){uh.error("Error while initializing PostHog app with config id ".concat(e.id),t),o(!1)}if(r&&n.loaded)try{i()}catch(t){uh.error("Error while processing buffered events PostHog app with config id ".concat(e.id),t),n.errored=!0}}},{key:"setupSiteApps",value:function(){var e,t=this.siteAppLoaders||[],n=H(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;this.apps[i.id]={id:i.id,loaded:!1,errored:!1,processedBuffer:!1}}}catch(e){n.e(e)}finally{n.f()}var r,o=H(t);try{for(o.s();!(r=o.n()).done;){var s=r.value;this.setupSiteApp(s)}}catch(e){o.e(e)}finally{o.f()}}},{key:"onCapturedEvent",value:function(e){if(0!==Object.keys(this.apps).length)for(var t=this.globalsForEvent(e),n=0,i=Object.values(this.apps);n<i.length;n++){var r=i[n];try{var o;null===(o=r.processEvent)||void 0===o||o.call(r,t)}catch(t){uh.error("Error while processing event ".concat(e.event," for site app ").concat(r.id),t)}}}},{key:"onRemoteConfig",value:function(e){var t,n,i,r=this;if(null!==(t=this.siteAppLoaders)&&void 0!==t&&t.length)return this.isEnabled?(this.setupSiteApps(),void this.instance.on("eventCaptured",(function(e){return r.onCapturedEvent(e)}))):void uh.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null===(n=this.stopBuffering)||void 0===n||n.call(this),null!==(i=e.siteApps)&&void 0!==i&&i.length)if(this.isEnabled){var o,s=H(e.siteApps);try{var a=function(){var e,t,n=o.value,i=n.id,s=n.url;ks["__$$ph_site_app_".concat(i)]=r.instance,null===(e=ks.__PosthogExtensions__)||void 0===e||null===(t=e.loadSiteApp)||void 0===t||t.call(e,r.instance,s,(function(e){if(e)return uh.error("Error while initializing PostHog app with config id ".concat(i),e)}))};for(s.s();!(o=s.n()).done;)a()}catch(e){s.e(e)}finally{s.f()}}else uh.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}]),e}(),ch=["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","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","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","googleweblight","mediapartners-google","storebot-google","bytespider"],dh=function(e,t){if(!e)return!1;var n=e.toLowerCase();return ch.concat(t||[]).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))},fh=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&dh(n,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((function(e){return dh(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver};function vh(e,t,n){return Zv({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(eh||(eh={}));var hh="i.posthog.com",ph=function(){function e(t){R(this,e),M(this,"_regionCache",{}),this.instance=t}return L(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:"uiHost",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(hh),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=eh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=eh.EU:this._regionCache[this.apiHost]=eh.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return this.uiHost+t;if(this.region===eh.CUSTOM)return this.apiHost+t;var n=hh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}]),e}(),gh={icontains:function(e,t){return!!ls&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return!!ls&&-1===t.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return!!ls&&Du(t.href,e)},not_regex:function(e,t){return!!ls&&!Du(t.href,e)},exact:function(e,t){return t.href===e},is_not:function(e,t){return t.href!==e}},_h=function(){function e(t){var n=this;R(this,e),M(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.getWebExperiments((function(t){e.logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,t.forEach((function(t){if(t.feature_flag_key){var i;if(n._flagToExperiments)e.logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null===(i=n._flagToExperiments)||void 0===i||i.set(t.feature_flag_key,t);var r=n.instance.getFeatureFlag(t.feature_flag_key);Ds(r)&&t.variants[r]&&n.applyTransforms(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var o in t.variants){var s=t.variants[o];e.matchesTestVariant(s)&&n.applyTransforms(t.name,o,s.transforms)}}))}),t)})),this.instance=t,this.instance.onFeatureFlags((function(e){n.onFeatureFlags(e)}))}return L(e,[{key:"onFeatureFlags",value:function(t){var n=this;if(this._is_bot())e.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(js(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)&&void 0!==t&&t.has(e)){var i,r=n.instance.getFeatureFlag(e),o=null===(i=n._flagToExperiments)||void 0===i?void 0:i.get(e);r&&null!=o&&o.variants[r]&&n.applyTransforms(o.name,r,o.variants[r].transforms)}}))}}},{key:"previewWebExperiment",value:function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var i=Aa(null==n?void 0:n.search,"__experiment_id"),r=Aa(null==n?void 0:n.search,"__experiment_variant");i&&r&&(e.logInfo("previewing web experiments ".concat(i," && ").concat(r)),this.getWebExperiments((function(e){t.showPreviewWebExperiment(parseInt(i),r,e)}),!1,!0))}}},{key:"loadIfEnabled",value:function(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}},{key:"getWebExperiments",value:function(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);var i=this.instance.get_property("$web_experiments");if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:function(t){if(200!==t.statusCode||!t.json)return e([]);var n=t.json.experiments||[];return e(n)}})}},{key:"showPreviewWebExperiment",value:function(t,n,i){var r=i.filter((function(e){return e.id===t}));r&&r.length>0&&(e.logInfo("Previewing web experiment [".concat(r[0].name,"] with variant [").concat(n,"]")),this.applyTransforms(r[0].name,n,r[0].variants[n].transforms))}},{key:"applyTransforms",value:function(t,n,i){this._is_bot()?e.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==n?i.forEach((function(i){if(i.selector){var r;e.logInfo("applying transform of variant ".concat(n," for experiment ").concat(t," "),i);var o=null===(r=document)||void 0===r?void 0:r.querySelectorAll(i.selector);null==o||o.forEach((function(e){var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)}))}})):e.logInfo("Control variants leave the page unmodified.")}},{key:"_is_bot",value:function(){return hs&&this.instance?fh(hs,this.instance.config.custom_blocked_useragents):void 0}}],[{key:"matchesTestVariant",value:function(t){return!js(t.conditions)&&(e.matchUrlConditions(t)&&e.matchUTMConditions(t))}},{key:"matchUrlConditions",value:function(t){var n;if(js(t.conditions)||js(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;var i,r,o,s=e.getWindowLocation();return!!s&&(null===(i=t.conditions)||void 0===i||!i.url||gh[null!==(r=null===(o=t.conditions)||void 0===o?void 0:o.urlMatchType)&&void 0!==r?r:"icontains"](t.conditions.url,s))}},{key:"getWindowLocation",value:function(){return null==ls?void 0:ls.location}},{key:"matchUTMConditions",value:function(e){var t;if(js(e.conditions)||js(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var n=$u.campaignParams();if(n.utm_source){var i,r,o,s,a,u,l,c,d,f,v,h,p,g,_,m,y=null===(i=e.conditions)||void 0===i||null===(r=i.utm)||void 0===r||!r.utm_campaign||(null===(o=e.conditions)||void 0===o||null===(s=o.utm)||void 0===s?void 0:s.utm_campaign)==n.utm_campaign,b=null===(a=e.conditions)||void 0===a||null===(u=a.utm)||void 0===u||!u.utm_source||(null===(l=e.conditions)||void 0===l||null===(c=l.utm)||void 0===c?void 0:c.utm_source)==n.utm_source,k=null===(d=e.conditions)||void 0===d||null===(f=d.utm)||void 0===f||!f.utm_medium||(null===(v=e.conditions)||void 0===v||null===(h=v.utm)||void 0===h?void 0:h.utm_medium)==n.utm_medium,w=null===(p=e.conditions)||void 0===p||null===(g=p.utm)||void 0===g||!g.utm_term||(null===(_=e.conditions)||void 0===_||null===(m=_.utm)||void 0===m?void 0:m.utm_term)==n.utm_term;return y&&k&&w&&b}return!1}},{key:"logInfo",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];Ws.info("[WebExperiments] ".concat(e),n)}}]),e}(),mh={},yh=function(){},bh="posthog",kh=!Vv&&-1===(null==bs?void 0:bs.indexOf("MSIE"))&&-1===(null==bs?void 0:bs.indexOf("Mozilla")),wh=function(){var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Ta(null==ps?void 0:ps.location),persistence:"localStorage+cookie",persistence_name:"",loaded:yh,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:gs&&Ds(null==gs?void 0:gs.search)&&-1!==gs.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==ls||null===(e=ls.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;Ws.error(t)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Jv},_onCapture:yh}},Sh=function(e){var t={};$s(e.process_person)||(t.person_profiles=e.process_person),$s(e.xhr_headers)||(t.request_headers=e.xhr_headers),$s(e.cookie_name)||(t.persistence_name=e.cookie_name),$s(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),$s(e.store_google)||(t.save_campaign_params=e.store_google),$s(e.verbose)||(t.debug=e.verbose);var n=ba({},t,e);return Ls(e.property_blacklist)&&($s(e.property_denylist)?n.property_denylist=e.property_blacklist:Ls(e.property_denylist)?n.property_denylist=[].concat($(e.property_blacklist),$(e.property_denylist)):Ws.error("Invalid value for property_denylist config: "+e.property_denylist)),n},xh=function(){function e(){R(this,e),M(this,"__forceAllowLocalhost",!1)}return L(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Ws.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),Eh=function(){function e(){var t=this;R(this,e),M(this,"webPerformance",new xh),M(this,"_personProcessingSetOncePropertiesSent",!1),M(this,"version",ws.LIB_VERSION),M(this,"_internalEventEmitter",new Nu),this.config=wh(),this.SentryIntegration=vv,this.sentryIntegration=function(e){return function(e,t){var n=dv(e,t);return{name:cv,processEvent:function(e){return n(e)}}}(t,e)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new $v(this),this.toolbar=new _v(this),this.scrollManager=new nh(this),this.pageViewManager=new Pv(this),this.surveys=new Yu(this),this.experiments=new _h(this),this.exceptions=new Tv(this),this.rateLimiter=new jv(this),this.requestRouter=new ph(this),this.consent=new zd(this),this.people={set:function(e,n,i){var r=Ds(e)?M({},e,n):e;t.setPersonProperties(r),null==i||i({})},set_once:function(e,n,i){var r=Ds(e)?M({},e,n):e;t.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(function(e){return Ws.info('send "'.concat(null==e?void 0:e.event,'"'),e)}))}return L(e,[{key:"decideEndpointWasHit",get:function(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"init",value:function(t,n,i){if(i&&i!==bh){var r,o=null!==(r=mh[i])&&void 0!==r?r:new e;return o._init(t,n,i),mh[i]=o,mh[bh][i]=o,o}return this._init(t,n,i)}},{key:"_init",value:function(e){var t,n,i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if($s(e)||Ns(e))return Ws.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 Ws.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],r.person_profiles&&(this._initialPersonProfilesConfig=r.person_profiles),this.set_config(ba({},wh(),Sh(r),{name:o,token:e})),this.config.on_xhr_error&&Ws.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:us.GZipJS,this.persistence=new Nv(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Nv(P(P({},this.config),{},{persistence:"sessionStorage"}));var s=P({},this.persistence.props),a=P({},this.sessionPersistence.props);if(this._requestQueue=new Xv((function(e){return i._send_retriable_request(e)}),this.config.request_queue_config),this._retryQueue=new th(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new sh(this),this.sessionPropsManager=new rh(this,this.sessionManager,this.persistence)),new yv(this).startIfEnabledOrStop(),this.siteApps=new lh(this),null===(t=this.siteApps)||void 0===t||t.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new av(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new kd(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Cv(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new wv(this),this.exceptionObserver=new Yd(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Zd(this,Gd),this.deadClicksAutocapture.startIfEnabled(),ws.DEBUG=ws.DEBUG||this.config.debug,ws.DEBUG&&Ws.info("Starting in debug mode",{this:this,config:r,thisC:P({},this.config),p:s,s:a}),this._sync_opt_out_with_persistence(),void 0!==(null===(n=r.bootstrap)||void 0===n?void 0:n.distinctID)){var u,l,c=this.config.get_device_id(Td()),d=null!==(u=r.bootstrap)&&void 0!==u&&u.isIdentifiedID?c:r.bootstrap.distinctID;this.persistence.set_property(So,null!==(l=r.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var f,v,h=Object.keys((null===(f=r.bootstrap)||void 0===f?void 0:f.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=r.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,i;return e[t]=(null===(n=r.bootstrap)||void 0===n||null===(i=n.featureFlags)||void 0===i?void 0:i[t])||!1,e}),{}),p=Object.keys((null===(v=r.bootstrap)||void 0===v?void 0:v.featureFlagPayloads)||{}).filter((function(e){return h[e]})).reduce((function(e,t){var n,i,o,s;null!==(n=r.bootstrap)&&void 0!==n&&null!==(i=n.featureFlagPayloads)&&void 0!==i&&i[t]&&(e[t]=null===(o=r.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:p})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ro,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(Td());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(So,"anonymous")}return Fa(ls,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),r.segment?lv(this,(function(){return i._loaded()})):this._loaded(),Ms(this.config._onCapture)&&this.config._onCapture!==yh&&(Ws.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(function(e){return i.config._onCapture(e.event,e)}))),this}},{key:"_onRemoteConfig",value:function(e){var t,n,i,r,o,s,a,u,l=this;if(!ps||!ps.body)return Ws.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){l._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Cs(e.supportedCompression,us.GZipJS)?us.GZipJS:Cs(e.supportedCompression,us.Base64)?us.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null===(n=this.siteApps)||void 0===n||n.onRemoteConfig(e),null===(i=this.sessionRecording)||void 0===i||i.onRemoteConfig(e),null===(r=this.autocapture)||void 0===r||r.onRemoteConfig(e),null===(o=this.heatmaps)||void 0===o||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null===(s=this.webVitalsAutocapture)||void 0===s||s.onRemoteConfig(e),null===(a=this.exceptionObserver)||void 0===a||a.onRemoteConfig(e),null===(u=this.deadClicksAutocapture)||void 0===u||u.onRemoteConfig(e)}},{key:"_loaded",value:function(){var e=this;try{this.config.loaded(this)}catch(e){Ws.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){e.consent.isOptedIn()&&e._captureInitialPageview()}),1),new Uv(this).load(),this.featureFlags.decide()}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||ma(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(kh?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Gv(e.url,{ip:this.config.ip?1:0}),e.headers=P({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,i,r=P({},e);r.timeout=r.timeout||6e4,r.url=Gv(r.url,{_:(new Date).getTime().toString(),ver:ws.LIB_VERSION,compression:r.compression});var o=null!==(t=r.transport)&&void 0!==t?t:"fetch",s=null!==(n=null===(i=Ia(Yv,(function(e){return e.transport===o})))||void 0===i?void 0:i.method)&&void 0!==n?n:Yv[0].method;if(!s)throw new Error("No available transport method");s(r)}(P(P({},e),{},{callback:function(n){var i,r,o;(t.rateLimiter.checkForLimiting(n),n.statusCode>=400)&&(null===(r=(o=t.config).on_request_error)||void 0===r||r.call(o,n));null===(i=e.callback)||void 0===i||i.call(e,n)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,i=[],r=[],o=[];ma(e,(function(e){e&&(t=e[0],Ls(t)?o.push(e):Ms(e)?e.call(n):Ls(e)&&"alias"===t?i.push(e):Ls(e)&&-1!==t.indexOf("capture")&&Ms(n[t])?o.push(e):r.push(e))}));var s=function(e,t){ma(e,(function(e){if(Ls(e[0])){var n=t;ya(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(i,this),s(r,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,n){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!$s(e)&&Ds(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var r=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==r||!r.isRateLimited){null!=t&&t.$current_url&&!Ds(null==t?void 0:t.$current_url)&&(Ws.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,s=(null==n?void 0:n.timestamp)||o,a=Td(),u={uuid:a,event:e,properties:this._calculate_event_properties(e,t||{},s,a)};r&&(u.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),(null==n?void 0:n.$set)&&(u.$set=null==n?void 0:n.$set);var l=this._calculate_set_once_properties(null==n?void 0:n.$set_once);l&&(u.$set_once=l),(u=Ca(u,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,$s(null==n?void 0:n.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o);var c=P(P({},u.properties.$set),u.$set);if(qs(c)||this.setPersonPropertiesForFlags(c),!js(this.config.before_send)){var d=this._runBeforeSend(u);if(!d)return;u=d}this._internalEventEmitter.emit("eventCaptured",u);var f={method:"POST",url:null!==(i=null==n?void 0:n._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(f):this._requestQueue.enqueue(f),u}Ws.critical("This capture call is ignored due to client rate limiting.")}}else Ws.error("No event name provided to posthog.capture")}else Ws.uninitializedWarning("posthog.capture")}},{key:"_addCaptureHook",value:function(e){return this.on("eventCaptured",(function(t){return e(t.event,t)}))}},{key:"_calculate_event_properties",value:function(e,t,n,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),o=P({},t);if(o.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(o.$cookieless_mode=!0),"$snapshot"===e){var s=P(P({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,(!Ds(o.distinct_id)&&!Bs(o.distinct_id)||Ns(o.distinct_id))&&Ws.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var a,u=$u.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),c=l.sessionId,d=l.windowId;o.$session_id=c,o.$window_id=d}this.sessionPropsManager&&ba(o,this.sessionPropsManager.getSessionProps());try{var f,v;this.sessionRecording&&(o.$recording_status=this.sessionRecording.status,o.$sdk_debug_replay_internal_buffer_length=this.sessionRecording.buffer.data.length,o.$sdk_debug_replay_internal_buffer_size=this.sessionRecording.buffer.size),o.$sdk_debug_retry_queue_size=null===(f=this._retryQueue)||void 0===f||null===(v=f.queue)||void 0===v?void 0:v.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===eh.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),a="$pageview"===e?this.pageViewManager.doPageView(n,i):"$pageleave"===e?this.pageViewManager.doPageLeave(n):this.pageViewManager.doEvent(),o=ba(o,a),"$pageview"===e&&ps&&(o.title=ps.title),!$s(r)){var h=n.getTime()-r;o.$duration=parseFloat((h/1e3).toFixed(3))}bs&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=ba({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Ls(this.config.property_denylist)?ya(this.config.property_denylist,(function(e){delete o[e]})):Ws.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(Ws.error("sanitize_properties is deprecated. Use before_send instead"),o=p(o,e));var g=this._hasPersonProcessing();return o.$process_person_profile=g,g&&this._requirePersonProcessing("_calculate_event_properties"),o}},{key:"_calculate_set_once_properties",value:function(e){var t;if(!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var n=this.persistence.get_initial_props(),i=null===(t=this.sessionPropsManager)||void 0===t?void 0:t.getSetOnceProps(),r=ba({},n,i||{},e||{}),o=this.config.sanitize_properties;return o&&(Ws.error("sanitize_properties is deprecated. Use before_send instead"),r=o(r,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,qs(r)?void 0:r}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var i;null===(i=this.persistence)||void 0===i||i.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(M({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return this.featureFlags.getEarlyAccessFeatures(e,t,n)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSurveysLoaded",value:function(e){return this.surveys.onSurveysLoaded(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"renderSurvey",value:function(e,t){this.surveys.renderSurvey(e,t)}},{key:"canRenderSurvey",value:function(e){return this.surveys.canRenderSurvey(e)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return Ws.uninitializedWarning("posthog.identify");if(Bs(e)&&(e=e.toString(),Ws.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))Ws.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var r=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:r},"")}e!==i&&e!==this.get_property(Zr)&&(this.unregister(Zr),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(So)||"anonymous");e!==i&&o?(this.persistence.set_property(So,"identified"),this.setPersonPropertiesForFlags(P(P({},n||{}),t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=vh(e,t,n),this.featureFlags.setAnonymousDistinctId(i)):(t||n)&&this.setPersonProperties(t,n),e!==i&&(this.reloadFeatureFlags(),this.unregister(wo))}}else Ws.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var n=vh(this.get_distinct_id(),e,t);this._cachedPersonProperties!==n?(this.setPersonPropertiesForFlags(P(P({},t||{}),e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=n):Ws.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}},{key:"group",value:function(e,t,n){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:P(P({},i),{},M({},e,t))}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(M({},e,n))),i[e]===t||n||this.reloadFeatureFlags()}}else Ws.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,i,r;if(Ws.info("reset"),!this.__loaded)return Ws.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),this.surveys.reset(),null===(i=this.persistence)||void 0===i||i.set_property(So,"anonymous"),null===(r=this.sessionManager)||void 0===r||r.resetSessionId(),this._cachedPersonProperties=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ro,$device_id:null},"");else{var s=this.config.get_device_id(Td());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,i=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(null!=e&&e.withTimestamp&&i){var o,s=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!i)return r;var a=Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0);r+="?t=".concat(a)}return r}},{key:"alias",value:function(e,t){return e===this.get_property(Gr)?(Ws.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?($s(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Zr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Ws.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,n,i,r,o=P({},this.config);As(e)&&(ba(this.config,Sh(e)),null===(t=this.persistence)||void 0===t||t.update_config(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Nv(P(P({},this.config),{},{persistence:"sessionStorage"})),$d.is_supported()&&"true"===$d.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(ws.DEBUG=!0,Ws.info("set_config",JSON.stringify({config:e,oldConfig:o,newConfig:P({},this.config)},null,2))),null===(n=this.sessionRecording)||void 0===n||n.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(r=this.heatmaps)||void 0===r||r.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){var t=!0===e,n={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(n).some(Boolean)){var i,r,o,s,a;if(null===(i=this.sessionManager)||void 0===i||i.checkAndGetSessionAndWindowId(),n.sampling)null===(r=this.sessionRecording)||void 0===r||r.overrideSampling();if(n.linked_flag)null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag();if(n.url_trigger)null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url");if(n.event_trigger)null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"captureException",value:function(e,t){var n=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(P(P({},Mc(function(e){return e instanceof Error}(e)?{error:e,event:e.message}:{event:e},{syntheticException:n})),t))}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:bh;return t!==bh&&(t=bh+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(So))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(So))}},{key:"_hasPersonProcessing",value:function(){var e,t,n,i;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&qs(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[Zr])&&(null===(n=this.persistence)||void 0===n||null===(i=n.props)||void 0===i||!i[Io]))}},{key:"_shouldCapturePageleave",value:function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return"never"===this.config.person_profiles?(Ws.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Io,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,n,i,r=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||r&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==s&&(null===(n=this.persistence)||void 0===n||n.set_disabled(s));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==s&&(null===(i=this.sessionPersistence)||void 0===i||i.set_disabled(s))}},{key:"opt_in_capturing",value:function(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),$s(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"_is_bot",value:function(){return hs?fh(hs,this.config.custom_blocked_useragents):void 0}},{key:"_captureInitialPageview",value:function(){ps&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:ps.title},{send_instantly:!0}))}},{key:"debug",value:function(e){!1===e?(null==ls||ls.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==ls||ls.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"_runBeforeSend",value:function(e){if(js(this.config.before_send))return e;var t,n=e,i=H(Ls(this.config.before_send)?this.config.before_send:[this.config.before_send]);try{for(i.s();!(t=i.n()).done;){if(n=(0,t.value)(n),js(n)){var r="Event '".concat(e.event,"' was rejected in beforeSend function");return Vs(e.event)?Ws.warn("".concat(r,". This can cause unexpected behavior.")):Ws.info(r),null}n.properties&&!qs(n.properties)||Ws.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"getPageViewId",value:function(){var e;return null===(e=this.pageViewManager._currentPageview)||void 0===e?void 0:e.pageViewId}},{key:"captureTraceFeedback",value:function(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}},{key:"captureTraceMetric",value:function(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=xa(e.prototype[t[n]])}(Eh,["identify"]);var Ch,Ph;Ch=mh[bh]=new Eh,(Ph=ks.posthog)&&ya(Ph._i,(function(e){if(e&&Ls(e)){var t=Ch.init(e[0],e[1],e[2]),n=Ph[e[2]]||Ph;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),ks.posthog=Ch,function(){function e(){e.done||(e.done=!0,kh=!1,ya(mh,(function(e){e._dom_loaded()})))}null!=ps&&ps.addEventListener?"complete"===ps.readyState?e():Fa(ps,"DOMContentLoaded",e,{capture:!1}):ls&&Ws.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
|
|
1
|
+
!function(){"use strict";var e,t,n,i,r,o,s,a,u,l,c,d,f,v,h,p,g,_,m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(){return t?e:(t=1,e=function(e){try{return!!e()}catch(e){return!0}})}function b(){if(i)return n;i=1;var e=y();return n=!e((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))}function k(){if(o)return r;o=1;var e=b(),t=Function.prototype,n=t.call,i=e&&t.bind.bind(n,n);return r=e?i:function(e){return function(){return n.apply(e,arguments)}},r}function w(){if(a)return s;a=1;var e=k(),t=e({}.toString),n=e("".slice);return s=function(e){return n(t(e),8,-1)}}function S(){return d?c:(d=1,c=function(e){return null==e})}function x(){if(v)return f;v=1;var e=S(),t=TypeError;return f=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function E(){if(p)return h;p=1;var e=function(){if(l)return u;l=1;var e=k(),t=y(),n=w(),i=Object,r=e("".split);return u=t((function(){return!i("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?r(e,""):i(e)}:i}(),t=x();return h=function(n){return e(t(n))}}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(){T=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function a(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(e){a=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var r=t&&t.prototype instanceof d?t:d,o=Object.create(r.prototype),s=new S(i||[]);return o._invoke=function(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return E()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=b(s,n);if(a){if(a===c)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=l(e,t,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(e,n,s),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var c={};function d(){}function f(){}function v(){}var h={};a(h,r,(function(){return this}));var p=Object.getPrototypeOf,g=p&&p(p(x([])));g&&g!==t&&n.call(g,r)&&(h=g);var _=v.prototype=d.prototype=Object.create(h);function m(e){["next","throw","return"].forEach((function(t){a(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function i(r,o,s,a){var u=l(e[r],e,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,s,a)}),(function(e){i("throw",e,s,a)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,a)}))}a(u.arg)}var r;this._invoke=function(e,n){function o(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var i=l(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,c;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=v,a(_,"constructor",v),a(v,"constructor",f),f.displayName=a(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,a(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},m(y.prototype),a(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new y(u(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},m(_),a(_,s,"Generator"),a(_,r,(function(){return this})),a(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=x,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;w(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function F(e,t,n,i,r,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(i,r)}function R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function L(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);s=!0);}catch(e){a=!0,r=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw r}}return o}(e,t)||D(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e){return function(e){if(Array.isArray(e))return N(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||D(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.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)?N(e,t):void 0}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=D(e))||t){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function j(){if(_)return g;_=1;var e=function(e){return e&&e.Math===Math&&e};return g=e("object"==("undefined"==typeof globalThis?"undefined":I(globalThis))&&globalThis)||e("object"==("undefined"==typeof window?"undefined":I(window))&&window)||e("object"==("undefined"==typeof self?"undefined":I(self))&&self)||e("object"==I(m)&&m)||e("object"==I(g)&&g)||function(){return this}()||Function("return this")()}var B,U,z,V,W,G,Z,Q,Y,J,X,K,ee,te,ne,ie,re,oe,se,ae,ue,le,ce,de,fe,ve,he,pe,ge,_e={exports:{}};function me(){return U?B:(U=1,B=!1)}function ye(){if(V)return z;V=1;var e=j(),t=Object.defineProperty;return z=function(n,i){try{t(e,n,{value:i,configurable:!0,writable:!0})}catch(t){e[n]=i}return i}}function be(){if(W)return _e.exports;W=1;var e=me(),t=j(),n=ye(),i="__core-js_shared__",r=_e.exports=t[i]||n(i,{});return(r.versions||(r.versions=[])).push({version:"3.38.1",mode:e?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"}),_e.exports}function ke(){if(Z)return G;Z=1;var e=be();return G=function(t,n){return e[t]||(e[t]=n||{})}}function we(){if(Y)return Q;Y=1;var e=x(),t=Object;return Q=function(n){return t(e(n))}}function Se(){if(X)return J;X=1;var e=k(),t=we(),n=e({}.hasOwnProperty);return J=Object.hasOwn||function(e,i){return n(t(e),i)}}function xe(){if(ee)return K;ee=1;var e=k(),t=0,n=Math.random(),i=e(1..toString);return K=function(e){return"Symbol("+(void 0===e?"":e)+")_"+i(++t+n,36)}}function Ee(){if(re)return ie;re=1;var e,t,n=j(),i=function(){if(ne)return te;ne=1;var e=j().navigator,t=e&&e.userAgent;return te=t?String(t):""}(),r=n.process,o=n.Deno,s=r&&r.versions||o&&o.version,a=s&&s.v8;return a&&(t=(e=a.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&i&&(!(e=i.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=i.match(/Chrome\/(\d+)/))&&(t=+e[1]),ie=t}function Ce(){if(se)return oe;se=1;var e=Ee(),t=y(),n=j().String;return oe=!!Object.getOwnPropertySymbols&&!t((function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41}))}function Pe(){if(ue)return ae;ue=1;var e=Ce();return ae=e&&!Symbol.sham&&"symbol"==I(Symbol.iterator)}function Te(){if(ce)return le;ce=1;var e=j(),t=ke(),n=Se(),i=xe(),r=Ce(),o=Pe(),s=e.Symbol,a=t("wks"),u=o?s.for||s:s&&s.withoutSetter||i;return le=function(e){return n(a,e)||(a[e]=r&&n(s,e)?s[e]:u("Symbol."+e)),a[e]},le}function Ie(){if(fe)return de;fe=1;var e="object"==("undefined"==typeof document?"undefined":I(document))&&document.all;return de=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function Fe(){if(he)return ve;he=1;var e=Ie();return ve=function(t){return"object"==I(t)?null!==t:e(t)}}function Re(){if(ge)return pe;ge=1;var e=Fe(),t=String,n=TypeError;return pe=function(i){if(e(i))return i;throw new n(t(i)+" is not an object")}}var Oe,Le,Me,Ae,qe={};function $e(){if(Le)return Oe;Le=1;var e=y();return Oe=!e((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function De(){if(Ae)return Me;Ae=1;var e=$e(),t=y();return Me=e&&t((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}var Ne,He,je,Be,Ue,ze,Ve,We,Ge,Ze,Qe,Ye,Je,Xe,Ke,et,tt,nt,it,rt,ot,st,at,ut,lt,ct,dt,ft,vt,ht,pt,gt,_t,mt,yt,bt,kt,wt,St,xt,Et,Ct,Pt,Tt,It,Ft,Rt,Ot,Lt,Mt,At,qt,$t,Dt,Nt,Ht,jt,Bt,Ut,zt,Vt,Wt,Gt,Zt,Qt={};function Yt(){if(He)return Ne;He=1;var e=j(),t=Fe(),n=e.document,i=t(n)&&t(n.createElement);return Ne=function(e){return i?n.createElement(e):{}}}function Jt(){if(Be)return je;Be=1;var e=$e(),t=y(),n=Yt();return je=!e&&!t((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))}function Xt(){if(ze)return Ue;ze=1;var e=b(),t=Function.prototype.call;return Ue=e?t.bind(t):function(){return t.apply(t,arguments)},Ue}function Kt(){if(We)return Ve;We=1;var e=j(),t=Ie();return Ve=function(n,i){return arguments.length<2?(r=e[n],t(r)?r:void 0):e[n]&&e[n][i];var r},Ve}function en(){if(Ze)return Ge;Ze=1;var e=k();return Ge=e({}.isPrototypeOf)}function tn(){if(Ye)return Qe;Ye=1;var e=Kt(),t=Ie(),n=en(),i=Pe(),r=Object;return Qe=i?function(e){return"symbol"==I(e)}:function(i){var o=e("Symbol");return t(o)&&n(o.prototype,r(i))}}function nn(){if(Xe)return Je;Xe=1;var e=String;return Je=function(t){try{return e(t)}catch(e){return"Object"}}}function rn(){if(et)return Ke;et=1;var e=Ie(),t=nn(),n=TypeError;return Ke=function(i){if(e(i))return i;throw new n(t(i)+" is not a function")}}function on(){if(nt)return tt;nt=1;var e=rn(),t=S();return tt=function(n,i){var r=n[i];return t(r)?void 0:e(r)},tt}function sn(){if(rt)return it;rt=1;var e=Xt(),t=Ie(),n=Fe(),i=TypeError;return it=function(r,o){var s,a;if("string"===o&&t(s=r.toString)&&!n(a=e(s,r)))return a;if(t(s=r.valueOf)&&!n(a=e(s,r)))return a;if("string"!==o&&t(s=r.toString)&&!n(a=e(s,r)))return a;throw new i("Can't convert object to primitive value")}}function an(){if(st)return ot;st=1;var e=Xt(),t=Fe(),n=tn(),i=on(),r=sn(),o=Te(),s=TypeError,a=o("toPrimitive");return ot=function(o,u){if(!t(o)||n(o))return o;var l,c=i(o,a);if(c){if(void 0===u&&(u="default"),l=e(c,o,u),!t(l)||n(l))return l;throw new s("Can't convert object to primitive value")}return void 0===u&&(u="number"),r(o,u)}}function un(){if(ut)return at;ut=1;var e=an(),t=tn();return at=function(n){var i=e(n,"string");return t(i)?i:i+""}}function ln(){if(lt)return Qt;lt=1;var e=$e(),t=Jt(),n=De(),i=Re(),r=un(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Qt.f=e?n?function(e,t,n){if(i(e),t=r(t),i(n),"function"==typeof e&&"prototype"===t&&"value"in n&&c in n&&!n[c]){var o=a(e,t);o&&o[c]&&(e[t]=n.value,n={configurable:l in n?n[l]:o[l],enumerable:u in n?n[u]:o[u],writable:!1})}return s(e,t,n)}:s:function(e,n,a){if(i(e),n=r(n),i(a),t)try{return s(e,n,a)}catch(e){}if("get"in a||"set"in a)throw new o("Accessors not supported");return"value"in a&&(e[n]=a.value),e},Qt}function cn(){if(vt)return ft;vt=1;var e=function(){if(dt)return ct;dt=1;var e=Math.ceil,t=Math.floor;return ct=Math.trunc||function(n){var i=+n;return(i>0?t:e)(i)},ct}();return ft=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function dn(){if(pt)return ht;pt=1;var e=cn(),t=Math.max,n=Math.min;return ht=function(i,r){var o=e(i);return o<0?t(o+r,0):n(o,r)}}function fn(){if(_t)return gt;_t=1;var e=cn(),t=Math.min;return gt=function(n){var i=e(n);return i>0?t(i,9007199254740991):0}}function vn(){if(yt)return mt;yt=1;var e=fn();return mt=function(t){return e(t.length)}}function hn(){return St?wt:(St=1,wt={})}function pn(){if(Et)return xt;Et=1;var e=k(),t=Se(),n=E(),i=function(){if(kt)return bt;kt=1;var e=E(),t=dn(),n=vn(),i=function(i){return function(r,o,s){var a=e(r),u=n(a);if(0===u)return!i&&-1;var l,c=t(s,u);if(i&&o!=o){for(;u>c;)if((l=a[c++])!=l)return!0}else for(;u>c;c++)if((i||c in a)&&a[c]===o)return i||c||0;return!i&&-1}};return bt={includes:i(!0),indexOf:i(!1)}}().indexOf,r=hn(),o=e([].push);return xt=function(e,s){var a,u=n(e),l=0,c=[];for(a in u)!t(r,a)&&t(u,a)&&o(c,a);for(;s.length>l;)t(u,a=s[l++])&&(~i(c,a)||o(c,a));return c},xt}function gn(){return Pt?Ct:(Pt=1,Ct=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}function _n(){if(It)return Tt;It=1;var e=pn(),t=gn();return Tt=Object.keys||function(n){return e(n,t)},Tt}function mn(){if(Ot)return Rt;Ot=1;var e=Kt();return Rt=e("document","documentElement")}function yn(){if(Mt)return Lt;Mt=1;var e=ke(),t=xe(),n=e("keys");return Lt=function(e){return n[e]||(n[e]=t(e))}}function bn(){if(qt)return At;qt=1;var e,t=Re(),n=function(){if(Ft)return qe;Ft=1;var e=$e(),t=De(),n=ln(),i=Re(),r=E(),o=_n();return qe.f=e&&!t?Object.defineProperties:function(e,t){i(e);for(var s,a=r(t),u=o(t),l=u.length,c=0;l>c;)n.f(e,s=u[c++],a[s]);return e},qe}(),i=gn(),r=hn(),o=mn(),s=Yt(),a=yn(),u="prototype",l="script",c=a("IE_PROTO"),d=function(){},f=function(e){return"<"+l+">"+e+"</"+l+">"},v=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,r;h="undefined"!=typeof document?document.domain&&e?v(e):(n=s("iframe"),r="java"+l+":",n.style.display="none",o.appendChild(n),n.src=String(r),(t=n.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F):v(e);for(var a=i.length;a--;)delete h[u][i[a]];return h()};return r[c]=!0,At=Object.create||function(e,i){var r;return null!==e?(d[u]=t(e),r=new d,d[u]=null,r[c]=e):r=h(),void 0===i?r:n.f(r,i)},At}function kn(){if(Dt)return $t;Dt=1;var e=Te(),t=bn(),n=ln().f,i=e("unscopables"),r=Array.prototype;return void 0===r[i]&&n(r,i,{configurable:!0,value:t(null)}),$t=function(e){r[i][e]=!0}}function wn(){return Ht?Nt:(Ht=1,Nt={})}function Sn(){return zt?Ut:(zt=1,Ut=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function xn(){if(Wt)return Vt;Wt=1;var e=$e(),t=ln(),n=Sn();return Vt=e?function(e,i,r){return t.f(e,i,n(1,r))}:function(e,t,n){return e[t]=n,e}}function En(){if(Zt)return Gt;Zt=1;var e,t,n,i=function(){if(Bt)return jt;Bt=1;var e=j(),t=Ie(),n=e.WeakMap;return jt=t(n)&&/native code/.test(String(n))}(),r=j(),o=Fe(),s=xn(),a=Se(),u=be(),l=yn(),c=hn(),d="Object already initialized",f=r.TypeError,v=r.WeakMap;if(i||u.state){var h=u.state||(u.state=new v);h.get=h.get,h.has=h.has,h.set=h.set,e=function(e,t){if(h.has(e))throw new f(d);return t.facade=e,h.set(e,t),t},t=function(e){return h.get(e)||{}},n=function(e){return h.has(e)}}else{var p=l("state");c[p]=!0,e=function(e,t){if(a(e,p))throw new f(d);return t.facade=e,s(e,p,t),t},t=function(e){return a(e,p)?e[p]:{}},n=function(e){return a(e,p)}}return Gt={set:e,get:t,has:n,enforce:function(i){return n(i)?t(i):e(i,{})},getterFor:function(e){return function(n){var i;if(!o(n)||(i=t(n)).type!==e)throw new f("Incompatible receiver, "+e+" required");return i}}}}var Cn,Pn,Tn={},In={};function Fn(){if(Pn)return Tn;Pn=1;var e=$e(),t=Xt(),n=function(){if(Cn)return In;Cn=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return In.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,In}(),i=Sn(),r=E(),o=un(),s=Se(),a=Jt(),u=Object.getOwnPropertyDescriptor;return Tn.f=e?u:function(e,l){if(e=r(e),l=o(l),a)try{return u(e,l)}catch(e){}if(s(e,l))return i(!t(n.f,e,l),e[l])},Tn}var Rn,On,Ln,Mn,An,qn,$n,Dn={exports:{}};function Nn(){if(On)return Rn;On=1;var e=$e(),t=Se(),n=Function.prototype,i=e&&Object.getOwnPropertyDescriptor,r=t(n,"name"),o=r&&"something"===function(){}.name,s=r&&(!e||e&&i(n,"name").configurable);return Rn={EXISTS:r,PROPER:o,CONFIGURABLE:s}}function Hn(){if(Mn)return Ln;Mn=1;var e=k(),t=Ie(),n=be(),i=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return i(e)}),Ln=n.inspectSource}function jn(){if(An)return Dn.exports;An=1;var e=k(),t=y(),n=Ie(),i=Se(),r=$e(),o=Nn().CONFIGURABLE,s=Hn(),a=En(),u=a.enforce,l=a.get,c=String,d=Object.defineProperty,f=e("".slice),v=e("".replace),h=e([].join),p=r&&!t((function(){return 8!==d((function(){}),"length",{value:8}).length})),g=String(String).split("String"),_=Dn.exports=function(e,t,n){"Symbol("===f(c(t),0,7)&&(t="["+v(c(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!i(e,"name")||o&&e.name!==t)&&(r?d(e,"name",{value:t,configurable:!0}):e.name=t),p&&n&&i(n,"arity")&&e.length!==n.arity&&d(e,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?r&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var s=u(e);return i(s,"source")||(s.source=h(g,"string"==typeof t?t:"")),e};return Function.prototype.toString=_((function(){return n(this)&&l(this).source||s(this)}),"toString"),Dn.exports}function Bn(){if($n)return qn;$n=1;var e=Ie(),t=ln(),n=jn(),i=ye();return qn=function(r,o,s,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:o;if(e(s)&&n(s,l,a),a.global)u?r[o]=s:i(o,s);else{try{a.unsafe?r[o]&&(u=!0):delete r[o]}catch(e){}u?r[o]=s:t.f(r,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return r},qn}var Un,zn={};var Vn,Wn,Gn,Zn,Qn,Yn,Jn,Xn,Kn,ei,ti,ni,ii,ri,oi,si,ai,ui,li,ci,di,fi,vi,hi,pi,gi,_i,mi,yi,bi,ki,wi,Si,xi={};function Ei(){if(Gn)return Wn;Gn=1;var e=Kt(),t=k(),n=function(){if(Un)return zn;Un=1;var e=pn(),t=gn().concat("length","prototype");return zn.f=Object.getOwnPropertyNames||function(n){return e(n,t)},zn}(),i=(Vn||(Vn=1,xi.f=Object.getOwnPropertySymbols),xi),r=Re(),o=t([].concat);return Wn=e("Reflect","ownKeys")||function(e){var t=n.f(r(e)),s=i.f;return s?o(t,s(e)):t}}function Ci(){if(Qn)return Zn;Qn=1;var e=Se(),t=Ei(),n=Fn(),i=ln();return Zn=function(r,o,s){for(var a=t(o),u=i.f,l=n.f,c=0;c<a.length;c++){var d=a[c];e(r,d)||s&&e(s,d)||u(r,d,l(o,d))}},Zn}function Pi(){if(Kn)return Xn;Kn=1;var e=j(),t=Fn().f,n=xn(),i=Bn(),r=ye(),o=Ci(),s=function(){if(Jn)return Yn;Jn=1;var e=y(),t=Ie(),n=/#|\.prototype\./,i=function(n,i){var u=o[r(n)];return u===a||u!==s&&(t(i)?e(i):!!i)},r=i.normalize=function(e){return String(e).replace(n,".").toLowerCase()},o=i.data={},s=i.NATIVE="N",a=i.POLYFILL="P";return Yn=i}();return Xn=function(a,u){var l,c,d,f,v,h=a.target,p=a.global,g=a.stat;if(l=p?e:g?e[h]||r(h,{}):e[h]&&e[h].prototype)for(c in u){if(f=u[c],d=a.dontCallGetSet?(v=t(l,c))&&v.value:l[c],!s(p?c:h+(g?".":"#")+c,a.forced)&&void 0!==d){if(I(f)==I(d))continue;o(f,d)}(a.sham||d&&d.sham)&&n(f,"sham",!0),i(l,c,f,a)}}}function Ti(){if(ii)return ni;ii=1;var e=Se(),t=Ie(),n=we(),i=yn(),r=function(){if(ti)return ei;ti=1;var e=y();return ei=!e((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),ei}(),o=i("IE_PROTO"),s=Object,a=s.prototype;return ni=r?s.getPrototypeOf:function(i){var r=n(i);if(e(r,o))return r[o];var u=r.constructor;return t(u)&&r instanceof u?u.prototype:r instanceof s?a:null},ni}function Ii(){if(oi)return ri;oi=1;var e,t,n,i=y(),r=Ie(),o=Fe(),s=bn(),a=Ti(),u=Bn(),l=Te(),c=me(),d=l("iterator"),f=!1;return[].keys&&("next"in(n=[].keys())?(t=a(a(n)))!==Object.prototype&&(e=t):f=!0),!o(e)||i((function(){var t={};return e[d].call(t)!==t}))?e={}:c&&(e=s(e)),r(e[d])||u(e,d,(function(){return this})),ri={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:f}}function Fi(){if(ai)return si;ai=1;var e=ln().f,t=Se(),n=Te()("toStringTag");return si=function(i,r,o){i&&!o&&(i=i.prototype),i&&!t(i,n)&&e(i,n,{configurable:!0,value:r})}}function Ri(){if(vi)return fi;vi=1;var e=Fe();return fi=function(t){return e(t)||null===t}}function Oi(){if(pi)return hi;pi=1;var e=Ri(),t=String,n=TypeError;return hi=function(i){if(e(i))return i;throw new n("Can't set "+t(i)+" as a prototype")}}function Li(){if(_i)return gi;_i=1;var e=function(){if(di)return ci;di=1;var e=k(),t=rn();return ci=function(n,i,r){try{return e(t(Object.getOwnPropertyDescriptor(n,i)[r]))}catch(e){}}}(),t=Fe(),n=x(),i=Oi();return gi=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,s={};try{(r=e(Object.prototype,"__proto__","set"))(s,[]),o=s instanceof Array}catch(e){}return function(e,s){return n(e),i(s),t(e)?(o?r(e,s):e.__proto__=s,e):e}}():void 0),gi}function Mi(){if(yi)return mi;yi=1;var e=Pi(),t=Xt(),n=me(),i=Nn(),r=Ie(),o=function(){if(li)return ui;li=1;var e=Ii().IteratorPrototype,t=bn(),n=Sn(),i=Fi(),r=wn(),o=function(){return this};return ui=function(s,a,u,l){var c=a+" Iterator";return s.prototype=t(e,{next:n(+!l,u)}),i(s,c,!1,!0),r[c]=o,s},ui}(),s=Ti(),a=Li(),u=Fi(),l=xn(),c=Bn(),d=Te(),f=wn(),v=Ii(),h=i.PROPER,p=i.CONFIGURABLE,g=v.IteratorPrototype,_=v.BUGGY_SAFARI_ITERATORS,m=d("iterator"),y="keys",b="values",k="entries",w=function(){return this};return mi=function(i,d,v,S,x,E,C){o(v,d,S);var P,T,I,F=function(e){if(e===x&&A)return A;if(!_&&e&&e in L)return L[e];switch(e){case y:case b:case k:return function(){return new v(this,e)}}return function(){return new v(this)}},R=d+" Iterator",O=!1,L=i.prototype,M=L[m]||L["@@iterator"]||x&&L[x],A=!_&&M||F(x),q="Array"===d&&L.entries||M;if(q&&(P=s(q.call(new i)))!==Object.prototype&&P.next&&(n||s(P)===g||(a?a(P,g):r(P[m])||c(P,m,w)),u(P,R,!0,!0),n&&(f[R]=w)),h&&x===b&&M&&M.name!==b&&(!n&&p?l(L,"name",b):(O=!0,A=function(){return t(M,this)})),x)if(T={values:F(b),keys:E?A:F(y),entries:F(k)},C)for(I in T)(_||O||!(I in L))&&c(L,I,T[I]);else e({target:d,proto:!0,forced:_||O},T);return n&&!C||L[m]===A||c(L,m,A,{name:x}),f[d]=A,T},mi}function Ai(){return ki?bi:(ki=1,bi=function(e,t){return{value:e,done:t}})}function qi(){if(Si)return wi;Si=1;var e=E(),t=kn(),n=wn(),i=En(),r=ln().f,o=Mi(),s=Ai(),a=me(),u=$e(),l="Array Iterator",c=i.set,d=i.getterFor(l);wi=o(Array,"Array",(function(t,n){c(this,{type:l,target:e(t),index:0,kind:n})}),(function(){var e=d(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,s(void 0,!0);switch(e.kind){case"keys":return s(n,!1);case"values":return s(t[n],!1)}return s([n,t[n]],!1)}),"values");var f=n.Arguments=n.Array;if(t("keys"),t("values"),t("entries"),!a&&u&&"values"!==f.name)try{r(f,"name",{value:"values"})}catch(e){}return wi}var $i,Di,Ni,Hi,ji,Bi,Ui,zi,Vi,Wi,Gi,Zi,Qi,Yi,Ji,Xi,Ki,er,tr,nr,ir,rr,or,sr,ar,ur={};function lr(){if(Hi)return Ni;Hi=1;var e=function(){if(Di)return $i;Di=1;var e=w(),t=k();return $i=function(n){if("Function"===e(n))return t(n)}}(),t=rn(),n=b(),i=e(e.bind);return Ni=function(e,r){return t(e),void 0===r?e:n?i(e,r):function(){return e.apply(r,arguments)}},Ni}function cr(){if(Bi)return ji;Bi=1;var e=Te(),t=wn(),n=e("iterator"),i=Array.prototype;return ji=function(e){return void 0!==e&&(t.Array===e||i[n]===e)}}function dr(){if(Wi)return Vi;Wi=1;var e=function(){if(zi)return Ui;zi=1;var e={};return e[Te()("toStringTag")]="z",Ui="[object z]"===String(e)}(),t=Ie(),n=w(),i=Te()("toStringTag"),r=Object,o="Arguments"===n(function(){return arguments}());return Vi=e?n:function(e){var s,a,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(a=function(e,t){try{return e[t]}catch(e){}}(s=r(e),i))?a:o?n(s):"Object"===(u=n(s))&&t(s.callee)?"Arguments":u},Vi}function fr(){if(Zi)return Gi;Zi=1;var e=dr(),t=on(),n=S(),i=wn(),r=Te()("iterator");return Gi=function(o){if(!n(o))return t(o,r)||t(o,"@@iterator")||i[e(o)]}}function vr(){if(Yi)return Qi;Yi=1;var e=Xt(),t=rn(),n=Re(),i=nn(),r=fr(),o=TypeError;return Qi=function(s,a){var u=arguments.length<2?r(s):a;if(t(u))return n(e(u,s));throw new o(i(s)+" is not iterable")},Qi}function hr(){if(Xi)return Ji;Xi=1;var e=Xt(),t=Re(),n=on();return Ji=function(i,r,o){var s,a;t(i);try{if(!(s=n(i,"return"))){if("throw"===r)throw o;return o}s=e(s,i)}catch(e){a=!0,s=e}if("throw"===r)throw o;if(a)throw s;return t(s),o}}function pr(){if(er)return Ki;er=1;var e=lr(),t=Xt(),n=Re(),i=nn(),r=cr(),o=vn(),s=en(),a=vr(),u=fr(),l=hr(),c=TypeError,d=function(e,t){this.stopped=e,this.result=t},f=d.prototype;return Ki=function(v,h,p){var g,_,m,y,b,k,w,S=p&&p.that,x=!(!p||!p.AS_ENTRIES),E=!(!p||!p.IS_RECORD),C=!(!p||!p.IS_ITERATOR),P=!(!p||!p.INTERRUPTED),T=e(h,S),F=function(e){return g&&l(g,"normal",e),new d(!0,e)},R=function(e){return x?(n(e),P?T(e[0],e[1],F):T(e[0],e[1])):P?T(e,F):T(e)};if(E)g=v.iterator;else if(C)g=v;else{if(!(_=u(v)))throw new c(i(v)+" is not iterable");if(r(_)){for(m=0,y=o(v);y>m;m++)if((b=R(v[m]))&&s(f,b))return b;return new d(!1)}g=a(v,_)}for(k=E?v.next:g.next;!(w=t(k,g)).done;){try{b=R(w.value)}catch(e){l(g,"throw",e)}if("object"==I(b)&&b&&s(f,b))return b}return new d(!1)}}function gr(){if(nr)return tr;nr=1;var e=$e(),t=ln(),n=Sn();return tr=function(i,r,o){e?t.f(i,r,n(0,o)):i[r]=o}}function _r(){if(or)return rr;or=1;var e=j();return rr=e}function mr(){if(ar)return sr;ar=1,qi(),function(){if(ir)return ur;ir=1;var e=Pi(),t=pr(),n=gr();e({target:"Object",stat:!0},{fromEntries:function(e){var i={};return t(e,(function(e,t){n(i,e,t)}),{AS_ENTRIES:!0}),i}})}();var e=_r();return sr=e.Object.fromEntries}var yr,br,kr,wr,Sr,xr,Er,Cr,Pr,Tr,Ir,Fr,Rr={};function Or(){if(Sr)return Rr;Sr=1;var e=j(),t=br?yr:(br=1,yr={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}),n=function(){if(wr)return kr;wr=1;var e=Yt()("span").classList,t=e&&e.constructor&&e.constructor.prototype;return kr=t===Object.prototype?void 0:t}(),i=qi(),r=xn(),o=Fi(),s=Te()("iterator"),a=i.values,u=function(e,n){if(e){if(e[s]!==a)try{r(e,s,a)}catch(t){e[s]=a}if(o(e,n,!0),t[n])for(var u in i)if(e[u]!==i[u])try{r(e,u,i[u])}catch(t){e[u]=i[u]}}};for(var l in t)u(e[l]&&e[l].prototype,l);return u(n,"DOMTokenList"),Rr}function Lr(){if(Pr)return Cr;Pr=1;var e=function(){if(Er)return xr;Er=1;var e=mr();return Or(),xr=e}();return Cr=e}Fr||(Fr=1,function(){if(Ir)return Tr;Ir=1;var e=Lr();Tr=e}());var Mr,Ar,qr,$r,Dr,Nr,Hr,jr,Br,Ur,zr,Vr,Wr,Gr="$people_distinct_id",Zr="__alias",Qr="__timers",Yr="$autocapture_disabled_server_side",Jr="$heatmaps_enabled_server_side",Xr="$exception_capture_enabled_server_side",Kr="$web_vitals_enabled_server_side",eo="$dead_clicks_enabled_server_side",to="$web_vitals_allowed_metrics",no="$session_recording_enabled_server_side",io="$console_log_recording_enabled_server_side",ro="$session_recording_network_payload_capture",oo="$session_recording_masking",so="$session_recording_canvas_recording",ao="$replay_sample_rate",uo="$replay_minimum_duration",lo="$replay_script_config",co="$sesid",fo="$session_is_sampled",vo="$session_recording_url_trigger_activated_session",ho="$session_recording_event_trigger_activated_session",po="$enabled_feature_flags",go="$early_access_features",_o="$feature_flag_details",mo="$stored_person_properties",yo="$stored_group_properties",bo="$surveys",ko="$surveys_activated",wo="$flag_call_reported",So="$user_state",xo="$client_session_props",Eo="$capture_rate_limit",Co="$initial_campaign_params",Po="$initial_referrer_info",To="$initial_person_info",Io="$epp",Fo="__POSTHOG_TOOLBAR__",Ro="$posthog_cookieless",Oo=[Gr,Zr,"__cmpns",Qr,no,Jr,co,po,So,go,_o,yo,mo,bo,wo,xo,Eo,Co,Po,Io],Lo={},Mo=[],Ao=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qo=Array.isArray;function $o(e,t){for(var n in t)e[n]=t[n];return e}function Do(e){var t=e.parentNode;t&&t.removeChild(e)}function No(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Mr.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Ho(e,s,i,r,null)}function Ho(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++qr:r,__i:-1,__u:0};return null==r&&null!=Ar.vnode&&Ar.vnode(o),o}function jo(e){return e.children}function Bo(e,t){this.props=e,this.context=t}function Uo(e,t){if(null==t)return e.__?Uo(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Uo(e):null}function zo(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return zo(e)}}function Vo(e){(!e.__d&&(e.__d=!0)&&$r.push(e)&&!Wo.__r++||Dr!==Ar.debounceRendering)&&((Dr=Ar.debounceRendering)||Nr)(Wo)}function Wo(){var e,t,n,i,r,o,s,a,u;for($r.sort(Hr);e=$r.shift();)e.__d&&(t=$r.length,i=void 0,o=(r=(n=e).__v).__e,a=[],u=[],(s=n.__P)&&((i=$o({},r)).__v=r.__v+1,Ar.vnode&&Ar.vnode(i),es(s,i,r,n.__n,void 0!==s.ownerSVGElement,32&r.__u?[o]:null,a,null==o?Uo(r):o,!!(32&r.__u),u),i.__.__k[i.__i]=i,ts(a,i,u),i.__e!=o&&zo(i)),$r.length>t&&$r.sort(Hr));Wo.__r=0}function Go(e,t,n,i,r,o,s,a,u,l,c){var d,f,v,h,p,g=i&&i.__k||Mo,_=t.length;for(n.__d=u,function(e,t,n){var i,r,o,s,a,u=t.length,l=n.length,c=l,d=0;for(e.__k=[],i=0;i<u;i++)null!=(r=e.__k[i]=null==(r=t[i])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?Ho(null,r,null,null,r):qo(r)?Ho(jo,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?Ho(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=Qo(r,n,s=i+d,c),r.__i=a,o=null,-1!==a&&(c--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof r.type&&(r.__u|=65536)):a!==s&&(a===s+1?d++:a>s?c>u-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==i+d&&(r.__u|=65536))):(o=n[i])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=Uo(o)),rs(o,o,!1),n[i]=null,c--);if(c)for(i=0;i<l;i++)null!=(o=n[i])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=Uo(o)),rs(o,o))}(n,t,g),u=n.__d,d=0;d<_;d++)null!=(v=n.__k[d])&&"boolean"!=typeof v&&"function"!=typeof v&&(f=-1===v.__i?Lo:g[v.__i]||Lo,v.__i=d,es(e,v,f,r,o,s,a,u,l,c),h=v.__e,v.ref&&f.ref!=v.ref&&(f.ref&&is(f.ref,null,v),c.push(v.ref,v.__c||h,v)),null==p&&null!=h&&(p=h),65536&v.__u||f.__k===v.__k?u=Zo(v,u,e):"function"==typeof v.type&&void 0!==v.__d?u=v.__d:h&&(u=h.nextSibling),v.__d=void 0,v.__u&=-196609);n.__d=u,n.__e=p}function Zo(e,t,n){var i,r;if("function"==typeof e.type){for(i=e.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=e,t=Zo(i[r],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Qo(e,t,n,i){var r=e.key,o=e.type,s=n-1,a=n+1,u=t[n];if(null===u||u&&r==u.key&&o===u.type)return n;if(i>(null!=u&&0==(131072&u.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((u=t[s])&&0==(131072&u.__u)&&r==u.key&&o===u.type)return s;s--}if(a<t.length){if((u=t[a])&&0==(131072&u.__u)&&r==u.key&&o===u.type)return a;a++}}return-1}function Yo(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ao.test(t)?n:n+"px"}function Jo(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Yo(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Yo(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n.u=i.u:(n.u=Date.now(),e.addEventListener(t,o?Ko:Xo,o)):e.removeEventListener(t,o?Ko:Xo,o);else{if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&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,n))}}function Xo(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Ar.event?Ar.event(e):e)}function Ko(e){return this.l[e.type+!0](Ar.event?Ar.event(e):e)}function es(e,t,n,i,r,o,s,a,u,l){var c,d,f,v,h,p,g,_,m,y,b,k,w,S,x,E=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=Ar.__b)&&c(t);e:if("function"==typeof E)try{if(_=t.props,m=(c=E.contextType)&&i[c.__c],y=c?m?m.props.value:c.__:i,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?t.__c=d=new E(_,y):(t.__c=d=new Bo(_,y),d.constructor=E,d.render=os),m&&m.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=i,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=$o({},d.__s)),$o(d.__s,E.getDerivedStateFromProps(_,d.__s))),v=d.props,h=d.state,d.__v=t,f)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&_!==v&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(v,h,p)}))}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,k=Ar.__r,w=0,"prototype"in E&&E.prototype.render){for(d.state=d.__s,d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(i=$o($o({},i),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(p=d.getSnapshotBeforeUpdate(v,h)),Go(e,qo(x=null!=c&&c.type===jo&&null==c.key?c.props.children:c)?x:[x],t,n,i,r,o,s,a,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,u||null!=o?(t.__e=a,t.__u|=u?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Ar.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ns(n.__e,t,n,i,r,o,s,u,l);(c=Ar.diffed)&&c(t)}function ts(e,t,n){t.__d=void 0;for(var i=0;i<n.length;i++)is(n[i],n[++i],n[++i]);Ar.__c&&Ar.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Ar.__e(e,t.__v)}}))}function ns(e,t,n,i,r,o,s,a,u){var l,c,d,f,v,h,p,g=n.props,_=t.props,m=t.type;if("svg"===m&&(r=!0),null!=o)for(l=0;l<o.length;l++)if((v=o[l])&&"setAttribute"in v==!!m&&(m?v.localName===m:3===v.nodeType)){e=v,o[l]=null;break}if(null==e){if(null===m)return document.createTextNode(_);e=r?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,_.is&&_),o=null,a=!1}if(null===m)g===_||a&&e.data===_||(e.data=_);else{if(o=o&&Mr.call(e.childNodes),g=n.props||Lo,!a&&null!=o)for(g={},l=0;l<e.attributes.length;l++)g[(v=e.attributes[l]).name]=v.value;for(l in g)v=g[l],"children"==l||("dangerouslySetInnerHTML"==l?d=v:"key"===l||l in _||Jo(e,l,null,v,r));for(l in _)v=_[l],"children"==l?f=v:"dangerouslySetInnerHTML"==l?c=v:"value"==l?h=v:"checked"==l?p=v:"key"===l||a&&"function"!=typeof v||g[l]===v||Jo(e,l,v,g[l],r);if(c)a||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),Go(e,qo(f)?f:[f],t,n,i,r&&"foreignObject"!==m,o,s,o?o[0]:n.__k&&Uo(n,0),a,u),null!=o)for(l=o.length;l--;)null!=o[l]&&Do(o[l]);a||(l="value",void 0!==h&&(h!==e[l]||"progress"===m&&!h||"option"===m&&h!==g[l])&&Jo(e,l,h,g[l],!1),l="checked",void 0!==p&&p!==e[l]&&Jo(e,l,p,g[l],!1))}return e}function is(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Ar.__e(e,n)}}function rs(e,t,n){var i,r;if(Ar.unmount&&Ar.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||is(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Ar.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&rs(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Do(e.__e),e.__=e.__e=e.__d=void 0}function os(e,t,n){return this.constructor(e,n)}function ss(e,t,n){var i,r,o,s;Ar.__&&Ar.__(e,t),r=(i="function"==typeof n)?null:t.__k,o=[],s=[],es(t,e=(!i&&n||t).__k=No(jo,null,[e]),r||Lo,Lo,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Mr.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i,s),ts(o,e,s)}function as(e,t,n){var i,r,o,s,a=$o({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?Mr.call(arguments,2):n),Ho(e.type,a,i||e.key,r||e.ref,null)}Mr=Mo.slice,Ar={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},qr=0,Bo.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=$o({},this.state),"function"==typeof e&&(e=e($o({},n),this.props)),e&&$o(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Vo(this))},Bo.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Vo(this))},Bo.prototype.render=jo,$r=[],Nr="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hr=function(e,t){return e.__v.__b-t.__v.__b},Wo.__r=0,jr=0,function(e){e.Button="button",e.Tab="tab",e.Selector="selector"}(Br||(Br={})),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Ur||(Ur={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(zr||(zr={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Vr||(Vr={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(Wr||(Wr={}));var us,ls="undefined"!=typeof window?window:void 0,cs="undefined"!=typeof globalThis?globalThis:ls,ds=Array.prototype,fs=ds.forEach,vs=ds.indexOf,hs=null==cs?void 0:cs.navigator,ps=null==cs?void 0:cs.document,gs=null==cs?void 0:cs.location,_s=null==cs?void 0:cs.fetch,ms=null!=cs&&cs.XMLHttpRequest&&"withCredentials"in new cs.XMLHttpRequest?cs.XMLHttpRequest:void 0,ys=null==cs?void 0:cs.AbortController,bs=null==hs?void 0:hs.userAgent,ks=null!=ls?ls:{},ws={DEBUG:!1,LIB_VERSION:"1.235.1"},Ss="$copy_autocapture",xs=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(us||(us={}));var Es=["fatal","error","warning","log","info","debug"];function Cs(e,t){return-1!==e.indexOf(t)}var Ps=function(e){return e.trim()},Ts=function(e){return e.replace(/^\$/,"")};var Is=Array.isArray,Fs=Object.prototype,Rs=Fs.hasOwnProperty,Os=Fs.toString,Ls=Is||function(e){return"[object Array]"===Os.call(e)},Ms=function(e){return"function"==typeof e},As=function(e){return e===Object(e)&&!Ls(e)},qs=function(e){if(As(e)){for(var t in e)if(Rs.call(e,t))return!1;return!0}return!1},$s=function(e){return void 0===e},Ds=function(e){return"[object String]"==Os.call(e)},Ns=function(e){return Ds(e)&&0===e.trim().length},Hs=function(e){return null===e},js=function(e){return $s(e)||Hs(e)},Bs=function(e){return"[object Number]"==Os.call(e)},Us=function(e){return"[object Boolean]"===Os.call(e)},zs=function(e){return e instanceof FormData},Vs=function(e){return Cs(xs,e)},Ws=function e(t){var n={_log:function(e){if(ls&&(ws.DEBUG||ks.POSTHOG_DEBUG)&&!$s(ls.console)&&ls.console){for(var n=("__rrweb_original__"in ls.console[e]?ls.console[e].__rrweb_original__:ls.console[e]),i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(void 0,[t].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n._log.apply(n,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n._log.apply(n,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n._log.apply(n,["error"].concat(t))},critical:function(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];(e=console).error.apply(e,[t].concat(i))},uninitializedWarning:function(e){n.error("You must initialize PostHog before calling ".concat(e))},createLogger:function(n){return e("".concat(t," ").concat(n))}};return n}("[PostHog.js]"),Gs=Ws.createLogger,Zs=Gs("[Stylesheet Loader]"),Qs=function(e,t,n){var i,r=e.createElement("style");return r.innerText=t,null!=n&&null!==(i=n.config)&&void 0!==i&&i.prepare_external_dependency_stylesheet&&(r=n.config.prepare_external_dependency_stylesheet(r)),r||(Zs.error("prepare_external_dependency_stylesheet returned null"),null)},Ys=ls,Js=ps,Xs="seenSurvey_",Ks=Gs("[Surveys]"),ea=2147483647;function ta(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?"".concat(e,", ").concat(t):"-apple-system, ".concat(t)}var na=function(e){return"\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: ".concat(ta(null==e?void 0:e.fontFamily),";\n text-align: left;\n max-width: ").concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||ea.toString()),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n\n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: ").concat((null==e?void 0:e.disabledButtonOpacity)||"0.6",";\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: ").concat(ta(null==e?void 0:e.fontFamily),";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(ra((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .limit-height {\n max-height: 300px;\n overflow: auto;\n scrollbar-width: thin;\n scrollbar-color: ").concat((null==e?void 0:e.borderColor)||"#c9c6c6"," ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ").replace(/[\n\r\t]+/g," ").replace(/\s{2,}/g," ").trim()};function ia(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function ra(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sa;"#"===t[0]&&(e=ia(t)),t.startsWith("rgb")&&(e=t);var n=function(e){return{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()]}(t);if(n&&(e=ia(n)),!e)return"black";var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var r=parseInt(i[1]),o=parseInt(i[2]),s=parseInt(i[3]);return Math.sqrt(r*r*.299+o*o*.587+s*s*.114)>127.5?"black":"white"}return"black"}var oa={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},sa="#eeeded",aa=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i?(localStorage.setItem(va(n),"true"),i.capture("survey sent",P(P({$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((function(e,t){return{id:e.id,question:e.question,index:t}})),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},t),{},{$set:M({},ha(n,"responded"),!0)})),Ys.dispatchEvent(new Event("PHSurveySent"))):Ks.error("[survey sent] event not captured, PostHog instance not found.")},ua=function(e,t,n){var i;t?n||(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(i=t.get_session_replay_url)||void 0===i?void 0:i.call(t),$set:M({},ha(e,"dismissed"),!0)}),localStorage.setItem(va(e),"true"),Ys.dispatchEvent(new Event("PHSurveyClosed"))):Ks.error("[survey dismissed] event not captured, PostHog instance not found.")},la=function(e){return e.map((function(e){return{sort:Math.floor(10*Math.random()),value:e}})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.value}))},ca=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},da=function(e){return e.appearance&&e.appearance.shuffleQuestions?ca(e.questions,la(e.questions)):e.questions},fa=function(e){var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!function(e){var t,n,i,r,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0}(e))||e.schedule===Wr.Always},va=function(e){var t="".concat(Xs).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(Xs).concat(e.id,"_").concat(e.current_iteration)),t},ha=function(e,t){var n="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(n="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),n},pa=function(e,t){var n={__c:t="__cC"+jr++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Vo(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:function(){},isPopup:!0,onPreviewSubmit:function(){}}),ga=function(e){var t=e.component,n=e.children,i=e.renderAsHtml,r=e.style;return as(t,i?{dangerouslySetInnerHTML:{__html:n},style:r}:{children:n,style:r})},_a={};function ma(e,t,n){if(Ls(e))if(fs&&e.forEach===fs)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i)===_a)return}function ya(e,t,n){if(!js(e)){if(Ls(e))return ma(e,t,n);if(zs(e)){var i,r=H(e.entries());try{for(r.s();!(i=r.n()).done;){var o=i.value;if(t.call(n,o[1],o[0])===_a)return}}catch(e){r.e(e)}finally{r.f()}}else for(var s in e)if(Rs.call(e,s)&&t.call(n,e[s],s)===_a)return}}var ba=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return ma(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},ka=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return ma(n,(function(t){ma(t,(function(t){e.push(t)}))})),e};function wa(e){for(var t=Object.keys(e),n=t.length,i=new Array(n);n--;)i[n]=[t[n],e[t[n]]];return i}var Sa=function(e){try{return e()}catch(e){return}},xa=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e.apply(this,n)}catch(e){Ws.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ws.critical(e)}}},Ea=function(e){var t={};return ya(e,(function(e,n){Ds(e)&&e.length>0&&(t[n]=e)})),t};function Ca(e,t){return n=e,i=function(e){return Ds(e)&&!Hs(t)?e.slice(0,t):e},r=new Set,function e(t,n){return t!==Object(t)?i?i(t,n):t:r.has(t)?void 0:(r.add(t),Ls(t)?(o=[],ma(t,(function(t){o.push(e(t))}))):(o={},ya(t,(function(t,n){r.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,i,r}var Pa=["herokuapp.com","vercel.app","netlify.app"];function Ta(e){var t=null==e?void 0:e.hostname;if(!Ds(t))return!1;var n,i=t.split(".").slice(-2).join("."),r=H(Pa);try{for(r.s();!(n=r.n()).done;){if(i===n.value)return!1}}catch(e){r.e(e)}finally{r.f()}return!0}function Ia(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Fa(e,t,n,i){var r=null!=i?i:{},o=r.capture,s=void 0!==o&&o,a=r.passive,u=void 0===a||a;null==e||e.addEventListener(t,n,{capture:s,passive:u})}var Ra,Oa=["localhost","127.0.0.1"],La=function(e){var t=null==ps?void 0:ps.createElement("a");return $s(t)?null:(t.href=e,t)},Ma=function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",r=[];return ya(e,(function(e,i){$s(e)||$s(i)||"undefined"===i||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(i),r[r.length]=n+"="+t)})),r.join(i)},Aa=function(e,t){for(var n,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var o=i[r].split("=");if(o[0]===t){n=o;break}}if(!Ls(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){Ws.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},qa=function(e,t,n){if(!e||!t||!t.length)return e;for(var i=e.split("#"),r=i[0]||"",o=i[1],s=r.split("?"),a=s[1],u=s[0],l=(a||"").split("&"),c=[],d=0;d<l.length;d++){var f=l[d].split("=");Ls(f)&&(t.includes(f[0])?c.push(f[0]+"="+n):c.push(l[d]))}var v=u;return null!=a&&(v+="?"+c.join("&")),null!=o&&(v+="#"+o),v},$a=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Da="Mobile",Na="iOS",Ha="Android",ja="Tablet",Ba=Ha+" "+ja,Ua="iPad",za="Apple",Va=za+" Watch",Wa="Safari",Ga="BlackBerry",Za="Samsung",Qa=Za+"Browser",Ya=Za+" Internet",Ja="Chrome",Xa=Ja+" OS",Ka=Ja+" "+Na,eu="Internet Explorer",tu=eu+" "+Da,nu="Opera",iu=nu+" Mini",ru="Edge",ou="Microsoft "+ru,su="Firefox",au=su+" "+Na,uu="Nintendo",lu="PlayStation",cu="Xbox",du=Ha+" "+Da,fu=Da+" "+Wa,vu="Windows",hu=vu+" Phone",pu="Nokia",gu="Ouya",_u="Generic",mu=_u+" "+Da.toLowerCase(),yu=_u+" "+ja.toLowerCase(),bu="Konqueror",ku="(\\d+(\\.\\d+)?)",wu=new RegExp("Version/"+ku),Su=new RegExp(cu,"i"),xu=new RegExp(lu+" \\w+","i"),Eu=new RegExp(uu+" \\w+","i"),Cu=new RegExp(Ga+"|PlayBook|BB10","i"),Pu={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var Tu=function(e,t){return t&&Cs(t,za)||function(e){return Cs(e,Wa)&&!Cs(e,Ja)&&!Cs(e,Ha)}(e)},Iu=function(e,t){return t=t||"",Cs(e," OPR/")&&Cs(e,"Mini")?iu:Cs(e," OPR/")?nu:Cu.test(e)?Ga:Cs(e,"IE"+Da)||Cs(e,"WPDesktop")?tu:Cs(e,Qa)?Ya:Cs(e,ru)||Cs(e,"Edg/")?ou:Cs(e,"FBIOS")?"Facebook "+Da:Cs(e,"UCWEB")||Cs(e,"UCBrowser")?"UC Browser":Cs(e,"CriOS")?Ka:Cs(e,"CrMo")||Cs(e,Ja)?Ja:Cs(e,Ha)&&Cs(e,Wa)?du:Cs(e,"FxiOS")?au:Cs(e.toLowerCase(),bu.toLowerCase())?bu:Tu(e,t)?Cs(e,Da)?fu:Wa:Cs(e,su)?su:Cs(e,"MSIE")||Cs(e,"Trident/")?eu:Cs(e,"Gecko")?su:""},Fu=(M(Ra={},tu,[new RegExp("rv:"+ku)]),M(Ra,ou,[new RegExp(ru+"?\\/"+ku)]),M(Ra,Ja,[new RegExp("("+Ja+"|CrMo)\\/"+ku)]),M(Ra,Ka,[new RegExp("CriOS\\/"+ku)]),M(Ra,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+ku)]),M(Ra,Wa,[wu]),M(Ra,fu,[wu]),M(Ra,nu,[new RegExp("(Opera|OPR)\\/"+ku)]),M(Ra,su,[new RegExp(su+"\\/"+ku)]),M(Ra,au,[new RegExp("FxiOS\\/"+ku)]),M(Ra,bu,[new RegExp("Konqueror[:/]?"+ku,"i")]),M(Ra,Ga,[new RegExp(Ga+" "+ku),wu]),M(Ra,du,[new RegExp("android\\s"+ku,"i")]),M(Ra,Ya,[new RegExp(Qa+"\\/"+ku)]),M(Ra,eu,[new RegExp("(rv:|MSIE )"+ku)]),M(Ra,"Mozilla",[new RegExp("rv:"+ku)]),Ra),Ru=[[new RegExp(cu+"; "+cu+" (.*?)[);]","i"),function(e){return[cu,e&&e[1]||""]}],[new RegExp(uu,"i"),[uu,""]],[new RegExp(lu,"i"),[lu,""]],[Cu,[Ga,""]],[new RegExp(vu,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[hu,""];if(new RegExp(Da).test(t)&&!/IEMobile\b/.test(t))return[vu+" "+Da,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var i=n[1],r=Pu[i]||"";return/arm/i.test(t)&&(r="RT"),[vu,r]}return[vu,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Na,t.join(".")]}return[Na,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=$s(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Ha+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ha+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Ha,t.join(".")]}return[Ha,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Xa,""]],[/Linux|debian/i,["Linux",""]]],Ou=function(e){return Eu.test(e)?uu:xu.test(e)?lu:Su.test(e)?cu:new RegExp(gu,"i").test(e)?gu:new RegExp("("+hu+"|WPDesktop)","i").test(e)?hu:/iPad/.test(e)?Ua:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Va:Cu.test(e)?Ga:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(pu,"i").test(e)?pu:/(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(Da).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)?Ha:Ba:Ha:new RegExp("(pda|"+Da+")","i").test(e)?mu:new RegExp(ja,"i").test(e)&&!new RegExp(ja+" pc","i").test(e)?yu:""},Lu="https?://(.*)",Mu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],Au=ka(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Mu),qu="<masked>",$u={campaignParams:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.customTrackedParams,n=e.maskPersonalDataProperties,i=e.customPersonalDataProperties;if(!ps)return{};var r=n?ka([],Mu,i||[]):[];return this._campaignParamsFromUrl(qa(ps.URL,r,qu),t)},_campaignParamsFromUrl:function(e,t){var n=Au.concat(t||[]),i={};return ya(n,(function(t){var n=Aa(e,t);i[t]=n||null})),i},_searchEngine:function(e){return e?0===e.search(Lu+"google.([^/?]*)")?"google":0===e.search(Lu+"bing.com")?"bing":0===e.search(Lu+"yahoo.com")?"yahoo":0===e.search(Lu+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=$u._searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(!Hs(t)){i.$search_engine=t;var r=ps?Aa(ps.referrer,n):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var e=null==ps?void 0:ps.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:Iu,browserVersion:function(e,t){var n=Iu(e,t),i=Fu[n];if($s(i))return null;for(var r=0;r<i.length;r++){var o=i[r],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return"string"==typeof e?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<Ru.length;t++){var n=q(Ru[t],2),i=n[0],r=n[1],o=i.exec(e),s=o&&(Ms(r)?r(o,e):r);if(s)return s}return["",""]},device:Ou,deviceType:function(e){var t=Ou(e);return t===Ua||t===Ba||"Kobo"===t||"Kindle Fire"===t||t===yu?ja:t===uu||t===cu||t===lu||t===gu?"Console":t===Va?"Wearable":t?Da:"Desktop"},referrer:function(){return(null==ps?void 0:ps.referrer)||"$direct"},referringDomain:function(){var e;return null!=ps&&ps.referrer&&(null===(e=La(ps.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},personInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maskPersonalDataProperties,n=e.customPersonalDataProperties,i=t?ka([],Mu,n||[]):[],r=null==gs?void 0:gs.href.substring(0,1e3);return{r:this.referrer().substring(0,1e3),u:r?qa(r,i,qu):void 0}},personPropsFromInfo:function(e){var t,n=e.r,i=e.u,r={$referrer:n,$referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=La(n))||void 0===t?void 0:t.host};if(i){r.$current_url=i;var o=La(i);r.$host=null==o?void 0:o.host,r.$pathname=null==o?void 0:o.pathname;var s=this._campaignParamsFromUrl(i);ba(r,s)}if(n){var a=this._searchInfoFromReferrer(n);ba(r,a)}return r},initialPersonPropsFromInfo:function(e){var t=this.personPropsFromInfo(e),n={};return ya(t,(function(e,t){n["$initial_".concat(Ts(t))]=e})),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},timezoneOffset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}},properties:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maskPersonalDataProperties,n=e.customPersonalDataProperties;if(!bs)return{};var i=t?ka([],Mu,n||[]):[],r=q($u.os(bs),2),o=r[0],s=r[1];return ba(Ea({$os:o,$os_version:s,$browser:$u.browser(bs,navigator.vendor),$device:$u.device(bs),$device_type:$u.deviceType(bs),$timezone:$u.timezone(),$timezone_offset:$u.timezoneOffset()}),{$current_url:qa(null==gs?void 0:gs.href,i,qu),$host:null==gs?void 0:gs.host,$pathname:null==gs?void 0:gs.pathname,$raw_user_agent:bs.length>1e3?bs.substring(0,997)+"...":bs,$browser_version:$u.browserVersion(bs,navigator.vendor),$browser_language:$u.browserLanguage(),$browser_language_prefix:$u.browserLanguagePrefix(),$screen_height:null==ls?void 0:ls.screen.height,$screen_width:null==ls?void 0:ls.screen.width,$viewport_height:null==ls?void 0:ls.innerHeight,$viewport_width:null==ls?void 0:ls.innerWidth,$lib:"web",$lib_version:ws.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!bs)return{};var e=q($u.os(bs),2),t=e[0],n=e[1];return ba(Ea({$os:t,$os_version:n,$browser:$u.browser(bs,navigator.vendor)}),{$browser_version:$u.browserVersion(bs,navigator.vendor)})}},Du=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}},Nu=function(){function e(){R(this,e),M(this,"events",{}),this.events={}}return L(e,[{key:"on",value: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}))}}},{key:"emit",value:function(e,t){var n,i=H(this.events[e]||[]);try{for(i.s();!(n=i.n()).done;){(0,n.value)(t)}}catch(e){i.e(e)}finally{i.f()}var r,o=H(this.events["*"]||[]);try{for(o.s();!(r=o.n()).done;){(0,r.value)(e,t)}}catch(e){o.e(e)}finally{o.f()}}}]),e}(),Hu=function(){function e(t){var n=this;R(this,e),M(this,"_debugEventEmitter",new Nu),M(this,"checkStep",(function(e,t){return n.checkStepEvent(e,t)&&n.checkStepUrl(e,t)&&n.checkStepElement(e,t)})),M(this,"checkStepEvent",(function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)})),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}return L(e,[{key:"init",value:function(){var e,t=this;if(!$s(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var n;null===(n=this.instance)||void 0===n||n._addCaptureHook((function(e,n){t.on(e,n)}))}}},{key:"register",value:function(e){var t,n,i=this;if(!$s(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((function(e){var t,n;null===(t=i.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((function(e){var t;null===(t=i.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var r,o=new Set;e.forEach((function(e){var t;null===(t=e.steps)||void 0===t||t.forEach((function(e){null!=e&&e.selector&&o.add(null==e?void 0:e.selector)}))})),null===(r=this.instance)||void 0===r||r.autocapture.setElementSelectors(o)}}},{key:"on",value:function(e,t){var n,i=this;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((function(e){i.checkAction(t,e)&&i._debugEventEmitter.emit("actionCaptured",e.name)}))}},{key:"_addActionHook",value:function(e){this.onAction("actionCaptured",(function(t){return e(t)}))}},{key:"checkAction",value:function(e,t){if(null==(null==t?void 0:t.steps))return!1;var n,i=H(t.steps);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(this.checkStep(e,r))return!0}}catch(e){i.e(e)}finally{i.f()}return!1}},{key:"onAction",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"checkStepUrl",value:function(t,n){if(null!=n&&n.url){var i,r=null==t||null===(i=t.properties)||void 0===i?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!e.matchString(r,null==n?void 0:n.url,(null==n?void 0:n.url_matching)||"contains"))return!1}return!0}},{key:"checkStepElement",value:function(t,n){if((null!=n&&n.href||null!=n&&n.tag_name||null!=n&&n.text)&&!this.getElementsList(t).some((function(t){return!(null!=n&&n.href&&!e.matchString(t.href||"",null==n?void 0:n.href,(null==n?void 0:n.href_matching)||"exact"))&&((null==n||!n.tag_name||t.tag_name===(null==n?void 0:n.tag_name))&&!(null!=n&&n.text&&!e.matchString(t.text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")&&!e.matchString(t.$el_text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")))})))return!1;if(null!=n&&n.selector){var i,r=null==t||null===(i=t.properties)||void 0===i?void 0:i.$element_selectors;if(!r)return!1;if(!r.includes(null==n?void 0:n.selector))return!1}return!0}},{key:"getElementsList",value:function(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}],[{key:"matchString",value:function(t,n,i){switch(i){case"regex":return!!ls&&Du(t,n);case"exact":return n===t;case"contains":var r=e.escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Du(t,r);default:return!1}}},{key:"escapeStringRegexp",value:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}}]),e}(),ju=function(){function e(t){R(this,e),this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return L(e,[{key:"register",value:function(e){var t;$s(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}},{key:"setupActionBasedSurveys",value:function(e){var t=this,n=e.filter((function(e){var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(i=n.actions)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0}));if(0!==n.length){if(null==this.actionMatcher){this.actionMatcher=new Hu(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((function(e){t.onAction(e)}))}n.forEach((function(e){var n,i,r,o,s,a,u,l,c,d;e.conditions&&null!==(n=e.conditions)&&void 0!==n&&n.actions&&null!==(i=e.conditions)&&void 0!==i&&null!==(r=i.actions)&&void 0!==r&&r.values&&(null===(o=e.conditions)||void 0===o||null===(s=o.actions)||void 0===s||null===(a=s.values)||void 0===a?void 0:a.length)>0&&(null===(u=t.actionMatcher)||void 0===u||u.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(d=c.values)||void 0===d||d.forEach((function(n){if(n&&n.name){var i=t.actionToSurveys.get(n.name);i&&i.push(e.id),t.actionToSurveys.set(n.name,i||[e.id])}})))}))}}},{key:"setupEventBasedSurveys",value:function(e){var t,n=this;if(0!==e.filter((function(e){var t,n,i,r;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i||null===(r=i.values)||void 0===r?void 0:r.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook((function(e,t){n.onEvent(e,t)})),e.forEach((function(e){var t,i,r;null===(t=e.conditions)||void 0===t||null===(i=t.events)||void 0===i||null===(r=i.values)||void 0===r||r.forEach((function(t){if(t&&t.name){var i=n.eventToSurveys.get(t.name);i&&i.push(e.id),n.eventToSurveys.set(t.name,i||[e.id])}}))}))}}},{key:"onEvent",value:function(t,n){var i,r,o=(null===(i=this.instance)||void 0===i||null===(r=i.persistence)||void 0===r?void 0:r.props[ko])||[];if(e.SURVEY_SHOWN_EVENT_NAME==t&&n&&o.length>0){var s,a=null==n||null===(s=n.properties)||void 0===s?void 0:s.$survey_id;if(a){var u=o.indexOf(a);u>=0&&(o.splice(u,1),this._updateActivatedSurveys(o))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(o.concat(this.eventToSurveys.get(t)||[]))}},{key:"onAction",value:function(e){var t,n,i=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[ko])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(e)||[]))}},{key:"_updateActivatedSurveys",value:function(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register(M({},ko,$(new Set(e))))}},{key:"getSurveys",value:function(){var e,t,n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[ko];return n||[]}},{key:"getEventToSurveys",value:function(){return this.eventToSurveys}},{key:"_getActionMatcher",value:function(){return this.actionMatcher}}]),e}();M(ju,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Bu=Gs("[Surveys]"),Uu={icontains:function(e,t){return e.some((function(e){return t.toLowerCase().includes(e.toLowerCase())}))},not_icontains:function(e,t){return e.every((function(e){return!t.toLowerCase().includes(e.toLowerCase())}))},regex:function(e,t){return e.some((function(e){return Du(t,e)}))},not_regex:function(e,t){return e.every((function(e){return!Du(t,e)}))},exact:function(e,t){return e.some((function(e){return t===e}))},is_not:function(e,t){return e.every((function(e){return t!==e}))}};function zu(e){return null!=e?e:"icontains"}function Vu(e){var t,n,i;if(null===(t=e.conditions)||void 0===t||!t.url)return!0;var r=null==ls||null===(n=ls.location)||void 0===n?void 0:n.href;if(!r)return!1;var o=[e.conditions.url];return Uu[zu(null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)](o,r)}var Wu,Gu,Zu,Qu,Yu=function(){function e(t){R(this,e),M(this,"_isFetchingSurveys",!1),M(this,"_isInitializingSurveys",!1),M(this,"_surveyCallbacks",[]),this.instance=t,this._surveyEventReceiver=null}return L(e,[{key:"onRemoteConfig",value:function(e){var t=e.surveys;if(js(t))return Bu.warn("Decide not loaded yet. Not loading surveys.");var n=Ls(t);this._hasSurveys=n?t.length>0:t,Bu.info("decide response received, hasSurveys: ".concat(this._hasSurveys)),this._hasSurveys&&this.loadIfEnabled()}},{key:"reset",value:function(){localStorage.removeItem("lastSeenSurveyDate");var e=function(){for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);null!=n&&n.startsWith(Xs)&&e.push(n)}return e}();e.forEach((function(e){return localStorage.removeItem(e)}))}},{key:"loadIfEnabled",value:function(){var e=this;if(!this._surveyManager)if(this._isInitializingSurveys)Bu.info("Already initializing surveys, skipping...");else if(this.instance.config.disable_surveys)Bu.info("Disabled. Not loading surveys.");else{var t=null==ks?void 0:ks.__PosthogExtensions__;if(t)if(this._hasSurveys){this._isInitializingSurveys=!0;try{var n=t.generateSurveys;if(n)this._surveyManager=n(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new ju(this.instance),Bu.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0});else{var i=t.loadExternalDependency;if(i)i(this.instance,"surveys",(function(n){if(n||!t.generateSurveys)return Bu.error("Could not load surveys script",n),void(e._isInitializingSurveys=!1);e._surveyManager=t.generateSurveys(e.instance),e._isInitializingSurveys=!1,e._surveyEventReceiver=new ju(e.instance),Bu.info("Surveys loaded successfully"),e._notifySurveyCallbacks({isLoaded:!0})}));else{var r="PostHog loadExternalDependency extension not found. Cannot load remote config.";Bu.error(r),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:r})}}}catch(e){throw Bu.error("Error initializing surveys",e),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:"Error initializing surveys"}),e}}else Bu.info("No surveys to load.");else Bu.error("PostHog Extensions not found.")}}},{key:"onSurveysLoaded",value: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}))}}},{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return Bu.info("Disabled. Not loading surveys."),e([]);var i=this.instance.get_property(bo);if(i&&!n)return e(i,{isLoaded:!0});if(this._isFetchingSurveys)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this._isFetchingSurveys=!0,this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",timeout:this.instance.config.surveys_request_timeout_ms,callback:function(n){var i;t._isFetchingSurveys=!1;var r=n.statusCode;if(200!==r||!n.json){var o="Surveys API could not be loaded, status: ".concat(r);return Bu.error(o),e([],{isLoaded:!1,error:o})}var s,a=n.json.surveys||[],u=a.filter((function(e){var t,n,i,r,o,s,a,u,l,c,d,f;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(i=n.events)||void 0===i?void 0:i.values)&&(null===(r=e.conditions)||void 0===r||null===(o=r.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(u=e.conditions)||void 0===u||null===(l=u.actions)||void 0===l?void 0:l.values)&&(null===(c=e.conditions)||void 0===c||null===(d=c.actions)||void 0===d||null===(f=d.values)||void 0===f?void 0:f.length)>0}));u.length>0&&(null===(s=t._surveyEventReceiver)||void 0===s||s.register(u));return null===(i=t.instance.persistence)||void 0===i||i.register(M({},bo,a)),e(a,{isLoaded:!0})}})}catch(e){throw this._isFetchingSurveys=!1,e}}},{key:"_notifySurveyCallbacks",value:function(e){var t,n=H(this._surveyCallbacks);try{for(n.s();!(t=n.n()).done;){var i=t.value;try{e.isLoaded?this.getSurveys(i):i([],e)}catch(e){Bu.error("Error in survey callback",e)}}}catch(e){n.e(e)}finally{n.f()}}},{key:"isSurveyFeatureFlagEnabled",value:function(e){return!e||this.instance.featureFlags.isFeatureEnabled(e)}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var i,r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t;if(!e.conditions)return!0;var n=Vu(e),i=null===(t=e.conditions)||void 0===t||!t.selector||(null==ps?void 0:ps.querySelector(e.conditions.selector)),r=function(e){var t,n,i;if(null===(t=e.conditions)||void 0===t||!t.deviceTypes||0===(null===(n=e.conditions)||void 0===n?void 0:n.deviceTypes.length))return!0;if(!bs)return!1;var r=$u.deviceType(bs);return Uu[zu(null===(i=e.conditions)||void 0===i?void 0:i.deviceTypesMatchType)](e.conditions.deviceTypes,r)}(e);return n&&i&&r})),o=null===(i=t._surveyEventReceiver)||void 0===i?void 0:i.getSurveys(),s=r.filter((function(e){var n,i,r,s,a,u,l,c,d;if(!(e.linked_flag_key||e.targeting_flag_key||e.internal_targeting_flag_key||null!==(n=e.feature_flag_keys)&&void 0!==n&&n.length))return!0;var f=t.isSurveyFeatureFlagEnabled(e.linked_flag_key),v=t.isSurveyFeatureFlagEnabled(e.targeting_flag_key),h=(null!==(i=null===(r=e.conditions)||void 0===r||null===(s=r.events)||void 0===s||null===(a=s.values)||void 0===a?void 0:a.length)&&void 0!==i?i:0)>0,p=(null!==(u=null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(d=c.values)||void 0===d?void 0:d.length)&&void 0!==u?u:0)>0,g=!h&&!p||(null==o?void 0:o.includes(e.id)),_=t._canActivateRepeatedly(e)||t.isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key),m=t.checkFlags(e);return f&&v&&_&&g&&m}));return e(s)}),n)}},{key:"checkFlags",value:function(e){var t,n=this;return null===(t=e.feature_flag_keys)||void 0===t||!t.length||e.feature_flag_keys.every((function(e){var t=e.key,i=e.value;return!t||!i||n.instance.featureFlags.isFeatureEnabled(i)}))}},{key:"_canActivateRepeatedly",value:function(e){var t;return js(null===(t=ks.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(Bu.warn("init was not called"),!1):ks.__PosthogExtensions__.canActivateRepeatedly(e)}},{key:"canRenderSurvey",value:function(e){var t=this;if(js(this._surveyManager))return Bu.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=null;return this.getSurveys((function(i){var r=i.filter((function(t){return t.id===e}))[0];n=r?P({},t._surveyManager.canRenderSurvey(r)):{visible:!1,disabledReason:"Survey not found"}})),n}},{key:"renderSurvey",value:function(e,t){var n=this;js(this._surveyManager)?Bu.warn("init was not called"):this.getSurveys((function(i){var r=i.filter((function(t){return t.id===e}))[0];n._surveyManager.renderSurvey(r,null==ps?void 0:ps.querySelector(t))}))}}]),e}(),Ju=0,Xu=[],Ku=[],el=Ar.__b,tl=Ar.__r,nl=Ar.diffed,il=Ar.__c,rl=Ar.unmount;function ol(e,t){Ar.__h&&Ar.__h(Gu,e,Ju||t),Ju=0;var n=Gu.__H||(Gu.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Ku}),n.__[e]}function sl(e){return Ju=1,function(e,t,n){var i=ol(Wu++,2);if(i.t=e,!i.__c&&(i.__=[_l(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=Gu,!Gu.u)){var r=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&i.__c.props===e)&&(!o||o.call(this,e,t,n))};Gu.u=!0;var o=Gu.shouldComponentUpdate,s=Gu.componentWillUpdate;Gu.componentWillUpdate=function(e,t,n){if(this.__e){var i=o;o=void 0,r(e,t,n),o=i}s&&s.call(this,e,t,n)},Gu.shouldComponentUpdate=r}return i.__N||i.__}(_l,e)}function al(e,t){var n=ol(Wu++,3);!Ar.__s&&gl(n.__H,t)&&(n.__=e,n.i=t,Gu.__H.__h.push(n))}function ul(e){return Ju=5,ll((function(){return{current:e}}),[])}function ll(e,t){var n=ol(Wu++,7);return gl(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function cl(e){var t=Gu.context[e.__c],n=ol(Wu++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Gu)),t.props.value):e.__}function dl(){for(var e;e=Xu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(hl),e.__H.__h.forEach(pl),e.__H.__h=[]}catch(t){e.__H.__h=[],Ar.__e(t,e.__v)}}Ar.__b=function(e){Gu=null,el&&el(e)},Ar.__r=function(e){tl&&tl(e),Wu=0;var t=(Gu=e.__c).__H;t&&(Zu===Gu?(t.__h=[],Gu.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Ku,e.__N=e.i=void 0}))):(t.__h.forEach(hl),t.__h.forEach(pl),t.__h=[],Wu=0)),Zu=Gu},Ar.diffed=function(e){nl&&nl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Xu.push(t)&&Qu===Ar.requestAnimationFrame||((Qu=Ar.requestAnimationFrame)||vl)(dl)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Ku&&(e.__=e.__V),e.i=void 0,e.__V=Ku}))),Zu=Gu=null},Ar.__c=function(e,t){t.some((function(e){try{e.__h.forEach(hl),e.__h=e.__h.filter((function(e){return!e.__||pl(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Ar.__e(n,e.__v)}})),il&&il(e,t)},Ar.unmount=function(e){rl&&rl(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{hl(e)}catch(e){t=e}})),n.__H=void 0,t&&Ar.__e(t,n.__v))};var fl="function"==typeof requestAnimationFrame;function vl(e){var t,n=function(){clearTimeout(i),fl&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,100);fl&&(t=requestAnimationFrame(n))}function hl(e){var t=Gu,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Gu=t}function pl(e){var t=Gu;e.__c=e.__(),Gu=t}function gl(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function _l(e,t){return"function"==typeof t?t(e):t}var ml=ps;function yl(e,t){var n,i=ml.createElement("div");i.className="PostHogWidget".concat(e.id);var r,o=i.attachShadow({mode:"open"}),s=(r=null===(n=e.appearance)||void 0===n?void 0:n.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(r||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: ").concat(ea,";\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n ")),a=Qs(ml,s,t);return a&&o.append(a),ml.body.appendChild(i),o}var bl=0;function kl(e,t,n,i,r,o){var s,a,u={};for(a in t)"ref"==a?s=t[a]:u[a]=t[a];var l={type:e,props:u,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--bl,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===u[a]&&(u[a]=s[a]);return Ar.vnode&&Ar.vnode(l),l}var wl=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),Sl=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),xl=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),El=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),Cl=kl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:kl("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"})}),Pl=kl("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:kl("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:"black"})}),Tl=kl("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[kl("g",{"clip-path":"url(#clip0_2415_6911)",children:[kl("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:kl("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),kl("g",{mask:"url(#mask0_2415_6911)",children:[kl("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"}),kl("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"}),kl("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"}),kl("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"}),kl("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"}),kl("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"})]})]}),kl("defs",{children:kl("clipPath",{id:"clip0_2415_6911",children:kl("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Il=kl("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:kl("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function Fl(){return kl("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Tl]})}function Rl(e){var t=e.text,n=e.submitDisabled,i=e.appearance,r=e.onSubmit,o=e.link,s=e.onPreviewSubmit,a=cl(pa),u=a.isPreviewMode,l=a.isPopup,c=i.submitButtonTextColor||ra(i.submitButtonColor||oa.submitButtonColor);return kl("div",{className:"bottom-section",children:[kl("div",{className:"buttons",children:kl("button",{className:"form-submit",disabled:n,"aria-label":"Submit survey",type:"button",style:l?{color:c}:{},onClick:function(){o&&(null==ls||ls.open(o)),u?null==s||s():r()},children:t})}),!i.whiteLabel&&kl(Fl,{})]})}function Ol(e){var t=e.question,n=e.description,i=e.descriptionContentType,r=e.backgroundColor,o=e.forceDisableHtml;return kl("div",{style:cl(pa).isPopup?{backgroundColor:r||oa.backgroundColor}:{},children:[kl("div",{className:"survey-question",children:t}),n&&ga({component:No("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==i})]})}function Ll(e){return kl("div",{className:"cancel-btn-wrapper",children:kl("button",{className:"form-cancel",onClick:e.onClick,disabled:cl(pa).isPreviewMode,"aria-label":"Close survey",role:"button",children:Pl})})}function Ml(e){var t=e.header,n=e.description,i=e.contentType,r=e.forceDisableHtml,o=e.appearance,s=e.onClose,a=e.styleOverrides,u=ra(o.backgroundColor||oa.backgroundColor),l=cl(pa).isPopup;return kl("div",{className:"thank-you-message",style:P({},a),children:kl("div",{className:"thank-you-message-container",children:[l&&kl(Ll,{onClick:function(){return s()}}),kl("h3",{className:"thank-you-message-header",style:{color:u},children:t}),n&&ga({component:No("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!r&&"text"!==i,style:{color:u}}),l&&kl(Rl,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:function(){return s()}})]})})}function Al(e){var t,n=ul(null),i=q(sl(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black"),2),r=i[0],o=i[1];return al((function(){if(n.current){var e=function(e){var t=Ys.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";var i=parseInt(n[1]),r=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(i*i*.299+r*r*.587+o*o*.114)>127.5?"black":"white"}(n.current);o(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:r}}function ql(e){var t=e.question,n=e.forceDisableHtml,i=e.appearance,r=e.onSubmit,o=e.onPreviewSubmit,s=q(sl(""),2),a=s[0],u=s[1];return kl("div",{children:[kl(Ol,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:i.backgroundColor,forceDisableHtml:n}),kl("textarea",{rows:4,placeholder:null==i?void 0:i.placeholder,onInput:function(e){return u(e.currentTarget.value)}}),kl(Rl,{text:t.buttonText||"Submit",submitDisabled:!a&&!t.optional,appearance:i,onSubmit:function(){return r(a)},onPreviewSubmit:function(){return o(a)}})]})}function $l(e){var t=e.question,n=e.forceDisableHtml,i=e.appearance,r=e.onSubmit,o=e.onPreviewSubmit;return kl(jo,{children:[kl(Ol,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),kl(Rl,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:function(){return r("link clicked")},onPreviewSubmit:function(){return o("link clicked")}})]})}function Dl(e){var t=e.question,n=e.forceDisableHtml,i=e.displayQuestionIndex,r=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=t.scale,u=10===t.scale?0:1,l=q(sl(null),2),c=l[0],d=l[1];return kl(jo,{children:[kl(Ol,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),kl("div",{className:"rating-section",children:[kl("div",{className:"rating-options",children:["emoji"===t.display&&kl("div",{className:"rating-options-emoji",children:(3===t.scale?Bl:Ul).map((function(e,t){var n=t+1===c;return kl("button",{className:"ratings-emoji question-".concat(i,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:function(){d(t+1)},style:{fill:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:e},t)}))}),"number"===t.display&&kl("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-u+1,", minmax(0, 1fr))")},children:Gl(t.scale).map((function(e,t){return kl(Nl,{displayQuestionIndex:i,active:c===e,appearance:r,num:e,setActiveNumber:function(e){d(e)}},t)}))})]}),kl("div",{className:"rating-text",children:[kl("div",{children:t.lowerBoundLabel}),kl("div",{children:t.upperBoundLabel})]})]}),kl(Rl,{text:t.buttonText||(null==r?void 0:r.submitButtonText)||"Submit",submitDisabled:Hs(c)&&!t.optional,appearance:r,onSubmit:function(){return o(c)},onPreviewSubmit:function(){return s(c)}})]})}function Nl(e){var t=e.num,n=e.active,i=e.displayQuestionIndex,r=e.appearance,o=e.setActiveNumber,s=Al({appearance:r,defaultTextColor:"black",forceUpdate:n}),a=s.textColor;return kl("button",{ref:s.ref,className:"ratings-number question-".concat(i,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:function(){o(t)},style:{color:a,backgroundColor:n?r.ratingButtonActiveColor:r.ratingButtonColor,borderColor:r.borderColor},children:t})}function Hl(e,t,n,i){if(i)return!1;if(Hs(e))return!0;if(Ls(e)){if(!t&&0===e.length)return!0;if(t&&!n&&0===e.length)return!0}return!1}function jl(e){var t=e.question,n=e.forceDisableHtml,i=e.displayQuestionIndex,r=e.appearance,o=e.onSubmit,s=e.onPreviewSubmit,a=ul(null),u=ll((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var i=ca(t,la(t));return e.hasOpenChoice&&(e.choices.push(n),i.push(n)),i}(t)}),[t]),l=q(sl(t.type===zr.MultipleChoice?[]:null),2),c=l[0],d=l[1],f=q(sl(!1),2),v=f[0],h=f[1],p=q(sl(""),2),g=p[0],_=p[1],m=t.type===zr.SingleChoice?"radio":"checkbox",y=function(e,n){return n?(h(!v),void(v||setTimeout((function(){var e;return null===(e=a.current)||void 0===e?void 0:e.focus()}),0))):t.type===zr.SingleChoice?(d(e),void h(!1)):void(t.type===zr.MultipleChoice&&Ls(c)&&(c.includes(e)?d(c.filter((function(t){return t!==e}))):d([].concat($(c),[e]))))};return kl("div",{children:[kl(Ol,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:r.backgroundColor}),kl("div",{className:"multiple-choice-options limit-height",children:u.map((function(e,n){var r=!!t.hasOpenChoice&&n===t.choices.length-1,o="choice-option".concat(r?" choice-option-open":""),s=r?v:t.type===zr.SingleChoice?c===e:Ls(c)&&c.includes(e);return kl("div",{className:o,children:[kl("input",{type:m,id:"surveyQuestion".concat(i,"Choice").concat(n),name:"question".concat(i),checked:s,onClick:function(){return y(e,r)}}),kl("label",{htmlFor:"surveyQuestion".concat(i,"Choice").concat(n),style:{color:"black"},children:r?kl(jo,{children:[kl("span",{children:[e,":"]}),kl("input",{type:"text",ref:a,id:"surveyQuestion".concat(i,"Choice").concat(n,"Open"),name:"question".concat(i),value:g,onInput:function(e){return n=e.currentTarget.value,_(n),void(t.type===zr.SingleChoice&&d(n));var n},onClick:function(t){v||y(e,!0),t.stopPropagation()}})]}):e}),kl("span",{className:"choice-check",style:{color:"black"},children:Il})]},n)}))}),kl(Rl,{text:t.buttonText||"Submit",submitDisabled:Hl(c,v,g,!!t.optional),appearance:r,onSubmit:function(){v&&t.type===zr.MultipleChoice?Ls(c)&&o([].concat($(c),[g])):o(c)},onPreviewSubmit:function(){v&&t.type===zr.MultipleChoice?Ls(c)&&s([].concat($(c),[g])):s(c)}})]})}var Bl=[xl,Sl,wl],Ul=[El,xl,Sl,wl,Cl],zl=[1,2,3,4,5],Vl=[1,2,3,4,5,6,7],Wl=[0,1,2,3,4,5,6,7,8,9,10];function Gl(e){switch(e){case 5:default:return zl;case 7:return Vl;case 10:return Wl}}var Zl=Gs("[Surveys]"),Ql=ls,Yl=ps;function Jl(e){return".PostHogWidget".concat(e)}var Xl="ph:show_survey_widget";function Kl(e,t,n){var i,r=e.questions[t],o=t+1;if(null===(i=r.branching)||void 0===i||!i.type)return t===e.questions.length-1?Vr.End:o;if(r.branching.type===Vr.End)return Vr.End;if(r.branching.type===Vr.SpecificQuestion){if(Number.isInteger(r.branching.index))return r.branching.index}else if(r.branching.type===Vr.ResponseBased){if(r.type===zr.SingleChoice){var s,a,u=r.choices.indexOf("".concat(n));if(null!==(s=r.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(u)){var l=r.branching.responseValues[u];return Number.isInteger(l)?l:l===Vr.End?Vr.End:o}}else if(r.type===zr.Rating){var c,d;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var f=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(n,r.scale);if(null!==(c=r.branching)&&void 0!==c&&null!==(d=c.responseValues)&&void 0!==d&&d.hasOwnProperty(f)){var v=r.branching.responseValues[f];return Number.isInteger(v)?v:v===Vr.End?Vr.End:o}}return o}return Zl.warn("Falling back to next question index due to unexpected branching type"),o}var ec=function(){function e(t){var n=this;R(this,e),M(this,"surveyTimeouts",new Map),M(this,"widgetSelectorListeners",new Map),M(this,"canShowNextEventBasedSurvey",(function(){var e,t=Yl.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),M(this,"handlePopoverSurvey",(function(e){var t,i=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays;if(function(e,t){if(!t||!e)return!0;var n=new Date,i=Math.abs(n.getTime()-new Date(e).getTime());return Math.ceil(i/864e5)>t}(localStorage.getItem("lastSeenSurveyDate"),i)){var r=function(e){return!!localStorage.getItem(va(e))&&!fa(e)}(e);if(!r){var o;n.clearSurveyTimeout(e.id),n.addSurveyToFocus(e.id);var s=(null===(o=e.appearance)||void 0===o?void 0:o.surveyPopupDelaySeconds)||0,a=function(e,t,n,i){var r=Js.createElement("div");r.className="PostHogSurvey".concat(t);var o=r.attachShadow({mode:"open"});if(e){var s=Qs(Js,e,i);s&&o.appendChild(s)}return Js.body.appendChild(r),o}(na(null==e?void 0:e.appearance),e.id,0,n.posthog);if(s<=0)return ss(kl(ic,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a);var u=setTimeout((function(){if(!Vu(e))return n.removeSurveyFromFocus(e.id);ss(kl(ic,{posthog:n.posthog,survey:P(P({},e),{},{appearance:P(P({},e.appearance),{},{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}),1e3*s);n.surveyTimeouts.set(e.id,u)}}})),M(this,"handleWidget",(function(e){if(0===Yl.querySelectorAll(Jl(e.id)).length){var t=yl(e,n.posthog),i=na(e.appearance),r=Qs(Yl,i,n.posthog);r&&t.appendChild(r),ss(kl(oc,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus},"feedback-survey-"+e.id),t)}})),M(this,"removeWidgetSelectorListener",(function(e){var t=n.widgetSelectorListeners.get(e);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute("PHWidgetSurveyClickListener"),n.widgetSelectorListeners.delete(e),Zl.info("Removed click listener for survey ".concat(e)))})),M(this,"manageWidgetSelectorListener",(function(e){var t,i=null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector;if(i){var r=Yl.querySelector(i),o=n.widgetSelectorListeners.get(e.id);if(r){if(n.handleWidget(e),o){if(r===o.element)return;Zl.info("Selector element changed for survey ".concat(e.id,". Re-attaching listener.")),n.removeWidgetSelectorListener(e.id)}if(!r.hasAttribute("PHWidgetSurveyClickListener")){var s=function(t){var n,i;t.stopPropagation();var r=t.currentTarget.getBoundingClientRect(),o=Ql.innerHeight,s=Ql.innerWidth,a=parseInt((null===(n=e.appearance)||void 0===n?void 0:n.maxWidth)||"300"),u=r.left+r.width/2-a/2;u+a>s-20&&(u=s-a-20),u<20&&(u=20);var l=o-r.bottom,c=r.top,d=l<250&&c>l,f={position:"fixed",top:d?"auto":"".concat(r.bottom+12,"px"),left:"".concat(u,"px"),right:"auto",bottom:d?"".concat(o-r.top+12,"px"):"auto",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderBottom:"1.5px solid ".concat((null===(i=e.appearance)||void 0===i?void 0:i.borderColor)||"#c9c6c6"),borderRadius:"10px",zIndex:ea};Ql.dispatchEvent(new CustomEvent(Xl,{detail:{surveyId:e.id,position:f}}))};Fa(r,"click",s),r.setAttribute("PHWidgetSurveyClickListener","true"),n.widgetSelectorListeners.set(e.id,{element:r,listener:s}),Zl.info("Attached click listener for survey ".concat(e.id))}}else o&&n.removeWidgetSelectorListener(e.id)}})),M(this,"canRenderSurvey",(function(e){var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=Ur.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),M(this,"renderSurvey",(function(e,t){ss(kl(ic,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),M(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=n.posthog)||void 0===e||e.getActiveMatchingSurveys((function(e){var t=e.filter((function(e){return"api"!==e.type})),i=n.sortSurveysByAppearanceDelay(t),r=new Set;i.forEach((function(e){var t,i,o;e.type===Ur.Widget&&((null===(t=e.appearance)||void 0===t?void 0:t.widgetType)===Br.Tab?n.handleWidget(e):(null===(i=e.appearance)||void 0===i?void 0:i.widgetType)===Br.Selector&&null!==(o=e.appearance)&&void 0!==o&&o.widgetSelector&&(r.add(e.id),n.manageWidgetSelectorListener(e)));Hs(n.surveyInFocus)&&e.type===Ur.Popover&&n.canShowNextEventBasedSurvey()&&n.handlePopoverSurvey(e)})),n.widgetSelectorListeners.forEach((function(e,t){r.has(t)||n.removeWidgetSelectorListener(t)}))}),t)})),M(this,"addSurveyToFocus",(function(e){Hs(n.surveyInFocus)||Zl.error("Survey ".concat($(n.surveyInFocus)," already in focus. Cannot add survey ").concat(e,".")),n.surveyInFocus=e})),M(this,"removeSurveyFromFocus",(function(e){n.surveyInFocus!==e&&Zl.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),n.clearSurveyTimeout(e),n.surveyInFocus=null})),this.posthog=t,this.surveyInFocus=null}return L(e,[{key:"clearSurveyTimeout",value:function(e){var t=this.surveyTimeouts.get(e);t&&(clearTimeout(t),this.surveyTimeouts.delete(e))}},{key:"sortSurveysByAppearanceDelay",value:function(e){return e.sort((function(e,t){var n,i,r=e.schedule===Wr.Always,o=t.schedule===Wr.Always;return r&&!o?1:!r&&o?-1:((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(i=t.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)||0)}))}},{key:"getTestAPI",value:function(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,surveyTimeouts:this.surveyTimeouts,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.manageWidgetSelectorListener,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}]),e}();function tc(e){if(Yl&&Ql){var t=new ec(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((function(){t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function nc(e){var t=e.survey,n=e.removeSurveyFromFocus,i=e.setSurveyVisible,r=e.isPreviewMode,o=void 0!==r&&r;al((function(){var e;if(!o&&null!==(e=t.conditions)&&void 0!==e&&e.url){var r=function(){if(!Vu(t))return i(!1),n(t.id)};Fa(Ql,"popstate",r),Fa(Ql,"hashchange",r);var s=Ql.history.pushState,a=Ql.history.replaceState;return Ql.history.pushState=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];s.apply(this,t),r()},Ql.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a.apply(this,t),r()},function(){Ql.removeEventListener("popstate",r),Ql.removeEventListener("hashchange",r),Ql.history.pushState=s,Ql.history.replaceState=a}}}),[o,t,n,i])}function ic(e){var t,n,i,r,o,s,a=e.survey,u=e.forceDisableHtml,l=e.posthog,c=e.style,d=e.previewPageIndex,f=e.removeSurveyFromFocus,v=e.isPopup,h=e.onPreviewSubmit,p=void 0===h?function(){}:h,g=e.onPopupSurveyDismissed,_=void 0===g?function(){}:g,m=e.onCloseConfirmationMessage,y=void 0===m?function(){}:m,b=Number.isInteger(d),k=null!==(t=a.appearance)&&void 0!==t&&t.surveyPopupDelaySeconds?1e3*a.appearance.surveyPopupDelaySeconds:0,w=function(e,t,n,i,r){var o=q(sl(i||0===n),2),s=o[0],a=o[1],u=q(sl(!1),2),l=u[0],c=u[1];return al((function(){if(t){if(!i){var o=function(){r(e.id),a(!1)},s=function(){var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(c(!0),r(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((function(){a(!1)}),5e3)):(r(e.id),a(!1))},u=function(){var n;Vu(e)&&(a(!0),Ql.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()),setTimeout((function(){var t,n,i=null===(t=Yl.querySelector(Jl(e.id)))||void 0===t||null===(n=t.shadowRoot)||void 0===n?void 0:n.querySelector('textarea, input[type="text"]');i&&i.focus()}),100))};if(Fa(Ql,"PHSurveyClosed",o),Fa(Ql,"PHSurveySent",s),n>0){var l=setTimeout(u,n);return function(){clearTimeout(l),Ql.removeEventListener("PHSurveyClosed",o),Ql.removeEventListener("PHSurveySent",s)}}return u(),function(){Ql.removeEventListener("PHSurveyClosed",o),Ql.removeEventListener("PHSurveySent",s)}}}else Zl.error("usePopupVisibility hook called without a PostHog instance.")}),[]),nc({survey:e,removeSurveyFromFocus:r,setSurveyVisible:a,isPreviewMode:i}),{isPopupVisible:s,isSurveySent:l,setIsPopupVisible:a}}(a,l,k,b,f),S=w.isPopupVisible,x=w.isSurveySent,E=w.setIsPopupVisible,C=x||d===a.questions.length,T=null!==(n=c)&&void 0!==n&&n.left&&Bs(null===(i=c)||void 0===i?void 0:i.left)?{left:c.left-40}:{};return b&&((c=c||{}).left="unset",c.right="unset",c.transform="unset"),S?kl(pa.Provider,{value:{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:function(){ua(a,l,b),_()},isPopup:v||!1,onPreviewSubmit:p},children:C?kl(Ml,{header:(null===(r=a.appearance)||void 0===r?void 0:r.thankYouMessageHeader)||"Thank you!",description:(null===(o=a.appearance)||void 0===o?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null===(s=a.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:a.appearance||oa,styleOverrides:P(P({},c),T),onClose:function(){E(!1),y()}}):kl(rc,{survey:a,forceDisableHtml:!!u,posthog:l,styleOverrides:c})}):null}function rc(e){var t,n,i=e.survey,r=e.forceDisableHtml,o=e.posthog,s=e.styleOverrides,a=ra((null===(t=i.appearance)||void 0===t?void 0:t.backgroundColor)||oa.backgroundColor),u=q(sl({}),2),l=u[0],c=u[1],d=cl(pa),f=d.previewPageIndex,v=d.onPopupSurveyDismissed,h=d.isPopup,p=d.onPreviewSubmit,g=q(sl(f||0),2),_=g[0],m=g[1],y=ll((function(){return da(i)}),[i]);al((function(){m(null!=f?f:0)}),[f]);return kl("form",{className:"survey-form",style:h?P({color:a,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor},s):{},children:y.map((function(e,t){var n;return _===t&&kl("div",{className:"survey-box",style:h?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||oa.backgroundColor}:{},children:[h&&kl(Ll,{onClick:function(){v()}}),sc({question:e,forceDisableHtml:r,displayQuestionIndex:t,appearance:i.appearance||oa,onSubmit:function(n){return function(e){var t=e.res,n=e.displayQuestionIndex,r=e.questionId;if(o)if(r){var s=function(e){return"$survey_response_".concat(e)}(r);c(P(P({},l),{},M({},s,t)));var a=Kl(i,n,t);a===Vr.End?aa(P(P({},l),{},M({},s,t)),i,o):m(a)}else Zl.error("onNextButtonClick called without a questionId.");else Zl.error("onNextButtonClick called without a PostHog instance.")}({res:n,displayQuestionIndex:t,questionId:e.id})},onPreviewSubmit:p})]})}))})}function oc(e){var t,n,i,r,o,s=e.survey,a=e.forceDisableHtml,u=e.posthog,l=e.readOnly,c=e.removeSurveyFromFocus,d=q(sl(!0),2),f=d[0],v=d[1],h=q(sl(!1),2),p=h[0],g=h[1],_=q(sl({}),2),m=_[0],y=_[1],b=ul(null);if(al((function(){var e;if(u){if(!l){if("tab"===(null===(e=s.appearance)||void 0===e?void 0:e.widgetType)&&b.current){var t,n=b.current.getBoundingClientRect();y({top:"50%",left:parseInt("".concat(n.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(t=s.appearance)||void 0===t?void 0:t.borderColor)||"#c9c6c6")})}var i=function(e){var t,n=e;(null===(t=n.detail)||void 0===t?void 0:t.surveyId)===s.id&&(Zl.info("Received show event for survey ".concat(s.id)),y(n.detail.position||{}),g(!0))};return Fa(Ql,Xl,i),function(){Ql.removeEventListener(Xl,i)}}}else Zl.error("FeedbackWidget called without a PostHog instance.")}),[u,l,s.id,null===(t=s.appearance)||void 0===t?void 0:t.widgetType,null===(n=s.appearance)||void 0===n?void 0:n.widgetSelector,null===(i=s.appearance)||void 0===i?void 0:i.borderColor]),nc({survey:s,removeSurveyFromFocus:c,setSurveyVisible:v}),!f)return null;var k=function(){g(!1)};return kl(jo,{children:["tab"===(null===(r=s.appearance)||void 0===r?void 0:r.widgetType)&&kl("div",{className:"ph-survey-widget-tab",ref:b,onClick:function(){return!l&&g(!p)},style:{color:ra(s.appearance.widgetColor)},children:[kl("div",{className:"ph-survey-widget-tab-icon"}),(null===(o=s.appearance)||void 0===o?void 0:o.widgetLabel)||""]}),p&&kl(ic,{posthog:u,survey:s,forceDisableHtml:a,style:m,removeSurveyFromFocus:c,isPopup:!0,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k},"feedback-widget-survey")]})}var sc=function(e){var t,n,i=e.question,r=e.forceDisableHtml,o=e.displayQuestionIndex,s=e.appearance,a=e.onSubmit,u=e.onPreviewSubmit,l=(M(t={},zr.Open,ql),M(t,zr.Link,$l),M(t,zr.Rating,Dl),M(t,zr.SingleChoice,jl),M(t,zr.MultipleChoice,jl),t),c={question:i,forceDisableHtml:r,appearance:s,onPreviewSubmit:function(e){u(e)},onSubmit:function(e){a(e)}},d=(M(n={},zr.Open,{}),M(n,zr.Link,{}),M(n,zr.Rating,{displayQuestionIndex:o}),M(n,zr.SingleChoice,{displayQuestionIndex:o}),M(n,zr.MultipleChoice,{displayQuestionIndex:o}),n),f=l[i.type],v=P(P({},c),d[i.type]);return kl(f,P({},v))};function ac(e){return!$s(Event)&&uc(e,Event)}function uc(e,t){try{return e instanceof t}catch(e){return!1}}function lc(e){return Hs(e)||!As(e)&&!Ms(e)}function cc(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function dc(e){return cc(e,"DOMError")}ks.__PosthogExtensions__=ks.__PosthogExtensions__||{},ks.__PosthogExtensions__.canActivateRepeatedly=fa,ks.__PosthogExtensions__.generateSurveys=tc,ks.extendPostHogWithSurveys=tc;var fc=/\(error: (.*)\)/,vc=50,hc="?";function pc(e,t,n,i){var r={platform:"web:javascript",filename:e,function:"<anonymous>"===t?hc:t,in_app:!0};return $s(n)||(r.lineno=n),$s(i)||(r.colno=i),r}var gc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_c=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mc=/\((\S*)(?::(\d+))(?::(\d+))\)/,yc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,bc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kc=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=e.split("\n"),o=t;o<r.length;o++){var s=r[o];if(!(s.length>1024)){var a=fc.test(s)?s.replace(fc,"$1"):s;if(!a.match(/\S*Error: /)){var u,l=H(i);try{for(l.s();!(u=l.n()).done;){var c=(0,u.value)(a);if(c){n.push(c);break}}}catch(e){l.e(e)}finally{l.f()}if(n.length>=vc)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,vc).map((function(e){return P(P({},e),{},{filename:e.filename||wc(t).filename,function:e.function||hc})}))}(n)}}.apply(void 0,[[30,function(e){var t=gc.exec(e);if(t){var n=q(t,4),i=n[1],r=n[2],o=n[3];return pc(i,hc,+r,+o)}var s=_c.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var a=mc.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var u=q(Cc(s[1]||hc,s[2]),2),l=u[0];return pc(u[1],l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}}],[50,function(e){var t=yc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=bc.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var i=t[3],r=t[1]||hc,o=q(Cc(r,i),2);return r=o[0],pc(i=o[1],r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function wc(e){return e[e.length-1]||{}}var Sc,xc,Ec,Cc=function(e,t){var n=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return n||i?[-1!==e.indexOf("@")?e.split("@")[0]:hc,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]};var Pc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Tc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.stacktrace||e.stack||"",i=function(e){if(e&&Ic.test(e.message))return 1;return 0}(e);try{var r=kc,o=function(e,t){var n=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var n=Object.keys(t);return Ec&&n.length===xc||(xc=n.length,Ec=n.reduce((function(n,i){Sc||(Sc={});var r=Sc[i];if(r)n[r[0]]=r[1];else for(var o=e(i),s=o.length-1;s>=0;s--){var a=o[s],u=null==a?void 0:a.filename,l=t[i];if(u&&l){n[u]=l,Sc[i]=[u,l];break}}return n}),{})),Ec}(t);return e.forEach((function(e){e.filename&&(e.chunk_id=n[e.filename])})),e}(r(n,i),r);return o.slice(0,o.length-t)}catch(e){}return[]}var Ic=/Minified React error #\d+;/i;function Fc(e,t){var n,i,r=Tc(e),o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null!==(i=null==t?void 0:t.synthetic)&&void 0!==i&&i;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return String(t.error.message);return String(t)}(e),stacktrace:{frames:r,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function Rc(e,t){var n,i,r,o=null===(n=null==t?void 0:t.handled)||void 0===n||n,s=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(r=null==t?void 0:t.defaultExceptionType)&&void 0!==r?r:"Error",value:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var u=Tc(t.syntheticException,1);u.length&&(a.stacktrace={frames:u,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Oc(e){return Ds(e)&&!Ns(e)&&Es.indexOf(e)>=0}function Lc(e,t){var n,i,r=null===(n=null==t?void 0:t.handled)||void 0===n||n,o=null===(i=null==t?void 0:t.synthetic)||void 0===i||i,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:ac(e)?e.constructor.name:"Error",a="Non-Error 'exception' captured with keys: ".concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var i=n.length;i>0;i--){var r=n.slice(0,i).join(", ");if(!(r.length>t))return i===n.length||r.length<=t?r:"".concat(r.slice(0,t),"...")}return""}(e)),u={type:s,value:a,mechanism:{handled:r,synthetic:o}};if(null!=t&&t.syntheticException){var l=Tc(null==t?void 0:t.syntheticException,1);l.length&&(u.stacktrace={frames:l,type:"raw"})}return{$exception_list:[u],$exception_level:Oc(e.level)?e.level:"error"}}function Mc(e,t){var n=e.error,i=e.event,r={$exception_list:[]},o=n||i;if(dc(o)||function(e){return cc(e,"DOMException")}(o)){var s=o;if(function(e){return"stack"in e}(o))r=Fc(o,t);else{var a=s.name||(dc(s)?"DOMError":"DOMException"),u=s.message?"".concat(a,": ").concat(s.message):a,l=dc(s)?"DOMError":"DOMException";r=Rc(u,P(P({},t),{},{overrideExceptionType:l,defaultExceptionMessage:u}))}return"code"in s&&(r.$exception_DOMException_code="".concat(s.code)),r}if(function(e){return cc(e,"ErrorEvent")}(o)&&o.error)return Fc(o.error,t);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return uc(e,Error)}}(o))return Fc(o,t);if(function(e){return cc(e,"Object")}(o)||ac(o))return Lc(o,t);if($s(n)&&Ds(i)){var c="Error",d=i,f=i.match(Pc);return f&&(c=f[1],d=f[2]),Rc(d,P(P({},t),{},{overrideExceptionType:c,defaultExceptionMessage:d}))}return Rc(o,t)}function Ac(e){var t=function(e){if(lc(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(q(e,1)[0]);return lc(t)?Rc("Non-Error promise rejection captured with value: ".concat(String(t)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Mc({event:t},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(t)})}var qc=Gs("[ExceptionAutocapture]"),$c={wrapOnError:function(e){var t=ls;t||qc.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var s=Mc({event:r[0],error:r[4]});return e(s),null!==(t=null==n?void 0:n.apply(void 0,r))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:function(e){var t=ls;t||qc.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var i,r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=Ac(o);return e(a),null!==(i=null==n?void 0:n.apply(t,o))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}},wrapConsoleError:function(e){var t=console;t||qc.info("console not available, cannot wrap console.error");var n=t.error;return t.error=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=i.join(" "),s=i.find((function(e){return e instanceof Error})),a=s?Mc({event:o,error:s}):Mc({event:o},{syntheticException:new Error("PostHog syntheticException")});return e(a),null==n?void 0:n.apply(void 0,i)},t.error.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.error)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.error=n}}};function Dc(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);return Ms(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,function(){e[t]=i}}catch(e){return function(){}}}ks.__PosthogExtensions__=ks.__PosthogExtensions__||{},ks.__PosthogExtensions__.errorWrappingFunctions=$c,ks.posthogErrorWrappingFunctions=$c;var Nc=function(e,t){if(e){var n=e.checkAndGetSessionAndWindowId(!0),i=n.sessionId,r=n.windowId;t.headers.set("X-POSTHOG-SESSION-ID",i),t.headers.set("X-POSTHOG-WINDOW-ID",r)}};ks.__PosthogExtensions__=ks.__PosthogExtensions__||{};var Hc={_patchFetch:function(e){return Dc(ls,"fetch",(function(t){return function(){var n,i=(n=T().mark((function n(i,r){var o;return T().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=new Request(i,r),Nc(e,o),n.abrupt("return",t(o));case 3:case"end":return n.stop()}}),n)})),function(){var e=this,t=arguments;return new Promise((function(i,r){var o=n.apply(e,t);function s(e){F(o,i,r,s,a,"next",e)}function a(e){F(o,i,r,s,a,"throw",e)}s(void 0)}))});return function(e,t){return i.apply(this,arguments)}}()}))},_patchXHR:function(e){return Dc(ls.XMLHttpRequest.prototype,"open",(function(t){return function(n,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(i);return Nc(e,a),t.call(this,n,a.url,r,o,s)}}))}};function jc(e){var t;return e instanceof Element&&(e.id===Fo||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container")))}function Bc(e){return!!e&&1===e.nodeType}function Uc(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function zc(e){return!!e&&3===e.nodeType}function Vc(e){return!!e&&11===e.nodeType}function Wc(e){return e?Ps(e).split(/\s+/):[]}function Gc(e){var t=null==ls?void 0:ls.location.href;return!!(t&&e&&e.some((function(e){return t.match(e)})))}function Zc(e){var t="";switch(I(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 Wc(t)}function Qc(e){return js(e)?null:Ps(e).split(/(\s+)/).filter((function(e){return ld(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Yc(e){var t="";return td(e)&&!nd(e)&&e.childNodes&&e.childNodes.length&&ya(e.childNodes,(function(e){var n;zc(e)&&e.textContent&&(t+=null!==(n=Qc(e.textContent))&&void 0!==n?n:"")})),Ps(t)}function Jc(e){return $s(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}ks.__PosthogExtensions__.tracingHeadersPatchFns=Hc,ks.postHogTracingHeadersPatchFns=Hc;var Xc=["a","button","form","input","select","textarea","label"];function Kc(e){var t=e.parentNode;return!(!t||!Bc(t))&&t}function ed(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!ls||!e||Uc(e,"html")||!Bc(e))return!1;if(null!=n&&n.url_allowlist&&!Gc(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&Gc(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}for(var s=!1,a=[e],u=!0,l=e;l.parentNode&&!Uc(l,"body");)if(Vc(l.parentNode))a.push(l.parentNode.host),l=l.parentNode.host;else{if(!(u=Kc(l)))break;if(i||Xc.indexOf(u.tagName.toLowerCase())>-1)s=!0;else{var c=ls.getComputedStyle(u);c&&"pointer"===c.getPropertyValue("cursor")&&(s=!0)}a.push(u),l=u}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if($s(n))return!0;var i,r=H(e);try{var o=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(r.s();!(i=r.n()).done;){var s=o();if("object"===I(s))return s.v}}catch(e){r.e(e)}finally{r.f()}return!1}(a,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if($s(n))return!0;var i,r=H(e);try{var o=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(r.s();!(i=r.n()).done;){var s=o();if("object"===I(s))return s.v}}catch(e){r.e(e)}finally{r.f()}return!1}(a,n))return!1;var d=ls.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return s?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(Xc.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}function td(e){for(var t=e;t.parentNode&&!Uc(t,"body");t=t.parentNode){var n=Zc(t);if(Cs(n,"ph-sensitive")||Cs(n,"ph-no-capture"))return!1}if(Cs(Zc(e),"ph-include"))return!0;var i=e.type||"";if(Ds(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";if(Ds(r)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function nd(e){return!!(Uc(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Uc(e,"select")||Uc(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var id="(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})",rd=new RegExp("^(?:".concat(id,")$")),od=new RegExp(id),sd="\\d{3}-?\\d{2}-?\\d{4}",ad=new RegExp("^(".concat(sd,")$")),ud=new RegExp("(".concat(sd,")"));function ld(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(js(e))return!1;if(Ds(e)){if(e=Ps(e),(t?rd:od).test((e||"").replace(/[- ]/g,"")))return!1;if((t?ad:ud).test(e))return!1}return!0}function cd(e){var t=Yc(e);return ld(t="".concat(t," ").concat(dd(e)).trim())?t:""}function dd(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ya(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var i=Yc(e);t="".concat(t," ").concat(i).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(dd(e)).trim())}catch(e){Ws.error("[AutoCapture]",e)}})),t}function fd(e){return function(e){var t=e.map((function(e){var t,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var r,o=H(e.attr_class);try{for(o.s();!(r=o.n()).done;){var s=r.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){o.e(e)}finally{o.f()}}var a=P(P(P(P({},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),u={};return wa(a).sort((function(e,t){var n=q(e,1)[0],i=q(t,1)[0];return n.localeCompare(i)})).forEach((function(e){var t=q(e,2),n=t[0],i=t[1];return u[vd(n.toString())]=vd(i.toString())})),i+=":",i+=wa(a).map((function(e){var t=q(e,2),n=t[0],i=t[1];return"".concat(n,'="').concat(i,'"')})).join("")}));return t.join(";")}(function(e){return e.map((function(e){var t,n,i={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:hd(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return wa(e).filter((function(e){return 0===q(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=q(e,2),n=t[0],r=t[1];return i.attributes[n]=r})),i}))}(e))}function vd(e){return e.replace(/"|\\"/g,'\\"')}function hd(e){var t=e.attr__class;return t?Ls(t)?t:Wc(t):void 0}var pd=function(){function e(){R(this,e),this.clicks=[]}return L(e,[{key:"isRageClick",value:function(e,t,n){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<30&&n-i.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),gd=Gs("[AutoCapture]");function _d(e,t){return t.length>e?t.slice(0,e)+"...":t}function md(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bc(t));return t}function yd(e,t,n,i){var r=e.tagName.toLowerCase(),o={tag_name:r};Xc.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?o.$el_text=_d(1024,cd(e)):o.$el_text=_d(1024,Yc(e)));var s=Zc(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),ya(e.attributes,(function(n){var r;if((!nd(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==i||!i.includes(n.name))&&!t&&ld(n.value)&&(r=n.name,!Ds(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var s=n.value;"class"===n.name&&(s=Wc(s).join(" ")),o["attr__"+n.name]=_d(1024,s)}}));for(var a=1,u=1,l=e;l=md(l);)a++,l.tagName===e.tagName&&u++;return o.nth_child=a,o.nth_of_type=u,o}function bd(e,t){for(var n,i,r=t.e,o=t.maskAllElementAttributes,s=t.maskAllText,a=t.elementAttributeIgnoreList,u=t.elementsChainAsString,l=[e],c=e;c.parentNode&&!Uc(c,"body");)Vc(c.parentNode)?(l.push(c.parentNode.host),c=c.parentNode.host):(l.push(c.parentNode),c=c.parentNode);var d,f=[],v={},h=!1,p=!1;if(ya(l,(function(e){var t=td(e);"a"===e.tagName.toLowerCase()&&(h=e.getAttribute("href"),h=t&&h&&ld(h)&&h),Cs(Zc(e),"ph-no-capture")&&(p=!0),f.push(yd(e,o,s,a));var n=function(e){if(!td(e))return{};var t={};return ya(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),i=e.value;n&&i&&ld(i)&&(t[n]=i)}})),t}(e);ba(v,n)})),p)return{props:{},explicitNoCapture:p};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?f[0].$el_text=cd(e):f[0].$el_text=Yc(e)),h){var g,_;f[0].attr__href=h;var m=null===(g=La(h))||void 0===g?void 0:g.host,y=null==ls||null===(_=ls.location)||void 0===_?void 0:_.host;m&&y&&m!==y&&(d=h)}return{props:ba({$event_type:r.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:fd(f)},null!==(n=f[0])&&void 0!==n&&n.$el_text?{$el_text:null===(i=f[0])||void 0===i?void 0:i.$el_text}:{},d&&"click"===r.type?{$external_click_url:d}:{},v)}}var kd=function(){function e(t){R(this,e),M(this,"_initialized",!1),M(this,"_isDisabledServerSide",null),M(this,"rageclicks",new pd),M(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}return L(e,[{key:"config",get:function(){var e,t,n=As(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((function(e){return new RegExp(e)})),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((function(e){return new RegExp(e)})),n}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(ls&&ps){var t=function(t){t=t||(null==ls?void 0:ls.event);try{e._captureEvent(t)}catch(e){gd.error("Failed to capture event",e)}};if(Fa(ps,"submit",t,{capture:!0}),Fa(ps,"change",t,{capture:!0}),Fa(ps,"click",t,{capture:!0}),this.config.capture_copied_text){var n=function(t){t=t||(null==ls?void 0:ls.event),e._captureEvent(t,Ss)};Fa(ps,"copy",n,{capture:!0}),Fa(ps,"cut",n,{capture:!0})}}}else gd.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"onRemoteConfig",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(M({},Yr,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"setElementSelectors",value:function(e){this._elementSelectors=e}},{key:"getElementSelectors",value:function(e){var t,n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((function(t){var i=null==ps?void 0:ps.querySelectorAll(t);null==i||i.forEach((function(i){e===i&&n.push(t)}))})),n}},{key:"isEnabled",get:function(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[Yr],i=this._isDisabledServerSide;if(Hs(i)&&!Us(n)&&!this.instance.config.advanced_disable_decide)return!1;var r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}},{key:"_captureEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var n,i=Jc(e);if(zc(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var r=t===Ss;if(i&&ed(i,e,this.config,r,r?["copy","cut"]:void 0)){var o=bd(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString}),s=o.props;if(o.explicitNoCapture)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===Ss){var u,l=Qc(null==ls||null===(u=ls.getSelection())||void 0===u?void 0:u.toString()),c=e.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=c}return this.instance.capture(t,s),!0}}}},{key:"isBrowserSupported",value:function(){return Ms(null==ps?void 0:ps.querySelectorAll)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Bs(e)&&isFinite(e)&&Math.floor(e)===e});var wd="0123456789abcdef",Sd=function(){function e(t){if(R(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return L(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+wd.charAt(this.bytes[t]>>>4)+wd.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,i,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(i)||!Number.isInteger(r)||t<0||n<0||i<0||r<0||t>0xffffffffffff||n>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new e(o)}}]),e}(),xd=function(){function e(){R(this,e),M(this,"timestamp",0),M(this,"counter",0),M(this,"random",new Pd)}return L(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if($s(e)){this.timestamp=0;var t=this.generateOrAbort();if($s(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Sd.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),Ed=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ls&&!$s(ls.crypto)&&crypto.getRandomValues&&(Ed=function(e){return crypto.getRandomValues(e)});var Cd,Pd=function(){function e(){R(this,e),M(this,"buffer",new Uint32Array(8)),M(this,"cursor",1/0)}return L(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Ed(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),Td=function(){return Id().toString()},Id=function(){return(Cd||(Cd=new xd)).generate()},Fd="Thu, 01 Jan 1970 00:00:00 GMT",Rd="";var Od=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Ld(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ps;if(Rd)return Rd;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),i=Math.min(n.length,8),r="dmn_chk_"+Td(),o=new RegExp("(^|;)\\s*"+r+"=1");!Rd&&i--;){var s=n.slice(i).join("."),a=r+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+Fd,Rd=s)}return Rd}(e);if(!n){var i=function(e){var t=e.match(Od);return t?t[0]:""}(e);i!==n&&Ws.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}var Md,Ad={is_supported:function(){return!!ps},error:function(e){Ws.error("cookieStore error: "+e)},get:function(e){if(ps){try{for(var t=e+"=",n=ps.cookie.split(";").filter((function(e){return e.length})),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(Ad.get(e))||{}}catch(e){}return t},set:function(e,t,n,i,r){if(ps)try{var o="",s="",a=Ld(ps.location.hostname,i);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}r&&(s="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&Ws.warn("cookieStore warning: large cookie, len="+l.length),ps.cookie=l,l}catch(e){return}},remove:function(e,t){try{Ad.set(e,"",-1,t)}catch(e){return}}},qd=null,$d={is_supported:function(){if(!Hs(qd))return qd;var e=!0;if($s(ls))e=!1;else try{var t="__mplssupport__";$d.set(t,"xyz"),'"xyz"'!==$d.get(t)&&(e=!1),$d.remove(t)}catch(t){e=!1}return e||Ws.error("localStorage unsupported; falling back to cookie store"),qd=e,e},error:function(e){Ws.error("localStorage error: "+e)},get:function(e){try{return null==ls?void 0:ls.localStorage.getItem(e)}catch(e){$d.error(e)}return null},parse:function(e){try{return JSON.parse($d.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==ls||ls.localStorage.setItem(e,JSON.stringify(t))}catch(e){$d.error(e)}},remove:function(e){try{null==ls||ls.localStorage.removeItem(e)}catch(e){$d.error(e)}}},Dd=["distinct_id",co,fo,Io,To],Nd=P(P({},$d),{},{parse:function(e){try{var t={};try{t=Ad.parse(e)||{}}catch(e){}var n=ba(t,JSON.parse($d.get(e)||"{}"));return $d.set(e,n),n}catch(e){}return null},set:function(e,t,n,i,r,o){try{$d.set(e,t,void 0,void 0,o);var s={};Dd.forEach((function(e){t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Ad.set(e,s,n,i,r,o)}catch(e){$d.error(e)}},remove:function(e,t){try{null==ls||ls.localStorage.removeItem(e),Ad.remove(e,t)}catch(e){$d.error(e)}}}),Hd={},jd={is_supported:function(){return!0},error:function(e){Ws.error("memoryStorage error: "+e)},get:function(e){return Hd[e]||null},parse:function(e){return Hd[e]||null},set:function(e,t){Hd[e]=t},remove:function(e){delete Hd[e]}},Bd=null,Ud={is_supported:function(){if(!Hs(Bd))return Bd;if(Bd=!0,$s(ls))Bd=!1;else try{var e="__support__";Ud.set(e,"xyz"),'"xyz"'!==Ud.get(e)&&(Bd=!1),Ud.remove(e)}catch(e){Bd=!1}return Bd},error:function(e){Ws.error("sessionStorage error: ",e)},get:function(e){try{return null==ls?void 0:ls.sessionStorage.getItem(e)}catch(e){Ud.error(e)}return null},parse:function(e){try{return JSON.parse(Ud.get(e))||null}catch(e){}return null},set:function(e,t){try{null==ls||ls.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Ud.error(e)}},remove:function(e){try{null==ls||ls.sessionStorage.removeItem(e)}catch(e){Ud.error(e)}}};!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(Md||(Md={}));var zd=function(){function e(t){R(this,e),this.instance=t}return L(e,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Md.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Md.DENIED||this.consent===Md.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return"1"===e?Md.GRANTED:"0"===e?Md.DENIED:Md.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?$d:Ad;var t="localStorage"===e?Ad:$d;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!Ia([null==hs?void 0:hs.doNotTrack,null==hs?void 0:hs.msDoNotTrack,ks.doNotTrack],(function(e){return Cs([!0,1,"1","yes"],e)}))}}]),e}(),Vd=Gs("[Dead Clicks]"),Wd=function(){return!0},Gd=function(e){var t,n=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(eo)),i=e.instance.config.capture_dead_clicks;return Us(i)?i:n},Zd=function(){function e(t,n,i){R(this,e),this.instance=t,this.isEnabled=n,this.onCapture=i,this.startIfEnabled()}return L(e,[{key:"lazyLoadedDeadClicksAutocapture",get:function(){return this._lazyLoadedDeadClicksAutocapture}},{key:"onRemoteConfig",value:function(e){this.instance.persistence&&this.instance.persistence.register(M({},eo,null==e?void 0:e.captureDeadClicks)),this.startIfEnabled()}},{key:"startIfEnabled",value:function(){var e=this;this.isEnabled(this)&&this.loadScript((function(){e.start()}))}},{key:"loadScript",value:function(e){var t,n,i;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.initDeadClicksAutocapture&&e(),null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"dead-clicks-autocapture",(function(t){t?Vd.error("failed to load script",t):e()}))}},{key:"start",value:function(){var e;if(ps){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=ks.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=As(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=ks.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(ps),Vd.info("starting...")}}else Vd.error("`document` not found. Cannot start.")}},{key:"stop",value:function(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Vd.info("stopping..."))}}]),e}(),Qd=Gs("[ExceptionAutocapture]"),Yd=function(){function e(t){var n,i=this;R(this,e),M(this,"startCapturing",(function(){var e;if(ls&&i.isEnabled&&null!==(e=ks.__PosthogExtensions__)&&void 0!==e&&e.errorWrappingFunctions){var t=ks.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=ks.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=ks.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!i.unwrapOnError&&i.config.capture_unhandled_errors&&(i.unwrapOnError=t(i.captureException.bind(i))),!i.unwrapUnhandledRejection&&i.config.capture_unhandled_rejections&&(i.unwrapUnhandledRejection=n(i.captureException.bind(i))),!i.unwrapConsoleError&&i.config.capture_console_errors&&(i.unwrapConsoleError=r(i.captureException.bind(i)))}catch(e){Qd.error("failed to start",e),i.stopCapturing()}}})),this.instance=t,this.remoteEnabled=!(null===(n=this.instance.persistence)||void 0===n||!n.props[Xr]),this.config=this.requiredConfig(),this.startIfEnabled()}return L(e,[{key:"requiredConfig",value:function(){var e=this.instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return As(e)?t=P(P({},t),e):($s(e)?this.remoteEnabled:e)&&(t=P(P({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}},{key:"isEnabled",get:function(){return this.config.capture_console_errors||this.config.capture_unhandled_errors||this.config.capture_unhandled_rejections}},{key:"startIfEnabled",value:function(){this.isEnabled&&(Qd.info("enabled"),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){var t,n,i;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.errorWrappingFunctions&&e(),null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"exception-autocapture",(function(t){if(t)return Qd.error("failed to load script",t);e()}))}},{key:"stopCapturing",value:function(){var e,t,n;null===(e=this.unwrapOnError)||void 0===e||e.call(this),this.unwrapOnError=void 0,null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this),this.unwrapUnhandledRejection=void 0,null===(n=this.unwrapConsoleError)||void 0===n||n.call(this),this.unwrapConsoleError=void 0}},{key:"onRemoteConfig",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.config=this.requiredConfig(),this.instance.persistence&&this.instance.persistence.register(M({},Xr,this.remoteEnabled)),this.startIfEnabled()}},{key:"captureException",value:function(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}}]),e}();function Jd(e){var t,n;return(null===(t=JSON.stringify(e,(n=[],function(e,t){if(As(t)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?"[Circular]":(n.push(t),t)}return t})))||void 0===t?void 0:t.length)||0}function Xd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),i=e.data.slice(0,n),r=e.data.slice(n);return[Xd({size:Jd(i),data:i,sessionId:e.sessionId,windowId:e.windowId}),Xd({size:Jd(r),data:r,sessionId:e.sessionId,windowId:e.windowId})].flatMap((function(e){return e}))}return[e]}var Kd=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Kd||{}),ef=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(ef||{}),tf="[SessionRecording]",nf="redacted",rf={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},of=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],sf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],af=["/s/","/e/","/i/"];function uf(e,t,n,i){if(js(e))return e;var r=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Ds(r)&&(r=parseInt(r)),r>n?tf+" ".concat(i," body too large to record (").concat(r," bytes)"):e}function lf(e,t){if(js(e))return e;var n=e;return ld(n,!1)||(n=tf+" "+t+" body "+nf),ya(sf,(function(e){var i,r;null!==(i=n)&&void 0!==i&&i.length&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(e))&&(n=tf+" "+t+" body "+nf+" as might contain: "+e)})),n}var cf=function(e,t){var n,i,r,o={payloadSizeLimitBytes:rf.payloadSizeLimitBytes,performanceEntryTypeToObserve:$(rf.performanceEntryTypeToObserve),payloadHostDenyList:[].concat($(t.payloadHostDenyList||[]),$(rf.payloadHostDenyList))},s=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,u=!1!==e.capture_performance&&t.recordPerformance,l=(n=o,r=Math.min(1e6,null!==(i=n.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=uf(e.requestBody,e.requestHeaders,r,"Request")),null!=e&&e.responseBody&&(e.responseBody=uf(e.responseBody,e.responseHeaders,r,"Response")),e}),c=function(t){return l(function(e,t){var n,i=La(e.name),r=0===t.indexOf("http")?null===(n=La(t))||void 0===n?void 0:n.pathname:t;"/"===r&&(r="");var o=null==i?void 0:i.pathname.replace(r||"","");if(!(i&&o&&af.some((function(e){return 0===o.indexOf(e)}))))return e}((i=(n=t).requestHeaders,js(i)||ya(Object.keys(null!=i?i:{}),(function(e){of.includes(e.toLowerCase())&&(i[e]=nf)})),n),e.api_host));var n,i},d=Ms(e.session_recording.maskNetworkRequestFn);return d&&Ms(e.session_recording.maskCapturedNetworkRequestFn)&&Ws.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var n=e.session_recording.maskNetworkRequestFn({url:t.name});return P(P({},t),{},{name:null==n?void 0:n.url})}),o.maskRequestFn=Ms(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,i,r,o=c(t);return o&&null!==(n=null===(i=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===i?void 0:i.call(r,o))&&void 0!==n?n:void 0}:function(e){return function(e){if(!$s(e))return e.requestBody=lf(e.requestBody,"Request"),e.responseBody=lf(e.responseBody,"Response"),e}(c(e))},P(P(P({},rf),o),{},{recordHeaders:s,recordBody:a,recordPerformance:u,recordInitialRequests:u})};function df(e,t,n,i,r){return t>n&&(Ws.warn("min cannot be greater than max."),t=n),Bs(e)?e>n?(i&&Ws.warn(i+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(i&&Ws.warn(i+" cannot be less than min: "+t+". Using min value instead."),t):e:(i&&Ws.warn(i+" must be a number. using max or fallback. max: "+n+", fallback: "+r),df(r||n,t,n,i))}var ff=L((function e(t){var n,i,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,e),M(this,"bucketSize",100),M(this,"refillRate",10),M(this,"mutationBuckets",{}),M(this,"loggedTracker",{}),M(this,"refillBuckets",(function(){Object.keys(r.mutationBuckets).forEach((function(e){r.mutationBuckets[e]=r.mutationBuckets[e]+r.refillRate,r.mutationBuckets[e]>=r.bucketSize&&delete r.mutationBuckets[e]}))})),M(this,"getNodeOrRelevantParent",(function(e){var t=r.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[r.rrweb.mirror.getId(n),n]}return[e,t]})),M(this,"numberOfChanges",(function(e){var t,n,i,r,o,s,a,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(i=null===(r=e.attributes)||void 0===r?void 0:r.length)&&void 0!==i?i:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==a?a:0)})),M(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=r.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,i,o=q(r.getNodeOrRelevantParent(e.id),2),s=o[0],a=o[1];if(0===r.mutationBuckets[s])return!1;(r.mutationBuckets[s]=null!==(t=r.mutationBuckets[s])&&void 0!==t?t:r.bucketSize,r.mutationBuckets[s]=Math.max(r.mutationBuckets[s]-1,0),0===r.mutationBuckets[s])&&(r.loggedTracker[s]||(r.loggedTracker[s]=!0,null===(n=(i=r.options).onBlockedNode)||void 0===n||n.call(i,s,a)));return e})));var i=r.numberOfChanges(t);return 0!==i||n===i?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=df(null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=df(null!==(i=this.options.bucketSize)&&void 0!==i?i:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((function(){r.refillBuckets()}),1e3)})),vf=Uint8Array,hf=Uint16Array,pf=Uint32Array,gf=new vf([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]),_f=new vf([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]),mf=new vf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yf=function(e,t){for(var n=new hf(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var r=new pf(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return[n,r]},bf=yf(gf,2),kf=bf[0],wf=bf[1];kf[28]=258,wf[258]=28;for(var Sf=yf(_f,0)[1],xf=new hf(32768),Ef=0;Ef<32768;++Ef){var Cf=(43690&Ef)>>>1|(21845&Ef)<<1;Cf=(61680&(Cf=(52428&Cf)>>>2|(13107&Cf)<<2))>>>4|(3855&Cf)<<4,xf[Ef]=((65280&Cf)>>>8|(255&Cf)<<8)>>>1}var Pf=function(e,t,n){for(var i=e.length,r=0,o=new hf(t);r<i;++r)++o[e[r]-1];var s,a=new hf(t);for(r=0;r<t;++r)a[r]=a[r-1]+o[r-1]<<1;if(n){s=new hf(1<<t);var u=15-t;for(r=0;r<i;++r)if(e[r])for(var l=r<<4|e[r],c=t-e[r],d=a[e[r]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)s[xf[d]>>>u]=l}else for(s=new hf(i),r=0;r<i;++r)s[r]=xf[a[e[r]-1]++]>>>15-e[r];return s},Tf=new vf(288);for(Ef=0;Ef<144;++Ef)Tf[Ef]=8;for(Ef=144;Ef<256;++Ef)Tf[Ef]=9;for(Ef=256;Ef<280;++Ef)Tf[Ef]=7;for(Ef=280;Ef<288;++Ef)Tf[Ef]=8;var If=new vf(32);for(Ef=0;Ef<32;++Ef)If[Ef]=5;var Ff=Pf(Tf,9,0),Rf=Pf(If,5,0),Of=function(e){return(e/8>>0)+(7&e&&1)},Lf=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof hf?hf:e instanceof pf?pf:vf)(n-t);return i.set(e.subarray(t,n)),i},Mf=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8},Af=function(e,t,n){n<<=7&t;var i=t/8>>0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},qf=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var r=n.length,o=n.slice();if(!r)return[new vf(0),0];if(1==r){var s=new vf(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=r-1;)a=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};var f=o[0].s;for(i=1;i<r;++i)o[i].s>f&&(f=o[i].s);var v=new hf(f+1),h=$f(n[c-1],v,0);if(h>t){i=0;var p=0,g=h-t,_=1<<g;for(o.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));i<r;++i){var m=o[i].s;if(!(v[m]>t))break;p+=_-(1<<h-v[m]),v[m]=t}for(p>>>=g;p>0;){var y=o[i].s;v[y]<t?p-=1<<t-v[y]++-1:++i}for(;i>=0&&p;--i){var b=o[i].s;v[b]==t&&(--v[b],++p)}h=t}return[new vf(v),h]},$f=function e(t,n,i){return-1==t.s?Math.max(e(t.l,n,i+1),e(t.r,n,i+1)):n[t.s]=i},Df=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new hf(++t),i=0,r=e[0],o=1,s=function(e){n[i++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=e[a]}return[n.subarray(0,i),t]},Nf=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},Hf=function(e,t,n){var i=n.length,r=Of(t+2);e[r]=255&i,e[r+1]=i>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var o=0;o<i;++o)e[r+o+4]=n[o];return 8*(r+4+i)},jf=function(e,t,n,i,r,o,s,a,u,l,c){Mf(t,c++,n),++r[256];for(var d=qf(r,15),f=d[0],v=d[1],h=qf(o,15),p=h[0],g=h[1],_=Df(f),m=_[0],y=_[1],b=Df(p),k=b[0],w=b[1],S=new hf(19),x=0;x<m.length;++x)S[31&m[x]]++;for(x=0;x<k.length;++x)S[31&k[x]]++;for(var E=qf(S,7),C=E[0],P=E[1],T=19;T>4&&!C[mf[T-1]];--T);var I,F,R,O,L=l+5<<3,M=Nf(r,Tf)+Nf(o,If)+s,A=Nf(r,f)+Nf(o,p)+s+14+3*T+Nf(S,C)+(2*S[16]+3*S[17]+7*S[18]);if(L<=M&&L<=A)return Hf(t,c,e.subarray(u,u+l));if(Mf(t,c,1+(A<M)),c+=2,A<M){I=Pf(f,v,0),F=f,R=Pf(p,g,0),O=p;var q=Pf(C,P,0);Mf(t,c,y-257),Mf(t,c+5,w-1),Mf(t,c+10,T-4),c+=14;for(x=0;x<T;++x)Mf(t,c+3*x,C[mf[x]]);c+=3*T;for(var $=[m,k],D=0;D<2;++D){var N=$[D];for(x=0;x<N.length;++x){var H=31&N[x];Mf(t,c,q[H]),c+=C[H],H>15&&(Mf(t,c,N[x]>>>5&127),c+=N[x]>>>12)}}}else I=Ff,F=Tf,R=Rf,O=If;for(x=0;x<a;++x)if(i[x]>255){H=i[x]>>>18&31;Af(t,c,I[H+257]),c+=F[H+257],H>7&&(Mf(t,c,i[x]>>>23&31),c+=gf[H]);var j=31&i[x];Af(t,c,R[j]),c+=O[j],j>3&&(Af(t,c,i[x]>>>5&8191),c+=_f[j])}else Af(t,c,I[i[x]]),c+=F[i[x]];return Af(t,c,I[256]),c+F[256]},Bf=new pf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Uf=function(){for(var e=new pf(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),zf=function(){var e=4294967295;return{p:function(t){for(var n=e,i=0;i<t.length;++i)n=Uf[255&n^t[i]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Vf=function(e,t,n,i,r){return function(e,t,n,i,r,o){var s=e.length,a=new vf(i+s+5*(1+Math.floor(s/7e3))+r),u=a.subarray(i,a.length-r),l=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var d=c+65535;d<s?l=Hf(u,l,e.subarray(c,d)):(u[c]=o,l=Hf(u,l,e.subarray(c,s)))}else{for(var f=Bf[t-1],v=f>>>13,h=8191&f,p=(1<<n)-1,g=new hf(32768),_=new hf(p+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&p},k=new pf(25e3),w=new hf(288),S=new hf(32),x=0,E=0,C=(c=0,0),P=0,T=0;c<s;++c){var I=b(c),F=32767&c,R=_[I];if(g[F]=R,_[I]=F,P<=c){var O=s-c;if((x>7e3||C>24576)&&O>423){l=jf(e,u,0,k,w,S,E,C,T,c-T,l),C=x=E=0,T=c;for(var L=0;L<286;++L)w[L]=0;for(L=0;L<30;++L)S[L]=0}var M=2,A=0,q=h,$=F-R&32767;if(O>2&&I==b(c-$))for(var D=Math.min(v,O)-1,N=Math.min(32767,c),H=Math.min(258,O);$<=N&&--q&&F!=R;){if(e[c+M]==e[c+M-$]){for(var j=0;j<H&&e[c+j]==e[c+j-$];++j);if(j>M){if(M=j,A=$,j>D)break;var B=Math.min($,j-2),U=0;for(L=0;L<B;++L){var z=c-$+L+32768&32767,V=z-g[z]+32768&32767;V>U&&(U=V,R=z)}}}$+=(F=R)-(R=g[F])+32768&32767}if(A){k[C++]=268435456|wf[M]<<18|Sf[A];var W=31&wf[M],G=31&Sf[A];E+=gf[W]+_f[G],++w[257+W],++S[G],P=c+M,++x}else k[C++]=e[c],++w[e[c]]}}l=jf(e,u,o,k,w,S,E,C,T,c-T,l)}return Lf(a,0,i+Of(l)+r)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,i,!r)},Wf=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Gf=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Wf(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}},Zf=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Qf(e,t){void 0===t&&(t={});var n=zf(),i=e.length;n.p(e);var r=Vf(e,t,Zf(t),8),o=r.length;return Gf(r,t),Wf(r,o-8,n.d()),Wf(r,o-4,i),r}function Yf(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new vf(e.length+(e.length>>>1)),r=0,o=function(e){i[r++]=e},s=0;s<n;++s){if(r+5>i.length){var a=new vf(r+8+(n-s<<1));a.set(i),i=a}var u=e.charCodeAt(s);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Lf(i,0,r)}function Jf(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%100<df(100*t,0,100)}var Xf="[SessionRecording]",Kf=Gs(Xf);function ev(){var e,t;return null==ks||null===(e=ks.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}var tv=3e5,nv=[ef.MouseMove,ef.MouseInteraction,ef.Scroll,ef.ViewportResize,ef.Input,ef.TouchMove,ef.MediaInteraction,ef.Drag],iv=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}};function rv(e){return function(e,t){for(var n="",i=0;i<e.length;){var r=e[i++];r<128||t?n+=String.fromCharCode(r):r<224?n+=String.fromCharCode((31&r)<<6|63&e[i++]):r<240?n+=String.fromCharCode((15&r)<<12|(63&e[i++])<<6|63&e[i++]):(r=((15&r)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++])-65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}return n}(Qf(Yf(JSON.stringify(e))),!0)}function ov(e){return e.type===Kd.Custom&&"sessionIdle"===e.data.tag}function sv(e,t){return t.some((function(t){return"regex"===t.matching&&new RegExp(t.url).test(e)}))}var av=function(){function e(t){var n=this;if(R(this,e),M(this,"queuedRRWebEvents",[]),M(this,"isIdle","unknown"),M(this,"_linkedFlagSeen",!1),M(this,"_lastActivityTimestamp",Date.now()),M(this,"_linkedFlag",null),M(this,"_removePageViewCaptureHook",void 0),M(this,"_onSessionIdListener",void 0),M(this,"_persistDecideOnSessionListener",void 0),M(this,"_samplingSessionListener",void 0),M(this,"_urlTriggers",[]),M(this,"_urlBlocklist",[]),M(this,"_urlBlocked",!1),M(this,"_eventTriggers",[]),M(this,"_removeEventTriggerCaptureHook",void 0),M(this,"_forceAllowLocalhostNetworkCapture",!1),M(this,"_onBeforeUnload",(function(){n._flushBuffer()})),M(this,"_onOffline",(function(){n._tryAddCustomEvent("browser offline",{})})),M(this,"_onOnline",(function(){n._tryAddCustomEvent("browser online",{})})),M(this,"_onVisibilityChange",(function(){if(null!=ps&&ps.visibilityState){var e="window "+ps.visibilityState;n._tryAddCustomEvent(e,{})}})),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Kf.error("started without valid sessionManager"),new Error(Xf+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(Xf+" cannot be used with __preview_experimental_cookieless_mode.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,o=i.windowId;this.sessionId=r,this.windowId=o,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Kf.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}return L(e,[{key:"sessionIdleThresholdMilliseconds",get:function(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Xf+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:tv}},{key:"isSampled",get:function(){var e=this.instance.get_property(fo);return Us(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],i=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-i:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(no),t=!this.instance.config.disable_session_recording;return ls&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(io),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e,t,n,i,r,o,s=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(so),u=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,l=null!==(n=null!==(i=null==s?void 0:s.canvasFps)&&void 0!==i?i:null==a?void 0:a.fps)&&void 0!==n?n:4,c=null!==(r=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==r?r:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:u,fps:df(l,0,12,"canvas recording fps",4),quality:df(c,0,1,"canvas recording quality",.4)}}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(ro),i={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},r=(null==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),s=As(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Us(s)?s:null==n?void 0:n.capturePerformance);return r||o||a?{recordHeaders:r,recordBody:o,recordPerformance:a}:void 0}},{key:"masking",get:function(){var e,t,n,i,r,o,s=this.instance.get_property(oo),a={maskAllInputs:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.maskTextSelector,blockSelector:null===(n=this.instance.config.session_recording)||void 0===n?void 0:n.blockSelector},u=null!==(i=null==a?void 0:a.maskAllInputs)&&void 0!==i?i:null==s?void 0:s.maskAllInputs,l=null!==(r=null==a?void 0:a.maskTextSelector)&&void 0!==r?r:null==s?void 0:s.maskTextSelector,c=null!==(o=null==a?void 0:a.blockSelector)&&void 0!==o?o:null==s?void 0:s.blockSelector;return $s(u)&&$s(l)&&$s(c)?void 0:{maskAllInputs:null==u||u,maskTextSelector:l,blockSelector:c}}},{key:"sampleRate",get:function(){var e=this.instance.get_property(ao);return Bs(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(uo);return Bs(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?!1===this.isSampled?"disabled":this._urlBlocked?"paused":js(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":Us(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"urlTriggerStatus",get:function(){var e;return 0===this._urlTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(vo))===this.sessionId?"trigger_activated":"trigger_pending"}},{key:"eventTriggerStatus",get:function(){var e;return 0===this._eventTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(ho))===this.sessionId?"trigger_activated":"trigger_pending"}},{key:"triggerStatus",get:function(){var e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}},{key:"startIfEnabledOrStop",value:function(e){var t=this;this.isRecordingEnabled?(this._startCapture(e),Fa(ls,"beforeunload",this._onBeforeUnload),Fa(ls,"offline",this._onOffline),Fa(ls,"online",this._onOnline),Fa(ls,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),js(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",(function(e){try{if("$pageview"===e.event){var n=null!=e&&e.properties.$current_url?t._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n})}}catch(e){Kf.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((function(e,n,i){var r,o,s,a;i&&(t._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:n,changeReason:i}),null===(r=t.instance)||void 0===r||null===(o=r.persistence)||void 0===o||o.unregister(ho),null===(s=t.instance)||void 0===s||null===(a=s.persistence)||void 0===a||a.unregister(vo))})))):this.stopRecording()}},{key:"stopRecording",value:function(){var e,t,n,i;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==ls||ls.removeEventListener("beforeunload",this._onBeforeUnload),null==ls||ls.removeEventListener("offline",this._onOffline),null==ls||ls.removeEventListener("online",this._onOnline),null==ls||ls.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._removeEventTriggerCaptureHook)||void 0===t||t.call(this),this._removeEventTriggerCaptureHook=void 0,null===(n=this._onSessionIdListener)||void 0===n||n.call(this),this._onSessionIdListener=void 0,null===(i=this._samplingSessionListener)||void 0===i||i.call(this),this._samplingSessionListener=void 0,Kf.info("stopped"))}},{key:"_resetSampling",value:function(){var e;null===(e=this.instance.persistence)||void 0===e||e.unregister(fo)}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e,i=this.sampleRate;if(Bs(i)){var r=this.isSampled,o=n||!Us(r),s=o?Jf(e,i):r;o&&(s?this._reportStarted("sampled"):Kf.warn("Sample rate (".concat(i,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:s})),null===(t=this.instance.persistence)||void 0===t||t.register(M({},fo,s))}else this._resetSampling()}},{key:"onRemoteConfig",value:function(e){var t,n,i,r,o,s,a=this;(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint);if(this._setupSampling(),!js(this._linkedFlag)&&!this._linkedFlagSeen){var u=Ds(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=Ds(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((function(e,t){var n=As(t)&&u in t,i=l?t[u]===l:n;i&&a._reportStarted("linked_flag_matched",{linkedFlag:u,linkedVariant:l}),a._linkedFlagSeen=i}))}null!==(i=e.sessionRecording)&&void 0!==i&&i.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!==(r=e.sessionRecording)&&void 0!==r&&r.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!==(o=e.sessionRecording)&&void 0!==o&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;Bs(this.sampleRate)&&js(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((function(t){e.makeSamplingDecision(t)})))}},{key:"_persistRemoteConfig",value:function(e){var t=this;if(this.instance.persistence){var n,i=this.instance.persistence,r=function(){var n,r,o,s,a,u,l,c,d,f,v=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate,h=js(v)?null:parseFloat(v);js(h)&&t._resetSampling();var p=null===(r=e.sessionRecording)||void 0===r?void 0:r.minimumDurationMilliseconds;i.register((M(f={},no,!!e.sessionRecording),M(f,io,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),M(f,ro,P({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture)),M(f,oo,null===(a=e.sessionRecording)||void 0===a?void 0:a.masking),M(f,so,{enabled:null===(u=e.sessionRecording)||void 0===u?void 0:u.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality}),M(f,ao,h),M(f,uo,$s(p)?null:p),M(f,lo,null===(d=e.sessionRecording)||void 0===d?void 0:d.scriptConfig),f))};r(),null===(n=this._persistDecideOnSessionListener)||void 0===n||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(r)}}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}},{key:"_startCapture",value:function(e){var t=this;if(!$s(Object.assign)&&!$s(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var n,i;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),ev())this._onScriptLoaded();else null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,this.scriptName,(function(e){if(e)return Kf.error("could not load recorder",e);t._onScriptLoaded()}));Kf.info("starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}},{key:"scriptName",get:function(){var e,t,n;return(null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t||null===(n=t.get_property(lo))||void 0===n?void 0:n.script)||"recorder"}},{key:"isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==nv.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle)){var i="unknown"===this.isIdle;this.isIdle=!1,i||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)}if(!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=r.windowId,s=r.sessionId,a=this.sessionId!==s,u=this.windowId!==o;this.windowId=o,this.sessionId=s,a||u?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):n&&this._scheduleFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Kf.warn("could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){return this._tryRRWebMethod(iv((function(){return ev().addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){return this._tryRRWebMethod(iv((function(){return ev().takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){for(var e,t,n,i,r=this,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},s=this.instance.config.session_recording,a=0,u=Object.entries(s||{});a<u.length;a++){var l=q(u[a],2),c=l[0],d=l[1];c in o&&("maskInputOptions"===c?o.maskInputOptions=P({password:!0},d):o[c]=d)}(this.canvasRecording&&this.canvasRecording.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.canvasRecording.fps},o.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.masking)&&(o.maskAllInputs=null===(t=this.masking.maskAllInputs)||void 0===t||t,o.maskTextSelector=null!==(n=this.masking.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(i=this.masking.blockSelector)&&void 0!==i?i:void 0);var f=ev();if(f){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new ff(f,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:function(e,t){var n="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");Kf.info(n,{node:t}),r.log(Xf+" "+n,"warn")}});var v=this._gatherRRWebPlugins();this.stopRrweb=f(P({emit:function(e){r.onRRwebEmit(e)},plugins:v},o)),this._lastActivityTimestamp=Date.now(),this.isIdle=Us(this.isIdle)?this.isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:o,activePlugins:v.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Kf.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!0!==this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),t))}}},{key:"_gatherRRWebPlugins",value:function(){var e,t,n,i,r=[],o=null===(e=ks.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&r.push(o());var s=null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.rrwebPlugins)||void 0===i?void 0:i.getRecordNetworkPlugin;this.networkPayloadCapture&&Ms(s)&&(!Oa.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(s(cf(this.instance.config,this.networkPayloadCapture))):Kf.info("NetworkCapture not started because we are on localhost."));return r}},{key:"onRRwebEmit",value:function(e){var t;if(this._processQueuedEvents(),e&&As(e)){if(e.type===Kd.Meta){var n=this._maskUrl(e.data.href);if(this._lastHref=n,!n)return;e.data.href=n}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),!this._urlBlocked||function(e){return e.type===Kd.Custom&&"recording paused"===e.data.tag}(e)){e.type===Kd.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Kd.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(e){var t=e;if(t&&As(t)&&6===t.type&&As(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],i=0;i<t.data.payload.payload.length;i++)t.data.payload.payload[i]&&t.data.payload.payload[i].length>2e3?n.push(t.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[i]);return t.data.payload.payload=n,e}return e}(i);if(this._updateWindowAndSessionIds(r),!0!==this.isIdle||ov(r)){if(ov(r)){var o=r.data.payload;if(o){var s=o.lastActivityTimestamp,a=o.threshold;r.timestamp=s+a}}var u=null===(t=this.instance.config.session_recording.compress_events)||void 0===t||t?function(e){if(Jd(e)<1024)return e;try{if(e.type===Kd.FullSnapshot)return P(P({},e),{},{data:rv(e.data),cv:"2024-10"});if(e.type===Kd.IncrementalSnapshot&&e.data.source===ef.Mutation)return P(P({},e),{},{cv:"2024-10",data:P(P({},e.data),{},{texts:rv(e.data.texts),attributes:rv(e.data.attributes),removes:rv(e.data.removes),adds:rv(e.data.adds)})});if(e.type===Kd.IncrementalSnapshot&&e.data.source===ef.StyleSheetRule)return P(P({},e),{},{cv:"2024-10",data:P(P({},e.data),{},{adds:e.data.adds?rv(e.data.adds):void 0,removes:e.data.removes?rv(e.data.removes):void 0})})}catch(e){Kf.error("could not compress event - will use uncompressed event",e)}return e}(r):r,l={$snapshot_bytes:Jd(u),$snapshot_data:u,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(l):this.clearBuffer()}}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&ls){var e=this._maskUrl(ls.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=$(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(t){Date.now()-t.enqueuedAt<=2e3&&e._tryRRWebMethod(t)}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,i={url:e};return null===(n=i=t.maskNetworkRequestFn(i))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,i=Bs(n)&&n>=0,r=Bs(t)&&i&&n<t;if("buffering"===this.status||"paused"===this.status||"disabled"===this.status||r)return this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&Xd(this.buffer).forEach((function(t){e._captureSnapshot({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:ws.LIB_VERSION})}));return this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,i=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}},{key:"_checkUrlTriggerConditions",value:function(){if(void 0!==ls&&ls.location.href){var e=ls.location.href,t=this._urlBlocked,n=sv(e,this._urlBlocklist);n&&!t?this._pauseRecording():!n&&t&&this._resumeRecording(),sv(e,this._urlTriggers)&&this._activateTrigger("url")}}},{key:"_activateTrigger",value:function(e){var t,n;"trigger_pending"===this.triggerStatus&&(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register(M({},"url"===e?vo:ho,this.sessionId)),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}},{key:"_pauseRecording",value:function(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Kf.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}},{key:"_resumeRecording",value:function(){this._urlBlocked&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Kf.info("recording resumed"))}},{key:"_addEventTriggerListener",value:function(){var e=this;0!==this._eventTriggers.length&&js(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(function(t){try{e._eventTriggers.includes(t.event)&&e._activateTrigger("event")}catch(e){Kf.error("Could not activate event trigger",e)}})))}},{key:"overrideLinkedFlag",value:function(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}},{key:"overrideSampling",value:function(){var e;null===(e=this.instance.persistence)||void 0===e||e.register(M({},fo,!0)),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}},{key:"overrideTrigger",value:function(e){this._activateTrigger(e)}},{key:"_reportStarted",value:function(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),Kf.info(e.replace("_"," "),t),Cs(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}},{key:"sdkDebugProperties",get:function(){var e=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.buffer.data.length,$sdk_debug_replay_internal_buffer_size:this.buffer.size,$sdk_debug_current_session_duration:this.sessionDuration,$sdk_debug_session_start:e}}}]),e}(),uv=Gs("[SegmentIntegration]");function lv(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var i=function(n){var i=function(){return n.anonymousId()||Td()};e.config.get_device_id=i,n.id()&&(e.register({distinct_id:n.id(),$device_id:i()}),e.persistence.set_property(So,"identified")),t()},r=n.user();"then"in r&&Ms(r.then)?r.then((function(e){return i(e)})):i(r)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||uv.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){var i;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(uv.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(uv.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e._calculate_event_properties(n,null!==(i=t.event.properties)&&void 0!==i?i:{},new Date);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(e)).then((function(){t()}))}))}var cv="posthog-js";function dv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.organization,i=t.projectId,r=t.prefix,o=t.severityAllowList,s=void 0===o?["error"]:o;return function(t){var o,a,u,l,c;if(!("*"===s||s.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null===(o=t.exception)||void 0===o?void 0:o.values)||[],v=f.map((function(e){return P(P({},e),{},{stacktrace:e.stacktrace?P(P({},e.stacktrace),{},{type:"raw",frames:(e.stacktrace.frames||[]).map((function(e){return P(P({},e),{},{platform:"web:javascript"})}))}):void 0})})),h={$exception_message:(null===(a=f[0])||void 0===a?void 0:a.value)||t.message,$exception_type:null===(u=f[0])||void 0===u?void 0:u.type,$exception_personURL:d,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null===(l=f[0])||void 0===l?void 0:l.value)||t.message,$sentry_exception_type:null===(c=f[0])||void 0===c?void 0:c.type,$sentry_tags:t.tags};return n&&i&&(h.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+t.event_id),e.exceptions.sendExceptionEvent(h),t}}var fv,vv=L((function e(t,n,i,r,o){R(this,e),this.name=cv,this.setupOnce=function(e){e(dv(t,{organization:n,projectId:i,prefix:r,severityAllowList:o}))}})),hv=null!=ls&&ls.location?$a(ls.location.hash,"__posthog")||$a(location.hash,"state"):null,pv="_postHogToolbarParams",gv=Gs("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(fv||(fv={}));var _v=function(){function e(t){R(this,e),this.instance=t}return L(e,[{key:"setToolbarState",value:function(e){ks.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return null!==(e=ks.ph_toolbar_state)&&void 0!==e?e:fv.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!ls||!ps)return!1;n=null!==(e=n)&&void 0!==e?e:ls.location,r=null!==(t=r)&&void 0!==t?t:ls.history;try{if(!i){try{ls.localStorage.setItem("test","test"),ls.localStorage.removeItem("test")}catch(e){return!1}i=null==ls?void 0:ls.localStorage}var o,s=hv||$a(n.hash,"__posthog")||$a(n.hash,"state"),a=s?Sa((function(){return JSON.parse(atob(decodeURIComponent(s)))}))||Sa((function(){return JSON.parse(decodeURIComponent(s))})):null;return a&&"ph_authorize"===a.action?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?n.hash=a.desiredHash:r?r.replaceState(r.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(i.getItem(pv)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"_callLoadToolbar",value:function(e){var t=ks.ph_load_toolbar||ks.ph_load_editor;!js(t)&&Ms(t)?t(e,this.instance):gv.warn("No toolbar load function found")}},{key:"loadToolbar",value:function(e){var t=this,n=!(null==ps||!ps.getElementById(Fo));if(!ls||n)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=P(P({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(ls.localStorage.setItem(pv,JSON.stringify(P(P({},r),{},{source:void 0}))),this.getToolbarState()===fv.LOADED)this._callLoadToolbar(r);else if(this.getToolbarState()===fv.UNINITIALIZED){var o,s;this.setToolbarState(fv.LOADING),null===(o=ks.__PosthogExtensions__)||void 0===o||null===(s=o.loadExternalDependency)||void 0===s||s.call(o,this.instance,"toolbar",(function(e){if(e)return gv.error("[Toolbar] Failed to load",e),void t.setToolbarState(fv.UNINITIALIZED);t.setToolbarState(fv.LOADED),t._callLoadToolbar(r)})),Fa(ls,"turbolinks:load",(function(){t.setToolbarState(fv.UNINITIALIZED),t.loadToolbar(r)}))}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),mv=Gs("[TracingHeaders]"),yv=function(){function e(t){var n=this;R(this,e),M(this,"_restoreXHRPatch",void 0),M(this,"_restoreFetchPatch",void 0),M(this,"_startCapturing",(function(){var e,t,i,r;$s(n._restoreXHRPatch)&&(null===(e=ks.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(n.instance.sessionManager));$s(n._restoreFetchPatch)&&(null===(i=ks.__PosthogExtensions__)||void 0===i||null===(r=i.tracingHeadersPatchFns)||void 0===r||r._patchFetch(n.instance.sessionManager))})),this.instance=t}return L(e,[{key:"_loadScript",value:function(e){var t,n,i;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"tracing-headers",(function(t){if(t)return mv.error("failed to load script",t);e()}))}},{key:"startIfEnabledOrStop",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),e}(),bv=Gs("[Web Vitals]"),kv=9e5,wv=function(){function e(t){var n,i=this;R(this,e),M(this,"_enabledServerSide",!1),M(this,"_initialized",!1),M(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),M(this,"_flushToCapture",(function(){clearTimeout(i._delayedFlushTimer),0!==i.buffer.metrics.length&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce((function(e,t){var n;return P(P({},e),{},(M(n={},"$web_vitals_".concat(t.name,"_event"),P({},t)),M(n,"$web_vitals_".concat(t.name,"_value"),t.value),n))}),{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),M(this,"_addToBuffer",(function(e){var t,n=null===(t=i.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);if($s(n))bv.error("Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=i._currentURL();if(!$s(r))if(js(null==e?void 0:e.name)||js(null==e?void 0:e.value))bv.error("Invalid metric received",e);else if(i._maxAllowedValue&&e.value>=i._maxAllowedValue)bv.error("Ignoring metric with value >= "+i._maxAllowedValue,e);else i.buffer.url!==r&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,i.flushToCaptureTimeoutMs)),$s(i.buffer.url)&&(i.buffer.url=r),i.buffer.firstMetricTimestamp=$s(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),i.buffer.metrics.push(P(P({},e),{},{$current_url:r,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),i.buffer.metrics.length===i.allowedMetrics.length&&i._flushToCapture()}})),M(this,"_startCapturing",(function(){var e,t,n,r,o=ks.__PosthogExtensions__;if(!$s(o)&&!$s(o.postHogWebVitalsCallbacks)){var s=o.postHogWebVitalsCallbacks;e=s.onLCP,t=s.onCLS,n=s.onFCP,r=s.onINP}e&&t&&n&&r?(i.allowedMetrics.indexOf("LCP")>-1&&e(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("CLS")>-1&&t(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("FCP")>-1&&n(i._addToBuffer.bind(i)),i.allowedMetrics.indexOf("INP")>-1&&r(i._addToBuffer.bind(i)),i._initialized=!0):bv.error("web vitals callbacks not loaded - not starting")})),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[Kr]),this.startIfEnabled()}return L(e,[{key:"allowedMetrics",get:function(){var e,t,n=As(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return $s(n)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[to])||["CLS","FCP","INP","LCP"]:n}},{key:"flushToCaptureTimeoutMs",get:function(){return(As(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}},{key:"_maxAllowedValue",get:function(){var e=As(this.instance.config.capture_performance)&&Bs(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:kv;return 0<e&&e<=6e4?kv:e}},{key:"isEnabled",get:function(){var e=null==gs?void 0:gs.protocol;if("http:"!==e&&"https:"!==e)return bv.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=As(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Us(t)?t:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(bv.info("enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"onRemoteConfig",value:function(e){var t=As(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=As(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register(M({},Kr,t)),this.instance.persistence.register(M({},to,n))),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){var t,n,i;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"web-vitals",(function(t){t?bv.error("failed to load script",t):e()}))}},{key:"_currentURL",value:function(){var e=ls?ls.location.href:void 0;return e||bv.error("Could not determine current URL"),e}}]),e}(),Sv=Gs("[Heatmaps]");function xv(e){return As(e)&&"clientX"in e&&"clientY"in e&&Bs(e.clientX)&&Bs(e.clientY)}var Ev,Cv=function(){function e(t){var n;R(this,e),M(this,"rageclicks",new pd),M(this,"_enabledServerSide",!1),M(this,"_initialized",!1),M(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[Jr])}return L(e,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return As(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return $s(this.instance.config.capture_heatmaps)?$s(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}},{key:"startIfEnabled",value:function(){if(this.isEnabled){if(this._initialized)return;Sv.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null===(t=this.deadClicksCapture)||void 0===t||t.stop(),this.getAndClearBuffer()}}},{key:"onRemoteConfig",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(M({},Jr,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_onDeadClick",value:function(e){this._onClick(e.originalEvent,"deadclick")}},{key:"_setupListeners",value:function(){var e=this;ls&&ps&&(Fa(ls,"beforeunload",this.flush.bind(this)),Fa(ps,"click",(function(t){return e._onClick(t||(null==ls?void 0:ls.event))}),{capture:!0}),Fa(ps,"mousemove",(function(t){return e._onMouseMove(t||(null==ls?void 0:ls.event))}),{capture:!0}),this.deadClicksCapture=new Zd(this.instance,Wd,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var i=e;i&&Bc(i)&&!Uc(i,"body");){if(i===n)return!1;if(Cs(t,null==ls?void 0:ls.getComputedStyle(i).position))return!0;i=Kc(i)}return!1}(Jc(e),["fixed","sticky"],r);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:n),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(!jc(e.target)&&xv(e)){var i=this._getProperties(e,n);null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(P(P({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;!jc(e.target)&&xv(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))}},{key:"_capture",value:function(e){if(ls){var t=ls.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}},{key:"flush",value:function(){this.buffer&&!qs(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),e}(),Pv=function(){function e(t){R(this,e),this._instance=t}return L(e,[{key:"doPageView",value:function(e,t){var n,i=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(n=null==ls?void 0:ls.location.pathname)&&void 0!==n?n:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}},{key:"doPageLeave",value:function(e){var t;return this._previousPageViewProperties(e,null===(t=this._currentPageview)||void 0===t?void 0:t.pageViewId)}},{key:"doEvent",value:function(){var e;return{$pageview_id:null===(e=this._currentPageview)||void 0===e?void 0:e.pageViewId}}},{key:"_previousPageViewProperties",value:function(e,t){var n=this._currentPageview;if(!n)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:n.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var o=r.maxScrollHeight,s=r.lastScrollY,a=r.maxScrollY,u=r.maxContentHeight,l=r.lastContentY,c=r.maxContentY;if(!($s(o)||$s(s)||$s(a)||$s(u)||$s(l)||$s(c))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c);var d=o<=1?1:df(s/o,0,1),f=o<=1?1:df(a/o,0,1),v=u<=1?1:df(l/u,0,1),h=u<=1?1:df(c/u,0,1);i=ba(i,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:h})}}return n.pathname&&(i.$prev_pageview_pathname=n.pathname),n.timestamp&&(i.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),i}}]),e}(),Tv=function(){function e(t){R(this,e),this.instance=t}return L(e,[{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}]),e}(),Iv=Gs("[FeatureFlags]"),Fv="$active_feature_flags",Rv="$override_feature_flags",Ov="$feature_flag_payloads",Lv="$override_feature_flag_payloads",Mv="$feature_flag_request_id",Av=function(e){var t,n={},i=H(wa(e||{}));try{for(i.s();!(t=i.n()).done;){var r=q(t.value,2),o=r[0],s=r[1];s&&(n[o]=s)}}catch(e){i.e(e)}finally{i.f()}return n},qv=function(e){var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((function(e){var n;return[e,null!==(n=t[e].variant)&&void 0!==n?n:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((function(e){return t[e].enabled})).filter((function(e){var n;return null===(n=t[e].metadata)||void 0===n?void 0:n.payload})).map((function(e){var n;return[e,null===(n=t[e].metadata)||void 0===n?void 0:n.payload]})))):Iv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};!function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"}(Ev||(Ev={}));var $v=function(){function e(t){R(this,e),M(this,"_override_warning",!1),M(this,"_hasLoadedFlags",!1),M(this,"_requestInFlight",!1),M(this,"_reloadingDisabled",!1),M(this,"_additionalReloadRequested",!1),M(this,"_decideCalled",!1),M(this,"_flagsLoadedFromRemote",!1),this.instance=t,this.featureFlagEventHandlers=[]}return L(e,[{key:"decide",value:function(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}},{key:"hasLoadedFlags",get:function(){return this._hasLoadedFlags}},{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagsWithDetails",value:function(){var e=this.instance.get_property(_o),t=this.instance.get_property(Rv),n=this.instance.get_property(Lv);if(!n&&!t)return e||{};var i,r=ba({},e||{}),o=H($(new Set([].concat($(Object.keys(n||{})),$(Object.keys(t||{}))))));try{for(o.s();!(i=o.n()).done;){var s,a,u=i.value,l=r[u],c=null==t?void 0:t[u],d=$s(c)?null!==(s=null==l?void 0:l.enabled)&&void 0!==s&&s:!!c,f=$s(c)?l.variant:"string"==typeof c?c:void 0,v=null==n?void 0:n[u],h=P(P({},l),{},{enabled:d,variant:d?null!=f?f:null==l?void 0:l.variant:void 0});if(d!==(null==l?void 0:l.enabled)&&(h.original_enabled=null==l?void 0:l.enabled),f!==(null==l?void 0:l.variant)&&(h.original_variant=null==l?void 0:l.variant),v)h.metadata=P(P({},null==l?void 0:l.metadata),{},{payload:v,original_payload:null==l||null===(a=l.metadata)||void 0===a?void 0:a.payload});r[u]=h}}catch(e){o.e(e)}finally{o.f()}return this._override_warning||(Iv.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this._override_warning=!0),r}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(po),t=this.instance.get_property(Rv);if(!t)return e||{};for(var n=ba({},e),i=Object.keys(t),r=0;r<i.length;r++)n[i[r]]=t[i[r]];return this._override_warning||(Iv.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){var e=this.instance.get_property(Ov),t=this.instance.get_property(Lv);if(!t)return e||{};for(var n=ba({},e||{}),i=Object.keys(t),r=0;r<i.length;r++)n[i[r]]=t[i[r]];return this._override_warning||(Iv.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this._override_warning=!0),n}},{key:"reloadFeatureFlags",value:function(){var e=this;this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((function(){e._callDecideEndpoint()}),5))}},{key:"clearDebouncer",value:function(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}},{key:"ensureFlagsLoaded",value:function(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this._reloadingDisabled=e}},{key:"_callDecideEndpoint",value:function(e){var t,n=this;if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var i={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:P(P({},(null===(t=this.instance.persistence)||void 0===t?void 0:t.get_initial_props())||{}),this.instance.get_property(mo)||{}),group_properties:this.instance.get_property(yo)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var r=this.instance.config.__preview_flags_v2&&this.instance.config.__preview_remote_config;r&&(i.timezone=$u.timezone()),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api",r?"/flags/?v=2":"/decide/?v=4"),data:i,compression:this.instance.config.disable_compression?void 0:us.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(e){var t,r,o,s=!0;(200===e.statusCode&&(n._additionalReloadRequested||(n.$anon_distinct_id=void 0),s=!1),n._requestInFlight=!1,n._decideCalled)||(n._decideCalled=!0,n.instance._onRemoteConfig(null!==(o=e.json)&&void 0!==o?o:{}));i.disable_flags&&!n._additionalReloadRequested||(n._flagsLoadedFromRemote=!s,e.json&&null!==(t=e.json.quotaLimited)&&void 0!==t&&t.includes(Ev.FeatureFlags)?Iv.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."):(n.receivedFeatureFlags(null!==(r=e.json)&&void 0!==r?r:{},s),n._additionalReloadRequested&&(n._additionalReloadRequested=!1,n._callDecideEndpoint())))}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants()[e],i="".concat(n),r=this.instance.get_property(Mv)||void 0,o=this.instance.get_property(wo)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(i))){var s,a,u,l,c,d,f,v,h,p,g;Ls(o[e])?o[e].push(i):o[e]=[i],null===(s=this.instance.persistence)||void 0===s||s.register(M({},wo,o));var _=this.getFeatureFlagDetails(e),m={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:r,$feature_flag_bootstrapped_response:(null===(a=this.instance.config.bootstrap)||void 0===a||null===(u=a.featureFlags)||void 0===u?void 0:u[e])||null,$feature_flag_bootstrapped_payload:(null===(l=this.instance.config.bootstrap)||void 0===l||null===(c=l.featureFlagPayloads)||void 0===c?void 0:c[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};$s(null==_||null===(d=_.metadata)||void 0===d?void 0:d.version)||(m.$feature_flag_version=_.metadata.version);var y,b=null!==(f=null==_||null===(v=_.reason)||void 0===v?void 0:v.description)&&void 0!==f?f:null==_||null===(h=_.reason)||void 0===h?void 0:h.code;if(b&&(m.$feature_flag_reason=b),null!=_&&null!==(p=_.metadata)&&void 0!==p&&p.id&&(m.$feature_flag_id=_.metadata.id),$s(null==_?void 0:_.original_variant)&&$s(null==_?void 0:_.original_enabled)||(m.$feature_flag_original_response=$s(_.original_variant)?_.original_enabled:_.original_variant),null!=_&&null!==(g=_.metadata)&&void 0!==g&&g.original_payload)m.$feature_flag_original_payload=null==_||null===(y=_.metadata)||void 0===y?void 0:y.original_payload;this.instance.capture("$feature_flag_called",m)}return n}Iv.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagDetails",value:function(e){return this.getFlagsWithDetails()[e]}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"getRemoteConfigPayload",value:function(e,t){var n=this.instance.config.token;this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this.instance.get_distinct_id(),token:n},compression:this.instance.config.disable_compression?void 0:us.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(n){var i,r=null===(i=n.json)||void 0===i?void 0:i.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Iv.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),i=this.getFlagPayloads(),r=this.getFlagsWithDetails();!function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=qv(e),a=s.flags,u=s.featureFlags,l=s.featureFlagPayloads;if(u){var c=e.requestId;if(Ls(u)){var d;Iv.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(u)for(var v=0;v<u.length;v++)f[u[v]]=!0;t&&t.register((M(d={},Fv,u),M(d,po,f),d))}else{var h=u,p=l,g=a;e.errorsWhileComputingFlags&&(h=P(P({},i),h),p=P(P({},r),p),g=P(P({},o),g)),t&&t.register(P((M(n={},Fv,Object.keys(Av(h))),M(n,po,h||{}),M(n,Ov,p||{}),M(n,_o,g||{}),n),c?M({},Mv,c):{}))}}}(e,this.instance.persistence,n,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Iv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}},{key:"overrideFeatureFlags",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return Iv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.instance.persistence.unregister(Rv),this.instance.persistence.unregister(Lv),void this._fireFeatureFlagsCallbacks();if(e&&"object"===I(e)&&("flags"in e||"payloads"in e)){var t,n=e;if(this._override_warning=Boolean(null!==(t=n.suppressWarning)&&void 0!==t&&t),"flags"in n)if(!1===n.flags)this.instance.persistence.unregister(Rv);else if(n.flags)if(Ls(n.flags)){for(var i={},r=0;r<n.flags.length;r++)i[n.flags[r]]=!0;this.instance.persistence.register(M({},Rv,i))}else this.instance.persistence.register(M({},Rv,n.flags));return"payloads"in n&&(!1===n.payloads?this.instance.persistence.unregister(Lv):n.payloads&&this.instance.persistence.register(M({},Lv,n.payloads))),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var n=this._prepareFeatureFlagsForCallbacks(),i=n.flags,r=n.flagVariants;e(i,r)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var n,i,r=(this.instance.get_property(go)||[]).find((function(t){return t.flagKey===e})),o=M({},"$feature_enrollment/".concat(e),t),s={$feature_flag:e,$feature_enrollment:t,$set:o};r&&(s.$early_access_feature_name=r.name),this.instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(o,!1);var a=P(P({},this.getFlagVariants()),{},M({},e,t));null===(n=this.instance.persistence)||void 0===n||n.register((M(i={},Fv,Object.keys(Av(a))),M(i,po,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this.instance.get_property(go),o=i?"&".concat(i.map((function(e){return"stage=".concat(e)})).join("&")):"";if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token).concat(o)),method:"GET",callback:function(n){var i;if(n.json){var r=n.json.earlyAccessFeatures;return null===(i=t.instance.persistence)||void 0===i||i.register(M({},go,r)),e(r)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,i=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,i,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(mo)||{};this.instance.register(M({},mo,P(P({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(mo)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(yo)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((function(t){n[t]=P(P({},n[t]),e[t]),delete e[t]})),this.instance.register(M({},yo,P(P({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(yo)||{};this.instance.register(M({},yo,P(P({},t),{},M({},e,{}))))}else this.instance.unregister(yo)}}]),e}(),Dv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Nv=function(){function e(t){R(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(t),this.storage=this.buildStorage(t),this.load(),t.debug&&Ws.info("Persistence loaded",t.persistence,P({},this.props)),this.update_config(t,t),this.save()}return L(e,[{key:"buildStorage",value:function(e){-1===Dv.indexOf(e.persistence.toLowerCase())&&(Ws.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&$d.is_supported()?$d:"localstorage+cookie"===t&&Nd.is_supported()?Nd:"sessionstorage"===t&&Ud.is_supported()?Ud:"memory"===t?jd:"cookie"===t?Ad:Nd.is_supported()?Nd:Ad}},{key:"properties",value:function(){var e={};return ya(this.props,(function(t,n){if(n===po&&As(t))for(var i=Object.keys(t),r=0;r<i.length;r++)e["$feature/".concat(i[r])]=t[i[r]];else s=n,a=!1,(Hs(o=Oo)?a:vs&&o.indexOf===vs?-1!=o.indexOf(s):(ya(o,(function(e){if(a||(a=e===s))return _a})),a))||(e[n]=t);var o,s,a})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=ba({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var i=this;if(As(e)){$s(t)&&(t="None"),this.expire_days=$s(n)?this.default_expiry:n;var r=!1;if(ya(e,(function(e,n){i.props.hasOwnProperty(n)&&i.props[n]!==t||(i.props[n]=e,r=!0)})),r)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(As(e)){this.expire_days=$s(t)?this.default_expiry:t;var i=!1;if(ya(e,(function(t,r){e.hasOwnProperty(r)&&n.props[r]!==t&&(n.props[r]=t,i=!0)})),i)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){if(!this.campaign_params_saved){var e=$u.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});qs(Ea(e))||this.register(e),this.campaign_params_saved=!0}}},{key:"update_search_keyword",value:function(){this.register($u.searchInfo())}},{key:"update_referrer_info",value:function(){this.register_once($u.referrerInfo(),void 0)}},{key:"set_initial_person_info",value:function(){this.props[Co]||this.props[Po]||this.register_once(M({},To,$u.personInfo({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties})),void 0)}},{key:"get_referrer_info",value:function(){return Ea({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};ya([Po,Co],(function(n){var i=e.props[n];i&&ya(i,(function(e,n){t["$initial_"+Ts(n)]=e}))}));var n=this.props[To];if(n){var i=$u.initialPersonPropsFromInfo(n);ba(t,i)}return t}},{key:"safe_merge",value:function(e){return ya(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),i=this.props;this.clear(),this.storage=n,this.props=i,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Qr]||{};n[e]=t,this.props[Qr]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Qr]||{})[e];return $s(t)||(delete this.props[Qr][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),e}(),Hv=Gs("[RateLimiter]"),jv=function(){function e(t){var n,i,r=this;R(this,e),M(this,"serverLimits",{}),M(this,"lastEventRateLimited",!1),M(this,"checkForLimiting",(function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){Hv.info("".concat(e||"events"," is quota limited.")),r.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void Hv.warn('could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=t,this.captureEventsPerSecond=(null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(i=t.config.rate_limiting)||void 0===i?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return L(e,[{key:"clientRateLimitContext",value:function(){var e,t,n,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Eo))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:r};o.tokens+=(r-o.last)/1e3*this.captureEventsPerSecond,o.last=r,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||i||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(n=this.instance.persistence)||void 0===n||n.set_property(Eo,o),{isRateLimited:s,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),Bv=Gs("[RemoteConfig]"),Uv=function(){function e(t){R(this,e),this.instance=t}return L(e,[{key:"remoteConfig",get:function(){var e,t;return null===(e=ks._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.config}},{key:"_loadRemoteConfigJs",value:function(e){var t,n,i,r=this;null!==(t=ks.__PosthogExtensions__)&&void 0!==t&&t.loadExternalDependency?null===(n=ks.__PosthogExtensions__)||void 0===n||null===(i=n.loadExternalDependency)||void 0===i||i.call(n,this.instance,"remote-config",(function(){return e(r.remoteConfig)})):(Bv.error("PostHog Extensions not found. Cannot load remote config."),e())}},{key:"_loadRemoteConfigJSON",value:function(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:function(t){e(t.json)}})}},{key:"load",value:function(){var e=this;try{if(this.remoteConfig)return Bv.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void Bv.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((function(t){if(!t)return Bv.info("No config found after loading remote JS config. Falling back to JSON."),void e._loadRemoteConfigJSON((function(t){e.onRemoteConfig(t)}));e.onRemoteConfig(t)}))}catch(e){Bv.error("Error loading remote config",e)}}},{key:"onRemoteConfig",value:function(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):Bv.info("__preview_remote_config is disabled. Logging config instead",e):Bv.error("Failed to fetch remote config from PostHog.")}}]),e}();var zv=function(e){var t,n,i,r,o="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<i;r++){var s=e.charCodeAt(r),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),Hs(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=r+1)}return n>t&&(o+=e.substring(t,e.length)),o},Vv=!!ms||!!_s,Wv="text/plain",Gv=function(e,t){var n=q(e.split("?"),2),i=n[0],r=n[1],o=P({},t);null==r||r.split("&").forEach((function(e){var t=q(e.split("="),1)[0];delete o[t]}));var s=Ma(o);return s=s?(r?r+"&":"")+s:r,"".concat(i,"?").concat(s)},Zv=function(e,t){return JSON.stringify(e,(function(e,t){return"bigint"==typeof t?t.toString():t}),t)},Qv=function(e){var t=e.data,n=e.compression;if(t){if(n===us.GZipJS){var i=Qf(Yf(Zv(t)),{mtime:0}),r=new Blob([i],{type:Wv});return{contentType:Wv,body:r,estimatedSize:r.size}}if(n===us.Base64){var o=function(e){var t,n,i,r,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",c=[];if(!e)return e;e=zv(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,i=o>>6&63,r=63&o,c[u++]=s.charAt(t)+s.charAt(n)+s.charAt(i)+s.charAt(r)}while(a<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(Zv(t)),s=function(e){return"data="+encodeURIComponent("string"==typeof e?e:Zv(e))}(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Zv(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Yv=[];_s&&Yv.push({transport:"fetch",method:function(e){var t,n,i=null!==(t=Qv(e))&&void 0!==t?t:{},r=i.contentType,o=i.body,s=i.estimatedSize,a=new Headers;ya(e.headers,(function(e,t){a.append(t,e)})),r&&a.append("Content-Type",r);var u=e.url,l=null;if(ys){var c=new ys;l={signal:c.signal,timeout:setTimeout((function(){return c.abort()}),e.timeout)}}_s(u,P({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null===(n=l)||void 0===n?void 0:n.signal},e.fetchOptions)).then((function(t){return t.text().then((function(n){var i,r={statusCode:t.status,text:n};if(200===t.status)try{r.json=JSON.parse(n)}catch(e){Ws.error(e)}null===(i=e.callback)||void 0===i||i.call(e,r)}))})).catch((function(t){var n;Ws.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return l?clearTimeout(l.timeout):null}))}}),ms&&Yv.push({transport:"XHR",method:function(e){var t,n=new ms;n.open(e.method||"GET",e.url,!0);var i=null!==(t=Qv(e))&&void 0!==t?t:{},r=i.contentType,o=i.body;ya(e.headers,(function(e,t){n.setRequestHeader(t,e)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,i={statusCode:n.status,text:n.responseText};if(200===n.status)try{i.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,i)}},n.send(o)}}),null!=hs&&hs.sendBeacon&&Yv.push({transport:"sendBeacon",method:function(e){var t=Gv(e.url,{beacon:"1"});try{var n,i=null!==(n=Qv(e))&&void 0!==n?n:{},r=i.contentType,o=i.body,s="string"==typeof o?new Blob([o],{type:r}):o;hs.sendBeacon(t,s)}catch(e){}}});var Jv=3e3,Xv=function(){function e(t,n){R(this,e),M(this,"isPaused",!0),M(this,"queue",[]),this.flushTimeoutMs=df((null==n?void 0:n.flush_interval_ms)||Jv,250,5e3,"flush interval",Jv),this.sendRequest=t}return L(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},n=Object.values(t),i=[].concat($(n.filter((function(e){return 0===e.url.indexOf("/e")}))),$(n.filter((function(e){return 0!==e.url.indexOf("/e")}))));i.map((function(t){e.sendRequest(P(P({},t),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var i=t[n],r=(new Date).getTime();i.data&&Ls(i.data)&&ya(i.data,(function(e){e.offset=Math.abs(e.timestamp-r),delete e.timestamp})),e.sendRequest(i)};for(var i in t)n(i)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return ya(this.queue,(function(t){var n,i=t,r=(i?i.batchKey:null)||i.url;$s(e[r])&&(e[r]=P(P({},i),{},{data:[]})),null===(n=e[r].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}]),e}(),Kv=["retriesPerformedSoFar"];var eh,th=function(){function e(t){var n=this;R(this,e),M(this,"isPolling",!1),M(this,"pollIntervalMs",3e3),M(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!$s(ls)&&"onLine"in ls.navigator&&(this.areWeOnline=ls.navigator.onLine,Fa(ls,"online",(function(){n.areWeOnline=!0,n.flush()})),Fa(ls,"offline",(function(){n.areWeOnline=!1})))}return L(e,[{key:"retriableRequest",value:function(e){var t=this,n=e.retriesPerformedSoFar,i=A(e,Kv);Bs(n)&&n>0&&(i.url=Gv(i.url,{retry_count:n})),this.instance._send_request(P(P({},i),{},{callback:function(e){var r;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?t.enqueue(P({retriesPerformedSoFar:n},i)):null===(r=i.callback)||void 0===r||r.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,i=Math.min(18e5,t),r=(Math.random()-.5)*(i-n);return Math.ceil(i+r)}(t),i=Date.now()+n;this.queue.push({retryAt:i,requestOptions:e});var r="Enqueued failed request for retry in ".concat(n);navigator.onLine||(r+=" (Browser is offline)"),Ws.warn(r),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var i,r=H(n);try{for(r.s();!(i=r.n()).done;){var o=i.value.requestOptions;this.retriableRequest(o)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=H(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestOptions;try{this.instance._send_request(P(P({},n),{},{transport:"sendBeacon"}))}catch(e){Ws.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}}]),e}(),nh=function(){function e(t){var n=this;R(this,e),M(this,"_updateScrollData",(function(){var e,t,i,r;n.context||(n.context={});var o=n.scrollElement(),s=n.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=s+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;n.context.lastScrollY=Math.ceil(s),n.context.maxScrollY=Math.max(s,null!==(e=n.context.maxScrollY)&&void 0!==e?e:0),n.context.maxScrollHeight=Math.max(a,null!==(t=n.context.maxScrollHeight)&&void 0!==t?t:0),n.context.lastContentY=u,n.context.maxContentY=Math.max(u,null!==(i=n.context.maxContentY)&&void 0!==i?i:0),n.context.maxContentHeight=Math.max(l,null!==(r=n.context.maxContentHeight)&&void 0!==r?r:0)})),this.instance=t}return L(e,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){Fa(ls,"scroll",this._updateScrollData,{capture:!0}),Fa(ls,"scrollend",this._updateScrollData,{capture:!0}),Fa(ls,"resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return null==ls?void 0:ls.document.documentElement;var e,t=H(Ls(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,i=null==ls?void 0:ls.document.querySelector(n);if(i)return i}}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return ls&&(ls.scrollY||ls.pageYOffset||ls.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return ls&&(ls.scrollX||ls.pageXOffset||ls.document.documentElement.scrollLeft)||0}}]),e}(),ih=function(e){return $u.personInfo({maskPersonalDataProperties:null==e?void 0:e.config.mask_personal_data_properties,customPersonalDataProperties:null==e?void 0:e.config.custom_personal_data_properties})},rh=function(){function e(t,n,i,r){var o=this;R(this,e),M(this,"_onSessionIdCallback",(function(e){var t=o._getStored();if(!t||t.sessionId!==e){var n={sessionId:e,props:o._sessionSourceParamGenerator(o.instance)};o._persistence.register(M({},xo,n))}})),this.instance=t,this._sessionIdManager=n,this._persistence=i,this._sessionSourceParamGenerator=r||ih,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return L(e,[{key:"_getStored",value:function(){return this._persistence.props[xo]}},{key:"getSetOnceProps",value:function(){var e,t=null===(e=this._getStored())||void 0===e?void 0:e.props;return t?"r"in t?$u.personPropsFromInfo(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}},{key:"getSessionProps",value:function(){var e={};return ya(Ea(this.getSetOnceProps()),(function(t,n){"$current_url"===n&&(n="url"),e["$session_entry_".concat(Ts(n))]=t})),e}}]),e}(),oh=Gs("[SessionId]"),sh=function(){function e(t,n,i){var r;if(R(this,e),M(this,"_sessionIdChangedHandlers",[]),!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=t.config,this.persistence=t.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Td,this._windowIdGenerator=i||Td;var o=this.config.persistence_name||this.config.token,s=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*df(s,60,36e3,"session_idle_timeout_seconds",1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=Ud.parse(this._window_id_storage_key),u=Ud.parse(this._primary_window_exists_storage_key);a&&!u?this._windowId=a:Ud.remove(this._window_id_storage_key),Ud.set(this._primary_window_exists_storage_key,!0)}if(null!==(r=this.config.bootstrap)&&void 0!==r&&r.sessionID)try{var l=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)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){oh.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}return L(e,[{key:"sessionTimeoutMs",get:function(){return this._sessionTimeoutMs}},{key:"onSessionId",value:function(e){var t=this;return $s(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Ud.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Ud.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Ud.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(M({},co,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[co];return Ls(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;Fa(ls,"beforeunload",(function(){e._canUseSessionStorage()&&Ud.remove(e._primary_window_exists_storage_key)}),{capture:!1})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var n=t||(new Date).getTime(),i=q(this._getSessionId(),3),r=i[0],o=i[1],s=i[2],a=this._getWindowId(),u=Bs(s)&&s>0&&Math.abs(n-s)>864e5,l=!1,c=!o,d=!e&&Math.abs(n-r)>this.sessionTimeoutMs;c||d||u?(o=this._sessionIdGenerator(),a=this._windowIdGenerator(),oh.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}}),s=n,l=!0):a||(a=this._windowIdGenerator(),l=!0);var f=0===r||!e||u?n:r,v=0===s?(new Date).getTime():s;return this._setWindowId(a),this._setSessionId(o,f,v),e||this.resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((function(e){return e(o,a,l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0)})),{sessionId:o,windowId:a,sessionStartTimestamp:v,changeReason:l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0,lastActivityTimestamp:r}}},{key:"resetIdleTimer",value:function(){var e=this;clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((function(){e.resetSessionId()}),1.1*this.sessionTimeoutMs)}}]),e}(),ah=["$set_once","$set"],uh=Gs("[SiteApps]"),lh=function(){function e(t){R(this,e),this.instance=t,this.bufferedInvocations=[],this.apps={}}return L(e,[{key:"isEnabled",get:function(){return!!this.instance.config.opt_in_site_apps}},{key:"eventCollector",value:function(e,t){if(t){var n=this.globalsForEvent(t);this.bufferedInvocations.push(n),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}},{key:"siteAppLoaders",get:function(){var e,t;return null===(e=ks._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.siteApps}},{key:"init",value: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}}}},{key:"globalsForEvent",value:function(e){var t,n,i,r,o,s,a;if(!e)throw new Error("Event payload is required");for(var u={},l=this.instance.get_property("$groups")||[],c=this.instance.get_property("$stored_group_properties")||{},d=0,f=Object.entries(c);d<f.length;d++){var v=q(f[d],2),h=v[0],p=v[1];u[h]={id:l[h],type:h,properties:p}}var g=e.$set_once,_=e.$set;return{event:P(P({},A(e,ah)),{},{properties:P(P(P({},e.properties),_?{$set:P(P({},null!==(t=null===(n=e.properties)||void 0===n?void 0:n.$set)&&void 0!==t?t:{}),_)}:{}),g?{$set_once:P(P({},null!==(i=null===(r=e.properties)||void 0===r?void 0:r.$set_once)&&void 0!==i?i:{}),g)}:{}),elements_chain:null!==(o=null===(s=e.properties)||void 0===s?void 0:s.$elements_chain)&&void 0!==o?o:"",distinct_id:null===(a=e.properties)||void 0===a?void 0:a.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}},{key:"setupSiteApp",value:function(e){var t=this,n=this.apps[e.id],i=function(){var i;(!n.errored&&t.bufferedInvocations.length&&(uh.info("Processing ".concat(t.bufferedInvocations.length," events for site app with id ").concat(e.id)),t.bufferedInvocations.forEach((function(e){var t;return null===(t=n.processEvent)||void 0===t?void 0:t.call(n,e)})),n.processedBuffer=!0),Object.values(t.apps).every((function(e){return e.processedBuffer||e.errored})))&&(null===(i=t.stopBuffering)||void 0===i||i.call(t))},r=!1,o=function(t){n.errored=!t,n.loaded=!0,uh.info("Site app with id ".concat(e.id," ").concat(t?"loaded":"errored")),r&&i()};try{var s=e.init({posthog:this.instance,callback:function(e){o(e)}}).processEvent;s&&(n.processEvent=s),r=!0}catch(t){uh.error("Error while initializing PostHog app with config id ".concat(e.id),t),o(!1)}if(r&&n.loaded)try{i()}catch(t){uh.error("Error while processing buffered events PostHog app with config id ".concat(e.id),t),n.errored=!0}}},{key:"setupSiteApps",value:function(){var e,t=this.siteAppLoaders||[],n=H(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;this.apps[i.id]={id:i.id,loaded:!1,errored:!1,processedBuffer:!1}}}catch(e){n.e(e)}finally{n.f()}var r,o=H(t);try{for(o.s();!(r=o.n()).done;){var s=r.value;this.setupSiteApp(s)}}catch(e){o.e(e)}finally{o.f()}}},{key:"onCapturedEvent",value:function(e){if(0!==Object.keys(this.apps).length)for(var t=this.globalsForEvent(e),n=0,i=Object.values(this.apps);n<i.length;n++){var r=i[n];try{var o;null===(o=r.processEvent)||void 0===o||o.call(r,t)}catch(t){uh.error("Error while processing event ".concat(e.event," for site app ").concat(r.id),t)}}}},{key:"onRemoteConfig",value:function(e){var t,n,i,r=this;if(null!==(t=this.siteAppLoaders)&&void 0!==t&&t.length)return this.isEnabled?(this.setupSiteApps(),void this.instance.on("eventCaptured",(function(e){return r.onCapturedEvent(e)}))):void uh.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null===(n=this.stopBuffering)||void 0===n||n.call(this),null!==(i=e.siteApps)&&void 0!==i&&i.length)if(this.isEnabled){var o,s=H(e.siteApps);try{var a=function(){var e,t,n=o.value,i=n.id,s=n.url;ks["__$$ph_site_app_".concat(i)]=r.instance,null===(e=ks.__PosthogExtensions__)||void 0===e||null===(t=e.loadSiteApp)||void 0===t||t.call(e,r.instance,s,(function(e){if(e)return uh.error("Error while initializing PostHog app with config id ".concat(i),e)}))};for(s.s();!(o=s.n()).done;)a()}catch(e){s.e(e)}finally{s.f()}}else uh.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}]),e}(),ch=["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","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","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","googleweblight","mediapartners-google","storebot-google","bytespider"],dh=function(e,t){if(!e)return!1;var n=e.toLowerCase();return ch.concat(t||[]).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))},fh=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&dh(n,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((function(e){return dh(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver};function vh(e,t,n){return Zv({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(eh||(eh={}));var hh="i.posthog.com",ph=function(){function e(t){R(this,e),M(this,"_regionCache",{}),this.instance=t}return L(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:"uiHost",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(hh),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=eh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=eh.EU:this._regionCache[this.apiHost]=eh.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return this.uiHost+t;if(this.region===eh.CUSTOM)return this.apiHost+t;var n=hh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}]),e}(),gh={icontains:function(e,t){return!!ls&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e,t){return!!ls&&-1===t.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e,t){return!!ls&&Du(t.href,e)},not_regex:function(e,t){return!!ls&&!Du(t.href,e)},exact:function(e,t){return t.href===e},is_not:function(e,t){return t.href!==e}},_h=function(){function e(t){var n=this;R(this,e),M(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.getWebExperiments((function(t){e.logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,t.forEach((function(t){if(t.feature_flag_key){var i;if(n._flagToExperiments)e.logInfo("setting flag key ",t.feature_flag_key," to web experiment ",t),null===(i=n._flagToExperiments)||void 0===i||i.set(t.feature_flag_key,t);var r=n.instance.getFeatureFlag(t.feature_flag_key);Ds(r)&&t.variants[r]&&n.applyTransforms(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var o in t.variants){var s=t.variants[o];e.matchesTestVariant(s)&&n.applyTransforms(t.name,o,s.transforms)}}))}),t)})),this.instance=t,this.instance.onFeatureFlags((function(e){n.onFeatureFlags(e)}))}return L(e,[{key:"onFeatureFlags",value:function(t){var n=this;if(this._is_bot())e.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(js(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)&&void 0!==t&&t.has(e)){var i,r=n.instance.getFeatureFlag(e),o=null===(i=n._flagToExperiments)||void 0===i?void 0:i.get(e);r&&null!=o&&o.variants[r]&&n.applyTransforms(o.name,r,o.variants[r].transforms)}}))}}},{key:"previewWebExperiment",value:function(){var t=this,n=e.getWindowLocation();if(null!=n&&n.search){var i=Aa(null==n?void 0:n.search,"__experiment_id"),r=Aa(null==n?void 0:n.search,"__experiment_variant");i&&r&&(e.logInfo("previewing web experiments ".concat(i," && ").concat(r)),this.getWebExperiments((function(e){t.showPreviewWebExperiment(parseInt(i),r,e)}),!1,!0))}}},{key:"loadIfEnabled",value:function(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}},{key:"getWebExperiments",value:function(e,t,n){if(this.instance.config.disable_web_experiments&&!n)return e([]);var i=this.instance.get_property("$web_experiments");if(i&&!t)return e(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:function(t){if(200!==t.statusCode||!t.json)return e([]);var n=t.json.experiments||[];return e(n)}})}},{key:"showPreviewWebExperiment",value:function(t,n,i){var r=i.filter((function(e){return e.id===t}));r&&r.length>0&&(e.logInfo("Previewing web experiment [".concat(r[0].name,"] with variant [").concat(n,"]")),this.applyTransforms(r[0].name,n,r[0].variants[n].transforms))}},{key:"applyTransforms",value:function(t,n,i){this._is_bot()?e.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==n?i.forEach((function(i){if(i.selector){var r;e.logInfo("applying transform of variant ".concat(n," for experiment ").concat(t," "),i);var o=null===(r=document)||void 0===r?void 0:r.querySelectorAll(i.selector);null==o||o.forEach((function(e){var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)}))}})):e.logInfo("Control variants leave the page unmodified.")}},{key:"_is_bot",value:function(){return hs&&this.instance?fh(hs,this.instance.config.custom_blocked_useragents):void 0}}],[{key:"matchesTestVariant",value:function(t){return!js(t.conditions)&&(e.matchUrlConditions(t)&&e.matchUTMConditions(t))}},{key:"matchUrlConditions",value:function(t){var n;if(js(t.conditions)||js(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;var i,r,o,s=e.getWindowLocation();return!!s&&(null===(i=t.conditions)||void 0===i||!i.url||gh[null!==(r=null===(o=t.conditions)||void 0===o?void 0:o.urlMatchType)&&void 0!==r?r:"icontains"](t.conditions.url,s))}},{key:"getWindowLocation",value:function(){return null==ls?void 0:ls.location}},{key:"matchUTMConditions",value:function(e){var t;if(js(e.conditions)||js(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var n=$u.campaignParams();if(n.utm_source){var i,r,o,s,a,u,l,c,d,f,v,h,p,g,_,m,y=null===(i=e.conditions)||void 0===i||null===(r=i.utm)||void 0===r||!r.utm_campaign||(null===(o=e.conditions)||void 0===o||null===(s=o.utm)||void 0===s?void 0:s.utm_campaign)==n.utm_campaign,b=null===(a=e.conditions)||void 0===a||null===(u=a.utm)||void 0===u||!u.utm_source||(null===(l=e.conditions)||void 0===l||null===(c=l.utm)||void 0===c?void 0:c.utm_source)==n.utm_source,k=null===(d=e.conditions)||void 0===d||null===(f=d.utm)||void 0===f||!f.utm_medium||(null===(v=e.conditions)||void 0===v||null===(h=v.utm)||void 0===h?void 0:h.utm_medium)==n.utm_medium,w=null===(p=e.conditions)||void 0===p||null===(g=p.utm)||void 0===g||!g.utm_term||(null===(_=e.conditions)||void 0===_||null===(m=_.utm)||void 0===m?void 0:m.utm_term)==n.utm_term;return y&&k&&w&&b}return!1}},{key:"logInfo",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];Ws.info("[WebExperiments] ".concat(e),n)}}]),e}(),mh={},yh=function(){},bh="posthog",kh=!Vv&&-1===(null==bs?void 0:bs.indexOf("MSIE"))&&-1===(null==bs?void 0:bs.indexOf("Mozilla")),wh=function(){var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Ta(null==ps?void 0:ps.location),persistence:"localStorage+cookie",persistence_name:"",loaded:yh,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:gs&&Ds(null==gs?void 0:gs.search)&&-1!==gs.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==ls||null===(e=ls.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;Ws.error(t)},get_device_id:function(e){return e},capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Jv},_onCapture:yh}},Sh=function(e){var t={};$s(e.process_person)||(t.person_profiles=e.process_person),$s(e.xhr_headers)||(t.request_headers=e.xhr_headers),$s(e.cookie_name)||(t.persistence_name=e.cookie_name),$s(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),$s(e.store_google)||(t.save_campaign_params=e.store_google),$s(e.verbose)||(t.debug=e.verbose);var n=ba({},t,e);return Ls(e.property_blacklist)&&($s(e.property_denylist)?n.property_denylist=e.property_blacklist:Ls(e.property_denylist)?n.property_denylist=[].concat($(e.property_blacklist),$(e.property_denylist)):Ws.error("Invalid value for property_denylist config: "+e.property_denylist)),n},xh=function(){function e(){R(this,e),M(this,"__forceAllowLocalhost",!1)}return L(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Ws.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),Eh=function(){function e(){var t=this;R(this,e),M(this,"webPerformance",new xh),M(this,"_personProcessingSetOncePropertiesSent",!1),M(this,"version",ws.LIB_VERSION),M(this,"_internalEventEmitter",new Nu),this.config=wh(),this.SentryIntegration=vv,this.sentryIntegration=function(e){return function(e,t){var n=dv(e,t);return{name:cv,processEvent:function(e){return n(e)}}}(t,e)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.featureFlags=new $v(this),this.toolbar=new _v(this),this.scrollManager=new nh(this),this.pageViewManager=new Pv(this),this.surveys=new Yu(this),this.experiments=new _h(this),this.exceptions=new Tv(this),this.rateLimiter=new jv(this),this.requestRouter=new ph(this),this.consent=new zd(this),this.people={set:function(e,n,i){var r=Ds(e)?M({},e,n):e;t.setPersonProperties(r),null==i||i({})},set_once:function(e,n,i){var r=Ds(e)?M({},e,n):e;t.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(function(e){return Ws.info('send "'.concat(null==e?void 0:e.event,'"'),e)}))}return L(e,[{key:"decideEndpointWasHit",get:function(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.hasLoadedFlags)&&void 0!==e&&e}},{key:"init",value:function(t,n,i){if(i&&i!==bh){var r,o=null!==(r=mh[i])&&void 0!==r?r:new e;return o._init(t,n,i),mh[i]=o,mh[bh][i]=o,o}return this._init(t,n,i)}},{key:"_init",value:function(e){var t,n,i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if($s(e)||Ns(e))return Ws.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 Ws.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],r.person_profiles&&(this._initialPersonProfilesConfig=r.person_profiles),this.set_config(ba({},wh(),Sh(r),{name:o,token:e})),this.config.on_xhr_error&&Ws.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:us.GZipJS,this.persistence=new Nv(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Nv(P(P({},this.config),{},{persistence:"sessionStorage"}));var s=P({},this.persistence.props),a=P({},this.sessionPersistence.props);if(this._requestQueue=new Xv((function(e){return i._send_retriable_request(e)}),this.config.request_queue_config),this._retryQueue=new th(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new sh(this),this.sessionPropsManager=new rh(this,this.sessionManager,this.persistence)),new yv(this).startIfEnabledOrStop(),this.siteApps=new lh(this),null===(t=this.siteApps)||void 0===t||t.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new av(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new kd(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Cv(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new wv(this),this.exceptionObserver=new Yd(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Zd(this,Gd),this.deadClicksAutocapture.startIfEnabled(),ws.DEBUG=ws.DEBUG||this.config.debug,ws.DEBUG&&Ws.info("Starting in debug mode",{this:this,config:r,thisC:P({},this.config),p:s,s:a}),this._sync_opt_out_with_persistence(),void 0!==(null===(n=r.bootstrap)||void 0===n?void 0:n.distinctID)){var u,l,c=this.config.get_device_id(Td()),d=null!==(u=r.bootstrap)&&void 0!==u&&u.isIdentifiedID?c:r.bootstrap.distinctID;this.persistence.set_property(So,null!==(l=r.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var f,v,h=Object.keys((null===(f=r.bootstrap)||void 0===f?void 0:f.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=r.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,i;return e[t]=(null===(n=r.bootstrap)||void 0===n||null===(i=n.featureFlags)||void 0===i?void 0:i[t])||!1,e}),{}),p=Object.keys((null===(v=r.bootstrap)||void 0===v?void 0:v.featureFlagPayloads)||{}).filter((function(e){return h[e]})).reduce((function(e,t){var n,i,o,s;null!==(n=r.bootstrap)&&void 0!==n&&null!==(i=n.featureFlagPayloads)&&void 0!==i&&i[t]&&(e[t]=null===(o=r.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:p})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ro,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(Td());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(So,"anonymous")}return Fa(ls,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),r.segment?lv(this,(function(){return i._loaded()})):this._loaded(),Ms(this.config._onCapture)&&this.config._onCapture!==yh&&(Ws.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(function(e){return i.config._onCapture(e.event,e)}))),this}},{key:"_onRemoteConfig",value:function(e){var t,n,i,r,o,s,a,u,l=this;if(!ps||!ps.body)return Ws.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){l._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Cs(e.supportedCompression,us.GZipJS)?us.GZipJS:Cs(e.supportedCompression,us.Base64)?us.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null===(n=this.siteApps)||void 0===n||n.onRemoteConfig(e),null===(i=this.sessionRecording)||void 0===i||i.onRemoteConfig(e),null===(r=this.autocapture)||void 0===r||r.onRemoteConfig(e),null===(o=this.heatmaps)||void 0===o||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null===(s=this.webVitalsAutocapture)||void 0===s||s.onRemoteConfig(e),null===(a=this.exceptionObserver)||void 0===a||a.onRemoteConfig(e),null===(u=this.deadClicksAutocapture)||void 0===u||u.onRemoteConfig(e)}},{key:"_loaded",value:function(){var e=this;try{this.config.loaded(this)}catch(e){Ws.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){e.consent.isOptedIn()&&e._captureInitialPageview()}),1),new Uv(this).load(),this.featureFlags.decide()}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||ma(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(kh?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Gv(e.url,{ip:this.config.ip?1:0}),e.headers=P({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,function(e){var t,n,i,r=P({},e);r.timeout=r.timeout||6e4,r.url=Gv(r.url,{_:(new Date).getTime().toString(),ver:ws.LIB_VERSION,compression:r.compression});var o=null!==(t=r.transport)&&void 0!==t?t:"fetch",s=null!==(n=null===(i=Ia(Yv,(function(e){return e.transport===o})))||void 0===i?void 0:i.method)&&void 0!==n?n:Yv[0].method;if(!s)throw new Error("No available transport method");s(r)}(P(P({},e),{},{callback:function(n){var i,r,o;(t.rateLimiter.checkForLimiting(n),n.statusCode>=400)&&(null===(r=(o=t.config).on_request_error)||void 0===r||r.call(o,n));null===(i=e.callback)||void 0===i||i.call(e,n)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,i=[],r=[],o=[];ma(e,(function(e){e&&(t=e[0],Ls(t)?o.push(e):Ms(e)?e.call(n):Ls(e)&&"alias"===t?i.push(e):Ls(e)&&-1!==t.indexOf("capture")&&Ms(n[t])?o.push(e):r.push(e))}));var s=function(e,t){ma(e,(function(e){if(Ls(e[0])){var n=t;ya(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(i,this),s(r,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,n){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!$s(e)&&Ds(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var r=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==r||!r.isRateLimited){null!=t&&t.$current_url&&!Ds(null==t?void 0:t.$current_url)&&(Ws.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,s=(null==n?void 0:n.timestamp)||o,a=Td(),u={uuid:a,event:e,properties:this._calculate_event_properties(e,t||{},s,a)};r&&(u.properties.$lib_rate_limit_remaining_tokens=r.remainingTokens),(null==n?void 0:n.$set)&&(u.$set=null==n?void 0:n.$set);var l=this._calculate_set_once_properties(null==n?void 0:n.$set_once);l&&(u.$set_once=l),(u=Ca(u,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,$s(null==n?void 0:n.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o);var c=P(P({},u.properties.$set),u.$set);if(qs(c)||this.setPersonPropertiesForFlags(c),!js(this.config.before_send)){var d=this._runBeforeSend(u);if(!d)return;u=d}this._internalEventEmitter.emit("eventCaptured",u);var f={method:"POST",url:null!==(i=null==n?void 0:n._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(f):this._requestQueue.enqueue(f),u}Ws.critical("This capture call is ignored due to client rate limiting.")}}else Ws.error("No event name provided to posthog.capture")}else Ws.uninitializedWarning("posthog.capture")}},{key:"_addCaptureHook",value:function(e){return this.on("eventCaptured",(function(t){return e(t.event,t)}))}},{key:"_calculate_event_properties",value:function(e,t,n,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),o=P({},t);if(o.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(o.$cookieless_mode=!0),"$snapshot"===e){var s=P(P({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,(!Ds(o.distinct_id)&&!Bs(o.distinct_id)||Ns(o.distinct_id))&&Ws.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var a,u=$u.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),c=l.sessionId,d=l.windowId;o.$session_id=c,o.$window_id=d}this.sessionPropsManager&&ba(o,this.sessionPropsManager.getSessionProps());try{var f,v;this.sessionRecording&&ba(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null===(f=this._retryQueue)||void 0===f||null===(v=f.queue)||void 0===v?void 0:v.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===eh.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),a="$pageview"===e?this.pageViewManager.doPageView(n,i):"$pageleave"===e?this.pageViewManager.doPageLeave(n):this.pageViewManager.doEvent(),o=ba(o,a),"$pageview"===e&&ps&&(o.title=ps.title),!$s(r)){var h=n.getTime()-r;o.$duration=parseFloat((h/1e3).toFixed(3))}bs&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=ba({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Ls(this.config.property_denylist)?ya(this.config.property_denylist,(function(e){delete o[e]})):Ws.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(Ws.error("sanitize_properties is deprecated. Use before_send instead"),o=p(o,e));var g=this._hasPersonProcessing();return o.$process_person_profile=g,g&&this._requirePersonProcessing("_calculate_event_properties"),o}},{key:"_calculate_set_once_properties",value:function(e){var t;if(!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var n=this.persistence.get_initial_props(),i=null===(t=this.sessionPropsManager)||void 0===t?void 0:t.getSetOnceProps(),r=ba({},n,i||{},e||{}),o=this.config.sanitize_properties;return o&&(Ws.error("sanitize_properties is deprecated. Use before_send instead"),r=o(r,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,qs(r)?void 0:r}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var i;null===(i=this.persistence)||void 0===i||i.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(M({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return this.featureFlags.getEarlyAccessFeatures(e,t,n)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSurveysLoaded",value:function(e){return this.surveys.onSurveysLoaded(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"renderSurvey",value:function(e,t){this.surveys.renderSurvey(e,t)}},{key:"canRenderSurvey",value:function(e){return this.surveys.canRenderSurvey(e)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return Ws.uninitializedWarning("posthog.identify");if(Bs(e)&&(e=e.toString(),Ws.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))Ws.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var r=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:r},"")}e!==i&&e!==this.get_property(Zr)&&(this.unregister(Zr),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(So)||"anonymous");e!==i&&o?(this.persistence.set_property(So,"identified"),this.setPersonPropertiesForFlags(P(P({},n||{}),t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:n||{}}),this._cachedPersonProperties=vh(e,t,n),this.featureFlags.setAnonymousDistinctId(i)):(t||n)&&this.setPersonProperties(t,n),e!==i&&(this.reloadFeatureFlags(),this.unregister(wo))}}else Ws.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var n=vh(this.get_distinct_id(),e,t);this._cachedPersonProperties!==n?(this.setPersonPropertiesForFlags(P(P({},t||{}),e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=n):Ws.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}},{key:"group",value:function(e,t,n){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:P(P({},i),{},M({},e,t))}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(M({},e,n))),i[e]===t||n||this.reloadFeatureFlags()}}else Ws.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,i,r;if(Ws.info("reset"),!this.__loaded)return Ws.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),this.surveys.reset(),null===(i=this.persistence)||void 0===i||i.set_property(So,"anonymous"),null===(r=this.sessionManager)||void 0===r||r.resetSessionId(),this._cachedPersonProperties=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ro,$device_id:null},"");else{var s=this.config.get_device_id(Td());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,i=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(null!=e&&e.withTimestamp&&i){var o,s=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!i)return r;var a=Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0);r+="?t=".concat(a)}return r}},{key:"alias",value:function(e,t){return e===this.get_property(Gr)?(Ws.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?($s(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Zr,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Ws.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,n,i,r,o=P({},this.config);As(e)&&(ba(this.config,Sh(e)),null===(t=this.persistence)||void 0===t||t.update_config(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Nv(P(P({},this.config),{},{persistence:"sessionStorage"})),$d.is_supported()&&"true"===$d.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(ws.DEBUG=!0,Ws.info("set_config",JSON.stringify({config:e,oldConfig:o,newConfig:P({},this.config)},null,2))),null===(n=this.sessionRecording)||void 0===n||n.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(r=this.heatmaps)||void 0===r||r.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){var t=!0===e,n={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(n).some(Boolean)){var i,r,o,s,a;if(null===(i=this.sessionManager)||void 0===i||i.checkAndGetSessionAndWindowId(),n.sampling)null===(r=this.sessionRecording)||void 0===r||r.overrideSampling();if(n.linked_flag)null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag();if(n.url_trigger)null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url");if(n.event_trigger)null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"captureException",value:function(e,t){var n=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(P(P({},Mc(function(e){return e instanceof Error}(e)?{error:e,event:e.message}:{event:e},{syntheticException:n})),t))}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:bh;return t!==bh&&(t=bh+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(So))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(So))}},{key:"_hasPersonProcessing",value:function(){var e,t,n,i;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&qs(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[Zr])&&(null===(n=this.persistence)||void 0===n||null===(i=n.props)||void 0===i||!i[Io]))}},{key:"_shouldCapturePageleave",value:function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return"never"===this.config.person_profiles?(Ws.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Io,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,n,i,r=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||r&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==s&&(null===(n=this.persistence)||void 0===n||n.set_disabled(s));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==s&&(null===(i=this.sessionPersistence)||void 0===i||i.set_disabled(s))}},{key:"opt_in_capturing",value:function(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),$s(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"_is_bot",value:function(){return hs?fh(hs,this.config.custom_blocked_useragents):void 0}},{key:"_captureInitialPageview",value:function(){ps&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:ps.title},{send_instantly:!0}))}},{key:"debug",value:function(e){!1===e?(null==ls||ls.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==ls||ls.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"_runBeforeSend",value:function(e){if(js(this.config.before_send))return e;var t,n=e,i=H(Ls(this.config.before_send)?this.config.before_send:[this.config.before_send]);try{for(i.s();!(t=i.n()).done;){if(n=(0,t.value)(n),js(n)){var r="Event '".concat(e.event,"' was rejected in beforeSend function");return Vs(e.event)?Ws.warn("".concat(r,". This can cause unexpected behavior.")):Ws.info(r),null}n.properties&&!qs(n.properties)||Ws.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"getPageViewId",value:function(){var e;return null===(e=this.pageViewManager._currentPageview)||void 0===e?void 0:e.pageViewId}},{key:"captureTraceFeedback",value:function(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}},{key:"captureTraceMetric",value:function(e,t,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=xa(e.prototype[t[n]])}(Eh,["identify"]);var Ch,Ph;Ch=mh[bh]=new Eh,(Ph=ks.posthog)&&ya(Ph._i,(function(e){if(e&&Ls(e)){var t=Ch.init(e[0],e[1],e[2]),n=Ph[e[2]]||Ph;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),ks.posthog=Ch,function(){function e(){e.done||(e.done=!0,kh=!1,ya(mh,(function(e){e._dom_loaded()})))}null!=ps&&ps.addEventListener?"complete"===ps.readyState?e():Fa(ps,"DOMContentLoaded",e,{capture:!1}):ls&&Ws.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.es5.js.map
|