@openmrs/esm-framework
Version:
2 lines • 38.1 kB
JavaScript
"use strict";(globalThis.webpackChunk_openmrs_esm_framework=globalThis.webpackChunk_openmrs_esm_framework||[]).push([[645],{1645:(t,e,n)=>{n.r(e),n.d(e,{ArgumentOutOfRangeError:()=>st.W,AsyncSubject:()=>M,BehaviorSubject:()=>x,ConnectableObservable:()=>v,EMPTY:()=>N.E,EmptyError:()=>ut,GroupedObservable:()=>b,NEVER:()=>ie,Notification:()=>P,NotificationKind:()=>k,ObjectUnsubscribedError:()=>u,Observable:()=>r.y,ReplaySubject:()=>R,Scheduler:()=>T,Subject:()=>a,Subscriber:()=>o.L,Subscription:()=>s.w,TimeoutError:()=>ht,UnsubscriptionError:()=>ct.B,VirtualAction:()=>et,VirtualTimeScheduler:()=>tt,animationFrame:()=>$,animationFrameScheduler:()=>X,asap:()=>D,asapScheduler:()=>K,async:()=>H,asyncScheduler:()=>J,bindCallback:()=>pt,bindNodeCallback:()=>yt,combineLatest:()=>At,concat:()=>Wt,config:()=>je.v,defer:()=>zt,empty:()=>N.c,forkJoin:()=>Bt,from:()=>Lt,fromEvent:()=>Dt,fromEventPattern:()=>Ht,generate:()=>Qt,identity:()=>it.y,iif:()=>$t,interval:()=>ee,isObservable:()=>ot,merge:()=>re,never:()=>oe,noop:()=>rt,observable:()=>w.L,of:()=>Z,onErrorResumeNext:()=>se,pairs:()=>ue,partition:()=>pe,pipe:()=>nt.z,queue:()=>S,queueScheduler:()=>I,race:()=>de,range:()=>be,scheduled:()=>Ft,throwError:()=>F,timer:()=>we,using:()=>ge,zip:()=>_e});var r=n(6196),i=n(7080),o=n(7811),s=n(1736),u=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),c=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return i.ZT(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}(s.w),h=n(9573),l=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return i.ZT(e,t),e}(o.L),a=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 i.ZT(e,t),e.prototype[h.b]=function(){return new l(this)},e.prototype.lift=function(t){var e=new f(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new u;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new u;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new u;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 u;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new u;return this.hasError?(t.error(this.thrownError),s.w.EMPTY):this.isStopped?(t.complete(),s.w.EMPTY):(this.observers.push(t),new c(this,t))},e.prototype.asObservable=function(){var t=new r.y;return t.source=this,t},e.create=function(t,e){return new f(t,e)},e}(r.y),f=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return i.ZT(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):s.w.EMPTY},e}(a),p=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new d(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),d=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return i.ZT(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}(o.L),v=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 i.ZT(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 s.w).add(this.source.subscribe(new y(this.getSubject(),this))),t.closed&&(this._connection=null,t=s.w.EMPTY)),t},e.prototype.refCount=function(){return(t=this).lift(new p(t));var t},e}(r.y),y=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return i.ZT(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}(l),b=function(t){function e(e,n,r){var i=t.call(this)||this;return i.key=e,i.groupSubject=n,i.refCountSubscription=r,i}return i.ZT(e,t),e.prototype._subscribe=function(t){var e=new s.w,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new m(n)),e.add(r.subscribe(t)),e},e}(r.y),m=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return i.ZT(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(s.w),w=n(4002),x=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return i.ZT(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new u;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(a),g=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 i.ZT(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 i.ZT(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(s.w)),_=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return i.ZT(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}(g),T=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}(),E=function(t){function e(n,r){void 0===r&&(r=T.now);var i=t.call(this,n,(function(){return e.delegate&&e.delegate!==i?e.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return i.ZT(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},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}(T),I=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e}(E))(_),S=I,N=n(70);function j(t){return t&&"function"==typeof t.schedule}var k,C=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}};function A(t,e){return new r.y((function(n){var r=new s.w,i=0;return r.add(e.schedule((function(){i!==t.length?(n.next(t[i++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}function O(t,e){return e?A(t,e):new r.y(C(t))}function Z(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return j(n)?(t.pop(),A(t,n)):O(t)}function F(t,e){return e?new r.y((function(n){return e.schedule(L,0,{error:t,subscriber:n})})):new r.y((function(e){return e.error(t)}))}function L(t){var e=t.error;t.subscriber.error(e)}k||(k={});var P=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 Z(this.value);case"E":return F(this.error);case"C":return(0,N.c)()}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}(),V=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return i.ZT(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new Y(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(P.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(P.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(P.createComplete()),this.unsubscribe()},e}(o.L),Y=function(){return function(t,e){this.notification=t,this.destination=e}}(),R=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return i.ZT(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){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.isStopped||(this._events.push(new q(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(),i=this.scheduler,o=r.length;if(this.closed)throw new u;if(this.isStopped||this.hasError?e=s.w.EMPTY:(this.observers.push(t),e=new c(this,t)),i&&t.add(t=new V(t,i)),n)for(var h=0;h<o&&!t.closed;h++)t.next(r[h]);else for(h=0;h<o&&!t.closed;h++)t.next(r[h].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||S).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(t-r[o].time<n);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r},e}(a),q=function(){return function(t,e){this.time=t,this.value=e}}(),M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return i.ZT(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),s.w.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),s.w.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(a),U=1,W=function(){return Promise.resolve()}(),z={};function B(t){return t in z&&(delete z[t],!0)}var G=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return i.ZT(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=(i=e.flush.bind(e,null),o=U++,z[o]=!0,W.then((function(){return B(o)&&i()})),o)));var i,o},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&&(B(n),e.scheduled=void 0)},e}(g),K=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(E))(G),D=K,J=new E(g),H=J,Q=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return i.ZT(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}(g),X=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},e}(E))(Q),$=X,tt=function(t){function e(e,n){void 0===e&&(e=et),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return i.ZT(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(E),et=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return i.ZT(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){void 0===n&&(n=0)},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(g),nt=n(6295);function rt(){}var it=n(7430);function ot(t){return!!t&&(t instanceof r.y||"function"==typeof t.lift&&"function"==typeof t.subscribe)}var st=n(1760),ut=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),ct=n(8961),ht=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),lt=n(5725),at=n(6022),ft=n(4724);function pt(t,e,n){if(e){if(!j(e))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return pt(t,n).apply(void 0,r).pipe((0,lt.U)((function(t){return(0,ft.k)(t)?e.apply(void 0,t):e(t)})))};n=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o,s=this,u={context:s,subject:o,callbackFunc:t,scheduler:n};return new r.y((function(r){if(n){var i={args:e,subscriber:r,params:u};return n.schedule(dt,0,i)}if(!o){o=new M;try{t.apply(s,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o.next(t.length<=1?t[0]:t),o.complete()}]))}catch(t){(0,at._)(o)?o.error(t):console.warn(t)}}return o.subscribe(r)}))}}function dt(t){var e=this,n=t.args,r=t.subscriber,i=t.params,o=i.callbackFunc,s=i.context,u=i.scheduler,c=i.subject;if(!c){c=i.subject=new M;try{o.apply(s,n.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length<=1?t[0]:t;e.add(u.schedule(vt,0,{value:r,subject:c}))}]))}catch(t){c.error(t)}}this.add(c.subscribe(r))}function vt(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function yt(t,e,n){if(e){if(!j(e))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return yt(t,n).apply(void 0,r).pipe((0,lt.U)((function(t){return(0,ft.k)(t)?e.apply(void 0,t):e(t)})))};n=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o={subject:void 0,args:e,callbackFunc:t,scheduler:n,context:this};return new r.y((function(r){var i=o.context,s=o.subject;if(n)return n.schedule(bt,0,{params:o,subscriber:r,context:i});if(!s){s=o.subject=new M;try{t.apply(i,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.shift();n?s.error(n):(s.next(t.length<=1?t[0]:t),s.complete())}]))}catch(t){(0,at._)(s)?s.error(t):console.warn(t)}}return s.subscribe(r)}))}}function bt(t){var e=this,n=t.params,r=t.subscriber,i=t.context,o=n.callbackFunc,s=n.args,u=n.scheduler,c=n.subject;if(!c){c=n.subject=new M;try{o.apply(i,s.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.shift();if(r)e.add(u.schedule(wt,0,{err:r,subject:c}));else{var i=t.length<=1?t[0]:t;e.add(u.schedule(mt,0,{value:i,subject:c}))}}]))}catch(t){this.add(u.schedule(wt,0,{err:t,subject:c}))}}this.add(c.subscribe(r))}function mt(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function wt(t){var e=t.err;t.subject.error(e)}var xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(o.L),gt=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i.index=0,i}return i.ZT(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}(o.L),_t=n(1450);function Tt(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Et=Tt(),It=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function St(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var Nt=n(1167),jt=function(t){if(t&&"function"==typeof t[w.L])return r=t,function(t){var e=r[w.L]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(It(t))return C(t);if(St(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,_t.z),t};if(t&&"function"==typeof t[Et])return e=t,function(t){for(var n=e[Et]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,r,i=(0,Nt.K)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function kt(t,e,n,i,o){if(void 0===o&&(o=new gt(t,n,i)),!o.closed)return e instanceof r.y?e.subscribe(o):jt(e)(o)}var Ct={};function At(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return j(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&(0,ft.k)(t[0])&&(t=t[0]),O(t,r).lift(new Ot(n))}var Ot=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Zt(t,this.resultSelector))},t}(),Zt=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 i.ZT(e,t),e.prototype._next=function(t){this.values.push(Ct),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(kt(this,r,void 0,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n){var r=this.values,i=r[n],o=this.toRespond?i===Ct?--this.toRespond:this.toRespond:0;r[n]=e,0===o&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.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 Ft(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[w.L]}(t))return function(t,e){return new r.y((function(n){var r=new s.w;return r.add(e.schedule((function(){var i=t[w.L]();r.add(i.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}))}(t,e);if(St(t))return function(t,e){return new r.y((function(n){var r=new s.w;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,e);if(It(t))return A(t,e);if(function(t){return t&&"function"==typeof t[Et]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.y((function(n){var r,i=new s.w;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(e.schedule((function(){r=t[Et](),i.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function Lt(t,e){return e?Ft(t,e):t instanceof r.y?t:new r.y(jt(t))}var Pt=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return i.ZT(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(o.L),Vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.ZT(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(o.L);function Yt(t,e){if(!e.closed){if(t instanceof r.y)return t.subscribe(e);var n;try{n=jt(t)(e)}catch(t){e.error(t)}return n}}function Rt(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(Rt((function(n,r){return Lt(t(n,r)).pipe((0,lt.U)((function(t,i){return e(n,t,r,i)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new qt(t,n))})}var qt=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 Mt(t,this.project,this.concurrent))},t}(),Mt=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return i.ZT(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)},e.prototype._innerSub=function(t){var e=new Pt(this),n=this.destination;n.add(e);var r=Yt(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(Vt);function Ut(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Rt(it.y,t)}function Wt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ut(1)(Z.apply(void 0,t))}function zt(t){return new r.y((function(e){var n;try{n=t()}catch(t){return void e.error(t)}return(n?Lt(n):(0,N.c)()).subscribe(e)}))}function Bt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var n=t[0];if((0,ft.k)(n))return Gt(n,null);if((0,Nt.K)(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return Gt(r.map((function(t){return n[t]})),r)}}if("function"==typeof t[t.length-1]){var i=t.pop();return Gt(t=1===t.length&&(0,ft.k)(t[0])?t[0]:t,null).pipe((0,lt.U)((function(t){return i.apply(void 0,t)})))}return Gt(t,null)}function Gt(t,e){return new r.y((function(n){var r=t.length;if(0!==r)for(var i=new Array(r),o=0,s=0,u=function(u){var c=Lt(t[u]),h=!1;n.add(c.subscribe({next:function(t){h||(h=!0,s++),i[u]=t},error:function(t){return n.error(t)},complete:function(){++o!==r&&h||(s===r&&n.next(e?e.reduce((function(t,e,n){return t[e]=i[n],t}),{}):i),n.complete())}}))},c=0;c<r;c++)u(c);else n.complete()}))}var Kt=n(9147);function Dt(t,e,n,i){return(0,Kt.m)(n)&&(i=n,n=void 0),i?Dt(t,e,n).pipe((0,lt.U)((function(t){return(0,ft.k)(t)?i.apply(void 0,t):i(t)}))):new r.y((function(r){Jt(t,e,(function(t){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(t)}),r,n)}))}function Jt(t,e,n,r,i){var o;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var s=t;t.addEventListener(e,n,i),o=function(){return s.removeEventListener(e,n,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var u=t;t.on(e,n),o=function(){return u.off(e,n)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var c=t;t.addListener(e,n),o=function(){return c.removeListener(e,n)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var h=0,l=t.length;h<l;h++)Jt(t[h],e,n,r,i)}r.add(o)}function Ht(t,e,n){return n?Ht(t,e).pipe((0,lt.U)((function(t){return(0,ft.k)(t)?n.apply(void 0,t):n(t)}))):new r.y((function(n){var r,i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.next(1===t.length?t[0]:t)};try{r=t(i)}catch(t){return void n.error(t)}if((0,Kt.m)(e))return function(){return e(i,r)}}))}function Qt(t,e,n,i,o){var s,u;if(1==arguments.length){var c=t;u=c.initialState,e=c.condition,n=c.iterate,s=c.resultSelector||it.y,o=c.scheduler}else void 0===i||j(i)?(u=t,s=it.y,o=i):(u=t,s=i);return new r.y((function(t){var r=u;if(o)return o.schedule(Xt,0,{subscriber:t,iterate:n,condition:e,resultSelector:s,state:r});for(;;){if(e){var i=void 0;try{i=e(r)}catch(e){return void t.error(e)}if(!i){t.complete();break}}var c=void 0;try{c=s(r)}catch(e){return void t.error(e)}if(t.next(c),t.closed)break;try{r=n(r)}catch(e){return void t.error(e)}}}))}function Xt(t){var e=t.subscriber,n=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(n){var r=void 0;try{r=n(t.state)}catch(t){return void e.error(t)}if(!r)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function $t(t,e,n){return void 0===e&&(e=N.E),void 0===n&&(n=N.E),zt((function(){return t()?e:n}))}function te(t){return!(0,ft.k)(t)&&t-parseFloat(t)+1>=0}function ee(t,e){return void 0===t&&(t=0),void 0===e&&(e=H),(!te(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=H),new r.y((function(n){return n.add(e.schedule(ne,t,{subscriber:n,counter:0,period:t})),n}))}function ne(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}function re(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,i=null,o=t[t.length-1];return j(o)?(i=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===i&&1===t.length&&t[0]instanceof r.y?t[0]:Ut(n)(O(t,i))}var ie=new r.y(rt);function oe(){return ie}function se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return N.E;var n=t[0],i=t.slice(1);return 1===t.length&&(0,ft.k)(n)?se.apply(void 0,n):new r.y((function(t){var e=function(){return t.add(se.apply(void 0,i).subscribe(t))};return Lt(n).subscribe({next:function(e){t.next(e)},error:e,complete:e})}))}function ue(t,e){return e?new r.y((function(n){var r=Object.keys(t),i=new s.w;return i.add(e.schedule(ce,0,{keys:r,index:0,subscriber:n,subscription:i,obj:t})),i})):new r.y((function(e){for(var n=Object.keys(t),r=0;r<n.length&&!e.closed;r++){var i=n[r];t.hasOwnProperty(i)&&e.next([i,t[i]])}e.complete()}))}function ce(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,o=t.obj;if(!r.closed)if(n<e.length){var s=e[n];r.next([s,o[s]]),i.add(this.schedule({keys:e,index:n+1,subscriber:r,subscription:i,obj:o}))}else r.complete()}function he(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}function le(t,e){return function(n){return n.lift(new ae(t,e))}}var ae=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 i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return i.ZT(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}(o.L);function pe(t,e,n){return[le(e,n)(new r.y(jt(t))),le(he(e,n))(new r.y(jt(t)))]}function de(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!(0,ft.k)(t[0]))return t[0];t=t[0]}return O(t,void 0).lift(new ve)}var ve=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ye(t))},t}(),ye=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return i.ZT(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=kt(this,t[n],void 0,n);this.subscriptions&&this.subscriptions.push(r),this.add(r)}this.observables=null}},e.prototype.notifyNext=function(t,e,n){if(!this.hasFirst){this.hasFirst=!0;for(var r=0;r<this.subscriptions.length;r++)if(r!==n){var i=this.subscriptions[r];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(e)},e}(xt);function be(t,e,n){return void 0===t&&(t=0),new r.y((function(r){void 0===e&&(e=t,t=0);var i=0,o=t;if(n)return n.schedule(me,0,{index:i,count:e,start:t,subscriber:r});for(;;){if(i++>=e){r.complete();break}if(r.next(o++),r.closed)break}}))}function me(t){var e=t.start,n=t.index,r=t.count,i=t.subscriber;n>=r?i.complete():(i.next(e),i.closed||(t.index=n+1,t.start=e+1,this.schedule(t)))}function we(t,e,n){void 0===t&&(t=0);var i=-1;return te(e)?i=Number(e)<1?1:Number(e):j(e)&&(n=e),j(n)||(n=H),new r.y((function(e){var r=te(t)?t:+t-n.now();return n.schedule(xe,r,{index:0,period:i,subscriber:e})}))}function xe(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}function ge(t,e){return new r.y((function(n){var r,i;try{r=t()}catch(t){return void n.error(t)}try{i=e(r)}catch(t){return void n.error(t)}var o=(i?Lt(i):N.E).subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}}))}function _e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return"function"==typeof n&&t.pop(),O(t,void 0).lift(new Te(n))}var Te=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Ee(t,this.resultSelector))},t}(),Ee=function(t){function e(e,n,r){void 0===r&&(r=Object.create(null));var i=t.call(this,e)||this;return i.resultSelector=n,i.iterators=[],i.active=0,i.resultSelector="function"==typeof n?n:void 0,i}return i.ZT(e,t),e.prototype._next=function(t){var e=this.iterators;(0,ft.k)(t)?e.push(new Se(t)):"function"==typeof t[Et]?e.push(new Ie(t[Et]())):e.push(new Ne(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[n];r.stillUnsubscribed?this.destination.add(r.subscribe()):this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++)if("function"==typeof(s=t[r]).hasValue&&!s.hasValue())return;var i=!1,o=[];for(r=0;r<e;r++){var s,u=(s=t[r]).next();if(s.hasCompleted()&&(i=!0),u.done)return void n.complete();o.push(u.value)}this.resultSelector?this._tryresultSelector(o):n.next(o),i&&n.complete()},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}(o.L),Ie=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),Se=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[Et]=function(){return this},t.prototype.next=function(t){var e=this.index++,n=this.array;return e<this.length?{value:n[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Ne=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return i.ZT(e,t),e.prototype[Et]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},e.prototype.subscribe=function(){return Yt(this.observable,new Pt(this))},e}(Vt),je=n(5769)}}]);
//# sourceMappingURL=645.openmrs-esm-framework.js.map