var Vx=Object.create;var Is=Object.defineProperty;var Nx=Object.getOwnPropertyDescriptor;var Wx=Object.getOwnPropertyNames;var Ux=Object.getPrototypeOf,Gx=Object.prototype.hasOwnProperty;var _=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Bx=(r,e)=>{for(var t in e)Is(r,t,{get:e[t],enumerable:!0})},rb=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Wx(e))!Gx.call(r,n)&&n!==t&&Is(r,n,{get:()=>e[n],enumerable:!(i=Nx(e,n))||i.enumerable});return r};var gt=(r,e,t)=>(t=r!=null?Vx(Ux(r)):{},rb(e||!r||!r.__esModule?Is(t,"default",{value:r,enumerable:!0}):t,r)),Hx=r=>rb(Is({},"__esModule",{value:!0}),r);var le=_(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.isFunction=void 0;function Kx(r){return typeof r=="function"}Fs.isFunction=Kx});var ai=_(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.createErrorClass=void 0;function Xx(r){var e=function(i){Error.call(i),i.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Ds.createErrorClass=Xx});var lp=_(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.UnsubscriptionError=void 0;var Jx=ai();Rs.UnsubscriptionError=Jx.createErrorClass(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription: `+t.map(function(i,n){return n+1+") "+i.toString()}).join(` `):"",this.name="UnsubscriptionError",this.errors=t}})});var zr=_(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.arrRemove=void 0;function Zx(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}zs.arrRemove=Zx});var Mt=_(bt=>{"use strict";var ab=bt&&bt.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},sb=bt&&bt.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},ub=bt&&bt.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.config=void 0;Vs.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var pp=_(lr=>{"use strict";var fb=lr&&lr.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},hb=lr&&lr.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.reportUnhandledError=void 0;var tM=xn(),rM=pp();function iM(r){rM.timeoutProvider.setTimeout(function(){var e=tM.config.onUnhandledError;if(e)e(r);else throw r})}Ns.reportUnhandledError=iM});var Ke=_(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.noop=void 0;function nM(){}Ws.noop=nM});var pb=_(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.createNotification=fr.nextNotification=fr.errorNotification=fr.COMPLETE_NOTIFICATION=void 0;fr.COMPLETE_NOTIFICATION=function(){return Us("C",void 0,void 0)}();function oM(r){return Us("E",void 0,r)}fr.errorNotification=oM;function aM(r){return Us("N",r,void 0)}fr.nextNotification=aM;function Us(r,e,t){return{kind:r,value:e,error:t}}fr.createNotification=Us});var Gs=_(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.captureError=Mn.errorContext=void 0;var db=xn(),Ki=null;function sM(r){if(db.config.useDeprecatedSynchronousErrorHandling){var e=!Ki;if(e&&(Ki={errorThrown:!1,error:null}),r(),e){var t=Ki,i=t.errorThrown,n=t.error;if(Ki=null,i)throw n}}else r()}Mn.errorContext=sM;function uM(r){db.config.useDeprecatedSynchronousErrorHandling&&Ki&&(Ki.errorThrown=!0,Ki.error=r)}Mn.captureError=uM});var Ln=_(Xt=>{"use strict";var yb=Xt&&Xt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Xt,"__esModule",{value:!0});Xt.EMPTY_OBSERVER=Xt.SafeSubscriber=Xt.Subscriber=void 0;var cM=le(),vb=Mt(),gp=xn(),lM=dp(),mb=Ke(),vp=pb(),fM=pp(),hM=Gs(),gb=function(r){yb(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,vb.isSubscription(t)&&t.add(i)):i.destination=Xt.EMPTY_OBSERVER,i}return e.create=function(t,i,n){return new bb(t,i,n)},e.prototype.next=function(t){this.isStopped?yp(vp.nextNotification(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?yp(vp.errorNotification(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?yp(vp.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(vb.Subscription);Xt.Subscriber=gb;var pM=Function.prototype.bind;function mp(r,e){return pM.call(r,e)}var dM=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){Bs(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){Bs(i)}else Bs(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Bs(t)}},r}(),bb=function(r){yb(e,r);function e(t,i,n){var a=r.call(this)||this,u;if(cM.isFunction(t)||!t)u={next:t??void 0,error:i??void 0,complete:n??void 0};else{var l;a&&gp.config.useDeprecatedNextContext?(l=Object.create(t),l.unsubscribe=function(){return a.unsubscribe()},u={next:t.next&&mp(t.next,l),error:t.error&&mp(t.error,l),complete:t.complete&&mp(t.complete,l)}):u=t}return a.destination=new dM(u),a}return e}(gb);Xt.SafeSubscriber=bb;function Bs(r){gp.config.useDeprecatedSynchronousErrorHandling?hM.captureError(r):lM.reportUnhandledError(r)}function vM(r){throw r}function yp(r,e){var t=gp.config.onStoppedNotification;t&&fM.timeoutProvider.setTimeout(function(){return t(r,e)})}Xt.EMPTY_OBSERVER={closed:!0,next:mb.noop,error:vM,complete:mb.noop}});var da=_(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.observable=void 0;Hs.observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}()});var Xe=_($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.identity=void 0;function mM(r){return r}$s.identity=mM});var va=_(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.pipeFromArray=jn.pipe=void 0;var yM=Xe();function gM(){for(var r=[],e=0;e{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.Observable=void 0;var _p=Ln(),bM=Mt(),_M=da(),PM=va(),wM=xn(),bp=le(),OM=Gs(),TM=function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,i){var n=this,a=CM(e)?e:new _p.SafeSubscriber(e,t,i);return OM.errorContext(function(){var u=n,l=u.operator,h=u.source;a.add(l?l.call(a,h):h?n._subscribe(a):n._trySubscribe(a))}),a},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var i=this;return t=Pb(t),new t(function(n,a){var u=new _p.SafeSubscriber({next:function(l){try{e(l)}catch(h){a(h),u.unsubscribe()}},error:a,complete:n});i.subscribe(u)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[_M.observable]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.operate=In.hasLift=void 0;var AM=le();function wb(r){return AM.isFunction(r?.lift)}In.hasLift=wb;function EM(r){return function(e){if(wb(e))return e.lift(function(t){try{return r(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}In.operate=EM});var U=_(si=>{"use strict";var qM=si&&si.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(si,"__esModule",{value:!0});si.OperatorSubscriber=si.createOperatorSubscriber=void 0;var xM=Ln();function MM(r,e,t,i,n){return new Ob(r,e,t,i,n)}si.createOperatorSubscriber=MM;var Ob=function(r){qM(e,r);function e(t,i,n,a,u,l){var h=r.call(this,t)||this;return h.onFinalize=u,h.shouldUnsubscribe=l,h._next=i?function(p){try{i(p)}catch(v){t.error(v)}}:r.prototype._next,h._error=a?function(p){try{a(p)}catch(v){t.error(v)}finally{this.unsubscribe()}}:r.prototype._error,h._complete=n?function(){try{n()}catch(p){t.error(p)}finally{this.unsubscribe()}}:r.prototype._complete,h}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;r.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(xM.Subscriber);si.OperatorSubscriber=Ob});var Ks=_(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.refCount=void 0;var LM=z(),jM=U();function IM(){return LM.operate(function(r,e){var t=null;r._refCount++;var i=jM.createOperatorSubscriber(e,void 0,void 0,void 0,function(){if(!r||r._refCount<=0||0<--r._refCount){t=null;return}var n=r._connection,a=t;t=null,n&&(!a||n===a)&&n.unsubscribe(),e.unsubscribe()});r.subscribe(i),i.closed||(t=r.connect())})}Qs.refCount=IM});var ma=_(kn=>{"use strict";var kM=kn&&kn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(kn,"__esModule",{value:!0});kn.ConnectableObservable=void 0;var FM=he(),Tb=Mt(),DM=Ks(),RM=U(),zM=z(),VM=function(r){kM(e,r);function e(t,i){var n=r.call(this)||this;return n.source=t,n.subjectFactory=i,n._subject=null,n._refCount=0,n._connection=null,zM.hasLift(t)&&(n.lift=t.lift),n}return e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,t?.unsubscribe()},e.prototype.connect=function(){var t=this,i=this._connection;if(!i){i=this._connection=new Tb.Subscription;var n=this.getSubject();i.add(this.source.subscribe(RM.createOperatorSubscriber(n,void 0,function(){t._teardown(),n.complete()},function(a){t._teardown(),n.error(a)},function(){return t._teardown()}))),i.closed&&(this._connection=null,i=Tb.Subscription.EMPTY)}return i},e.prototype.refCount=function(){return DM.refCount()(this)},e}(FM.Observable);kn.ConnectableObservable=VM});var Sb=_(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.performanceTimestampProvider=void 0;ya.performanceTimestampProvider={now:function(){return(ya.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var Pp=_(Jt=>{"use strict";var Cb=Jt&&Jt.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},Ab=Jt&&Jt.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.animationFrames=void 0;var WM=he(),UM=Sb(),Eb=Pp();function GM(r){return r?qb(r):BM}Xs.animationFrames=GM;function qb(r){return new WM.Observable(function(e){var t=r||UM.performanceTimestampProvider,i=t.now(),n=0,a=function(){e.closed||(n=Eb.animationFrameProvider.requestAnimationFrame(function(u){n=0;var l=t.now();e.next({timestamp:r?l:u,elapsed:l-i}),a()}))};return a(),function(){n&&Eb.animationFrameProvider.cancelAnimationFrame(n)}})}var BM=qb()});var wp=_(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.ObjectUnsubscribedError=void 0;var HM=ai();Js.ObjectUnsubscribedError=HM.createErrorClass(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var Je=_(hr=>{"use strict";var Lb=hr&&hr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),$M=hr&&hr.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(hr,"__esModule",{value:!0});hr.AnonymousSubject=hr.Subject=void 0;var Mb=he(),Tp=Mt(),YM=wp(),QM=zr(),Op=Gs(),jb=function(r){Lb(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var i=new Sp(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new YM.ObjectUnsubscribedError},e.prototype.next=function(t){var i=this;Op.errorContext(function(){var n,a;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var u=$M(i.currentObservers),l=u.next();!l.done;l=u.next()){var h=l.value;h.next(t)}}catch(p){n={error:p}}finally{try{l&&!l.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}}})},e.prototype.error=function(t){var i=this;Op.errorContext(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var n=i.observers;n.length;)n.shift().error(t)}})},e.prototype.complete=function(){var t=this;Op.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var i=this,n=this,a=n.hasError,u=n.isStopped,l=n.observers;return a||u?Tp.EMPTY_SUBSCRIPTION:(this.currentObservers=null,l.push(t),new Tp.Subscription(function(){i.currentObservers=null,QM.arrRemove(l,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,n=i.hasError,a=i.thrownError,u=i.isStopped;n?t.error(a):u&&t.complete()},e.prototype.asObservable=function(){var t=new Mb.Observable;return t.source=this,t},e.create=function(t,i){return new Sp(t,i)},e}(Mb.Observable);hr.Subject=jb;var Sp=function(r){Lb(e,r);function e(t,i){var n=r.call(this)||this;return n.destination=t,n.source=i,n}return e.prototype.next=function(t){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,t)},e.prototype.error=function(t){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&n!==void 0?n:Tp.EMPTY_SUBSCRIPTION},e}(jb);hr.AnonymousSubject=Sp});var Cp=_(Fn=>{"use strict";var KM=Fn&&Fn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.BehaviorSubject=void 0;var XM=Je(),JM=function(r){KM(e,r);function e(t){var i=r.call(this)||this;return i._value=t,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var i=r.prototype._subscribe.call(this,t);return!i.closed&&t.next(this._value),i},e.prototype.getValue=function(){var t=this,i=t.hasError,n=t.thrownError,a=t._value;if(i)throw n;return this._throwIfClosed(),a},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e}(XM.Subject);Fn.BehaviorSubject=JM});var Zs=_(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.dateTimestampProvider=void 0;ga.dateTimestampProvider={now:function(){return(ga.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var eu=_(Dn=>{"use strict";var ZM=Dn&&Dn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ReplaySubject=void 0;var eL=Je(),tL=Zs(),rL=function(r){ZM(e,r);function e(t,i,n){t===void 0&&(t=1/0),i===void 0&&(i=1/0),n===void 0&&(n=tL.dateTimestampProvider);var a=r.call(this)||this;return a._bufferSize=t,a._windowTime=i,a._timestampProvider=n,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=i===1/0,a._bufferSize=Math.max(1,t),a._windowTime=Math.max(1,i),a}return e.prototype.next=function(t){var i=this,n=i.isStopped,a=i._buffer,u=i._infiniteTimeWindow,l=i._timestampProvider,h=i._windowTime;n||(a.push(t),!u&&a.push(l.now()+h)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var i=this._innerSubscribe(t),n=this,a=n._infiniteTimeWindow,u=n._buffer,l=u.slice(),h=0;h{"use strict";var iL=Rn&&Rn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Rn,"__esModule",{value:!0});Rn.AsyncSubject=void 0;var nL=Je(),oL=function(r){iL(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return e.prototype._checkFinalizedStatuses=function(t){var i=this,n=i.hasError,a=i._hasValue,u=i._value,l=i.thrownError,h=i.isStopped,p=i._isComplete;n?t.error(l):(h||p)&&(a&&t.next(u),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var t=this,i=t._hasValue,n=t._value,a=t._isComplete;a||(this._isComplete=!0,i&&r.prototype.next.call(this,n),r.prototype.complete.call(this))},e}(nL.Subject);Rn.AsyncSubject=oL});var Ib=_(zn=>{"use strict";var aL=zn&&zn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(zn,"__esModule",{value:!0});zn.Action=void 0;var sL=Mt(),uL=function(r){aL(e,r);function e(t,i){return r.call(this)||this}return e.prototype.schedule=function(t,i){return i===void 0&&(i=0),this},e}(sL.Subscription);zn.Action=uL});var Db=_(pr=>{"use strict";var kb=pr&&pr.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},Fb=pr&&pr.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";var cL=Vn&&Vn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.AsyncAction=void 0;var lL=Ib(),Rb=Db(),fL=zr(),hL=function(r){cL(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.scheduler=t,n.work=i,n.pending=!1,n}return e.prototype.schedule=function(t,i){var n;if(i===void 0&&(i=0),this.closed)return this;this.state=t;var a=this.id,u=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(u,a,i)),this.pending=!0,this.delay=i,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(u,this.id,i),this},e.prototype.requestAsyncId=function(t,i,n){return n===void 0&&(n=0),Rb.intervalProvider.setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,i,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return i;i!=null&&Rb.intervalProvider.clearInterval(i)},e.prototype.execute=function(t,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,i);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,i){var n=!1,a;try{this.work(t)}catch(u){n=!0,a=u||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,i=t.id,n=t.scheduler,a=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,fL.arrRemove(a,this),i!=null&&(this.id=this.recycleAsyncId(n,i,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e}(lL.Action);Vn.AsyncAction=hL});var Vb=_(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.TestTools=Wn.Immediate=void 0;var pL=1,Ap,ru={};function zb(r){return r in ru?(delete ru[r],!0):!1}Wn.Immediate={setImmediate:function(r){var e=pL++;return ru[e]=!0,Ap||(Ap=Promise.resolve()),Ap.then(function(){return zb(e)&&r()}),e},clearImmediate:function(r){zb(r)}};Wn.TestTools={pending:function(){return Object.keys(ru).length}}});var Wb=_(dr=>{"use strict";var dL=dr&&dr.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},vL=dr&&dr.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";var gL=Un&&Un.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Un,"__esModule",{value:!0});Un.AsapAction=void 0;var bL=Nn(),Ub=Wb(),_L=function(r){gL(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.scheduler=t,n.work=i,n}return e.prototype.requestAsyncId=function(t,i,n){return n===void 0&&(n=0),n!==null&&n>0?r.prototype.requestAsyncId.call(this,t,i,n):(t.actions.push(this),t._scheduled||(t._scheduled=Ub.immediateProvider.setImmediate(t.flush.bind(t,void 0))))},e.prototype.recycleAsyncId=function(t,i,n){var a;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,t,i,n);var u=t.actions;i!=null&&((a=u[u.length-1])===null||a===void 0?void 0:a.id)!==i&&(Ub.immediateProvider.clearImmediate(i),t._scheduled===i&&(t._scheduled=void 0))},e}(bL.AsyncAction);Un.AsapAction=_L});var Ep=_(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.Scheduler=void 0;var PL=Zs(),wL=function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,i){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(i,t)},r.now=PL.dateTimestampProvider.now,r}();iu.Scheduler=wL});var Bn=_(Gn=>{"use strict";var OL=Gn&&Gn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.AsyncScheduler=void 0;var Bb=Ep(),TL=function(r){OL(e,r);function e(t,i){i===void 0&&(i=Bb.Scheduler.now);var n=r.call(this,t,i)||this;return n.actions=[],n._active=!1,n}return e.prototype.flush=function(t){var i=this.actions;if(this._active){i.push(t);return}var n;this._active=!0;do if(n=t.execute(t.state,t.delay))break;while(t=i.shift());if(this._active=!1,n){for(;t=i.shift();)t.unsubscribe();throw n}},e}(Bb.Scheduler);Gn.AsyncScheduler=TL});var Hb=_(Hn=>{"use strict";var SL=Hn&&Hn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Hn,"__esModule",{value:!0});Hn.AsapScheduler=void 0;var CL=Bn(),AL=function(r){SL(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0;var i=this._scheduled;this._scheduled=void 0;var n=this.actions,a;t=t||n.shift();do if(a=t.execute(t.state,t.delay))break;while((t=n[0])&&t.id===i&&n.shift());if(this._active=!1,a){for(;(t=n[0])&&t.id===i&&n.shift();)t.unsubscribe();throw a}},e}(CL.AsyncScheduler);Hn.AsapScheduler=AL});var $b=_(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.asap=Xi.asapScheduler=void 0;var EL=Gb(),qL=Hb();Xi.asapScheduler=new qL.AsapScheduler(EL.AsapAction);Xi.asap=Xi.asapScheduler});var _t=_(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.async=Ji.asyncScheduler=void 0;var xL=Nn(),ML=Bn();Ji.asyncScheduler=new ML.AsyncScheduler(xL.AsyncAction);Ji.async=Ji.asyncScheduler});var Yb=_($n=>{"use strict";var LL=$n&&$n.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty($n,"__esModule",{value:!0});$n.QueueAction=void 0;var jL=Nn(),IL=function(r){LL(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.scheduler=t,n.work=i,n}return e.prototype.schedule=function(t,i){return i===void 0&&(i=0),i>0?r.prototype.schedule.call(this,t,i):(this.delay=i,this.state=t,this.scheduler.flush(this),this)},e.prototype.execute=function(t,i){return i>0||this.closed?r.prototype.execute.call(this,t,i):this._execute(t,i)},e.prototype.requestAsyncId=function(t,i,n){return n===void 0&&(n=0),n!=null&&n>0||n==null&&this.delay>0?r.prototype.requestAsyncId.call(this,t,i,n):(t.flush(this),0)},e}(jL.AsyncAction);$n.QueueAction=IL});var Qb=_(Yn=>{"use strict";var kL=Yn&&Yn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.QueueScheduler=void 0;var FL=Bn(),DL=function(r){kL(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(FL.AsyncScheduler);Yn.QueueScheduler=DL});var Kb=_(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.queue=Zi.queueScheduler=void 0;var RL=Yb(),zL=Qb();Zi.queueScheduler=new zL.QueueScheduler(RL.QueueAction);Zi.queue=Zi.queueScheduler});var Jb=_(Qn=>{"use strict";var VL=Qn&&Qn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Qn,"__esModule",{value:!0});Qn.AnimationFrameAction=void 0;var NL=Nn(),Xb=Pp(),WL=function(r){VL(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.scheduler=t,n.work=i,n}return e.prototype.requestAsyncId=function(t,i,n){return n===void 0&&(n=0),n!==null&&n>0?r.prototype.requestAsyncId.call(this,t,i,n):(t.actions.push(this),t._scheduled||(t._scheduled=Xb.animationFrameProvider.requestAnimationFrame(function(){return t.flush(void 0)})))},e.prototype.recycleAsyncId=function(t,i,n){var a;if(n===void 0&&(n=0),n!=null?n>0:this.delay>0)return r.prototype.recycleAsyncId.call(this,t,i,n);var u=t.actions;i!=null&&((a=u[u.length-1])===null||a===void 0?void 0:a.id)!==i&&(Xb.animationFrameProvider.cancelAnimationFrame(i),t._scheduled=void 0)},e}(NL.AsyncAction);Qn.AnimationFrameAction=WL});var Zb=_(Kn=>{"use strict";var UL=Kn&&Kn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Kn,"__esModule",{value:!0});Kn.AnimationFrameScheduler=void 0;var GL=Bn(),BL=function(r){UL(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0;var i=this._scheduled;this._scheduled=void 0;var n=this.actions,a;t=t||n.shift();do if(a=t.execute(t.state,t.delay))break;while((t=n[0])&&t.id===i&&n.shift());if(this._active=!1,a){for(;(t=n[0])&&t.id===i&&n.shift();)t.unsubscribe();throw a}},e}(GL.AsyncScheduler);Kn.AnimationFrameScheduler=BL});var e_=_(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.animationFrame=en.animationFrameScheduler=void 0;var HL=Jb(),$L=Zb();en.animationFrameScheduler=new $L.AnimationFrameScheduler(HL.AnimationFrameAction);en.animationFrame=en.animationFrameScheduler});var i_=_(ui=>{"use strict";var t_=ui&&ui.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(i[a]=n[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(ui,"__esModule",{value:!0});ui.VirtualAction=ui.VirtualTimeScheduler=void 0;var YL=Nn(),QL=Mt(),KL=Bn(),XL=function(r){t_(e,r);function e(t,i){t===void 0&&(t=r_),i===void 0&&(i=1/0);var n=r.call(this,t,function(){return n.frame})||this;return n.maxFrames=i,n.frame=0,n.index=-1,n}return e.prototype.flush=function(){for(var t=this,i=t.actions,n=t.maxFrames,a,u;(u=i[0])&&u.delay<=n&&(i.shift(),this.frame=u.delay,!(a=u.execute(u.state,u.delay))););if(a){for(;u=i.shift();)u.unsubscribe();throw a}},e.frameTimeFactor=10,e}(KL.AsyncScheduler);ui.VirtualTimeScheduler=XL;var r_=function(r){t_(e,r);function e(t,i,n){n===void 0&&(n=t.index+=1);var a=r.call(this,t,i)||this;return a.scheduler=t,a.work=i,a.index=n,a.active=!0,a.index=t.index=n,a}return e.prototype.schedule=function(t,i){if(i===void 0&&(i=0),Number.isFinite(i)){if(!this.id)return r.prototype.schedule.call(this,t,i);this.active=!1;var n=new e(this.scheduler,this.work);return this.add(n),n.schedule(t,i)}else return QL.Subscription.EMPTY},e.prototype.requestAsyncId=function(t,i,n){n===void 0&&(n=0),this.delay=t.frame+n;var a=t.actions;return a.push(this),a.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,i,n){n===void 0&&(n=0)},e.prototype._execute=function(t,i){if(this.active===!0)return r.prototype._execute.call(this,t,i)},e.sortActions=function(t,i){return t.delay===i.delay?t.index===i.index?0:t.index>i.index?1:-1:t.delay>i.delay?1:-1},e}(YL.AsyncAction);ui.VirtualAction=r_});var Zt=_(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.empty=tn.EMPTY=void 0;var n_=he();tn.EMPTY=new n_.Observable(function(r){return r.complete()});function JL(r){return r?ZL(r):tn.EMPTY}tn.empty=JL;function ZL(r){return new n_.Observable(function(e){return r.schedule(function(){return e.complete()})})}});var ba=_(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.isScheduler=void 0;var ej=le();function tj(r){return r&&ej.isFunction(r.schedule)}nu.isScheduler=tj});var Pt=_(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.popNumber=ci.popScheduler=ci.popResultSelector=void 0;var rj=le(),ij=ba();function qp(r){return r[r.length-1]}function nj(r){return rj.isFunction(qp(r))?r.pop():void 0}ci.popResultSelector=nj;function oj(r){return ij.isScheduler(qp(r))?r.pop():void 0}ci.popScheduler=oj;function aj(r,e){return typeof qp(r)=="number"?r.pop():e}ci.popNumber=aj});var au=_(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.isArrayLike=void 0;ou.isArrayLike=function(r){return r&&typeof r.length=="number"&&typeof r!="function"}});var xp=_(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.isPromise=void 0;var sj=le();function uj(r){return sj.isFunction(r?.then)}su.isPromise=uj});var Mp=_(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.isInteropObservable=void 0;var cj=da(),lj=le();function fj(r){return lj.isFunction(r[cj.observable])}uu.isInteropObservable=fj});var Lp=_(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.isAsyncIterable=void 0;var hj=le();function pj(r){return Symbol.asyncIterator&&hj.isFunction(r?.[Symbol.asyncIterator])}cu.isAsyncIterable=pj});var jp=_(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.createInvalidObservableTypeError=void 0;function dj(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}lu.createInvalidObservableTypeError=dj});var Ip=_(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.iterator=Xn.getSymbolIterator=void 0;function o_(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}Xn.getSymbolIterator=o_;Xn.iterator=o_()});var kp=_(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.isIterable=void 0;var vj=Ip(),mj=le();function yj(r){return mj.isFunction(r?.[vj.iterator])}fu.isIterable=yj});var hu=_(Ut=>{"use strict";var gj=Ut&&Ut.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(p){return function(v){return h([p,v])}}function h(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(a=p[0]&2?n.return:p[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,p[1])).done)return a;switch(n=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]1||l(T,S)})})}function l(T,S){try{h(i[T](S))}catch(q){b(a[0][3],q)}}function h(T){T.value instanceof Jn?Promise.resolve(T.value.v).then(p,v):b(a[0][2],T)}function p(T){l("next",T)}function v(T){l("throw",T)}function b(T,S){T(S),a.shift(),a.length&&l(a[0][0],a[0][1])}};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.isReadableStreamLike=Ut.readableStreamLikeToAsyncGenerator=void 0;var _j=le();function Pj(r){return bj(this,arguments,function(){var t,i,n,a;return gj(this,function(u){switch(u.label){case 0:t=r.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,Jn(t.read())];case 3:return i=u.sent(),n=i.value,a=i.done,a?[4,Jn(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,Jn(n)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}Ut.readableStreamLikeToAsyncGenerator=Pj;function wj(r){return _j.isFunction(r?.getReader)}Ut.isReadableStreamLike=wj});var X=_(be=>{"use strict";var Oj=be&&be.__awaiter||function(r,e,t,i){function n(a){return a instanceof t?a:new t(function(u){u(a)})}return new(t||(t=Promise))(function(a,u){function l(v){try{p(i.next(v))}catch(b){u(b)}}function h(v){try{p(i.throw(v))}catch(b){u(b)}}function p(v){v.done?a(v.value):n(v.value).then(l,h)}p((i=i.apply(r,e||[])).next())})},Tj=be&&be.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(p){return function(v){return h([p,v])}}function h(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(a=p[0]&2?n.return:p[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,p[1])).done)return a;switch(n=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(be,"__esModule",{value:!0});be.fromReadableStreamLike=be.fromAsyncIterable=be.fromIterable=be.fromPromise=be.fromArrayLike=be.fromInteropObservable=be.innerFrom=void 0;var Cj=au(),Aj=xp(),Zn=he(),Ej=Mp(),qj=Lp(),xj=jp(),Mj=kp(),a_=hu(),Lj=le(),jj=dp(),Ij=da();function kj(r){if(r instanceof Zn.Observable)return r;if(r!=null){if(Ej.isInteropObservable(r))return s_(r);if(Cj.isArrayLike(r))return u_(r);if(Aj.isPromise(r))return c_(r);if(qj.isAsyncIterable(r))return Dp(r);if(Mj.isIterable(r))return l_(r);if(a_.isReadableStreamLike(r))return f_(r)}throw xj.createInvalidObservableTypeError(r)}be.innerFrom=kj;function s_(r){return new Zn.Observable(function(e){var t=r[Ij.observable]();if(Lj.isFunction(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}be.fromInteropObservable=s_;function u_(r){return new Zn.Observable(function(e){for(var t=0;t{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.executeSchedule=void 0;function Dj(r,e,t,i,n){i===void 0&&(i=0),n===void 0&&(n=!1);var a=e.schedule(function(){t(),n?r.add(this.schedule(null,i)):this.unsubscribe()},i);if(r.add(a),!n)return a}pu.executeSchedule=Dj});var eo=_(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.observeOn=void 0;var Rp=Vr(),Rj=z(),zj=U();function Vj(r,e){return e===void 0&&(e=0),Rj.operate(function(t,i){t.subscribe(zj.createOperatorSubscriber(i,function(n){return Rp.executeSchedule(i,r,function(){return i.next(n)},e)},function(){return Rp.executeSchedule(i,r,function(){return i.complete()},e)},function(n){return Rp.executeSchedule(i,r,function(){return i.error(n)},e)}))})}du.observeOn=Vj});var to=_(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.subscribeOn=void 0;var Nj=z();function Wj(r,e){return e===void 0&&(e=0),Nj.operate(function(t,i){i.add(r.schedule(function(){return t.subscribe(i)},e))})}vu.subscribeOn=Wj});var h_=_(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.scheduleObservable=void 0;var Uj=X(),Gj=eo(),Bj=to();function Hj(r,e){return Uj.innerFrom(r).pipe(Bj.subscribeOn(e),Gj.observeOn(e))}mu.scheduleObservable=Hj});var p_=_(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.schedulePromise=void 0;var $j=X(),Yj=eo(),Qj=to();function Kj(r,e){return $j.innerFrom(r).pipe(Qj.subscribeOn(e),Yj.observeOn(e))}yu.schedulePromise=Kj});var d_=_(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.scheduleArray=void 0;var Xj=he();function Jj(r,e){return new Xj.Observable(function(t){var i=0;return e.schedule(function(){i===r.length?t.complete():(t.next(r[i++]),t.closed||this.schedule())})})}gu.scheduleArray=Jj});var zp=_(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.scheduleIterable=void 0;var Zj=he(),eI=Ip(),tI=le(),v_=Vr();function rI(r,e){return new Zj.Observable(function(t){var i;return v_.executeSchedule(t,e,function(){i=r[eI.iterator](),v_.executeSchedule(t,e,function(){var n,a,u;try{n=i.next(),a=n.value,u=n.done}catch(l){t.error(l);return}u?t.complete():t.next(a)},0,!0)}),function(){return tI.isFunction(i?.return)&&i.return()}})}bu.scheduleIterable=rI});var Vp=_(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.scheduleAsyncIterable=void 0;var iI=he(),m_=Vr();function nI(r,e){if(!r)throw new Error("Iterable cannot be null");return new iI.Observable(function(t){m_.executeSchedule(t,e,function(){var i=r[Symbol.asyncIterator]();m_.executeSchedule(t,e,function(){i.next().then(function(n){n.done?t.complete():t.next(n.value)})},0,!0)})})}_u.scheduleAsyncIterable=nI});var y_=_(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.scheduleReadableStreamLike=void 0;var oI=Vp(),aI=hu();function sI(r,e){return oI.scheduleAsyncIterable(aI.readableStreamLikeToAsyncGenerator(r),e)}Pu.scheduleReadableStreamLike=sI});var Np=_(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.scheduled=void 0;var uI=h_(),cI=p_(),lI=d_(),fI=zp(),hI=Vp(),pI=Mp(),dI=xp(),vI=au(),mI=kp(),yI=Lp(),gI=jp(),bI=hu(),_I=y_();function PI(r,e){if(r!=null){if(pI.isInteropObservable(r))return uI.scheduleObservable(r,e);if(vI.isArrayLike(r))return lI.scheduleArray(r,e);if(dI.isPromise(r))return cI.schedulePromise(r,e);if(yI.isAsyncIterable(r))return hI.scheduleAsyncIterable(r,e);if(mI.isIterable(r))return fI.scheduleIterable(r,e);if(bI.isReadableStreamLike(r))return _I.scheduleReadableStreamLike(r,e)}throw gI.createInvalidObservableTypeError(r)}wu.scheduled=PI});var Nr=_(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.from=void 0;var wI=Np(),OI=X();function TI(r,e){return e?wI.scheduled(r,e):OI.innerFrom(r)}Ou.from=TI});var Su=_(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.of=void 0;var SI=Pt(),CI=Nr();function AI(){for(var r=[],e=0;e{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.throwError=void 0;var EI=he(),qI=le();function xI(r,e){var t=qI.isFunction(r)?r:function(){return r},i=function(n){return n.error(t())};return new EI.Observable(e?function(n){return e.schedule(i,0,n)}:i)}Cu.throwError=xI});var Au=_(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.observeNotification=Wr.Notification=Wr.NotificationKind=void 0;var MI=Zt(),LI=Su(),jI=Wp(),II=le(),kI;(function(r){r.NEXT="N",r.ERROR="E",r.COMPLETE="C"})(kI=Wr.NotificationKind||(Wr.NotificationKind={}));var FI=function(){function r(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue=e==="N"}return r.prototype.observe=function(e){return g_(this,e)},r.prototype.do=function(e,t,i){var n=this,a=n.kind,u=n.value,l=n.error;return a==="N"?e?.(u):a==="E"?t?.(l):i?.()},r.prototype.accept=function(e,t,i){var n;return II.isFunction((n=e)===null||n===void 0?void 0:n.next)?this.observe(e):this.do(e,t,i)},r.prototype.toObservable=function(){var e=this,t=e.kind,i=e.value,n=e.error,a=t==="N"?LI.of(i):t==="E"?jI.throwError(function(){return n}):t==="C"?MI.EMPTY:0;if(!a)throw new TypeError("Unexpected notification kind "+t);return a},r.createNext=function(e){return new r("N",e)},r.createError=function(e){return new r("E",void 0,e)},r.createComplete=function(){return r.completeNotification},r.completeNotification=new r("C"),r}();Wr.Notification=FI;function g_(r,e){var t,i,n,a=r,u=a.kind,l=a.value,h=a.error;if(typeof u!="string")throw new TypeError('Invalid notification, missing "kind"');u==="N"?(t=e.next)===null||t===void 0||t.call(e,l):u==="E"?(i=e.error)===null||i===void 0||i.call(e,h):(n=e.complete)===null||n===void 0||n.call(e)}Wr.observeNotification=g_});var __=_(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.isObservable=void 0;var DI=he(),b_=le();function RI(r){return!!r&&(r instanceof DI.Observable||b_.isFunction(r.lift)&&b_.isFunction(r.subscribe))}Eu.isObservable=RI});var li=_(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.EmptyError=void 0;var zI=ai();qu.EmptyError=zI.createErrorClass(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}})});var P_=_(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.lastValueFrom=void 0;var VI=li();function NI(r,e){var t=typeof e=="object";return new Promise(function(i,n){var a=!1,u;r.subscribe({next:function(l){u=l,a=!0},error:n,complete:function(){a?i(u):t?i(e.defaultValue):n(new VI.EmptyError)}})})}xu.lastValueFrom=NI});var w_=_(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.firstValueFrom=void 0;var WI=li(),UI=Ln();function GI(r,e){var t=typeof e=="object";return new Promise(function(i,n){var a=new UI.SafeSubscriber({next:function(u){i(u),a.unsubscribe()},error:n,complete:function(){t?i(e.defaultValue):n(new WI.EmptyError)}});r.subscribe(a)})}Mu.firstValueFrom=GI});var Up=_(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.ArgumentOutOfRangeError=void 0;var BI=ai();Lu.ArgumentOutOfRangeError=BI.createErrorClass(function(r){return function(){r(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var Gp=_(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.NotFoundError=void 0;var HI=ai();ju.NotFoundError=HI.createErrorClass(function(r){return function(t){r(this),this.name="NotFoundError",this.message=t}})});var Bp=_(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.SequenceError=void 0;var $I=ai();Iu.SequenceError=$I.createErrorClass(function(r){return function(t){r(this),this.name="SequenceError",this.message=t}})});var Fu=_(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.isValidDate=void 0;function YI(r){return r instanceof Date&&!isNaN(r)}ku.isValidDate=YI});var _a=_(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.timeout=rn.TimeoutError=void 0;var QI=_t(),KI=Fu(),XI=z(),JI=X(),ZI=ai(),ek=U(),tk=Vr();rn.TimeoutError=ZI.createErrorClass(function(r){return function(t){t===void 0&&(t=null),r(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function rk(r,e){var t=KI.isValidDate(r)?{first:r}:typeof r=="number"?{each:r}:r,i=t.first,n=t.each,a=t.with,u=a===void 0?ik:a,l=t.scheduler,h=l===void 0?e??QI.asyncScheduler:l,p=t.meta,v=p===void 0?null:p;if(i==null&&n==null)throw new TypeError("No timeout provided.");return XI.operate(function(b,T){var S,q,M=null,j=0,D=function(V){q=tk.executeSchedule(T,h,function(){try{S.unsubscribe(),JI.innerFrom(u({meta:v,lastValue:M,seen:j})).subscribe(T)}catch(Y){T.error(Y)}},V)};S=b.subscribe(ek.createOperatorSubscriber(T,function(V){q?.unsubscribe(),j++,T.next(M=V),n>0&&D(n)},void 0,void 0,function(){q?.closed||q?.unsubscribe(),M=null})),!j&&D(i!=null?typeof i=="number"?i:+i-h.now():n)})}rn.timeout=rk;function ik(r){throw new rn.TimeoutError(r)}});var Ur=_(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.map=void 0;var nk=z(),ok=U();function ak(r,e){return nk.operate(function(t,i){var n=0;t.subscribe(ok.createOperatorSubscriber(i,function(a){i.next(r.call(e,a,n++))}))})}Du.map=ak});var hi=_(fi=>{"use strict";var sk=fi&&fi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},uk=fi&&fi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";var pk=pi&&pi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},O_=pi&&pi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.bindCallback=void 0;var _k=$p();function Pk(r,e,t){return _k.bindCallbackInternals(!1,r,e,t)}Ru.bindCallback=Pk});var S_=_(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.bindNodeCallback=void 0;var wk=$p();function Ok(r,e,t){return wk.bindCallbackInternals(!0,r,e,t)}zu.bindNodeCallback=Ok});var Yp=_(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.argsArgArrayOrObject=void 0;var Tk=Array.isArray,Sk=Object.getPrototypeOf,Ck=Object.prototype,Ak=Object.keys;function Ek(r){if(r.length===1){var e=r[0];if(Tk(e))return{args:e,keys:null};if(qk(e)){var t=Ak(e);return{args:t.map(function(i){return e[i]}),keys:t}}}return{args:r,keys:null}}Vu.argsArgArrayOrObject=Ek;function qk(r){return r&&typeof r=="object"&&Sk(r)===Ck}});var Qp=_(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.createObject=void 0;function xk(r,e){return r.reduce(function(t,i,n){return t[i]=e[n],t},{})}Nu.createObject=xk});var Wu=_(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.combineLatestInit=ro.combineLatest=void 0;var Mk=he(),Lk=Yp(),E_=Nr(),q_=Xe(),jk=hi(),C_=Pt(),Ik=Qp(),kk=U(),Fk=Vr();function Dk(){for(var r=[],e=0;e{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.mergeInternals=void 0;var Rk=X(),zk=Vr(),M_=U();function Vk(r,e,t,i,n,a,u,l){var h=[],p=0,v=0,b=!1,T=function(){b&&!h.length&&!p&&e.complete()},S=function(M){return p{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.mergeMap=void 0;var Nk=Ur(),Wk=X(),Uk=z(),Gk=Gu(),Bk=le();function L_(r,e,t){return t===void 0&&(t=1/0),Bk.isFunction(e)?L_(function(i,n){return Nk.map(function(a,u){return e(i,a,n,u)})(Wk.innerFrom(r(i,n)))},t):(typeof e=="number"&&(t=e),Uk.operate(function(i,n){return Gk.mergeInternals(i,n,r,t)}))}Bu.mergeMap=L_});var io=_(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.mergeAll=void 0;var Hk=vr(),$k=Xe();function Yk(r){return r===void 0&&(r=1/0),Hk.mergeMap($k.identity,r)}Hu.mergeAll=Yk});var Pa=_($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.concatAll=void 0;var Qk=io();function Kk(){return Qk.mergeAll(1)}$u.concatAll=Kk});var wa=_(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.concat=void 0;var Xk=Pa(),Jk=Pt(),Zk=Nr();function eF(){for(var r=[],e=0;e{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.defer=void 0;var tF=he(),rF=X();function iF(r){return new tF.Observable(function(e){rF.innerFrom(r()).subscribe(e)})}Qu.defer=iF});var j_=_(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.connectable=void 0;var nF=Je(),oF=he(),aF=Oa(),sF={connector:function(){return new nF.Subject},resetOnDisconnect:!0};function uF(r,e){e===void 0&&(e=sF);var t=null,i=e.connector,n=e.resetOnDisconnect,a=n===void 0?!0:n,u=i(),l=new oF.Observable(function(h){return u.subscribe(h)});return l.connect=function(){return(!t||t.closed)&&(t=aF.defer(function(){return r}).subscribe(u),a&&t.add(function(){return u=i()})),t},l}Ku.connectable=uF});var I_=_(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.forkJoin=void 0;var cF=he(),lF=Yp(),fF=X(),hF=Pt(),pF=U(),dF=hi(),vF=Qp();function mF(){for(var r=[],e=0;e{"use strict";var yF=no&&no.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a};Object.defineProperty(no,"__esModule",{value:!0});no.fromEvent=void 0;var gF=X(),bF=he(),_F=vr(),PF=au(),nn=le(),wF=hi(),OF=["addListener","removeListener"],TF=["addEventListener","removeEventListener"],SF=["on","off"];function Kp(r,e,t,i){if(nn.isFunction(t)&&(i=t,t=void 0),i)return Kp(r,e,t).pipe(wF.mapOneOrManyArgs(i));var n=yF(EF(r)?TF.map(function(l){return function(h){return r[l](e,h,t)}}):CF(r)?OF.map(k_(r,e)):AF(r)?SF.map(k_(r,e)):[],2),a=n[0],u=n[1];if(!a&&PF.isArrayLike(r))return _F.mergeMap(function(l){return Kp(l,e,t)})(gF.innerFrom(r));if(!a)throw new TypeError("Invalid event target");return new bF.Observable(function(l){var h=function(){for(var p=[],v=0;v{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.fromEventPattern=void 0;var qF=he(),xF=le(),MF=hi();function D_(r,e,t){return t?D_(r,e).pipe(MF.mapOneOrManyArgs(t)):new qF.Observable(function(i){var n=function(){for(var u=[],l=0;l{"use strict";var LF=oo&&oo.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(p){return function(v){return h([p,v])}}function h(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(a=p[0]&2?n.return:p[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,p[1])).done)return a;switch(n=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.iif=void 0;var DF=Oa();function RF(r,e,t){return DF.defer(function(){return r()?e:t})}Zu.iif=RF});var di=_(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.timer=void 0;var zF=he(),VF=_t(),NF=ba(),WF=Fu();function UF(r,e,t){r===void 0&&(r=0),t===void 0&&(t=VF.async);var i=-1;return e!=null&&(NF.isScheduler(e)?t=e:i=e),new zF.Observable(function(n){var a=WF.isValidDate(r)?+r-t.now():r;a<0&&(a=0);var u=0;return t.schedule(function(){n.closed||(n.next(u++),0<=i?this.schedule(void 0,i):n.complete())},a)})}ec.timer=UF});var Xp=_(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.interval=void 0;var GF=_t(),BF=di();function HF(r,e){return r===void 0&&(r=0),e===void 0&&(e=GF.asyncScheduler),r<0&&(r=0),BF.timer(r,r,e)}tc.interval=HF});var U_=_(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.merge=void 0;var $F=io(),YF=X(),QF=Zt(),W_=Pt(),KF=Nr();function XF(){for(var r=[],e=0;e{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.never=on.NEVER=void 0;var JF=he(),ZF=Ke();on.NEVER=new JF.Observable(ZF.noop);function eD(){return on.NEVER}on.never=eD});var vi=_(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.argsOrArgArray=void 0;var tD=Array.isArray;function rD(r){return r.length===1&&tD(r[0])?r[0]:r}ic.argsOrArgArray=rD});var Zp=_(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.onErrorResumeNext=void 0;var iD=he(),nD=vi(),oD=U(),G_=Ke(),aD=X();function sD(){for(var r=[],e=0;e{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.pairs=void 0;var uD=Nr();function cD(r,e){return uD.from(Object.entries(r),e)}oc.pairs=cD});var ed=_(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.not=void 0;function lD(r,e){return function(t,i){return!r.call(e,t,i)}}ac.not=lD});var Gr=_(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.filter=void 0;var fD=z(),hD=U();function pD(r,e){return fD.operate(function(t,i){var n=0;t.subscribe(hD.createOperatorSubscriber(i,function(a){return r.call(e,a,n++)&&i.next(a)}))})}sc.filter=pD});var Y_=_(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.partition=void 0;var dD=ed(),H_=Gr(),$_=X();function vD(r,e,t){return[H_.filter(e,t)($_.innerFrom(r)),H_.filter(dD.not(e,t))($_.innerFrom(r))]}uc.partition=vD});var td=_(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.raceInit=ao.race=void 0;var mD=he(),Q_=X(),yD=vi(),gD=U();function bD(){for(var r=[],e=0;e{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.range=void 0;var _D=he(),PD=Zt();function wD(r,e,t){if(e==null&&(e=r,r=0),e<=0)return PD.EMPTY;var i=e+r;return new _D.Observable(t?function(n){var a=r;return t.schedule(function(){a{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.using=void 0;var OD=he(),TD=X(),SD=Zt();function CD(r,e){return new OD.Observable(function(t){var i=r(),n=e(i),a=n?TD.innerFrom(n):SD.EMPTY;return a.subscribe(t),function(){i&&i.unsubscribe()}})}lc.using=CD});var fc=_(mi=>{"use strict";var AD=mi&&mi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},ED=mi&&mi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0})});var pc=_(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.audit=void 0;var FD=z(),DD=X(),t0=U();function RD(r){return FD.operate(function(e,t){var i=!1,n=null,a=null,u=!1,l=function(){if(a?.unsubscribe(),a=null,i){i=!1;var p=n;n=null,t.next(p)}u&&t.complete()},h=function(){a=null,u&&t.complete()};e.subscribe(t0.createOperatorSubscriber(t,function(p){i=!0,n=p,a||DD.innerFrom(r(p)).subscribe(a=t0.createOperatorSubscriber(t,l,h))},function(){u=!0,(!i||!a||a.closed)&&t.complete()}))})}hc.audit=RD});var rd=_(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.auditTime=void 0;var zD=_t(),VD=pc(),ND=di();function WD(r,e){return e===void 0&&(e=zD.asyncScheduler),VD.audit(function(){return ND.timer(r,e)})}dc.auditTime=WD});var id=_(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.buffer=void 0;var UD=z(),GD=Ke(),r0=U(),BD=X();function HD(r){return UD.operate(function(e,t){var i=[];return e.subscribe(r0.createOperatorSubscriber(t,function(n){return i.push(n)},function(){t.next(i),t.complete()})),BD.innerFrom(r).subscribe(r0.createOperatorSubscriber(t,function(){var n=i;i=[],t.next(n)},GD.noop)),function(){i=null}})}vc.buffer=HD});var od=_(so=>{"use strict";var nd=so&&so.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(so,"__esModule",{value:!0});so.bufferCount=void 0;var $D=z(),YD=U(),QD=zr();function KD(r,e){return e===void 0&&(e=null),e=e??r,$D.operate(function(t,i){var n=[],a=0;t.subscribe(YD.createOperatorSubscriber(i,function(u){var l,h,p,v,b=null;a++%e===0&&n.push([]);try{for(var T=nd(n),S=T.next();!S.done;S=T.next()){var q=S.value;q.push(u),r<=q.length&&(b=b??[],b.push(q))}}catch(D){l={error:D}}finally{try{S&&!S.done&&(h=T.return)&&h.call(T)}finally{if(l)throw l.error}}if(b)try{for(var M=nd(b),j=M.next();!j.done;j=M.next()){var q=j.value;QD.arrRemove(n,q),i.next(q)}}catch(D){p={error:D}}finally{try{j&&!j.done&&(v=M.return)&&v.call(M)}finally{if(p)throw p.error}}},function(){var u,l;try{for(var h=nd(n),p=h.next();!p.done;p=h.next()){var v=p.value;i.next(v)}}catch(b){u={error:b}}finally{try{p&&!p.done&&(l=h.return)&&l.call(h)}finally{if(u)throw u.error}}i.complete()},void 0,function(){n=null}))})}so.bufferCount=KD});var ad=_(uo=>{"use strict";var XD=uo&&uo.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(uo,"__esModule",{value:!0});uo.bufferTime=void 0;var JD=Mt(),ZD=z(),eR=U(),tR=zr(),rR=_t(),iR=Pt(),i0=Vr();function nR(r){for(var e,t,i=[],n=1;n=0?i0.executeSchedule(p,a,S,u,!0):b=!0,S();var q=eR.createOperatorSubscriber(p,function(M){var j,D,V=v.slice();try{for(var Y=XD(V),ie=Y.next();!ie.done;ie=Y.next()){var pe=ie.value,ke=pe.buffer;ke.push(M),l<=ke.length&&T(pe)}}catch(pt){j={error:pt}}finally{try{ie&&!ie.done&&(D=Y.return)&&D.call(Y)}finally{if(j)throw j.error}}},function(){for(;v?.length;)p.next(v.shift().buffer);q?.unsubscribe(),p.complete(),p.unsubscribe()},void 0,function(){return v=null});h.subscribe(q)})}uo.bufferTime=nR});var ud=_(co=>{"use strict";var oR=co&&co.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(co,"__esModule",{value:!0});co.bufferToggle=void 0;var aR=Mt(),sR=z(),n0=X(),sd=U(),o0=Ke(),uR=zr();function cR(r,e){return sR.operate(function(t,i){var n=[];n0.innerFrom(r).subscribe(sd.createOperatorSubscriber(i,function(a){var u=[];n.push(u);var l=new aR.Subscription,h=function(){uR.arrRemove(n,u),i.next(u),l.unsubscribe()};l.add(n0.innerFrom(e(a)).subscribe(sd.createOperatorSubscriber(i,h,o0.noop)))},o0.noop)),t.subscribe(sd.createOperatorSubscriber(i,function(a){var u,l;try{for(var h=oR(n),p=h.next();!p.done;p=h.next()){var v=p.value;v.push(a)}}catch(b){u={error:b}}finally{try{p&&!p.done&&(l=h.return)&&l.call(h)}finally{if(u)throw u.error}}},function(){for(;n.length>0;)i.next(n.shift());i.complete()}))})}co.bufferToggle=cR});var cd=_(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.bufferWhen=void 0;var lR=z(),fR=Ke(),a0=U(),hR=X();function pR(r){return lR.operate(function(e,t){var i=null,n=null,a=function(){n?.unsubscribe();var u=i;i=[],u&&t.next(u),hR.innerFrom(r()).subscribe(n=a0.createOperatorSubscriber(t,a,fR.noop))};a(),e.subscribe(a0.createOperatorSubscriber(t,function(u){return i?.push(u)},function(){i&&t.next(i),t.complete()},void 0,function(){return i=n=null}))})}mc.bufferWhen=pR});var ld=_(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.catchError=void 0;var dR=X(),vR=U(),mR=z();function s0(r){return mR.operate(function(e,t){var i=null,n=!1,a;i=e.subscribe(vR.createOperatorSubscriber(t,void 0,void 0,function(u){a=dR.innerFrom(r(u,s0(r)(e))),i?(i.unsubscribe(),i=null,a.subscribe(t)):n=!0})),n&&(i.unsubscribe(),i=null,a.subscribe(t))})}yc.catchError=s0});var fd=_(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.scanInternals=void 0;var yR=U();function gR(r,e,t,i,n){return function(a,u){var l=t,h=e,p=0;a.subscribe(yR.createOperatorSubscriber(u,function(v){var b=p++;h=l?r(h,v,b):(l=!0,v),i&&u.next(h)},n&&function(){l&&u.next(h),u.complete()}))}}gc.scanInternals=gR});var an=_(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.reduce=void 0;var bR=fd(),_R=z();function PR(r,e){return _R.operate(bR.scanInternals(r,e,arguments.length>=2,!1,!0))}bc.reduce=PR});var Pc=_(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.toArray=void 0;var wR=an(),OR=z(),TR=function(r,e){return r.push(e),r};function SR(){return OR.operate(function(r,e){wR.reduce(TR,[])(r).subscribe(e)})}_c.toArray=SR});var hd=_(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.joinAllInternals=void 0;var CR=Xe(),AR=hi(),ER=va(),qR=vr(),xR=Pc();function MR(r,e){return ER.pipe(xR.toArray(),qR.mergeMap(function(t){return r(t)}),e?AR.mapOneOrManyArgs(e):CR.identity)}wc.joinAllInternals=MR});var Tc=_(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.combineLatestAll=void 0;var LR=Wu(),jR=hd();function IR(r){return jR.joinAllInternals(LR.combineLatest,r)}Oc.combineLatestAll=IR});var pd=_(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.combineAll=void 0;var kR=Tc();Sc.combineAll=kR.combineLatestAll});var dd=_(yi=>{"use strict";var u0=yi&&yi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},c0=yi&&yi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";var WR=gi&&gi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},UR=gi&&gi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.concatMap=void 0;var f0=vr(),HR=le();function $R(r,e){return HR.isFunction(e)?f0.mergeMap(r,e,1):f0.mergeMap(r,1)}Cc.concatMap=$R});var md=_(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.concatMapTo=void 0;var h0=Ac(),YR=le();function QR(r,e){return YR.isFunction(e)?h0.concatMap(function(){return r},e):h0.concatMap(function(){return r})}Ec.concatMapTo=QR});var yd=_(bi=>{"use strict";var KR=bi&&bi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},XR=bi&&bi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";var iz=_i&&_i.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},nz=_i&&_i.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.fromSubscribable=void 0;var sz=he();function uz(r){return new sz.Observable(function(e){return r.subscribe(e)})}qc.fromSubscribable=uz});var Ta=_(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.connect=void 0;var cz=Je(),lz=X(),fz=z(),hz=p0(),pz={connector:function(){return new cz.Subject}};function dz(r,e){e===void 0&&(e=pz);var t=e.connector;return fz.operate(function(i,n){var a=t();lz.innerFrom(r(hz.fromSubscribable(a))).subscribe(n),n.add(i.subscribe(a))})}xc.connect=dz});var bd=_(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.count=void 0;var vz=an();function mz(r){return vz.reduce(function(e,t,i){return!r||r(t,i)?e+1:e},0)}Mc.count=mz});var _d=_(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.debounce=void 0;var yz=z(),gz=Ke(),d0=U(),bz=X();function _z(r){return yz.operate(function(e,t){var i=!1,n=null,a=null,u=function(){if(a?.unsubscribe(),a=null,i){i=!1;var l=n;n=null,t.next(l)}};e.subscribe(d0.createOperatorSubscriber(t,function(l){a?.unsubscribe(),i=!0,n=l,a=d0.createOperatorSubscriber(t,u,gz.noop),bz.innerFrom(r(l)).subscribe(a)},function(){u(),t.complete()},void 0,function(){n=a=null}))})}Lc.debounce=_z});var Pd=_(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.debounceTime=void 0;var Pz=_t(),wz=z(),Oz=U();function Tz(r,e){return e===void 0&&(e=Pz.asyncScheduler),wz.operate(function(t,i){var n=null,a=null,u=null,l=function(){if(n){n.unsubscribe(),n=null;var p=a;a=null,i.next(p)}};function h(){var p=u+r,v=e.now();if(v{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.defaultIfEmpty=void 0;var Sz=z(),Cz=U();function Az(r){return Sz.operate(function(e,t){var i=!1;e.subscribe(Cz.createOperatorSubscriber(t,function(n){i=!0,t.next(n)},function(){i||t.next(r),t.complete()}))})}Ic.defaultIfEmpty=Az});var fo=_(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.take=void 0;var Ez=Zt(),qz=z(),xz=U();function Mz(r){return r<=0?function(){return Ez.EMPTY}:qz.operate(function(e,t){var i=0;e.subscribe(xz.createOperatorSubscriber(t,function(n){++i<=r&&(t.next(n),r<=i&&t.complete())}))})}kc.take=Mz});var Dc=_(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.ignoreElements=void 0;var Lz=z(),jz=U(),Iz=Ke();function kz(){return Lz.operate(function(r,e){r.subscribe(jz.createOperatorSubscriber(e,Iz.noop))})}Fc.ignoreElements=kz});var zc=_(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.mapTo=void 0;var Fz=Ur();function Dz(r){return Fz.map(function(){return r})}Rc.mapTo=Dz});var Nc=_(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.delayWhen=void 0;var Rz=wa(),v0=fo(),zz=Dc(),Vz=zc(),Nz=vr(),Wz=X();function m0(r,e){return e?function(t){return Rz.concat(e.pipe(v0.take(1),zz.ignoreElements()),t.pipe(m0(r)))}:Nz.mergeMap(function(t,i){return Wz.innerFrom(r(t,i)).pipe(v0.take(1),Vz.mapTo(t))})}Vc.delayWhen=m0});var wd=_(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.delay=void 0;var Uz=_t(),Gz=Nc(),Bz=di();function Hz(r,e){e===void 0&&(e=Uz.asyncScheduler);var t=Bz.timer(r,e);return Gz.delayWhen(function(){return t})}Wc.delay=Hz});var Od=_(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.dematerialize=void 0;var $z=Au(),Yz=z(),Qz=U();function Kz(){return Yz.operate(function(r,e){r.subscribe(Qz.createOperatorSubscriber(e,function(t){return $z.observeNotification(t,e)}))})}Uc.dematerialize=Kz});var Td=_(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.distinct=void 0;var Xz=z(),y0=U(),Jz=Ke(),Zz=X();function eV(r,e){return Xz.operate(function(t,i){var n=new Set;t.subscribe(y0.createOperatorSubscriber(i,function(a){var u=r?r(a):a;n.has(u)||(n.add(u),i.next(a))})),e&&Zz.innerFrom(e).subscribe(y0.createOperatorSubscriber(i,function(){return n.clear()},Jz.noop))})}Gc.distinct=eV});var Hc=_(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.distinctUntilChanged=void 0;var tV=Xe(),rV=z(),iV=U();function nV(r,e){return e===void 0&&(e=tV.identity),r=r??oV,rV.operate(function(t,i){var n,a=!0;t.subscribe(iV.createOperatorSubscriber(i,function(u){var l=e(u);(a||!r(n,l))&&(a=!1,n=l,i.next(u))}))})}Bc.distinctUntilChanged=nV;function oV(r,e){return r===e}});var Sd=_($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.distinctUntilKeyChanged=void 0;var aV=Hc();function sV(r,e){return aV.distinctUntilChanged(function(t,i){return e?e(t[r],i[r]):t[r]===i[r]})}$c.distinctUntilKeyChanged=sV});var ho=_(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.throwIfEmpty=void 0;var uV=li(),cV=z(),lV=U();function fV(r){return r===void 0&&(r=hV),cV.operate(function(e,t){var i=!1;e.subscribe(lV.createOperatorSubscriber(t,function(n){i=!0,t.next(n)},function(){return i?t.complete():t.error(r())}))})}Yc.throwIfEmpty=fV;function hV(){return new uV.EmptyError}});var Cd=_(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.elementAt=void 0;var g0=Up(),pV=Gr(),dV=ho(),vV=lo(),mV=fo();function yV(r,e){if(r<0)throw new g0.ArgumentOutOfRangeError;var t=arguments.length>=2;return function(i){return i.pipe(pV.filter(function(n,a){return a===r}),mV.take(1),t?vV.defaultIfEmpty(e):dV.throwIfEmpty(function(){return new g0.ArgumentOutOfRangeError}))}}Qc.elementAt=yV});var Ad=_(Pi=>{"use strict";var gV=Pi&&Pi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},bV=Pi&&Pi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.every=void 0;var OV=z(),TV=U();function SV(r,e){return OV.operate(function(t,i){var n=0;t.subscribe(TV.createOperatorSubscriber(i,function(a){r.call(e,a,n++,t)||(i.next(!1),i.complete())},function(){i.next(!0),i.complete()}))})}Kc.every=SV});var Jc=_(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.exhaustMap=void 0;var CV=Ur(),b0=X(),AV=z(),_0=U();function P0(r,e){return e?function(t){return t.pipe(P0(function(i,n){return b0.innerFrom(r(i,n)).pipe(CV.map(function(a,u){return e(i,a,n,u)}))}))}:AV.operate(function(t,i){var n=0,a=null,u=!1;t.subscribe(_0.createOperatorSubscriber(i,function(l){a||(a=_0.createOperatorSubscriber(i,void 0,function(){a=null,u&&i.complete()}),b0.innerFrom(r(l,n++)).subscribe(a))},function(){u=!0,!a&&i.complete()}))})}Xc.exhaustMap=P0});var el=_(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.exhaustAll=void 0;var EV=Jc(),qV=Xe();function xV(){return EV.exhaustMap(qV.identity)}Zc.exhaustAll=xV});var qd=_(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.exhaust=void 0;var MV=el();tl.exhaust=MV.exhaustAll});var xd=_(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.expand=void 0;var LV=z(),jV=Gu();function IV(r,e,t){return e===void 0&&(e=1/0),e=(e||0)<1?1/0:e,LV.operate(function(i,n){return jV.mergeInternals(i,n,r,e,void 0,!0,t)})}rl.expand=IV});var Md=_(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.finalize=void 0;var kV=z();function FV(r){return kV.operate(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}il.finalize=FV});var nl=_(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.createFind=po.find=void 0;var DV=z(),RV=U();function zV(r,e){return DV.operate(w0(r,e,"value"))}po.find=zV;function w0(r,e,t){var i=t==="index";return function(n,a){var u=0;n.subscribe(RV.createOperatorSubscriber(a,function(l){var h=u++;r.call(e,l,h,n)&&(a.next(i?h:l),a.complete())},function(){a.next(i?-1:void 0),a.complete()}))}}po.createFind=w0});var Ld=_(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.findIndex=void 0;var VV=z(),NV=nl();function WV(r,e){return VV.operate(NV.createFind(r,e,"index"))}ol.findIndex=WV});var jd=_(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.first=void 0;var UV=li(),GV=Gr(),BV=fo(),HV=lo(),$V=ho(),YV=Xe();function QV(r,e){var t=arguments.length>=2;return function(i){return i.pipe(r?GV.filter(function(n,a){return r(n,a,i)}):YV.identity,BV.take(1),t?HV.defaultIfEmpty(e):$V.throwIfEmpty(function(){return new UV.EmptyError}))}}al.first=QV});var Id=_(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.groupBy=void 0;var KV=he(),XV=X(),JV=Je(),ZV=z(),O0=U();function eN(r,e,t,i){return ZV.operate(function(n,a){var u;!e||typeof e=="function"?u=e:(t=e.duration,u=e.element,i=e.connector);var l=new Map,h=function(q){l.forEach(q),q(a)},p=function(q){return h(function(M){return M.error(q)})},v=0,b=!1,T=new O0.OperatorSubscriber(a,function(q){try{var M=r(q),j=l.get(M);if(!j){l.set(M,j=i?i():new JV.Subject);var D=S(M,j);if(a.next(D),t){var V=O0.createOperatorSubscriber(j,function(){j.complete(),V?.unsubscribe()},void 0,void 0,function(){return l.delete(M)});T.add(XV.innerFrom(t(D)).subscribe(V))}}j.next(u?u(q):q)}catch(Y){p(Y)}},function(){return h(function(q){return q.complete()})},p,function(){return l.clear()},function(){return b=!0,v===0});n.subscribe(T);function S(q,M){var j=new KV.Observable(function(D){v++;var V=M.subscribe(D);return function(){V.unsubscribe(),--v===0&&b&&T.unsubscribe()}});return j.key=q,j}})}sl.groupBy=eN});var kd=_(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.isEmpty=void 0;var tN=z(),rN=U();function iN(){return tN.operate(function(r,e){r.subscribe(rN.createOperatorSubscriber(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}ul.isEmpty=iN});var cl=_(vo=>{"use strict";var nN=vo&&vo.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(vo,"__esModule",{value:!0});vo.takeLast=void 0;var oN=Zt(),aN=z(),sN=U();function uN(r){return r<=0?function(){return oN.EMPTY}:aN.operate(function(e,t){var i=[];e.subscribe(sN.createOperatorSubscriber(t,function(n){i.push(n),r{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.last=void 0;var cN=li(),lN=Gr(),fN=cl(),hN=ho(),pN=lo(),dN=Xe();function vN(r,e){var t=arguments.length>=2;return function(i){return i.pipe(r?lN.filter(function(n,a){return r(n,a,i)}):dN.identity,fN.takeLast(1),t?pN.defaultIfEmpty(e):hN.throwIfEmpty(function(){return new cN.EmptyError}))}}ll.last=vN});var Rd=_(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.materialize=void 0;var Dd=Au(),mN=z(),yN=U();function gN(){return mN.operate(function(r,e){r.subscribe(yN.createOperatorSubscriber(e,function(t){e.next(Dd.Notification.createNext(t))},function(){e.next(Dd.Notification.createComplete()),e.complete()},function(t){e.next(Dd.Notification.createError(t)),e.complete()}))})}fl.materialize=gN});var zd=_(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.max=void 0;var bN=an(),_N=le();function PN(r){return bN.reduce(_N.isFunction(r)?function(e,t){return r(e,t)>0?e:t}:function(e,t){return e>t?e:t})}hl.max=PN});var Vd=_(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.flatMap=void 0;var wN=vr();pl.flatMap=wN.mergeMap});var Nd=_(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.mergeMapTo=void 0;var T0=vr(),ON=le();function TN(r,e,t){return t===void 0&&(t=1/0),ON.isFunction(e)?T0.mergeMap(function(){return r},e,t):(typeof e=="number"&&(t=e),T0.mergeMap(function(){return r},t))}dl.mergeMapTo=TN});var Wd=_(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.mergeScan=void 0;var SN=z(),CN=Gu();function AN(r,e,t){return t===void 0&&(t=1/0),SN.operate(function(i,n){var a=e;return CN.mergeInternals(i,n,function(u,l){return r(a,u,l)},t,function(u){a=u},!1,void 0,function(){return a=null})})}vl.mergeScan=AN});var Ud=_(wi=>{"use strict";var EN=wi&&wi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},qN=wi&&wi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";var kN=Oi&&Oi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},FN=Oi&&Oi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});ml.min=void 0;var zN=an(),VN=le();function NN(r){return zN.reduce(VN.isFunction(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.multicast=void 0;var WN=ma(),C0=le(),UN=Ta();function GN(r,e){var t=C0.isFunction(r)?r:function(){return r};return C0.isFunction(e)?UN.connect(e,{connector:t}):function(i){return new WN.ConnectableObservable(i,t)}}yl.multicast=GN});var Hd=_(mr=>{"use strict";var BN=mr&&mr.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},HN=mr&&mr.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.pairwise=void 0;var QN=z(),KN=U();function XN(){return QN.operate(function(r,e){var t,i=!1;r.subscribe(KN.createOperatorSubscriber(e,function(n){var a=t;t=n,i&&e.next([a,n]),i=!0}))})}gl.pairwise=XN});var Yd=_(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.pluck=void 0;var JN=Ur();function ZN(){for(var r=[],e=0;e{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.publish=void 0;var e2=Je(),t2=Sa(),r2=Ta();function i2(r){return r?function(e){return r2.connect(r)(e)}:function(e){return t2.multicast(new e2.Subject)(e)}}_l.publish=i2});var Kd=_(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.publishBehavior=void 0;var n2=Cp(),o2=ma();function a2(r){return function(e){var t=new n2.BehaviorSubject(r);return new o2.ConnectableObservable(e,function(){return t})}}Pl.publishBehavior=a2});var Xd=_(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.publishLast=void 0;var s2=tu(),u2=ma();function c2(){return function(r){var e=new s2.AsyncSubject;return new u2.ConnectableObservable(r,function(){return e})}}wl.publishLast=c2});var Jd=_(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.publishReplay=void 0;var l2=eu(),f2=Sa(),E0=le();function h2(r,e,t,i){t&&!E0.isFunction(t)&&(i=t);var n=E0.isFunction(t)?t:void 0;return function(a){return f2.multicast(new l2.ReplaySubject(r,e,i),n)(a)}}Ol.publishReplay=h2});var Tl=_(Ti=>{"use strict";var p2=Ti&&Ti.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},d2=Ti&&Ti.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.repeat=void 0;var b2=Zt(),_2=z(),q0=U(),P2=X(),w2=di();function O2(r){var e,t=1/0,i;return r!=null&&(typeof r=="object"?(e=r.count,t=e===void 0?1/0:e,i=r.delay):t=r),t<=0?function(){return b2.EMPTY}:_2.operate(function(n,a){var u=0,l,h=function(){if(l?.unsubscribe(),l=null,i!=null){var v=typeof i=="number"?w2.timer(i):P2.innerFrom(i(u)),b=q0.createOperatorSubscriber(a,function(){b.unsubscribe(),p()});v.subscribe(b)}else p()},p=function(){var v=!1;l=n.subscribe(q0.createOperatorSubscriber(a,void 0,function(){++u{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.repeatWhen=void 0;var T2=X(),S2=Je(),C2=z(),x0=U();function A2(r){return C2.operate(function(e,t){var i,n=!1,a,u=!1,l=!1,h=function(){return l&&u&&(t.complete(),!0)},p=function(){return a||(a=new S2.Subject,T2.innerFrom(r(a)).subscribe(x0.createOperatorSubscriber(t,function(){i?v():n=!0},function(){u=!0,h()}))),a},v=function(){l=!1,i=e.subscribe(x0.createOperatorSubscriber(t,void 0,function(){l=!0,!h()&&p().next()})),n&&(i.unsubscribe(),i=null,n=!1,v())};v()})}Cl.repeatWhen=A2});var tv=_(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.retry=void 0;var E2=z(),M0=U(),q2=Xe(),x2=di(),M2=X();function L2(r){r===void 0&&(r=1/0);var e;r&&typeof r=="object"?e=r:e={count:r};var t=e.count,i=t===void 0?1/0:t,n=e.delay,a=e.resetOnSuccess,u=a===void 0?!1:a;return i<=0?q2.identity:E2.operate(function(l,h){var p=0,v,b=function(){var T=!1;v=l.subscribe(M0.createOperatorSubscriber(h,function(S){u&&(p=0),h.next(S)},void 0,function(S){if(p++{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.retryWhen=void 0;var j2=X(),I2=Je(),k2=z(),L0=U();function F2(r){return k2.operate(function(e,t){var i,n=!1,a,u=function(){i=e.subscribe(L0.createOperatorSubscriber(t,void 0,void 0,function(l){a||(a=new I2.Subject,j2.innerFrom(r(a)).subscribe(L0.createOperatorSubscriber(t,function(){return i?u():n=!0}))),a&&a.next(l)})),n&&(i.unsubscribe(),i=null,n=!1,u())};u()})}El.retryWhen=F2});var xl=_(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.sample=void 0;var D2=X(),R2=z(),z2=Ke(),j0=U();function V2(r){return R2.operate(function(e,t){var i=!1,n=null;e.subscribe(j0.createOperatorSubscriber(t,function(a){i=!0,n=a})),D2.innerFrom(r).subscribe(j0.createOperatorSubscriber(t,function(){if(i){i=!1;var a=n;n=null,t.next(a)}},z2.noop))})}ql.sample=V2});var iv=_(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.sampleTime=void 0;var N2=_t(),W2=xl(),U2=Xp();function G2(r,e){return e===void 0&&(e=N2.asyncScheduler),W2.sample(U2.interval(r,e))}Ml.sampleTime=G2});var nv=_(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.scan=void 0;var B2=z(),H2=fd();function $2(r,e){return B2.operate(H2.scanInternals(r,e,arguments.length>=2,!0))}Ll.scan=$2});var ov=_(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.sequenceEqual=void 0;var Y2=z(),Q2=U(),K2=X();function X2(r,e){return e===void 0&&(e=function(t,i){return t===i}),Y2.operate(function(t,i){var n=I0(),a=I0(),u=function(h){i.next(h),i.complete()},l=function(h,p){var v=Q2.createOperatorSubscriber(i,function(b){var T=p.buffer,S=p.complete;T.length===0?S?u(!1):h.buffer.push(b):!e(b,T.shift())&&u(!1)},function(){h.complete=!0;var b=p.complete,T=p.buffer;b&&u(T.length===0),v?.unsubscribe()});return v};t.subscribe(l(n,a)),K2.innerFrom(r).subscribe(l(a,n))})}jl.sequenceEqual=X2;function I0(){return{buffer:[],complete:!1}}});var Il=_(Si=>{"use strict";var J2=Si&&Si.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},Z2=Si&&Si.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t0&&(v=new F0.SafeSubscriber({next:function(ke){return pe.next(ke)},error:function(ke){M=!0,j(),b=av(D,n,ke),pe.error(ke)},complete:function(){q=!0,j(),b=av(D,u),pe.complete()}}),k0.innerFrom(Y).subscribe(v))})(p)}}Si.share=rW;function av(r,e){for(var t=[],i=2;i{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.shareReplay=void 0;var iW=eu(),nW=Il();function oW(r,e,t){var i,n,a,u,l=!1;return r&&typeof r=="object"?(i=r.bufferSize,u=i===void 0?1/0:i,n=r.windowTime,e=n===void 0?1/0:n,a=r.refCount,l=a===void 0?!1:a,t=r.scheduler):u=r??1/0,nW.share({connector:function(){return new iW.ReplaySubject(u,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l})}kl.shareReplay=oW});var uv=_(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.single=void 0;var aW=li(),sW=Bp(),uW=Gp(),cW=z(),lW=U();function fW(r){return cW.operate(function(e,t){var i=!1,n,a=!1,u=0;e.subscribe(lW.createOperatorSubscriber(t,function(l){a=!0,(!r||r(l,u++,e))&&(i&&t.error(new sW.SequenceError("Too many matching values")),i=!0,n=l)},function(){i?(t.next(n),t.complete()):t.error(a?new uW.NotFoundError("No matching values"):new aW.EmptyError)}))})}Fl.single=fW});var cv=_(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.skip=void 0;var hW=Gr();function pW(r){return hW.filter(function(e,t){return r<=t})}Dl.skip=pW});var lv=_(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.skipLast=void 0;var dW=Xe(),vW=z(),mW=U();function yW(r){return r<=0?dW.identity:vW.operate(function(e,t){var i=new Array(r),n=0;return e.subscribe(mW.createOperatorSubscriber(t,function(a){var u=n++;if(u{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.skipUntil=void 0;var gW=z(),D0=U(),bW=X(),_W=Ke();function PW(r){return gW.operate(function(e,t){var i=!1,n=D0.createOperatorSubscriber(t,function(){n?.unsubscribe(),i=!0},_W.noop);bW.innerFrom(r).subscribe(n),e.subscribe(D0.createOperatorSubscriber(t,function(a){return i&&t.next(a)}))})}zl.skipUntil=PW});var hv=_(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.skipWhile=void 0;var wW=z(),OW=U();function TW(r){return wW.operate(function(e,t){var i=!1,n=0;e.subscribe(OW.createOperatorSubscriber(t,function(a){return(i||(i=!r(a,n++)))&&t.next(a)}))})}Vl.skipWhile=TW});var pv=_(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.startWith=void 0;var R0=wa(),SW=Pt(),CW=z();function AW(){for(var r=[],e=0;e{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});Wl.switchMap=void 0;var EW=X(),qW=z(),z0=U();function xW(r,e){return qW.operate(function(t,i){var n=null,a=0,u=!1,l=function(){return u&&!n&&i.complete()};t.subscribe(z0.createOperatorSubscriber(i,function(h){n?.unsubscribe();var p=0,v=a++;EW.innerFrom(r(h,v)).subscribe(n=z0.createOperatorSubscriber(i,function(b){return i.next(e?e(h,b,v,p++):b)},function(){n=null,l()}))},function(){u=!0,l()}))})}Wl.switchMap=xW});var dv=_(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.switchAll=void 0;var MW=mo(),LW=Xe();function jW(){return MW.switchMap(LW.identity)}Ul.switchAll=jW});var vv=_(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.switchMapTo=void 0;var V0=mo(),IW=le();function kW(r,e){return IW.isFunction(e)?V0.switchMap(function(){return r},e):V0.switchMap(function(){return r})}Gl.switchMapTo=kW});var mv=_(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.switchScan=void 0;var FW=mo(),DW=z();function RW(r,e){return DW.operate(function(t,i){var n=e;return FW.switchMap(function(a,u){return r(n,a,u)},function(a,u){return n=u,u})(t).subscribe(i),function(){n=null}})}Bl.switchScan=RW});var yv=_(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});Hl.takeUntil=void 0;var zW=z(),VW=U(),NW=X(),WW=Ke();function UW(r){return zW.operate(function(e,t){NW.innerFrom(r).subscribe(VW.createOperatorSubscriber(t,function(){return t.complete()},WW.noop)),!t.closed&&e.subscribe(t)})}Hl.takeUntil=UW});var gv=_($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.takeWhile=void 0;var GW=z(),BW=U();function HW(r,e){return e===void 0&&(e=!1),GW.operate(function(t,i){var n=0;t.subscribe(BW.createOperatorSubscriber(i,function(a){var u=r(a,n++);(u||e)&&i.next(a),!u&&i.complete()}))})}$l.takeWhile=HW});var bv=_(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.tap=void 0;var $W=le(),YW=z(),QW=U(),KW=Xe();function XW(r,e,t){var i=$W.isFunction(r)||e||t?{next:r,error:e,complete:t}:r;return i?YW.operate(function(n,a){var u;(u=i.subscribe)===null||u===void 0||u.call(i);var l=!0;n.subscribe(QW.createOperatorSubscriber(a,function(h){var p;(p=i.next)===null||p===void 0||p.call(i,h),a.next(h)},function(){var h;l=!1,(h=i.complete)===null||h===void 0||h.call(i),a.complete()},function(h){var p;l=!1,(p=i.error)===null||p===void 0||p.call(i,h),a.error(h)},function(){var h,p;l&&((h=i.unsubscribe)===null||h===void 0||h.call(i)),(p=i.finalize)===null||p===void 0||p.call(i)}))}):KW.identity}Yl.tap=XW});var Kl=_(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});Ql.throttle=void 0;var JW=z(),N0=U(),ZW=X();function eU(r,e){return JW.operate(function(t,i){var n=e??{},a=n.leading,u=a===void 0?!0:a,l=n.trailing,h=l===void 0?!1:l,p=!1,v=null,b=null,T=!1,S=function(){b?.unsubscribe(),b=null,h&&(j(),T&&i.complete())},q=function(){b=null,T&&i.complete()},M=function(D){return b=ZW.innerFrom(r(D)).subscribe(N0.createOperatorSubscriber(i,S,q))},j=function(){if(p){p=!1;var D=v;v=null,i.next(D),!T&&M(D)}};t.subscribe(N0.createOperatorSubscriber(i,function(D){p=!0,v=D,!(b&&!b.closed)&&(u?j():M(D))},function(){T=!0,!(h&&p&&b&&!b.closed)&&i.complete()}))})}Ql.throttle=eU});var _v=_(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.throttleTime=void 0;var tU=_t(),rU=Kl(),iU=di();function nU(r,e,t){e===void 0&&(e=tU.asyncScheduler);var i=iU.timer(r,e);return rU.throttle(function(){return i},t)}Xl.throttleTime=nU});var Pv=_(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.TimeInterval=yo.timeInterval=void 0;var oU=_t(),aU=z(),sU=U();function uU(r){return r===void 0&&(r=oU.asyncScheduler),aU.operate(function(e,t){var i=r.now();e.subscribe(sU.createOperatorSubscriber(t,function(n){var a=r.now(),u=a-i;i=a,t.next(new W0(n,u))}))})}yo.timeInterval=uU;var W0=function(){function r(e,t){this.value=e,this.interval=t}return r}();yo.TimeInterval=W0});var wv=_(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.timeoutWith=void 0;var cU=_t(),lU=Fu(),fU=_a();function hU(r,e,t){var i,n,a;if(t=t??cU.async,lU.isValidDate(r)?i=r:typeof r=="number"&&(n=r),e)a=function(){return e};else throw new TypeError("No observable provided to switch to");if(i==null&&n==null)throw new TypeError("No timeout provided.");return fU.timeout({first:i,each:n,scheduler:t,with:a})}Jl.timeoutWith=hU});var Ov=_(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.timestamp=void 0;var pU=Zs(),dU=Ur();function vU(r){return r===void 0&&(r=pU.dateTimestampProvider),dU.map(function(e){return{value:e,timestamp:r.now()}})}Zl.timestamp=vU});var Tv=_(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.window=void 0;var U0=Je(),mU=z(),G0=U(),yU=Ke(),gU=X();function bU(r){return mU.operate(function(e,t){var i=new U0.Subject;t.next(i.asObservable());var n=function(a){i.error(a),t.error(a)};return e.subscribe(G0.createOperatorSubscriber(t,function(a){return i?.next(a)},function(){i.complete(),t.complete()},n)),gU.innerFrom(r).subscribe(G0.createOperatorSubscriber(t,function(){i.complete(),t.next(i=new U0.Subject)},yU.noop,n)),function(){i?.unsubscribe(),i=null}})}ef.window=bU});var Sv=_(go=>{"use strict";var _U=go&&go.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(go,"__esModule",{value:!0});go.windowCount=void 0;var B0=Je(),PU=z(),wU=U();function OU(r,e){e===void 0&&(e=0);var t=e>0?e:r;return PU.operate(function(i,n){var a=[new B0.Subject],u=[],l=0;n.next(a[0].asObservable()),i.subscribe(wU.createOperatorSubscriber(n,function(h){var p,v;try{for(var b=_U(a),T=b.next();!T.done;T=b.next()){var S=T.value;S.next(h)}}catch(j){p={error:j}}finally{try{T&&!T.done&&(v=b.return)&&v.call(b)}finally{if(p)throw p.error}}var q=l-r+1;if(q>=0&&q%t===0&&a.shift().complete(),++l%t===0){var M=new B0.Subject;a.push(M),n.next(M.asObservable())}},function(){for(;a.length>0;)a.shift().complete();n.complete()},function(h){for(;a.length>0;)a.shift().error(h);n.error(h)},function(){u=null,a=null}))})}go.windowCount=OU});var Cv=_(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.windowTime=void 0;var TU=Je(),SU=_t(),CU=Mt(),AU=z(),EU=U(),qU=zr(),xU=Pt(),H0=Vr();function MU(r){for(var e,t,i=[],n=1;n=0?H0.executeSchedule(p,a,S,u,!0):b=!0,S();var q=function(j){return v.slice().forEach(j)},M=function(j){q(function(D){var V=D.window;return j(V)}),j(p),p.unsubscribe()};return h.subscribe(EU.createOperatorSubscriber(p,function(j){q(function(D){D.window.next(j),l<=++D.seen&&T(D)})},function(){return M(function(j){return j.complete()})},function(j){return M(function(D){return D.error(j)})})),function(){v=null}})}tf.windowTime=MU});var Ev=_(bo=>{"use strict";var LU=bo&&bo.__values||function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(bo,"__esModule",{value:!0});bo.windowToggle=void 0;var jU=Je(),IU=Mt(),kU=z(),$0=X(),Av=U(),Y0=Ke(),FU=zr();function DU(r,e){return kU.operate(function(t,i){var n=[],a=function(u){for(;0{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.windowWhen=void 0;var RU=Je(),zU=z(),Q0=U(),VU=X();function NU(r){return zU.operate(function(e,t){var i,n,a=function(l){i.error(l),t.error(l)},u=function(){n?.unsubscribe(),i?.complete(),i=new RU.Subject,t.next(i.asObservable());var l;try{l=VU.innerFrom(r())}catch(h){a(h);return}l.subscribe(n=Q0.createOperatorSubscriber(t,u,u,a))};u(),e.subscribe(Q0.createOperatorSubscriber(t,function(l){return i.next(l)},function(){i.complete(),t.complete()},a,function(){n?.unsubscribe(),i=null}))})}rf.windowWhen=NU});var xv=_(Ci=>{"use strict";var K0=Ci&&Ci.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},X0=Ci&&Ci.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.zipAll=void 0;var YU=fc(),QU=hd();function KU(r){return QU.joinAllInternals(YU.zip,r)}nf.zipAll=KU});var Lv=_(Ai=>{"use strict";var XU=Ai&&Ai.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},JU=Ai&&Ai.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";var rG=Ei&&Ei.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},iG=Ei&&Ei.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";var aG=m&&m.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),sG=m&&m.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&aG(e,r,t)};Object.defineProperty(m,"__esModule",{value:!0});m.interval=m.iif=m.generate=m.fromEventPattern=m.fromEvent=m.from=m.forkJoin=m.empty=m.defer=m.connectable=m.concat=m.combineLatest=m.bindNodeCallback=m.bindCallback=m.UnsubscriptionError=m.TimeoutError=m.SequenceError=m.ObjectUnsubscribedError=m.NotFoundError=m.EmptyError=m.ArgumentOutOfRangeError=m.firstValueFrom=m.lastValueFrom=m.isObservable=m.identity=m.noop=m.pipe=m.NotificationKind=m.Notification=m.Subscriber=m.Subscription=m.Scheduler=m.VirtualAction=m.VirtualTimeScheduler=m.animationFrameScheduler=m.animationFrame=m.queueScheduler=m.queue=m.asyncScheduler=m.async=m.asapScheduler=m.asap=m.AsyncSubject=m.ReplaySubject=m.BehaviorSubject=m.Subject=m.animationFrames=m.observable=m.ConnectableObservable=m.Observable=void 0;m.filter=m.expand=m.exhaustMap=m.exhaustAll=m.exhaust=m.every=m.endWith=m.elementAt=m.distinctUntilKeyChanged=m.distinctUntilChanged=m.distinct=m.dematerialize=m.delayWhen=m.delay=m.defaultIfEmpty=m.debounceTime=m.debounce=m.count=m.connect=m.concatWith=m.concatMapTo=m.concatMap=m.concatAll=m.combineLatestWith=m.combineLatestAll=m.combineAll=m.catchError=m.bufferWhen=m.bufferToggle=m.bufferTime=m.bufferCount=m.buffer=m.auditTime=m.audit=m.config=m.NEVER=m.EMPTY=m.scheduled=m.zip=m.using=m.timer=m.throwError=m.range=m.race=m.partition=m.pairs=m.onErrorResumeNext=m.of=m.never=m.merge=void 0;m.switchMap=m.switchAll=m.subscribeOn=m.startWith=m.skipWhile=m.skipUntil=m.skipLast=m.skip=m.single=m.shareReplay=m.share=m.sequenceEqual=m.scan=m.sampleTime=m.sample=m.refCount=m.retryWhen=m.retry=m.repeatWhen=m.repeat=m.reduce=m.raceWith=m.publishReplay=m.publishLast=m.publishBehavior=m.publish=m.pluck=m.pairwise=m.onErrorResumeNextWith=m.observeOn=m.multicast=m.min=m.mergeWith=m.mergeScan=m.mergeMapTo=m.mergeMap=m.flatMap=m.mergeAll=m.max=m.materialize=m.mapTo=m.map=m.last=m.isEmpty=m.ignoreElements=m.groupBy=m.first=m.findIndex=m.find=m.finalize=void 0;m.zipWith=m.zipAll=m.withLatestFrom=m.windowWhen=m.windowToggle=m.windowTime=m.windowCount=m.window=m.toArray=m.timestamp=m.timeoutWith=m.timeout=m.timeInterval=m.throwIfEmpty=m.throttleTime=m.throttle=m.tap=m.takeWhile=m.takeUntil=m.takeLast=m.take=m.switchScan=m.switchMapTo=void 0;var uG=he();Object.defineProperty(m,"Observable",{enumerable:!0,get:function(){return uG.Observable}});var cG=ma();Object.defineProperty(m,"ConnectableObservable",{enumerable:!0,get:function(){return cG.ConnectableObservable}});var lG=da();Object.defineProperty(m,"observable",{enumerable:!0,get:function(){return lG.observable}});var fG=xb();Object.defineProperty(m,"animationFrames",{enumerable:!0,get:function(){return fG.animationFrames}});var hG=Je();Object.defineProperty(m,"Subject",{enumerable:!0,get:function(){return hG.Subject}});var pG=Cp();Object.defineProperty(m,"BehaviorSubject",{enumerable:!0,get:function(){return pG.BehaviorSubject}});var dG=eu();Object.defineProperty(m,"ReplaySubject",{enumerable:!0,get:function(){return dG.ReplaySubject}});var vG=tu();Object.defineProperty(m,"AsyncSubject",{enumerable:!0,get:function(){return vG.AsyncSubject}});var Z0=$b();Object.defineProperty(m,"asap",{enumerable:!0,get:function(){return Z0.asap}});Object.defineProperty(m,"asapScheduler",{enumerable:!0,get:function(){return Z0.asapScheduler}});var eP=_t();Object.defineProperty(m,"async",{enumerable:!0,get:function(){return eP.async}});Object.defineProperty(m,"asyncScheduler",{enumerable:!0,get:function(){return eP.asyncScheduler}});var tP=Kb();Object.defineProperty(m,"queue",{enumerable:!0,get:function(){return tP.queue}});Object.defineProperty(m,"queueScheduler",{enumerable:!0,get:function(){return tP.queueScheduler}});var rP=e_();Object.defineProperty(m,"animationFrame",{enumerable:!0,get:function(){return rP.animationFrame}});Object.defineProperty(m,"animationFrameScheduler",{enumerable:!0,get:function(){return rP.animationFrameScheduler}});var iP=i_();Object.defineProperty(m,"VirtualTimeScheduler",{enumerable:!0,get:function(){return iP.VirtualTimeScheduler}});Object.defineProperty(m,"VirtualAction",{enumerable:!0,get:function(){return iP.VirtualAction}});var mG=Ep();Object.defineProperty(m,"Scheduler",{enumerable:!0,get:function(){return mG.Scheduler}});var yG=Mt();Object.defineProperty(m,"Subscription",{enumerable:!0,get:function(){return yG.Subscription}});var gG=Ln();Object.defineProperty(m,"Subscriber",{enumerable:!0,get:function(){return gG.Subscriber}});var nP=Au();Object.defineProperty(m,"Notification",{enumerable:!0,get:function(){return nP.Notification}});Object.defineProperty(m,"NotificationKind",{enumerable:!0,get:function(){return nP.NotificationKind}});var bG=va();Object.defineProperty(m,"pipe",{enumerable:!0,get:function(){return bG.pipe}});var _G=Ke();Object.defineProperty(m,"noop",{enumerable:!0,get:function(){return _G.noop}});var PG=Xe();Object.defineProperty(m,"identity",{enumerable:!0,get:function(){return PG.identity}});var wG=__();Object.defineProperty(m,"isObservable",{enumerable:!0,get:function(){return wG.isObservable}});var OG=P_();Object.defineProperty(m,"lastValueFrom",{enumerable:!0,get:function(){return OG.lastValueFrom}});var TG=w_();Object.defineProperty(m,"firstValueFrom",{enumerable:!0,get:function(){return TG.firstValueFrom}});var SG=Up();Object.defineProperty(m,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return SG.ArgumentOutOfRangeError}});var CG=li();Object.defineProperty(m,"EmptyError",{enumerable:!0,get:function(){return CG.EmptyError}});var AG=Gp();Object.defineProperty(m,"NotFoundError",{enumerable:!0,get:function(){return AG.NotFoundError}});var EG=wp();Object.defineProperty(m,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return EG.ObjectUnsubscribedError}});var qG=Bp();Object.defineProperty(m,"SequenceError",{enumerable:!0,get:function(){return qG.SequenceError}});var xG=_a();Object.defineProperty(m,"TimeoutError",{enumerable:!0,get:function(){return xG.TimeoutError}});var MG=lp();Object.defineProperty(m,"UnsubscriptionError",{enumerable:!0,get:function(){return MG.UnsubscriptionError}});var LG=T_();Object.defineProperty(m,"bindCallback",{enumerable:!0,get:function(){return LG.bindCallback}});var jG=S_();Object.defineProperty(m,"bindNodeCallback",{enumerable:!0,get:function(){return jG.bindNodeCallback}});var IG=Wu();Object.defineProperty(m,"combineLatest",{enumerable:!0,get:function(){return IG.combineLatest}});var kG=wa();Object.defineProperty(m,"concat",{enumerable:!0,get:function(){return kG.concat}});var FG=j_();Object.defineProperty(m,"connectable",{enumerable:!0,get:function(){return FG.connectable}});var DG=Oa();Object.defineProperty(m,"defer",{enumerable:!0,get:function(){return DG.defer}});var RG=Zt();Object.defineProperty(m,"empty",{enumerable:!0,get:function(){return RG.empty}});var zG=I_();Object.defineProperty(m,"forkJoin",{enumerable:!0,get:function(){return zG.forkJoin}});var VG=Nr();Object.defineProperty(m,"from",{enumerable:!0,get:function(){return VG.from}});var NG=F_();Object.defineProperty(m,"fromEvent",{enumerable:!0,get:function(){return NG.fromEvent}});var WG=R_();Object.defineProperty(m,"fromEventPattern",{enumerable:!0,get:function(){return WG.fromEventPattern}});var UG=V_();Object.defineProperty(m,"generate",{enumerable:!0,get:function(){return UG.generate}});var GG=N_();Object.defineProperty(m,"iif",{enumerable:!0,get:function(){return GG.iif}});var BG=Xp();Object.defineProperty(m,"interval",{enumerable:!0,get:function(){return BG.interval}});var HG=U_();Object.defineProperty(m,"merge",{enumerable:!0,get:function(){return HG.merge}});var $G=Jp();Object.defineProperty(m,"never",{enumerable:!0,get:function(){return $G.never}});var YG=Su();Object.defineProperty(m,"of",{enumerable:!0,get:function(){return YG.of}});var QG=Zp();Object.defineProperty(m,"onErrorResumeNext",{enumerable:!0,get:function(){return QG.onErrorResumeNext}});var KG=B_();Object.defineProperty(m,"pairs",{enumerable:!0,get:function(){return KG.pairs}});var XG=Y_();Object.defineProperty(m,"partition",{enumerable:!0,get:function(){return XG.partition}});var JG=td();Object.defineProperty(m,"race",{enumerable:!0,get:function(){return JG.race}});var ZG=X_();Object.defineProperty(m,"range",{enumerable:!0,get:function(){return ZG.range}});var eB=Wp();Object.defineProperty(m,"throwError",{enumerable:!0,get:function(){return eB.throwError}});var tB=di();Object.defineProperty(m,"timer",{enumerable:!0,get:function(){return tB.timer}});var rB=J_();Object.defineProperty(m,"using",{enumerable:!0,get:function(){return rB.using}});var iB=fc();Object.defineProperty(m,"zip",{enumerable:!0,get:function(){return iB.zip}});var nB=Np();Object.defineProperty(m,"scheduled",{enumerable:!0,get:function(){return nB.scheduled}});var oB=Zt();Object.defineProperty(m,"EMPTY",{enumerable:!0,get:function(){return oB.EMPTY}});var aB=Jp();Object.defineProperty(m,"NEVER",{enumerable:!0,get:function(){return aB.NEVER}});sG(e0(),m);var sB=xn();Object.defineProperty(m,"config",{enumerable:!0,get:function(){return sB.config}});var uB=pc();Object.defineProperty(m,"audit",{enumerable:!0,get:function(){return uB.audit}});var cB=rd();Object.defineProperty(m,"auditTime",{enumerable:!0,get:function(){return cB.auditTime}});var lB=id();Object.defineProperty(m,"buffer",{enumerable:!0,get:function(){return lB.buffer}});var fB=od();Object.defineProperty(m,"bufferCount",{enumerable:!0,get:function(){return fB.bufferCount}});var hB=ad();Object.defineProperty(m,"bufferTime",{enumerable:!0,get:function(){return hB.bufferTime}});var pB=ud();Object.defineProperty(m,"bufferToggle",{enumerable:!0,get:function(){return pB.bufferToggle}});var dB=cd();Object.defineProperty(m,"bufferWhen",{enumerable:!0,get:function(){return dB.bufferWhen}});var vB=ld();Object.defineProperty(m,"catchError",{enumerable:!0,get:function(){return vB.catchError}});var mB=pd();Object.defineProperty(m,"combineAll",{enumerable:!0,get:function(){return mB.combineAll}});var yB=Tc();Object.defineProperty(m,"combineLatestAll",{enumerable:!0,get:function(){return yB.combineLatestAll}});var gB=vd();Object.defineProperty(m,"combineLatestWith",{enumerable:!0,get:function(){return gB.combineLatestWith}});var bB=Pa();Object.defineProperty(m,"concatAll",{enumerable:!0,get:function(){return bB.concatAll}});var _B=Ac();Object.defineProperty(m,"concatMap",{enumerable:!0,get:function(){return _B.concatMap}});var PB=md();Object.defineProperty(m,"concatMapTo",{enumerable:!0,get:function(){return PB.concatMapTo}});var wB=gd();Object.defineProperty(m,"concatWith",{enumerable:!0,get:function(){return wB.concatWith}});var OB=Ta();Object.defineProperty(m,"connect",{enumerable:!0,get:function(){return OB.connect}});var TB=bd();Object.defineProperty(m,"count",{enumerable:!0,get:function(){return TB.count}});var SB=_d();Object.defineProperty(m,"debounce",{enumerable:!0,get:function(){return SB.debounce}});var CB=Pd();Object.defineProperty(m,"debounceTime",{enumerable:!0,get:function(){return CB.debounceTime}});var AB=lo();Object.defineProperty(m,"defaultIfEmpty",{enumerable:!0,get:function(){return AB.defaultIfEmpty}});var EB=wd();Object.defineProperty(m,"delay",{enumerable:!0,get:function(){return EB.delay}});var qB=Nc();Object.defineProperty(m,"delayWhen",{enumerable:!0,get:function(){return qB.delayWhen}});var xB=Od();Object.defineProperty(m,"dematerialize",{enumerable:!0,get:function(){return xB.dematerialize}});var MB=Td();Object.defineProperty(m,"distinct",{enumerable:!0,get:function(){return MB.distinct}});var LB=Hc();Object.defineProperty(m,"distinctUntilChanged",{enumerable:!0,get:function(){return LB.distinctUntilChanged}});var jB=Sd();Object.defineProperty(m,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return jB.distinctUntilKeyChanged}});var IB=Cd();Object.defineProperty(m,"elementAt",{enumerable:!0,get:function(){return IB.elementAt}});var kB=Ad();Object.defineProperty(m,"endWith",{enumerable:!0,get:function(){return kB.endWith}});var FB=Ed();Object.defineProperty(m,"every",{enumerable:!0,get:function(){return FB.every}});var DB=qd();Object.defineProperty(m,"exhaust",{enumerable:!0,get:function(){return DB.exhaust}});var RB=el();Object.defineProperty(m,"exhaustAll",{enumerable:!0,get:function(){return RB.exhaustAll}});var zB=Jc();Object.defineProperty(m,"exhaustMap",{enumerable:!0,get:function(){return zB.exhaustMap}});var VB=xd();Object.defineProperty(m,"expand",{enumerable:!0,get:function(){return VB.expand}});var NB=Gr();Object.defineProperty(m,"filter",{enumerable:!0,get:function(){return NB.filter}});var WB=Md();Object.defineProperty(m,"finalize",{enumerable:!0,get:function(){return WB.finalize}});var UB=nl();Object.defineProperty(m,"find",{enumerable:!0,get:function(){return UB.find}});var GB=Ld();Object.defineProperty(m,"findIndex",{enumerable:!0,get:function(){return GB.findIndex}});var BB=jd();Object.defineProperty(m,"first",{enumerable:!0,get:function(){return BB.first}});var HB=Id();Object.defineProperty(m,"groupBy",{enumerable:!0,get:function(){return HB.groupBy}});var $B=Dc();Object.defineProperty(m,"ignoreElements",{enumerable:!0,get:function(){return $B.ignoreElements}});var YB=kd();Object.defineProperty(m,"isEmpty",{enumerable:!0,get:function(){return YB.isEmpty}});var QB=Fd();Object.defineProperty(m,"last",{enumerable:!0,get:function(){return QB.last}});var KB=Ur();Object.defineProperty(m,"map",{enumerable:!0,get:function(){return KB.map}});var XB=zc();Object.defineProperty(m,"mapTo",{enumerable:!0,get:function(){return XB.mapTo}});var JB=Rd();Object.defineProperty(m,"materialize",{enumerable:!0,get:function(){return JB.materialize}});var ZB=zd();Object.defineProperty(m,"max",{enumerable:!0,get:function(){return ZB.max}});var eH=io();Object.defineProperty(m,"mergeAll",{enumerable:!0,get:function(){return eH.mergeAll}});var tH=Vd();Object.defineProperty(m,"flatMap",{enumerable:!0,get:function(){return tH.flatMap}});var rH=vr();Object.defineProperty(m,"mergeMap",{enumerable:!0,get:function(){return rH.mergeMap}});var iH=Nd();Object.defineProperty(m,"mergeMapTo",{enumerable:!0,get:function(){return iH.mergeMapTo}});var nH=Wd();Object.defineProperty(m,"mergeScan",{enumerable:!0,get:function(){return nH.mergeScan}});var oH=Gd();Object.defineProperty(m,"mergeWith",{enumerable:!0,get:function(){return oH.mergeWith}});var aH=Bd();Object.defineProperty(m,"min",{enumerable:!0,get:function(){return aH.min}});var sH=Sa();Object.defineProperty(m,"multicast",{enumerable:!0,get:function(){return sH.multicast}});var uH=eo();Object.defineProperty(m,"observeOn",{enumerable:!0,get:function(){return uH.observeOn}});var cH=Hd();Object.defineProperty(m,"onErrorResumeNextWith",{enumerable:!0,get:function(){return cH.onErrorResumeNextWith}});var lH=$d();Object.defineProperty(m,"pairwise",{enumerable:!0,get:function(){return lH.pairwise}});var fH=Yd();Object.defineProperty(m,"pluck",{enumerable:!0,get:function(){return fH.pluck}});var hH=Qd();Object.defineProperty(m,"publish",{enumerable:!0,get:function(){return hH.publish}});var pH=Kd();Object.defineProperty(m,"publishBehavior",{enumerable:!0,get:function(){return pH.publishBehavior}});var dH=Xd();Object.defineProperty(m,"publishLast",{enumerable:!0,get:function(){return dH.publishLast}});var vH=Jd();Object.defineProperty(m,"publishReplay",{enumerable:!0,get:function(){return vH.publishReplay}});var mH=Tl();Object.defineProperty(m,"raceWith",{enumerable:!0,get:function(){return mH.raceWith}});var yH=an();Object.defineProperty(m,"reduce",{enumerable:!0,get:function(){return yH.reduce}});var gH=Zd();Object.defineProperty(m,"repeat",{enumerable:!0,get:function(){return gH.repeat}});var bH=ev();Object.defineProperty(m,"repeatWhen",{enumerable:!0,get:function(){return bH.repeatWhen}});var _H=tv();Object.defineProperty(m,"retry",{enumerable:!0,get:function(){return _H.retry}});var PH=rv();Object.defineProperty(m,"retryWhen",{enumerable:!0,get:function(){return PH.retryWhen}});var wH=Ks();Object.defineProperty(m,"refCount",{enumerable:!0,get:function(){return wH.refCount}});var OH=xl();Object.defineProperty(m,"sample",{enumerable:!0,get:function(){return OH.sample}});var TH=iv();Object.defineProperty(m,"sampleTime",{enumerable:!0,get:function(){return TH.sampleTime}});var SH=nv();Object.defineProperty(m,"scan",{enumerable:!0,get:function(){return SH.scan}});var CH=ov();Object.defineProperty(m,"sequenceEqual",{enumerable:!0,get:function(){return CH.sequenceEqual}});var AH=Il();Object.defineProperty(m,"share",{enumerable:!0,get:function(){return AH.share}});var EH=sv();Object.defineProperty(m,"shareReplay",{enumerable:!0,get:function(){return EH.shareReplay}});var qH=uv();Object.defineProperty(m,"single",{enumerable:!0,get:function(){return qH.single}});var xH=cv();Object.defineProperty(m,"skip",{enumerable:!0,get:function(){return xH.skip}});var MH=lv();Object.defineProperty(m,"skipLast",{enumerable:!0,get:function(){return MH.skipLast}});var LH=fv();Object.defineProperty(m,"skipUntil",{enumerable:!0,get:function(){return LH.skipUntil}});var jH=hv();Object.defineProperty(m,"skipWhile",{enumerable:!0,get:function(){return jH.skipWhile}});var IH=pv();Object.defineProperty(m,"startWith",{enumerable:!0,get:function(){return IH.startWith}});var kH=to();Object.defineProperty(m,"subscribeOn",{enumerable:!0,get:function(){return kH.subscribeOn}});var FH=dv();Object.defineProperty(m,"switchAll",{enumerable:!0,get:function(){return FH.switchAll}});var DH=mo();Object.defineProperty(m,"switchMap",{enumerable:!0,get:function(){return DH.switchMap}});var RH=vv();Object.defineProperty(m,"switchMapTo",{enumerable:!0,get:function(){return RH.switchMapTo}});var zH=mv();Object.defineProperty(m,"switchScan",{enumerable:!0,get:function(){return zH.switchScan}});var VH=fo();Object.defineProperty(m,"take",{enumerable:!0,get:function(){return VH.take}});var NH=cl();Object.defineProperty(m,"takeLast",{enumerable:!0,get:function(){return NH.takeLast}});var WH=yv();Object.defineProperty(m,"takeUntil",{enumerable:!0,get:function(){return WH.takeUntil}});var UH=gv();Object.defineProperty(m,"takeWhile",{enumerable:!0,get:function(){return UH.takeWhile}});var GH=bv();Object.defineProperty(m,"tap",{enumerable:!0,get:function(){return GH.tap}});var BH=Kl();Object.defineProperty(m,"throttle",{enumerable:!0,get:function(){return BH.throttle}});var HH=_v();Object.defineProperty(m,"throttleTime",{enumerable:!0,get:function(){return HH.throttleTime}});var $H=ho();Object.defineProperty(m,"throwIfEmpty",{enumerable:!0,get:function(){return $H.throwIfEmpty}});var YH=Pv();Object.defineProperty(m,"timeInterval",{enumerable:!0,get:function(){return YH.timeInterval}});var QH=_a();Object.defineProperty(m,"timeout",{enumerable:!0,get:function(){return QH.timeout}});var KH=wv();Object.defineProperty(m,"timeoutWith",{enumerable:!0,get:function(){return KH.timeoutWith}});var XH=Ov();Object.defineProperty(m,"timestamp",{enumerable:!0,get:function(){return XH.timestamp}});var JH=Pc();Object.defineProperty(m,"toArray",{enumerable:!0,get:function(){return JH.toArray}});var ZH=Tv();Object.defineProperty(m,"window",{enumerable:!0,get:function(){return ZH.window}});var e3=Sv();Object.defineProperty(m,"windowCount",{enumerable:!0,get:function(){return e3.windowCount}});var t3=Cv();Object.defineProperty(m,"windowTime",{enumerable:!0,get:function(){return t3.windowTime}});var r3=Ev();Object.defineProperty(m,"windowToggle",{enumerable:!0,get:function(){return r3.windowToggle}});var i3=qv();Object.defineProperty(m,"windowWhen",{enumerable:!0,get:function(){return i3.windowWhen}});var n3=xv();Object.defineProperty(m,"withLatestFrom",{enumerable:!0,get:function(){return n3.withLatestFrom}});var o3=Mv();Object.defineProperty(m,"zipAll",{enumerable:!0,get:function(){return o3.zipAll}});var a3=jv();Object.defineProperty(m,"zipWith",{enumerable:!0,get:function(){return a3.zipWith}})});var sP=_(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.partition=void 0;var s3=ed(),aP=Gr();function u3(r,e){return function(t){return[aP.filter(r,e)(t),aP.filter(s3.not(r,e))(t)]}}af.partition=u3});var uP=_(Mi=>{"use strict";var c3=Mi&&Mi.__read||function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],u;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(l){u={error:l}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(u)throw u.error}}return a},l3=Mi&&Mi.__spreadArray||function(r,e){for(var t=0,i=e.length,n=r.length;t{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.mergeAll=w.merge=w.max=w.materialize=w.mapTo=w.map=w.last=w.isEmpty=w.ignoreElements=w.groupBy=w.first=w.findIndex=w.find=w.finalize=w.filter=w.expand=w.exhaustMap=w.exhaustAll=w.exhaust=w.every=w.endWith=w.elementAt=w.distinctUntilKeyChanged=w.distinctUntilChanged=w.distinct=w.dematerialize=w.delayWhen=w.delay=w.defaultIfEmpty=w.debounceTime=w.debounce=w.count=w.connect=w.concatWith=w.concatMapTo=w.concatMap=w.concatAll=w.concat=w.combineLatestWith=w.combineLatest=w.combineLatestAll=w.combineAll=w.catchError=w.bufferWhen=w.bufferToggle=w.bufferTime=w.bufferCount=w.buffer=w.auditTime=w.audit=void 0;w.timeInterval=w.throwIfEmpty=w.throttleTime=w.throttle=w.tap=w.takeWhile=w.takeUntil=w.takeLast=w.take=w.switchScan=w.switchMapTo=w.switchMap=w.switchAll=w.subscribeOn=w.startWith=w.skipWhile=w.skipUntil=w.skipLast=w.skip=w.single=w.shareReplay=w.share=w.sequenceEqual=w.scan=w.sampleTime=w.sample=w.refCount=w.retryWhen=w.retry=w.repeatWhen=w.repeat=w.reduce=w.raceWith=w.race=w.publishReplay=w.publishLast=w.publishBehavior=w.publish=w.pluck=w.partition=w.pairwise=w.onErrorResumeNext=w.observeOn=w.multicast=w.min=w.mergeWith=w.mergeScan=w.mergeMapTo=w.mergeMap=w.flatMap=void 0;w.zipWith=w.zipAll=w.zip=w.withLatestFrom=w.windowWhen=w.windowToggle=w.windowTime=w.windowCount=w.window=w.toArray=w.timestamp=w.timeoutWith=w.timeout=void 0;var d3=pc();Object.defineProperty(w,"audit",{enumerable:!0,get:function(){return d3.audit}});var v3=rd();Object.defineProperty(w,"auditTime",{enumerable:!0,get:function(){return v3.auditTime}});var m3=id();Object.defineProperty(w,"buffer",{enumerable:!0,get:function(){return m3.buffer}});var y3=od();Object.defineProperty(w,"bufferCount",{enumerable:!0,get:function(){return y3.bufferCount}});var g3=ad();Object.defineProperty(w,"bufferTime",{enumerable:!0,get:function(){return g3.bufferTime}});var b3=ud();Object.defineProperty(w,"bufferToggle",{enumerable:!0,get:function(){return b3.bufferToggle}});var _3=cd();Object.defineProperty(w,"bufferWhen",{enumerable:!0,get:function(){return _3.bufferWhen}});var P3=ld();Object.defineProperty(w,"catchError",{enumerable:!0,get:function(){return P3.catchError}});var w3=pd();Object.defineProperty(w,"combineAll",{enumerable:!0,get:function(){return w3.combineAll}});var O3=Tc();Object.defineProperty(w,"combineLatestAll",{enumerable:!0,get:function(){return O3.combineLatestAll}});var T3=dd();Object.defineProperty(w,"combineLatest",{enumerable:!0,get:function(){return T3.combineLatest}});var S3=vd();Object.defineProperty(w,"combineLatestWith",{enumerable:!0,get:function(){return S3.combineLatestWith}});var C3=yd();Object.defineProperty(w,"concat",{enumerable:!0,get:function(){return C3.concat}});var A3=Pa();Object.defineProperty(w,"concatAll",{enumerable:!0,get:function(){return A3.concatAll}});var E3=Ac();Object.defineProperty(w,"concatMap",{enumerable:!0,get:function(){return E3.concatMap}});var q3=md();Object.defineProperty(w,"concatMapTo",{enumerable:!0,get:function(){return q3.concatMapTo}});var x3=gd();Object.defineProperty(w,"concatWith",{enumerable:!0,get:function(){return x3.concatWith}});var M3=Ta();Object.defineProperty(w,"connect",{enumerable:!0,get:function(){return M3.connect}});var L3=bd();Object.defineProperty(w,"count",{enumerable:!0,get:function(){return L3.count}});var j3=_d();Object.defineProperty(w,"debounce",{enumerable:!0,get:function(){return j3.debounce}});var I3=Pd();Object.defineProperty(w,"debounceTime",{enumerable:!0,get:function(){return I3.debounceTime}});var k3=lo();Object.defineProperty(w,"defaultIfEmpty",{enumerable:!0,get:function(){return k3.defaultIfEmpty}});var F3=wd();Object.defineProperty(w,"delay",{enumerable:!0,get:function(){return F3.delay}});var D3=Nc();Object.defineProperty(w,"delayWhen",{enumerable:!0,get:function(){return D3.delayWhen}});var R3=Od();Object.defineProperty(w,"dematerialize",{enumerable:!0,get:function(){return R3.dematerialize}});var z3=Td();Object.defineProperty(w,"distinct",{enumerable:!0,get:function(){return z3.distinct}});var V3=Hc();Object.defineProperty(w,"distinctUntilChanged",{enumerable:!0,get:function(){return V3.distinctUntilChanged}});var N3=Sd();Object.defineProperty(w,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return N3.distinctUntilKeyChanged}});var W3=Cd();Object.defineProperty(w,"elementAt",{enumerable:!0,get:function(){return W3.elementAt}});var U3=Ad();Object.defineProperty(w,"endWith",{enumerable:!0,get:function(){return U3.endWith}});var G3=Ed();Object.defineProperty(w,"every",{enumerable:!0,get:function(){return G3.every}});var B3=qd();Object.defineProperty(w,"exhaust",{enumerable:!0,get:function(){return B3.exhaust}});var H3=el();Object.defineProperty(w,"exhaustAll",{enumerable:!0,get:function(){return H3.exhaustAll}});var $3=Jc();Object.defineProperty(w,"exhaustMap",{enumerable:!0,get:function(){return $3.exhaustMap}});var Y3=xd();Object.defineProperty(w,"expand",{enumerable:!0,get:function(){return Y3.expand}});var Q3=Gr();Object.defineProperty(w,"filter",{enumerable:!0,get:function(){return Q3.filter}});var K3=Md();Object.defineProperty(w,"finalize",{enumerable:!0,get:function(){return K3.finalize}});var X3=nl();Object.defineProperty(w,"find",{enumerable:!0,get:function(){return X3.find}});var J3=Ld();Object.defineProperty(w,"findIndex",{enumerable:!0,get:function(){return J3.findIndex}});var Z3=jd();Object.defineProperty(w,"first",{enumerable:!0,get:function(){return Z3.first}});var e$=Id();Object.defineProperty(w,"groupBy",{enumerable:!0,get:function(){return e$.groupBy}});var t$=Dc();Object.defineProperty(w,"ignoreElements",{enumerable:!0,get:function(){return t$.ignoreElements}});var r$=kd();Object.defineProperty(w,"isEmpty",{enumerable:!0,get:function(){return r$.isEmpty}});var i$=Fd();Object.defineProperty(w,"last",{enumerable:!0,get:function(){return i$.last}});var n$=Ur();Object.defineProperty(w,"map",{enumerable:!0,get:function(){return n$.map}});var o$=zc();Object.defineProperty(w,"mapTo",{enumerable:!0,get:function(){return o$.mapTo}});var a$=Rd();Object.defineProperty(w,"materialize",{enumerable:!0,get:function(){return a$.materialize}});var s$=zd();Object.defineProperty(w,"max",{enumerable:!0,get:function(){return s$.max}});var u$=Ud();Object.defineProperty(w,"merge",{enumerable:!0,get:function(){return u$.merge}});var c$=io();Object.defineProperty(w,"mergeAll",{enumerable:!0,get:function(){return c$.mergeAll}});var l$=Vd();Object.defineProperty(w,"flatMap",{enumerable:!0,get:function(){return l$.flatMap}});var f$=vr();Object.defineProperty(w,"mergeMap",{enumerable:!0,get:function(){return f$.mergeMap}});var h$=Nd();Object.defineProperty(w,"mergeMapTo",{enumerable:!0,get:function(){return h$.mergeMapTo}});var p$=Wd();Object.defineProperty(w,"mergeScan",{enumerable:!0,get:function(){return p$.mergeScan}});var d$=Gd();Object.defineProperty(w,"mergeWith",{enumerable:!0,get:function(){return d$.mergeWith}});var v$=Bd();Object.defineProperty(w,"min",{enumerable:!0,get:function(){return v$.min}});var m$=Sa();Object.defineProperty(w,"multicast",{enumerable:!0,get:function(){return m$.multicast}});var y$=eo();Object.defineProperty(w,"observeOn",{enumerable:!0,get:function(){return y$.observeOn}});var g$=Hd();Object.defineProperty(w,"onErrorResumeNext",{enumerable:!0,get:function(){return g$.onErrorResumeNext}});var b$=$d();Object.defineProperty(w,"pairwise",{enumerable:!0,get:function(){return b$.pairwise}});var _$=sP();Object.defineProperty(w,"partition",{enumerable:!0,get:function(){return _$.partition}});var P$=Yd();Object.defineProperty(w,"pluck",{enumerable:!0,get:function(){return P$.pluck}});var w$=Qd();Object.defineProperty(w,"publish",{enumerable:!0,get:function(){return w$.publish}});var O$=Kd();Object.defineProperty(w,"publishBehavior",{enumerable:!0,get:function(){return O$.publishBehavior}});var T$=Xd();Object.defineProperty(w,"publishLast",{enumerable:!0,get:function(){return T$.publishLast}});var S$=Jd();Object.defineProperty(w,"publishReplay",{enumerable:!0,get:function(){return S$.publishReplay}});var C$=uP();Object.defineProperty(w,"race",{enumerable:!0,get:function(){return C$.race}});var A$=Tl();Object.defineProperty(w,"raceWith",{enumerable:!0,get:function(){return A$.raceWith}});var E$=an();Object.defineProperty(w,"reduce",{enumerable:!0,get:function(){return E$.reduce}});var q$=Zd();Object.defineProperty(w,"repeat",{enumerable:!0,get:function(){return q$.repeat}});var x$=ev();Object.defineProperty(w,"repeatWhen",{enumerable:!0,get:function(){return x$.repeatWhen}});var M$=tv();Object.defineProperty(w,"retry",{enumerable:!0,get:function(){return M$.retry}});var L$=rv();Object.defineProperty(w,"retryWhen",{enumerable:!0,get:function(){return L$.retryWhen}});var j$=Ks();Object.defineProperty(w,"refCount",{enumerable:!0,get:function(){return j$.refCount}});var I$=xl();Object.defineProperty(w,"sample",{enumerable:!0,get:function(){return I$.sample}});var k$=iv();Object.defineProperty(w,"sampleTime",{enumerable:!0,get:function(){return k$.sampleTime}});var F$=nv();Object.defineProperty(w,"scan",{enumerable:!0,get:function(){return F$.scan}});var D$=ov();Object.defineProperty(w,"sequenceEqual",{enumerable:!0,get:function(){return D$.sequenceEqual}});var R$=Il();Object.defineProperty(w,"share",{enumerable:!0,get:function(){return R$.share}});var z$=sv();Object.defineProperty(w,"shareReplay",{enumerable:!0,get:function(){return z$.shareReplay}});var V$=uv();Object.defineProperty(w,"single",{enumerable:!0,get:function(){return V$.single}});var N$=cv();Object.defineProperty(w,"skip",{enumerable:!0,get:function(){return N$.skip}});var W$=lv();Object.defineProperty(w,"skipLast",{enumerable:!0,get:function(){return W$.skipLast}});var U$=fv();Object.defineProperty(w,"skipUntil",{enumerable:!0,get:function(){return U$.skipUntil}});var G$=hv();Object.defineProperty(w,"skipWhile",{enumerable:!0,get:function(){return G$.skipWhile}});var B$=pv();Object.defineProperty(w,"startWith",{enumerable:!0,get:function(){return B$.startWith}});var H$=to();Object.defineProperty(w,"subscribeOn",{enumerable:!0,get:function(){return H$.subscribeOn}});var $$=dv();Object.defineProperty(w,"switchAll",{enumerable:!0,get:function(){return $$.switchAll}});var Y$=mo();Object.defineProperty(w,"switchMap",{enumerable:!0,get:function(){return Y$.switchMap}});var Q$=vv();Object.defineProperty(w,"switchMapTo",{enumerable:!0,get:function(){return Q$.switchMapTo}});var K$=mv();Object.defineProperty(w,"switchScan",{enumerable:!0,get:function(){return K$.switchScan}});var X$=fo();Object.defineProperty(w,"take",{enumerable:!0,get:function(){return X$.take}});var J$=cl();Object.defineProperty(w,"takeLast",{enumerable:!0,get:function(){return J$.takeLast}});var Z$=yv();Object.defineProperty(w,"takeUntil",{enumerable:!0,get:function(){return Z$.takeUntil}});var e6=gv();Object.defineProperty(w,"takeWhile",{enumerable:!0,get:function(){return e6.takeWhile}});var t6=bv();Object.defineProperty(w,"tap",{enumerable:!0,get:function(){return t6.tap}});var r6=Kl();Object.defineProperty(w,"throttle",{enumerable:!0,get:function(){return r6.throttle}});var i6=_v();Object.defineProperty(w,"throttleTime",{enumerable:!0,get:function(){return i6.throttleTime}});var n6=ho();Object.defineProperty(w,"throwIfEmpty",{enumerable:!0,get:function(){return n6.throwIfEmpty}});var o6=Pv();Object.defineProperty(w,"timeInterval",{enumerable:!0,get:function(){return o6.timeInterval}});var a6=_a();Object.defineProperty(w,"timeout",{enumerable:!0,get:function(){return a6.timeout}});var s6=wv();Object.defineProperty(w,"timeoutWith",{enumerable:!0,get:function(){return s6.timeoutWith}});var u6=Ov();Object.defineProperty(w,"timestamp",{enumerable:!0,get:function(){return u6.timestamp}});var c6=Pc();Object.defineProperty(w,"toArray",{enumerable:!0,get:function(){return c6.toArray}});var l6=Tv();Object.defineProperty(w,"window",{enumerable:!0,get:function(){return l6.window}});var f6=Sv();Object.defineProperty(w,"windowCount",{enumerable:!0,get:function(){return f6.windowCount}});var h6=Cv();Object.defineProperty(w,"windowTime",{enumerable:!0,get:function(){return h6.windowTime}});var p6=Ev();Object.defineProperty(w,"windowToggle",{enumerable:!0,get:function(){return p6.windowToggle}});var d6=qv();Object.defineProperty(w,"windowWhen",{enumerable:!0,get:function(){return d6.windowWhen}});var v6=xv();Object.defineProperty(w,"withLatestFrom",{enumerable:!0,get:function(){return v6.withLatestFrom}});var m6=Lv();Object.defineProperty(w,"zip",{enumerable:!0,get:function(){return m6.zip}});var y6=Mv();Object.defineProperty(w,"zipAll",{enumerable:!0,get:function(){return y6.zipAll}});var g6=jv();Object.defineProperty(w,"zipWith",{enumerable:!0,get:function(){return g6.zipWith}})});var xa=_(qa=>{var b6=function(r,e){return re?1:0},_6=function(r,e){return re?-1:0};function P6(r){return function(e,t){return r(t,e)}}function w6(r){return r===2?function(e,t){return e[0]t[0]?1:e[1]t[1]?1:0}:function(e,t){for(var i=0;it[i])return 1;i++}return 0}}qa.DEFAULT_COMPARATOR=b6;qa.DEFAULT_REVERSE_COMPARATOR=_6;qa.reverseComparator=P6;qa.createTupleComparator=w6});var cP=_(kv=>{kv.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u";kv.SYMBOL_SUPPORT=typeof Symbol<"u"});var _e=_((XX,fP)=>{var lP=cP(),O6=lP.ARRAY_BUFFER_SUPPORT,T6=lP.SYMBOL_SUPPORT;fP.exports=function(e,t){var i,n,a,u,l;if(!e)throw new Error("obliterator/forEach: invalid iterable.");if(typeof t!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||O6&&ArrayBuffer.isView(e)||typeof e=="string"||e.toString()==="[object Arguments]"){for(a=0,u=e.length;a{var hP=xa(),pP=_e(),dP=hP.DEFAULT_COMPARATOR,S6=hP.reverseComparator;function lt(r){if(this.clear(),this.comparator=r||dP,typeof this.comparator!="function")throw new Error("mnemonist/FibonacciHeap.constructor: given comparator should be a function.")}lt.prototype.clear=function(){this.root=null,this.min=null,this.size=0};function C6(r){return{item:r,degree:0}}function vP(r,e){r.root?(e.right=r.root.right,e.left=r.root,r.root.right.left=e,r.root.right=e):r.root=e}lt.prototype.push=function(r){var e=C6(r);return e.left=e,e.right=e,vP(this,e),(!this.min||this.comparator(e.item,this.min.item)<=0)&&(this.min=e),++this.size};lt.prototype.peek=function(){return this.min?this.min.item:void 0};function mP(r){for(var e=[],t=r,i=!1;!(t===r&&i);)t===r&&(i=!0),e.push(t),t=t.right;return e}function yP(r,e){r.root===e&&(r.root=e.right),e.left.right=e.right,e.right.left=e.left}function A6(r,e){r.child?(e.right=r.child.right,e.left=r.child,r.child.right.left=e,r.child.right=e):r.child=e}function E6(r,e,t){yP(r,e),e.left=e,e.right=e,A6(t,e),t.degree++,e.parent=t}function q6(r){var e=new Array(r.size),t=mP(r.root),i,n,a,u,l,h;for(i=0,n=t.length;i0&&(h=a,a=u,u=h),E6(r,u,a),e[l]=null,l++;e[l]=a}for(i=0;i{var x6=Math.pow(2,8)-1,M6=Math.pow(2,16)-1,L6=Math.pow(2,32)-1,j6=Math.pow(2,7)-1,I6=Math.pow(2,15)-1,k6=Math.pow(2,31)-1;gr.getPointerArray=function(r){var e=r-1;if(e<=x6)return Uint8Array;if(e<=M6)return Uint16Array;if(e<=L6)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")};gr.getSignedPointerArray=function(r){var e=r-1;return e<=j6?Int8Array:e<=I6?Int16Array:e<=k6?Int32Array:Float64Array};gr.getNumberType=function(r){return r===(r|0)?Math.sign(r)===-1?r<=127&&r>=-128?Int8Array:r<=32767&&r>=-32768?Int16Array:Int32Array:r<=255?Uint8Array:r<=65535?Uint16Array:Uint32Array:Float64Array};var F6={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};gr.getMinimalRepresentation=function(r,e){var t=null,i=0,n,a,u,l,h;for(l=0,h=r.length;li&&(i=n,t=a);return t};gr.isTypedArray=function(r){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(r)};gr.concat=function(){var r=0,e,t,i;for(e=0,i=arguments.length;e{var PP=_e(),wP=ft();function D6(r){return Array.isArray(r)||wP.isTypedArray(r)}function Fv(r){if(typeof r.length=="number")return r.length;if(typeof r.size=="number")return r.size}function R6(r){var e=Fv(r),t=typeof e=="number"?new Array(e):[],i=0;return PP(r,function(n){t[i++]=n}),t}function z6(r){var e=Fv(r),t=typeof e=="number"?wP.getPointerArray(e):Array,i=typeof e=="number"?new Array(e):[],n=typeof e=="number"?new t(e):[],a=0;return PP(r,function(u){i[a]=u,n[a]=a++}),[i,n]}La.isArrayLike=D6;La.guessLength=Fv;La.toArray=R6;La.toArrayWithIndices=z6});var _f=_((w7,CP)=>{var yf=_e(),OP=xa(),br=wt(),bf=OP.DEFAULT_COMPARATOR,Dv=OP.reverseComparator;function Rv(r,e,t,i){for(var n=e[i],a,u;i>t;){if(a=i-1>>1,u=e[a],r(n,u)<0){e[i]=u,i=a;continue}break}e[i]=n}function ja(r,e,t){for(var i=e.length,n=t,a=e[t],u=2*t+1,l;u=0&&(u=l),e[t]=e[u],t=u,u=2*t+1;e[t]=a,Rv(r,e,n,t)}function TP(r,e,t){e.push(t),Rv(r,e,0,e.length-1)}function zv(r,e){var t=e.pop();if(e.length!==0){var i=e[0];return e[0]=t,ja(r,e,0),i}return t}function Oo(r,e,t){if(e.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var i=e[0];return e[0]=t,ja(r,e,0),i}function SP(r,e,t){var i;return e.length!==0&&r(e[0],t)<0&&(i=e[0],e[0]=t,t=i,ja(r,e,0)),t}function ln(r,e){for(var t=e.length,i=t>>1,n=i;--n>=0;)ja(r,e,n)}function Vv(r,e){for(var t=e.length,i=0,n=new Array(t);i=t.length)return t.slice().sort(r);for(h=t.slice(0,e),ln(i,h),n=e,a=t.length;n0&&Oo(i,h,t[n]);return h.sort(r)}var p=br.guessLength(t);return p!==null&&p0&&Oo(i,h,v)),n++}),h.length>n&&(h.length=n),h.sort(r)}function N6(r,e,t){arguments.length===2&&(t=e,e=r,r=bf);var i=Dv(r),n,a,u,l=-1/0,h;if(e===1){if(br.isArrayLike(t)){for(n=0,a=t.length;n0)&&(l=u);return h=new t.constructor(1),h[0]=l,h}return yf(t,function(v){(l===-1/0||r(v,l)>0)&&(l=v)}),[l]}if(br.isArrayLike(t)){if(e>=t.length)return t.slice().sort(i);for(h=t.slice(0,e),ln(r,h),n=e,a=t.length;n0&&Oo(r,h,t[n]);return h.sort(i)}var p=br.guessLength(t);return p!==null&&p0&&Oo(r,h,v)),n++}),h.length>n&&(h.length=n),h.sort(i)}function fe(r){if(this.clear(),this.comparator=r||bf,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}fe.prototype.clear=function(){this.items=[],this.size=0};fe.prototype.push=function(r){return TP(this.comparator,this.items,r),++this.size};fe.prototype.peek=function(){return this.items[0]};fe.prototype.pop=function(){return this.size!==0&&this.size--,zv(this.comparator,this.items)};fe.prototype.replace=function(r){return Oo(this.comparator,this.items,r)};fe.prototype.pushpop=function(r){return SP(this.comparator,this.items,r)};fe.prototype.consume=function(){return this.size=0,Vv(this.comparator,this.items)};fe.prototype.toArray=function(){return Vv(this.comparator,this.items.slice())};fe.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:fe,enumerable:!1}),r};typeof Symbol<"u"&&(fe.prototype[Symbol.for("nodejs.util.inspect.custom")]=fe.prototype.inspect);function gf(r){if(this.clear(),this.comparator=r||bf,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=Dv(this.comparator)}gf.prototype=fe.prototype;fe.from=function(r,e){var t=new fe(e),i;return br.isArrayLike(r)?i=r.slice():i=br.toArray(r),ln(t.comparator,i),t.items=i,t.size=i.length,t};gf.from=function(r,e){var t=new gf(e),i;return br.isArrayLike(r)?i=r.slice():i=br.toArray(r),ln(t.comparator,i),t.items=i,t.size=i.length,t};fe.siftUp=ja;fe.siftDown=Rv;fe.push=TP;fe.pop=zv;fe.replace=Oo;fe.pushpop=SP;fe.heapify=ln;fe.consume=Vv;fe.nsmallest=V6;fe.nlargest=N6;fe.MinHeap=fe;fe.MaxHeap=gf;CP.exports=fe});var MP=_((O7,xP)=>{var AP="";function EP(r,e,t){for(var i=e.length,n=[],a=i,u=-1,l,h=0,p;a--;)u=Math.max(r[e[a]+t],u);for(p=u>>24&&32||u>>16&&24||u>>8&&16||8;h>h&15].push(e[a]);for(l=0;l<16;l++)for(u=n[l].length;u--;)e[++a]=n[l][u]}}function W6(r,e,t,i){return r[t]-r[i]||(t%3===2?r[t+1]-r[i+1]||e[t+2]-e[i+2]:e[t+1]-e[i+1])}function Nv(r,e){var t=[],i=[],n=2*e/3|0,a=e-n,u=n+1>>1,l=n,h=0,p,v=[],b=[];if(e===1)return[0];for(;l--;)t[l]=(l*3>>1)+1;for(l=3;l--;)EP(r,t,l);for(h=i[(t[0]/3|0)+(t[0]%3===1?0:u)]=1,l=1;lthis.firstLength&&a>this.firstLength)){for(e=Math.min(this.length-n,this.length-a),i=0;ir.length&&(r=this.text.slice(n,n+e))}return r};ji.prototype.toString=function(){return this.array.join(",")};ji.prototype.toJSON=function(){return this.array};ji.prototype.inspect=function(){for(var r=new Array(this.length),e=0;e{var U6=_e();function tr(r){this.size=0,this.items=new Map,this.inverse=r}function Lt(){this.size=0,this.items=new Map,this.inverse=new tr(this)}function LP(){this.size=0,this.items.clear(),this.inverse.items.clear()}Lt.prototype.clear=LP;tr.prototype.clear=LP;function jP(r,e){if(this.items.has(r)){var t=this.items.get(r);if(t===e)return this;this.inverse.items.delete(t)}if(this.inverse.items.has(e)){var i=this.inverse.items.get(e);if(i===r)return this;this.items.delete(i)}return this.items.set(r,e),this.inverse.items.set(e,r),this.size=this.items.size,this.inverse.size=this.inverse.items.size,this}Lt.prototype.set=jP;tr.prototype.set=jP;function IP(r){if(this.items.has(r)){var e=this.items.get(r);return this.items.delete(r),this.inverse.items.delete(e),this.size=this.items.size,this.inverse.size=this.inverse.items.size,!0}return!1}Lt.prototype.delete=IP;tr.prototype.delete=IP;var G6=["has","get","forEach","keys","values","entries"];G6.forEach(function(r){Lt.prototype[r]=tr.prototype[r]=function(){return Map.prototype[r].apply(this.items,arguments)}});typeof Symbol<"u"&&(Lt.prototype[Symbol.iterator]=Lt.prototype.entries,tr.prototype[Symbol.iterator]=tr.prototype.entries);Lt.prototype.inspect=function(){var r={left:this.items,right:this.inverse.items};return Object.defineProperty(r,"constructor",{value:Lt,enumerable:!1}),r};typeof Symbol<"u"&&(Lt.prototype[Symbol.for("nodejs.util.inspect.custom")]=Lt.prototype.inspect);tr.prototype.inspect=function(){var r={left:this.inverse.items,right:this.items};return Object.defineProperty(r,"constructor",{value:tr,enumerable:!1}),r};typeof Symbol<"u"&&(tr.prototype[Symbol.for("nodejs.util.inspect.custom")]=tr.prototype.inspect);Lt.from=function(r){var e=new Lt;return U6(r,function(t,i){e.set(i,t)}),e};kP.exports=Lt});var Ge=_((S7,DP)=>{function _r(r){if(typeof r!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=r}typeof Symbol<"u"&&(_r.prototype[Symbol.iterator]=function(){return this});_r.of=function(){var r=arguments,e=r.length,t=0;return new _r(function(){return t>=e?{done:!0}:{done:!1,value:r[t++]}})};_r.empty=function(){var r=new _r(function(){return{done:!0}});return r};_r.fromSequence=function(r){var e=0,t=r.length;return new _r(function(){return e>=t?{done:!0}:{done:!1,value:r[e++]}})};_r.is=function(r){return r instanceof _r?!0:typeof r=="object"&&r!==null&&typeof r.next=="function"};DP.exports=_r});var Uv=_(rr=>{function zP(r){return r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r&~(r>>1)}rr.msb32=zP;function Wv(r){return r|=r>>1,r|=r>>2,r|=r>>4,r&~(r>>1)}rr.msb8=Wv;rr.test=function(r,e){return r>>e&1};rr.criticalBit8=function(r,e){return Wv(r^e)};rr.criticalBit8Mask=function(r,e){return~Wv(r^e)>>>0&255};rr.testCriticalBit8=function(r,e){return 1+(r|e)>>8};rr.criticalBit32Mask=function(r,e){return~zP(r^e)>>>0&4294967295};rr.popcount=function(r){return r-=r>>1&1431655765,r=(r&858993459)+(r>>2&858993459),r=r+(r>>4)&252645135,r+=r>>8,r+=r>>16,r&127};var To=new Uint8Array(Math.pow(2,8));for(Ia=0,RP=To.length;Ia>8&255]+To[r>>16&255]+To[r>>24&255]}});var UP=_((A7,WP)=>{var NP=Ge(),VP=Uv();function Re(r){this.length=r,this.clear()}Re.prototype.clear=function(){this.size=0,this.array=new Uint32Array(Math.ceil(this.length/32))};Re.prototype.set=function(r,e){var t=r>>5,i=r&31,n=this.array[t],a;return e===0||e===!1?a=this.array[t]&=~(1<>>0,a>n?this.size++:a>5,t=r&31,i=this.array[e],n;return n=this.array[e]&=~(1<>5,t=r&31,i=this.array[e],n=this.array[e]^=1<>>0,n>i?this.size++:n>5,t=r&31;return this.array[e]>>t&1};Re.prototype.test=function(r){return!!this.get(r)};Re.prototype.rank=function(r){if(this.size===0)return 0;for(var e=r>>5,t=r&31,i=0,n=0;n=this.length)return-1;for(var e,t=32,i=0,n=0,a=0,u=this.array.length;a>l&1,n===r)return i}};Re.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t=this.length,i,n,a=32,u=0,l=this.array.length;u>h&1,r.call(e,n,u*32+h)}};Re.prototype.values=function(){var r=this.length,e=!1,t,i,n=this.array,a=n.length,u=0,l=-1,h=32;return new NP(function p(){if(!e){if(u>=a)return{done:!0};u===a-1&&(h=r%32||32),t=n[u++],e=!0,l=-1}return l++,l>=h?(e=!1,p()):(i=t>>l&1,{value:i})})};Re.prototype.entries=function(){var r=this.length,e=!1,t,i,n=this.array,a,u=n.length,l=0,h=-1,p=32;return new NP(function v(){if(!e){if(l>=u)return{done:!0};l===u-1&&(p=r%32||32),t=n[l++],e=!0,h=-1}return h++,a=~-l*32+h,h>=p?(e=!1,v()):(i=t>>h&1,{value:[a,i]})})};typeof Symbol<"u"&&(Re.prototype[Symbol.iterator]=Re.prototype.values);Re.prototype.inspect=function(){var r=new Uint8Array(this.length);return this.forEach(function(e,t){r[t]=e}),Object.defineProperty(r,"constructor",{value:Re,enumerable:!1}),r};typeof Symbol<"u"&&(Re.prototype[Symbol.for("nodejs.util.inspect.custom")]=Re.prototype.inspect);Re.prototype.toJSON=function(){return Array.from(this.array)};WP.exports=Re});var $P=_((E7,HP)=>{var BP=Ge(),GP=Uv(),B6=function(r){return Math.max(1,Math.ceil(r*1.5))};function H6(r){return new Uint32Array(Math.ceil(r/32))}function Pe(r){var e=r||0,t=B6;typeof r=="object"&&(e=r.initialLength||r.initialCapacity||0,t=r.policy||t),this.size=0,this.length=e,this.capacity=Math.ceil(this.length/32)*32,this.policy=t,this.array=H6(this.capacity)}Pe.prototype.set=function(r,e){if(this.length>5,i=r&31,n=this.array[t],a;return e===0||e===!1?a=this.array[t]&=~(1<>>0,a>n?this.size++:a>5,t=r&31,i=this.array[e],n;return n=this.array[e]&=~(1<>5,t=r&31,i=this.array[e],n=this.array[e]^=1<>>0,n>i?this.size++:nthis.array.length?(this.array=new Uint32Array(i),this.array.set(t,0)):this.array=t.slice(0,i),this.capacity=r,this)};Pe.prototype.grow=function(r){var e;if(typeof r=="number"){if(this.capacity>=r)return this;for(e=this.capacity;e>5,i=e&31;return this.array[t]|=1<>5,t=r&31;return this.array[e]>>t&1}};Pe.prototype.get=function(r){if(!(this.length>5,t=r&31;return this.array[e]>>t&1}};Pe.prototype.test=function(r){return this.length>5,t=r&31,i=0,n=0;n=this.length)return-1;for(var e,t=32,i=0,n=0,a=0,u=this.array.length;a>l&1,n===r)return i}};Pe.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t=this.length,i,n,a=32,u=0,l=this.array.length;u>h&1,r.call(e,n,u*32+h)}};Pe.prototype.values=function(){var r=this.length,e=!1,t,i,n=this.array,a=n.length,u=0,l=-1,h=32;return new BP(function p(){if(!e){if(u>=a)return{done:!0};u===a-1&&(h=r%32||32),t=n[u++],e=!0,l=-1}return l++,l>=h?(e=!1,p()):(i=t>>l&1,{value:i})})};Pe.prototype.entries=function(){var r=this.length,e=!1,t,i,n=this.array,a,u=n.length,l=0,h=-1,p=32;return new BP(function v(){if(!e){if(l>=u)return{done:!0};l===u-1&&(p=r%32||32),t=n[l++],e=!0,h=-1}return h++,a=~-l*32+h,h>=p?(e=!1,v()):(i=t>>h&1,{value:[a,i]})})};typeof Symbol<"u"&&(Pe.prototype[Symbol.iterator]=Pe.prototype.values);Pe.prototype.inspect=function(){var r=new Uint8Array(this.length);return this.forEach(function(e,t){r[t]=e}),Object.defineProperty(r,"constructor",{value:Pe,enumerable:!1}),r};typeof Symbol<"u"&&(Pe.prototype[Symbol.for("nodejs.util.inspect.custom")]=Pe.prototype.inspect);Pe.prototype.toJSON=function(){return Array.from(this.array.slice(0,(this.length>>5)+1))};HP.exports=Pe});var QP=_((q7,YP)=>{function fn(r,e){return(r&65535)*e+(((r>>>16)*e&65535)<<16)&4294967295}function $6(r,e){return(r&65535)+(e>>>16)+(((r>>>16)+e&65535)<<16)&4294967295}function Gv(r,e){return r<>>32-e}YP.exports=function(e,t){var i=3432918353,n=461845907,a=15,u=13,l=5,h=1801774676,p=e,v,b,T;for(b=0,T=t.length-4;b<=T;b+=4)v=t[b]|t[b+1]<<8|t[b+2]<<16|t[b+3]<<24,v=fn(v,i),v=Gv(v,a),v=fn(v,n),p^=v,p=Gv(p,u),p=fn(p,l),p=$6(p,h);switch(v=0,t.length&3){case 3:v^=t[b+2]<<16;case 2:v^=t[b+1]<<8;case 1:v^=t[b],v=fn(v,i),v=Gv(v,a),v=fn(v,n),p^=v;default:}return p^=t.length,p^=p>>>16,p=fn(p,2246822507),p^=p>>>13,p=fn(p,3266489909),p^=p>>>16,p>>>0}});var ZP=_((x7,JP)=>{var Y6=QP(),Q6=_e(),K6=Math.LN2*Math.LN2,X6={errorRate:.005};function KP(r){var e=new Uint16Array(r.length),t,i;for(t=0,i=r.length;t>3]|=a}return this};hn.prototype.test=function(r){for(var e=KP(r),t=0,i=this.hashFunctions;t>3]&1<<(7&n)))return!1}return!0};hn.prototype.toJSON=function(){return this.data};hn.from=function(r,e){if(!e&&(e=r.length||r.size,typeof e!="number"))throw new Error("BloomFilter.from: could not infer the filter's capacity. Try passing it as second argument.");var t=new hn(e);return Q6(r,function(i){t.add(i)}),t};JP.exports=hn});var tw=_((M7,ew)=>{var J6=_e();function ir(r){if(typeof r!="function")throw new Error("mnemonist/BKTree.constructor: given `distance` should be a function.");this.distance=r,this.clear()}ir.prototype.add=function(r){if(!this.root)return this.root={item:r,children:{}},this.size++,this;for(var e=this.root,t;t=this.distance(r,e.item),!!e.children[t];)e=e.children[t];return e.children[t]={item:r,children:{}},this.size++,this};ir.prototype.search=function(r,e){if(!this.root)return[];for(var t=[],i=[this.root],n,a,u,l,h;i.length;)for(n=i.pop(),u=this.distance(e,n.item),u<=r&&t.push({item:n.item,distance:u}),l=u-r,h=u+r+1;l{var Bv=wt(),rw=Ge();function xe(r,e){if(arguments.length<2)throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");if(typeof e!="number"||e<=0)throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=r,this.capacity=e,this.items=new r(this.capacity),this.clear()}xe.prototype.clear=function(){this.start=0,this.size=0};xe.prototype.push=function(r){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.push: deque capacity ("+this.capacity+") exceeded!");var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]=r,++this.size};xe.prototype.unshift=function(r){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.unshift: deque capacity ("+this.capacity+") exceeded!");var e=this.start-1;return this.start===0&&(e=this.capacity-1),this.items[e]=r,this.start=e,++this.size};xe.prototype.pop=function(){if(this.size!==0){this.size--;var r=this.start+this.size;return r>=this.capacity&&(r-=this.capacity),this.items[r]}};xe.prototype.shift=function(){if(this.size!==0){var r=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[r]}};xe.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]};xe.prototype.peekLast=function(){if(this.size!==0){var r=this.start+this.size-1;return r>=this.capacity&&(r-=this.capacity),this.items[r]}};xe.prototype.get=function(r){if(!(this.size===0||r>=this.capacity))return r=this.start+r,r>=this.capacity&&(r-=this.capacity),this.items[r]};xe.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t=this.capacity,i=this.size,n=this.start,a=0;a=t)return{done:!0};var a=r[i];return i++,n++,i===e&&(i=0),{value:a,done:!1}})};xe.prototype.entries=function(){var r=this.items,e=this.capacity,t=this.size,i=this.start,n=0;return new rw(function(){if(n>=t)return{done:!0};var a=r[i];return i++,i===e&&(i=0),{value:[n++,a],done:!1}})};typeof Symbol<"u"&&(xe.prototype[Symbol.iterator]=xe.prototype.values);xe.prototype.inspect=function(){var r=this.toArray();return r.type=this.ArrayClass.name,r.capacity=this.capacity,Object.defineProperty(r,"constructor",{value:xe,enumerable:!1}),r};typeof Symbol<"u"&&(xe.prototype[Symbol.for("nodejs.util.inspect.custom")]=xe.prototype.inspect);xe.from=function(r,e,t){if(arguments.length<3&&(t=Bv.guessLength(r),typeof t!="number"))throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");var i=new xe(e,t);if(Bv.isArrayLike(r)){var n,a;for(n=0,a=r.length;n{var $v=wt(),Yv=Hv();function So(r,e){if(arguments.length<2)throw new Error("mnemonist/circular-buffer: expecting an Array class and a capacity.");if(typeof e!="number"||e<=0)throw new Error("mnemonist/circular-buffer: `capacity` should be a positive number.");this.ArrayClass=r,this.capacity=e,this.items=new r(this.capacity),this.clear()}function nw(r){So.prototype[r]=Yv.prototype[r]}Object.keys(Yv.prototype).forEach(nw);typeof Symbol<"u"&&Object.getOwnPropertySymbols(Yv.prototype).forEach(nw);So.prototype.push=function(r){var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]=r,this.size===this.capacity?(e++,e>=this.capacity?this.start=0:this.start=e,this.size):++this.size};So.prototype.unshift=function(r){var e=this.start-1;return this.start===0&&(e=this.capacity-1),this.items[e]=r,this.size===this.capacity?(this.start=e,this.size):(this.start=e,++this.size)};So.from=function(r,e,t){if(arguments.length<3&&(t=$v.guessLength(r),typeof t!="number"))throw new Error("mnemonist/circular-buffer.from: could not guess iterable length. Please provide desired capacity as last argument.");var i=new So(e,t);if($v.isArrayLike(r)){var n,a;for(n=0,a=r.length;n{function Ze(r){if(typeof r!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=r,this.size=0}Ze.prototype.clear=function(){this.items.clear(),this.size=0};Ze.prototype.get=function(r){var e=this.items.get(r);return typeof e>"u"&&(e=this.factory(r,this.size),this.items.set(r,e),this.size++),e};Ze.prototype.peek=function(r){return this.items.get(r)};Ze.prototype.set=function(r,e){return this.items.set(r,e),this.size=this.items.size,this};Ze.prototype.has=function(r){return this.items.has(r)};Ze.prototype.delete=function(r){var e=this.items.delete(r);return this.size=this.items.size,e};Ze.prototype.forEach=function(r,e){e=arguments.length>1?e:this,this.items.forEach(r,e)};Ze.prototype.entries=function(){return this.items.entries()};Ze.prototype.keys=function(){return this.items.keys()};Ze.prototype.values=function(){return this.items.values()};typeof Symbol<"u"&&(Ze.prototype[Symbol.iterator]=Ze.prototype.entries);Ze.prototype.inspect=function(){return this.items};typeof Symbol<"u"&&(Ze.prototype[Symbol.for("nodejs.util.inspect.custom")]=Ze.prototype.inspect);Ze.autoIncrement=function(){var r=0;return function(){return r++}};sw.exports=Ze});var lw=_((k7,cw)=>{function Pr(r){if(typeof r!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=r}Pr.prototype.clear=function(){this.items=new WeakMap};Pr.prototype.get=function(r){var e=this.items.get(r);return typeof e>"u"&&(e=this.factory(r),this.items.set(r,e)),e};Pr.prototype.peek=function(r){return this.items.get(r)};Pr.prototype.set=function(r,e){return this.items.set(r,e),this};Pr.prototype.has=function(r){return this.items.has(r)};Pr.prototype.delete=function(r){return this.items.delete(r)};Pr.prototype.inspect=function(){return this.items};typeof Symbol<"u"&&(Pr.prototype[Symbol.for("nodejs.util.inspect.custom")]=Pr.prototype.inspect);cw.exports=Pr});var hw=_((F7,fw)=>{var Qv=ft();function wr(r){var e=Qv.getPointerArray(r),t=Qv.getPointerArray(Math.log2(r));this.size=r,this.dimension=r,this.parents=new e(r),this.ranks=new t(r);for(var i=0;ia?this.parents[i]=t:(this.parents[i]=t,this.ranks[t]++),this};wr.prototype.connected=function(r,e){var t=this.find(r);return t===this.find(e)};wr.prototype.mapping=function(){for(var r=Qv.getPointerArray(this.dimension),e={},t=new r(this.size),i=0,n,a=0,u=this.parents.length;a"u"?(t[a]=i,e[n]=i++):t[a]=e[n];return t};wr.prototype.compile=function(){for(var r={},e=new Array(this.dimension),t=0,i,n=0,a=this.parents.length;n"u"?(e[t]=[n],r[i]=t++):e[r[i]].push(n);return e};wr.prototype.inspect=function(){var r=this.compile();return Object.defineProperty(r,"constructor",{value:wr,enumerable:!1}),r};typeof Symbol<"u"&&(wr.prototype[Symbol.for("nodejs.util.inspect.custom")]=wr.prototype.inspect);fw.exports=wr});var Pf=_((D7,vw)=>{var pw=xa(),Kv=_f(),Z6=pw.DEFAULT_COMPARATOR,e8=pw.reverseComparator;function t8(r,e,t,i){for(var n=t,a=i,u=e[i],l=2*i+1,h;l=0&&(l=h),e[i]=e[l],i=l,l=2*i+1;e[i]=u,Kv.siftDown(r,e,a,i)}function dw(r,e,t,i){for(var n=i,a=n,u=new r(i),l,h;a>0;)l=t[--a],a!==0&&(h=t[0],t[0]=l,t8(e,t,--i,0),l=h),u[a]=l;return u}function Or(r,e,t){if(arguments.length===2&&(t=e,e=null),this.ArrayClass=r,this.capacity=t,this.items=new r(t),this.clear(),this.comparator=e||Z6,typeof t!="number"&&t<=0)throw new Error("mnemonist/FixedReverseHeap.constructor: capacity should be a number > 0.");if(typeof this.comparator!="function")throw new Error("mnemonist/FixedReverseHeap.constructor: given comparator should be a function.");this.comparator=e8(this.comparator)}Or.prototype.clear=function(){this.size=0};Or.prototype.push=function(r){return this.size0&&Kv.replace(this.comparator,this.items,r),this.size};Or.prototype.peek=function(){return this.items[0]};Or.prototype.consume=function(){var r=dw(this.ArrayClass,this.comparator,this.items,this.size);return this.size=0,r};Or.prototype.toArray=function(){return dw(this.ArrayClass,this.comparator,this.items.slice(0,this.size),this.size)};Or.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:Or,enumerable:!1}),r};typeof Symbol<"u"&&(Or.prototype[Symbol.for("nodejs.util.inspect.custom")]=Or.prototype.inspect);vw.exports=Or});var gw=_((R7,yw)=>{var r8=_e(),mw=function(r){return r};function it(r){if(this.items=new Map,this.clear(),Array.isArray(r)?(this.writeHashFunction=r[0],this.readHashFunction=r[1]):(this.writeHashFunction=r,this.readHashFunction=r),this.writeHashFunction||(this.writeHashFunction=mw),this.readHashFunction||(this.readHashFunction=mw),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.")}it.prototype.clear=function(){this.items.clear(),this.size=0};it.prototype.add=function(r){var e=this.writeHashFunction(r);return this.items.set(e,r),this.size=this.items.size,this};it.prototype.set=function(r,e){return r=this.writeHashFunction(r),this.items.set(r,e),this.size=this.items.size,this};it.prototype.get=function(r){return r=this.readHashFunction(r),this.items.get(r)};it.prototype.has=function(r){return r=this.readHashFunction(r),this.items.has(r)};it.prototype.forEach=function(r,e){e=arguments.length>1?e:this,this.items.forEach(function(t){r.call(e,t,t)})};it.prototype.values=function(){return this.items.values()};typeof Symbol<"u"&&(it.prototype[Symbol.iterator]=it.prototype.values);it.prototype.inspect=function(){var r=Array.from(this.items.values());return Object.defineProperty(r,"constructor",{value:it,enumerable:!1}),r};typeof Symbol<"u"&&(it.prototype[Symbol.for("nodejs.util.inspect.custom")]=it.prototype.inspect);it.from=function(r,e,t){var i=new it(e);return r8(r,function(n,a){t?i.set(a,n):i.add(n)}),i};yw.exports=it});var Xv=_((z7,bw)=>{var wf=Ge(),i8=_e();function me(r){this.Container=r||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:me,enumerable:!1})}me.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()};me.prototype.set=function(r,e){var t=this.items.get(r),i;return t||(this.dimension++,t=new this.Container,this.items.set(r,t)),this.Container===Set?(i=t.size,t.add(e),i"u"?0:this.Container===Set?e.size:e.length};me.prototype.count=me.prototype.multiplicity;me.prototype.forEach=function(r,e){e=arguments.length>1?e:this;var t;function i(n){r.call(e,n,t)}this.items.forEach(function(n,a){t=a,n.forEach(i)})};me.prototype.forEachAssociation=function(r,e){e=arguments.length>1?e:this,this.items.forEach(r,e)};me.prototype.keys=function(){return this.items.keys()};me.prototype.values=function(){var r=this.items.values(),e=!1,t,i,n,a;return this.Container===Set?new wf(function u(){if(!e){if(i=r.next(),i.done)return{done:!0};e=!0,t=i.value.values()}return i=t.next(),i.done?(e=!1,u()):{done:!1,value:i.value}}):new wf(function u(){if(!e){if(i=r.next(),i.done)return{done:!0};e=!0,t=i.value,n=0,a=t.length}return n>=a?(e=!1,u()):{done:!1,value:t[n++]}})};me.prototype.entries=function(){var r=this.items.entries(),e=!1,t,i,n,a,u;return this.Container===Set?new wf(function l(){if(!e){if(i=r.next(),i.done)return{done:!0};e=!0,n=i.value[0],t=i.value[1].values()}return i=t.next(),i.done?(e=!1,l()):{done:!1,value:[n,i.value]}}):new wf(function l(){if(!e){if(i=r.next(),i.done)return{done:!0};e=!0,n=i.value[0],t=i.value[1],a=0,u=t.length}return a>=u?(e=!1,l()):{done:!1,value:[n,t[a++]]}})};me.prototype.containers=function(){return this.items.values()};me.prototype.associations=function(){return this.items.entries()};typeof Symbol<"u"&&(me.prototype[Symbol.iterator]=me.prototype.entries);me.prototype.inspect=function(){return this.items};typeof Symbol<"u"&&(me.prototype[Symbol.for("nodejs.util.inspect.custom")]=me.prototype.inspect);me.prototype.toJSON=function(){return this.items};me.from=function(r,e){var t=new me(e);return i8(r,function(i,n){t.set(n,i)}),t};bw.exports=me});var ww=_((V7,Pw)=>{var n8=Xv(),o8=_e(),_w=function(r){return r};function nt(r,e){if(this.items=new n8(e),this.clear(),Array.isArray(r)?(this.writeHashFunction=r[0],this.readHashFunction=r[1]):(this.writeHashFunction=r,this.readHashFunction=r),this.writeHashFunction||(this.writeHashFunction=_w),this.readHashFunction||(this.readHashFunction=_w),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.")}nt.prototype.clear=function(){this.items.clear(),this.size=0,this.dimension=0};nt.prototype.add=function(r){var e=this.writeHashFunction(r);return this.items.set(e,r),this.size=this.items.size,this.dimension=this.items.dimension,this};nt.prototype.set=function(r,e){return r=this.writeHashFunction(r),this.items.set(r,e),this.size=this.items.size,this.dimension=this.items.dimension,this};nt.prototype.get=function(r){return r=this.readHashFunction(r),this.items.get(r)};nt.prototype.has=function(r){return r=this.readHashFunction(r),this.items.has(r)};nt.prototype.forEach=function(r,e){e=arguments.length>1?e:this,this.items.forEach(function(t){r.call(e,t,t)})};nt.prototype.values=function(){return this.items.values()};typeof Symbol<"u"&&(nt.prototype[Symbol.iterator]=nt.prototype.values);nt.prototype.inspect=function(){var r=Array.from(this);return Object.defineProperty(r,"constructor",{value:nt,enumerable:!1}),r};typeof Symbol<"u"&&(nt.prototype[Symbol.for("nodejs.util.inspect.custom")]=nt.prototype.inspect);nt.from=function(r,e,t,i){arguments.length===3&&typeof t=="boolean"&&(i=t,t=Array);var n=new nt(e,t);return o8(r,function(a,u){i?n.set(u,a):n.add(a)}),n};Pw.exports=nt});var Sw=_((N7,Tw)=>{var Ow=1024;function a8(r){return(r&r-1)===0}function nr(r,e){if(arguments.length<1)throw new Error("mnemonist/hashed-array-tree: expecting at least a byte array constructor.");var t=e||0,i=Ow,n=0;if(typeof e=="object"&&(t=e.initialCapacity||0,n=e.initialLength||0,i=e.blockSize||Ow),!i||!a8(i))throw new Error("mnemonist/hashed-array-tree: block size should be a power of two.");var a=Math.max(n,t),u=Math.ceil(a/i);this.ArrayClass=r,this.length=n,this.capacity=u*i,this.blockSize=i,this.offsetMask=i-1,this.blockMask=Math.log2(i),this.blocks=new Array(u);for(var l=0;l>this.blockMask,i=r&this.offsetMask;return this.blocks[t][i]=e,this};nr.prototype.get=function(r){if(!(this.length>this.blockMask,t=r&this.offsetMask;return this.blocks[e][t]}};nr.prototype.grow=function(r){if(typeof r!="number"&&(r=this.capacity+this.blockSize),this.capacity>=r)return this;for(;this.capacity>this.blockMask,i=e&this.offsetMask;return this.blocks[t][i]=r,++this.length};nr.prototype.pop=function(){if(this.length!==0){var r=this.blocks[this.blocks.length-1],e=--this.length&this.offsetMask;return r[e]}};nr.prototype.inspect=function(){for(var r=new this.ArrayClass(this.length),e,t=0,i=this.length;t>this.blockMask,r[t]=this.blocks[e][t&this.offsetMask];return r.type=this.ArrayClass.name,r.items=this.length,r.capacity=this.capacity,r.blockSize=this.blockSize,Object.defineProperty(r,"constructor",{value:nr,enumerable:!1}),r};typeof Symbol<"u"&&(nr.prototype[Symbol.for("nodejs.util.inspect.custom")]=nr.prototype.inspect);Tw.exports=nr});var Zv=_((W7,Aw)=>{var Cw=Ge(),Jv=wt();function ze(r,e){if(arguments.length<2)throw new Error("mnemonist/fixed-stack: expecting an Array class and a capacity.");if(typeof e!="number"||e<=0)throw new Error("mnemonist/fixed-stack: `capacity` should be a positive number.");this.capacity=e,this.ArrayClass=r,this.items=new this.ArrayClass(this.capacity),this.clear()}ze.prototype.clear=function(){this.size=0};ze.prototype.push=function(r){if(this.size===this.capacity)throw new Error("mnemonist/fixed-stack.push: stack capacity ("+this.capacity+") exceeded!");return this.items[this.size++]=r,this.size};ze.prototype.pop=function(){if(this.size!==0)return this.items[--this.size]};ze.prototype.peek=function(){return this.items[this.size-1]};ze.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t=0,i=this.items.length;t=e)return{done:!0};var i=r[e-t-1];return t++,{value:i,done:!1}})};ze.prototype.entries=function(){var r=this.items,e=this.size,t=0;return new Cw(function(){if(t>=e)return{done:!0};var i=r[e-t-1];return{value:[t++,i],done:!1}})};typeof Symbol<"u"&&(ze.prototype[Symbol.iterator]=ze.prototype.values);ze.prototype.toString=function(){return this.toArray().join(",")};ze.prototype.toJSON=function(){return this.toArray()};ze.prototype.inspect=function(){var r=this.toArray();return r.type=this.ArrayClass.name,r.capacity=this.capacity,Object.defineProperty(r,"constructor",{value:ze,enumerable:!1}),r};typeof Symbol<"u"&&(ze.prototype[Symbol.for("nodejs.util.inspect.custom")]=ze.prototype.inspect);ze.from=function(r,e,t){if(arguments.length<3&&(t=Jv.guessLength(r),typeof t!="number"))throw new Error("mnemonist/fixed-stack.from: could not guess iterable length. Please provide desired capacity as last argument.");var i=new ze(e,t);if(Jv.isArrayLike(r)){var n,a;for(n=0,a=r.length;n{var s8=wt(),u8=ft(),c8=Zv();function em(r,e,t,i,n,a,u,l){var h=u+(l-u)/2|0,p=~-h,v=-~h,b=t[h];i[a]=b+1;var T=e?e(r[b]):r[b][1],S=a*2+1,q=a*2+2,M=-1/0,j=-1/0;u<=p&&(M=em(r,e,t,i,n,S,u,p)),v<=l&&(j=em(r,e,t,i,n,q,v,l));var D=Math.max(T,M,j),V=b;return D===M?V=n[i[S]-1]:D===j&&(V=n[i[q]-1]),n[b]=V,D}function Tr(r,e){this.size=r.length,this.intervals=r;var t=null,i=null;Array.isArray(e)&&(t=e[0],i=e[1]);var n=r.length,a=u8.getPointerArray(n+1),u=new a(n),l;for(l=1;lS?1:0});var h=Math.ceil(Math.log2(n+1)),p=Math.pow(2,h)-1,v=new a(p),b=new a(n);em(r,i,u,v,b,0,0,n-1),u=null,this.height=h,this.tree=v,this.augmentations=b,this.startGetter=t,this.endGetter=i,this.stack=new c8(a,this.height)}Tr.prototype.intervalsContainingPoint=function(r){var e=[],t=this.stack;t.clear(),t.push(0);for(var i=this.tree.length,n,a,u,l,h,p,v,b,T;t.size;)n=t.pop(),a=this.tree[n]-1,u=this.intervals[a],l=this.intervals[this.augmentations[a]],v=this.endGetter?this.endGetter(l):l[1],!(r>v)&&(b=n*2+1,b=h&&r<=p&&e.push(u),!(rT)&&(S=u*2+1,S=v&&e<=b&&i.push(h),!(t{Ii.search=function(r,e,t,i){var n=0;t=typeof t<"u"?t:0,i=typeof i<"u"?i:r.length,i--;for(var a;t<=i;)if(n=t+i>>>1,a=r[n],a>e)i=~-n;else if(a>>1,u=r(e[i],t),u>0)a=~-i;else if(u<0)n=-~i;else return i;return-1};Ii.lowerBound=function(r,e,t,i){var n=0;for(t=typeof t<"u"?t:0,i=typeof i<"u"?i:r.length;t>>1,e<=r[n]?i=n:t=-~n;return t};Ii.lowerBoundWithComparator=function(r,e,t){for(var i=0,n=0,a=e.length;n>>1,r(t,e[i])<=0?a=i:n=-~i;return n};Ii.lowerBoundIndices=function(r,e,t,i,n){var a=0;for(i=typeof i<"u"?i:0,n=typeof n<"u"?n:r.length;i>>1,t<=r[e[a]]?n=a:i=-~a;return i};Ii.upperBound=function(r,e,t,i){var n=0;for(t=typeof t<"u"?t:0,i=typeof i<"u"?i:r.length;t>>1,e>=r[n]?t=-~n:i=n;return t};Ii.upperBoundWithComparator=function(r,e,t){for(var i=0,n=0,a=e.length;n>>1,r(t,e[i])>=0?n=-~i:a=i;return n}});var jw=_(ki=>{var Co=ft(),Ao=wt().isArrayLike,pn=tm(),xw=hf();function Mw(r,e){if(r.length===0)return e.slice();if(e.length===0)return r.slice();var t;r[0]>e[0]&&(t=r,r=e,e=t);var i=r[r.length-1],n=e[0];if(i<=n)return Co.isTypedArray(r)?Co.concat(r,e):r.concat(e);var a=new r.constructor(r.length+e.length),u,l,h;for(u=0,l=r.length;ue[0]&&(t=r,r=e,e=t);var i=r[r.length-1],n=e[0];if(ie[0]&&(t=r,r=e,e=t);var i=r[r.length-1],n=e[0];if(ib?h=pn.lowerBound(e,v,h+1):(a.push(v),u++,h++);return a};function l8(r){var e=0,t=-1/0,i,n,a,u=[];for(n=0,a=r.length;nt&&(t=i));if(u.length===0)return new r[0].constructor(0);if(u.length===1)return u[0].slice();if(u.length===2)return Mw(u[0],u[1]);r=u;var l=new r[0].constructor(e),h=Co.getPointerArray(t),p=new h(r.length),v=new xw(function(S,q){return S=r[S][p[S]],q=r[q][p[q]],Sq?1:0});for(n=0;ne&&(e=t));if(a.length===0)return new r[0].constructor(0);if(a.length===1)return a[0].slice();if(a.length===2)return Lw(a[0],a[1]);r=a;var u=new r[0].constructor,l=Co.getPointerArray(e),h=new l(r.length),p=new xw(function(T,S){return T=r[T][h[T]],S=r[S][h[S]],TS?1:0});for(i=0;ie&&(e=u),n=r[l][0],a=r[l][u-1],n>t&&(t=n),ai)return[];if(t===i)return[t];var p,v,b=r[0],T,S,q,M,j,D,V=t;for(l=1;lD?S=pn.lowerBound(v,j,S+1):(b.push(j),T++,S++);if(b.length===0)return b;V=b[0]}return b};ki.merge=function(){if(arguments.length===2){if(Ao(arguments[0]))return Mw(arguments[0],arguments[1])}else if(Ao(arguments[0]))return l8(arguments);return null};ki.unionUnique=function(){if(arguments.length===2){if(Ao(arguments[0]))return Lw(arguments[0],arguments[1])}else if(Ao(arguments[0]))return f8(arguments);return null};ki.intersectionUnique=function(){if(arguments.length===2){if(Ao(arguments[0]))return ki.intersectionUniqueArrays(arguments[0],arguments[1])}else if(Ao(arguments[0]))return ki.kWayIntersectionUniqueArrays(arguments);return null}});var Fw=_((H7,kw)=>{var h8=Ge(),p8=_e(),d8=jw();function Iw(r){return r}function ht(r){if(this.clear(),Array.isArray(r)?(this.documentTokenizer=r[0],this.queryTokenizer=r[1]):(this.documentTokenizer=r,this.queryTokenizer=r),this.documentTokenizer||(this.documentTokenizer=Iw),this.queryTokenizer||(this.queryTokenizer=Iw),typeof this.documentTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: document tokenizer is not a function.");if(typeof this.queryTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: query tokenizer is not a function.")}ht.prototype.clear=function(){this.items=[],this.mapping=new Map,this.size=0,this.dimension=0};ht.prototype.add=function(r){this.size++;var e=this.items.length;this.items.push(r);var t=this.documentTokenizer(r);if(!Array.isArray(t))throw new Error("mnemonist/InvertedIndex.add: tokenizer function should return an array of tokens.");for(var i=new Set,n,a,u=0,l=t.length;u"u"||t.length===0)return[];if(e.length>1)for(n=1,a=e.length;n"u"||i.length===0)return[];t=d8.intersectionUniqueArrays(t,i)}var u=new Array(t.length);for(n=0,a=u.length;n1?e:this;for(var t=0,i=this.documents.length;t=e)return{done:!0};var i=r[t++];return{value:i,done:!1}})};ht.prototype.tokens=function(){return this.mapping.keys()};typeof Symbol<"u"&&(ht.prototype[Symbol.iterator]=ht.prototype.documents);ht.prototype.inspect=function(){var r=this.items.slice();return Object.defineProperty(r,"constructor",{value:ht,enumerable:!1}),r};typeof Symbol<"u"&&(ht.prototype[Symbol.for("nodejs.util.inspect.custom")]=ht.prototype.inspect);ht.from=function(r,e){var t=new ht(e);return p8(r,function(i){t.add(i)}),t};kw.exports=ht});var im=_(rm=>{var Be=new Float64Array(64),Ce=new Float64Array(64);function v8(r,e,t){var i,n,a,u,l;for(Be[0]=e,Ce[0]=t,n=0;n>=0;)if(a=Be[n],u=Ce[n]-1,a=i&&aCe[n-1]-Be[n-1]&&(l=Be[n],Be[n]=Be[n-1],Be[n-1]=l,l=Ce[n],Ce[n]=Ce[n-1],Ce[n-1]=l)}else n--;return r}rm.inplaceQuickSort=v8;function m8(r,e,t,i){var n,a,u,l,h,p;for(Be[0]=t,Ce[0]=i,a=0;a>=0;)if(u=Be[a],l=Ce[a]-1,u=n&&uCe[a-1]-Be[a-1]&&(p=Be[a],Be[a]=Be[a-1],Be[a-1]=p,p=Ce[a],Ce[a]=Ce[a-1],Ce[a-1]=p)}else a--;return e}rm.inplaceQuickSortIndices=m8});var Nw=_((Y7,Vw)=>{var y8=wt(),Of=ft(),Dw=xa().createTupleComparator,Rw=Pf(),g8=im().inplaceQuickSortIndices;function nm(r,e,t,i){var n,a=0,u;for(n=0;n>>1),q=t[S],u[V]=q,b>-1&&(T===0?l[b]=V+1:h[b]=V+1),D=(D+1)%r,S!==M&&S!==j-1&&p.push([D,S+1,j,V,1]),S!==M&&p.push([D,M,S,V,0]),V++;return{axes:e,labels:i,pivots:u,lefts:l,rights:h}}function Gt(r,e){this.dimensions=r,this.visited=0,this.axes=e.axes,this.labels=e.labels,this.pivots=e.pivots,this.lefts=e.lefts,this.rights=e.rights,this.size=this.labels.length}Gt.prototype.nearestNeighbor=function(r){var e=1/0,t=null,i=this.dimensions,n=this.axes,a=this.pivots,u=this.lefts,l=this.rights,h=0;function p(v,b){h++;var T=u[b],S=l[b],q=a[b],M=nm(i,n,q,r);if(!(M0?T!==0&&p(v,T-1):S!==0&&p(v,S-1),j*j0?S!==0&&p(v,S-1):T!==0&&p(v,T-1))}}return p(0,0),this.visited=h,this.labels[t]};var _8=Dw(3),P8=Dw(2);Gt.prototype.kNearestNeighbors=function(r,e){if(r<=0)throw new Error("mnemonist/kd-tree.kNearestNeighbors: k should be a positive number.");if(r=Math.min(r,this.size),r===1)return[this.nearestNeighbor(e)];var t=new Rw(Array,_8,r),i=this.dimensions,n=this.axes,a=this.pivots,u=this.lefts,l=this.rights,h=0;function p(T,S){var q=u[S],M=l[S],j=a[S],D=nm(i,n,j,e);t.push([D,h++,j]);var V=e[T],Y=n[T][j],ie=V-Y;T=(T+1)%i,V{var Ww=Ge(),w8=_e();function Oe(){this.clear()}Oe.prototype.clear=function(){this.head=null,this.tail=null,this.size=0};Oe.prototype.first=function(){return this.head?this.head.item:void 0};Oe.prototype.peek=Oe.prototype.first;Oe.prototype.last=function(){return this.tail?this.tail.item:void 0};Oe.prototype.push=function(r){var e={item:r,next:null};return this.head?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),this.size++,this.size};Oe.prototype.unshift=function(r){var e={item:r,next:null};return this.head?(this.head.next||(this.tail=this.head),e.next=this.head,this.head=e):(this.head=e,this.tail=e),this.size++,this.size};Oe.prototype.shift=function(){if(this.size){var r=this.head;return this.head=r.next,this.size--,r.item}};Oe.prototype.forEach=function(r,e){if(this.size){e=arguments.length>1?e:this;for(var t=this.head,i=0;t;)r.call(e,t.item,i,this),t=t.next,i++}};Oe.prototype.toArray=function(){if(!this.size)return[];for(var r=new Array(this.size),e=0,t=this.size,i=this.head;e{var om=Ge(),O8=_e(),T8=ft(),S8=wt();function Ie(r,e,t){if(arguments.length<2&&(t=r,r=null,e=null),this.capacity=t,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var i=T8.getPointerArray(t);this.forward=new i(t),this.backward=new i(t),this.K=typeof r=="function"?new r(t):new Array(t),this.V=typeof e=="function"?new e(t):new Array(t),this.size=0,this.head=0,this.tail=0,this.items={}}Ie.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}};Ie.prototype.splayOnTop=function(r){var e=this.head;if(this.head===r)return this;var t=this.backward[r],i=this.forward[r];return this.tail===r?this.tail=t:this.backward[i]=t,this.forward[t]=i,this.backward[e]=r,this.head=r,this.forward[r]=e,this};Ie.prototype.set=function(r,e){var t=this.items[r];if(typeof t<"u"){this.splayOnTop(t),this.V[t]=e;return}this.size"u"))return this.splayOnTop(e),this.V[e]};Ie.prototype.peek=function(r){var e=this.items[r];if(!(typeof e>"u"))return this.V[e]};Ie.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t=0,i=this.size,n=this.head,a=this.K,u=this.V,l=this.forward;t=e)return{done:!0};var a=i[t];return r++,r=e)return{done:!0};var a=i[t];return r++,r=e)return{done:!0};var u=i[t],l=n[t];return r++,r{var Eo=Tf(),C8=_e(),A8=ft(),E8=wt();function Sr(r,e,t){arguments.length<2?Eo.call(this,r):Eo.call(this,r,e,t);var i=A8.getPointerArray(this.capacity);this.deleted=new i(this.capacity),this.deletedSize=0}for(am in Eo.prototype)Sr.prototype[am]=Eo.prototype[am];var am;typeof Symbol<"u"&&(Sr.prototype[Symbol.iterator]=Eo.prototype[Symbol.iterator]);Sr.prototype.clear=function(){Eo.prototype.clear.call(this),this.deletedSize=0};Sr.prototype.set=function(r,e){var t=this.items[r];if(typeof t<"u"){this.splayOnTop(t),this.V[t]=e;return}this.size0?t=this.deleted[--this.deletedSize]:t=this.size,this.size++):(t=this.tail,this.tail=this.backward[t],delete this.items[this.K[t]]),this.items[r]=t,this.K[t]=r,this.V[t]=e,this.forward[t]=this.head,this.backward[this.head]=t,this.head=t};Sr.prototype.setpop=function(r,e){var t=null,i=null,n=this.items[r];return typeof n<"u"?(this.splayOnTop(n),t=this.V[n],this.V[n]=e,{evicted:!1,key:r,value:t}):(this.size0?n=this.deleted[--this.deletedSize]:n=this.size,this.size++):(n=this.tail,this.tail=this.backward[n],t=this.V[n],i=this.K[n],delete this.items[i]),this.items[r]=n,this.K[n]=r,this.V[n]=e,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n,i?{evicted:!0,key:i,value:t}:null)};Sr.prototype.delete=function(r){var e=this.items[r];if(typeof e>"u")return!1;if(delete this.items[r],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var t=this.backward[e],i=this.forward[e];return this.head===e&&(this.head=i),this.tail===e&&(this.tail=t),this.forward[t]=i,this.backward[i]=t,this.size--,this.deleted[this.deletedSize++]=e,!0};Sr.prototype.remove=function(r,e=void 0){var t=this.items[r];if(typeof t>"u")return e;var i=this.V[t];if(delete this.items[r],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,i;var n=this.backward[t],a=this.forward[t];return this.head===t&&(this.head=a),this.tail===t&&(this.tail=n),this.forward[n]=a,this.backward[a]=n,this.size--,this.deleted[this.deletedSize++]=t,i};Sr.from=function(r,e,t,i){if(arguments.length<2){if(i=E8.guessLength(r),typeof i!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(i=e,e=null,t=null);var n=new Sr(e,t,i);return C8(r,function(a,u){n.set(u,a)}),n};Hw.exports=Sr});var sm=_((J7,Yw)=>{var qo=Tf(),q8=_e(),x8=ft(),M8=wt();function et(r,e,t){if(arguments.length<2&&(t=r,r=null,e=null),this.capacity=t,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var i=x8.getPointerArray(t);this.forward=new i(t),this.backward=new i(t),this.K=typeof r=="function"?new r(t):new Array(t),this.V=typeof e=="function"?new e(t):new Array(t),this.size=0,this.head=0,this.tail=0,this.items=new Map}et.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()};et.prototype.set=function(r,e){var t=this.items.get(r);if(typeof t<"u"){this.splayOnTop(t),this.V[t]=e;return}this.size"u"))return this.splayOnTop(e),this.V[e]};et.prototype.peek=function(r){var e=this.items.get(r);if(!(typeof e>"u"))return this.V[e]};et.prototype.splayOnTop=qo.prototype.splayOnTop;et.prototype.forEach=qo.prototype.forEach;et.prototype.keys=qo.prototype.keys;et.prototype.values=qo.prototype.values;et.prototype.entries=qo.prototype.entries;typeof Symbol<"u"&&(et.prototype[Symbol.iterator]=et.prototype.entries);et.prototype.inspect=qo.prototype.inspect;et.from=function(r,e,t,i){if(arguments.length<2){if(i=M8.guessLength(r),typeof i!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(i=e,e=null,t=null);var n=new et(e,t,i);return q8(r,function(a,u){n.set(u,a)}),n};Yw.exports=et});var Kw=_((Z7,Qw)=>{var xo=sm(),L8=_e(),j8=ft(),I8=wt();function Cr(r,e,t){arguments.length<2?xo.call(this,r):xo.call(this,r,e,t);var i=j8.getPointerArray(this.capacity);this.deleted=new i(this.capacity),this.deletedSize=0}for(um in xo.prototype)Cr.prototype[um]=xo.prototype[um];var um;typeof Symbol<"u"&&(Cr.prototype[Symbol.iterator]=xo.prototype[Symbol.iterator]);Cr.prototype.clear=function(){xo.prototype.clear.call(this),this.deletedSize=0};Cr.prototype.set=function(r,e){var t=this.items.get(r);if(typeof t<"u"){this.splayOnTop(t),this.V[t]=e;return}this.size0?t=this.deleted[--this.deletedSize]:t=this.size,this.size++):(t=this.tail,this.tail=this.backward[t],this.items.delete(this.K[t])),this.items.set(r,t),this.K[t]=r,this.V[t]=e,this.forward[t]=this.head,this.backward[this.head]=t,this.head=t};Cr.prototype.setpop=function(r,e){var t=null,i=null,n=this.items.get(r);return typeof n<"u"?(this.splayOnTop(n),t=this.V[n],this.V[n]=e,{evicted:!1,key:r,value:t}):(this.size0?n=this.deleted[--this.deletedSize]:n=this.size,this.size++):(n=this.tail,this.tail=this.backward[n],t=this.V[n],i=this.K[n],this.items.delete(i)),this.items.set(r,n),this.K[n]=r,this.V[n]=e,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n,i?{evicted:!0,key:i,value:t}:null)};Cr.prototype.delete=function(r){var e=this.items.get(r);if(typeof e>"u")return!1;if(this.items.delete(r),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var t=this.backward[e],i=this.forward[e];return this.head===e&&(this.head=i),this.tail===e&&(this.tail=t),this.forward[t]=i,this.backward[i]=t,this.size--,this.deleted[this.deletedSize++]=e,!0};Cr.prototype.remove=function(r,e=void 0){var t=this.items.get(r);if(typeof t>"u")return e;var i=this.V[t];if(this.items.delete(r),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,i;var n=this.backward[t],a=this.forward[t];return this.head===t&&(this.head=a),this.tail===t&&(this.tail=n),this.forward[n]=a,this.backward[a]=n,this.size--,this.deleted[this.deletedSize++]=t,i};Cr.from=function(r,e,t,i){if(arguments.length<2){if(i=I8.guessLength(r),typeof i!="number")throw new Error("mnemonist/lru-map.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(i=e,e=null,t=null);var n=new Cr(e,t,i);return L8(r,function(a,u){n.set(u,a)}),n};Qw.exports=Cr});var Jw=_((e9,Xw)=>{var k8=Ge(),F8=_e(),D8=Pf(),R8=function(r,e){return r[1]>e[1]?-1:r[1]"u")){var i=Math.max(0,t-e);i===0?(this.items.delete(r),this.size-=t,this.dimension--):(this.items.set(r,i),this.size-=e)}}};ae.prototype.edit=function(r,e){var t=this.multiplicity(r);if(t!==0){var i=this.multiplicity(e);return this.items.set(e,t+i),this.items.delete(r),this}};ae.prototype.multiplicity=function(r){var e=this.items.get(r);return typeof e>"u"?0:e};ae.prototype.get=ae.prototype.multiplicity;ae.prototype.count=ae.prototype.multiplicity;ae.prototype.frequency=function(r){if(this.size===0)return 0;var e=this.multiplicity(r);return e/this.size};ae.prototype.top=function(r){if(typeof r!="number"||r<=0)throw new Error("mnemonist/multi-set.top: n must be a number > 0.");for(var e=new D8(Array,R8,r),t=this.items.entries(),i;i=t.next(),!i.done;)e.push(i.value);return e.consume()};ae.prototype.forEach=function(r,e){e=arguments.length>1?e:this;var t;this.items.forEach(function(i,n){for(t=0;t1?e:this,this.items.forEach(r,e)};ae.prototype.keys=function(){return this.items.keys()};ae.prototype.values=function(){var r=this.items.entries(),e=!1,t,i,n,a;return new k8(function u(){if(!e){if(t=r.next(),t.done)return{done:!0};e=!0,i=t.value[0],n=t.value[1],a=0}return a>=n?(e=!1,u()):(a++,{done:!1,value:i})})};ae.prototype.multiplicities=function(){return this.items.entries()};typeof Symbol<"u"&&(ae.prototype[Symbol.iterator]=ae.prototype.values);ae.prototype.inspect=function(){return this.items};typeof Symbol<"u"&&(ae.prototype[Symbol.for("nodejs.util.inspect.custom")]=ae.prototype.inspect);ae.prototype.toJSON=function(){return this.items};ae.from=function(r){var e=new ae;return F8(r,function(t){e.add(t)}),e};ae.isSubset=function(r,e){var t=r.multiplicities(),i,n,a;if(r===e)return!0;if(r.dimension>e.dimension)return!1;for(;i=t.next(),!i.done;)if(n=i.value[0],a=i.value[1],e.multiplicity(n){var z8=Ge(),V8=_e();function N8(r,e,t){return((Math.pow(r,2)-Math.pow(Math.abs(e-t),2))/2|0)+r+1}function W8(r,e){for(var t=0,i=0,n=e+1;ie.length?-1:r.lengthe?1:0}function Zw(r,e){var t=r+1,i=e/t|0,n=i+1,a,u,l=e-i*t,h=t-l,p=new Array(r+1);for(a=0;a 0");this.levenshtein=r,this.k=e,this.clear()}Me.prototype.clear=function(){this.size=0,this.strings=[],this.invertedIndices={}};Me.prototype.add=function(r){var e=r.length,t=this.size;this.strings.push(r),this.size++;var i=e1(this.k,r),n=this.invertedIndices[e];typeof n>"u"&&(n={},this.invertedIndices[e]=n);var a,u,l,h,p;for(h=0,p=i.length;h"u"?(u=[t],n[l]=u):u.push(t);return this};Me.prototype.search=function(r){var e=r.length,t=this.k,i=new Set,n,a,u,l,h,p,v,b,T,S,q,M,j,D,V;for(b=Math.max(0,e-t),T=e+t+1;b"u")){for(v=Zw(t,b),S=0,q=v.length;S"u"))for(D=0,V=n.length;D1?e:this;for(var t=0,i=this.strings.length;t=e)return{done:!0};var i=r[t];return t++,{value:i,done:!1}})};typeof Symbol<"u"&&(Me.prototype[Symbol.iterator]=Me.prototype.values);Me.prototype.inspect=function(){var r=this.strings.slice();return Object.defineProperty(r,"constructor",{value:Me,enumerable:!1}),r};typeof Symbol<"u"&&(Me.prototype[Symbol.for("nodejs.util.inspect.custom")]=Me.prototype.inspect);Me.from=function(r,e,t){var i=new Me(e,t);return V8(r,function(n){i.add(n)}),i};Me.countKeys=W8;Me.comparator=U8;Me.partition=Zw;Me.segments=e1;Me.segmentPos=G8;Me.multiMatchAwareInterval=t1;Me.multiMatchAwareSubstrings=r1;i1.exports=Me});var s1=_((r9,a1)=>{var o1=Ge(),B8=_e();function Le(){this.clear()}Le.prototype.clear=function(){this.items=[],this.offset=0,this.size=0};Le.prototype.enqueue=function(r){return this.items.push(r),++this.size};Le.prototype.dequeue=function(){if(this.size){var r=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,r}};Le.prototype.peek=function(){if(this.size)return this.items[this.offset]};Le.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t=this.offset,i=0,n=this.items.length;t=r.length)return{done:!0};var t=r[e];return e++,{value:t,done:!1}})};Le.prototype.entries=function(){var r=this.items,e=this.offset,t=0;return new o1(function(){if(e>=r.length)return{done:!0};var i=r[e];return e++,{value:[t++,i],done:!1}})};typeof Symbol<"u"&&(Le.prototype[Symbol.iterator]=Le.prototype.values);Le.prototype.toString=function(){return this.toArray().join(",")};Le.prototype.toJSON=function(){return this.toArray()};Le.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:Le,enumerable:!1}),r};typeof Symbol<"u"&&(Le.prototype[Symbol.for("nodejs.util.inspect.custom")]=Le.prototype.inspect);Le.from=function(r){var e=new Le;return B8(r,function(t){e.enqueue(t)}),e};Le.of=function(){return Le.from(arguments)};a1.exports=Le});var l1=_((i9,c1)=>{var u1=Ge(),H8=_e();function je(){this.clear()}je.prototype.clear=function(){this.items=[],this.size=0};je.prototype.push=function(r){return this.items.push(r),++this.size};je.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()};je.prototype.peek=function(){return this.items[this.size-1]};je.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t=0,i=this.items.length;t=e)return{done:!0};var i=r[e-t-1];return t++,{value:i,done:!1}})};je.prototype.entries=function(){var r=this.items,e=r.length,t=0;return new u1(function(){if(t>=e)return{done:!0};var i=r[e-t-1];return{value:[t++,i],done:!1}})};typeof Symbol<"u"&&(je.prototype[Symbol.iterator]=je.prototype.values);je.prototype.toString=function(){return this.toArray().join(",")};je.prototype.toJSON=function(){return this.toArray()};je.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:je,enumerable:!1}),r};typeof Symbol<"u"&&(je.prototype[Symbol.for("nodejs.util.inspect.custom")]=je.prototype.inspect);je.from=function(r){var e=new je;return H8(r,function(t){e.push(t)}),e};je.of=function(){return je.from(arguments)};c1.exports=je});var f1=_(Ve=>{Ve.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var r=new Set,e=1/0,t=null,i,n,a=arguments.length;for(n=0;ne.size)return!1;for(;i=t.next(),!i.done;)if(!e.has(i.value))return!1;return!0};Ve.isSuperset=function(r,e){return Ve.isSubset(e,r)};Ve.add=function(r,e){for(var t=e.values(),i;i=t.next(),!i.done;)r.add(i.value)};Ve.subtract=function(r,e){for(var t=e.values(),i;i=t.next(),!i.done;)r.delete(i.value)};Ve.intersect=function(r,e){for(var t=r.values(),i;i=t.next(),!i.done;)e.has(i.value)||r.delete(i.value)};Ve.disjunct=function(r,e){for(var t=r.values(),i,n=[];i=t.next(),!i.done;)e.has(i.value)&&n.push(i.value);for(t=e.values();i=t.next(),!i.done;)r.has(i.value)||r.add(i.value);for(var a=0,u=n.length;ae.size&&(t=r,r=e,e=t),r.size===0)return 0;if(r===e)return r.size;for(var i=r.values(),n,a=0;n=i.next(),!n.done;)e.has(n.value)&&a++;return a};Ve.unionSize=function(r,e){var t=Ve.intersectionSize(r,e);return r.size+e.size-t};Ve.jaccard=function(r,e){var t=Ve.intersectionSize(r,e);if(t===0)return 0;var i=r.size+e.size-t;return t/i};Ve.overlap=function(r,e){var t=Ve.intersectionSize(r,e);return t===0?0:t/Math.min(r.size,e.size)}});var p1=_((o9,h1)=>{var $8=Ge(),Y8=ft().getPointerArray;function jt(r){var e=Y8(r);this.start=0,this.size=0,this.capacity=r,this.dense=new e(r),this.sparse=new e(r)}jt.prototype.clear=function(){this.start=0,this.size=0};jt.prototype.has=function(r){if(this.size===0)return!1;var e=this.sparse[r],t=e=this.start&&e=this.start&&e1?e:this;for(var t=this.capacity,i=this.size,n=this.start,a=0;a=t)return{done:!0};var a=r[i];return i++,n++,i===e&&(i=0),{value:a,done:!1}})};typeof Symbol<"u"&&(jt.prototype[Symbol.iterator]=jt.prototype.values);jt.prototype.inspect=function(){var r=[];return this.forEach(function(e){r.push(e)}),Object.defineProperty(r,"constructor",{value:jt,enumerable:!1}),r.capacity=this.capacity,r};typeof Symbol<"u"&&(jt.prototype[Symbol.for("nodejs.util.inspect.custom")]=jt.prototype.inspect);h1.exports=jt});var v1=_((a9,d1)=>{var cm=Ge(),Q8=ft().getPointerArray;function ot(r,e){arguments.length<2&&(e=r,r=Array);var t=Q8(e);this.size=0,this.length=e,this.dense=new t(e),this.sparse=new t(e),this.vals=new r(e)}ot.prototype.clear=function(){this.size=0};ot.prototype.has=function(r){var e=this.sparse[r];return e=this.size||this.dense[e]!==r?!1:(e=this.dense[this.size-1],this.dense[this.sparse[r]]=e,this.sparse[e]=this.sparse[r],this.size--,!0)};ot.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t=0;t{var K8=Ge(),X8=ft().getPointerArray;function It(r){var e=X8(r);this.size=0,this.length=r,this.dense=new e(r),this.sparse=new e(r)}It.prototype.clear=function(){this.size=0};It.prototype.has=function(r){var e=this.sparse[r];return e=this.size||this.dense[e]!==r?!1:(e=this.dense[this.size-1],this.dense[this.sparse[r]]=e,this.sparse[e]=this.sparse[r],this.size--,!0)};It.prototype.forEach=function(r,e){e=arguments.length>1?e:this;for(var t,i=0;i{var J8=_e(),Z8=2,e4=2,t4=new Set([0,1,2]),r4={0:"Returns only the top suggestion",1:"Returns suggestions with the smallest edit distance",2:"Returns every suggestion (no early termination)"};function Sf(r){var e=new Set;return typeof r=="number"&&e.add(r),{suggestions:e,count:0}}function g1(r,e,t){return{term:r||"",distance:e||0,count:t||0}}function _1(r,e,t,i){i=i||new Set,e++;var n,a=r.length,u;if(a>1)for(u=0;u0&&r[u].length-a.length>i.length-a.length&&(t.suggestions=new Set,t.count=0),(e===2||!t.suggestions.size||r[u].length-a.length>=i.length-a.length)&&t.suggestions.add(n)}function b1(r,e){var t=r.length,i=e.length,n=[[]],a=t+i,u=new Map,l,h,p;for(n[0][0]=a,l=0;l<=t;l++)n[l+1]||(n[l+1]=[]),n[l+1][1]=l,n[l+1][0]=a;for(p=0;p<=i;p++)n[1][p+1]=p,n[0][p+1]=a;var v=r+e,b;for(l=0,h=v.length;ln)return[];for(var l=[a],h=new Set,p=new Set,v=[],b,T;l.length>0&&(b=l.shift(),!(t<2&&v.length>0&&u-b.length>v[0].distance));){if(T=r[b],T!==void 0){if(typeof T=="number"&&(T=Sf(T)),T.count>0&&!p.has(b)){p.add(b);var S=g1(b,u-b.length,T.count);if(v.push(S),t<2&&u-b.length===0)break}T.suggestions.forEach(D=>{var V=e[D];if(!p.has(V)){p.add(V);var Y=0;if(a!==V)if(V.length===b.length)Y=u-b.length;else if(u===b.length)Y=V.length-b.length;else{for(var ie=0,pe=0,ke=V.length;ie0||pe>0?Y=b1(V.substr(ie,ke-ie-pe),a.substr(ie,u-ie-pe)):Y=b1(V,a)}if(t<2&&v.length>0&&v[0].distance>Y&&(v=[]),!(t<2&&v.length>0&&Y>v[0].distance)&&Y<=i){var pt=r[V];pt!==void 0&&v.push(g1(V,Y,pt.count))}}})}if(u-b.length0&&u-b.length>=v[0].distance)continue;for(var q=0,M=b.length;qthis.maxLength&&(this.maxLength=r.length)),e.count===1){var t=this.words.length;this.words.push(r);var i=_1(r,0,this.maxDistance);i.forEach(n=>{var a=this.dictionary[n];a!==void 0?(typeof a=="number"&&(a=Sf(a),this.dictionary[n]=a),a.suggestions.has(t)||i4(this.words,this.verbosity,a,r,t,n)):this.dictionary[n]=t})}return this.size++,this};Ar.prototype.search=function(r){return n4(this.dictionary,this.words,this.verbosity,this.maxDistance,this.maxLength,r)};Ar.prototype.inspect=function(){var r=[];r.size=this.size,r.maxDistance=this.maxDistance,r.verbosity=this.verbosity,r.behavior=r4[this.verbosity];for(var e in this.dictionary)typeof this.dictionary[e]=="object"&&this.dictionary[e].count&&r.push([e,this.dictionary[e].count]);return Object.defineProperty(r,"constructor",{value:Ar,enumerable:!1}),r};typeof Symbol<"u"&&(Ar.prototype[Symbol.for("nodejs.util.inspect.custom")]=Ar.prototype.inspect);Ar.from=function(r,e){var t=new Ar(e);return J8(r,function(i){t.add(i)}),t};P1.exports=Ar});var lm=_((c9,O1)=>{var o4=_e(),Mo=Ge(),He="\0";function Te(r){this.mode=r===Array?"array":"string",this.clear()}Te.prototype.clear=function(){this.root={},this.size=0};Te.prototype.set=function(r,e){for(var t=this.root,i,n=0,a=r.length;n"u")return;if(He in e)return e[He]};Te.prototype.delete=function(r){var e=this.root,t=null,i=null,n,a,u,l;for(u=0,l=r.length;u"u")return!1;t!==null?Object.keys(e).length>1&&(t=null,i=null):Object.keys(e).length<2&&(t=n,i=a)}return He in e?(this.size--,t?delete t[i]:delete e[He],!0):!1};Te.prototype.has=function(r){for(var e=this.root,t,i=0,n=r.length;i"u")return!1;return He in e};Te.prototype.find=function(r){var e=typeof r=="string",t=this.root,i=[],n,a,u;for(a=0,u=r.length;a"u")return i;for(var l=[t],h=[r],p;l.length;){r=h.pop(),t=l.pop();for(p in t){if(p===He){i.push([r,t[He]]);continue}l.push(t[p]),h.push(e?r+p:r.concat(p))}}return i};Te.prototype.values=function(r){var e=this.root,t=[],i,n,a;if(r){for(n=0,a=r.length;n"u")return Mo.empty()}return t.push(e),new Mo(function(){for(var u,l=!1,h;t.length;){u=t.pop();for(h in u){if(h===He){l=!0;continue}t.push(u[h])}if(l)return{done:!1,value:u[He]}}return{done:!0}})};Te.prototype.prefixes=function(r){var e=this.root,t=[],i=[],n,a,u,l=this.mode==="string";if(r){for(a=0,u=r.length;a"u")return Mo.empty()}else r=l?"":[];return t.push(e),i.push(r),new Mo(function(){for(var h,p,v=!1,b;t.length;){h=t.pop(),p=i.pop();for(b in h){if(b===He){v=!0;continue}t.push(h[b]),i.push(l?p+b:p.concat(b))}if(v)return{done:!1,value:p}}return{done:!0}})};Te.prototype.keys=Te.prototype.prefixes;Te.prototype.entries=function(r){var e=this.root,t=[],i=[],n,a,u,l=this.mode==="string";if(r){for(a=0,u=r.length;a"u")return Mo.empty()}else r=l?"":[];return t.push(e),i.push(r),new Mo(function(){for(var h,p,v=!1,b;t.length;){h=t.pop(),p=i.pop();for(b in h){if(b===He){v=!0;continue}t.push(h[b]),i.push(l?p+b:p.concat(b))}if(v)return{done:!1,value:[p,h[He]]}}return{done:!0}})};typeof Symbol<"u"&&(Te.prototype[Symbol.iterator]=Te.prototype.entries);Te.prototype.inspect=function(){for(var r=new Array(this.size),e=this.entries(),t,i=0;t=e.next(),!t.done;)r[i++]=t.value;return Object.defineProperty(r,"constructor",{value:Te,enumerable:!1}),r};typeof Symbol<"u"&&(Te.prototype[Symbol.for("nodejs.util.inspect.custom")]=Te.prototype.inspect);Te.prototype.toJSON=function(){return this.root};Te.from=function(r){var e=new Te;return o4(r,function(t,i){e.set(i,t)}),e};Te.SENTINEL=He;O1.exports=Te});var C1=_((l9,S1)=>{var a4=_e(),T1=lm(),Cf="\0";function $e(r){this.mode=r===Array?"array":"string",this.clear()}for(fm in T1.prototype)$e.prototype[fm]=T1.prototype[fm];var fm;delete $e.prototype.set;delete $e.prototype.get;delete $e.prototype.values;delete $e.prototype.entries;$e.prototype.add=function(r){for(var e=this.root,t,i=0,n=r.length;i"u")return i;for(var l=[t],h=[r],p;l.length;){r=h.pop(),t=l.pop();for(p in t){if(p===Cf){i.push(r);continue}l.push(t[p]),h.push(e?r+p:r.concat(p))}}return i};typeof Symbol<"u"&&($e.prototype[Symbol.iterator]=$e.prototype.keys);$e.prototype.inspect=function(){for(var r=new Set,e=this.keys(),t;t=e.next(),!t.done;)r.add(t.value);return Object.defineProperty(r,"constructor",{value:$e,enumerable:!1}),r};typeof Symbol<"u"&&($e.prototype[Symbol.for("nodejs.util.inspect.custom")]=$e.prototype.inspect);$e.prototype.toJSON=function(){return this.root};$e.from=function(r){var e=new $e;return a4(r,function(t){e.add(t)}),e};$e.SENTINEL=Cf;S1.exports=$e});var x1=_((f9,q1)=>{var A1=Ge(),s4=_e(),u4=wt(),E1=ft(),c4=function(r){return Math.max(1,Math.ceil(r*1.5))},l4=function(r){var e=E1.getPointerArray(r);return new e(r)};function oe(r,e){if(arguments.length<1)throw new Error("mnemonist/vector: expecting at least a byte array constructor.");var t=e||0,i=c4,n=0,a=!1;typeof e=="object"&&(t=e.initialCapacity||0,n=e.initialLength||0,i=e.policy||i,a=e.factory===!0),this.factory=a?r:null,this.ArrayClass=r,this.length=n,this.capacity=Math.max(n,t),this.policy=i,this.array=new r(this.capacity)}oe.prototype.set=function(r,e){if(this.lengththis.capacity)if(this.factory===null?this.array=new this.ArrayClass(r):this.array=this.factory(r),E1.isTypedArray(this.array))this.array.set(e,0);else for(var t=0,i=this.length;t=r)return this;for(e=this.capacity;e=e)return{done:!0};var i=r[t];return t++,{value:i,done:!1}})};oe.prototype.entries=function(){var r=this.array,e=this.length,t=0;return new A1(function(){if(t>=e)return{done:!0};var i=r[t];return{value:[t++,i],done:!1}})};typeof Symbol<"u"&&(oe.prototype[Symbol.iterator]=oe.prototype.values);oe.prototype.inspect=function(){var r=this.array.slice(0,this.length);return r.type=this.array.constructor.name,r.items=this.length,r.capacity=this.capacity,Object.defineProperty(r,"constructor",{value:oe,enumerable:!1}),r};typeof Symbol<"u"&&(oe.prototype[Symbol.for("nodejs.util.inspect.custom")]=oe.prototype.inspect);oe.from=function(r,e,t){if(arguments.length<3&&(t=u4.guessLength(r),typeof t!="number"))throw new Error("mnemonist/vector.from: could not guess iterable length. Please provide desired capacity as last argument.");var i=new oe(e,t);return s4(r,function(n){i.push(n)}),i};function Er(r){var e=function(i){oe.call(this,r,i)};for(var t in oe.prototype)oe.prototype.hasOwnProperty(t)&&(e.prototype[t]=oe.prototype[t]);return e.from=function(i,n){return oe.from(i,r,n)},typeof Symbol<"u"&&(e.prototype[Symbol.iterator]=e.prototype.values),e}oe.Int8Vector=Er(Int8Array);oe.Uint8Vector=Er(Uint8Array);oe.Uint8ClampedVector=Er(Uint8ClampedArray);oe.Int16Vector=Er(Int16Array);oe.Uint16Vector=Er(Uint16Array);oe.Int32Vector=Er(Int32Array);oe.Uint32Vector=Er(Uint32Array);oe.Float32Vector=Er(Float32Array);oe.Float64Vector=Er(Float64Array);oe.PointerVector=Er(l4);q1.exports=oe});var L1=_((h9,M1)=>{var f4=wt(),h4=ft(),p4=im().inplaceQuickSortIndices,d4=tm().lowerBoundIndices,v4=_f(),m4=h4.getPointerArray;function y4(r,e){return r.distancee.distance?-1:0}function g4(r,e,t){for(var i=t.length,n=m4(i),a=0,u=new n(i),l=new n(i),h=new n(i),p=new Float64Array(i),v=[0,0,i],b=new Float64Array(i),T,S,q,M,j,D,V,Y,ie;v.length;)if(j=v.pop(),M=v.pop(),T=v.pop(),S=t[j-1],j--,ie=j-M,u[T]=S,ie!==0){if(ie===1){V=r(e[S],e[t[M]]),p[T]=V,a++,h[T]=a,u[a]=t[M];continue}for(Y=M;Y0&&(a++,h[T]=a,v.push(a,D,j)),D-M>0&&(a++,l[T]=a,v.push(a,M,D))}return{nodes:u,lefts:l,rights:h,mus:p}}function $r(r,e){if(typeof r!="function")throw new Error("mnemonist/VPTree.constructor: given `distance` must be a function.");if(!e)throw new Error("mnemonist/VPTree.constructor: you must provide items to the tree. A VPTree cannot be updated after its creation.");this.distance=r,this.heap=new v4(y4),this.D=0;var t=f4.toArrayWithIndices(e);this.items=t[0];var i=t[1];this.size=i.length;var n=g4(r,this.items,i);this.nodes=n.nodes,this.lefts=n.lefts,this.rights=n.rights,this.mus=n.mus}$r.prototype.nearestNeighbors=function(r,e){var t=this.heap,i=[0],n=1/0,a,u,l,h,p,v,b;for(this.D=0;i.length;)a=i.pop(),u=this.nodes[a],l=this.items[u],b=this.distance(l,e),this.D++,br&&t.pop(),t.size>=r&&(n=t.peek().distance)),h=this.lefts[a],p=this.rights[a],!(!h&&!p)&&(v=this.mus[a],b=v-n&&i.push(p)):(p&&b>=v-n&&i.push(p),h&&b=0;S--)T[S]=t.pop();return T};$r.prototype.neighbors=function(r,e){var t=[],i=[0],n,a,u,l,h,p,v;for(this.D=0;i.length;)n=i.pop(),a=this.nodes[n],u=this.items[a],v=this.distance(u,e),this.D++,v<=r&&t.push({distance:v,item:u}),l=this.lefts[n],h=this.rights[n],!(!l&&!h)&&(p=this.mus[n],v=p-r&&i.push(h)):(h&&v>=p-r&&i.push(h),l&&v{var hm=_f(),pm=hf(),j1=MP();I1.exports={BiMap:FP(),BitSet:UP(),BitVector:$P(),BloomFilter:ZP(),BKTree:tw(),CircularBuffer:aw(),DefaultMap:uw(),DefaultWeakMap:lw(),FixedDeque:Hv(),StaticDisjointSet:hw(),FibonacciHeap:pm,MinFibonacciHeap:pm.MinFibonacciHeap,MaxFibonacciHeap:pm.MaxFibonacciHeap,FixedReverseHeap:Pf(),FuzzyMap:gw(),FuzzyMultiMap:ww(),HashedArrayTree:Sw(),Heap:hm,MinHeap:hm.MinHeap,MaxHeap:hm.MaxHeap,StaticIntervalTree:qw(),InvertedIndex:Fw(),KDTree:Nw(),LinkedList:Gw(),LRUCache:Tf(),LRUCacheWithDelete:$w(),LRUMap:sm(),LRUMapWithDelete:Kw(),MultiMap:Xv(),MultiSet:Jw(),PassjoinIndex:n1(),Queue:s1(),FixedStack:Zv(),Stack:l1(),SuffixArray:j1,GeneralizedSuffixArray:j1.GeneralizedSuffixArray,Set:f1(),SparseQueueSet:p1(),SparseMap:v1(),SparseSet:y1(),SymSpell:w1(),Trie:C1(),TrieMap:lm(),Vector:x1(),VPTree:L1()}});var F4={};Bx(F4,{ArrayTilemap:()=>Vf,CharacterShiftAction:()=>If,CollisionStrategy:()=>Aa,Direction:()=>ct,GridEngine:()=>Va,GridEngineHeadless:()=>Da,MoveToResult:()=>Df,NoPathFoundStrategy:()=>cn,NumberOfDirections:()=>Qi,PathBlockedStrategy:()=>Po,PhaserTile:()=>Di,PhaserTileLayer:()=>zo,PhaserTilemap:()=>za,QueuedPathBlockedStrategy:()=>gm,TiledLayer:()=>No,TiledTile:()=>Vo,TiledTilemap:()=>Nf,default:()=>k4,directionFromPos:()=>Ue});module.exports=Hx(F4);var E=class r{static get ZERO(){return new r(0,0)}static get ONE(){return new r(1,1)}static get UP(){return new r(0,-1)}static get DOWN(){return new r(0,1)}static get LEFT(){return new r(-1,0)}static get RIGHT(){return new r(1,0)}static get UP_LEFT(){return new r(-1,-1)}static get UP_RIGHT(){return new r(1,-1)}static get DOWN_RIGHT(){return new r(1,1)}static get DOWN_LEFT(){return new r(-1,1)}constructor(e,t){typeof e=="number"?(this.x=e,this.y=t||0):(this.x=e.x,this.y=e.y)}clone(){return new r(this.x,this.y)}add(e){return new r(this.x+e.x,this.y+e.y)}multiply(e){return new r(this.x*e.x,this.y*e.y)}divide(e){return new r(this.x/e.x,this.y/e.y)}subtract(e){return new r(this.x-e.x,this.y-e.y)}equals(e){return this.x===e.x&&this.y===e.y}abs(){return new r(Math.abs(this.x),Math.abs(this.y))}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}modulo(e){return new r(this.x%e.x,this.y%e.y)}scalarModulo(e){return new r(this.x%e,this.y%e)}scalarMult(e){return new r(this.x*e,this.y*e)}toPosition(){return{x:this.x,y:this.y}}toString(){return`${this.x}#${this.y}`}};var G=class{static equal(e,t){return e.position.x===t.position.x&&e.position.y===t.position.y&&e.layer===t.layer}static copyOver(e,t){t.position.x=e.position.x,t.position.y=e.position.y,t.layer=e.layer}static clone(e){return{position:e.position.clone(),layer:e.layer}}static toString(e){return`${e.position.toString()}#${e.layer}`}static toInternal(e){return{position:new E(e.position.x,e.position.y),layer:e.charLayer}}static fromInternal(e){return{position:e.position.toPosition(),charLayer:e.layer}}};var ct=(p=>(p.NONE="none",p.LEFT="left",p.UP_LEFT="up-left",p.UP="up",p.UP_RIGHT="up-right",p.RIGHT="right",p.DOWN_RIGHT="down-right",p.DOWN="down",p.DOWN_LEFT="down-left",p))(ct||{}),$x={up:"down",down:"up",left:"right",right:"left",none:"none","up-left":"down-right","up-right":"down-left","down-right":"up-left","down-left":"up-right"},Yx={up:E.UP,down:E.DOWN,left:E.LEFT,right:E.RIGHT,none:E.ZERO,"up-left":E.UP_LEFT,"up-right":E.UP_RIGHT,"down-right":E.DOWN_RIGHT,"down-left":E.DOWN_LEFT},fa={up:0,"up-right":1,right:2,"down-right":3,down:4,"down-left":5,left:6,"up-left":7,none:NaN},ib=["up","up-right","right","down-right","down","down-left","left","up-left"],Qx=["down-left","down-right","up-right","up-left"];function ha(){return["up","down","left","right","none","up-left","up-right","down-right","down-left"]}function Yi(r){return Qx.includes(r)}function nb(r,e=1){return r==="none"?"none":ib[(fa[r]+8-Math.abs(e)%8)%8]}function ks(r,e=1){return r==="none"?"none":ib[(fa[r]+e)%8]}function xt(r){return Yx[r]}function ob(r){return $x[r]}function Ue(r,e){if(r.x===e.x){if(r.y>e.y)return"up";if(r.ye.x)return"left";if(r.xe.x){if(r.ye.y)return"up-left"}else if(r.xe.y)return"up-right"}return"none"}var Qi=(t=>(t[t.FOUR=4]="FOUR",t[t.EIGHT=8]="EIGHT",t))(Qi||{});function oi(r){return typeof r=="string"&&ha().includes(r)}var Br=gt(qi(),1);var xi=1e3,of=class{constructor(e,t){this.id=e;this.movementDirection="none";this._tilePos={position:new E(0,0),layer:void 0};this.movementStarted$=new Br.Subject;this.movementStopped$=new Br.Subject;this.directionChanged$=new Br.Subject;this.positionChangeStarted$=new Br.Subject;this.positionChangeFinished$=new Br.Subject;this.tilePositionSet$=new Br.Subject;this.autoMovementSet$=new Br.Subject;this.lastMovementImpulse="none";this.facingDirection="down";this.depthChanged$=new Br.Subject;this.movementProgress=0;this.tilemap=t.tilemap,this.speed=t.speed,this.collidesWithTilesInternal=t.collidesWithTiles,this._tilePos.layer=t.charLayer,this.ignoreMissingTiles=t.ignoreMissingTiles??!1,this.collisionGroups=new Set(t.collisionGroups||[]),this.ignoreCollisionGroups=new Set(t.ignoreCollisionGroups||[]),this.labels=new Set(t.labels||[]),this.numberOfDirections=t.numberOfDirections,t.facingDirection&&this.turnTowards(t.facingDirection),this.tileWidth=t.tileWidth??1,this.tileHeight=t.tileHeight??1}getId(){return this.id}getSpeed(){return this.speed}setSpeed(e){this.speed=e}setMovement(e){this.autoMovementSet$.next(e),this.movement=e}getMovement(){return this.movement}collidesWithTiles(){return this.collidesWithTilesInternal}setCollidesWithTiles(e){this.collidesWithTilesInternal=e}getIgnoreMissingTiles(){return this.ignoreMissingTiles}setIgnoreMissingTiles(e){this.ignoreMissingTiles=e}setTilePosition(e){this.isMoving()&&this.movementStopped$.next(this.movementDirection),this.tilePositionSet$.next({...e}),this.fire(this.positionChangeStarted$,this.tilePos,e),this.fire(this.positionChangeFinished$,this.tilePos,e),this.movementDirection="none",this.lastMovementImpulse="none",this.tilePos=e,this.movementProgress=0}getTilePos(){return this.tilePos}getNextTilePos(){if(!this.isMoving())return this.tilePos;let e=this.tilePos.layer,t=this.tilePosInDirection(this.tilePos.position,this.movementDirection),i=this.tilemap.getTransition(t,this.tilePos.layer);return i&&(e=i),{position:this.tilePosInDirection(this.tilePos.position,this.movementDirection),layer:e}}getTileWidth(){return this.tileWidth}getTileHeight(){return this.tileHeight}move(e){this.lastMovementImpulse=e,e!="none"&&(this.isMoving()||(this.isBlockingDirection(e)?this.changeFacingDirection(e):this.startMoving(e)))}update(e){this.movement?.update(e),this.isMoving()&&this.updateCharacterPosition(e),this.lastMovementImpulse="none"}getMovementDirection(){return this.movementDirection}isBlockingDirection(e){if(e=="none")return!1;let t=this.tilePosInDirection(this.getNextTilePos().position,e),i=this.tilemap.getTransition(t,this.getNextTilePos().layer)||this.getNextTilePos().layer;return this.collidesWithTilesInternal&&this.isTileBlocking(e,i)?!0:this.isCharBlocking(e,i)}isTileBlocking(e,t){return this.someCharTile((i,n)=>{let a=this.tilePosInDirection(new E(i,n),e);return this.tilemap.hasBlockingTile(a,t,ob(e),this.ignoreMissingTiles)})}isCharBlocking(e,t){return this.someCharTile((i,n)=>{let a=this.tilePosInDirection(new E(i,n),e);return this.tilemap.hasBlockingChar(a,t,this.getCollisionGroups(),new Set([this.getId()]),this.ignoreCollisionGroups)})}isMoving(){return this.movementDirection!="none"}turnTowards(e){this.isMoving()||e!="none"&&this.changeFacingDirection(e)}changeFacingDirection(e){this.facingDirection!==e&&(this.facingDirection=e,this.directionChanged$.next(e))}getFacingDirection(){return this.facingDirection}getFacingPosition(){return this._tilePos.position.add(xt(this.facingDirection))}addCollisionGroup(e){this.collisionGroups.add(e)}setCollisionGroups(e){this.collisionGroups=new Set(e)}setIgnoreCollisionGroups(e){this.ignoreCollisionGroups=new Set(e)}getCollisionGroups(){return Array.from(this.collisionGroups)}getIgnoreCollisionGroups(){return Array.from(this.ignoreCollisionGroups)}hasCollisionGroup(e){return this.collisionGroups.has(e)}removeCollisionGroup(e){this.collisionGroups.delete(e)}removeAllCollisionGroups(){this.collisionGroups.clear()}addLabels(e){for(let t of e)this.labels.add(t)}getLabels(){return[...this.labels.values()]}hasLabel(e){return this.labels.has(e)}clearLabels(){this.labels.clear()}removeLabels(e){for(let t of e)this.labels.delete(t)}getNumberOfDirections(){return this.numberOfDirections}movementStarted(){return this.movementStarted$}movementStopped(){return this.movementStopped$}directionChanged(){return this.directionChanged$}tilePositionSet(){return this.tilePositionSet$}positionChangeStarted(){return this.positionChangeStarted$}positionChangeFinished(){return this.positionChangeFinished$}autoMovementSet(){return this.autoMovementSet$}depthChanged(){return this.depthChanged$}getMovementProgress(){return this.movementProgress}setMovementProgress(e){let t=Math.max(0,Math.min(xi,e));this.movementProgress=t}hasWalkedHalfATile(){return this.movementProgress>xi/2}willCrossTileBorderThisUpdate(e){return this.movementProgress+this.maxProgressForDelta(e)>=xi}updateCharacterPosition(e){let t=this.willCrossTileBorderThisUpdate(e),n=1-(t?xi-this.movementProgress:this.maxProgressForDelta(e))/this.maxProgressForDelta(e);this.movementProgress=Math.min(this.movementProgress+this.maxProgressForDelta(e),xi),t&&(this.movementProgress=0,this.shouldContinueMoving()?(this.fire(this.positionChangeFinished$,this.tilePos,this.getNextTilePos()),this.tilePos=this.getNextTilePos(),this.startMoving(this.lastMovementImpulse),n>0&&this.updateCharacterPosition(e*n)):this.stopMoving())}maxProgressForDelta(e){let i=e/1e3;return Math.floor(i*this.speed*xi)}get tilePos(){return G.clone(this._tilePos)}set tilePos(e){G.copyOver(e,this._tilePos)}startMoving(e){e!=="none"&&(e!=this.movementDirection&&this.movementStarted$.next(e),this.movementDirection=e,this.facingDirection=e,this.fire(this.positionChangeStarted$,this.tilePos,this.getNextTilePos()))}tilePosInDirection(e,t){return e.add(xt(this.tilemap.toMapDirection(t)))}shouldContinueMoving(){return this.lastMovementImpulse!=="none"&&!this.isBlockingDirection(this.lastMovementImpulse)}stopMoving(){if(this.movementDirection==="none")return;let e=this.tilePos,t=this.getNextTilePos(),i=this.movementDirection;this.tilePos=this.getNextTilePos(),this.movementDirection="none",this.movementStopped$.next(i),this.fire(this.positionChangeFinished$,e,t)}fire(e,{position:t,layer:i},{position:n,layer:a}){e.next({exitTile:t,enterTile:n,exitLayer:i,enterLayer:a})}someCharTile(e){let t=this.getNextTilePos().position;for(let i=t.x;ithis.isLayerAlwaysOnTop(a));this.tilemap.layers.filter(a=>!this.isLayerAlwaysOnTop(a)).forEach(a=>{this.hasLayerProp(a,r.HEIGHT_SHIFT_PROP_NAME)?(this.createHeightShiftLayers(a,t),e.push(a.tilemapLayer)):this.setDepth(a,++t)}),this.charLayerDepths.set(void 0,t),i.forEach((a,u)=>{a.tilemapLayer.setDepth(u+1+t)}),e.forEach(a=>a.destroy())}setDepth(e,t){e.tilemapLayer.setDepth(t),this.isCharLayer(e)&&this.charLayerDepths.set(this.getLayerProp(e,r.CHAR_LAYER_PROP_NAME),t)}createHeightShiftLayers(e,t){let i=this.getLayerProp(e,r.HEIGHT_SHIFT_PROP_NAME);isNaN(i)&&(i=0);let n=1;for(let a=0;aa.name==t)?.value}hasLayerProp(e,t){return this.getLayerProp(e,t)!=null}copyLayer(e,t){let i=`${e.name}#${t}`,n=this.tilemap.createBlankLayer(i,e.tilemapLayer.tileset);if(n){if(n.name=i,this.isIsometric())for(let a=t;a>=0;a--){let u=t-a;n.putTileAt(e.data[a][u],u,a)}else for(let a=0;au===this.charData.id)).subscribe(({direction:u})=>{this.animation?.setStandingFrame(u)}),this.sprite&&(this.sprite.setOrigin(0,0),this.resetAnimation(this.sprite),this.updateOverlaySprite(),this.updateGridChar())}destroy(){this.destroy$.next(),this.destroy$.complete(),this.newSpriteSet$.complete()}setSprite(e){e?(this.sprite&&(e.x=this.sprite.x,e.y=this.sprite.y),this.sprite=e,this.newSpriteSet$.next(),this.layerOverlaySprite=this.layerOverlaySprite?this.scene.add.sprite(0,0,this.sprite.texture):void 0,this.updateOverlaySprite(),this.resetAnimation(this.sprite),this.updateDepth()):(this.layerOverlaySprite=void 0,this.sprite=void 0)}getSprite(){return this.sprite}getLayerOverlaySprite(){return this.layerOverlaySprite}setContainer(e){this.container=e,this.cachedContainerHeight=e?.getBounds().height??0}getContainer(){return this.container}getOffsetX(){return this.customOffset.x}setOffsetX(e){this.customOffset.x=e}getOffsetY(){return this.customOffset.y}setOffsetY(e){this.customOffset.y=e}getWalkingAnimationMapping(){return this.walkingAnimationMapping}turnTowards(e){this.geHeadless.isMoving(this.charData.id)||e!="none"&&(this.geHeadless.turnTowards(this.charData.id,e),this.animation?.setStandingFrame(e))}getAnimation(){return this.animation}setAnimation(e){this.animation=e}update(e){this.updateGridChar()}getDepthOffset(){return this.depthOffset}getEngineOffset(){if(!this.sprite)return E.ZERO;let e=this.tilemap.getTileWidth()/2-Math.floor((this.sprite?.displayWidth??0)/2),t=-(this.sprite?.displayHeight??0)+this.tilemap.getTileHeight();return new E(e,t)}updatePixelPos(){let e=new E(this.geHeadless.getPosition(this.charData.id)),t=this.geHeadless.getMovementProgress(this.charData.id)/1e3,n=this.tilemap.tilePosToPixelPos(e).add(this.getEngineOffset()).add(this.customOffset).add(xt(this.geHeadless.getFacingDirection(this.charData.id)).multiply(this.tilemap.getTileDistance(this.geHeadless.getFacingDirection(this.charData.id)).scalarMult(t))),a=this.getGameObj();a&&(a.x=Math.floor(n.x),a.y=Math.floor(n.y))}getGameObj(){return this.container||this.sprite}updateGridChar(){if(this.updatePixelPos(),this.sprite&&this.geHeadless.isMoving(this.charData.id)){let e=this.geHeadless.getMovementProgress(this.charData.id)>xi/2;this.getAnimation()?.updateCharacterFrame(this.geHeadless.getFacingDirection(this.charData.id),e,Number(this.sprite.frame.name))}this.updateDepth()}resetAnimation(e){let t=new Ca(this.walkingAnimationMapping,e.texture.source[0].width/e.width/Ca.FRAMES_CHAR_ROW);this.setAnimation(t),t.frameChange().pipe((0,uf.takeUntil)(this.newSpriteSet$)).subscribe(i=>{e?.setFrame(i)}),t.setIsEnabled(this.walkingAnimationMapping!==void 0),t.setStandingFrame(this.geHeadless.getFacingDirection(this.charData.id))}updateOverlaySprite(){if(!this.layerOverlaySprite||!this.sprite)return;this.layerOverlaySprite.scale=this.sprite.scale;let e=this.tilemap.getTileHeight()/this.layerOverlaySprite.scale;this.layerOverlaySprite.setCrop(0,0,this.layerOverlaySprite.displayWidth,this.sprite.height-e),this.layerOverlaySprite.setOrigin(0,0)}updateDepth(){if(!this.getGameObj())return;let t=new E(this.geHeadless.getPosition(this.charData.id)),i=this.geHeadless.getCharLayer(this.charData.id);this.container?this.setContainerDepth(this.container,{position:t,layer:i}):this.sprite&&this.setSpriteDepth(this.sprite,{position:t,layer:i});let n=this.getLayerOverlaySprite();if(n){let a=new E({...t,y:t.y-1});this.setSpriteDepth(n,{position:a,layer:i})}}setSpriteDepth(e,t){e.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(t))+this.getPaddedPixelDepthSprite(e))}setContainerDepth(e,t){e.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(t))+this.getPaddedPixelDepthContainer(e))}getPaddedPixelDepthContainer(e){return sn.shiftPad(e.y+this.cachedContainerHeight,un.Z_INDEX_PADDING)}getPaddedPixelDepthSprite(e){return sn.shiftPad(e.y+e.displayHeight+this.depthOffset,un.Z_INDEX_PADDING)}getTransitionLayer(e){if(e.layer)return this.geHeadless.getTransition(e.position,e.layer)||e.layer}};var Aa=(n=>(n.DONT_BLOCK="DONT_BLOCK",n.BLOCK_TWO_TILES="BLOCK_TWO_TILES",n.BLOCK_ONE_TILE_AHEAD="BLOCK_ONE_TILE_AHEAD",n.BLOCK_ONE_TILE_BEHIND="BLOCK_ONE_TILE_BEHIND",n))(Aa||{});var cn=(n=>(n.STOP="STOP",n.CLOSEST_REACHABLE="CLOSEST_REACHABLE",n.RETRY="RETRY",n.ALTERNATIVE_TARGETS="ALTERNATIVE_TARGETS",n))(cn||{});var cf=class{distance(e,t){return qe.manhattanDistance(e,t)}direction(e,t){if(qe.equal(e,t))return"none";let i=e.clone().subtract(t);return Math.abs(i.x)>Math.abs(i.y)?i.x>0?"left":"right":i.y>0?"up":"down"}neighbors(e){return[new E(e.x,e.y+1),new E(e.x+1,e.y),new E(e.x-1,e.y),new E(e.x,e.y-1)]}getDirections(){return["up","right","down","left"]}};var lf=class{distance(e,t){return qe.chebyshevDistance(e,t)}neighbors(e){let t=[new E(e.x,e.y+1),new E(e.x+1,e.y),new E(e.x-1,e.y),new E(e.x,e.y-1)],i=[new E(e.x+1,e.y+1),new E(e.x+1,e.y-1),new E(e.x-1,e.y+1),new E(e.x-1,e.y-1)];return[...t,...i]}direction(e,t){return t.x>e.x?t.y>e.y?"down-right":t.ye.y?"down-left":t.ye.y?"down":"none"}getDirections(){return["up","right","down","left","down-left","down-right","up-right","up-left"]}};var er=class{static create(e){switch(e){case 4:return new cf;case 8:return new lf}}};var Ea=class{constructor(e,t,i){this.backoffMs=e;this.maxRetries=t;this.onFinished=i;this.retries=0;this.elapsed=0}retry(e,t){this.shouldRetry()?(this.elapsed+=e,this.elapsed>=this.backoffMs&&(this.elapsed=0,this.retries++,t())):this.onFinished()}reset(){this.retries=0,this.elapsed=0}getMaxRetries(){return this.maxRetries}getBackoffMs(){return this.backoffMs}shouldRetry(){return this.maxRetries===-1||this.retries(i.WAIT="WAIT",i.RETRY="RETRY",i.STOP="STOP",i))(Po||{});var Ro=gt(qi(),1);var yr=class{constructor(e,{shortestPathAlgorithm:t="BFS",pathWidth:i=1,pathHeight:n=1,numberOfDirections:a=4,isPositionAllowed:u=(j,D)=>!0,collisionGroups:l=[],ignoredChars:h=[],ignoreTiles:p=!1,ignoreMapBounds:v=!1,ignoreBlockedTarget:b=!1,maxPathLength:T=1/0,ignoreLayers:S=!1,considerCosts:q=!1,calculateClosestToTarget:M=!0}={}){this.gridTilemap=e;this.options={shortestPathAlgorithm:t,pathWidth:i,pathHeight:n,numberOfDirections:a,isPositionAllowed:u,collisionGroups:l,ignoredChars:h,ignoreTiles:p,ignoreMapBounds:v,ignoreBlockedTarget:b,maxPathLength:T,ignoreLayers:S,considerCosts:q,calculateClosestToTarget:M},this.ignoredCharsSet=new Set(h)}findShortestPath(e,t){this.options.ignoreLayers&&(this.gridTilemap.fixCacheLayer(e.layer),t.layer=e.layer);let i=this.findShortestPathImpl(e,t);return this.gridTilemap.unfixCacheLayers(),i}getNeighbors(e,t){return er.create(this.options.numberOfDirections??4).neighbors(e.position).map(u=>{let l=e.layer;return this.options.ignoreLayers||(l=this.gridTilemap.getTransition(u,e.layer)),{position:u,layer:l||e.layer}}).filter(u=>!this.isBlocking(e,u)||this.options.ignoreBlockedTarget&&G.equal(u,t))}getTransition(e,t){if(!this.options.ignoreLayers)return this.gridTilemap.getTransition(e,t)}getCosts(e,t){if(!this.options.considerCosts)return 1;let i=Ue(t.position,e);return this.gridTilemap.getTileCosts(t,i)}isBlocking(e,t){return!(this.options.ignoreMapBounds||this.gridTilemap.isInRange(t.position))||!this.options.isPositionAllowed(t.position,t.layer)||!this.options.ignoreTiles&&this.hasBlockingTileFrom(e,t,this.options.pathWidth,this.options.pathHeight,this.options.ignoreMapBounds,this.gridTilemap)?!0:this.hasBlockingCharFrom(e,t,this.options.pathWidth,this.options.pathHeight,this.options.collisionGroups,this.ignoredCharsSet,this.gridTilemap)}distance(e,t){return(this.options.numberOfDirections===4?qe.manhattanDistance:qe.chebyshevDistance)(e,t)}getTilePosInDir(e,t){return this.options.ignoreLayers?{position:e.position.add(xt(this.gridTilemap.toMapDirection(t))),layer:e.layer}:this.gridTilemap.getTilePosInDirection(e,t)}getReverseNeighbors(e,t){let n=er.create(this.options.numberOfDirections??4).neighbors(e.position),a;if(!this.options.ignoreLayers){let l=this.gridTilemap.getReverseTransitions(e.position,e.layer);a=l?[...l]:void 0}return n.map(l=>a?a.map(h=>({position:l,layer:h||e.layer})):[{position:l,layer:e.layer}]).flat().filter(l=>!this.isBlocking(l,e)||this.options.ignoreBlockedTarget&&G.equal(e,t))}hasBlockingCharFrom(e,t,i,n,a,u,l){if(i===1&&n===1)return l.hasBlockingChar(t.position,t.layer,a,u);let h=v=>l.hasBlockingChar(v,t.layer,a,u),p=Ue(e.position,t.position);return this.isBlockingMultiTile(e,p,i,n,h)}hasBlockingTileFrom(e,t,i,n,a,u){if(i===1&&n===1)return u.hasBlockingTile(t.position,t.layer,Ue(t.position,e.position),a);let l=Ue(e.position,t.position),h=p=>u.hasBlockingTile(p,t.layer,l,a);return this.isBlockingMultiTile(e,l,i,n,h)}isBlockingMultiTile(e,t,i,n,a){let u={src:new E(e.position.x+i,e.position.y),dest:new E(e.position.x+i,e.position.y+n-1)},l={src:new E(e.position.x-1,e.position.y),dest:new E(e.position.x-1,e.position.y+n-1)},h={src:new E(e.position.x,e.position.y-1),dest:new E(e.position.x+i-1,e.position.y-1)},p={src:new E(e.position.x,e.position.y+n),dest:new E(e.position.x+i-1,e.position.y+n)};switch(t){case"right":return this.checkLine(u,a);case"left":return this.checkLine(l,a);case"up":return this.checkLine(h,a);case"down":return this.checkLine(p,a);case"up-left":return this.checkLine({src:h.src,dest:new E(h.dest.x-1,h.dest.y)},a)||this.checkLine({src:new E(l.src.x,l.src.y-1),dest:new E(l.dest.x,l.dest.y-1)},a);case"up-right":return this.checkLine({src:new E(h.src.x+1,h.src.y),dest:h.dest},a)||this.checkLine({src:new E(u.src.x,u.src.y-1),dest:new E(u.dest.x,u.dest.y-1)},a);case"down-left":return this.checkLine({src:new E(l.src.x,l.src.y+1),dest:new E(l.dest.x,l.dest.y+1)},a)||this.checkLine({src:p.src,dest:new E(p.dest.x-1,p.dest.y)},a);case"down-right":return this.checkLine({src:new E(p.src.x+1,p.src.y),dest:p.dest},a)||this.checkLine({src:new E(u.src.x,u.src.y+1),dest:new E(u.dest.x,u.dest.y+1)},a)}return!1}checkLine(e,t){for(let i=e.src.x;i<=e.dest.x;i++)for(let n=e.src.y;n<=e.dest.y;n++)if(t(new E(i,n)))return!0;return!1}};var _P=gt(hf(),1);var pf=class extends yr{findShortestPathImpl(e,t){let i=this.shortestPathBfs(e,t);return{path:this.returnPath(i.previous,e,t),closestToTarget:i.closestToTarget,steps:i.steps,maxPathLengthReached:i.maxPathLengthReached,algorithmUsed:"A_STAR"}}shortestPathBfs(e,t){let i=new Map,n=new Map,a=new Map,u=new _P.MinFibonacciHeap((v,b)=>Ma(a,v)-Ma(a,b)),l=e,h=this.distance(e.position,t.position),p=0;for(u.push(e),n.set(G.toString(e),0),a.set(G.toString(e),this.distance(e.position,t.position));u.size>0;){let v=u.pop();if(!v)break;p++;let b=this.distance(v.position,t.position);if(bthis.options.maxPathLength)return{previous:new Map,closestToTarget:l,steps:p,maxPathLengthReached:!0};for(let T of this.getNeighbors(v,t)){let S=Ma(n,v)+this.getCosts(v.position,T),q=G.toString(T);(!n.has(q)||S0;){let p=a.dequeue();if(h++,!p)break;let{node:v,dist:b}=p;if(b>this.options.maxPathLength)return{previous:new Map,closestToTarget:u,steps:h,maxPathLengthReached:!0};let T=this.distance(v.position,t.position);if(Tthis.lastDist)}step(e,t,i){this.lastDist=i;for(let n of e){let a=G.toString(n);if(!this.visited.has(a)){this.previous.set(a,t),this.queue.enqueue({node:n,dist:i+1}),this.visited.set(a,i+1);let u=this.otherBfs?.visited.get(a);u!==void 0&&u0,n.queue.size()>0);){let h=i.queue.dequeue();if(!h)break;let{node:p,dist:v}=h;if(v+1+(n.queue.peek()?.dist||0)>this.options.maxPathLength)return{previous:i.previous,previous2:n.previous,closestToTarget:this.maybeClosestToTarget(u),steps:a,maxPathLengthReached:!0};let b=this.distance(p.position,t.position);if(bka(this.f,u)-ka(this.f,l)),this.openSet.push(t);let a=G.toString(t);for(this.g.set(a,0),this.f.set(a,this.distance(t.position,i.position)),this.maxFrontierSize=Math.max(this.maxFrontierSize,this.openSet.size);this.openSet.size>0;){let u=this.openSet.pop();if(!u)break;if(this.steps++,G.equal(u,i))return{previous:n,closestToTarget:i,steps:this.steps,maxPathLengthReached:!1};if(ka(this.g,u)+1>this.options.maxPathLength)return{previous:new Map,closestToTarget:this.closestToTarget,steps:this.steps,maxPathLengthReached:!0};this.updateClosestToTarget(u,i);for(let l of this.getNeighborsInternal(u,n.get(G.toString(u)),i)){let h=G.toString(l.p),p=ka(this.g,u)+l.dist;(!this.g.has(h)||p({p:l,dist:1}));let a=this.prune(i,t).filter(l=>!this.isBlockingIgnoreTarget(t,l,n)).map(l=>{let h=this.getTransition(l.position,t.layer);return{position:l.position,layer:h||t.layer}}),u=[];for(let l of a)if(this.isHorizontal(t.position,l.position))u.push({p:l,dist:1});else{let h=this.jump(t,l,n,1,Ue(t.position,l.position));h&&u.push(h)}return u}isBlockingIgnoreTarget(t,i,n){return this.isBlocking(t,i)&&!(this.options.ignoreBlockedTarget&&G.equal(i,n))}jump(t,i,n,a,u){if(!this.isBlockingIgnoreTarget(t,i,n))return G.equal(i,n)?{p:i,dist:a}:a>=this.maxJumpSize?{p:i,dist:a}:this.getTransition(i.position,t.layer)!==void 0?{p:i,dist:a}:this.hasForced(t,i)?{p:i,dist:a}:(this.updateClosestToTarget(i,n),this.jump(i,this.getTilePosInDir(i,u),n,a+1,u))}isHorizontal(t,i){return t.y===i.y}getForced(t,i,n,a,u,l){let h=[],p=t;return(this.blockOrTrans(p,n)||this.blockOrTrans(n,a))&&this.addIfNotBlocked(h,i,a),(this.blockOrTrans(p,u)||this.blockOrTrans(u,l))&&this.addIfNotBlocked(h,i,l),h}hasForced(t,i){let{topLeft:n,downLeft:a,top:u,bottom:l}=this.normalizedPositions(t,i);return!!((this.blockOrTrans(t,a)||this.blockOrTrans(a,l))&&!this.blockOrTrans(i,l)||(this.blockOrTrans(t,n)||this.blockOrTrans(n,u))&&!this.blockOrTrans(i,u))}prune(t,i){let{right:n,top:a,bottom:u,downLeft:l,topLeft:h}=this.normalizedPositions(t,i);return this.isHorizontal(t.position,i.position)?[n,a,u]:[n,...this.getForced(t,i,l,u,h,a)]}normalizedPositions(t,i){return t.position.xi.position.x?{topLeft:{position:new E(i.position.x+1,i.position.y+1),layer:i.layer},downLeft:{position:new E(i.position.x+1,i.position.y-1),layer:i.layer},top:{position:new E(i.position.x,i.position.y+1),layer:i.layer},bottom:{position:new E(i.position.x,i.position.y-1),layer:i.layer},right:{position:new E(i.position.x-1,i.position.y),layer:i.layer}}:t.position.y1?this.fillPath(u,l,a):a.push(l),u=l}return a.reverse()}fillPath(t,i,n){let a=t;do{let u=Ue(a.position,i.position);a=this.getTilePosInDir(a,u),n.push(a)}while(!qe.equal(a.position,i.position))}};function ka(r,e){return r.get(G.toString(e))??Number.MAX_VALUE}var jo=gt(_o(),1);var Af=class{constructor(e,t,i,n={}){this.character=e;this.gridTilemap=t;this.charToFollow=i;let a={distance:0,noPathFoundStrategy:"STOP",maxPathLength:1/0,shortestPathAlgorithm:"BIDIRECTIONAL_SEARCH",ignoreLayers:!1,considerCosts:n.considerCosts||!1,facingDirection:"none",isPositionAllowedFn:()=>!0,ignoredChars:[]};this.options={...a,...n},this.options.considerCosts&&this.options.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.options.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.options.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.character=e,this.updateTarget(this.charToFollow.getTilePos().position,this.charToFollow.getTilePos().layer),this.charToFollow.positionChangeStarted().pipe((0,jo.takeUntil)(this.character.autoMovementSet().pipe((0,jo.filter)(u=>u!==this),(0,jo.take)(1)))).subscribe(({enterTile:u,enterLayer:l})=>{this.updateTarget(u,l)})}update(e){this.targetMovement?.update(e)}getInfo(){return{type:"Follow",config:{charToFollow:this.charToFollow.getId(),distance:this.options.distance,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,facingDirection:this.options.facingDirection,shortestPathAlgorithm:this.options.shortestPathAlgorithm,considerCosts:this.options.considerCosts,isPositionAllowedFn:this.options.isPositionAllowedFn,ignoredChars:this.options.ignoredChars}}}getFacingPos(){let e=fa[this.options.facingDirection]+fa[this.charToFollow.getFacingDirection()],t=ks("up",e),i={x:this.charToFollow.getTilePos().position.x,y:this.charToFollow.getTilePos().position.y};return t==="right"?i.x+=this.charToFollow.getTileWidth()-1:t==="down"?i.y+=this.charToFollow.getTileWidth()-1:t==="down-left"?i.y+=this.charToFollow.getTileWidth()-1:t==="down-right"?(i.y+=this.charToFollow.getTileWidth()-1,i.x+=this.charToFollow.getTileWidth()-1):t==="up-right"&&(i.x+=this.charToFollow.getTileWidth()-1),this.gridTilemap.getTilePosInDirection({position:new E(i),layer:this.charToFollow.getTilePos().layer},t).position}updateTarget(e,t){let i=this.options.facingDirection!=="none"&&this.options.distance===0;i&&(e=this.getFacingPos()),this.targetMovement=new Io(this.character,this.gridTilemap,{position:new E(e),layer:t},{distance:i?0:this.options.distance+1,config:{algorithm:this.options.shortestPathAlgorithm,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,considerCosts:this.options.considerCosts,ignoredChars:[this.charToFollow.getId(),...this.options.ignoredChars],isPositionAllowedFn:this.options.isPositionAllowedFn}})}};var Fa=class{static getRandomInt(e){return Math.floor(Math.random()*Math.floor(e))}};var ko=gt(_o(),1);var Ef=class{constructor(e,t=0,i=-1){this.character=e;this.delay=t;this.radius=i;this.stepSize=0;this.delayLeft=this.delay,this.initialRow=e.getNextTilePos().position.y,this.initialCol=e.getNextTilePos().position.x,this.randomizeStepSize(),this.stepsWalked=0,this.currentMovementDirection="none",this.character.positionChangeStarted().pipe((0,ko.takeUntil)(this.character.autoMovementSet().pipe((0,ko.filter)(n=>n!==this),(0,ko.take)(1)))).subscribe(()=>{this.stepsWalked++}),this.distanceUtils=er.create(e.getNumberOfDirections())}update(e){if(this.shouldContinueWalkingCurrentDirection())this.character.move(this.currentMovementDirection);else if(this.delayLeft-=e,this.delayLeft<=0){this.delayLeft=this.delay;let t=this.getFreeRandomDirection();this.stepsWalked=0,this.character.move(t),this.currentMovementDirection=t,this.randomizeStepSize()}}getInfo(){return{type:"Random",config:{delay:this.delay,radius:this.radius}}}shouldContinueWalkingCurrentDirection(){return this.stepsWalked!this.character.isBlockingDirection(t)).filter(t=>this.isWithinRadius(t))}isWithinRadius(e){return this.radius==-1?!0:this.getDist(e)<=this.radius}getDist(e){return this.distanceUtils.distance(this.character.getNextTilePos().position.add(xt(e)),new E(this.initialCol,this.initialRow))}getFreeRandomDirection(){let e=this.getFreeDirections();return e.length==0?"none":e[Fa.getRandomInt(e.length)]}randomizeStepSize(){this.stepSize=Fa.getRandomInt(this.radius)+1}};var or=gt(qi(),1),Ye=gt(_o(),1);function F1(r,e){return r.filter(t=>e.labels?.withAllLabels?e.labels?.withAllLabels.every(i=>t.hasLabel(i)):e.labels?.withOneOfLabels?e.labels?.withOneOfLabels.some(i=>t.hasLabel(i)):e.labels?.withNoneLabels?!e.labels?.withNoneLabels.some(i=>t.hasLabel(i)):!0)}var qf="2.46.0";var Ot=gt(qi(),1);var xf=class{constructor(e,t){this.collistionStrategy=e;this.collisionGroupRelation=t;this.tilePosToCharacters=new vm;this.charRemoved$=new Ot.Subject}isCharBlockingAt(e,t,i,n=new Set,a=new Set){if(i.length===0)return!1;let u=this.tilePosToCharacters.get(e,t);return!!(u&&u.size>0&&[...u].filter(l=>!n.has(l.getId())).filter(l=>!this.doIntersect(l.getCollisionGroups(),a)).some(l=>i.some(h=>l.getCollisionGroups().some(p=>this.collidesWith(h,p)))))}doIntersect(e,t){for(let i of e)if(t.has(i))return!0;return!1}collidesWith(e,t){return this.collisionGroupRelation?(this.collisionGroupRelation.get(e)||new Set).has(t):e===t}getCharactersAt(e,t){return this.tilePosToCharacters.get(e,t)||new Set}addCharacter(e){this.addTilePositions(e.getTilePos(),e),this.addTilePositions(e.getNextTilePos(),e),this.addPositionChangeSub(e),this.addPositionChangeFinishedSub(e),this.addTilePosSetSub(e)}removeCharacter(e){let t=e.getId();this.charRemoved$.next(t),this.deleteTilePositions(e.getTilePos(),e),this.deleteTilePositions(e.getNextTilePos(),e)}add(e,t,i){let n=this.tilePosToCharacters.get(e,t);n||this.tilePosToCharacters.set(e,t,new Set([i])),n?.add(i)}addTilePosSetSub(e){e.tilePositionSet().pipe((0,Ot.takeUntil)(this.charRemoved(e.getId()))).subscribe(t=>{this.deleteTilePositions(e.getNextTilePos(),e),this.addTilePositions(t,e)})}charRemoved(e){return this.charRemoved$?.pipe((0,Ot.take)(1),(0,Ot.filter)(t=>t==e))}addPositionChangeSub(e){e.positionChangeStarted().pipe((0,Ot.takeUntil)(this.charRemoved(e.getId())),this.posChangeToLayerPos()).subscribe(t=>{this.collistionStrategy==="BLOCK_ONE_TILE_AHEAD"&&this.deleteTilePositions(t.exit,e),this.addTilePositions(t.enter,e)})}addPositionChangeFinishedSub(e){e.positionChangeFinished().pipe((0,Ot.takeUntil)(this.charRemoved(e.getId())),this.posChangeToLayerPos()).subscribe(t=>{this.deleteTilePositions(t.exit,e),this.addTilePositions(t.enter,e)})}addTilePositions(e,t){this.forEachCharTile(e,t,(i,n)=>{this.add(new E(i,n),e.layer,t)})}deleteTilePositions(e,t){this.forEachCharTile(e,t,(i,n)=>{this.tilePosToCharacters.get(new E(i,n),e.layer)?.delete(t)})}forEachCharTile(e,t,i){let n=e.position;for(let a=n.x;a({enter:{position:new E(e.enterTile),layer:e.enterLayer},exit:{position:new E(e.exitTile),layer:e.exitLayer}})))}posToString(e,t){return`${e.x}#${e.y}#${t}`}},vm=class{constructor(){this.memo=new Map}set(e,t,i){let n=this.memo.get(e.x);n||(n=new Map,this.memo.set(e.x,n));let a=n.get(e.y);a||(a=new Map,n.set(e.y,a)),a.set(t,i)}get(e,t){let i=this.memo.get(e.x);if(!i)return;let n=i.get(e.y);if(n)return n.get(t)}};var Fi=class{constructor(e,t,i,n){this.x=e;this.y=t;this.width=i;this.height=n}getX(){return this.x}getY(){return this.y}getWidth(){return this.width}getHeight(){return this.height}isInRange(e){return e.x>=this.x&&e.x=this.y&&e.yi.isCharLayer());for(let i of[...t,void 0]){let n=this.tileCollisionCache.get(i?.getName());if(n===void 0){n=new Array(this.tilemap.getWidth());for(let a=0;a>e&1)==1}var R1="ge_cost",jf=class r{constructor(e,t,i,n=void 0,a=!1){this.tilemap=e;this.collisionTilePropertyName=t;this.useTileCollisionCache=a;this.characters=new Map;this.transitions=new Map;this.reverseTransitions=new Map;this.collidesPropNames=new Map;this.tileCostPropNames=new Map;this.collisionRelevantLayersFrameCache=new Map;this.charBlockCache=new xf(i,n);for(let u of ha())this.collidesPropNames.set(u,r.ONE_WAY_COLLIDE_PROP_PREFIX+u),this.tileCostPropNames.set(u,`${R1}_${u}`);this.useTileCollisionCache&&(this.tileCollisionCache=new Lf(e,this),this.tileCollisionCache.rebuild())}static{this.ONE_WAY_COLLIDE_PROP_PREFIX="ge_collide_"}fixCacheLayer(e){this.tileCollisionCache?.fixLayer(e)}unfixCacheLayers(){this.tileCollisionCache?.unfixLayers()}addCharacter(e){this.characters.set(e.getId(),e);let t=e.getNextTilePos().layer;t===void 0?e.setTilePosition({...e.getNextTilePos(),layer:this.getLowestCharLayer()}):this.getCharLayerNames().includes(t)||console.warn(`Char layer '${t}' of character '${e.getId()}' is unknown.`),this.charBlockCache.addCharacter(e)}removeCharacter(e){let t=this.characters.get(e);t&&(this.charBlockCache.removeCharacter(t),this.characters.delete(e))}getCharacters(){return[...this.characters.values()]}getCharactersAt(e,t){return this.charBlockCache.getCharactersAt(e,t)}rebuildTileCollisionCache(e){this.tileCollisionCache?.rebuild(e)}hasBlockingTileUncached(e,t,i,n){if(!n&&this.hasNoTileUncached(e,t))return!0;let a=this.getCollisionRelevantLayers(t);for(let u of a)if(this.isLayerBlockingAt(u.getName(),e,i))return!0;return!1}hasBlockingTile(e,t,i,n){let a=this.tileCollisionCache?.isBlockingFrom(e.x,e.y,t,i,n);return a!==void 0?a:this.hasBlockingTileUncached(e,t,i,n)}getTransition(e,t){let i=this.transitions.get(e.toString());if(i)return i.get(t)}getReverseTransitions(e,t){let i=this.reverseTransitions.get(e.toString());if(i)return i.get(t)}setTransition(e,t,i){this.transitions.has(e.toString())||this.transitions.set(e.toString(),new Map),this.reverseTransitions.has(e.toString())||this.reverseTransitions.set(e.toString(),new Map),this.transitions.get(e.toString())?.set(t,i),this.reverseTransitions.get(e.toString())?.has(i)||this.reverseTransitions.get(e.toString())?.set(i,new Set),this.reverseTransitions.get(e.toString())?.get(i)?.add(t)}getTransitions(){return new Map([...this.transitions].map(([e,t])=>[e,new Map(t)]))}getTileCosts(e,t){let i=this.getCollisionRelevantLayers(e.layer),n=1;for(let a of i)n=Math.max(n,this.getTileCostsForLayer({...e,layer:a.getName()},t));return n}getTileCostsForLayer(e,t){let i=this.tilemap.getTileAt(e.position.x,e.position.y,e.layer);return t&&i?.getProperty(this.tileCostPropNames.get(t)||"")||i?.getProperty(R1)||1}hasNoTileUncached(e,t){return!this.getCollisionRelevantLayers(t).some(n=>this.tilemap.hasTileAt(e.x,e.y,n.getName()))}hasNoTile(e,t){let i=this.tileCollisionCache?.hasTileAt(e.x,e.y,t);return i!==void 0?i:this.hasNoTileUncached(e,t)}hasBlockingChar(e,t,i,n=new Set,a=new Set){return this.charBlockCache.isCharBlockingAt(e,t,i,n,a)}isInRange(e){return new Fi(0,0,this.tilemap.getWidth(),this.tilemap.getHeight()).isInRange(e)}toMapDirection(e){return this.isIsometric()?nb(e):e}fromMapDirection(e){return this.isIsometric()?ks(e):e}isIsometric(){return this.tilemap.getOrientation()==="isometric"}getTilePosInDirection(e,t){let i=e.position.add(xt(this.toMapDirection(t))),n=this.getTransition(i,e.layer)||e.layer;return{position:i,layer:n}}invalidateFrameCache(){this.collisionRelevantLayersFrameCache.clear()}isLayerBlockingAt(e,t,i){let n=this.tilemap.getTileAt(t.x,t.y,e);return n?!!(n.getProperty(this.collisionTilePropertyName)||i&&n.getProperty(this.collidesPropNames.get(i)||"")):!1}getCharLayerIndexes(){return this.tilemap.getLayers().map((e,t)=>({layer:e,index:t})).filter(({layer:e})=>e.isCharLayer()).map(({index:e})=>e)}findPrevAndCharLayer(e){let t=this.getCharLayerIndexes(),i=this.tilemap.getLayers(),n=t.findIndex(a=>i[a].getProperty(Fo)==e);return n==0?{prevIndex:-1,charLayerIndex:t[n]}:{prevIndex:t[n-1],charLayerIndex:t[n]}}getCollisionRelevantLayers(e){if(!e)return this.tilemap.getLayers();let t=this.collisionRelevantLayersFrameCache.get(e);if(t)return t;let{prevIndex:i,charLayerIndex:n}=this.findPrevAndCharLayer(e),a=this.tilemap.getLayers().slice(i+1,n+1);return this.collisionRelevantLayersFrameCache.set(e,a),a}getLowestCharLayer(){for(let e of this.tilemap.getLayers())if(e.isCharLayer())return e.getProperty(Fo)}getCharLayerNames(){return this.tilemap.getLayers().filter(e=>e.isCharLayer()).map(e=>e.getProperty(Fo)).filter(P4)}};function P4(r){return r!=null}var If=(t=>(t.REMOVED="REMOVED",t.ADDED="ADDED",t))(If||{});var z1=gt(qi(),1),Ff=gt(_o(),1);var gm=(i=>(i.WAIT="WAIT",i.SKIP="SKIP",i.STOP="STOP",i))(gm||{}),kf=class{constructor(e,t){this.character=e;this.tilemap=t;this.queue=new Hr;this.finished$=new z1.Subject;this.pathBlockedWaitElapsed=0;this.distanceUtils=er.create(e.getNumberOfDirections()),this.character.autoMovementSet().pipe((0,Ff.filter)(i=>i!==this),(0,Ff.take)(1)).subscribe(()=>{this.queue.size()>0&&this.finishMovementTerminated(),this.finished$.complete()})}update(e){(!this.character.isMoving()||this.character.willCrossTileBorderThisUpdate(e))&&this.queue.size()>0&&this.moveCharOnPath(e)}getInfo(){return{type:"Queue"}}enqueue(e,t={}){let i={pathBlockedStrategy:t.pathBlockedStrategy??"STOP",pathBlockedWaitTimeoutMs:t?.pathBlockedWaitTimeoutMs||-1,ignoreInvalidPositions:t.ignoreInvalidPositions??!1,skipInvalidPositions:t.skipInvalidPositions??!1};for(let n of e){let a={command:n,config:i};if(oi(n)){this.queue.enqueue(a);continue}let l=this.queue.peekEnd()?.command;if(l||(l=this.character.getNextTilePos()),oi(l)){this.queue.enqueue(a);continue}let h=this.distanceUtils.distance(l.position,n.position)===1;(!t.ignoreInvalidPositions||h)&&this.queue.enqueue(a)}}peekAll(){return this.queue.peekAll()}size(){return this.queue.size()}finished(){return this.finished$}clear(){this.queue.clear()}moveCharOnPath(e){let t=this.queue.peek();if(!t)return;let i=t.command,n=t.config;if(oi(i)&&(i=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),i)),n.skipInvalidPositions){if(i=this.getNextValidPosition(),!i){this.finishInvalidNextPos(i);return}}else if(!this.isNeighborPos(i)){this.finishInvalidNextPos(i);return}if(this.character.isBlockingDirection(Ue(this.character.getNextTilePos().position,i.position))){if(n.pathBlockedStrategy==="STOP")this.finishPathBlocked(i);else if(n.pathBlockedStrategy==="SKIP"){this.queue.dequeue(),this.moveCharOnPath(e);return}else n.pathBlockedStrategy==="WAIT"&&n.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=e,this.pathBlockedWaitElapsed>=n.pathBlockedWaitTimeoutMs&&this.finishBlockedWaitTimeout(i,n.pathBlockedWaitTimeoutMs));return}this.pathBlockedWaitElapsed=0,this.queue.dequeue(),this.character.move(this.getDir(this.character.getNextTilePos().position,i.position)),this.isLastMovement()&&this.finish("SUCCESS","",i)}getNextValidPosition(){for(;this.queue.size()>0;){let e=this.queue.peek()?.command;if(oi(e)&&(e=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),e)),e&&this.isNeighborPos(e))return e;this.queue.dequeue()}}isLastMovement(){return this.queue.size()===0}isNeighborPos(e){let t=this.distanceUtils.distance(this.character.getNextTilePos().position,e.position)===1,i=this.tilemap.getTransition(e.position,this.character.getNextTilePos().layer);if(this.character.getNextTilePos().layer!==e.layer)return t&&i===e.layer;let n=i!==void 0&&i!==e.layer;return t&&!n}finishMovementTerminated(){this.finish("MOVEMENT_TERMINATED","New automatic movement has been set to character.")}finishInvalidNextPos(e){e?this.finish("INVALID_NEXT_POS",`Position ${this.posToStr(e)} is not reachable from ${this.posToStr(this.character.getNextTilePos())}.`):this.finish("INVALID_NEXT_POS",`No enqueued position is reachable from ${this.posToStr(this.character.getNextTilePos())}.`)}finishPathBlocked(e){this.finish("PATH_BLOCKED",`Position ${this.posToStr(e)} is blocked.`)}finishBlockedWaitTimeout(e,t){this.finish("PATH_BLOCKED_WAIT_TIMEOUT",`Position ${this.posToStr(e)} is blocked and the wait timeout of ${t} ms has been exceeded.`)}finish(e,t="",i=this.character.getNextTilePos()){this.queue=new Hr,this.finished$.next({position:i.position,result:e,description:t,layer:i.layer})}getDir(e,t){return this.tilemap.fromMapDirection(Ue(e,t))}posToStr(e){return`(${e.position.x}, ${e.position.y}, ${e.layer})`}};var Da=class{constructor(e=!0){this.isCreatedInternal=!1;e&&console.log(`Using GridEngine v${qf}`)}getCharLayer(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getTilePos().layer}getTransition(e,t){return this.initGuard(),this.gridTilemap?.getTransition(new E(e),t)}setTransition(e,t,i){return this.initGuard(),this.gridTilemap?.setTransition(new E(e),t,i)}create(e,t){this.isCreatedInternal=!0,this.gridCharacters=new Map;let i=this.setConfigDefaults(t);this.config=i,this.movementStopped$=new or.Subject,this.movementStarted$=new or.Subject,this.directionChanged$=new or.Subject,this.positionChangeStarted$=new or.Subject,this.positionChangeFinished$=new or.Subject,this.queueMovementFinished$=new or.Subject,this.charRemoved$=new or.Subject,this.charAdded$=new or.Subject,this.gridTilemap=new jf(e,this.config.collisionTilePropertyName,this.config.characterCollisionStrategy,this.recordToMap(this.config.collisionGroupRelation),this.config.cacheTileCollisions),this.addCharacters()}recordToMap(e){return e?new Map(Object.entries(e).map(([i,n])=>[i,new Set(n)])):void 0}getPosition(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getTilePos().position}move(e,t){this.moveChar(e,t)}moveRandomly(e,t=0,i=-1){this.initGuard();let n=this.gridCharacters?.get(e);if(!n)throw this.createCharUnknownErr(e);let a=new Ef(n,t,i);n.setMovement(a)}getMovement(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);let i=t.getMovement();return i?i.getInfo():{type:"None"}}moveTo(e,t,i){let n=this.assembleMoveToConfig(i);this.initGuard();let a=this.gridCharacters?.get(e);if(!a)throw this.createCharUnknownErr(e);if(!this.gridTilemap)throw this.createUninitializedErr();let u=new Io(a,this.gridTilemap,{position:new E(t),layer:i?.targetLayer||a.getNextTilePos().layer},{distance:0,config:n});return a.setMovement(u),u.finishedObs().pipe((0,Ye.map)(l=>({charId:e,position:l.position,result:l.result,description:l.description,layer:l.layer})))}stopMovement(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);t.setMovement(void 0)}setSpeed(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.setSpeed(t)}getSpeed(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getSpeed()}collidesWithTiles(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.collidesWithTiles()}update(e,t){if(this.isCreatedInternal&&this.gridCharacters)for(let[i,n]of this.gridCharacters)n.update(t);this.gridTilemap?.invalidateFrameCache()}addCharacter(e){if(!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let t={speed:e.speed||4,tilemap:this.gridTilemap,collidesWithTiles:!0,collisionGroups:["geDefault"],ignoreCollisionGroups:[],charLayer:e.charLayer,facingDirection:e.facingDirection,labels:e.labels,numberOfDirections:e.numberOfDirections??this.config.numberOfDirections,tileWidth:e.tileWidth,tileHeight:e.tileHeight};typeof e.collides=="boolean"?e.collides===!1&&(t.collidesWithTiles=!1,t.collisionGroups=[]):e.collides!==void 0&&(e.collides.collidesWithTiles===!1&&(t.collidesWithTiles=!1),e.collides.collisionGroups&&(t.collisionGroups=e.collides.collisionGroups),e.collides.ignoreCollisionGroups&&(t.ignoreCollisionGroups=e.collides.ignoreCollisionGroups),t.ignoreMissingTiles=e.collides?.ignoreMissingTiles??!1);let i=new of(e.id,t);e.startPosition&&i.setTilePosition({position:new E(e.startPosition),layer:i.getTilePos().layer}),this.gridCharacters?.set(e.id,i),this.gridTilemap.addCharacter(i);let n=i.getId();i.movementStopped().pipe((0,Ye.takeUntil)(this.charRemoved(n))).subscribe(a=>{this.movementStopped$?.next({charId:n,direction:a})}),i.movementStarted().pipe((0,Ye.takeUntil)(this.charRemoved(n))).subscribe(a=>{this.movementStarted$?.next({charId:n,direction:a})}),i.directionChanged().pipe((0,Ye.takeUntil)(this.charRemoved(n))).subscribe(a=>{this.directionChanged$?.next({charId:n,direction:a})}),i.positionChangeStarted().pipe((0,Ye.takeUntil)(this.charRemoved(n))).subscribe(a=>{this.positionChangeStarted$?.next({charId:n,...a})}),i.positionChangeFinished().pipe((0,Ye.takeUntil)(this.charRemoved(n))).subscribe(a=>{this.positionChangeFinished$?.next({charId:n,...a})}),this.charAdded$?.next(n)}hasCharacter(e){return this.initGuard(),!!this.gridCharacters?.has(e)}removeCharacter(e){if(this.initGuard(),!this.gridCharacters?.get(e))throw this.createCharUnknownErr(e);this.gridTilemap?.removeCharacter(e),this.gridCharacters?.delete(e),this.charRemoved$?.next(e)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters)for(let e of this.gridCharacters.keys())this.removeCharacter(e)}getAllCharacters(e){if(this.initGuard(),!this.gridCharacters)return[];let t=[...this.gridCharacters.values()];return(e?F1(t,e):t).map(n=>n.getId())}getLabels(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getLabels()}addLabels(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.addLabels(t)}removeLabels(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.removeLabels(t)}clearLabels(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);t.clearLabels()}follow(e,t,i,n){let a;i===void 0?a={distance:0,closestPointIfBlocked:!1}:typeof i=="number"?(a={distance:i,closestPointIfBlocked:!1},n&&(a.closestPointIfBlocked=!0)):a=i,this.initGuard();let u=this.gridCharacters?.get(e),l=this.gridCharacters?.get(t);if(!u)throw this.createCharUnknownErr(e);if(!l)throw this.createCharUnknownErr(t);if(!this.gridTilemap)throw this.createUninitializedErr();let h=new Af(u,this.gridTilemap,l,{distance:a.distance??0,noPathFoundStrategy:a.closestPointIfBlocked?"CLOSEST_REACHABLE":"STOP",maxPathLength:a.maxPathLength??1/0,shortestPathAlgorithm:a.algorithm??"BIDIRECTIONAL_SEARCH",ignoreLayers:!!a.ignoreLayers,facingDirection:a.facingDirection??"none",considerCosts:a.considerCosts??!1,isPositionAllowedFn:a.isPositionAllowedFn??(()=>!0),ignoredChars:a.ignoredChars??[]});u.setMovement(h)}isMoving(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.isMoving()}getFacingDirection(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getFacingDirection()}getFacingPosition(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);let i=t.getFacingPosition();return{x:i.x,y:i.y}}turnTowards(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);return i.turnTowards(t)}getCharactersAt(e,t){if(this.initGuard(),!this.gridTilemap)return[];let i=this.gridTilemap.getCharactersAt(new E(e),t);return Array.from(i).map(n=>n.getId())}setPosition(e,t,i){this.initGuard();let n=this.gridCharacters?.get(e);if(!n)throw this.createCharUnknownErr(e);i||n.setTilePosition({position:new E(t),layer:n.getTilePos().layer}),n.setTilePosition({position:new E(t),layer:i})}isBlocked(e,t,i=["geDefault"]){this.initGuard();let n=new E(e);return!!(this.gridTilemap?.hasBlockingTile(n,t)||this.gridTilemap?.hasBlockingChar(n,t,i))}isTileBlocked(e,t){return this.initGuard(),!!this.gridTilemap?.hasBlockingTile(new E(e),t)}getCollisionGroups(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getCollisionGroups()||[]}setCollisionGroups(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.setCollisionGroups(t)}getIgnoreCollisionGroups(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getIgnoreCollisionGroups()||[]}setIgnoreCollisionGroups(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.setIgnoreCollisionGroups(t)}getTilePosInDirection(e,t,i){if(!this.gridTilemap)throw this.createUninitializedErr();let n=this.gridTilemap.getTilePosInDirection({position:new E(e),layer:t},i);return{position:n.position.toPosition(),charLayer:n.layer}}findShortestPath(e,t,i={}){if(!this.gridTilemap)throw this.createUninitializedErr();let n=i.shortestPathAlgorithm||"BFS";i.considerCosts&&n!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${n}'. It can only be used with A* algorithm.`);let a=i.pathWidth!==void 0&&i.pathWidth!==1,u=i.pathHeight!==void 0&&i.pathHeight!==1;(a||u)&&n==="JPS"&&console.warn("GridEngine: Pathfinding options 'pathWidth' and 'pathHeight' > 1 cannot be used with algorithm 'JPS'.");let h=new Do(this.gridTilemap).findShortestPath(G.toInternal(e),G.toInternal(t),{...i,shortestPathAlgorithm:n});return{path:h.path.map(G.fromInternal),closestToTarget:h.closestToTarget?G.fromInternal(h.closestToTarget):void 0,reachedMaxPathLength:!1,steps:h.steps}}steppedOn(e,t,i){return this.positionChangeFinished().pipe((0,Ye.filter)(n=>e.includes(n.charId)&&t.some(a=>a.x===n.enterTile.x&&a.y===n.enterTile.y)&&(i===void 0||i.includes(n.enterLayer))))}characterShifted(){if(!this.charAdded$||!this.charRemoved$)throw this.createUninitializedErr();return this.charAdded$.pipe((0,Ye.map)(e=>({charId:e,action:"ADDED"})),(0,Ye.mergeWith)(this.charRemoved$.pipe((0,Ye.map)(e=>({charId:e,action:"REMOVED"})))))}movementStarted(){if(!this.movementStarted$)throw this.createUninitializedErr();return this.movementStarted$}movementStopped(){if(!this.movementStopped$)throw this.createUninitializedErr();return this.movementStopped$}directionChanged(){if(!this.directionChanged$)throw this.createUninitializedErr();return this.directionChanged$}positionChangeStarted(){if(!this.positionChangeStarted$)throw this.createUninitializedErr();return this.positionChangeStarted$}positionChangeFinished(){if(!this.positionChangeFinished$)throw this.createUninitializedErr();return this.positionChangeFinished$}getMovementProgress(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getMovementProgress()}rebuildTileCollisionCache(e,t,i,n){this.gridTilemap?.rebuildTileCollisionCache(new Fi(e,t,i,n))}addQueueMovements(e,t,i){this.initGuard();let n=this.gridCharacters?.get(e);if(!n)throw this.createCharUnknownErr(e);if(!this.gridTilemap)throw this.createUninitializedErr();let a;n?.getMovement()?.getInfo().type==="Queue"?a=n.getMovement():(a=new kf(n,this.gridTilemap),n.setMovement(a),a.finished().pipe((0,Ye.takeUntil)((0,or.merge)(this.charRemoved(e),n.autoMovementSet()))).subscribe(u=>{this.queueMovementFinished$?.next({charId:e,...u})})),a.enqueue(t.map(u=>oi(u)?u:{position:new E(u.position),layer:u.charLayer}),i)}queueMovementFinished(){if(!this.queueMovementFinished$)throw this.createUninitializedErr();return this.queueMovementFinished$}getEnqueuedMovements(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getMovement()?.getInfo().type==="Queue"?t.getMovement().peekAll().map(n=>({command:oi(n.command)?n.command:G.fromInternal(n.command),config:n.config})):[]}clearEnqueuedMovements(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);t.getMovement()?.getInfo().type==="Queue"&&t.getMovement().clear()}getTileCost(e,t,i){return this.initGuard(),this.gridTilemap?.getTileCosts({position:new E(e),layer:t},i)??1}getState(){let e=[];if(this.gridCharacters)for(let[t,i]of this.gridCharacters.entries())e.push({id:t,position:G.fromInternal(i.getTilePos()),facingDirection:i.getFacingDirection(),speed:i.getSpeed(),labels:i.getLabels(),movementProgress:i.getMovementProgress(),collisionConfig:{collisionGroups:i.getCollisionGroups(),ignoreCollisionGroups:i.getIgnoreCollisionGroups(),collidesWithTiles:i.collidesWithTiles(),ignoreMissingTiles:i.getIgnoreMissingTiles()}});return{characters:e}}setState(e){if(this.gridCharacters)for(let t of e.characters){let i=this.gridCharacters.get(t.id);if(i){let n=i.getTilePos();G.equal(n,G.toInternal(t.position))||i.setTilePosition(G.toInternal(t.position)),i.setSpeed(t.speed),i.turnTowards(t.facingDirection),t.collisionConfig.collisionGroups&&i.setCollisionGroups(t.collisionConfig.collisionGroups),t.collisionConfig.collidesWithTiles!==void 0&&i.setCollidesWithTiles(t.collisionConfig.collidesWithTiles),t.collisionConfig.ignoreMissingTiles!==void 0&&i.setIgnoreMissingTiles(t.collisionConfig.ignoreMissingTiles),i.setMovementProgress(t.movementProgress),i.clearLabels(),i.addLabels(t.labels)}}}charRemoved(e){if(!this.charRemoved$)throw this.createUninitializedErr();return this.charRemoved$?.pipe((0,Ye.take)(1),(0,Ye.filter)(t=>t==e))}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){this.config?.characters.forEach(e=>this.addCharacter(e))}moveChar(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);if(i.getNumberOfDirections()===4){if(!this.gridTilemap?.isIsometric()&&Yi(t)){console.warn(`GridEngine: Character '${e}' can't be moved '${t}' in 4 direction mode.`);return}else if(this.gridTilemap?.isIsometric()&&!Yi(t)){console.warn(`GridEngine: Character '${e}' can't be moved '${t}' in 4 direction isometric mode.`);return}}i.move(t)}createCharUnknownErr(e){return new Error(`Character unknown: ${e}`)}assembleMoveToConfig(e={}){let t={...e,noPathFoundStrategy:"STOP",pathBlockedStrategy:"WAIT"};return e?.noPathFoundStrategy&&(Object.values(cn).includes(e.noPathFoundStrategy)?t.noPathFoundStrategy=e.noPathFoundStrategy:console.warn(`GridEngine: Unknown NoPathFoundStrategy '${e.noPathFoundStrategy}'. Falling back to 'STOP'`)),e?.pathBlockedStrategy&&(Object.values(Po).includes(e.pathBlockedStrategy)?t.pathBlockedStrategy=e.pathBlockedStrategy:console.warn(`GridEngine: Unknown PathBlockedStrategy '${e.pathBlockedStrategy}'. Falling back to 'WAIT'`)),t}setConfigDefaults(e){return{collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",cacheTileCollisions:!1,...e}}};var Rf=class extends Lo{constructor(t,i={}){super(t,i);this.jumpCache=new zf}findShortestPathImpl(t,i){return this.jumpCache=new zf,super.findShortestPathImpl(t,i)}getNeighborsInternal(t,i,n){if(!i||t.layer!==i.layer)return this.getNeighbors(t,n).map(l=>({p:l,dist:1}));let a=this.prune(i,t).map(l=>{let h=this.getTransition(l.position,t.layer);return{position:l.position,layer:h||t.layer}}),u=[];for(let l of a){let h=this.jump(t,l,n,1,Ue(t.position,l.position));h&&(h.dist=this.distance(t.position,h.p.position),u.push(h))}return u}getForced(t,i){let n=[],{topLeft:a,downLeft:u,top:l,bottom:h,topRight:p,downRight:v}=this.normalizedPositions(t,i),b=Ue(t.position,i.position);return Yi(b)?(this.blockOrTrans(t,a)&&(this.addIfNotBlocked(n,i,l),this.addIfNotBlocked(n,i,p),this.blockOrTrans(u,a)&&this.addIfNotBlocked(n,i,a)),this.blockOrTrans(t,u)&&(this.addIfNotBlocked(n,i,h),this.addIfNotBlocked(n,i,v),this.blockOrTrans(a,u)&&this.addIfNotBlocked(n,i,u)),this.blockOrTrans(a,l)&&this.addIfNotBlocked(n,i,l),this.blockOrTrans(u,h)&&this.addIfNotBlocked(n,i,h),this.blockOrTrans(a,p)&&this.addIfNotBlocked(n,i,p),this.blockOrTrans(u,v)&&this.addIfNotBlocked(n,i,v)):((this.blockOrTrans(t,l)||this.blockOrTrans(l,p))&&this.addIfNotBlocked(n,i,p),(this.blockOrTrans(t,h)||this.blockOrTrans(h,v))&&this.addIfNotBlocked(n,i,v),this.blockOrTrans(t,a)&&this.blockOrTrans(t,l)&&(this.addIfNotBlocked(n,i,l),this.addIfNotBlocked(n,i,a)),this.blockOrTrans(t,u)&&this.blockOrTrans(t,h)&&(this.addIfNotBlocked(n,i,h),this.addIfNotBlocked(n,i,u)),this.blockOrTrans(a,l)&&this.blockOrTrans(t,l)&&this.addIfNotBlocked(n,i,l),this.blockOrTrans(u,h)&&this.blockOrTrans(t,h)&&this.addIfNotBlocked(n,i,h)),n}hasForced(t,i){let{topLeft:n,downLeft:a,top:u,bottom:l,topRight:h,downRight:p}=this.normalizedPositions(t,i),v=Ue(t.position,i.position);if(Yi(v)){if(this.blockOrTrans(t,n)&&(!this.blockOrTrans(i,u)||!this.blockOrTrans(i,h)||this.blockOrTrans(a,n)&&!this.blockOrTrans(i,n))||this.blockOrTrans(t,a)&&(!this.blockOrTrans(i,l)||!this.blockOrTrans(i,p)||this.blockOrTrans(n,a)&&!this.blockOrTrans(i,a))||this.blockOrTrans(n,u)&&!this.blockOrTrans(i,u)||this.blockOrTrans(a,l)&&!this.blockOrTrans(i,l)||this.blockOrTrans(n,h)&&!this.blockOrTrans(i,h)||this.blockOrTrans(a,p)&&!this.blockOrTrans(i,p))return!0}else if((this.blockOrTrans(t,u)||this.blockOrTrans(u,h))&&!this.blockOrTrans(i,h)||(this.blockOrTrans(t,l)||this.blockOrTrans(l,p))&&!this.blockOrTrans(i,p)||this.blockOrTrans(t,n)&&this.blockOrTrans(t,u)&&(!this.blockOrTrans(i,u)||!this.blockOrTrans(i,n))||this.blockOrTrans(t,a)&&this.blockOrTrans(t,l)&&(!this.blockOrTrans(i,l)||!this.blockOrTrans(i,a))||this.blockOrTrans(n,u)&&this.blockOrTrans(t,u)&&!this.blockOrTrans(i,u)||this.blockOrTrans(a,l)&&this.blockOrTrans(t,l)&&!this.blockOrTrans(i,l))return!0;return!1}prune(t,i){let{top:n,right:a,topRight:u,downRight:l,bottom:h}=this.normalizedPositions(t,i),p=this.getForced(t,i),v=Ue(t.position,i.position);return Yi(v)?[n,a,u,l,h,...p]:[a,...p]}jump(t,i,n,a,u){let l=this.jumpCache.get(t,i);if(l!==null)return l;if(this.isBlocking(t,i)&&!(G.equal(i,n)&&this.options.ignoreBlockedTarget)){this.jumpCache.set(t,i,void 0);return}if(G.equal(i,n))return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0};if(a>=this.maxJumpSize)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0};if(this.getTransition(i.position,t.layer)!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0};if(this.hasForced(t,i))return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0};if(this.updateClosestToTarget(i,n),u==="up-left"){if(this.jump(i,this.getTilePosInDir(i,"up"),n,a+1,"up")!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0};if(this.jump(i,this.getTilePosInDir(i,"left"),n,a+1,"left")!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0}}else if(u==="down-left"){if(this.jump(i,this.getTilePosInDir(i,"down"),n,a+1,"down")!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0};if(this.jump(i,this.getTilePosInDir(i,"left"),n,a+1,"left")!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0}}else if(u==="up-right"){if(this.jump(i,this.getTilePosInDir(i,"up"),n,a+1,"up")!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0};if(this.jump(i,this.getTilePosInDir(i,"right"),n,a+1,"right")!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0}}else if(u==="down-right"){if(this.jump(i,this.getTilePosInDir(i,"down"),n,a+1,"down")!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0};if(this.jump(i,this.getTilePosInDir(i,"right"),n,a+1,"right")!==void 0)return this.jumpCache.set(t,i,{p:i,dist:0}),{p:i,dist:0}}let h=this.jump(i,this.getTilePosInDir(i,u),n,a+1,u);return this.jumpCache.set(t,i,h),h}normalizedPositions(t,i){return t.position.xi.position.x&&t.position.y===i.position.y?{topLeft:{position:new E(i.position.x+1,i.position.y+1),layer:i.layer},downLeft:{position:new E(i.position.x+1,i.position.y-1),layer:i.layer},top:{position:new E(i.position.x,i.position.y+1),layer:i.layer},bottom:{position:new E(i.position.x,i.position.y-1),layer:i.layer},right:{position:new E(i.position.x-1,i.position.y),layer:i.layer},topRight:{position:new E(i.position.x-1,i.position.y+1),layer:i.layer},downRight:{position:new E(i.position.x-1,i.position.y-1),layer:i.layer}}:t.position.yi.position.y&&t.position.x===i.position.x?{topLeft:{position:new E(i.position.x-1,i.position.y+1),layer:i.layer},downLeft:{position:new E(i.position.x+1,i.position.y+1),layer:i.layer},top:{position:new E(i.position.x-1,i.position.y),layer:i.layer},bottom:{position:new E(i.position.x+1,i.position.y),layer:i.layer},right:{position:new E(i.position.x,i.position.y-1),layer:i.layer},topRight:{position:new E(i.position.x-1,i.position.y-1),layer:i.layer},downRight:{position:new E(i.position.x+1,i.position.y-1),layer:i.layer}}:t.position.yi.position.x?{topLeft:{position:new E(i.position.x+1,i.position.y),layer:i.layer},downLeft:{position:new E(i.position.x,i.position.y-1),layer:i.layer},top:{position:new E(i.position.x+1,i.position.y+1),layer:i.layer},bottom:{position:new E(i.position.x-1,i.position.y-1),layer:i.layer},right:{position:new E(i.position.x-1,i.position.y+1),layer:i.layer},topRight:{position:new E(i.position.x,i.position.y+1),layer:i.layer},downRight:{position:new E(i.position.x-1,i.position.y),layer:i.layer}}:t.position.y>i.position.y&&t.position.x(h.SUCCESS="SUCCESS",h.NO_PATH_FOUND_MAX_RETRIES_EXCEEDED="NO_PATH_FOUND_MAX_RETRIES_EXCEEDED",h.PATH_BLOCKED_MAX_RETRIES_EXCEEDED="PATH_BLOCKED_MAX_RETRIES_EXCEEDED",h.PATH_BLOCKED="PATH_BLOCKED",h.NO_PATH_FOUND="NO_PATH_FOUND",h.PATH_BLOCKED_WAIT_TIMEOUT="PATH_BLOCKED_WAIT_TIMEOUT",h.MOVEMENT_TERMINATED="MOVEMENT_TERMINATED",h.MAX_PATH_LENGTH_REACHED="MAX_PATH_LENGTH_REACHED",h))(Df||{}),Io=class{constructor(e,t,i,{config:n,ignoreBlockedTarget:a=!1,distance:u=0}={}){this.character=e;this.tilemap=t;this.targetPos=i;this.shortestPath=[];this.distOffset=0;this.posOnPath=0;this.stopped=!1;this.pathBlockedWaitElapsed=0;this.isPositionAllowed=()=>!0;this.shortestPathAlgorithm="BIDIRECTIONAL_SEARCH";this.maxPathLength=1/0;this.considerCosts=!1;this.ignoredChars=[];this.isBlocking=(e,t)=>e?new wo(this.tilemap,this.getPathfindingOptions()).isBlocking(this.character.getTilePos(),{position:e,layer:t}):!0;this.shortestPathAlgorithm=n?.algorithm??this.shortestPathAlgorithm,this.ignoreBlockedTarget=a,this.distance=u,this.noPathFoundStrategy=n?.noPathFoundStrategy||"STOP",this.pathBlockedStrategy=n?.pathBlockedStrategy||"WAIT",this.noPathFoundRetryable=new Ea(n?.noPathFoundRetryBackoffMs||200,n?.noPathFoundMaxRetries||-1,()=>{this.stop("NO_PATH_FOUND_MAX_RETRIES_EXCEEDED")}),this.pathBlockedRetryable=new Ea(n?.pathBlockedRetryBackoffMs||200,n?.pathBlockedMaxRetries||-1,()=>{this.stop("PATH_BLOCKED_MAX_RETRIES_EXCEEDED")}),n?.isPositionAllowedFn&&(this.isPositionAllowed=n.isPositionAllowedFn),n?.maxPathLength&&(this.maxPathLength=n.maxPathLength),this.alternativeTargets=n?.alternativeTargets,this.noPathFoundAlternativeTargetsFallbackStrategy=n?.noPathFoundAlternativeTargetsFallbackStrategy,n?.considerCosts&&this.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.considerCosts=n?.considerCosts||!1,this.ignoreLayers=!!n?.ignoreLayers,this.distanceUtils=er.create(e.getNumberOfDirections()),this.pathBlockedWaitTimeoutMs=n?.pathBlockedWaitTimeoutMs||-1,this.ignoredChars=n?.ignoredChars??[],this.finished$=new Ro.Subject,this.setCharacter(e)}setPathBlockedStrategy(e){this.pathBlockedStrategy=e}getPathBlockedStrategy(){return this.pathBlockedStrategy}setCharacter(e){this.character=e,this.noPathFoundRetryable.reset(),this.pathBlockedRetryable.reset(),this.pathBlockedWaitElapsed=0,this.calcShortestPath(),this.character.autoMovementSet().pipe((0,Ro.filter)(t=>t!==this),(0,Ro.take)(1)).subscribe(()=>{this.stop("MOVEMENT_TERMINATED")})}getPathfindingOptions(){return{shortestPathAlgorithm:this.shortestPathAlgorithm,pathWidth:this.character.getTileWidth(),pathHeight:this.character.getTileHeight(),numberOfDirections:this.character.getNumberOfDirections(),isPositionAllowed:this.isPositionAllowed,collisionGroups:this.character.getCollisionGroups(),ignoredChars:[this.character.getId(),...this.ignoredChars],ignoreTiles:!this.character.collidesWithTiles(),ignoreMapBounds:this.character.getIgnoreMissingTiles(),ignoreBlockedTarget:this.ignoreBlockedTarget,maxPathLength:this.maxPathLength,ignoreLayers:this.ignoreLayers,considerCosts:this.considerCosts,calculateClosestToTarget:!0}}update(e){this.stopped||(this.noPathFound()&&(this.noPathFoundStrategy==="RETRY"?this.noPathFoundRetryable.retry(e,()=>this.calcShortestPath()):this.noPathFoundStrategy==="STOP"&&this.stop("NO_PATH_FOUND")),this.updatePosOnPath(),this.isBlocking(this.nextTileOnPath()?.position,this.character?.getNextTilePos().layer)?this.applyPathBlockedStrategy(e):this.pathBlockedWaitElapsed=0,this.hasArrived()?(this.stop("SUCCESS"),this.existsDistToTarget()&&this.turnTowardsTarget()):this.isBlocking(this.nextTileOnPath()?.position,this.character?.getNextTilePos().layer)||this.moveCharOnPath())}finishedObs(){return this.finished$}getInfo(){return{type:"Target",state:{pathAhead:this.shortestPath.slice(this.posOnPath).map(e=>G.fromInternal(e))},config:{algorithm:this.shortestPathAlgorithm,ignoreBlockedTarget:this.ignoreBlockedTarget,distance:this.distance,targetPos:G.fromInternal(this.targetPos),noPathFoundStrategy:this.noPathFoundStrategy,pathBlockedStrategy:this.pathBlockedStrategy,noPathFoundRetryBackoffMs:this.noPathFoundRetryable.getBackoffMs(),noPathFoundMaxRetries:this.noPathFoundRetryable.getMaxRetries()}}}resultToReason(e){switch(e){case"SUCCESS":return"Successfully arrived.";case"MOVEMENT_TERMINATED":return"Movement of character has been replaced before destination was reached.";case"PATH_BLOCKED":return"PathBlockedStrategy STOP: Path blocked.";case"NO_PATH_FOUND_MAX_RETRIES_EXCEEDED":return`NoPathFoundStrategy RETRY: Maximum retries of ${this.noPathFoundRetryable.getMaxRetries()} exceeded.`;case"NO_PATH_FOUND":return"NoPathFoundStrategy STOP: No path found.";case"PATH_BLOCKED_MAX_RETRIES_EXCEEDED":return`PathBlockedStrategy RETRY: Maximum retries of ${this.pathBlockedRetryable.getMaxRetries()} exceeded.`;case"PATH_BLOCKED_WAIT_TIMEOUT":return`PathBlockedStrategy WAIT: Wait timeout of ${this.pathBlockedWaitTimeoutMs}ms exceeded.`}}applyPathBlockedStrategy(e){this.pathBlockedStrategy==="RETRY"?this.pathBlockedRetryable.retry(e,()=>{let t=this.getShortestPath();t.path.length>0&&this.calcShortestPath(t)}):this.pathBlockedStrategy==="STOP"?this.stop("PATH_BLOCKED"):this.pathBlockedStrategy==="WAIT"&&this.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=e,this.pathBlockedWaitElapsed>=this.pathBlockedWaitTimeoutMs&&this.stop("PATH_BLOCKED_WAIT_TIMEOUT"))}moveCharOnPath(){let e=this.nextTileOnPath();if(!e)return;let t=this.getDir(this.character.getNextTilePos().position,e.position);this.character.move(t)}nextTileOnPath(){return this.shortestPath[this.posOnPath+1]}stop(e){this.finished$.next({position:this.character.getTilePos().position,result:e,description:this.resultToReason(e),layer:this.character.getTilePos().layer}),this.finished$.complete(),this.stopped=!0}turnTowardsTarget(){let e=this.shortestPath[this.posOnPath+1],t=this.getDir(this.character.getNextTilePos().position,e.position);this.character.turnTowards(t)}existsDistToTarget(){return this.posOnPath=this.shortestPath.length-1}updatePosOnPath(){let e=this.shortestPath[this.posOnPath];for(;this.posOnPath0)return{path:u,distOffset:l}}return this.noPathFoundStrategy=this.noPathFoundAlternativeTargetsFallbackStrategy||"STOP",this.getShortestPath()}}return{path:t,distOffset:0}}pathToAlternativeTarget(e,t){let i=t.findShortestPath(this.character.getNextTilePos(),e,this.getPathfindingOptions()).path,n=this.distanceUtils.distance(e.position,this.targetPos.position);return{path:i,distOffset:n}}getDir(e,t){return this.tilemap.fromMapDirection(this.distanceUtils.direction(e,t))}};var O4=Object.create,N1=Object.defineProperty,T4=Object.getOwnPropertyDescriptor,S4=Object.getOwnPropertyNames,C4=Object.getPrototypeOf,A4=Object.prototype.hasOwnProperty,E4=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),q4=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of S4(e))!A4.call(r,n)&&n!==t&&N1(r,n,{get:()=>e[n],enumerable:!(i=T4(e,n))||i.enumerable});return r},_m=(r,e,t)=>(t=r!=null?O4(C4(r)):{},q4(e||!r||!r.__esModule?N1(t,"default",{value:r,enumerable:!0}):t,r)),Pm=E4((r,e)=>{(function(){var t,i="4.17.21",n=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",p=500,v="__lodash_placeholder__",b=1,T=2,S=4,q=1,M=2,j=1,D=2,V=4,Y=8,ie=16,pe=32,ke=64,pt=128,Wo=256,Wf=512,B1=30,H1="...",$1=800,Y1=16,Tm=1,Q1=2,K1=3,Ri=1/0,Yr=9007199254740991,X1=17976931348623157e292,Na=NaN,ar=4294967295,J1=ar-1,Z1=ar>>>1,eO=[["ary",pt],["bind",j],["bindKey",D],["curry",Y],["curryRight",ie],["flip",Wf],["partial",pe],["partialRight",ke],["rearg",Wo]],vn="[object Arguments]",Wa="[object Array]",tO="[object AsyncFunction]",Uo="[object Boolean]",Go="[object Date]",rO="[object DOMException]",Ua="[object Error]",Ga="[object Function]",Sm="[object GeneratorFunction]",Bt="[object Map]",Bo="[object Number]",iO="[object Null]",qr="[object Object]",Cm="[object Promise]",nO="[object Proxy]",Ho="[object RegExp]",Ht="[object Set]",$o="[object String]",Ba="[object Symbol]",oO="[object Undefined]",Yo="[object WeakMap]",aO="[object WeakSet]",Qo="[object ArrayBuffer]",mn="[object DataView]",Uf="[object Float32Array]",Gf="[object Float64Array]",Bf="[object Int8Array]",Hf="[object Int16Array]",$f="[object Int32Array]",Yf="[object Uint8Array]",Qf="[object Uint8ClampedArray]",Kf="[object Uint16Array]",Xf="[object Uint32Array]",sO=/\b__p \+= '';/g,uO=/\b(__p \+=) '' \+/g,cO=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Am=/&(?:amp|lt|gt|quot|#39);/g,Em=/[&<>"']/g,lO=RegExp(Am.source),fO=RegExp(Em.source),hO=/<%-([\s\S]+?)%>/g,pO=/<%([\s\S]+?)%>/g,qm=/<%=([\s\S]+?)%>/g,dO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vO=/^\w*$/,mO=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jf=/[\\^$.*+?()[\]{}|]/g,yO=RegExp(Jf.source),Zf=/^\s+/,gO=/\s/,bO=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_O=/\{\n\/\* \[wrapped with (.+)\] \*/,PO=/,? & /,wO=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,OO=/[()=,{}\[\]\/\s]/,TO=/\\(\\)?/g,SO=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,xm=/\w*$/,CO=/^[-+]0x[0-9a-f]+$/i,AO=/^0b[01]+$/i,EO=/^\[object .+?Constructor\]$/,qO=/^0o[0-7]+$/i,xO=/^(?:0|[1-9]\d*)$/,MO=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ha=/($^)/,LO=/['\n\r\u2028\u2029\\]/g,$a="\\ud800-\\udfff",jO="\\u0300-\\u036f",IO="\\ufe20-\\ufe2f",kO="\\u20d0-\\u20ff",Mm=jO+IO+kO,Lm="\\u2700-\\u27bf",jm="a-z\\xdf-\\xf6\\xf8-\\xff",FO="\\xac\\xb1\\xd7\\xf7",DO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",RO="\\u2000-\\u206f",zO=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Im="A-Z\\xc0-\\xd6\\xd8-\\xde",km="\\ufe0e\\ufe0f",Fm=FO+DO+RO+zO,eh="['\u2019]",VO="["+$a+"]",Dm="["+Fm+"]",Ya="["+Mm+"]",Rm="\\d+",NO="["+Lm+"]",zm="["+jm+"]",Vm="[^"+$a+Fm+Rm+Lm+jm+Im+"]",th="\\ud83c[\\udffb-\\udfff]",WO="(?:"+Ya+"|"+th+")",Nm="[^"+$a+"]",rh="(?:\\ud83c[\\udde6-\\uddff]){2}",ih="[\\ud800-\\udbff][\\udc00-\\udfff]",yn="["+Im+"]",Wm="\\u200d",Um="(?:"+zm+"|"+Vm+")",UO="(?:"+yn+"|"+Vm+")",Gm="(?:"+eh+"(?:d|ll|m|re|s|t|ve))?",Bm="(?:"+eh+"(?:D|LL|M|RE|S|T|VE))?",Hm=WO+"?",$m="["+km+"]?",GO="(?:"+Wm+"(?:"+[Nm,rh,ih].join("|")+")"+$m+Hm+")*",BO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",HO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ym=$m+Hm+GO,$O="(?:"+[NO,rh,ih].join("|")+")"+Ym,YO="(?:"+[Nm+Ya+"?",Ya,rh,ih,VO].join("|")+")",QO=RegExp(eh,"g"),KO=RegExp(Ya,"g"),nh=RegExp(th+"(?="+th+")|"+YO+Ym,"g"),XO=RegExp([yn+"?"+zm+"+"+Gm+"(?="+[Dm,yn,"$"].join("|")+")",UO+"+"+Bm+"(?="+[Dm,yn+Um,"$"].join("|")+")",yn+"?"+Um+"+"+Gm,yn+"+"+Bm,HO,BO,Rm,$O].join("|"),"g"),JO=RegExp("["+Wm+$a+Mm+km+"]"),ZO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eT=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tT=-1,ye={};ye[Uf]=ye[Gf]=ye[Bf]=ye[Hf]=ye[$f]=ye[Yf]=ye[Qf]=ye[Kf]=ye[Xf]=!0,ye[vn]=ye[Wa]=ye[Qo]=ye[Uo]=ye[mn]=ye[Go]=ye[Ua]=ye[Ga]=ye[Bt]=ye[Bo]=ye[qr]=ye[Ho]=ye[Ht]=ye[$o]=ye[Yo]=!1;var ve={};ve[vn]=ve[Wa]=ve[Qo]=ve[mn]=ve[Uo]=ve[Go]=ve[Uf]=ve[Gf]=ve[Bf]=ve[Hf]=ve[$f]=ve[Bt]=ve[Bo]=ve[qr]=ve[Ho]=ve[Ht]=ve[$o]=ve[Ba]=ve[Yf]=ve[Qf]=ve[Kf]=ve[Xf]=!0,ve[Ua]=ve[Ga]=ve[Yo]=!1;var rT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},iT={"&":"&","<":"<",">":">",'"':""","'":"'"},nT={"&":"&","<":"<",">":">",""":'"',"'":"'"},oT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},aT=parseFloat,sT=parseInt,Qm=typeof global=="object"&&global&&global.Object===Object&&global,uT=typeof self=="object"&&self&&self.Object===Object&&self,Ne=Qm||uT||Function("return this")(),oh=typeof r=="object"&&r&&!r.nodeType&&r,zi=oh&&typeof e=="object"&&e&&!e.nodeType&&e,Km=zi&&zi.exports===oh,ah=Km&&Qm.process,kt=function(){try{var C=zi&&zi.require&&zi.require("util").types;return C||ah&&ah.binding&&ah.binding("util")}catch{}}(),Xm=kt&&kt.isArrayBuffer,Jm=kt&&kt.isDate,Zm=kt&&kt.isMap,ey=kt&&kt.isRegExp,ty=kt&&kt.isSet,ry=kt&&kt.isTypedArray;function Tt(C,L,x){switch(x.length){case 0:return C.call(L);case 1:return C.call(L,x[0]);case 2:return C.call(L,x[0],x[1]);case 3:return C.call(L,x[0],x[1],x[2])}return C.apply(L,x)}function cT(C,L,x,N){for(var Q=-1,se=C==null?0:C.length;++Q-1}function sh(C,L,x){for(var N=-1,Q=C==null?0:C.length;++N-1;);return x}function ly(C,L){for(var x=C.length;x--&&gn(L,C[x],0)>-1;);return x}function gT(C,L){for(var x=C.length,N=0;x--;)C[x]===L&&++N;return N}var bT=fh(rT),_T=fh(iT);function PT(C){return"\\"+oT[C]}function wT(C,L){return C==null?t:C[L]}function bn(C){return JO.test(C)}function OT(C){return ZO.test(C)}function TT(C){for(var L,x=[];!(L=C.next()).done;)x.push(L.value);return x}function vh(C){var L=-1,x=Array(C.size);return C.forEach(function(N,Q){x[++L]=[Q,N]}),x}function fy(C,L){return function(x){return C(L(x))}}function Xr(C,L){for(var x=-1,N=C.length,Q=0,se=[];++x-1}function fS(o,s){var c=this.__data__,f=hs(c,o);return f<0?(++this.size,c.push([o,s])):c[f][1]=s,this}xr.prototype.clear=sS,xr.prototype.delete=uS,xr.prototype.get=cS,xr.prototype.has=lS,xr.prototype.set=fS;function Mr(o){var s=-1,c=o==null?0:o.length;for(this.clear();++s=s?o:s)),o}function zt(o,s,c,f,d,g){var P,O=s&b,A=s&T,I=s&S;if(c&&(P=d?c(o,f,d,g):c(o)),P!==t)return P;if(!we(o))return o;var k=K(o);if(k){if(P=vC(o),!O)return dt(o,P)}else{var F=rt(o),R=F==Ga||F==Sm;if(ni(o))return $y(o,O);if(F==qr||F==vn||R&&!d){if(P=A||R?{}:hg(o),!O)return A?nC(o,AS(P,o)):iC(o,Oy(P,o))}else{if(!ve[F])return d?o:{};P=mC(o,F,O)}}g||(g=new Yt);var W=g.get(o);if(W)return W;g.set(o,P),Ng(o)?o.forEach(function($){P.add(zt($,s,c,$,o,g))}):zg(o)&&o.forEach(function($,te){P.set(te,zt($,s,c,te,o,g))});var H=I?A?Nh:Vh:A?mt:We,Z=k?t:H(o);return Ft(Z||o,function($,te){Z&&(te=$,$=o[te]),ra(P,te,zt($,s,c,te,o,g))}),P}function ES(o){var s=We(o);return function(c){return Ty(c,o,s)}}function Ty(o,s,c){var f=c.length;if(o==null)return!f;for(o=de(o);f--;){var d=c[f],g=s[d],P=o[d];if(P===t&&!(d in o)||!g(P))return!1}return!0}function Sy(o,s,c){if(typeof o!="function")throw new Dt(u);return ca(function(){o.apply(t,c)},s)}function ia(o,s,c,f){var d=-1,g=Qa,P=!0,O=o.length,A=[],I=s.length;if(!O)return A;c&&(s=ge(s,St(c))),f?(g=sh,P=!1):s.length>=n&&(g=Ko,P=!1,s=new Wi(s));e:for(;++dd?0:d+c),f=f===t||f>d?d:J(f),f<0&&(f+=d),f=c>f?0:Ug(f);c0&&c(O)?s>1?Qe(O,s-1,c,f,d):Kr(d,O):f||(d[d.length]=O)}return d}var wh=Zy(),Ey=Zy(!0);function sr(o,s){return o&&wh(o,s,We)}function Oh(o,s){return o&&Ey(o,s,We)}function ds(o,s){return Qr(s,function(c){return Fr(o[c])})}function Gi(o,s){s=ri(s,o);for(var c=0,f=s.length;o!=null&&cs}function MS(o,s){return o!=null&&ce.call(o,s)}function LS(o,s){return o!=null&&s in de(o)}function jS(o,s,c){return o>=tt(s,c)&&o=120&&k.length>=120)?new Wi(P&&k):t}k=o[0];var F=-1,R=O[0];e:for(;++F-1;)O!==o&&os.call(O,A,1),os.call(o,A,1);return o}function zy(o,s){for(var c=o?s.length:0,f=c-1;c--;){var d=s[c];if(c==f||d!==g){var g=d;kr(d)?os.call(o,d,1):jh(o,d)}}return o}function xh(o,s){return o+us(by()*(s-o+1))}function HS(o,s,c,f){for(var d=-1,g=De(ss((s-o)/(c||1)),0),P=x(g);g--;)P[f?g:++d]=o,o+=c;return P}function Mh(o,s){var c="";if(!o||s<1||s>Yr)return c;do s%2&&(c+=o),s=us(s/2),s&&(o+=o);while(s);return c}function ee(o,s){return Yh(vg(o,s,yt),o+"")}function $S(o){return wy(qn(o))}function YS(o,s){var c=qn(o);return Ss(c,Ui(s,0,c.length))}function aa(o,s,c,f){if(!we(o))return o;s=ri(s,o);for(var d=-1,g=s.length,P=g-1,O=o;O!=null&&++dd?0:d+s),c=c>d?d:c,c<0&&(c+=d),d=s>c?0:c-s>>>0,s>>>=0;for(var g=x(d);++f>>1,P=o[g];P!==null&&!At(P)&&(c?P<=s:P=n){var I=s?null:uC(o);if(I)return Xa(I);P=!1,d=Ko,A=new Wi}else A=s?[]:O;e:for(;++f=f?o:Vt(o,s,c)}var Hy=zT||function(o){return Ne.clearTimeout(o)};function $y(o,s){if(s)return o.slice();var c=o.length,f=dy?dy(c):new o.constructor(c);return o.copy(f),f}function Dh(o){var s=new o.constructor(o.byteLength);return new is(s).set(new is(o)),s}function ZS(o,s){var c=s?Dh(o.buffer):o.buffer;return new o.constructor(c,o.byteOffset,o.byteLength)}function eC(o){var s=new o.constructor(o.source,xm.exec(o));return s.lastIndex=o.lastIndex,s}function tC(o){return ta?de(ta.call(o)):{}}function Yy(o,s){var c=s?Dh(o.buffer):o.buffer;return new o.constructor(c,o.byteOffset,o.length)}function Qy(o,s){if(o!==s){var c=o!==t,f=o===null,d=o===o,g=At(o),P=s!==t,O=s===null,A=s===s,I=At(s);if(!O&&!I&&!g&&o>s||g&&P&&A&&!O&&!I||f&&P&&A||!c&&A||!d)return 1;if(!f&&!g&&!I&&o=O)return A;var I=c[f];return A*(I=="desc"?-1:1)}}return o.index-s.index}function Ky(o,s,c,f){for(var d=-1,g=o.length,P=c.length,O=-1,A=s.length,I=De(g-P,0),k=x(A+I),F=!f;++O1?c[d-1]:t,P=d>2?c[2]:t;for(g=o.length>3&&typeof g=="function"?(d--,g):t,P&&st(c[0],c[1],P)&&(g=d<3?t:g,d=1),s=de(s);++f-1?d[g?s[P]:P]:t}}function rg(o){return Ir(function(s){var c=s.length,f=c,d=Rt.prototype.thru;for(o&&s.reverse();f--;){var g=s[f];if(typeof g!="function")throw new Dt(u);if(d&&!P&&Os(g)=="wrapper")var P=new Rt([],!0)}for(f=P?f:c;++f1&&ne.reverse(),k&&AO))return!1;var I=g.get(o),k=g.get(s);if(I&&k)return I==s&&k==o;var F=-1,R=!0,W=c&M?new Wi:t;for(g.set(o,s),g.set(s,o);++F1?"& ":"")+s[f],s=s.join(c>2?", ":" "),o.replace(bO,`{ /* [wrapped with `+s+`] */ `)}function gC(o){return K(o)||$i(o)||!!(yy&&o&&o[yy])}function kr(o,s){var c=typeof o;return s=s??Yr,!!s&&(c=="number"||c!="symbol"&&xO.test(o))&&o>-1&&o%1==0&&o0){if(++s>=$1)return arguments[0]}else s=0;return o.apply(t,arguments)}}function Ss(o,s){var c=-1,f=o.length,d=f-1;for(s=s===t?f:s;++c1?o[s-1]:t;return c=typeof c=="function"?(o.pop(),c):t,Ag(o,c)});function Eg(o){var s=y(o);return s.__chain__=!0,s}function qA(o,s){return s(o),o}function Cs(o,s){return s(o)}var xA=Ir(function(o){var s=o.length,c=s?o[0]:0,f=this.__wrapped__,d=function(g){return Ph(g,o)};return s>1||this.__actions__.length||!(f instanceof re)||!kr(c)?this.thru(d):(f=f.slice(c,+c+(s?1:0)),f.__actions__.push({func:Cs,args:[d],thisArg:t}),new Rt(f,this.__chain__).thru(function(g){return s&&!g.length&&g.push(t),g}))});function MA(){return Eg(this)}function LA(){return new Rt(this.value(),this.__chain__)}function jA(){this.__values__===t&&(this.__values__=Wg(this.value()));var o=this.__index__>=this.__values__.length,s=o?t:this.__values__[this.__index__++];return{done:o,value:s}}function IA(){return this}function kA(o){for(var s,c=this;c instanceof fs;){var f=Pg(c);f.__index__=0,f.__values__=t,s?d.__wrapped__=f:s=f;var d=f;c=c.__wrapped__}return d.__wrapped__=o,s}function FA(){var o=this.__wrapped__;if(o instanceof re){var s=o;return this.__actions__.length&&(s=new re(this)),s=s.reverse(),s.__actions__.push({func:Cs,args:[Qh],thisArg:t}),new Rt(s,this.__chain__)}return this.thru(Qh)}function DA(){return Gy(this.__wrapped__,this.__actions__)}var RA=gs(function(o,s,c){ce.call(o,c)?++o[c]:Lr(o,c,1)});function zA(o,s,c){var f=K(o)?iy:qS;return c&&st(o,s,c)&&(s=t),f(o,B(s,3))}function VA(o,s){var c=K(o)?Qr:Ay;return c(o,B(s,3))}var NA=tg(wg),WA=tg(Og);function UA(o,s){return Qe(As(o,s),1)}function GA(o,s){return Qe(As(o,s),Ri)}function BA(o,s,c){return c=c===t?1:J(c),Qe(As(o,s),c)}function qg(o,s){var c=K(o)?Ft:ei;return c(o,B(s,3))}function xg(o,s){var c=K(o)?lT:Cy;return c(o,B(s,3))}var HA=gs(function(o,s,c){ce.call(o,c)?o[c].push(s):Lr(o,c,[s])});function $A(o,s,c,f){o=vt(o)?o:qn(o),c=c&&!f?J(c):0;var d=o.length;return c<0&&(c=De(d+c,0)),Ls(o)?c<=d&&o.indexOf(s,c)>-1:!!d&&gn(o,s,c)>-1}var YA=ee(function(o,s,c){var f=-1,d=typeof s=="function",g=vt(o)?x(o.length):[];return ei(o,function(P){g[++f]=d?Tt(s,P,c):na(P,s,c)}),g}),QA=gs(function(o,s,c){Lr(o,c,s)});function As(o,s){var c=K(o)?ge:jy;return c(o,B(s,3))}function KA(o,s,c,f){return o==null?[]:(K(s)||(s=s==null?[]:[s]),c=f?t:c,K(c)||(c=c==null?[]:[c]),Dy(o,s,c))}var XA=gs(function(o,s,c){o[c?0:1].push(s)},function(){return[[],[]]});function JA(o,s,c){var f=K(o)?uh:sy,d=arguments.length<3;return f(o,B(s,4),c,d,ei)}function ZA(o,s,c){var f=K(o)?fT:sy,d=arguments.length<3;return f(o,B(s,4),c,d,Cy)}function eE(o,s){var c=K(o)?Qr:Ay;return c(o,xs(B(s,3)))}function tE(o){var s=K(o)?wy:$S;return s(o)}function rE(o,s,c){(c?st(o,s,c):s===t)?s=1:s=J(s);var f=K(o)?TS:YS;return f(o,s)}function iE(o){var s=K(o)?SS:KS;return s(o)}function nE(o){if(o==null)return 0;if(vt(o))return Ls(o)?_n(o):o.length;var s=rt(o);return s==Bt||s==Ht?o.size:Ah(o).length}function oE(o,s,c){var f=K(o)?ch:XS;return c&&st(o,s,c)&&(s=t),f(o,B(s,3))}var aE=ee(function(o,s){if(o==null)return[];var c=s.length;return c>1&&st(o,s[0],s[1])?s=[]:c>2&&st(s[0],s[1],s[2])&&(s=[s[0]]),Dy(o,Qe(s,1),[])}),Es=VT||function(){return Ne.Date.now()};function sE(o,s){if(typeof s!="function")throw new Dt(u);return o=J(o),function(){if(--o<1)return s.apply(this,arguments)}}function Mg(o,s,c){return s=c?t:s,s=o&&s==null?o.length:s,jr(o,pt,t,t,t,t,s)}function Lg(o,s){var c;if(typeof s!="function")throw new Dt(u);return o=J(o),function(){return--o>0&&(c=s.apply(this,arguments)),o<=1&&(s=t),c}}var Xh=ee(function(o,s,c){var f=j;if(c.length){var d=Xr(c,An(Xh));f|=pe}return jr(o,f,s,c,d)}),jg=ee(function(o,s,c){var f=j|D;if(c.length){var d=Xr(c,An(jg));f|=pe}return jr(s,f,o,c,d)});function Ig(o,s,c){s=c?t:s;var f=jr(o,Y,t,t,t,t,t,s);return f.placeholder=Ig.placeholder,f}function kg(o,s,c){s=c?t:s;var f=jr(o,ie,t,t,t,t,t,s);return f.placeholder=kg.placeholder,f}function Fg(o,s,c){var f,d,g,P,O,A,I=0,k=!1,F=!1,R=!0;if(typeof o!="function")throw new Dt(u);s=Wt(s)||0,we(c)&&(k=!!c.leading,F="maxWait"in c,g=F?De(Wt(c.maxWait)||0,s):g,R="trailing"in c?!!c.trailing:R);function W(Ee){var Kt=f,Rr=d;return f=d=t,I=Ee,P=o.apply(Rr,Kt),P}function H(Ee){return I=Ee,O=ca(te,s),k?W(Ee):P}function Z(Ee){var Kt=Ee-A,Rr=Ee-I,tb=s-Kt;return F?tt(tb,g-Rr):tb}function $(Ee){var Kt=Ee-A,Rr=Ee-I;return A===t||Kt>=s||Kt<0||F&&Rr>=g}function te(){var Ee=Es();if($(Ee))return ne(Ee);O=ca(te,Z(Ee))}function ne(Ee){return O=t,R&&f?W(Ee):(f=d=t,P)}function Et(){O!==t&&Hy(O),I=0,f=A=d=O=t}function ut(){return O===t?P:ne(Es())}function qt(){var Ee=Es(),Kt=$(Ee);if(f=arguments,d=this,A=Ee,Kt){if(O===t)return H(A);if(F)return Hy(O),O=ca(te,s),W(A)}return O===t&&(O=ca(te,s)),P}return qt.cancel=Et,qt.flush=ut,qt}var uE=ee(function(o,s){return Sy(o,1,s)}),cE=ee(function(o,s,c){return Sy(o,Wt(s)||0,c)});function lE(o){return jr(o,Wf)}function qs(o,s){if(typeof o!="function"||s!=null&&typeof s!="function")throw new Dt(u);var c=function(){var f=arguments,d=s?s.apply(this,f):f[0],g=c.cache;if(g.has(d))return g.get(d);var P=o.apply(this,f);return c.cache=g.set(d,P)||g,P};return c.cache=new(qs.Cache||Mr),c}qs.Cache=Mr;function xs(o){if(typeof o!="function")throw new Dt(u);return function(){var s=arguments;switch(s.length){case 0:return!o.call(this);case 1:return!o.call(this,s[0]);case 2:return!o.call(this,s[0],s[1]);case 3:return!o.call(this,s[0],s[1],s[2])}return!o.apply(this,s)}}function fE(o){return Lg(2,o)}var hE=JS(function(o,s){s=s.length==1&&K(s[0])?ge(s[0],St(B())):ge(Qe(s,1),St(B()));var c=s.length;return ee(function(f){for(var d=-1,g=tt(f.length,c);++d=s}),$i=xy(function(){return arguments}())?xy:function(o){return Se(o)&&ce.call(o,"callee")&&!my.call(o,"callee")},K=x.isArray,AE=Xm?St(Xm):kS;function vt(o){return o!=null&&Ms(o.length)&&!Fr(o)}function Ae(o){return Se(o)&&vt(o)}function EE(o){return o===!0||o===!1||Se(o)&&at(o)==Uo}var ni=WT||cp,qE=Jm?St(Jm):FS;function xE(o){return Se(o)&&o.nodeType===1&&!la(o)}function ME(o){if(o==null)return!0;if(vt(o)&&(K(o)||typeof o=="string"||typeof o.splice=="function"||ni(o)||En(o)||$i(o)))return!o.length;var s=rt(o);if(s==Bt||s==Ht)return!o.size;if(ua(o))return!Ah(o).length;for(var c in o)if(ce.call(o,c))return!1;return!0}function LE(o,s){return oa(o,s)}function jE(o,s,c){c=typeof c=="function"?c:t;var f=c?c(o,s):t;return f===t?oa(o,s,t,c):!!f}function Zh(o){if(!Se(o))return!1;var s=at(o);return s==Ua||s==rO||typeof o.message=="string"&&typeof o.name=="string"&&!la(o)}function IE(o){return typeof o=="number"&&gy(o)}function Fr(o){if(!we(o))return!1;var s=at(o);return s==Ga||s==Sm||s==tO||s==nO}function Rg(o){return typeof o=="number"&&o==J(o)}function Ms(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=Yr}function we(o){var s=typeof o;return o!=null&&(s=="object"||s=="function")}function Se(o){return o!=null&&typeof o=="object"}var zg=Zm?St(Zm):RS;function kE(o,s){return o===s||Ch(o,s,Uh(s))}function FE(o,s,c){return c=typeof c=="function"?c:t,Ch(o,s,Uh(s),c)}function DE(o){return Vg(o)&&o!=+o}function RE(o){if(PC(o))throw new Q(a);return My(o)}function zE(o){return o===null}function VE(o){return o==null}function Vg(o){return typeof o=="number"||Se(o)&&at(o)==Bo}function la(o){if(!Se(o)||at(o)!=qr)return!1;var s=ns(o);if(s===null)return!0;var c=ce.call(s,"constructor")&&s.constructor;return typeof c=="function"&&c instanceof c&&es.call(c)==FT}var ep=ey?St(ey):zS;function NE(o){return Rg(o)&&o>=-Yr&&o<=Yr}var Ng=ty?St(ty):VS;function Ls(o){return typeof o=="string"||!K(o)&&Se(o)&&at(o)==$o}function At(o){return typeof o=="symbol"||Se(o)&&at(o)==Ba}var En=ry?St(ry):NS;function WE(o){return o===t}function UE(o){return Se(o)&&rt(o)==Yo}function GE(o){return Se(o)&&at(o)==aO}var BE=ws(Eh),HE=ws(function(o,s){return o<=s});function Wg(o){if(!o)return[];if(vt(o))return Ls(o)?$t(o):dt(o);if(Xo&&o[Xo])return TT(o[Xo]());var s=rt(o),c=s==Bt?vh:s==Ht?Xa:qn;return c(o)}function Dr(o){if(!o)return o===0?o:0;if(o=Wt(o),o===Ri||o===-Ri){var s=o<0?-1:1;return s*X1}return o===o?o:0}function J(o){var s=Dr(o),c=s%1;return s===s?c?s-c:s:0}function Ug(o){return o?Ui(J(o),0,ar):0}function Wt(o){if(typeof o=="number")return o;if(At(o))return Na;if(we(o)){var s=typeof o.valueOf=="function"?o.valueOf():o;o=we(s)?s+"":s}if(typeof o!="string")return o===0?o:+o;o=uy(o);var c=AO.test(o);return c||qO.test(o)?sT(o.slice(2),c?2:8):CO.test(o)?Na:+o}function Gg(o){return ur(o,mt(o))}function $E(o){return o?Ui(J(o),-Yr,Yr):o===0?o:0}function ue(o){return o==null?"":Ct(o)}var YE=Sn(function(o,s){if(ua(s)||vt(s)){ur(s,We(s),o);return}for(var c in s)ce.call(s,c)&&ra(o,c,s[c])}),Bg=Sn(function(o,s){ur(s,mt(s),o)}),js=Sn(function(o,s,c,f){ur(s,mt(s),o,f)}),QE=Sn(function(o,s,c,f){ur(s,We(s),o,f)}),KE=Ir(Ph);function XE(o,s){var c=Tn(o);return s==null?c:Oy(c,s)}var JE=ee(function(o,s){o=de(o);var c=-1,f=s.length,d=f>2?s[2]:t;for(d&&st(s[0],s[1],d)&&(f=1);++c1),g}),ur(o,Nh(o),c),f&&(c=zt(c,b|T|S,cC));for(var d=s.length;d--;)jh(c,s[d]);return c});function mq(o,s){return $g(o,xs(B(s)))}var yq=Ir(function(o,s){return o==null?{}:GS(o,s)});function $g(o,s){if(o==null)return{};var c=ge(Nh(o),function(f){return[f]});return s=B(s),Ry(o,c,function(f,d){return s(f,d[0])})}function gq(o,s,c){s=ri(s,o);var f=-1,d=s.length;for(d||(d=1,o=t);++fs){var f=o;o=s,s=f}if(c||o%1||s%1){var d=by();return tt(o+d*(s-o+aT("1e-"+((d+"").length-1))),s)}return xh(o,s)}var qq=Cn(function(o,s,c){return s=s.toLowerCase(),o+(c?Kg(s):s)});function Kg(o){return ip(ue(o).toLowerCase())}function Xg(o){return o=ue(o),o&&o.replace(MO,bT).replace(KO,"")}function xq(o,s,c){o=ue(o),s=Ct(s);var f=o.length;c=c===t?f:Ui(J(c),0,f);var d=c;return c-=s.length,c>=0&&o.slice(c,d)==s}function Mq(o){return o=ue(o),o&&fO.test(o)?o.replace(Em,_T):o}function Lq(o){return o=ue(o),o&&yO.test(o)?o.replace(Jf,"\\$&"):o}var jq=Cn(function(o,s,c){return o+(c?"-":"")+s.toLowerCase()}),Iq=Cn(function(o,s,c){return o+(c?" ":"")+s.toLowerCase()}),kq=eg("toLowerCase");function Fq(o,s,c){o=ue(o),s=J(s);var f=s?_n(o):0;if(!s||f>=s)return o;var d=(s-f)/2;return Ps(us(d),c)+o+Ps(ss(d),c)}function Dq(o,s,c){o=ue(o),s=J(s);var f=s?_n(o):0;return s&&f>>0,c?(o=ue(o),o&&(typeof s=="string"||s!=null&&!ep(s))&&(s=Ct(s),!s&&bn(o))?ii($t(o),0,c):o.split(s,c)):[]}var Gq=Cn(function(o,s,c){return o+(c?" ":"")+ip(s)});function Bq(o,s,c){return o=ue(o),c=c==null?0:Ui(J(c),0,o.length),s=Ct(s),o.slice(c,c+s.length)==s}function Hq(o,s,c){var f=y.templateSettings;c&&st(o,s,c)&&(s=t),o=ue(o),s=js({},s,f,sg);var d=js({},s.imports,f.imports,sg),g=We(d),P=dh(d,g),O,A,I=0,k=s.interpolate||Ha,F="__p += '",R=mh((s.escape||Ha).source+"|"+k.source+"|"+(k===qm?SO:Ha).source+"|"+(s.evaluate||Ha).source+"|$","g"),W="//# sourceURL="+(ce.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tT+"]")+` `;o.replace(R,function($,te,ne,Et,ut,qt){return ne||(ne=Et),F+=o.slice(I,qt).replace(LO,PT),te&&(O=!0,F+=`' + __e(`+te+`) + '`),ut&&(A=!0,F+=`'; `+ut+`; __p += '`),ne&&(F+=`' + ((__t = (`+ne+`)) == null ? '' : __t) + '`),I=qt+$.length,$}),F+=`'; `;var H=ce.call(s,"variable")&&s.variable;if(!H)F=`with (obj) { `+F+` } `;else if(OO.test(H))throw new Q(l);F=(A?F.replace(sO,""):F).replace(uO,"$1").replace(cO,"$1;"),F="function("+(H||"obj")+`) { `+(H?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(O?", __e = _.escape":"")+(A?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+F+`return __p }`;var Z=Zg(function(){return se(g,W+"return "+F).apply(t,P)});if(Z.source=F,Zh(Z))throw Z;return Z}function $q(o){return ue(o).toLowerCase()}function Yq(o){return ue(o).toUpperCase()}function Qq(o,s,c){if(o=ue(o),o&&(c||s===t))return uy(o);if(!o||!(s=Ct(s)))return o;var f=$t(o),d=$t(s),g=cy(f,d),P=ly(f,d)+1;return ii(f,g,P).join("")}function Kq(o,s,c){if(o=ue(o),o&&(c||s===t))return o.slice(0,hy(o)+1);if(!o||!(s=Ct(s)))return o;var f=$t(o),d=ly(f,$t(s))+1;return ii(f,0,d).join("")}function Xq(o,s,c){if(o=ue(o),o&&(c||s===t))return o.replace(Zf,"");if(!o||!(s=Ct(s)))return o;var f=$t(o),d=cy(f,$t(s));return ii(f,d).join("")}function Jq(o,s){var c=B1,f=H1;if(we(s)){var d="separator"in s?s.separator:d;c="length"in s?J(s.length):c,f="omission"in s?Ct(s.omission):f}o=ue(o);var g=o.length;if(bn(o)){var P=$t(o);g=P.length}if(c>=g)return o;var O=c-_n(f);if(O<1)return f;var A=P?ii(P,0,O).join(""):o.slice(0,O);if(d===t)return A+f;if(P&&(O+=A.length-O),ep(d)){if(o.slice(O).search(d)){var I,k=A;for(d.global||(d=mh(d.source,ue(xm.exec(d))+"g")),d.lastIndex=0;I=d.exec(k);)var F=I.index;A=A.slice(0,F===t?O:F)}}else if(o.indexOf(Ct(d),O)!=O){var R=A.lastIndexOf(d);R>-1&&(A=A.slice(0,R))}return A+f}function Zq(o){return o=ue(o),o&&lO.test(o)?o.replace(Am,ET):o}var ex=Cn(function(o,s,c){return o+(c?" ":"")+s.toUpperCase()}),ip=eg("toUpperCase");function Jg(o,s,c){return o=ue(o),s=c?t:s,s===t?OT(o)?MT(o):dT(o):o.match(s)||[]}var Zg=ee(function(o,s){try{return Tt(o,t,s)}catch(c){return Zh(c)?c:new Q(c)}}),tx=Ir(function(o,s){return Ft(s,function(c){c=cr(c),Lr(o,c,Xh(o[c],o))}),o});function rx(o){var s=o==null?0:o.length,c=B();return o=s?ge(o,function(f){if(typeof f[1]!="function")throw new Dt(u);return[c(f[0]),f[1]]}):[],ee(function(f){for(var d=-1;++dYr)return[];var c=ar,f=tt(o,ar);s=B(s),o-=ar;for(var d=ph(f,s);++c0||s<0)?new re(c):(o<0?c=c.takeRight(-o):o&&(c=c.drop(o)),s!==t&&(s=J(s),c=s<0?c.dropRight(-s):c.take(s-o)),c)},re.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},re.prototype.toArray=function(){return this.take(ar)},sr(re.prototype,function(o,s){var c=/^(?:filter|find|map|reject)|While$/.test(s),f=/^(?:head|last)$/.test(s),d=y[f?"take"+(s=="last"?"Right":""):s],g=f||/^find/.test(s);d&&(y.prototype[s]=function(){var P=this.__wrapped__,O=f?[1]:arguments,A=P instanceof re,I=O[0],k=A||K(P),F=function(te){var ne=d.apply(y,Kr([te],O));return f&&R?ne[0]:ne};k&&c&&typeof I=="function"&&I.length!=1&&(A=k=!1);var R=this.__chain__,W=!!this.__actions__.length,H=g&&!R,Z=A&&!W;if(!g&&k){P=Z?P:new re(this);var $=o.apply(P,O);return $.__actions__.push({func:Cs,args:[F],thisArg:t}),new Rt($,R)}return H&&Z?o.apply(this,O):($=this.thru(F),H?f?$.value()[0]:$.value():$)})}),Ft(["pop","push","shift","sort","splice","unshift"],function(o){var s=Ja[o],c=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",f=/^(?:pop|shift)$/.test(o);y.prototype[o]=function(){var d=arguments;if(f&&!this.__chain__){var g=this.value();return s.apply(K(g)?g:[],d)}return this[c](function(P){return s.apply(K(P)?P:[],d)})}}),sr(re.prototype,function(o,s){var c=y[s];if(c){var f=c.name+"";ce.call(On,f)||(On[f]=[]),On[f].push({name:s,func:c})}}),On[bs(t,D).name]=[{name:"wrapper",func:t}],re.prototype.clone=ZT,re.prototype.reverse=eS,re.prototype.value=tS,y.prototype.at=xA,y.prototype.chain=MA,y.prototype.commit=LA,y.prototype.next=jA,y.prototype.plant=kA,y.prototype.reverse=FA,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=DA,y.prototype.first=y.prototype.head,Xo&&(y.prototype[Xo]=IA),y},Jr=LT();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ne._=Jr,define(function(){return Jr})):zi?((zi.exports=Jr)._=Jr,oh._=Jr):Ne._=Jr}).call(r)}),W1=class extends Set{constructor(r,e=!1){super(r),this.valuesAsFlags=e}};function Ra(r){if(r instanceof Map)return Object.fromEntries([...r.entries()].map(([e,t])=>[e,Ra(t)]));if(r instanceof Set)return Array.from(r.values()).map(Ra);if(r instanceof W1)return{values:[...r.values()],valuesAsFlags:r.valuesAsFlags};if(typeof r=="object"){let e={};return Object.entries(r).forEach(([t,i])=>{e[t]=Ra(i)}),e}else return r}var yZ=_m(Pm(),1);var x4=_m(Pm(),1);function dn(r,e){if(typeof r!="object")throw new Error(`Cannot merge into non-object objectToMergeWith. Received: ${JSON.stringify(r)}`);if(typeof e!="object")throw new Error(`Cannot merge using non-object objectToMergeWith. Received: ${JSON.stringify(e)}`);let t=(0,x4.cloneDeep)(r);for(let[i,n]of Object.entries(e))typeof n!="object"||n instanceof Set||t[i]===void 0?t[i]=n:t[i]=dn(t[i],n);return t}function U1(r,e){if(!(r===void 0||typeof r!="object"))for(let t of Object.keys(r)){if(t===e)return r[t];let i=r[t];if(typeof i=="object"){let n=U1(i,e);if(n!==void 0)return n}}}var bm="@composite:",M4="@inherit:",L4=class{constructor(r,e,t){this.tiledClassToMembersMap=r,this.enumNameToValuesMap=e,this.parserOptions=t,this.memoiser=new Map}flattenMembers(r,e){return this.memoiser.has(r)?{[r]:this.memoiser.get(r)}:(this.memoiser.set(r,e.reduce((t,i)=>({...t,...this.flattenMemberProperty(i)}),{})),{[r]:this.memoiser.get(r)})}flattenMemberProperty(r){let e=r.propertyType??r.propertytype;if(r.type==="class"){if(!this.memoiser.has(e)){let n=this.tiledClassToMembersMap.get(e).reduce((a,u)=>dn(this.flattenMemberProperty(u),a),{});this.memoiser.set(e,n)}let t=this.memoiser.get(e),i=dn(t,this.flattenValue(r.value,t));return this.checkIfShouldFlatten(r.name)?i:{[r.name.replace(bm,"")]:i}}else return this.enumNameToValuesMap.has(e)?this.enumNameToValuesMap.get(e).valuesAsFlags?{[r.name]:new Set(r.value.split(",").filter(t=>t!==""))}:{[r.name]:r.value}:{[r.name]:r.value}}get memoisedFlattenedProperties(){return this.memoiser}flattenValue(r,e){return Object.entries(r).reduce((t,[i,n])=>{if(typeof n!="object")return U1(e,i)instanceof Set?dn({[i]:new Set(n.split(",").filter(a=>a!==""))},t):dn({[i]:n},t);if(this.checkIfShouldFlatten(i))return dn(this.flattenValue(n,e),t);{let a=i.replace(bm,"");return dn({[a]:this.flattenValue(n,e)},t)}},{})}checkIfShouldFlatten(r){return this.parserOptions?.defaultComposite===!0?r.startsWith(M4):!r.startsWith(bm)}},V1=_m(Pm(),1),j4=class{constructor(r){this.flattener=r}flattenPropertiesOnObject(r){return{...this.flattener.memoisedFlattenedProperties.get(r.class??r.type),...r.properties?.reduce((e,t)=>({...e,...this.flattener.flattenMemberProperty(t)}),{}),name:r.name,id:r.id,class:r.class??r.type??null,x:r.x,y:r.y}}flattenPropertiesOnTile(r){return{...this.flattener.memoisedFlattenedProperties.get(r.class??r.type),...r.properties?.reduce((e,t)=>({...e,...this.flattener.flattenMemberProperty(t)}),{}),id:r.id,class:r.class??r.type??null}}getCustomTypesMap(){return new Map([...this.flattener.memoisedFlattenedProperties.entries()].map(([r,e])=>[r,(0,V1.cloneDeep)(e)]))}getEnumsMap(){return new Map([...this.flattener.enumNameToValuesMap.entries()].map(([r,e])=>[r,(0,V1.cloneDeep)(e)]))}toJSON(){return JSON.stringify({customTypes:Ra(this.getCustomTypesMap()),enums:Ra(this.getEnumsMap())},null,4)}};function I4(r,e){let t=new Map(r.propertyTypes.filter(a=>a.type==="enum").map(a=>[a.name,new W1(a.values,a.valuesAsFlags)])),i=new Map(r.propertyTypes.filter(a=>a.type==="class").map(a=>[a.name,a.members])),n=new L4(i,t,e);return i.forEach((a,u)=>{n.flattenMembers(u,a)}),new j4(n)}var G1={parse:I4};var Di=class{constructor(e,t){this.phaserTile=e;this.tiledProject=t}getProperty(e){let t={};if(this.tiledProject){let n=G1.parse(this.tiledProject),a=this.getType();if(a){let u=n.getCustomTypesMap()?.get(a);if(u)for(let[l,h]of Object.entries(u))t[l]=h}}return this.phaserTile.properties[e]??t[e]}hasProperty(e){return this.getProperty(e)!=null}getType(){return this.phaserTile.tileset?.tileData[this.phaserTile.index-1]?.type}};var zo=class{constructor(e,t){this.phaserTilemapLayer=e;this.tiledProject=t}getName(){return this.phaserTilemapLayer.layer.name}getProperty(e){return this.phaserTilemapLayer.layer.properties?.find(n=>n.name==e)?.value}hasProperty(e){return this.getProperty(e)!=null}isCharLayer(){return this.hasProperty(Fo)}getData(){return this.phaserTilemapLayer.layer.data.map(e=>e.map(t=>new Di(t,this.tiledProject)))}};var za=class{constructor(e,t){this.phaserTilemap=e;this.tiledProject=t;for(let i of this.phaserTilemap.layers)if(i.tilemapLayer==null)throw new Error(`Error initializing tilemap. Layer '${i.name}' has no 'tilemapLayer'. This can happen if you call 'createLayer' with the wrong layer ID.`)}getTileWidth(){return this.phaserTilemap.tileWidth}getTileHeight(){return this.phaserTilemap.tileHeight}getWidth(){return this.phaserTilemap.width}getHeight(){return this.phaserTilemap.height}getOrientation(){return this.phaserTilemap.orientation==Phaser.Tilemaps.Orientation.ISOMETRIC.toString()?"isometric":"orthogonal"}getLayers(){return this.phaserTilemap.layers.map(e=>new zo(e.tilemapLayer,this.tiledProject))}hasTileAt(e,t,i){return!!this.phaserTilemap.hasTileAt(e,t,i)}getTileAt(e,t,i){let n=this.phaserTilemap.getTileAt(e,t,!1,i);if(n)return new Di(n,this.tiledProject)}};var Vf=class{constructor(e,t="orthogonal",i="ge_collide"){this.map=e;this.orientation=t;this.layerMap=new Map;this.layers=[];let n=-1,a=-1;Object.entries(e).map(([u,l])=>{let h=l.data[0]?.length,p=l.data.length;if(n!==-1&&n!==h||a!==-1&&a!==p)throw new Error("All tilemap layers must have the same dimensions.");n=h,a=p;let v=[];for(let T=0;T=0&&e=0&&t{if(!a.tiles)return!1;let u=a.firstgid??0;return!!a.tiles.find(h=>h.id+u===t)});if(!i)return;let n=i.tiles?.find(a=>a.id+(i.firstgid??0)===t);if(n?.properties)for(let a of n.properties)a.name&&(this.props[a.name]=a.value)}getProperty(e){return this.props[e]}hasProperty(e){return this.props[e]!==void 0}};var No=class{constructor(e,t){this.layer=t;this.data=[];if(this.data=[],this.layer.data)for(let i=0;i<(this.layer.height||0);i++){let n=[];for(let a=0;a<(this.layer.width||0);a++){let u=this.layer.data[i*(this.layer.width||0)+a];u!==void 0?n.push(new Vo(e,u)):n.push(void 0)}this.data.push(n)}}getName(){return this.layer.name}getProperty(e){return this.layer.properties?.find(t=>t.name===e)?.value}hasProperty(e){return this.getProperty(e)!==void 0}getData(){return this.data}isCharLayer(){return this.hasProperty("ge_charLayer")}};var Nf=class{constructor(e){this.rawTilemap=e;this.layers=[];this.layers=this.rawTilemap.layers?.map(t=>new No(this.rawTilemap.tilesets,t))}hasTileAt(e,t,i){if(e<0||e>=this.rawTilemap.width||t<0||t>=this.rawTilemap.height||!this.rawTilemap.layers)return!1;let n=this.rawTilemap.layers.find(u=>u.name===i);if(!n)return!1;let a=t*this.rawTilemap.width+e;return n.data[a]>0}getTileAt(e,t,i){if(e<0||e>=this.rawTilemap.width||t<0||t>=this.rawTilemap.height||!this.rawTilemap.layers)return;let n=this.layers.find(a=>a.getName()===i);if(n)return n.getData()[t][e]}getOrientation(){return this.rawTilemap.orientation}getLayers(){return this.layers}getWidth(){return this.rawTilemap.width}getHeight(){return this.rawTilemap.height}};var Va=class r{constructor(e){this.scene=e;this.geHeadless=new Da(!1);this.isCreatedInternal=!1;r.welcomeMessagePrinted||(console.log(`Using GridEngine Phaser Plugin v${qf}`),r.welcomeMessagePrinted=!0),this.scene.sys.events.once("boot",this.boot,this)}static{this.welcomeMessagePrinted=!1}boot(){this.scene.sys.events.on("update",this.update,this)}getCharLayer(e){return this.geHeadless.getCharLayer(e)}getTransition(e,t){return this.geHeadless.getTransition(e,t)}setTransition(e,t,i){this.geHeadless.setTransition(e,t,i)}create(e,t){this.geHeadless.create(new za(e,t.tiledProject),t),this.isCreatedInternal=!0,this.gridCharacters=new Map;let i=this.setConfigDefaults(t);this.config=i,this.gridTilemap=new un(e),this.addCharacters()}getPosition(e){return this.geHeadless.getPosition(e)}move(e,t){this.geHeadless.move(e,t)}moveRandomly(e,t=0,i=-1){this.geHeadless.moveRandomly(e,t,i)}getMovement(e){return this.geHeadless.getMovement(e)}moveTo(e,t,i){return this.geHeadless.moveTo(e,t,i)}stopMovement(e){this.geHeadless.stopMovement(e)}setSpeed(e,t){this.geHeadless.setSpeed(e,t)}getSpeed(e){return this.geHeadless.getSpeed(e)}setContainer(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.setContainer(t)}getContainer(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getContainer()}getOffsetX(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getOffsetX()}setOffsetX(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.setOffsetX(t)}getOffsetY(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getOffsetY()}setOffsetY(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.setOffsetY(t)}getDepthOffset(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getDepthOffset()}collidesWithTiles(e){return this.geHeadless.collidesWithTiles(e)}getWalkingAnimationMapping(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getAnimation()?.getWalkingAnimationMapping()}hasLayerOverlay(){return this.initGuard(),!!this.config?.layerOverlay}setWalkingAnimationMapping(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.getAnimation()?.setWalkingAnimationMapping(t)}update(e,t){if(this.isCreatedInternal&&this.gridCharacters)for(let[i,n]of this.gridCharacters)n.update(t);this.geHeadless.update(e,t)}addCharacter(e){this.geHeadless.addCharacter(e),this.addCharacterInternal(e)}hasCharacter(e){return this.geHeadless.hasCharacter(e)}removeCharacter(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);t.destroy(),this.gridCharacters?.delete(e),this.geHeadless.removeCharacter(e)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters){for(let e of this.gridCharacters.keys())this.removeCharacter(e);this.geHeadless.removeAllCharacters()}}getAllCharacters(e){return this.geHeadless.getAllCharacters(e)}getLabels(e){return this.geHeadless.getLabels(e)}addLabels(e,t){this.geHeadless.addLabels(e,t)}removeLabels(e,t){this.geHeadless.removeLabels(e,t)}clearLabels(e){this.geHeadless.clearLabels(e)}follow(e,t,i,n){let a;i===void 0?a={distance:0,closestPointIfBlocked:!1}:typeof i=="number"?(a={distance:i,closestPointIfBlocked:!1},n&&(a.closestPointIfBlocked=!0)):a=i,this.geHeadless.follow(e,t,a)}isMoving(e){return this.geHeadless.isMoving(e)}getFacingDirection(e){return this.geHeadless.getFacingDirection(e)}getFacingPosition(e){return this.geHeadless.getFacingPosition(e)}turnTowards(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);i.turnTowards(t),this.geHeadless.turnTowards(e,t)}getCharactersAt(e,t){return this.geHeadless.getCharactersAt(e,t)}setPosition(e,t,i){this.geHeadless.setPosition(e,t,i)}getSprite(e){this.initGuard();let t=this.gridCharacters?.get(e);if(!t)throw this.createCharUnknownErr(e);return t.getSprite()}setSprite(e,t){this.initGuard();let i=this.gridCharacters?.get(e);if(!i)throw this.createCharUnknownErr(e);t.setOrigin(0,0),i.setSprite(t)}isBlocked(e,t,i=["geDefault"]){return this.geHeadless.isBlocked(e,t,i)}isTileBlocked(e,t){return this.geHeadless.isTileBlocked(e,t)}getCollisionGroups(e){return this.geHeadless.getCollisionGroups(e)}setCollisionGroups(e,t){this.geHeadless.setCollisionGroups(e,t)}getIgnoreCollisionGroups(e){return this.geHeadless.getIgnoreCollisionGroups(e)}setIgnoreCollisionGroups(e,t){this.geHeadless.setIgnoreCollisionGroups(e,t)}getTilePosInDirection(e,t,i){return this.geHeadless.getTilePosInDirection(e,t,i)}findShortestPath(e,t,i={}){return this.geHeadless.findShortestPath(e,t,i)}steppedOn(e,t,i){return this.geHeadless.steppedOn(e,t,i)}characterShifted(){return this.geHeadless.characterShifted()}movementStarted(){return this.geHeadless.movementStarted()}movementStopped(){return this.geHeadless.movementStopped()}directionChanged(){return this.geHeadless.directionChanged()}positionChangeStarted(){return this.geHeadless.positionChangeStarted()}positionChangeFinished(){return this.geHeadless.positionChangeFinished()}getMovementProgress(e){return this.geHeadless.getMovementProgress(e)}rebuildTileCollisionCache(e,t,i,n){this.geHeadless.rebuildTileCollisionCache(e,t,i,n)}addQueueMovements(e,t,i){this.geHeadless.addQueueMovements(e,t,i)}getEnqueuedMovements(e){return this.geHeadless.getEnqueuedMovements(e)}queueMovementFinished(){return this.geHeadless.queueMovementFinished()}clearEnqueuedMovements(e){return this.geHeadless.clearEnqueuedMovements(e)}getState(){return{characters:this.geHeadless.getState().characters.map(e=>({...e,offsetX:this.getOffsetX(e.id),offsetY:this.getOffsetY(e.id)}))}}setState(e){if(this.geHeadless.setState(e),this.gridCharacters)for(let t of e.characters){let i=this.gridCharacters.get(t.id);i&&(i.setOffsetX(t.offsetX),i.setOffsetY(t.offsetY))}}getTileCost(e,t,i){return this.initGuard(),this.geHeadless.getTileCost(e,t,i)}setConfigDefaults(e){return{collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",layerOverlay:!1,cacheTileCollisions:!1,...e}}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){this.config?.characters.forEach(e=>this.addCharacterInternal(e))}createCharUnknownErr(e){return new Error(`Character unknown: ${e}`)}addCharacterInternal(e){if(this.initGuard(),!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let t=new sf(e,this.scene,this.gridTilemap,this.config.layerOverlay,this.geHeadless);this.gridCharacters?.set(e.id,t)}};var k4=Va;0&&(module.exports={ArrayTilemap,CharacterShiftAction,CollisionStrategy,Direction,GridEngine,GridEngineHeadless,MoveToResult,NoPathFoundStrategy,NumberOfDirections,PathBlockedStrategy,PhaserTile,PhaserTileLayer,PhaserTilemap,QueuedPathBlockedStrategy,TiledLayer,TiledTile,TiledTilemap,directionFromPos}); /*! Bundled license information: tiled-property-flattener/dist/tiled_property_flattener.min.js: (*! Bundled license information: lodash/lodash.js: (** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) *) */