Files
profile/assets/js/vendor/hy-drawer/index.js
Andrey Kuvshinov 8fc8cbae32 add files
2025-07-09 21:21:17 +03:00

34 lines
71 KiB
JavaScript

/*!
* Copyright (c) 2018 Florian Klampfer <https://qwtel.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jQuery")):"function"==typeof define&&define.amd?define("hyDrawer",["jQuery"],e):"object"==typeof exports?exports.hyDrawer=e(require("jQuery")):t.hyDrawer=e(t.jQuery)}(window,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(e,n){e.exports=t},,,function(t,e,n){"use strict";n.r(e);var r=n(0),o=n.n(r),i="undefined"!=typeof Set&&1===new Set([1]).size?Set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(t=t.filter(function(e,n){return n===t.indexOf(e)})).size=t.length,t.has=function(e){return t.indexOf(e)>-1},t.add=function(e){return t.has(e)||(t.size++,t.push(e)),t},t.delete=function(e){var n;return(n=t.has(e))&&(t.size--,t.splice(t.indexOf(e),1)),n},t.clear=function(){for(;t.pop(););t.size=0},t};function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function a(t,e,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var p=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.setupComponent(e,n),this.connectComponent()};function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function b(t,e){return!e||"object"!==h(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){return(v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var w=new i(["customevent"]),_=Symbol||function(t){return"_".concat(t)},g=_("sroot"),S=_("state");window.process=window.process||{},window.process.env=window.process.env||{},window.requestIdleCallback=window.requestIdleCallback||function(t){return window.setTimeout(t,0)},window.cancelIdleCallback=window.cancelIdleCallback||window.clearTimeout;var E=function t(){m(this,t)},O=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E;return function(e){function n(){return m(this,n),b(this,d(n).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(n,t),function(t,e,n){e&&y(t.prototype,e),n&&y(t,n)}(n,[{key:"setupComponent",value:function(t,e){var n=this.constructor.defaults;this[S]=Object.assign({},n,e),this.setupProperties(this),this[g]=this.setupShadowDOM(t)}},{key:"setupShadowDOM",value:function(t){return t}},{key:"connectComponent",value:function(){}},{key:"disconnectComponent",value:function(){}},{key:"adoptComponent",value:function(){}},{key:"getRoot",value:function(){return this[g]}},{key:"getEl",value:function(){return this[g]}},{key:"fireEvent",value:function(t,e){var n=this.constructor.componentName,r=new CustomEvent("".concat(n,"-").concat(t),e);this.el.dispatchEvent(r)}},{key:"setInternalState",value:function(t,e){this[S][t]=e}},{key:"setupProperties",value:function(){var t=this,e=this.constructor.sideEffects;Object.keys(this[S]).forEach(function(n){var r=e[n];t.setupProperty(n,r)})}},{key:"setupProperty",value:function(t,e){var n=this;Object.defineProperty(this,t,{get:function(){return n[S][t]},set:function(r){var o=n[S][t];n.setInternalState(t,r),e&&e.call(n,r,o)},enumerable:!0,configurable:!0})}},{key:"sroot",get:function(){return this.getRoot()}},{key:"el",get:function(){return this.getEl()}}]),n}()};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var j=function(t,e){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function x(t,e){function n(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function T(t){return"function"==typeof t}var P=!1,I={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;P=t},get useDeprecatedSynchronousErrorHandling(){return P}};function k(t){setTimeout(function(){throw t})}var C={closed:!0,next:function(t){},error:function(t){if(I.useDeprecatedSynchronousErrorHandling)throw t;k(t)},complete:function(){}},A=Array.isArray||function(t){return t&&"number"==typeof t.length};function N(t){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t){return null!=t&&"object"===N(t)}var M,D={e:{}};function V(){try{return M.apply(this,arguments)}catch(t){return D.e=t,D}}function X(t){return M=t,V}function Y(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}Y.prototype=Object.create(Error.prototype);var $=Y;function F(t){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var L=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this._parent,r=this._parents,o=this._unsubscribe,i=this._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var u=-1,c=r?r.length:0;n;)n.remove(this),n=++u<c&&r[u]||null;if(T(o))X(o).call(this)===D&&(e=!0,t=t||(D.e instanceof $?q(D.e.errors):[D.e]));if(A(i))for(u=-1,c=i.length;++u<c;){var s=i[u];if(R(s))if(X(s.unsubscribe).call(s)===D){e=!0,t=t||[];var a=D.e;a instanceof $?t=t.concat(q(a.errors)):t.push(a)}}if(e)throw new $(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var n=e;switch(F(e)){case"function":n=new t(e);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this._parent,n=this._parents;e&&e!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function q(t){return t.reduce(function(t,e){return t.concat(e instanceof $?e.errors:e)},[])}var H="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("rxSubscriber"):"@@rxSubscriber";function z(t){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var W=function(t){function e(e,n,r){var o=t.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,o._parentSubscription=null,arguments.length){case 0:o.destination=C;break;case 1:if(!e){o.destination=C;break}if("object"===z(e)){if(function(t){return t instanceof W||"syncErrorThrowable"in t&&t[H]}(e)){var i=e[H]();o.syncErrorThrowable=i.syncErrorThrowable,o.destination=i,i._addParentTeardownLogic(o)}else o.syncErrorThrowable=!0,o.destination=new B(o,e);break}default:o.syncErrorThrowable=!0,o.destination=new B(o,e,n,r)}return o}return x(e,t),e.prototype[H]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t),this._unsubscribeParentSubscription())},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete(),this._unsubscribeParentSubscription())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._addParentTeardownLogic=function(t){this._parentSubscription=this.add(t)},e.prototype._unsubscribeParentSubscription=function(){null!==this._parentSubscription&&this._parentSubscription.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this._parentSubscription=null,this},e}(L),B=function(t){function e(e,n,r,o){var i,u=t.call(this)||this;u._parentSubscriber=e;var c=u;return T(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==C&&(T((c=Object.create(n)).unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=i,u._error=r,u._complete=o,u}return x(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;I.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=I.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):k(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;k(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};I.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),I.useDeprecatedSynchronousErrorHandling)throw t;k(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!I.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return I.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(k(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(W);var U="function"==typeof Symbol&&Symbol.observable||"@@observable";function Q(){}function G(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:Q}var J=function(){function t(t){this._isScalar=!1,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=this.operator,o=function(t,e,n){if(t){if(t instanceof W)return t;if(t[H])return t[H]()}return t||e||n?new W(t,e,n):new W(C)}(t,e,n);if(r?r.call(o,this.source):o._addParentTeardownLogic(this.source||I.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),I.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){I.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=K(e))(function(e,r){var o;o=n.subscribe(function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}},r,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[U]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:G(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=K(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 K(t){if(t||(t=I.Promise||Promise),!t)throw new Error("no Promise impl found");return t}function Z(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}Z.prototype=Object.create(Error.prototype);var tt=Z,et=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return x(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(L),nt=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return x(e,t),e}(W),rt=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return x(e,t),e.prototype[H]=function(){return new nt(this)},e.prototype.lift=function(t){var e=new ot(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new tt;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new tt;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new tt;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new tt;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new tt;return this.hasError?(t.error(this.thrownError),L.EMPTY):this.isStopped?(t.complete(),L.EMPTY):(this.observers.push(t),new et(this,t))},e.prototype.asObservable=function(){var t=new J;return t.source=this,t},e.create=function(t,e){return new ot(t,e)},e}(J),ot=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return x(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):L.EMPTY},e}(rt),it=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 x(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(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;clearInterval(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=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,n){return t.call(this)||this}return x(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(L)),ut=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return x(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)},e}(it),ct=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),st=function(t){function e(n,r){void 0===r&&(r=ct.now);var o=t.call(this,n,function(){return e.delegate&&e.delegate!==o?e.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return x(e,t),e.prototype.schedule=function(n,r,o){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,o):t.prototype.schedule.call(this,n,r,o)},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}(ct),at=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x(e,t),e}(st))(ut),lt=new J(function(t){return t.complete()});function ft(t){return t?function(t){return new J(function(e){return t.schedule(function(){return e.complete()})})}(t):lt}function pt(t){return t&&"function"==typeof t.schedule}var ht=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.closed||e.complete()}};function yt(t,e){return new J(e?function(n){var r=new L,o=0;return r.add(e.schedule(function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()})),r}:ht(t))}function bt(t){var e=new J(function(e){e.next(t),e.complete()});return e._isScalar=!0,e.value=t,e}function dt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];switch(pt(n)?t.pop():n=void 0,t.length){case 0:return ft(n);case 1:return n?yt(t,n):bt(t[0]);default:return yt(t,n)}}function vt(t){var e=t.error;t.subscriber.error(e)}var mt=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return dt(this.value);case"E":return function(t,e){return new J(e?function(n){return e.schedule(vt,0,{error:t,subscriber:n})}:function(e){return e.error(t)})}(this.error);case"C":return ft()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var wt=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new _t(t,this.scheduler,this.delay))},t}(),_t=function(t){function e(e,n,r){void 0===r&&(r=0);var o=t.call(this,e)||this;return o.scheduler=n,o.delay=r,o}return x(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.add(this.scheduler.schedule(e.dispatch,this.delay,new gt(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(mt.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(mt.createError(t))},e.prototype._complete=function(){this.scheduleMessage(mt.createComplete())},e}(W),gt=function(){return function(t,e){this.notification=t,this.destination=e}}(),St=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=r,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return x(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new Et(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=r.length;if(this.closed)throw new tt;if(this.isStopped||this.hasError?e=L.EMPTY:(this.observers.push(t),e=new et(this,t)),o&&t.add(t=new _t(t,o)),n)for(var u=0;u<i&&!t.closed;u++)t.next(r[u]);else for(u=0;u<i&&!t.closed;u++)t.next(r[u].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||at).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,o=r.length,i=0;i<o&&!(t-r[i].time<n);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&r.splice(0,i),r},e}(rt),Et=function(){return function(t,e){this.time=t,this.value=e}}();function Ot(t){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xt(t,e){return!e||"object"!==Ot(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Tt(t,e,n){return(Tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Pt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Pt(t){return(Pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function It(t,e){return(It=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var kt=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),xt(this,Pt(n).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&It(t,e)}(n,t),function(t,e,n){e&&jt(t.prototype,e),n&&jt(t,n)}(n,[{key:"setupComponent",value:function(t,e){var r=this,o={};this.subjects={},this.subjects.disconnect=new rt,this.subjects.document=new St,Object.keys(this.constructor.types).map(function(t){r.subjects[t]=new St(1),o[t]=function(e){return r.subjects[t].next(e)}}),Object.defineProperty(this.constructor,"sideEffects",{get:function(){return o},set:function(){},enumerable:!0,configurable:!0}),Tt(Pt(n.prototype),"setupComponent",this).call(this,t,e)}},{key:"connectComponent",value:function(){var t=this;Tt(Pt(n.prototype),"connectComponent",this).call(this),this.subjects.document.next(document),Object.keys(this.constructor.types).map(function(e){return t.subjects[e].next(t[e])})}},{key:"disconnectComponent",value:function(){Tt(Pt(n.prototype),"disconnectComponent",this).call(this),this.subjects.disconnect.next({})}},{key:"adaptComponent",value:function(){Tt(Pt(n.prototype),"adaptComponent",this).call(this),this.subjects.document.next(document)}}]),n}()},Ct=function(t){return null==t?null:t.trim().replace(/^\[?(.*?)\]?$/,"$1").split(",").map(function(t){return t.trim()})||null};Ct.stringify=function(t){return t&&t.length>0?t.join(","):null};var At=function(t){var e=function(e){if(null==e)return null;var n=Ct(e).map(t);return n.reduce(function(t,e){return t&&null!==e},!0)?n:null};return e.stringify=function(e){var n=e&&e.map&&e.map(t.stringify);return n&&n.reduce(function(t,e){return t&&null!==e},!0)?Ct.stringify(n):null},e},Nt=function(t){if(null==t)return!1;var e=t.trim&&t.trim()||t;return!("false"===e||"null"===e||"undefined"===e||"0"===e||!1===e)};Nt.stringify=function(t){return t?"":null};var Rt=function(t){return null==t?null:Number(t)};Rt.stringify=function(t){return null==t?null:"".concat(t)};var Mt=function(t){var e=function(e){if(null==e)return null;var n=t.indexOf(e);return n>-1?t[n]:null};return e.stringify=function(e){return-1!==t.indexOf(e)?e:null},e},Dt=function(t){if(null==t)return null;var e=(t.trim&&t.trim()||t).match(/^\/?(.*?)(\/([gimy]*))?$/);return new RegExp(e[1],e[3])};Dt.stringify=function(t){return t&&t.toString()||null};var Vt=function(t){return t};Vt.stringify=function(t){return t};var Xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(W),Yt=function(t){function e(e,n,r){var o=t.call(this)||this;return o.parent=e,o.outerValue=n,o.outerIndex=r,o.index=0,o}return x(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(W),$t=function(t){return function(e){return t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,k),e}};var Ft=function(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}(),Lt=function(t){return function(e){for(var n=t[Ft]();;){var r=n.next();if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof n.return&&e.add(function(){n.return&&n.return()}),e}},qt=function(t){return function(e){var n=t[U]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}},Ht=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function zt(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var Wt=function(t){if(t instanceof J)return function(e){return t._isScalar?(e.next(t.value),void e.complete()):t.subscribe(e)};if(t&&"function"==typeof t[U])return qt(t);if(Ht(t))return ht(t);if(zt(t))return $t(t);if(t&&"function"==typeof t[Ft])return Lt(t);var e=R(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function Bt(t,e,n,r,o){if(void 0===o&&(o=new Yt(t,n,r)),!o.closed)return Wt(e)(o)}var Ut={};function Qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null,r=null;return pt(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&A(t[0])&&(t=t[0]),yt(t,r).lift(new Gt(n))}var Gt=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Jt(t,this.resultSelector))},t}(),Jt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return x(e,t),e.prototype._next=function(t){this.values.push(Ut),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Bt(this,r,r,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){var i=this.values,u=i[n],c=this.toRespond?u===Ut?--this.toRespond:this.toRespond:0;i[n]=e,0===c&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Xt);function Kt(t){return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zt(t,e){if(!e)return t instanceof J?t:new J(Wt(t));if(null!=t){if(function(t){return t&&"function"==typeof t[U]}(t))return function(t,e){return new J(e?function(n){var r=new L;return r.add(e.schedule(function(){var o=t[U]();r.add(o.subscribe({next:function(t){r.add(e.schedule(function(){return n.next(t)}))},error:function(t){r.add(e.schedule(function(){return n.error(t)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r}:qt(t))}(t,e);if(zt(t))return function(t,e){return new J(e?function(n){var r=new L;return r.add(e.schedule(function(){return t.then(function(t){r.add(e.schedule(function(){n.next(t),r.add(e.schedule(function(){return n.complete()}))}))},function(t){r.add(e.schedule(function(){return n.error(t)}))})})),r}:$t(t))}(t,e);if(Ht(t))return yt(t,e);if(function(t){return t&&"function"==typeof t[Ft]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new J(e?function(n){var r,o=new L;return o.add(function(){r&&"function"==typeof r.return&&r.return()}),o.add(e.schedule(function(){r=t[Ft](),o.add(e.schedule(function(){if(!n.closed){var t,e;try{var o=r.next();t=o.value,e=o.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}}))})),o}:Lt(t))}(t,e)}throw new TypeError((null!==t&&Kt(t)||t)+" is not observable")}function te(t){return new J(function(e){var n;try{n=t()}catch(t){return void e.error(t)}return(n?Zt(n):ft()).subscribe(e)})}function ee(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new ne(t,e))}}var ne=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new re(t,this.project,this.thisArg))},t}(),re=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return x(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(W);var oe=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new ie(t,this.project,this.concurrent))},t}(),ie=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return x(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new Yt(this,void 0,void 0);this.add(r),Bt(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(Xt);function ue(t){return t}function ce(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),function t(e,n,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof n?function(o){return o.pipe(t(function(t,r){return Zt(e(t,r)).pipe(ee(function(e,o){return n(t,e,r,o)}))},r))}:("number"==typeof n&&(r=n),function(t){return t.lift(new oe(e,r))})}(ue,t)}function se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,o=t[t.length-1];return pt(o)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof J?t[0]:ce(n)(yt(t,r))}var ae=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return x(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(null)})))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(cancelAnimationFrame(n),e.scheduled=void 0)},e}(it),le=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,o=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<o&&(t=n.shift()));if(this.active=!1,e){for(;++r<o&&(t=n.shift());)t.unsubscribe();throw e}},e}(st))(ae);Object.prototype.toString;function fe(t,e,n,r){return T(n)&&(r=n,n=void 0),r?fe(t,e,n).pipe(ee(function(t){return A(t)?r.apply(void 0,t):r(t)})):new J(function(r){!function t(e,n,r,o,i){var u;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var c=e;e.addEventListener(n,r,i),u=function(){return c.removeEventListener(n,r,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var s=e;e.on(n,r),u=function(){return s.off(n,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var a=e;e.addListener(n,r),u=function(){return a.removeListener(n,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var l=0,f=e.length;l<f;l++)t(e[l],n,r,o,i)}o.add(u)}(t,e,function(t){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(t)},r,n)})}var pe=new J(Q);function he(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length||2===t.length&&pt(t[1])?Zt(t[0]):ce(1)(dt.apply(void 0,t))}function ye(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n=t[t.length-1];pt(n)?t.pop():n=null;var r=t.length;return he(1!==r||n?r>0?yt(t,n):ft(n):bt(t[0]),e)}}function be(t){return function(e){return e.lift(new de(t))}}var de=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new ve(t),r=Bt(n,this.notifier);return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),ve=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return x(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(Xt);function me(){return function(t){return t.lift(new we(t))}}var we=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new _e(t,n),o=e.subscribe(r);return r.closed||(r.connection=n.connect()),o},t}(),_e=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return x(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(W),ge=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return x(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.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new L).add(this.source.subscribe(new Ee(this.getSubject(),this))),t.closed?(this._connection=null,t=L.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return me()(this)},e}(J).prototype,Se={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:ge._subscribe},_isComplete:{value:ge._isComplete,writable:!0},getSubject:{value:ge.getSubject},connect:{value:ge.connect},refCount:{value:ge.refCount}},Ee=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return x(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(nt);var Oe=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),o=n(r).subscribe(t);return o.add(e.subscribe(r)),o},t}();function je(){return new rt}function xe(){return function(t){return me()(function(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new Oe(r,e));var o=Object.create(n,Se);return o.source=n,o.subjectFactory=r,o}}(je)(t))}}function Te(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new Pe(r,n))}}var Pe=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new Ie(t,this.observables,this.project))},t}(),Ie=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.observables=n,o.project=r,o.toRespond=[];var i=n.length;o.values=new Array(i);for(var u=0;u<i;u++)o.toRespond.push(u);for(u=0;u<i;u++){var c=n[u];o.add(Bt(o,c,c,u))}return o}return x(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.values[n]=e;var i=this.toRespond;if(i.length>0){var u=i.indexOf(n);-1!==u&&i.splice(u,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Xt);function ke(t,e,n){return function(r){return r.lift(new Ce(t,e,n))}}var Ce=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Ae(t,this.nextOrObserver,this.error,this.complete))},t}(),Ae=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i._tapNext=Q,i._tapError=Q,i._tapComplete=Q,i._tapError=r||Q,i._tapComplete=o||Q,T(n)?(i._context=i,i._tapNext=n):n&&(i._context=n,i._tapNext=n.next||Q,i._tapError=n.error||Q,i._tapComplete=n.complete||Q),i}return x(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(W);var Ne=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Re(t),r=e.subscribe(n);return r.add(Bt(n,this.notifier)),r},t}(),Re=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return x(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,r,o){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(Xt),Me=new st(it);var De=function(){return function(t,e){this.value=t,this.timestamp=e}}();var Ve=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Xe(t))},t}(),Xe=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return x(e,t),e.prototype._next=function(t){this.hasPrev?this.destination.next([this.prev,t]):this.hasPrev=!0,this.prev=t},e}(W);function Ye(t,e){return function(n){return n.lift(new $e(t,e))}}var $e=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Fe(t,this.predicate,this.thisArg))},t}(),Fe=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return x(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(W);function Le(t,e){return"function"==typeof e?function(n){return n.pipe(Le(function(n,r){return Zt(t(n,r)).pipe(ee(function(t,o){return e(n,t,r,o)}))}))}:function(e){return e.lift(new qe(t))}}var qe=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new He(t,this.project))},t}(),He=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return x(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var o=new Yt(this,void 0,void 0);this.add(o),this.innerSubscription=Bt(this,t,e,n,o)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e}(Xt);var ze=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new We(t,this.total))},t}(),We=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return x(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(W);function Be(t,e,n,r,o){return J.create(function(i){var u,c=requestAnimationFrame(function s(a){var l=a-(u=u||a);l<r?(i.next(t(l,e,n,r,o)),c=requestAnimationFrame(s)):(i.next(t(r,e,n,r,o)),c=requestAnimationFrame(function(){return i.complete()}))});return function(){c&&cancelAnimationFrame(c)}})}function Ue(t,e,n,r){return n*Math.sin(t/r*(Math.PI/2))+e}function Qe(t){return Ke(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||Je()}function Ge(t,e){return Ke(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||Je()}function Je(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Ke(t){if(Array.isArray(t))return t}var Ze=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(e){return 0===n.length?e.pipe(Te(t),Ye(function(t){return Ge(t,2)[1]}),ee(function(t){return Ge(t,1)[0]})):e.pipe(Te.apply(void 0,[t].concat(n)),Ye(function(t){return Qe(t).slice(1).every(function(t){return t})}),ee(function(t){return Ge(t,1)[0]}))}};function tn(t){return(tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function en(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function nn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rn(t,e){return!e||"object"!==tn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function on(t){return(on=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function un(t,e){return(un=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var cn=Math.min.bind(Math),sn=Math.max.bind(Math),an=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),rn(this,on(n).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&un(t,e)}(n,t),function(t,e,n){e&&nn(t.prototype,e),n&&nn(t,n)}(n,[{key:"calcIsInRange",value:function(t,e){switch(this.align){case"left":var n=this.range[0],r=this.range[1];return t>n&&(e||t<r);case"right":var o=window.innerWidth-this.range[0],i=window.innerWidth-this.range[1];return t<o&&(e||t>i);default:throw Error()}}},{key:"calcIsSwipe",value:function(t){var e=en(t,4),n=e[0].clientX,r=e[1].clientX,o=e[2],i=e[3];return n!==r||o>0&&o<i}},{key:"calcWillOpen",value:function(t){var e=en(t,5),n=e[2],r=e[3],o=e[4];switch(this.align){case"left":return o>.15||!(o<-.15)&&n>=r/2;case"right":return-o>.15||!(-o<-.15)&&n<=-r/2;default:throw Error()}}},{key:"calcTranslateX",value:function(t,e,n,r){switch(this.align){case"left":return sn(0,cn(r,n+(t-e)));case"right":return cn(0,sn(-r,n+(t-e)));default:throw Error()}}}]),n}()};function ln(t){return(ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pn(t,e){return!e||"object"!==ln(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function hn(t){return(hn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yn(t,e){return(yn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var bn="attributeStyleMap"in Element.prototype&&"CSS"in window&&CSS.number,dn=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),pn(this,hn(n).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yn(t,e)}(n,t),function(t,e,n){e&&fn(t.prototype,e),n&&fn(t,n)}(n,[{key:"histId",value:function(){return this.el.id||this.constructor.componentName}},{key:"prepareInteraction",value:function(){bn?(this.contentEl.attributeStyleMap.set("will-change","transform"),this.scrimEl.attributeStyleMap.set("will-change","opacity")):(this.contentEl.style.willChange="transform",this.scrimEl.style.willChange="opacity"),this.fireEvent("prepare")}},{key:"cleanupInteraction",value:function(t){bn?(this.contentEl.attributeStyleMap.delete("will-change"),this.scrimEl.attributeStyleMap.delete("will-change"),t?this.scrimEl.attributeStyleMap.set("pointer-events",new CSSKeywordValue("all")):this.scrimEl.attributeStyleMap.delete("pointer-events")):(this.scrimEl.style.willChange="",this.contentEl.style.willChange="",this.scrimEl.style.pointerEvents=t?"all":""),this.fireEvent("transitioned",{detail:t})}},{key:"updateDOM",value:function(t,e){this.translateX=t;var n="left"===this.align?1:-1,r=this.opacity=t/e*n;this.moveCallback&&this.moveCallback({translateX:t,opacity:r}),bn?(this.contentEl.attributeStyleMap.set("transform",new CSSTransformValue([new CSSTranslate(CSS.px(t),CSS.px(0))])),this.scrimEl.attributeStyleMap.set("opacity",this.opacity)):(this.contentEl.style.transform="translateX(".concat(t,"px)"),this.scrimEl.style.opacity=this.opacity)}}]),n}()};function vn(t){return function(e){return e.lift(new mn(t))}}var mn=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new wn(t,this.value))},t}(),wn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return x(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(W);function _n(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}_n.prototype=Object.create(Error.prototype);var gn=_n;var Sn=function(){function t(t){if(this.total=t,this.total<0)throw new gn}return t.prototype.call=function(t,e){return e.subscribe(new En(t,this.total))},t}(),En=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return x(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(W);var On=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new jn(t,this.notifier,e))},t}(),jn=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.notifier=n,o.source=r,o.sourceIsBeingSubscribedTo=!0,o}return x(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){this.notifications=new rt;var e=X(this.notifier)(this.notifications);if(e===D)return t.prototype.complete.call(this);this.retries=e,this.retriesSubscription=Bt(this,e)},e}(Xt);var xn=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new Tn(t,this.predicate))},t}(),Tn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return x(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(W);function Pn(t){return(Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function In(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function kn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Cn(t,e){return!e||"object"!==Pn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function An(t){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Nn(t,e){return(Nn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Rn=Math.abs.bind(Math),Mn=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Cn(this,An(n).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Nn(t,e)}(n,t),function(t,e,n){e&&kn(t.prototype,e),n&&kn(t,n)}(n,[{key:"getStartObservable",value:function(){return Qt(this.subjects.document,this.subjects.touchEvents,this.subjects.mouseEvents).pipe(Le(function(t){var e=In(t,3),n=e[0],r=e[1],o=e[2];return se(r?fe(n,"touchstart",{passive:!0}).pipe(Ye(function(t){return 1===t.touches.length}),ee(function(t){return t.touches[0]})):pe,o?fe(n,"mousedown").pipe(ke(function(t){return t.event=t,t})):pe)}))}},{key:"getMoveObservable",value:function(t,e){return Qt(this.subjects.document,this.subjects.touchEvents,this.subjects.mouseEvents,this.subjects.preventDefault).pipe(Le(function(n){var r=In(n,4),o=r[0],i=r[1],u=r[2],c=r[3];return se(i?fe(o,"touchmove",{passive:!c}).pipe(ee(function(t){return t.touches[0].event=t,t.touches[0]})):pe,u?fe(o,"mousemove",{passive:!c}).pipe(function(t){return function(e){return t.pipe(Le(function(t){return t?e:pe}))}}(se(t.pipe(vn(!0)),e.pipe(vn(!1)))),ke(function(t){return t.event=t,t})):pe)}))}},{key:"getEndObservable",value:function(){return Qt(this.subjects.document,this.subjects.touchEvents,this.subjects.mouseEvents).pipe(Le(function(t){var e=In(t,3),n=e[0],r=e[1],o=e[2];return se(r?fe(n,"touchend",{passive:!0}).pipe(Ye(function(t){return 0===t.touches.length}),ee(function(t){return t.changedTouches[0]})):pe,o?fe(n,"mouseup",{passive:!0}):pe)}))}},{key:"getIsSlidingObservable",value:function(t,e,n){return this.getIsSlidingObservable2(t,e).pipe(function(t){return function(e){return 0===t?ft():e.lift(new Sn(t))}}(1),ye(void 0),function(t){return function(e){return e.lift(new On(t))}}(function(){return n}))}},{key:"getIsSlidingObservable2",value:function(t,e){var n=this;return this.threshold?t.pipe(Te(e),function(t){return function(e){return e.lift(new xn(t))}}(function(t){var e=In(t,2),r=e[0],o=r.clientX,i=r.clientY,u=e[1],c=u.clientX,s=u.clientY;return Rn(s-i)<n.threshold&&Rn(c-o)<n.threshold}),ee(function(t){var e=In(t,2),n=e[0],r=n.clientX,o=n.clientY,i=e[1],u=i.clientX,c=i.clientY;return Rn(u-r)>=Rn(c-o)})):t.pipe(Te(e),ee(function(t){var e=In(t,2),r=e[0],o=r.clientX,i=r.clientY,u=r.event,c=e[1],s=c.clientX,a=c.clientY,l=Rn(s-o)>=Rn(a-i);return n.preventDefault&&l&&u.preventDefault(),l}))}}]),n}()};function Dn(t){return(Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yn(t,e){return!e||"object"!==Dn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function $n(t){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Fn(t,e){return(Fn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ln=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),Yn(this,$n(n).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fn(t,e)}(n,Mn(dn(an(t)))),function(t,e,n){e&&Xn(t.prototype,e),n&&Xn(t,n)}(n,[{key:"setupObservables",value:function(){var t=this,e={contentRect:this.contentEl.getBoundingClientRect()},n=("ResizeObserver"in window?function(t){return function(e,n,r){return J.create(function(o){var i=o.next.bind(o),u=new t(function(t){return Array.from(t).forEach(i)},n);return u.observe(e,r),function(){u.unobserve(e)}})}}(ResizeObserver)(this.contentEl).pipe(ye(e)):dt(e)).pipe(be(this.subjects.disconnect),ee(function(t){return t.contentRect.width}),xe(),ye(e.contentRect.width));this._peek$&&(n=Qt(n,this._peek$).pipe(ee(function(t){var e=Vn(t,2);return e[0]-e[1]})));var r=this.subjects.persistent.pipe(ee(function(t){return!t})),o=this.getStartObservable().pipe(be(this.subjects.disconnect),Ze(r),xe()),i=te(function(){return t.translateX$.pipe(ee(function(t){return 0!=t}))}),u=o.pipe(Te(i),ee(function(e){var n=Vn(e,2),r=n[0].clientX,o=n[1];return t.calcIsInRange(r,o)}),ke(function(e){e&&(t.mouseEvents&&t.contentEl.classList.add("hy-drawer-grabbing"),t.prepareInteraction())}),xe()),c=this.getEndObservable().pipe(be(this.subjects.disconnect),Ze(r,u),xe()),s=this.getMoveObservable(o,c).pipe(be(this.subjects.disconnect),Ze(r,u),xe()),a=this.getIsSlidingObservable(s,o,c).pipe(ke(function(e){e&&t.fireEvent("slidestart",{detail:t.opened})}));this.translateX$=te(function(){return se(t.tween$,s.pipe(Ze(a),ke(function(e){var n=e.event;return t.preventDefault&&n.preventDefault()}),Te(o,t.startTranslateX$,n),function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new wt(t,e))}}(le),ee(function(e){var n=Vn(e,4),r=n[0].clientX,o=n[1].clientX,i=n[2],u=n[3];return t.calcTranslateX(r,o,i,u)})),Qt(t.subjects.opened,t.subjects.align,n).pipe(ke(function(e){var n=Vn(e,1)[0];return t.cleanupInteraction(n)}),ee(function(t){var e=Vn(t,3),n=e[0],r=e[1],o=e[2];return n?o*("left"===r?1:-1):0})))}).pipe(be(this.subjects.disconnect),xe()),this.startTranslateX$=this.translateX$.pipe(function(t){return function(e){return e.lift(new Ne(t))}}(o));var l=this.translateX$.pipe(function(t){return void 0===t&&(t=Me),ee(function(e){return new De(e,t.now())})}(),function(t){return t.lift(new Ve)},Ye(function(t){var e=Vn(t,2),n=e[0].timestamp;return e[1].timestamp-n>0}),ee(function(t){var e=Vn(t,2),n=e[0],r=n.value,o=n.timestamp,i=e[1];return(i.value-r)/(i.timestamp-o)}),ye(0)),f=se(c.pipe(ke(function(){return t.contentEl.classList.remove("hy-drawer-grabbing")}),Te(o,this.translateX$,n,l),Ye(this.calcIsSwipe.bind(this)),ee(this.calcWillOpen.bind(this)),ke(function(e){return t.fireEvent("slideend",{detail:e})})),this.animateTo$.pipe(ke(this.prepareInteraction.bind(this))));this.tween$=f.pipe(ke(function(e){return t.setInternalState("opened",e)}),Te(this.translateX$,n),Le(function(e){var n=Vn(e,3),r=n[0],i=n[1],u=n[2],c="left"===t.align?1:-1;return Be(Ue,i,(r?u*c:0)-i,200+.15*u).pipe(ke({complete:function(){return t.subjects.opened.next(r)}}),be(o),be(t.subjects.align.pipe(function(t){return function(e){return e.lift(new ze(t))}}(1))),xe())})),this.translateX$.pipe(Te(n)).subscribe(function(e){var n=Vn(e,2),r=n[0],o=n[1];return t.updateDOM(r,o)}),fe(this.scrimEl,"click").pipe(be(this.subjects.disconnect)).subscribe(function(){return t.close()}),r.pipe(be(this.subjects.disconnect)).subscribe(function(e){t.scrimEl.style.display=e?"block":"none"}),this.subjects.align.pipe(be(this.subjects.disconnect)).subscribe(function(e){t.contentEl.classList.remove("hy-drawer-left"),t.contentEl.classList.remove("hy-drawer-right"),t.contentEl.classList.add("hy-drawer-".concat(e))}),this.subjects.mouseEvents.pipe(be(this.subjects.disconnect),Le(function(e){return e?t.contentEl.classList.add("hy-drawer-grab"):t.contentEl.classList.remove("hy-drawer-grab"),e?o.pipe(Te(u)):pe})).subscribe(function(t){var e=Vn(t,2),n=e[0].event;return e[1]&&n&&n.preventDefault()}),this.fireEvent("init",{detail:this.opened})}}]),n}()};function qn(t){return(qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function zn(t,e){return!e||"object"!==qn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Wn(t,e,n){return(Wn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Bn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function Bn(t){return(Bn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Un(t,e){return(Un=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Qn=new i(function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(w).concat(["eventlistener","queryselector","requestanimationframe","classlist","opacity","csstransforms","csspointerevents"])),Gn=function(t){return function(e){function n(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),zn(this,Bn(n).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Un(t,e)}(n,Ln(kt(O(t)))),function(t,e,n){e&&Hn(t.prototype,e),n&&Hn(t,n)}(n,[{key:"setupComponent",value:function(t,e){Wn(Bn(n.prototype),"setupComponent",this).call(this,t,e),this.animateTo$=new rt,this.scrimEl=this.sroot.querySelector(".hy-drawer-scrim"),this.contentEl=this.sroot.querySelector(".hy-drawer-content"),this.contentEl.classList.add("hy-drawer-".concat(this.align))}},{key:"connectComponent",value:function(){this.setupObservables(),Wn(Bn(n.prototype),"connectComponent",this).call(this)}},{key:"open",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.animateTo$.next(!0):this.opened=!0}},{key:"close",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.animateTo$.next(!1):this.opened=!1}},{key:"toggle",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.animateTo$.next(!this.opened):this.opened=!this.opened}}],[{key:"componentName",get:function(){return"hy-drawer"}},{key:"types",get:function(){return{opened:Nt,align:Mt(["left","right"]),persistent:Nt,range:At(Rt),threshold:Rt,preventDefault:Nt,touchEvents:Nt,mouseEvents:Nt}}},{key:"defaults",get:function(){return{opened:!1,align:"left",persistent:!1,range:[0,100],threshold:10,preventDefault:!1,touchEvents:!1,mouseEvents:!1}}}]),n}()};function Jn(t){return(Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Zn(t,e){return!e||"object"!==Jn(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function tr(t){return(tr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function er(t,e){return(er=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"JQUERY_FEATURE_TESTS",function(){return nr}),n.d(e,"Set",function(){return i});var nr=new i(function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(Qn));nr.delete("customevent"),function(t,e){var n=t.toLowerCase(),r=function(t){function r(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),s(this,l(r).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(r,e),function(t,e,n){e&&c(t.prototype,e),n&&c(t,n)}(r,[{key:"setupShadowDOM",value:function(t){return this.$element=a(l(r.prototype),"setupShadowDOM",this).call(this,o()(t)),this.$element[0]}},{key:"fireEvent",value:function(t,e){var r=o.a.Event("".concat(t,".").concat(n),e);this.$element.trigger(r)}}]),r}(),i=n.split(".").pop(),p=o.a.fn[i];o.a.fn[i]=function(t,i){for(var c=arguments.length,s=new Array(c>2?c-2:0),a=2;a<c;a++)s[a-2]=arguments[a];var l="string"==typeof t?t:null;return this.each(function(){var c=o()(this),a=c.data(n);if(a)l&&"function"==typeof a[l]?a[l].apply(a,[i].concat(s)):"object"===u(t)&&t&&o.a.extend(a,t);else{var f=e.defaults,p=e.types,h=c.data();Object.keys(f).forEach(function(t){if(h[t]){var n=function(t,e){return t?t(e):e}(p[t],h[t]);h[t]=null!=n?n:e.defaults[t]}});var y=o.a.extend({},h,"object"===u(t)&&t);c.data(n,new r(this,y))}})},o.a.fn[i].Constructor=r,o.a.fn[i].noConflict=function(){return o.a.fn[i]=p,this}}("hy.drawer",function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Zn(this,tr(e).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&er(t,e)}(e,Gn(p)),function(t,e,n){e&&Kn(t.prototype,e),n&&Kn(t,n)}(e,[{key:"setupShadowDOM",value:function(t){var e=t.children().detach();return t.append(o()('<div class="hy-drawer-scrim" />')).append(o()('<div class="hy-drawer-content" />').append(e)),t}}]),e}())}])});
//# sourceMappingURL=index.js.map