Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplitude/plugin-autocapture-browser

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/plugin-autocapture-browser - npm Package Compare versions

Comparing version 1.0.0-beta.3 to 1.0.0-beta.4

2

lib/cjs/autocapture-plugin.js

@@ -47,3 +47,3 @@ var _this = this;

options.actionClickAllowlist = (_b = options.actionClickAllowlist) !== null && _b !== void 0 ? _b : exports.DEFAULT_ACTION_CLICK_ALLOWLIST;
options.debounceTime = (_c = options.debounceTime) !== null && _c !== void 0 ? _c : 1000;
options.debounceTime = (_c = options.debounceTime) !== null && _c !== void 0 ? _c : 0; // TODO: update this when rage clicks are added to 1000ms
var name = constants.PLUGIN_NAME;

@@ -50,0 +50,0 @@ var type = 'enrichment';

@@ -34,8 +34,12 @@ Object.defineProperty(exports, "__esModule", { value: true });

// If a mutation occurs within 0.5 seconds of a click event (timeout({ first: 500 })), it emits the original first click event.
// take 1 to only limit the action events in case there are multiple
(0, rxjs_1.switchMap)(function (click) {
return mutationOrNavigate.pipe((0, rxjs_1.timeout)({ first: 500, with: function () { return rxjs_1.EMPTY; } }), (0, rxjs_1.map)(function () { return click; }));
return mutationOrNavigate.pipe((0, rxjs_1.take)(1), (0, rxjs_1.timeout)({ first: 500, with: function () { return rxjs_1.EMPTY; } }), // in case of timeout, map to empty to prevent any click from being emitted
(0, rxjs_1.map)(function () { return click; }));
}));
return actionClicks.subscribe(function (actionClick) {
/* istanbul ignore next */
amplitude === null || amplitude === void 0 ? void 0 : amplitude.track(constants_1.AMPLITUDE_ELEMENT_CLICKED_EVENT, getEventProperties('click', actionClick.closestTrackedAncestor));
amplitude === null || amplitude === void 0 ? void 0 : amplitude.track(constants_1.AMPLITUDE_ELEMENT_CLICKED_EVENT, getEventProperties('click', actionClick.closestTrackedAncestor), {
time: actionClick.timestamp,
});
});

@@ -42,0 +46,0 @@ }

@@ -1,2 +0,2 @@

export declare const VERSION = "1.0.0-beta.2";
export declare const VERSION = "1.0.0-beta.3";
//# sourceMappingURL=version.d.ts.map
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSION = void 0;
exports.VERSION = '1.0.0-beta.2';
exports.VERSION = '1.0.0-beta.3';
//# sourceMappingURL=version.js.map

@@ -43,3 +43,3 @@ import { __assign, __awaiter, __generator, __read, __spreadArray, __values } from "tslib";

options.actionClickAllowlist = (_b = options.actionClickAllowlist) !== null && _b !== void 0 ? _b : DEFAULT_ACTION_CLICK_ALLOWLIST;
options.debounceTime = (_c = options.debounceTime) !== null && _c !== void 0 ? _c : 1000;
options.debounceTime = (_c = options.debounceTime) !== null && _c !== void 0 ? _c : 0; // TODO: update this when rage clicks are added to 1000ms
var name = constants.PLUGIN_NAME;

@@ -46,0 +46,0 @@ var type = 'enrichment';

import { __read, __spreadArray } from "tslib";
import { filter, map, switchMap, merge, timeout, EMPTY } from 'rxjs';
import { filter, map, merge, switchMap, take, timeout, EMPTY } from 'rxjs';
import { filterOutNonTrackableEvents, getClosestElement } from '../helpers';

@@ -32,10 +32,14 @@ import { AMPLITUDE_ELEMENT_CLICKED_EVENT } from '../constants';

// If a mutation occurs within 0.5 seconds of a click event (timeout({ first: 500 })), it emits the original first click event.
// take 1 to only limit the action events in case there are multiple
switchMap(function (click) {
return mutationOrNavigate.pipe(timeout({ first: 500, with: function () { return EMPTY; } }), map(function () { return click; }));
return mutationOrNavigate.pipe(take(1), timeout({ first: 500, with: function () { return EMPTY; } }), // in case of timeout, map to empty to prevent any click from being emitted
map(function () { return click; }));
}));
return actionClicks.subscribe(function (actionClick) {
/* istanbul ignore next */
amplitude === null || amplitude === void 0 ? void 0 : amplitude.track(AMPLITUDE_ELEMENT_CLICKED_EVENT, getEventProperties('click', actionClick.closestTrackedAncestor));
amplitude === null || amplitude === void 0 ? void 0 : amplitude.track(AMPLITUDE_ELEMENT_CLICKED_EVENT, getEventProperties('click', actionClick.closestTrackedAncestor), {
time: actionClick.timestamp,
});
});
}
//# sourceMappingURL=track-action-click.js.map

@@ -1,2 +0,2 @@

export declare const VERSION = "1.0.0-beta.2";
export declare const VERSION = "1.0.0-beta.3";
//# sourceMappingURL=version.d.ts.map

@@ -1,2 +0,2 @@

export var VERSION = '1.0.0-beta.2';
export var VERSION = '1.0.0-beta.3';
//# sourceMappingURL=version.js.map

@@ -1,1 +0,1 @@

var amplitudeAutocapturePlugin=function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(l){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){u.label=c[1];break}if(6===c[0]&&u.label<i[1]){u.label=i[1],i=c;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(c);break}i[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function a(t){return this instanceof a?(this.v=t,this):new a(t)}function s(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=i[t](e)).value instanceof a?Promise.resolve(n.value.v).then(l,s):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function l(t){c("next",t)}function s(t){c("throw",t)}function f(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}}function f(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}var d="[Amplitude] Element Clicked",h="[Amplitude] Element Tag",p="[Amplitude] Element Text",v="[Amplitude] Element Selector",y="[Amplitude] Page URL",b="https://app.amplitude.com",m={US:b,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},g="amp-visual-tagging-selector-highlight";function w(t){return"function"==typeof t}function _(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var x=_((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function A(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var E=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=u(o),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(w(f))try{f()}catch(t){i=t instanceof x?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var h=u(d),p=h.next();!p.done;p=h.next()){var v=p.value;try{T(v)}catch(t){i=null!=i?i:[],t instanceof x?i=l(l([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new x(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)T(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&A(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&A(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),S=E.EMPTY;function k(t){return t instanceof E||t&&"closed"in t&&w(t.remove)&&w(t.add)&&w(t.unsubscribe)}function T(t){w(t)?t():t.unsubscribe()}var C={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},O=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,l([t,e],c(n)))};function N(t){O((function(){throw t}))}function P(){}function I(t){t()}var L=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,k(e)&&e.add(n)):n.destination=R,n}return n(e,t),e.create=function(t,e,n){return new q(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(E),j=Function.prototype.bind;function F(t,e){return j.call(t,e)}var M=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){z(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){z(t)}else z(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){z(t)}},t}(),q=function(t){function e(e,n,r){var i,o,u=t.call(this)||this;w(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&C.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&F(e.next,o),error:e.error&&F(e.error,o),complete:e.complete&&F(e.complete,o)}):i=e;return u.destination=new M(i),u}return n(e,t),e}(L);function z(t){N(t)}var R={closed:!0,next:P,error:function(t){throw t},complete:P},D="function"==typeof Symbol&&Symbol.observable||"@@observable";function U(t){return t}function V(t){return 0===t.length?U:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var W=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof L||function(t){return t&&w(t.next)&&w(t.error)&&w(t.complete)}(r)&&k(r)?t:new q(t,e,n);return I((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=H(e))((function(e,r){var i=new q({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[D]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return V(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=H(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function H(t){var e;return null!==(e=null!=t?t:C.Promise)&&void 0!==e?e:Promise}function Y(t){return w(null==t?void 0:t.lift)}function B(t){return function(e){if(Y(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}function X(t,e,n,r,i){return new G(t,e,n,r,i)}var G=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=u,c._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,c._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return n(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(L);!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Y(e)&&(r.lift=e.lift),r}n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new E;var n=this.getSubject();e.add(this.source.subscribe(X(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=E.EMPTY)}return e},e.prototype.refCount=function(){return B((function(t,e){var n=null;t._refCount++;var r=X(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())}))(this)}}(W);var J,Z={now:function(){return(Z.delegate||performance).now()},delegate:void 0},$={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new E((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,l([],c(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,l([],c(t)))},delegate:void 0};new W((function(t){var e=J||Z,n=e.now(),r=0,i=function(){t.closed||(r=$.requestAnimationFrame((function(o){r=0;var u=e.now();t.next({timestamp:J?u:o,elapsed:u-n}),i()})))};return i(),function(){r&&$.cancelAnimationFrame(r)}}));var K=_((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Q=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n(e,t),e.prototype.lift=function(t){var e=new tt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new K},e.prototype.next=function(t){var e=this;I((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=u(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;I((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;I((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?S:(this.currentObservers=null,o.push(t),new E((function(){e.currentObservers=null,A(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new W;return t.source=this,t},e.create=function(t,e){return new tt(t,e)},e}(W),tt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return n(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:S},e}(Q);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(Q);var et={now:function(){return(et.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=et);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}n(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var u=n.now(),c=0,l=1;l<r.length&&r[l]<=u;l+=2)c=l;c&&r.splice(0,c+1)}}}(Q),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}n(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,u=e.isStopped,c=e._isComplete;n?t.error(o):(u||c)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(Q);var nt,rt=function(t){function e(e,n){return t.call(this)||this}return n(e,t),e.prototype.schedule=function(t,e){return this},e}(E),it=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,l([t,e],c(n)))},ot=function(t){return clearInterval(t)},ut=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n(e,t),e.prototype.schedule=function(t,e){var n;if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),it(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&ot(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,A(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(rt),ct=1,lt={};function at(t){return t in lt&&(delete lt[t],!0)}var st=function(t){var e=ct++;return lt[e]=!0,nt||(nt=Promise.resolve()),nt.then((function(){return at(e)&&t()})),e},ft=function(t){at(t)},dt={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=dt.delegate;return((null==n?void 0:n.setImmediate)||st).apply(void 0,l([],c(t)))},clearImmediate:function(t){return ft(t)},delegate:void 0},ht=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=dt.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(dt.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))},e}(ut),pt=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=et.now,t}(),vt=function(t){function e(e,n){void 0===n&&(n=pt.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(pt),yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new yt(ht);var bt=new vt(ut),mt=bt,gt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.flush(this),0)},e}(ut),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(vt);new wt(gt);var _t=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=$.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&($.cancelAnimationFrame(n),e._scheduled=void 0)},e}(ut),xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new xt(_t),function(t){function e(e,n){void 0===e&&(e=At),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}n(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(vt);var At=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return n(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return E.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(ut),Et=new W((function(t){return t.complete()}));function St(t){return t&&w(t.schedule)}function kt(t){return t[t.length-1]}function Tt(t){return St(kt(t))?t.pop():void 0}function Ct(t,e){return"number"==typeof kt(t)?t.pop():e}var Ot=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Nt(t){return w(null==t?void 0:t.then)}function Pt(t){return w(t[D])}function It(t){return Symbol.asyncIterator&&w(null==t?void 0:t[Symbol.asyncIterator])}function Lt(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var jt,Ft="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Mt(t){return w(null==t?void 0:t[Ft])}function qt(t){return s(this,arguments,(function(){var e,n,r;return o(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,a(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,a(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,a(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function zt(t){return w(null==t?void 0:t.getReader)}function Rt(t){if(t instanceof W)return t;if(null!=t){if(Pt(t))return i=t,new W((function(t){var e=i[D]();if(w(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ot(t))return r=t,new W((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(Nt(t))return n=t,new W((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,N)}));if(It(t))return Dt(t);if(Mt(t))return e=t,new W((function(t){var n,r;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(zt(t))return Dt(qt(t))}var e,n,r,i;throw Lt(t)}function Dt(t){return new W((function(e){(function(t,e){var n,r,u,c;return i(this,void 0,void 0,(function(){var i,l;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),n=f(t),o.label=1;case 1:return[4,n.next()];case 2:if((r=o.sent()).done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=o.sent(),u={error:l},[3,11];case 6:return o.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function Ut(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(o),!i)return o}function Vt(t,e){return void 0===e&&(e=0),B((function(n,r){n.subscribe(X(r,(function(n){return Ut(r,t,(function(){return r.next(n)}),e)}),(function(){return Ut(r,t,(function(){return r.complete()}),e)}),(function(n){return Ut(r,t,(function(){return r.error(n)}),e)})))}))}function Wt(t,e){return void 0===e&&(e=0),B((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function Ht(t,e){if(!t)throw new Error("Iterable cannot be null");return new W((function(n){Ut(n,e,(function(){var r=t[Symbol.asyncIterator]();Ut(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function Yt(t,e){if(null!=t){if(Pt(t))return function(t,e){return Rt(t).pipe(Wt(e),Vt(e))}(t,e);if(Ot(t))return function(t,e){return new W((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(Nt(t))return function(t,e){return Rt(t).pipe(Wt(e),Vt(e))}(t,e);if(It(t))return Ht(t,e);if(Mt(t))return function(t,e){return new W((function(n){var r;return Ut(n,e,(function(){r=t[Ft](),Ut(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return w(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(zt(t))return function(t,e){return Ht(qt(t),e)}(t,e)}throw Lt(t)}function Bt(t,e){return e?Yt(t,e):Rt(t)}function Xt(t){return t instanceof Date&&!isNaN(t)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(jt||(jt={})),_((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),_((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),_((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),_((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}));var Gt=_((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}));function Jt(t){throw new Gt(t)}function Zt(t,e){return B((function(n,r){var i=0;n.subscribe(X(r,(function(n){r.next(t.call(e,n,i++))})))}))}var $t=Array.isArray;function Kt(t){return Zt((function(e){return function(t,e){return $t(e)?t.apply(void 0,l([],c(e))):t(e)}(t,e)}))}function Qt(t,e,n){return void 0===n&&(n=1/0),w(e)?Qt((function(n,r){return Zt((function(t,i){return e(n,t,r,i)}))(Rt(t(n,r)))}),n):("number"==typeof e&&(n=e),B((function(e,r){return function(t,e,n,r,i,o,u,c){var l=[],a=0,s=0,f=!1,d=function(){!f||l.length||a||e.complete()},h=function(t){return a<r?p(t):l.push(t)},p=function(t){o&&e.next(t),a++;var c=!1;Rt(n(t,s++)).subscribe(X(e,(function(t){null==i||i(t),o?h(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{a--;for(var t=function(){var t=l.shift();u?Ut(e,u,(function(){return p(t)})):p(t)};l.length&&a<r;)t();d()}catch(t){e.error(t)}})))};return t.subscribe(X(e,h,(function(){f=!0,d()}))),function(){null==c||c()}}(e,r,t,n)})))}function te(t){return void 0===t&&(t=1/0),Qt(U,t)}function ee(){return te(1)}var ne,re,ie=["addListener","removeListener"],oe=["addEventListener","removeEventListener"],ue=["on","off"];function ce(t,e,n,r){if(w(n)&&(r=n,n=void 0),r)return ce(t,e,n).pipe(Kt(r));var i=c(function(t){return w(t.addEventListener)&&w(t.removeEventListener)}(t)?oe.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return w(t.addListener)&&w(t.removeListener)}(t)?ie.map(le(t,e)):function(t){return w(t.on)&&w(t.off)}(t)?ue.map(le(t,e)):[],2),o=i[0],u=i[1];if(!o&&Ot(t))return Qt((function(t){return ce(t,e,n)}))(Rt(t));if(!o)throw new TypeError("Invalid event target");return new W((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return u(e)}}))}function le(t,e){return function(n){return function(r){return t[n](e,r)}}}function ae(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Tt(t),r=Ct(t,1/0),i=t;return i.length?1===i.length?Rt(i[0]):te(r)(Bt(i,n)):Et}function se(t,e){return B((function(n,r){var i=0;n.subscribe(X(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}function fe(t){return t<=0?function(){return Et}:B((function(e,n){var r=0;e.subscribe(X(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}function de(t,e){return e?function(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ee()(Bt(t,Tt(t)))}(e.pipe(fe(1),B((function(t,e){t.subscribe(X(e,P))}))),n.pipe(de(t)))}:Qt((function(e,n){return Rt(t(e,n)).pipe(fe(1),function(t){return Zt((function(){return t}))}(e))}))}function he(t,e){void 0===e&&(e=bt);var n=function(t,e,n){void 0===t&&(t=0),void 0===n&&(n=mt);var r=-1;return null!=e&&(St(e)?n=e:r=e),new W((function(e){var i=Xt(t)?+t-n.now():t;i<0&&(i=0);var o=0;return n.schedule((function(){e.closed||(e.next(o++),0<=r?this.schedule(void 0,r):e.complete())}),i)}))}(t,e);return de((function(){return n}))}function pe(t,e){if(t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===t.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(t){return!0},className:function(t){return!0},tagName:function(t){return!0},attr:function(t,e){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};ne=r(r({},n),e),re=function(t,e){if(t.nodeType===Node.DOCUMENT_NODE)return t;if(t===e.root)return t.ownerDocument;return t}(ne.root,n);var i=ve(t,"all",(function(){return ve(t,"two",(function(){return ve(t,"one",(function(){return ve(t,"none")}))}))}));if(i){var o=Se(ke(i,t));return o.length>0&&(i=o[0]),be(i)}throw new Error("Selector was not found.")}function ve(t,e,n){for(var r=null,i=[],o=t,a=0,s=function(){var t,s,f=xe(function(t){var e=t.getAttribute("id");if(e&&ne.idName(e))return{name:"#"+CSS.escape(e),penalty:0};return null}(o))||xe.apply(void 0,l([],c(function(t){var e=Array.from(t.attributes).filter((function(t){return ne.attr(t.name,t.value)}));return e.map((function(t){return{name:"[".concat(CSS.escape(t.name),'="').concat(CSS.escape(t.value),'"]'),penalty:.5}}))}(o)),!1))||xe.apply(void 0,l([],c(function(t){var e=Array.from(t.classList).filter(ne.className);return e.map((function(t){return{name:"."+CSS.escape(t),penalty:1}}))}(o)),!1))||xe(function(t){var e=t.tagName.toLowerCase();if(ne.tagName(e))return{name:e,penalty:2};return null}(o))||[{name:"*",penalty:3}],d=function(t){var e=t.parentNode;if(!e)return null;var n=e.firstChild;if(!n)return null;var r=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==t);)n=n.nextSibling;return r}(o);if("all"==e)d&&(f=f.concat(f.filter(_e).map((function(t){return we(t,d)}))));else if("two"==e)f=f.slice(0,1),d&&(f=f.concat(f.filter(_e).map((function(t){return we(t,d)}))));else if("one"==e){var h=c(f=f.slice(0,1),1)[0];d&&_e(h)&&(f=[we(h,d)])}else"none"==e&&(f=[{name:"*",penalty:3}],d&&(f=[we(f[0],d)]));try{for(var p=(t=void 0,u(f)),v=p.next();!v.done;v=p.next()){(h=v.value).level=a}}catch(e){t={error:e}}finally{try{v&&!v.done&&(s=p.return)&&s.call(p)}finally{if(t)throw t.error}}if(i.push(f),i.length>=ne.seedMinLength&&(r=ye(i,n)))return"break";o=o.parentElement,a++};o;){if("break"===s())break}return r||(r=ye(i,n)),!r&&n?n():r}function ye(t,e){var n,r,i=Se(Ee(t));if(i.length>ne.threshold)return e?e():null;try{for(var o=u(i),c=o.next();!c.done;c=o.next()){var l=c.value;if(ge(l))return l}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function be(t){for(var e=t[0],n=e.name,r=1;r<t.length;r++){var i=t[r].level||0;n=e.level===i-1?"".concat(t[r].name," > ").concat(n):"".concat(t[r].name," ").concat(n),e=t[r]}return n}function me(t){return t.map((function(t){return t.penalty})).reduce((function(t,e){return t+e}),0)}function ge(t){var e=be(t);switch(re.querySelectorAll(e).length){case 0:throw new Error("Can't select any node with this selector: ".concat(e));case 1:return!0;default:return!1}}function we(t,e){return{name:t.name+":nth-child(".concat(e,")"),penalty:t.penalty+1}}function _e(t){return"html"!==t.name&&!t.name.startsWith("#")}function xe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Ae);return n.length>0?n:null}function Ae(t){return null!=t}function Ee(t,e){var n,r,i,c,l,a;return void 0===e&&(e=[]),o(this,(function(o){switch(o.label){case 0:if(!(t.length>0))return[3,9];o.label=1;case 1:o.trys.push([1,6,7,8]),n=u(t[0]),r=n.next(),o.label=2;case 2:return r.done?[3,5]:(i=r.value,[5,u(Ee(t.slice(1,t.length),e.concat(i)))]);case 3:o.sent(),o.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return c=o.sent(),l={error:c},[3,8];case 7:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(l)throw l.error}return[7];case 8:return[3,11];case 9:return[4,e];case 10:o.sent(),o.label=11;case 11:return[2]}}))}function Se(t){return l([],c(t),!1).sort((function(t,e){return me(t)-me(e)}))}function ke(t,e,n){var r,i,a;return void 0===n&&(n={counter:0,visited:new Map}),o(this,(function(o){switch(o.label){case 0:if(!(t.length>2&&t.length>ne.optimizedMinLength))return[3,5];r=1,o.label=1;case 1:return r<t.length-1?n.counter>ne.maxNumberOfTries?[2]:(n.counter+=1,(i=l([],c(t),!1)).splice(r,1),a=be(i),n.visited.has(a)?[2]:ge(i)&&function(t,e){return re.querySelector(be(t))===e}(i,e)?[4,i]:[3,4]):[3,5];case 2:return o.sent(),n.visited.set(a,!0),[5,u(ke(i,e,n))];case 3:o.sent(),o.label=4;case 4:return r++,[3,1];case 5:return[2]}}))}new W(P);var Te=["input","select","textarea"],Ce=function(t,e){return function(n,r){var i,o,u,c=t.pageUrlAllowlist,l=t.shouldTrackEventResolver,a=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!a)return!1;if(l)return l(n,r);if(!Le(window.location.href,c))return!1;var s=(null==r?void 0:r.type)||"";if("string"==typeof s)switch(s.toLowerCase()){case"hidden":case"password":return!1}if(e){var f=e.some((function(t){var e;return!!(null===(e=null==r?void 0:r.matches)||void 0===e?void 0:e.call(r,t))}));if(!f)return!1}switch(a){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:var d=null===(u=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===u?void 0:u.call(window,r);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==n)||"click"===n}}},Oe=function(t){if(null==t)return!1;if("string"==typeof t){if(/^(?:(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}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0},Ne=function(t){var e,n,r,i=null===(n=null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),o=t instanceof HTMLElement&&"true"===(null===(r=t.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!Te.includes(i)&&!o},Pe=function(t){var e="";return Ne(t)&&t.childNodes&&t.childNodes.length&&t.childNodes.forEach((function(t){var n,r="";(n=t)&&3===n.nodeType?t.textContent&&(r=t.textContent):r=Pe(t),e+=r.split(/(\s+)/).filter(Oe).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),e},Ie=function(t,e){var n,r,i="";try{return i=pe(t,{className:function(t){return t!==g}})}catch(t){if(e){var o=t;e.warn("Failed to get selector with finder, use fallback strategy instead: ".concat(o.toString()))}}var u=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);if(u&&(i=u),t.id)i="#".concat(t.id);else if(t.className){var c=t.className.split(" ").filter((function(t){return t!==g})).join(".");c&&(i="".concat(i,".").concat(c))}return i},Le=function(t,e){return!e||!e.length||e.some((function(e){return"string"==typeof e?t===e:t.match(e)}))},je=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];return function(t){return null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length}(r)||(e[n]=r),e}),{})},Fe=function(t){var e=t.parentElement;if(!e)return"";var n=e.querySelector(":scope>span,h1,h2,h3,h4,h5,h6");if(n){var r=n.textContent||"";return Oe(r)?r:""}return Fe(e)},Me=function(t,e){return t?e.some((function(e){var n;return null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e)}))?t:Me(null==t?void 0:t.parentElement,e):null},qe=function(t,e){var n,r,i;if(!t)return{};var o=null===(i=null===(r=null==t?void 0:t.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u=Ie(t,e),c=((n={})[h]=o,n[p]=Pe(t),n[v]=u,n[y]=window.location.href.split("?")[0],n);return je(c)};var ze=function(t){return!(null===t.event.target||!t.closestTrackedAncestor)},Re=function(){function t(t){var e=(void 0===t?{}:t).origin,n=void 0===e?b:e,r=this;this.endpoint=b,this.requestCallbacks={},this.onSelect=function(t){r.notify({action:"element-selected",data:t})},this.onTrack=function(t,e){"selector-mode-changed"===t?r.notify({action:"track-selector-mode-changed",data:e}):"selector-moved"===t&&r.notify({action:"track-selector-moved",data:e})},this.endpoint=n}return t.prototype.notify=function(t){var e,n,r,i;null===(n=null===(e=this.logger)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"Message sent: ",JSON.stringify(t)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,t,this.endpoint)},t.prototype.sendRequest=function(t,e,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:t,args:e};return new Promise((function(e,u){r.requestCallbacks[i]={resolve:e,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(new Error("".concat(t," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},t.prototype.handleResponse=function(t){var e;this.requestCallbacks[t.id]?(this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]):null===(e=this.logger)||void 0===e||e.warn("No callback found for request id: ".concat(t.id))},t.prototype.setup=function(t){var e=this,n=void 0===t?{}:t,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,c=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===b&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(t){var n,r,i,a,s;if(null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(t)),e.endpoint===t.origin){var f,d=null==t?void 0:t.data,h=null==d?void 0:d.action;if(h)if("id"in d)null===(a=null===(i=e.logger)||void 0===i?void 0:i.debug)||void 0===a||a.call(i,"Received Response to previous request: ",JSON.stringify(t)),e.handleResponse(d);else if("ping"===h)e.notify({action:"pong"});else if("initialize-visual-tagging-selector"===h){var p=null==d?void 0:d.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(t,e){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){t({status:!0})}),{once:!0}),r.addEventListener("error",(function(){e({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(t){e(t)}}))).then((function(){var t;l=null===(t=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===t?void 0:t.call(window,{getEventTagProps:qe,isElementSelectable:function(t){return!o||o((null==p?void 0:p.actionType)||"click",t)},onTrack:e.onTrack,onSelect:e.onSelect,visualHighlightClass:g,messenger:e,cssSelectorAllowlist:u,actionClickAllowlist:c}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===h&&(null===(s=null==l?void 0:l.close)||void 0===s||s.call(l))}})),this.notify({action:"page-loaded"})},t}(),De=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],Ue=["type"],Ve=["svg","path","g"],We=["password","hidden"];var He=function(t){var e;return t?(e=function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(null===i)n+=4;else{var o=Ye(i);n+=o?Array.from(o).length:4}if(n>e)return t.slice(0,r)}return t}(function(t){var e=[];if(!t)return e;e.push(t);for(var n=t.parentElement;n&&"HTML"!==n.tagName;)e.push(n),n=n.parentElement;return e}(t).map((function(t){return function(t){var e,n,r,i,o,c;if(null===t)return null;var l=t.tagName.toLowerCase(),a={tag:l},s=Array.from(null!==(i=null===(r=t.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);s.length&&(a.index=s.indexOf(t),a.indexOfType=s.filter((function(e){return e.tagName===t.tagName})).indexOf(t));var f=null===(c=null===(o=t.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===c?void 0:c.toLowerCase();f&&(a.prevSib=f);var d=t.id;d&&(a.id=d);var h=Array.from(t.classList);h.length&&(a.classes=h);var p={},v=Array.from(t.attributes).filter((function(t){return!De.includes(t.name)})),y=!Ne(t);if(!We.includes(t.type)&&!Ve.includes(l))try{for(var b=u(v),m=b.next();!m.done;m=b.next()){var g=m.value;y&&!Ue.includes(g.name)||(p[g.name]=String(g.value).substring(0,128))}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=b.return)&&n.call(b)}finally{if(e)throw e.error}}return Object.keys(p).length&&(a.attrs=p),a}(t)})),1024),e):[]};function Ye(t,e){void 0===e&&(e=!1);try{if(null==t)return e?"None":null;if("string"==typeof t)return e?(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(t,"'"):t.includes("'")?'"'.concat(t.replace(/'/g,"\\'"),'"'):"'".concat(t,"'"):t;if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var n=t.map((function(t){return Ye(t,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof t){var r=Object.entries(t).filter((function(t){return null!=c(t,1)[0]})).map((function(t){var e=c(t,2),n=e[0],r=e[1];return"".concat(String(Ye(n,!0)),": ").concat(String(Ye(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return t.toString()}catch(t){return null}}function Be(t){var e,n,r,i=t.amplitude,o=t.allObservables,l=t.options,a=t.shouldTrackEvent,s=o.clickObservable,f=s.pipe(B((function(t,e){var n,r=!1;t.subscribe(X(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))})),se((function(t){var e=c(t,2),n=e[0],r=e[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),h=ae(f,s.pipe((e=l.debounceTime,void 0===n&&(n=bt),B((function(t,r){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var t=o;o=null,r.next(t)}};function l(){var t=u+e,o=n.now();if(o<t)return i=this.schedule(void 0,t-o),void r.add(i);c()}t.subscribe(X(r,(function(t){o=t,u=n.now(),i||(i=n.schedule(l,e),r.add(i))}),(function(){c(),r.complete()}),void 0,(function(){o=i=null})))}))),Zt((function(){return"timeout"}))));return s.pipe(he(0),se(ze),se((function(t){return a("click",t.closestTrackedAncestor)})),(r=h,B((function(t,e){var n=[];return t.subscribe(X(e,(function(t){return n.push(t)}),(function(){e.next(n),e.complete()}))),Rt(r).subscribe(X(e,(function(){var t=n;n=[],e.next(t)}),P)),function(){n=null}})))).subscribe((function(t){var e,n,r=(t.length,d);try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value;null==i||i.track(r,l.targetElementProperties,{time:l.timestamp})}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}function Xe(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,u=t.shouldTrackActionClick,a=n.clickObservable,s=n.mutationObservable,f=n.navigateObservable,h=a.pipe(se((function(t){return!o("click",t.closestTrackedAncestor)})),Zt((function(t){var e=Me(t.event.target,r.actionClickAllowlist);return t.closestTrackedAncestor=e,null!==t.closestTrackedAncestor&&(t.targetElementProperties=i(t.type,t.closestTrackedAncestor)),t})),se(ze),se((function(t){return u("click",t.closestTrackedAncestor)}))),p=[s];f&&p.push(f);var v,y,b=ae.apply(void 0,l([],c(p),!1)),m=h.pipe((v=function(t){return b.pipe(function(t,e){var n=Xt(t)?{first:t}:"number"==typeof t?{each:t}:t,r=n.first,i=n.each,o=n.with,u=void 0===o?Jt:o,c=n.scheduler,l=void 0===c?null!=e?e:bt:c,a=n.meta,s=void 0===a?null:a;if(null==r&&null==i)throw new TypeError("No timeout provided.");return B((function(t,e){var n,o,c=null,a=0,f=function(t){o=Ut(e,l,(function(){try{n.unsubscribe(),Rt(u({meta:s,lastValue:c,seen:a})).subscribe(e)}catch(t){e.error(t)}}),t)};n=t.subscribe(X(e,(function(t){null==o||o.unsubscribe(),a++,e.next(c=t),i>0&&f(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),c=null}))),!a&&f(null!=r?"number"==typeof r?r:+r-l.now():i)}))}({first:500,with:function(){return Et}}),Zt((function(){return t})))},B((function(t,e){var n=null,r=0,i=!1,o=function(){return i&&!n&&e.complete()};t.subscribe(X(e,(function(t){null==n||n.unsubscribe();var i=0,u=r++;Rt(v(t,u)).subscribe(n=X(e,(function(n){return e.next(y?y(t,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return m.subscribe((function(t){null==e||e.track(d,i("click",t.closestTrackedAncestor))}))}var Ge,Je=["a","button","input","select","textarea","label","[data-amp-default-track]",".amp-default-track"],Ze=["div","span","h1","h2","h3","h4","h5","h6"],$e="data-amp-track-";!function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable"}(Ge||(Ge={}));var Ke=function(t){var e,n,a;void 0===t&&(t={});var s=t.dataAttributePrefix,f=void 0===s?$e:s,d=t.visualTaggingOptions,b=void 0===d?{enabled:!0,messenger:new Re}:d;t.cssSelectorAllowlist=null!==(e=t.cssSelectorAllowlist)&&void 0!==e?e:Je,t.actionClickAllowlist=null!==(n=t.actionClickAllowlist)&&void 0!==n?n:Ze,t.debounceTime=null!==(a=t.debounceTime)&&void 0!==a?a:1e3;var g="@amplitude/plugin-autocapture-browser",w=[],_=void 0,x=function(t,e){var n,r,i,o=null===(i=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:null,top:null},c=e.getAttribute("aria-label"),l=function(t,e){return t.getAttributeNames().reduce((function(n,r){if(r.startsWith(e)){var i=r.replace(e,""),o=t.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(e,f),a=Fe(e),s=Ie(e,_),d=((n={})["[Amplitude] Element ID"]=e.id,n["[Amplitude] Element Class"]=e.className,n["[Amplitude] Element Hierarchy"]=He(e),n[h]=o,n[p]=Pe(e),n["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),n["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),n["[Amplitude] Element Aria Label"]=c,n["[Amplitude] Element Attributes"]=l,n[v]=s,n["[Amplitude] Element Parent Label"]=a,n[y]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===o&&"click"===t&&e instanceof HTMLAnchorElement&&(d["[Amplitude] Element Href"]=e.href),je(d)},A=function(e,n){var r={event:e,timestamp:Date.now(),type:n};if(function(t){return"click"===t.type||"change"===t.type}(r)&&null!==r.event.target){var i=Me(r.event.target,t.cssSelectorAllowlist);return i&&(r.closestTrackedAncestor=i,r.targetElementProperties=x(r.type,i)),r}return r};return{name:g,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,a,s,f,d,h,p,v,y,E;return o(this,(function(o){return n?(_=e.loggerProvider,"undefined"==typeof document||(i=Ce(t,t.cssSelectorAllowlist),u=Ce(t,t.actionClickAllowlist),a=function(){var t,e,n=ce(document,"click",{capture:!0}).pipe(Zt((function(t){return A(t,"click")}))),r=ce(document,"change",{capture:!0}).pipe(Zt((function(t){return A(t,"change")})));window.navigation&&(e=ce(window.navigation,"navigate").pipe(Zt((function(t){return A(t,"navigate")}))));var i=new W((function(t){var e=new MutationObserver((function(e){t.next(e)}));return e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}})).pipe(Zt((function(t){return A(t,"mutation")})));return(t={})[Ge.ClickObservable]=n,t[Ge.ChangeObservable]=r,t[Ge.NavigateObservable]=e,t[Ge.MutationObservable]=i,t}(),s=Be({allObservables:a,options:t,amplitude:n,shouldTrackEvent:i}),w.push(s),f=function(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent;return n.changeObservable.pipe(se(ze),se((function(t){return i("change",t.closestTrackedAncestor)}))).subscribe((function(t){null==e||e.track("[Amplitude] Element Changed",r("change",t.closestTrackedAncestor))}))}({allObservables:a,getEventProperties:x,amplitude:n,shouldTrackEvent:i}),w.push(f),d=Xe({allObservables:a,options:t,getEventProperties:x,amplitude:n,shouldTrackEvent:i,shouldTrackActionClick:u}),w.push(d),null===(y=null==e?void 0:e.loggerProvider)||void 0===y||y.log("".concat(g," has been successfully added.")),window.opener&&b.enabled&&(h=t.cssSelectorAllowlist,p=t.actionClickAllowlist,null===(E=b.messenger)||void 0===E||E.setup(r(r({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:m[e.serverZone]}),{isElementSelectable:Ce(t,l(l([],c(h),!1),c(p),!1)),cssSelectorAllowlist:h,actionClickAllowlist:p})))),[2]):(null===(v=null==e?void 0:e.loggerProvider)||void 0===v||v.warn("".concat(g," plugin requires a later version of @amplitude/analytics-browser. Events are not tracked.")),[2])}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(w),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}};return t.DEFAULT_CSS_SELECTOR_ALLOWLIST=Je,t.DEFAULT_DATA_ATTRIBUTE_PREFIX=$e,t.WindowMessenger=Re,t.autocapturePlugin=Ke,t.plugin=Ke,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
var amplitudeAutocapturePlugin=function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(l){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){u.label=c[1];break}if(6===c[0]&&u.label<i[1]){u.label=i[1],i=c;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(c);break}i[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function a(t){return this instanceof a?(this.v=t,this):new a(t)}function s(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=i[t](e)).value instanceof a?Promise.resolve(n.value.v).then(l,s):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function l(t){c("next",t)}function s(t){c("throw",t)}function f(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}}function f(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}var d="[Amplitude] Element Clicked",h="[Amplitude] Element Tag",p="[Amplitude] Element Text",v="[Amplitude] Element Selector",y="[Amplitude] Page URL",b="https://app.amplitude.com",m={US:b,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},g="amp-visual-tagging-selector-highlight";function w(t){return"function"==typeof t}function _(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var x=_((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function A(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var E=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=u(o),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(w(f))try{f()}catch(t){i=t instanceof x?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var h=u(d),p=h.next();!p.done;p=h.next()){var v=p.value;try{T(v)}catch(t){i=null!=i?i:[],t instanceof x?i=l(l([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new x(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)T(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&A(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&A(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),S=E.EMPTY;function k(t){return t instanceof E||t&&"closed"in t&&w(t.remove)&&w(t.add)&&w(t.unsubscribe)}function T(t){w(t)?t():t.unsubscribe()}var C={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},O=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,l([t,e],c(n)))};function N(t){O((function(){throw t}))}function P(){}function I(t){t()}var L=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,k(e)&&e.add(n)):n.destination=R,n}return n(e,t),e.create=function(t,e,n){return new q(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(E),j=Function.prototype.bind;function F(t,e){return j.call(t,e)}var M=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){z(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){z(t)}else z(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){z(t)}},t}(),q=function(t){function e(e,n,r){var i,o,u=t.call(this)||this;w(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&C.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&F(e.next,o),error:e.error&&F(e.error,o),complete:e.complete&&F(e.complete,o)}):i=e;return u.destination=new M(i),u}return n(e,t),e}(L);function z(t){N(t)}var R={closed:!0,next:P,error:function(t){throw t},complete:P},D="function"==typeof Symbol&&Symbol.observable||"@@observable";function U(t){return t}function V(t){return 0===t.length?U:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var W=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof L||function(t){return t&&w(t.next)&&w(t.error)&&w(t.complete)}(r)&&k(r)?t:new q(t,e,n);return I((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=H(e))((function(e,r){var i=new q({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[D]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return V(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=H(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function H(t){var e;return null!==(e=null!=t?t:C.Promise)&&void 0!==e?e:Promise}function Y(t){return w(null==t?void 0:t.lift)}function B(t){return function(e){if(Y(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}function X(t,e,n,r,i){return new G(t,e,n,r,i)}var G=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=u,c._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,c._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return n(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(L);!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Y(e)&&(r.lift=e.lift),r}n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new E;var n=this.getSubject();e.add(this.source.subscribe(X(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=E.EMPTY)}return e},e.prototype.refCount=function(){return B((function(t,e){var n=null;t._refCount++;var r=X(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())}))(this)}}(W);var J,Z={now:function(){return(Z.delegate||performance).now()},delegate:void 0},$={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new E((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,l([],c(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,l([],c(t)))},delegate:void 0};new W((function(t){var e=J||Z,n=e.now(),r=0,i=function(){t.closed||(r=$.requestAnimationFrame((function(o){r=0;var u=e.now();t.next({timestamp:J?u:o,elapsed:u-n}),i()})))};return i(),function(){r&&$.cancelAnimationFrame(r)}}));var K=_((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Q=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n(e,t),e.prototype.lift=function(t){var e=new tt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new K},e.prototype.next=function(t){var e=this;I((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=u(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;I((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;I((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?S:(this.currentObservers=null,o.push(t),new E((function(){e.currentObservers=null,A(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new W;return t.source=this,t},e.create=function(t,e){return new tt(t,e)},e}(W),tt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return n(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:S},e}(Q);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(Q);var et={now:function(){return(et.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=et);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}n(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var u=n.now(),c=0,l=1;l<r.length&&r[l]<=u;l+=2)c=l;c&&r.splice(0,c+1)}}}(Q),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}n(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,u=e.isStopped,c=e._isComplete;n?t.error(o):(u||c)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(Q);var nt,rt=function(t){function e(e,n){return t.call(this)||this}return n(e,t),e.prototype.schedule=function(t,e){return this},e}(E),it=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,l([t,e],c(n)))},ot=function(t){return clearInterval(t)},ut=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n(e,t),e.prototype.schedule=function(t,e){var n;if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),it(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&ot(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,A(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(rt),ct=1,lt={};function at(t){return t in lt&&(delete lt[t],!0)}var st=function(t){var e=ct++;return lt[e]=!0,nt||(nt=Promise.resolve()),nt.then((function(){return at(e)&&t()})),e},ft=function(t){at(t)},dt={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=dt.delegate;return((null==n?void 0:n.setImmediate)||st).apply(void 0,l([],c(t)))},clearImmediate:function(t){return ft(t)},delegate:void 0},ht=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=dt.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(dt.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))},e}(ut),pt=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=et.now,t}(),vt=function(t){function e(e,n){void 0===n&&(n=pt.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(pt),yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new yt(ht);var bt=new vt(ut),mt=bt,gt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.flush(this),0)},e}(ut),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(vt);new wt(gt);var _t=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=$.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&($.cancelAnimationFrame(n),e._scheduled=void 0)},e}(ut),xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new xt(_t),function(t){function e(e,n){void 0===e&&(e=At),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}n(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(vt);var At=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return n(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return E.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(ut),Et=new W((function(t){return t.complete()}));function St(t){return t&&w(t.schedule)}function kt(t){return t[t.length-1]}function Tt(t){return St(kt(t))?t.pop():void 0}function Ct(t,e){return"number"==typeof kt(t)?t.pop():e}var Ot=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Nt(t){return w(null==t?void 0:t.then)}function Pt(t){return w(t[D])}function It(t){return Symbol.asyncIterator&&w(null==t?void 0:t[Symbol.asyncIterator])}function Lt(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var jt,Ft="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Mt(t){return w(null==t?void 0:t[Ft])}function qt(t){return s(this,arguments,(function(){var e,n,r;return o(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,a(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,a(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,a(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function zt(t){return w(null==t?void 0:t.getReader)}function Rt(t){if(t instanceof W)return t;if(null!=t){if(Pt(t))return i=t,new W((function(t){var e=i[D]();if(w(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ot(t))return r=t,new W((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(Nt(t))return n=t,new W((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,N)}));if(It(t))return Dt(t);if(Mt(t))return e=t,new W((function(t){var n,r;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(zt(t))return Dt(qt(t))}var e,n,r,i;throw Lt(t)}function Dt(t){return new W((function(e){(function(t,e){var n,r,u,c;return i(this,void 0,void 0,(function(){var i,l;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),n=f(t),o.label=1;case 1:return[4,n.next()];case 2:if((r=o.sent()).done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=o.sent(),u={error:l},[3,11];case 6:return o.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function Ut(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(o),!i)return o}function Vt(t,e){return void 0===e&&(e=0),B((function(n,r){n.subscribe(X(r,(function(n){return Ut(r,t,(function(){return r.next(n)}),e)}),(function(){return Ut(r,t,(function(){return r.complete()}),e)}),(function(n){return Ut(r,t,(function(){return r.error(n)}),e)})))}))}function Wt(t,e){return void 0===e&&(e=0),B((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function Ht(t,e){if(!t)throw new Error("Iterable cannot be null");return new W((function(n){Ut(n,e,(function(){var r=t[Symbol.asyncIterator]();Ut(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function Yt(t,e){if(null!=t){if(Pt(t))return function(t,e){return Rt(t).pipe(Wt(e),Vt(e))}(t,e);if(Ot(t))return function(t,e){return new W((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(Nt(t))return function(t,e){return Rt(t).pipe(Wt(e),Vt(e))}(t,e);if(It(t))return Ht(t,e);if(Mt(t))return function(t,e){return new W((function(n){var r;return Ut(n,e,(function(){r=t[Ft](),Ut(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return w(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(zt(t))return function(t,e){return Ht(qt(t),e)}(t,e)}throw Lt(t)}function Bt(t,e){return e?Yt(t,e):Rt(t)}function Xt(t){return t instanceof Date&&!isNaN(t)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(jt||(jt={})),_((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),_((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),_((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),_((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}));var Gt=_((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}));function Jt(t){throw new Gt(t)}function Zt(t,e){return B((function(n,r){var i=0;n.subscribe(X(r,(function(n){r.next(t.call(e,n,i++))})))}))}var $t=Array.isArray;function Kt(t){return Zt((function(e){return function(t,e){return $t(e)?t.apply(void 0,l([],c(e))):t(e)}(t,e)}))}function Qt(t,e,n){return void 0===n&&(n=1/0),w(e)?Qt((function(n,r){return Zt((function(t,i){return e(n,t,r,i)}))(Rt(t(n,r)))}),n):("number"==typeof e&&(n=e),B((function(e,r){return function(t,e,n,r,i,o,u,c){var l=[],a=0,s=0,f=!1,d=function(){!f||l.length||a||e.complete()},h=function(t){return a<r?p(t):l.push(t)},p=function(t){o&&e.next(t),a++;var c=!1;Rt(n(t,s++)).subscribe(X(e,(function(t){null==i||i(t),o?h(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{a--;for(var t=function(){var t=l.shift();u?Ut(e,u,(function(){return p(t)})):p(t)};l.length&&a<r;)t();d()}catch(t){e.error(t)}})))};return t.subscribe(X(e,h,(function(){f=!0,d()}))),function(){null==c||c()}}(e,r,t,n)})))}function te(t){return void 0===t&&(t=1/0),Qt(U,t)}function ee(){return te(1)}var ne,re,ie=["addListener","removeListener"],oe=["addEventListener","removeEventListener"],ue=["on","off"];function ce(t,e,n,r){if(w(n)&&(r=n,n=void 0),r)return ce(t,e,n).pipe(Kt(r));var i=c(function(t){return w(t.addEventListener)&&w(t.removeEventListener)}(t)?oe.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return w(t.addListener)&&w(t.removeListener)}(t)?ie.map(le(t,e)):function(t){return w(t.on)&&w(t.off)}(t)?ue.map(le(t,e)):[],2),o=i[0],u=i[1];if(!o&&Ot(t))return Qt((function(t){return ce(t,e,n)}))(Rt(t));if(!o)throw new TypeError("Invalid event target");return new W((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return u(e)}}))}function le(t,e){return function(n){return function(r){return t[n](e,r)}}}function ae(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Tt(t),r=Ct(t,1/0),i=t;return i.length?1===i.length?Rt(i[0]):te(r)(Bt(i,n)):Et}function se(t,e){return B((function(n,r){var i=0;n.subscribe(X(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}function fe(t){return t<=0?function(){return Et}:B((function(e,n){var r=0;e.subscribe(X(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}function de(t,e){return e?function(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ee()(Bt(t,Tt(t)))}(e.pipe(fe(1),B((function(t,e){t.subscribe(X(e,P))}))),n.pipe(de(t)))}:Qt((function(e,n){return Rt(t(e,n)).pipe(fe(1),function(t){return Zt((function(){return t}))}(e))}))}function he(t,e){void 0===e&&(e=bt);var n=function(t,e,n){void 0===t&&(t=0),void 0===n&&(n=mt);var r=-1;return null!=e&&(St(e)?n=e:r=e),new W((function(e){var i=Xt(t)?+t-n.now():t;i<0&&(i=0);var o=0;return n.schedule((function(){e.closed||(e.next(o++),0<=r?this.schedule(void 0,r):e.complete())}),i)}))}(t,e);return de((function(){return n}))}function pe(t,e){if(t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===t.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(t){return!0},className:function(t){return!0},tagName:function(t){return!0},attr:function(t,e){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};ne=r(r({},n),e),re=function(t,e){if(t.nodeType===Node.DOCUMENT_NODE)return t;if(t===e.root)return t.ownerDocument;return t}(ne.root,n);var i=ve(t,"all",(function(){return ve(t,"two",(function(){return ve(t,"one",(function(){return ve(t,"none")}))}))}));if(i){var o=Se(ke(i,t));return o.length>0&&(i=o[0]),be(i)}throw new Error("Selector was not found.")}function ve(t,e,n){for(var r=null,i=[],o=t,a=0,s=function(){var t,s,f=xe(function(t){var e=t.getAttribute("id");if(e&&ne.idName(e))return{name:"#"+CSS.escape(e),penalty:0};return null}(o))||xe.apply(void 0,l([],c(function(t){var e=Array.from(t.attributes).filter((function(t){return ne.attr(t.name,t.value)}));return e.map((function(t){return{name:"[".concat(CSS.escape(t.name),'="').concat(CSS.escape(t.value),'"]'),penalty:.5}}))}(o)),!1))||xe.apply(void 0,l([],c(function(t){var e=Array.from(t.classList).filter(ne.className);return e.map((function(t){return{name:"."+CSS.escape(t),penalty:1}}))}(o)),!1))||xe(function(t){var e=t.tagName.toLowerCase();if(ne.tagName(e))return{name:e,penalty:2};return null}(o))||[{name:"*",penalty:3}],d=function(t){var e=t.parentNode;if(!e)return null;var n=e.firstChild;if(!n)return null;var r=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==t);)n=n.nextSibling;return r}(o);if("all"==e)d&&(f=f.concat(f.filter(_e).map((function(t){return we(t,d)}))));else if("two"==e)f=f.slice(0,1),d&&(f=f.concat(f.filter(_e).map((function(t){return we(t,d)}))));else if("one"==e){var h=c(f=f.slice(0,1),1)[0];d&&_e(h)&&(f=[we(h,d)])}else"none"==e&&(f=[{name:"*",penalty:3}],d&&(f=[we(f[0],d)]));try{for(var p=(t=void 0,u(f)),v=p.next();!v.done;v=p.next()){(h=v.value).level=a}}catch(e){t={error:e}}finally{try{v&&!v.done&&(s=p.return)&&s.call(p)}finally{if(t)throw t.error}}if(i.push(f),i.length>=ne.seedMinLength&&(r=ye(i,n)))return"break";o=o.parentElement,a++};o;){if("break"===s())break}return r||(r=ye(i,n)),!r&&n?n():r}function ye(t,e){var n,r,i=Se(Ee(t));if(i.length>ne.threshold)return e?e():null;try{for(var o=u(i),c=o.next();!c.done;c=o.next()){var l=c.value;if(ge(l))return l}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function be(t){for(var e=t[0],n=e.name,r=1;r<t.length;r++){var i=t[r].level||0;n=e.level===i-1?"".concat(t[r].name," > ").concat(n):"".concat(t[r].name," ").concat(n),e=t[r]}return n}function me(t){return t.map((function(t){return t.penalty})).reduce((function(t,e){return t+e}),0)}function ge(t){var e=be(t);switch(re.querySelectorAll(e).length){case 0:throw new Error("Can't select any node with this selector: ".concat(e));case 1:return!0;default:return!1}}function we(t,e){return{name:t.name+":nth-child(".concat(e,")"),penalty:t.penalty+1}}function _e(t){return"html"!==t.name&&!t.name.startsWith("#")}function xe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Ae);return n.length>0?n:null}function Ae(t){return null!=t}function Ee(t,e){var n,r,i,c,l,a;return void 0===e&&(e=[]),o(this,(function(o){switch(o.label){case 0:if(!(t.length>0))return[3,9];o.label=1;case 1:o.trys.push([1,6,7,8]),n=u(t[0]),r=n.next(),o.label=2;case 2:return r.done?[3,5]:(i=r.value,[5,u(Ee(t.slice(1,t.length),e.concat(i)))]);case 3:o.sent(),o.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return c=o.sent(),l={error:c},[3,8];case 7:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(l)throw l.error}return[7];case 8:return[3,11];case 9:return[4,e];case 10:o.sent(),o.label=11;case 11:return[2]}}))}function Se(t){return l([],c(t),!1).sort((function(t,e){return me(t)-me(e)}))}function ke(t,e,n){var r,i,a;return void 0===n&&(n={counter:0,visited:new Map}),o(this,(function(o){switch(o.label){case 0:if(!(t.length>2&&t.length>ne.optimizedMinLength))return[3,5];r=1,o.label=1;case 1:return r<t.length-1?n.counter>ne.maxNumberOfTries?[2]:(n.counter+=1,(i=l([],c(t),!1)).splice(r,1),a=be(i),n.visited.has(a)?[2]:ge(i)&&function(t,e){return re.querySelector(be(t))===e}(i,e)?[4,i]:[3,4]):[3,5];case 2:return o.sent(),n.visited.set(a,!0),[5,u(ke(i,e,n))];case 3:o.sent(),o.label=4;case 4:return r++,[3,1];case 5:return[2]}}))}new W(P);var Te=["input","select","textarea"],Ce=function(t,e){return function(n,r){var i,o,u,c=t.pageUrlAllowlist,l=t.shouldTrackEventResolver,a=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!a)return!1;if(l)return l(n,r);if(!Le(window.location.href,c))return!1;var s=(null==r?void 0:r.type)||"";if("string"==typeof s)switch(s.toLowerCase()){case"hidden":case"password":return!1}if(e){var f=e.some((function(t){var e;return!!(null===(e=null==r?void 0:r.matches)||void 0===e?void 0:e.call(r,t))}));if(!f)return!1}switch(a){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:var d=null===(u=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===u?void 0:u.call(window,r);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==n)||"click"===n}}},Oe=function(t){if(null==t)return!1;if("string"==typeof t){if(/^(?:(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}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0},Ne=function(t){var e,n,r,i=null===(n=null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),o=t instanceof HTMLElement&&"true"===(null===(r=t.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!Te.includes(i)&&!o},Pe=function(t){var e="";return Ne(t)&&t.childNodes&&t.childNodes.length&&t.childNodes.forEach((function(t){var n,r="";(n=t)&&3===n.nodeType?t.textContent&&(r=t.textContent):r=Pe(t),e+=r.split(/(\s+)/).filter(Oe).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),e},Ie=function(t,e){var n,r,i="";try{return i=pe(t,{className:function(t){return t!==g}})}catch(t){if(e){var o=t;e.warn("Failed to get selector with finder, use fallback strategy instead: ".concat(o.toString()))}}var u=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);if(u&&(i=u),t.id)i="#".concat(t.id);else if(t.className){var c=t.className.split(" ").filter((function(t){return t!==g})).join(".");c&&(i="".concat(i,".").concat(c))}return i},Le=function(t,e){return!e||!e.length||e.some((function(e){return"string"==typeof e?t===e:t.match(e)}))},je=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];return function(t){return null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length}(r)||(e[n]=r),e}),{})},Fe=function(t){var e=t.parentElement;if(!e)return"";var n=e.querySelector(":scope>span,h1,h2,h3,h4,h5,h6");if(n){var r=n.textContent||"";return Oe(r)?r:""}return Fe(e)},Me=function(t,e){return t?e.some((function(e){var n;return null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e)}))?t:Me(null==t?void 0:t.parentElement,e):null},qe=function(t,e){var n,r,i;if(!t)return{};var o=null===(i=null===(r=null==t?void 0:t.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u=Ie(t,e),c=((n={})[h]=o,n[p]=Pe(t),n[v]=u,n[y]=window.location.href.split("?")[0],n);return je(c)};var ze=function(t){return!(null===t.event.target||!t.closestTrackedAncestor)},Re=function(){function t(t){var e=(void 0===t?{}:t).origin,n=void 0===e?b:e,r=this;this.endpoint=b,this.requestCallbacks={},this.onSelect=function(t){r.notify({action:"element-selected",data:t})},this.onTrack=function(t,e){"selector-mode-changed"===t?r.notify({action:"track-selector-mode-changed",data:e}):"selector-moved"===t&&r.notify({action:"track-selector-moved",data:e})},this.endpoint=n}return t.prototype.notify=function(t){var e,n,r,i;null===(n=null===(e=this.logger)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"Message sent: ",JSON.stringify(t)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,t,this.endpoint)},t.prototype.sendRequest=function(t,e,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:t,args:e};return new Promise((function(e,u){r.requestCallbacks[i]={resolve:e,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(new Error("".concat(t," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},t.prototype.handleResponse=function(t){var e;this.requestCallbacks[t.id]?(this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]):null===(e=this.logger)||void 0===e||e.warn("No callback found for request id: ".concat(t.id))},t.prototype.setup=function(t){var e=this,n=void 0===t?{}:t,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,c=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===b&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(t){var n,r,i,a,s;if(null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(t)),e.endpoint===t.origin){var f,d=null==t?void 0:t.data,h=null==d?void 0:d.action;if(h)if("id"in d)null===(a=null===(i=e.logger)||void 0===i?void 0:i.debug)||void 0===a||a.call(i,"Received Response to previous request: ",JSON.stringify(t)),e.handleResponse(d);else if("ping"===h)e.notify({action:"pong"});else if("initialize-visual-tagging-selector"===h){var p=null==d?void 0:d.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(t,e){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){t({status:!0})}),{once:!0}),r.addEventListener("error",(function(){e({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(t){e(t)}}))).then((function(){var t;l=null===(t=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===t?void 0:t.call(window,{getEventTagProps:qe,isElementSelectable:function(t){return!o||o((null==p?void 0:p.actionType)||"click",t)},onTrack:e.onTrack,onSelect:e.onSelect,visualHighlightClass:g,messenger:e,cssSelectorAllowlist:u,actionClickAllowlist:c}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===h&&(null===(s=null==l?void 0:l.close)||void 0===s||s.call(l))}})),this.notify({action:"page-loaded"})},t}(),De=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],Ue=["type"],Ve=["svg","path","g"],We=["password","hidden"];var He=function(t){var e;return t?(e=function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(null===i)n+=4;else{var o=Ye(i);n+=o?Array.from(o).length:4}if(n>e)return t.slice(0,r)}return t}(function(t){var e=[];if(!t)return e;e.push(t);for(var n=t.parentElement;n&&"HTML"!==n.tagName;)e.push(n),n=n.parentElement;return e}(t).map((function(t){return function(t){var e,n,r,i,o,c;if(null===t)return null;var l=t.tagName.toLowerCase(),a={tag:l},s=Array.from(null!==(i=null===(r=t.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);s.length&&(a.index=s.indexOf(t),a.indexOfType=s.filter((function(e){return e.tagName===t.tagName})).indexOf(t));var f=null===(c=null===(o=t.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===c?void 0:c.toLowerCase();f&&(a.prevSib=f);var d=t.id;d&&(a.id=d);var h=Array.from(t.classList);h.length&&(a.classes=h);var p={},v=Array.from(t.attributes).filter((function(t){return!De.includes(t.name)})),y=!Ne(t);if(!We.includes(t.type)&&!Ve.includes(l))try{for(var b=u(v),m=b.next();!m.done;m=b.next()){var g=m.value;y&&!Ue.includes(g.name)||(p[g.name]=String(g.value).substring(0,128))}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=b.return)&&n.call(b)}finally{if(e)throw e.error}}return Object.keys(p).length&&(a.attrs=p),a}(t)})),1024),e):[]};function Ye(t,e){void 0===e&&(e=!1);try{if(null==t)return e?"None":null;if("string"==typeof t)return e?(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(t,"'"):t.includes("'")?'"'.concat(t.replace(/'/g,"\\'"),'"'):"'".concat(t,"'"):t;if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var n=t.map((function(t){return Ye(t,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof t){var r=Object.entries(t).filter((function(t){return null!=c(t,1)[0]})).map((function(t){var e=c(t,2),n=e[0],r=e[1];return"".concat(String(Ye(n,!0)),": ").concat(String(Ye(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return t.toString()}catch(t){return null}}function Be(t){var e,n,r,i=t.amplitude,o=t.allObservables,l=t.options,a=t.shouldTrackEvent,s=o.clickObservable,f=s.pipe(B((function(t,e){var n,r=!1;t.subscribe(X(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))})),se((function(t){var e=c(t,2),n=e[0],r=e[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),h=ae(f,s.pipe((e=l.debounceTime,void 0===n&&(n=bt),B((function(t,r){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var t=o;o=null,r.next(t)}};function l(){var t=u+e,o=n.now();if(o<t)return i=this.schedule(void 0,t-o),void r.add(i);c()}t.subscribe(X(r,(function(t){o=t,u=n.now(),i||(i=n.schedule(l,e),r.add(i))}),(function(){c(),r.complete()}),void 0,(function(){o=i=null})))}))),Zt((function(){return"timeout"}))));return s.pipe(he(0),se(ze),se((function(t){return a("click",t.closestTrackedAncestor)})),(r=h,B((function(t,e){var n=[];return t.subscribe(X(e,(function(t){return n.push(t)}),(function(){e.next(n),e.complete()}))),Rt(r).subscribe(X(e,(function(){var t=n;n=[],e.next(t)}),P)),function(){n=null}})))).subscribe((function(t){var e,n,r=(t.length,d);try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value;null==i||i.track(r,l.targetElementProperties,{time:l.timestamp})}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}function Xe(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,u=t.shouldTrackActionClick,a=n.clickObservable,s=n.mutationObservable,f=n.navigateObservable,h=a.pipe(se((function(t){return!o("click",t.closestTrackedAncestor)})),Zt((function(t){var e=Me(t.event.target,r.actionClickAllowlist);return t.closestTrackedAncestor=e,null!==t.closestTrackedAncestor&&(t.targetElementProperties=i(t.type,t.closestTrackedAncestor)),t})),se(ze),se((function(t){return u("click",t.closestTrackedAncestor)}))),p=[s];f&&p.push(f);var v,y,b=ae.apply(void 0,l([],c(p),!1)),m=h.pipe((v=function(t){return b.pipe(fe(1),function(t,e){var n=Xt(t)?{first:t}:"number"==typeof t?{each:t}:t,r=n.first,i=n.each,o=n.with,u=void 0===o?Jt:o,c=n.scheduler,l=void 0===c?null!=e?e:bt:c,a=n.meta,s=void 0===a?null:a;if(null==r&&null==i)throw new TypeError("No timeout provided.");return B((function(t,e){var n,o,c=null,a=0,f=function(t){o=Ut(e,l,(function(){try{n.unsubscribe(),Rt(u({meta:s,lastValue:c,seen:a})).subscribe(e)}catch(t){e.error(t)}}),t)};n=t.subscribe(X(e,(function(t){null==o||o.unsubscribe(),a++,e.next(c=t),i>0&&f(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),c=null}))),!a&&f(null!=r?"number"==typeof r?r:+r-l.now():i)}))}({first:500,with:function(){return Et}}),Zt((function(){return t})))},B((function(t,e){var n=null,r=0,i=!1,o=function(){return i&&!n&&e.complete()};t.subscribe(X(e,(function(t){null==n||n.unsubscribe();var i=0,u=r++;Rt(v(t,u)).subscribe(n=X(e,(function(n){return e.next(y?y(t,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return m.subscribe((function(t){null==e||e.track(d,i("click",t.closestTrackedAncestor),{time:t.timestamp})}))}var Ge,Je=["a","button","input","select","textarea","label","[data-amp-default-track]",".amp-default-track"],Ze=["div","span","h1","h2","h3","h4","h5","h6"],$e="data-amp-track-";!function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable"}(Ge||(Ge={}));var Ke=function(t){var e,n,a;void 0===t&&(t={});var s=t.dataAttributePrefix,f=void 0===s?$e:s,d=t.visualTaggingOptions,b=void 0===d?{enabled:!0,messenger:new Re}:d;t.cssSelectorAllowlist=null!==(e=t.cssSelectorAllowlist)&&void 0!==e?e:Je,t.actionClickAllowlist=null!==(n=t.actionClickAllowlist)&&void 0!==n?n:Ze,t.debounceTime=null!==(a=t.debounceTime)&&void 0!==a?a:0;var g="@amplitude/plugin-autocapture-browser",w=[],_=void 0,x=function(t,e){var n,r,i,o=null===(i=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:null,top:null},c=e.getAttribute("aria-label"),l=function(t,e){return t.getAttributeNames().reduce((function(n,r){if(r.startsWith(e)){var i=r.replace(e,""),o=t.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(e,f),a=Fe(e),s=Ie(e,_),d=((n={})["[Amplitude] Element ID"]=e.id,n["[Amplitude] Element Class"]=e.className,n["[Amplitude] Element Hierarchy"]=He(e),n[h]=o,n[p]=Pe(e),n["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),n["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),n["[Amplitude] Element Aria Label"]=c,n["[Amplitude] Element Attributes"]=l,n[v]=s,n["[Amplitude] Element Parent Label"]=a,n[y]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===o&&"click"===t&&e instanceof HTMLAnchorElement&&(d["[Amplitude] Element Href"]=e.href),je(d)},A=function(e,n){var r={event:e,timestamp:Date.now(),type:n};if(function(t){return"click"===t.type||"change"===t.type}(r)&&null!==r.event.target){var i=Me(r.event.target,t.cssSelectorAllowlist);return i&&(r.closestTrackedAncestor=i,r.targetElementProperties=x(r.type,i)),r}return r};return{name:g,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,a,s,f,d,h,p,v,y,E;return o(this,(function(o){return n?(_=e.loggerProvider,"undefined"==typeof document||(i=Ce(t,t.cssSelectorAllowlist),u=Ce(t,t.actionClickAllowlist),a=function(){var t,e,n=ce(document,"click",{capture:!0}).pipe(Zt((function(t){return A(t,"click")}))),r=ce(document,"change",{capture:!0}).pipe(Zt((function(t){return A(t,"change")})));window.navigation&&(e=ce(window.navigation,"navigate").pipe(Zt((function(t){return A(t,"navigate")}))));var i=new W((function(t){var e=new MutationObserver((function(e){t.next(e)}));return e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}})).pipe(Zt((function(t){return A(t,"mutation")})));return(t={})[Ge.ClickObservable]=n,t[Ge.ChangeObservable]=r,t[Ge.NavigateObservable]=e,t[Ge.MutationObservable]=i,t}(),s=Be({allObservables:a,options:t,amplitude:n,shouldTrackEvent:i}),w.push(s),f=function(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent;return n.changeObservable.pipe(se(ze),se((function(t){return i("change",t.closestTrackedAncestor)}))).subscribe((function(t){null==e||e.track("[Amplitude] Element Changed",r("change",t.closestTrackedAncestor))}))}({allObservables:a,getEventProperties:x,amplitude:n,shouldTrackEvent:i}),w.push(f),d=Xe({allObservables:a,options:t,getEventProperties:x,amplitude:n,shouldTrackEvent:i,shouldTrackActionClick:u}),w.push(d),null===(y=null==e?void 0:e.loggerProvider)||void 0===y||y.log("".concat(g," has been successfully added.")),window.opener&&b.enabled&&(h=t.cssSelectorAllowlist,p=t.actionClickAllowlist,null===(E=b.messenger)||void 0===E||E.setup(r(r({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:m[e.serverZone]}),{isElementSelectable:Ce(t,l(l([],c(h),!1),c(p),!1)),cssSelectorAllowlist:h,actionClickAllowlist:p})))),[2]):(null===(v=null==e?void 0:e.loggerProvider)||void 0===v||v.warn("".concat(g," plugin requires a later version of @amplitude/analytics-browser. Events are not tracked.")),[2])}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(w),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}};return t.DEFAULT_CSS_SELECTOR_ALLOWLIST=Je,t.DEFAULT_DATA_ATTRIBUTE_PREFIX=$e,t.WindowMessenger=Re,t.autocapturePlugin=Ke,t.plugin=Ke,Object.defineProperty(t,"__esModule",{value:!0}),t}({});

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).amplitude={})}(this,(function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(l){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){u.label=c[1];break}if(6===c[0]&&u.label<i[1]){u.label=i[1],i=c;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(c);break}i[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function a(t){return this instanceof a?(this.v=t,this):new a(t)}function s(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=i[t](e)).value instanceof a?Promise.resolve(n.value.v).then(l,s):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function l(t){c("next",t)}function s(t){c("throw",t)}function f(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}}function f(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}var d="[Amplitude] Element Clicked",h="[Amplitude] Element Tag",p="[Amplitude] Element Text",v="[Amplitude] Element Selector",y="[Amplitude] Page URL",b="https://app.amplitude.com",m={US:b,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},g="amp-visual-tagging-selector-highlight";function w(t){return"function"==typeof t}function _(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var x=_((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function A(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var E=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=u(o),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(w(f))try{f()}catch(t){i=t instanceof x?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var h=u(d),p=h.next();!p.done;p=h.next()){var v=p.value;try{T(v)}catch(t){i=null!=i?i:[],t instanceof x?i=l(l([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new x(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)T(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&A(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&A(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),S=E.EMPTY;function k(t){return t instanceof E||t&&"closed"in t&&w(t.remove)&&w(t.add)&&w(t.unsubscribe)}function T(t){w(t)?t():t.unsubscribe()}var C={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},O=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,l([t,e],c(n)))};function N(t){O((function(){throw t}))}function P(){}function I(t){t()}var L=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,k(e)&&e.add(n)):n.destination=R,n}return n(e,t),e.create=function(t,e,n){return new q(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(E),j=Function.prototype.bind;function F(t,e){return j.call(t,e)}var M=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){z(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){z(t)}else z(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){z(t)}},t}(),q=function(t){function e(e,n,r){var i,o,u=t.call(this)||this;w(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&C.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&F(e.next,o),error:e.error&&F(e.error,o),complete:e.complete&&F(e.complete,o)}):i=e;return u.destination=new M(i),u}return n(e,t),e}(L);function z(t){N(t)}var R={closed:!0,next:P,error:function(t){throw t},complete:P},D="function"==typeof Symbol&&Symbol.observable||"@@observable";function U(t){return t}function V(t){return 0===t.length?U:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var W=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof L||function(t){return t&&w(t.next)&&w(t.error)&&w(t.complete)}(r)&&k(r)?t:new q(t,e,n);return I((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=H(e))((function(e,r){var i=new q({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[D]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return V(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=H(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function H(t){var e;return null!==(e=null!=t?t:C.Promise)&&void 0!==e?e:Promise}function Y(t){return w(null==t?void 0:t.lift)}function B(t){return function(e){if(Y(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}function X(t,e,n,r,i){return new G(t,e,n,r,i)}var G=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=u,c._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,c._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return n(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(L);!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Y(e)&&(r.lift=e.lift),r}n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new E;var n=this.getSubject();e.add(this.source.subscribe(X(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=E.EMPTY)}return e},e.prototype.refCount=function(){return B((function(t,e){var n=null;t._refCount++;var r=X(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())}))(this)}}(W);var J,Z={now:function(){return(Z.delegate||performance).now()},delegate:void 0},$={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new E((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,l([],c(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,l([],c(t)))},delegate:void 0};new W((function(t){var e=J||Z,n=e.now(),r=0,i=function(){t.closed||(r=$.requestAnimationFrame((function(o){r=0;var u=e.now();t.next({timestamp:J?u:o,elapsed:u-n}),i()})))};return i(),function(){r&&$.cancelAnimationFrame(r)}}));var K=_((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Q=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n(e,t),e.prototype.lift=function(t){var e=new tt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new K},e.prototype.next=function(t){var e=this;I((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=u(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;I((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;I((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?S:(this.currentObservers=null,o.push(t),new E((function(){e.currentObservers=null,A(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new W;return t.source=this,t},e.create=function(t,e){return new tt(t,e)},e}(W),tt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return n(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:S},e}(Q);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(Q);var et={now:function(){return(et.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=et);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}n(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var u=n.now(),c=0,l=1;l<r.length&&r[l]<=u;l+=2)c=l;c&&r.splice(0,c+1)}}}(Q),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}n(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,u=e.isStopped,c=e._isComplete;n?t.error(o):(u||c)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(Q);var nt,rt=function(t){function e(e,n){return t.call(this)||this}return n(e,t),e.prototype.schedule=function(t,e){return this},e}(E),it=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,l([t,e],c(n)))},ot=function(t){return clearInterval(t)},ut=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n(e,t),e.prototype.schedule=function(t,e){var n;if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),it(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&ot(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,A(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(rt),ct=1,lt={};function at(t){return t in lt&&(delete lt[t],!0)}var st=function(t){var e=ct++;return lt[e]=!0,nt||(nt=Promise.resolve()),nt.then((function(){return at(e)&&t()})),e},ft=function(t){at(t)},dt={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=dt.delegate;return((null==n?void 0:n.setImmediate)||st).apply(void 0,l([],c(t)))},clearImmediate:function(t){return ft(t)},delegate:void 0},ht=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=dt.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(dt.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))},e}(ut),pt=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=et.now,t}(),vt=function(t){function e(e,n){void 0===n&&(n=pt.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(pt),yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new yt(ht);var bt=new vt(ut),mt=bt,gt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.flush(this),0)},e}(ut),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(vt);new wt(gt);var _t=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=$.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&($.cancelAnimationFrame(n),e._scheduled=void 0)},e}(ut),xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new xt(_t),function(t){function e(e,n){void 0===e&&(e=At),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}n(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(vt);var At=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return n(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return E.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(ut),Et=new W((function(t){return t.complete()}));function St(t){return t&&w(t.schedule)}function kt(t){return t[t.length-1]}function Tt(t){return St(kt(t))?t.pop():void 0}function Ct(t,e){return"number"==typeof kt(t)?t.pop():e}var Ot=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Nt(t){return w(null==t?void 0:t.then)}function Pt(t){return w(t[D])}function It(t){return Symbol.asyncIterator&&w(null==t?void 0:t[Symbol.asyncIterator])}function Lt(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var jt,Ft="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Mt(t){return w(null==t?void 0:t[Ft])}function qt(t){return s(this,arguments,(function(){var e,n,r;return o(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,a(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,a(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,a(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function zt(t){return w(null==t?void 0:t.getReader)}function Rt(t){if(t instanceof W)return t;if(null!=t){if(Pt(t))return i=t,new W((function(t){var e=i[D]();if(w(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ot(t))return r=t,new W((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(Nt(t))return n=t,new W((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,N)}));if(It(t))return Dt(t);if(Mt(t))return e=t,new W((function(t){var n,r;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(zt(t))return Dt(qt(t))}var e,n,r,i;throw Lt(t)}function Dt(t){return new W((function(e){(function(t,e){var n,r,u,c;return i(this,void 0,void 0,(function(){var i,l;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),n=f(t),o.label=1;case 1:return[4,n.next()];case 2:if((r=o.sent()).done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=o.sent(),u={error:l},[3,11];case 6:return o.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function Ut(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(o),!i)return o}function Vt(t,e){return void 0===e&&(e=0),B((function(n,r){n.subscribe(X(r,(function(n){return Ut(r,t,(function(){return r.next(n)}),e)}),(function(){return Ut(r,t,(function(){return r.complete()}),e)}),(function(n){return Ut(r,t,(function(){return r.error(n)}),e)})))}))}function Wt(t,e){return void 0===e&&(e=0),B((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function Ht(t,e){if(!t)throw new Error("Iterable cannot be null");return new W((function(n){Ut(n,e,(function(){var r=t[Symbol.asyncIterator]();Ut(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function Yt(t,e){if(null!=t){if(Pt(t))return function(t,e){return Rt(t).pipe(Wt(e),Vt(e))}(t,e);if(Ot(t))return function(t,e){return new W((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(Nt(t))return function(t,e){return Rt(t).pipe(Wt(e),Vt(e))}(t,e);if(It(t))return Ht(t,e);if(Mt(t))return function(t,e){return new W((function(n){var r;return Ut(n,e,(function(){r=t[Ft](),Ut(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return w(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(zt(t))return function(t,e){return Ht(qt(t),e)}(t,e)}throw Lt(t)}function Bt(t,e){return e?Yt(t,e):Rt(t)}function Xt(t){return t instanceof Date&&!isNaN(t)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(jt||(jt={})),_((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),_((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),_((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),_((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}));var Gt=_((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}));function Jt(t){throw new Gt(t)}function Zt(t,e){return B((function(n,r){var i=0;n.subscribe(X(r,(function(n){r.next(t.call(e,n,i++))})))}))}var $t=Array.isArray;function Kt(t){return Zt((function(e){return function(t,e){return $t(e)?t.apply(void 0,l([],c(e))):t(e)}(t,e)}))}function Qt(t,e,n){return void 0===n&&(n=1/0),w(e)?Qt((function(n,r){return Zt((function(t,i){return e(n,t,r,i)}))(Rt(t(n,r)))}),n):("number"==typeof e&&(n=e),B((function(e,r){return function(t,e,n,r,i,o,u,c){var l=[],a=0,s=0,f=!1,d=function(){!f||l.length||a||e.complete()},h=function(t){return a<r?p(t):l.push(t)},p=function(t){o&&e.next(t),a++;var c=!1;Rt(n(t,s++)).subscribe(X(e,(function(t){null==i||i(t),o?h(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{a--;for(var t=function(){var t=l.shift();u?Ut(e,u,(function(){return p(t)})):p(t)};l.length&&a<r;)t();d()}catch(t){e.error(t)}})))};return t.subscribe(X(e,h,(function(){f=!0,d()}))),function(){null==c||c()}}(e,r,t,n)})))}function te(t){return void 0===t&&(t=1/0),Qt(U,t)}function ee(){return te(1)}var ne,re,ie=["addListener","removeListener"],oe=["addEventListener","removeEventListener"],ue=["on","off"];function ce(t,e,n,r){if(w(n)&&(r=n,n=void 0),r)return ce(t,e,n).pipe(Kt(r));var i=c(function(t){return w(t.addEventListener)&&w(t.removeEventListener)}(t)?oe.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return w(t.addListener)&&w(t.removeListener)}(t)?ie.map(le(t,e)):function(t){return w(t.on)&&w(t.off)}(t)?ue.map(le(t,e)):[],2),o=i[0],u=i[1];if(!o&&Ot(t))return Qt((function(t){return ce(t,e,n)}))(Rt(t));if(!o)throw new TypeError("Invalid event target");return new W((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return u(e)}}))}function le(t,e){return function(n){return function(r){return t[n](e,r)}}}function ae(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Tt(t),r=Ct(t,1/0),i=t;return i.length?1===i.length?Rt(i[0]):te(r)(Bt(i,n)):Et}function se(t,e){return B((function(n,r){var i=0;n.subscribe(X(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}function fe(t){return t<=0?function(){return Et}:B((function(e,n){var r=0;e.subscribe(X(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}function de(t,e){return e?function(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ee()(Bt(t,Tt(t)))}(e.pipe(fe(1),B((function(t,e){t.subscribe(X(e,P))}))),n.pipe(de(t)))}:Qt((function(e,n){return Rt(t(e,n)).pipe(fe(1),function(t){return Zt((function(){return t}))}(e))}))}function he(t,e){void 0===e&&(e=bt);var n=function(t,e,n){void 0===t&&(t=0),void 0===n&&(n=mt);var r=-1;return null!=e&&(St(e)?n=e:r=e),new W((function(e){var i=Xt(t)?+t-n.now():t;i<0&&(i=0);var o=0;return n.schedule((function(){e.closed||(e.next(o++),0<=r?this.schedule(void 0,r):e.complete())}),i)}))}(t,e);return de((function(){return n}))}function pe(t,e){if(t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===t.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(t){return!0},className:function(t){return!0},tagName:function(t){return!0},attr:function(t,e){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};ne=r(r({},n),e),re=function(t,e){if(t.nodeType===Node.DOCUMENT_NODE)return t;if(t===e.root)return t.ownerDocument;return t}(ne.root,n);var i=ve(t,"all",(function(){return ve(t,"two",(function(){return ve(t,"one",(function(){return ve(t,"none")}))}))}));if(i){var o=Se(ke(i,t));return o.length>0&&(i=o[0]),be(i)}throw new Error("Selector was not found.")}function ve(t,e,n){for(var r=null,i=[],o=t,a=0,s=function(){var t,s,f=xe(function(t){var e=t.getAttribute("id");if(e&&ne.idName(e))return{name:"#"+CSS.escape(e),penalty:0};return null}(o))||xe.apply(void 0,l([],c(function(t){var e=Array.from(t.attributes).filter((function(t){return ne.attr(t.name,t.value)}));return e.map((function(t){return{name:"[".concat(CSS.escape(t.name),'="').concat(CSS.escape(t.value),'"]'),penalty:.5}}))}(o)),!1))||xe.apply(void 0,l([],c(function(t){var e=Array.from(t.classList).filter(ne.className);return e.map((function(t){return{name:"."+CSS.escape(t),penalty:1}}))}(o)),!1))||xe(function(t){var e=t.tagName.toLowerCase();if(ne.tagName(e))return{name:e,penalty:2};return null}(o))||[{name:"*",penalty:3}],d=function(t){var e=t.parentNode;if(!e)return null;var n=e.firstChild;if(!n)return null;var r=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==t);)n=n.nextSibling;return r}(o);if("all"==e)d&&(f=f.concat(f.filter(_e).map((function(t){return we(t,d)}))));else if("two"==e)f=f.slice(0,1),d&&(f=f.concat(f.filter(_e).map((function(t){return we(t,d)}))));else if("one"==e){var h=c(f=f.slice(0,1),1)[0];d&&_e(h)&&(f=[we(h,d)])}else"none"==e&&(f=[{name:"*",penalty:3}],d&&(f=[we(f[0],d)]));try{for(var p=(t=void 0,u(f)),v=p.next();!v.done;v=p.next()){(h=v.value).level=a}}catch(e){t={error:e}}finally{try{v&&!v.done&&(s=p.return)&&s.call(p)}finally{if(t)throw t.error}}if(i.push(f),i.length>=ne.seedMinLength&&(r=ye(i,n)))return"break";o=o.parentElement,a++};o;){if("break"===s())break}return r||(r=ye(i,n)),!r&&n?n():r}function ye(t,e){var n,r,i=Se(Ee(t));if(i.length>ne.threshold)return e?e():null;try{for(var o=u(i),c=o.next();!c.done;c=o.next()){var l=c.value;if(ge(l))return l}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function be(t){for(var e=t[0],n=e.name,r=1;r<t.length;r++){var i=t[r].level||0;n=e.level===i-1?"".concat(t[r].name," > ").concat(n):"".concat(t[r].name," ").concat(n),e=t[r]}return n}function me(t){return t.map((function(t){return t.penalty})).reduce((function(t,e){return t+e}),0)}function ge(t){var e=be(t);switch(re.querySelectorAll(e).length){case 0:throw new Error("Can't select any node with this selector: ".concat(e));case 1:return!0;default:return!1}}function we(t,e){return{name:t.name+":nth-child(".concat(e,")"),penalty:t.penalty+1}}function _e(t){return"html"!==t.name&&!t.name.startsWith("#")}function xe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Ae);return n.length>0?n:null}function Ae(t){return null!=t}function Ee(t,e){var n,r,i,c,l,a;return void 0===e&&(e=[]),o(this,(function(o){switch(o.label){case 0:if(!(t.length>0))return[3,9];o.label=1;case 1:o.trys.push([1,6,7,8]),n=u(t[0]),r=n.next(),o.label=2;case 2:return r.done?[3,5]:(i=r.value,[5,u(Ee(t.slice(1,t.length),e.concat(i)))]);case 3:o.sent(),o.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return c=o.sent(),l={error:c},[3,8];case 7:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(l)throw l.error}return[7];case 8:return[3,11];case 9:return[4,e];case 10:o.sent(),o.label=11;case 11:return[2]}}))}function Se(t){return l([],c(t),!1).sort((function(t,e){return me(t)-me(e)}))}function ke(t,e,n){var r,i,a;return void 0===n&&(n={counter:0,visited:new Map}),o(this,(function(o){switch(o.label){case 0:if(!(t.length>2&&t.length>ne.optimizedMinLength))return[3,5];r=1,o.label=1;case 1:return r<t.length-1?n.counter>ne.maxNumberOfTries?[2]:(n.counter+=1,(i=l([],c(t),!1)).splice(r,1),a=be(i),n.visited.has(a)?[2]:ge(i)&&function(t,e){return re.querySelector(be(t))===e}(i,e)?[4,i]:[3,4]):[3,5];case 2:return o.sent(),n.visited.set(a,!0),[5,u(ke(i,e,n))];case 3:o.sent(),o.label=4;case 4:return r++,[3,1];case 5:return[2]}}))}new W(P);var Te=["input","select","textarea"],Ce=function(t,e){return function(n,r){var i,o,u,c=t.pageUrlAllowlist,l=t.shouldTrackEventResolver,a=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!a)return!1;if(l)return l(n,r);if(!Le(window.location.href,c))return!1;var s=(null==r?void 0:r.type)||"";if("string"==typeof s)switch(s.toLowerCase()){case"hidden":case"password":return!1}if(e){var f=e.some((function(t){var e;return!!(null===(e=null==r?void 0:r.matches)||void 0===e?void 0:e.call(r,t))}));if(!f)return!1}switch(a){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:var d=null===(u=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===u?void 0:u.call(window,r);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==n)||"click"===n}}},Oe=function(t){if(null==t)return!1;if("string"==typeof t){if(/^(?:(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}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0},Ne=function(t){var e,n,r,i=null===(n=null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),o=t instanceof HTMLElement&&"true"===(null===(r=t.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!Te.includes(i)&&!o},Pe=function(t){var e="";return Ne(t)&&t.childNodes&&t.childNodes.length&&t.childNodes.forEach((function(t){var n,r="";(n=t)&&3===n.nodeType?t.textContent&&(r=t.textContent):r=Pe(t),e+=r.split(/(\s+)/).filter(Oe).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),e},Ie=function(t,e){var n,r,i="";try{return i=pe(t,{className:function(t){return t!==g}})}catch(t){if(e){var o=t;e.warn("Failed to get selector with finder, use fallback strategy instead: ".concat(o.toString()))}}var u=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);if(u&&(i=u),t.id)i="#".concat(t.id);else if(t.className){var c=t.className.split(" ").filter((function(t){return t!==g})).join(".");c&&(i="".concat(i,".").concat(c))}return i},Le=function(t,e){return!e||!e.length||e.some((function(e){return"string"==typeof e?t===e:t.match(e)}))},je=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];return function(t){return null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length}(r)||(e[n]=r),e}),{})},Fe=function(t){var e=t.parentElement;if(!e)return"";var n=e.querySelector(":scope>span,h1,h2,h3,h4,h5,h6");if(n){var r=n.textContent||"";return Oe(r)?r:""}return Fe(e)},Me=function(t,e){return t?e.some((function(e){var n;return null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e)}))?t:Me(null==t?void 0:t.parentElement,e):null},qe=function(t,e){var n,r,i;if(!t)return{};var o=null===(i=null===(r=null==t?void 0:t.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u=Ie(t,e),c=((n={})[h]=o,n[p]=Pe(t),n[v]=u,n[y]=window.location.href.split("?")[0],n);return je(c)};var ze=function(t){return!(null===t.event.target||!t.closestTrackedAncestor)},Re=function(){function t(t){var e=(void 0===t?{}:t).origin,n=void 0===e?b:e,r=this;this.endpoint=b,this.requestCallbacks={},this.onSelect=function(t){r.notify({action:"element-selected",data:t})},this.onTrack=function(t,e){"selector-mode-changed"===t?r.notify({action:"track-selector-mode-changed",data:e}):"selector-moved"===t&&r.notify({action:"track-selector-moved",data:e})},this.endpoint=n}return t.prototype.notify=function(t){var e,n,r,i;null===(n=null===(e=this.logger)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"Message sent: ",JSON.stringify(t)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,t,this.endpoint)},t.prototype.sendRequest=function(t,e,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:t,args:e};return new Promise((function(e,u){r.requestCallbacks[i]={resolve:e,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(new Error("".concat(t," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},t.prototype.handleResponse=function(t){var e;this.requestCallbacks[t.id]?(this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]):null===(e=this.logger)||void 0===e||e.warn("No callback found for request id: ".concat(t.id))},t.prototype.setup=function(t){var e=this,n=void 0===t?{}:t,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,c=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===b&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(t){var n,r,i,a,s;if(null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(t)),e.endpoint===t.origin){var f,d=null==t?void 0:t.data,h=null==d?void 0:d.action;if(h)if("id"in d)null===(a=null===(i=e.logger)||void 0===i?void 0:i.debug)||void 0===a||a.call(i,"Received Response to previous request: ",JSON.stringify(t)),e.handleResponse(d);else if("ping"===h)e.notify({action:"pong"});else if("initialize-visual-tagging-selector"===h){var p=null==d?void 0:d.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(t,e){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){t({status:!0})}),{once:!0}),r.addEventListener("error",(function(){e({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(t){e(t)}}))).then((function(){var t;l=null===(t=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===t?void 0:t.call(window,{getEventTagProps:qe,isElementSelectable:function(t){return!o||o((null==p?void 0:p.actionType)||"click",t)},onTrack:e.onTrack,onSelect:e.onSelect,visualHighlightClass:g,messenger:e,cssSelectorAllowlist:u,actionClickAllowlist:c}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===h&&(null===(s=null==l?void 0:l.close)||void 0===s||s.call(l))}})),this.notify({action:"page-loaded"})},t}(),De=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],Ue=["type"],Ve=["svg","path","g"],We=["password","hidden"];var He=function(t){var e;return t?(e=function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(null===i)n+=4;else{var o=Ye(i);n+=o?Array.from(o).length:4}if(n>e)return t.slice(0,r)}return t}(function(t){var e=[];if(!t)return e;e.push(t);for(var n=t.parentElement;n&&"HTML"!==n.tagName;)e.push(n),n=n.parentElement;return e}(t).map((function(t){return function(t){var e,n,r,i,o,c;if(null===t)return null;var l=t.tagName.toLowerCase(),a={tag:l},s=Array.from(null!==(i=null===(r=t.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);s.length&&(a.index=s.indexOf(t),a.indexOfType=s.filter((function(e){return e.tagName===t.tagName})).indexOf(t));var f=null===(c=null===(o=t.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===c?void 0:c.toLowerCase();f&&(a.prevSib=f);var d=t.id;d&&(a.id=d);var h=Array.from(t.classList);h.length&&(a.classes=h);var p={},v=Array.from(t.attributes).filter((function(t){return!De.includes(t.name)})),y=!Ne(t);if(!We.includes(t.type)&&!Ve.includes(l))try{for(var b=u(v),m=b.next();!m.done;m=b.next()){var g=m.value;y&&!Ue.includes(g.name)||(p[g.name]=String(g.value).substring(0,128))}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=b.return)&&n.call(b)}finally{if(e)throw e.error}}return Object.keys(p).length&&(a.attrs=p),a}(t)})),1024),e):[]};function Ye(t,e){void 0===e&&(e=!1);try{if(null==t)return e?"None":null;if("string"==typeof t)return e?(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(t,"'"):t.includes("'")?'"'.concat(t.replace(/'/g,"\\'"),'"'):"'".concat(t,"'"):t;if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var n=t.map((function(t){return Ye(t,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof t){var r=Object.entries(t).filter((function(t){return null!=c(t,1)[0]})).map((function(t){var e=c(t,2),n=e[0],r=e[1];return"".concat(String(Ye(n,!0)),": ").concat(String(Ye(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return t.toString()}catch(t){return null}}function Be(t){var e,n,r,i=t.amplitude,o=t.allObservables,l=t.options,a=t.shouldTrackEvent,s=o.clickObservable,f=s.pipe(B((function(t,e){var n,r=!1;t.subscribe(X(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))})),se((function(t){var e=c(t,2),n=e[0],r=e[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),h=ae(f,s.pipe((e=l.debounceTime,void 0===n&&(n=bt),B((function(t,r){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var t=o;o=null,r.next(t)}};function l(){var t=u+e,o=n.now();if(o<t)return i=this.schedule(void 0,t-o),void r.add(i);c()}t.subscribe(X(r,(function(t){o=t,u=n.now(),i||(i=n.schedule(l,e),r.add(i))}),(function(){c(),r.complete()}),void 0,(function(){o=i=null})))}))),Zt((function(){return"timeout"}))));return s.pipe(he(0),se(ze),se((function(t){return a("click",t.closestTrackedAncestor)})),(r=h,B((function(t,e){var n=[];return t.subscribe(X(e,(function(t){return n.push(t)}),(function(){e.next(n),e.complete()}))),Rt(r).subscribe(X(e,(function(){var t=n;n=[],e.next(t)}),P)),function(){n=null}})))).subscribe((function(t){var e,n,r=(t.length,d);try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value;null==i||i.track(r,l.targetElementProperties,{time:l.timestamp})}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}function Xe(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,u=t.shouldTrackActionClick,a=n.clickObservable,s=n.mutationObservable,f=n.navigateObservable,h=a.pipe(se((function(t){return!o("click",t.closestTrackedAncestor)})),Zt((function(t){var e=Me(t.event.target,r.actionClickAllowlist);return t.closestTrackedAncestor=e,null!==t.closestTrackedAncestor&&(t.targetElementProperties=i(t.type,t.closestTrackedAncestor)),t})),se(ze),se((function(t){return u("click",t.closestTrackedAncestor)}))),p=[s];f&&p.push(f);var v,y,b=ae.apply(void 0,l([],c(p),!1)),m=h.pipe((v=function(t){return b.pipe(function(t,e){var n=Xt(t)?{first:t}:"number"==typeof t?{each:t}:t,r=n.first,i=n.each,o=n.with,u=void 0===o?Jt:o,c=n.scheduler,l=void 0===c?null!=e?e:bt:c,a=n.meta,s=void 0===a?null:a;if(null==r&&null==i)throw new TypeError("No timeout provided.");return B((function(t,e){var n,o,c=null,a=0,f=function(t){o=Ut(e,l,(function(){try{n.unsubscribe(),Rt(u({meta:s,lastValue:c,seen:a})).subscribe(e)}catch(t){e.error(t)}}),t)};n=t.subscribe(X(e,(function(t){null==o||o.unsubscribe(),a++,e.next(c=t),i>0&&f(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),c=null}))),!a&&f(null!=r?"number"==typeof r?r:+r-l.now():i)}))}({first:500,with:function(){return Et}}),Zt((function(){return t})))},B((function(t,e){var n=null,r=0,i=!1,o=function(){return i&&!n&&e.complete()};t.subscribe(X(e,(function(t){null==n||n.unsubscribe();var i=0,u=r++;Rt(v(t,u)).subscribe(n=X(e,(function(n){return e.next(y?y(t,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return m.subscribe((function(t){null==e||e.track(d,i("click",t.closestTrackedAncestor))}))}var Ge,Je=["a","button","input","select","textarea","label","[data-amp-default-track]",".amp-default-track"],Ze=["div","span","h1","h2","h3","h4","h5","h6"],$e="data-amp-track-";!function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable"}(Ge||(Ge={}));var Ke=function(t){var e,n,a;void 0===t&&(t={});var s=t.dataAttributePrefix,f=void 0===s?$e:s,d=t.visualTaggingOptions,b=void 0===d?{enabled:!0,messenger:new Re}:d;t.cssSelectorAllowlist=null!==(e=t.cssSelectorAllowlist)&&void 0!==e?e:Je,t.actionClickAllowlist=null!==(n=t.actionClickAllowlist)&&void 0!==n?n:Ze,t.debounceTime=null!==(a=t.debounceTime)&&void 0!==a?a:1e3;var g="@amplitude/plugin-autocapture-browser",w=[],_=void 0,x=function(t,e){var n,r,i,o=null===(i=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:null,top:null},c=e.getAttribute("aria-label"),l=function(t,e){return t.getAttributeNames().reduce((function(n,r){if(r.startsWith(e)){var i=r.replace(e,""),o=t.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(e,f),a=Fe(e),s=Ie(e,_),d=((n={})["[Amplitude] Element ID"]=e.id,n["[Amplitude] Element Class"]=e.className,n["[Amplitude] Element Hierarchy"]=He(e),n[h]=o,n[p]=Pe(e),n["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),n["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),n["[Amplitude] Element Aria Label"]=c,n["[Amplitude] Element Attributes"]=l,n[v]=s,n["[Amplitude] Element Parent Label"]=a,n[y]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===o&&"click"===t&&e instanceof HTMLAnchorElement&&(d["[Amplitude] Element Href"]=e.href),je(d)},A=function(e,n){var r={event:e,timestamp:Date.now(),type:n};if(function(t){return"click"===t.type||"change"===t.type}(r)&&null!==r.event.target){var i=Me(r.event.target,t.cssSelectorAllowlist);return i&&(r.closestTrackedAncestor=i,r.targetElementProperties=x(r.type,i)),r}return r};return{name:g,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,a,s,f,d,h,p,v,y,E;return o(this,(function(o){return n?(_=e.loggerProvider,"undefined"==typeof document||(i=Ce(t,t.cssSelectorAllowlist),u=Ce(t,t.actionClickAllowlist),a=function(){var t,e,n=ce(document,"click",{capture:!0}).pipe(Zt((function(t){return A(t,"click")}))),r=ce(document,"change",{capture:!0}).pipe(Zt((function(t){return A(t,"change")})));window.navigation&&(e=ce(window.navigation,"navigate").pipe(Zt((function(t){return A(t,"navigate")}))));var i=new W((function(t){var e=new MutationObserver((function(e){t.next(e)}));return e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}})).pipe(Zt((function(t){return A(t,"mutation")})));return(t={})[Ge.ClickObservable]=n,t[Ge.ChangeObservable]=r,t[Ge.NavigateObservable]=e,t[Ge.MutationObservable]=i,t}(),s=Be({allObservables:a,options:t,amplitude:n,shouldTrackEvent:i}),w.push(s),f=function(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent;return n.changeObservable.pipe(se(ze),se((function(t){return i("change",t.closestTrackedAncestor)}))).subscribe((function(t){null==e||e.track("[Amplitude] Element Changed",r("change",t.closestTrackedAncestor))}))}({allObservables:a,getEventProperties:x,amplitude:n,shouldTrackEvent:i}),w.push(f),d=Xe({allObservables:a,options:t,getEventProperties:x,amplitude:n,shouldTrackEvent:i,shouldTrackActionClick:u}),w.push(d),null===(y=null==e?void 0:e.loggerProvider)||void 0===y||y.log("".concat(g," has been successfully added.")),window.opener&&b.enabled&&(h=t.cssSelectorAllowlist,p=t.actionClickAllowlist,null===(E=b.messenger)||void 0===E||E.setup(r(r({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:m[e.serverZone]}),{isElementSelectable:Ce(t,l(l([],c(h),!1),c(p),!1)),cssSelectorAllowlist:h,actionClickAllowlist:p})))),[2]):(null===(v=null==e?void 0:e.loggerProvider)||void 0===v||v.warn("".concat(g," plugin requires a later version of @amplitude/analytics-browser. Events are not tracked.")),[2])}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(w),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}};t.DEFAULT_CSS_SELECTOR_ALLOWLIST=Je,t.DEFAULT_DATA_ATTRIBUTE_PREFIX=$e,t.WindowMessenger=Re,t.autocapturePlugin=Ke,t.plugin=Ke,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).amplitude={})}(this,(function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(l){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){u.label=c[1];break}if(6===c[0]&&u.label<i[1]){u.label=i[1],i=c;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(c);break}i[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function a(t){return this instanceof a?(this.v=t,this):new a(t)}function s(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))})}function c(t,e){try{(n=i[t](e)).value instanceof a?Promise.resolve(n.value.v).then(l,s):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function l(t){c("next",t)}function s(t){c("throw",t)}function f(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}}function f(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}var d="[Amplitude] Element Clicked",h="[Amplitude] Element Tag",p="[Amplitude] Element Text",v="[Amplitude] Element Selector",y="[Amplitude] Page URL",b="https://app.amplitude.com",m={US:b,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},g="amp-visual-tagging-selector-highlight";function w(t){return"function"==typeof t}function _(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var x=_((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function A(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var E=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=u(o),s=a.next();!s.done;s=a.next()){s.value.remove(this)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(w(f))try{f()}catch(t){i=t instanceof x?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var h=u(d),p=h.next();!p.done;p=h.next()){var v=p.value;try{T(v)}catch(t){i=null!=i?i:[],t instanceof x?i=l(l([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new x(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)T(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&A(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&A(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),S=E.EMPTY;function k(t){return t instanceof E||t&&"closed"in t&&w(t.remove)&&w(t.add)&&w(t.unsubscribe)}function T(t){w(t)?t():t.unsubscribe()}var C={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},O=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,l([t,e],c(n)))};function N(t){O((function(){throw t}))}function P(){}function I(t){t()}var L=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,k(e)&&e.add(n)):n.destination=R,n}return n(e,t),e.create=function(t,e,n){return new q(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(E),j=Function.prototype.bind;function F(t,e){return j.call(t,e)}var M=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){z(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){z(t)}else z(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){z(t)}},t}(),q=function(t){function e(e,n,r){var i,o,u=t.call(this)||this;w(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&C.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&F(e.next,o),error:e.error&&F(e.error,o),complete:e.complete&&F(e.complete,o)}):i=e;return u.destination=new M(i),u}return n(e,t),e}(L);function z(t){N(t)}var R={closed:!0,next:P,error:function(t){throw t},complete:P},D="function"==typeof Symbol&&Symbol.observable||"@@observable";function U(t){return t}function V(t){return 0===t.length?U:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var W=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof L||function(t){return t&&w(t.next)&&w(t.error)&&w(t.complete)}(r)&&k(r)?t:new q(t,e,n);return I((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=H(e))((function(e,r){var i=new q({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[D]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return V(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=H(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function H(t){var e;return null!==(e=null!=t?t:C.Promise)&&void 0!==e?e:Promise}function Y(t){return w(null==t?void 0:t.lift)}function B(t){return function(e){if(Y(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}function X(t,e,n,r,i){return new G(t,e,n,r,i)}var G=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=u,c._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,c._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return n(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(L);!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,Y(e)&&(r.lift=e.lift),r}n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new E;var n=this.getSubject();e.add(this.source.subscribe(X(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=E.EMPTY)}return e},e.prototype.refCount=function(){return B((function(t,e){var n=null;t._refCount++;var r=X(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())}))(this)}}(W);var J,Z={now:function(){return(Z.delegate||performance).now()},delegate:void 0},$={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new E((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,l([],c(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,l([],c(t)))},delegate:void 0};new W((function(t){var e=J||Z,n=e.now(),r=0,i=function(){t.closed||(r=$.requestAnimationFrame((function(o){r=0;var u=e.now();t.next({timestamp:J?u:o,elapsed:u-n}),i()})))};return i(),function(){r&&$.cancelAnimationFrame(r)}}));var K=_((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Q=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n(e,t),e.prototype.lift=function(t){var e=new tt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new K},e.prototype.next=function(t){var e=this;I((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=u(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;I((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;I((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?S:(this.currentObservers=null,o.push(t),new E((function(){e.currentObservers=null,A(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new W;return t.source=this,t},e.create=function(t,e){return new tt(t,e)},e}(W),tt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return n(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:S},e}(Q);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(Q);var et={now:function(){return(et.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=et);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}n(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var u=n.now(),c=0,l=1;l<r.length&&r[l]<=u;l+=2)c=l;c&&r.splice(0,c+1)}}}(Q),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}n(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,u=e.isStopped,c=e._isComplete;n?t.error(o):(u||c)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(Q);var nt,rt=function(t){function e(e,n){return t.call(this)||this}return n(e,t),e.prototype.schedule=function(t,e){return this},e}(E),it=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,l([t,e],c(n)))},ot=function(t){return clearInterval(t)},ut=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n(e,t),e.prototype.schedule=function(t,e){var n;if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),it(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&ot(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,A(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(rt),ct=1,lt={};function at(t){return t in lt&&(delete lt[t],!0)}var st=function(t){var e=ct++;return lt[e]=!0,nt||(nt=Promise.resolve()),nt.then((function(){return at(e)&&t()})),e},ft=function(t){at(t)},dt={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=dt.delegate;return((null==n?void 0:n.setImmediate)||st).apply(void 0,l([],c(t)))},clearImmediate:function(t){return ft(t)},delegate:void 0},ht=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=dt.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(dt.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))},e}(ut),pt=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=et.now,t}(),vt=function(t){function e(e,n){void 0===n&&(n=pt.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(pt),yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new yt(ht);var bt=new vt(ut),mt=bt,gt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.flush(this),0)},e}(ut),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(vt);new wt(gt);var _t=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=$.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&($.cancelAnimationFrame(n),e._scheduled=void 0)},e}(ut),xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(vt);new xt(_t),function(t){function e(e,n){void 0===e&&(e=At),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}n(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(vt);var At=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return n(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return E.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(ut),Et=new W((function(t){return t.complete()}));function St(t){return t&&w(t.schedule)}function kt(t){return t[t.length-1]}function Tt(t){return St(kt(t))?t.pop():void 0}function Ct(t,e){return"number"==typeof kt(t)?t.pop():e}var Ot=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Nt(t){return w(null==t?void 0:t.then)}function Pt(t){return w(t[D])}function It(t){return Symbol.asyncIterator&&w(null==t?void 0:t[Symbol.asyncIterator])}function Lt(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var jt,Ft="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Mt(t){return w(null==t?void 0:t[Ft])}function qt(t){return s(this,arguments,(function(){var e,n,r;return o(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,a(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,a(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,a(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function zt(t){return w(null==t?void 0:t.getReader)}function Rt(t){if(t instanceof W)return t;if(null!=t){if(Pt(t))return i=t,new W((function(t){var e=i[D]();if(w(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ot(t))return r=t,new W((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(Nt(t))return n=t,new W((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,N)}));if(It(t))return Dt(t);if(Mt(t))return e=t,new W((function(t){var n,r;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(zt(t))return Dt(qt(t))}var e,n,r,i;throw Lt(t)}function Dt(t){return new W((function(e){(function(t,e){var n,r,u,c;return i(this,void 0,void 0,(function(){var i,l;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),n=f(t),o.label=1;case 1:return[4,n.next()];case 2:if((r=o.sent()).done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=o.sent(),u={error:l},[3,11];case 6:return o.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function Ut(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(o),!i)return o}function Vt(t,e){return void 0===e&&(e=0),B((function(n,r){n.subscribe(X(r,(function(n){return Ut(r,t,(function(){return r.next(n)}),e)}),(function(){return Ut(r,t,(function(){return r.complete()}),e)}),(function(n){return Ut(r,t,(function(){return r.error(n)}),e)})))}))}function Wt(t,e){return void 0===e&&(e=0),B((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function Ht(t,e){if(!t)throw new Error("Iterable cannot be null");return new W((function(n){Ut(n,e,(function(){var r=t[Symbol.asyncIterator]();Ut(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function Yt(t,e){if(null!=t){if(Pt(t))return function(t,e){return Rt(t).pipe(Wt(e),Vt(e))}(t,e);if(Ot(t))return function(t,e){return new W((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(Nt(t))return function(t,e){return Rt(t).pipe(Wt(e),Vt(e))}(t,e);if(It(t))return Ht(t,e);if(Mt(t))return function(t,e){return new W((function(n){var r;return Ut(n,e,(function(){r=t[Ft](),Ut(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return w(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(zt(t))return function(t,e){return Ht(qt(t),e)}(t,e)}throw Lt(t)}function Bt(t,e){return e?Yt(t,e):Rt(t)}function Xt(t){return t instanceof Date&&!isNaN(t)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(jt||(jt={})),_((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),_((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),_((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),_((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}));var Gt=_((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}));function Jt(t){throw new Gt(t)}function Zt(t,e){return B((function(n,r){var i=0;n.subscribe(X(r,(function(n){r.next(t.call(e,n,i++))})))}))}var $t=Array.isArray;function Kt(t){return Zt((function(e){return function(t,e){return $t(e)?t.apply(void 0,l([],c(e))):t(e)}(t,e)}))}function Qt(t,e,n){return void 0===n&&(n=1/0),w(e)?Qt((function(n,r){return Zt((function(t,i){return e(n,t,r,i)}))(Rt(t(n,r)))}),n):("number"==typeof e&&(n=e),B((function(e,r){return function(t,e,n,r,i,o,u,c){var l=[],a=0,s=0,f=!1,d=function(){!f||l.length||a||e.complete()},h=function(t){return a<r?p(t):l.push(t)},p=function(t){o&&e.next(t),a++;var c=!1;Rt(n(t,s++)).subscribe(X(e,(function(t){null==i||i(t),o?h(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{a--;for(var t=function(){var t=l.shift();u?Ut(e,u,(function(){return p(t)})):p(t)};l.length&&a<r;)t();d()}catch(t){e.error(t)}})))};return t.subscribe(X(e,h,(function(){f=!0,d()}))),function(){null==c||c()}}(e,r,t,n)})))}function te(t){return void 0===t&&(t=1/0),Qt(U,t)}function ee(){return te(1)}var ne,re,ie=["addListener","removeListener"],oe=["addEventListener","removeEventListener"],ue=["on","off"];function ce(t,e,n,r){if(w(n)&&(r=n,n=void 0),r)return ce(t,e,n).pipe(Kt(r));var i=c(function(t){return w(t.addEventListener)&&w(t.removeEventListener)}(t)?oe.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return w(t.addListener)&&w(t.removeListener)}(t)?ie.map(le(t,e)):function(t){return w(t.on)&&w(t.off)}(t)?ue.map(le(t,e)):[],2),o=i[0],u=i[1];if(!o&&Ot(t))return Qt((function(t){return ce(t,e,n)}))(Rt(t));if(!o)throw new TypeError("Invalid event target");return new W((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return u(e)}}))}function le(t,e){return function(n){return function(r){return t[n](e,r)}}}function ae(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Tt(t),r=Ct(t,1/0),i=t;return i.length?1===i.length?Rt(i[0]):te(r)(Bt(i,n)):Et}function se(t,e){return B((function(n,r){var i=0;n.subscribe(X(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}function fe(t){return t<=0?function(){return Et}:B((function(e,n){var r=0;e.subscribe(X(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}function de(t,e){return e?function(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ee()(Bt(t,Tt(t)))}(e.pipe(fe(1),B((function(t,e){t.subscribe(X(e,P))}))),n.pipe(de(t)))}:Qt((function(e,n){return Rt(t(e,n)).pipe(fe(1),function(t){return Zt((function(){return t}))}(e))}))}function he(t,e){void 0===e&&(e=bt);var n=function(t,e,n){void 0===t&&(t=0),void 0===n&&(n=mt);var r=-1;return null!=e&&(St(e)?n=e:r=e),new W((function(e){var i=Xt(t)?+t-n.now():t;i<0&&(i=0);var o=0;return n.schedule((function(){e.closed||(e.next(o++),0<=r?this.schedule(void 0,r):e.complete())}),i)}))}(t,e);return de((function(){return n}))}function pe(t,e){if(t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if("html"===t.tagName.toLowerCase())return"html";var n={root:document.body,idName:function(t){return!0},className:function(t){return!0},tagName:function(t){return!0},attr:function(t,e){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4};ne=r(r({},n),e),re=function(t,e){if(t.nodeType===Node.DOCUMENT_NODE)return t;if(t===e.root)return t.ownerDocument;return t}(ne.root,n);var i=ve(t,"all",(function(){return ve(t,"two",(function(){return ve(t,"one",(function(){return ve(t,"none")}))}))}));if(i){var o=Se(ke(i,t));return o.length>0&&(i=o[0]),be(i)}throw new Error("Selector was not found.")}function ve(t,e,n){for(var r=null,i=[],o=t,a=0,s=function(){var t,s,f=xe(function(t){var e=t.getAttribute("id");if(e&&ne.idName(e))return{name:"#"+CSS.escape(e),penalty:0};return null}(o))||xe.apply(void 0,l([],c(function(t){var e=Array.from(t.attributes).filter((function(t){return ne.attr(t.name,t.value)}));return e.map((function(t){return{name:"[".concat(CSS.escape(t.name),'="').concat(CSS.escape(t.value),'"]'),penalty:.5}}))}(o)),!1))||xe.apply(void 0,l([],c(function(t){var e=Array.from(t.classList).filter(ne.className);return e.map((function(t){return{name:"."+CSS.escape(t),penalty:1}}))}(o)),!1))||xe(function(t){var e=t.tagName.toLowerCase();if(ne.tagName(e))return{name:e,penalty:2};return null}(o))||[{name:"*",penalty:3}],d=function(t){var e=t.parentNode;if(!e)return null;var n=e.firstChild;if(!n)return null;var r=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==t);)n=n.nextSibling;return r}(o);if("all"==e)d&&(f=f.concat(f.filter(_e).map((function(t){return we(t,d)}))));else if("two"==e)f=f.slice(0,1),d&&(f=f.concat(f.filter(_e).map((function(t){return we(t,d)}))));else if("one"==e){var h=c(f=f.slice(0,1),1)[0];d&&_e(h)&&(f=[we(h,d)])}else"none"==e&&(f=[{name:"*",penalty:3}],d&&(f=[we(f[0],d)]));try{for(var p=(t=void 0,u(f)),v=p.next();!v.done;v=p.next()){(h=v.value).level=a}}catch(e){t={error:e}}finally{try{v&&!v.done&&(s=p.return)&&s.call(p)}finally{if(t)throw t.error}}if(i.push(f),i.length>=ne.seedMinLength&&(r=ye(i,n)))return"break";o=o.parentElement,a++};o;){if("break"===s())break}return r||(r=ye(i,n)),!r&&n?n():r}function ye(t,e){var n,r,i=Se(Ee(t));if(i.length>ne.threshold)return e?e():null;try{for(var o=u(i),c=o.next();!c.done;c=o.next()){var l=c.value;if(ge(l))return l}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function be(t){for(var e=t[0],n=e.name,r=1;r<t.length;r++){var i=t[r].level||0;n=e.level===i-1?"".concat(t[r].name," > ").concat(n):"".concat(t[r].name," ").concat(n),e=t[r]}return n}function me(t){return t.map((function(t){return t.penalty})).reduce((function(t,e){return t+e}),0)}function ge(t){var e=be(t);switch(re.querySelectorAll(e).length){case 0:throw new Error("Can't select any node with this selector: ".concat(e));case 1:return!0;default:return!1}}function we(t,e){return{name:t.name+":nth-child(".concat(e,")"),penalty:t.penalty+1}}function _e(t){return"html"!==t.name&&!t.name.startsWith("#")}function xe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Ae);return n.length>0?n:null}function Ae(t){return null!=t}function Ee(t,e){var n,r,i,c,l,a;return void 0===e&&(e=[]),o(this,(function(o){switch(o.label){case 0:if(!(t.length>0))return[3,9];o.label=1;case 1:o.trys.push([1,6,7,8]),n=u(t[0]),r=n.next(),o.label=2;case 2:return r.done?[3,5]:(i=r.value,[5,u(Ee(t.slice(1,t.length),e.concat(i)))]);case 3:o.sent(),o.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return c=o.sent(),l={error:c},[3,8];case 7:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(l)throw l.error}return[7];case 8:return[3,11];case 9:return[4,e];case 10:o.sent(),o.label=11;case 11:return[2]}}))}function Se(t){return l([],c(t),!1).sort((function(t,e){return me(t)-me(e)}))}function ke(t,e,n){var r,i,a;return void 0===n&&(n={counter:0,visited:new Map}),o(this,(function(o){switch(o.label){case 0:if(!(t.length>2&&t.length>ne.optimizedMinLength))return[3,5];r=1,o.label=1;case 1:return r<t.length-1?n.counter>ne.maxNumberOfTries?[2]:(n.counter+=1,(i=l([],c(t),!1)).splice(r,1),a=be(i),n.visited.has(a)?[2]:ge(i)&&function(t,e){return re.querySelector(be(t))===e}(i,e)?[4,i]:[3,4]):[3,5];case 2:return o.sent(),n.visited.set(a,!0),[5,u(ke(i,e,n))];case 3:o.sent(),o.label=4;case 4:return r++,[3,1];case 5:return[2]}}))}new W(P);var Te=["input","select","textarea"],Ce=function(t,e){return function(n,r){var i,o,u,c=t.pageUrlAllowlist,l=t.shouldTrackEventResolver,a=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!a)return!1;if(l)return l(n,r);if(!Le(window.location.href,c))return!1;var s=(null==r?void 0:r.type)||"";if("string"==typeof s)switch(s.toLowerCase()){case"hidden":case"password":return!1}if(e){var f=e.some((function(t){var e;return!!(null===(e=null==r?void 0:r.matches)||void 0===e?void 0:e.call(r,t))}));if(!f)return!1}switch(a){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:var d=null===(u=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===u?void 0:u.call(window,r);return!(!d||"pointer"!==d.getPropertyValue("cursor")||"click"!==n)||"click"===n}}},Oe=function(t){if(null==t)return!1;if("string"==typeof t){if(/^(?:(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}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0},Ne=function(t){var e,n,r,i=null===(n=null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),o=t instanceof HTMLElement&&"true"===(null===(r=t.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!Te.includes(i)&&!o},Pe=function(t){var e="";return Ne(t)&&t.childNodes&&t.childNodes.length&&t.childNodes.forEach((function(t){var n,r="";(n=t)&&3===n.nodeType?t.textContent&&(r=t.textContent):r=Pe(t),e+=r.split(/(\s+)/).filter(Oe).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),e},Ie=function(t,e){var n,r,i="";try{return i=pe(t,{className:function(t){return t!==g}})}catch(t){if(e){var o=t;e.warn("Failed to get selector with finder, use fallback strategy instead: ".concat(o.toString()))}}var u=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n);if(u&&(i=u),t.id)i="#".concat(t.id);else if(t.className){var c=t.className.split(" ").filter((function(t){return t!==g})).join(".");c&&(i="".concat(i,".").concat(c))}return i},Le=function(t,e){return!e||!e.length||e.some((function(e){return"string"==typeof e?t===e:t.match(e)}))},je=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];return function(t){return null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length}(r)||(e[n]=r),e}),{})},Fe=function(t){var e=t.parentElement;if(!e)return"";var n=e.querySelector(":scope>span,h1,h2,h3,h4,h5,h6");if(n){var r=n.textContent||"";return Oe(r)?r:""}return Fe(e)},Me=function(t,e){return t?e.some((function(e){var n;return null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e)}))?t:Me(null==t?void 0:t.parentElement,e):null},qe=function(t,e){var n,r,i;if(!t)return{};var o=null===(i=null===(r=null==t?void 0:t.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u=Ie(t,e),c=((n={})[h]=o,n[p]=Pe(t),n[v]=u,n[y]=window.location.href.split("?")[0],n);return je(c)};var ze=function(t){return!(null===t.event.target||!t.closestTrackedAncestor)},Re=function(){function t(t){var e=(void 0===t?{}:t).origin,n=void 0===e?b:e,r=this;this.endpoint=b,this.requestCallbacks={},this.onSelect=function(t){r.notify({action:"element-selected",data:t})},this.onTrack=function(t,e){"selector-mode-changed"===t?r.notify({action:"track-selector-mode-changed",data:e}):"selector-moved"===t&&r.notify({action:"track-selector-moved",data:e})},this.endpoint=n}return t.prototype.notify=function(t){var e,n,r,i;null===(n=null===(e=this.logger)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"Message sent: ",JSON.stringify(t)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,t,this.endpoint)},t.prototype.sendRequest=function(t,e,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:t,args:e};return new Promise((function(e,u){r.requestCallbacks[i]={resolve:e,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(new Error("".concat(t," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},t.prototype.handleResponse=function(t){var e;this.requestCallbacks[t.id]?(this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]):null===(e=this.logger)||void 0===e||e.warn("No callback found for request id: ".concat(t.id))},t.prototype.setup=function(t){var e=this,n=void 0===t?{}:t,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,c=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===b&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(t){var n,r,i,a,s;if(null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(t)),e.endpoint===t.origin){var f,d=null==t?void 0:t.data,h=null==d?void 0:d.action;if(h)if("id"in d)null===(a=null===(i=e.logger)||void 0===i?void 0:i.debug)||void 0===a||a.call(i,"Received Response to previous request: ",JSON.stringify(t)),e.handleResponse(d);else if("ping"===h)e.notify({action:"pong"});else if("initialize-visual-tagging-selector"===h){var p=null==d?void 0:d.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(t,e){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){t({status:!0})}),{once:!0}),r.addEventListener("error",(function(){e({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(t){e(t)}}))).then((function(){var t;l=null===(t=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===t?void 0:t.call(window,{getEventTagProps:qe,isElementSelectable:function(t){return!o||o((null==p?void 0:p.actionType)||"click",t)},onTrack:e.onTrack,onSelect:e.onSelect,visualHighlightClass:g,messenger:e,cssSelectorAllowlist:u,actionClickAllowlist:c}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===h&&(null===(s=null==l?void 0:l.close)||void 0===s||s.call(l))}})),this.notify({action:"page-loaded"})},t}(),De=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],Ue=["type"],Ve=["svg","path","g"],We=["password","hidden"];var He=function(t){var e;return t?(e=function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(null===i)n+=4;else{var o=Ye(i);n+=o?Array.from(o).length:4}if(n>e)return t.slice(0,r)}return t}(function(t){var e=[];if(!t)return e;e.push(t);for(var n=t.parentElement;n&&"HTML"!==n.tagName;)e.push(n),n=n.parentElement;return e}(t).map((function(t){return function(t){var e,n,r,i,o,c;if(null===t)return null;var l=t.tagName.toLowerCase(),a={tag:l},s=Array.from(null!==(i=null===(r=t.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);s.length&&(a.index=s.indexOf(t),a.indexOfType=s.filter((function(e){return e.tagName===t.tagName})).indexOf(t));var f=null===(c=null===(o=t.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===c?void 0:c.toLowerCase();f&&(a.prevSib=f);var d=t.id;d&&(a.id=d);var h=Array.from(t.classList);h.length&&(a.classes=h);var p={},v=Array.from(t.attributes).filter((function(t){return!De.includes(t.name)})),y=!Ne(t);if(!We.includes(t.type)&&!Ve.includes(l))try{for(var b=u(v),m=b.next();!m.done;m=b.next()){var g=m.value;y&&!Ue.includes(g.name)||(p[g.name]=String(g.value).substring(0,128))}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=b.return)&&n.call(b)}finally{if(e)throw e.error}}return Object.keys(p).length&&(a.attrs=p),a}(t)})),1024),e):[]};function Ye(t,e){void 0===e&&(e=!1);try{if(null==t)return e?"None":null;if("string"==typeof t)return e?(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(t,"'"):t.includes("'")?'"'.concat(t.replace(/'/g,"\\'"),'"'):"'".concat(t,"'"):t;if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var n=t.map((function(t){return Ye(t,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof t){var r=Object.entries(t).filter((function(t){return null!=c(t,1)[0]})).map((function(t){var e=c(t,2),n=e[0],r=e[1];return"".concat(String(Ye(n,!0)),": ").concat(String(Ye(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return t.toString()}catch(t){return null}}function Be(t){var e,n,r,i=t.amplitude,o=t.allObservables,l=t.options,a=t.shouldTrackEvent,s=o.clickObservable,f=s.pipe(B((function(t,e){var n,r=!1;t.subscribe(X(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))})),se((function(t){var e=c(t,2),n=e[0],r=e[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),h=ae(f,s.pipe((e=l.debounceTime,void 0===n&&(n=bt),B((function(t,r){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var t=o;o=null,r.next(t)}};function l(){var t=u+e,o=n.now();if(o<t)return i=this.schedule(void 0,t-o),void r.add(i);c()}t.subscribe(X(r,(function(t){o=t,u=n.now(),i||(i=n.schedule(l,e),r.add(i))}),(function(){c(),r.complete()}),void 0,(function(){o=i=null})))}))),Zt((function(){return"timeout"}))));return s.pipe(he(0),se(ze),se((function(t){return a("click",t.closestTrackedAncestor)})),(r=h,B((function(t,e){var n=[];return t.subscribe(X(e,(function(t){return n.push(t)}),(function(){e.next(n),e.complete()}))),Rt(r).subscribe(X(e,(function(){var t=n;n=[],e.next(t)}),P)),function(){n=null}})))).subscribe((function(t){var e,n,r=(t.length,d);try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value;null==i||i.track(r,l.targetElementProperties,{time:l.timestamp})}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}function Xe(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,u=t.shouldTrackActionClick,a=n.clickObservable,s=n.mutationObservable,f=n.navigateObservable,h=a.pipe(se((function(t){return!o("click",t.closestTrackedAncestor)})),Zt((function(t){var e=Me(t.event.target,r.actionClickAllowlist);return t.closestTrackedAncestor=e,null!==t.closestTrackedAncestor&&(t.targetElementProperties=i(t.type,t.closestTrackedAncestor)),t})),se(ze),se((function(t){return u("click",t.closestTrackedAncestor)}))),p=[s];f&&p.push(f);var v,y,b=ae.apply(void 0,l([],c(p),!1)),m=h.pipe((v=function(t){return b.pipe(fe(1),function(t,e){var n=Xt(t)?{first:t}:"number"==typeof t?{each:t}:t,r=n.first,i=n.each,o=n.with,u=void 0===o?Jt:o,c=n.scheduler,l=void 0===c?null!=e?e:bt:c,a=n.meta,s=void 0===a?null:a;if(null==r&&null==i)throw new TypeError("No timeout provided.");return B((function(t,e){var n,o,c=null,a=0,f=function(t){o=Ut(e,l,(function(){try{n.unsubscribe(),Rt(u({meta:s,lastValue:c,seen:a})).subscribe(e)}catch(t){e.error(t)}}),t)};n=t.subscribe(X(e,(function(t){null==o||o.unsubscribe(),a++,e.next(c=t),i>0&&f(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),c=null}))),!a&&f(null!=r?"number"==typeof r?r:+r-l.now():i)}))}({first:500,with:function(){return Et}}),Zt((function(){return t})))},B((function(t,e){var n=null,r=0,i=!1,o=function(){return i&&!n&&e.complete()};t.subscribe(X(e,(function(t){null==n||n.unsubscribe();var i=0,u=r++;Rt(v(t,u)).subscribe(n=X(e,(function(n){return e.next(y?y(t,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return m.subscribe((function(t){null==e||e.track(d,i("click",t.closestTrackedAncestor),{time:t.timestamp})}))}var Ge,Je=["a","button","input","select","textarea","label","[data-amp-default-track]",".amp-default-track"],Ze=["div","span","h1","h2","h3","h4","h5","h6"],$e="data-amp-track-";!function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable"}(Ge||(Ge={}));var Ke=function(t){var e,n,a;void 0===t&&(t={});var s=t.dataAttributePrefix,f=void 0===s?$e:s,d=t.visualTaggingOptions,b=void 0===d?{enabled:!0,messenger:new Re}:d;t.cssSelectorAllowlist=null!==(e=t.cssSelectorAllowlist)&&void 0!==e?e:Je,t.actionClickAllowlist=null!==(n=t.actionClickAllowlist)&&void 0!==n?n:Ze,t.debounceTime=null!==(a=t.debounceTime)&&void 0!==a?a:0;var g="@amplitude/plugin-autocapture-browser",w=[],_=void 0,x=function(t,e){var n,r,i,o=null===(i=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===i?void 0:i.call(r),u="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:null,top:null},c=e.getAttribute("aria-label"),l=function(t,e){return t.getAttributeNames().reduce((function(n,r){if(r.startsWith(e)){var i=r.replace(e,""),o=t.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(e,f),a=Fe(e),s=Ie(e,_),d=((n={})["[Amplitude] Element ID"]=e.id,n["[Amplitude] Element Class"]=e.className,n["[Amplitude] Element Hierarchy"]=He(e),n[h]=o,n[p]=Pe(e),n["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),n["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),n["[Amplitude] Element Aria Label"]=c,n["[Amplitude] Element Attributes"]=l,n[v]=s,n["[Amplitude] Element Parent Label"]=a,n[y]=window.location.href.split("?")[0],n["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",n["[Amplitude] Viewport Height"]=window.innerHeight,n["[Amplitude] Viewport Width"]=window.innerWidth,n);return"a"===o&&"click"===t&&e instanceof HTMLAnchorElement&&(d["[Amplitude] Element Href"]=e.href),je(d)},A=function(e,n){var r={event:e,timestamp:Date.now(),type:n};if(function(t){return"click"===t.type||"change"===t.type}(r)&&null!==r.event.target){var i=Me(r.event.target,t.cssSelectorAllowlist);return i&&(r.closestTrackedAncestor=i,r.targetElementProperties=x(r.type,i)),r}return r};return{name:g,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,a,s,f,d,h,p,v,y,E;return o(this,(function(o){return n?(_=e.loggerProvider,"undefined"==typeof document||(i=Ce(t,t.cssSelectorAllowlist),u=Ce(t,t.actionClickAllowlist),a=function(){var t,e,n=ce(document,"click",{capture:!0}).pipe(Zt((function(t){return A(t,"click")}))),r=ce(document,"change",{capture:!0}).pipe(Zt((function(t){return A(t,"change")})));window.navigation&&(e=ce(window.navigation,"navigate").pipe(Zt((function(t){return A(t,"navigate")}))));var i=new W((function(t){var e=new MutationObserver((function(e){t.next(e)}));return e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}})).pipe(Zt((function(t){return A(t,"mutation")})));return(t={})[Ge.ClickObservable]=n,t[Ge.ChangeObservable]=r,t[Ge.NavigateObservable]=e,t[Ge.MutationObservable]=i,t}(),s=Be({allObservables:a,options:t,amplitude:n,shouldTrackEvent:i}),w.push(s),f=function(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent;return n.changeObservable.pipe(se(ze),se((function(t){return i("change",t.closestTrackedAncestor)}))).subscribe((function(t){null==e||e.track("[Amplitude] Element Changed",r("change",t.closestTrackedAncestor))}))}({allObservables:a,getEventProperties:x,amplitude:n,shouldTrackEvent:i}),w.push(f),d=Xe({allObservables:a,options:t,getEventProperties:x,amplitude:n,shouldTrackEvent:i,shouldTrackActionClick:u}),w.push(d),null===(y=null==e?void 0:e.loggerProvider)||void 0===y||y.log("".concat(g," has been successfully added.")),window.opener&&b.enabled&&(h=t.cssSelectorAllowlist,p=t.actionClickAllowlist,null===(E=b.messenger)||void 0===E||E.setup(r(r({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:m[e.serverZone]}),{isElementSelectable:Ce(t,l(l([],c(h),!1),c(p),!1)),cssSelectorAllowlist:h,actionClickAllowlist:p})))),[2]):(null===(v=null==e?void 0:e.loggerProvider)||void 0===v||v.warn("".concat(g," plugin requires a later version of @amplitude/analytics-browser. Events are not tracked.")),[2])}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(w),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}};t.DEFAULT_CSS_SELECTOR_ALLOWLIST=Je,t.DEFAULT_DATA_ATTRIBUTE_PREFIX=$e,t.WindowMessenger=Re,t.autocapturePlugin=Ke,t.plugin=Ke,Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -1,2 +0,2 @@

export declare const VERSION = "1.0.0-beta.2";
export declare const VERSION = "1.0.0-beta.3";
//# sourceMappingURL=version.d.ts.map
{
"name": "@amplitude/plugin-autocapture-browser",
"version": "1.0.0-beta.3",
"version": "1.0.0-beta.4",
"description": "",

@@ -61,3 +61,3 @@ "author": "Amplitude Inc",

],
"gitHead": "8f38464162deb357c20d6612ea18a6328ceb2cc0"
"gitHead": "11b7deaee7350badccd49b9bdb08115a5488ccc5"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc