ngx-store-9
Version:
Angular decorators to automagically keep variables in HTML5 LocalStorage, SessionStorage, cookies; injectable services for managing and listening to data changes and a bit more.
1 lines • 70.2 kB
JavaScript
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("ngx-store",["exports","@angular/core"],factory):factory((global=global||self)["ngx-store"]={},global.ng.core)}(this,function(exports,core){"use strict";var extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])})(d,b)};function __extends(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}function isFunction(x){return"function"==typeof x}var _enable_super_gross_mode_that_will_cause_bad_things=!1,config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value&&(new Error).stack;_enable_super_gross_mode_that_will_cause_bad_things=value},get useDeprecatedSynchronousErrorHandling(){return _enable_super_gross_mode_that_will_cause_bad_things}};function hostReportError(err){setTimeout(function(){throw err},0)}var empty={closed:!0,next:function(value){},error:function(err){if(config.useDeprecatedSynchronousErrorHandling)throw err;hostReportError(err)},complete:function(){}},isArray=function(){return Array.isArray||function(x){return x&&"number"==typeof x.length}}();function isObject(x){return null!==x&&"object"==typeof x}var UnsubscriptionError=function(){function UnsubscriptionErrorImpl(errors){return Error.call(this),this.message=errors?errors.length+" errors occurred during unsubscription:\n"+errors.map(function(err,i){return i+1+") "+err.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=errors,this}return UnsubscriptionErrorImpl.prototype=Object.create(Error.prototype),UnsubscriptionErrorImpl}(),Subscription=function(){function Subscription(unsubscribe){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,unsubscribe&&(this._unsubscribe=unsubscribe)}var empty;return Subscription.prototype.unsubscribe=function(){var errors;if(!this.closed){var _parentOrParents=this._parentOrParents,_unsubscribe=this._unsubscribe,_subscriptions=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,_parentOrParents instanceof Subscription)_parentOrParents.remove(this);else if(null!==_parentOrParents)for(var index=0;index<_parentOrParents.length;++index){_parentOrParents[index].remove(this)}if(isFunction(_unsubscribe))try{_unsubscribe.call(this)}catch(e){errors=e instanceof UnsubscriptionError?flattenUnsubscriptionErrors(e.errors):[e]}if(isArray(_subscriptions)){index=-1;for(var len=_subscriptions.length;++index<len;){var sub=_subscriptions[index];if(isObject(sub))try{sub.unsubscribe()}catch(e){errors=errors||[],e instanceof UnsubscriptionError?errors=errors.concat(flattenUnsubscriptionErrors(e.errors)):errors.push(e)}}}if(errors)throw new UnsubscriptionError(errors)}},Subscription.prototype.add=function(teardown){var subscription=teardown;if(!teardown)return Subscription.EMPTY;switch(typeof teardown){case"function":subscription=new Subscription(teardown);case"object":if(subscription===this||subscription.closed||"function"!=typeof subscription.unsubscribe)return subscription;if(this.closed)return subscription.unsubscribe(),subscription;if(!(subscription instanceof Subscription)){var tmp=subscription;(subscription=new Subscription)._subscriptions=[tmp]}break;default:throw new Error("unrecognized teardown "+teardown+" added to Subscription.")}var _parentOrParents=subscription._parentOrParents;if(null===_parentOrParents)subscription._parentOrParents=this;else if(_parentOrParents instanceof Subscription){if(_parentOrParents===this)return subscription;subscription._parentOrParents=[_parentOrParents,this]}else{if(-1!==_parentOrParents.indexOf(this))return subscription;_parentOrParents.push(this)}var subscriptions=this._subscriptions;return null===subscriptions?this._subscriptions=[subscription]:subscriptions.push(subscription),subscription},Subscription.prototype.remove=function(subscription){var subscriptions=this._subscriptions;if(subscriptions){var subscriptionIndex=subscriptions.indexOf(subscription);-1!==subscriptionIndex&&subscriptions.splice(subscriptionIndex,1)}},Subscription.EMPTY=((empty=new Subscription).closed=!0,empty),Subscription}();function flattenUnsubscriptionErrors(errors){return errors.reduce(function(errs,err){return errs.concat(err instanceof UnsubscriptionError?err.errors:err)},[])}var rxSubscriber=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),Subscriber=function(_super){function Subscriber(destinationOrNext,error,complete){var _this=_super.call(this)||this;switch(_this.syncErrorValue=null,_this.syncErrorThrown=!1,_this.syncErrorThrowable=!1,_this.isStopped=!1,arguments.length){case 0:_this.destination=empty;break;case 1:if(!destinationOrNext){_this.destination=empty;break}if("object"==typeof destinationOrNext){destinationOrNext instanceof Subscriber?(_this.syncErrorThrowable=destinationOrNext.syncErrorThrowable,(_this.destination=destinationOrNext).add(_this)):(_this.syncErrorThrowable=!0,_this.destination=new SafeSubscriber(_this,destinationOrNext));break}default:_this.syncErrorThrowable=!0,_this.destination=new SafeSubscriber(_this,destinationOrNext,error,complete)}return _this}return __extends(Subscriber,_super),Subscriber.prototype[rxSubscriber]=function(){return this},Subscriber.create=function(next,error,complete){var subscriber=new Subscriber(next,error,complete);return subscriber.syncErrorThrowable=!1,subscriber},Subscriber.prototype.next=function(value){this.isStopped||this._next(value)},Subscriber.prototype.error=function(err){this.isStopped||(this.isStopped=!0,this._error(err))},Subscriber.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},Subscriber.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,_super.prototype.unsubscribe.call(this))},Subscriber.prototype._next=function(value){this.destination.next(value)},Subscriber.prototype._error=function(err){this.destination.error(err),this.unsubscribe()},Subscriber.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},Subscriber.prototype._unsubscribeAndRecycle=function(){var _parentOrParents=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=_parentOrParents,this},Subscriber}(Subscription),SafeSubscriber=function(_super){function SafeSubscriber(_parentSubscriber,observerOrNext,error,complete){var next,_this=_super.call(this)||this;_this._parentSubscriber=_parentSubscriber;var context=_this;return isFunction(observerOrNext)?next=observerOrNext:observerOrNext&&(next=observerOrNext.next,error=observerOrNext.error,complete=observerOrNext.complete,observerOrNext!==empty&&(isFunction((context=Object.create(observerOrNext)).unsubscribe)&&_this.add(context.unsubscribe.bind(context)),context.unsubscribe=_this.unsubscribe.bind(_this))),_this._context=context,_this._next=next,_this._error=error,_this._complete=complete,_this}return __extends(SafeSubscriber,_super),SafeSubscriber.prototype.next=function(value){if(!this.isStopped&&this._next){var _parentSubscriber=this._parentSubscriber;config.useDeprecatedSynchronousErrorHandling&&_parentSubscriber.syncErrorThrowable?this.__tryOrSetError(_parentSubscriber,this._next,value)&&this.unsubscribe():this.__tryOrUnsub(this._next,value)}},SafeSubscriber.prototype.error=function(err){if(!this.isStopped){var _parentSubscriber=this._parentSubscriber,useDeprecatedSynchronousErrorHandling=config.useDeprecatedSynchronousErrorHandling;if(this._error)useDeprecatedSynchronousErrorHandling&&_parentSubscriber.syncErrorThrowable?this.__tryOrSetError(_parentSubscriber,this._error,err):this.__tryOrUnsub(this._error,err),this.unsubscribe();else if(_parentSubscriber.syncErrorThrowable)useDeprecatedSynchronousErrorHandling?(_parentSubscriber.syncErrorValue=err,_parentSubscriber.syncErrorThrown=!0):hostReportError(err),this.unsubscribe();else{if(this.unsubscribe(),useDeprecatedSynchronousErrorHandling)throw err;hostReportError(err)}}},SafeSubscriber.prototype.complete=function(){var _this=this;if(!this.isStopped){var _parentSubscriber=this._parentSubscriber;if(this._complete){var wrappedComplete=function(){return _this._complete.call(_this._context)};config.useDeprecatedSynchronousErrorHandling&&_parentSubscriber.syncErrorThrowable?this.__tryOrSetError(_parentSubscriber,wrappedComplete):this.__tryOrUnsub(wrappedComplete),this.unsubscribe()}else this.unsubscribe()}},SafeSubscriber.prototype.__tryOrUnsub=function(fn,value){try{fn.call(this._context,value)}catch(err){if(this.unsubscribe(),config.useDeprecatedSynchronousErrorHandling)throw err;hostReportError(err)}},SafeSubscriber.prototype.__tryOrSetError=function(parent,fn,value){if(!config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{fn.call(this._context,value)}catch(err){return config.useDeprecatedSynchronousErrorHandling?(parent.syncErrorValue=err,parent.syncErrorThrown=!0):(hostReportError(err),!0)}return!1},SafeSubscriber.prototype._unsubscribe=function(){var _parentSubscriber=this._parentSubscriber;this._context=null,this._parentSubscriber=null,_parentSubscriber.unsubscribe()},SafeSubscriber}(Subscriber);var observable=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function identity(x){return x}var Observable=function(){function Observable(subscribe){this._isScalar=!1,subscribe&&(this._subscribe=subscribe)}return Observable.prototype.lift=function(operator){var observable=new Observable;return observable.source=this,observable.operator=operator,observable},Observable.prototype.subscribe=function(observerOrNext,error,complete){var operator=this.operator,sink=function(nextOrObserver,error,complete){if(nextOrObserver){if(nextOrObserver instanceof Subscriber)return nextOrObserver;if(nextOrObserver[rxSubscriber])return nextOrObserver[rxSubscriber]()}return nextOrObserver||error||complete?new Subscriber(nextOrObserver,error,complete):new Subscriber(empty)}(observerOrNext,error,complete);if(operator?sink.add(operator.call(sink,this.source)):sink.add(this.source||config.useDeprecatedSynchronousErrorHandling&&!sink.syncErrorThrowable?this._subscribe(sink):this._trySubscribe(sink)),config.useDeprecatedSynchronousErrorHandling&&sink.syncErrorThrowable&&(sink.syncErrorThrowable=!1,sink.syncErrorThrown))throw sink.syncErrorValue;return sink},Observable.prototype._trySubscribe=function(sink){try{return this._subscribe(sink)}catch(err){config.useDeprecatedSynchronousErrorHandling&&(sink.syncErrorThrown=!0,sink.syncErrorValue=err),!function(observer){for(;observer;){var closed_1=observer.closed,destination=observer.destination,isStopped=observer.isStopped;if(closed_1||isStopped)return;observer=destination&&destination instanceof Subscriber?destination:null}return 1}(sink)?console.warn(err):sink.error(err)}},Observable.prototype.forEach=function(next,promiseCtor){var _this=this;return new(promiseCtor=getPromiseCtor(promiseCtor))(function(resolve,reject){var subscription;subscription=_this.subscribe(function(value){try{next(value)}catch(err){reject(err),subscription&&subscription.unsubscribe()}},reject,resolve)})},Observable.prototype._subscribe=function(subscriber){var source=this.source;return source&&source.subscribe(subscriber)},Observable.prototype[observable]=function(){return this},Observable.prototype.pipe=function(){for(var fns,operations=[],_i=0;_i<arguments.length;_i++)operations[_i]=arguments[_i];return 0===operations.length?this:(0===(fns=operations).length?identity:1===fns.length?fns[0]:function(input){return fns.reduce(function(prev,fn){return fn(prev)},input)})(this)},Observable.prototype.toPromise=function(promiseCtor){var _this=this;return new(promiseCtor=getPromiseCtor(promiseCtor))(function(resolve,reject){var value;_this.subscribe(function(x){return value=x},function(err){return reject(err)},function(){return resolve(value)})})},Observable.create=function(subscribe){return new Observable(subscribe)},Observable}();function getPromiseCtor(promiseCtor){if(!(promiseCtor=promiseCtor||Promise))throw new Error("no Promise impl found");return promiseCtor}var ObjectUnsubscribedError=function(){function ObjectUnsubscribedErrorImpl(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return ObjectUnsubscribedErrorImpl.prototype=Object.create(Error.prototype),ObjectUnsubscribedErrorImpl}(),SubjectSubscription=function(_super){function SubjectSubscription(subject,subscriber){var _this=_super.call(this)||this;return _this.subject=subject,_this.subscriber=subscriber,_this.closed=!1,_this}return __extends(SubjectSubscription,_super),SubjectSubscription.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var subject=this.subject,observers=subject.observers;if(this.subject=null,observers&&0!==observers.length&&!subject.isStopped&&!subject.closed){var subscriberIndex=observers.indexOf(this.subscriber);-1!==subscriberIndex&&observers.splice(subscriberIndex,1)}}},SubjectSubscription}(Subscription),SubjectSubscriber=function(_super){function SubjectSubscriber(destination){var _this=_super.call(this,destination)||this;return _this.destination=destination,_this}return __extends(SubjectSubscriber,_super),SubjectSubscriber}(Subscriber),Subject=function(_super){function Subject(){var _this=_super.call(this)||this;return _this.observers=[],_this.closed=!1,_this.isStopped=!1,_this.hasError=!1,_this.thrownError=null,_this}return __extends(Subject,_super),Subject.prototype[rxSubscriber]=function(){return new SubjectSubscriber(this)},Subject.prototype.lift=function(operator){var subject=new AnonymousSubject(this,this);return subject.operator=operator,subject},Subject.prototype.next=function(value){if(this.closed)throw new ObjectUnsubscribedError;if(!this.isStopped)for(var observers=this.observers,len=observers.length,copy=observers.slice(),i=0;i<len;i++)copy[i].next(value)},Subject.prototype.error=function(err){if(this.closed)throw new ObjectUnsubscribedError;this.hasError=!0,this.thrownError=err,this.isStopped=!0;for(var observers=this.observers,len=observers.length,copy=observers.slice(),i=0;i<len;i++)copy[i].error(err);this.observers.length=0},Subject.prototype.complete=function(){if(this.closed)throw new ObjectUnsubscribedError;this.isStopped=!0;for(var observers=this.observers,len=observers.length,copy=observers.slice(),i=0;i<len;i++)copy[i].complete();this.observers.length=0},Subject.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},Subject.prototype._trySubscribe=function(subscriber){if(this.closed)throw new ObjectUnsubscribedError;return _super.prototype._trySubscribe.call(this,subscriber)},Subject.prototype._subscribe=function(subscriber){if(this.closed)throw new ObjectUnsubscribedError;return this.hasError?(subscriber.error(this.thrownError),Subscription.EMPTY):this.isStopped?(subscriber.complete(),Subscription.EMPTY):(this.observers.push(subscriber),new SubjectSubscription(this,subscriber))},Subject.prototype.asObservable=function(){var observable=new Observable;return observable.source=this,observable},Subject.create=function(destination,source){return new AnonymousSubject(destination,source)},Subject}(Observable),AnonymousSubject=function(_super){function AnonymousSubject(destination,source){var _this=_super.call(this)||this;return _this.destination=destination,_this.source=source,_this}return __extends(AnonymousSubject,_super),AnonymousSubject.prototype.next=function(value){var destination=this.destination;destination&&destination.next&&destination.next(value)},AnonymousSubject.prototype.error=function(err){var destination=this.destination;destination&&destination.error&&this.destination.error(err)},AnonymousSubject.prototype.complete=function(){var destination=this.destination;destination&&destination.complete&&this.destination.complete()},AnonymousSubject.prototype._subscribe=function(subscriber){return this.source?this.source.subscribe(subscriber):Subscription.EMPTY},AnonymousSubject}(Subject),AsyncAction=function(_super){function AsyncAction(scheduler,work){var _this=_super.call(this,scheduler,work)||this;return _this.scheduler=scheduler,_this.work=work,_this.pending=!1,_this}return __extends(AsyncAction,_super),AsyncAction.prototype.schedule=function(state,delay){if(void 0===delay&&(delay=0),this.closed)return this;this.state=state;var id=this.id,scheduler=this.scheduler;return null!=id&&(this.id=this.recycleAsyncId(scheduler,id,delay)),this.pending=!0,this.delay=delay,this.id=this.id||this.requestAsyncId(scheduler,this.id,delay),this},AsyncAction.prototype.requestAsyncId=function(scheduler,id,delay){return void 0===delay&&(delay=0),setInterval(scheduler.flush.bind(scheduler,this),delay)},AsyncAction.prototype.recycleAsyncId=function(scheduler,id,delay){if(void 0===delay&&(delay=0),null!==delay&&this.delay===delay&&!1===this.pending)return id;clearInterval(id)},AsyncAction.prototype.execute=function(state,delay){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var error=this._execute(state,delay);if(error)return error;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},AsyncAction.prototype._execute=function(state,delay){var errored=!1,errorValue=void 0;try{this.work(state)}catch(e){errored=!0,errorValue=!!e&&e||new Error(e)}if(errored)return this.unsubscribe(),errorValue},AsyncAction.prototype._unsubscribe=function(){var id=this.id,scheduler=this.scheduler,actions=scheduler.actions,index=actions.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==index&&actions.splice(index,1),null!=id&&(this.id=this.recycleAsyncId(scheduler,id,null)),this.delay=null},AsyncAction}(function(_super){function Action(scheduler,work){return _super.call(this)||this}return __extends(Action,_super),Action.prototype.schedule=function(state,delay){return this},Action}(Subscription)),Scheduler=function(){function Scheduler(SchedulerAction,now){void 0===now&&(now=Scheduler.now),this.SchedulerAction=SchedulerAction,this.now=now}return Scheduler.prototype.schedule=function(work,delay,state){return void 0===delay&&(delay=0),new this.SchedulerAction(this,work).schedule(state,delay)},Scheduler.now=function(){return Date.now()},Scheduler}(),AsyncScheduler=function(_super){function AsyncScheduler(SchedulerAction,now){void 0===now&&(now=Scheduler.now);var _this=_super.call(this,SchedulerAction,function(){return AsyncScheduler.delegate&&AsyncScheduler.delegate!==_this?AsyncScheduler.delegate.now():now()})||this;return _this.actions=[],_this.active=!1,_this.scheduled=void 0,_this}return __extends(AsyncScheduler,_super),AsyncScheduler.prototype.schedule=function(work,delay,state){return void 0===delay&&(delay=0),AsyncScheduler.delegate&&AsyncScheduler.delegate!==this?AsyncScheduler.delegate.schedule(work,delay,state):_super.prototype.schedule.call(this,work,delay,state)},AsyncScheduler.prototype.flush=function(action){var actions=this.actions;if(this.active)actions.push(action);else{var error;this.active=!0;do{if(error=action.execute(action.state,action.delay))break}while(action=actions.shift());if(this.active=!1,error){for(;action=actions.shift();)action.unsubscribe();throw error}}},AsyncScheduler}(Scheduler),EMPTY=new Observable(function(subscriber){return subscriber.complete()});function empty$1(scheduler){return scheduler?function(scheduler){return new Observable(function(subscriber){return scheduler.schedule(function(){return subscriber.complete()})})}(scheduler):EMPTY}function isScheduler(value){return value&&"function"==typeof value.schedule}var subscribeToArray=function(array){return function(subscriber){for(var i=0,len=array.length;i<len&&!subscriber.closed;i++)subscriber.next(array[i]);subscriber.complete()}};function scheduleArray(input,scheduler){return new Observable(function(subscriber){var sub=new Subscription,i=0;return sub.add(scheduler.schedule(function(){i!==input.length?(subscriber.next(input[i++]),subscriber.closed||sub.add(this.schedule())):subscriber.complete()})),sub})}function fromArray(input,scheduler){return scheduler?scheduleArray(input,scheduler):new Observable(subscribeToArray(input))}function dispatch(_a){var error=_a.error;_a.subscriber.error(error)}var Notification=function(){function Notification(kind,value,error){this.kind=kind,this.value=value,this.error=error,this.hasValue="N"===kind}return Notification.prototype.observe=function(observer){switch(this.kind){case"N":return observer.next&&observer.next(this.value);case"E":return observer.error&&observer.error(this.error);case"C":return observer.complete&&observer.complete()}},Notification.prototype.do=function(next,error,complete){switch(this.kind){case"N":return next&&next(this.value);case"E":return error&&error(this.error);case"C":return complete&&complete()}},Notification.prototype.accept=function(nextOrObserver,error,complete){return nextOrObserver&&"function"==typeof nextOrObserver.next?this.observe(nextOrObserver):this.do(nextOrObserver,error,complete)},Notification.prototype.toObservable=function(){var error,scheduler;switch(this.kind){case"N":return function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];var scheduler=args[args.length-1];return isScheduler(scheduler)?(args.pop(),scheduleArray(args,scheduler)):fromArray(args)}(this.value);case"E":return error=this.error,new Observable(scheduler?function(subscriber){return scheduler.schedule(dispatch,0,{error:error,subscriber:subscriber})}:function(subscriber){return subscriber.error(error)});case"C":return empty$1()}throw new Error("unexpected notification kind value")},Notification.createNext=function(value){return void 0!==value?new Notification("N",value):Notification.undefinedValueNotification},Notification.createError=function(err){return new Notification("E",void 0,err)},Notification.createComplete=function(){return Notification.completeNotification},Notification.completeNotification=new Notification("C"),Notification.undefinedValueNotification=new Notification("N",void 0),Notification}(),async=new AsyncScheduler(AsyncAction);function map(project,thisArg){return function(source){if("function"!=typeof project)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return source.lift(new MapOperator(project,thisArg))}}var MapOperator=function(){function MapOperator(project,thisArg){this.project=project,this.thisArg=thisArg}return MapOperator.prototype.call=function(subscriber,source){return source.subscribe(new MapSubscriber(subscriber,this.project,this.thisArg))},MapOperator}(),MapSubscriber=function(_super){function MapSubscriber(destination,project,thisArg){var _this=_super.call(this,destination)||this;return _this.project=project,_this.count=0,_this.thisArg=thisArg||_this,_this}return __extends(MapSubscriber,_super),MapSubscriber.prototype._next=function(value){var result;try{result=this.project.call(this.thisArg,value,this.count++)}catch(err){return void this.destination.error(err)}this.destination.next(result)},MapSubscriber}(Subscriber),OuterSubscriber=function(_super){function OuterSubscriber(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(OuterSubscriber,_super),OuterSubscriber.prototype.notifyNext=function(outerValue,innerValue,outerIndex,innerIndex,innerSub){this.destination.next(innerValue)},OuterSubscriber.prototype.notifyError=function(error,innerSub){this.destination.error(error)},OuterSubscriber.prototype.notifyComplete=function(innerSub){this.destination.complete()},OuterSubscriber}(Subscriber),InnerSubscriber=function(_super){function InnerSubscriber(parent,outerValue,outerIndex){var _this=_super.call(this)||this;return _this.parent=parent,_this.outerValue=outerValue,_this.outerIndex=outerIndex,_this.index=0,_this}return __extends(InnerSubscriber,_super),InnerSubscriber.prototype._next=function(value){this.parent.notifyNext(this.outerValue,value,this.outerIndex,this.index++,this)},InnerSubscriber.prototype._error=function(error){this.parent.notifyError(error,this),this.unsubscribe()},InnerSubscriber.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},InnerSubscriber}(Subscriber);function getSymbolIterator(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var iterator=getSymbolIterator(),isArrayLike=function(x){return x&&"number"==typeof x.length&&"function"!=typeof x};function isPromise(value){return value&&"function"!=typeof value.subscribe&&"function"==typeof value.then}var subscribeTo=function(result){if(result&&"function"==typeof result[observable])return obj=result,function(subscriber){var obs=obj[observable]();if("function"!=typeof obs.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return obs.subscribe(subscriber)};if(isArrayLike(result))return subscribeToArray(result);if(isPromise(result))return promise=result,function(subscriber){return promise.then(function(value){subscriber.closed||(subscriber.next(value),subscriber.complete())},function(err){return subscriber.error(err)}).then(null,hostReportError),subscriber};if(result&&"function"==typeof result[iterator])return iterable=result,function(subscriber){for(var iterator$1=iterable[iterator]();;){var item=iterator$1.next();if(item.done){subscriber.complete();break}if(subscriber.next(item.value),subscriber.closed)break}return"function"==typeof iterator$1.return&&subscriber.add(function(){iterator$1.return&&iterator$1.return()}),subscriber};var iterable,promise,obj,value=isObject(result)?"an invalid object":"'"+result+"'";throw new TypeError("You provided "+value+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function scheduled(input,scheduler){if(null!=input){if(function(input){return input&&"function"==typeof input[observable]}(input))return function(input,scheduler){return new Observable(function(subscriber){var sub=new Subscription;return sub.add(scheduler.schedule(function(){var observable$1=input[observable]();sub.add(observable$1.subscribe({next:function(value){sub.add(scheduler.schedule(function(){return subscriber.next(value)}))},error:function(err){sub.add(scheduler.schedule(function(){return subscriber.error(err)}))},complete:function(){sub.add(scheduler.schedule(function(){return subscriber.complete()}))}}))})),sub})}(input,scheduler);if(isPromise(input))return function(input,scheduler){return new Observable(function(subscriber){var sub=new Subscription;return sub.add(scheduler.schedule(function(){return input.then(function(value){sub.add(scheduler.schedule(function(){subscriber.next(value),sub.add(scheduler.schedule(function(){return subscriber.complete()}))}))},function(err){sub.add(scheduler.schedule(function(){return subscriber.error(err)}))})})),sub})}(input,scheduler);if(isArrayLike(input))return scheduleArray(input,scheduler);if(function(input){return input&&"function"==typeof input[iterator]}(input)||"string"==typeof input)return function(input,scheduler){if(!input)throw new Error("Iterable cannot be null");return new Observable(function(subscriber){var iterator$1,sub=new Subscription;return sub.add(function(){iterator$1&&"function"==typeof iterator$1.return&&iterator$1.return()}),sub.add(scheduler.schedule(function(){iterator$1=input[iterator](),sub.add(scheduler.schedule(function(){if(!subscriber.closed){var value,done;try{var result=iterator$1.next();value=result.value,done=result.done}catch(err){return void subscriber.error(err)}done?subscriber.complete():(subscriber.next(value),this.schedule())}}))})),sub})}(input,scheduler)}throw new TypeError((null!==input&&typeof input||input)+" is not observable")}function mergeMap(project,resultSelector,concurrent){return void 0===concurrent&&(concurrent=Number.POSITIVE_INFINITY),"function"==typeof resultSelector?function(source){return source.pipe(mergeMap(function(a,i){return input=project(a,i),(scheduler?scheduled(input,scheduler):input instanceof Observable?input:new Observable(subscribeTo(input))).pipe(map(function(b,ii){return resultSelector(a,b,i,ii)}));var input,scheduler},concurrent))}:("number"==typeof resultSelector&&(concurrent=resultSelector),function(source){return source.lift(new MergeMapOperator(project,concurrent))})}var MergeMapOperator=function(){function MergeMapOperator(project,concurrent){void 0===concurrent&&(concurrent=Number.POSITIVE_INFINITY),this.project=project,this.concurrent=concurrent}return MergeMapOperator.prototype.call=function(observer,source){return source.subscribe(new MergeMapSubscriber(observer,this.project,this.concurrent))},MergeMapOperator}(),MergeMapSubscriber=function(_super){function MergeMapSubscriber(destination,project,concurrent){void 0===concurrent&&(concurrent=Number.POSITIVE_INFINITY);var _this=_super.call(this,destination)||this;return _this.project=project,_this.concurrent=concurrent,_this.hasCompleted=!1,_this.buffer=[],_this.active=0,_this.index=0,_this}return __extends(MergeMapSubscriber,_super),MergeMapSubscriber.prototype._next=function(value){this.active<this.concurrent?this._tryNext(value):this.buffer.push(value)},MergeMapSubscriber.prototype._tryNext=function(value){var result,index=this.index++;try{result=this.project(value,index)}catch(err){return void this.destination.error(err)}this.active++,this._innerSub(result,value,index)},MergeMapSubscriber.prototype._innerSub=function(ish,value,index){var innerSubscriber=new InnerSubscriber(this,value,index),destination=this.destination;destination.add(innerSubscriber);var innerSubscription=function(outerSubscriber,result,outerValue,outerIndex,innerSubscriber){if(void 0===innerSubscriber&&(innerSubscriber=new InnerSubscriber(outerSubscriber,outerValue,outerIndex)),!innerSubscriber.closed)return result instanceof Observable?result.subscribe(innerSubscriber):subscribeTo(result)(innerSubscriber)}(this,ish,void 0,void 0,innerSubscriber);innerSubscription!==innerSubscriber&&destination.add(innerSubscription)},MergeMapSubscriber.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},MergeMapSubscriber.prototype.notifyNext=function(outerValue,innerValue,outerIndex,innerIndex,innerSub){this.destination.next(innerValue)},MergeMapSubscriber.prototype.notifyComplete=function(innerSub){var buffer=this.buffer;this.remove(innerSub),this.active--,0<buffer.length?this._next(buffer.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},MergeMapSubscriber}(OuterSubscriber);function fromEvent(target,eventName,options,resultSelector){return isFunction(options)&&(resultSelector=options,options=void 0),resultSelector?fromEvent(target,eventName,options).pipe(map(function(args){return isArray(args)?resultSelector.apply(void 0,args):resultSelector(args)})):new Observable(function(subscriber){!function setupSubscription(sourceObj,eventName,handler,subscriber,options){var unsubscribe;if(isEventTarget(sourceObj)){var source_1=sourceObj;sourceObj.addEventListener(eventName,handler,options),unsubscribe=function(){return source_1.removeEventListener(eventName,handler,options)}}else if(isJQueryStyleEventEmitter(sourceObj)){var source_2=sourceObj;sourceObj.on(eventName,handler),unsubscribe=function(){return source_2.off(eventName,handler)}}else if(isNodeStyleEventEmitter(sourceObj)){var source_3=sourceObj;sourceObj.addListener(eventName,handler),unsubscribe=function(){return source_3.removeListener(eventName,handler)}}else{if(!sourceObj||!sourceObj.length)throw new TypeError("Invalid event target");for(var i=0,len=sourceObj.length;i<len;i++)setupSubscription(sourceObj[i],eventName,handler,subscriber,options)}subscriber.add(unsubscribe)}(target,eventName,function(e){1<arguments.length?subscriber.next(Array.prototype.slice.call(arguments)):subscriber.next(e)},subscriber,options)})}function isNodeStyleEventEmitter(sourceObj){return sourceObj&&"function"==typeof sourceObj.addListener&&"function"==typeof sourceObj.removeListener}function isJQueryStyleEventEmitter(sourceObj){return sourceObj&&"function"==typeof sourceObj.on&&"function"==typeof sourceObj.off}function isEventTarget(sourceObj){return sourceObj&&"function"==typeof sourceObj.addEventListener&&"function"==typeof sourceObj.removeEventListener}function interval(period,scheduler){var val;return void 0===period&&(period=0),void 0===scheduler&&(scheduler=async),!isArray(val=period)&&0<=val-parseFloat(val)+1&&!(period<0)||(period=0),scheduler&&"function"==typeof scheduler.schedule||(scheduler=async),new Observable(function(subscriber){return subscriber.add(scheduler.schedule(dispatch$1,period,{subscriber:subscriber,counter:0,period:period})),subscriber})}function dispatch$1(state){var subscriber=state.subscriber,counter=state.counter,period=state.period;subscriber.next(counter),this.schedule({subscriber:subscriber,counter:counter+1,period:period},period)}function merge(){for(var observables=[],_i=0;_i<arguments.length;_i++)observables[_i]=arguments[_i];var concurrent=Number.POSITIVE_INFINITY,scheduler=null,last=observables[observables.length-1];return isScheduler(last)?(scheduler=observables.pop(),1<observables.length&&"number"==typeof observables[observables.length-1]&&(concurrent=observables.pop())):"number"==typeof last&&(concurrent=observables.pop()),null===scheduler&&1===observables.length&&observables[0]instanceof Observable?observables[0]:function(concurrent){return void 0===concurrent&&(concurrent=Number.POSITIVE_INFINITY),mergeMap(identity,concurrent)}(concurrent)(fromArray(observables,scheduler))}function filter(predicate,thisArg){return function(source){return source.lift(new FilterOperator(predicate,thisArg))}}var FilterOperator=function(){function FilterOperator(predicate,thisArg){this.predicate=predicate,this.thisArg=thisArg}return FilterOperator.prototype.call=function(subscriber,source){return source.subscribe(new FilterSubscriber(subscriber,this.predicate,this.thisArg))},FilterOperator}(),FilterSubscriber=function(_super){function FilterSubscriber(destination,predicate,thisArg){var _this=_super.call(this,destination)||this;return _this.predicate=predicate,_this.thisArg=thisArg,_this.count=0,_this}return __extends(FilterSubscriber,_super),FilterSubscriber.prototype._next=function(value){var result;try{result=this.predicate.call(this.thisArg,value,this.count++)}catch(err){return void this.destination.error(err)}result&&this.destination.next(value)},FilterSubscriber}(Subscriber),Debugger=function(){function Debugger(console,isEnabled,prefix){void 0===isEnabled&&(isEnabled=!0),void 0===prefix&&(prefix=""),this.prefix="",this.console=console,this.isEnabled=isEnabled,this.prefix=prefix}return Object.defineProperty(Debugger.prototype,"memory",{get:function(){return this.doIfEnabled(function(){return console.hasOwnProperty("memory")&&console.memory})},enumerable:!0,configurable:!0}),Debugger.prototype.assert=function(value,message){for(var _this=this,optionalParams=[],_i=2;_i<arguments.length;_i++)optionalParams[_i-2]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).assert.apply(_a,[value,message].concat(optionalParams))})},Debugger.prototype.countReset=function(label){var _this=this;return this.doIfEnabled(function(){return _this.console.countReset(label)})},Debugger.prototype.dir=function(obj){for(var _this=this,options=[],_i=1;_i<arguments.length;_i++)options[_i-1]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).dir.apply(_a,[obj].concat(options))})},Debugger.prototype.error=function(message){for(var _this=this,optionalParams=[],_i=1;_i<arguments.length;_i++)optionalParams[_i-1]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).error.apply(_a,[_this.addPrefix(message)].concat(optionalParams))})},Debugger.prototype.info=function(message){for(var _this=this,optionalParams=[],_i=1;_i<arguments.length;_i++)optionalParams[_i-1]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).info.apply(_a,[_this.addPrefix(message)].concat(optionalParams))})},Debugger.prototype.log=function(message){for(var _this=this,optionalParams=[],_i=1;_i<arguments.length;_i++)optionalParams[_i-1]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).log.apply(_a,[_this.addPrefix(message)].concat(optionalParams))})},Debugger.prototype.time=function(label){var _this=this;return this.doIfEnabled(function(){return _this.console.time(label)})},Debugger.prototype.timeEnd=function(label){var _this=this;return this.doIfEnabled(function(){return _this.console.timeEnd(label)})},Debugger.prototype.timeLog=function(label){for(var _this=this,data=[],_i=1;_i<arguments.length;_i++)data[_i-1]=arguments[_i];return this.doIfEnabled(function(){return _this.console.timeLog(label,data)})},Debugger.prototype.timeStamp=function(label){var _this=this;return this.doIfEnabled(function(){return _this.console.timeStamp(label)})},Debugger.prototype.timeline=function(label){var _this=this;return this.doIfEnabled(function(){return _this.console.timeline(label)})},Debugger.prototype.timelineEnd=function(label){var _this=this;return this.doIfEnabled(function(){return _this.console.timelineEnd(label)})},Debugger.prototype.trace=function(message){for(var _this=this,optionalParams=[],_i=1;_i<arguments.length;_i++)optionalParams[_i-1]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).trace.apply(_a,[_this.addPrefix(message)].concat(optionalParams))})},Debugger.prototype.warn=function(message){for(var _this=this,optionalParams=[],_i=1;_i<arguments.length;_i++)optionalParams[_i-1]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).warn.apply(_a,[_this.addPrefix(message)].concat(optionalParams))})},Debugger.prototype.clear=function(){var _this=this;return this.doIfEnabled(function(){return _this.console.clear()})},Debugger.prototype.count=function(countTitle){var _this=this;return this.doIfEnabled(function(){return _this.console.count()})},Debugger.prototype.debug=function(message){for(var _this=this,optionalParams=[],_i=1;_i<arguments.length;_i++)optionalParams[_i-1]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).debug.apply(_a,[_this.addPrefix(message)].concat(optionalParams))})},Debugger.prototype.dirxml=function(value){var _this=this;return this.doIfEnabled(function(){return _this.console.dirxml(value)})},Debugger.prototype.exception=function(message){for(var _this=this,optionalParams=[],_i=1;_i<arguments.length;_i++)optionalParams[_i-1]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).exception.apply(_a,[_this.addPrefix(message)].concat(optionalParams))})},Debugger.prototype.group=function(groupTitle){var _this=this;return this.doIfEnabled(function(){return _this.console.group(groupTitle)})},Debugger.prototype.groupCollapsed=function(groupTitle){var _this=this;return this.doIfEnabled(function(){return _this.console.groupCollapsed(groupTitle)})},Debugger.prototype.groupEnd=function(){var _this=this;return this.doIfEnabled(function(){return _this.console.groupEnd()})},Debugger.prototype.markTimeline=function(label){var _this=this;return this.doIfEnabled(function(){return _this.console.markTimeline(label)})},Debugger.prototype.profile=function(reportName){var _this=this;return this.doIfEnabled(function(){return _this.console.profile(reportName)})},Debugger.prototype.profileEnd=function(){var _this=this;return this.doIfEnabled(function(){return _this.console.profileEnd()})},Debugger.prototype.table=function(){for(var _this=this,data=[],_i=0;_i<arguments.length;_i++)data[_i]=arguments[_i];return this.doIfEnabled(function(){var _a;return(_a=_this.console).table.apply(_a,data)})},Debugger.prototype.throw=function(error){if(error.message=this.addPrefix(error.message),this.isEnabled)throw error;setTimeout(function(){throw error})},Debugger.prototype.doIfEnabled=function(action){if(this.isEnabled)return action()},Debugger.prototype.addPrefix=function(message){return!this.prefix||"string"!=typeof message&&message?message:this.prefix+message},Debugger}();function delay(delay,scheduler){void 0===scheduler&&(scheduler=async);var value,delayFor=(value=delay)instanceof Date&&!isNaN(+value)?delay-scheduler.now():Math.abs(delay);return function(source){return source.lift(new DelayOperator(delayFor,scheduler))}}var DelayOperator=function(){function DelayOperator(delay,scheduler){this.delay=delay,this.scheduler=scheduler}return DelayOperator.prototype.call=function(subscriber,source){return source.subscribe(new DelaySubscriber(subscriber,this.delay,this.scheduler))},DelayOperator}(),DelaySubscriber=function(_super){function DelaySubscriber(destination,delay,scheduler){var _this=_super.call(this,destination)||this;return _this.delay=delay,_this.scheduler=scheduler,_this.queue=[],_this.active=!1,_this.errored=!1,_this}return __extends(DelaySubscriber,_super),DelaySubscriber.dispatch=function(state){for(var source=state.source,queue=source.queue,scheduler=state.scheduler,destination=state.destination;0<queue.length&&queue[0].time-scheduler.now()<=0;)queue.shift().notification.observe(destination);if(0<queue.length){var delay_1=Math.max(0,queue[0].time-scheduler.now());this.schedule(state,delay_1)}else this.unsubscribe(),source.active=!1},DelaySubscriber.prototype._schedule=function(scheduler){this.active=!0,this.destination.add(scheduler.schedule(DelaySubscriber.dispatch,this.delay,{source:this,destination:this.destination,scheduler:scheduler}))},DelaySubscriber.prototype.scheduleNotification=function(notification){if(!0!==this.errored){var scheduler=this.scheduler,message=new DelayMessage(scheduler.now()+this.delay,notification);this.queue.push(message),!1===this.active&&this._schedule(scheduler)}},DelaySubscriber.prototype._next=function(value){this.scheduleNotification(Notification.createNext(value))},DelaySubscriber.prototype._error=function(err){this.errored=!0,this.queue=[],this.destination.error(err),this.unsubscribe()},DelaySubscriber.prototype._complete=function(){this.scheduleNotification(Notification.createComplete()),this.unsubscribe()},DelaySubscriber}(Subscriber),DelayMessage=function(){return function(time,notification){this.time=time,this.notification=notification}}(),isEqual=require("lodash.isequal"),CacheItem=function(){function CacheItem(cacheItem){this.name="",this.targets=[],this.services=[],this.utilities=[],this.proxy=null,this._key="",this.initializedTargets=new Set,this._key=cacheItem.key,this.name=cacheItem.name,this.addTargets(cacheItem.targets),this.addServices(cacheItem.services),this.addUtilities(cacheItem.utilities)}return Object.defineProperty(CacheItem.prototype,"key",{get:function(){return this._key},enumerable:!0,configurable:!0}),CacheItem.prototype.saveValue=function(value,config,source){if(void 0===config&&(config={}),debug.groupCollapsed("CacheItem#saveValue for "+this.key+" in "+this.currentTarget.constructor.name),debug.log("new value: ",value),debug.log("previous value: ",this.readValue()),debug.log("targets.length: ",this.targets.length),debug.log("currentTarget:",this.currentTarget),debug.groupEnd(),this.initializedTargets.has(this.currentTarget))return this.propagateChange(value,source),this.getProxy(value,config);this.initializedTargets.add(this.currentTarget);var readValue=this.readValue(),savedValue=null!=readValue?readValue:value,proxy=this.getProxy(savedValue,config);return proxy=null!==proxy?proxy:value,debug.log("initial value for "+this.key+" in "+this.currentTarget.constructor.name,proxy),this.propagateChange(savedValue,source),proxy},CacheItem.prototype.getProxy=function(value,config){if(void 0===config&&(config={}),void 0===value&&this.proxy)return this.proxy;if("object"!=typeof(value=void 0===value?this.readValue():value)||null===value)return this.proxy=value;if(!Config.mutateObjects&&!config.mutate||!1===config.mutate)return value;var _self=this,prototype=Object.assign(new value.constructor,value.__proto__);if(prototype.save=function(){_self.saveValue(value,config)},Array.isArray(value))for(var _loop_1=function(method){prototype[method]=function(){var readValue=_self.readValue(),result=Array.prototype[method].apply(readValue,arguments);return debug.log("Saving value for "+_self.key+" by method "+prototype.constructor.name+"."+method),_self.saveValue(readValue,config),result}},_i=0,methodsToOverwrite_1=["pop","push","reverse","shift","unshift","splice","filter","forEach","map","fill","sort","copyWithin"];_i<methodsToOverwrite_1.length;_i++){_loop_1(methodsToOverwrite_1[_i])}return Object.setPrototypeOf(value,prototype),this.proxy=value},CacheItem.prototype.readValue=function(config){var entry=this.utilities[0],value=entry?entry.utility.get(this.key,entry.config):null;return"object"!=typeof value?value:JSON.parse(JSON.stringify(this.getProxy(value,entry.config)))},CacheItem.prototype.addTargets=function(targets){var _this=this;targets.forEach(function(target){if(-1===_this.targets.indexOf(target)&&"object"==typeof target){var originalFunction_1=target.ngOnDestroy,_self_1=_this;target.ngOnDestroy=function(){"function"==typeof originalFunction_1&&originalFunction_1.apply(this,arguments),target.ngOnDestroy=originalFunction_1||function(){},_self_1.initializedTargets.delete(target),_self_1.targets=_self_1.targets.filter(function(t){return t!==target}),_self_1.targets.length||(_self_1.services.forEach(function(service){service.keys=service.keys.filter(function(key){return key!==_self_1._key})}),_self_1.resetProxy(),Cache.remove(_self_1)),debug.groupCollapsed(_self_1.key+" OnDestroy handler:"),debug.log("removed target:",target.constructor.name),debug.log("remaining targets:",_self_1.targets),debug.log("cacheItem:",Cache.get(_self_1.key)),debug.groupEnd()},_this.targets.push(target)}})},CacheItem.prototype.addServices=function(services){var _this=this;services.forEach(function(service){-1===_this.services.indexOf(service)&&(service.keys.push(_this._key),_this.services.push(service))})},CacheItem.prototype.addUtilities=function(utilityEntries){var _this=this;utilityEntries.forEach(function(entry){-1===_this.utilities.findIndex(function(e){return e.utility===entry.utility})&&(_this.utilities.push(entry),entry.utility.set(_this.key,_this.readValue()))})},CacheItem.prototype.resetProxy=function(){this.proxy=null},CacheItem.prototype.propagateChange=function(value,source){var _this=this;isEqual(value,this.readValue())||this.utilities.forEach(function(entry){var utility=entry.utility;utility!==source&&(debug.log("propagating change on "+_this.key+" to:",utility),utility.set(_this._key,value,entry.config))})},CacheItem}(),Cache=function(){function Cache(){}return Cache.getCacheFor=function(cacheCandidate){var cacheItem=Cache.get(cacheCandidate.key);return cacheItem?(debug.log("Loaded prior CacheItem of "+cacheItem.name+" for "+cacheCandidate.utilities[0].utility.getStorageName()),cacheItem.addTargets(cacheCandidate.targets),cacheItem.addServices(cacheCandidate.services),cacheItem.addUtilities(cacheCandidate.utilities)):(cacheItem=new CacheItem(cacheCandidate),debug.log("Created new CacheItem for "+cacheCandidate.name+" for "+cacheItem.utilities[0].utility.getStorageName())),Cache.set(cacheItem),cacheItem},Cache.remove=function(cacheItem){return Cache.items.delete(cacheItem.key)},Cache.get=function(key){return Cache.items.get(key)},Cache.set=function(cacheItem){Cache.get(cacheItem.key)||debug.log("CacheItem for "+cacheItem.key,cacheItem),Cache.items.set(cacheItem.key,cacheItem)},Cache.items=new Map,Cache}(),NgxStorageEvent=function(){function NgxStorageEvent(type,key,storageArea){this.type=type,this.key=key,this.storageArea=storageArea,this.timeStamp=Date.now()-NgxStorageEvent.initTimeStamp,this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.composed=!1,this.currentTarget=window,this.defaultPrevented=!1,this.eventPhase=2,this.isTrusted=!0,this.path=[window],this.returnValue=!0,this.srcElement=window,this.target=window,this.url=window.location.href,this.isInternal=!0}return Object.defineProperty(NgxStorageEvent.prototype,"initEvent",{get:function(){return StorageEvent.prototype.initEvent.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(NgxStorageEvent.prototype,"preventDefault",{get:function(){return StorageEvent.prototype.preventDefault.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(NgxStorageEvent.prototype,"stopImmediatePropagation",{get:function(){return StorageEvent.prototype.stopImmediatePropagation.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(NgxStorageEvent.prototype,"stopPropagation",{get:function(){return StorageEvent.prototype.stopPropagation.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(NgxStorageEvent.prototype,"composedPath",{get:function(){return StorageEvent.prototype.composedPath.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(NgxStorageEvent.prototype,"AT_TARGET",{get:function(){return StorageEvent.prototype.AT_TARGET},enumerable:!0,configurable:!0}),Object.defineProperty(NgxStorageEvent.prototype,"BUBBLING_PHASE",{get:function(){return StorageEvent.prototype.BUBBLING_PHASE},enumerable:!0,configurable:!0}),Object.defineProperty(NgxStorageEvent.prototype,"CAPTURING_PHASE",{get:function(){return StorageEvent.prototype.BUBBLING_PHASE},enumerable:!0,configurable:!0}),NgxStorageEvent.initTimeStamp=Date.now(),NgxStorageEvent}(),WebStorageUtility=function(){function WebStorageUtility(storage,prefix,previousPrefix){var _this=this;this._prefix="",this._changes=new Subject,this._storage=storage,(this._prefix=prefix)!==previousPrefix&&null!=previousPrefix&&(debug.log(this.getStorageName()+" > Detected prefix change from "+previousPrefix+" to "+pre