neo4j-driver 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/neo4j-web.esm.js +1077 -433
- package/lib/browser/neo4j-web.esm.min.js +1 -1
- package/lib/browser/neo4j-web.js +1077 -433
- package/lib/browser/neo4j-web.min.js +1 -1
- package/lib/index.js +10 -3
- package/lib/version.js +1 -1
- package/package.json +5 -5
- package/types/index.d.ts +19 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).neo4j=t()}(this,function(){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function U(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D,L,B={},F={},e={},t={},n=r&&r.__extends||(D=function(e,t){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),W=(Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_ERROR=t.SESSION_EXPIRED=t.SERVICE_UNAVAILABLE=t.Neo4jError=t.isRetriableError=t.newError=void 0,"ServiceUnavailable"),z=(t.SERVICE_UNAVAILABLE=W,"SessionExpired"),q=(t.SESSION_EXPIRED=z,t.PROTOCOL_ERROR="ProtocolError",L=Error,n(V,L),V.isRetriable=function(e){return null!=e&&e instanceof V&&e.retriable},V);function V(e,t,r){e=L.call(this,e,null!=r?{cause:r}:void 0)||this;return e.constructor=V,e.__proto__=V.prototype,e.code=t,e.name="Neo4jError",e.retriable=(r=t)===W||r===z||"Neo.ClientError.Security.AuthorizationExpired"===r||function(e){return!0===(null==e?void 0:e.includes("TransientError"))}(r),e}t.Neo4jError=q,t.newError=function(e,t,r){return new q(e,null!=t?t:"N/A",r)};n=q.isRetriable;t.isRetriableError=n;var n={},H=(Object.defineProperty(n,"__esModule",{value:!0}),n.toString=n.toNumber=n.inSafeRange=n.isInt=n.int=void 0,t),Y=new Map,o=(d.prototype.inSafeRange=function(){return this.greaterThanOrEqual(d.MIN_SAFE_VALUE)&&this.lessThanOrEqual(d.MAX_SAFE_VALUE)},d.prototype.toInt=function(){return this.low},d.prototype.toNumber=function(){return this.high*K+(this.low>>>0)},d.prototype.toBigInt=function(){var e;return this.isZero()?BigInt(0):this.isPositive()?BigInt(this.high>>>0)*BigInt(K)+BigInt(this.low>>>0):(e=this.negate(),BigInt(-1)*(BigInt(e.high>>>0)*BigInt(K)+BigInt(e.low>>>0)))},d.prototype.toNumberOrInfinity=function(){return this.lessThan(d.MIN_SAFE_VALUE)?Number.NEGATIVE_INFINITY:this.greaterThan(d.MAX_SAFE_VALUE)?Number.POSITIVE_INFINITY:this.toNumber()},d.prototype.toString=function(e){if((e=null!=e?e:10)<2||36<e)throw RangeError("radix out of range: "+e.toString());if(this.isZero())return"0";var t,r,n;if(this.isNegative())return this.equals(d.MIN_VALUE)?(t=d.fromNumber(e),n=(r=this.div(t)).multiply(t).subtract(this),r.toString(e)+n.toInt().toString(e)):"-"+this.negate().toString(e);for(var o=d.fromNumber(Math.pow(e,6)),i=(n=this,"");;){var u=n.div(o),a=(n.subtract(u.multiply(o)).toInt()>>>0).toString(e);if((n=u).isZero())return a+i;for(;a.length<6;)a="0"+a;i=""+a+i}},d.prototype.valueOf=function(){return this.toBigInt()},d.prototype.getHighBits=function(){return this.high},d.prototype.getLowBits=function(){return this.low},d.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(d.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var e=0!==this.high?this.high:this.low,t=0,t=31;0<t&&0==(e&1<<t);t--);return 0!==this.high?t+33:t+1},d.prototype.isZero=function(){return 0===this.high&&0===this.low},d.prototype.isNegative=function(){return this.high<0},d.prototype.isPositive=function(){return 0<=this.high},d.prototype.isOdd=function(){return 1==(1&this.low)},d.prototype.isEven=function(){return 0==(1&this.low)},d.prototype.equals=function(e){e=d.fromValue(e);return this.high===e.high&&this.low===e.low},d.prototype.notEquals=function(e){return!this.equals(e)},d.prototype.lessThan=function(e){return this.compare(e)<0},d.prototype.lessThanOrEqual=function(e){return this.compare(e)<=0},d.prototype.greaterThan=function(e){return 0<this.compare(e)},d.prototype.greaterThanOrEqual=function(e){return 0<=this.compare(e)},d.prototype.compare=function(e){e=d.fromValue(e);if(this.equals(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r||(t||!r)&&this.subtract(e).isNegative()?-1:1},d.prototype.negate=function(){return this.equals(d.MIN_VALUE)?d.MIN_VALUE:this.not().add(d.ONE)},d.prototype.add=function(e){var e=d.fromValue(e),t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,u=65535&e.high,a=e.low>>>16,s=0,c=0,l=0,f=0;return c+=(l=l+((f+=o+(65535&e.low))>>>16)+(n+a))>>>16,d.fromBits((l&=65535)<<16|(f&=65535),((s+=(c+=r+u)>>>16)+(t+i)&65535)<<16|(c&=65535))},d.prototype.subtract=function(e){e=d.fromValue(e);return this.add(e.negate())},d.prototype.multiply=function(e){if(this.isZero())return d.ZERO;e=d.fromValue(e);if(e.isZero())return d.ZERO;if(this.equals(d.MIN_VALUE))return e.isOdd()?d.MIN_VALUE:d.ZERO;if(e.equals(d.MIN_VALUE))return this.isOdd()?d.MIN_VALUE:d.ZERO;if(this.isNegative())return e.isNegative()?this.negate().multiply(e.negate()):this.negate().multiply(e).negate();if(e.isNegative())return this.multiply(e.negate()).negate();if(this.lessThan(Z)&&e.lessThan(Z))return d.fromNumber(this.toNumber()*e.toNumber());var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,u=65535&e.high,a=e.low>>>16,e=65535&e.low,s=0,c=0,l=0,f=(f=0)+((c=c+((l+=o*e)>>>16)+n*e)>>>16)+((c=(c&65535)+o*a)>>>16);return d.fromBits((c&=65535)<<16|(l&=65535),((s+=(f+=r*e)>>>16)+((f=(f&65535)+n*a)>>>16)+((f=(f&65535)+o*u)>>>16)+(t*e+r*a+n*u+o*i)&65535)<<16|(f&=65535))},d.prototype.div=function(e){var t,r,n,o=d.fromValue(e);if(o.isZero())throw(0,H.newError)("division by zero");if(this.isZero())return d.ZERO;{if(this.equals(d.MIN_VALUE))return o.equals(d.ONE)||o.equals(d.NEG_ONE)?d.MIN_VALUE:o.equals(d.MIN_VALUE)?d.ONE:(n=this.shiftRight(1).div(o).shiftLeft(1)).equals(d.ZERO)?o.isNegative()?d.ONE:d.NEG_ONE:(t=this.subtract(o.multiply(n)),n.add(t.div(o)));if(o.equals(d.MIN_VALUE))return d.ZERO}if(this.isNegative())return o.isNegative()?this.negate().div(o.negate()):this.negate().div(o).negate();if(o.isNegative())return this.div(o.negate()).negate();for(r=d.ZERO,t=this;t.greaterThanOrEqual(o);){n=Math.max(1,Math.floor(t.toNumber()/o.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),u=i<=48?1:Math.pow(2,i-48),a=d.fromNumber(n),s=a.multiply(o);s.isNegative()||s.greaterThan(t);)s=(a=d.fromNumber(n-=u)).multiply(o);a.isZero()&&(a=d.ONE),r=r.add(a),t=t.subtract(s)}return r},d.prototype.modulo=function(e){e=d.fromValue(e);return this.subtract(this.div(e).multiply(e))},d.prototype.not=function(){return d.fromBits(~this.low,~this.high)},d.prototype.and=function(e){e=d.fromValue(e);return d.fromBits(this.low&e.low,this.high&e.high)},d.prototype.or=function(e){e=d.fromValue(e);return d.fromBits(this.low|e.low,this.high|e.high)},d.prototype.xor=function(e){e=d.fromValue(e);return d.fromBits(this.low^e.low,this.high^e.high)},d.prototype.shiftLeft=function(e){e=d.toNumber(e);return 0==(e&=63)?d.ZERO:e<32?d.fromBits(this.low<<e,this.high<<e|this.low>>>32-e):d.fromBits(0,this.low<<e-32)},d.prototype.shiftRight=function(e){var t=d.toNumber(e);return 0==(t&=63)?d.ZERO:e<32?d.fromBits(this.low>>>t|this.high<<32-t,this.high>>t):d.fromBits(this.high>>t-32,0<=this.high?0:-1)},d.isInteger=function(e){return!0===(null==e?void 0:e.__isInteger__)},d.fromInt=function(e){if(-128<=(e|=0)&&e<128&&null!=(t=Y.get(e)))return t;var t=new d(e,e<0?-1:0);return-128<=e&&e<128&&Y.set(e,t),t},d.fromBits=function(e,t){return new d(e,t)},d.fromNumber=function(e){return isNaN(e)||!isFinite(e)?d.ZERO:e<=-G?d.MIN_VALUE:G<=e+1?d.MAX_VALUE:e<0?d.fromNumber(-e).negate():new d(e%K|0,e/K|0)},d.fromString=function(e,t,r){var n=(void 0===r?{}:r).strictStringValidation;if(0===e.length)throw(0,H.newError)("number format error: empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return d.ZERO;if((t=null!=t?t:10)<2||36<t)throw(0,H.newError)("radix out of range: "+t.toString());if(0<(r=e.indexOf("-")))throw(0,H.newError)('number format error: interior "-" character: '+e);if(0===r)return d.fromString(e.substring(1),t).negate();for(var o,i,u=d.fromNumber(Math.pow(t,8)),a=d.ZERO,s=0;s<e.length;s+=8){var c,l=Math.min(8,e.length-s),f=e.substring(s,s+l),p=parseInt(f,t);if(!0===n&&(o=f,c=p,i=t,Number.isNaN(o)||Number.isNaN(c)||function(e,t,r){e=e.toString(t),t=Math.max(r-e.length,0),r="0".repeat(t);return"".concat(r).concat(e)}(c,i,o.length)!==o.toLowerCase()))throw(0,H.newError)('number format error: "'.concat(f,'" is NaN in radix ').concat(t,": ").concat(e));a=l<8?(c=d.fromNumber(Math.pow(t,l)),a.multiply(c).add(d.fromNumber(p))):(a=a.multiply(u)).add(d.fromNumber(p))}return a},d.fromValue=function(e,t){return void 0===t&&(t={}),e instanceof d?e:"number"==typeof e?d.fromNumber(e):"string"==typeof e?d.fromString(e,void 0,t):"bigint"==typeof e?d.fromString(e.toString()):new d(e.low,e.high)},d.toNumber=function(e){switch(typeof e){case"number":return e;case"bigint":return Number(e);default:return d.fromValue(e).toNumber()}},d.toString=function(e,t){return d.fromValue(e).toString(t)},d.inSafeRange=function(e){return d.fromValue(e).inSafeRange()},d.ZERO=d.fromInt(0),d.ONE=d.fromInt(1),d.NEG_ONE=d.fromInt(-1),d.MAX_VALUE=d.fromBits(-1,2147483647),d.MIN_VALUE=d.fromBits(0,-2147483648),d.MIN_SAFE_VALUE=d.fromBits(1,-2097152),d.MAX_SAFE_VALUE=d.fromBits(-1,2097151),d.__isInteger__=!0,d);function d(e,t){this.low=null!=e?e:0,this.high=null!=t?t:0}Object.defineProperty(o.prototype,"__isInteger__",{value:!0,enumerable:!1,configurable:!1});var K=4294967296,G=K*K/2,Z=o.fromInt(1<<24),i=o.fromValue,i=(n.int=i,o.isInteger),i=(n.isInt=i,o.inSafeRange),i=(n.inSafeRange=i,o.toNumber),i=(n.toNumber=i,o.toString),i=(n.toString=i,n.default=o,{}),o={},u={},X={},a={},Q=(Object.defineProperty(a,"__esModule",{value:!0}),a.getBrokenObjectReason=a.isBrokenObject=a.createBrokenObject=void 0,"__isBrokenObject__"),J="__reason__";a.createBrokenObject=function(r,e){function n(){throw r}return void 0===e&&(e={}),new Proxy(e,{get:function(e,t){return t===Q||(t===J?r:void("toJSON"!==t&&n()))},set:n,apply:n,construct:n,defineProperty:n,deleteProperty:n,getOwnPropertyDescriptor:n,getPrototypeOf:n,has:n,isExtensible:n,ownKeys:n,preventExtensions:n,setPrototypeOf:n})},a.isBrokenObject=function(e){return null!==e&&"object"==typeof e&&!0===e[Q]},a.getBrokenObjectReason=function(e){return e[J]},Object.defineProperty(X,"__esModule",{value:!0}),X.stringify=void 0;var $=a;X.stringify=function(e){return JSON.stringify(e,function(e,t){return(0,$.isBrokenObject)(t)?{__isBrokenObject__:!0,__reason__:(0,$.getBrokenObjectReason)(t)}:"bigint"==typeof t?"".concat(t,"n"):t})},Object.defineProperty(u,"__esModule",{value:!0}),u.ENCRYPTION_OFF=u.ENCRYPTION_ON=u.validateQueryAndParameters=u.assertValidDate=u.assertNumberOrInteger=u.assertNumber=u.assertString=u.assertObject=u.isString=u.isObject=u.isEmptyObjectOrNull=void 0;var s,ee,te,re,ne,oe,ie=n,ue=X;u.ENCRYPTION_ON="ENCRYPTION_ON";function ae(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}function se(e,t){if(ce(e))return e;throw new TypeError((0,ue.stringify)(t)+" expected to be string but was: "+(0,ue.stringify)(e))}function ce(e){return"[object String]"===Object.prototype.toString.call(e)}function le(e,t){this._minNumber=e,this._maxNumber=t,this._minInteger=(0,re.int)(e),this._maxInteger=(0,re.int)(t)}function fe(e,t,r){e=(0,re.int)(e),t=(0,re.int)(t),r=(0,re.int)(r);var n=e.multiply(365);return n=(n=(n=e.greaterThanOrEqual(0)?n.add(e.add(3).div(4).subtract(e.add(99).div(100)).add(e.add(399).div(400))):n.subtract(e.div(-4).subtract(e.div(-100)).add(e.div(-400)))).add(t.multiply(367).subtract(362).div(12))).add(r.subtract(1)),t.greaterThan(2)&&(n=n.subtract(1),function(e){if((e=(0,re.int)(e)).modulo(4).equals(0))return!e.modulo(100).equals(0)||!!e.modulo(400).equals(0)}(e)||(n=n.subtract(1))),n.subtract(s.DAYS_0000_TO_1970)}function pe(e,t,r){if((0,oe.assertNumberOrInteger)(e,r),t.contains(e))return e;throw(0,ne.newError)("".concat(r," is expected to be in range ").concat(t.toString()," but was: ").concat(e.toString()))}function de(e,t){e=(0,re.int)(e),t=(0,re.int)(t);var r=e.div(t);return r=e.isPositive()!==t.isPositive()&&r.multiply(t).notEquals(e)?r.subtract(1):r}function he(e,t){return e=(0,re.int)(e),t=(0,re.int)(t),e.subtract(de(e,t).multiply(t))}function be(e){return(e=(0,re.int)(e)).equals(0)?"":"."+ye(e,9)}function ye(e,t,r){var n=(e=(0,re.int)(e)).isNegative(),o=(e=n?e.negate():e).toString();if(null!=t)for(;o.length<t;)o="0"+o;return n?"-"+o:!0===(null==r?void 0:r.usePositiveSign)?"+"+o:o}u.ENCRYPTION_OFF="ENCRYPTION_OFF",u.isEmptyObjectOrNull=function(e){if(null===e)return!0;if(!ae(e))return!1;for(var t in e)if(void 0!==e[t])return!1;return!0},u.isObject=ae,u.validateQueryAndParameters=function(e,t,r){var n="",t=null!=t?t:{},r=null!=(r=null==r?void 0:r.skipAsserts)&&r;if("string"==typeof e?n=e:e instanceof String?n=e.toString():"object"==typeof e&&null!=e.text&&(n=e.text,t=null!=(e=e.parameters)?e:{}),!r){e=n;if(se(e,"Cypher query"),0===e.trim().length)throw new TypeError("Cypher query is expected to be a non-empty string.");r=t;if(!ae(r))throw e=null!=r.constructor?" "+r.constructor.name:"",new TypeError("Query parameters are expected to either be undefined/null or an object, given:".concat(e," ").concat(JSON.stringify(r)))}return{validatedQuery:n,params:t}},u.assertObject=function(e,t){if(ae(e))return e;throw new TypeError(t+" expected to be an object but was: "+(0,ue.stringify)(e))},u.assertString=se,u.assertNumber=function(e,t){if("number"!=typeof e)throw new TypeError(t+" expected to be a number but was: "+(0,ue.stringify)(e));return e},u.assertNumberOrInteger=function(e,t){if("number"==typeof e||"bigint"==typeof e||(0,ie.isInt)(e))return e;throw new TypeError(t+" expected to be either a number or an Integer object but was: "+(0,ue.stringify)(e))},u.assertValidDate=function(e,t){if("[object Date]"!==Object.prototype.toString.call(e))throw new TypeError(t+" expected to be a standard JavaScript Date but was: "+(0,ue.stringify)(e));if(Number.isNaN(e.getTime()))throw new TypeError(t+" expected to be valid JavaScript Date but its time was NaN: "+(0,ue.stringify)(e));return e},u.isString=ce,s=o,ee=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),te=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ee(t,e,r);return te(t,e),t},Object.defineProperty(s,"__esModule",{value:!0}),s.floorMod=s.floorDiv=s.assertValidZoneId=s.assertValidNanosecond=s.assertValidSecond=s.assertValidMinute=s.assertValidHour=s.assertValidDay=s.assertValidMonth=s.assertValidYear=s.timeZoneOffsetInSeconds=s.totalNanoseconds=s.newDate=s.toStandardDate=s.isoStringToStandardDate=s.dateToIsoString=s.timeZoneOffsetToIsoString=s.timeToIsoString=s.durationToIsoString=s.dateToEpochDay=s.localDateTimeToEpochSecond=s.localTimeToNanoOfDay=s.normalizeNanosecondsForDuration=s.normalizeSecondsForDuration=s.SECONDS_PER_DAY=s.DAYS_PER_400_YEAR_CYCLE=s.DAYS_0000_TO_1970=s.NANOS_PER_HOUR=s.NANOS_PER_MINUTE=s.NANOS_PER_MILLISECOND=s.NANOS_PER_SECOND=s.SECONDS_PER_HOUR=s.SECONDS_PER_MINUTE=s.MINUTES_PER_HOUR=s.NANOSECOND_OF_SECOND_RANGE=s.SECOND_OF_MINUTE_RANGE=s.MINUTE_OF_HOUR_RANGE=s.HOUR_OF_DAY_RANGE=s.DAY_OF_MONTH_RANGE=s.MONTH_OF_YEAR_RANGE=s.YEAR_RANGE=void 0,re=c(n),ne=t,oe=u,le.prototype.contains=function(e){var t;return(0,re.isInt)(e)&&e instanceof re.default?e.greaterThanOrEqual(this._minInteger)&&e.lessThanOrEqual(this._maxInteger):"bigint"==typeof e?(t=(0,re.int)(e)).greaterThanOrEqual(this._minInteger)&&t.lessThanOrEqual(this._maxInteger):e>=this._minNumber&&e<=this._maxNumber},le.prototype.toString=function(){return"[".concat(this._minNumber,", ").concat(this._maxNumber,"]")},c=le,s.YEAR_RANGE=new c(-999999999,999999999),s.MONTH_OF_YEAR_RANGE=new c(1,12),s.DAY_OF_MONTH_RANGE=new c(1,31),s.HOUR_OF_DAY_RANGE=new c(0,23),s.MINUTE_OF_HOUR_RANGE=new c(0,59),s.SECOND_OF_MINUTE_RANGE=new c(0,59),s.NANOSECOND_OF_SECOND_RANGE=new c(0,999999999),s.MINUTES_PER_HOUR=60,s.SECONDS_PER_MINUTE=60,s.SECONDS_PER_HOUR=s.SECONDS_PER_MINUTE*s.MINUTES_PER_HOUR,s.NANOS_PER_SECOND=1e9,s.NANOS_PER_MILLISECOND=1e6,s.NANOS_PER_MINUTE=s.NANOS_PER_SECOND*s.SECONDS_PER_MINUTE,s.NANOS_PER_HOUR=s.NANOS_PER_MINUTE*s.MINUTES_PER_HOUR,s.DAYS_0000_TO_1970=719528,s.DAYS_PER_400_YEAR_CYCLE=146097,s.SECONDS_PER_DAY=86400,s.normalizeSecondsForDuration=function(e,t){return(0,re.int)(e).add(de(t,s.NANOS_PER_SECOND))},s.normalizeNanosecondsForDuration=function(e){return he(e,s.NANOS_PER_SECOND)},s.localTimeToNanoOfDay=function(e,t,r,n){return e=(0,re.int)(e),t=(0,re.int)(t),r=(0,re.int)(r),n=(0,re.int)(n),(e=(e=(e=e.multiply(s.NANOS_PER_HOUR)).add(t.multiply(s.NANOS_PER_MINUTE))).add(r.multiply(s.NANOS_PER_SECOND))).add(n)},s.localDateTimeToEpochSecond=function(e,t,r,n,o,i,u){return e=fe(e,t,r),t=function(e,t,r){e=(0,re.int)(e),t=(0,re.int)(t),r=(0,re.int)(r);e=e.multiply(s.SECONDS_PER_HOUR);return(e=e.add(t.multiply(s.SECONDS_PER_MINUTE))).add(r)}(n,o,i),e.multiply(s.SECONDS_PER_DAY).add(t)},s.dateToEpochDay=fe,s.durationToIsoString=function(e,t,r,n){return e=ye(e),t=ye(t),r=function(e,t){e=(0,re.int)(e),t=(0,re.int)(t);var r,n=e.isNegative(),o=t.greaterThan(0);e=n&&o?e.equals(-1)?"-0":e.add(1).toString():e.toString();o&&(r=be((n?t.negate().add(2*s.NANOS_PER_SECOND):t.add(s.NANOS_PER_SECOND)).modulo(s.NANOS_PER_SECOND)));return null!=r?e+r:e}(r,n),"P".concat(e,"M").concat(t,"DT").concat(r,"S")},s.timeToIsoString=function(e,t,r,n){return e=ye(e,2),t=ye(t,2),r=ye(r,2),n=be(n),"".concat(e,":").concat(t,":").concat(r).concat(n)},s.timeZoneOffsetToIsoString=function(e){if((e=(0,re.int)(e)).equals(0))return"Z";var t=(r=e.isNegative())?"-":"+",r=ye((e=r?e.multiply(-1):e).div(s.SECONDS_PER_HOUR),2),n=ye(e.div(s.SECONDS_PER_MINUTE).modulo(s.MINUTES_PER_HOUR),2);return null!=(e=(e=e.modulo(s.SECONDS_PER_MINUTE)).equals(0)?null:ye(e,2))?"".concat(t).concat(r,":").concat(n,":").concat(e):"".concat(t).concat(r,":").concat(n)},s.dateToIsoString=function(e,t,r){return e=function(e){e=(0,re.int)(e);if(e.isNegative()||e.greaterThan(9999))return ye(e,6,{usePositiveSign:!0});return ye(e,4)}(e),t=ye(t,2),r=ye(r,2),"".concat(e,"-").concat(t,"-").concat(r)},s.isoStringToStandardDate=function(e){return new Date(e)},s.toStandardDate=function(e){return new Date(e)},s.newDate=function(e){return new Date(e)},s.totalNanoseconds=function(e,t){return t=null!=t?t:0,e=e.getMilliseconds()*s.NANOS_PER_MILLISECOND,t instanceof re.default?t.add(e):"bigint"==typeof t?t+BigInt(e):t+e},s.timeZoneOffsetInSeconds=function(e){var t=e.getSeconds()>=e.getUTCSeconds()?e.getSeconds()-e.getUTCSeconds():e.getSeconds()-e.getUTCSeconds()+60;return 0===(e=e.getTimezoneOffset())?0+t:-1*e*s.SECONDS_PER_MINUTE+t},s.assertValidYear=function(e){return pe(e,s.YEAR_RANGE,"Year")},s.assertValidMonth=function(e){return pe(e,s.MONTH_OF_YEAR_RANGE,"Month")},s.assertValidDay=function(e){return pe(e,s.DAY_OF_MONTH_RANGE,"Day")},s.assertValidHour=function(e){return pe(e,s.HOUR_OF_DAY_RANGE,"Hour")},s.assertValidMinute=function(e){return pe(e,s.MINUTE_OF_HOUR_RANGE,"Minute")},s.assertValidSecond=function(e){return pe(e,s.SECOND_OF_MINUTE_RANGE,"Second")},s.assertValidNanosecond=function(e){return pe(e,s.NANOSECOND_OF_SECOND_RANGE,"Nanosecond")},s.assertValidZoneId=function(t,r){try{Intl.DateTimeFormat(void 0,{timeZone:r})}catch(e){throw(0,ne.newError)("".concat(t,' is expected to be a valid ZoneId but was: "').concat(r,'"'))}},s.floorDiv=de,s.floorMod=he;var _e=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),ve=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),c=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&_e(t,e,r);return ve(t,e),t},me=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},l=(Object.defineProperty(i,"__esModule",{value:!0}),i.isDateTime=i.DateTime=i.isLocalDateTime=i.LocalDateTime=i.isDate=i.Date=i.isTime=i.Time=i.isLocalTime=i.LocalTime=i.isDuration=i.Duration=void 0,c(o)),ge=u,Oe=t,we=c(n),c={value:!0,enumerable:!1,configurable:!1,writable:!1},Ee="__isDuration__",Pe="__isLocalTime__",Se="__isTime__",Te="__isDate__",je="__isLocalDateTime__",Ce="__isDateTime__",f=(Ie.prototype.toString=function(){return l.durationToIsoString(this.months,this.days,this.seconds,this.nanoseconds)},Ie);function Ie(e,t,r,n){this.months=(0,ge.assertNumberOrInteger)(e,"Months"),this.days=(0,ge.assertNumberOrInteger)(t,"Days"),(0,ge.assertNumberOrInteger)(r,"Seconds"),(0,ge.assertNumberOrInteger)(n,"Nanoseconds"),this.seconds=l.normalizeSecondsForDuration(r,n),this.nanoseconds=l.normalizeNanosecondsForDuration(n),Object.freeze(this)}i.Duration=f,Object.defineProperty(f.prototype,Ee,c),i.isDuration=function(e){return Ne(e,Ee)};Re.fromStandardDate=function(e,t){De(e,t);t=l.totalNanoseconds(e,t);return new Re(e.getHours(),e.getMinutes(),e.getSeconds(),t instanceof we.default?t.toInt():"bigint"==typeof t?(0,we.int)(t).toInt():t)},Re.prototype.toString=function(){return l.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)};f=Re;function Re(e,t,r,n){this.hour=l.assertValidHour(e),this.minute=l.assertValidMinute(t),this.second=l.assertValidSecond(r),this.nanosecond=l.assertValidNanosecond(n),Object.freeze(this)}i.LocalTime=f,Object.defineProperty(f.prototype,Pe,c),i.isLocalTime=function(e){return Ne(e,Pe)};ke.fromStandardDate=function(e,t){return De(e,t),new ke(e.getHours(),e.getMinutes(),e.getSeconds(),(0,we.toNumber)(l.totalNanoseconds(e,t)),l.timeZoneOffsetInSeconds(e))},ke.prototype.toString=function(){return l.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)+l.timeZoneOffsetToIsoString(this.timeZoneOffsetSeconds)};f=ke;function ke(e,t,r,n,o){this.hour=l.assertValidHour(e),this.minute=l.assertValidMinute(t),this.second=l.assertValidSecond(r),this.nanosecond=l.assertValidNanosecond(n),this.timeZoneOffsetSeconds=(0,ge.assertNumberOrInteger)(o,"Time zone offset in seconds"),Object.freeze(this)}i.Time=f,Object.defineProperty(f.prototype,Se,c),i.isTime=function(e){return Ne(e,Se)};Ae.fromStandardDate=function(e){return De(e),new Ae(e.getFullYear(),e.getMonth()+1,e.getDate())},Ae.prototype.toStandardDate=function(){return l.isoStringToStandardDate(this.toString())},Ae.prototype.toString=function(){return l.dateToIsoString(this.year,this.month,this.day)};f=Ae;function Ae(e,t,r){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),Object.freeze(this)}i.Date=f,Object.defineProperty(f.prototype,Te,c),i.isDate=function(e){return Ne(e,Te)};Me.fromStandardDate=function(e,t){return De(e,t),new Me(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,we.toNumber)(l.totalNanoseconds(e,t)))},Me.prototype.toStandardDate=function(){return l.isoStringToStandardDate(this.toString())},Me.prototype.toString=function(){return Ue(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)};f=Me;function Me(e,t,r,n,o,i,u){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),this.hour=l.assertValidHour(n),this.minute=l.assertValidMinute(o),this.second=l.assertValidSecond(i),this.nanosecond=l.assertValidNanosecond(u),Object.freeze(this)}i.LocalDateTime=f,Object.defineProperty(f.prototype,je,c),i.isLocalDateTime=function(e){return Ne(e,je)};xe.fromStandardDate=function(e,t){return De(e,t),new xe(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,we.toNumber)(l.totalNanoseconds(e,t)),l.timeZoneOffsetInSeconds(e),null)},xe.prototype.toStandardDate=function(){return l.toStandardDate(this._toUTC())},xe.prototype.toString=function(){var e;return Ue(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)+(null!=this.timeZoneOffsetSeconds?l.timeZoneOffsetToIsoString(null!=(e=this.timeZoneOffsetSeconds)?e:0):"")+(null!=this.timeZoneId?"[".concat(this.timeZoneId,"]"):"")},xe.prototype._toUTC=function(){if(void 0===this.timeZoneOffsetSeconds)throw new Error("Requires DateTime created with time zone offset");var e=l.localDateTimeToEpochSecond(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond).subtract(null!=(e=this.timeZoneOffsetSeconds)?e:0);return(0,we.int)(e).multiply(1e3).add((0,we.int)(this.nanosecond).div(1e6)).toNumber()};f=xe;function xe(e,t,r,n,o,i,u,a,s){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),this.hour=l.assertValidHour(n),this.minute=l.assertValidMinute(o),this.second=l.assertValidSecond(i),this.nanosecond=l.assertValidNanosecond(u);e=me(function(e,t){var r=null!=e,n=null!=t&&""!==t;if(!r&&!n)throw(0,Oe.newError)("Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: ".concat(e," and id: ").concat(t));var o=[void 0,void 0];r&&((0,ge.assertNumberOrInteger)(e,"Time zone offset in seconds"),o[0]=e);n&&((0,ge.assertString)(t,"Time zone ID"),l.assertValidZoneId("Time zone ID",t),o[1]=t);return o}(a,s),2),t=e[0],r=e[1];this.timeZoneOffsetSeconds=t,this.timeZoneId=null!=r?r:void 0,Object.freeze(this)}function Ne(e,t){return null!=e&&!0===e[t]}function Ue(e,t,r,n,o,i,u){return l.dateToIsoString(e,t,r)+"T"+l.timeToIsoString(n,o,i,u)}function De(e,t){(0,ge.assertValidDate)(e,"Standard date"),null!=t&&(0,ge.assertNumberOrInteger)(t,"Nanosecond")}i.DateTime=f,Object.defineProperty(f.prototype,Ce,c),i.isDateTime=function(e){return Ne(e,Ce)};var f={},Le=(Object.defineProperty(f,"__esModule",{value:!0}),f.isPathSegment=f.PathSegment=f.isPath=f.Path=f.isUnboundRelationship=f.UnboundRelationship=f.isRelationship=f.Relationship=f.isNode=f.Node=void 0,X),c={value:!0,enumerable:!1,configurable:!1,writable:!1},Be="__isNode__",Fe="__isRelationship__",We="__isUnboundRelationship__",ze="__isPath__",qe="__isPathSegment__";function Ve(e,t){return null!=e&&!0===e[t]}He.prototype.toString=function(){for(var e="("+this.elementId,t=0;t<this.labels.length;t++)e+=":"+this.labels[t];var r=Object.keys(this.properties);if(0<r.length){e+=" {";for(t=0;t<r.length;t++)0<t&&(e+=","),e+=r[t]+":"+(0,Le.stringify)(this.properties[r[t]]);e+="}"}return e+=")"};var p=He;function He(e,t,r,n){this.identity=e,this.labels=t,this.properties=r,this.elementId=Qe(n,function(){return e.toString()})}f.Node=p,Object.defineProperty(p.prototype,Be,c),f.isNode=function(e){return Ve(e,Be)};Ke.prototype.toString=function(){var e="("+this.startNodeElementId+")-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,Le.stringify)(this.properties[t[r]]);e+="}"}return e+="]->("+this.endNodeElementId+")"};var Ye=Ke;function Ke(e,t,r,n,o,i,u,a){this.identity=e,this.start=t,this.end=r,this.type=n,this.properties=o,this.elementId=Qe(i,function(){return e.toString()}),this.startNodeElementId=Qe(u,function(){return t.toString()}),this.endNodeElementId=Qe(a,function(){return r.toString()})}f.Relationship=Ye,Object.defineProperty(Ye.prototype,Fe,c),f.isRelationship=function(e){return Ve(e,Fe)};Ge.prototype.bind=function(e,t){return new Ye(this.identity,e,t,this.type,this.properties,this.elementId)},Ge.prototype.bindTo=function(e,t){return new Ye(this.identity,e.identity,t.identity,this.type,this.properties,this.elementId,e.elementId,t.elementId)},Ge.prototype.toString=function(){var e="-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,Le.stringify)(this.properties[t[r]]);e+="}"}return e+="]->"};p=Ge;function Ge(e,t,r,n){this.identity=e,this.type=t,this.properties=r,this.elementId=Qe(n,function(){return e.toString()})}f.UnboundRelationship=p,Object.defineProperty(p.prototype,We,c),f.isUnboundRelationship=function(e){return Ve(e,We)};function Ze(e,t,r){this.start=e,this.relationship=t,this.end=r}f.PathSegment=Ze,Object.defineProperty(Ze.prototype,qe,c),f.isPathSegment=function(e){return Ve(e,qe)};function Xe(e,t,r){this.start=e,this.end=t,this.segments=r,this.length=r.length}function Qe(e,t){return null==e?t():e}f.Path=Xe,Object.defineProperty(Xe.prototype,ze,c),f.isPath=function(e){return Ve(e,ze)};var p={},Je=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},$e=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},et=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},tt=(Object.defineProperty(p,"__esModule",{value:!0}),t);function rt(e,t,r){var n;this.keys=e,this.length=e.length,this._fields=t,this._fieldLookup=null!=r?r:(n={},e.forEach(function(e,t){n[e]=t}),n)}rt.prototype.forEach=function(e){var t,r;try{for(var n=$e(this.entries()),o=n.next();!o.done;o=n.next()){var i=et(o.value,2),u=i[0];e(i[1],u,this)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},rt.prototype.map=function(e){var t,r,n=[];try{for(var o=$e(this.entries()),i=o.next();!i.done;i=o.next()){var u=et(i.value,2),a=u[0],s=u[1];n.push(e(s,a,this))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},rt.prototype.entries=function(){var t;return Je(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,[this.keys[t],this._fields[t]]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},rt.prototype.values=function(){var t;return Je(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},rt.prototype[Symbol.iterator]=function(){var t;return Je(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},rt.prototype.toObject=function(){var t,e,r={};try{for(var n=$e(this.entries()),o=n.next();!o.done;o=n.next()){var i=et(o.value,2),u=i[0],a=i[1];r[u]=a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r},rt.prototype.get=function(e){var t;if("number"!=typeof e){if(void 0===(t=this._fieldLookup[e]))throw(0,tt.newError)("This record has no field with key '".concat(e.toString(),"', available keys are: [")+this.keys.toString()+"].")}else t=e;if(t>this._fields.length-1||t<0)throw(0,tt.newError)("This record has no field with index '"+t.toString()+"'. Remember that indexes start at `0`, and make sure your query returns records in the shape you meant it to.");return this._fields[t]},rt.prototype.has=function(e){return"number"==typeof e?0<=e&&e<this._fields.length:void 0!==this._fieldLookup[e]},p.default=rt;var c={},nt=(Object.defineProperty(c,"__esModule",{value:!0}),c.isPoint=c.Point=void 0,u),ot="__isPoint__",h=(it.prototype.toString=function(){return null==this.z||isNaN(this.z)?"Point{srid=".concat(ut(this.srid),", x=").concat(ut(this.x),", y=").concat(ut(this.y),"}"):"Point{srid=".concat(ut(this.srid),", x=").concat(ut(this.x),", y=").concat(ut(this.y),", z=").concat(ut(this.z),"}")},it);function it(e,t,r,n){this.srid=(0,nt.assertNumberOrInteger)(e,"SRID"),this.x=(0,nt.assertNumber)(t,"X coordinate"),this.y=(0,nt.assertNumber)(r,"Y coordinate"),this.z=null==n?n:(0,nt.assertNumber)(n,"Z coordinate"),Object.freeze(this)}function ut(e){return Number.isInteger(e)?e.toString()+".0":e.toString()}c.Point=h,Object.defineProperty(h.prototype,ot,{value:!0,enumerable:!1,configurable:!1,writable:!1}),c.isPoint=function(e){return null!=e&&!0===e[ot]};var h={},at=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),st=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),b=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&at(t,e,r);return st(t,e),t},ct=(Object.defineProperty(h,"__esModule",{value:!0}),h.Stats=h.QueryStatistics=h.ProfiledPlan=h.Plan=h.Notification=h.ServerInfo=h.queryType=void 0,b(n)),b=(lt.prototype._buildNotifications=function(e){return null==e?[]:e.map(function(e){return new yt(e)})},lt.prototype.hasPlan=function(){return this.plan instanceof ft},lt.prototype.hasProfile=function(){return this.profile instanceof pt},lt);function lt(e,t,r,n){this.query={text:e,parameters:t},this.queryType=r.type,this.counters=new ht(null!=(e=r.stats)?e:{}),this.updateStatistics=this.counters,this.plan=(null!=r.plan||null!=r.profile)&&new ft(null!=(t=r.plan)?t:r.profile),this.profile=null!=r.profile&&new pt(r.profile),this.notifications=this._buildNotifications(r.notifications),this.server=new vt(r.server,n),this.resultConsumedAfter=r.result_consumed_after,this.resultAvailableAfter=r.result_available_after,this.database={name:null!=(e=r.db)?e:null}}var ft=function t(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.children=null!=e.children?e.children.map(function(e){return new t(e)}):[]},pt=(h.Plan=ft,dt.prototype.hasPageCacheStats=function(){return 0<this.pageCacheMisses||0<this.pageCacheHits||0<this.pageCacheHitRatio},dt);function dt(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.dbHits=gt("dbHits",e),this.rows=gt("rows",e),this.pageCacheMisses=gt("pageCacheMisses",e),this.pageCacheHits=gt("pageCacheHits",e),this.pageCacheHitRatio=gt("pageCacheHitRatio",e),this.time=gt("time",e),this.children=null!=e.children?e.children.map(function(e){return new dt(e)}):[]}h.ProfiledPlan=pt;h.Stats=function(){this.nodesCreated=0,this.nodesDeleted=0,this.relationshipsCreated=0,this.relationshipsDeleted=0,this.propertiesSet=0,this.labelsAdded=0,this.labelsRemoved=0,this.indexesAdded=0,this.indexesRemoved=0,this.constraintsAdded=0,this.constraintsRemoved=0},bt.prototype.containsUpdates=function(){var r=this;return void 0!==this._containsUpdates?this._containsUpdates:0<Object.keys(this._stats).reduce(function(e,t){return e+r._stats[t]},0)},bt.prototype.updates=function(){return this._stats},bt.prototype.containsSystemUpdates=function(){return void 0!==this._containsSystemUpdates?this._containsSystemUpdates:0<this._systemUpdates},bt.prototype.systemUpdates=function(){return this._systemUpdates};var ht=bt;function bt(r){var n=this;this._stats={nodesCreated:0,nodesDeleted:0,relationshipsCreated:0,relationshipsDeleted:0,propertiesSet:0,labelsAdded:0,labelsRemoved:0,indexesAdded:0,indexesRemoved:0,constraintsAdded:0,constraintsRemoved:0},this._systemUpdates=0,Object.keys(r).forEach(function(e){var t=e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()});t in n._stats?n._stats[t]=mt(r[e]):"systemUpdates"===t?n._systemUpdates=mt(r[e]):"containsSystemUpdates"===t?n._containsSystemUpdates=r[e]:"containsUpdates"===t&&(n._containsUpdates=r[e])}),this._stats=Object.freeze(this._stats)}h.QueryStatistics=ht;_t._constructPosition=function(e){return null==e?{}:{offset:mt(e.offset),line:mt(e.line),column:mt(e.column)}};var yt=_t;function _t(e){this.code=e.code,this.title=e.title,this.description=e.description,this.severity=e.severity,this.position=_t._constructPosition(e.position)}h.Notification=yt;var vt=function(e,t){null!=e&&(this.address=e.address,this.agent=e.version),this.protocolVersion=t};function mt(e){return e instanceof ct.default?e.toInt():"bigint"==typeof e?(0,ct.int)(e).toInt():e}function gt(e,t,r){return void 0===r&&(r=0),!1!==t&&e in t?mt(t[e]):r}h.ServerInfo=vt;h.queryType={READ_ONLY:"r",READ_WRITE:"rw",WRITE_ONLY:"w",SCHEMA_WRITE:"s"},h.default=b;var b={},y={},_={},v=(Object.defineProperty(_,"__esModule",{value:!0}),_.FailedObserver=_.CompletedObserver=void 0,Ot.prototype.subscribe=function(e){Et(e,e.onKeys,[]),Et(e,e.onCompleted,{})},Ot.prototype.cancel=function(){},Ot.prototype.pause=function(){},Ot.prototype.resume=function(){},Ot.prototype.prepareToHandleSingleResponse=function(){},Ot.prototype.markCompleted=function(){},Ot.prototype.onError=function(e){throw Error("CompletedObserver not supposed to call onError")},Ot);function Ot(){}function wt(e){var t=e.error,e=e.onError;this._error=t,this._beforeError=e,this._observers=[],this.onError(t)}function Et(e,t,r){null!=t&&t.bind(e)(r)}_.CompletedObserver=v,wt.prototype.subscribe=function(e){Et(e,e.onError,this._error),this._observers.push(e)},wt.prototype.onError=function(t){Et(this,this._beforeError,t),this._observers.forEach(function(e){return Et(e,e.onError,t)})},wt.prototype.cancel=function(){},wt.prototype.pause=function(){},wt.prototype.resume=function(){},wt.prototype.markCompleted=function(){},wt.prototype.prepareToHandleSingleResponse=function(){},_.FailedObserver=wt;var v={},Pt=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),St=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),m=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Pt(t,e,r);return St(t,e),t},Tt=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},jt=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Ct=(Object.defineProperty(v,"__esModule",{value:!0}),v.Bookmarks=void 0,m(u)),m=(It.empty=function(){return Rt},It.prototype.isEmpty=function(){return 0===this._values.length},It.prototype.values=function(){return this._values},It.prototype[Symbol.iterator]=function(){return this._values[Symbol.iterator]()},It.prototype.asBeginTransactionParameters=function(){var e;return this.isEmpty()?{}:((e={}).bookmarks=this._values,e)},It);function It(e){this._values=function(e){if(null==e||""===e)return[];if(Ct.isString(e))return[e];if(Array.isArray(e)){for(var t=new Set,r=function r(e){return e.reduce(function(e,t){return Array.isArray(t)?e.concat(r(t)):e.concat(t)},[])}(e),n=0;n<r.length;n++){var o=r[n];if(null!=o){if(!Ct.isString(o))throw new TypeError("Bookmark value should be a string, given: '".concat(o,"'"));t.add(o)}}return jt([],Tt(t),!1)}throw new TypeError("Bookmarks should either be a string or a string array, given: '".concat(e,"'"))}(e)}var Rt=new(v.Bookmarks=m)(null);var kt,m={},g=(Object.defineProperty(m,"__esModule",{value:!0}),m.BOLT_PROTOCOL_V5_0=m.BOLT_PROTOCOL_V4_4=m.BOLT_PROTOCOL_V4_3=m.BOLT_PROTOCOL_V4_2=m.BOLT_PROTOCOL_V4_1=m.BOLT_PROTOCOL_V4_0=m.BOLT_PROTOCOL_V3=m.BOLT_PROTOCOL_V2=m.BOLT_PROTOCOL_V1=m.DEFAULT_POOL_MAX_SIZE=m.DEFAULT_POOL_ACQUISITION_TIMEOUT=m.DEFAULT_CONNECTION_TIMEOUT_MILLIS=m.ACCESS_MODE_WRITE=m.ACCESS_MODE_READ=m.FETCH_ALL=void 0,m.FETCH_ALL=-1,m.DEFAULT_POOL_ACQUISITION_TIMEOUT=6e4,m.DEFAULT_POOL_MAX_SIZE=100,m.DEFAULT_CONNECTION_TIMEOUT_MILLIS=3e4,m.ACCESS_MODE_READ="READ",m.ACCESS_MODE_WRITE="WRITE",m.BOLT_PROTOCOL_V1=1,m.BOLT_PROTOCOL_V2=2,m.BOLT_PROTOCOL_V3=3,m.BOLT_PROTOCOL_V4_0=4,m.BOLT_PROTOCOL_V4_1=4.1,m.BOLT_PROTOCOL_V4_2=4.2,m.BOLT_PROTOCOL_V4_3=4.3,m.BOLT_PROTOCOL_V4_4=4.4,m.BOLT_PROTOCOL_V5_0=5,{}),At=r&&r.__extends||(kt=function(e,t){return(kt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}kt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Mt=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},xt=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Nt=(Object.defineProperty(g,"__esModule",{value:!0}),g.EMPTY_CONNECTION_HOLDER=g.ReadOnlyConnectionHolder=g.ConnectionHolder=void 0,t),Ut=u,Dt=m,Lt=v,O=(Bt.prototype.mode=function(){return this._mode},Bt.prototype.database=function(){return this._database},Bt.prototype.setDatabase=function(e){this._database=e},Bt.prototype.bookmarks=function(){return this._bookmarks},Bt.prototype.connectionProvider=function(){return this._connectionProvider},Bt.prototype.referenceCount=function(){return this._referenceCount},Bt.prototype.initializeConnection=function(){return 0!==this._referenceCount||null==this._connectionProvider?(this._referenceCount++,!1):(this._connectionPromise=this._createConnectionPromise(this._connectionProvider),this._referenceCount++,!0)},Bt.prototype._createConnectionPromise=function(o){return Mt(this,void 0,void 0,function(){var t,r,n;return xt(this,function(e){switch(e.label){case 0:return r=(t=o).acquireConnection,n={accessMode:this._mode,database:this._database},[4,this._getBookmarks()];case 1:return[4,r.apply(t,[(n.bookmarks=e.sent(),n.impersonatedUser=this._impersonatedUser,n.onDatabaseNameResolved=this._onDatabaseNameResolved,n)])];case 2:return[2,e.sent()]}})})},Bt.prototype._getBookmarks=function(){return Mt(this,void 0,void 0,function(){return xt(this,function(e){switch(e.label){case 0:return[4,this._getConnectionAcquistionBookmarks()];case 1:return[2,e.sent()]}})})},Bt.prototype.getConnection=function(){return this._connectionPromise},Bt.prototype.releaseConnection=function(){return 0===this._referenceCount?this._connectionPromise:(this._referenceCount--,0===this._referenceCount?this._releaseConnection():this._connectionPromise)},Bt.prototype.close=function(e){return 0===this._referenceCount?this._connectionPromise:(this._referenceCount=0,this._releaseConnection(e))},Bt.prototype._releaseConnection=function(t){return this._connectionPromise=this._connectionPromise.then(function(e){return null!=e?e.isOpen()&&(e.hasOngoingObservableRequests()||!0===t)?e.resetAndFlush().catch(Vt).then(function(){return e._release().then(function(){return null})}):e._release().then(function(){return null}):Promise.resolve(null)}).catch(Vt),this._connectionPromise},Bt);function Bt(e){var e=void 0===e?{}:e,t=e.mode,t=void 0===t?Dt.ACCESS_MODE_WRITE:t,r=e.database,r=void 0===r?"":r,n=e.bookmarks,o=e.connectionProvider,i=e.impersonatedUser,u=e.onDatabaseNameResolved,e=e.getConnectionAcquistionBookmarks;this._mode=t,this._database=null!=r?(0,Ut.assertString)(r,"database"):"",this._bookmarks=null!=n?n:Lt.Bookmarks.empty(),this._connectionProvider=o,this._impersonatedUser=i,this._referenceCount=0,this._connectionPromise=Promise.resolve(null),this._onDatabaseNameResolved=u,this._getConnectionAcquistionBookmarks=null!=e?e:function(){return Promise.resolve(Lt.Bookmarks.empty())}}g.ConnectionHolder=O;At(zt,Ft=O),zt.prototype.initializeConnection=function(){return 0!==this._connectionHolder.referenceCount()},zt.prototype.getConnection=function(){return this._connectionHolder.getConnection()},zt.prototype.releaseConnection=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})},zt.prototype.close=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})};var Ft,Wt,w=zt;function zt(e){var t=Ft.call(this,{mode:e.mode(),database:e.database(),bookmarks:e.bookmarks(),getConnectionAcquistionBookmarks:e._getConnectionAcquistionBookmarks,connectionProvider:e.connectionProvider()})||this;return t._connectionHolder=e,t}function qt(){return null!==Wt&&Wt.apply(this,arguments)||this}g.ReadOnlyConnectionHolder=w,g.default=w,At(qt,Wt=O),qt.prototype.mode=function(){},qt.prototype.database=function(){},qt.prototype.initializeConnection=function(){return!0},qt.prototype.getConnection=function(){return Mt(this,void 0,void 0,function(){return xt(this,function(e){switch(e.label){case 0:return[4,Promise.reject((0,Nt.newError)("This connection holder does not serve connections"))];case 1:return[2,e.sent()]}})})},qt.prototype.releaseConnection=function(){return Mt(this,void 0,void 0,function(){return xt(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})},qt.prototype.close=function(){return Mt(this,void 0,void 0,function(){return xt(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})};w=new qt;function Vt(e){return null}g.EMPTY_CONNECTION_HOLDER=w;var At={},Ht=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Yt=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),O=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Ht(t,e,r);return Yt(t,e),t},Kt=(Object.defineProperty(At,"__esModule",{value:!0}),At.TxConfig=void 0,O(u)),Gt=t,Zt=n,w=(Xt.empty=function(){return Qt},Xt.prototype.isEmpty=function(){return Object.values(this).every(function(e){return null==e})},Xt);function Xt(e){var t;null!=(t=e)&&Kt.assertObject(t,"Transaction config"),this.timeout=function(e){if(Kt.isObject(e)&&null!=e.timeout){Kt.assertNumberOrInteger(e.timeout,"Transaction timeout");e=(0,Zt.int)(e.timeout);if(e.isNegative())throw(0,Gt.newError)("Transaction timeout should not be negative");return e}return null}(e),this.metadata=function(e){if(Kt.isObject(e)&&null!=e.metadata){e=e.metadata;if(Kt.assertObject(e,"config.metadata"),0!==Object.keys(e).length)return e}return null}(e)}var Qt=new(At.TxConfig=w)({});var O={},Jt=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},$t=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},er=(Object.defineProperty(O,"__esModule",{value:!0}),O.TransactionExecutor=void 0,t);function tr(e,t,r,n){this._maxRetryTimeMs=rr(e,3e4),this._initialRetryDelayMs=rr(t,1e3),this._multiplier=rr(r,2),this._jitterFactor=rr(n,.2),this._inFlightTimeoutIds=[],this._verifyAfterConstruction()}function rr(e,t){return null!=e?e:t}tr.prototype.execute=function(n,o,i){var u=this;return new Promise(function(e,t){u._executeTransactionInsidePromise(n,o,e,t,i).catch(t)}).catch(function(e){var t=Date.now(),r=u._initialRetryDelayMs;return u._retryTransactionPromise(n,o,e,t,r,i)})},tr.prototype.close=function(){this._inFlightTimeoutIds.forEach(function(e){return clearTimeout(e)}),this._inFlightTimeoutIds=[]},tr.prototype._retryTransactionPromise=function(o,i,e,r,u,a){var s=this;return Date.now()-r>this._maxRetryTimeMs||!(0,er.isRetriableError)(e)?Promise.reject(e):new Promise(function(e,t){var r=s._computeDelayWithJitter(u),n=setTimeout(function(){s._inFlightTimeoutIds=s._inFlightTimeoutIds.filter(function(e){return e!==n}),s._executeTransactionInsidePromise(o,i,e,t,a).catch(t)},r);s._inFlightTimeoutIds.push(n)}).catch(function(e){var t=u*s._multiplier;return s._retryTransactionPromise(o,i,e,r,t,a)})},tr.prototype._executeTransactionInsidePromise=function(o,i,u,a,s){return Jt(this,void 0,void 0,function(){var t,r,n=this;return $t(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,o()];case 1:return t=e.sent(),[3,3];case 2:return r=e.sent(),a(r),[2];case 3:return r=(null!=s?s:function(e){return e})(t),this._safeExecuteTransactionWork(r,i).then(function(e){return n._handleTransactionWorkSuccess(e,t,u,a)}).catch(function(e){return n._handleTransactionWorkFailure(e,t,a)}),[2]}})})},tr.prototype._safeExecuteTransactionWork=function(e,t){try{var r=t(e);return Promise.resolve(r)}catch(e){return Promise.reject(e)}},tr.prototype._handleTransactionWorkSuccess=function(e,t,r,n){t.isOpen()?t.commit().then(function(){r(e)}).catch(function(e){n(e)}):r(e)},tr.prototype._handleTransactionWorkFailure=function(e,t,r){t.isOpen()?t.rollback().catch(function(e){}).then(function(){return r(e)}).catch(r):r(e)},tr.prototype._computeDelayWithJitter=function(e){var t=e*this._jitterFactor,r=e-t,e=e+t;return Math.random()*(e-r)+r},tr.prototype._verifyAfterConstruction=function(){if(this._maxRetryTimeMs<0)throw(0,er.newError)("Max retry time should be >= 0: "+this._maxRetryTimeMs.toString());if(this._initialRetryDelayMs<0)throw(0,er.newError)("Initial retry delay should >= 0: "+this._initialRetryDelayMs.toString());if(this._multiplier<1)throw(0,er.newError)("Multiplier should be >= 1.0: "+this._multiplier.toString());if(this._jitterFactor<0||1<this._jitterFactor)throw(0,er.newError)("Jitter factor should be in [0.0, 1.0]: "+this._jitterFactor.toFixed())},O.TransactionExecutor=tr;var nr,or,w={},ir=r&&r.__extends||(nr=function(e,t){return(nr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ur=(Object.defineProperty(w,"__esModule",{value:!0}),w.Logger=void 0,t),ar="error",sr="warn",cr="info",lr="debug",fr=((E={})[ar]=0,E[sr]=1,E[cr]=2,E[lr]=3,E),E=(pr.create=function(e){return null!=(null==e?void 0:e.logging)?new pr(function(e){if(null==(null==e?void 0:e.level))return"info";var e=e.level,t=fr[e];if(null!=t||0===t)return e;throw(0,ur.newError)("Illegal logging level: ".concat(e,". Supported levels are: ").concat(Object.keys(fr).toString()))}(e=e.logging),function(e){if(null!=(null==e?void 0:e.logger)){var t=e.logger;if(null!=t&&"function"==typeof t)return t}throw(0,ur.newError)("Illegal logger function: ".concat(null!=(e=null==(t=null==e?void 0:e.logger)?void 0:t.toString())?e:"undefined"))}(e)):this.noOp()},pr.noOp=function(){return hr},pr.prototype.isErrorEnabled=function(){return br(this._level,ar)},pr.prototype.error=function(e){this.isErrorEnabled()&&this._loggerFunction(ar,e)},pr.prototype.isWarnEnabled=function(){return br(this._level,sr)},pr.prototype.warn=function(e){this.isWarnEnabled()&&this._loggerFunction(sr,e)},pr.prototype.isInfoEnabled=function(){return br(this._level,cr)},pr.prototype.info=function(e){this.isInfoEnabled()&&this._loggerFunction(cr,e)},pr.prototype.isDebugEnabled=function(){return br(this._level,lr)},pr.prototype.debug=function(e){this.isDebugEnabled()&&this._loggerFunction(lr,e)},pr);function pr(e,t){this._level=e,this._loggerFunction=t}function dr(){return or.call(this,cr,function(e,t){})||this}w.Logger=E,ir(dr,or=E),dr.prototype.isErrorEnabled=function(){return!1},dr.prototype.error=function(e){},dr.prototype.isWarnEnabled=function(){return!1},dr.prototype.warn=function(e){},dr.prototype.isInfoEnabled=function(){return!1},dr.prototype.info=function(e){},dr.prototype.isDebugEnabled=function(){return!1},dr.prototype.debug=function(e){};var hr=new dr;function br(e,t){return fr[e]>=fr[t]}var ir={},yr=r&&r.__assign||function(){return(yr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},_r=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},vr=(Object.defineProperty(ir,"__esModule",{value:!0}),ir.Url=ir.formatIPv6Address=ir.formatIPv4Address=ir.defaultPortForScheme=ir.parseDatabaseUrl=void 0,u),mr=7687,gr=7474,Or=7473,wr=function(e,t,r,n,o){this.scheme=e,this.host=t,this.port=r,this.hostAndPort=n,this.query=o};function Er(e,t,r){if(""===(e=(null!=e?e:"").trim()))throw new Error("Illegal empty ".concat(t," in URL query '").concat(r,"'"));return e}function Pr(e){var t="["===e.charAt(0),r="]"===e.charAt(e.length-1);if(t||r){if(t&&r)return e;throw new Error("Illegal IPv6 address ".concat(e))}return"[".concat(e,"]")}function Sr(e){return"http"===e?gr:"https"===e?Or:mr}ir.Url=wr,ir.parseDatabaseUrl=function(e){(0,vr.assertString)(e,"URL");var t,r=function(e){function u(e,t){t=e.indexOf(t);return 0<=t?[e.substring(0,t),e[t],e.substring(t+1)]:[e,"",""]}function t(e){var t,r={},n=((t="@")===(t=0<=(t=(o=e).lastIndexOf(t))?[o.substring(0,t),o[t],o.substring(t+1)]:["","",o])[1]&&(r.userInfo=decodeURIComponent(t[0]),e=t[2]),_r((o="]",n=u(n=e,i="["),[(i=u(n[2],o))[0],i[2]]),2)),o=n[0],i=n[1];return""!==o?(r.host=o,t=u(i,":")):(t=u(e,":"),r.host=t[0]),":"===t[1]&&(r.port=t[2]),r}var r,n={};":"===(r=u(e,":"))[1]&&(n.scheme=decodeURIComponent(r[0]),e=r[2]);"#"===(r=u(e,"#"))[1]&&(n.fragment=decodeURIComponent(r[2]),e=r[0]);"?"===(r=u(e,"?"))[1]&&(n.query=r[2],e=r[0]);e.startsWith("//")?(r=u(e.substr(2),"/"),(n=yr(yr({},n),t(r[0]))).path=r[1]+r[2]):n.path=e;return n}((n=(n=(n=e).trim()).includes("://")?{schemeMissing:!1,url:n}:{schemeMissing:!0,url:"none://".concat(n)}).url),n=n.schemeMissing?null:function(e){if(null==e)return null;":"===(e=e.trim()).charAt(e.length-1)&&(e=e.substring(0,e.length-1));return e}(r.scheme),o=function(e){if(null!=e)return e.trim();throw new Error("Unable to extract host from null or undefined URL")}(r.host),i=function(e){if(""!==e&&null!=e)return e.includes(":")?Pr(e):e;throw new Error("Illegal host ".concat(e))}(o),u=function(e,t){e="string"==typeof e?parseInt(e,10):e;return null==e||isNaN(e)?Sr(t):e}(r.port,n),i="".concat(i,":").concat(u),r=function(e,r){var e=null!=e?function(e){"?"===(null==(e=(null!=e?e:"").trim())?void 0:e.charAt(0))&&(e=e.substring(1,e.length));return e}(e):null,n={};null!=e&&e.split("&").forEach(function(e){e=e.split("=");if(2!==e.length)throw new Error("Invalid parameters: '".concat(e.toString(),"' in URL '").concat(r,"'."));var t=Er(e[0],"key",r),e=Er(e[1],"value",r);if(void 0!==n[t])throw new Error("Duplicated query parameters with key '".concat(t,"' in URL '").concat(r,"'"));n[t]=e});return n}(null!=(t=r.query)?t:"string"==typeof(t=r.resourceName)?_r(t.split("?"),2)[1]:null,e);return new wr(n,o,u,i,r)},ir.formatIPv4Address=function(e,t){return"".concat(e,":").concat(t)},ir.formatIPv6Address=function(e,t){return e=Pr(e),"".concat(e,":").concat(t)},ir.defaultPortForScheme=Sr;var E={},Tr=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),jr=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Cr=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Tr(t,e,r);return jr(t,e),t},Ir=(Object.defineProperty(E,"__esModule",{value:!0}),E.ServerAddress=void 0,u),Rr=Cr(ir);function kr(e,t,r,n){this._host=(0,Ir.assertString)(e,"host"),this._resolved=null!=t?(0,Ir.assertString)(t,"resolved"):null,this._port=(0,Ir.assertNumber)(r,"port"),this._hostPort=n,this._stringValue=null!=t?"".concat(n,"(").concat(t,")"):"".concat(n)}kr.prototype.host=function(){return this._host},kr.prototype.resolvedHost=function(){return null!=this._resolved?this._resolved:this._host},kr.prototype.port=function(){return this._port},kr.prototype.resolveWith=function(e){return new kr(this._host,e,this._port,this._hostPort)},kr.prototype.asHostPort=function(){return this._hostPort},kr.prototype.asKey=function(){return this._hostPort},kr.prototype.toString=function(){return this._stringValue},kr.fromUrl=function(e){e=Rr.parseDatabaseUrl(e);return new kr(e.host,null,e.port,e.hostAndPort)},E.ServerAddress=kr;var Cr={},Ar={};function Mr(){}Object.defineProperty(Ar,"__esModule",{value:!0}),Mr.prototype.resolve=function(){throw new Error("Abstract function")},Mr.prototype._resolveToItself=function(e){return Promise.resolve([e])},Ar.default=Mr;var P={},xr=(Object.defineProperty(P,"__esModule",{value:!0}),E);function Nr(e){return Promise.resolve([e])}function Ur(e){this._resolverFunction=null!=e?e:Nr}Ur.prototype.resolve=function(t){var r=this;return new Promise(function(e){return e(r._resolverFunction(t.asHostPort()))}).then(function(e){if(Array.isArray(e))return e.map(function(e){return xr.ServerAddress.fromUrl(e)});throw new TypeError("Configured resolver function should either return an array of addresses or a Promise resolved with an array of addresses."+"Each address is '<host>:<port>'. Got: ".concat(e))})},P.default=Ur;function Dr(e){console.log("Uncaught error when processing result: "+e)}function Lr(e){}function Br(e){}var S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ar=(Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.ConfiguredCustomResolver=Cr.BaseHostNameResolver=void 0,S(Ar)),Ar=(Cr.BaseHostNameResolver=Ar.default,S(P)),Fr=(Cr.ConfiguredCustomResolver=Ar.default,r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]})),Wr=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),S=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Fr(t,e,r);return Wr(t,e),t},Ar=(Object.defineProperty(y,"__esModule",{value:!0}),y.objectUtil=y.resolver=y.serverAddress=y.urlUtil=y.logger=y.transactionExecutor=y.txConfig=y.connectionHolder=y.constants=y.bookmarks=y.observer=y.temporalUtil=y.util=void 0,S(u)),Ar=(y.util=Ar,S(o)),o=(y.temporalUtil=Ar,S(_)),Ar=(y.observer=o,S(v)),o=(y.bookmarks=Ar,S(m)),Ar=(y.constants=o,S(g)),o=(y.connectionHolder=Ar,S(At)),Ar=(y.txConfig=o,S(O)),o=(y.transactionExecutor=Ar,S(w)),Ar=(y.logger=o,S(ir)),o=(y.urlUtil=Ar,S(E)),ir=(y.serverAddress=o,S(Cr)),Ar=(y.resolver=ir,S(a)),zr=(y.objectUtil=Ar,r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})}),qr=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},E=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Vr=(Object.defineProperty(b,"__esModule",{value:!0}),E(h)),Hr=y,Yr=t,Kr=Hr.connectionHolder.EMPTY_CONNECTION_HOLDER;function Gr(e,t,r,n,o){var i;void 0===o&&(o={high:Number.MAX_VALUE,low:Number.MAX_VALUE}),this._stack=null==(i=new Error("")).stack?null:i.stack.replace(/^Error(\n\r)*/,""),this._streamObserverPromise=e,this._p=null,this._query=t,this._parameters=null!=r?r:{},this._connectionHolder=null!=n?n:Kr,this._keys=null,this._summary=null,this._error=null,this._watermarks=o}Gr.prototype.keys=function(){var n=this;return null!==this._keys?Promise.resolve(this._keys):null!==this._error?Promise.reject(this._error):new Promise(function(t,r){n._streamObserverPromise.then(function(e){return e.subscribe(n._decorateObserver({onKeys:function(e){return t(e)},onError:function(e){return r(e)}}))}).catch(r)})},Gr.prototype.summary=function(){var n=this;return null!==this._summary?Promise.resolve(this._summary):null!==this._error?Promise.reject(this._error):new Promise(function(t,r){n._streamObserverPromise.then(function(e){e.cancel(),e.subscribe(n._decorateObserver({onCompleted:function(e){return t(e)},onError:function(e){return r(e)}}))}).catch(r)})},Gr.prototype._getOrCreatePromise=function(){var e=this;return null==this._p&&(this._p=new Promise(function(t,r){var n=[];e.subscribe({onNext:function(e){n.push(e)},onCompleted:function(e){t({records:n,summary:e})},onError:function(e){r(e)}})})),this._p},Gr.prototype[Symbol.asyncIterator]=function(){var e,n=this;if(!this.isOpen())return e=(0,Yr.newError)("Result is already consumed"),{next:function(){return Promise.reject(e)},peek:function(){return Promise.reject(e)}};function o(){return zr(n,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:return void 0!==u.queuedObserver?[3,2]:(u.queuedObserver=this._createQueuedResultObserver(r),t=u,[4,this._subscribe(u.queuedObserver,!0).catch(function(){})]);case 1:t.streaming=e.sent(),r(),e.label=2;case 2:return[2,u.queuedObserver]}})})}function i(e){if(void 0===e)throw(0,Yr.newError)("InvalidState: Result stream finished without Summary",Yr.PROTOCOL_ERROR);return 1}var u={paused:!0,firstRun:!0,finished:!1},r=function(){var e,t;null!=u.streaming&&(e=(t=null!=(t=null==(t=u.queuedObserver)?void 0:t.size)?t:0)>=n._watermarks.high,t=t<=n._watermarks.low,e&&!u.paused?(u.paused=!0,u.streaming.pause()):(t&&u.paused||u.firstRun&&!e)&&(u.firstRun=!1,u.paused=!1,u.streaming.resume()))};return{next:function(){return zr(n,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:return u.finished&&i(u.summary)?[2,{done:!0,value:u.summary}]:[4,o()];case 1:return[4,e.sent().dequeue()];case 2:return!0===(t=e.sent()).done&&(u.finished=t.done,u.summary=t.value),[2,t]}})})},return:function(r){return zr(n,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:return u.finished&&i(u.summary)?[2,{done:!0,value:null!=r?r:u.summary}]:(null!=(t=u.streaming)&&t.cancel(),[4,o()]);case 1:return[4,e.sent().dequeueUntilDone()];case 2:return t=e.sent(),u.finished=!0,t.value=null!=r?r:t.value,u.summary=t.value,[2,t]}})})},peek:function(){return zr(n,void 0,void 0,function(){return qr(this,function(e){switch(e.label){case 0:return u.finished&&i(u.summary)?[2,{done:!0,value:u.summary}]:[4,o()];case 1:return[4,e.sent().head()];case 2:return[2,e.sent()]}})})}}},Gr.prototype.then=function(e,t){return this._getOrCreatePromise().then(e,t)},Gr.prototype.catch=function(e){return this._getOrCreatePromise().catch(e)},Gr.prototype.finally=function(e){return this._getOrCreatePromise().finally(e)},Gr.prototype.subscribe=function(e){this._subscribe(e).catch(function(){})},Gr.prototype.isOpen=function(){return null===this._summary&&null===this._error},Gr.prototype._subscribe=function(e,t){void 0===t&&(t=!1);var r=this._decorateObserver(e);return this._streamObserverPromise.then(function(e){return t&&e.pause(),e.subscribe(r),e}).catch(function(e){return null!=r.onError&&r.onError(e),Promise.reject(e)})},Gr.prototype._decorateObserver=function(n){var e,o=this,t=null!=(e=n.onCompleted)?e:Lr,i=null!=(e=n.onError)?e:Dr,r=null!=(e=n.onKeys)?e:Br;return{onNext:null!=n.onNext?n.onNext.bind(n):void 0,onKeys:function(e){return o._keys=e,r.call(n,e)},onCompleted:function(e){o._releaseConnectionAndGetSummary(e).then(function(e){return null!==o._summary?t.call(n,o._summary):(o._summary=e,t.call(n,e))}).catch(i)},onError:function(r){o._connectionHolder.releaseConnection().then(function(){var e,t;e=r,null!=(t=o._stack)&&(e.stack=e.toString()+"\n"+t),o._error=r,i.call(n,r)}).catch(i)}}},Gr.prototype._cancel=function(){null===this._summary&&null===this._error&&this._streamObserverPromise.then(function(e){return e.cancel()}).catch(function(){})},Gr.prototype._releaseConnectionAndGetSummary=function(t){var e=Hr.util.validateQueryAndParameters(this._query,this._parameters,{skipAsserts:!0}),r=e.validatedQuery,n=e.params,o=this._connectionHolder;return o.getConnection().then(function(t){return o.releaseConnection().then(function(){var e;return null==(e=null==t?void 0:t.protocol())?void 0:e.version})},function(e){}).then(function(e){return new Vr.default(r,n,t,e)})},Gr.prototype._createQueuedResultObserver=function(n){var e=this;function o(){var r={};return r.promise=new Promise(function(e,t){r.resolve=e,r.reject=t}),r}function i(e){return e instanceof Error}function r(){var r;return zr(this,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:if(0<u.length){if(t=null!=(r=u.shift())?r:(0,Yr.newError)("Unexpected empty buffer",Yr.PROTOCOL_ERROR),n(),i(t))throw t;return[2,t]}return a.resolvable=o(),[4,a.resolvable.promise];case 1:return[2,e.sent()]}})})}var u=[],a={resolvable:null},t={onNext:function(e){t._push({done:!1,value:e})},onCompleted:function(e){t._push({done:!0,value:e})},onError:function(e){t._push(e)},_push:function(e){var t;null!==a.resolvable?(t=a.resolvable,a.resolvable=null,i(e)?t.reject(e):t.resolve(e)):(u.push(e),n())},dequeue:r,dequeueUntilDone:function(){return zr(e,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:return[4,r()];case 1:return!0===(t=e.sent()).done?[2,t]:[3,0];case 2:return[2]}})})},head:function(){return zr(e,void 0,void 0,function(){var t,r;return qr(this,function(e){switch(e.label){case 0:if(0<u.length){if(i(t=u[0]))throw t;return[2,t]}a.resolvable=o(),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.resolvable.promise];case 2:return t=e.sent(),u.unshift(t),[2,t];case 3:throw r=e.sent(),u.unshift(r),r;case 4:return n(),[7];case 5:return[2]}})})},get size(){return u.length}};return t},b.default=Gr;o={};function Zr(){}Object.defineProperty(o,"__esModule",{value:!0}),Zr.prototype.acquireConnection=function(e){throw Error("Not implemented")},Zr.prototype.supportsMultiDb=function(){throw Error("Not implemented")},Zr.prototype.supportsTransactionConfig=function(){throw Error("Not implemented")},Zr.prototype.supportsUserImpersonation=function(){throw Error("Not implemented")},Zr.prototype.verifyConnectivityAndGetServerInfo=function(e){throw Error("Not implemented")},Zr.prototype.getNegotiatedProtocolVersion=function(){throw Error("Not Implemented")},Zr.prototype.close=function(){throw Error("Not implemented")},o.default=Zr;Cr={};function Xr(){}Object.defineProperty(Cr,"__esModule",{value:!0}),Object.defineProperty(Xr.prototype,"id",{get:function(){return""},enumerable:!1,configurable:!0}),Object.defineProperty(Xr.prototype,"databaseId",{get:function(){return""},enumerable:!1,configurable:!0}),Object.defineProperty(Xr.prototype,"server",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(Xr.prototype,"address",{get:function(){},enumerable:!1,configurable:!0}),Object.defineProperty(Xr.prototype,"version",{get:function(){},enumerable:!1,configurable:!0}),Xr.prototype.isOpen=function(){return!1},Xr.prototype.protocol=function(){throw Error("Not implemented")},Xr.prototype.connect=function(e,t){throw Error("Not implemented")},Xr.prototype.write=function(e,t,r){throw Error("Not implemented")},Xr.prototype.resetAndFlush=function(){throw Error("Not implemented")},Xr.prototype.hasOngoingObservableRequests=function(){throw Error("Not implemented")},Xr.prototype.close=function(){throw Error("Not implemented")},Xr.prototype._release=function(){return Promise.resolve()},Cr.default=Xr;var ir={},Qr=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Jr=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$r=(Object.defineProperty(ir,"__esModule",{value:!0}),u),en=g,tn=v,rn=At,nn=_,on=t,un=S(b);function an(e){var t=e.connectionHolder,r=e.onClose,n=e.onBookmarks,o=e.onConnection,i=e.reactive,u=e.fetchSize,a=e.impersonatedUser,s=e.highRecordWatermark,e=e.lowRecordWatermark,c=this;this._connectionHolder=t,this._reactive=i,this._state=sn.ACTIVE,this._onClose=r,this._onBookmarks=n,this._onConnection=o,this._onError=this._onErrorCallback.bind(this),this._fetchSize=u,this._onComplete=this._onCompleteCallback.bind(this),this._results=[],this._impersonatedUser=a,this._lowRecordWatermak=e,this._highRecordWatermark=s,this._bookmarks=tn.Bookmarks.empty(),this._acceptActive=function(){},this._activePromise=new Promise(function(e,t){c._acceptActive=e})}an.prototype._begin=function(o,i,u){var t=this;this._connectionHolder.getConnection().then(function(n){return Qr(t,void 0,void 0,function(){var t,r=this;return Jr(this,function(e){switch(e.label){case 0:return(this._onConnection(),null==n)?[3,2]:(t=this,[4,o()]);case 1:return t._bookmarks=e.sent(),[2,n.protocol().beginTransaction({bookmarks:this._bookmarks,txConfig:i,mode:this._connectionHolder.mode(),database:this._connectionHolder.database(),impersonatedUser:this._impersonatedUser,beforeError:function(e){return null!=u&&u.onError(e),r._onError(e)},afterComplete:function(e){return null!=u&&u.onComplete(e),r._onComplete(e)}})];case 2:throw(0,on.newError)("No connection available")}})})}).catch(function(e){null!=u&&u.onError(e),t._onError(e).catch(function(){})}).finally(function(){return t._acceptActive()})},an.prototype.run=function(e,t){e=(0,$r.validateQueryAndParameters)(e,t),t=e.validatedQuery,e=e.params,t=this._state.run(t,e,{connectionHolder:this._connectionHolder,onError:this._onError,onComplete:this._onComplete,onConnection:this._onConnection,reactive:this._reactive,fetchSize:this._fetchSize,highRecordWatermark:this._highRecordWatermark,lowRecordWatermark:this._lowRecordWatermak,preparationJob:this._activePromise});return this._results.push(t),t},an.prototype.commit=function(){var t=this,r=this._state.commit({connectionHolder:this._connectionHolder,onError:this._onError,onComplete:function(e){return t._onCompleteCallback(e,t._bookmarks)},onConnection:this._onConnection,pendingResults:this._results,preparationJob:this._activePromise});return this._state=r.state,this._onClose(),new Promise(function(e,t){r.result.subscribe({onCompleted:function(){return e()},onError:function(e){return t(e)}})})},an.prototype.rollback=function(){var r=this._state.rollback({connectionHolder:this._connectionHolder,onError:this._onError,onComplete:this._onComplete,onConnection:this._onConnection,pendingResults:this._results,preparationJob:this._activePromise});return this._state=r.state,this._onClose(),new Promise(function(e,t){r.result.subscribe({onCompleted:function(){return e()},onError:function(e){return t(e)}})})},an.prototype.isOpen=function(){return this._state===sn.ACTIVE},an.prototype.close=function(){return Qr(this,void 0,void 0,function(){return Jr(this,function(e){switch(e.label){case 0:return this.isOpen()?[4,this.rollback()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},an.prototype._onErrorCallback=function(){return this._state=sn.FAILED,this._onClose(),this._connectionHolder.releaseConnection()},an.prototype._onCompleteCallback=function(e,t){this._onBookmarks(new tn.Bookmarks(null==e?void 0:e.bookmark),null!=t?t:tn.Bookmarks.empty(),null==e?void 0:e.db)};var sn={ACTIVE:{commit:function(e){return{result:cn(!0,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:sn.SUCCEEDED}},rollback:function(e){return{result:cn(!1,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:sn.ROLLED_BACK}},run:function(t,r,e){var n=e.connectionHolder,o=e.onError,i=e.onComplete,u=e.onConnection,a=e.reactive,s=e.fetchSize,c=e.highRecordWatermark,l=e.lowRecordWatermark,e=e.preparationJob,f=null!=e?e:Promise.resolve();return ln(n.getConnection().then(function(e){return f.then(function(){return e})}).then(function(e){if(u(),null!=e)return e.protocol().run(t,r,{bookmarks:tn.Bookmarks.empty(),txConfig:rn.TxConfig.empty(),beforeError:o,afterComplete:i,reactive:a,fetchSize:s,highRecordWatermark:c,lowRecordWatermark:l});throw(0,on.newError)("No connection available")}).catch(function(e){return new nn.FailedObserver({error:e,onError:o})}),t,r,n,c,l)}},FAILED:{commit:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination."),onError:r}),"COMMIT",{},t,0,0),state:sn.FAILED}},rollback:function(e){var t=e.connectionHolder;return e.onError,e.onComplete,{result:ln(new nn.CompletedObserver,"ROLLBACK",{},t,0,0),state:sn.FAILED}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,ln(new nn.FailedObserver({error:(0,on.newError)("Cannot run query in this transaction, because it has been rolled back either because of an error or explicit termination."),onError:o}),e,t,n,0,0)}},SUCCEEDED:{commit:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot commit this transaction, because it has already been committed."),onError:r}),"COMMIT",{},en.EMPTY_CONNECTION_HOLDER,0,0),state:sn.SUCCEEDED,connectionHolder:t}},rollback:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot rollback this transaction, because it has already been committed."),onError:r}),"ROLLBACK",{},en.EMPTY_CONNECTION_HOLDER,0,0),state:sn.SUCCEEDED,connectionHolder:t}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,ln(new nn.FailedObserver({error:(0,on.newError)("Cannot run query in this transaction, because it has already been committed."),onError:o}),e,t,n,0,0)}},ROLLED_BACK:{commit:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot commit this transaction, because it has already been rolled back."),onError:r}),"COMMIT",{},t,0,0),state:sn.ROLLED_BACK}},rollback:function(e){var t=e.connectionHolder;return e.onError,e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot rollback this transaction, because it has already been rolled back.")}),"ROLLBACK",{},t,0,0),state:sn.ROLLED_BACK}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,ln(new nn.FailedObserver({error:(0,on.newError)("Cannot run query in this transaction, because it has already been rolled back."),onError:o}),e,t,n,0,0)}}};function cn(r,e,n,o,i,u,t){var a=null!=t?t:Promise.resolve(),t=e.getConnection().then(function(e){return a.then(function(){return e})}).then(function(t){return i(),u.forEach(function(e){return e._cancel()}),Promise.all(u.map(function(e){return e.summary()})).then(function(e){if(null!=t)return r?t.protocol().commitTransaction({beforeError:n,afterComplete:o}):t.protocol().rollbackTransaction({beforeError:n,afterComplete:o});throw(0,on.newError)("No connection available")})}).catch(function(e){return new nn.FailedObserver({error:e,onError:n})});return new un.default(t,r?"COMMIT":"ROLLBACK",{},e,{high:Number.MAX_VALUE,low:Number.MAX_VALUE})}function ln(e,t,r,n,o,i){return void 0===n&&(n=en.EMPTY_CONNECTION_HOLDER),new un.default(Promise.resolve(e),t,r,new en.ReadOnlyConnectionHolder(null!=n?n:en.EMPTY_CONNECTION_HOLDER),{low:i,high:o})}ir.default=an;a={};function fn(e){e=e.run;this._run=e}Object.defineProperty(a,"__esModule",{value:!0}),fn.fromTransaction=function(e){return new fn({run:e.run.bind(e)})},fn.prototype.run=function(e,t){return this._run(e,t)},a.default=fn;var pn,dn,hn,Ar={},E=r&&r.__extends||(pn=function(e,t){return(pn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),bn=r&&r.__assign||function(){return(bn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},S=(Object.defineProperty(Ar,"__esModule",{value:!0}),S(ir)),S=(hn=S.default,E(yn,hn),yn.prototype.then=function(e,t){return this._getOrCreateBeginPromise().then(e,t)},yn.prototype.catch=function(e){return this._getOrCreateBeginPromise().catch(e)},yn.prototype.finally=function(e){return this._getOrCreateBeginPromise().finally(e)},yn.prototype._getOrCreateBeginPromise=function(){var r=this;return null==this._beginPromise&&(this._beginPromise=new Promise(function(e,t){r._resolve=e,r._reject=t,null!=r._beginError&&t(r._beginError),null!=r._beginMetadata&&e(r._toTransaction())})),this._beginPromise},yn.prototype._toTransaction=function(){return bn(bn({},this),{run:hn.prototype.run.bind(this),commit:hn.prototype.commit.bind(this),rollback:hn.prototype.rollback.bind(this),close:hn.prototype.close.bind(this),isOpen:hn.prototype.isOpen.bind(this),_begin:this._begin.bind(this)})},yn.prototype._begin=function(e,t){return hn.prototype._begin.call(this,e,t,{onError:this._onBeginError.bind(this),onComplete:this._onBeginMetadata.bind(this)})},yn.prototype._onBeginError=function(e){this._beginError=e,null!=this._reject&&this._reject(e)},yn.prototype._onBeginMetadata=function(e){this._beginMetadata=null!=e?e:{},null!=this._resolve&&this._resolve(this._toTransaction())},yn);function yn(e){var t=e.connectionHolder,r=e.onClose,n=e.onBookmarks,o=e.onConnection,i=e.reactive,u=e.fetchSize,a=e.impersonatedUser,s=e.highRecordWatermark,e=e.lowRecordWatermark,t=hn.call(this,{connectionHolder:t,onClose:r,onBookmarks:n,onConnection:o,reactive:i,fetchSize:u,impersonatedUser:a,highRecordWatermark:s,lowRecordWatermark:e})||this;return t[dn]="TransactionPromise",t}dn=Symbol.toStringTag,Ar.default=S;var E={},_n=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},vn=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},mn=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},gn=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},On=(Object.defineProperty(E,"__esModule",{value:!0}),_),wn=u,En=m,Pn=t,Sn=S(b),Tn=g,jn=O,Cn=v,In=At,Rn=S(Ar),kn=S(a);function An(e){var t=e.mode,r=e.connectionProvider,n=e.bookmarks,o=e.database,i=e.config,u=e.reactive,a=e.fetchSize,s=e.impersonatedUser,e=e.bookmarkManager,t=(this._mode=t,this._database=o,this._reactive=u,this._fetchSize=a,this._onDatabaseNameResolved=this._onDatabaseNameResolved.bind(this),this._getConnectionAcquistionBookmarks=this._getConnectionAcquistionBookmarks.bind(this),this._readConnectionHolder=new Tn.ConnectionHolder({mode:En.ACCESS_MODE_READ,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved,getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks}),this._writeConnectionHolder=new Tn.ConnectionHolder({mode:En.ACCESS_MODE_WRITE,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved,getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks}),this._open=!0,this._hasTx=!1,this._impersonatedUser=s,this._lastBookmarks=null!=n?n:Cn.Bookmarks.empty(),this._configuredBookmarks=this._lastBookmarks,this._transactionExecutor=function(e){e=null!=(e=null==e?void 0:e.maxTransactionRetryTime)?e:null;return new jn.TransactionExecutor(e)}(i),this._databaseNameResolved=""!==this._database,this._calculateWatermaks());this._lowRecordWatermark=t.low,this._highRecordWatermark=t.high,this._results=[],this._bookmarkManager=e}An.prototype.run=function(e,t,r){var o=this,e=(0,wn.validateQueryAndParameters)(e,t),i=e.validatedQuery,u=e.params,a=null!=r?new In.TxConfig(r):In.TxConfig.empty(),t=this._run(i,u,function(n){return _n(o,void 0,void 0,function(){var t,r=this;return vn(this,function(e){switch(e.label){case 0:return[4,this._bookmarks()];case 1:return t=e.sent(),this._assertSessionIsOpen(),[2,n.protocol().run(i,u,{bookmarks:t,txConfig:a,mode:this._mode,database:this._database,impersonatedUser:this._impersonatedUser,afterComplete:function(e){return r._onCompleteCallback(e,t)},reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark})]}})})});return this._results.push(t),t},An.prototype._run=function(e,t,r){var n=this._connectionHolderWithMode(this._mode),o=this._open?!this._hasTx&&n.initializeConnection()?n.getConnection().then(function(e){return r(e)}).catch(function(e){return Promise.resolve(new On.FailedObserver({error:e}))}):Promise.resolve(new On.FailedObserver({error:(0,Pn.newError)("Queries cannot be run directly on a session with an open transaction; either run from within the transaction or use a different session.")})):Promise.resolve(new On.FailedObserver({error:(0,Pn.newError)("Cannot run query in a closed session.")})),i={high:this._highRecordWatermark,low:this._lowRecordWatermark};return new Sn.default(o,e,t,n,i)},An.prototype._acquireConnection=function(t){var e=this,r=this._connectionHolderWithMode(this._mode),n=this._open?!this._hasTx&&r.initializeConnection()?r.getConnection().then(function(e){return t(e)}).then(function(t){return _n(e,void 0,void 0,function(){return vn(this,function(e){switch(e.label){case 0:return[4,r.releaseConnection()];case 1:return e.sent(),[2,t]}})})}):Promise.reject((0,Pn.newError)("Queries cannot be run directly on a session with an open transaction; either run from within the transaction or use a different session.")):Promise.reject((0,Pn.newError)("Cannot run query in a closed session."));return n},An.prototype.beginTransaction=function(e){var t=In.TxConfig.empty();return null!=e&&(t=new In.TxConfig(e)),this._beginTransaction(this._mode,t)},An.prototype._beginTransaction=function(e,t){var n=this;if(!this._open)throw(0,Pn.newError)("Cannot begin a transaction on a closed session.");if(this._hasTx)throw(0,Pn.newError)("You cannot begin a transaction on a session with an open transaction; either run from within the transaction or use a different session.");e=An._validateSessionMode(e),e=this._connectionHolderWithMode(e),e.initializeConnection(),this._hasTx=!0,e=new Rn.default({connectionHolder:e,impersonatedUser:this._impersonatedUser,onClose:this._transactionClosed.bind(this),onBookmarks:function(e,t,r){return n._updateBookmarks(e,t,r)},onConnection:this._assertSessionIsOpen.bind(this),reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark});return e._begin(function(){return n._bookmarks()},t),e},An.prototype._assertSessionIsOpen=function(){if(!this._open)throw(0,Pn.newError)("You cannot run more transactions on a closed session.")},An.prototype._transactionClosed=function(){this._hasTx=!1},An.prototype.lastBookmark=function(){return this.lastBookmarks()},An.prototype.lastBookmarks=function(){return this._lastBookmarks.values()},An.prototype._bookmarks=function(){var r;return _n(this,void 0,void 0,function(){var t;return vn(this,function(e){switch(e.label){case 0:return[4,null==(r=this._bookmarkManager)?void 0:r.getBookmarks()];case 1:return void 0===(t=e.sent())?[2,this._lastBookmarks]:[2,new Cn.Bookmarks(gn(gn([],mn(t),!1),mn(this._configuredBookmarks),!1))]}})})},An.prototype.readTransaction=function(e,t){t=new In.TxConfig(t);return this._runTransaction(En.ACCESS_MODE_READ,t,e)},An.prototype.writeTransaction=function(e,t){t=new In.TxConfig(t);return this._runTransaction(En.ACCESS_MODE_WRITE,t,e)},An.prototype._runTransaction=function(e,t,r){var n=this;return this._transactionExecutor.execute(function(){return n._beginTransaction(e,t)},r)},An.prototype.executeRead=function(e,t){t=new In.TxConfig(t);return this._executeInTransaction(En.ACCESS_MODE_READ,t,e)},An.prototype.executeWrite=function(e,t){t=new In.TxConfig(t);return this._executeInTransaction(En.ACCESS_MODE_WRITE,t,e)},An.prototype._executeInTransaction=function(e,t,r){var n=this;return this._transactionExecutor.execute(function(){return n._beginTransaction(e,t)},r,kn.default.fromTransaction)},An.prototype._onDatabaseNameResolved=function(e){this._databaseNameResolved||(this._database=e=null!=e?e:"",this._readConnectionHolder.setDatabase(e),this._writeConnectionHolder.setDatabase(e),this._databaseNameResolved=!0)},An.prototype._getConnectionAcquistionBookmarks=function(){var r;return _n(this,void 0,void 0,function(){var t;return vn(this,function(e){switch(e.label){case 0:return[4,null==(r=this._bookmarkManager)?void 0:r.getBookmarks()];case 1:return void 0===(t=e.sent())?[2,this._lastBookmarks]:[2,new Cn.Bookmarks(gn(gn([],mn(this._configuredBookmarks),!1),mn(t),!1))]}})})},An.prototype._updateBookmarks=function(e,t,r){var n;null==e||e.isEmpty()||(null!=(n=this._bookmarkManager)&&n.updateBookmarks(null!=(n=null==t?void 0:t.values())?n:[],null!=(t=null==e?void 0:e.values())?t:[]),this._lastBookmarks=e,this._configuredBookmarks=Cn.Bookmarks.empty())},An.prototype.close=function(){return _n(this,void 0,void 0,function(){return vn(this,function(e){switch(e.label){case 0:return this._open?(this._open=!1,this._results.forEach(function(e){return e._cancel()}),this._transactionExecutor.close(),[4,this._readConnectionHolder.close(this._hasTx)]):[3,3];case 1:return e.sent(),[4,this._writeConnectionHolder.close(this._hasTx)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},An.prototype._connectionHolderWithMode=function(e){if(e===En.ACCESS_MODE_READ)return this._readConnectionHolder;if(e===En.ACCESS_MODE_WRITE)return this._writeConnectionHolder;throw(0,Pn.newError)("Unknown access mode: "+e)},An.prototype._onCompleteCallback=function(e,t){this._updateBookmarks(new Cn.Bookmarks(e.bookmark),t,e.db)},An.prototype._calculateWatermaks=function(){return this._fetchSize===En.FETCH_ALL?{low:Number.MAX_VALUE,high:Number.MAX_VALUE}:{low:.3*this._fetchSize,high:.7*this._fetchSize}},An._validateSessionMode=function(e){e=null!=e?e:En.ACCESS_MODE_WRITE;if(e!==En.ACCESS_MODE_READ&&e!==En.ACCESS_MODE_WRITE)throw(0,Pn.newError)("Illegal session mode "+e);return e},E.default=An;var _={},g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Mn=(Object.defineProperty(_,"__esModule",{value:!0}),_.SessionConfig=_.WRITE=_.READ=_.Driver=void 0,v),xn=g(P),Nn=m,Un=w,Dn=g(E),Ln=u,Bn=36e5,Fn=1e3,Wn=Nn.ACCESS_MODE_READ,zn=(_.READ=Wn,Nn.ACCESS_MODE_WRITE),qn=(_.WRITE=zn,0),O=(_.SessionConfig=function(){this.defaultAccessMode=zn,this.bookmarks=[],this.database="",this.impersonatedUser=void 0,this.fetchSize=void 0,this.bookmarkManager=void 0},Vn.prototype.verifyConnectivity=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:Wn})},Vn.prototype.getServerInfo=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:Wn})},Vn.prototype.supportsMultiDb=function(){return this._getOrCreateConnectionProvider().supportsMultiDb()},Vn.prototype.supportsTransactionConfig=function(){return this._getOrCreateConnectionProvider().supportsTransactionConfig()},Vn.prototype.supportsUserImpersonation=function(){return this._getOrCreateConnectionProvider().supportsUserImpersonation()},Vn.prototype.getNegotiatedProtocolVersion=function(){return this._getOrCreateConnectionProvider().getNegotiatedProtocolVersion()},Vn.prototype.isEncrypted=function(){return this._isEncrypted()},Vn.prototype._supportsRouting=function(){return this._meta.routing},Vn.prototype._isEncrypted=function(){return this._config.encrypted===Ln.ENCRYPTION_ON||!0===this._config.encrypted},Vn.prototype._getTrust=function(){return this._config.trust},Vn.prototype.session=function(e){var e=void 0===e?{}:e,t=e.defaultAccessMode,r=e.bookmarks,n=e.database,o=e.impersonatedUser,i=e.fetchSize,e=e.bookmarkManager;return this._newSession({defaultAccessMode:void 0===t?zn:t,bookmarkOrBookmarks:r,database:void 0===n?"":n,reactive:!1,impersonatedUser:o,fetchSize:Yn(i,this._config.fetchSize),bookmarkManager:e})},Vn.prototype.close=function(){return this._log.info("Driver ".concat(this._id," closing")),null!=this._connectionProvider?this._connectionProvider.close():Promise.resolve()},Vn.prototype._afterConstruction=function(){this._log.info("".concat(this._meta.typename," driver ").concat(this._id," created for server address ").concat(this._meta.address.toString()))},Vn.prototype._newSession=function(e){var t=e.defaultAccessMode,r=e.bookmarkOrBookmarks,n=e.database,o=e.reactive,i=e.impersonatedUser,u=e.fetchSize,e=e.bookmarkManager,t=Dn.default._validateSessionMode(t),a=this._getOrCreateConnectionProvider(),r=null!=r?new Mn.Bookmarks(r):Mn.Bookmarks.empty();return this._createSession({mode:t,database:null!=n?n:"",connectionProvider:a,bookmarks:r,config:this._config,reactive:o,impersonatedUser:i,fetchSize:u,bookmarkManager:e})},Vn.prototype._getOrCreateConnectionProvider=function(){var e;return null==this._connectionProvider&&(this._connectionProvider=this._createConnectionProvider(this._id,this._config,this._log,(e=this._config,new xn.default(e.resolver)))),this._connectionProvider},Vn);function Vn(e,t,r,n){void 0===n&&(n=function(e){return new Dn.default(e)}),(o=t=void 0===t?{}:t).maxConnectionLifetime=Hn(o.maxConnectionLifetime,Bn),o.maxConnectionPoolSize=Hn(o.maxConnectionPoolSize,Nn.DEFAULT_POOL_MAX_SIZE),o.connectionAcquisitionTimeout=Hn(o.connectionAcquisitionTimeout,Nn.DEFAULT_POOL_ACQUISITION_TIMEOUT),o.fetchSize=Yn(o.fetchSize,Fn),o.connectionTimeout=function(e){e=parseInt(e.connectionTimeout,10);return 0===e||!isNaN(e)&&e<0?null:isNaN(e)?Nn.DEFAULT_CONNECTION_TIMEOUT_MILLIS:e}(o);var o=Un.Logger.create(t),i=t,u=o,a=i.resolver;if(null!=a&&"function"!=typeof a)throw new TypeError("Configured resolver should be a function. Got: ".concat(typeof a));i.connectionAcquisitionTimeout<i.connectionTimeout&&u.warn('Configuration for "connectionAcquisitionTimeout" should be greater than or equal to "connectionTimeout". Otherwise, the connection acquisition timeout will take precedence for over the connection timeout in scenarios where a new connection is created while it is acquired'),this._id=qn++,this._meta=e,this._config=t,this._log=o,this._createConnectionProvider=r,this._createSession=n,this._connectionProvider=null,this._afterConstruction()}function Hn(e,t){e=parseInt(e,10);return 0<e||0===e?e:e<0?Number.MAX_SAFE_INTEGER:t}function Yn(e,t){e=parseInt(e,10);if(0<e||e===Nn.FETCH_ALL)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(Nn.FETCH_ALL," for ALL. However fetchSize = ").concat(e));return t}_.Driver=O,_.default=O;At={};function Kn(e){return null!=e&&""!==e&&(Object.getPrototypeOf(e)!==Object.prototype||0!==Object.keys(e).length)}Object.defineProperty(At,"__esModule",{value:!0}),At.default={basic:function(e,t,r){return null!=r?{scheme:"basic",principal:e,credentials:t,realm:r}:{scheme:"basic",principal:e,credentials:t}},kerberos:function(e){return{scheme:"kerberos",principal:"",credentials:e}},bearer:function(e){return{scheme:"bearer",credentials:e}},custom:function(e,t,r,n,o){n={scheme:n,principal:e};return Kn(t)&&(n.credentials=t),Kn(r)&&(n.realm=r),Kn(o)&&(n.parameters=o),n}};var S={},Gn=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Zn=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Xn=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qn=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Jn=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},v=(Object.defineProperty(S,"__esModule",{value:!0}),S.bookmarkManager=void 0,$n.prototype.updateBookmarks=function(e,t){return Gn(this,void 0,void 0,function(){return Zn(this,function(e){throw new Error("Not implemented")})})},$n.prototype.getBookmarks=function(){return Gn(this,void 0,void 0,function(){return Zn(this,function(e){throw new Error("Not implemented")})})},$n);function $n(){throw new Error("Not implemented")}S.default=v,S.bookmarkManager=function(e){void 0===e&&(e={});var t=new Set(e.initialBookmarks);return new eo(t,e.bookmarksSupplier,e.bookmarksConsumer)};to.prototype.updateBookmarks=function(f,p){return Gn(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c,l;return Zn(this,function(e){switch(e.label){case 0:t=this._bookmarks;try{for(r=Xn(f),n=r.next();!n.done;n=r.next())u=n.value,t.delete(u)}catch(e){a={error:e}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}}try{for(o=Xn(p),i=o.next();!i.done;i=o.next())u=i.value,t.add(u)}catch(e){c={error:e}}finally{try{i&&!i.done&&(l=o.return)&&l.call(o)}finally{if(c)throw c.error}}return"function"!=typeof this._bookmarksConsumer?[3,2]:[4,this._bookmarksConsumer(Jn([],Qn(t),!1))];case 1:e.sent(),e.label=2;case 2:return[2]}})})},to.prototype.getBookmarks=function(){var s;return Gn(this,void 0,void 0,function(){var t,r,n,o,i,u,a;return Zn(this,function(e){switch(e.label){case 0:return t=new Set(this._bookmarks),"function"!=typeof this._bookmarksSupplier?[3,2]:[4,this._bookmarksSupplier()];case 1:r=null!=(s=e.sent())?s:[];try{for(n=Xn(r),o=n.next();!o.done;o=n.next())i=o.value,t.add(i)}catch(e){u={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(u)throw u.error}}e.label=2;case 2:return[2,Jn([],Qn(t),!1)]}})})};var eo=to;function to(e,t,r){this._bookmarks=e,this._bookmarksSupplier=t,this._bookmarksConsumer=r}var ro,no,oo,io,uo,ao,so,co,lo,P={},Cr=(Object.defineProperty(P,"__esModule",{value:!0}),m=e,ro=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),no=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),w=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ro(t,e,r);return no(t,e),t},g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(m,"__esModule",{value:!0}),m.TransactionPromise=m.ManagedTransaction=m.Transaction=m.Connection=m.ConnectionProvider=m.Result=m.Stats=m.QueryStatistics=m.ProfiledPlan=m.Plan=m.Notification=m.ServerInfo=m.queryType=m.ResultSummary=m.Record=m.isPathSegment=m.PathSegment=m.isPath=m.Path=m.isUnboundRelationship=m.UnboundRelationship=m.isRelationship=m.Relationship=m.isNode=m.Node=m.Time=m.LocalTime=m.LocalDateTime=m.isTime=m.isLocalTime=m.isLocalDateTime=m.isDuration=m.isDateTime=m.isDate=m.Duration=m.DateTime=m.Date=m.Point=m.isPoint=m.internal=m.toString=m.toNumber=m.inSafeRange=m.isInt=m.int=m.Integer=m.error=m.isRetriableError=m.Neo4jError=m.newError=void 0,m.bookmarkManager=m.auth=m.json=m.driver=m.types=m.Driver=m.Session=void 0,oo=t,Object.defineProperty(m,"newError",{enumerable:!0,get:function(){return oo.newError}}),Object.defineProperty(m,"Neo4jError",{enumerable:!0,get:function(){return oo.Neo4jError}}),Object.defineProperty(m,"isRetriableError",{enumerable:!0,get:function(){return oo.isRetriableError}}),io=w(n),m.Integer=io.default,Object.defineProperty(m,"int",{enumerable:!0,get:function(){return io.int}}),Object.defineProperty(m,"isInt",{enumerable:!0,get:function(){return io.isInt}}),Object.defineProperty(m,"inSafeRange",{enumerable:!0,get:function(){return io.inSafeRange}}),Object.defineProperty(m,"toNumber",{enumerable:!0,get:function(){return io.toNumber}}),Object.defineProperty(m,"toString",{enumerable:!0,get:function(){return io.toString}}),uo=i,Object.defineProperty(m,"Date",{enumerable:!0,get:function(){return uo.Date}}),Object.defineProperty(m,"DateTime",{enumerable:!0,get:function(){return uo.DateTime}}),Object.defineProperty(m,"Duration",{enumerable:!0,get:function(){return uo.Duration}}),Object.defineProperty(m,"isDate",{enumerable:!0,get:function(){return uo.isDate}}),Object.defineProperty(m,"isDateTime",{enumerable:!0,get:function(){return uo.isDateTime}}),Object.defineProperty(m,"isDuration",{enumerable:!0,get:function(){return uo.isDuration}}),Object.defineProperty(m,"isLocalDateTime",{enumerable:!0,get:function(){return uo.isLocalDateTime}}),Object.defineProperty(m,"isLocalTime",{enumerable:!0,get:function(){return uo.isLocalTime}}),Object.defineProperty(m,"isTime",{enumerable:!0,get:function(){return uo.isTime}}),Object.defineProperty(m,"LocalDateTime",{enumerable:!0,get:function(){return uo.LocalDateTime}}),Object.defineProperty(m,"LocalTime",{enumerable:!0,get:function(){return uo.LocalTime}}),Object.defineProperty(m,"Time",{enumerable:!0,get:function(){return uo.Time}}),ao=f,Object.defineProperty(m,"Node",{enumerable:!0,get:function(){return ao.Node}}),Object.defineProperty(m,"isNode",{enumerable:!0,get:function(){return ao.isNode}}),Object.defineProperty(m,"Relationship",{enumerable:!0,get:function(){return ao.Relationship}}),Object.defineProperty(m,"isRelationship",{enumerable:!0,get:function(){return ao.isRelationship}}),Object.defineProperty(m,"UnboundRelationship",{enumerable:!0,get:function(){return ao.UnboundRelationship}}),Object.defineProperty(m,"isUnboundRelationship",{enumerable:!0,get:function(){return ao.isUnboundRelationship}}),Object.defineProperty(m,"Path",{enumerable:!0,get:function(){return ao.Path}}),Object.defineProperty(m,"isPath",{enumerable:!0,get:function(){return ao.isPath}}),Object.defineProperty(m,"PathSegment",{enumerable:!0,get:function(){return ao.PathSegment}}),Object.defineProperty(m,"isPathSegment",{enumerable:!0,get:function(){return ao.isPathSegment}}),u=g(p),m.Record=u.default,so=c,Object.defineProperty(m,"isPoint",{enumerable:!0,get:function(){return so.isPoint}}),Object.defineProperty(m,"Point",{enumerable:!0,get:function(){return so.Point}}),co=w(h),m.ResultSummary=co.default,Object.defineProperty(m,"queryType",{enumerable:!0,get:function(){return co.queryType}}),Object.defineProperty(m,"ServerInfo",{enumerable:!0,get:function(){return co.ServerInfo}}),Object.defineProperty(m,"Notification",{enumerable:!0,get:function(){return co.Notification}}),Object.defineProperty(m,"Plan",{enumerable:!0,get:function(){return co.Plan}}),Object.defineProperty(m,"ProfiledPlan",{enumerable:!0,get:function(){return co.ProfiledPlan}}),Object.defineProperty(m,"QueryStatistics",{enumerable:!0,get:function(){return co.QueryStatistics}}),Object.defineProperty(m,"Stats",{enumerable:!0,get:function(){return co.Stats}}),O=g(b),m.Result=O.default,v=g(o),m.ConnectionProvider=v.default,v=g(Cr),m.Connection=v.default,t=g(ir),m.Transaction=t.default,n=g(a),m.ManagedTransaction=n.default,i=g(Ar),m.TransactionPromise=i.default,f=g(E),m.Session=f.default,p=w(_),c=p,m.Driver=p.default,m.driver=c,g=g(At),m.auth=g.default,lo=S,Object.defineProperty(m,"bookmarkManager",{enumerable:!0,get:function(){return lo.bookmarkManager}}),h=w(P),m.types=h,b=w(X),m.json=b,w=w(y),m.internal=w,o={SERVICE_UNAVAILABLE:oo.SERVICE_UNAVAILABLE,SESSION_EXPIRED:oo.SESSION_EXPIRED,PROTOCOL_ERROR:oo.PROTOCOL_ERROR},m.error=o,o={newError:oo.newError,Neo4jError:oo.Neo4jError,isRetriableError:oo.isRetriableError,error:o,Integer:io.default,int:io.int,isInt:io.isInt,inSafeRange:io.inSafeRange,toNumber:io.toNumber,toString:io.toString,internal:w,isPoint:so.isPoint,Point:so.Point,Date:uo.Date,DateTime:uo.DateTime,Duration:uo.Duration,isDate:uo.isDate,isDateTime:uo.isDateTime,isDuration:uo.isDuration,isLocalDateTime:uo.isLocalDateTime,isLocalTime:uo.isLocalTime,isTime:uo.isTime,LocalDateTime:uo.LocalDateTime,LocalTime:uo.LocalTime,Time:uo.Time,Node:ao.Node,isNode:ao.isNode,Relationship:ao.Relationship,isRelationship:ao.isRelationship,UnboundRelationship:ao.UnboundRelationship,isUnboundRelationship:ao.isUnboundRelationship,Path:ao.Path,isPath:ao.isPath,PathSegment:ao.PathSegment,isPathSegment:ao.isPathSegment,Record:u.default,ResultSummary:co.default,queryType:co.queryType,ServerInfo:co.ServerInfo,Notification:co.Notification,Plan:co.Plan,ProfiledPlan:co.ProfiledPlan,QueryStatistics:co.QueryStatistics,Stats:co.Stats,Result:O.default,Transaction:t.default,ManagedTransaction:n.default,TransactionPromise:i.default,Session:f.default,Driver:p.default,Connection:v.default,types:h,driver:c,json:b,auth:g.default,bookmarkManager:lo.bookmarkManager},m.default=o,{}),ir={},a={},Ar={},E={};Object.defineProperty(E,"__esModule",{value:!0}),E.isFunction=void 0,E.isFunction=function(e){return"function"==typeof e};_={},At={},S={};Object.defineProperty(S,"__esModule",{value:!0}),S.createErrorClass=void 0,S.createErrorClass=function(e){return(e=e(function(e){Error.call(e),e.stack=(new Error).stack})).prototype=Object.create(Error.prototype),e.prototype.constructor=e},Object.defineProperty(At,"__esModule",{value:!0}),At.UnsubscriptionError=void 0;P=S,At.UnsubscriptionError=P.createErrorClass(function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}),X={};Object.defineProperty(X,"__esModule",{value:!0}),X.arrRemove=void 0,X.arrRemove=function(e,t){e&&0<=(t=e.indexOf(t))&&e.splice(t,1)};var fo=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},po=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ho=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},bo=(Object.defineProperty(_,"__esModule",{value:!0}),_.isSubscription=_.EMPTY_SUBSCRIPTION=_.Subscription=void 0,E),yo=At,_o=X,vo=(mo.prototype.unsubscribe=function(){var t,e,r;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var o=fo(n),i=o.next();!i.done;i=o.next())i.value.remove(this)}catch(e){a={error:e}}finally{try{i&&!i.done&&(u=o.return)&&u.call(o)}finally{if(a)throw a.error}}else n.remove(this);var u=this.initialTeardown;if(bo.isFunction(u))try{u()}catch(e){r=e instanceof yo.UnsubscriptionError?e.errors:[e]}var a=this._finalizers;if(a){this._finalizers=null;try{for(var s=fo(a),c=s.next();!c.done;c=s.next()){var l=c.value;try{go(l)}catch(e){r=null!=r?r:[],e instanceof yo.UnsubscriptionError?r=ho(ho([],po(r)),po(e.errors)):r.push(e)}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}}if(r)throw new yo.UnsubscriptionError(r)}},mo.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)go(e);else{if(e instanceof mo){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(t=this._finalizers)?t:[]).push(e)}},mo.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},mo.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},mo.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&_o.arrRemove(t,e)},mo.prototype.remove=function(e){var t=this._finalizers;t&&_o.arrRemove(t,e),e instanceof mo&&e._removeParent(this)},mo.EMPTY=((y=new mo).closed=!0,y),mo);function mo(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}function go(e){bo.isFunction(e)?e():e.unsubscribe()}_.Subscription=vo,_.EMPTY_SUBSCRIPTION=vo.EMPTY,_.isSubscription=function(e){return e instanceof vo||e&&"closed"in e&&bo.isFunction(e.remove)&&bo.isFunction(e.add)&&bo.isFunction(e.unsubscribe)};var Oo,wo,Eo,w={},u=(Object.defineProperty(w,"__esModule",{value:!0}),w.config=void 0,w.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},{}),O={},Po=(Oo=O,wo=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Eo=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.timeoutProvider=void 0,Oo.timeoutProvider={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Oo.timeoutProvider.delegate;return null!=o&&o.setTimeout?o.setTimeout.apply(o,Eo([e,t],wo(r))):setTimeout.apply(void 0,Eo([e,t],wo(r)))},clearTimeout:function(e){var t=Oo.timeoutProvider.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0},Object.defineProperty(u,"__esModule",{value:!0}),u.reportUnhandledError=void 0,w),So=O;u.reportUnhandledError=function(t){So.timeoutProvider.setTimeout(function(){var e=Po.config.onUnhandledError;if(!e)throw t;e(t)})};t={};Object.defineProperty(t,"__esModule",{value:!0}),t.noop=void 0,t.noop=function(){};n={};function To(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(n,"__esModule",{value:!0}),n.createNotification=n.nextNotification=n.errorNotification=n.COMPLETE_NOTIFICATION=void 0,n.COMPLETE_NOTIFICATION=To("C",void 0,void 0),n.errorNotification=function(e){return To("E",void 0,e)},n.nextNotification=function(e){return To("N",e,void 0)},n.createNotification=To;var jo,Co,Io,Ro,ko,Ao,Mo,xo,No,Uo,Do,Lo,Bo,Fo,i={},Wo=(Object.defineProperty(i,"__esModule",{value:!0}),i.captureError=i.errorContext=void 0,w),zo=null;function qo(e){var t=Io.call(this)||this;return t.isStopped=!1,e?(t.destination=e,ko.isSubscription(e)&&e.add(t)):t.destination=jo.EMPTY_OBSERVER,t}function Vo(e,t){return Do.call(e,t)}function Ho(e){this.partialObserver=e}function Yo(e,t,r){var n=Bo.call(this)||this;return r=Ro.isFunction(e)||!e?{next:null!=e?e:void 0,error:null!=t?t:void 0,complete:null!=r?r:void 0}:n&&Ao.config.useDeprecatedNextContext?((t=Object.create(e)).unsubscribe=function(){return n.unsubscribe()},{next:e.next&&Vo(e.next,t),error:e.error&&Vo(e.error,t),complete:e.complete&&Vo(e.complete,t)}):e,n.destination=new Lo(r),n}function Ko(e){Ao.config.useDeprecatedSynchronousErrorHandling?Uo.captureError(e):Mo.reportUnhandledError(e)}function Go(e,t){var r=Ao.config.onStoppedNotification;r&&No.timeoutProvider.setTimeout(function(){return r(e,t)})}i.errorContext=function(e){if(Wo.config.useDeprecatedSynchronousErrorHandling){var t=!zo;if(t&&(zo={errorThrown:!1,error:null}),e(),t){var t=zo,r=t.errorThrown,t=t.error;if(zo=null,r)throw t}}else e()},i.captureError=function(e){Wo.config.useDeprecatedSynchronousErrorHandling&&zo&&(zo.errorThrown=!0,zo.error=e)},jo=Ar,f=r&&r.__extends||(Co=function(e,t){return(Co=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Co(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Object.defineProperty(jo,"__esModule",{value:!0}),jo.EMPTY_OBSERVER=jo.SafeSubscriber=jo.Subscriber=void 0,Ro=E,Ao=w,Mo=u,p=t,xo=n,No=O,Uo=i,Io=(ko=_).Subscription,f(qo,Io),qo.create=function(e,t,r){return new Fo(e,t,r)},qo.prototype.next=function(e){this.isStopped?Go(xo.nextNotification(e),this):this._next(e)},qo.prototype.error=function(e){this.isStopped?Go(xo.errorNotification(e),this):(this.isStopped=!0,this._error(e))},qo.prototype.complete=function(){this.isStopped?Go(xo.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},qo.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Io.prototype.unsubscribe.call(this),this.destination=null)},qo.prototype._next=function(e){this.destination.next(e)},qo.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},qo.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},v=qo,jo.Subscriber=v,Do=Function.prototype.bind,Ho.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Ko(e)}},Ho.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Ko(e)}else Ko(e)},Ho.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Ko(e)}},Lo=Ho,f(Yo,Bo=v),Fo=Yo,jo.SafeSubscriber=Fo,jo.EMPTY_OBSERVER={closed:!0,next:p.noop,error:function(e){throw e},complete:p.noop};h={},Object.defineProperty(h,"__esModule",{value:!0}),h.observable=void 0,h.observable="function"==typeof Symbol&&Symbol.observable||"@@observable",c={},b={};Object.defineProperty(b,"__esModule",{value:!0}),b.identity=void 0,b.identity=function(e){return e},Object.defineProperty(c,"__esModule",{value:!0}),c.pipeFromArray=c.pipe=void 0;var Zo=b;function Xo(t){return 0===t.length?Zo.identity:1===t.length?t[0]:function(e){return t.reduce(function(e,t){return t(e)},e)}}c.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xo(e)},c.pipeFromArray=Xo,Object.defineProperty(a,"__esModule",{value:!0}),a.Observable=void 0;var Qo=Ar,Jo=_,g=h,$o=c,ei=w,ti=E,ri=i;function ni(e){e&&(this._subscribe=e)}function oi(e){return null!=(e=null!=e?e:ei.config.Promise)?e:Promise}ni.prototype.lift=function(e){var t=new ni;return t.source=this,t.operator=e,t},ni.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof Qo.Subscriber||function(e){return e&&ti.isFunction(e.next)&&ti.isFunction(e.error)&&ti.isFunction(e.complete)}(n)&&Jo.isSubscription(n)?e:new Qo.SafeSubscriber(e,t,r);return ri.errorContext(function(){var e=o.operator,t=o.source;i.add(e?e.call(i,t):t?o._subscribe(i):o._trySubscribe(i))}),i},ni.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},ni.prototype.forEach=function(n,e){var o=this;return new(e=oi(e))(function(e,t){var r=new Qo.SafeSubscriber({next:function(e){try{n(e)}catch(e){t(e),r.unsubscribe()}},error:t,complete:e});o.subscribe(r)})},ni.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},ni.prototype[g.observable]=function(){return this},ni.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $o.pipeFromArray(e)(this)},ni.prototype.toPromise=function(e){var n=this;return new(e=oi(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},ni.create=function(e){return new ni(e)},a.Observable=ni;var m={},o={},P={},ii=(Object.defineProperty(P,"__esModule",{value:!0}),P.operate=P.hasLift=void 0,E);function ui(e){return ii.isFunction(null==e?void 0:e.lift)}P.hasLift=ui,P.operate=function(t){return function(e){if(ui(e))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});throw new TypeError("Unable to lift unknown Observable type")}};var ai,y={},n=r&&r.__extends||(ai=function(e,t){return(ai=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ai(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),O=(Object.defineProperty(y,"__esModule",{value:!0}),y.OperatorSubscriber=y.createOperatorSubscriber=void 0,Ar);y.createOperatorSubscriber=function(e,t,r,n,o){return new ci(e,t,r,n,o)};n(li,si=O.Subscriber),li.prototype.unsubscribe=function(){var e;this.shouldUnsubscribe&&!this.shouldUnsubscribe()||(e=this.closed,si.prototype.unsubscribe.call(this),e||null==(e=this.onFinalize)||e.call(this))};var si,ci=li;function li(t,r,e,n,o,i){var u=si.call(this,t)||this;return u.onFinalize=o,u.shouldUnsubscribe=i,u._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:si.prototype._next,u._error=n?function(e){try{n(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:si.prototype._error,u._complete=e?function(){try{e()}catch(e){t.error(e)}finally{this.unsubscribe()}}:si.prototype._complete,u}y.OperatorSubscriber=ci,Object.defineProperty(o,"__esModule",{value:!0}),o.refCount=void 0;var fi=P,pi=y;o.refCount=function(){return fi.operate(function(r,n){var o=null,e=(r._refCount++,pi.createOperatorSubscriber(n,void 0,void 0,void 0,function(){var e,t;!r||r._refCount<=0||0<--r._refCount?o=null:(e=r._connection,t=o,o=null,!e||t&&e!==t||e.unsubscribe(),n.unsubscribe())}));r.subscribe(e),e.closed||(o=r.connect())})};var di,f=r&&r.__extends||(di=function(e,t){return(di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(m,"__esModule",{value:!0}),m.ConnectableObservable=void 0;var hi,bi=_,yi=o,_i=y,vi=P,v=(hi=a.Observable,f(mi,hi),mi.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},mi.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},mi.prototype._teardown=function(){this._refCount=0;var e=this._connection;(this._subject=this._connection=null)!=e&&e.unsubscribe()},mi.prototype.connect=function(){var t,r=this,e=this._connection;return e||(e=this._connection=new bi.Subscription,t=this.getSubject(),e.add(this.source.subscribe(_i.createOperatorSubscriber(t,void 0,function(){r._teardown(),t.complete()},function(e){r._teardown(),t.error(e)},function(){return r._teardown()}))),e.closed&&(this._connection=null,e=bi.Subscription.EMPTY)),e},mi.prototype.refCount=function(){return yi.refCount()(this)},mi);function mi(e,t){var r=hi.call(this)||this;return r.source=e,r.subjectFactory=t,r._subject=null,r._refCount=0,r._connection=null,vi.hasLift(e)&&(r.lift=e.lift),r}m.ConnectableObservable=v;var gi,Oi,wi,Ei,Pi,p={},g={},n=(gi=g,Object.defineProperty(gi,"__esModule",{value:!0}),gi.performanceTimestampProvider=void 0,gi.performanceTimestampProvider={now:function(){return(gi.performanceTimestampProvider.delegate||performance).now()},delegate:void 0},{}),Si=(Oi=n,wi=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ei=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.animationFrameProvider=void 0,Pi=_,Oi.animationFrameProvider={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=Oi.animationFrameProvider.delegate,o=(n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame),e(function(e){r=void 0,t(e)}));return new Pi.Subscription(function(){return null==r?void 0:r(o)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Oi.animationFrameProvider.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,Ei([],wi(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Oi.animationFrameProvider.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,Ei([],wi(e)))},delegate:void 0},Object.defineProperty(p,"__esModule",{value:!0}),p.animationFrames=void 0,a),Ti=g,ji=n;function Ci(a){return new Si.Observable(function(r){var n=a||Ti.performanceTimestampProvider,o=n.now(),i=0,u=function(){r.closed||(i=ji.animationFrameProvider.requestAnimationFrame(function(e){i=0;var t=n.now();r.next({timestamp:a?t:e,elapsed:t-o}),u()}))};return u(),function(){i&&ji.animationFrameProvider.cancelAnimationFrame(i)}})}p.animationFrames=function(e){return e?Ci(e):ki};var Ii,Ri,ki=Ci(),O={},f={},v=(Object.defineProperty(f,"__esModule",{value:!0}),f.ObjectUnsubscribedError=void 0,S),g=(f.ObjectUnsubscribedError=v.createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),r&&r.__extends||(Ii=function(e,t){return(Ii=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ii(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Ai=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mi=(Object.defineProperty(O,"__esModule",{value:!0}),O.AnonymousSubject=O.Subject=void 0,a),xi=_,Ni=f,Ui=X,Di=i,v=(Ri=Mi.Observable,g(Li,Ri),Li.prototype.lift=function(e){var t=new Fi(this,this);return t.operator=e,t},Li.prototype._throwIfClosed=function(){if(this.closed)throw new Ni.ObjectUnsubscribedError},Li.prototype.next=function(o){var i=this;Di.errorContext(function(){var t,e;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var r=Ai(i.currentObservers),n=r.next();!n.done;n=r.next())n.value.next(o)}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}}})},Li.prototype.error=function(t){var r=this;Di.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var e=r.observers;e.length;)e.shift().error(t)}})},Li.prototype.complete=function(){var t=this;Di.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},Li.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(Li.prototype,"observed",{get:function(){var e;return 0<(null==(e=this.observers)?void 0:e.length)},enumerable:!1,configurable:!0}),Li.prototype._trySubscribe=function(e){return this._throwIfClosed(),Ri.prototype._trySubscribe.call(this,e)},Li.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},Li.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,o=this.observers;return r||n?xi.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new xi.Subscription(function(){t.currentObservers=null,Ui.arrRemove(o,e)}))},Li.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},Li.prototype.asObservable=function(){var e=new Mi.Observable;return e.source=this,e},Li.create=function(e,t){return new Fi(e,t)},Li);function Li(){var e=Ri.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}O.Subject=v;g(Wi,Bi=v),Wi.prototype.next=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.next)&&r.call(t,e)},Wi.prototype.error=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.error)&&r.call(t,e)},Wi.prototype.complete=function(){var e,t;null!=(t=null==(e=this.destination)?void 0:e.complete)&&t.call(e)},Wi.prototype._subscribe=function(e){var t;return null!=(t=null==(t=this.source)?void 0:t.subscribe(e))?t:xi.EMPTY_SUBSCRIPTION};var Bi,Fi=Wi;function Wi(e,t){var r=Bi.call(this)||this;return r.destination=e,r.source=t,r}O.AnonymousSubject=Fi;var zi,i={},g=r&&r.__extends||(zi=function(e,t){return(zi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0}),i.BehaviorSubject=void 0;qi=O.Subject,g(Vi,qi),Object.defineProperty(Vi.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),Vi.prototype._subscribe=function(e){var t=qi.prototype._subscribe.call(this,e);return t.closed||e.next(this._value),t},Vi.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},Vi.prototype.next=function(e){qi.prototype.next.call(this,this._value=e)};var qi,v=Vi;function Vi(e){var t=qi.call(this)||this;return t._value=e,t}i.BehaviorSubject=v;var Hi,Yi,g={},v={},Ki=(Hi=v,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.dateTimestampProvider=void 0,Hi.dateTimestampProvider={now:function(){return(Hi.dateTimestampProvider.delegate||Date).now()},delegate:void 0},r&&r.__extends||(Yi=function(e,t){return(Yi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Yi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(g,"__esModule",{value:!0}),g.ReplaySubject=void 0;var Gi,Zi=v,Ki=(Gi=O.Subject,Ki(Xi,Gi),Xi.prototype.next=function(e){var t=this.isStopped,r=this._buffer,n=this._infiniteTimeWindow,o=this._timestampProvider,i=this._windowTime;t||(r.push(e),n||r.push(o.now()+i)),this._trimBuffer(),Gi.prototype.next.call(this,e)},Xi.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),o=0;o<n.length&&!e.closed;o+=r?1:2)e.next(n[o]);return this._checkFinalizedStatuses(e),t},Xi.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,o=(n?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!n){for(var i=t.now(),u=0,a=1;a<r.length&&r[a]<=i;a+=2)u=a;u&&r.splice(0,u+1)}},Xi);function Xi(e,t,r){void 0===e&&(e=1/0),void 0===t&&(t=1/0),void 0===r&&(r=Zi.dateTimestampProvider);var n=Gi.call(this)||this;return n._bufferSize=e,n._windowTime=t,n._timestampProvider=r,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=t===1/0,n._bufferSize=Math.max(1,e),n._windowTime=Math.max(1,t),n}g.ReplaySubject=Ki;var Qi,Ki={},Ji=r&&r.__extends||(Qi=function(e,t){return(Qi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Qi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.AsyncSubject=void 0;$i=O.Subject,Ji(eu,$i),eu.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this._hasValue,n=this._value,o=this.thrownError,i=this.isStopped,u=this._isComplete;t?e.error(o):(i||u)&&(r&&e.next(n),e.complete())},eu.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},eu.prototype.complete=function(){var e=this._hasValue,t=this._value;this._isComplete||(this._isComplete=!0,e&&$i.prototype.next.call(this,t),$i.prototype.complete.call(this))};var $i,Ji=eu;function eu(){var e=null!==$i&&$i.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}Ki.AsyncSubject=Ji;var tu,Ji={},T={},j={},ru={},nu=r&&r.__extends||(tu=function(e,t){return(tu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}tu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(ru,"__esModule",{value:!0}),ru.Action=void 0;ou=_.Subscription,nu(iu,ou),iu.prototype.schedule=function(e,t){return this};var ou,nu=iu;function iu(e,t){return ou.call(this)||this}ru.Action=nu;var uu,au,su,cu,nu={},lu=(uu=nu,au=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},su=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(uu,"__esModule",{value:!0}),uu.intervalProvider=void 0,uu.intervalProvider={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=uu.intervalProvider.delegate;return null!=o&&o.setInterval?o.setInterval.apply(o,su([e,t],au(r))):setInterval.apply(void 0,su([e,t],au(r)))},clearInterval:function(e){var t=uu.intervalProvider.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},r&&r.__extends||(cu=function(e,t){return(cu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}cu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(j,"__esModule",{value:!0}),j.AsyncAction=void 0;var fu,pu=nu,du=X,nu=(fu=ru.Action,lu(hu,fu),hu.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var e=this.id,r=this.scheduler;return null!=e&&(this.id=this.recycleAsyncId(r,e,t)),this.pending=!0,this.delay=t,this.id=null!=(e=this.id)?e:this.requestAsyncId(r,this.id,t),this},hu.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),pu.intervalProvider.setInterval(e.flush.bind(e,this),r)},hu.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)&&this.delay===r&&!1===this.pending)return t;null!=t&&pu.intervalProvider.clearInterval(t)},hu.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;e=this._execute(e,t);if(e)return e;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},hu.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},hu.prototype.unsubscribe=function(){var e,t,r;this.closed||(e=this.id,r=(t=this.scheduler).actions,this.work=this.state=this.scheduler=null,this.pending=!1,du.arrRemove(r,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,fu.prototype.unsubscribe.call(this))},hu);function hu(e,t){var r=fu.call(this,e,t)||this;return r.scheduler=e,r.work=t,r.pending=!1,r}j.AsyncAction=nu;var bu,yu,_u,vu,mu,gu,ru={},lu={},Ou=(Object.defineProperty(lu,"__esModule",{value:!0}),lu.TestTools=lu.Immediate=void 0,1),wu={};function Eu(e){return e in wu&&(delete wu[e],!0)}lu.Immediate={setImmediate:function(e){var t=Ou++;return wu[t]=!0,(bu=bu||Promise.resolve()).then(function(){return Eu(t)&&e()}),t},clearImmediate:function(e){Eu(e)}},lu.TestTools={pending:function(){return Object.keys(wu).length}},yu=ru,_u=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},vu=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(yu,"__esModule",{value:!0}),yu.immediateProvider=void 0,mu=lu.Immediate.setImmediate,gu=lu.Immediate.clearImmediate,yu.immediateProvider={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=yu.immediateProvider.delegate;return((null==r?void 0:r.setImmediate)||mu).apply(void 0,vu([],_u(e)))},clearImmediate:function(e){var t=yu.immediateProvider.delegate;return((null==t?void 0:t.clearImmediate)||gu)(e)},delegate:void 0};var Pu,nu=r&&r.__extends||(Pu=function(e,t){return(Pu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Pu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(T,"__esModule",{value:!0}),T.AsapAction=void 0;var Su,Tu=ru,lu=(Su=j.AsyncAction,nu(ju,Su),ju.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?Su.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Tu.immediateProvider.setImmediate(e.flush.bind(e,void 0))))},ju.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return Su.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(Tu.immediateProvider.clearImmediate(t),e._scheduled=void 0)},ju);function ju(e,t){var r=Su.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}T.AsapAction=lu;var ru={},nu={},lu={},Cu=(Object.defineProperty(lu,"__esModule",{value:!0}),lu.Scheduler=void 0,v);function Iu(e,t){void 0===t&&(t=Iu.now),this.schedulerActionCtor=e,this.now=t}Iu.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},Iu.now=Cu.dateTimestampProvider.now,lu.Scheduler=Iu;var Ru,ku,Cu=r&&r.__extends||(Ru=function(e,t){return(Ru=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ru(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Au=(Object.defineProperty(nu,"__esModule",{value:!0}),nu.AsyncScheduler=void 0,lu),Cu=(ku=Au.Scheduler,Cu(Mu,ku),Mu.prototype.flush=function(e){var t,r=this.actions;if(this._active)r.push(e);else{this._active=!0;do{if(t=e.execute(e.state,e.delay))break}while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}}},Mu);function Mu(e,t){void 0===t&&(t=Au.Scheduler.now);e=ku.call(this,e,t)||this;return e.actions=[],e._active=!1,e}nu.AsyncScheduler=Cu;var xu,Cu=r&&r.__extends||(xu=function(e,t){return(xu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}xu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(ru,"__esModule",{value:!0}),ru.AsapScheduler=void 0;Nu=nu.AsyncScheduler,Cu(Uu,Nu),Uu.prototype.flush=function(e){this._active=!0;var t,r=this._scheduled,n=(this._scheduled=void 0,this.actions);e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,t){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw t}};var Nu,Cu=Uu;function Uu(){return null!==Nu&&Nu.apply(this,arguments)||this}ru.AsapScheduler=Cu,Cu=Ji,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.asap=Cu.asapScheduler=void 0,Cu.asapScheduler=new ru.AsapScheduler(T.AsapAction),Cu.asap=Cu.asapScheduler;var Du,ru={},Cu=(T=ru,Object.defineProperty(T,"__esModule",{value:!0}),T.async=T.asyncScheduler=void 0,T.asyncScheduler=new nu.AsyncScheduler(j.AsyncAction),T.async=T.asyncScheduler,{}),T={},Lu=r&&r.__extends||(Du=function(e,t){return(Du=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Du(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(T,"__esModule",{value:!0}),T.QueueAction=void 0;Bu=j.AsyncAction,Lu(Fu,Bu),Fu.prototype.schedule=function(e,t){return 0<(t=void 0===t?0:t)?Bu.prototype.schedule.call(this,e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)},Fu.prototype.execute=function(e,t){return 0<t||this.closed?Bu.prototype.execute.call(this,e,t):this._execute(e,t)},Fu.prototype.requestAsyncId=function(e,t,r){return null!=(r=void 0===r?0:r)&&0<r||null==r&&0<this.delay?Bu.prototype.requestAsyncId.call(this,e,t,r):(e.flush(this),0)};var Bu,Lu=Fu;function Fu(e,t){var r=Bu.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}T.QueueAction=Lu;var Wu,Lu={},zu=r&&r.__extends||(Wu=function(e,t){return(Wu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Wu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.QueueScheduler=void 0;qu=nu.AsyncScheduler,zu(Vu,qu);var qu,zu=Vu;function Vu(){return null!==qu&&qu.apply(this,arguments)||this}Lu.QueueScheduler=zu,zu=Cu,Object.defineProperty(zu,"__esModule",{value:!0}),zu.queue=zu.queueScheduler=void 0,zu.queueScheduler=new Lu.QueueScheduler(T.QueueAction),zu.queue=zu.queueScheduler;var Hu,Lu={},T={},zu=r&&r.__extends||(Hu=function(e,t){return(Hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Hu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(T,"__esModule",{value:!0}),T.AnimationFrameAction=void 0;var Yu,Ku=n,n=(Yu=j.AsyncAction,zu(Gu,Yu),Gu.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?Yu.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Ku.animationFrameProvider.requestAnimationFrame(function(){return e.flush(void 0)})))},Gu.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return Yu.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(Ku.animationFrameProvider.cancelAnimationFrame(t),e._scheduled=void 0)},Gu);function Gu(e,t){var r=Yu.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}T.AnimationFrameAction=n;var Zu,zu={},n=r&&r.__extends||(Zu=function(e,t){return(Zu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Zu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(zu,"__esModule",{value:!0}),zu.AnimationFrameScheduler=void 0;Xu=nu.AsyncScheduler,n(Qu,Xu),Qu.prototype.flush=function(e){this._active=!0;var t,r=this._scheduled,n=(this._scheduled=void 0,this.actions);e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,t){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw t}};var Xu,n=Qu;function Qu(){return null!==Xu&&Xu.apply(this,arguments)||this}zu.AnimationFrameScheduler=n,n=Lu,Object.defineProperty(n,"__esModule",{value:!0}),n.animationFrame=n.animationFrameScheduler=void 0,n.animationFrameScheduler=new zu.AnimationFrameScheduler(T.AnimationFrameAction),n.animationFrame=n.animationFrameScheduler;var Ju,$u,zu={},T=r&&r.__extends||(Ju=function(e,t){return(Ju=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ju(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=(Object.defineProperty(zu,"__esModule",{value:!0}),zu.VirtualAction=zu.VirtualTimeScheduler=void 0,j),ea=_,j=($u=nu.AsyncScheduler,T(ta,$u),ta.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},ta.frameTimeFactor=10,ta);function ta(e,t){void 0===t&&(t=1/0);var r=$u.call(this,e=void 0===e?na:e,function(){return r.frame})||this;return r.maxFrames=t,r.frame=0,r.index=-1,r}zu.VirtualTimeScheduler=j;ra=n.AsyncAction,T(oa,ra),oa.prototype.schedule=function(e,t){if(void 0===t&&(t=0),Number.isFinite(t)){if(!this.id)return ra.prototype.schedule.call(this,e,t);this.active=!1;var r=new oa(this.scheduler,this.work);return this.add(r),r.schedule(e,t)}return ea.Subscription.EMPTY},oa.prototype.requestAsyncId=function(e,t,r){this.delay=e.frame+(r=void 0===r?0:r);r=e.actions;return r.push(this),r.sort(oa.sortActions),1},oa.prototype.recycleAsyncId=function(e,t,r){},oa.prototype._execute=function(e,t){if(!0===this.active)return ra.prototype._execute.call(this,e,t)},oa.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1};var ra,na=oa;function oa(e,t,r){void 0===r&&(r=e.index+=1);var n=ra.call(this,e,t)||this;return n.scheduler=e,n.work=t,n.index=r,n.active=!0,n.index=e.index=r,n}zu.VirtualAction=na;var ia,ua,nu={},j={},n=(ia=j,Object.defineProperty(ia,"__esModule",{value:!0}),ia.empty=ia.EMPTY=void 0,ua=a,ia.EMPTY=new ua.Observable(function(e){return e.complete()}),ia.empty=function(e){return e?(t=e,new ua.Observable(function(e){return t.schedule(function(){return e.complete()})})):ia.EMPTY;var t},{}),T={},aa={},sa=(Object.defineProperty(aa,"__esModule",{value:!0}),aa.isScheduler=void 0,E);aa.isScheduler=function(e){return e&&sa.isFunction(e.schedule)},Object.defineProperty(T,"__esModule",{value:!0}),T.popNumber=T.popScheduler=T.popResultSelector=void 0;var ca=E,la=aa;function fa(e){return e[e.length-1]}T.popResultSelector=function(e){return ca.isFunction(fa(e))?e.pop():void 0},T.popScheduler=function(e){return la.isScheduler(fa(e))?e.pop():void 0},T.popNumber=function(e,t){return"number"==typeof fa(e)?e.pop():t};var pa={},da={},ha={},C={},ba={},ya=(Object.defineProperty(ba,"__esModule",{value:!0}),ba.isArrayLike=void 0,ba.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},{}),_a=(Object.defineProperty(ya,"__esModule",{value:!0}),ya.isPromise=void 0,E);ya.isPromise=function(e){return _a.isFunction(null==e?void 0:e.then)};var va={},ma=(Object.defineProperty(va,"__esModule",{value:!0}),va.isInteropObservable=void 0,h),ga=E;va.isInteropObservable=function(e){return ga.isFunction(e[ma.observable])};var Oa={},wa=(Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.isAsyncIterable=void 0,E);Oa.isAsyncIterable=function(e){return Symbol.asyncIterator&&wa.isFunction(null==e?void 0:e[Symbol.asyncIterator])};var Ea={};Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.createInvalidObservableTypeError=void 0,Ea.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")};var Pa={},Sa={};function Ta(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.iterator=Sa.getSymbolIterator=void 0,Sa.getSymbolIterator=Ta,Sa.iterator=Ta(),Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.isIterable=void 0;var ja=Sa,Ca=E;Pa.isIterable=function(e){return Ca.isFunction(null==e?void 0:e[ja.iterator])};var Ia={},Ra=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},ka=r&&r.__await||function(e){return this instanceof ka?(this.v=e,this):new ka(e)},Aa=r&&r.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=r.apply(e,t||[]),i=[],u={};return n("next"),n("throw"),n("return"),u[Symbol.asyncIterator]=function(){return this},u;function n(n){o[n]&&(u[n]=function(r){return new Promise(function(e,t){1<i.push([n,r,e,t])||a(n,r)})})}function a(e,t){try{(r=o[e](t)).value instanceof ka?Promise.resolve(r.value.v).then(s,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function s(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}},Ma=(Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.isReadableStreamLike=Ia.readableStreamLikeToAsyncGenerator=void 0,E);Ia.readableStreamLikeToAsyncGenerator=function(o){return Aa(this,arguments,function(){var t,r,n;return Ra(this,function(e){switch(e.label){case 0:t=o.getReader(),e.label=1;case 1:e.trys.push([1,,9,10]),e.label=2;case 2:return[4,ka(t.read())];case 3:return(r=e.sent(),n=r.value,r.done)?[4,ka(void 0)]:[3,5];case 4:return[2,e.sent()];case 5:return[4,ka(n)];case 6:return[4,e.sent()];case 7:return e.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})},Ia.isReadableStreamLike=function(e){return Ma.isFunction(null==e?void 0:e.getReader)};var xa=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Na=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Ua=r&&r.__asyncValues||function(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=u[Symbol.asyncIterator];return t?t.call(u):(u="function"==typeof Da?Da(u):u[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(i){e[i]=u[i]&&function(o){return new Promise(function(e,t){var r,n;o=u[i](o),r=e,e=t,n=o.done,t=o.value,Promise.resolve(t).then(function(e){r({value:e,done:n})},e)})}}},Da=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},La=(Object.defineProperty(C,"__esModule",{value:!0}),C.fromReadableStreamLike=C.fromAsyncIterable=C.fromIterable=C.fromPromise=C.fromArrayLike=C.fromInteropObservable=C.innerFrom=void 0,ba),Ba=ya,Fa=a,Wa=va,za=Oa,qa=Ea,Va=Pa,Ha=Ia,Ya=E,Ka=u,Ga=h;function Za(r){return new Fa.Observable(function(e){var t=r[Ga.observable]();if(Ya.isFunction(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Xa(r){return new Fa.Observable(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function Qa(e){return new Fa.Observable(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Ka.reportUnhandledError)})}function Ja(u){return new Fa.Observable(function(e){var t,r;try{for(var n=Da(u),o=n.next();!o.done;o=n.next()){var i=o.value;if(e.next(i),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e.complete()})}function $a(e){return new Fa.Observable(function(t){!function(r,n){var o,i,u,a;return xa(this,void 0,void 0,function(){var t;return Na(this,function(e){switch(e.label){case 0:e.trys.push([0,5,6,11]),o=Ua(r),e.label=1;case 1:return[4,o.next()];case 2:if((i=e.sent()).done)return[3,4];if(t=i.value,n.next(t),n.closed)return[2];e.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return t=e.sent(),u={error:t},[3,11];case 6:return(e.trys.push([6,,9,10]),i&&!i.done&&(a=o.return))?[4,a.call(o)]:[3,8];case 7:e.sent(),e.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}(e,t).catch(function(e){return t.error(e)})})}function es(e){return $a(Ha.readableStreamLikeToAsyncGenerator(e))}C.innerFrom=function(e){if(e instanceof Fa.Observable)return e;if(null!=e){if(Wa.isInteropObservable(e))return Za(e);if(La.isArrayLike(e))return Xa(e);if(Ba.isPromise(e))return Qa(e);if(za.isAsyncIterable(e))return $a(e);if(Va.isIterable(e))return Ja(e);if(Ha.isReadableStreamLike(e))return es(e)}throw qa.createInvalidObservableTypeError(e)},C.fromInteropObservable=Za,C.fromArrayLike=Xa,C.fromPromise=Qa,C.fromIterable=Ja,C.fromAsyncIterable=$a,C.fromReadableStreamLike=es;var u={},ts={};Object.defineProperty(ts,"__esModule",{value:!0}),ts.executeSchedule=void 0,ts.executeSchedule=function(e,t,r,n,o){if(void 0===n&&(n=0),void 0===o&&(o=!1),t=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n),e.add(t),!o)return t},Object.defineProperty(u,"__esModule",{value:!0}),u.observeOn=void 0;var rs=ts,ns=P,os=y;u.observeOn=function(r,n){return void 0===n&&(n=0),ns.operate(function(e,t){e.subscribe(os.createOperatorSubscriber(t,function(e){return rs.executeSchedule(t,r,function(){return t.next(e)},n)},function(){return rs.executeSchedule(t,r,function(){return t.complete()},n)},function(e){return rs.executeSchedule(t,r,function(){return t.error(e)},n)}))})};var is={},us=(Object.defineProperty(is,"__esModule",{value:!0}),is.subscribeOn=void 0,P);is.subscribeOn=function(r,n){return void 0===n&&(n=0),us.operate(function(e,t){t.add(r.schedule(function(){return e.subscribe(t)},n))})},Object.defineProperty(ha,"__esModule",{value:!0}),ha.scheduleObservable=void 0;var as=C,ss=u,cs=is;ha.scheduleObservable=function(e,t){return as.innerFrom(e).pipe(cs.subscribeOn(t),ss.observeOn(t))};var ls={},fs=(Object.defineProperty(ls,"__esModule",{value:!0}),ls.schedulePromise=void 0,C),ps=u,ds=is;ls.schedulePromise=function(e,t){return fs.innerFrom(e).pipe(ds.subscribeOn(t),ps.observeOn(t))};var hs={},bs=(Object.defineProperty(hs,"__esModule",{value:!0}),hs.scheduleArray=void 0,a);hs.scheduleArray=function(r,n){return new bs.Observable(function(e){var t=0;return n.schedule(function(){t===r.length?e.complete():(e.next(r[t++]),e.closed||this.schedule())})})};var ys={},_s=(Object.defineProperty(ys,"__esModule",{value:!0}),ys.scheduleIterable=void 0,a),vs=Sa,ms=E,gs=ts;ys.scheduleIterable=function(e,t){return new _s.Observable(function(n){var o;return gs.executeSchedule(n,t,function(){o=e[vs.iterator](),gs.executeSchedule(n,t,function(){var e,t,r;try{t=(e=o.next()).value,r=e.done}catch(e){return void n.error(e)}r?n.complete():n.next(t)},0,!0)}),function(){return ms.isFunction(null==o?void 0:o.return)&&o.return()}})};var Sa={},Os=(Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.scheduleAsyncIterable=void 0,a),ws=ts;Sa.scheduleAsyncIterable=function(r,n){if(r)return new Os.Observable(function(t){ws.executeSchedule(t,n,function(){var e=r[Symbol.asyncIterator]();ws.executeSchedule(t,n,function(){e.next().then(function(e){e.done?t.complete():t.next(e.value)})},0,!0)})});throw new Error("Iterable cannot be null")};var Es={},Ps=(Object.defineProperty(Es,"__esModule",{value:!0}),Es.scheduleReadableStreamLike=void 0,Sa),Ss=Ia;Es.scheduleReadableStreamLike=function(e,t){return Ps.scheduleAsyncIterable(Ss.readableStreamLikeToAsyncGenerator(e),t)},Object.defineProperty(da,"__esModule",{value:!0}),da.scheduled=void 0;var Ts=ha,js=ls,Cs=hs,Is=ys,Rs=Sa,ks=va,As=ya,Ms=ba,xs=Pa,Ns=Oa,Us=Ea,Ds=Ia,Ls=Es;da.scheduled=function(e,t){if(null!=e){if(ks.isInteropObservable(e))return Ts.scheduleObservable(e,t);if(Ms.isArrayLike(e))return Cs.scheduleArray(e,t);if(As.isPromise(e))return js.schedulePromise(e,t);if(Ns.isAsyncIterable(e))return Rs.scheduleAsyncIterable(e,t);if(xs.isIterable(e))return Is.scheduleIterable(e,t);if(Ds.isReadableStreamLike(e))return Ls.scheduleReadableStreamLike(e,t)}throw Us.createInvalidObservableTypeError(e)},Object.defineProperty(pa,"__esModule",{value:!0}),pa.from=void 0;var Bs=da,Fs=C;pa.from=function(e,t){return t?Bs.scheduled(e,t):Fs.innerFrom(e)},Object.defineProperty(n,"__esModule",{value:!0}),n.of=void 0;var Ws=T,zs=pa;n.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Ws.popScheduler(e);return zs.from(e,r)};var qs,Vs,Hs,Ys,ha={},Ks=(Object.defineProperty(ha,"__esModule",{value:!0}),ha.throwError=void 0,a),Gs=E;function Zs(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}function Xs(e,t){var r,n=e.kind,o=e.value,e=e.error;if("string"!=typeof n)throw new TypeError('Invalid notification, missing "kind"');"N"===n?null!=(r=t.next)&&r.call(t,o):"E"===n?null!=(r=t.error)&&r.call(t,e):null!=(o=t.complete)&&o.call(t)}ha.throwError=function(e,t){function r(e){return e.error(n())}var n=Gs.isFunction(e)?e:function(){return e};return new Ks.Observable(t?function(e){return t.schedule(r,0,e)}:r)},ls=nu,Object.defineProperty(ls,"__esModule",{value:!0}),ls.observeNotification=ls.Notification=ls.NotificationKind=void 0,qs=j,Vs=n,Hs=ha,Ys=E,(hs=ls.NotificationKind||(ls.NotificationKind={})).NEXT="N",hs.ERROR="E",hs.COMPLETE="C",Zs.prototype.observe=function(e){return Xs(this,e)},Zs.prototype.do=function(e,t,r){var n=this.kind,o=this.value,i=this.error;return"N"===n?null==e?void 0:e(o):"E"===n?null==t?void 0:t(i):null==r?void 0:r()},Zs.prototype.accept=function(e,t,r){var n;return Ys.isFunction(null==(n=e)?void 0:n.next)?this.observe(e):this.do(e,t,r)},Zs.prototype.toObservable=function(){var e=this.kind,t=this.value,r=this.error,t="N"===e?Vs.of(t):"E"===e?Hs.throwError(function(){return r}):"C"===e?qs.EMPTY:0;if(t)return t;throw new TypeError("Unexpected notification kind "+e)},Zs.createNext=function(e){return new Zs("N",e)},Zs.createError=function(e){return new Zs("E",void 0,e)},Zs.createComplete=function(){return Zs.completeNotification},Zs.completeNotification=new Zs("C"),hs=Zs,ls.Notification=hs,ls.observeNotification=Xs;var Sa={},Qs=(Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.isObservable=void 0,a),Js=E;Sa.isObservable=function(e){return!!e&&(e instanceof Qs.Observable||Js.isFunction(e.lift)&&Js.isFunction(e.subscribe))};var va={},ya={},Pa=(Object.defineProperty(ya,"__esModule",{value:!0}),ya.EmptyError=void 0,S),$s=(ya.EmptyError=Pa.createErrorClass(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}),Object.defineProperty(va,"__esModule",{value:!0}),va.lastValueFrom=void 0,ya);va.lastValueFrom=function(o,i){var u="object"==typeof i;return new Promise(function(e,t){var r,n=!1;o.subscribe({next:function(e){r=e,n=!0},error:t,complete:function(){n?e(r):u?e(i.defaultValue):t(new $s.EmptyError)}})})};var Oa={},ec=(Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.firstValueFrom=void 0,ya),tc=Ar;Oa.firstValueFrom=function(n,o){var i="object"==typeof o;return new Promise(function(t,e){var r=new tc.SafeSubscriber({next:function(e){t(e),r.unsubscribe()},error:e,complete:function(){i?t(o.defaultValue):e(new ec.EmptyError)}});n.subscribe(r)})};var rc,nc,oc,ic,uc,ac,sc,Ea={},Ia=(Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.ArgumentOutOfRangeError=void 0,S),Es=(Ea.ArgumentOutOfRangeError=Ia.createErrorClass(function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}),{}),hs=(Object.defineProperty(Es,"__esModule",{value:!0}),Es.NotFoundError=void 0,S),ls=(Es.NotFoundError=hs.createErrorClass(function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}}),{}),Pa=(Object.defineProperty(ls,"__esModule",{value:!0}),ls.SequenceError=void 0,S),Ia=(ls.SequenceError=Pa.createErrorClass(function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}),{}),hs={};function cc(e){throw new rc.TimeoutError(e)}Object.defineProperty(hs,"__esModule",{value:!0}),hs.isValidDate=void 0,hs.isValidDate=function(e){return e instanceof Date&&!isNaN(e)},rc=Ia,Object.defineProperty(rc,"__esModule",{value:!0}),rc.timeout=rc.TimeoutError=void 0,nc=ru,oc=hs,ic=P,uc=C,ac=y,sc=ts,rc.TimeoutError=S.createErrorClass(function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}),rc.timeout=function(e,t){var a=(e=oc.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e).first,s=e.each,r=e.with,c=void 0===r?cc:r,l=void 0===(r=e.scheduler)?null!=t?t:nc.asyncScheduler:r,f=void 0===(t=e.meta)?null:t;if(null==a&&null==s)throw new TypeError("No timeout provided.");return ic.operate(function(e,t){function r(e){n=sc.executeSchedule(t,l,function(){try{u.unsubscribe(),uc.innerFrom(c({meta:f,lastValue:o,seen:i})).subscribe(t)}catch(e){t.error(e)}},e)}var n,o=null,i=0,u=e.subscribe(ac.createOperatorSubscriber(t,function(e){null!=n&&n.unsubscribe(),i++,t.next(o=e),0<s&&r(s)},void 0,void 0,function(){null!=n&&n.closed||null!=n&&n.unsubscribe(),o=null}));i||r(null!=a?"number"==typeof a?a:+a-l.now():s)})};var Pa={},S={},lc={},fc={},pc=(Object.defineProperty(fc,"__esModule",{value:!0}),fc.map=void 0,P),dc=y;fc.map=function(n,o){return pc.operate(function(e,t){var r=0;e.subscribe(dc.createOperatorSubscriber(t,function(e){t.next(n.call(o,e,r++))}))})};var hc=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},bc=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},yc=(Object.defineProperty(lc,"__esModule",{value:!0}),lc.mapOneOrManyArgs=void 0,fc),_c=Array.isArray;lc.mapOneOrManyArgs=function(r){return yc.map(function(e){return t=r,_c(e=e)?t.apply(void 0,bc([],hc(e))):t(e);var t})};var vc=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},mc=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},gc=(Object.defineProperty(S,"__esModule",{value:!0}),S.bindCallbackInternals=void 0,aa),Oc=a,wc=is,Ec=lc,Pc=u,Sc=Ki;S.bindCallbackInternals=function r(a,s,n,o){if(n){if(!gc.isScheduler(n))return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(a,s,o).apply(this,e).pipe(Ec.mapOneOrManyArgs(n))};o=n}return o?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(a,s).apply(this,e).pipe(wc.subscribeOn(o),Pc.observeOn(o))}:function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var i=new Sc.AsyncSubject,u=!0;return new Oc.Observable(function(e){var n,o,e=i.subscribe(e);return u&&(n=u=!1,o=!1,s.apply(t,mc(mc([],vc(r)),[function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(a){var r=e.shift();if(null!=r)return void i.error(r)}i.next(1<e.length?e:e[0]),o=!0,n&&i.complete()}])),o&&i.complete(),n=!0),e})}},Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.bindCallback=void 0;var Tc=S;Pa.bindCallback=function(e,t,r){return Tc.bindCallbackInternals(!1,e,t,r)};var jc={},Cc=(Object.defineProperty(jc,"__esModule",{value:!0}),jc.bindNodeCallback=void 0,S);jc.bindNodeCallback=function(e,t,r){return Cc.bindCallbackInternals(!0,e,t,r)};var S={},Ic={},Rc=(Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.argsArgArrayOrObject=void 0,Array.isArray),kc=Object.getPrototypeOf,Ac=Object.prototype,Mc=Object.keys;Ic.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(Rc(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&kc(r)===Ac)return{args:(r=Mc(t)).map(function(e){return t[e]}),keys:r}}var r;return{args:e,keys:null}};var xc={};Object.defineProperty(xc,"__esModule",{value:!0}),xc.createObject=void 0,xc.createObject=function(e,n){return e.reduce(function(e,t,r){return e[t]=n[r],e},{})},Object.defineProperty(S,"__esModule",{value:!0}),S.combineLatestInit=S.combineLatest=void 0;var Nc=a,Uc=Ic,Dc=pa,Lc=b,Bc=lc,Fc=T,Wc=xc,zc=y,qc=ts;function Vc(a,s,c){return void 0===c&&(c=Lc.identity),function(u){Hc(s,function(){for(var e=a.length,n=new Array(e),o=e,i=e,t=0;t<e;t++)!function(r){Hc(s,function(){var e=Dc.from(a[r],s),t=!1;e.subscribe(zc.createOperatorSubscriber(u,function(e){n[r]=e,t||(t=!0,i--),i||u.next(c(n.slice()))},function(){--o||u.complete()}))},u)}(t)},u)}}function Hc(e,t,r){e?qc.executeSchedule(r,e,t):t()}S.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Fc.popScheduler(e),n=Fc.popResultSelector(e),o=Uc.argsArgArrayOrObject(e),i=o.args,u=o.keys;return 0===i.length?Dc.from([],r):(o=new Nc.Observable(Vc(i,r,u?function(e){return Wc.createObject(u,e)}:Lc.identity)),n?o.pipe(Bc.mapOneOrManyArgs(n)):o)},S.combineLatestInit=Vc;var Yc={},Kc={},Gc={},Zc={},Xc={},Qc=(Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.mergeInternals=void 0,C),Jc=ts,$c=y;Xc.mergeInternals=function(e,r,n,o,i,u,a,t){var s=[],c=0,l=0,f=function(){s.length||c||r.complete()},p=function(e){return c<o?d(e):s.push(e)},d=function(e){u&&r.next(e),c++;var t=!1;Qc.innerFrom(n(e,l++)).subscribe($c.createOperatorSubscriber(r,function(e){null!=i&&i(e),u?p(e):r.next(e)},function(){t=!0},void 0,function(){if(t)try{c--;for(;s.length&&c<o;)!function(){var e=s.shift();a?Jc.executeSchedule(r,a,function(){return d(e)}):d(e)}();f()}catch(e){r.error(e)}}))};return e.subscribe($c.createOperatorSubscriber(r,p,function(){f()})),function(){null!=t&&t()}},Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.mergeMap=void 0;var el=fc,tl=C,rl=P,nl=Xc,ol=E;Zc.mergeMap=function e(o,i,r){return void 0===r&&(r=1/0),ol.isFunction(i)?e(function(r,n){return el.map(function(e,t){return i(r,e,n,t)})(tl.innerFrom(o(r,n)))},r):("number"==typeof i&&(r=i),rl.operate(function(e,t){return nl.mergeInternals(e,t,o,r)}))},Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.mergeAll=void 0;var il=Zc,ul=b;Gc.mergeAll=function(e){return il.mergeMap(ul.identity,e=void 0===e?1/0:e)},Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.concatAll=void 0;var al=Gc;Kc.concatAll=function(){return al.mergeAll(1)},Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.concat=void 0;var sl=Kc,cl=T,ll=pa;Yc.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return sl.concatAll()(ll.from(e,cl.popScheduler(e)))};var fl={},pl={},dl=(Object.defineProperty(pl,"__esModule",{value:!0}),pl.defer=void 0,a),hl=C;pl.defer=function(t){return new dl.Observable(function(e){hl.innerFrom(t()).subscribe(e)})},Object.defineProperty(fl,"__esModule",{value:!0}),fl.connectable=void 0;var bl=O,yl=a,_l=pl,vl={connector:function(){return new bl.Subject},resetOnDisconnect:!0};fl.connectable=function(e,t){var r=null,n=(t=void 0===t?vl:t).connector,o=void 0===(t=t.resetOnDisconnect)||t,i=n();return(t=new yl.Observable(function(e){return i.subscribe(e)})).connect=function(){return r&&!r.closed||(r=_l.defer(function(){return e}).subscribe(i),o&&r.add(function(){return i=n()})),r},t};var ml={},gl=(Object.defineProperty(ml,"__esModule",{value:!0}),ml.forkJoin=void 0,a),Ol=Ic,wl=C,El=T,Pl=y,Sl=lc,Tl=xc;ml.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=El.popResultSelector(e),u=(n=Ol.argsArgArrayOrObject(e)).args,a=n.keys,n=new gl.Observable(function(e){var t=u.length;if(t)for(var n=new Array(t),o=t,i=t,r=0;r<t;r++)!function(t){var r=!1;wl.innerFrom(u[t]).subscribe(Pl.createOperatorSubscriber(e,function(e){r||(r=!0,i--),n[t]=e},function(){return o--},void 0,function(){o&&r||(i||e.next(a?Tl.createObject(a,n):n),e.complete())}))}(r);else e.complete()});return r?n.pipe(Sl.mapOneOrManyArgs(r)):n};var Ic={},jl=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Cl=(Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.fromEvent=void 0,C),Il=a,Rl=Zc,kl=ba,Al=E,Ml=lc,xl=["addListener","removeListener"],Nl=["addEventListener","removeEventListener"],Ul=["on","off"];function Dl(r,n){return function(t){return function(e){return r[t](n,e)}}}Ic.fromEvent=function t(r,n,o,e){if(Al.isFunction(o)&&(e=o,o=void 0),e)return t(r,n,o).pipe(Ml.mapOneOrManyArgs(e));var e=jl((e=r,Al.isFunction(e.addEventListener)&&Al.isFunction(e.removeEventListener)?Nl.map(function(t){return function(e){return r[t](n,e,o)}}):(e=r,Al.isFunction(e.addListener)&&Al.isFunction(e.removeListener)?xl.map(Dl(r,n)):(e=r,Al.isFunction(e.on)&&Al.isFunction(e.off)?Ul.map(Dl(r,n)):[]))),2),i=e[0],u=e[1];if(!i&&kl.isArrayLike(r))return Rl.mergeMap(function(e){return t(e,n,o)})(Cl.innerFrom(r));if(i)return new Il.Observable(function(r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1<e.length?e:e[0])}return i(e),function(){return u(e)}});throw new TypeError("Invalid event target")};var xc={},Ll=(Object.defineProperty(xc,"__esModule",{value:!0}),xc.fromEventPattern=void 0,a),Bl=E,Fl=lc;xc.fromEventPattern=function e(n,o,t){return t?e(n,o).pipe(Fl.mapOneOrManyArgs(t)):new Ll.Observable(function(r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1===e.length?e[0]:e)}var t=n(e);return Bl.isFunction(o)?function(){return o(e,t)}:void 0})};var ba={},Wl=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},zl=(Object.defineProperty(ba,"__esModule",{value:!0}),ba.generate=void 0,b),ql=aa,Vl=pl,Hl=ys;ba.generate=function(e,r,n,t,o){var i,u,a;function s(){var t;return Wl(this,function(e){switch(e.label){case 0:t=a,e.label=1;case 1:return r&&!r(t)?[3,4]:[4,u(t)];case 2:e.sent(),e.label=3;case 3:return t=n(t),[3,1];case 4:return[2]}})}return 1===arguments.length?(a=e.initialState,r=e.condition,n=e.iterate,i=e.resultSelector,u=void 0===i?zl.identity:i,o=e.scheduler):(a=e,!t||ql.isScheduler(t)?(u=zl.identity,o=t):u=t),Vl.defer(o?function(){return Hl.scheduleIterable(s(),o)}:s)};var ys={},Yl=(Object.defineProperty(ys,"__esModule",{value:!0}),ys.iif=void 0,pl);ys.iif=function(e,t,r){return Yl.defer(function(){return e()?t:r})};var Kl={},Gl={},Zl=(Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.timer=void 0,a),Xl=ru,Ql=aa,Jl=hs;Gl.timer=function(n,e,o){void 0===n&&(n=0),void 0===o&&(o=Xl.async);var i=-1;return null!=e&&(Ql.isScheduler(e)?o=e:i=e),new Zl.Observable(function(e){var t=Jl.isValidDate(n)?+n-o.now():n,r=0;return o.schedule(function(){e.closed||(e.next(r++),0<=i?this.schedule(void 0,i):e.complete())},t=t<0?0:t)})},Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.interval=void 0;var $l=ru,ef=Gl;Kl.interval=function(e,t){return ef.timer(e=(e=void 0===e?0:e)<0?0:e,e,t=void 0===t?$l.asyncScheduler:t)};var aa={},tf=(Object.defineProperty(aa,"__esModule",{value:!0}),aa.merge=void 0,Gc),rf=C,nf=j,of=T,uf=pa;aa.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=of.popScheduler(e),n=of.popNumber(e,1/0),o=e;return o.length?1===o.length?rf.innerFrom(o[0]):tf.mergeAll(n)(uf.from(o,r)):nf.EMPTY};var af,sf={},cf=(af=sf,Object.defineProperty(af,"__esModule",{value:!0}),af.never=af.NEVER=void 0,af.NEVER=new a.Observable(t.noop),af.never=function(){return af.NEVER},{}),lf={},ff=(Object.defineProperty(lf,"__esModule",{value:!0}),lf.argsOrArgArray=void 0,Array.isArray);lf.argsOrArgArray=function(e){return 1===e.length&&ff(e[0])?e[0]:e},Object.defineProperty(cf,"__esModule",{value:!0}),cf.onErrorResumeNext=void 0;var pf=a,df=lf,hf=y,bf=t,yf=C;cf.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=df.argsOrArgArray(e);return new pf.Observable(function(r){var n=0,o=function(){if(n<i.length){var e=void 0;try{e=yf.innerFrom(i[n++])}catch(e){return void o()}var t=new hf.OperatorSubscriber(r,void 0,bf.noop,bf.noop);e.subscribe(t),t.add(o)}else r.complete()};o()})};var _f={},vf=(Object.defineProperty(_f,"__esModule",{value:!0}),_f.pairs=void 0,pa);_f.pairs=function(e,t){return vf.from(Object.entries(e),t)};var mf={},gf={};Object.defineProperty(gf,"__esModule",{value:!0}),gf.not=void 0,gf.not=function(r,n){return function(e,t){return!r.call(n,e,t)}};var Of={},wf=(Object.defineProperty(Of,"__esModule",{value:!0}),Of.filter=void 0,P),Ef=y;Of.filter=function(n,o){return wf.operate(function(e,t){var r=0;e.subscribe(Ef.createOperatorSubscriber(t,function(e){return n.call(o,e,r++)&&t.next(e)}))})},Object.defineProperty(mf,"__esModule",{value:!0}),mf.partition=void 0;var Pf=gf,Sf=Of,Tf=C;mf.partition=function(e,t,r){return[Sf.filter(t,r)(Tf.innerFrom(e)),Sf.filter(Pf.not(t,r))(Tf.innerFrom(e))]};var jf={},Cf=(Object.defineProperty(jf,"__esModule",{value:!0}),jf.raceInit=jf.race=void 0,a),If=C,Rf=lf,kf=y;function Af(t){return function(n){for(var o=[],e=0;o&&!n.closed&&e<t.length;e++)!function(r){o.push(If.innerFrom(t[r]).subscribe(kf.createOperatorSubscriber(n,function(e){if(o){for(var t=0;t<o.length;t++)t!==r&&o[t].unsubscribe();o=null}n.next(e)})))}(e)}}jf.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Rf.argsOrArgArray(e)).length?If.innerFrom(e[0]):new Cf.Observable(Af(e))},jf.raceInit=Af;var Mf={},xf=(Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.range=void 0,a),Nf=j;Mf.range=function(r,e,n){if(null==e&&(e=r,r=0),e<=0)return Nf.EMPTY;var o=e+r;return new xf.Observable(n?function(e){var t=r;return n.schedule(function(){t<o?(e.next(t++),this.schedule()):e.complete()})}:function(e){for(var t=r;t<o&&!e.closed;)e.next(t++);e.complete()})};var Uf={},Df=(Object.defineProperty(Uf,"__esModule",{value:!0}),Uf.using=void 0,a),Lf=C,Bf=j;Uf.using=function(n,o){return new Df.Observable(function(e){var t=n(),r=o(t);return(r?Lf.innerFrom(r):Bf.EMPTY).subscribe(e),function(){t&&t.unsubscribe()}})};var Ff={},Wf=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},zf=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},qf=(Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.zip=void 0,a),Vf=C,Hf=lf,Yf=j,Kf=y,Gf=T;Ff.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Gf.popResultSelector(e),u=Hf.argsOrArgArray(e);return u.length?new qf.Observable(function(r){for(var n=u.map(function(){return[]}),o=u.map(function(){return!1}),e=(r.add(function(){n=o=null}),0);!r.closed&&e<u.length;e++)!function(t){Vf.innerFrom(u[t]).subscribe(Kf.createOperatorSubscriber(r,function(e){n[t].push(e),n.every(function(e){return e.length})&&(e=n.map(function(e){return e.shift()}),r.next(i?i.apply(void 0,zf([],Wf(e))):e),n.some(function(e,t){return!e.length&&o[t]})&&r.complete())},function(){o[t]=!0,n[t].length||r.complete()}))}(e);return function(){n=o=null}}):Yf.EMPTY};var Zf={},Xf=(Object.defineProperty(Zf,"__esModule",{value:!0}),{}),Qf=(Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.audit=void 0,P),Jf=C,$f=y;Xf.audit=function(s){return Qf.operate(function(e,t){function r(){var e;null!=u&&u.unsubscribe(),u=null,o&&(o=!1,e=i,i=null,t.next(e)),a&&t.complete()}function n(){u=null,a&&t.complete()}var o=!1,i=null,u=null,a=!1;e.subscribe($f.createOperatorSubscriber(t,function(e){o=!0,i=e,u||Jf.innerFrom(s(e)).subscribe(u=$f.createOperatorSubscriber(t,r,n))},function(){a=!0,o&&u&&!u.closed||t.complete()}))})};var ep={},tp=(Object.defineProperty(ep,"__esModule",{value:!0}),ep.auditTime=void 0,ru),rp=Xf,np=Gl;ep.auditTime=function(e,t){return void 0===t&&(t=tp.asyncScheduler),rp.audit(function(){return np.timer(e,t)})};var op={},ip=(Object.defineProperty(op,"__esModule",{value:!0}),op.buffer=void 0,P),up=t,ap=y,sp=C;op.buffer=function(n){return ip.operate(function(e,t){var r=[];return e.subscribe(ap.createOperatorSubscriber(t,function(e){return r.push(e)},function(){t.next(r),t.complete()})),sp.innerFrom(n).subscribe(ap.createOperatorSubscriber(t,function(){var e=r;r=[],t.next(e)},up.noop)),function(){r=null}})};var cp={},lp=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fp=(Object.defineProperty(cp,"__esModule",{value:!0}),cp.bufferCount=void 0,P),pp=y,dp=X;cp.bufferCount=function(h,b){return b=null!=(b=void 0===b?null:b)?b:h,fp.operate(function(e,f){var p=[],d=0;e.subscribe(pp.createOperatorSubscriber(f,function(e){var t,r,n,o,i=null;d++%b==0&&p.push([]);try{for(var u=lp(p),a=u.next();!a.done;a=u.next())(l=a.value).push(e),h<=l.length&&(i=null!=i?i:[]).push(l)}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}if(i)try{for(var s=lp(i),c=s.next();!c.done;c=s.next()){var l=c.value;dp.arrRemove(p,l),f.next(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},function(){var t,e;try{for(var r=lp(p),n=r.next();!n.done;n=r.next()){var o=n.value;f.next(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}f.complete()},void 0,function(){p=null}))})};var hp={},bp=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yp=(Object.defineProperty(hp,"__esModule",{value:!0}),hp.bufferTime=void 0,_),_p=P,vp=y,mp=X,gp=ru,Op=T,wp=ts;hp.bufferTime=function(i){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var u=null!=(e=Op.popScheduler(t))?e:gp.asyncScheduler,a=null!=(e=t[0])?e:null,l=t[1]||1/0;return _p.operate(function(e,r){var s=[],n=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),mp.arrRemove(s,e),r.next(t),n&&o()},o=function(){var e,t;s&&(e=new yp.Subscription,r.add(e),s.push(t={buffer:[],subs:e}),wp.executeSchedule(e,u,function(){return c(t)},i))},t=(null!==a&&0<=a?wp.executeSchedule(r,u,o,a,!0):n=!0,o(),vp.createOperatorSubscriber(r,function(e){var t,r,n=s.slice();try{for(var o=bp(n),i=o.next();!i.done;i=o.next()){var u=i.value,a=u.buffer;a.push(e),l<=a.length&&c(u)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},function(){for(;null!=s&&s.length;)r.next(s.shift().buffer);null!=t&&t.unsubscribe(),r.complete(),r.unsubscribe()},void 0,function(){return s=null}));e.subscribe(t)})};var Ep={},Pp=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Sp=(Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.bufferToggle=void 0,_),Tp=P,jp=C,Cp=y,Ip=t,Rp=X;Ep.bufferToggle=function(t,o){return Tp.operate(function(e,n){var i=[];jp.innerFrom(t).subscribe(Cp.createOperatorSubscriber(n,function(e){var t=[],r=(i.push(t),new Sp.Subscription);r.add(jp.innerFrom(o(e)).subscribe(Cp.createOperatorSubscriber(n,function(){Rp.arrRemove(i,t),n.next(t),r.unsubscribe()},Ip.noop)))},Ip.noop)),e.subscribe(Cp.createOperatorSubscriber(n,function(e){var t,r;try{for(var n=Pp(i),o=n.next();!o.done;o=n.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},function(){for(;0<i.length;)n.next(i.shift());n.complete()}))})};var kp={},Ap=(Object.defineProperty(kp,"__esModule",{value:!0}),kp.bufferWhen=void 0,P),Mp=t,xp=y,Np=C;kp.bufferWhen=function(i){return Ap.operate(function(e,t){var r=null,n=null,o=function(){null!=n&&n.unsubscribe();var e=r;r=[],e&&t.next(e),Np.innerFrom(i()).subscribe(n=xp.createOperatorSubscriber(t,o,Mp.noop))};o(),e.subscribe(xp.createOperatorSubscriber(t,function(e){return null==r?void 0:r.push(e)},function(){r&&t.next(r),t.complete()},void 0,function(){return r=n=null}))})};var Up={},Dp=(Object.defineProperty(Up,"__esModule",{value:!0}),Up.catchError=void 0,C),Lp=y,Bp=P;Up.catchError=function u(a){return Bp.operate(function(t,r){var n,o=null,i=!1,o=t.subscribe(Lp.createOperatorSubscriber(r,void 0,void 0,function(e){n=Dp.innerFrom(a(e,u(a)(t))),o?(o.unsubscribe(),o=null,n.subscribe(r)):i=!0}));i&&(o.unsubscribe(),o=null,n.subscribe(r))})};var Fp={},Wp={},I={},zp={},qp={},Vp={},Hp=(Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.scanInternals=void 0,y);Vp.scanInternals=function(u,t,a,s,c){return function(e,r){var n=a,o=t,i=0;e.subscribe(Hp.createOperatorSubscriber(r,function(e){var t=i++;o=n?u(o,e,t):(n=!0,e),s&&r.next(o)},c&&function(){n&&r.next(o),r.complete()}))}},Object.defineProperty(qp,"__esModule",{value:!0}),qp.reduce=void 0;var Yp=Vp,Kp=P;qp.reduce=function(e,t){return Kp.operate(Yp.scanInternals(e,t,2<=arguments.length,!1,!0))},Object.defineProperty(zp,"__esModule",{value:!0}),zp.toArray=void 0;function Gp(e,t){return e.push(t),e}var Zp=qp,Xp=P;zp.toArray=function(){return Xp.operate(function(e,t){Zp.reduce(Gp,[])(e).subscribe(t)})},Object.defineProperty(I,"__esModule",{value:!0}),I.joinAllInternals=void 0;var Qp=b,Jp=lc,$p=c,ed=Zc,td=zp;I.joinAllInternals=function(t,e){return $p.pipe(td.toArray(),ed.mergeMap(function(e){return t(e)}),e?Jp.mapOneOrManyArgs(e):Qp.identity)},Object.defineProperty(Wp,"__esModule",{value:!0}),Wp.combineLatestAll=void 0;var rd=S,nd=I;Wp.combineLatestAll=function(e){return nd.joinAllInternals(rd.combineLatest,e)},Object.defineProperty(Fp,"__esModule",{value:!0}),Fp.combineAll=void 0;Fp.combineAll=Wp.combineLatestAll;var od={},id={},ud=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ad=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},sd=(Object.defineProperty(id,"__esModule",{value:!0}),id.combineLatest=void 0,S),cd=P,ld=lf,fd=lc,pd=c,dd=T;function hd(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=dd.popResultSelector(r);return t?pd.pipe(hd.apply(void 0,ad([],ud(r))),fd.mapOneOrManyArgs(t)):cd.operate(function(e,t){sd.combineLatestInit(ad([e],ud(ld.argsOrArgArray(r))))(t)})}id.combineLatest=hd;var bd=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},yd=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},_d=(Object.defineProperty(od,"__esModule",{value:!0}),od.combineLatestWith=void 0,id);od.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _d.combineLatest.apply(void 0,yd([],bd(e)))};var lc={},vd=(Object.defineProperty(lc,"__esModule",{value:!0}),lc.concatMap=void 0,Zc),md=E;lc.concatMap=function(e,t){return md.isFunction(t)?vd.mergeMap(e,t,1):vd.mergeMap(e,1)};var gd={},Od=(Object.defineProperty(gd,"__esModule",{value:!0}),gd.concatMapTo=void 0,lc),wd=E;gd.concatMapTo=function(e,t){return wd.isFunction(t)?Od.concatMap(function(){return e},t):Od.concatMap(function(){return e})};var Ed={},Pd={},Sd=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Td=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},jd=(Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.concat=void 0,P),Cd=Kc,Id=T,Rd=pa;Pd.concat=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=Id.popScheduler(r);return jd.operate(function(e,t){Cd.concatAll()(Rd.from(Td([e],Sd(r)),n)).subscribe(t)})};var kd=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ad=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Md=(Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.concatWith=void 0,Pd);Ed.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Md.concat.apply(void 0,Ad([],kd(e)))};var xd={},Nd={},Ud=(Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.fromSubscribable=void 0,a);Nd.fromSubscribable=function(t){return new Ud.Observable(function(e){return t.subscribe(e)})},Object.defineProperty(xd,"__esModule",{value:!0}),xd.connect=void 0;var Dd=O,Ld=C,Bd=P,Fd=Nd,Wd={connector:function(){return new Dd.Subject}};xd.connect=function(n,e){var o=(e=void 0===e?Wd:e).connector;return Bd.operate(function(e,t){var r=o();Ld.innerFrom(n(Fd.fromSubscribable(r))).subscribe(t),t.add(e.subscribe(r))})};var Nd={},zd=(Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.count=void 0,qp);Nd.count=function(n){return zd.reduce(function(e,t,r){return!n||n(t,r)?e+1:e},0)};var qd={},Vd=(Object.defineProperty(qd,"__esModule",{value:!0}),qd.debounce=void 0,P),Hd=t,Yd=y,Kd=C;qd.debounce=function(u){return Vd.operate(function(e,t){function r(){var e;null!=i&&i.unsubscribe(),i=null,n&&(n=!1,e=o,o=null,t.next(e))}var n=!1,o=null,i=null;e.subscribe(Yd.createOperatorSubscriber(t,function(e){null!=i&&i.unsubscribe(),n=!0,o=e,i=Yd.createOperatorSubscriber(t,r,Hd.noop),Kd.innerFrom(u(e)).subscribe(i)},function(){r(),t.complete()},void 0,function(){o=i=null}))})};var R={},Gd=(Object.defineProperty(R,"__esModule",{value:!0}),R.debounceTime=void 0,ru),Zd=P,Xd=y;R.debounceTime=function(a,s){return void 0===s&&(s=Gd.asyncScheduler),Zd.operate(function(e,r){var n=null,t=null,o=null,i=function(){var e;n&&(n.unsubscribe(),e=t,t=n=null,r.next(e))};function u(){var e=o+a,t=s.now();if(t<e)return n=this.schedule(void 0,e-t),void r.add(n);i()}e.subscribe(Xd.createOperatorSubscriber(r,function(e){t=e,o=s.now(),n||(n=s.schedule(u,a),r.add(n))},function(){i(),r.complete()},void 0,function(){t=n=null}))})};var Qd={},Jd=(Object.defineProperty(Qd,"__esModule",{value:!0}),Qd.defaultIfEmpty=void 0,P),$d=y;Qd.defaultIfEmpty=function(n){return Jd.operate(function(e,t){var r=!1;e.subscribe($d.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){r||t.next(n),t.complete()}))})};var eh={},th={},rh={},nh=(Object.defineProperty(rh,"__esModule",{value:!0}),rh.take=void 0,j),oh=P,ih=y;rh.take=function(n){return n<=0?function(){return nh.EMPTY}:oh.operate(function(e,t){var r=0;e.subscribe(ih.createOperatorSubscriber(t,function(e){++r<=n&&(t.next(e),n<=r&&t.complete())}))})};var uh={},ah=(Object.defineProperty(uh,"__esModule",{value:!0}),uh.ignoreElements=void 0,P),sh=y,ch=t;uh.ignoreElements=function(){return ah.operate(function(e,t){e.subscribe(sh.createOperatorSubscriber(t,ch.noop))})};var lh={},fh=(Object.defineProperty(lh,"__esModule",{value:!0}),lh.mapTo=void 0,fc);lh.mapTo=function(e){return fh.map(function(){return e})},Object.defineProperty(th,"__esModule",{value:!0}),th.delayWhen=void 0;var ph=Yc,dh=rh,hh=uh,bh=lh,yh=Zc,_h=C;th.delayWhen=function t(r,n){return n?function(e){return ph.concat(n.pipe(dh.take(1),hh.ignoreElements()),e.pipe(t(r)))}:yh.mergeMap(function(e,t){return _h.innerFrom(r(e,t)).pipe(dh.take(1),bh.mapTo(e))})},Object.defineProperty(eh,"__esModule",{value:!0}),eh.delay=void 0;var vh=ru,mh=th,gh=Gl;eh.delay=function(e,t){var r=gh.timer(e,t=void 0===t?vh.asyncScheduler:t);return mh.delayWhen(function(){return r})};var Oh={},wh=(Object.defineProperty(Oh,"__esModule",{value:!0}),Oh.dematerialize=void 0,nu),Eh=P,Ph=y;Oh.dematerialize=function(){return Eh.operate(function(e,t){e.subscribe(Ph.createOperatorSubscriber(t,function(e){return wh.observeNotification(e,t)}))})};var Sh={},Th=(Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.distinct=void 0,P),jh=y,Ch=t,Ih=C;Sh.distinct=function(o,t){return Th.operate(function(e,r){var n=new Set;e.subscribe(jh.createOperatorSubscriber(r,function(e){var t=o?o(e):e;n.has(t)||(n.add(t),r.next(e))})),t&&Ih.innerFrom(t).subscribe(jh.createOperatorSubscriber(r,function(){return n.clear()},Ch.noop))})};var Rh={},kh=(Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.distinctUntilChanged=void 0,b),Ah=P,Mh=y;function xh(e,t){return e===t}Rh.distinctUntilChanged=function(i,u){return void 0===u&&(u=kh.identity),i=null!=i?i:xh,Ah.operate(function(e,r){var n,o=!0;e.subscribe(Mh.createOperatorSubscriber(r,function(e){var t=u(e);!o&&i(n,t)||(o=!1,n=t,r.next(e))}))})};var Nh={},Uh=(Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.distinctUntilKeyChanged=void 0,Rh);Nh.distinctUntilKeyChanged=function(r,n){return Uh.distinctUntilChanged(function(e,t){return n?n(e[r],t[r]):e[r]===t[r]})};var Dh={},Lh={},Bh=(Object.defineProperty(Lh,"__esModule",{value:!0}),Lh.throwIfEmpty=void 0,ya),Fh=P,Wh=y;function zh(){return new Bh.EmptyError}Lh.throwIfEmpty=function(n){return void 0===n&&(n=zh),Fh.operate(function(e,t){var r=!1;e.subscribe(Wh.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){return r?t.complete():t.error(n())}))})},Object.defineProperty(Dh,"__esModule",{value:!0}),Dh.elementAt=void 0;var qh=Ea,Vh=Of,Hh=Lh,Yh=Qd,Kh=rh;Dh.elementAt=function(r,t){if(r<0)throw new qh.ArgumentOutOfRangeError;var n=2<=arguments.length;return function(e){return e.pipe(Vh.filter(function(e,t){return t===r}),Kh.take(1),n?Yh.defaultIfEmpty(t):Hh.throwIfEmpty(function(){return new qh.ArgumentOutOfRangeError}))}};var Gh={},Zh=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Xh=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Qh=(Object.defineProperty(Gh,"__esModule",{value:!0}),Gh.endWith=void 0,Yc),Jh=n;Gh.endWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return Qh.concat(e,Jh.of.apply(void 0,Xh([],Zh(t))))}};var $h={},eb=(Object.defineProperty($h,"__esModule",{value:!0}),$h.every=void 0,P),tb=y;$h.every=function(o,i){return eb.operate(function(t,r){var n=0;t.subscribe(tb.createOperatorSubscriber(r,function(e){o.call(i,e,n++,t)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})};var rb={},nb={},ob={},ib=(Object.defineProperty(ob,"__esModule",{value:!0}),ob.exhaustMap=void 0,fc),ub=C,ab=P,sb=y;ob.exhaustMap=function t(i,o){return o?function(e){return e.pipe(t(function(r,n){return ub.innerFrom(i(r,n)).pipe(ib.map(function(e,t){return o(r,e,n,t)}))}))}:ab.operate(function(e,t){var r=0,n=null,o=!1;e.subscribe(sb.createOperatorSubscriber(t,function(e){n||(n=sb.createOperatorSubscriber(t,void 0,function(){n=null,o&&t.complete()}),ub.innerFrom(i(e,r++)).subscribe(n))},function(){o=!0,n||t.complete()}))})},Object.defineProperty(nb,"__esModule",{value:!0}),nb.exhaustAll=void 0;var cb=ob,lb=b;nb.exhaustAll=function(){return cb.exhaustMap(lb.identity)},Object.defineProperty(rb,"__esModule",{value:!0}),rb.exhaust=void 0;rb.exhaust=nb.exhaustAll;var fb={},pb=(Object.defineProperty(fb,"__esModule",{value:!0}),fb.expand=void 0,P),db=Xc;fb.expand=function(r,n,o){return n=((n=void 0===n?1/0:n)||0)<1?1/0:n,pb.operate(function(e,t){return db.mergeInternals(e,t,r,n,void 0,!0,o)})};var k={},hb=(Object.defineProperty(k,"__esModule",{value:!0}),k.finalize=void 0,P);k.finalize=function(r){return hb.operate(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})};var bb={},yb=(Object.defineProperty(bb,"__esModule",{value:!0}),bb.createFind=bb.find=void 0,P),_b=y;function vb(i,u,e){var a="index"===e;return function(r,n){var o=0;r.subscribe(_b.createOperatorSubscriber(n,function(e){var t=o++;i.call(u,e,t,r)&&(n.next(a?t:e),n.complete())},function(){n.next(a?-1:void 0),n.complete()}))}}bb.find=function(e,t){return yb.operate(vb(e,t,"value"))},bb.createFind=vb;var mb={},gb=(Object.defineProperty(mb,"__esModule",{value:!0}),mb.findIndex=void 0,P),Ob=bb;mb.findIndex=function(e,t){return gb.operate(Ob.createFind(e,t,"index"))};var wb={},Eb=(Object.defineProperty(wb,"__esModule",{value:!0}),wb.first=void 0,ya),Pb=Of,Sb=rh,Tb=Qd,jb=Lh,Cb=b;wb.first=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?Pb.filter(function(e,t){return n(e,t,r)}):Cb.identity,Sb.take(1),t?Tb.defaultIfEmpty(e):jb.throwIfEmpty(function(){return new Eb.EmptyError}))}};var Ib={},Rb=(Object.defineProperty(Ib,"__esModule",{value:!0}),Ib.groupBy=void 0,a),kb=C,Ab=O,Mb=P,xb=y;Ib.groupBy=function(b,t,y,_){return Mb.operate(function(e,s){function c(t){return r(function(e){return e.error(t)})}t&&"function"!=typeof t?(y=t.duration,l=t.element,_=t.connector):l=t;var l,f=new Map,r=function(e){f.forEach(e),e(s)},p=0,d=!1,h=new xb.OperatorSubscriber(s,function(e){try{var t,r,n=b(e),o=f.get(n);o||(f.set(n,o=_?_():new Ab.Subject),i=n,u=o,(a=new Rb.Observable(function(e){p++;var t=u.subscribe(e);return function(){t.unsubscribe(),0==--p&&d&&h.unsubscribe()}})).key=i,t=a,s.next(t),y&&(r=xb.createOperatorSubscriber(o,function(){o.complete(),null!=r&&r.unsubscribe()},void 0,void 0,function(){return f.delete(n)}),h.add(kb.innerFrom(y(t)).subscribe(r)))),o.next(l?l(e):e)}catch(e){c(e)}var i,u,a},function(){return r(function(e){return e.complete()})},c,function(){return f.clear()},function(){return d=!0,0===p});e.subscribe(h)})};var Nb={},Ub=(Object.defineProperty(Nb,"__esModule",{value:!0}),Nb.isEmpty=void 0,P),Db=y;Nb.isEmpty=function(){return Ub.operate(function(e,t){e.subscribe(Db.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})};var Lb={},Bb={},Fb=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wb=(Object.defineProperty(Bb,"__esModule",{value:!0}),Bb.takeLast=void 0,j),zb=P,qb=y;Bb.takeLast=function(t){return t<=0?function(){return Wb.EMPTY}:zb.operate(function(e,i){var u=[];e.subscribe(qb.createOperatorSubscriber(i,function(e){u.push(e),t<u.length&&u.shift()},function(){var t,e;try{for(var r=Fb(u),n=r.next();!n.done;n=r.next()){var o=n.value;i.next(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}i.complete()},void 0,function(){u=null}))})},Object.defineProperty(Lb,"__esModule",{value:!0}),Lb.last=void 0;var Vb=ya,Hb=Of,Yb=Bb,Kb=Lh,Gb=Qd,Zb=b;Lb.last=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?Hb.filter(function(e,t){return n(e,t,r)}):Zb.identity,Yb.takeLast(1),t?Gb.defaultIfEmpty(e):Kb.throwIfEmpty(function(){return new Vb.EmptyError}))}};var Xb={},Qb=(Object.defineProperty(Xb,"__esModule",{value:!0}),Xb.materialize=void 0,nu),Jb=P,$b=y;Xb.materialize=function(){return Jb.operate(function(e,t){e.subscribe($b.createOperatorSubscriber(t,function(e){t.next(Qb.Notification.createNext(e))},function(){t.next(Qb.Notification.createComplete()),t.complete()},function(e){t.next(Qb.Notification.createError(e)),t.complete()}))})};var ey={},ty=(Object.defineProperty(ey,"__esModule",{value:!0}),ey.max=void 0,qp),ry=E;ey.max=function(r){return ty.reduce(ry.isFunction(r)?function(e,t){return 0<r(e,t)?e:t}:function(e,t){return t<e?e:t})};var ny={},oy=(Object.defineProperty(ny,"__esModule",{value:!0}),ny.flatMap=void 0,Zc),oy=(ny.flatMap=oy.mergeMap,{}),iy=(Object.defineProperty(oy,"__esModule",{value:!0}),oy.mergeMapTo=void 0,Zc),uy=E;oy.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),uy.isFunction(t)?iy.mergeMap(function(){return e},t,r):iy.mergeMap(function(){return e},r="number"==typeof t?t:r)};var ay={},sy=(Object.defineProperty(ay,"__esModule",{value:!0}),ay.mergeScan=void 0,P),cy=Xc;ay.mergeScan=function(n,o,i){return void 0===i&&(i=1/0),sy.operate(function(e,t){var r=o;return cy.mergeInternals(e,t,function(e,t){return n(r,e,t)},i,function(e){r=e},!1,void 0,function(){return r=null})})};var Xc={},ly={},fy=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},py=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},dy=(Object.defineProperty(ly,"__esModule",{value:!0}),ly.merge=void 0,P),hy=lf,by=Gc,yy=T,_y=pa;ly.merge=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=yy.popScheduler(r),o=yy.popNumber(r,1/0),r=hy.argsOrArgArray(r);return dy.operate(function(e,t){by.mergeAll(o)(_y.from(py([e],fy(r)),n)).subscribe(t)})};var vy=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},my=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},gy=(Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.mergeWith=void 0,ly);Xc.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return gy.merge.apply(void 0,my([],vy(e)))};var Oy={},wy=(Object.defineProperty(Oy,"__esModule",{value:!0}),Oy.min=void 0,qp),Ey=E;Oy.min=function(r){return wy.reduce(Ey.isFunction(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e<t?e:t})};var Py={},Sy=(Object.defineProperty(Py,"__esModule",{value:!0}),Py.multicast=void 0,m),Ty=E,jy=xd;Py.multicast=function(e,t){var r=Ty.isFunction(e)?e:function(){return e};return Ty.isFunction(t)?jy.connect(t,{connector:r}):function(e){return new Sy.ConnectableObservable(e,r)}};var Cy={},Iy=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ry=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},ky=(Object.defineProperty(Cy,"__esModule",{value:!0}),Cy.onErrorResumeNext=Cy.onErrorResumeNextWith=void 0,lf),Ay=cf;function My(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ky.argsOrArgArray(e);return function(e){return Ay.onErrorResumeNext.apply(void 0,Ry([e],Iy(r)))}}Cy.onErrorResumeNextWith=My,Cy.onErrorResumeNext=My;var xy={},Ny=(Object.defineProperty(xy,"__esModule",{value:!0}),xy.pairwise=void 0,P),Uy=y;xy.pairwise=function(){return Ny.operate(function(e,r){var n,o=!1;e.subscribe(Uy.createOperatorSubscriber(r,function(e){var t=n;n=e,o&&r.next([t,e]),o=!0}))})};var Dy={},Ly=(Object.defineProperty(Dy,"__esModule",{value:!0}),Dy.pluck=void 0,fc);Dy.pluck=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];var i=o.length;if(0===i)throw new Error("list of properties cannot be empty.");return Ly.map(function(e){for(var t=e,r=0;r<i;r++){var n=null==t?void 0:t[o[r]];if(void 0===n)return;t=n}return t})};var By={},Fy=(Object.defineProperty(By,"__esModule",{value:!0}),By.publish=void 0,O),Wy=Py,zy=xd;By.publish=function(t){return t?function(e){return zy.connect(t)(e)}:function(e){return Wy.multicast(new Fy.Subject)(e)}};var qy={},Vy=(Object.defineProperty(qy,"__esModule",{value:!0}),qy.publishBehavior=void 0,i),Hy=m;qy.publishBehavior=function(r){return function(e){var t=new Vy.BehaviorSubject(r);return new Hy.ConnectableObservable(e,function(){return t})}};var Yy={},Ky=(Object.defineProperty(Yy,"__esModule",{value:!0}),Yy.publishLast=void 0,Ki),Gy=m;Yy.publishLast=function(){return function(e){var t=new Ky.AsyncSubject;return new Gy.ConnectableObservable(e,function(){return t})}};var Zy={},Xy=(Object.defineProperty(Zy,"__esModule",{value:!0}),Zy.publishReplay=void 0,g),Qy=Py,Jy=E;Zy.publishReplay=function(t,r,e,n){e&&!Jy.isFunction(e)&&(n=e);var o=Jy.isFunction(e)?e:void 0;return function(e){return Qy.multicast(new Xy.ReplaySubject(t,r,n),o)(e)}};var $y={},e_=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},t_=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},r_=(Object.defineProperty($y,"__esModule",{value:!0}),$y.raceWith=void 0,jf),n_=P,o_=b;$y.raceWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length?n_.operate(function(e,t){r_.raceInit(t_([e],e_(r)))(t)}):o_.identity};var i_={},u_=(Object.defineProperty(i_,"__esModule",{value:!0}),i_.repeat=void 0,j),a_=P,s_=y,c_=C,l_=Gl;i_.repeat=function(e){var t,a,s=1/0;return null!=e&&("object"==typeof e?(t=e.count,s=void 0===t?1/0:t,a=e.delay):s=e),s<=0?function(){return u_.EMPTY}:a_.operate(function(t,r){function n(){var e=!1;o=t.subscribe(s_.createOperatorSubscriber(r,void 0,function(){++i<s?o?u():e=!0:r.complete()})),e&&u()}var o,i=0,u=function(){var e,t;null!=o&&o.unsubscribe(),(o=null)!=a?(e="number"==typeof a?l_.timer(a):c_.innerFrom(a(i)),t=s_.createOperatorSubscriber(r,function(){t.unsubscribe(),n()}),e.subscribe(t)):n()};n()})};var f_={},p_=(Object.defineProperty(f_,"__esModule",{value:!0}),f_.repeatWhen=void 0,C),d_=O,h_=P,b_=y;f_.repeatWhen=function(l){return h_.operate(function(e,t){var r,n,o=!1,i=!1,u=!1,a=function(){return u&&i&&(t.complete(),!0)},s=function(){return n||(n=new d_.Subject,p_.innerFrom(l(n)).subscribe(b_.createOperatorSubscriber(t,function(){r?c():o=!0},function(){i=!0,a()}))),n},c=function(){u=!1,r=e.subscribe(b_.createOperatorSubscriber(t,void 0,function(){u=!0,a()||s().next()})),o&&(r.unsubscribe(),r=null,o=!1,c())};c()})};var y_={},__=(Object.defineProperty(y_,"__esModule",{value:!0}),y_.retry=void 0,P),v_=y,m_=b,g_=Gl,O_=C;y_.retry=function(e){var t=(e=(e=void 0===e?1/0:e)&&"object"==typeof e?e:{count:e}).count,c=void 0===t?1/0:t,l=e.delay,r=void 0!==(t=e.resetOnSuccess)&&t;return c<=0?m_.identity:__.operate(function(e,i){var u,a=0,s=function(){var o=!1;u=e.subscribe(v_.createOperatorSubscriber(i,function(e){r&&(a=0),i.next(e)},void 0,function(e){var t,r,n;a++<c?(t=function(){u?(u.unsubscribe(),u=null,s()):o=!0},null!=l?(r="number"==typeof l?g_.timer(l):O_.innerFrom(l(e,a)),n=v_.createOperatorSubscriber(i,function(){n.unsubscribe(),t()},function(){i.complete()}),r.subscribe(n)):t()):i.error(e)})),o&&(u.unsubscribe(),u=null,s())};s()})};var w_={},E_=(Object.defineProperty(w_,"__esModule",{value:!0}),w_.retryWhen=void 0,C),P_=O,S_=P,T_=y;w_.retryWhen=function(u){return S_.operate(function(e,t){var r,n,o=!1,i=function(){r=e.subscribe(T_.createOperatorSubscriber(t,void 0,void 0,function(e){n||(n=new P_.Subject,E_.innerFrom(u(n)).subscribe(T_.createOperatorSubscriber(t,function(){return r?i():o=!0}))),n&&n.next(e)})),o&&(r.unsubscribe(),r=null,o=!1,i())};i()})};var j_={},C_=(Object.defineProperty(j_,"__esModule",{value:!0}),j_.sample=void 0,C),I_=P,R_=t,k_=y;j_.sample=function(o){return I_.operate(function(e,t){var r=!1,n=null;e.subscribe(k_.createOperatorSubscriber(t,function(e){r=!0,n=e})),C_.innerFrom(o).subscribe(k_.createOperatorSubscriber(t,function(){var e;r&&(r=!1,e=n,n=null,t.next(e))},R_.noop))})};var A_={},M_=(Object.defineProperty(A_,"__esModule",{value:!0}),A_.sampleTime=void 0,ru),x_=j_,N_=Kl;A_.sampleTime=function(e,t){return x_.sample(N_.interval(e,t=void 0===t?M_.asyncScheduler:t))};var U_={},D_=(Object.defineProperty(U_,"__esModule",{value:!0}),U_.scan=void 0,P),L_=Vp;U_.scan=function(e,t){return D_.operate(L_.scanInternals(e,t,2<=arguments.length,!0))};var Vp={},B_=(Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.sequenceEqual=void 0,P),F_=y,W_=C;function z_(){return{buffer:[],complete:!1}}Vp.sequenceEqual=function(u,a){return void 0===a&&(a=function(e,t){return e===t}),B_.operate(function(e,t){function r(n,o){var r=F_.createOperatorSubscriber(t,function(e){var t=o.buffer,r=o.complete;0===t.length?r?i(!1):n.buffer.push(e):a(e,t.shift())||i(!1)},function(){n.complete=!0;var e=o.complete,t=o.buffer;e&&i(0===t.length),null!=r&&r.unsubscribe()});return r}var n=z_(),o=z_(),i=function(e){t.next(e),t.complete()};e.subscribe(r(n,o)),W_.innerFrom(u).subscribe(r(o,n))})};var q_={},V_=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},H_=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Y_=(Object.defineProperty(q_,"__esModule",{value:!0}),q_.share=void 0,C),K_=O,G_=Ar,Z_=P;function X_(e,t){for(var r,n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(!0===t)e();else if(!1!==t)return r=new G_.SafeSubscriber({next:function(){r.unsubscribe(),e()}}),Y_.innerFrom(t.apply(void 0,H_([],V_(n)))).subscribe(r)}q_.share=function(e){var t=(e=void 0===e?{}:e).connector,p=void 0===t?function(){return new K_.Subject}:t,d=void 0===(t=e.resetOnError)||t,h=void 0===(t=e.resetOnComplete)||t,b=void 0===(t=e.resetOnRefCountZero)||t;return function(e){function n(){var e=o;f(),null!=e&&e.unsubscribe()}var o,i,u,a=0,s=!1,c=!1,l=function(){null!=i&&i.unsubscribe(),i=void 0},f=function(){l(),o=u=void 0,s=c=!1};return Z_.operate(function(e,t){a++,c||s||l();var r=u=null!=u?u:p();t.add(function(){0!==--a||c||s||(i=X_(n,b))}),r.subscribe(t),!o&&0<a&&(o=new G_.SafeSubscriber({next:function(e){return r.next(e)},error:function(e){c=!0,l(),i=X_(f,d,e),r.error(e)},complete:function(){s=!0,l(),i=X_(f,h),r.complete()}}),Y_.innerFrom(e).subscribe(o))})(e)}};var Q_={},J_=(Object.defineProperty(Q_,"__esModule",{value:!0}),Q_.shareReplay=void 0,g),$_=q_;Q_.shareReplay=function(e,t,r){var n,o,i=!1;return e&&"object"==typeof e?(n=e.bufferSize,o=void 0===n?1/0:n,n=e.windowTime,t=void 0===n?1/0:n,i=void 0!==(n=e.refCount)&&n,r=e.scheduler):o=null!=e?e:1/0,$_.share({connector:function(){return new J_.ReplaySubject(o,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})};var ev={},tv=(Object.defineProperty(ev,"__esModule",{value:!0}),ev.single=void 0,ya),rv=ls,nv=Es,ov=P,iv=y;ev.single=function(a){return ov.operate(function(t,r){var n,o=!1,i=!1,u=0;t.subscribe(iv.createOperatorSubscriber(r,function(e){i=!0,a&&!a(e,u++,t)||(o&&r.error(new rv.SequenceError("Too many matching values")),o=!0,n=e)},function(){o?(r.next(n),r.complete()):r.error(i?new nv.NotFoundError("No matching values"):new tv.EmptyError)}))})};var uv={},av=(Object.defineProperty(uv,"__esModule",{value:!0}),uv.skip=void 0,Of);uv.skip=function(r){return av.filter(function(e,t){return r<=t})};var sv={},cv=(Object.defineProperty(sv,"__esModule",{value:!0}),sv.skipLast=void 0,b),lv=P,fv=y;sv.skipLast=function(u){return u<=0?cv.identity:lv.operate(function(e,n){var o=new Array(u),i=0;return e.subscribe(fv.createOperatorSubscriber(n,function(e){var t,r=i++;r<u?o[r]=e:(t=o[r=r%u],o[r]=e,n.next(t))})),function(){o=null}})};var pv={},dv=(Object.defineProperty(pv,"__esModule",{value:!0}),pv.skipUntil=void 0,P),hv=y,bv=C,yv=t;pv.skipUntil=function(o){return dv.operate(function(e,t){var r=!1,n=hv.createOperatorSubscriber(t,function(){null!=n&&n.unsubscribe(),r=!0},yv.noop);bv.innerFrom(o).subscribe(n),e.subscribe(hv.createOperatorSubscriber(t,function(e){return r&&t.next(e)}))})};var _v={},vv=(Object.defineProperty(_v,"__esModule",{value:!0}),_v.skipWhile=void 0,P),mv=y;_v.skipWhile=function(o){return vv.operate(function(e,t){var r=!1,n=0;e.subscribe(mv.createOperatorSubscriber(t,function(e){return(r=r||!o(e,n++))&&t.next(e)}))})};var gv={},Ov=(Object.defineProperty(gv,"__esModule",{value:!0}),gv.startWith=void 0,Yc),wv=T,Ev=P;gv.startWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=wv.popScheduler(r);return Ev.operate(function(e,t){(n?Ov.concat(r,e,n):Ov.concat(r,e)).subscribe(t)})};var Pv={},Sv={},Tv=(Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.switchMap=void 0,C),jv=P,Cv=y;Sv.switchMap=function(s,c){return jv.operate(function(e,o){function i(){t&&!u&&o.complete()}var u=null,a=0,t=!1;e.subscribe(Cv.createOperatorSubscriber(o,function(t){null!=u&&u.unsubscribe();var r=0,n=a++;Tv.innerFrom(s(t,n)).subscribe(u=Cv.createOperatorSubscriber(o,function(e){return o.next(c?c(t,e,n,r++):e)},function(){u=null,i()}))},function(){t=!0,i()}))})},Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.switchAll=void 0;var Iv=Sv,Rv=b;Pv.switchAll=function(){return Iv.switchMap(Rv.identity)};var kv={},Av=(Object.defineProperty(kv,"__esModule",{value:!0}),kv.switchMapTo=void 0,Sv),Mv=E;kv.switchMapTo=function(e,t){return Mv.isFunction(t)?Av.switchMap(function(){return e},t):Av.switchMap(function(){return e})};var xv={},Nv=(Object.defineProperty(xv,"__esModule",{value:!0}),xv.switchScan=void 0,Sv),Uv=P;xv.switchScan=function(n,o){return Uv.operate(function(e,t){var r=o;return Nv.switchMap(function(e,t){return n(r,e,t)},function(e,t){return r=t})(e).subscribe(t),function(){r=null}})};var Dv={},Lv=(Object.defineProperty(Dv,"__esModule",{value:!0}),Dv.takeUntil=void 0,P),Bv=y,Fv=C,Wv=t;Dv.takeUntil=function(r){return Lv.operate(function(e,t){Fv.innerFrom(r).subscribe(Bv.createOperatorSubscriber(t,function(){return t.complete()},Wv.noop)),t.closed||e.subscribe(t)})};var zv={},qv=(Object.defineProperty(zv,"__esModule",{value:!0}),zv.takeWhile=void 0,P),Vv=y;zv.takeWhile=function(o,i){return void 0===i&&(i=!1),qv.operate(function(e,r){var n=0;e.subscribe(Vv.createOperatorSubscriber(r,function(e){var t=o(e,n++);(t||i)&&r.next(e),t||r.complete()}))})};var Hv={},Yv=(Object.defineProperty(Hv,"__esModule",{value:!0}),Hv.tap=void 0,E),Kv=P,Gv=y,Zv=b;Hv.tap=function(e,t,r){var o=Yv.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return o?Kv.operate(function(e,r){null!=(t=o.subscribe)&&t.call(o);var t,n=!0;e.subscribe(Gv.createOperatorSubscriber(r,function(e){var t;null!=(t=o.next)&&t.call(o,e),r.next(e)},function(){var e;n=!1,null!=(e=o.complete)&&e.call(o),r.complete()},function(e){var t;n=!1,null!=(t=o.error)&&t.call(o,e),r.error(e)},function(){var e;n&&null!=(e=o.unsubscribe)&&e.call(o),null!=(e=o.finalize)&&e.call(o)}))}):Zv.identity};var Xv,Qv,Jv,$v,E={},em=(Xv=E,Object.defineProperty(Xv,"__esModule",{value:!0}),Xv.throttle=Xv.defaultThrottleConfig=void 0,Qv=P,Jv=y,$v=C,Xv.defaultThrottleConfig={leading:!0,trailing:!1},Xv.throttle=function(p,d){return void 0===d&&(d=Xv.defaultThrottleConfig),Qv.operate(function(e,t){function r(){var e;i&&(i=!1,e=u,u=null,t.next(e),s||f(e))}var n=d.leading,o=d.trailing,i=!1,u=null,a=null,s=!1,c=function(){null!=a&&a.unsubscribe(),a=null,o&&(r(),s&&t.complete())},l=function(){a=null,s&&t.complete()},f=function(e){return a=$v.innerFrom(p(e)).subscribe(Jv.createOperatorSubscriber(t,c,l))};e.subscribe(Jv.createOperatorSubscriber(t,function(e){i=!0,u=e,a&&!a.closed||(n?r():f(e))},function(){s=!0,o&&i&&a&&!a.closed||t.complete()}))})},{}),tm=(Object.defineProperty(em,"__esModule",{value:!0}),em.throttleTime=void 0,ru),rm=E,nm=Gl;em.throttleTime=function(e,t,r){void 0===r&&(r=rm.defaultThrottleConfig);var n=nm.timer(e,t=void 0===t?tm.asyncScheduler:t);return rm.throttle(function(){return n},r)};var om={},im=(Object.defineProperty(om,"__esModule",{value:!0}),om.TimeInterval=om.timeInterval=void 0,ru),um=P,am=y;om.timeInterval=function(i){return void 0===i&&(i=im.asyncScheduler),um.operate(function(e,n){var o=i.now();e.subscribe(am.createOperatorSubscriber(n,function(e){var t=i.now(),r=t-o;o=t,n.next(new sm(e,r))}))})};var sm=function(e,t){this.value=e,this.interval=t},cm=(om.TimeInterval=sm,{}),lm=(Object.defineProperty(cm,"__esModule",{value:!0}),cm.timeoutWith=void 0,ru),fm=hs,pm=Ia;cm.timeoutWith=function(e,t,r){var n,o;if(r=null!=r?r:lm.async,fm.isValidDate(e)?n=e:"number"==typeof e&&(o=e),!t)throw new TypeError("No observable provided to switch to");if(e=function(){return t},null==n&&null==o)throw new TypeError("No timeout provided.");return pm.timeout({first:n,each:o,scheduler:r,with:e})};var hs={},dm=(Object.defineProperty(hs,"__esModule",{value:!0}),hs.timestamp=void 0,v),hm=fc;hs.timestamp=function(t){return void 0===t&&(t=dm.dateTimestampProvider),hm.map(function(e){return{value:e,timestamp:t.now()}})};var v={},bm=(Object.defineProperty(v,"__esModule",{value:!0}),v.window=void 0,O),ym=P,_m=y,vm=t,mm=C;v.window=function(o){return ym.operate(function(e,t){function r(e){n.error(e),t.error(e)}var n=new bm.Subject;t.next(n.asObservable());return e.subscribe(_m.createOperatorSubscriber(t,function(e){return null==n?void 0:n.next(e)},function(){n.complete(),t.complete()},r)),mm.innerFrom(o).subscribe(_m.createOperatorSubscriber(t,function(){n.complete(),t.next(n=new bm.Subject)},vm.noop,r)),function(){null!=n&&n.unsubscribe(),n=null}})};var gm={},Om=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},wm=(Object.defineProperty(gm,"__esModule",{value:!0}),gm.windowCount=void 0,O),Em=P,Pm=y;gm.windowCount=function(s,e){var c=0<(e=void 0===e?0:e)?e:s;return Em.operate(function(e,i){var u=[new wm.Subject],a=0;i.next(u[0].asObservable()),e.subscribe(Pm.createOperatorSubscriber(i,function(e){try{for(var t=Om(u),r=t.next();!r.done;r=t.next())r.value.next(e)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=t.return)&&o.call(t)}finally{if(n)throw n.error}}var n,o=a-s+1;0<=o&&o%c==0&&u.shift().complete(),++a%c==0&&(n=new wm.Subject,u.push(n),i.next(n.asObservable()))},function(){for(;0<u.length;)u.shift().complete();i.complete()},function(e){for(;0<u.length;)u.shift().error(e);i.error(e)},function(){u=null}))})};var Sm={},Tm=(Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.windowTime=void 0,O),jm=ru,Cm=_,Im=P,Rm=y,km=X,Am=T,Mm=ts;Sm.windowTime=function(c){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var l=null!=(e=Am.popScheduler(t))?e:jm.asyncScheduler,f=null!=(e=t[0])?e:null,p=t[1]||1/0;return Im.operate(function(e,n){function r(t){s(function(e){e=e.window;return t(e)}),t(n),n.unsubscribe()}var o=[],i=!1,u=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),km.arrRemove(o,e),i&&a()},a=function(){var e,t,r;o&&(e=new Cm.Subscription,n.add(e),t=new Tm.Subject,o.push(r={window:t,subs:e,seen:0}),n.next(t.asObservable()),Mm.executeSchedule(e,l,function(){return u(r)},c))},s=(null!==f&&0<=f?Mm.executeSchedule(n,l,a,f,!0):i=!0,a(),function(e){return o.slice().forEach(e)});return e.subscribe(Rm.createOperatorSubscriber(n,function(t){s(function(e){e.window.next(t),p<=++e.seen&&u(e)})},function(){return r(function(e){return e.complete()})},function(t){return r(function(e){return e.error(t)})})),function(){o=null}})};var ts={},xm=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nm=(Object.defineProperty(ts,"__esModule",{value:!0}),ts.windowToggle=void 0,O),Um=_,Dm=P,Lm=C,Bm=y,Fm=t,Wm=X;ts.windowToggle=function(t,a){return Dm.operate(function(e,o){function i(e){for(;0<u.length;)u.shift().error(e);o.error(e)}var u=[];Lm.innerFrom(t).subscribe(Bm.createOperatorSubscriber(o,function(e){var t,r=new Nm.Subject,n=(u.push(r),new Um.Subscription);try{t=Lm.innerFrom(a(e))}catch(e){return void i(e)}o.next(r.asObservable()),n.add(t.subscribe(Bm.createOperatorSubscriber(o,function(){Wm.arrRemove(u,r),r.complete(),n.unsubscribe()},Fm.noop,i)))},Fm.noop)),e.subscribe(Bm.createOperatorSubscriber(o,function(e){var t,r,n=u.slice();try{for(var o=xm(n),i=o.next();!i.done;i=o.next())i.value.next(e)}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},function(){for(;0<u.length;)u.shift().complete();o.complete()},i,function(){for(;0<u.length;)u.shift().unsubscribe()}))})};var X={},zm=(Object.defineProperty(X,"__esModule",{value:!0}),X.windowWhen=void 0,O),qm=P,Vm=y,Hm=C;X.windowWhen=function(u){return qm.operate(function(e,t){var r,n,o=function(e){r.error(e),t.error(e)},i=function(){var e;null!=n&&n.unsubscribe(),null!=r&&r.complete(),r=new zm.Subject,t.next(r.asObservable());try{e=Hm.innerFrom(u())}catch(e){return void o(e)}e.subscribe(n=Vm.createOperatorSubscriber(t,i,i,o))};i(),e.subscribe(Vm.createOperatorSubscriber(t,function(e){return r.next(e)},function(){r.complete(),t.complete()},o,function(){null!=n&&n.unsubscribe(),r=null}))})};var Ym={},Km=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Gm=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Zm=(Object.defineProperty(Ym,"__esModule",{value:!0}),Ym.withLatestFrom=void 0,P),Xm=y,Qm=C,Jm=b,$m=t,e0=T;Ym.withLatestFrom=function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var s=e0.popResultSelector(a);return Zm.operate(function(e,r){for(var t=a.length,n=new Array(t),o=a.map(function(){return!1}),i=!1,u=0;u<t;u++)!function(t){Qm.innerFrom(a[t]).subscribe(Xm.createOperatorSubscriber(r,function(e){n[t]=e,i||o[t]||(o[t]=!0,(i=o.every(Jm.identity))&&(o=null))},$m.noop))}(u);e.subscribe(Xm.createOperatorSubscriber(r,function(e){i&&(e=Gm([e],Km(n)),r.next(s?s.apply(void 0,Gm([],Km(e))):e))}))})};var y={},t0=(Object.defineProperty(y,"__esModule",{value:!0}),y.zipAll=void 0,Ff),r0=I;y.zipAll=function(e){return r0.joinAllInternals(t0.zip,e)};var C={},T={},n0=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},o0=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},i0=(Object.defineProperty(T,"__esModule",{value:!0}),T.zip=void 0,Ff),u0=P;T.zip=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return u0.operate(function(e,t){i0.zip.apply(void 0,o0([e],n0(r))).subscribe(t)})};var a0,s0,c0,l0,f0,p0,d0,h0,b0,y0,_0,v0,m0,g0,O0,w0,E0,P0,S0,T0,j0,C0,I0,R0,k0,A0,M0,x0,N0,U0,D0,L0,B0,F0,W0,z0,q0,V0,H0,Y0,K0,G0,Z0,X0,Q0,J0,$0,eg,tg,rg,ng,og,ig,ug,ag,sg,cg,lg,fg,pg,dg,hg,bg,yg,_g,vg,mg,gg,Og,wg,Eg,Pg,Sg,Tg,jg,Cg,Ig,Rg,kg,Ag,Mg,xg,Ng,Ug,Dg,Lg,Bg,Fg,Wg,zg,qg,Vg,Hg,Yg,Kg,Gg,Zg,Xg,Qg,Jg,$g,eO,tO,rO,nO,oO,iO,uO,aO,sO,cO,lO,fO,pO,dO,hO,bO,yO,_O,vO,mO,gO,OO,wO,EO,PO,SO,TO,jO,CO,IO,RO,kO,AO,MO,xO,NO,UO,DO,LO,BO,FO,WO,zO,qO,VO,HO,YO,KO,GO,ZO,XO,QO,JO,$O,ew,tw,rw,nw,ow,iw,uw,aw,sw,cw,lw,fw,pw,dw=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},hw=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},bw=(Object.defineProperty(C,"__esModule",{value:!0}),C.zipWith=void 0,T);C.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return bw.zip.apply(void 0,hw([],dw(e)))},I=ir,a0=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),P=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a0(t,e,r)},Object.defineProperty(I,"__esModule",{value:!0}),I.interval=I.iif=I.generate=I.fromEventPattern=I.fromEvent=I.from=I.forkJoin=I.empty=I.defer=I.connectable=I.concat=I.combineLatest=I.bindNodeCallback=I.bindCallback=I.UnsubscriptionError=I.TimeoutError=I.SequenceError=I.ObjectUnsubscribedError=I.NotFoundError=I.EmptyError=I.ArgumentOutOfRangeError=I.firstValueFrom=I.lastValueFrom=I.isObservable=I.identity=I.noop=I.pipe=I.NotificationKind=I.Notification=I.Subscriber=I.Subscription=I.Scheduler=I.VirtualAction=I.VirtualTimeScheduler=I.animationFrameScheduler=I.animationFrame=I.queueScheduler=I.queue=I.asyncScheduler=I.async=I.asapScheduler=I.asap=I.AsyncSubject=I.ReplaySubject=I.BehaviorSubject=I.Subject=I.animationFrames=I.observable=I.ConnectableObservable=I.Observable=void 0,I.filter=I.expand=I.exhaustMap=I.exhaustAll=I.exhaust=I.every=I.endWith=I.elementAt=I.distinctUntilKeyChanged=I.distinctUntilChanged=I.distinct=I.dematerialize=I.delayWhen=I.delay=I.defaultIfEmpty=I.debounceTime=I.debounce=I.count=I.connect=I.concatWith=I.concatMapTo=I.concatMap=I.concatAll=I.combineLatestWith=I.combineLatestAll=I.combineAll=I.catchError=I.bufferWhen=I.bufferToggle=I.bufferTime=I.bufferCount=I.buffer=I.auditTime=I.audit=I.config=I.NEVER=I.EMPTY=I.scheduled=I.zip=I.using=I.timer=I.throwError=I.range=I.race=I.partition=I.pairs=I.onErrorResumeNext=I.of=I.never=I.merge=void 0,I.switchMap=I.switchAll=I.subscribeOn=I.startWith=I.skipWhile=I.skipUntil=I.skipLast=I.skip=I.single=I.shareReplay=I.share=I.sequenceEqual=I.scan=I.sampleTime=I.sample=I.refCount=I.retryWhen=I.retry=I.repeatWhen=I.repeat=I.reduce=I.raceWith=I.publishReplay=I.publishLast=I.publishBehavior=I.publish=I.pluck=I.pairwise=I.onErrorResumeNextWith=I.observeOn=I.multicast=I.min=I.mergeWith=I.mergeScan=I.mergeMapTo=I.mergeMap=I.flatMap=I.mergeAll=I.max=I.materialize=I.mapTo=I.map=I.last=I.isEmpty=I.ignoreElements=I.groupBy=I.first=I.findIndex=I.find=I.finalize=void 0,I.zipWith=I.zipAll=I.withLatestFrom=I.windowWhen=I.windowToggle=I.windowTime=I.windowCount=I.window=I.toArray=I.timestamp=I.timeoutWith=I.timeout=I.timeInterval=I.throwIfEmpty=I.throttleTime=I.throttle=I.tap=I.takeWhile=I.takeUntil=I.takeLast=I.take=I.switchScan=I.switchMapTo=void 0,s0=a,Object.defineProperty(I,"Observable",{enumerable:!0,get:function(){return s0.Observable}}),c0=m,Object.defineProperty(I,"ConnectableObservable",{enumerable:!0,get:function(){return c0.ConnectableObservable}}),l0=h,Object.defineProperty(I,"observable",{enumerable:!0,get:function(){return l0.observable}}),f0=p,Object.defineProperty(I,"animationFrames",{enumerable:!0,get:function(){return f0.animationFrames}}),p0=O,Object.defineProperty(I,"Subject",{enumerable:!0,get:function(){return p0.Subject}}),d0=i,Object.defineProperty(I,"BehaviorSubject",{enumerable:!0,get:function(){return d0.BehaviorSubject}}),h0=g,Object.defineProperty(I,"ReplaySubject",{enumerable:!0,get:function(){return h0.ReplaySubject}}),b0=Ki,Object.defineProperty(I,"AsyncSubject",{enumerable:!0,get:function(){return b0.AsyncSubject}}),y0=Ji,Object.defineProperty(I,"asap",{enumerable:!0,get:function(){return y0.asap}}),Object.defineProperty(I,"asapScheduler",{enumerable:!0,get:function(){return y0.asapScheduler}}),_0=ru,Object.defineProperty(I,"async",{enumerable:!0,get:function(){return _0.async}}),Object.defineProperty(I,"asyncScheduler",{enumerable:!0,get:function(){return _0.asyncScheduler}}),v0=Cu,Object.defineProperty(I,"queue",{enumerable:!0,get:function(){return v0.queue}}),Object.defineProperty(I,"queueScheduler",{enumerable:!0,get:function(){return v0.queueScheduler}}),m0=Lu,Object.defineProperty(I,"animationFrame",{enumerable:!0,get:function(){return m0.animationFrame}}),Object.defineProperty(I,"animationFrameScheduler",{enumerable:!0,get:function(){return m0.animationFrameScheduler}}),g0=zu,Object.defineProperty(I,"VirtualTimeScheduler",{enumerable:!0,get:function(){return g0.VirtualTimeScheduler}}),Object.defineProperty(I,"VirtualAction",{enumerable:!0,get:function(){return g0.VirtualAction}}),O0=lu,Object.defineProperty(I,"Scheduler",{enumerable:!0,get:function(){return O0.Scheduler}}),w0=_,Object.defineProperty(I,"Subscription",{enumerable:!0,get:function(){return w0.Subscription}}),E0=Ar,Object.defineProperty(I,"Subscriber",{enumerable:!0,get:function(){return E0.Subscriber}}),P0=nu,Object.defineProperty(I,"Notification",{enumerable:!0,get:function(){return P0.Notification}}),Object.defineProperty(I,"NotificationKind",{enumerable:!0,get:function(){return P0.NotificationKind}}),S0=c,Object.defineProperty(I,"pipe",{enumerable:!0,get:function(){return S0.pipe}}),T0=t,Object.defineProperty(I,"noop",{enumerable:!0,get:function(){return T0.noop}}),j0=b,Object.defineProperty(I,"identity",{enumerable:!0,get:function(){return j0.identity}}),C0=Sa,Object.defineProperty(I,"isObservable",{enumerable:!0,get:function(){return C0.isObservable}}),I0=va,Object.defineProperty(I,"lastValueFrom",{enumerable:!0,get:function(){return I0.lastValueFrom}}),R0=Oa,Object.defineProperty(I,"firstValueFrom",{enumerable:!0,get:function(){return R0.firstValueFrom}}),k0=Ea,Object.defineProperty(I,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return k0.ArgumentOutOfRangeError}}),A0=ya,Object.defineProperty(I,"EmptyError",{enumerable:!0,get:function(){return A0.EmptyError}}),M0=Es,Object.defineProperty(I,"NotFoundError",{enumerable:!0,get:function(){return M0.NotFoundError}}),x0=f,Object.defineProperty(I,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return x0.ObjectUnsubscribedError}}),N0=ls,Object.defineProperty(I,"SequenceError",{enumerable:!0,get:function(){return N0.SequenceError}}),U0=Ia,Object.defineProperty(I,"TimeoutError",{enumerable:!0,get:function(){return U0.TimeoutError}}),D0=At,Object.defineProperty(I,"UnsubscriptionError",{enumerable:!0,get:function(){return D0.UnsubscriptionError}}),L0=Pa,Object.defineProperty(I,"bindCallback",{enumerable:!0,get:function(){return L0.bindCallback}}),B0=jc,Object.defineProperty(I,"bindNodeCallback",{enumerable:!0,get:function(){return B0.bindNodeCallback}}),F0=S,Object.defineProperty(I,"combineLatest",{enumerable:!0,get:function(){return F0.combineLatest}}),W0=Yc,Object.defineProperty(I,"concat",{enumerable:!0,get:function(){return W0.concat}}),z0=fl,Object.defineProperty(I,"connectable",{enumerable:!0,get:function(){return z0.connectable}}),q0=pl,Object.defineProperty(I,"defer",{enumerable:!0,get:function(){return q0.defer}}),V0=j,Object.defineProperty(I,"empty",{enumerable:!0,get:function(){return V0.empty}}),H0=ml,Object.defineProperty(I,"forkJoin",{enumerable:!0,get:function(){return H0.forkJoin}}),Y0=pa,Object.defineProperty(I,"from",{enumerable:!0,get:function(){return Y0.from}}),K0=Ic,Object.defineProperty(I,"fromEvent",{enumerable:!0,get:function(){return K0.fromEvent}}),G0=xc,Object.defineProperty(I,"fromEventPattern",{enumerable:!0,get:function(){return G0.fromEventPattern}}),Z0=ba,Object.defineProperty(I,"generate",{enumerable:!0,get:function(){return Z0.generate}}),X0=ys,Object.defineProperty(I,"iif",{enumerable:!0,get:function(){return X0.iif}}),Q0=Kl,Object.defineProperty(I,"interval",{enumerable:!0,get:function(){return Q0.interval}}),J0=aa,Object.defineProperty(I,"merge",{enumerable:!0,get:function(){return J0.merge}}),$0=sf,Object.defineProperty(I,"never",{enumerable:!0,get:function(){return $0.never}}),eg=n,Object.defineProperty(I,"of",{enumerable:!0,get:function(){return eg.of}}),tg=cf,Object.defineProperty(I,"onErrorResumeNext",{enumerable:!0,get:function(){return tg.onErrorResumeNext}}),rg=_f,Object.defineProperty(I,"pairs",{enumerable:!0,get:function(){return rg.pairs}}),ng=mf,Object.defineProperty(I,"partition",{enumerable:!0,get:function(){return ng.partition}}),og=jf,Object.defineProperty(I,"race",{enumerable:!0,get:function(){return og.race}}),ig=Mf,Object.defineProperty(I,"range",{enumerable:!0,get:function(){return ig.range}}),ug=ha,Object.defineProperty(I,"throwError",{enumerable:!0,get:function(){return ug.throwError}}),ag=Gl,Object.defineProperty(I,"timer",{enumerable:!0,get:function(){return ag.timer}}),sg=Uf,Object.defineProperty(I,"using",{enumerable:!0,get:function(){return sg.using}}),cg=Ff,Object.defineProperty(I,"zip",{enumerable:!0,get:function(){return cg.zip}}),lg=da,Object.defineProperty(I,"scheduled",{enumerable:!0,get:function(){return lg.scheduled}}),fg=j,Object.defineProperty(I,"EMPTY",{enumerable:!0,get:function(){return fg.EMPTY}}),pg=sf,Object.defineProperty(I,"NEVER",{enumerable:!0,get:function(){return pg.NEVER}}),P(Zf,I),dg=w,Object.defineProperty(I,"config",{enumerable:!0,get:function(){return dg.config}}),hg=Xf,Object.defineProperty(I,"audit",{enumerable:!0,get:function(){return hg.audit}}),bg=ep,Object.defineProperty(I,"auditTime",{enumerable:!0,get:function(){return bg.auditTime}}),yg=op,Object.defineProperty(I,"buffer",{enumerable:!0,get:function(){return yg.buffer}}),_g=cp,Object.defineProperty(I,"bufferCount",{enumerable:!0,get:function(){return _g.bufferCount}}),vg=hp,Object.defineProperty(I,"bufferTime",{enumerable:!0,get:function(){return vg.bufferTime}}),mg=Ep,Object.defineProperty(I,"bufferToggle",{enumerable:!0,get:function(){return mg.bufferToggle}}),gg=kp,Object.defineProperty(I,"bufferWhen",{enumerable:!0,get:function(){return gg.bufferWhen}}),Og=Up,Object.defineProperty(I,"catchError",{enumerable:!0,get:function(){return Og.catchError}}),wg=Fp,Object.defineProperty(I,"combineAll",{enumerable:!0,get:function(){return wg.combineAll}}),Eg=Wp,Object.defineProperty(I,"combineLatestAll",{enumerable:!0,get:function(){return Eg.combineLatestAll}}),Pg=od,Object.defineProperty(I,"combineLatestWith",{enumerable:!0,get:function(){return Pg.combineLatestWith}}),Sg=Kc,Object.defineProperty(I,"concatAll",{enumerable:!0,get:function(){return Sg.concatAll}}),Tg=lc,Object.defineProperty(I,"concatMap",{enumerable:!0,get:function(){return Tg.concatMap}}),jg=gd,Object.defineProperty(I,"concatMapTo",{enumerable:!0,get:function(){return jg.concatMapTo}}),Cg=Ed,Object.defineProperty(I,"concatWith",{enumerable:!0,get:function(){return Cg.concatWith}}),Ig=xd,Object.defineProperty(I,"connect",{enumerable:!0,get:function(){return Ig.connect}}),Rg=Nd,Object.defineProperty(I,"count",{enumerable:!0,get:function(){return Rg.count}}),kg=qd,Object.defineProperty(I,"debounce",{enumerable:!0,get:function(){return kg.debounce}}),Ag=R,Object.defineProperty(I,"debounceTime",{enumerable:!0,get:function(){return Ag.debounceTime}}),Mg=Qd,Object.defineProperty(I,"defaultIfEmpty",{enumerable:!0,get:function(){return Mg.defaultIfEmpty}}),xg=eh,Object.defineProperty(I,"delay",{enumerable:!0,get:function(){return xg.delay}}),Ng=th,Object.defineProperty(I,"delayWhen",{enumerable:!0,get:function(){return Ng.delayWhen}}),Ug=Oh,Object.defineProperty(I,"dematerialize",{enumerable:!0,get:function(){return Ug.dematerialize}}),Dg=Sh,Object.defineProperty(I,"distinct",{enumerable:!0,get:function(){return Dg.distinct}}),Lg=Rh,Object.defineProperty(I,"distinctUntilChanged",{enumerable:!0,get:function(){return Lg.distinctUntilChanged}}),Bg=Nh,Object.defineProperty(I,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Bg.distinctUntilKeyChanged}}),Fg=Dh,Object.defineProperty(I,"elementAt",{enumerable:!0,get:function(){return Fg.elementAt}}),Wg=Gh,Object.defineProperty(I,"endWith",{enumerable:!0,get:function(){return Wg.endWith}}),zg=$h,Object.defineProperty(I,"every",{enumerable:!0,get:function(){return zg.every}}),qg=rb,Object.defineProperty(I,"exhaust",{enumerable:!0,get:function(){return qg.exhaust}}),Vg=nb,Object.defineProperty(I,"exhaustAll",{enumerable:!0,get:function(){return Vg.exhaustAll}}),Hg=ob,Object.defineProperty(I,"exhaustMap",{enumerable:!0,get:function(){return Hg.exhaustMap}}),Yg=fb,Object.defineProperty(I,"expand",{enumerable:!0,get:function(){return Yg.expand}}),Kg=Of,Object.defineProperty(I,"filter",{enumerable:!0,get:function(){return Kg.filter}}),Gg=k,Object.defineProperty(I,"finalize",{enumerable:!0,get:function(){return Gg.finalize}}),Zg=bb,Object.defineProperty(I,"find",{enumerable:!0,get:function(){return Zg.find}}),Xg=mb,Object.defineProperty(I,"findIndex",{enumerable:!0,get:function(){return Xg.findIndex}}),Qg=wb,Object.defineProperty(I,"first",{enumerable:!0,get:function(){return Qg.first}}),Jg=Ib,Object.defineProperty(I,"groupBy",{enumerable:!0,get:function(){return Jg.groupBy}}),$g=uh,Object.defineProperty(I,"ignoreElements",{enumerable:!0,get:function(){return $g.ignoreElements}}),eO=Nb,Object.defineProperty(I,"isEmpty",{enumerable:!0,get:function(){return eO.isEmpty}}),tO=Lb,Object.defineProperty(I,"last",{enumerable:!0,get:function(){return tO.last}}),rO=fc,Object.defineProperty(I,"map",{enumerable:!0,get:function(){return rO.map}}),nO=lh,Object.defineProperty(I,"mapTo",{enumerable:!0,get:function(){return nO.mapTo}}),oO=Xb,Object.defineProperty(I,"materialize",{enumerable:!0,get:function(){return oO.materialize}}),iO=ey,Object.defineProperty(I,"max",{enumerable:!0,get:function(){return iO.max}}),uO=Gc,Object.defineProperty(I,"mergeAll",{enumerable:!0,get:function(){return uO.mergeAll}}),aO=ny,Object.defineProperty(I,"flatMap",{enumerable:!0,get:function(){return aO.flatMap}}),sO=Zc,Object.defineProperty(I,"mergeMap",{enumerable:!0,get:function(){return sO.mergeMap}}),cO=oy,Object.defineProperty(I,"mergeMapTo",{enumerable:!0,get:function(){return cO.mergeMapTo}}),lO=ay,Object.defineProperty(I,"mergeScan",{enumerable:!0,get:function(){return lO.mergeScan}}),fO=Xc,Object.defineProperty(I,"mergeWith",{enumerable:!0,get:function(){return fO.mergeWith}}),pO=Oy,Object.defineProperty(I,"min",{enumerable:!0,get:function(){return pO.min}}),dO=Py,Object.defineProperty(I,"multicast",{enumerable:!0,get:function(){return dO.multicast}}),hO=u,Object.defineProperty(I,"observeOn",{enumerable:!0,get:function(){return hO.observeOn}}),bO=Cy,Object.defineProperty(I,"onErrorResumeNextWith",{enumerable:!0,get:function(){return bO.onErrorResumeNextWith}}),yO=xy,Object.defineProperty(I,"pairwise",{enumerable:!0,get:function(){return yO.pairwise}}),_O=Dy,Object.defineProperty(I,"pluck",{enumerable:!0,get:function(){return _O.pluck}}),vO=By,Object.defineProperty(I,"publish",{enumerable:!0,get:function(){return vO.publish}}),mO=qy,Object.defineProperty(I,"publishBehavior",{enumerable:!0,get:function(){return mO.publishBehavior}}),gO=Yy,Object.defineProperty(I,"publishLast",{enumerable:!0,get:function(){return gO.publishLast}}),OO=Zy,Object.defineProperty(I,"publishReplay",{enumerable:!0,get:function(){return OO.publishReplay}}),wO=$y,Object.defineProperty(I,"raceWith",{enumerable:!0,get:function(){return wO.raceWith}}),EO=qp,Object.defineProperty(I,"reduce",{enumerable:!0,get:function(){return EO.reduce}}),PO=i_,Object.defineProperty(I,"repeat",{enumerable:!0,get:function(){return PO.repeat}}),SO=f_,Object.defineProperty(I,"repeatWhen",{enumerable:!0,get:function(){return SO.repeatWhen}}),TO=y_,Object.defineProperty(I,"retry",{enumerable:!0,get:function(){return TO.retry}}),jO=w_,Object.defineProperty(I,"retryWhen",{enumerable:!0,get:function(){return jO.retryWhen}}),CO=o,Object.defineProperty(I,"refCount",{enumerable:!0,get:function(){return CO.refCount}}),IO=j_,Object.defineProperty(I,"sample",{enumerable:!0,get:function(){return IO.sample}}),RO=A_,Object.defineProperty(I,"sampleTime",{enumerable:!0,get:function(){return RO.sampleTime}}),kO=U_,Object.defineProperty(I,"scan",{enumerable:!0,get:function(){return kO.scan}}),AO=Vp,Object.defineProperty(I,"sequenceEqual",{enumerable:!0,get:function(){return AO.sequenceEqual}}),MO=q_,Object.defineProperty(I,"share",{enumerable:!0,get:function(){return MO.share}}),xO=Q_,Object.defineProperty(I,"shareReplay",{enumerable:!0,get:function(){return xO.shareReplay}}),NO=ev,Object.defineProperty(I,"single",{enumerable:!0,get:function(){return NO.single}}),UO=uv,Object.defineProperty(I,"skip",{enumerable:!0,get:function(){return UO.skip}}),DO=sv,Object.defineProperty(I,"skipLast",{enumerable:!0,get:function(){return DO.skipLast}}),LO=pv,Object.defineProperty(I,"skipUntil",{enumerable:!0,get:function(){return LO.skipUntil}}),BO=_v,Object.defineProperty(I,"skipWhile",{enumerable:!0,get:function(){return BO.skipWhile}}),FO=gv,Object.defineProperty(I,"startWith",{enumerable:!0,get:function(){return FO.startWith}}),WO=is,Object.defineProperty(I,"subscribeOn",{enumerable:!0,get:function(){return WO.subscribeOn}}),zO=Pv,Object.defineProperty(I,"switchAll",{enumerable:!0,get:function(){return zO.switchAll}}),qO=Sv,Object.defineProperty(I,"switchMap",{enumerable:!0,get:function(){return qO.switchMap}}),VO=kv,Object.defineProperty(I,"switchMapTo",{enumerable:!0,get:function(){return VO.switchMapTo}}),HO=xv,Object.defineProperty(I,"switchScan",{enumerable:!0,get:function(){return HO.switchScan}}),YO=rh,Object.defineProperty(I,"take",{enumerable:!0,get:function(){return YO.take}}),KO=Bb,Object.defineProperty(I,"takeLast",{enumerable:!0,get:function(){return KO.takeLast}}),GO=Dv,Object.defineProperty(I,"takeUntil",{enumerable:!0,get:function(){return GO.takeUntil}}),ZO=zv,Object.defineProperty(I,"takeWhile",{enumerable:!0,get:function(){return ZO.takeWhile}}),XO=Hv,Object.defineProperty(I,"tap",{enumerable:!0,get:function(){return XO.tap}}),QO=E,Object.defineProperty(I,"throttle",{enumerable:!0,get:function(){return QO.throttle}}),JO=em,Object.defineProperty(I,"throttleTime",{enumerable:!0,get:function(){return JO.throttleTime}}),$O=Lh,Object.defineProperty(I,"throwIfEmpty",{enumerable:!0,get:function(){return $O.throwIfEmpty}}),ew=om,Object.defineProperty(I,"timeInterval",{enumerable:!0,get:function(){return ew.timeInterval}}),tw=Ia,Object.defineProperty(I,"timeout",{enumerable:!0,get:function(){return tw.timeout}}),rw=cm,Object.defineProperty(I,"timeoutWith",{enumerable:!0,get:function(){return rw.timeoutWith}}),nw=hs,Object.defineProperty(I,"timestamp",{enumerable:!0,get:function(){return nw.timestamp}}),ow=zp,Object.defineProperty(I,"toArray",{enumerable:!0,get:function(){return ow.toArray}}),iw=v,Object.defineProperty(I,"window",{enumerable:!0,get:function(){return iw.window}}),uw=gm,Object.defineProperty(I,"windowCount",{enumerable:!0,get:function(){return uw.windowCount}}),aw=Sm,Object.defineProperty(I,"windowTime",{enumerable:!0,get:function(){return aw.windowTime}}),sw=ts,Object.defineProperty(I,"windowToggle",{enumerable:!0,get:function(){return sw.windowToggle}}),cw=X,Object.defineProperty(I,"windowWhen",{enumerable:!0,get:function(){return cw.windowWhen}}),lw=Ym,Object.defineProperty(I,"withLatestFrom",{enumerable:!0,get:function(){return lw.withLatestFrom}}),fw=y,Object.defineProperty(I,"zipAll",{enumerable:!0,get:function(){return fw.zipAll}}),pw=C,Object.defineProperty(I,"zipWith",{enumerable:!0,get:function(){return pw.zipWith}});var a={},m={},yw=(Object.defineProperty(m,"__esModule",{value:!0}),m.partition=void 0,gf),_w=Of;m.partition=function(t,r){return function(e){return[_w.filter(t,r)(e),_w.filter(yw.not(t,r))(e)]}};var vw,mw,gw,Ow,ww,Ew,Pw,Sw,Tw,jw,Cw,Iw,Rw,kw,Aw,Mw,xw,Nw,Uw,Dw,Lw,Bw,Fw,Ww,zw,qw,Vw,Hw,Yw,Kw,Gw,Zw,Xw,Qw,Jw,$w,eE,tE,rE,nE,oE,iE,uE,aE,sE,cE,lE,fE,pE,dE,hE,bE,yE,_E,vE,mE,gE,OE,wE,EE,PE,SE,TE,jE,CE,IE,RE,kE,AE,ME,xE,NE,UE,DE,LE,BE,FE,WE,zE,qE,VE,HE,YE,KE,GE,ZE,XE,QE,JE,$E,eP,tP,rP,nP,oP,iP,uP,aP,sP,cP,lP,fP,pP,dP,hP,bP,yP,_P,vP,mP,gP,OP,wP,h={},EP=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},PP=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},SP=(Object.defineProperty(h,"__esModule",{value:!0}),h.race=void 0,lf),TP=$y;h.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return TP.raceWith.apply(void 0,PP([],EP(SP.argsOrArgArray(e))))},p=a,Object.defineProperty(p,"__esModule",{value:!0}),p.mergeAll=p.merge=p.max=p.materialize=p.mapTo=p.map=p.last=p.isEmpty=p.ignoreElements=p.groupBy=p.first=p.findIndex=p.find=p.finalize=p.filter=p.expand=p.exhaustMap=p.exhaustAll=p.exhaust=p.every=p.endWith=p.elementAt=p.distinctUntilKeyChanged=p.distinctUntilChanged=p.distinct=p.dematerialize=p.delayWhen=p.delay=p.defaultIfEmpty=p.debounceTime=p.debounce=p.count=p.connect=p.concatWith=p.concatMapTo=p.concatMap=p.concatAll=p.concat=p.combineLatestWith=p.combineLatest=p.combineLatestAll=p.combineAll=p.catchError=p.bufferWhen=p.bufferToggle=p.bufferTime=p.bufferCount=p.buffer=p.auditTime=p.audit=void 0,p.timeInterval=p.throwIfEmpty=p.throttleTime=p.throttle=p.tap=p.takeWhile=p.takeUntil=p.takeLast=p.take=p.switchScan=p.switchMapTo=p.switchMap=p.switchAll=p.subscribeOn=p.startWith=p.skipWhile=p.skipUntil=p.skipLast=p.skip=p.single=p.shareReplay=p.share=p.sequenceEqual=p.scan=p.sampleTime=p.sample=p.refCount=p.retryWhen=p.retry=p.repeatWhen=p.repeat=p.reduce=p.raceWith=p.race=p.publishReplay=p.publishLast=p.publishBehavior=p.publish=p.pluck=p.partition=p.pairwise=p.onErrorResumeNext=p.observeOn=p.multicast=p.min=p.mergeWith=p.mergeScan=p.mergeMapTo=p.mergeMap=p.flatMap=void 0,p.zipWith=p.zipAll=p.zip=p.withLatestFrom=p.windowWhen=p.windowToggle=p.windowTime=p.windowCount=p.window=p.toArray=p.timestamp=p.timeoutWith=p.timeout=void 0,vw=Xf,Object.defineProperty(p,"audit",{enumerable:!0,get:function(){return vw.audit}}),mw=ep,Object.defineProperty(p,"auditTime",{enumerable:!0,get:function(){return mw.auditTime}}),gw=op,Object.defineProperty(p,"buffer",{enumerable:!0,get:function(){return gw.buffer}}),Ow=cp,Object.defineProperty(p,"bufferCount",{enumerable:!0,get:function(){return Ow.bufferCount}}),ww=hp,Object.defineProperty(p,"bufferTime",{enumerable:!0,get:function(){return ww.bufferTime}}),Ew=Ep,Object.defineProperty(p,"bufferToggle",{enumerable:!0,get:function(){return Ew.bufferToggle}}),Pw=kp,Object.defineProperty(p,"bufferWhen",{enumerable:!0,get:function(){return Pw.bufferWhen}}),Sw=Up,Object.defineProperty(p,"catchError",{enumerable:!0,get:function(){return Sw.catchError}}),Tw=Fp,Object.defineProperty(p,"combineAll",{enumerable:!0,get:function(){return Tw.combineAll}}),jw=Wp,Object.defineProperty(p,"combineLatestAll",{enumerable:!0,get:function(){return jw.combineLatestAll}}),Cw=id,Object.defineProperty(p,"combineLatest",{enumerable:!0,get:function(){return Cw.combineLatest}}),Iw=od,Object.defineProperty(p,"combineLatestWith",{enumerable:!0,get:function(){return Iw.combineLatestWith}}),Rw=Pd,Object.defineProperty(p,"concat",{enumerable:!0,get:function(){return Rw.concat}}),kw=Kc,Object.defineProperty(p,"concatAll",{enumerable:!0,get:function(){return kw.concatAll}}),Aw=lc,Object.defineProperty(p,"concatMap",{enumerable:!0,get:function(){return Aw.concatMap}}),Mw=gd,Object.defineProperty(p,"concatMapTo",{enumerable:!0,get:function(){return Mw.concatMapTo}}),xw=Ed,Object.defineProperty(p,"concatWith",{enumerable:!0,get:function(){return xw.concatWith}}),Nw=xd,Object.defineProperty(p,"connect",{enumerable:!0,get:function(){return Nw.connect}}),Uw=Nd,Object.defineProperty(p,"count",{enumerable:!0,get:function(){return Uw.count}}),Dw=qd,Object.defineProperty(p,"debounce",{enumerable:!0,get:function(){return Dw.debounce}}),Lw=R,Object.defineProperty(p,"debounceTime",{enumerable:!0,get:function(){return Lw.debounceTime}}),Bw=Qd,Object.defineProperty(p,"defaultIfEmpty",{enumerable:!0,get:function(){return Bw.defaultIfEmpty}}),Fw=eh,Object.defineProperty(p,"delay",{enumerable:!0,get:function(){return Fw.delay}}),Ww=th,Object.defineProperty(p,"delayWhen",{enumerable:!0,get:function(){return Ww.delayWhen}}),zw=Oh,Object.defineProperty(p,"dematerialize",{enumerable:!0,get:function(){return zw.dematerialize}}),qw=Sh,Object.defineProperty(p,"distinct",{enumerable:!0,get:function(){return qw.distinct}}),Vw=Rh,Object.defineProperty(p,"distinctUntilChanged",{enumerable:!0,get:function(){return Vw.distinctUntilChanged}}),Hw=Nh,Object.defineProperty(p,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Hw.distinctUntilKeyChanged}}),Yw=Dh,Object.defineProperty(p,"elementAt",{enumerable:!0,get:function(){return Yw.elementAt}}),Kw=Gh,Object.defineProperty(p,"endWith",{enumerable:!0,get:function(){return Kw.endWith}}),Gw=$h,Object.defineProperty(p,"every",{enumerable:!0,get:function(){return Gw.every}}),Zw=rb,Object.defineProperty(p,"exhaust",{enumerable:!0,get:function(){return Zw.exhaust}}),Xw=nb,Object.defineProperty(p,"exhaustAll",{enumerable:!0,get:function(){return Xw.exhaustAll}}),Qw=ob,Object.defineProperty(p,"exhaustMap",{enumerable:!0,get:function(){return Qw.exhaustMap}}),Jw=fb,Object.defineProperty(p,"expand",{enumerable:!0,get:function(){return Jw.expand}}),$w=Of,Object.defineProperty(p,"filter",{enumerable:!0,get:function(){return $w.filter}}),eE=k,Object.defineProperty(p,"finalize",{enumerable:!0,get:function(){return eE.finalize}}),tE=bb,Object.defineProperty(p,"find",{enumerable:!0,get:function(){return tE.find}}),rE=mb,Object.defineProperty(p,"findIndex",{enumerable:!0,get:function(){return rE.findIndex}}),nE=wb,Object.defineProperty(p,"first",{enumerable:!0,get:function(){return nE.first}}),oE=Ib,Object.defineProperty(p,"groupBy",{enumerable:!0,get:function(){return oE.groupBy}}),iE=uh,Object.defineProperty(p,"ignoreElements",{enumerable:!0,get:function(){return iE.ignoreElements}}),uE=Nb,Object.defineProperty(p,"isEmpty",{enumerable:!0,get:function(){return uE.isEmpty}}),aE=Lb,Object.defineProperty(p,"last",{enumerable:!0,get:function(){return aE.last}}),sE=fc,Object.defineProperty(p,"map",{enumerable:!0,get:function(){return sE.map}}),cE=lh,Object.defineProperty(p,"mapTo",{enumerable:!0,get:function(){return cE.mapTo}}),lE=Xb,Object.defineProperty(p,"materialize",{enumerable:!0,get:function(){return lE.materialize}}),fE=ey,Object.defineProperty(p,"max",{enumerable:!0,get:function(){return fE.max}}),pE=ly,Object.defineProperty(p,"merge",{enumerable:!0,get:function(){return pE.merge}}),dE=Gc,Object.defineProperty(p,"mergeAll",{enumerable:!0,get:function(){return dE.mergeAll}}),hE=ny,Object.defineProperty(p,"flatMap",{enumerable:!0,get:function(){return hE.flatMap}}),bE=Zc,Object.defineProperty(p,"mergeMap",{enumerable:!0,get:function(){return bE.mergeMap}}),yE=oy,Object.defineProperty(p,"mergeMapTo",{enumerable:!0,get:function(){return yE.mergeMapTo}}),_E=ay,Object.defineProperty(p,"mergeScan",{enumerable:!0,get:function(){return _E.mergeScan}}),vE=Xc,Object.defineProperty(p,"mergeWith",{enumerable:!0,get:function(){return vE.mergeWith}}),mE=Oy,Object.defineProperty(p,"min",{enumerable:!0,get:function(){return mE.min}}),gE=Py,Object.defineProperty(p,"multicast",{enumerable:!0,get:function(){return gE.multicast}}),OE=u,Object.defineProperty(p,"observeOn",{enumerable:!0,get:function(){return OE.observeOn}}),wE=Cy,Object.defineProperty(p,"onErrorResumeNext",{enumerable:!0,get:function(){return wE.onErrorResumeNext}}),EE=xy,Object.defineProperty(p,"pairwise",{enumerable:!0,get:function(){return EE.pairwise}}),PE=m,Object.defineProperty(p,"partition",{enumerable:!0,get:function(){return PE.partition}}),SE=Dy,Object.defineProperty(p,"pluck",{enumerable:!0,get:function(){return SE.pluck}}),TE=By,Object.defineProperty(p,"publish",{enumerable:!0,get:function(){return TE.publish}}),jE=qy,Object.defineProperty(p,"publishBehavior",{enumerable:!0,get:function(){return jE.publishBehavior}}),CE=Yy,Object.defineProperty(p,"publishLast",{enumerable:!0,get:function(){return CE.publishLast}}),IE=Zy,Object.defineProperty(p,"publishReplay",{enumerable:!0,get:function(){return IE.publishReplay}}),RE=h,Object.defineProperty(p,"race",{enumerable:!0,get:function(){return RE.race}}),kE=$y,Object.defineProperty(p,"raceWith",{enumerable:!0,get:function(){return kE.raceWith}}),AE=qp,Object.defineProperty(p,"reduce",{enumerable:!0,get:function(){return AE.reduce}}),ME=i_,Object.defineProperty(p,"repeat",{enumerable:!0,get:function(){return ME.repeat}}),xE=f_,Object.defineProperty(p,"repeatWhen",{enumerable:!0,get:function(){return xE.repeatWhen}}),NE=y_,Object.defineProperty(p,"retry",{enumerable:!0,get:function(){return NE.retry}}),UE=w_,Object.defineProperty(p,"retryWhen",{enumerable:!0,get:function(){return UE.retryWhen}}),DE=o,Object.defineProperty(p,"refCount",{enumerable:!0,get:function(){return DE.refCount}}),LE=j_,Object.defineProperty(p,"sample",{enumerable:!0,get:function(){return LE.sample}}),BE=A_,Object.defineProperty(p,"sampleTime",{enumerable:!0,get:function(){return BE.sampleTime}}),FE=U_,Object.defineProperty(p,"scan",{enumerable:!0,get:function(){return FE.scan}}),WE=Vp,Object.defineProperty(p,"sequenceEqual",{enumerable:!0,get:function(){return WE.sequenceEqual}}),zE=q_,Object.defineProperty(p,"share",{enumerable:!0,get:function(){return zE.share}}),qE=Q_,Object.defineProperty(p,"shareReplay",{enumerable:!0,get:function(){return qE.shareReplay}}),VE=ev,Object.defineProperty(p,"single",{enumerable:!0,get:function(){return VE.single}}),HE=uv,Object.defineProperty(p,"skip",{enumerable:!0,get:function(){return HE.skip}}),YE=sv,Object.defineProperty(p,"skipLast",{enumerable:!0,get:function(){return YE.skipLast}}),KE=pv,Object.defineProperty(p,"skipUntil",{enumerable:!0,get:function(){return KE.skipUntil}}),GE=_v,Object.defineProperty(p,"skipWhile",{enumerable:!0,get:function(){return GE.skipWhile}}),ZE=gv,Object.defineProperty(p,"startWith",{enumerable:!0,get:function(){return ZE.startWith}}),XE=is,Object.defineProperty(p,"subscribeOn",{enumerable:!0,get:function(){return XE.subscribeOn}}),QE=Pv,Object.defineProperty(p,"switchAll",{enumerable:!0,get:function(){return QE.switchAll}}),JE=Sv,Object.defineProperty(p,"switchMap",{enumerable:!0,get:function(){return JE.switchMap}}),$E=kv,Object.defineProperty(p,"switchMapTo",{enumerable:!0,get:function(){return $E.switchMapTo}}),eP=xv,Object.defineProperty(p,"switchScan",{enumerable:!0,get:function(){return eP.switchScan}}),tP=rh,Object.defineProperty(p,"take",{enumerable:!0,get:function(){return tP.take}}),rP=Bb,Object.defineProperty(p,"takeLast",{enumerable:!0,get:function(){return rP.takeLast}}),nP=Dv,Object.defineProperty(p,"takeUntil",{enumerable:!0,get:function(){return nP.takeUntil}}),oP=zv,Object.defineProperty(p,"takeWhile",{enumerable:!0,get:function(){return oP.takeWhile}}),iP=Hv,Object.defineProperty(p,"tap",{enumerable:!0,get:function(){return iP.tap}}),uP=E,Object.defineProperty(p,"throttle",{enumerable:!0,get:function(){return uP.throttle}}),aP=em,Object.defineProperty(p,"throttleTime",{enumerable:!0,get:function(){return aP.throttleTime}}),sP=Lh,Object.defineProperty(p,"throwIfEmpty",{enumerable:!0,get:function(){return sP.throwIfEmpty}}),cP=om,Object.defineProperty(p,"timeInterval",{enumerable:!0,get:function(){return cP.timeInterval}}),lP=Ia,Object.defineProperty(p,"timeout",{enumerable:!0,get:function(){return lP.timeout}}),fP=cm,Object.defineProperty(p,"timeoutWith",{enumerable:!0,get:function(){return fP.timeoutWith}}),pP=hs,Object.defineProperty(p,"timestamp",{enumerable:!0,get:function(){return pP.timestamp}}),dP=zp,Object.defineProperty(p,"toArray",{enumerable:!0,get:function(){return dP.toArray}}),hP=v,Object.defineProperty(p,"window",{enumerable:!0,get:function(){return hP.window}}),bP=gm,Object.defineProperty(p,"windowCount",{enumerable:!0,get:function(){return bP.windowCount}}),yP=Sm,Object.defineProperty(p,"windowTime",{enumerable:!0,get:function(){return yP.windowTime}}),_P=ts,Object.defineProperty(p,"windowToggle",{enumerable:!0,get:function(){return _P.windowToggle}}),vP=X,Object.defineProperty(p,"windowWhen",{enumerable:!0,get:function(){return vP.windowWhen}}),mP=Ym,Object.defineProperty(p,"withLatestFrom",{enumerable:!0,get:function(){return mP.withLatestFrom}}),gP=T,Object.defineProperty(p,"zip",{enumerable:!0,get:function(){return gP.zip}}),OP=y,Object.defineProperty(p,"zipAll",{enumerable:!0,get:function(){return OP.zipAll}}),wP=C,Object.defineProperty(p,"zipWith",{enumerable:!0,get:function(){return wP.zipWith}});var O={},jP=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},CP=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},IP=(Object.defineProperty(O,"__esModule",{value:!0}),e),RP=ir,kP=a,AP=0,MP=1,xP=2;function NP(e,t){e=e.pipe((0,kP.publishReplay)(1),(0,kP.refCount)());this._result=e,this._keys=e.pipe((0,kP.mergeMap)(function(e){return(0,RP.from)(e.keys())}),(0,kP.publishReplay)(1),(0,kP.refCount)()),this._records=void 0,this._controls=new UP,this._summary=new RP.ReplaySubject,this._state=t||AP}NP.prototype.keys=function(){return this._keys},NP.prototype.records=function(){var r=this,e=this._result.pipe((0,kP.mergeMap)(function(t){return new RP.Observable(function(e){return r._startStreaming({result:t,recordsObserver:e})})}));return e.push=function(){return r._push()},e},NP.prototype.consume=function(){var r=this;return this._result.pipe((0,kP.mergeMap)(function(t){return new RP.Observable(function(e){return r._startStreaming({result:t,summaryObserver:e})})}))},NP.prototype.pause=function(){this._controls.pause()},NP.prototype.resume=function(){return this._controls.resume()},NP.prototype.push=function(){return this._controls.push()},NP.prototype._startStreaming=function(e){var e=void 0===e?{}:e,t=e.result,r=e.recordsObserver,r=void 0===r?null:r,e=e.summaryObserver,e=void 0===e?null:e,n=[];return e&&n.push(this._summary.subscribe(e)),this._state<MP?(this._state=MP,this._setupRecordsStream(t),r?n.push(this._records.subscribe(r)):t._cancel(),n.push({unsubscribe:function(){t._cancel&&t._cancel()}})):r&&r.error((0,IP.newError)("Streaming has already started/consumed with a previous records or summary subscription.")),function(){n.forEach(function(e){return e.unsubscribe()})}},NP.prototype._toObservable=function(){var n=this;return new RP.Observable(function(r){n._result.subscribe({complete:function(){return r.complete()},next:function(e){return r.next(new NP((t=e,new RP.Observable(function(e){e.next(t),e.complete()}))),n._state);var t},error:function(e){return r.error(e)}})})},NP.prototype._setupRecordsStream=function(n){var t=this;return this._records||(this._records=function(o,i,u){var e=this;void 0===u&&(u=new UP);var a=new RP.Subject,s=function(n){return jP(e,void 0,void 0,function(){var t,r;return CP(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),u.pushing=!0,[4,n];case 1:return t=e.sent(),r=t.done,t=t.value,r?(a.complete(),i.complete()):(a.next(t),u.paused||s(o.next()).catch(function(){})),[3,4];case 2:return r=e.sent(),a.error(r),i.error(r),[3,4];case 3:return u.pushing=!1,[7];case 4:return[2]}})})};function t(t){return jP(this,void 0,void 0,function(){return CP(this,function(e){switch(e.label){case 0:return[4,s(o.next(t))];case 1:return e.sent(),[2]}})})}return(u.pusher=t)(),a}(n[Symbol.asyncIterator](),{complete:function(){return jP(t,void 0,void 0,function(){var t,r;return CP(this,function(e){switch(e.label){case 0:return this._state=xP,r=(t=this._summary).next,[4,n.summary()];case 1:return r.apply(t,[e.sent()]),this._summary.complete(),[2]}})})},error:function(e){t._state=xP,t._summary.error(e)}},this._controls),this._records)},O.default=NP;DP.prototype.pause=function(){this._paused=!0},Object.defineProperty(DP.prototype,"paused",{get:function(){return this._paused},enumerable:!1,configurable:!0}),Object.defineProperty(DP.prototype,"pushing",{get:function(){return this._pushing},set:function(e){this._pushing=e},enumerable:!1,configurable:!0}),DP.prototype.resume=function(){return jP(this,void 0,void 0,function(){var t;return CP(this,function(e){switch(e.label){case 0:return t=this._paused,this._paused=!1,!t||this._pushing?[3,2]:[4,this._push()];case 1:e.sent(),e.label=2;case 2:return[2]}})})},DP.prototype.push=function(){return jP(this,void 0,void 0,function(){return CP(this,function(e){switch(e.label){case 0:return this.pause(),[4,this._push()];case 1:return[2,e.sent()]}})})},Object.defineProperty(DP.prototype,"pusher",{get:function(){return this._push},set:function(e){this._push=e},enumerable:!1,configurable:!0});var UP=DP;function DP(e){void 0===e&&(e=function(){return jP(t,void 0,void 0,function(){return CP(this,function(e){return[2]})})});var t=this;this._paused=!1,this._pushing=!1,this._push=e}var i={},g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},LP=(Object.defineProperty(i,"__esModule",{value:!0}),ir),BP=g(O);function FP(e){this._txc=e}g(e),FP.prototype.run=function(e,r){var n=this;return new BP.default(new LP.Observable(function(t){try{t.next(n._txc.run(e,r)),t.complete()}catch(e){t.error(e)}return function(){}}))},FP.prototype.commit=function(){var e=this;return new LP.Observable(function(t){e._txc.commit().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},FP.prototype.rollback=function(){var e=this;return new LP.Observable(function(t){e._txc.rollback().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},FP.prototype.isOpen=function(){return this._txc.isOpen()},FP.prototype.close=function(){var e=this;return new LP.Observable(function(t){e._txc.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},i.default=FP;Ki={},Ji=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};function WP(e){e=e.run;this._run=e}Object.defineProperty(Ki,"__esModule",{value:!0}),Ji(O),Ji(i),WP.fromTransaction=function(e){return new WP({run:e.run.bind(e)})},WP.prototype.run=function(e,t){return this._run(e,t)},Ki.default=WP;var ru={},zP=(Object.defineProperty(ru,"__esModule",{value:!0}),e),qP=ir,VP=a,HP=(zP.internal.logger.Logger,zP.error.SERVICE_UNAVAILABLE);function YP(e){var e=void 0===e?{}:e,t=e.maxRetryTimeout,r=e.initialDelay,r=void 0===r?1e3:r,n=e.delayMultiplier,n=void 0===n?2:n,o=e.delayJitter,o=void 0===o?.2:o,e=e.logger,e=void 0===e?null:e;this._maxRetryTimeout=KP(void 0===t?3e4:t,3e4),this._initialDelay=KP(r,1e3),this._delayMultiplier=KP(n,2),this._delayJitter=KP(o,.2),this._logger=e}function KP(e,t){return e||0===e?e:t}YP.prototype.retry=function(e){var a=this;return e.pipe((0,VP.retryWhen)(function(e){var n=[],o=Date.now(),i=1,u=a._initialDelay;return e.pipe((0,VP.mergeMap)(function(e){if(!(0,zP.isRetriableError)(e))return(0,qP.throwError)(function(){return e});var t;if(n.push(e),2<=i&&Date.now()-o>=a._maxRetryTimeout)return(t=(0,zP.newError)("Failed after retried for ".concat(i," times in ").concat(a._maxRetryTimeout," ms. Make sure that your database is online and retry again."),HP)).seenErrors=n,(0,qP.throwError)(function(){return t});var r=a._computeNextDelay(u);return u*=a._delayMultiplier,i++,a._logger&&a._logger.warn("Transaction failed and will be retried in ".concat(r)),(0,qP.of)(1).pipe((0,VP.delay)(r))}))}))},YP.prototype._computeNextDelay=function(e){var t=e*this._delayJitter;return e-t+2*t*Math.random()},ru.default=YP;var Cu=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},GP=(Object.defineProperty(Cr,"__esModule",{value:!0}),ir),ZP=a,XP=Cu(O),Lu=e,QP=Cu(i),JP=Cu(Ki),$P=Cu(ru),zu=Lu.internal.constants,eS=zu.ACCESS_MODE_READ,tS=zu.ACCESS_MODE_WRITE,rS=Lu.internal.txConfig.TxConfig;function nS(e){var e=void 0===e?{}:e,t=e.session,e=e.config;this._session=t,this._retryLogic=function(e){e=e&&e.maxTransactionRetryTime?e.maxTransactionRetryTime:null;return new $P.default({maxRetryTimeout:e})}(e)}nS.prototype.run=function(e,r,n){var o=this;return new XP.default(new GP.Observable(function(t){try{t.next(o._session.run(e,r,n)),t.complete()}catch(e){t.error(e)}return function(){}}))},nS.prototype.beginTransaction=function(e){return this._beginTransaction(this._session._mode,e)},nS.prototype.readTransaction=function(e,t){return this._runTransaction(eS,e,t)},nS.prototype.writeTransaction=function(e,t){return this._runTransaction(tS,e,t)},nS.prototype.executeRead=function(e,t){return this._executeInTransaction(eS,e,t)},nS.prototype.executeWrite=function(e,t){return this._executeInTransaction(tS,e,t)},nS.prototype._executeInTransaction=function(e,t,r){return this._runTransaction(e,t,r,function(e){return new JP.default({run:e.run.bind(e)})})},nS.prototype.close=function(){var e=this;return new GP.Observable(function(t){e._session.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},nS.prototype.lastBookmark=function(){return this.lastBookmarks()},nS.prototype.lastBookmarks=function(){return this._session.lastBookmarks()},nS.prototype._beginTransaction=function(e,t){var r=this,n=rS.empty();return t&&(n=new rS(t)),new GP.Observable(function(t){try{r._session._beginTransaction(e,n).then(function(e){t.next(new QP.default(e)),t.complete()}).catch(function(e){return t.error(e)})}catch(e){t.error(e)}return function(){}})},nS.prototype._runTransaction=function(e,r,t,n){void 0===n&&(n=function(e){return e});var o=rS.empty();return t&&(o=new rS(t)),this._retryLogic.retry(this._beginTransaction(e,o).pipe((0,ZP.mergeMap)(function(t){return(0,GP.defer)(function(){try{return r(n(t))}catch(e){return(0,GP.throwError)(function(){return e})}}).pipe((0,ZP.catchError)(function(e){return t.rollback().pipe((0,ZP.concatWith)((0,GP.throwError)(function(){return e})))}),(0,ZP.concatWith)(t.commit()))})))},Cr.default=nS;var oS,iS,lu=r&&r.__extends||(oS=function(e,t){return(oS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}oS(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ar=(Object.defineProperty(F,"__esModule",{value:!0}),F.WRITE=F.READ=F.Driver=void 0,e),uS=_(Cr),aS=Ar.internal.constants.FETCH_ALL,nu=Ar.driver.READ,sS=Ar.driver.WRITE,c=(F.READ=nu,F.WRITE=sS,lu(cS,iS=Ar.Driver),cS.prototype.rxSession=function(e){var e=void 0===e?{}:e,t=e.defaultAccessMode,r=e.bookmarks,n=e.database,o=e.fetchSize,i=e.impersonatedUser,e=e.bookmarkManager;return new uS.default({session:this._newSession({defaultAccessMode:void 0===t?sS:t,bookmarkOrBookmarks:r,database:void 0===n?"":n,impersonatedUser:i,reactive:!1,fetchSize:function(e,t){e=parseInt(e,10);{if(0<e||e===aS)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(aS," for ALL. However fetchSize = ").concat(e));return t}}(o,this._config.fetchSize),bookmarkManager:e}),config:this._config})},cS);function cS(){return null!==iS&&iS.apply(this,arguments)||this}F.Driver=c,F.default=c;t={},Object.defineProperty(t,"__esModule",{value:!0}),t.default="5.4.0",b={},Sa={},va={};function lS(){}Object.defineProperty(va,"__esModule",{value:!0}),lS.prototype.selectReader=function(e){throw new Error("Abstract function")},lS.prototype.selectWriter=function(e){throw new Error("Abstract function")},va.default=lS;Oa={},Ea={};function fS(e){this._offset=e||0}Object.defineProperty(Ea,"__esModule",{value:!0}),fS.prototype.next=function(e){if(0===e)return-1;var t=this._offset;return this._offset+=1,this._offset===Number.MAX_SAFE_INTEGER&&(this._offset=0),t%e},Ea.default=fS;var pS,dS,ya=r&&r.__extends||(pS=function(e,t){return(pS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pS(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Es=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hS=(Object.defineProperty(Oa,"__esModule",{value:!0}),Es(Ea)),f=Es(va),ls=(dS=f.default,ya(bS,dS),bS.prototype.selectReader=function(e){return this._select(e,this._readersIndex)},bS.prototype.selectWriter=function(e){return this._select(e,this._writersIndex)},bS.prototype._select=function(e,t){var r=e.length;if(0===r)return null;var n=t.next(r),o=n,i=null,u=Number.MAX_SAFE_INTEGER;do{var a=e[o],s=this._connectionPool.activeResourceCount(a)}while(s<u&&(i=a,u=s),o===r-1?o=0:o++,o!==n);return i},bS);function bS(e){var t=dS.call(this)||this;return t._readersIndex=new hS.default,t._writersIndex=new hS.default,t._connectionPool=e,t}Oa.default=ls;At=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.LeastConnectedLoadBalancingStrategy=Sa.LoadBalancingStrategy=void 0,Pa=At(va),Sa.LoadBalancingStrategy=Pa.default,jc=At(Oa),Sa.LeastConnectedLoadBalancingStrategy=jc.default,Sa.default=jc.default,S={},Yc={},fl={},pl={},ml={},pa={},Ic={},xc={byteLength:function(e){var e=wS(e),t=e[0],e=e[1];return 3*(t+e)/4-e}};xc.toByteArray=function(e){var t,r,n=wS(e),o=n[0],n=n[1],i=new vS(function(e,t){return 3*(e+t)/4-t}(o,n)),u=0,a=0<n?o-4:o;for(r=0;r<a;r+=4)t=_S[e.charCodeAt(r)]<<18|_S[e.charCodeAt(r+1)]<<12|_S[e.charCodeAt(r+2)]<<6|_S[e.charCodeAt(r+3)],i[u++]=t>>16&255,i[u++]=t>>8&255,i[u++]=255&t;2===n&&(t=_S[e.charCodeAt(r)]<<2|_S[e.charCodeAt(r+1)]>>4,i[u++]=255&t);1===n&&(t=_S[e.charCodeAt(r)]<<10|_S[e.charCodeAt(r+1)]<<4|_S[e.charCodeAt(r+2)]>>2,i[u++]=t>>8&255,i[u++]=255&t);return i},xc.fromByteArray=function(e){for(var t,r=e.length,n=r%3,o=[],i=0,u=r-n;i<u;i+=16383)o.push(function(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(function(e){return yS[e>>18&63]+yS[e>>12&63]+yS[e>>6&63]+yS[63&e]}(n));return o.join("")}(e,i,u<i+16383?u:i+16383));1==n?(t=e[r-1],o.push(yS[t>>2]+yS[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],o.push(yS[t>>10]+yS[t>>4&63]+yS[t<<2&63]+"="));return o.join("")};for(var yS=[],_S=[],vS="undefined"!=typeof Uint8Array?Uint8Array:Array,mS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gS=0,OS=mS.length;gS<OS;++gS)yS[gS]=mS[gS],_S[mS.charCodeAt(gS)]=gS;function wS(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}_S["-".charCodeAt(0)]=62,_S["_".charCodeAt(0)]=63;ba={read:function(e,t,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,l=-7,f=r?o-1:0,p=r?-1:1,o=e[t+f];for(f+=p,i=o&(1<<-l)-1,o>>=-l,l+=a;0<l;i=256*i+e[t+f],f+=p,l-=8);for(u=i&(1<<-l)-1,i>>=-l,l+=n;0<l;u=256*u+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(o?-1:1);u+=Math.pow(2,n),i-=c}return(o?-1:1)*u*Math.pow(2,i-n)},write:function(e,t,r,n,o,i){var u,a,s=8*i-o-1,c=(1<<s)-1,l=c>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,i=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,u=c):(u=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-u))<1&&(u--,n*=2),2<=(t+=1<=u+l?f/n:f*Math.pow(2,1-l))*n&&(u++,n/=2),c<=u+l?(a=0,u=c):1<=u+l?(a=(t*n-1)*Math.pow(2,o),u+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),u=0));8<=o;e[r+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,s+=o;0<s;e[r+p]=255&u,p+=d,u/=256,s-=8);e[r+p-d]|=128*i}};{var ES=Ic;const DA=xc,LA=ba,BA=(ys="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,ES.Buffer=A,ES.SlowBuffer=function(e){+e!=e&&(e=0);return A.alloc(+e)},ES.INSPECT_MAX_BYTES=50,2147483647);function PS(e){if(e>BA)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return Object.setPrototypeOf(e,A.prototype),e}function A(e,t,r){if("number"!=typeof e)return SS(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return jS(e)}function SS(t,r,e){if("string"==typeof t){var n=t;var o=r;"string"==typeof o&&""!==o||(o="utf8");if(!A.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var i=0|kS(n,o);let e=PS(i);n=e.write(n,o);n!==i&&(e=e.slice(0,n));return e}if(ArrayBuffer.isView(t))return e1(o=t,Uint8Array)?IS((i=new Uint8Array(o)).buffer,i.byteOffset,i.byteLength):CS(o);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(e1(t,ArrayBuffer)||t&&e1(t.buffer,ArrayBuffer))return IS(t,r,e);if("undefined"!=typeof SharedArrayBuffer&&(e1(t,SharedArrayBuffer)||t&&e1(t.buffer,SharedArrayBuffer)))return IS(t,r,e);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return A.from(n,r,e);var u=function(e){{var t,r;if(A.isBuffer(e))return t=0|RS(e.length),0===(r=PS(t)).length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||t1(e.length)?PS(0):CS(e);if("Buffer"===e.type&&Array.isArray(e.data))return CS(e.data)}(t);if(u)return u;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return A.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function TS(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function jS(e){return TS(e),PS(e<0?0:0|RS(e))}function CS(t){var r=t.length<0?0:0|RS(t.length);const n=PS(r);for(let e=0;e<r;e+=1)n[e]=255&t[e];return n}function IS(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,A.prototype),n}function RS(e){if(e>=BA)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+BA.toString(16)+" bytes");return 0|e}function kS(e,t){if(A.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||e1(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return QS(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return JS(e).length;default:if(o)return n?-1:QS(e).length;t=(""+t).toLowerCase(),o=!0}}function AS(e,r,n){let t=!1;if((r=void 0===r||r<0?0:r)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(r>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":{var o=this;var i=r;var u=n;var a=o.length;(!i||i<0)&&(i=0);(!u||u<0||a<u)&&(u=a);let t="";for(let e=i;e<u;++e)t+=qA[o[e]];return t;return}case"utf8":case"utf-8":return LS(this,r,n);case"ascii":{var s=this;a=r;var c=n;let t="";c=Math.min(s.length,c);for(let e=a;e<c;++e)t+=String.fromCharCode(127&s[e]);return t;return}case"latin1":case"binary":{var l=this;i=r;var f=n;let t="";f=Math.min(l.length,f);for(let e=i;e<f;++e)t+=String.fromCharCode(l[e]);return t;return}case"base64":return d=this,b=n,0===(h=r)&&b===d.length?DA.fromByteArray(d):DA.fromByteArray(d.slice(h,b));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":{d=this;h=r;b=n;var p=d.slice(h,b);let t="";for(let e=0;e<p.length-1;e+=2)t+=String.fromCharCode(p[e]+256*p[e+1]);return t;return}default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}var d,h,b}function MS(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function xS(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=t1(r=+r)?o?0:e.length-1:r)<0?e.length+r:r)>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=A.from(t,n)),A.isBuffer(t))return 0===t.length?-1:NS(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):NS(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function NS(r,n,t,e,o){let i=1,u=r.length,a=n.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(r.length<2||n.length<2)return-1;i=2,u/=2,a/=2,t/=2}function s(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}let c;if(o){let e=-1;for(c=t;c<u;c++)if(s(r,c)===s(n,-1===e?0:c-e)){if(-1===e&&(e=c),c-e+1===a)return e*i}else-1!==e&&(c-=c-e),e=-1}else for(t+a>u&&(t=u-a),c=t;0<=c;c--){let t=!0;for(let e=0;e<a;e++)if(s(r,c+e)!==s(n,e)){t=!1;break}if(t)return c}return-1}function US(e,t,r,n){return $S(function(t){const r=[];for(let e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(t),e,r,n)}function DS(e,t,r,n){return $S(function(t,r){var n,o;const i=[];for(let e=0;e<t.length&&!((r-=2)<0);++e)o=t.charCodeAt(e),n=o>>8,o=o%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function LS(u,e,t){t=Math.min(u.length,t);const r=[];let a=e;for(;a<t;){var s=u[a];let o=null,i=239<s?4:223<s?3:191<s?2:1;if(a+i<=t){let e,t,r,n;switch(i){case 1:s<128&&(o=s);break;case 2:128==(192&(e=u[a+1]))&&127<(n=(31&s)<<6|63&e)&&(o=n);break;case 3:e=u[a+1],t=u[a+2],128==(192&e)&&128==(192&t)&&2047<(n=(15&s)<<12|(63&e)<<6|63&t)&&(n<55296||57343<n)&&(o=n);break;case 4:e=u[a+1],t=u[a+2],r=u[a+3],128==(192&e)&&128==(192&t)&&128==(192&r)&&65535<(n=(15&s)<<18|(63&e)<<12|(63&t)<<6|63&r)&&n<1114112&&(o=n)}}null===o?(o=65533,i=1):65535<o&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),a+=i}{var n=r,o=n.length;if(o<=FA)return String.fromCharCode.apply(String,n);let e="",t=0;for(;t<o;)e+=String.fromCharCode.apply(String,n.slice(t,t+=FA));return e}}ES.kMaxLength=BA,(A.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1);var e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.buffer}}),Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.byteOffset}}),A.poolSize=8192,A.from=SS,Object.setPrototypeOf(A.prototype,Uint8Array.prototype),Object.setPrototypeOf(A,Uint8Array),A.alloc=function(e,t,r){return t=t,r=r,TS(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?PS(e).fill(t,r):PS(e).fill(t):PS(e)},A.allocUnsafe=jS,A.allocUnsafeSlow=jS,A.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==A.prototype},A.compare=function(r,n){if(e1(r,Uint8Array)&&(r=A.from(r,r.offset,r.byteLength)),e1(n,Uint8Array)&&(n=A.from(n,n.offset,n.byteLength)),!A.isBuffer(r)||!A.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===n)return 0;let o=r.length,i=n.length;for(let e=0,t=Math.min(o,i);e<t;++e)if(r[e]!==n[e]){o=r[e],i=n[e];break}return o<i?-1:i<o?1:0},A.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return A.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=A.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(e1(e,Uint8Array))o+e.length>n.length?(e=A.isBuffer(e)?e:A.from(e)).copy(n,o):Uint8Array.prototype.set.call(n,e,o);else{if(!A.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},A.byteLength=kS,A.prototype._isBuffer=!0,A.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)MS(this,e,e+1);return this},A.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)MS(this,e,e+3),MS(this,e+1,e+2);return this},A.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)MS(this,e,e+7),MS(this,e+1,e+6),MS(this,e+2,e+5),MS(this,e+3,e+4);return this},A.prototype.toLocaleString=A.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?LS(this,0,e):AS.apply(this,arguments)},A.prototype.equals=function(e){if(A.isBuffer(e))return this===e||0===A.compare(this,e);throw new TypeError("Argument must be a Buffer")},A.prototype.inspect=function(){let e="";var t=ES.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},ys&&(A.prototype[ys]=A.prototype.inspect),A.prototype.compare=function(e,t,r,n,o){if(e1(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=t)return 0;if(o<=n)return-1;if(r<=t)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(t>>>=0);var a=Math.min(i,u),s=this.slice(n,o),c=e.slice(t,r);for(let e=0;e<a;++e)if(s[e]!==c[e]){i=s[e],u=c[e];break}return i<u?-1:u<i?1:0},A.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},A.prototype.indexOf=function(e,t,r){return xS(this,e,t,r,!0)},A.prototype.lastIndexOf=function(e,t,r){return xS(this,e,t,r,!1)},A.prototype.write=function(t,r,n,e){if(void 0===r)e="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)e=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(n)?(n>>>=0,void 0===e&&(e="utf8")):(e=n,n=void 0)}var o,i,u,a=this.length-r;if((void 0===n||a<n)&&(n=a),0<t.length&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");e=e||"utf8";let s=!1;for(;;)switch(e){case"hex":{var c=this;var l=t;var f=r;var p=n;f=Number(f)||0;var d=c.length-f;(!p||d<(p=Number(p)))&&(p=d),(d=l.length)/2<p&&(p=d/2);let e;for(e=0;e<p;++e){var h=parseInt(l.substr(2*e,2),16);if(t1(h))return e;c[f+e]=h}return e;return}case"utf8":case"utf-8":return d=r,u=n,$S(QS(t,(i=this).length-d),i,d,u);case"ascii":case"latin1":case"binary":return US(this,t,r,n);case"base64":return i=this,u=r,o=n,$S(JS(t),i,u,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return DS(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),s=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const FA=4096;function BS(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function FS(e,t,r,n,o,i){if(!A.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<t||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function WS(e,t,r,n,o){GS(t,n,o,e,r,7);n=Number(t&BigInt(4294967295)),e[r++]=n,e[r++]=n>>=8,e[r++]=n>>=8,e[r++]=n>>=8,o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,e[r++]=o>>=8,e[r++]=o>>=8,e[r++]=o>>=8,r}function zS(e,t,r,n,o){GS(t,n,o,e,r,7);n=Number(t&BigInt(4294967295)),e[r+7]=n,e[r+6]=n>>=8,e[r+5]=n>>=8,e[r+4]=n>>=8,o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,e[r+2]=o>>=8,e[r+1]=o>>=8,e[r]=o>>=8,r+8}function qS(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function VS(e,t,r,n,o){return t=+t,r>>>=0,o||qS(e,0,r,4),LA.write(e,t,r,n,23,4),r+4}function HS(e,t,r,n,o){return t=+t,r>>>=0,o||qS(e,0,r,8),LA.write(e,t,r,n,52,8),r+8}A.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return Object.setPrototypeOf(r,A.prototype),r},A.prototype.readUintLE=A.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||BS(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},A.prototype.readUintBE=A.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||BS(e,t,this.length);let n=this[e+--t],o=1;for(;0<t&&(o*=256);)n+=this[e+--t]*o;return n},A.prototype.readUint8=A.prototype.readUInt8=function(e,t){return e>>>=0,t||BS(e,1,this.length),this[e]},A.prototype.readUint16LE=A.prototype.readUInt16LE=function(e,t){return e>>>=0,t||BS(e,2,this.length),this[e]|this[e+1]<<8},A.prototype.readUint16BE=A.prototype.readUInt16BE=function(e,t){return e>>>=0,t||BS(e,2,this.length),this[e]<<8|this[e+1]},A.prototype.readUint32LE=A.prototype.readUInt32LE=function(e,t){return e>>>=0,t||BS(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},A.prototype.readUint32BE=A.prototype.readUInt32BE=function(e,t){return e>>>=0,t||BS(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},A.prototype.readBigUInt64LE=r1(function(e){ZS(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||XS(e,this.length-8),t+256*this[++e]+65536*this[++e]+this[++e]*2**24),e=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(t)+(BigInt(e)<<BigInt(32))}),A.prototype.readBigUInt64BE=r1(function(e){ZS(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||XS(e,this.length-8),t*2**24+65536*this[++e]+256*this[++e]+this[++e]),e=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(t)<<BigInt(32))+BigInt(e)}),A.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||BS(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},A.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||BS(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;0<n&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},A.prototype.readInt8=function(e,t){return e>>>=0,t||BS(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},A.prototype.readInt16LE=function(e,t){e>>>=0,t||BS(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},A.prototype.readInt16BE=function(e,t){e>>>=0,t||BS(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},A.prototype.readInt32LE=function(e,t){return e>>>=0,t||BS(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},A.prototype.readInt32BE=function(e,t){return e>>>=0,t||BS(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},A.prototype.readBigInt64LE=r1(function(e){ZS(e>>>=0,"offset");var t=this[e],r=this[e+7],r=(void 0!==t&&void 0!==r||XS(e,this.length-8),this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24));return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),A.prototype.readBigInt64BE=r1(function(e){ZS(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||XS(e,this.length-8),(t<<24)+65536*this[++e]+256*this[++e]+this[++e]);return(BigInt(t)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),A.prototype.readFloatLE=function(e,t){return e>>>=0,t||BS(e,4,this.length),LA.read(this,e,!0,23,4)},A.prototype.readFloatBE=function(e,t){return e>>>=0,t||BS(e,4,this.length),LA.read(this,e,!1,23,4)},A.prototype.readDoubleLE=function(e,t){return e>>>=0,t||BS(e,8,this.length),LA.read(this,e,!0,52,8)},A.prototype.readDoubleBE=function(e,t){return e>>>=0,t||BS(e,8,this.length),LA.read(this,e,!1,52,8)},A.prototype.writeUintLE=A.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||FS(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},A.prototype.writeUintBE=A.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||FS(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;0<=--o&&(i*=256);)this[t+o]=e/i&255;return t+r},A.prototype.writeUint8=A.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,1,255,0),this[t]=255&e,t+1},A.prototype.writeUint16LE=A.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeUint16BE=A.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeUint32LE=A.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},A.prototype.writeUint32BE=A.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeBigUInt64LE=r1(function(e,t=0){return WS(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),A.prototype.writeBigUInt64BE=r1(function(e,t=0){return zS(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),A.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||FS(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);let o=0,i=1,u=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===u&&0!==this[t+o-1]&&(u=1),this[t+o]=(e/i>>0)-u&255;return t+r},A.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||FS(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);let o=r-1,i=1,u=0;for(this[t+o]=255&e;0<=--o&&(i*=256);)e<0&&0===u&&0!==this[t+o+1]&&(u=1),this[t+o]=(e/i>>0)-u&255;return t+r},A.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},A.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},A.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||FS(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeBigInt64LE=r1(function(e,t=0){return WS(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),A.prototype.writeBigInt64BE=r1(function(e,t=0){return zS(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),A.prototype.writeFloatLE=function(e,t,r){return VS(this,e,t,!0,r)},A.prototype.writeFloatBE=function(e,t,r){return VS(this,e,t,!1,r)},A.prototype.writeDoubleLE=function(e,t,r){return HS(this,e,t,!0,r)},A.prototype.writeDoubleBE=function(e,t,r){return HS(this,e,t,!1,r)},A.prototype.copy=function(e,t,r,n){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var o=(n=e.length-t<n-r?e.length-t+r:n)-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},A.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!A.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o;1===e.length&&(o=e.charCodeAt(0),("utf8"===n&&o<128||"latin1"===n)&&(e=o))}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0;let i;if("number"==typeof(e=e||0))for(i=t;i<r;++i)this[i]=e;else{var u=A.isBuffer(e)?e:A.from(e,n),a=u.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=u[i%a]}return this};const WA={};function YS(e,t,r){WA[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=this.name+` [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return this.name+` [${e}]: `+this.message}}}function KS(e){let t="",r=e.length;for(var n="-"===e[0]?1:0;r>=4+n;r-=3)t="_"+e.slice(r-3,r)+t;return""+e.slice(0,r)+t}function GS(t,r,n,e,o,i){if(n<t||t<r){var u="bigint"==typeof r?"n":"";let e;throw e=3<i?0===r||r===BigInt(0)?`>= 0${u} and < 2${u} ** `+8*(i+1)+u:`>= -(2${u} ** ${8*(i+1)-1}${u}) and < 2 ** `+(8*(i+1)-1)+u:`>= ${r}${u} and <= `+n+u,new WA.ERR_OUT_OF_RANGE("value",e,t)}r=e,n=i,ZS(u=o,"offset"),void 0!==r[u]&&void 0!==r[u+n]||XS(u,r.length-(n+1))}function ZS(e,t){if("number"!=typeof e)throw new WA.ERR_INVALID_ARG_TYPE(t,"number",e)}function XS(e,t,r){if(Math.floor(e)!==e)throw ZS(e,r),new WA.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new WA.ERR_BUFFER_OUT_OF_BOUNDS;throw new WA.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= `+t,e)}YS("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"},RangeError),YS("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type `+typeof t},TypeError),YS("ERR_OUT_OF_RANGE",function(e,t,r){e=`The value of "${e}" is out of range.`;let n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=KS(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=KS(n)),n+="n"),e+=` It must be ${t}. Received `+n},RangeError);const zA=/[^+/0-9A-Za-z-_]/g;function QS(t,r){r=r||1/0;let n;var o=t.length;let i=null;const u=[];for(let e=0;e<o;++e){if(55295<(n=t.charCodeAt(e))&&n<57344){if(!i){if(56319<n){-1<(r-=3)&&u.push(239,191,189);continue}if(e+1===o){-1<(r-=3)&&u.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(r-=3)&&u.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(r-=3)&&u.push(239,191,189);if(i=null,n<128){if(--r<0)break;u.push(n)}else if(n<2048){if((r-=2)<0)break;u.push(n>>6|192,63&n|128)}else if(n<65536){if((r-=3)<0)break;u.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;u.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return u}function JS(e){return DA.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(zA,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $S(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function e1(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function t1(e){return e!=e}const qA=function(){var r="0123456789abcdef";const n=new Array(256);for(let t=0;t<16;++t){var o=16*t;for(let e=0;e<16;++e)n[o+e]=r[t]+r[e]}return n}();function r1(e){return"undefined"==typeof BigInt?n1:e}function n1(){throw new Error("BigInt not supported")}}var o1,Kl={},aa={},n=r&&r.__extends||(o1=function(e,t){return(o1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),cf=(Object.defineProperty(aa,"__esModule",{value:!0}),M.prototype.getUInt8=function(e){throw new Error("Not implemented")},M.prototype.getInt8=function(e){throw new Error("Not implemented")},M.prototype.getFloat64=function(e){throw new Error("Not implemented")},M.prototype.putUInt8=function(e,t){throw new Error("Not implemented")},M.prototype.putInt8=function(e,t){throw new Error("Not implemented")},M.prototype.putFloat64=function(e,t){throw new Error("Not implemented")},M.prototype.getInt16=function(e){return this.getInt8(e)<<8|this.getUInt8(e+1)},M.prototype.getUInt16=function(e){return this.getUInt8(e)<<8|this.getUInt8(e+1)},M.prototype.getInt32=function(e){return this.getInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},M.prototype.getUInt32=function(e){return this.getUInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},M.prototype.getInt64=function(e){return this.getInt8(e)<<56|this.getUInt8(e+1)<<48|this.getUInt8(e+2)<<40|this.getUInt8(e+3)<<32|this.getUInt8(e+4)<<24|this.getUInt8(e+5)<<16|this.getUInt8(e+6)<<8|this.getUInt8(e+7)},M.prototype.getSlice=function(e,t){return new u1(e,t,this)},M.prototype.putInt16=function(e,t){this.putInt8(e,t>>8),this.putUInt8(e+1,255&t)},M.prototype.putUInt16=function(e,t){this.putUInt8(e,t>>8&255),this.putUInt8(e+1,255&t)},M.prototype.putInt32=function(e,t){this.putInt8(e,t>>24),this.putUInt8(e+1,t>>16&255),this.putUInt8(e+2,t>>8&255),this.putUInt8(e+3,255&t)},M.prototype.putUInt32=function(e,t){this.putUInt8(e,t>>24&255),this.putUInt8(e+1,t>>16&255),this.putUInt8(e+2,t>>8&255),this.putUInt8(e+3,255&t)},M.prototype.putInt64=function(e,t){this.putInt8(e,t>>48),this.putUInt8(e+1,t>>42&255),this.putUInt8(e+2,t>>36&255),this.putUInt8(e+3,t>>30&255),this.putUInt8(e+4,t>>24&255),this.putUInt8(e+5,t>>16&255),this.putUInt8(e+6,t>>8&255),this.putUInt8(e+7,255&t)},M.prototype.putBytes=function(e,t){for(var r=0,n=t.remaining();r<n;r++)this.putUInt8(e+r,t.readUInt8())},M.prototype.readUInt8=function(){return this.getUInt8(this._updatePos(1))},M.prototype.readInt8=function(){return this.getInt8(this._updatePos(1))},M.prototype.readUInt16=function(){return this.getUInt16(this._updatePos(2))},M.prototype.readUInt32=function(){return this.getUInt32(this._updatePos(4))},M.prototype.readInt16=function(){return this.getInt16(this._updatePos(2))},M.prototype.readInt32=function(){return this.getInt32(this._updatePos(4))},M.prototype.readInt64=function(){return this.getInt32(this._updatePos(8))},M.prototype.readFloat64=function(){return this.getFloat64(this._updatePos(8))},M.prototype.writeUInt8=function(e){this.putUInt8(this._updatePos(1),e)},M.prototype.writeInt8=function(e){this.putInt8(this._updatePos(1),e)},M.prototype.writeInt16=function(e){this.putInt16(this._updatePos(2),e)},M.prototype.writeInt32=function(e){this.putInt32(this._updatePos(4),e)},M.prototype.writeUInt32=function(e){this.putUInt32(this._updatePos(4),e)},M.prototype.writeInt64=function(e){this.putInt64(this._updatePos(8),e)},M.prototype.writeFloat64=function(e){this.putFloat64(this._updatePos(8),e)},M.prototype.writeBytes=function(e){this.putBytes(this._updatePos(e.remaining()),e)},M.prototype.readSlice=function(e){return this.getSlice(this._updatePos(e),e)},M.prototype._updatePos=function(e){var t=this.position;return this.position+=e,t},M.prototype.remaining=function(){return this.length-this.position},M.prototype.hasRemaining=function(){return 0<this.remaining()},M.prototype.reset=function(){this.position=0},M.prototype.toString=function(){return this.constructor.name+"( position="+this.position+" )\n "+this.toHex()},M.prototype.toHex=function(){for(var e="",t=0;t<this.length;t++){var r=this.getUInt8(t).toString(16);e+=r=1===r.length?"0"+r:r,t!==this.length-1&&(e+=" ")}return e},M);function M(e){this.position=0,this.length=e}aa.default=cf;n(a1,i1=cf),a1.prototype.putUInt8=function(e,t){this._inner.putUInt8(this._start+e,t)},a1.prototype.getUInt8=function(e){return this._inner.getUInt8(this._start+e)},a1.prototype.putInt8=function(e,t){this._inner.putInt8(this._start+e,t)},a1.prototype.putFloat64=function(e,t){this._inner.putFloat64(this._start+e,t)},a1.prototype.getInt8=function(e){return this._inner.getInt8(this._start+e)},a1.prototype.getFloat64=function(e){return this._inner.getFloat64(this._start+e)};var i1,u1=a1;function a1(e,t,r){t=i1.call(this,t)||this;return t._start=e,t._inner=r,t}var s1,c1,_f=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mf=(Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.BaseBuffer=void 0,_f(aa)),jf=(Kl.BaseBuffer=mf.default,Kl.default=mf.default,r&&r.__extends||(s1=function(e,t){return(s1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}s1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Mf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},l1=(Object.defineProperty(pa,"__esModule",{value:!0}),pa.alloc=void 0,Mf(Ic)),ha=Mf(Kl),f1=(c1=ha.default,jf(p1,c1),p1.prototype.getUInt8=function(e){return this._buffer.readUInt8(e)},p1.prototype.getInt8=function(e){return this._buffer.readInt8(e)},p1.prototype.getFloat64=function(e){return this._buffer.readDoubleBE(e)},p1.prototype.putUInt8=function(e,t){this._buffer.writeUInt8(t,e)},p1.prototype.putInt8=function(e,t){this._buffer.writeInt8(t,e)},p1.prototype.putFloat64=function(e,t){this._buffer.writeDoubleBE(t,e)},p1.prototype.putBytes=function(e,t){var r;t instanceof p1?(r=Math.min(t.length-t.position,this.length-e),t._buffer.copy(this._buffer,e,t.position,t.position+r),t.position+=r):c1.prototype.putBytes.call(this,e,t)},p1.prototype.getSlice=function(e,t){return new p1(this._buffer.slice(e,e+t))},p1);function p1(e){var t=this,e=(e=e)instanceof l1.default.Buffer?e:"number"==typeof e&&"function"==typeof l1.default.Buffer.alloc?l1.default.Buffer.alloc(e):new l1.default.Buffer(e);return(t=c1.call(this,e.length)||this)._buffer=e,t}pa.default=f1,pa.alloc=function(e){return new f1(e)};var Gl=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},d1=(Object.defineProperty(ml,"__esModule",{value:!0}),Gl(pa)),h1=e,Uf=h1.internal.util,b1=Uf.ENCRYPTION_OFF,y1=Uf.ENCRYPTION_ON;function _1(e,t,r){void 0===t&&(t=v1),void 0===r&&(r=function(e){return new WebSocket(e)});var n,o=this,t=(this._open=!0,this._pending=[],this._error=null,this._handleConnectionError=this._handleConnectionError.bind(this),this._config=e,this._receiveTimeout=null,this._receiveTimeoutStarted=!1,this._receiveTimeoutId=null,function(e,t){var r=function(e){return!0===e.encrypted||e.encrypted===y1}(e),n=function(e){return!1===e.encrypted||e.encrypted===b1}(e),e=e.trust,t=function(e){e="function"==typeof e?e():"";return e&&0<=e.toLowerCase().indexOf("https")}(t);if(function(e,t,r){null!==r&&(e&&!r?console.warn("Neo4j driver is configured to use secure WebSocket on a HTTP web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to not use encryption."):t&&r&&console.warn("Neo4j driver is configured to use insecure WebSocket on a HTTPS web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to use encryption."))}(r,n,t),n)return{scheme:"ws",error:null};if(t)return{scheme:"wss",error:null};if(r)return e&&"TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"!==e?{scheme:null,error:(0,h1.newError)("The browser version of this driver only supports one trust strategy, 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES'. "+e+' is not supported. Please either use TRUST_SYSTEM_CA_SIGNED_CERTIFICATES or disable encryption by setting `encrypted:"'+b1+'"` in the driver configuration.')}:{scheme:"wss",error:null};return{scheme:"ws",error:null}}(e,t)),i=t.scheme,t=t.error;t?this._error=t:(this._ws=function(t,r,n){var o=t+"://"+r.asHostPort();try{return n(o)}catch(e){if(function(e,t){return"SyntaxError"===e.name&&function(e){return"["===e.charAt(0)&&-1!==e.indexOf("]")}(t.asHostPort())}(e,r))return o=function(e,t){var r=t.host().replace(/:/g,"-").replace("%","s")+".ipv6-literal.net";return"".concat(e,"://").concat(r,":").concat(t.port())}(t,r),n(o);throw e}}(i,e.address,r),this._ws.binaryType="arraybuffer",(n=this)._ws.onclose=function(e){e&&!e.wasClean&&n._handleConnectionError(),n._open=!1},this._ws.onopen=function(){n._clearConnectionTimeout();var e=n._pending;n._pending=null;for(var t=0;t<e.length;t++)n.write(e[t])},this._ws.onmessage=function(e){o._resetTimeout(),n.onmessage&&(e=new d1.default(e.data),n.onmessage(e))},this._ws.onerror=this._handleConnectionError,this._connectionTimeoutFired=!1,this._connectionTimeoutId=this._setupConnectionTimeout())}function v1(){return"undefined"!=typeof window&&window.location?window.location.protocol:null}_1.prototype._handleConnectionError=function(){if(this._connectionTimeoutFired)return this._error=(0,h1.newError)("Failed to establish connection in ".concat(this._config.connectionTimeout,"ms"),this._config.connectionErrorCode),void(this.onerror&&this.onerror(this._error));this._open&&!this._timedout&&(this._error=(0,h1.newError)("WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket `readyState` is: "+this._ws.readyState,this._config.connectionErrorCode),this.onerror&&this.onerror(this._error))},_1.prototype.write=function(e){if(null!==this._pending)this._pending.push(e);else{if(!(e instanceof d1.default))throw(0,h1.newError)("Don't know how to send buffer: "+e);try{this._ws.send(e._buffer)}catch(e){if(1===this._ws.readyState)throw e;this._handleConnectionError()}}},_1.prototype.close=function(){var r=this;return new Promise(function(e,t){r._ws&&3!==r._ws.readyState?(r._open=!1,r.stopReceiveTimeout(),r._clearConnectionTimeout(),r._ws.onclose=function(){return e()},r._ws.close()):e()})},_1.prototype.setupReceiveTimeout=function(e){this._receiveTimeout=e},_1.prototype.stopReceiveTimeout=function(){null!==this._receiveTimeout&&this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!1,null!=this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=null)},_1.prototype.startReceiveTimeout=function(){this._open&&null!==this._receiveTimeout&&!this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!0,this._resetTimeout())},_1.prototype._resetTimeout=function(){var e=this;this._receiveTimeoutStarted&&(null!==this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=setTimeout(function(){e._receiveTimeoutId=null,e._timedout=!0,e.stopReceiveTimeout(),e._error=(0,h1.newError)("Connection lost. Server didn't respond in ".concat(e._receiveTimeout,"ms"),e._config.connectionErrorCode),e.close(),e.onerror&&e.onerror(e._error)},this._receiveTimeout))},_1.prototype._setupConnectionTimeout=function(){var e,t=this,r=this._config.connectionTimeout;return r?(e=this._ws,setTimeout(function(){1!==e.readyState&&(t._connectionTimeoutFired=!0,e.close())},r)):null},_1.prototype._clearConnectionTimeout=function(){var e=this._connectionTimeoutId;!e&&0!==e||(this._connectionTimeoutFired=!1,this._connectionTimeoutId=null,clearTimeout(e))},ml.default=_1;var m1,Ff={},da=r&&r.__extends||(m1=function(e,t){return(m1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}m1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Ff,"__esModule",{value:!0});var g1,j=e.internal.resolver.BaseHostNameResolver,sf=(da(O1,g1=j),O1.prototype.resolve=function(e){return this._resolveToItself(e)},O1);function O1(){return null!==g1&&g1.apply(this,arguments)||this}Ff.default=sf;var w1,P=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Zf=(Object.defineProperty(pl,"__esModule",{value:!0}),pl.HostNameResolver=pl.Channel=void 0,P(ml)),w=P(Ff),I=(pl.Channel=Zf.default,pl.HostNameResolver=w.default,{}),gf={},lf=r&&r.__extends||(w1=function(e,t){return(w1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}w1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(gf,"__esModule",{value:!0});var E1,P1=pa,Xf=(E1=Kl.BaseBuffer,lf(S1,E1),S1.prototype.getUInt8=function(e){for(var t=0;t<this._buffers.length;t++){var r=this._buffers[t];if(!(e>=r.length))return r.getUInt8(e);e-=r.length}},S1.prototype.getInt8=function(e){for(var t=0;t<this._buffers.length;t++){var r=this._buffers[t];if(!(e>=r.length))return r.getInt8(e);e-=r.length}},S1.prototype.getFloat64=function(e){for(var t=(0,P1.alloc)(8),r=0;r<8;r++)t.putUInt8(r,this.getUInt8(e+r));return t.getFloat64(0)},S1);function S1(e){for(var t=this,r=0,n=0;n<e.length;n++)r+=e[n].length;return(t=E1.call(this,r)||this)._buffers=e,t}gf.default=Xf;var T1,j1,ep=r&&r.__extends||(T1=function(e,t){return(T1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}T1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),op=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},cp=(Object.defineProperty(I,"__esModule",{value:!0}),I.Dechunker=I.Chunker=void 0,op(aa)),C1=pa,I1=op(gf),hp=(j1=cp.default,ep(R1,j1),R1.prototype.putUInt8=function(e,t){this._ensure(1),this._buffer.writeUInt8(t)},R1.prototype.putInt8=function(e,t){this._ensure(1),this._buffer.writeInt8(t)},R1.prototype.putFloat64=function(e,t){this._ensure(8),this._buffer.writeFloat64(t)},R1.prototype.putBytes=function(e,t){for(;0<t.remaining();)this._ensure(1),this._buffer.remaining()>t.remaining()?this._buffer.writeBytes(t):this._buffer.writeBytes(t.readSlice(this._buffer.remaining()));return this},R1.prototype.flush=function(){var e;return 0<this._buffer.position&&(this._closeChunkIfOpen(),e=this._buffer,this._buffer=null,this._ch.write(e.getSlice(0,e.position)),this._buffer=(0,C1.alloc)(this._bufferSize),this._chunkOpen=!1),this},R1.prototype.messageBoundary=function(){this._closeChunkIfOpen(),this._buffer.remaining()<2&&this.flush(),this._buffer.writeInt16(0)},R1.prototype._ensure=function(e){e=this._chunkOpen?e:e+2;this._buffer.remaining()<e&&this.flush(),this._chunkOpen||(this._currentChunkStart=this._buffer.position,this._buffer.position=this._buffer.position+2,this._chunkOpen=!0)},R1.prototype._closeChunkIfOpen=function(){var e;this._chunkOpen&&(e=this._buffer.position-(this._currentChunkStart+2),this._buffer.putUInt16(this._currentChunkStart,e),this._chunkOpen=!1)},R1);function R1(e,t){var r=j1.call(this,0)||this;return r._bufferSize=t||1400,r._ch=e,r._buffer=(0,C1.alloc)(r._bufferSize),r._currentChunkStart=0,r._chunkOpen=!1,r}function k1(){this._currentMessage=[],this._partialChunkHeader=0,this._state=this.AWAITING_CHUNK}I.Chunker=hp,k1.prototype.AWAITING_CHUNK=function(e){return 2<=e.remaining()?this._onHeader(e.readUInt16()):(this._partialChunkHeader=e.readUInt8()<<8,this.IN_HEADER)},k1.prototype.IN_HEADER=function(e){return this._onHeader(65535&(this._partialChunkHeader|e.readUInt8()))},k1.prototype.IN_CHUNK=function(e){return this._chunkSize<=e.remaining()?(this._currentMessage.push(e.readSlice(this._chunkSize)),this.AWAITING_CHUNK):(this._chunkSize-=e.remaining(),this._currentMessage.push(e.readSlice(e.remaining())),this.IN_CHUNK)},k1.prototype.CLOSED=function(e){},k1.prototype._onHeader=function(e){if(0!==e)return this._chunkSize=e,this.IN_CHUNK;var t=void 0;switch(this._currentMessage.length){case 0:return this.AWAITING_CHUNK;case 1:t=this._currentMessage[0];break;default:t=new I1.default(this._currentMessage)}return this._currentMessage=[],this.onmessage(t),this.AWAITING_CHUNK},k1.prototype.write=function(e){for(;e.hasRemaining();)this._state=this._state(e)},I.Dechunker=k1;var Ep={},A1=(Object.defineProperty(Ep,"__esModule",{value:!0}),e),kp=A1.internal.util,Up=kp.ENCRYPTION_OFF,Fp=kp.ENCRYPTION_ON,M1=A1.error.SERVICE_UNAVAILABLE,x1=[null,void 0,!0,!1,Fp,Up],N1=[null,void 0,"TRUST_ALL_CERTIFICATES","TRUST_CUSTOM_CA_SIGNED_CERTIFICATES","TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"];Ep.default=function(e,t,r){this.address=e,this.encrypted=function(e){e=e.encrypted;if(-1!==x1.indexOf(e))return e;throw(0,A1.newError)("Illegal value of the encrypted setting ".concat(e,". Expected one of ").concat(x1))}(t),this.trust=function(e){e=e.trust;if(-1!==N1.indexOf(e))return e;throw(0,A1.newError)("Illegal value of the trust setting ".concat(e,". Expected one of ").concat(N1))}(t),this.trustedCertificates=t.trustedCertificates||[],this.knownHostsPath=t.knownHosts||null,this.connectionErrorCode=r||M1,this.connectionTimeout=t.connectionTimeout};var U1,D1,Wp={},id={},od={exports:{}};function L1(e,t){for(var r in e)t[r]=e[r]}function B1(e,t,r){return D1(e,t,r)}Kc=(Pd=od).exports,(D1=(U1=Ic).Buffer).from&&D1.alloc&&D1.allocUnsafe&&D1.allocUnsafeSlow?Pd.exports=U1:(L1(U1,Kc),Kc.Buffer=B1),B1.prototype=Object.create(D1.prototype),L1(D1,B1),B1.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return D1(e,t,r)},B1.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=D1(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},B1.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return D1(e)},B1.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return U1.SlowBuffer(e)};var F1=od.exports.Buffer,W1=F1.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function z1(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"==typeof t||F1.isEncoding!==W1&&W1(e))return t||e;throw new Error("Unknown encoding: "+e)}function q1(e){var t;switch(this.encoding=z1(e),this.encoding){case"utf16le":this.text=Y1,this.end=K1,t=4;break;case"utf8":this.fillLast=H1,t=4;break;case"base64":this.text=G1,this.end=Z1,t=3;break;default:return this.write=X1,void(this.end=Q1)}this.lastNeed=0,this.lastTotal=0,this.lastChar=F1.allocUnsafe(t)}function V1(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function H1(e){var t,r=this.lastTotal-this.lastNeed,n=(t=this,128!=(192&(n=e)[0])?(t.lastNeed=0,"�"):1<t.lastNeed&&1<n.length?128!=(192&n[1])?(t.lastNeed=1,"�"):2<t.lastNeed&&2<n.length&&128!=(192&n[2])?(t.lastNeed=2,"�"):void 0:void 0);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,r,0,e.length),void(this.lastNeed-=e.length))}function Y1(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);t=e.toString("utf16le",t);if(t){var r=t.charCodeAt(t.length-1);if(55296<=r&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}function K1(e){var t,e=e&&e.length?this.write(e):"";return this.lastNeed?(t=this.lastTotal-this.lastNeed,e+this.lastChar.toString("utf16le",0,t)):e}function G1(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function Z1(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function X1(e){return e.toString(this.encoding)}function Q1(e){return e&&e.length?this.write(e):""}(id.StringDecoder=q1).prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},q1.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},q1.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=V1(t[n]);if(0<=o)return 0<o&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(0<=(o=V1(t[n])))return 0<o&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(0<=(o=V1(t[n])))return 0<o&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;r=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},q1.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var J1,$1,eT,tT,rT,lc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nT=(Object.defineProperty(Wp,"__esModule",{value:!0}),lc(pa)),oT=e,iT=lc(Ic),uT=new id.StringDecoder("utf8");Wp.default={encode:function(e){return new nT.default((e=e,"function"==typeof iT.default.Buffer.from?iT.default.Buffer.from(e,"utf8"):new iT.default.Buffer(e,"utf8")))},decode:function(e,t){if(Object.prototype.hasOwnProperty.call(e,"_buffer"))return n=t,a=(r=e).position,n=a+n,r.position=Math.min(n,r.length),r._buffer.toString("utf8",a,n);var o,i,u,r,n,a;if(Object.prototype.hasOwnProperty.call(e,"_buffers"))return o=function(e){return uT.write(e._buffer)},r=function(){return uT.end()},i=t,u=(a=e).position,a._updatePos(Math.min(t,a.length-u)),a._buffers.reduce(function(e,t){var r,n;return i<=0?e:u>=t.length?(u-=t.length,""):(t._updatePos(u-t.position),r=Math.min(t.length-u,i),n=t.readSlice(r),t._updatePos(r),i=Math.max(i-n.length,0),u=0,e+o(n))},"")+r();throw(0,oT.newError)("Don't know how to decode strings from '".concat(e,"'"))}},gd=fl,J1=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Ed=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||J1(t,e,r)},$1=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(gd,"__esModule",{value:!0}),gd.utf8=gd.alloc=gd.ChannelConfig=void 0,Ed(pl,gd),Ed(I,gd),eT=Ep,Object.defineProperty(gd,"ChannelConfig",{enumerable:!0,get:function(){return $1(eT).default}}),tT=pa,Object.defineProperty(gd,"alloc",{enumerable:!0,get:function(){return tT.alloc}}),rT=Wp,Object.defineProperty(gd,"utf8",{enumerable:!0,get:function(){return $1(rT).default}}),Object.defineProperty(Yc,"__esModule",{value:!0});var aT=fl,sT=e,cT=1616949271;function lT(e,t){return{major:e,minor:t}}function fT(){var e=[lT(5,0),[lT(4,4),lT(4,2)],lT(4,1),lT(3,0)];if(4<e.length)throw(0,sT.newError)("It should not have more than 4 versions of the protocol");var o=(0,aT.alloc)(20);return o.writeInt32(cT),e.forEach(function(e){var t,r,n;e instanceof Array?(r=(n=e[0]).major,n=n.minor,t=e[1].minor,o.writeInt32(n-t<<16|n<<8|r)):(r=e.major,n=e.minor,o.writeInt32(n<<8|r))}),o.reset(),o}Yc.default=function(t){var o=this;return new Promise(function(r,n){function e(e){n(e)}t.onerror=e.bind(o),t._error&&e(t._error),t.onmessage=function(t){try{var e=function(e){if(72===(e=[e.readUInt8(),e.readUInt8(),e.readUInt8(),e.readUInt8()])[0]&&84===e[1]&&84===e[2]&&80===e[3])throw(0,sT.newError)("Server responded HTTP. Make sure you are not trying to connect to the http endpoint (HTTP defaults to port 7474 whereas BOLT defaults to port 7687)");return Number(e[3]+"."+e[2])}(t);r({protocolVersion:e,consumeRemainingBuffer:function(e){t.hasRemaining()&&e(t.readSlice(t.remaining()))}})}catch(e){n(e)}},t.write(fT())})};var pT,xd={},Nd={},qd={},R={},Qd={},eh=r&&r.__extends||(pT=function(e,t){return(pT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pT(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),th=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Oh=(Object.defineProperty(Qd,"__esModule",{value:!0}),th(e),dT.ofRecord=function(e){return null===e?dT.ofNull():new OT(e)},dT.ofMessageResponse=function(e){return null===e?dT.ofNull():new bT(e)},dT.ofNull=function(){return new vT},Object.defineProperty(dT.prototype,"ttl",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(dT.prototype,"db",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(dT.prototype,"servers",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(dT.prototype,"isNull",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),dT);function dT(){}Qd.default=Oh;eh(yT,hT=Oh),Object.defineProperty(yT.prototype,"ttl",{get:function(){return this._response.rt.ttl},enumerable:!1,configurable:!0}),Object.defineProperty(yT.prototype,"servers",{get:function(){return this._response.rt.servers},enumerable:!1,configurable:!0}),Object.defineProperty(yT.prototype,"db",{get:function(){return this._response.rt.db},enumerable:!1,configurable:!0}),Object.defineProperty(yT.prototype,"isNull",{get:function(){return null===this._response},enumerable:!1,configurable:!0});var hT,bT=yT;function yT(e){var t=hT.call(this)||this;return t._response=e,t}eh(mT,_T=Oh),Object.defineProperty(mT.prototype,"isNull",{get:function(){return!0},enumerable:!1,configurable:!0});var _T,vT=mT;function mT(){return null!==_T&&_T.apply(this,arguments)||this}eh(wT,gT=Oh),Object.defineProperty(wT.prototype,"ttl",{get:function(){return this._record.get("ttl")},enumerable:!1,configurable:!0}),Object.defineProperty(wT.prototype,"servers",{get:function(){return this._record.get("servers")},enumerable:!1,configurable:!0}),Object.defineProperty(wT.prototype,"db",{get:function(){return this._record.has("db")?this._record.get("db"):null},enumerable:!1,configurable:!0}),Object.defineProperty(wT.prototype,"isNull",{get:function(){return null===this._record},enumerable:!1,configurable:!0});var gT,OT=wT;function wT(e){var t=gT.call(this)||this;return t._record=e,t}var ET,Sh=r&&r.__extends||(ET=function(e,t){return(ET=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ET(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Rh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},PT=(Object.defineProperty(R,"__esModule",{value:!0}),R.ProcedureRouteObserver=R.RouteObserver=R.CompletedObserver=R.FailedObserver=R.ResetObserver=R.LoginObserver=R.ResultStreamObserver=R.StreamObserver=void 0,e),ST=Rh(Qd),TT=PT.internal.constants.FETCH_ALL,jT=PT.error.PROTOCOL_ERROR,Nh=(CT.prototype.onNext=function(e){},CT.prototype.onError=function(e){},CT.prototype.onCompleted=function(e){},CT);function CT(){}R.StreamObserver=Nh;Sh(RT,IT=Nh),RT.prototype.pause=function(){this._paused=!0},RT.prototype.resume=function(){this._paused=!1,this._setupAutoPull(!0),this._state.pull(this)},RT.prototype.onNext=function(e){var t=new PT.Record(this._fieldKeys,e,this._fieldLookup);this._observers.some(function(e){return e.onNext})?this._observers.forEach(function(e){e.onNext&&e.onNext(t)}):(this._queuedRecords.push(t),this._queuedRecords.length>this._highRecordWatermark&&(this._autoPull=!1))},RT.prototype.onCompleted=function(e){this._state.onSuccess(this,e)},RT.prototype.onError=function(e){this._state.onError(this,e)},RT.prototype.cancel=function(){this._discard=!0},RT.prototype.prepareToHandleSingleResponse=function(){this._head=[],this._fieldKeys=[],this._setState(qT.STREAMING)},RT.prototype.markCompleted=function(){this._head=[],this._fieldKeys=[],this._tail={},this._setState(qT.SUCCEEDED)},RT.prototype.subscribe=function(e){if(this._head&&e.onKeys&&e.onKeys(this._head),0<this._queuedRecords.length&&e.onNext)for(var t=0;t<this._queuedRecords.length;t++)e.onNext(this._queuedRecords[t]),this._queuedRecords.length-t-1<=this._lowRecordWatermark&&(this._autoPull=!0,this._state===qT.READY&&this._handleStreaming());this._tail&&e.onCompleted&&e.onCompleted(this._tail),this._error&&e.onError(this._error),this._observers.push(e),this._state===qT.READY&&this._handleStreaming()},RT.prototype._handleHasMore=function(e){this._setState(qT.READY),this._handleStreaming(),delete e.has_more},RT.prototype._handlePullSuccess=function(e){var t,r=this,n=Object.assign(this._server?{server:this._server}:{},this._meta,e);[void 0,null,"r","w","rw","s"].includes(n.type)?(this._setState(qT.SUCCEEDED),e=null,t=function(){r._tail=n,r._observers.some(function(e){return e.onCompleted})&&r._observers.forEach(function(e){e.onCompleted&&e.onCompleted(n)}),r._afterComplete&&r._afterComplete(n)},(e=this._beforeComplete?this._beforeComplete(n):e)?Promise.resolve(e).then(t):t()):this.onError((0,PT.newError)('Server returned invalid query type. Expected one of [undefined, null, "r", "w", "rw", "s"] but got \''.concat(n.type,"'"),jT))},RT.prototype._handleRunSuccess=function(e,t){var r=this;if(null===this._fieldKeys){if(this._fieldKeys=[],this._fieldLookup={},e.fields&&0<e.fields.length){this._fieldKeys=e.fields;for(var n=0;n<e.fields.length;n++)this._fieldLookup[e.fields[n]]=n;delete e.fields}null!==e.qid&&void 0!==e.qid&&(this._queryId=e.qid,delete e.qid),this._storeMetadataForCompletion(e);var o=null,i=(this._beforeKeys&&(o=this._beforeKeys(this._fieldKeys)),function(){r._head=r._fieldKeys,r._observers.some(function(e){return e.onKeys})&&r._observers.forEach(function(e){e.onKeys&&e.onKeys(r._fieldKeys)}),r._afterKeys&&r._afterKeys(r._fieldKeys),t()});o?Promise.resolve(o).then(i):i()}},RT.prototype._handleError=function(t){function e(){r._observers.some(function(e){return e.onError})&&r._observers.forEach(function(e){e.onError&&e.onError(t)}),r._afterError&&r._afterError(t)}var r=this,n=(this._setState(qT.FAILED),this._error=t,null);this._beforeError&&(n=this._beforeError(t));n?Promise.resolve(n).then(e):e()},RT.prototype._handleStreaming=function(){this._head&&this._observers.some(function(e){return e.onNext||e.onCompleted})&&(this._paused||!this._discard&&!this._autoPull||this._more())},RT.prototype._more=function(){this._discard?this._discardFunction(this._queryId,this):this._moreFunction(this._queryId,this._fetchSize,this),this._setState(qT.STREAMING)},RT.prototype._storeMetadataForCompletion=function(e){for(var t,r=Object.keys(e),n=r.length;n--;)t=r[n],this._meta[t]=e[t]},RT.prototype._setState=function(e){this._state=e},RT.prototype._setupAutoPull=function(){this._autoPull=!0};var IT,Dh=RT;function RT(e){var e=void 0===e?{}:e,t=e.reactive,t=void 0!==t&&t,r=e.moreFunction,n=e.discardFunction,o=e.fetchSize,o=void 0===o?TT:o,i=e.beforeError,u=e.afterError,a=e.beforeKeys,s=e.afterKeys,c=e.beforeComplete,l=e.afterComplete,f=e.server,p=e.highRecordWatermark,p=void 0===p?Number.MAX_VALUE:p,e=e.lowRecordWatermark,e=void 0===e?Number.MAX_VALUE:e,d=IT.call(this)||this;return d._fieldKeys=null,d._fieldLookup=null,d._head=null,d._queuedRecords=[],d._tail=null,d._error=null,d._observers=[],d._meta={},d._server=f,d._beforeError=i,d._afterError=u,d._beforeKeys=a,d._afterKeys=s,d._beforeComplete=c,d._afterComplete=l,d._queryId=null,d._moreFunction=r,d._discardFunction=n,d._discard=!1,d._fetchSize=o,d._lowRecordWatermark=e,d._highRecordWatermark=p,d._setState(t?qT.READY:qT.READY_STREAMING),d._setupAutoPull(),d._paused=!1,d}R.ResultStreamObserver=Dh;Sh(AT,kT=Nh),AT.prototype.onNext=function(e){this.onError((0,PT.newError)("Received RECORD when initializing "+PT.json.stringify(e)))},AT.prototype.onError=function(e){this._onError&&this._onError(e)},AT.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var kT,Gh=AT;function AT(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=kT.call(this)||this;return r._onError=t,r._onCompleted=e,r}R.LoginObserver=Gh;Sh(xT,MT=Nh),xT.prototype.onNext=function(e){this.onError((0,PT.newError)("Received RECORD when resetting: received record is: "+PT.json.stringify(e),jT))},xT.prototype.onError=function(e){e.code===jT&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},xT.prototype.onCompleted=function(e){this._onComplete&&this._onComplete(e)};var MT,$h=xT;function xT(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onComplete,n=MT.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onComplete=e,n}R.ResetObserver=$h;Sh(UT,NT=Dh);var NT,rb=UT;function UT(e){var t=e.error,e=e.onError,e=NT.call(this,{beforeError:e})||this;return e.onError(t),e}R.FailedObserver=rb;Sh(LT,DT=Dh);var DT,nb=LT;function LT(){var e=DT.call(this)||this;return DT.prototype.markCompleted.call(e),e}R.CompletedObserver=nb;Sh(FT,BT=Nh),FT.prototype.onNext=function(e){this._records.push(e)},FT.prototype.onError=function(e){e.code===jT&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},FT.prototype.onCompleted=function(){null!==this._records&&1!==this._records.length?this.onError((0,PT.newError)("Illegal response from router. Received "+this._records.length+" records but expected only one.\n"+PT.json.stringify(this._records),jT)):this._onCompleted&&this._onCompleted(ST.default.ofRecord(this._records[0]))};var BT,ob=FT;function FT(e){var t=e.resultObserver,r=e.onProtocolError,n=e.onError,e=e.onCompleted,o=BT.call(this)||this;return o._resultObserver=t,o._onError=n,o._onCompleted=e,o._records=[],o._onProtocolError=r,t.subscribe(o),o}R.ProcedureRouteObserver=ob;Sh(zT,WT=Nh),zT.prototype.onNext=function(e){this.onError((0,PT.newError)("Received RECORD when resetting: received record is: "+PT.json.stringify(e),jT))},zT.prototype.onError=function(e){e.code===jT&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},zT.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(ST.default.ofMessageResponse(e))};var WT,fb=zT;function zT(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onCompleted,n=WT.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onCompleted=e,n}R.RouteObserver=fb;var qT={READY_STREAMING:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){e._setState(qT.STREAMING)})},onError:function(e,t){e._handleError(t)},name:function(){return"READY_STREAMING"},pull:function(){}},READY:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){return e._handleStreaming()})},onError:function(e,t){e._handleError(t)},name:function(){return"READY"},pull:function(e){return e._more()}},STREAMING:{onSuccess:function(e,t){t.has_more?e._handleHasMore(t):e._handlePullSuccess(t)},onError:function(e,t){e._handleError(t)},name:function(){return"STREAMING"},pull:function(){}},FAILED:{onError:function(e){},name:function(){return"FAILED"},pull:function(){}},SUCCEEDED:{name:function(){return"SUCCEEDED"},pull:function(){}}},VT=(Object.defineProperty(qd,"__esModule",{value:!0}),qd.assertImpersonatedUserIsEmpty=qd.assertTxConfigIsEmpty=qd.assertDatabaseIsEmpty=void 0,e);qd.assertTxConfigIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e&&!e.isEmpty())throw t((e=(0,VT.newError)("Driver is connected to the database that does not support transaction configuration. Please upgrade to neo4j 3.5.0 or later in order to use this functionality")).message),r.onError(e),e},qd.assertDatabaseIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e)throw t((e=(0,VT.newError)("Driver is connected to the database that does not support multiple databases. Please upgrade to neo4j 4.0.0 or later in order to use this functionality")).message),r.onError(e),e},qd.assertImpersonatedUserIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e)throw t((t=(0,VT.newError)("Driver is connected to the database that does not support user impersonation. Please upgrade to neo4j 4.4.0 or later in order to use this functionality. "+"Trying to impersonate ".concat(e,"."))).message),r.onError(t),t};Of={},k={},bb={},mb={};Object.defineProperty(mb,"__esModule",{value:!0}),mb.identity=void 0,mb.identity=function(e){return e};var HT=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),YT=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),wb=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&HT(t,e,r);return YT(t,e),t},Ib=(Object.defineProperty(bb,"__esModule",{value:!0}),bb.functional=void 0,bb.functional=wb(mb),{}),KT=(Object.defineProperty(Ib,"__esModule",{value:!0}),Ib.verifyStructSize=Ib.Structure=void 0,e),GT=KT.error.PROTOCOL_ERROR,uh=(Object.defineProperty(ZT.prototype,"size",{get:function(){return this.fields.length},enumerable:!1,configurable:!0}),ZT.prototype.toString=function(){for(var e="",t=0;t<this.fields.length;t++)0<t&&(e+=", "),e+=this.fields[t];return"Structure("+this.signature+", ["+e+"])"},ZT);function ZT(e,t){this.signature=e,this.fields=t}Ib.Structure=uh,Ib.verifyStructSize=function(e,t,r){if(t!==r)throw(0,KT.newError)("Wrong struct size for ".concat(e,", expected ").concat(t," but was ").concat(r),GT)},Ib.default=uh,Object.defineProperty(k,"__esModule",{value:!0}),k.Unpacker=k.Packer=void 0;var XT=fl,QT=bb,JT=Ib,$T=e,ej=$T.error.PROTOCOL_ERROR;function tj(e){this._ch=e,this._byteArraysSupported=!0}function rj(e,t){void 0===t&&(t=!1),this._disableLosslessIntegers=e=void 0===e?!1:e,this._useBigInt=t}tj.prototype.packable=function(o,i){var e,u=this;void 0===i&&(i=QT.functional.identity);try{o=i(o)}catch(e){return function(){throw e}}if(null===o)return function(){return u._ch.writeUInt8(192)};if(!0===o)return function(){return u._ch.writeUInt8(195)};if(!1===o)return function(){return u._ch.writeUInt8(194)};if("number"==typeof o)return function(){return u.packFloat(o)};if("string"==typeof o)return function(){return u.packString(o)};if("bigint"==typeof o)return function(){return u.packInteger((0,$T.int)(o))};if((0,$T.isInt)(o))return function(){return u.packInteger(o)};if(o instanceof Int8Array)return function(){return u.packBytes(o)};if(o instanceof Array)return function(){u.packListHeader(o.length);for(var e=0;e<o.length;e++)u.packable(void 0===o[e]?null:o[e],i)()};if(null!=(e=o)&&"function"==typeof e[Symbol.iterator])return this.packableIterable(o,i);if(o instanceof JT.Structure){for(var t=[],r=0;r<o.fields.length;r++)t[r]=this.packable(o.fields[r],i);return function(){return u.packStruct(o.signature,t)}}return"object"==typeof o?function(){for(var e=Object.keys(o),t=0,r=0;r<e.length;r++)void 0!==o[e[r]]&&t++;u.packMapHeader(t);for(r=0;r<e.length;r++){var n=e[r];void 0!==o[n]&&(u.packString(n),u.packable(o[n],i)())}}:this._nonPackableValue("Unable to pack the given value: ".concat(o))},tj.prototype.packableIterable=function(t,e){try{var r=Array.from(t);return this.packable(r,e)}catch(e){throw(0,$T.newError)("Cannot pack given iterable, ".concat(e.message,": ").concat(t))}},tj.prototype.packStruct=function(e,t){this.packStructHeader((t=t||[]).length,e);for(var r=0;r<t.length;r++)t[r]()},tj.prototype.packInteger=function(e){var t=e.high,r=e.low;e.greaterThanOrEqual(-16)&&e.lessThan(128)?this._ch.writeInt8(r):e.greaterThanOrEqual(-128)&&e.lessThan(-16)?(this._ch.writeUInt8(200),this._ch.writeInt8(r)):e.greaterThanOrEqual(-32768)&&e.lessThan(32768)?(this._ch.writeUInt8(201),this._ch.writeInt16(r)):(e.greaterThanOrEqual(-2147483648)&&e.lessThan(2147483648)?this._ch.writeUInt8(202):(this._ch.writeUInt8(203),this._ch.writeInt32(t)),this._ch.writeInt32(r))},tj.prototype.packFloat=function(e){this._ch.writeUInt8(193),this._ch.writeFloat64(e)},tj.prototype.packString=function(e){var e=XT.utf8.encode(e),t=e.length;if(t<16)this._ch.writeUInt8(128|t),this._ch.writeBytes(e);else if(t<256)this._ch.writeUInt8(208),this._ch.writeUInt8(t),this._ch.writeBytes(e);else if(t<65536)this._ch.writeUInt8(209),this._ch.writeUInt8(t/256>>0),this._ch.writeUInt8(t%256),this._ch.writeBytes(e);else{if(!(t<4294967296))throw(0,$T.newError)("UTF-8 strings of size "+t+" are not supported");this._ch.writeUInt8(210),this._ch.writeUInt8((t/16777216>>0)%256),this._ch.writeUInt8((t/65536>>0)%256),this._ch.writeUInt8((t/256>>0)%256),this._ch.writeUInt8(t%256),this._ch.writeBytes(e)}},tj.prototype.packListHeader=function(e){if(e<16)this._ch.writeUInt8(144|e);else if(e<256)this._ch.writeUInt8(212),this._ch.writeUInt8(e);else if(e<65536)this._ch.writeUInt8(213),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256);else{if(!(e<4294967296))throw(0,$T.newError)("Lists of size "+e+" are not supported");this._ch.writeUInt8(214),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},tj.prototype.packBytes=function(e){if(!this._byteArraysSupported)throw(0,$T.newError)("Byte arrays are not supported by the database this driver is connected to");this.packBytesHeader(e.length);for(var t=0;t<e.length;t++)this._ch.writeInt8(e[t])},tj.prototype.packBytesHeader=function(e){if(e<256)this._ch.writeUInt8(204),this._ch.writeUInt8(e);else if(e<65536)this._ch.writeUInt8(205),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256);else{if(!(e<4294967296))throw(0,$T.newError)("Byte arrays of size "+e+" are not supported");this._ch.writeUInt8(206),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},tj.prototype.packMapHeader=function(e){if(e<16)this._ch.writeUInt8(160|e);else if(e<256)this._ch.writeUInt8(216),this._ch.writeUInt8(e);else if(e<65536)this._ch.writeUInt8(217),this._ch.writeUInt8(e/256>>0),this._ch.writeUInt8(e%256);else{if(!(e<4294967296))throw(0,$T.newError)("Maps of size "+e+" are not supported");this._ch.writeUInt8(218),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},tj.prototype.packStructHeader=function(e,t){if(e<16)this._ch.writeUInt8(176|e),this._ch.writeUInt8(t);else if(e<256)this._ch.writeUInt8(220),this._ch.writeUInt8(e),this._ch.writeUInt8(t);else{if(!(e<65536))throw(0,$T.newError)("Structures of size "+e+" are not supported");this._ch.writeUInt8(221),this._ch.writeUInt8(e/256>>0),this._ch.writeUInt8(e%256)}},tj.prototype.disableByteArrays=function(){this._byteArraysSupported=!1},tj.prototype._nonPackableValue=function(e){return function(){throw(0,$T.newError)(e,ej)}},k.Packer=tj,rj.prototype.unpack=function(e,t){void 0===t&&(t=QT.functional.identity);var r=e.readUInt8(),n=240&r,o=15&r;if(192===r)return null;var i=this._unpackBoolean(r);if(null!==i)return i;i=this._unpackNumberOrInteger(r,e);if(null!==i){if((0,$T.isInt)(i)){if(this._useBigInt)return i.toBigInt();if(this._disableLosslessIntegers)return i.toNumberOrInfinity()}return i}i=this._unpackString(r,n,o,e);if(null!==i)return i;i=this._unpackList(r,n,o,e,t);if(null!==i)return i;i=this._unpackByteArray(r,e);if(null!==i)return i;i=this._unpackMap(r,n,o,e,t);if(null!==i)return i;i=this._unpackStruct(r,n,o,e,t);if(null!==i)return i;throw(0,$T.newError)("Unknown packed value with marker "+r.toString(16))},rj.prototype.unpackInteger=function(e){var t=e.readUInt8(),e=this._unpackInteger(t,e);if(null==e)throw(0,$T.newError)("Unable to unpack integer value with marker "+t.toString(16));return e},rj.prototype._unpackBoolean=function(e){return 195===e||194!==e&&null},rj.prototype._unpackNumberOrInteger=function(e,t){return 193===e?t.readFloat64():this._unpackInteger(e,t)},rj.prototype._unpackInteger=function(e,t){var r;return 0<=e&&e<128?(0,$T.int)(e):240<=e&&e<256?(0,$T.int)(e-256):200===e?(0,$T.int)(t.readInt8()):201===e?(0,$T.int)(t.readInt16()):202===e?(r=t.readInt32(),(0,$T.int)(r)):203===e?(r=t.readInt32(),e=t.readInt32(),new $T.Integer(e,r)):null},rj.prototype._unpackString=function(e,t,r,n){return 128===t?XT.utf8.decode(n,r):208===e?XT.utf8.decode(n,n.readUInt8()):209===e?XT.utf8.decode(n,n.readUInt16()):210===e?XT.utf8.decode(n,n.readUInt32()):null},rj.prototype._unpackList=function(e,t,r,n,o){return 144===t?this._unpackListWithSize(r,n,o):212===e?this._unpackListWithSize(n.readUInt8(),n,o):213===e?this._unpackListWithSize(n.readUInt16(),n,o):214===e?this._unpackListWithSize(n.readUInt32(),n,o):null},rj.prototype._unpackListWithSize=function(e,t,r){for(var n=[],o=0;o<e;o++)n.push(this.unpack(t,r));return n},rj.prototype._unpackByteArray=function(e,t){return 204===e?this._unpackByteArrayWithSize(t.readUInt8(),t):205===e?this._unpackByteArrayWithSize(t.readUInt16(),t):206===e?this._unpackByteArrayWithSize(t.readUInt32(),t):null},rj.prototype._unpackByteArrayWithSize=function(e,t){for(var r=new Int8Array(e),n=0;n<e;n++)r[n]=t.readInt8();return r},rj.prototype._unpackMap=function(e,t,r,n,o){return 160===t?this._unpackMapWithSize(r,n,o):216===e?this._unpackMapWithSize(n.readUInt8(),n,o):217===e?this._unpackMapWithSize(n.readUInt16(),n,o):218===e?this._unpackMapWithSize(n.readUInt32(),n,o):null},rj.prototype._unpackMapWithSize=function(e,t,r){for(var n={},o=0;o<e;o++)n[this.unpack(t,r)]=this.unpack(t,r);return n},rj.prototype._unpackStruct=function(e,t,r,n,o){return 176===t?this._unpackStructWithSize(r,n,o):220===e?this._unpackStructWithSize(n.readUInt8(),n,o):221===e?this._unpackStructWithSize(n.readUInt16(),n,o):null},rj.prototype._unpackStructWithSize=function(e,t,r){for(var n=t.readUInt8(),o=new JT.Structure(n,[]),i=0;i<e;i++)o.fields.push(this.unpack(t,r));return r(o)},k.Unpacker=rj;var nj,oj,Nb={},Lb=r&&r.__extends||(nj=function(e,t){return(nj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}nj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ij=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),uj=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fc=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ij(t,e,r);return uj(t,e),t},lh=(Object.defineProperty(Nb,"__esModule",{value:!0}),Nb.Unpacker=Nb.Packer=void 0,fc(k)),Xb=(oj=lh.Packer,Lb(aj,oj),aj.prototype.disableByteArrays=function(){throw new Error("Bolt V2 should always support byte arrays")},aj);function aj(){return null!==oj&&oj.apply(this,arguments)||this}Nb.Packer=Xb;sj=lh.Unpacker,Lb(cj,sj);var sj,ey=cj;function cj(e,t){return sj.call(this,e=void 0===e?!1:e,t=void 0===t?!1:t)||this}Nb.Unpacker=ey;var lj=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),fj=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ly=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&lj(t,e,r);return fj(t,e),t},Gc=(Object.defineProperty(Of,"__esModule",{value:!0}),Of.structure=Of.v2=Of.v1=void 0,ly(k)),ny=(Of.v1=Gc,ly(Nb)),Zc=(Of.v2=ny,ly(Ib)),oy=(Of.structure=Zc,Of.default=ny,{}),pj=(Object.defineProperty(oy,"__esModule",{value:!0}),e),ay=pj.internal.constants,dj=ay.ACCESS_MODE_READ,hj=ay.FETCH_ALL,bj=pj.internal.util.assertString,Xc=(yj.init=function(e,t){return new yj(1,[e,t],function(){return"INIT ".concat(e," {...}")})},yj.run=function(e,t){return new yj(16,[e,t],function(){return"RUN ".concat(e," ").concat(pj.json.stringify(t))})},yj.pullAll=function(){return mj},yj.reset=function(){return gj},yj.hello=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);t=Object.assign({user_agent:e},t);return r&&(t.routing=r),n&&(t.patch_bolt=n),new yj(1,[t],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},yj.begin=function(e){var e=void 0===e?{}:e,t=_j(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser);return new yj(17,[t],function(){return"BEGIN ".concat(pj.json.stringify(t))})},yj.commit=function(){return Oj},yj.rollback=function(){return wj},yj.runWithMetadata=function(e,t,r){var r=void 0===r?{}:r,n=_j(r.bookmarks,r.txConfig,r.database,r.mode,r.impersonatedUser);return new yj(16,[e,t,n],function(){return"RUN ".concat(e," ").concat(pj.json.stringify(t)," ").concat(pj.json.stringify(n))})},yj.goodbye=function(){return Ej},yj.pull=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=vj(null==t?-1:t,(void 0===e?hj:e)||hj);return new yj(63,[r],function(){return"PULL ".concat(pj.json.stringify(r))})},yj.discard=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=vj(null==t?-1:t,(void 0===e?hj:e)||hj);return new yj(47,[r],function(){return"DISCARD ".concat(pj.json.stringify(r))})},yj.route=function(e,t,r){return new yj(102,[e=void 0===e?{}:e,t=void 0===t?[]:t,r=void 0===r?null:r],function(){return"ROUTE ".concat(pj.json.stringify(e)," ").concat(pj.json.stringify(t)," ").concat(r)})},yj.routeV4x4=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t=[]);var n={};return(r=void 0===r?{}:r).databaseName&&(n.db=r.databaseName),r.impersonatedUser&&(n.imp_user=r.impersonatedUser),new yj(102,[e,t,n],function(){return"ROUTE ".concat(pj.json.stringify(e)," ").concat(pj.json.stringify(t)," ").concat(pj.json.stringify(n))})},yj);function yj(e,t,r){this.signature=e,this.fields=t,this.toString=r}function _j(e,t,r,n,o){var i={};return e.isEmpty()||(i.bookmarks=e.values()),null!==t.timeout&&(i.tx_timeout=t.timeout),t.metadata&&(i.tx_metadata=t.metadata),r&&(i.db=bj(r,"database")),o&&(i.imp_user=bj(o,"impersonatedUser")),n===dj&&(i.mode="r"),i}function vj(e,t){t={n:(0,pj.int)(t)};return-1!==e&&(t.qid=(0,pj.int)(e)),t}var mj=new(oy.default=Xc)(63,[],function(){return"PULL_ALL"}),gj=new Xc(15,[],function(){return"RESET"}),Oj=new Xc(18,[],function(){return"COMMIT"}),wj=new Xc(19,[],function(){return"ROLLBACK"}),Ej=new Xc(2,[],function(){return"GOODBYE"}),Oy={},Py={},Pj=(Object.defineProperty(Py,"__esModule",{value:!0}),Py.TypeTransformer=void 0,Of),Sj=e.internal.objectUtil;function Tj(e){this._transformers=e,this._transformersPerSignature=new Map(e.map(function(e){return[e.signature,e]})),this.fromStructure=this.fromStructure.bind(this),this.toStructure=this.toStructure.bind(this),Object.freeze(this)}function jj(e){var t=e.signature,r=e.fromStructure,n=e.toStructure,e=e.isTypeInstance;this.signature=t,this.isTypeInstance=e,this.fromStructure=r,this.toStructure=n,Object.freeze(this)}Tj.prototype.fromStructure=function(e){try{return e instanceof Pj.structure.Structure&&this._transformersPerSignature.has(e.signature)?(0,this._transformersPerSignature.get(e.signature).fromStructure)(e):e}catch(e){return Sj.createBrokenObject(e)}},Tj.prototype.toStructure=function(t){var e=this._transformers.find(function(e){return(0,e.isTypeInstance)(t)});return void 0!==e?e.toStructure(t):t},Py.default=Tj,jj.prototype.extendsWith=function(e){var t=e.signature,r=e.fromStructure,n=e.toStructure,e=e.isTypeInstance;return new jj({signature:t||this.signature,fromStructure:r||this.fromStructure,toStructure:n||this.toStructure,isTypeInstance:e||this.isTypeInstance})},Py.TypeTransformer=jj;var Cj=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ij=(Object.defineProperty(Oy,"__esModule",{value:!0}),e),Rj=Of,kj=Py,Aj=Ij.error.PROTOCOL_ERROR;Oy.default={createNodeTransformer:function(){return new kj.TypeTransformer({signature:78,isTypeInstance:function(e){return e instanceof Ij.Node},toStructure:function(e){throw(0,Ij.newError)("It is not allowed to pass nodes in query parameters, given: ".concat(e),Aj)},fromStructure:function(e){Rj.structure.verifyStructSize("Node",3,e.size);var e=Cj(e.fields,3),t=e[0],r=e[1],e=e[2];return new Ij.Node(t,r,e)}})},createRelationshipTransformer:function(){return new kj.TypeTransformer({signature:82,isTypeInstance:function(e){return e instanceof Ij.Relationship},toStructure:function(e){throw(0,Ij.newError)("It is not allowed to pass relationships in query parameters, given: ".concat(e),Aj)},fromStructure:function(e){Rj.structure.verifyStructSize("Relationship",5,e.size);var e=Cj(e.fields,5),t=e[0],r=e[1],n=e[2],o=e[3],e=e[4];return new Ij.Relationship(t,r,n,o,e)}})},createUnboundRelationshipTransformer:function(){return new kj.TypeTransformer({signature:114,isTypeInstance:function(e){return e instanceof Ij.UnboundRelationship},toStructure:function(e){throw(0,Ij.newError)("It is not allowed to pass unbound relationships in query parameters, given: ".concat(e),Aj)},fromStructure:function(e){Rj.structure.verifyStructSize("UnboundRelationship",3,e.size);var e=Cj(e.fields,3),t=e[0],r=e[1],e=e[2];return new Ij.UnboundRelationship(t,r,e)}})},createPathTransformer:function(){return new kj.TypeTransformer({signature:80,isTypeInstance:function(e){return e instanceof Ij.Path},toStructure:function(e){throw(0,Ij.newError)("It is not allowed to pass paths in query parameters, given: ".concat(e),Aj)},fromStructure:function(e){Rj.structure.verifyStructSize("Path",3,e.size);for(var e=Cj(e.fields,3),t=e[0],r=e[1],n=e[2],o=[],i=t[0],u=0;u<n.length;u+=2){var a=t[n[u+1]],s=(0,Ij.toNumber)(n[u]),c=void 0;0<s?(c=r[s-1])instanceof Ij.UnboundRelationship&&(r[s-1]=c=c.bindTo(i,a)):(c=r[-s-1])instanceof Ij.UnboundRelationship&&(r[-s-1]=c=c.bindTo(a,i)),o.push(new Ij.PathSegment(i,c,a)),i=a}return new Ij.Path(t[0],t[t.length-1],o)}})}};var u=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Mj=(Object.defineProperty(Nd,"__esModule",{value:!0}),qd),xj=Of,Nj=u(oy),Uj=R,Cy=e,Dj=u(Oy),Lj=u(Py),Bj=Cy.internal.bookmarks.Bookmarks,xy=Cy.internal.constants,Fj=xy.ACCESS_MODE_WRITE,Wj=xy.BOLT_PROTOCOL_V1,zj=(Cy.internal.logger.Logger,Cy.internal.txConfig.TxConfig),m=(Object.defineProperty(qj.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Lj.default(Object.values(Dj.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(qj.prototype,"version",{get:function(){return Wj},enumerable:!1,configurable:!0}),qj.prototype.packer=function(){return this._packer},qj.prototype.packable=function(e){return this._packer.packable(e,this.transformer.toStructure)},qj.prototype.unpacker=function(){return this._unpacker},qj.prototype.unpack=function(e){return this._unpacker.unpack(e,this.transformer.fromStructure)},qj.prototype.transformMetadata=function(e){return e},qj.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new Uj.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return t._onLoginCompleted(e,i)}});return this.write(Nj.default.init(r,n),e,!0),e},qj.prototype.prepareToClose=function(){},qj.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,u=e.beforeError,a=e.afterError,s=e.beforeComplete,e=e.afterComplete;return this.run("BEGIN",t?t.asBeginTransactionParameters():{},{bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,beforeError:u,afterError:a,beforeComplete:s,afterComplete:e,flush:!1})},qj.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete;return this.run("COMMIT",{},{bookmarks:Bj.empty(),txConfig:zj.empty(),mode:Fj,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},qj.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete;return this.run("ROLLBACK",{},{bookmarks:Bj.empty(),txConfig:zj.empty(),mode:Fj,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},qj.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=(r.bookmarks,r.txConfig),o=r.database,i=(r.mode,r.impersonatedUser),u=r.beforeKeys,a=r.afterKeys,s=r.beforeError,c=r.afterError,l=r.beforeComplete,f=r.afterComplete,p=r.flush,p=void 0===p||p,d=r.highRecordWatermark,d=void 0===d?Number.MAX_VALUE:d,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,u=new Uj.ResultStreamObserver({server:this._server,beforeKeys:u,afterKeys:a,beforeError:s,afterError:c,beforeComplete:l,afterComplete:f,highRecordWatermark:d,lowRecordWatermark:r});return(0,Mj.assertTxConfigIsEmpty)(n,this._onProtocolError,u),(0,Mj.assertDatabaseIsEmpty)(o,this._onProtocolError,u),(0,Mj.assertImpersonatedUserIsEmpty)(i,this._onProtocolError,u),this.write(Nj.default.run(e,t),u,!1),this.write(Nj.default.pullAll(),u,p),u},Object.defineProperty(qj.prototype,"currentFailure",{get:function(){return this._responseHandler.currentFailure},enumerable:!1,configurable:!0}),qj.prototype.reset=function(e){var e=void 0===e?{}:e,t=e.onError,e=e.onComplete,t=new Uj.ResetObserver({onProtocolError:this._onProtocolError,onError:t,onComplete:e});return this.write(Nj.default.reset(),t,!0),t},qj.prototype._createPacker=function(e){return new xj.v1.Packer(e)},qj.prototype._createUnpacker=function(e,t){return new xj.v1.Unpacker(e,t)},qj.prototype.write=function(e,t,r){this.queueObserverIfProtocolIsNotBroken(t)&&(this._log.isDebugEnabled()&&this._log.debug("C: ".concat(e)),this._lastMessageSignature=e.signature,t=new xj.structure.Structure(e.signature,e.fields),this.packable(t)(),this._chunker.messageBoundary(),r&&this._chunker.flush())},qj.prototype.isLastMessageLogin=function(){return 1===this._lastMessageSignature},qj.prototype.isLastMessageReset=function(){return 15===this._lastMessageSignature},qj.prototype.notifyFatalError=function(e){return this._fatalError=e,this._responseHandler._notifyErrorToObservers(e)},qj.prototype.updateCurrentObserver=function(){return this._responseHandler._updateCurrentObserver()},qj.prototype.hasOngoingObservableRequests=function(){return this._responseHandler.hasOngoingObservableRequests()},qj.prototype.queueObserverIfProtocolIsNotBroken=function(e){return this.isBroken()?(this.notifyFatalErrorToObserver(e),!1):this._responseHandler._queueObserver(e)},qj.prototype.isBroken=function(){return!!this._fatalError},qj.prototype.notifyFatalErrorToObserver=function(e){e&&e.onError&&e.onError(this._fatalError)},qj.prototype.resetFailure=function(){this._responseHandler._resetFailure()},qj.prototype._onLoginCompleted=function(e,t){var r;e&&(r=e.server,this._server.version||(this._server.version=r)),t&&t(e)},qj.prototype._onLoginError=function(e,t){this._onProtocolError(e.message),t&&t(e)},qj);function qj(e,t,r,n,o,i){var r=void 0===r?{}:r,u=r.disableLosslessIntegers,r=r.useBigInt;void 0===n&&(n=function(){return null}),this._server=e||{},this._chunker=t,this._packer=this._createPacker(t),this._unpacker=this._createUnpacker(u,r),this._responseHandler=n(this),this._log=o,this._onProtocolError=i,this._fatalError=null,this._lastMessageSignature=null,this._config={disableLosslessIntegers:u,useBigInt:r}}Nd.default=m;var Dy={},By={},qy={},Vj=(Object.defineProperty(qy,"__esModule",{value:!0}),qy.epochSecondAndNanoToLocalDateTime=qy.nanoOfDayToLocalTime=qy.epochDayToDate=void 0,e),Yy=Vj.internal.temporalUtil,Hj=Yy.DAYS_0000_TO_1970,Yj=Yy.DAYS_PER_400_YEAR_CYCLE,Kj=Yy.NANOS_PER_HOUR,Gj=Yy.NANOS_PER_MINUTE,Zj=Yy.NANOS_PER_SECOND,Xj=Yy.SECONDS_PER_DAY,Qj=Yy.floorDiv,Jj=Yy.floorMod;function $j(e){var e=(e=(0,Vj.int)(e)).add(Hj).subtract(60),t=(0,Vj.int)(0),r=(e.lessThan(0)&&(t=(r=e.add(1).div(Yj).subtract(1)).multiply(400),e=e.add(r.multiply(-Yj))),e.multiply(400).add(591).div(Yj)),n=e.subtract(r.multiply(365).add(r.div(4)).subtract(r.div(100)).add(r.div(400))),e=(n.lessThan(0)&&(r=r.subtract(1),n=e.subtract(r.multiply(365).add(r.div(4)).subtract(r.div(100)).add(r.div(400)))),r=r.add(t),n),t=e.multiply(5).add(2).div(153),n=t.add(2).modulo(12).add(1),e=e.subtract(t.multiply(306).add(5).div(10)).add(1),r=r.add(t.div(10));return new Vj.Date(r,n,e)}function eC(e){var t=(e=(0,Vj.int)(e)).div(Kj),r=(e=e.subtract(t.multiply(Kj))).div(Gj),n=(e=e.subtract(r.multiply(Gj))).div(Zj),e=e.subtract(n.multiply(Zj));return new Vj.LocalTime(t,r,n,e)}qy.epochDayToDate=$j,qy.nanoOfDayToLocalTime=eC,qy.epochSecondAndNanoToLocalDateTime=function(e,t){var r=Qj(e,Xj),e=Jj(e,Xj).multiply(Zj).add(t),t=$j(r),r=eC(e);return new Vj.LocalDateTime(t.year,t.month,t.day,r.hour,r.minute,r.second,r.nanosecond)};var tC=r&&r.__assign||function(){return(tC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},rC=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Zy=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nC=(Object.defineProperty(By,"__esModule",{value:!0}),e),oC=Of,iC=Py,uC=qy,h=Zy(Oy),$y=nC.internal.temporalUtil,aC=$y.dateToEpochDay,sC=$y.localDateTimeToEpochSecond,cC=$y.localTimeToNanoOfDay;function lC(e,t,r){if(!t&&!r)return e;var n,o,i,u=Object.create(Object.getPrototypeOf(e));for(n in e)!0===Object.prototype.hasOwnProperty.call(e,n)&&(o=e[n],u[n]=(0,nC.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}By.default=tC(tC({},h.default),{createPoint2DTransformer:function(){return new iC.TypeTransformer({signature:88,isTypeInstance:function(e){return(0,nC.isPoint)(e)&&(null===e.z||void 0===e.z)},toStructure:function(e){return new oC.structure.Structure(88,[(0,nC.int)(e.srid),e.x,e.y])},fromStructure:function(e){oC.structure.verifyStructSize("Point2D",3,e.size);var e=rC(e.fields,3),t=e[0],r=e[1],e=e[2];return new nC.Point(t,r,e,void 0)}})},createPoint3DTransformer:function(){return new iC.TypeTransformer({signature:89,isTypeInstance:function(e){return(0,nC.isPoint)(e)&&null!==e.z&&void 0!==e.z},toStructure:function(e){return new oC.structure.Structure(89,[(0,nC.int)(e.srid),e.x,e.y,e.z])},fromStructure:function(e){oC.structure.verifyStructSize("Point3D",4,e.size);var e=rC(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new nC.Point(t,r,n,e)}})},createDurationTransformer:function(){return new iC.TypeTransformer({signature:69,isTypeInstance:nC.isDuration,toStructure:function(e){var t=(0,nC.int)(e.months),r=(0,nC.int)(e.days),n=(0,nC.int)(e.seconds),e=(0,nC.int)(e.nanoseconds);return new oC.structure.Structure(69,[t,r,n,e])},fromStructure:function(e){oC.structure.verifyStructSize("Duration",4,e.size);var e=rC(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new nC.Duration(t,r,n,e)}})},createLocalTimeTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new iC.TypeTransformer({signature:116,isTypeInstance:nC.isLocalTime,toStructure:function(e){e=cC(e.hour,e.minute,e.second,e.nanosecond);return new oC.structure.Structure(116,[e])},fromStructure:function(e){oC.structure.verifyStructSize("LocalTime",1,e.size);e=rC(e.fields,1)[0];return lC((0,uC.nanoOfDayToLocalTime)(e),t,r)}})},createTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new iC.TypeTransformer({signature:84,isTypeInstance:nC.isTime,toStructure:function(e){var t=cC(e.hour,e.minute,e.second,e.nanosecond),e=(0,nC.int)(e.timeZoneOffsetSeconds);return new oC.structure.Structure(84,[t,e])},fromStructure:function(e){oC.structure.verifyStructSize("Time",2,e.size);var e=rC(e.fields,2),t=e[0],e=e[1],t=(0,uC.nanoOfDayToLocalTime)(t);return lC(new nC.Time(t.hour,t.minute,t.second,t.nanosecond,e),r,n)}})},createDateTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new iC.TypeTransformer({signature:68,isTypeInstance:nC.isDate,toStructure:function(e){e=aC(e.year,e.month,e.day);return new oC.structure.Structure(68,[e])},fromStructure:function(e){oC.structure.verifyStructSize("Date",1,e.size);e=rC(e.fields,1)[0];return lC((0,uC.epochDayToDate)(e),t,r)}})},createLocalDateTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new iC.TypeTransformer({signature:100,isTypeInstance:nC.isLocalDateTime,toStructure:function(e){var t=sC(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),e=(0,nC.int)(e.nanosecond);return new oC.structure.Structure(100,[t,e])},fromStructure:function(e){oC.structure.verifyStructSize("LocalDateTime",2,e.size);var e=rC(e.fields,2),t=e[0],e=e[1];return lC((0,uC.epochSecondAndNanoToLocalDateTime)(t,e),r,n)}})},createDateTimeWithZoneIdTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new iC.TypeTransformer({signature:102,isTypeInstance:function(e){return(0,nC.isDateTime)(e)&&null!=e.timeZoneId},toStructure:function(e){var t=sC(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,nC.int)(e.nanosecond),e=e.timeZoneId;return new oC.structure.Structure(102,[t,r,e])},fromStructure:function(e){oC.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=rC(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,uC.epochSecondAndNanoToLocalDateTime)(t,r);return lC(new nC.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,null,e),n,o)}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new iC.TypeTransformer({signature:70,isTypeInstance:function(e){return(0,nC.isDateTime)(e)&&null==e.timeZoneId},toStructure:function(e){var t=sC(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,nC.int)(e.nanosecond),e=(0,nC.int)(e.timeZoneOffsetSeconds);return new oC.structure.Structure(70,[t,r,e])},fromStructure:function(e){oC.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=rC(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,uC.epochSecondAndNanoToLocalDateTime)(t,r);return lC(new nC.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}});var fC,pC,qp=r&&r.__extends||(fC=function(e,t){return(fC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},f_=(Object.defineProperty(Dy,"__esModule",{value:!0}),i_(Nd)),dC=i_(Of),y_=e,hC=i_(By),bC=i_(Py),yC=y_.internal.constants.BOLT_PROTOCOL_V2,w_=(pC=f_.default,qp(_C,pC),_C.prototype._createPacker=function(e){return new dC.default.Packer(e)},_C.prototype._createUnpacker=function(e,t){return new dC.default.Unpacker(e,t)},Object.defineProperty(_C.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new bC.default(Object.values(hC.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(_C.prototype,"version",{get:function(){return yC},enumerable:!1,configurable:!0}),_C);function _C(){return null!==pC&&pC.apply(this,arguments)||this}Dy.default=w_;var vC,mC,o={},j_={},gC=r&&r.__assign||function(){return(gC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},A_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},U_=(Object.defineProperty(j_,"__esModule",{value:!0}),A_(By)),Vp=(j_.default=gC({},U_.default),r&&r.__extends||(vC=function(e,t){return(vC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}vC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),OC=r&&r.__assign||function(){return(OC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},q_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Q_=(Object.defineProperty(o,"__esModule",{value:!0}),q_(Dy)),wC=q_(oy),EC=qd,PC=R,SC=q_(j_),TC=q_(Py),jC=(e.internal.bookmarks.Bookmarks,e.internal.constants.BOLT_PROTOCOL_V3),CC=e.internal.txConfig.TxConfig,IC="context",RC="CALL dbms.cluster.routing.getRoutingTable($".concat(IC,")"),kC=new PC.StreamObserver,ev=(mC=Q_.default,Vp(AC,mC),Object.defineProperty(AC.prototype,"version",{get:function(){return jC},enumerable:!1,configurable:!0}),Object.defineProperty(AC.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new TC.default(Object.values(SC.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),AC.prototype.transformMetadata=function(e){return"t_first"in e&&(e.result_available_after=e.t_first,delete e.t_first),"t_last"in e&&(e.result_consumed_after=e.t_last,delete e.t_last),e},AC.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new PC.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return t._onLoginCompleted(e,i)}});return this.write(wC.default.hello(r,n),e,!0),e},AC.prototype.prepareToClose=function(){this.write(wC.default.goodbye(),kC,!0)},AC.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.mode,u=e.beforeError,a=e.afterError,s=e.beforeComplete,e=e.afterComplete,u=new PC.ResultStreamObserver({server:this._server,beforeError:u,afterError:a,beforeComplete:s,afterComplete:e});return u.prepareToHandleSingleResponse(),(0,EC.assertDatabaseIsEmpty)(n,this._onProtocolError,u),(0,EC.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,u),this.write(wC.default.begin({bookmarks:t,txConfig:r,mode:i}),u,!0),u},AC.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete,t=new PC.ResultStreamObserver({server:this._server,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e});return t.prepareToHandleSingleResponse(),this.write(wC.default.commit(),t,!0),t},AC.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete,t=new PC.ResultStreamObserver({server:this._server,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e});return t.prepareToHandleSingleResponse(),this.write(wC.default.rollback(),t,!0),t},AC.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.impersonatedUser,a=r.mode,s=r.beforeKeys,c=r.afterKeys,l=r.beforeError,f=r.afterError,p=r.beforeComplete,d=r.afterComplete,h=r.flush,h=void 0===h||h,b=r.highRecordWatermark,b=void 0===b?Number.MAX_VALUE:b,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,s=new PC.ResultStreamObserver({server:this._server,beforeKeys:s,afterKeys:c,beforeError:l,afterError:f,beforeComplete:p,afterComplete:d,highRecordWatermark:b,lowRecordWatermark:r});return(0,EC.assertDatabaseIsEmpty)(i,this._onProtocolError,s),(0,EC.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,s),this.write(wC.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,mode:a}),s,!1),this.write(wC.default.pullAll(),s,h),s},AC.prototype.requestRoutingInformation=function(e){var t,r=e.routingContext,n=e.sessionContext,n=void 0===n?{}:n,o=e.onError,e=e.onCompleted,r=this.run(RC,((t={})[IC]=void 0===r?{}:r,t),OC(OC({},n),{txConfig:CC.empty()}));return new PC.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:o,onCompleted:e})},AC);function AC(){return null!==mC&&mC.apply(this,arguments)||this}o.default=ev;var MC,xC,uv={},sv={},NC=r&&r.__assign||function(){return(NC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},pv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_v=(Object.defineProperty(sv,"__esModule",{value:!0}),pv(j_)),gv=(sv.default=NC({},_v.default),r&&r.__extends||(MC=function(e,t){return(MC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}MC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),UC=r&&r.__assign||function(){return(UC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},is=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Pv=(Object.defineProperty(uv,"__esModule",{value:!0}),is(o)),DC=is(oy),LC=qd,BC=R,FC=is(sv),WC=is(Py),Sv=(e.internal.bookmarks.Bookmarks,e.internal.constants),zC=Sv.BOLT_PROTOCOL_V4_0,qC=Sv.FETCH_ALL,VC=e.internal.txConfig.TxConfig,HC="context",YC="database",KC="CALL dbms.routing.getRoutingTable($".concat(HC,", $").concat(YC,")"),kv=(xC=Pv.default,gv(GC,xC),Object.defineProperty(GC.prototype,"version",{get:function(){return zC},enumerable:!1,configurable:!0}),Object.defineProperty(GC.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new WC.default(Object.values(FC.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),GC.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.mode,u=e.beforeError,a=e.afterError,s=e.beforeComplete,e=e.afterComplete,u=new BC.ResultStreamObserver({server:this._server,beforeError:u,afterError:a,beforeComplete:s,afterComplete:e});return u.prepareToHandleSingleResponse(),(0,LC.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,u),this.write(DC.default.begin({bookmarks:t,txConfig:r,database:n,mode:i}),u,!0),u},GC.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.impersonatedUser,a=r.mode,s=r.beforeKeys,c=r.afterKeys,l=r.beforeError,f=r.afterError,p=r.beforeComplete,d=r.afterComplete,h=r.flush,h=void 0===h||h,b=r.reactive,b=void 0!==b&&b,y=r.fetchSize,y=void 0===y?qC:y,_=r.highRecordWatermark,_=void 0===_?Number.MAX_VALUE:_,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,s=new BC.ResultStreamObserver({server:this._server,reactive:b,fetchSize:y,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:s,afterKeys:c,beforeError:l,afterError:f,beforeComplete:p,afterComplete:d,highRecordWatermark:_,lowRecordWatermark:r}),c=((0,LC.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,s),b);return this.write(DC.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:a}),s,c&&h),b||this.write(DC.default.pull({n:y}),s,h),s},GC.prototype._requestMore=function(e,t,r){this.write(DC.default.pull({stmtId:e,n:t}),r,!0)},GC.prototype._requestDiscard=function(e,t){this.write(DC.default.discard({stmtId:e}),t,!0)},GC.prototype._noOp=function(){},GC.prototype.requestRoutingInformation=function(e){var t,r=e.routingContext,n=e.databaseName,n=void 0===n?null:n,o=e.sessionContext,o=void 0===o?{}:o,i=e.onError,e=e.onCompleted,r=this.run(KC,((t={})[HC]=void 0===r?{}:r,t[YC]=n,t),UC(UC({},o),{txConfig:VC.empty()}));return new BC.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:i,onCompleted:e})},GC);function GC(){return null!==xC&&xC.apply(this,arguments)||this}uv.default=kv;var ZC,XC,xv={},rh={},QC=r&&r.__assign||function(){return(QC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Bb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Dv=(Object.defineProperty(rh,"__esModule",{value:!0}),Bb(sv)),zv=(rh.default=QC({},Dv.default),r&&r.__extends||(ZC=function(e,t){return(ZC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ZC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Hv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},E=(Object.defineProperty(xv,"__esModule",{value:!0}),Hv(uv)),JC=Hv(oy),$C=R,em=e,eI=Hv(rh),tI=Hv(Py),rI=em.internal.constants.BOLT_PROTOCOL_V4_1,Lh=(XC=E.default,zv(nI,XC),Object.defineProperty(nI.prototype,"version",{get:function(){return rI},enumerable:!1,configurable:!0}),Object.defineProperty(nI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new tI.default(Object.values(eI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),nI.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new $C.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return t._onLoginCompleted(e,i)}});return this.write(JC.default.hello(r,n,this._serversideRouting),e,!0),e},nI);function nI(e,t,r,n,o,i,u){e=XC.call(this,e,t,r,n=void 0===n?function(){return null}:n,o,i)||this;return e._serversideRouting=u,e}xv.default=Lh;var oI,iI,om={},Ia={},uI=r&&r.__assign||function(){return(uI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},cm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hs=(Object.defineProperty(Ia,"__esModule",{value:!0}),cm(rh)),zp=(Ia.default=uI({},hs.default),r&&r.__extends||(oI=function(e,t){return(oI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}oI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),v=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gm=(Object.defineProperty(om,"__esModule",{value:!0}),v(xv)),Sm=e,aI=v(Ia),sI=v(Py),cI=Sm.internal.constants.BOLT_PROTOCOL_V4_2,ts=(iI=gm.default,zp(lI,iI),Object.defineProperty(lI.prototype,"version",{get:function(){return cI},enumerable:!1,configurable:!0}),Object.defineProperty(lI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new sI.default(Object.values(aI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),lI);function lI(){return null!==iI&&iI.apply(this,arguments)||this}om.default=ts;var X={},Ym={},fI=r&&r.__assign||function(){return(fI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},T=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},y=(Object.defineProperty(Ym,"__esModule",{value:!0}),T(Ia)),C=(Ym.default=fI({},y.default),{}),p={},pI=r&&r.__assign||function(){return(pI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ji=(Object.defineProperty(p,"__esModule",{value:!0}),g(Ym)),dI=(p.default=pI({},Ji.default),r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}),ir=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hI=(Object.defineProperty(C,"__esModule",{value:!0}),Of),bI=e,yI=ir(p),_I=qy,vI=mb,mI=bI.internal.temporalUtil.localDateTimeToEpochSecond;function gI(e,t,r){e=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,era:"narrow"}),r=(0,bI.int)(t).multiply(1e3).add((0,bI.int)(r).div(1e6)).toNumber(),e=e.formatToParts(r).reduce(function(e,t){return"era"===t.type?e.adjustEra="B"===t.value.toUpperCase()?function(e){return e.subtract(1).negate()}:vI.identity:"literal"!==t.type&&(e[t.type]=(0,bI.int)(t.value)),e},{}),e.year=e.adjustEra(e.year),r=mI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond);return e.timeZoneOffsetSeconds=r.subtract(t),e.hour=e.hour.modulo(24),e}function OI(e,t,r){if(!t&&!r)return e;var n,o,i,u=Object.create(Object.getPrototypeOf(e));for(n in e)!0===Object.prototype.hasOwnProperty.call(e,n)&&(o=e[n],u[n]=(0,bI.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}C.default={createDateTimeWithZoneIdTransformer:function(e,u){var n=e.disableLosslessIntegers,o=e.useBigInt;return yI.default.createDateTimeWithZoneIdTransformer(e).extendsWith({signature:105,fromStructure:function(e){hI.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=dI(e.fields,3),t=e[0],r=e[1],e=e[2],t=gI(e,t,r);return OI(new bI.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,(0,bI.int)(r),t.timeZoneOffsetSeconds,e),n,o)},toStructure:function(e){var t=mI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=null!=e.timeZoneOffsetSeconds?e.timeZoneOffsetSeconds:(r=e.timeZoneId,i=t,o=e.nanosecond,n=gI(r,i,o),n=mI(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i),i=i.subtract(n),n=gI(r,i,o),mI(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i)),n=(null==e.timeZoneOffsetSeconds&&u.warn('DateTime objects without "timeZoneOffsetSeconds" property are prune to bugs related to ambiguous times. For instance, 2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.'),t.subtract(r)),o=(0,bI.int)(e.nanosecond),i=e.timeZoneId;return new hI.structure.Structure(105,[n,o,i])}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return yI.default.createDateTimeWithOffsetTransformer(e).extendsWith({signature:73,toStructure:function(e){var t=mI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,bI.int)(e.nanosecond),e=(0,bI.int)(e.timeZoneOffsetSeconds),t=t.subtract(e);return new hI.structure.Structure(73,[t,r,e])},fromStructure:function(e){hI.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=dI(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,bI.int)(t).add(e),t=(0,_I.epochSecondAndNanoToLocalDateTime)(t,r);return OI(new bI.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}};var wI,EI,a=r&&r.__extends||(wI=function(e,t){return(wI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}wI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),PI=r&&r.__assign||function(){return(PI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Cu=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ru=(Object.defineProperty(X,"__esModule",{value:!0}),Cu(om)),SI=Cu(oy),TI=R,jI=Cu(Ym),CI=Cu(C),II=Cu(Py),RI=e.internal.bookmarks.Bookmarks,kI=e.internal.constants.BOLT_PROTOCOL_V4_3,zu=(EI=ru.default,a(AI,EI),Object.defineProperty(AI.prototype,"version",{get:function(){return kI},enumerable:!1,configurable:!0}),Object.defineProperty(AI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new II.default(Object.values(jI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),AI.prototype.requestRoutingInformation=function(e){var t=e.routingContext,t=void 0===t?{}:t,r=e.databaseName,r=void 0===r?null:r,n=e.sessionContext,n=void 0===n?{}:n,o=e.onError,e=e.onCompleted,o=new TI.RouteObserver({onProtocolError:this._onProtocolError,onError:o,onCompleted:e}),e=n.bookmarks||RI.empty();return this.write(SI.default.route(t,e.values(),r),o,!0),o},AI.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new TI.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return void 0!==e.patch_bolt&&t._applyPatches(e.patch_bolt),t._onLoginCompleted(e,i)}});return this.write(SI.default.hello(r,n,this._serversideRouting,["utc"]),e,!0),e},AI.prototype._applyPatches=function(e){e.includes("utc")&&this._applyUtcPatch()},AI.prototype._applyUtcPatch=function(){var t=this;this._transformer=new II.default(Object.values(PI(PI({},jI.default),CI.default)).map(function(e){return e(t._config,t._log)}))},AI);function AI(){return null!==EI&&EI.apply(this,arguments)||this}X.default=zu;var MI,xI,Lu={},_=r&&r.__extends||(MI=function(e,t){return(MI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}MI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),NI=r&&r.__assign||function(){return(NI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},nu=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lu=(Object.defineProperty(Lu,"__esModule",{value:!0}),nu(X)),Ar=e,UI=nu(oy),DI=R,LI=nu(p),BI=nu(C),FI=nu(Py),c=Ar.internal.constants,WI=c.BOLT_PROTOCOL_V4_4,zI=c.FETCH_ALL,qI=Ar.internal.bookmarks.Bookmarks,Ea=(xI=lu.default,_(VI,xI),Object.defineProperty(VI.prototype,"version",{get:function(){return WI},enumerable:!1,configurable:!0}),Object.defineProperty(VI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new FI.default(Object.values(LI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),VI.prototype.requestRoutingInformation=function(e){var t=e.routingContext,t=void 0===t?{}:t,r=e.databaseName,r=void 0===r?null:r,n=e.impersonatedUser,n=void 0===n?null:n,o=e.sessionContext,o=void 0===o?{}:o,i=e.onError,e=e.onCompleted,i=new DI.RouteObserver({onProtocolError:this._onProtocolError,onError:i,onCompleted:e}),e=o.bookmarks||qI.empty();return this.write(UI.default.routeV4x4(t,e.values(),{databaseName:r,impersonatedUser:n}),i,!0),i},VI.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.mode,a=r.impersonatedUser,s=r.beforeKeys,c=r.afterKeys,l=r.beforeError,f=r.afterError,p=r.beforeComplete,d=r.afterComplete,h=r.flush,h=void 0===h||h,b=r.reactive,b=void 0!==b&&b,y=r.fetchSize,y=void 0===y?zI:y,_=r.highRecordWatermark,_=void 0===_?Number.MAX_VALUE:_,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,s=new DI.ResultStreamObserver({server:this._server,reactive:b,fetchSize:y,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:s,afterKeys:c,beforeError:l,afterError:f,beforeComplete:p,afterComplete:d,highRecordWatermark:_,lowRecordWatermark:r}),c=b;return this.write(UI.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a}),s,c&&h),b||this.write(UI.default.pull({n:y}),s,h),s},VI.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,u=e.beforeError,a=e.afterError,s=e.beforeComplete,e=e.afterComplete,u=new DI.ResultStreamObserver({server:this._server,beforeError:u,afterError:a,beforeComplete:s,afterComplete:e});return u.prepareToHandleSingleResponse(),this.write(UI.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i}),u,!0),u},VI.prototype._applyUtcPatch=function(){var t=this;this._transformer=new FI.default(Object.values(NI(NI({},LI.default),BI.default)).map(function(e){return e(t._config,t._log)}))},VI);function VI(){return null!==xI&&xI.apply(this,arguments)||this}Lu.default=Ea;var Es={},f={},HI=r&&r.__assign||function(){return(HI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},YI=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},ya=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},KI=(Object.defineProperty(f,"__esModule",{value:!0}),Of),GI=e,ZI=ya(p),ls=ya(C);f.default=HI(HI(HI({},ZI.default),ls.default),{createNodeTransformer:function(e){return ZI.default.createNodeTransformer(e).extendsWith({fromStructure:function(e){KI.structure.verifyStructSize("Node",4,e.size);var e=YI(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new GI.Node(t,r,n,e)}})},createRelationshipTransformer:function(e){return ZI.default.createRelationshipTransformer(e).extendsWith({fromStructure:function(e){KI.structure.verifyStructSize("Relationship",8,e.size);var e=YI(e.fields,8),t=e[0],r=e[1],n=e[2],o=e[3],i=e[4],u=e[5],a=e[6],e=e[7];return new GI.Relationship(t,r,n,o,i,u,a,e)}})},createUnboundRelationshipTransformer:function(e){return ZI.default.createUnboundRelationshipTransformer(e).extendsWith({fromStructure:function(e){KI.structure.verifyStructSize("UnboundRelationship",4,e.size);var e=YI(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new GI.UnboundRelationship(t,r,n,e)}})}});var XI,QI,va=r&&r.__extends||(XI=function(e,t){return(XI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}XI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Pa=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},At=(Object.defineProperty(Es,"__esModule",{value:!0}),Pa(Lu)),JI=Pa(f),$I=Pa(Py),eR=Pa(oy),tR=R,rR=e.internal.constants.BOLT_PROTOCOL_V5_0,Oa=(QI=At.default,va(nR,QI),Object.defineProperty(nR.prototype,"version",{get:function(){return rR},enumerable:!1,configurable:!0}),Object.defineProperty(nR.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new $I.default(Object.values(JI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),nR.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new tR.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return t._onLoginCompleted(e,i)}});return this.write(eR.default.hello(r,n,this._serversideRouting),e,!0),e},nR);function nR(){return null!==QI&&QI.apply(this,arguments)||this}Es.default=Oa;var jc={},oR=(Object.defineProperty(jc,"__esModule",{value:!0}),e);function iR(){}function uR(e){return e}var aR={onNext:iR,onCompleted:iR,onError:iR};function sR(e){var e=void 0===e?{}:e,t=e.transformMetadata,r=e.log,e=e.observer;this._pendingObservers=[],this._log=r,this._transformMetadata=t||uR,this._observer=Object.assign({onPendingObserversChange:iR,onError:iR,onFailure:iR,onErrorApplyTransformation:uR},e)}Object.defineProperty(sR.prototype,"currentFailure",{get:function(){return this._currentFailure},enumerable:!1,configurable:!0}),sR.prototype.handleResponse=function(e){var t=e.fields[0];switch(e.signature){case 113:this._log.isDebugEnabled()&&this._log.debug("S: RECORD ".concat(oR.json.stringify(e))),this._currentObserver.onNext(t);break;case 112:this._log.isDebugEnabled()&&this._log.debug("S: SUCCESS ".concat(oR.json.stringify(e)));try{var r=this._transformMetadata(t);this._currentObserver.onCompleted(r)}finally{this._updateCurrentObserver()}break;case 127:this._log.isDebugEnabled()&&this._log.debug("S: FAILURE ".concat(oR.json.stringify(e)));try{var n=function(e){{if("Neo.TransientError.Transaction.Terminated"===e)return"Neo.ClientError.Transaction.Terminated";if("Neo.TransientError.Transaction.LockClientStopped"===e)return"Neo.ClientError.Transaction.LockClientStopped"}return e}(t.code),o=(0,oR.newError)(t.message,n);this._currentFailure=this._observer.onErrorApplyTransformation(o),this._currentObserver.onError(this._currentFailure)}finally{this._updateCurrentObserver(),this._observer.onFailure(this._currentFailure)}break;case 126:this._log.isDebugEnabled()&&this._log.debug("S: IGNORED ".concat(oR.json.stringify(e)));try{this._currentFailure&&this._currentObserver.onError?this._currentObserver.onError(this._currentFailure):this._currentObserver.onError&&this._currentObserver.onError((0,oR.newError)("Ignored either because of an error or RESET"))}finally{this._updateCurrentObserver()}break;default:this._observer.onError((0,oR.newError)("Unknown Bolt protocol message: "+e))}},sR.prototype._updateCurrentObserver=function(){this._currentObserver=this._pendingObservers.shift(),this._observer.onPendingObserversChange(this._pendingObservers.length)},sR.prototype._queueObserver=function(e){return(e=e||aR).onCompleted=e.onCompleted||iR,e.onError=e.onError||iR,e.onNext=e.onNext||iR,void 0===this._currentObserver?this._currentObserver=e:this._pendingObservers.push(e),this._observer.onPendingObserversChange(this._pendingObservers.length),!0},sR.prototype._notifyErrorToObservers=function(e){for(this._currentObserver&&this._currentObserver.onError&&this._currentObserver.onError(e);0<this._pendingObservers.length;){var t=this._pendingObservers.shift();t&&t.onError&&t.onError(e)}},sR.prototype.hasOngoingObservableRequests=function(){return null!=this._currentObserver||0<this._pendingObservers.length},sR.prototype._resetFailure=function(){this._currentFailure=null},jc.default=sR;var cR,xc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lR=(Object.defineProperty(xd,"__esModule",{value:!0}),e),fR=xc(Nd),pR=xc(Dy),dR=xc(o),hR=xc(uv),bR=xc(xv),yR=xc(om),_R=xc(X),vR=xc(Lu),mR=xc(Es),gR=xc(jc);xd.default=function(e){var t=(e=void 0===e?{}:e).version,r=e.chunker,n=e.dechunker,o=e.channel,i=e.disableLosslessIntegers,u=e.useBigInt,a=e.serversideRouting,s=e.server,c=e.log,l=e.observer,f=t,p=s,d=r,h={disableLosslessIntegers:i,useBigInt:u},b=a,y=function(t){var r=new gR.default({transformMetadata:t.transformMetadata.bind(t),log:c,observer:l});return o.onerror=l.onError.bind(l),o.onmessage=function(e){return n.write(e)},n.onmessage=function(e){try{r.handleResponse(t.unpack(e))}catch(e){return l.onError(e)}},r},_=l.onProtocolError.bind(l),v=c;switch(f){case 1:return new fR.default(p,d,h,y,v,_);case 2:return new pR.default(p,d,h,y,v,_);case 3:return new dR.default(p,d,h,y,v,_);case 4:return new hR.default(p,d,h,y,v,_);case 4.1:return new bR.default(p,d,h,y,v,_,b);case 4.2:return new yR.default(p,d,h,y,v,_,b);case 4.3:return new _R.default(p,d,h,y,v,_,b);case 4.4:return new vR.default(p,d,h,y,v,_,b);case 5:return new mR.default(p,d,h,y,v,_,b);default:throw(0,lR.newError)("Unknown Bolt protocol version: "+f)}},ba=S,cR=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),ys=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||cR(t,e,r)},n=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(ba,"__esModule",{value:!0}),ba.RawRoutingTable=ba.BoltProtocol=void 0,cf=n(Yc),_f=n(xd),mf=n(X),n=n(Qd),ys(R,ba),ba.BoltProtocol=mf.default,ba.RawRoutingTable=n.default,ba.default={handshake:cf.default,create:_f.default};Mf={},ha={},Object.defineProperty(ha,"__esModule",{value:!0}),ha.DEFAULT_ACQUISITION_TIMEOUT=ha.DEFAULT_MAX_SIZE=void 0,ha.DEFAULT_MAX_SIZE=100,ha.DEFAULT_ACQUISITION_TIMEOUT=6e4,OR.defaultConfig=function(){return new OR(100,6e4)},OR.fromDriverConfig=function(e){return new OR(ER(e.maxConnectionPoolSize)?e.maxConnectionPoolSize:100,ER(e.connectionAcquisitionTimeout)?e.connectionAcquisitionTimeout:6e4)},jf=OR;function OR(e,t){this.maxSize=wR(e,100),this.acquisitionTimeout=wR(t,6e4)}function wR(e,t){return 0===e||e?e:t}function ER(e){return 0===e||e}ha.default=jf;var Gl={},PR=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},SR=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Uf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},TR=(Object.defineProperty(Gl,"__esModule",{value:!0}),Uf(ha)),jR=e,CR=jR.internal.logger.Logger,da=(IR.prototype.acquire=function(o){var i=this,u=o.asKey(),a=this._acquireRequests;return a[u]||(a[u]=[]),new Promise(function(e,t){var r=null,n=setTimeout(function(){var e,t=a[u];t&&(a[u]=t.filter(function(e){return e!==r})),r.isCompleted()||(t=i.activeResourceCount(o),e=i.has(o)?i._pools[u].length:0,r.reject((0,jR.newError)("Connection acquisition timed out in ".concat(i._acquisitionTimeout," ms. Pool status: Active conn count = ").concat(t,", Idle conn count = ").concat(e,"."))))},i._acquisitionTimeout),r=new kR(u,e,t,n,i._log);a[u].push(r),i._processPendingAcquireRequests(o)})},IR.prototype.purge=function(e){return this._purgeKey(e.asKey())},IR.prototype.close=function(){return PR(this,void 0,void 0,function(){var t=this;return SR(this,function(e){switch(e.label){case 0:return this._closed=!0,[4,Promise.all(Object.keys(this._pools).map(function(e){return t._purgeKey(e)}))];case 1:return[2,e.sent()]}})})},IR.prototype.keepAll=function(e){var t=this,r=e.map(function(e){return e.asKey()}),e=Object.keys(this._pools).filter(function(e){return-1===r.indexOf(e)});return Promise.all(e.map(function(e){return t._purgeKey(e)}))},IR.prototype.has=function(e){return e.asKey()in this._pools},IR.prototype.activeResourceCount=function(e){return this._activeResourceCounts[e.asKey()]||0},IR.prototype._getOrInitializePoolFor=function(e){var t=this._pools[e];return t||(t=new UR,this._pools[e]=t,this._pendingCreates[e]=0),t},IR.prototype._acquire=function(u){return PR(this,void 0,void 0,function(){var t,r,n,o,i=this;return SR(this,function(e){switch(e.label){case 0:if(this._closed)throw(0,jR.newError)("Pool is closed, it is no more able to serve requests.");t=u.asKey(),r=this._getOrInitializePoolFor(t),e.label=1;case 1:return r.length?(n=r.pop(),this._validate(n)?(this._removeIdleObserver&&this._removeIdleObserver(n),RR(t,this._activeResourceCounts),this._log.isDebugEnabled()&&this._log.debug("".concat(n," acquired from the pool ").concat(t)),[2,{resource:n,pool:r}]):[3,2]):[3,5];case 2:return[4,this._destroy(n)];case 3:e.sent(),e.label=4;case 4:return[3,1];case 5:if(0<this._maxSize&&this.activeResourceCount(u)+this._pendingCreates[t]>=this._maxSize)return[2,{resource:null,pool:r}];this._pendingCreates[t]=this._pendingCreates[t]+1,e.label=6;case 6:return e.trys.push([6,,8,9]),[4,this._create(u,function(e,t){return i._release(e,t,r)})];case 7:return o=e.sent(),RR(t,this._activeResourceCounts),this._log.isDebugEnabled()&&this._log.debug("".concat(o," created for the pool ").concat(t)),[3,9];case 8:return this._pendingCreates[t]=this._pendingCreates[t]-1,[7];case 9:return[2,{resource:o,pool:r}]}})})},IR.prototype._release=function(u,a,s){return PR(this,void 0,void 0,function(){var o,i=this;return SR(this,function(e){switch(e.label){case 0:return(o=u.asKey(),s.isActive())?this._validate(a)?[3,2]:(this._log.isDebugEnabled()&&this._log.debug("".concat(a," destroyed and can't be released to the pool ").concat(o," because it is not functional")),[4,this._destroy(a)]):[3,4];case 1:return e.sent(),[3,3];case 2:this._installIdleObserver&&this._installIdleObserver(a,{onError:function(e){i._log.debug("Idle connection ".concat(a," destroyed because of error: ").concat(e));e=i._pools[o];e&&(i._pools[o]=e.filter(function(e){return e!==a})),i._destroy(a).catch(function(){})}}),s.push(a),this._log.isDebugEnabled()&&this._log.debug("".concat(a," released to the pool ").concat(o)),e.label=3;case 3:return[3,6];case 4:return this._log.isDebugEnabled()&&this._log.debug("".concat(a," destroyed and can't be released to the pool ").concat(o," because pool has been purged")),[4,this._destroy(a)];case 5:e.sent(),e.label=6;case 6:return t=o,r=this._activeResourceCounts,0<(n=(r[t]||0)-1)?r[t]=n:delete r[t],this._processPendingAcquireRequests(u),[2]}var t,r,n})})},IR.prototype._purgeKey=function(o){return PR(this,void 0,void 0,function(){var t,r,n;return SR(this,function(e){switch(e.label){case 0:if(t=this._pools[o],r=[],!t)return[3,2];for(;t.length;)n=t.pop(),this._removeIdleObserver&&this._removeIdleObserver(n),r.push(this._destroy(n));return t.close(),delete this._pools[o],[4,Promise.all(r)];case 1:e.sent(),e.label=2;case 2:return[2]}})})},IR.prototype._processPendingAcquireRequests=function(r){var n,o=this,i=r.asKey(),e=this._acquireRequests[i];e&&((n=e.shift())?this._acquire(r).catch(function(e){return n.reject(e),{resource:null}}).then(function(e){var t=e.resource,e=e.pool;t?n.isCompleted()?o._release(r,t,e):n.resolve(t):n.isCompleted()||(o._acquireRequests[i]||(o._acquireRequests[i]=[]),o._acquireRequests[i].unshift(n))}):delete this._acquireRequests[i])},IR);function IR(e){var e=void 0===e?{}:e,t=e.create,t=void 0===t?function(e,t){return Promise.resolve()}:t,r=e.destroy,r=void 0===r?function(e){return Promise.resolve()}:r,n=e.validate,n=void 0===n?function(e){return!0}:n,o=e.installIdleObserver,o=void 0===o?function(e,t){}:o,i=e.removeIdleObserver,i=void 0===i?function(e){}:i,u=e.config,u=void 0===u?TR.default.defaultConfig():u,e=e.log,e=void 0===e?CR.noOp():e;this._create=t,this._destroy=r,this._validate=n,this._installIdleObserver=o,this._removeIdleObserver=i,this._maxSize=u.maxSize,this._acquisitionTimeout=u.acquisitionTimeout,this._pools={},this._pendingCreates={},this._acquireRequests={},this._activeResourceCounts={},this._release=this._release.bind(this),this._log=e,this._closed=!1}function RR(e,t){var r=t[e]||0;t[e]=r+1}AR.prototype.isCompleted=function(){return this._completed},AR.prototype.resolve=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._log.isDebugEnabled()&&this._log.debug("".concat(e," acquired from the pool ").concat(this._key)),this._resolve(e))},AR.prototype.reject=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._reject(e))};var kR=AR;function AR(e,t,r,n,o){this._key=e,this._resolve=t,this._reject=r,this._timeoutId=n,this._log=o,this._completed=!1}DR.prototype.isActive=function(){return this._active},DR.prototype.close=function(){this._active=!1},DR.prototype.filter=function(e){return this._elements=this._elements.filter(e),this},Object.defineProperty(DR.prototype,"length",{get:function(){return this._elements.length},enumerable:!1,configurable:!0}),DR.prototype.pop=function(){return this._elements.pop()},DR.prototype.push=function(e){return this._elements.push(e)};var MR,xR,NR,UR=DR;function DR(){this._active=!0,this._elements=[]}Gl.default=da,j=Mf,MR=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),xR=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),sf=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&MR(t,e,r);return xR(t,e),t},ml=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(j,"__esModule",{value:!0}),j.DEFAULT_MAX_SIZE=j.DEFAULT_ACQUISITION_TIMEOUT=j.PoolConfig=j.Pool=void 0,NR=sf(ha),j.PoolConfig=NR.default,Object.defineProperty(j,"DEFAULT_ACQUISITION_TIMEOUT",{enumerable:!0,get:function(){return NR.DEFAULT_ACQUISITION_TIMEOUT}}),Object.defineProperty(j,"DEFAULT_MAX_SIZE",{enumerable:!0,get:function(){return NR.DEFAULT_MAX_SIZE}}),sf=ml(Gl),j.Pool=sf.default,j.default=sf.default;var LR,P={},Ff={},Zf=r&&r.__extends||(LR=function(e,t){return(LR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}LR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Ff,"__esModule",{value:!0});Zf(FR,BR=e.ConnectionProvider),FR.prototype.acquireConnection=function(e){e=void 0===e?{}:e,e.accessMode,e.database,e.bookmarks,e=this._connection;return this._connection=null,Promise.resolve(e)};var BR,w=FR;function FR(e){var t=BR.call(this)||this;return t._connection=e,t}Ff.default=w;lf={},Xf={},aa={};function WR(e){this._errorHandler=e}Object.defineProperty(aa,"__esModule",{value:!0}),Object.defineProperty(WR.prototype,"id",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(WR.prototype,"databaseId",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),WR.prototype.isOpen=function(){throw new Error("not implemented")},WR.prototype.protocol=function(){throw new Error("not implemented")},Object.defineProperty(WR.prototype,"address",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(WR.prototype,"version",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(WR.prototype,"server",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),WR.prototype.connect=function(e,t){throw new Error("not implemented")},WR.prototype.write=function(e,t,r){throw new Error("not implemented")},WR.prototype.resetAndFlush=function(){throw new Error("not implemented")},WR.prototype.hasOngoingObservableRequests=function(){throw new Error("not implemented")},WR.prototype.close=function(){throw new Error("not implemented")},WR.prototype.handleAndTransformError=function(e,t){return this._errorHandler?this._errorHandler.handleAndTransformError(e,t):e},aa.default=WR;var zR,op={},gf=r&&r.__extends||(zR=function(e,t){return(zR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),qR=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},VR=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},cp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},HR=(Object.defineProperty(op,"__esModule",{value:!0}),op.createChannelConnection=void 0,fl),YR=e,ep=cp(aa),KR=cp(S),GR=YR.error.PROTOCOL_ERROR,ZR=YR.internal.logger.Logger,XR=0;op.createChannelConnection=function(i,u,a,s,c,e){void 0===c&&(c=null);var l=(e=void 0===e?function(e){return new HR.Channel(e)}:e)(new HR.ChannelConfig(i,u,a.errorCode()));return KR.default.handshake(l).then(function(e){var r=e.protocolVersion,e=e.consumeRemainingBuffer,n=new HR.Chunker(l),o=new HR.Dechunker,t=new JR(l,a,i,s,u.disableLosslessIntegers,c,n,function(t){return KR.default.create({version:r,channel:l,chunker:n,dechunker:o,disableLosslessIntegers:u.disableLosslessIntegers,useBigInt:u.useBigInt,serversideRouting:c,server:t.server,log:t.logger,observer:{onPendingObserversChange:t._handleOngoingRequestsNumberChange.bind(t),onError:t._handleFatalError.bind(t),onFailure:t._resetOnFailure.bind(t),onProtocolError:t._handleProtocolError.bind(t),onErrorApplyTransformation:function(e){return t.handleAndTransformError(e,t._address)}}})});return e(function(e){return o.write(e)}),t}).catch(function(e){return l.close().then(function(){throw e})})};QR=ep.default,gf($R,QR),Object.defineProperty($R.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty($R.prototype,"databaseId",{get:function(){return this._dbConnectionId},set:function(e){this._dbConnectionId=e},enumerable:!1,configurable:!0}),$R.prototype.connect=function(e,t){return this._initialize(e,t)},$R.prototype._initialize=function(e,n){var o=this,i=this;return new Promise(function(r,t){o._protocol.initialize({userAgent:e,authToken:n,onError:function(e){return t(e)},onComplete:function(e){var t;e&&(t=e.server,o.version&&!t||(o.version=t),t=e.connection_id,o.databaseId||(o.databaseId=t),e.hints&&null!=(t=e.hints["connection.recv_timeout_seconds"])&&(e=(0,YR.toNumber)(t),Number.isInteger(e)&&0<e?o._ch.setupReceiveTimeout(1e3*e):o._log.info("Server located at ".concat(o._address," supplied an invalid connection receive timeout value (").concat(e,"). ")+"Please, verify the server configuration and status because this can be the symptom of a bigger issue."))),r(i)}})})},$R.prototype.protocol=function(){return this._protocol},Object.defineProperty($R.prototype,"address",{get:function(){return this._address},enumerable:!1,configurable:!0}),Object.defineProperty($R.prototype,"version",{get:function(){return this._server.version},set:function(e){this._server.version=e},enumerable:!1,configurable:!0}),Object.defineProperty($R.prototype,"server",{get:function(){return this._server},enumerable:!1,configurable:!0}),Object.defineProperty($R.prototype,"logger",{get:function(){return this._log},enumerable:!1,configurable:!0}),$R.prototype._handleFatalError=function(e){this._isBroken=!0,this._error=this.handleAndTransformError(this._protocol.currentFailure||e,this._address),this._log.isErrorEnabled()&&this._log.error("experienced a fatal error caused by ".concat(this._error," (").concat(YR.json.stringify(this._error),")")),this._protocol.notifyFatalError(this._error)},$R.prototype._queueObserver=function(e){return this._protocol.queueObserverIfProtocolIsNotBroken(e)},$R.prototype.hasOngoingObservableRequests=function(){return this._protocol.hasOngoingObservableRequests()},$R.prototype.resetAndFlush=function(){var r=this;return new Promise(function(e,t){r._reset({onError:function(e){r._isBroken?t(e):(e=r._handleProtocolError("Received FAILURE as a response for RESET: "+e),t(e))},onComplete:function(){e()}})})},$R.prototype._resetOnFailure=function(){var e=this;this.isOpen()&&this._reset({onError:function(){e._protocol.resetFailure()},onComplete:function(){e._protocol.resetFailure()}})},$R.prototype._reset=function(t){var e,r=this;this._reseting?this._protocol.isLastMessageReset()?this._resetObservers.push(t):this._protocol.reset({onError:function(e){t.onError(e)},onComplete:function(){t.onComplete()}}):(this._resetObservers.push(t),this._reseting=!0,e=function(e){r._reseting=!1;var t=r._resetObservers;r._resetObservers=[],t.forEach(e)},this._protocol.reset({onError:function(t){e(function(e){return e.onError(t)})},onComplete:function(){e(function(e){return e.onComplete()})}}))},$R.prototype._updateCurrentObserver=function(){this._protocol.updateCurrentObserver()},$R.prototype.isOpen=function(){return!this._isBroken&&this._ch._open},$R.prototype._handleOngoingRequestsNumberChange=function(e){0===e?this._ch.stopReceiveTimeout():this._ch.startReceiveTimeout()},$R.prototype.close=function(){return qR(this,void 0,void 0,function(){return VR(this,function(e){switch(e.label){case 0:return this._log.isDebugEnabled()&&this._log.debug("closing"),this._protocol&&this.isOpen()&&this._protocol.prepareToClose(),[4,this._ch.close()];case 1:return e.sent(),this._log.isDebugEnabled()&&this._log.debug("closed"),[2]}})})},$R.prototype.toString=function(){return"Connection [".concat(this.id,"][").concat(this.databaseId||"","]")},$R.prototype._handleProtocolError=function(e){this._protocol.resetFailure(),this._updateCurrentObserver();e=(0,YR.newError)(e,GR);return this._handleFatalError(e),e};var QR,JR=$R;function $R(e,t,r,n,o,i,u,a){void 0===o&&(o=!1),void 0===i&&(i=null);var s,c,t=QR.call(this,t)||this;return t._reseting=!1,t._resetObservers=[],t._id=XR++,t._address=r,t._server={address:r.asHostPort()},t.creationTimestamp=Date.now(),t._disableLosslessIntegers=o,t._ch=e,t._chunker=u,t._log=(s=t,new ZR((c=n)._level,function(e,t){return c._loggerFunction(e,"".concat(s," ").concat(t))})),t._serversideRouting=i,t._dbConnectionId=null,t._protocol=a(t),t._isBroken=!1,t._log.isDebugEnabled()&&t._log.debug("created towards ".concat(r)),t}op.default=JR;var ek,tk,hp={},kp=r&&r.__extends||(ek=function(e,t){return(ek=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ek(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Fp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Up=(Object.defineProperty(hp,"__esModule",{value:!0}),Fp(aa)),Pd=(tk=Up.default,kp(rk,tk),Object.defineProperty(rk.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(rk.prototype,"databaseId",{get:function(){return this._delegate.databaseId},set:function(e){this._delegate.databaseId=e},enumerable:!1,configurable:!0}),Object.defineProperty(rk.prototype,"server",{get:function(){return this._delegate.server},enumerable:!1,configurable:!0}),Object.defineProperty(rk.prototype,"address",{get:function(){return this._delegate.address},enumerable:!1,configurable:!0}),Object.defineProperty(rk.prototype,"version",{get:function(){return this._delegate.version},set:function(e){this._delegate.version=e},enumerable:!1,configurable:!0}),rk.prototype.isOpen=function(){return this._delegate.isOpen()},rk.prototype.protocol=function(){return this._delegate.protocol()},rk.prototype.connect=function(e,t){return this._delegate.connect(e,t)},rk.prototype.write=function(e,t,r){return this._delegate.write(e,t,r)},rk.prototype.resetAndFlush=function(){return this._delegate.resetAndFlush()},rk.prototype.hasOngoingObservableRequests=function(){return this._delegate.hasOngoingObservableRequests()},rk.prototype.close=function(){return this._delegate.close()},rk.prototype._release=function(){return this._originalErrorHandler&&(this._delegate._errorHandler=this._originalErrorHandler),this._delegate._release()},rk);function rk(e,t){var r=tk.call(this,t)||this;return t&&(r._originalErrorHandler=e._errorHandler,e._errorHandler=r._errorHandler),r._delegate=e,r}hp.default=Pd;Kc={};Object.defineProperty(Kc,"__esModule",{value:!0});var nk,ok,ik,uk=e.error.SERVICE_UNAVAILABLE,ak=e.error.SESSION_EXPIRED;function sk(e,t,r,n){this._errorCode=e,this._handleUnavailability=t||ck,this._handleWriteFailure=r||ck,this._handleAuthorizationExpired=n||ck}function ck(e){return e}sk.create=function(e){return new sk(e.errorCode,e.handleUnavailability,e.handleWriteFailure,e.handleAuthorizationExpired)},sk.prototype.errorCode=function(){return this._errorCode},sk.prototype.handleAndTransformError=function(e,t){return!(r=e)||"Neo.ClientError.Security.AuthorizationExpired"!==r.code&&"Neo.ClientError.Security.TokenExpired"!==r.code?function(e){if(e)return e.code===ak||e.code===uk||"Neo.TransientError.General.DatabaseUnavailable"===e.code;return}(e)?this._handleUnavailability(e,t):function(e){if(e)return"Neo.ClientError.Cluster.NotALeader"===e.code||"Neo.ClientError.General.ForbiddenOnReadOnlyDatabase"===e.code;return}(e)?this._handleWriteFailure(e,t):e:this._handleAuthorizationExpired(e,t);var r},Kc.default=sk,od=Xf,nk=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),ok=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lc=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&nk(t,e,r);return ok(t,e),t},Ic=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(od,"__esModule",{value:!0}),od.createChannelConnection=od.ConnectionErrorHandler=od.DelegateConnection=od.ChannelConnection=od.Connection=void 0,id=Ic(aa),od.Connection=id.default,ik=lc(op),od.ChannelConnection=ik.default,Object.defineProperty(od,"createChannelConnection",{enumerable:!0,get:function(){return ik.createChannelConnection}}),lc=Ic(hp),od.DelegateConnection=lc.default,lc=Ic(Kc),od.ConnectionErrorHandler=lc.default,od.default=id.default;var lk,fk,pl=r&&r.__extends||(lk=function(e,t){return(lk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}lk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),pk=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),dk=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ed=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&pk(t,e,r);return dk(t,e),t},hk=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},bk=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},yk=(Object.defineProperty(lf,"__esModule",{value:!0}),Xf),_k=Ed(Mf),vk=e,mk=vk.error.SERVICE_UNAVAILABLE,I=(fk=vk.ConnectionProvider,pl(gk,fk),gk.prototype._createConnectionErrorHandler=function(){return new yk.ConnectionErrorHandler(mk)},gk.prototype._createConnection=function(e,r){var n=this;return this._createChannelConnection(e).then(function(t){return t._release=function(){return r(e,t)},(n._openConnections[t.id]=t).connect(n._userAgent,n._authToken).catch(function(e){throw n._destroyConnection(t),e})})},gk.prototype._validateConnection=function(e){if(!e.isOpen())return!1;var t=this._config.maxConnectionLifetime;return Date.now()-e.creationTimestamp<=t},gk.prototype._destroyConnection=function(e){return delete this._openConnections[e.id],e.close()},gk.prototype._verifyConnectivityAndGetServerVersion=function(e){var n=e.address;return hk(this,void 0,void 0,function(){var t,r;return bk(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.acquire(n)];case 1:t=e.sent(),r=new vk.ServerInfo(t.server,t.protocol().version),e.label=2;case 2:return e.trys.push([2,,5,7]),t.protocol().isLastMessageLogin()?[3,4]:[4,t.resetAndFlush()];case 3:e.sent(),e.label=4;case 4:return[3,7];case 5:return[4,t._release()];case 6:return e.sent(),[7];case 7:return[2,r]}})})},gk.prototype.close=function(){return hk(this,void 0,void 0,function(){return bk(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.close()];case 1:return e.sent(),[4,Promise.all(Object.values(this._openConnections).map(function(e){return e.close()}))];case 2:return e.sent(),[2]}})})},gk._installIdleObserverOnConnection=function(e,t){e._queueObserver(t)},gk._removeIdleObserverOnConnection=function(e){e._updateCurrentObserver()},gk);function gk(e,t){var r=e.id,n=e.config,o=e.log,i=e.userAgent,e=e.authToken,u=(void 0===t&&(t=null),fk.call(this)||this);return u._id=r,u._config=n,u._log=o,u._userAgent=i,u._authToken=e,u._createChannelConnection=t||function(e){return(0,yk.createChannelConnection)(e,u._config,u._createConnectionErrorHandler(),u._log)},u._connectionPool=new _k.default({create:u._createConnection.bind(u),destroy:u._destroyConnection.bind(u),validate:u._validateConnection.bind(u),installIdleObserver:gk._installIdleObserverOnConnection.bind(u),removeIdleObserver:gk._removeIdleObserverOnConnection.bind(u),config:_k.PoolConfig.fromDriverConfig(n),log:u._log}),u._openConnections={},u}lf.default=I;var Ok,wk,Ep={},pa=r&&r.__extends||(Ok=function(e,t){return(Ok=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ok(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ek=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Pk=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Wp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gd=(Object.defineProperty(Ep,"__esModule",{value:!0}),Wp(lf)),Sk=Xf,th=e.internal.constants,Tk=th.BOLT_PROTOCOL_V3,jk=th.BOLT_PROTOCOL_V4_0,Ck=th.BOLT_PROTOCOL_V4_4,Ik=e.error.SERVICE_UNAVAILABLE,eh=(wk=gd.default,pa(Rk,wk),Rk.prototype.acquireConnection=function(e){var r=this,e=void 0===e?{}:e,n=(e.accessMode,e.database),t=(e.bookmarks,Sk.ConnectionErrorHandler.create({errorCode:Ik,handleAuthorizationExpired:function(e,t){return r._handleAuthorizationExpired(e,t,n)}}));return this._connectionPool.acquire(this._address).then(function(e){return new Sk.DelegateConnection(e,t)})},Rk.prototype._handleAuthorizationExpired=function(e,t,r){return this._log.warn("Direct driver ".concat(this._id," will close connection to ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this._connectionPool.purge(t).catch(function(){}),e},Rk.prototype._hasProtocolVersion=function(n){return Ek(this,void 0,void 0,function(){var t,r;return Pk(this,function(e){switch(e.label){case 0:return[4,(0,Sk.createChannelConnection)(this._address,this._config,this._createConnectionErrorHandler(),this._log)];case 1:return t=e.sent(),r=t.protocol()?t.protocol().version:null,[4,t.close()];case 2:return e.sent(),r?[2,n(r)]:[2,!1]}})})},Rk.prototype.supportsMultiDb=function(){return Ek(this,void 0,void 0,function(){return Pk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return jk<=e})];case 1:return[2,e.sent()]}})})},Rk.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},Rk.prototype.supportsTransactionConfig=function(){return Ek(this,void 0,void 0,function(){return Pk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return Tk<=e})];case 1:return[2,e.sent()]}})})},Rk.prototype.supportsUserImpersonation=function(){return Ek(this,void 0,void 0,function(){return Pk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return Ck<=e})];case 1:return[2,e.sent()]}})})},Rk.prototype.verifyConnectivityAndGetServerInfo=function(){return Ek(this,void 0,void 0,function(){return Pk(this,function(e){switch(e.label){case 0:return[4,this._verifyConnectivityAndGetServerVersion({address:this._address})];case 1:return[2,e.sent()]}})})},Rk);function Rk(e){var t=e.id,r=e.config,n=e.log,o=e.address,i=e.userAgent,e=e.authToken,t=wk.call(this,{id:t,config:r,log:n,userAgent:i,authToken:e})||this;return t._address=o,t}Ep.default=eh;var Oh={},Rh={},Gh={},$h={},kk=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ak=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Mk=(Object.defineProperty($h,"__esModule",{value:!0}),$h.createValidRoutingTable=void 0,e),rb=Mk.internal.constants,xk=rb.ACCESS_MODE_WRITE,Nk=rb.ACCESS_MODE_READ,Uk=Mk.internal.serverAddress.ServerAddress,Dk=Mk.error.PROTOCOL_ERROR,Lk=(Bk.fromRawRoutingTable=Wk,Bk.prototype.forget=function(e){this.readers=Fk(this.readers,e),this.writers=Fk(this.writers,e)},Bk.prototype.forgetRouter=function(e){this.routers=Fk(this.routers,e)},Bk.prototype.forgetWriter=function(e){this.writers=Fk(this.writers,e)},Bk.prototype.isStaleFor=function(e){return this.expirationTime.lessThan(Date.now())||this.routers.length<1||e===Nk&&0===this.readers.length||e===xk&&0===this.writers.length},Bk.prototype.isExpiredFor=function(e){return this.expirationTime.add(e).lessThan(Date.now())},Bk.prototype.allServers=function(){return Ak(Ak(Ak([],kk(this.routers),!1),kk(this.readers),!1),kk(this.writers),!1)},Bk.prototype.toString=function(){return"RoutingTable["+"database=".concat(this.databaseName,", ")+"expirationTime=".concat(this.expirationTime,", ")+"currentTime=".concat(Date.now(),", ")+"routers=[".concat(this.routers,"], ")+"readers=[".concat(this.readers,"], ")+"writers=[".concat(this.writers,"]]")},Bk);function Bk(e){var e=void 0===e?{}:e,t=e.database,r=e.routers,n=e.readers,o=e.writers,i=e.expirationTime,e=e.ttl;this.database=t||null,this.databaseName=t||"default database",this.routers=r||[],this.readers=n||[],this.writers=o||[],this.expirationTime=i||(0,Mk.int)(0),this.ttl=e}function Fk(e,t){return e.filter(function(e){return e.asKey()!==t.asKey()})}function Wk(e,t,r){var n=r.ttl,o=function(t,r){try{var e=(0,Mk.int)(Date.now()),n=(0,Mk.int)(t.ttl).multiply(1e3).add(e);return n.lessThan(e)?Mk.Integer.MAX_VALUE:n}catch(e){throw(0,Mk.newError)("Unable to parse TTL entry from router ".concat(r," from raw routing table:\n").concat(Mk.json.stringify(t),"\nError message: ").concat(e.message),Dk)}}(r,t),i=function(t,r){try{var n=[],o=[],i=[];return t.servers.forEach(function(e){var t=e.role,e=e.addresses;"ROUTE"===t?n=qk(e).map(function(e){return Uk.fromUrl(e)}):"WRITE"===t?i=qk(e).map(function(e){return Uk.fromUrl(e)}):"READ"===t&&(o=qk(e).map(function(e){return Uk.fromUrl(e)}))}),{routers:n,readers:o,writers:i}}catch(e){throw(0,Mk.newError)("Unable to parse servers entry from router ".concat(r," from addresses:\n").concat(Mk.json.stringify(t.servers),"\nError message: ").concat(e.message),Dk)}}(r,t),u=i.routers,a=i.readers,i=i.writers;return zk(u,"routers",t),zk(a,"readers",t),new Lk({database:e||r.db,routers:u,readers:a,writers:i,expirationTime:o,ttl:n})}function zk(e,t,r){if(0===e.length)throw(0,Mk.newError)("Received no "+t+" from router "+r,Dk)}function qk(e){if(Array.isArray(e))return Array.from(e);throw new TypeError("Array expected but got: "+e)}$h.default=Lk,$h.createValidRoutingTable=Wk;var Dh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Vk=(Object.defineProperty(Gh,"__esModule",{value:!0}),Dh($h));function Hk(e){this._routingContext=e}Hk.prototype.lookupRoutingTableOnRouter=function(t,r,n,o){var i=this;return t._acquireConnection(function(e){return i._requestRawRoutingTable(e,t,r,n,o).then(function(e){return e.isNull?null:Vk.default.fromRawRoutingTable(r,n,e)})})},Hk.prototype._requestRawRoutingTable=function(r,n,o,e,i){var u=this;return new Promise(function(e,t){r.protocol().requestRoutingInformation({routingContext:u._routingContext,databaseName:o,impersonatedUser:i,sessionContext:{bookmarks:n._lastBookmarks,mode:n._mode,database:n._database,afterComplete:n._onComplete},onCompleted:e,onError:t})})},Gh.default=Hk;var Yk,Kk,nb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ob=(Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.RoutingTable=Rh.Rediscovery=void 0,nb(Gh)),Sh=(Rh.Rediscovery=ob.default,nb($h)),Nh=(Rh.RoutingTable=Sh.default,Rh.default=ob.default,r&&r.__extends||(Yk=function(e,t){return(Yk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Yk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Gk=r&&r.__assign||function(){return(Gk=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zk=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Xk=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fb=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Zk(t,e,r);return Xk(t,e),t},Qk=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Jk=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},$k=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},eA=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},wb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},tA=(Object.defineProperty(Oh,"__esModule",{value:!0}),e),rA=fb(Rh),nA=fl,oA=wb(Ff),uh=wb(lf),iA=Sa,uA=Xf,aA=tA.error.SERVICE_UNAVAILABLE,sA=tA.error.SESSION_EXPIRED,cA=tA.internal.bookmarks.Bookmarks,bb=tA.internal.constants,lA=bb.ACCESS_MODE_READ,fA=bb.ACCESS_MODE_WRITE,pA=bb.BOLT_PROTOCOL_V3,dA=bb.BOLT_PROTOCOL_V4_0,hA=bb.BOLT_PROTOCOL_V4_4,bA=(0,tA.int)(3e4),fc=(Kk=uh.default,Nh(x,Kk),x.prototype._createConnectionErrorHandler=function(){return new uA.ConnectionErrorHandler(sA)},x.prototype._handleUnavailability=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will forget ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this.forget(t,r||null),e},x.prototype._handleAuthorizationExpired=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will close connections to ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this._connectionPool.purge(t).catch(function(){}),e},x.prototype._handleWriteFailure=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will forget writer ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this.forgetWriter(t,r||null),(0,tA.newError)("No longer possible to write to server at "+t,sA,e)},x.prototype.acquireConnection=function(e){var e=void 0===e?{}:e,s=e.accessMode,c=e.database,l=e.bookmarks,f=e.impersonatedUser,p=e.onDatabaseNameResolved;return Qk(this,void 0,void 0,function(){var t,r,n,o,i,u,a=this;return Jk(this,function(e){switch(e.label){case 0:return n={database:c||null},o=new uA.ConnectionErrorHandler(sA,function(e,t){return a._handleUnavailability(e,t,n.database)},function(e,t){return a._handleWriteFailure(e,t,n.database)},function(e,t){return a._handleAuthorizationExpired(e,t,n.database)}),[4,this._freshRoutingTable({accessMode:s,database:n.database,bookmarks:l,impersonatedUser:f,onDatabaseNameResolved:function(e){n.database=n.database||e,p&&p(e)}})];case 1:if(i=e.sent(),s===lA)r=this._loadBalancingStrategy.selectReader(i.readers),t="read";else{if(s!==fA)throw(0,tA.newError)("Illegal mode "+s);r=this._loadBalancingStrategy.selectWriter(i.writers),t="write"}if(!r)throw(0,tA.newError)("Failed to obtain connection towards ".concat(t," server. Known routing table is: ").concat(i),sA);e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this._acquireConnectionToServer(r,t,i)];case 3:return u=e.sent(),[2,new uA.DelegateConnection(u,o)];case 4:throw u=e.sent(),o.handleAndTransformError(u,r);case 5:return[2]}})})},x.prototype._hasProtocolVersion=function(u){return Qk(this,void 0,void 0,function(){var t,r,n,o,i;return Jk(this,function(e){switch(e.label){case 0:return[4,this._resolveSeedRouter(this._seedRouter)];case 1:t=e.sent(),n=0,e.label=2;case 2:if(!(n<t.length))return[3,8];e.label=3;case 3:return e.trys.push([3,6,,7]),[4,(0,uA.createChannelConnection)(t[n],this._config,this._createConnectionErrorHandler(),this._log)];case 4:return i=e.sent(),o=i.protocol()?i.protocol().version:null,[4,i.close()];case 5:return e.sent(),o?[2,u(o)]:[2,!1];case 6:return i=e.sent(),r=i,[3,7];case 7:return n++,[3,2];case 8:if(r)throw r;return[2,!1]}})})},x.prototype.supportsMultiDb=function(){return Qk(this,void 0,void 0,function(){return Jk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return dA<=e})];case 1:return[2,e.sent()]}})})},x.prototype.supportsTransactionConfig=function(){return Qk(this,void 0,void 0,function(){return Jk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return pA<=e})];case 1:return[2,e.sent()]}})})},x.prototype.supportsUserImpersonation=function(){return Qk(this,void 0,void 0,function(){return Jk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return hA<=e})];case 1:return[2,e.sent()]}})})},x.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},x.prototype.verifyConnectivityAndGetServerInfo=function(e){var l=e.database,f=e.accessMode;return Qk(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c;return Jk(this,function(e){switch(e.label){case 0:return t={database:l||null},[4,this._freshRoutingTable({accessMode:f,database:t.database,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:r=e.sent(),r=f===fA?r.writers:r.readers,n=(0,tA.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(f,"'"),aA),e.label=2;case 2:e.trys.push([2,9,10,11]),o=$k(r),i=o.next(),e.label=3;case 3:if(i.done)return[3,8];u=i.value,e.label=4;case 4:return e.trys.push([4,6,,7]),[4,this._verifyConnectivityAndGetServerVersion({address:u})];case 5:return[2,e.sent()];case 6:return a=e.sent(),n=a,[3,7];case 7:return i=o.next(),[3,3];case 8:return[3,11];case 9:return a=e.sent(),s={error:a},[3,11];case 10:try{i&&!i.done&&(c=o.return)&&c.call(o)}finally{if(s)throw s.error}return[7];case 11:throw n}})})},x.prototype.forget=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forget(t)}}),this._connectionPool.purge(t).catch(function(){})},x.prototype.forgetWriter=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forgetWriter(t)}})},x.prototype._acquireConnectionToServer=function(e,t,r){return this._connectionPool.acquire(e)},x.prototype._freshRoutingTable=function(e){var e=void 0===e?{}:e,t=e.accessMode,r=e.database,n=e.bookmarks,o=e.impersonatedUser,e=e.onDatabaseNameResolved,i=this._routingTableRegistry.get(r,function(){return new rA.RoutingTable({database:r})});return i.isStaleFor(t)?(this._log.info('Routing table is stale for database: "'.concat(r,'" and access mode: "').concat(t,'": ').concat(i)),this._refreshRoutingTable(i,n,o,e)):i},x.prototype._refreshRoutingTable=function(e,t,r,n){var o=e.routers;return this._useSeedRouter?this._fetchRoutingTableFromSeedRouterFallbackToKnownRouters(o,e,t,r,n):this._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter(o,e,t,r,n)},x.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters=function(u,a,s,c,l){return Qk(this,void 0,void 0,function(){var t,r,n,o,i;return Jk(this,function(e){switch(e.label){case 0:return t=[],[4,this._fetchRoutingTableUsingSeedRouter(t,this._seedRouter,a,s,c)];case 1:return(t=eA.apply(void 0,[e.sent(),2]),r=t[0],n=t[1],r)?(this._useSeedRouter=!1,[3,4]):[3,2];case 2:return[4,this._fetchRoutingTableUsingKnownRouters(u,a,s,c)];case 3:i=eA.apply(void 0,[e.sent(),2]),o=i[0],i=i[1],r=o,n=i||n,e.label=4;case 4:return[4,this._applyRoutingTableIfPossible(a,r,l,n)];case 5:return[2,e.sent()]}})})},x.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter=function(o,i,u,a,s){return Qk(this,void 0,void 0,function(){var t,r,n;return Jk(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTableUsingKnownRouters(o,i,u,a)];case 1:return r=eA.apply(void 0,[e.sent(),2]),t=r[0],r=r[1],t?[3,3]:[4,this._fetchRoutingTableUsingSeedRouter(o,this._seedRouter,i,u,a)];case 2:n=eA.apply(void 0,[e.sent(),2]),t=n[0],r=n[1],e.label=3;case 3:return[4,this._applyRoutingTableIfPossible(i,t,s,r)];case 4:return[2,e.sent()]}})})},x.prototype._fetchRoutingTableUsingKnownRouters=function(n,o,i,u){return Qk(this,void 0,void 0,function(){var t,r;return Jk(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTable(n,o,i,u)];case 1:return(t=eA.apply(void 0,[e.sent(),2]),r=t[0],t=t[1],r)?[2,[r,null]]:(r=n.length-1,x._forgetRouter(o,n,r),[2,[null,t]])}})})},x.prototype._fetchRoutingTableUsingSeedRouter=function(r,n,o,i,u){return Qk(this,void 0,void 0,function(){var t;return Jk(this,function(e){switch(e.label){case 0:return[4,this._resolveSeedRouter(n)];case 1:return t=e.sent(),t=t.filter(function(e){return r.indexOf(e)<0}),[4,this._fetchRoutingTable(t,o,i,u)];case 2:return[2,e.sent()]}})})},x.prototype._resolveSeedRouter=function(n){return Qk(this,void 0,void 0,function(){var t,r=this;return Jk(this,function(e){switch(e.label){case 0:return[4,this._hostNameResolver.resolve(n)];case 1:return t=e.sent(),[4,Promise.all(t.map(function(e){return r._dnsResolver.resolve(e)}))];case 2:return t=e.sent(),[2,[].concat.apply([],t)]}})})},x.prototype._fetchRoutingTable=function(s,c,l,f){return Qk(this,void 0,void 0,function(){var t=this;return Jk(this,function(e){return[2,s.reduce(function(i,u,a){return Qk(t,void 0,void 0,function(){var t,r,n,o;return Jk(this,function(e){switch(e.label){case 0:return[4,i];case 1:return(t=eA.apply(void 0,[e.sent(),1]),t=t[0])?[2,[t,null]]:(x._forgetRouter(c,s,a-1),[4,this._createSessionForRediscovery(u,l,f)]);case 2:if(t=eA.apply(void 0,[e.sent(),2]),r=t[0],n=t[1],!r)return[3,8];e.label=3;case 3:return e.trys.push([3,5,6,7]),[4,this._rediscovery.lookupRoutingTableOnRouter(r,c.database,u,f)];case 4:return[2,[e.sent(),null]];case 5:return o=e.sent(),[2,this._handleRediscoveryError(o,u)];case 6:return r.close(),[7];case 7:return[3,9];case 8:return[2,[null,n]];case 9:return[2]}})})},Promise.resolve([null,null]))]})})},x.prototype._createSessionForRediscovery=function(o,i,u){return Qk(this,void 0,void 0,function(){var t,r,n=this;return Jk(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this._connectionPool.acquire(o)];case 1:return r=e.sent(),t=uA.ConnectionErrorHandler.create({errorCode:sA,handleAuthorizationExpired:function(e,t){return n._handleAuthorizationExpired(e,t)}}),t=new oA.default(new uA.DelegateConnection(r,t)),r.protocol().version<4?[2,[new tA.Session({mode:fA,bookmarks:cA.empty(),connectionProvider:t}),null]]:[2,[new tA.Session({mode:lA,database:"system",bookmarks:i,connectionProvider:t,impersonatedUser:u}),null]];case 2:return r=e.sent(),[2,this._handleRediscoveryError(r,o)];case 3:return[2]}})})},x.prototype._handleRediscoveryError=function(e,t){if(["Neo.ClientError.Database.DatabaseNotFound","Neo.ClientError.Transaction.InvalidBookmark","Neo.ClientError.Transaction.InvalidBookmarkMixture","Neo.ClientError.Statement.ArgumentError","Neo.ClientError.Request.Invalid","Neo.ClientError.Statement.TypeError"].includes(e.code)||(r=e).code.startsWith("Neo.ClientError.Security.")&&!["Neo.ClientError.Security.AuthorizationExpired"].includes(r.code))throw e;if("Neo.ClientError.Procedure.ProcedureNotFound"===e.code)throw(0,tA.newError)("Server at ".concat(t.asHostPort()," can't perform routing. Make sure you are connecting to a causal cluster"),aA,e);var r;return this._log.warn("unable to fetch routing table because of an error ".concat(e)),[null,e]},x.prototype._applyRoutingTableIfPossible=function(t,r,n,o){return Qk(this,void 0,void 0,function(){return Jk(this,function(e){switch(e.label){case 0:if(r)return 0===r.writers.length&&(this._useSeedRouter=!0),[4,this._updateRoutingTable(r,n)];throw(0,tA.newError)("Could not perform discovery. No routing servers available. Known routing table: ".concat(t),aA,o);case 1:return e.sent(),[2,r]}})})},x.prototype._updateRoutingTable=function(t,r){return Qk(this,void 0,void 0,function(){return Jk(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.keepAll(t.allServers())];case 1:return e.sent(),this._routingTableRegistry.removeExpired(),this._routingTableRegistry.register(t),r(t.database),this._log.info("Updated routing table ".concat(t)),[2]}})})},x._forgetRouter=function(e,t,r){t=t[r];e&&t&&e.forgetRouter(t)},x);function x(e){var t=e.id,r=e.address,n=e.routingContext,o=e.hostNameResolver,i=e.config,u=e.log,a=e.userAgent,s=e.authToken,e=e.routingTablePurgeDelay,c=Kk.call(this,{id:t,config:i,log:u,userAgent:a,authToken:s},function(e){return(0,uA.createChannelConnection)(e,c._config,c._createConnectionErrorHandler(),c._log,c._routingContext)})||this;return c._routingContext=Gk(Gk({},n),{address:r.toString()}),c._seedRouter=r,c._rediscovery=new rA.default(c._routingContext),c._loadBalancingStrategy=new iA.LeastConnectedLoadBalancingStrategy(c._connectionPool),c._hostNameResolver=o,c._dnsResolver=new nA.HostNameResolver,c._log=u,c._useSeedRouter=!0,c._routingTableRegistry=new MA(e?(0,tA.int)(e):bA),c}Oh.default=fc;xA.prototype.register=function(e){return this._tables.set(e.database,e),this},xA.prototype.apply=function(e,t){var t=void 0===t?{}:t,r=t.applyWhenExists,t=t.applyWhenDontExists,t=void 0===t?function(){}:t;return this._tables.has(e)?r(this._tables.get(e)):"string"==typeof e||null===e?t():this._forEach(r),this},xA.prototype.get=function(e,t){return this._tables.has(e)?this._tables.get(e):"function"==typeof t?t():t},xA.prototype.removeExpired=function(){var t=this;return this._removeIf(function(e){return e.isExpiredFor(t._routingTablePurgeDelay)})},xA.prototype._forEach=function(e){var t,r;try{for(var n=$k(this._tables),o=n.next();!o.done;o=n.next())e(eA(o.value,2)[1])}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return this},xA.prototype._remove=function(e){return this._tables.delete(e),this},xA.prototype._removeIf=function(e){var t,r;try{for(var n=$k(this._tables),o=n.next();!o.done;o=n.next()){var i=eA(o.value,2),u=i[0];e(i[1])&&this._remove(u)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return this};var yA,_A,vA,mA,gA,OA,wA,EA,PA,SA,N,TA,jA,CA,IA,RA,kA,AA,MA=xA;function xA(e){this._tables=new Map,this._routingTablePurgeDelay=e}function NA(e,o,t){void 0===t&&(t={}),CA(e,"Bolt URL");var r,i=kA.parseDatabaseUrl(e),n=!1,u=!1;switch(i.scheme){case"bolt":break;case"bolt+s":u=!0,r="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";break;case"bolt+ssc":u=!0,r="TRUST_ALL_CERTIFICATES";break;case"neo4j":n=!0;break;case"neo4j+s":r="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",n=u=!0;break;case"neo4j+ssc":r="TRUST_ALL_CERTIFICATES",n=u=!0;break;default:throw new Error("Unknown scheme: ".concat(i.scheme))}if(u){if("encrypted"in t||"trust"in t)throw new Error("Encryption/trust can only be configured either through URL or config, not both");t.encrypted=jA,t.trust=r}(o=o||{}).scheme=o.scheme||"none",t.userAgent=t.userAgent||AA;var a=RA.fromUrl(i.hostAndPort),s={address:a,typename:n?"Routing":"Direct",routing:n};return new SA.Driver(s,t,function(){{if(n)return function(e,t,r,n){return new TA.RoutingConnectionProvider({id:e,config:t,log:r,hostNameResolver:n,authToken:o,address:a,userAgent:t.userAgent,routingContext:i.query})};if(IA(i.query))return function(e,t,r){return new TA.DirectConnectionProvider({id:e,config:t,log:r,authToken:o,address:a,userAgent:t.userAgent})};throw new Error("Parameters are not supported with none routed scheme. Given URL: '".concat(e,"'"))}}())}function UA(r,n){return EA(this,void 0,void 0,function(){var t;return PA(this,function(e){switch(e.label){case 0:t=NA(r,{scheme:"none",principal:"",credentials:""},n),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,t.getNegotiatedProtocolVersion()];case 2:return e.sent(),[2,!0];case 3:return[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})}return Xb=P,yA=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Xb,"__esModule",{value:!0}),Xb.RoutingConnectionProvider=Xb.DirectConnectionProvider=Xb.PooledConnectionProvider=Xb.SingleConnectionProvider=void 0,_A=Ff,Object.defineProperty(Xb,"SingleConnectionProvider",{enumerable:!0,get:function(){return yA(_A).default}}),vA=lf,Object.defineProperty(Xb,"PooledConnectionProvider",{enumerable:!0,get:function(){return yA(vA).default}}),mA=Ep,Object.defineProperty(Xb,"DirectConnectionProvider",{enumerable:!0,get:function(){return yA(mA).default}}),gA=Oh,Object.defineProperty(Xb,"RoutingConnectionProvider",{enumerable:!0,get:function(){return yA(gA).default}}),lh=b,OA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),wA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lb=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&OA(t,e,r);return wA(t,e),t},ey=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||OA(t,e,r)},Object.defineProperty(lh,"__esModule",{value:!0}),lh.pool=lh.packstream=lh.channel=lh.buf=lh.bolt=lh.loadBalancing=void 0,lh.loadBalancing=Lb(Sa),lh.bolt=Lb(S),lh.buf=Lb(Kl),lh.channel=Lb(fl),lh.packstream=Lb(Of),lh.pool=Lb(Mf),ey(P,lh),k=B,EA=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},PA=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Gc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(k,"__esModule",{value:!0}),k.Integer=k.Point=k.PathSegment=k.Path=k.UnboundRelationship=k.Relationship=k.Node=k.Record=k.ServerInfo=k.Notification=k.QueryStatistics=k.ProfiledPlan=k.Plan=k.ResultSummary=k.RxResult=k.RxManagedTransaction=k.RxTransaction=k.RxSession=k.Result=k.ManagedTransaction=k.Transaction=k.Session=k.Driver=k.temporal=k.spatial=k.graph=k.error=k.session=k.types=k.logging=k.auth=k.isRetryableError=k.Neo4jError=k.integer=k.isUnboundRelationship=k.isRelationship=k.isPathSegment=k.isPath=k.isNode=k.isDateTime=k.isLocalDateTime=k.isDate=k.isTime=k.isLocalTime=k.isDuration=k.isPoint=k.isInt=k.int=k.hasReachableServer=k.driver=void 0,k.bookmarkManager=k.DateTime=k.LocalDateTime=k.Date=k.Time=k.LocalTime=k.Duration=void 0,SA=F,Object.defineProperty(k,"Driver",{enumerable:!0,get:function(){return SA.Driver}}),Nb=Gc(t),N=e,Object.defineProperty(k,"Neo4jError",{enumerable:!0,get:function(){return N.Neo4jError}}),Object.defineProperty(k,"isRetryableError",{enumerable:!0,get:function(){return N.isRetryableError}}),Object.defineProperty(k,"error",{enumerable:!0,get:function(){return N.error}}),Object.defineProperty(k,"Integer",{enumerable:!0,get:function(){return N.Integer}}),Object.defineProperty(k,"int",{enumerable:!0,get:function(){return N.int}}),Object.defineProperty(k,"isInt",{enumerable:!0,get:function(){return N.isInt}}),Object.defineProperty(k,"isPoint",{enumerable:!0,get:function(){return N.isPoint}}),Object.defineProperty(k,"Point",{enumerable:!0,get:function(){return N.Point}}),Object.defineProperty(k,"Date",{enumerable:!0,get:function(){return N.Date}}),Object.defineProperty(k,"DateTime",{enumerable:!0,get:function(){return N.DateTime}}),Object.defineProperty(k,"Duration",{enumerable:!0,get:function(){return N.Duration}}),Object.defineProperty(k,"isDate",{enumerable:!0,get:function(){return N.isDate}}),Object.defineProperty(k,"isDateTime",{enumerable:!0,get:function(){return N.isDateTime}}),Object.defineProperty(k,"isDuration",{enumerable:!0,get:function(){return N.isDuration}}),Object.defineProperty(k,"isLocalDateTime",{enumerable:!0,get:function(){return N.isLocalDateTime}}),Object.defineProperty(k,"isLocalTime",{enumerable:!0,get:function(){return N.isLocalTime}}),Object.defineProperty(k,"isNode",{enumerable:!0,get:function(){return N.isNode}}),Object.defineProperty(k,"isPath",{enumerable:!0,get:function(){return N.isPath}}),Object.defineProperty(k,"isPathSegment",{enumerable:!0,get:function(){return N.isPathSegment}}),Object.defineProperty(k,"isRelationship",{enumerable:!0,get:function(){return N.isRelationship}}),Object.defineProperty(k,"isTime",{enumerable:!0,get:function(){return N.isTime}}),Object.defineProperty(k,"isUnboundRelationship",{enumerable:!0,get:function(){return N.isUnboundRelationship}}),Object.defineProperty(k,"LocalDateTime",{enumerable:!0,get:function(){return N.LocalDateTime}}),Object.defineProperty(k,"LocalTime",{enumerable:!0,get:function(){return N.LocalTime}}),Object.defineProperty(k,"Time",{enumerable:!0,get:function(){return N.Time}}),Object.defineProperty(k,"Node",{enumerable:!0,get:function(){return N.Node}}),Object.defineProperty(k,"Path",{enumerable:!0,get:function(){return N.Path}}),Object.defineProperty(k,"PathSegment",{enumerable:!0,get:function(){return N.PathSegment}}),Object.defineProperty(k,"Relationship",{enumerable:!0,get:function(){return N.Relationship}}),Object.defineProperty(k,"UnboundRelationship",{enumerable:!0,get:function(){return N.UnboundRelationship}}),Object.defineProperty(k,"Record",{enumerable:!0,get:function(){return N.Record}}),Object.defineProperty(k,"ResultSummary",{enumerable:!0,get:function(){return N.ResultSummary}}),Object.defineProperty(k,"Plan",{enumerable:!0,get:function(){return N.Plan}}),Object.defineProperty(k,"ProfiledPlan",{enumerable:!0,get:function(){return N.ProfiledPlan}}),Object.defineProperty(k,"QueryStatistics",{enumerable:!0,get:function(){return N.QueryStatistics}}),Object.defineProperty(k,"Notification",{enumerable:!0,get:function(){return N.Notification}}),Object.defineProperty(k,"ServerInfo",{enumerable:!0,get:function(){return N.ServerInfo}}),Object.defineProperty(k,"Result",{enumerable:!0,get:function(){return N.Result}}),Object.defineProperty(k,"auth",{enumerable:!0,get:function(){return N.auth}}),Object.defineProperty(k,"Session",{enumerable:!0,get:function(){return N.Session}}),Object.defineProperty(k,"Transaction",{enumerable:!0,get:function(){return N.Transaction}}),Object.defineProperty(k,"ManagedTransaction",{enumerable:!0,get:function(){return N.ManagedTransaction}}),Object.defineProperty(k,"bookmarkManager",{enumerable:!0,get:function(){return N.bookmarkManager}}),TA=b,ly=Gc(Cr),k.RxSession=ly.default,Ib=Gc(i),k.RxTransaction=Ib.default,Zc=Gc(Ki),k.RxManagedTransaction=Zc.default,Gc=Gc(O),k.RxResult=Gc.default,ny=N.internal.util,jA=ny.ENCRYPTION_ON,CA=ny.assertString,IA=ny.isEmptyObjectOrNull,RA=N.internal.serverAddress.ServerAddress,kA=N.internal.urlUtil,k.driver=NA,k.hasReachableServer=UA,AA="neo4j-javascript/"+Nb.default,ny={console:function(e){return{level:e,logger:function(e,t){return console.log("".concat(r.Date.now()," ").concat(e.toUpperCase()," ").concat(t))}}}},k.logging=ny,Nb={Node:N.Node,Relationship:N.Relationship,UnboundRelationship:N.UnboundRelationship,PathSegment:N.PathSegment,Path:N.Path,Result:N.Result,ResultSummary:N.ResultSummary,Record:N.Record,Point:N.Point,Date:N.Date,DateTime:N.DateTime,Duration:N.Duration,LocalDateTime:N.LocalDateTime,LocalTime:N.LocalTime,Time:N.Time,Integer:N.Integer},k.types=Nb,ay={READ:SA.READ,WRITE:SA.WRITE},k.session=ay,Xc={toNumber:N.toNumber,toString:N.toString,inSafeRange:N.inSafeRange},k.integer=Xc,u={isPoint:N.isPoint},k.spatial=u,xy={isDuration:N.isDuration,isLocalTime:N.isLocalTime,isTime:N.isTime,isDate:N.isDate,isLocalDateTime:N.isLocalDateTime,isDateTime:N.isDateTime},k.temporal=xy,Cy={isNode:N.isNode,isPath:N.isPath,isPathSegment:N.isPathSegment,isRelationship:N.isRelationship,isUnboundRelationship:N.isUnboundRelationship},k.graph=Cy,Xc={driver:NA,hasReachableServer:UA,int:N.int,isInt:N.isInt,isPoint:N.isPoint,isDuration:N.isDuration,isLocalTime:N.isLocalTime,isTime:N.isTime,isDate:N.isDate,isLocalDateTime:N.isLocalDateTime,isDateTime:N.isDateTime,isNode:N.isNode,isPath:N.isPath,isPathSegment:N.isPathSegment,isRelationship:N.isRelationship,isUnboundRelationship:N.isUnboundRelationship,integer:Xc,Neo4jError:N.Neo4jError,isRetryableError:N.isRetryableError,auth:N.auth,logging:ny,types:Nb,session:ay,error:N.error,graph:Cy,spatial:u,temporal:xy,Driver:SA.Driver,Session:N.Session,Transaction:N.Transaction,ManagedTransaction:N.ManagedTransaction,Result:N.Result,RxSession:ly.default,RxTransaction:Ib.default,RxManagedTransaction:Zc.default,RxResult:Gc.default,ResultSummary:N.ResultSummary,Plan:N.Plan,ProfiledPlan:N.ProfiledPlan,QueryStatistics:N.QueryStatistics,Notification:N.Notification,ServerInfo:N.ServerInfo,Record:N.Record,Node:N.Node,Relationship:N.Relationship,UnboundRelationship:N.UnboundRelationship,Path:N.Path,PathSegment:N.PathSegment,Point:N.Point,Integer:N.Integer,Duration:N.Duration,LocalTime:N.LocalTime,Time:N.Time,Date:N.Date,LocalDateTime:N.LocalDateTime,DateTime:N.DateTime,bookmarkManager:N.bookmarkManager},k.default=Xc,U(B)});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).neo4j=t()}(this,function(){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function U(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D,L,B={},F={},e={},t={},n=r&&r.__extends||(D=function(e,t){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),W=(Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_ERROR=t.SESSION_EXPIRED=t.SERVICE_UNAVAILABLE=t.Neo4jError=t.isRetriableError=t.newError=void 0,"ServiceUnavailable"),z=(t.SERVICE_UNAVAILABLE=W,"SessionExpired"),q=(t.SESSION_EXPIRED=z,t.PROTOCOL_ERROR="ProtocolError",L=Error,n(V,L),V.isRetriable=function(e){return null!=e&&e instanceof V&&e.retriable},V);function V(e,t,r){e=L.call(this,e,null!=r?{cause:r}:void 0)||this;return e.constructor=V,e.__proto__=V.prototype,e.code=t,e.name="Neo4jError",e.retriable=(r=t)===W||r===z||"Neo.ClientError.Security.AuthorizationExpired"===r||function(e){return!0===(null==e?void 0:e.includes("TransientError"))}(r),e}t.Neo4jError=q,t.newError=function(e,t,r){return new q(e,null!=t?t:"N/A",r)};n=q.isRetriable;t.isRetriableError=n;var n={},H=(Object.defineProperty(n,"__esModule",{value:!0}),n.toString=n.toNumber=n.inSafeRange=n.isInt=n.int=void 0,t),Y=new Map,o=(d.prototype.inSafeRange=function(){return this.greaterThanOrEqual(d.MIN_SAFE_VALUE)&&this.lessThanOrEqual(d.MAX_SAFE_VALUE)},d.prototype.toInt=function(){return this.low},d.prototype.toNumber=function(){return this.high*K+(this.low>>>0)},d.prototype.toBigInt=function(){var e;return this.isZero()?BigInt(0):this.isPositive()?BigInt(this.high>>>0)*BigInt(K)+BigInt(this.low>>>0):(e=this.negate(),BigInt(-1)*(BigInt(e.high>>>0)*BigInt(K)+BigInt(e.low>>>0)))},d.prototype.toNumberOrInfinity=function(){return this.lessThan(d.MIN_SAFE_VALUE)?Number.NEGATIVE_INFINITY:this.greaterThan(d.MAX_SAFE_VALUE)?Number.POSITIVE_INFINITY:this.toNumber()},d.prototype.toString=function(e){if((e=null!=e?e:10)<2||36<e)throw RangeError("radix out of range: "+e.toString());if(this.isZero())return"0";var t,r,n;if(this.isNegative())return this.equals(d.MIN_VALUE)?(t=d.fromNumber(e),n=(r=this.div(t)).multiply(t).subtract(this),r.toString(e)+n.toInt().toString(e)):"-"+this.negate().toString(e);for(var o=d.fromNumber(Math.pow(e,6)),i=(n=this,"");;){var u=n.div(o),a=(n.subtract(u.multiply(o)).toInt()>>>0).toString(e);if((n=u).isZero())return a+i;for(;a.length<6;)a="0"+a;i=""+a+i}},d.prototype.valueOf=function(){return this.toBigInt()},d.prototype.getHighBits=function(){return this.high},d.prototype.getLowBits=function(){return this.low},d.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(d.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var e=0!==this.high?this.high:this.low,t=0,t=31;0<t&&0==(e&1<<t);t--);return 0!==this.high?t+33:t+1},d.prototype.isZero=function(){return 0===this.high&&0===this.low},d.prototype.isNegative=function(){return this.high<0},d.prototype.isPositive=function(){return 0<=this.high},d.prototype.isOdd=function(){return 1==(1&this.low)},d.prototype.isEven=function(){return 0==(1&this.low)},d.prototype.equals=function(e){e=d.fromValue(e);return this.high===e.high&&this.low===e.low},d.prototype.notEquals=function(e){return!this.equals(e)},d.prototype.lessThan=function(e){return this.compare(e)<0},d.prototype.lessThanOrEqual=function(e){return this.compare(e)<=0},d.prototype.greaterThan=function(e){return 0<this.compare(e)},d.prototype.greaterThanOrEqual=function(e){return 0<=this.compare(e)},d.prototype.compare=function(e){e=d.fromValue(e);if(this.equals(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r||(t||!r)&&this.subtract(e).isNegative()?-1:1},d.prototype.negate=function(){return this.equals(d.MIN_VALUE)?d.MIN_VALUE:this.not().add(d.ONE)},d.prototype.add=function(e){var e=d.fromValue(e),t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,u=65535&e.high,a=e.low>>>16,s=0,c=0,l=0,f=0;return c+=(l=l+((f+=o+(65535&e.low))>>>16)+(n+a))>>>16,d.fromBits((l&=65535)<<16|(f&=65535),((s+=(c+=r+u)>>>16)+(t+i)&65535)<<16|(c&=65535))},d.prototype.subtract=function(e){e=d.fromValue(e);return this.add(e.negate())},d.prototype.multiply=function(e){if(this.isZero())return d.ZERO;e=d.fromValue(e);if(e.isZero())return d.ZERO;if(this.equals(d.MIN_VALUE))return e.isOdd()?d.MIN_VALUE:d.ZERO;if(e.equals(d.MIN_VALUE))return this.isOdd()?d.MIN_VALUE:d.ZERO;if(this.isNegative())return e.isNegative()?this.negate().multiply(e.negate()):this.negate().multiply(e).negate();if(e.isNegative())return this.multiply(e.negate()).negate();if(this.lessThan(Z)&&e.lessThan(Z))return d.fromNumber(this.toNumber()*e.toNumber());var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,i=e.high>>>16,u=65535&e.high,a=e.low>>>16,e=65535&e.low,s=0,c=0,l=0,f=(f=0)+((c=c+((l+=o*e)>>>16)+n*e)>>>16)+((c=(c&65535)+o*a)>>>16);return d.fromBits((c&=65535)<<16|(l&=65535),((s+=(f+=r*e)>>>16)+((f=(f&65535)+n*a)>>>16)+((f=(f&65535)+o*u)>>>16)+(t*e+r*a+n*u+o*i)&65535)<<16|(f&=65535))},d.prototype.div=function(e){var t,r,n,o=d.fromValue(e);if(o.isZero())throw(0,H.newError)("division by zero");if(this.isZero())return d.ZERO;{if(this.equals(d.MIN_VALUE))return o.equals(d.ONE)||o.equals(d.NEG_ONE)?d.MIN_VALUE:o.equals(d.MIN_VALUE)?d.ONE:(n=this.shiftRight(1).div(o).shiftLeft(1)).equals(d.ZERO)?o.isNegative()?d.ONE:d.NEG_ONE:(t=this.subtract(o.multiply(n)),n.add(t.div(o)));if(o.equals(d.MIN_VALUE))return d.ZERO}if(this.isNegative())return o.isNegative()?this.negate().div(o.negate()):this.negate().div(o).negate();if(o.isNegative())return this.div(o.negate()).negate();for(r=d.ZERO,t=this;t.greaterThanOrEqual(o);){n=Math.max(1,Math.floor(t.toNumber()/o.toNumber()));for(var i=Math.ceil(Math.log(n)/Math.LN2),u=i<=48?1:Math.pow(2,i-48),a=d.fromNumber(n),s=a.multiply(o);s.isNegative()||s.greaterThan(t);)s=(a=d.fromNumber(n-=u)).multiply(o);a.isZero()&&(a=d.ONE),r=r.add(a),t=t.subtract(s)}return r},d.prototype.modulo=function(e){e=d.fromValue(e);return this.subtract(this.div(e).multiply(e))},d.prototype.not=function(){return d.fromBits(~this.low,~this.high)},d.prototype.and=function(e){e=d.fromValue(e);return d.fromBits(this.low&e.low,this.high&e.high)},d.prototype.or=function(e){e=d.fromValue(e);return d.fromBits(this.low|e.low,this.high|e.high)},d.prototype.xor=function(e){e=d.fromValue(e);return d.fromBits(this.low^e.low,this.high^e.high)},d.prototype.shiftLeft=function(e){e=d.toNumber(e);return 0==(e&=63)?d.ZERO:e<32?d.fromBits(this.low<<e,this.high<<e|this.low>>>32-e):d.fromBits(0,this.low<<e-32)},d.prototype.shiftRight=function(e){var t=d.toNumber(e);return 0==(t&=63)?d.ZERO:e<32?d.fromBits(this.low>>>t|this.high<<32-t,this.high>>t):d.fromBits(this.high>>t-32,0<=this.high?0:-1)},d.isInteger=function(e){return!0===(null==e?void 0:e.__isInteger__)},d.fromInt=function(e){if(-128<=(e|=0)&&e<128&&null!=(t=Y.get(e)))return t;var t=new d(e,e<0?-1:0);return-128<=e&&e<128&&Y.set(e,t),t},d.fromBits=function(e,t){return new d(e,t)},d.fromNumber=function(e){return isNaN(e)||!isFinite(e)?d.ZERO:e<=-G?d.MIN_VALUE:G<=e+1?d.MAX_VALUE:e<0?d.fromNumber(-e).negate():new d(e%K|0,e/K|0)},d.fromString=function(e,t,r){var n=(void 0===r?{}:r).strictStringValidation;if(0===e.length)throw(0,H.newError)("number format error: empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return d.ZERO;if((t=null!=t?t:10)<2||36<t)throw(0,H.newError)("radix out of range: "+t.toString());if(0<(r=e.indexOf("-")))throw(0,H.newError)('number format error: interior "-" character: '+e);if(0===r)return d.fromString(e.substring(1),t).negate();for(var o,i,u=d.fromNumber(Math.pow(t,8)),a=d.ZERO,s=0;s<e.length;s+=8){var c,l=Math.min(8,e.length-s),f=e.substring(s,s+l),p=parseInt(f,t);if(!0===n&&(o=f,c=p,i=t,Number.isNaN(o)||Number.isNaN(c)||function(e,t,r){e=e.toString(t),t=Math.max(r-e.length,0),r="0".repeat(t);return"".concat(r).concat(e)}(c,i,o.length)!==o.toLowerCase()))throw(0,H.newError)('number format error: "'.concat(f,'" is NaN in radix ').concat(t,": ").concat(e));a=l<8?(c=d.fromNumber(Math.pow(t,l)),a.multiply(c).add(d.fromNumber(p))):(a=a.multiply(u)).add(d.fromNumber(p))}return a},d.fromValue=function(e,t){return void 0===t&&(t={}),e instanceof d?e:"number"==typeof e?d.fromNumber(e):"string"==typeof e?d.fromString(e,void 0,t):"bigint"==typeof e?d.fromString(e.toString()):new d(e.low,e.high)},d.toNumber=function(e){switch(typeof e){case"number":return e;case"bigint":return Number(e);default:return d.fromValue(e).toNumber()}},d.toString=function(e,t){return d.fromValue(e).toString(t)},d.inSafeRange=function(e){return d.fromValue(e).inSafeRange()},d.ZERO=d.fromInt(0),d.ONE=d.fromInt(1),d.NEG_ONE=d.fromInt(-1),d.MAX_VALUE=d.fromBits(-1,2147483647),d.MIN_VALUE=d.fromBits(0,-2147483648),d.MIN_SAFE_VALUE=d.fromBits(1,-2097152),d.MAX_SAFE_VALUE=d.fromBits(-1,2097151),d.__isInteger__=!0,d);function d(e,t){this.low=null!=e?e:0,this.high=null!=t?t:0}Object.defineProperty(o.prototype,"__isInteger__",{value:!0,enumerable:!1,configurable:!1});var K=4294967296,G=K*K/2,Z=o.fromInt(1<<24),i=o.fromValue,i=(n.int=i,o.isInteger),i=(n.isInt=i,o.inSafeRange),i=(n.inSafeRange=i,o.toNumber),i=(n.toNumber=i,o.toString),i=(n.toString=i,n.default=o,{}),o={},u={},a={},s={},Q=(Object.defineProperty(s,"__esModule",{value:!0}),s.getBrokenObjectReason=s.isBrokenObject=s.createBrokenObject=void 0,"__isBrokenObject__"),X="__reason__";s.createBrokenObject=function(r,e){function n(){throw r}return void 0===e&&(e={}),new Proxy(e,{get:function(e,t){return t===Q||(t===X?r:void("toJSON"!==t&&n()))},set:n,apply:n,construct:n,defineProperty:n,deleteProperty:n,getOwnPropertyDescriptor:n,getPrototypeOf:n,has:n,isExtensible:n,ownKeys:n,preventExtensions:n,setPrototypeOf:n})},s.isBrokenObject=function(e){return null!==e&&"object"==typeof e&&!0===e[Q]},s.getBrokenObjectReason=function(e){return e[X]},Object.defineProperty(a,"__esModule",{value:!0}),a.stringify=void 0;var J=s;a.stringify=function(e){return JSON.stringify(e,function(e,t){return(0,J.isBrokenObject)(t)?{__isBrokenObject__:!0,__reason__:(0,J.getBrokenObjectReason)(t)}:"bigint"==typeof t?"".concat(t,"n"):t})},Object.defineProperty(u,"__esModule",{value:!0}),u.ENCRYPTION_OFF=u.ENCRYPTION_ON=u.validateQueryAndParameters=u.assertValidDate=u.assertNumberOrInteger=u.assertNumber=u.assertString=u.assertObject=u.isString=u.isObject=u.isEmptyObjectOrNull=void 0;var c,$,ee,te,re,ne,oe=n,ie=a;u.ENCRYPTION_ON="ENCRYPTION_ON";function ue(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}function ae(e,t){if(se(e))return e;throw new TypeError((0,ie.stringify)(t)+" expected to be string but was: "+(0,ie.stringify)(e))}function se(e){return"[object String]"===Object.prototype.toString.call(e)}function ce(e,t){this._minNumber=e,this._maxNumber=t,this._minInteger=(0,te.int)(e),this._maxInteger=(0,te.int)(t)}function le(e,t,r){e=(0,te.int)(e),t=(0,te.int)(t),r=(0,te.int)(r);var n=e.multiply(365);return n=(n=(n=e.greaterThanOrEqual(0)?n.add(e.add(3).div(4).subtract(e.add(99).div(100)).add(e.add(399).div(400))):n.subtract(e.div(-4).subtract(e.div(-100)).add(e.div(-400)))).add(t.multiply(367).subtract(362).div(12))).add(r.subtract(1)),t.greaterThan(2)&&(n=n.subtract(1),function(e){if((e=(0,te.int)(e)).modulo(4).equals(0))return!e.modulo(100).equals(0)||!!e.modulo(400).equals(0)}(e)||(n=n.subtract(1))),n.subtract(c.DAYS_0000_TO_1970)}function fe(e,t,r){if((0,ne.assertNumberOrInteger)(e,r),t.contains(e))return e;throw(0,re.newError)("".concat(r," is expected to be in range ").concat(t.toString()," but was: ").concat(e.toString()))}function pe(e,t){e=(0,te.int)(e),t=(0,te.int)(t);var r=e.div(t);return r=e.isPositive()!==t.isPositive()&&r.multiply(t).notEquals(e)?r.subtract(1):r}function de(e,t){return e=(0,te.int)(e),t=(0,te.int)(t),e.subtract(pe(e,t).multiply(t))}function he(e){return(e=(0,te.int)(e)).equals(0)?"":"."+be(e,9)}function be(e,t,r){var n=(e=(0,te.int)(e)).isNegative(),o=(e=n?e.negate():e).toString();if(null!=t)for(;o.length<t;)o="0"+o;return n?"-"+o:!0===(null==r?void 0:r.usePositiveSign)?"+"+o:o}u.ENCRYPTION_OFF="ENCRYPTION_OFF",u.isEmptyObjectOrNull=function(e){if(null===e)return!0;if(!ue(e))return!1;for(var t in e)if(void 0!==e[t])return!1;return!0},u.isObject=ue,u.validateQueryAndParameters=function(e,t,r){var n="",t=null!=t?t:{},r=null!=(r=null==r?void 0:r.skipAsserts)&&r;if("string"==typeof e?n=e:e instanceof String?n=e.toString():"object"==typeof e&&null!=e.text&&(n=e.text,t=null!=(e=e.parameters)?e:{}),!r){e=n;if(ae(e,"Cypher query"),0===e.trim().length)throw new TypeError("Cypher query is expected to be a non-empty string.");r=t;if(!ue(r))throw e=null!=r.constructor?" "+r.constructor.name:"",new TypeError("Query parameters are expected to either be undefined/null or an object, given:".concat(e," ").concat(JSON.stringify(r)))}return{validatedQuery:n,params:t}},u.assertObject=function(e,t){if(ue(e))return e;throw new TypeError(t+" expected to be an object but was: "+(0,ie.stringify)(e))},u.assertString=ae,u.assertNumber=function(e,t){if("number"!=typeof e)throw new TypeError(t+" expected to be a number but was: "+(0,ie.stringify)(e));return e},u.assertNumberOrInteger=function(e,t){if("number"==typeof e||"bigint"==typeof e||(0,oe.isInt)(e))return e;throw new TypeError(t+" expected to be either a number or an Integer object but was: "+(0,ie.stringify)(e))},u.assertValidDate=function(e,t){if("[object Date]"!==Object.prototype.toString.call(e))throw new TypeError(t+" expected to be a standard JavaScript Date but was: "+(0,ie.stringify)(e));if(Number.isNaN(e.getTime()))throw new TypeError(t+" expected to be valid JavaScript Date but its time was NaN: "+(0,ie.stringify)(e));return e},u.isString=se,c=o,$=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),ee=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&$(t,e,r);return ee(t,e),t},Object.defineProperty(c,"__esModule",{value:!0}),c.floorMod=c.floorDiv=c.assertValidZoneId=c.assertValidNanosecond=c.assertValidSecond=c.assertValidMinute=c.assertValidHour=c.assertValidDay=c.assertValidMonth=c.assertValidYear=c.timeZoneOffsetInSeconds=c.totalNanoseconds=c.newDate=c.toStandardDate=c.isoStringToStandardDate=c.dateToIsoString=c.timeZoneOffsetToIsoString=c.timeToIsoString=c.durationToIsoString=c.dateToEpochDay=c.localDateTimeToEpochSecond=c.localTimeToNanoOfDay=c.normalizeNanosecondsForDuration=c.normalizeSecondsForDuration=c.SECONDS_PER_DAY=c.DAYS_PER_400_YEAR_CYCLE=c.DAYS_0000_TO_1970=c.NANOS_PER_HOUR=c.NANOS_PER_MINUTE=c.NANOS_PER_MILLISECOND=c.NANOS_PER_SECOND=c.SECONDS_PER_HOUR=c.SECONDS_PER_MINUTE=c.MINUTES_PER_HOUR=c.NANOSECOND_OF_SECOND_RANGE=c.SECOND_OF_MINUTE_RANGE=c.MINUTE_OF_HOUR_RANGE=c.HOUR_OF_DAY_RANGE=c.DAY_OF_MONTH_RANGE=c.MONTH_OF_YEAR_RANGE=c.YEAR_RANGE=void 0,te=l(n),re=t,ne=u,ce.prototype.contains=function(e){var t;return(0,te.isInt)(e)&&e instanceof te.default?e.greaterThanOrEqual(this._minInteger)&&e.lessThanOrEqual(this._maxInteger):"bigint"==typeof e?(t=(0,te.int)(e)).greaterThanOrEqual(this._minInteger)&&t.lessThanOrEqual(this._maxInteger):e>=this._minNumber&&e<=this._maxNumber},ce.prototype.toString=function(){return"[".concat(this._minNumber,", ").concat(this._maxNumber,"]")},l=ce,c.YEAR_RANGE=new l(-999999999,999999999),c.MONTH_OF_YEAR_RANGE=new l(1,12),c.DAY_OF_MONTH_RANGE=new l(1,31),c.HOUR_OF_DAY_RANGE=new l(0,23),c.MINUTE_OF_HOUR_RANGE=new l(0,59),c.SECOND_OF_MINUTE_RANGE=new l(0,59),c.NANOSECOND_OF_SECOND_RANGE=new l(0,999999999),c.MINUTES_PER_HOUR=60,c.SECONDS_PER_MINUTE=60,c.SECONDS_PER_HOUR=c.SECONDS_PER_MINUTE*c.MINUTES_PER_HOUR,c.NANOS_PER_SECOND=1e9,c.NANOS_PER_MILLISECOND=1e6,c.NANOS_PER_MINUTE=c.NANOS_PER_SECOND*c.SECONDS_PER_MINUTE,c.NANOS_PER_HOUR=c.NANOS_PER_MINUTE*c.MINUTES_PER_HOUR,c.DAYS_0000_TO_1970=719528,c.DAYS_PER_400_YEAR_CYCLE=146097,c.SECONDS_PER_DAY=86400,c.normalizeSecondsForDuration=function(e,t){return(0,te.int)(e).add(pe(t,c.NANOS_PER_SECOND))},c.normalizeNanosecondsForDuration=function(e){return de(e,c.NANOS_PER_SECOND)},c.localTimeToNanoOfDay=function(e,t,r,n){return e=(0,te.int)(e),t=(0,te.int)(t),r=(0,te.int)(r),n=(0,te.int)(n),(e=(e=(e=e.multiply(c.NANOS_PER_HOUR)).add(t.multiply(c.NANOS_PER_MINUTE))).add(r.multiply(c.NANOS_PER_SECOND))).add(n)},c.localDateTimeToEpochSecond=function(e,t,r,n,o,i,u){return e=le(e,t,r),t=function(e,t,r){e=(0,te.int)(e),t=(0,te.int)(t),r=(0,te.int)(r);e=e.multiply(c.SECONDS_PER_HOUR);return(e=e.add(t.multiply(c.SECONDS_PER_MINUTE))).add(r)}(n,o,i),e.multiply(c.SECONDS_PER_DAY).add(t)},c.dateToEpochDay=le,c.durationToIsoString=function(e,t,r,n){return e=be(e),t=be(t),r=function(e,t){e=(0,te.int)(e),t=(0,te.int)(t);var r,n=e.isNegative(),o=t.greaterThan(0);e=n&&o?e.equals(-1)?"-0":e.add(1).toString():e.toString();o&&(r=he((n?t.negate().add(2*c.NANOS_PER_SECOND):t.add(c.NANOS_PER_SECOND)).modulo(c.NANOS_PER_SECOND)));return null!=r?e+r:e}(r,n),"P".concat(e,"M").concat(t,"DT").concat(r,"S")},c.timeToIsoString=function(e,t,r,n){return e=be(e,2),t=be(t,2),r=be(r,2),n=he(n),"".concat(e,":").concat(t,":").concat(r).concat(n)},c.timeZoneOffsetToIsoString=function(e){if((e=(0,te.int)(e)).equals(0))return"Z";var t=(r=e.isNegative())?"-":"+",r=be((e=r?e.multiply(-1):e).div(c.SECONDS_PER_HOUR),2),n=be(e.div(c.SECONDS_PER_MINUTE).modulo(c.MINUTES_PER_HOUR),2);return null!=(e=(e=e.modulo(c.SECONDS_PER_MINUTE)).equals(0)?null:be(e,2))?"".concat(t).concat(r,":").concat(n,":").concat(e):"".concat(t).concat(r,":").concat(n)},c.dateToIsoString=function(e,t,r){return e=function(e){e=(0,te.int)(e);if(e.isNegative()||e.greaterThan(9999))return be(e,6,{usePositiveSign:!0});return be(e,4)}(e),t=be(t,2),r=be(r,2),"".concat(e,"-").concat(t,"-").concat(r)},c.isoStringToStandardDate=function(e){return new Date(e)},c.toStandardDate=function(e){return new Date(e)},c.newDate=function(e){return new Date(e)},c.totalNanoseconds=function(e,t){return t=null!=t?t:0,e=e.getMilliseconds()*c.NANOS_PER_MILLISECOND,t instanceof te.default?t.add(e):"bigint"==typeof t?t+BigInt(e):t+e},c.timeZoneOffsetInSeconds=function(e){var t=e.getSeconds()>=e.getUTCSeconds()?e.getSeconds()-e.getUTCSeconds():e.getSeconds()-e.getUTCSeconds()+60;return 0===(e=e.getTimezoneOffset())?0+t:-1*e*c.SECONDS_PER_MINUTE+t},c.assertValidYear=function(e){return fe(e,c.YEAR_RANGE,"Year")},c.assertValidMonth=function(e){return fe(e,c.MONTH_OF_YEAR_RANGE,"Month")},c.assertValidDay=function(e){return fe(e,c.DAY_OF_MONTH_RANGE,"Day")},c.assertValidHour=function(e){return fe(e,c.HOUR_OF_DAY_RANGE,"Hour")},c.assertValidMinute=function(e){return fe(e,c.MINUTE_OF_HOUR_RANGE,"Minute")},c.assertValidSecond=function(e){return fe(e,c.SECOND_OF_MINUTE_RANGE,"Second")},c.assertValidNanosecond=function(e){return fe(e,c.NANOSECOND_OF_SECOND_RANGE,"Nanosecond")},c.assertValidZoneId=function(t,r){try{Intl.DateTimeFormat(void 0,{timeZone:r})}catch(e){throw(0,re.newError)("".concat(t,' is expected to be a valid ZoneId but was: "').concat(r,'"'))}},c.floorDiv=pe,c.floorMod=de;var ye=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),_e=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ye(t,e,r);return _e(t,e),t},ve=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},f=(Object.defineProperty(i,"__esModule",{value:!0}),i.isDateTime=i.DateTime=i.isLocalDateTime=i.LocalDateTime=i.isDate=i.Date=i.isTime=i.Time=i.isLocalTime=i.LocalTime=i.isDuration=i.Duration=void 0,l(o)),me=u,ge=t,Oe=l(n),l={value:!0,enumerable:!1,configurable:!1,writable:!1},we="__isDuration__",Ee="__isLocalTime__",Pe="__isTime__",Se="__isDate__",Te="__isLocalDateTime__",je="__isDateTime__",p=(Ce.prototype.toString=function(){return f.durationToIsoString(this.months,this.days,this.seconds,this.nanoseconds)},Ce);function Ce(e,t,r,n){this.months=(0,me.assertNumberOrInteger)(e,"Months"),this.days=(0,me.assertNumberOrInteger)(t,"Days"),(0,me.assertNumberOrInteger)(r,"Seconds"),(0,me.assertNumberOrInteger)(n,"Nanoseconds"),this.seconds=f.normalizeSecondsForDuration(r,n),this.nanoseconds=f.normalizeNanosecondsForDuration(n),Object.freeze(this)}i.Duration=p,Object.defineProperty(p.prototype,we,l),i.isDuration=function(e){return xe(e,we)};Ie.fromStandardDate=function(e,t){Ue(e,t);t=f.totalNanoseconds(e,t);return new Ie(e.getHours(),e.getMinutes(),e.getSeconds(),t instanceof Oe.default?t.toInt():"bigint"==typeof t?(0,Oe.int)(t).toInt():t)},Ie.prototype.toString=function(){return f.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)};p=Ie;function Ie(e,t,r,n){this.hour=f.assertValidHour(e),this.minute=f.assertValidMinute(t),this.second=f.assertValidSecond(r),this.nanosecond=f.assertValidNanosecond(n),Object.freeze(this)}i.LocalTime=p,Object.defineProperty(p.prototype,Ee,l),i.isLocalTime=function(e){return xe(e,Ee)};Re.fromStandardDate=function(e,t){return Ue(e,t),new Re(e.getHours(),e.getMinutes(),e.getSeconds(),(0,Oe.toNumber)(f.totalNanoseconds(e,t)),f.timeZoneOffsetInSeconds(e))},Re.prototype.toString=function(){return f.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)+f.timeZoneOffsetToIsoString(this.timeZoneOffsetSeconds)};p=Re;function Re(e,t,r,n,o){this.hour=f.assertValidHour(e),this.minute=f.assertValidMinute(t),this.second=f.assertValidSecond(r),this.nanosecond=f.assertValidNanosecond(n),this.timeZoneOffsetSeconds=(0,me.assertNumberOrInteger)(o,"Time zone offset in seconds"),Object.freeze(this)}i.Time=p,Object.defineProperty(p.prototype,Pe,l),i.isTime=function(e){return xe(e,Pe)};ke.fromStandardDate=function(e){return Ue(e),new ke(e.getFullYear(),e.getMonth()+1,e.getDate())},ke.prototype.toStandardDate=function(){return f.isoStringToStandardDate(this.toString())},ke.prototype.toString=function(){return f.dateToIsoString(this.year,this.month,this.day)};p=ke;function ke(e,t,r){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),Object.freeze(this)}i.Date=p,Object.defineProperty(p.prototype,Se,l),i.isDate=function(e){return xe(e,Se)};Ae.fromStandardDate=function(e,t){return Ue(e,t),new Ae(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,Oe.toNumber)(f.totalNanoseconds(e,t)))},Ae.prototype.toStandardDate=function(){return f.isoStringToStandardDate(this.toString())},Ae.prototype.toString=function(){return Ne(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)};p=Ae;function Ae(e,t,r,n,o,i,u){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),this.hour=f.assertValidHour(n),this.minute=f.assertValidMinute(o),this.second=f.assertValidSecond(i),this.nanosecond=f.assertValidNanosecond(u),Object.freeze(this)}i.LocalDateTime=p,Object.defineProperty(p.prototype,Te,l),i.isLocalDateTime=function(e){return xe(e,Te)};Me.fromStandardDate=function(e,t){return Ue(e,t),new Me(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,Oe.toNumber)(f.totalNanoseconds(e,t)),f.timeZoneOffsetInSeconds(e),null)},Me.prototype.toStandardDate=function(){return f.toStandardDate(this._toUTC())},Me.prototype.toString=function(){var e;return Ne(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)+(null!=this.timeZoneOffsetSeconds?f.timeZoneOffsetToIsoString(null!=(e=this.timeZoneOffsetSeconds)?e:0):"")+(null!=this.timeZoneId?"[".concat(this.timeZoneId,"]"):"")},Me.prototype._toUTC=function(){if(void 0===this.timeZoneOffsetSeconds)throw new Error("Requires DateTime created with time zone offset");var e=f.localDateTimeToEpochSecond(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond).subtract(null!=(e=this.timeZoneOffsetSeconds)?e:0);return(0,Oe.int)(e).multiply(1e3).add((0,Oe.int)(this.nanosecond).div(1e6)).toNumber()};p=Me;function Me(e,t,r,n,o,i,u,a,s){this.year=f.assertValidYear(e),this.month=f.assertValidMonth(t),this.day=f.assertValidDay(r),this.hour=f.assertValidHour(n),this.minute=f.assertValidMinute(o),this.second=f.assertValidSecond(i),this.nanosecond=f.assertValidNanosecond(u);e=ve(function(e,t){var r=null!=e,n=null!=t&&""!==t;if(!r&&!n)throw(0,ge.newError)("Unable to create DateTime without either time zone offset or id. Please specify either of them. Given offset: ".concat(e," and id: ").concat(t));var o=[void 0,void 0];r&&((0,me.assertNumberOrInteger)(e,"Time zone offset in seconds"),o[0]=e);n&&((0,me.assertString)(t,"Time zone ID"),f.assertValidZoneId("Time zone ID",t),o[1]=t);return o}(a,s),2),t=e[0],r=e[1];this.timeZoneOffsetSeconds=t,this.timeZoneId=null!=r?r:void 0,Object.freeze(this)}function xe(e,t){return null!=e&&!0===e[t]}function Ne(e,t,r,n,o,i,u){return f.dateToIsoString(e,t,r)+"T"+f.timeToIsoString(n,o,i,u)}function Ue(e,t){(0,me.assertValidDate)(e,"Standard date"),null!=t&&(0,me.assertNumberOrInteger)(t,"Nanosecond")}i.DateTime=p,Object.defineProperty(p.prototype,je,l),i.isDateTime=function(e){return xe(e,je)};var p={},De=(Object.defineProperty(p,"__esModule",{value:!0}),p.isPathSegment=p.PathSegment=p.isPath=p.Path=p.isUnboundRelationship=p.UnboundRelationship=p.isRelationship=p.Relationship=p.isNode=p.Node=void 0,a),l={value:!0,enumerable:!1,configurable:!1,writable:!1},Le="__isNode__",Be="__isRelationship__",Fe="__isUnboundRelationship__",We="__isPath__",ze="__isPathSegment__";function qe(e,t){return null!=e&&!0===e[t]}Ve.prototype.toString=function(){for(var e="("+this.elementId,t=0;t<this.labels.length;t++)e+=":"+this.labels[t];var r=Object.keys(this.properties);if(0<r.length){e+=" {";for(t=0;t<r.length;t++)0<t&&(e+=","),e+=r[t]+":"+(0,De.stringify)(this.properties[r[t]]);e+="}"}return e+=")"};var h=Ve;function Ve(e,t,r,n){this.identity=e,this.labels=t,this.properties=r,this.elementId=Qe(n,function(){return e.toString()})}p.Node=h,Object.defineProperty(h.prototype,Le,l),p.isNode=function(e){return qe(e,Le)};Ye.prototype.toString=function(){var e="("+this.startNodeElementId+")-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,De.stringify)(this.properties[t[r]]);e+="}"}return e+="]->("+this.endNodeElementId+")"};var He=Ye;function Ye(e,t,r,n,o,i,u,a){this.identity=e,this.start=t,this.end=r,this.type=n,this.properties=o,this.elementId=Qe(i,function(){return e.toString()}),this.startNodeElementId=Qe(u,function(){return t.toString()}),this.endNodeElementId=Qe(a,function(){return r.toString()})}p.Relationship=He,Object.defineProperty(He.prototype,Be,l),p.isRelationship=function(e){return qe(e,Be)};Ke.prototype.bind=function(e,t){return new He(this.identity,e,t,this.type,this.properties,this.elementId)},Ke.prototype.bindTo=function(e,t){return new He(this.identity,e.identity,t.identity,this.type,this.properties,this.elementId,e.elementId,t.elementId)},Ke.prototype.toString=function(){var e="-[:"+this.type,t=Object.keys(this.properties);if(0<t.length){e+=" {";for(var r=0;r<t.length;r++)0<r&&(e+=","),e+=t[r]+":"+(0,De.stringify)(this.properties[t[r]]);e+="}"}return e+="]->"};h=Ke;function Ke(e,t,r,n){this.identity=e,this.type=t,this.properties=r,this.elementId=Qe(n,function(){return e.toString()})}p.UnboundRelationship=h,Object.defineProperty(h.prototype,Fe,l),p.isUnboundRelationship=function(e){return qe(e,Fe)};function Ge(e,t,r){this.start=e,this.relationship=t,this.end=r}p.PathSegment=Ge,Object.defineProperty(Ge.prototype,ze,l),p.isPathSegment=function(e){return qe(e,ze)};function Ze(e,t,r){this.start=e,this.end=t,this.segments=r,this.length=r.length}function Qe(e,t){return null==e?t():e}p.Path=Ze,Object.defineProperty(Ze.prototype,We,l),p.isPath=function(e){return qe(e,We)};var h={},Xe=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Je=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$e=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},et=(Object.defineProperty(h,"__esModule",{value:!0}),t);function tt(e,t,r){var n;this.keys=e,this.length=e.length,this._fields=t,this._fieldLookup=null!=r?r:(n={},e.forEach(function(e,t){n[e]=t}),n)}tt.prototype.forEach=function(e){var t,r;try{for(var n=Je(this.entries()),o=n.next();!o.done;o=n.next()){var i=$e(o.value,2),u=i[0];e(i[1],u,this)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},tt.prototype.map=function(e){var t,r,n=[];try{for(var o=Je(this.entries()),i=o.next();!i.done;i=o.next()){var u=$e(i.value,2),a=u[0],s=u[1];n.push(e(s,a,this))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},tt.prototype.entries=function(){var t;return Xe(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,[this.keys[t],this._fields[t]]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},tt.prototype.values=function(){var t;return Xe(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},tt.prototype[Symbol.iterator]=function(){var t;return Xe(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.keys.length?[4,this._fields[t]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})},tt.prototype.toObject=function(){var t,e,r={};try{for(var n=Je(this.entries()),o=n.next();!o.done;o=n.next()){var i=$e(o.value,2),u=i[0],a=i[1];r[u]=a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r},tt.prototype.get=function(e){var t;if("number"!=typeof e){if(void 0===(t=this._fieldLookup[e]))throw(0,et.newError)("This record has no field with key '".concat(e.toString(),"', available keys are: [")+this.keys.toString()+"].")}else t=e;if(t>this._fields.length-1||t<0)throw(0,et.newError)("This record has no field with index '"+t.toString()+"'. Remember that indexes start at `0`, and make sure your query returns records in the shape you meant it to.");return this._fields[t]},tt.prototype.has=function(e){return"number"==typeof e?0<=e&&e<this._fields.length:void 0!==this._fieldLookup[e]},h.default=tt;var l={},rt=(Object.defineProperty(l,"__esModule",{value:!0}),l.isPoint=l.Point=void 0,u),nt="__isPoint__",b=(ot.prototype.toString=function(){return null==this.z||isNaN(this.z)?"Point{srid=".concat(it(this.srid),", x=").concat(it(this.x),", y=").concat(it(this.y),"}"):"Point{srid=".concat(it(this.srid),", x=").concat(it(this.x),", y=").concat(it(this.y),", z=").concat(it(this.z),"}")},ot);function ot(e,t,r,n){this.srid=(0,rt.assertNumberOrInteger)(e,"SRID"),this.x=(0,rt.assertNumber)(t,"X coordinate"),this.y=(0,rt.assertNumber)(r,"Y coordinate"),this.z=null==n?n:(0,rt.assertNumber)(n,"Z coordinate"),Object.freeze(this)}function it(e){return Number.isInteger(e)?e.toString()+".0":e.toString()}l.Point=b,Object.defineProperty(b.prototype,nt,{value:!0,enumerable:!1,configurable:!1,writable:!1}),l.isPoint=function(e){return null!=e&&!0===e[nt]};var b={},ut=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),at=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),st=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&ut(t,e,r);return at(t,e),t},ct=(Object.defineProperty(b,"__esModule",{value:!0}),b.Stats=b.QueryStatistics=b.ProfiledPlan=b.Plan=b.Notification=b.ServerInfo=b.queryType=void 0,st(n)),st=(lt.prototype._buildNotifications=function(e){return null==e?[]:e.map(function(e){return new yt(e)})},lt.prototype.hasPlan=function(){return this.plan instanceof ft},lt.prototype.hasProfile=function(){return this.profile instanceof pt},lt);function lt(e,t,r,n){this.query={text:e,parameters:t},this.queryType=r.type,this.counters=new ht(null!=(e=r.stats)?e:{}),this.updateStatistics=this.counters,this.plan=(null!=r.plan||null!=r.profile)&&new ft(null!=(t=r.plan)?t:r.profile),this.profile=null!=r.profile&&new pt(r.profile),this.notifications=this._buildNotifications(r.notifications),this.server=new vt(r.server,n),this.resultConsumedAfter=r.result_consumed_after,this.resultAvailableAfter=r.result_available_after,this.database={name:null!=(e=r.db)?e:null}}var ft=function t(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.children=null!=e.children?e.children.map(function(e){return new t(e)}):[]},pt=(b.Plan=ft,dt.prototype.hasPageCacheStats=function(){return 0<this.pageCacheMisses||0<this.pageCacheHits||0<this.pageCacheHitRatio},dt);function dt(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.dbHits=gt("dbHits",e),this.rows=gt("rows",e),this.pageCacheMisses=gt("pageCacheMisses",e),this.pageCacheHits=gt("pageCacheHits",e),this.pageCacheHitRatio=gt("pageCacheHitRatio",e),this.time=gt("time",e),this.children=null!=e.children?e.children.map(function(e){return new dt(e)}):[]}b.ProfiledPlan=pt;b.Stats=function(){this.nodesCreated=0,this.nodesDeleted=0,this.relationshipsCreated=0,this.relationshipsDeleted=0,this.propertiesSet=0,this.labelsAdded=0,this.labelsRemoved=0,this.indexesAdded=0,this.indexesRemoved=0,this.constraintsAdded=0,this.constraintsRemoved=0},bt.prototype.containsUpdates=function(){var r=this;return void 0!==this._containsUpdates?this._containsUpdates:0<Object.keys(this._stats).reduce(function(e,t){return e+r._stats[t]},0)},bt.prototype.updates=function(){return this._stats},bt.prototype.containsSystemUpdates=function(){return void 0!==this._containsSystemUpdates?this._containsSystemUpdates:0<this._systemUpdates},bt.prototype.systemUpdates=function(){return this._systemUpdates};var ht=bt;function bt(r){var n=this;this._stats={nodesCreated:0,nodesDeleted:0,relationshipsCreated:0,relationshipsDeleted:0,propertiesSet:0,labelsAdded:0,labelsRemoved:0,indexesAdded:0,indexesRemoved:0,constraintsAdded:0,constraintsRemoved:0},this._systemUpdates=0,Object.keys(r).forEach(function(e){var t=e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()});t in n._stats?n._stats[t]=mt(r[e]):"systemUpdates"===t?n._systemUpdates=mt(r[e]):"containsSystemUpdates"===t?n._containsSystemUpdates=r[e]:"containsUpdates"===t&&(n._containsUpdates=r[e])}),this._stats=Object.freeze(this._stats)}b.QueryStatistics=ht;_t._constructPosition=function(e){return null==e?{}:{offset:mt(e.offset),line:mt(e.line),column:mt(e.column)}};var yt=_t;function _t(e){this.code=e.code,this.title=e.title,this.description=e.description,this.severity=e.severity,this.position=_t._constructPosition(e.position)}b.Notification=yt;var vt=function(e,t){null!=e&&(this.address=e.address,this.agent=e.version),this.protocolVersion=t};function mt(e){return e instanceof ct.default?e.toInt():"bigint"==typeof e?(0,ct.int)(e).toInt():e}function gt(e,t,r){return void 0===r&&(r=0),!1!==t&&e in t?mt(t[e]):r}b.ServerInfo=vt;b.queryType={READ_ONLY:"r",READ_WRITE:"rw",WRITE_ONLY:"w",SCHEMA_WRITE:"s"},b.default=st;var st={},y={},_={},v=(Object.defineProperty(_,"__esModule",{value:!0}),_.FailedObserver=_.CompletedObserver=void 0,Ot.prototype.subscribe=function(e){Et(e,e.onKeys,[]),Et(e,e.onCompleted,{})},Ot.prototype.cancel=function(){},Ot.prototype.pause=function(){},Ot.prototype.resume=function(){},Ot.prototype.prepareToHandleSingleResponse=function(){},Ot.prototype.markCompleted=function(){},Ot.prototype.onError=function(e){throw Error("CompletedObserver not supposed to call onError")},Ot);function Ot(){}function wt(e){var t=e.error,e=e.onError;this._error=t,this._beforeError=e,this._observers=[],this.onError(t)}function Et(e,t,r){null!=t&&t.bind(e)(r)}_.CompletedObserver=v,wt.prototype.subscribe=function(e){Et(e,e.onError,this._error),this._observers.push(e)},wt.prototype.onError=function(t){Et(this,this._beforeError,t),this._observers.forEach(function(e){return Et(e,e.onError,t)})},wt.prototype.cancel=function(){},wt.prototype.pause=function(){},wt.prototype.resume=function(){},wt.prototype.markCompleted=function(){},wt.prototype.prepareToHandleSingleResponse=function(){},_.FailedObserver=wt;var v={},Pt=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),St=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),m=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Pt(t,e,r);return St(t,e),t},Tt=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},jt=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Ct=(Object.defineProperty(v,"__esModule",{value:!0}),v.Bookmarks=void 0,m(u)),m=(It.empty=function(){return Rt},It.prototype.isEmpty=function(){return 0===this._values.length},It.prototype.values=function(){return this._values},It.prototype[Symbol.iterator]=function(){return this._values[Symbol.iterator]()},It.prototype.asBeginTransactionParameters=function(){var e;return this.isEmpty()?{}:((e={}).bookmarks=this._values,e)},It);function It(e){this._values=function(e){if(null==e||""===e)return[];if(Ct.isString(e))return[e];if(Array.isArray(e)){for(var t=new Set,r=function r(e){return e.reduce(function(e,t){return Array.isArray(t)?e.concat(r(t)):e.concat(t)},[])}(e),n=0;n<r.length;n++){var o=r[n];if(null!=o){if(!Ct.isString(o))throw new TypeError("Bookmark value should be a string, given: '".concat(o,"'"));t.add(o)}}return jt([],Tt(t),!1)}throw new TypeError("Bookmarks should either be a string or a string array, given: '".concat(e,"'"))}(e)}var Rt=new(v.Bookmarks=m)(null);var kt,m={},g=(Object.defineProperty(m,"__esModule",{value:!0}),m.BOLT_PROTOCOL_V5_0=m.BOLT_PROTOCOL_V4_4=m.BOLT_PROTOCOL_V4_3=m.BOLT_PROTOCOL_V4_2=m.BOLT_PROTOCOL_V4_1=m.BOLT_PROTOCOL_V4_0=m.BOLT_PROTOCOL_V3=m.BOLT_PROTOCOL_V2=m.BOLT_PROTOCOL_V1=m.DEFAULT_POOL_MAX_SIZE=m.DEFAULT_POOL_ACQUISITION_TIMEOUT=m.DEFAULT_CONNECTION_TIMEOUT_MILLIS=m.ACCESS_MODE_WRITE=m.ACCESS_MODE_READ=m.FETCH_ALL=void 0,m.FETCH_ALL=-1,m.DEFAULT_POOL_ACQUISITION_TIMEOUT=6e4,m.DEFAULT_POOL_MAX_SIZE=100,m.DEFAULT_CONNECTION_TIMEOUT_MILLIS=3e4,m.ACCESS_MODE_READ="READ",m.ACCESS_MODE_WRITE="WRITE",m.BOLT_PROTOCOL_V1=1,m.BOLT_PROTOCOL_V2=2,m.BOLT_PROTOCOL_V3=3,m.BOLT_PROTOCOL_V4_0=4,m.BOLT_PROTOCOL_V4_1=4.1,m.BOLT_PROTOCOL_V4_2=4.2,m.BOLT_PROTOCOL_V4_3=4.3,m.BOLT_PROTOCOL_V4_4=4.4,m.BOLT_PROTOCOL_V5_0=5,{}),O=r&&r.__extends||(kt=function(e,t){return(kt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}kt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),At=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Mt=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},xt=(Object.defineProperty(g,"__esModule",{value:!0}),g.EMPTY_CONNECTION_HOLDER=g.ReadOnlyConnectionHolder=g.ConnectionHolder=void 0,t),Nt=u,Ut=m,Dt=v,w=(Lt.prototype.mode=function(){return this._mode},Lt.prototype.database=function(){return this._database},Lt.prototype.setDatabase=function(e){this._database=e},Lt.prototype.bookmarks=function(){return this._bookmarks},Lt.prototype.connectionProvider=function(){return this._connectionProvider},Lt.prototype.referenceCount=function(){return this._referenceCount},Lt.prototype.initializeConnection=function(){return 0!==this._referenceCount||null==this._connectionProvider?(this._referenceCount++,!1):(this._connectionPromise=this._createConnectionPromise(this._connectionProvider),this._referenceCount++,!0)},Lt.prototype._createConnectionPromise=function(o){return At(this,void 0,void 0,function(){var t,r,n;return Mt(this,function(e){switch(e.label){case 0:return r=(t=o).acquireConnection,n={accessMode:this._mode,database:this._database},[4,this._getBookmarks()];case 1:return[4,r.apply(t,[(n.bookmarks=e.sent(),n.impersonatedUser=this._impersonatedUser,n.onDatabaseNameResolved=this._onDatabaseNameResolved,n)])];case 2:return[2,e.sent()]}})})},Lt.prototype._getBookmarks=function(){return At(this,void 0,void 0,function(){return Mt(this,function(e){switch(e.label){case 0:return[4,this._getConnectionAcquistionBookmarks()];case 1:return[2,e.sent()]}})})},Lt.prototype.getConnection=function(){return this._connectionPromise},Lt.prototype.releaseConnection=function(){return 0===this._referenceCount?this._connectionPromise:(this._referenceCount--,0===this._referenceCount?this._releaseConnection():this._connectionPromise)},Lt.prototype.close=function(e){return 0===this._referenceCount?this._connectionPromise:(this._referenceCount=0,this._releaseConnection(e))},Lt.prototype._releaseConnection=function(t){return this._connectionPromise=this._connectionPromise.then(function(e){return null!=e?e.isOpen()&&(e.hasOngoingObservableRequests()||!0===t)?e.resetAndFlush().catch(qt).then(function(){return e._release().then(function(){return null})}):e._release().then(function(){return null}):Promise.resolve(null)}).catch(qt),this._connectionPromise},Lt);function Lt(e){var e=void 0===e?{}:e,t=e.mode,t=void 0===t?Ut.ACCESS_MODE_WRITE:t,r=e.database,r=void 0===r?"":r,n=e.bookmarks,o=e.connectionProvider,i=e.impersonatedUser,u=e.onDatabaseNameResolved,e=e.getConnectionAcquistionBookmarks;this._mode=t,this._database=null!=r?(0,Nt.assertString)(r,"database"):"",this._bookmarks=null!=n?n:Dt.Bookmarks.empty(),this._connectionProvider=o,this._impersonatedUser=i,this._referenceCount=0,this._connectionPromise=Promise.resolve(null),this._onDatabaseNameResolved=u,this._getConnectionAcquistionBookmarks=null!=e?e:function(){return Promise.resolve(Dt.Bookmarks.empty())}}g.ConnectionHolder=w;O(Wt,Bt=w),Wt.prototype.initializeConnection=function(){return 0!==this._connectionHolder.referenceCount()},Wt.prototype.getConnection=function(){return this._connectionHolder.getConnection()},Wt.prototype.releaseConnection=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})},Wt.prototype.close=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})};var Bt,Ft,E=Wt;function Wt(e){var t=Bt.call(this,{mode:e.mode(),database:e.database(),bookmarks:e.bookmarks(),getConnectionAcquistionBookmarks:e._getConnectionAcquistionBookmarks,connectionProvider:e.connectionProvider()})||this;return t._connectionHolder=e,t}function zt(){return null!==Ft&&Ft.apply(this,arguments)||this}g.ReadOnlyConnectionHolder=E,g.default=E,O(zt,Ft=w),zt.prototype.mode=function(){},zt.prototype.database=function(){},zt.prototype.initializeConnection=function(){return!0},zt.prototype.getConnection=function(){return At(this,void 0,void 0,function(){return Mt(this,function(e){switch(e.label){case 0:return[4,Promise.reject((0,xt.newError)("This connection holder does not serve connections"))];case 1:return[2,e.sent()]}})})},zt.prototype.releaseConnection=function(){return At(this,void 0,void 0,function(){return Mt(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})},zt.prototype.close=function(){return At(this,void 0,void 0,function(){return Mt(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})};E=new zt;function qt(e){return null}g.EMPTY_CONNECTION_HOLDER=E;var O={},Vt=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Ht=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),w=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Vt(t,e,r);return Ht(t,e),t},Yt=(Object.defineProperty(O,"__esModule",{value:!0}),O.TxConfig=void 0,w(u)),Kt=t,Gt=n,E=(Zt.empty=function(){return Qt},Zt.prototype.isEmpty=function(){return Object.values(this).every(function(e){return null==e})},Zt);function Zt(e){var t;null!=(t=e)&&Yt.assertObject(t,"Transaction config"),this.timeout=function(e){if(Yt.isObject(e)&&null!=e.timeout){Yt.assertNumberOrInteger(e.timeout,"Transaction timeout");e=(0,Gt.int)(e.timeout);if(e.isNegative())throw(0,Kt.newError)("Transaction timeout should not be negative");return e}return null}(e),this.metadata=function(e){if(Yt.isObject(e)&&null!=e.metadata){e=e.metadata;if(Yt.assertObject(e,"config.metadata"),0!==Object.keys(e).length)return e}return null}(e)}var Qt=new(O.TxConfig=E)({});var w={},Xt=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Jt=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},$t=(Object.defineProperty(w,"__esModule",{value:!0}),w.TransactionExecutor=void 0,t);function er(e,t,r,n){this._maxRetryTimeMs=tr(e,3e4),this._initialRetryDelayMs=tr(t,1e3),this._multiplier=tr(r,2),this._jitterFactor=tr(n,.2),this._inFlightTimeoutIds=[],this._verifyAfterConstruction()}function tr(e,t){return null!=e?e:t}er.prototype.execute=function(n,o,i){var u=this;return new Promise(function(e,t){u._executeTransactionInsidePromise(n,o,e,t,i).catch(t)}).catch(function(e){var t=Date.now(),r=u._initialRetryDelayMs;return u._retryTransactionPromise(n,o,e,t,r,i)})},er.prototype.close=function(){this._inFlightTimeoutIds.forEach(function(e){return clearTimeout(e)}),this._inFlightTimeoutIds=[]},er.prototype._retryTransactionPromise=function(o,i,e,r,u,a){var s=this;return Date.now()-r>this._maxRetryTimeMs||!(0,$t.isRetriableError)(e)?Promise.reject(e):new Promise(function(e,t){var r=s._computeDelayWithJitter(u),n=setTimeout(function(){s._inFlightTimeoutIds=s._inFlightTimeoutIds.filter(function(e){return e!==n}),s._executeTransactionInsidePromise(o,i,e,t,a).catch(t)},r);s._inFlightTimeoutIds.push(n)}).catch(function(e){var t=u*s._multiplier;return s._retryTransactionPromise(o,i,e,r,t,a)})},er.prototype._executeTransactionInsidePromise=function(o,i,u,a,s){return Xt(this,void 0,void 0,function(){var t,r,n=this;return Jt(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,o()];case 1:return t=e.sent(),[3,3];case 2:return r=e.sent(),a(r),[2];case 3:return r=(null!=s?s:function(e){return e})(t),this._safeExecuteTransactionWork(r,i).then(function(e){return n._handleTransactionWorkSuccess(e,t,u,a)}).catch(function(e){return n._handleTransactionWorkFailure(e,t,a)}),[2]}})})},er.prototype._safeExecuteTransactionWork=function(e,t){try{var r=t(e);return Promise.resolve(r)}catch(e){return Promise.reject(e)}},er.prototype._handleTransactionWorkSuccess=function(e,t,r,n){t.isOpen()?t.commit().then(function(){r(e)}).catch(function(e){n(e)}):r(e)},er.prototype._handleTransactionWorkFailure=function(e,t,r){t.isOpen()?t.rollback().catch(function(e){}).then(function(){return r(e)}).catch(r):r(e)},er.prototype._computeDelayWithJitter=function(e){var t=e*this._jitterFactor,r=e-t,e=e+t;return Math.random()*(e-r)+r},er.prototype._verifyAfterConstruction=function(){if(this._maxRetryTimeMs<0)throw(0,$t.newError)("Max retry time should be >= 0: "+this._maxRetryTimeMs.toString());if(this._initialRetryDelayMs<0)throw(0,$t.newError)("Initial retry delay should >= 0: "+this._initialRetryDelayMs.toString());if(this._multiplier<1)throw(0,$t.newError)("Multiplier should be >= 1.0: "+this._multiplier.toString());if(this._jitterFactor<0||1<this._jitterFactor)throw(0,$t.newError)("Jitter factor should be in [0.0, 1.0]: "+this._jitterFactor.toFixed())},w.TransactionExecutor=er;var rr,nr,E={},P=r&&r.__extends||(rr=function(e,t){return(rr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}rr(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),or=(Object.defineProperty(E,"__esModule",{value:!0}),E.Logger=void 0,t),ir="error",ur="warn",ar="info",sr="debug",cr=((lr={})[ir]=0,lr[ur]=1,lr[ar]=2,lr[sr]=3,lr),lr=(fr.create=function(e){return null!=(null==e?void 0:e.logging)?new fr(function(e){if(null==(null==e?void 0:e.level))return"info";var e=e.level,t=cr[e];if(null!=t||0===t)return e;throw(0,or.newError)("Illegal logging level: ".concat(e,". Supported levels are: ").concat(Object.keys(cr).toString()))}(e=e.logging),function(e){if(null!=(null==e?void 0:e.logger)){var t=e.logger;if(null!=t&&"function"==typeof t)return t}throw(0,or.newError)("Illegal logger function: ".concat(null!=(e=null==(t=null==e?void 0:e.logger)?void 0:t.toString())?e:"undefined"))}(e)):this.noOp()},fr.noOp=function(){return dr},fr.prototype.isErrorEnabled=function(){return hr(this._level,ir)},fr.prototype.error=function(e){this.isErrorEnabled()&&this._loggerFunction(ir,e)},fr.prototype.isWarnEnabled=function(){return hr(this._level,ur)},fr.prototype.warn=function(e){this.isWarnEnabled()&&this._loggerFunction(ur,e)},fr.prototype.isInfoEnabled=function(){return hr(this._level,ar)},fr.prototype.info=function(e){this.isInfoEnabled()&&this._loggerFunction(ar,e)},fr.prototype.isDebugEnabled=function(){return hr(this._level,sr)},fr.prototype.debug=function(e){this.isDebugEnabled()&&this._loggerFunction(sr,e)},fr);function fr(e,t){this._level=e,this._loggerFunction=t}function pr(){return nr.call(this,ar,function(e,t){})||this}E.Logger=lr,P(pr,nr=lr),pr.prototype.isErrorEnabled=function(){return!1},pr.prototype.error=function(e){},pr.prototype.isWarnEnabled=function(){return!1},pr.prototype.warn=function(e){},pr.prototype.isInfoEnabled=function(){return!1},pr.prototype.info=function(e){},pr.prototype.isDebugEnabled=function(){return!1},pr.prototype.debug=function(e){};var dr=new pr;function hr(e,t){return cr[e]>=cr[t]}var P={},br=r&&r.__assign||function(){return(br=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},yr=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},_r=(Object.defineProperty(P,"__esModule",{value:!0}),P.Url=P.formatIPv6Address=P.formatIPv4Address=P.defaultPortForScheme=P.parseDatabaseUrl=void 0,u),vr=7687,mr=7474,gr=7473,Or=function(e,t,r,n,o){this.scheme=e,this.host=t,this.port=r,this.hostAndPort=n,this.query=o};function wr(e,t,r){if(""===(e=(null!=e?e:"").trim()))throw new Error("Illegal empty ".concat(t," in URL query '").concat(r,"'"));return e}function Er(e){var t="["===e.charAt(0),r="]"===e.charAt(e.length-1);if(t||r){if(t&&r)return e;throw new Error("Illegal IPv6 address ".concat(e))}return"[".concat(e,"]")}function Pr(e){return"http"===e?mr:"https"===e?gr:vr}P.Url=Or,P.parseDatabaseUrl=function(e){(0,_r.assertString)(e,"URL");var t,r=function(e){function u(e,t){t=e.indexOf(t);return 0<=t?[e.substring(0,t),e[t],e.substring(t+1)]:[e,"",""]}function t(e){var t,r={},n=((t="@")===(t=0<=(t=(o=e).lastIndexOf(t))?[o.substring(0,t),o[t],o.substring(t+1)]:["","",o])[1]&&(r.userInfo=decodeURIComponent(t[0]),e=t[2]),yr((o="]",n=u(n=e,i="["),[(i=u(n[2],o))[0],i[2]]),2)),o=n[0],i=n[1];return""!==o?(r.host=o,t=u(i,":")):(t=u(e,":"),r.host=t[0]),":"===t[1]&&(r.port=t[2]),r}var r,n={};":"===(r=u(e,":"))[1]&&(n.scheme=decodeURIComponent(r[0]),e=r[2]);"#"===(r=u(e,"#"))[1]&&(n.fragment=decodeURIComponent(r[2]),e=r[0]);"?"===(r=u(e,"?"))[1]&&(n.query=r[2],e=r[0]);e.startsWith("//")?(r=u(e.substr(2),"/"),(n=br(br({},n),t(r[0]))).path=r[1]+r[2]):n.path=e;return n}((n=(n=(n=e).trim()).includes("://")?{schemeMissing:!1,url:n}:{schemeMissing:!0,url:"none://".concat(n)}).url),n=n.schemeMissing?null:function(e){if(null==e)return null;":"===(e=e.trim()).charAt(e.length-1)&&(e=e.substring(0,e.length-1));return e}(r.scheme),o=function(e){if(null!=e)return e.trim();throw new Error("Unable to extract host from null or undefined URL")}(r.host),i=function(e){if(""!==e&&null!=e)return e.includes(":")?Er(e):e;throw new Error("Illegal host ".concat(e))}(o),u=function(e,t){e="string"==typeof e?parseInt(e,10):e;return null==e||isNaN(e)?Pr(t):e}(r.port,n),i="".concat(i,":").concat(u),r=function(e,r){var e=null!=e?function(e){"?"===(null==(e=(null!=e?e:"").trim())?void 0:e.charAt(0))&&(e=e.substring(1,e.length));return e}(e):null,n={};null!=e&&e.split("&").forEach(function(e){e=e.split("=");if(2!==e.length)throw new Error("Invalid parameters: '".concat(e.toString(),"' in URL '").concat(r,"'."));var t=wr(e[0],"key",r),e=wr(e[1],"value",r);if(void 0!==n[t])throw new Error("Duplicated query parameters with key '".concat(t,"' in URL '").concat(r,"'"));n[t]=e});return n}(null!=(t=r.query)?t:"string"==typeof(t=r.resourceName)?yr(t.split("?"),2)[1]:null,e);return new Or(n,o,u,i,r)},P.formatIPv4Address=function(e,t){return"".concat(e,":").concat(t)},P.formatIPv6Address=function(e,t){return e=Er(e),"".concat(e,":").concat(t)},P.defaultPortForScheme=Pr;var lr={},Sr=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Tr=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jr=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Sr(t,e,r);return Tr(t,e),t},Cr=(Object.defineProperty(lr,"__esModule",{value:!0}),lr.ServerAddress=void 0,u),Ir=jr(P);function Rr(e,t,r,n){this._host=(0,Cr.assertString)(e,"host"),this._resolved=null!=t?(0,Cr.assertString)(t,"resolved"):null,this._port=(0,Cr.assertNumber)(r,"port"),this._hostPort=n,this._stringValue=null!=t?"".concat(n,"(").concat(t,")"):"".concat(n)}Rr.prototype.host=function(){return this._host},Rr.prototype.resolvedHost=function(){return null!=this._resolved?this._resolved:this._host},Rr.prototype.port=function(){return this._port},Rr.prototype.resolveWith=function(e){return new Rr(this._host,e,this._port,this._hostPort)},Rr.prototype.asHostPort=function(){return this._hostPort},Rr.prototype.asKey=function(){return this._hostPort},Rr.prototype.toString=function(){return this._stringValue},Rr.fromUrl=function(e){e=Ir.parseDatabaseUrl(e);return new Rr(e.host,null,e.port,e.hostAndPort)},lr.ServerAddress=Rr;var jr={},kr={};function Ar(){}Object.defineProperty(kr,"__esModule",{value:!0}),Ar.prototype.resolve=function(){throw new Error("Abstract function")},Ar.prototype._resolveToItself=function(e){return Promise.resolve([e])},kr.default=Ar;var Mr={},xr=(Object.defineProperty(Mr,"__esModule",{value:!0}),lr);function Nr(e){return Promise.resolve([e])}function Ur(e){this._resolverFunction=null!=e?e:Nr}Ur.prototype.resolve=function(t){var r=this;return new Promise(function(e){return e(r._resolverFunction(t.asHostPort()))}).then(function(e){if(Array.isArray(e))return e.map(function(e){return xr.ServerAddress.fromUrl(e)});throw new TypeError("Configured resolver function should either return an array of addresses or a Promise resolved with an array of addresses."+"Each address is '<host>:<port>'. Got: ".concat(e))})},Mr.default=Ur;function Dr(e){console.log("Uncaught error when processing result: "+e)}function Lr(e){}function Br(e){}var S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},kr=(Object.defineProperty(jr,"__esModule",{value:!0}),jr.ConfiguredCustomResolver=jr.BaseHostNameResolver=void 0,S(kr)),kr=(jr.BaseHostNameResolver=kr.default,S(Mr)),Fr=(jr.ConfiguredCustomResolver=kr.default,r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]})),Wr=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),S=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Fr(t,e,r);return Wr(t,e),t},kr=(Object.defineProperty(y,"__esModule",{value:!0}),y.objectUtil=y.resolver=y.serverAddress=y.urlUtil=y.logger=y.transactionExecutor=y.txConfig=y.connectionHolder=y.constants=y.bookmarks=y.observer=y.temporalUtil=y.util=void 0,S(u)),kr=(y.util=kr,S(o)),o=(y.temporalUtil=kr,S(_)),kr=(y.observer=o,S(v)),o=(y.bookmarks=kr,S(m)),kr=(y.constants=o,S(g)),o=(y.connectionHolder=kr,S(O)),kr=(y.txConfig=o,S(w)),o=(y.transactionExecutor=kr,S(E)),kr=(y.logger=o,S(P)),o=(y.urlUtil=kr,S(lr)),P=(y.serverAddress=o,S(jr)),kr=(y.resolver=P,S(s)),zr=(y.objectUtil=kr,r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})}),qr=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},lr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Vr=(Object.defineProperty(st,"__esModule",{value:!0}),lr(b)),Hr=y,Yr=t,Kr=Hr.connectionHolder.EMPTY_CONNECTION_HOLDER;function Gr(e,t,r,n,o){var i;void 0===o&&(o={high:Number.MAX_VALUE,low:Number.MAX_VALUE}),this._stack=null==(i=new Error("")).stack?null:i.stack.replace(/^Error(\n\r)*/,""),this._streamObserverPromise=e,this._p=null,this._query=t,this._parameters=null!=r?r:{},this._connectionHolder=null!=n?n:Kr,this._keys=null,this._summary=null,this._error=null,this._watermarks=o}Gr.prototype.keys=function(){var n=this;return null!==this._keys?Promise.resolve(this._keys):null!==this._error?Promise.reject(this._error):new Promise(function(t,r){n._streamObserverPromise.then(function(e){return e.subscribe(n._decorateObserver({onKeys:function(e){return t(e)},onError:function(e){return r(e)}}))}).catch(r)})},Gr.prototype.summary=function(){var n=this;return null!==this._summary?Promise.resolve(this._summary):null!==this._error?Promise.reject(this._error):new Promise(function(t,r){n._streamObserverPromise.then(function(e){e.cancel(),e.subscribe(n._decorateObserver({onCompleted:function(e){return t(e)},onError:function(e){return r(e)}}))}).catch(r)})},Gr.prototype._getOrCreatePromise=function(){var e=this;return null==this._p&&(this._p=new Promise(function(t,r){var n=[];e.subscribe({onNext:function(e){n.push(e)},onCompleted:function(e){t({records:n,summary:e})},onError:function(e){r(e)}})})),this._p},Gr.prototype[Symbol.asyncIterator]=function(){var e,n=this;if(!this.isOpen())return e=(0,Yr.newError)("Result is already consumed"),{next:function(){return Promise.reject(e)},peek:function(){return Promise.reject(e)}};function o(){return zr(n,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:return void 0!==u.queuedObserver?[3,2]:(u.queuedObserver=this._createQueuedResultObserver(r),t=u,[4,this._subscribe(u.queuedObserver,!0).catch(function(){})]);case 1:t.streaming=e.sent(),r(),e.label=2;case 2:return[2,u.queuedObserver]}})})}function i(e){if(void 0===e)throw(0,Yr.newError)("InvalidState: Result stream finished without Summary",Yr.PROTOCOL_ERROR);return 1}var u={paused:!0,firstRun:!0,finished:!1},r=function(){var e,t;null!=u.streaming&&(e=(t=null!=(t=null==(t=u.queuedObserver)?void 0:t.size)?t:0)>=n._watermarks.high,t=t<=n._watermarks.low,e&&!u.paused?(u.paused=!0,u.streaming.pause()):(t&&u.paused||u.firstRun&&!e)&&(u.firstRun=!1,u.paused=!1,u.streaming.resume()))};return{next:function(){return zr(n,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:return u.finished&&i(u.summary)?[2,{done:!0,value:u.summary}]:[4,o()];case 1:return[4,e.sent().dequeue()];case 2:return!0===(t=e.sent()).done&&(u.finished=t.done,u.summary=t.value),[2,t]}})})},return:function(r){return zr(n,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:return u.finished&&i(u.summary)?[2,{done:!0,value:null!=r?r:u.summary}]:(null!=(t=u.streaming)&&t.cancel(),[4,o()]);case 1:return[4,e.sent().dequeueUntilDone()];case 2:return t=e.sent(),u.finished=!0,t.value=null!=r?r:t.value,u.summary=t.value,[2,t]}})})},peek:function(){return zr(n,void 0,void 0,function(){return qr(this,function(e){switch(e.label){case 0:return u.finished&&i(u.summary)?[2,{done:!0,value:u.summary}]:[4,o()];case 1:return[4,e.sent().head()];case 2:return[2,e.sent()]}})})}}},Gr.prototype.then=function(e,t){return this._getOrCreatePromise().then(e,t)},Gr.prototype.catch=function(e){return this._getOrCreatePromise().catch(e)},Gr.prototype.finally=function(e){return this._getOrCreatePromise().finally(e)},Gr.prototype.subscribe=function(e){this._subscribe(e).catch(function(){})},Gr.prototype.isOpen=function(){return null===this._summary&&null===this._error},Gr.prototype._subscribe=function(e,t){void 0===t&&(t=!1);var r=this._decorateObserver(e);return this._streamObserverPromise.then(function(e){return t&&e.pause(),e.subscribe(r),e}).catch(function(e){return null!=r.onError&&r.onError(e),Promise.reject(e)})},Gr.prototype._decorateObserver=function(n){var e,o=this,t=null!=(e=n.onCompleted)?e:Lr,i=null!=(e=n.onError)?e:Dr,r=null!=(e=n.onKeys)?e:Br;return{onNext:null!=n.onNext?n.onNext.bind(n):void 0,onKeys:function(e){return o._keys=e,r.call(n,e)},onCompleted:function(e){o._releaseConnectionAndGetSummary(e).then(function(e){return null!==o._summary?t.call(n,o._summary):(o._summary=e,t.call(n,e))}).catch(i)},onError:function(r){o._connectionHolder.releaseConnection().then(function(){var e,t;e=r,null!=(t=o._stack)&&(e.stack=e.toString()+"\n"+t),o._error=r,i.call(n,r)}).catch(i)}}},Gr.prototype._cancel=function(){null===this._summary&&null===this._error&&this._streamObserverPromise.then(function(e){return e.cancel()}).catch(function(){})},Gr.prototype._releaseConnectionAndGetSummary=function(t){var e=Hr.util.validateQueryAndParameters(this._query,this._parameters,{skipAsserts:!0}),r=e.validatedQuery,n=e.params,o=this._connectionHolder;return o.getConnection().then(function(t){return o.releaseConnection().then(function(){var e;return null==(e=null==t?void 0:t.protocol())?void 0:e.version})},function(e){}).then(function(e){return new Vr.default(r,n,t,e)})},Gr.prototype._createQueuedResultObserver=function(n){var e=this;function o(){var r={};return r.promise=new Promise(function(e,t){r.resolve=e,r.reject=t}),r}function i(e){return e instanceof Error}function r(){var r;return zr(this,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:if(0<u.length){if(t=null!=(r=u.shift())?r:(0,Yr.newError)("Unexpected empty buffer",Yr.PROTOCOL_ERROR),n(),i(t))throw t;return[2,t]}return a.resolvable=o(),[4,a.resolvable.promise];case 1:return[2,e.sent()]}})})}var u=[],a={resolvable:null},t={onNext:function(e){t._push({done:!1,value:e})},onCompleted:function(e){t._push({done:!0,value:e})},onError:function(e){t._push(e)},_push:function(e){var t;null!==a.resolvable?(t=a.resolvable,a.resolvable=null,i(e)?t.reject(e):t.resolve(e)):(u.push(e),n())},dequeue:r,dequeueUntilDone:function(){return zr(e,void 0,void 0,function(){var t;return qr(this,function(e){switch(e.label){case 0:return[4,r()];case 1:return!0===(t=e.sent()).done?[2,t]:[3,0];case 2:return[2]}})})},head:function(){return zr(e,void 0,void 0,function(){var t,r;return qr(this,function(e){switch(e.label){case 0:if(0<u.length){if(i(t=u[0]))throw t;return[2,t]}a.resolvable=o(),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,a.resolvable.promise];case 2:return t=e.sent(),u.unshift(t),[2,t];case 3:throw r=e.sent(),u.unshift(r),r;case 4:return n(),[7];case 5:return[2]}})})},get size(){return u.length}};return t},st.default=Gr;o={};Object.defineProperty(o,"__esModule",{value:!0});o.default=function(e,t,r){this.keys=e,this.records=t,this.summary=r};jr={};function Zr(){}Object.defineProperty(jr,"__esModule",{value:!0}),Zr.prototype.acquireConnection=function(e){throw Error("Not implemented")},Zr.prototype.supportsMultiDb=function(){throw Error("Not implemented")},Zr.prototype.supportsTransactionConfig=function(){throw Error("Not implemented")},Zr.prototype.supportsUserImpersonation=function(){throw Error("Not implemented")},Zr.prototype.verifyConnectivityAndGetServerInfo=function(e){throw Error("Not implemented")},Zr.prototype.getNegotiatedProtocolVersion=function(){throw Error("Not Implemented")},Zr.prototype.close=function(){throw Error("Not implemented")},jr.default=Zr;P={};function Qr(){}Object.defineProperty(P,"__esModule",{value:!0}),Object.defineProperty(Qr.prototype,"id",{get:function(){return""},enumerable:!1,configurable:!0}),Object.defineProperty(Qr.prototype,"databaseId",{get:function(){return""},enumerable:!1,configurable:!0}),Object.defineProperty(Qr.prototype,"server",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(Qr.prototype,"address",{get:function(){},enumerable:!1,configurable:!0}),Object.defineProperty(Qr.prototype,"version",{get:function(){},enumerable:!1,configurable:!0}),Qr.prototype.isOpen=function(){return!1},Qr.prototype.protocol=function(){throw Error("Not implemented")},Qr.prototype.connect=function(e,t){throw Error("Not implemented")},Qr.prototype.write=function(e,t,r){throw Error("Not implemented")},Qr.prototype.resetAndFlush=function(){throw Error("Not implemented")},Qr.prototype.hasOngoingObservableRequests=function(){throw Error("Not implemented")},Qr.prototype.close=function(){throw Error("Not implemented")},Qr.prototype._release=function(){return Promise.resolve()},P.default=Qr;var S={},Xr=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Jr=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},s=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},$r=(Object.defineProperty(S,"__esModule",{value:!0}),u),en=g,tn=v,rn=O,nn=_,on=t,un=s(st);function an(e){var t=e.connectionHolder,r=e.onClose,n=e.onBookmarks,o=e.onConnection,i=e.reactive,u=e.fetchSize,a=e.impersonatedUser,s=e.highRecordWatermark,e=e.lowRecordWatermark,c=this;this._connectionHolder=t,this._reactive=i,this._state=sn.ACTIVE,this._onClose=r,this._onBookmarks=n,this._onConnection=o,this._onError=this._onErrorCallback.bind(this),this._fetchSize=u,this._onComplete=this._onCompleteCallback.bind(this),this._results=[],this._impersonatedUser=a,this._lowRecordWatermak=e,this._highRecordWatermark=s,this._bookmarks=tn.Bookmarks.empty(),this._acceptActive=function(){},this._activePromise=new Promise(function(e,t){c._acceptActive=e})}an.prototype._begin=function(o,i,u){var t=this;this._connectionHolder.getConnection().then(function(n){return Xr(t,void 0,void 0,function(){var t,r=this;return Jr(this,function(e){switch(e.label){case 0:return(this._onConnection(),null==n)?[3,2]:(t=this,[4,o()]);case 1:return t._bookmarks=e.sent(),[2,n.protocol().beginTransaction({bookmarks:this._bookmarks,txConfig:i,mode:this._connectionHolder.mode(),database:this._connectionHolder.database(),impersonatedUser:this._impersonatedUser,beforeError:function(e){return null!=u&&u.onError(e),r._onError(e)},afterComplete:function(e){return null!=u&&u.onComplete(e),r._onComplete(e)}})];case 2:throw(0,on.newError)("No connection available")}})})}).catch(function(e){null!=u&&u.onError(e),t._onError(e).catch(function(){})}).finally(function(){return t._acceptActive()})},an.prototype.run=function(e,t){e=(0,$r.validateQueryAndParameters)(e,t),t=e.validatedQuery,e=e.params,t=this._state.run(t,e,{connectionHolder:this._connectionHolder,onError:this._onError,onComplete:this._onComplete,onConnection:this._onConnection,reactive:this._reactive,fetchSize:this._fetchSize,highRecordWatermark:this._highRecordWatermark,lowRecordWatermark:this._lowRecordWatermak,preparationJob:this._activePromise});return this._results.push(t),t},an.prototype.commit=function(){var t=this,r=this._state.commit({connectionHolder:this._connectionHolder,onError:this._onError,onComplete:function(e){return t._onCompleteCallback(e,t._bookmarks)},onConnection:this._onConnection,pendingResults:this._results,preparationJob:this._activePromise});return this._state=r.state,this._onClose(),new Promise(function(e,t){r.result.subscribe({onCompleted:function(){return e()},onError:function(e){return t(e)}})})},an.prototype.rollback=function(){var r=this._state.rollback({connectionHolder:this._connectionHolder,onError:this._onError,onComplete:this._onComplete,onConnection:this._onConnection,pendingResults:this._results,preparationJob:this._activePromise});return this._state=r.state,this._onClose(),new Promise(function(e,t){r.result.subscribe({onCompleted:function(){return e()},onError:function(e){return t(e)}})})},an.prototype.isOpen=function(){return this._state===sn.ACTIVE},an.prototype.close=function(){return Xr(this,void 0,void 0,function(){return Jr(this,function(e){switch(e.label){case 0:return this.isOpen()?[4,this.rollback()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},an.prototype._onErrorCallback=function(){return this._state=sn.FAILED,this._onClose(),this._connectionHolder.releaseConnection()},an.prototype._onCompleteCallback=function(e,t){this._onBookmarks(new tn.Bookmarks(null==e?void 0:e.bookmark),null!=t?t:tn.Bookmarks.empty(),null==e?void 0:e.db)};var sn={ACTIVE:{commit:function(e){return{result:cn(!0,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:sn.SUCCEEDED}},rollback:function(e){return{result:cn(!1,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:sn.ROLLED_BACK}},run:function(t,r,e){var n=e.connectionHolder,o=e.onError,i=e.onComplete,u=e.onConnection,a=e.reactive,s=e.fetchSize,c=e.highRecordWatermark,l=e.lowRecordWatermark,e=e.preparationJob,f=null!=e?e:Promise.resolve();return ln(n.getConnection().then(function(e){return f.then(function(){return e})}).then(function(e){if(u(),null!=e)return e.protocol().run(t,r,{bookmarks:tn.Bookmarks.empty(),txConfig:rn.TxConfig.empty(),beforeError:o,afterComplete:i,reactive:a,fetchSize:s,highRecordWatermark:c,lowRecordWatermark:l});throw(0,on.newError)("No connection available")}).catch(function(e){return new nn.FailedObserver({error:e,onError:o})}),t,r,n,c,l)}},FAILED:{commit:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot commit this transaction, because it has been rolled back either because of an error or explicit termination."),onError:r}),"COMMIT",{},t,0,0),state:sn.FAILED}},rollback:function(e){var t=e.connectionHolder;return e.onError,e.onComplete,{result:ln(new nn.CompletedObserver,"ROLLBACK",{},t,0,0),state:sn.FAILED}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,ln(new nn.FailedObserver({error:(0,on.newError)("Cannot run query in this transaction, because it has been rolled back either because of an error or explicit termination."),onError:o}),e,t,n,0,0)}},SUCCEEDED:{commit:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot commit this transaction, because it has already been committed."),onError:r}),"COMMIT",{},en.EMPTY_CONNECTION_HOLDER,0,0),state:sn.SUCCEEDED,connectionHolder:t}},rollback:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot rollback this transaction, because it has already been committed."),onError:r}),"ROLLBACK",{},en.EMPTY_CONNECTION_HOLDER,0,0),state:sn.SUCCEEDED,connectionHolder:t}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,ln(new nn.FailedObserver({error:(0,on.newError)("Cannot run query in this transaction, because it has already been committed."),onError:o}),e,t,n,0,0)}},ROLLED_BACK:{commit:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot commit this transaction, because it has already been rolled back."),onError:r}),"COMMIT",{},t,0,0),state:sn.ROLLED_BACK}},rollback:function(e){var t=e.connectionHolder;return e.onError,e.onComplete,{result:ln(new nn.FailedObserver({error:(0,on.newError)("Cannot rollback this transaction, because it has already been rolled back.")}),"ROLLBACK",{},t,0,0),state:sn.ROLLED_BACK}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,ln(new nn.FailedObserver({error:(0,on.newError)("Cannot run query in this transaction, because it has already been rolled back."),onError:o}),e,t,n,0,0)}}};function cn(r,e,n,o,i,u,t){var a=null!=t?t:Promise.resolve(),t=e.getConnection().then(function(e){return a.then(function(){return e})}).then(function(t){return i(),u.forEach(function(e){return e._cancel()}),Promise.all(u.map(function(e){return e.summary()})).then(function(e){if(null!=t)return r?t.protocol().commitTransaction({beforeError:n,afterComplete:o}):t.protocol().rollbackTransaction({beforeError:n,afterComplete:o});throw(0,on.newError)("No connection available")})}).catch(function(e){return new nn.FailedObserver({error:e,onError:n})});return new un.default(t,r?"COMMIT":"ROLLBACK",{},e,{high:Number.MAX_VALUE,low:Number.MAX_VALUE})}function ln(e,t,r,n,o,i){return void 0===n&&(n=en.EMPTY_CONNECTION_HOLDER),new un.default(Promise.resolve(e),t,r,new en.ReadOnlyConnectionHolder(null!=n?n:en.EMPTY_CONNECTION_HOLDER),{low:i,high:o})}S.default=an;kr={};function fn(e){e=e.run;this._run=e}Object.defineProperty(kr,"__esModule",{value:!0}),fn.fromTransaction=function(e){return new fn({run:e.run.bind(e)})},fn.prototype.run=function(e,t){return this._run(e,t)},kr.default=fn;var pn,dn,hn,lr={},s=r&&r.__extends||(pn=function(e,t){return(pn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}pn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),bn=r&&r.__assign||function(){return(bn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},yn=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yn=(Object.defineProperty(lr,"__esModule",{value:!0}),yn(S)),yn=(hn=yn.default,s(_n,hn),_n.prototype.then=function(e,t){return this._getOrCreateBeginPromise().then(e,t)},_n.prototype.catch=function(e){return this._getOrCreateBeginPromise().catch(e)},_n.prototype.finally=function(e){return this._getOrCreateBeginPromise().finally(e)},_n.prototype._getOrCreateBeginPromise=function(){var r=this;return null==this._beginPromise&&(this._beginPromise=new Promise(function(e,t){r._resolve=e,r._reject=t,null!=r._beginError&&t(r._beginError),null!=r._beginMetadata&&e(r._toTransaction())})),this._beginPromise},_n.prototype._toTransaction=function(){return bn(bn({},this),{run:hn.prototype.run.bind(this),commit:hn.prototype.commit.bind(this),rollback:hn.prototype.rollback.bind(this),close:hn.prototype.close.bind(this),isOpen:hn.prototype.isOpen.bind(this),_begin:this._begin.bind(this)})},_n.prototype._begin=function(e,t){return hn.prototype._begin.call(this,e,t,{onError:this._onBeginError.bind(this),onComplete:this._onBeginMetadata.bind(this)})},_n.prototype._onBeginError=function(e){this._beginError=e,null!=this._reject&&this._reject(e)},_n.prototype._onBeginMetadata=function(e){this._beginMetadata=null!=e?e:{},null!=this._resolve&&this._resolve(this._toTransaction())},_n);function _n(e){var t=e.connectionHolder,r=e.onClose,n=e.onBookmarks,o=e.onConnection,i=e.reactive,u=e.fetchSize,a=e.impersonatedUser,s=e.highRecordWatermark,e=e.lowRecordWatermark,t=hn.call(this,{connectionHolder:t,onClose:r,onBookmarks:n,onConnection:o,reactive:i,fetchSize:u,impersonatedUser:a,highRecordWatermark:s,lowRecordWatermark:e})||this;return t[dn]="TransactionPromise",t}dn=Symbol.toStringTag,lr.default=yn;var s={},vn=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},mn=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},gn=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},On=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},yn=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},wn=(Object.defineProperty(s,"__esModule",{value:!0}),_),En=u,Pn=m,Sn=t,Tn=yn(st),jn=g,Cn=w,In=v,Rn=O,kn=yn(lr),An=yn(kr);function Mn(e){var t=e.mode,r=e.connectionProvider,n=e.bookmarks,o=e.database,i=e.config,u=e.reactive,a=e.fetchSize,s=e.impersonatedUser,e=e.bookmarkManager,t=(this._mode=t,this._database=o,this._reactive=u,this._fetchSize=a,this._onDatabaseNameResolved=this._onDatabaseNameResolved.bind(this),this._getConnectionAcquistionBookmarks=this._getConnectionAcquistionBookmarks.bind(this),this._readConnectionHolder=new jn.ConnectionHolder({mode:Pn.ACCESS_MODE_READ,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved,getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks}),this._writeConnectionHolder=new jn.ConnectionHolder({mode:Pn.ACCESS_MODE_WRITE,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved,getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks}),this._open=!0,this._hasTx=!1,this._impersonatedUser=s,this._lastBookmarks=null!=n?n:In.Bookmarks.empty(),this._configuredBookmarks=this._lastBookmarks,this._transactionExecutor=function(e){e=null!=(e=null==e?void 0:e.maxTransactionRetryTime)?e:null;return new Cn.TransactionExecutor(e)}(i),this._databaseNameResolved=""!==this._database,this._calculateWatermaks());this._lowRecordWatermark=t.low,this._highRecordWatermark=t.high,this._results=[],this._bookmarkManager=e}Mn.prototype.run=function(e,t,r){var o=this,e=(0,En.validateQueryAndParameters)(e,t),i=e.validatedQuery,u=e.params,a=null!=r?new Rn.TxConfig(r):Rn.TxConfig.empty(),t=this._run(i,u,function(n){return vn(o,void 0,void 0,function(){var t,r=this;return mn(this,function(e){switch(e.label){case 0:return[4,this._bookmarks()];case 1:return t=e.sent(),this._assertSessionIsOpen(),[2,n.protocol().run(i,u,{bookmarks:t,txConfig:a,mode:this._mode,database:this._database,impersonatedUser:this._impersonatedUser,afterComplete:function(e){return r._onCompleteCallback(e,t)},reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark})]}})})});return this._results.push(t),t},Mn.prototype._run=function(e,t,r){var n=this._connectionHolderWithMode(this._mode),o=this._open?!this._hasTx&&n.initializeConnection()?n.getConnection().then(function(e){return r(e)}).catch(function(e){return Promise.resolve(new wn.FailedObserver({error:e}))}):Promise.resolve(new wn.FailedObserver({error:(0,Sn.newError)("Queries cannot be run directly on a session with an open transaction; either run from within the transaction or use a different session.")})):Promise.resolve(new wn.FailedObserver({error:(0,Sn.newError)("Cannot run query in a closed session.")})),i={high:this._highRecordWatermark,low:this._lowRecordWatermark};return new Tn.default(o,e,t,n,i)},Mn.prototype._acquireConnection=function(t){var e=this,r=this._connectionHolderWithMode(this._mode),n=this._open?!this._hasTx&&r.initializeConnection()?r.getConnection().then(function(e){return t(e)}).then(function(t){return vn(e,void 0,void 0,function(){return mn(this,function(e){switch(e.label){case 0:return[4,r.releaseConnection()];case 1:return e.sent(),[2,t]}})})}):Promise.reject((0,Sn.newError)("Queries cannot be run directly on a session with an open transaction; either run from within the transaction or use a different session.")):Promise.reject((0,Sn.newError)("Cannot run query in a closed session."));return n},Mn.prototype.beginTransaction=function(e){var t=Rn.TxConfig.empty();return null!=e&&(t=new Rn.TxConfig(e)),this._beginTransaction(this._mode,t)},Mn.prototype._beginTransaction=function(e,t){var n=this;if(!this._open)throw(0,Sn.newError)("Cannot begin a transaction on a closed session.");if(this._hasTx)throw(0,Sn.newError)("You cannot begin a transaction on a session with an open transaction; either run from within the transaction or use a different session.");e=Mn._validateSessionMode(e),e=this._connectionHolderWithMode(e),e.initializeConnection(),this._hasTx=!0,e=new kn.default({connectionHolder:e,impersonatedUser:this._impersonatedUser,onClose:this._transactionClosed.bind(this),onBookmarks:function(e,t,r){return n._updateBookmarks(e,t,r)},onConnection:this._assertSessionIsOpen.bind(this),reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark});return e._begin(function(){return n._bookmarks()},t),e},Mn.prototype._assertSessionIsOpen=function(){if(!this._open)throw(0,Sn.newError)("You cannot run more transactions on a closed session.")},Mn.prototype._transactionClosed=function(){this._hasTx=!1},Mn.prototype.lastBookmark=function(){return this.lastBookmarks()},Mn.prototype.lastBookmarks=function(){return this._lastBookmarks.values()},Mn.prototype._bookmarks=function(){var r;return vn(this,void 0,void 0,function(){var t;return mn(this,function(e){switch(e.label){case 0:return[4,null==(r=this._bookmarkManager)?void 0:r.getBookmarks()];case 1:return void 0===(t=e.sent())?[2,this._lastBookmarks]:[2,new In.Bookmarks(On(On([],gn(t),!1),gn(this._configuredBookmarks),!1))]}})})},Mn.prototype.readTransaction=function(e,t){t=new Rn.TxConfig(t);return this._runTransaction(Pn.ACCESS_MODE_READ,t,e)},Mn.prototype.writeTransaction=function(e,t){t=new Rn.TxConfig(t);return this._runTransaction(Pn.ACCESS_MODE_WRITE,t,e)},Mn.prototype._runTransaction=function(e,t,r){var n=this;return this._transactionExecutor.execute(function(){return n._beginTransaction(e,t)},r)},Mn.prototype.executeRead=function(e,t){t=new Rn.TxConfig(t);return this._executeInTransaction(Pn.ACCESS_MODE_READ,t,e)},Mn.prototype.executeWrite=function(e,t){t=new Rn.TxConfig(t);return this._executeInTransaction(Pn.ACCESS_MODE_WRITE,t,e)},Mn.prototype._executeInTransaction=function(e,t,r){var n=this;return this._transactionExecutor.execute(function(){return n._beginTransaction(e,t)},r,An.default.fromTransaction)},Mn.prototype._onDatabaseNameResolved=function(e){this._databaseNameResolved||(this._database=e=null!=e?e:"",this._readConnectionHolder.setDatabase(e),this._writeConnectionHolder.setDatabase(e),this._databaseNameResolved=!0)},Mn.prototype._getConnectionAcquistionBookmarks=function(){var r;return vn(this,void 0,void 0,function(){var t;return mn(this,function(e){switch(e.label){case 0:return[4,null==(r=this._bookmarkManager)?void 0:r.getBookmarks()];case 1:return void 0===(t=e.sent())?[2,this._lastBookmarks]:[2,new In.Bookmarks(On(On([],gn(this._configuredBookmarks),!1),gn(t),!1))]}})})},Mn.prototype._updateBookmarks=function(e,t,r){var n;null==e||e.isEmpty()||(null!=(n=this._bookmarkManager)&&n.updateBookmarks(null!=(n=null==t?void 0:t.values())?n:[],null!=(t=null==e?void 0:e.values())?t:[]),this._lastBookmarks=e,this._configuredBookmarks=In.Bookmarks.empty())},Mn.prototype.close=function(){return vn(this,void 0,void 0,function(){return mn(this,function(e){switch(e.label){case 0:return this._open?(this._open=!1,this._results.forEach(function(e){return e._cancel()}),this._transactionExecutor.close(),[4,this._readConnectionHolder.close(this._hasTx)]):[3,3];case 1:return e.sent(),[4,this._writeConnectionHolder.close(this._hasTx)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},Mn.prototype._connectionHolderWithMode=function(e){if(e===Pn.ACCESS_MODE_READ)return this._readConnectionHolder;if(e===Pn.ACCESS_MODE_WRITE)return this._writeConnectionHolder;throw(0,Sn.newError)("Unknown access mode: "+e)},Mn.prototype._onCompleteCallback=function(e,t){this._updateBookmarks(new In.Bookmarks(e.bookmark),t,e.db)},Mn.prototype._calculateWatermaks=function(){return this._fetchSize===Pn.FETCH_ALL?{low:Number.MAX_VALUE,high:Number.MAX_VALUE}:{low:.3*this._fetchSize,high:.7*this._fetchSize}},Mn._validateSessionMode=function(e){e=null!=e?e:Pn.ACCESS_MODE_WRITE;if(e!==Pn.ACCESS_MODE_READ&&e!==Pn.ACCESS_MODE_WRITE)throw(0,Sn.newError)("Illegal session mode "+e);return e},s.default=Mn;var _={},g={},xn=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Nn=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Un=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Dn=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ln=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},w=(Object.defineProperty(g,"__esModule",{value:!0}),g.bookmarkManager=void 0,Bn.prototype.updateBookmarks=function(e,t){return xn(this,void 0,void 0,function(){return Nn(this,function(e){throw new Error("Not implemented")})})},Bn.prototype.getBookmarks=function(){return xn(this,void 0,void 0,function(){return Nn(this,function(e){throw new Error("Not implemented")})})},Bn);function Bn(){throw new Error("Not implemented")}g.default=w,g.bookmarkManager=function(e){void 0===e&&(e={});var t=new Set(e.initialBookmarks);return new Fn(t,e.bookmarksSupplier,e.bookmarksConsumer)};Wn.prototype.updateBookmarks=function(f,p){return xn(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c,l;return Nn(this,function(e){switch(e.label){case 0:t=this._bookmarks;try{for(r=Un(f),n=r.next();!n.done;n=r.next())u=n.value,t.delete(u)}catch(e){a={error:e}}finally{try{n&&!n.done&&(s=r.return)&&s.call(r)}finally{if(a)throw a.error}}try{for(o=Un(p),i=o.next();!i.done;i=o.next())u=i.value,t.add(u)}catch(e){c={error:e}}finally{try{i&&!i.done&&(l=o.return)&&l.call(o)}finally{if(c)throw c.error}}return"function"!=typeof this._bookmarksConsumer?[3,2]:[4,this._bookmarksConsumer(Ln([],Dn(t),!1))];case 1:e.sent(),e.label=2;case 2:return[2]}})})},Wn.prototype.getBookmarks=function(){var s;return xn(this,void 0,void 0,function(){var t,r,n,o,i,u,a;return Nn(this,function(e){switch(e.label){case 0:return t=new Set(this._bookmarks),"function"!=typeof this._bookmarksSupplier?[3,2]:[4,this._bookmarksSupplier()];case 1:r=null!=(s=e.sent())?s:[];try{for(n=Un(r),o=n.next();!o.done;o=n.next())i=o.value,t.add(i)}catch(e){u={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(u)throw u.error}}e.label=2;case 2:return[2,Ln([],Dn(t),!1)]}})})};var Fn=Wn;function Wn(e,t,r){this._bookmarks=e,this._bookmarksSupplier=t,this._bookmarksConsumer=r}var O={},zn=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},qn=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},yn=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Vn=(Object.defineProperty(O,"__esModule",{value:!0}),yn(o)),Hn=t;function Yn(o){return zn(this,void 0,void 0,function(){var t,r,n;return qn(this,function(e){switch(e.label){case 0:return[4,o];case 1:return r=e.sent(),t=r.summary,r=r.records,[4,o.keys()];case 2:return n=e.sent(),[2,new Vn.default(n,r,t)]}})})}function Kn(){}Kn.prototype.eagerResultTransformer=function(){return Yn},Kn.prototype.mappedResultTransformer=function(i){var e=this;if(null==i||null==i.collect&&null==i.map)throw(0,Hn.newError)("Requires a map or/and a collect functions.");return function(o){return zn(e,void 0,void 0,function(){return qn(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t,r){var n={records:[],keys:[]};o.subscribe({onKeys:function(e){n.keys=e},onNext:function(e){null!=i.map?n.records.push(i.map(e)):n.records.push(e)},onCompleted:function(e){null!=i.collect?t(i.collect(n.records,e,n.keys)):(e={records:n.records,summary:e,keys:n.keys},t(e))},onError:function(e){r(e)}})})];case 1:return[2,e.sent()]}})})}};var w=new Kn,yn=(Object.freeze(w),O.default=w,{}),Gn=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Zn=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}};function Qn(e){this._createSession=e}Object.defineProperty(yn,"__esModule",{value:!0}),Qn.prototype.execute=function(o,i,u){return Gn(this,void 0,void 0,function(){var t,n=this;return Zn(this,function(e){switch(e.label){case 0:t=this._createSession({database:o.database,bookmarkManager:o.bookmarkManager,impersonatedUser:o.impersonatedUser}),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,("READERS"===o.routing?t.executeRead:t.executeWrite).bind(t)(function(r){return Gn(n,void 0,void 0,function(){var t;return Zn(this,function(e){switch(e.label){case 0:return t=r.run(i,u),[4,o.resultTransformer(t)];case 1:return[2,e.sent()]}})})})];case 2:return[2,e.sent()];case 3:return[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})},yn.default=Qn;function Xn(){this.routing=yo.WRITERS,this.resultTransformer=void 0,this.database="",this.impersonatedUser=void 0,this.bookmarkManager=void 0}var Jn=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},$n=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},w=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},eo=(Object.defineProperty(_,"__esModule",{value:!0}),_.QueryConfig=_.SessionConfig=_.routing=_.WRITE=_.READ=_.Driver=void 0,v),to=w(Mr),ro=m,no=E,oo=w(s),io=u,uo=g,ao=w(O),so=w(yn),co=t,lo=36e5,fo=1e3,po=ro.ACCESS_MODE_READ,ho=(_.READ=po,ro.ACCESS_MODE_WRITE),bo=(_.WRITE=ho,0),yo=(_.SessionConfig=function(){this.defaultAccessMode=ho,this.bookmarks=[],this.database="",this.impersonatedUser=void 0,this.fetchSize=void 0,this.bookmarkManager=void 0},{WRITERS:"WRITERS",READERS:"READERS"}),v=(_.routing=yo,Object.freeze(yo),_.QueryConfig=Xn,Object.defineProperty(_o.prototype,"queryBookmarkManager",{get:function(){return this._queryBookmarkManager},enumerable:!1,configurable:!0}),_o.prototype.executeQuery=function(o,i,u){var a,s;return void 0===u&&(u={}),Jn(this,void 0,void 0,function(){var t,r,n;return $n(this,function(e){switch(e.label){case 0:if(t=null===u.bookmarkManager?void 0:null!=(a=u.bookmarkManager)?a:this.queryBookmarkManager,r=null!=(a=u.resultTransformer)?a:ao.default.eagerResultTransformer(),(n=null!=(s=u.routing)?s:yo.WRITERS)!==yo.READERS&&n!==yo.WRITERS)throw(0,co.newError)('Illegal query routing config: "'.concat(n,'"'));return[4,this._queryExecutor.execute({resultTransformer:r,bookmarkManager:t,routing:n,database:u.database,impersonatedUser:u.impersonatedUser},o,i)];case 1:return[2,e.sent()]}})})},_o.prototype.verifyConnectivity=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:po})},_o.prototype.getServerInfo=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:po})},_o.prototype.supportsMultiDb=function(){return this._getOrCreateConnectionProvider().supportsMultiDb()},_o.prototype.supportsTransactionConfig=function(){return this._getOrCreateConnectionProvider().supportsTransactionConfig()},_o.prototype.supportsUserImpersonation=function(){return this._getOrCreateConnectionProvider().supportsUserImpersonation()},_o.prototype.getNegotiatedProtocolVersion=function(){return this._getOrCreateConnectionProvider().getNegotiatedProtocolVersion()},_o.prototype.isEncrypted=function(){return this._isEncrypted()},_o.prototype._supportsRouting=function(){return this._meta.routing},_o.prototype._isEncrypted=function(){return this._config.encrypted===io.ENCRYPTION_ON||!0===this._config.encrypted},_o.prototype._getTrust=function(){return this._config.trust},_o.prototype.session=function(e){var e=void 0===e?{}:e,t=e.defaultAccessMode,r=e.bookmarks,n=e.database,o=e.impersonatedUser,i=e.fetchSize,e=e.bookmarkManager;return this._newSession({defaultAccessMode:void 0===t?ho:t,bookmarkOrBookmarks:r,database:void 0===n?"":n,reactive:!1,impersonatedUser:o,fetchSize:mo(i,this._config.fetchSize),bookmarkManager:e})},_o.prototype.close=function(){return this._log.info("Driver ".concat(this._id," closing")),null!=this._connectionProvider?this._connectionProvider.close():Promise.resolve()},_o.prototype._afterConstruction=function(){this._log.info("".concat(this._meta.typename," driver ").concat(this._id," created for server address ").concat(this._meta.address.toString()))},_o.prototype._newSession=function(e){var t=e.defaultAccessMode,r=e.bookmarkOrBookmarks,n=e.database,o=e.reactive,i=e.impersonatedUser,u=e.fetchSize,e=e.bookmarkManager,t=oo.default._validateSessionMode(t),a=this._getOrCreateConnectionProvider(),r=null!=r?new eo.Bookmarks(r):eo.Bookmarks.empty();return this._createSession({mode:t,database:null!=n?n:"",connectionProvider:a,bookmarks:r,config:this._config,reactive:o,impersonatedUser:i,fetchSize:u,bookmarkManager:e})},_o.prototype._getOrCreateConnectionProvider=function(){var e;return null==this._connectionProvider&&(this._connectionProvider=this._createConnectionProvider(this._id,this._config,this._log,(e=this._config,new to.default(e.resolver)))),this._connectionProvider},_o);function _o(e,t,r,n,o){void 0===n&&(n=function(e){return new oo.default(e)}),void 0===o&&(o=function(e){return new so.default(e)}),(i=t=void 0===t?{}:t).maxConnectionLifetime=vo(i.maxConnectionLifetime,lo),i.maxConnectionPoolSize=vo(i.maxConnectionPoolSize,ro.DEFAULT_POOL_MAX_SIZE),i.connectionAcquisitionTimeout=vo(i.connectionAcquisitionTimeout,ro.DEFAULT_POOL_ACQUISITION_TIMEOUT),i.fetchSize=mo(i.fetchSize,fo),i.connectionTimeout=function(e){e=parseInt(e.connectionTimeout,10);return 0===e||!isNaN(e)&&e<0?null:isNaN(e)?ro.DEFAULT_CONNECTION_TIMEOUT_MILLIS:e}(i);var i=no.Logger.create(t),u=t,a=i,s=u.resolver;if(null!=s&&"function"!=typeof s)throw new TypeError("Configured resolver should be a function. Got: ".concat(typeof s));u.connectionAcquisitionTimeout<u.connectionTimeout&&a.warn('Configuration for "connectionAcquisitionTimeout" should be greater than or equal to "connectionTimeout". Otherwise, the connection acquisition timeout will take precedence for over the connection timeout in scenarios where a new connection is created while it is acquired'),this._id=bo++,this._meta=e,this._config=t,this._log=i,this._createConnectionProvider=r,this._createSession=n,this._queryBookmarkManager=(0,uo.bookmarkManager)(),this._queryExecutor=o(this.session.bind(this)),this._connectionProvider=null,this._afterConstruction()}function vo(e,t){e=parseInt(e,10);return 0<e||0===e?e:e<0?Number.MAX_SAFE_INTEGER:t}function mo(e,t){e=parseInt(e,10);if(0<e||e===ro.FETCH_ALL)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(ro.FETCH_ALL," for ALL. However fetchSize = ").concat(e));return t}_.Driver=v,_.default=v;Mr={};function go(e){return null!=e&&""!==e&&(Object.getPrototypeOf(e)!==Object.prototype||0!==Object.keys(e).length)}Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.default={basic:function(e,t,r){return null!=r?{scheme:"basic",principal:e,credentials:t,realm:r}:{scheme:"basic",principal:e,credentials:t}},kerberos:function(e){return{scheme:"kerberos",principal:"",credentials:e}},bearer:function(e){return{scheme:"bearer",credentials:e}},custom:function(e,t,r,n,o){n={scheme:n,principal:e};return go(t)&&(n.credentials=t),go(r)&&(n.realm=r),go(o)&&(n.parameters=o),n}};var Oo,wo,Eo,Po,So,To,jo,Co,Io,Ro,m={},kr=(Object.defineProperty(m,"__esModule",{value:!0}),E=e,Oo=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),wo=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Oo(t,e,r);return wo(t,e),t},w=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(E,"__esModule",{value:!0}),E.ManagedTransaction=E.Transaction=E.Connection=E.ConnectionProvider=E.EagerResult=E.Result=E.Stats=E.QueryStatistics=E.ProfiledPlan=E.Plan=E.Notification=E.ServerInfo=E.queryType=E.ResultSummary=E.Record=E.isPathSegment=E.PathSegment=E.isPath=E.Path=E.isUnboundRelationship=E.UnboundRelationship=E.isRelationship=E.Relationship=E.isNode=E.Node=E.Time=E.LocalTime=E.LocalDateTime=E.isTime=E.isLocalTime=E.isLocalDateTime=E.isDuration=E.isDateTime=E.isDate=E.Duration=E.DateTime=E.Date=E.Point=E.isPoint=E.internal=E.toString=E.toNumber=E.inSafeRange=E.isInt=E.int=E.Integer=E.error=E.isRetriableError=E.Neo4jError=E.newError=void 0,E.resultTransformers=E.routing=E.bookmarkManager=E.auth=E.json=E.driver=E.types=E.Driver=E.Session=E.TransactionPromise=void 0,Eo=t,Object.defineProperty(E,"newError",{enumerable:!0,get:function(){return Eo.newError}}),Object.defineProperty(E,"Neo4jError",{enumerable:!0,get:function(){return Eo.Neo4jError}}),Object.defineProperty(E,"isRetriableError",{enumerable:!0,get:function(){return Eo.isRetriableError}}),Po=u(n),E.Integer=Po.default,Object.defineProperty(E,"int",{enumerable:!0,get:function(){return Po.int}}),Object.defineProperty(E,"isInt",{enumerable:!0,get:function(){return Po.isInt}}),Object.defineProperty(E,"inSafeRange",{enumerable:!0,get:function(){return Po.inSafeRange}}),Object.defineProperty(E,"toNumber",{enumerable:!0,get:function(){return Po.toNumber}}),Object.defineProperty(E,"toString",{enumerable:!0,get:function(){return Po.toString}}),So=i,Object.defineProperty(E,"Date",{enumerable:!0,get:function(){return So.Date}}),Object.defineProperty(E,"DateTime",{enumerable:!0,get:function(){return So.DateTime}}),Object.defineProperty(E,"Duration",{enumerable:!0,get:function(){return So.Duration}}),Object.defineProperty(E,"isDate",{enumerable:!0,get:function(){return So.isDate}}),Object.defineProperty(E,"isDateTime",{enumerable:!0,get:function(){return So.isDateTime}}),Object.defineProperty(E,"isDuration",{enumerable:!0,get:function(){return So.isDuration}}),Object.defineProperty(E,"isLocalDateTime",{enumerable:!0,get:function(){return So.isLocalDateTime}}),Object.defineProperty(E,"isLocalTime",{enumerable:!0,get:function(){return So.isLocalTime}}),Object.defineProperty(E,"isTime",{enumerable:!0,get:function(){return So.isTime}}),Object.defineProperty(E,"LocalDateTime",{enumerable:!0,get:function(){return So.LocalDateTime}}),Object.defineProperty(E,"LocalTime",{enumerable:!0,get:function(){return So.LocalTime}}),Object.defineProperty(E,"Time",{enumerable:!0,get:function(){return So.Time}}),To=p,Object.defineProperty(E,"Node",{enumerable:!0,get:function(){return To.Node}}),Object.defineProperty(E,"isNode",{enumerable:!0,get:function(){return To.isNode}}),Object.defineProperty(E,"Relationship",{enumerable:!0,get:function(){return To.Relationship}}),Object.defineProperty(E,"isRelationship",{enumerable:!0,get:function(){return To.isRelationship}}),Object.defineProperty(E,"UnboundRelationship",{enumerable:!0,get:function(){return To.UnboundRelationship}}),Object.defineProperty(E,"isUnboundRelationship",{enumerable:!0,get:function(){return To.isUnboundRelationship}}),Object.defineProperty(E,"Path",{enumerable:!0,get:function(){return To.Path}}),Object.defineProperty(E,"isPath",{enumerable:!0,get:function(){return To.isPath}}),Object.defineProperty(E,"PathSegment",{enumerable:!0,get:function(){return To.PathSegment}}),Object.defineProperty(E,"isPathSegment",{enumerable:!0,get:function(){return To.isPathSegment}}),yn=w(h),E.Record=yn.default,jo=l,Object.defineProperty(E,"isPoint",{enumerable:!0,get:function(){return jo.isPoint}}),Object.defineProperty(E,"Point",{enumerable:!0,get:function(){return jo.Point}}),Co=u(b),E.ResultSummary=Co.default,Object.defineProperty(E,"queryType",{enumerable:!0,get:function(){return Co.queryType}}),Object.defineProperty(E,"ServerInfo",{enumerable:!0,get:function(){return Co.ServerInfo}}),Object.defineProperty(E,"Notification",{enumerable:!0,get:function(){return Co.Notification}}),Object.defineProperty(E,"Plan",{enumerable:!0,get:function(){return Co.Plan}}),Object.defineProperty(E,"ProfiledPlan",{enumerable:!0,get:function(){return Co.ProfiledPlan}}),Object.defineProperty(E,"QueryStatistics",{enumerable:!0,get:function(){return Co.QueryStatistics}}),Object.defineProperty(E,"Stats",{enumerable:!0,get:function(){return Co.Stats}}),v=w(st),E.Result=v.default,t=w(o),E.EagerResult=t.default,n=w(jr),E.ConnectionProvider=n.default,n=w(P),E.Connection=n.default,i=w(S),E.Transaction=i.default,p=w(kr),E.ManagedTransaction=p.default,h=w(lr),E.TransactionPromise=h.default,l=w(s),E.Session=l.default,b=u(_),st=b,E.Driver=b.default,E.driver=st,o=w(Mr),E.auth=o.default,Io=g,Object.defineProperty(E,"bookmarkManager",{enumerable:!0,get:function(){return Io.bookmarkManager}}),Ro=_,Object.defineProperty(E,"routing",{enumerable:!0,get:function(){return Ro.routing}}),jr=u(m),E.types=jr,P=u(a),E.json=P,w=w(O),E.resultTransformers=w.default,u=u(y),E.internal=u,S={SERVICE_UNAVAILABLE:Eo.SERVICE_UNAVAILABLE,SESSION_EXPIRED:Eo.SESSION_EXPIRED,PROTOCOL_ERROR:Eo.PROTOCOL_ERROR},E.error=S,S={newError:Eo.newError,Neo4jError:Eo.Neo4jError,isRetriableError:Eo.isRetriableError,error:S,Integer:Po.default,int:Po.int,isInt:Po.isInt,inSafeRange:Po.inSafeRange,toNumber:Po.toNumber,toString:Po.toString,internal:u,isPoint:jo.isPoint,Point:jo.Point,Date:So.Date,DateTime:So.DateTime,Duration:So.Duration,isDate:So.isDate,isDateTime:So.isDateTime,isDuration:So.isDuration,isLocalDateTime:So.isLocalDateTime,isLocalTime:So.isLocalTime,isTime:So.isTime,LocalDateTime:So.LocalDateTime,LocalTime:So.LocalTime,Time:So.Time,Node:To.Node,isNode:To.isNode,Relationship:To.Relationship,isRelationship:To.isRelationship,UnboundRelationship:To.UnboundRelationship,isUnboundRelationship:To.isUnboundRelationship,Path:To.Path,isPath:To.isPath,PathSegment:To.PathSegment,isPathSegment:To.isPathSegment,Record:yn.default,ResultSummary:Co.default,queryType:Co.queryType,ServerInfo:Co.ServerInfo,Notification:Co.Notification,Plan:Co.Plan,ProfiledPlan:Co.ProfiledPlan,QueryStatistics:Co.QueryStatistics,Stats:Co.Stats,Result:v.default,EagerResult:t.default,Transaction:i.default,ManagedTransaction:p.default,TransactionPromise:h.default,Session:l.default,Driver:b.default,Connection:n.default,types:jr,driver:st,json:P,auth:o.default,bookmarkManager:Io.bookmarkManager,routing:Ro.routing,resultTransformers:w.default},E.default=S,{}),lr={},s={},Mr={},g={};Object.defineProperty(g,"__esModule",{value:!0}),g.isFunction=void 0,g.isFunction=function(e){return"function"==typeof e};_={},m={},a={};Object.defineProperty(a,"__esModule",{value:!0}),a.createErrorClass=void 0,a.createErrorClass=function(e){return(e=e(function(e){Error.call(e),e.stack=(new Error).stack})).prototype=Object.create(Error.prototype),e.prototype.constructor=e},Object.defineProperty(m,"__esModule",{value:!0}),m.UnsubscriptionError=void 0;O=a,m.UnsubscriptionError=O.createErrorClass(function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}),y={};Object.defineProperty(y,"__esModule",{value:!0}),y.arrRemove=void 0,y.arrRemove=function(e,t){e&&0<=(t=e.indexOf(t))&&e.splice(t,1)};var ko=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ao=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Mo=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},xo=(Object.defineProperty(_,"__esModule",{value:!0}),_.isSubscription=_.EMPTY_SUBSCRIPTION=_.Subscription=void 0,g),No=m,Uo=y,Do=(Lo.prototype.unsubscribe=function(){var t,e,r;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var o=ko(n),i=o.next();!i.done;i=o.next())i.value.remove(this)}catch(e){a={error:e}}finally{try{i&&!i.done&&(u=o.return)&&u.call(o)}finally{if(a)throw a.error}}else n.remove(this);var u=this.initialTeardown;if(xo.isFunction(u))try{u()}catch(e){r=e instanceof No.UnsubscriptionError?e.errors:[e]}var a=this._finalizers;if(a){this._finalizers=null;try{for(var s=ko(a),c=s.next();!c.done;c=s.next()){var l=c.value;try{Bo(l)}catch(e){r=null!=r?r:[],e instanceof No.UnsubscriptionError?r=Mo(Mo([],Ao(r)),Ao(e.errors)):r.push(e)}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}}if(r)throw new No.UnsubscriptionError(r)}},Lo.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Bo(e);else{if(e instanceof Lo){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(t=this._finalizers)?t:[]).push(e)}},Lo.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},Lo.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},Lo.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Uo.arrRemove(t,e)},Lo.prototype.remove=function(e){var t=this._finalizers;t&&Uo.arrRemove(t,e),e instanceof Lo&&e._removeParent(this)},Lo.EMPTY=((u=new Lo).closed=!0,u),Lo);function Lo(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}function Bo(e){xo.isFunction(e)?e():e.unsubscribe()}_.Subscription=Do,_.EMPTY_SUBSCRIPTION=Do.EMPTY,_.isSubscription=function(e){return e instanceof Do||e&&"closed"in e&&xo.isFunction(e.remove)&&xo.isFunction(e.add)&&xo.isFunction(e.unsubscribe)};var Fo,Wo,zo,yn={},v=(Object.defineProperty(yn,"__esModule",{value:!0}),yn.config=void 0,yn.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},{}),t={},qo=(Fo=t,Wo=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},zo=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.timeoutProvider=void 0,Fo.timeoutProvider={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Fo.timeoutProvider.delegate;return null!=o&&o.setTimeout?o.setTimeout.apply(o,zo([e,t],Wo(r))):setTimeout.apply(void 0,zo([e,t],Wo(r)))},clearTimeout:function(e){var t=Fo.timeoutProvider.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0},Object.defineProperty(v,"__esModule",{value:!0}),v.reportUnhandledError=void 0,yn),Vo=t;v.reportUnhandledError=function(t){Vo.timeoutProvider.setTimeout(function(){var e=qo.config.onUnhandledError;if(!e)throw t;e(t)})};i={};Object.defineProperty(i,"__esModule",{value:!0}),i.noop=void 0,i.noop=function(){};p={};function Ho(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(p,"__esModule",{value:!0}),p.createNotification=p.nextNotification=p.errorNotification=p.COMPLETE_NOTIFICATION=void 0,p.COMPLETE_NOTIFICATION=Ho("C",void 0,void 0),p.errorNotification=function(e){return Ho("E",void 0,e)},p.nextNotification=function(e){return Ho("N",e,void 0)},p.createNotification=Ho;var Yo,Ko,Go,Zo,Qo,Xo,Jo,$o,ei,ti,ri,ni,oi,ii,h={},ui=(Object.defineProperty(h,"__esModule",{value:!0}),h.captureError=h.errorContext=void 0,yn),ai=null;function si(e){var t=Go.call(this)||this;return t.isStopped=!1,e?(t.destination=e,Qo.isSubscription(e)&&e.add(t)):t.destination=Yo.EMPTY_OBSERVER,t}function ci(e,t){return ri.call(e,t)}function li(e){this.partialObserver=e}function fi(e,t,r){var n=oi.call(this)||this;return r=Zo.isFunction(e)||!e?{next:null!=e?e:void 0,error:null!=t?t:void 0,complete:null!=r?r:void 0}:n&&Xo.config.useDeprecatedNextContext?((t=Object.create(e)).unsubscribe=function(){return n.unsubscribe()},{next:e.next&&ci(e.next,t),error:e.error&&ci(e.error,t),complete:e.complete&&ci(e.complete,t)}):e,n.destination=new ni(r),n}function pi(e){Xo.config.useDeprecatedSynchronousErrorHandling?ti.captureError(e):Jo.reportUnhandledError(e)}function di(e,t){var r=Xo.config.onStoppedNotification;r&&ei.timeoutProvider.setTimeout(function(){return r(e,t)})}h.errorContext=function(e){if(ui.config.useDeprecatedSynchronousErrorHandling){var t=!ai;if(t&&(ai={errorThrown:!1,error:null}),e(),t){var t=ai,r=t.errorThrown,t=t.error;if(ai=null,r)throw t}}else e()},h.captureError=function(e){ui.config.useDeprecatedSynchronousErrorHandling&&ai&&(ai.errorThrown=!0,ai.error=e)},Yo=Mr,l=r&&r.__extends||(Ko=function(e,t){return(Ko=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ko(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.EMPTY_OBSERVER=Yo.SafeSubscriber=Yo.Subscriber=void 0,Zo=g,Xo=yn,Jo=v,b=i,$o=p,ei=t,ti=h,Go=(Qo=_).Subscription,l(si,Go),si.create=function(e,t,r){return new ii(e,t,r)},si.prototype.next=function(e){this.isStopped?di($o.nextNotification(e),this):this._next(e)},si.prototype.error=function(e){this.isStopped?di($o.errorNotification(e),this):(this.isStopped=!0,this._error(e))},si.prototype.complete=function(){this.isStopped?di($o.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},si.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,Go.prototype.unsubscribe.call(this),this.destination=null)},si.prototype._next=function(e){this.destination.next(e)},si.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},si.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n=si,Yo.Subscriber=n,ri=Function.prototype.bind,li.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){pi(e)}},li.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){pi(e)}else pi(e)},li.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){pi(e)}},ni=li,l(fi,oi=n),ii=fi,Yo.SafeSubscriber=ii,Yo.EMPTY_OBSERVER={closed:!0,next:b.noop,error:function(e){throw e},complete:b.noop};jr={},Object.defineProperty(jr,"__esModule",{value:!0}),jr.observable=void 0,jr.observable="function"==typeof Symbol&&Symbol.observable||"@@observable",st={},P={};Object.defineProperty(P,"__esModule",{value:!0}),P.identity=void 0,P.identity=function(e){return e},Object.defineProperty(st,"__esModule",{value:!0}),st.pipeFromArray=st.pipe=void 0;var hi=P;function bi(t){return 0===t.length?hi.identity:1===t.length?t[0]:function(e){return t.reduce(function(e,t){return t(e)},e)}}st.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return bi(e)},st.pipeFromArray=bi,Object.defineProperty(s,"__esModule",{value:!0}),s.Observable=void 0;var yi=Mr,_i=_,o=jr,vi=st,mi=yn,gi=g,Oi=h;function wi(e){e&&(this._subscribe=e)}function Ei(e){return null!=(e=null!=e?e:mi.config.Promise)?e:Promise}wi.prototype.lift=function(e){var t=new wi;return t.source=this,t.operator=e,t},wi.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof yi.Subscriber||function(e){return e&&gi.isFunction(e.next)&&gi.isFunction(e.error)&&gi.isFunction(e.complete)}(n)&&_i.isSubscription(n)?e:new yi.SafeSubscriber(e,t,r);return Oi.errorContext(function(){var e=o.operator,t=o.source;i.add(e?e.call(i,t):t?o._subscribe(i):o._trySubscribe(i))}),i},wi.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},wi.prototype.forEach=function(n,e){var o=this;return new(e=Ei(e))(function(e,t){var r=new yi.SafeSubscriber({next:function(e){try{n(e)}catch(e){t(e),r.unsubscribe()}},error:t,complete:e});o.subscribe(r)})},wi.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},wi.prototype[o.observable]=function(){return this},wi.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vi.pipeFromArray(e)(this)},wi.prototype.toPromise=function(e){var n=this;return new(e=Ei(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},wi.create=function(e){return new wi(e)},s.Observable=wi;var w={},E={},S={},Pi=(Object.defineProperty(S,"__esModule",{value:!0}),S.operate=S.hasLift=void 0,g);function Si(e){return Pi.isFunction(null==e?void 0:e.lift)}S.hasLift=Si,S.operate=function(t){return function(e){if(Si(e))return e.lift(function(e){try{return t(e,this)}catch(e){this.error(e)}});throw new TypeError("Unable to lift unknown Observable type")}};var Ti,O={},u=r&&r.__extends||(Ti=function(e,t){return(Ti=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ti(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),p=(Object.defineProperty(O,"__esModule",{value:!0}),O.OperatorSubscriber=O.createOperatorSubscriber=void 0,Mr);O.createOperatorSubscriber=function(e,t,r,n,o){return new Ci(e,t,r,n,o)};u(Ii,ji=p.Subscriber),Ii.prototype.unsubscribe=function(){var e;this.shouldUnsubscribe&&!this.shouldUnsubscribe()||(e=this.closed,ji.prototype.unsubscribe.call(this),e||null==(e=this.onFinalize)||e.call(this))};var ji,Ci=Ii;function Ii(t,r,e,n,o,i){var u=ji.call(this,t)||this;return u.onFinalize=o,u.shouldUnsubscribe=i,u._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:ji.prototype._next,u._error=n?function(e){try{n(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:ji.prototype._error,u._complete=e?function(){try{e()}catch(e){t.error(e)}finally{this.unsubscribe()}}:ji.prototype._complete,u}O.OperatorSubscriber=Ci,Object.defineProperty(E,"__esModule",{value:!0}),E.refCount=void 0;var Ri=S,ki=O;E.refCount=function(){return Ri.operate(function(r,n){var o=null,e=(r._refCount++,ki.createOperatorSubscriber(n,void 0,void 0,void 0,function(){var e,t;!r||r._refCount<=0||0<--r._refCount?o=null:(e=r._connection,t=o,o=null,!e||t&&e!==t||e.unsubscribe(),n.unsubscribe())}));r.subscribe(e),e.closed||(o=r.connect())})};var Ai,t=r&&r.__extends||(Ai=function(e,t){return(Ai=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ai(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(w,"__esModule",{value:!0}),w.ConnectableObservable=void 0;var Mi,xi=_,Ni=E,Ui=O,Di=S,l=(Mi=s.Observable,t(Li,Mi),Li.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},Li.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},Li.prototype._teardown=function(){this._refCount=0;var e=this._connection;(this._subject=this._connection=null)!=e&&e.unsubscribe()},Li.prototype.connect=function(){var t,r=this,e=this._connection;return e||(e=this._connection=new xi.Subscription,t=this.getSubject(),e.add(this.source.subscribe(Ui.createOperatorSubscriber(t,void 0,function(){r._teardown(),t.complete()},function(e){r._teardown(),t.error(e)},function(){return r._teardown()}))),e.closed&&(this._connection=null,e=xi.Subscription.EMPTY)),e},Li.prototype.refCount=function(){return Ni.refCount()(this)},Li);function Li(e,t){var r=Mi.call(this)||this;return r.source=e,r.subjectFactory=t,r._subject=null,r._refCount=0,r._connection=null,Di.hasLift(e)&&(r.lift=e.lift),r}w.ConnectableObservable=l;var Bi,Fi,Wi,zi,qi,n={},b={},o=(Bi=b,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.performanceTimestampProvider=void 0,Bi.performanceTimestampProvider={now:function(){return(Bi.performanceTimestampProvider.delegate||performance).now()},delegate:void 0},{}),Vi=(Fi=o,Wi=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},zi=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.animationFrameProvider=void 0,qi=_,Fi.animationFrameProvider={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=Fi.animationFrameProvider.delegate,o=(n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame),e(function(e){r=void 0,t(e)}));return new qi.Subscription(function(){return null==r?void 0:r(o)})},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Fi.animationFrameProvider.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,zi([],Wi(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Fi.animationFrameProvider.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,zi([],Wi(e)))},delegate:void 0},Object.defineProperty(n,"__esModule",{value:!0}),n.animationFrames=void 0,s),Hi=b,Yi=o;function Ki(a){return new Vi.Observable(function(r){var n=a||Hi.performanceTimestampProvider,o=n.now(),i=0,u=function(){r.closed||(i=Yi.animationFrameProvider.requestAnimationFrame(function(e){i=0;var t=n.now();r.next({timestamp:a?t:e,elapsed:t-o}),u()}))};return u(),function(){i&&Yi.animationFrameProvider.cancelAnimationFrame(i)}})}n.animationFrames=function(e){return e?Ki(e):Qi};var Gi,Zi,Qi=Ki(),u={},p={},t=(Object.defineProperty(p,"__esModule",{value:!0}),p.ObjectUnsubscribedError=void 0,a),l=(p.ObjectUnsubscribedError=t.createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),r&&r.__extends||(Gi=function(e,t){return(Gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gi(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Xi=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ji=(Object.defineProperty(u,"__esModule",{value:!0}),u.AnonymousSubject=u.Subject=void 0,s),$i=_,eu=p,tu=y,ru=h,b=(Zi=Ji.Observable,l(nu,Zi),nu.prototype.lift=function(e){var t=new iu(this,this);return t.operator=e,t},nu.prototype._throwIfClosed=function(){if(this.closed)throw new eu.ObjectUnsubscribedError},nu.prototype.next=function(o){var i=this;ru.errorContext(function(){var t,e;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var r=Xi(i.currentObservers),n=r.next();!n.done;n=r.next())n.value.next(o)}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}}})},nu.prototype.error=function(t){var r=this;ru.errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var e=r.observers;e.length;)e.shift().error(t)}})},nu.prototype.complete=function(){var t=this;ru.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},nu.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(nu.prototype,"observed",{get:function(){var e;return 0<(null==(e=this.observers)?void 0:e.length)},enumerable:!1,configurable:!0}),nu.prototype._trySubscribe=function(e){return this._throwIfClosed(),Zi.prototype._trySubscribe.call(this,e)},nu.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},nu.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,o=this.observers;return r||n?$i.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new $i.Subscription(function(){t.currentObservers=null,tu.arrRemove(o,e)}))},nu.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},nu.prototype.asObservable=function(){var e=new Ji.Observable;return e.source=this,e},nu.create=function(e,t){return new iu(e,t)},nu);function nu(){var e=Zi.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}u.Subject=b;l(uu,ou=b),uu.prototype.next=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.next)&&r.call(t,e)},uu.prototype.error=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.error)&&r.call(t,e)},uu.prototype.complete=function(){var e,t;null!=(t=null==(e=this.destination)?void 0:e.complete)&&t.call(e)},uu.prototype._subscribe=function(e){var t;return null!=(t=null==(t=this.source)?void 0:t.subscribe(e))?t:$i.EMPTY_SUBSCRIPTION};var ou,iu=uu;function uu(e,t){var r=ou.call(this)||this;return r.destination=e,r.source=t,r}u.AnonymousSubject=iu;var au,t={},h=r&&r.__extends||(au=function(e,t){return(au=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}au(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BehaviorSubject=void 0;su=u.Subject,h(cu,su),Object.defineProperty(cu.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),cu.prototype._subscribe=function(e){var t=su.prototype._subscribe.call(this,e);return t.closed||e.next(this._value),t},cu.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},cu.prototype.next=function(e){su.prototype.next.call(this,this._value=e)};var su,l=cu;function cu(e){var t=su.call(this)||this;return t._value=e,t}t.BehaviorSubject=l;var lu,fu,b={},h={},l=(lu=h,Object.defineProperty(lu,"__esModule",{value:!0}),lu.dateTimestampProvider=void 0,lu.dateTimestampProvider={now:function(){return(lu.dateTimestampProvider.delegate||Date).now()},delegate:void 0},r&&r.__extends||(fu=function(e,t){return(fu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}fu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(b,"__esModule",{value:!0}),b.ReplaySubject=void 0;var pu,du=h,l=(pu=u.Subject,l(hu,pu),hu.prototype.next=function(e){var t=this.isStopped,r=this._buffer,n=this._infiniteTimeWindow,o=this._timestampProvider,i=this._windowTime;t||(r.push(e),n||r.push(o.now()+i)),this._trimBuffer(),pu.prototype.next.call(this,e)},hu.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),o=0;o<n.length&&!e.closed;o+=r?1:2)e.next(n[o]);return this._checkFinalizedStatuses(e),t},hu.prototype._trimBuffer=function(){var e=this._bufferSize,t=this._timestampProvider,r=this._buffer,n=this._infiniteTimeWindow,o=(n?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!n){for(var i=t.now(),u=0,a=1;a<r.length&&r[a]<=i;a+=2)u=a;u&&r.splice(0,u+1)}},hu);function hu(e,t,r){void 0===e&&(e=1/0),void 0===t&&(t=1/0),void 0===r&&(r=du.dateTimestampProvider);var n=pu.call(this)||this;return n._bufferSize=e,n._windowTime=t,n._timestampProvider=r,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=t===1/0,n._bufferSize=Math.max(1,e),n._windowTime=Math.max(1,t),n}b.ReplaySubject=l;var bu,l={},yu=r&&r.__extends||(bu=function(e,t){return(bu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}bu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(l,"__esModule",{value:!0}),l.AsyncSubject=void 0;_u=u.Subject,yu(vu,_u),vu.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this._hasValue,n=this._value,o=this.thrownError,i=this.isStopped,u=this._isComplete;t?e.error(o):(i||u)&&(r&&e.next(n),e.complete())},vu.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},vu.prototype.complete=function(){var e=this._hasValue,t=this._value;this._isComplete||(this._isComplete=!0,e&&_u.prototype.next.call(this,t),_u.prototype.complete.call(this))};var _u,yu=vu;function vu(){var e=null!==_u&&_u.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}l.AsyncSubject=yu;var mu,yu={},T={},j={},gu={},Ou=r&&r.__extends||(mu=function(e,t){return(mu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}mu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(gu,"__esModule",{value:!0}),gu.Action=void 0;wu=_.Subscription,Ou(Eu,wu),Eu.prototype.schedule=function(e,t){return this};var wu,Ou=Eu;function Eu(e,t){return wu.call(this)||this}gu.Action=Ou;var Pu,Su,Tu,ju,Ou={},Cu=(Pu=Ou,Su=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Tu=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.intervalProvider=void 0,Pu.intervalProvider={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Pu.intervalProvider.delegate;return null!=o&&o.setInterval?o.setInterval.apply(o,Tu([e,t],Su(r))):setInterval.apply(void 0,Tu([e,t],Su(r)))},clearInterval:function(e){var t=Pu.intervalProvider.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},r&&r.__extends||(ju=function(e,t){return(ju=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ju(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(j,"__esModule",{value:!0}),j.AsyncAction=void 0;var Iu,Ru=Ou,ku=y,Ou=(Iu=gu.Action,Cu(Au,Iu),Au.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var e=this.id,r=this.scheduler;return null!=e&&(this.id=this.recycleAsyncId(r,e,t)),this.pending=!0,this.delay=t,this.id=null!=(e=this.id)?e:this.requestAsyncId(r,this.id,t),this},Au.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),Ru.intervalProvider.setInterval(e.flush.bind(e,this),r)},Au.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)&&this.delay===r&&!1===this.pending)return t;null!=t&&Ru.intervalProvider.clearInterval(t)},Au.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;e=this._execute(e,t);if(e)return e;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},Au.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},Au.prototype.unsubscribe=function(){var e,t,r;this.closed||(e=this.id,r=(t=this.scheduler).actions,this.work=this.state=this.scheduler=null,this.pending=!1,ku.arrRemove(r,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,Iu.prototype.unsubscribe.call(this))},Au);function Au(e,t){var r=Iu.call(this,e,t)||this;return r.scheduler=e,r.work=t,r.pending=!1,r}j.AsyncAction=Ou;var Mu,xu,Nu,Uu,Du,Lu,gu={},Cu={},Bu=(Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.TestTools=Cu.Immediate=void 0,1),Fu={};function Wu(e){return e in Fu&&(delete Fu[e],!0)}Cu.Immediate={setImmediate:function(e){var t=Bu++;return Fu[t]=!0,(Mu=Mu||Promise.resolve()).then(function(){return Wu(t)&&e()}),t},clearImmediate:function(e){Wu(e)}},Cu.TestTools={pending:function(){return Object.keys(Fu).length}},xu=gu,Nu=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Uu=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Object.defineProperty(xu,"__esModule",{value:!0}),xu.immediateProvider=void 0,Du=Cu.Immediate.setImmediate,Lu=Cu.Immediate.clearImmediate,xu.immediateProvider={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=xu.immediateProvider.delegate;return((null==r?void 0:r.setImmediate)||Du).apply(void 0,Uu([],Nu(e)))},clearImmediate:function(e){var t=xu.immediateProvider.delegate;return((null==t?void 0:t.clearImmediate)||Lu)(e)},delegate:void 0};var zu,Ou=r&&r.__extends||(zu=function(e,t){return(zu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}zu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(T,"__esModule",{value:!0}),T.AsapAction=void 0;var qu,Vu=gu,Cu=(qu=j.AsyncAction,Ou(Hu,qu),Hu.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?qu.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Vu.immediateProvider.setImmediate(e.flush.bind(e,void 0))))},Hu.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return qu.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(Vu.immediateProvider.clearImmediate(t),e._scheduled=void 0)},Hu);function Hu(e,t){var r=qu.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}T.AsapAction=Cu;var gu={},Ou={},Cu={},Yu=(Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.Scheduler=void 0,h);function Ku(e,t){void 0===t&&(t=Ku.now),this.schedulerActionCtor=e,this.now=t}Ku.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},Ku.now=Yu.dateTimestampProvider.now,Cu.Scheduler=Ku;var Gu,Zu,Yu=r&&r.__extends||(Gu=function(e,t){return(Gu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Gu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Qu=(Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.AsyncScheduler=void 0,Cu),Yu=(Zu=Qu.Scheduler,Yu(Xu,Zu),Xu.prototype.flush=function(e){var t,r=this.actions;if(this._active)r.push(e);else{this._active=!0;do{if(t=e.execute(e.state,e.delay))break}while(e=r.shift());if(this._active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}}},Xu);function Xu(e,t){void 0===t&&(t=Qu.Scheduler.now);e=Zu.call(this,e,t)||this;return e.actions=[],e._active=!1,e}Ou.AsyncScheduler=Yu;var Ju,Yu=r&&r.__extends||(Ju=function(e,t){return(Ju=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ju(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(gu,"__esModule",{value:!0}),gu.AsapScheduler=void 0;$u=Ou.AsyncScheduler,Yu(ea,$u),ea.prototype.flush=function(e){this._active=!0;var t,r=this._scheduled,n=(this._scheduled=void 0,this.actions);e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,t){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw t}};var $u,Yu=ea;function ea(){return null!==$u&&$u.apply(this,arguments)||this}gu.AsapScheduler=Yu,Yu=yu,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.asap=Yu.asapScheduler=void 0,Yu.asapScheduler=new gu.AsapScheduler(T.AsapAction),Yu.asap=Yu.asapScheduler;var ta,gu={},Yu=(T=gu,Object.defineProperty(T,"__esModule",{value:!0}),T.async=T.asyncScheduler=void 0,T.asyncScheduler=new Ou.AsyncScheduler(j.AsyncAction),T.async=T.asyncScheduler,{}),T={},ra=r&&r.__extends||(ta=function(e,t){return(ta=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ta(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(T,"__esModule",{value:!0}),T.QueueAction=void 0;na=j.AsyncAction,ra(oa,na),oa.prototype.schedule=function(e,t){return 0<(t=void 0===t?0:t)?na.prototype.schedule.call(this,e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)},oa.prototype.execute=function(e,t){return 0<t||this.closed?na.prototype.execute.call(this,e,t):this._execute(e,t)},oa.prototype.requestAsyncId=function(e,t,r){return null!=(r=void 0===r?0:r)&&0<r||null==r&&0<this.delay?na.prototype.requestAsyncId.call(this,e,t,r):(e.flush(this),0)};var na,ra=oa;function oa(e,t){var r=na.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}T.QueueAction=ra;var ia,ra={},ua=r&&r.__extends||(ia=function(e,t){return(ia=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ia(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(ra,"__esModule",{value:!0}),ra.QueueScheduler=void 0;aa=Ou.AsyncScheduler,ua(sa,aa);var aa,ua=sa;function sa(){return null!==aa&&aa.apply(this,arguments)||this}ra.QueueScheduler=ua,ua=Yu,Object.defineProperty(ua,"__esModule",{value:!0}),ua.queue=ua.queueScheduler=void 0,ua.queueScheduler=new ra.QueueScheduler(T.QueueAction),ua.queue=ua.queueScheduler;var ca,ra={},T={},ua=r&&r.__extends||(ca=function(e,t){return(ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ca(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(T,"__esModule",{value:!0}),T.AnimationFrameAction=void 0;var la,fa=o,o=(la=j.AsyncAction,ua(pa,la),pa.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?la.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=fa.animationFrameProvider.requestAnimationFrame(function(){return e.flush(void 0)})))},pa.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return la.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(fa.animationFrameProvider.cancelAnimationFrame(t),e._scheduled=void 0)},pa);function pa(e,t){var r=la.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}T.AnimationFrameAction=o;var da,ua={},o=r&&r.__extends||(da=function(e,t){return(da=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}da(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(ua,"__esModule",{value:!0}),ua.AnimationFrameScheduler=void 0;ha=Ou.AsyncScheduler,o(ba,ha),ba.prototype.flush=function(e){this._active=!0;var t,r=this._scheduled,n=(this._scheduled=void 0,this.actions);e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,t){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw t}};var ha,o=ba;function ba(){return null!==ha&&ha.apply(this,arguments)||this}ua.AnimationFrameScheduler=o,o=ra,Object.defineProperty(o,"__esModule",{value:!0}),o.animationFrame=o.animationFrameScheduler=void 0,o.animationFrameScheduler=new ua.AnimationFrameScheduler(T.AnimationFrameAction),o.animationFrame=o.animationFrameScheduler;var ya,_a,ua={},T=r&&r.__extends||(ya=function(e,t){return(ya=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}ya(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=(Object.defineProperty(ua,"__esModule",{value:!0}),ua.VirtualAction=ua.VirtualTimeScheduler=void 0,j),va=_,j=(_a=Ou.AsyncScheduler,T(ma,_a),ma.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},ma.frameTimeFactor=10,ma);function ma(e,t){void 0===t&&(t=1/0);var r=_a.call(this,e=void 0===e?Oa:e,function(){return r.frame})||this;return r.maxFrames=t,r.frame=0,r.index=-1,r}ua.VirtualTimeScheduler=j;ga=o.AsyncAction,T(wa,ga),wa.prototype.schedule=function(e,t){if(void 0===t&&(t=0),Number.isFinite(t)){if(!this.id)return ga.prototype.schedule.call(this,e,t);this.active=!1;var r=new wa(this.scheduler,this.work);return this.add(r),r.schedule(e,t)}return va.Subscription.EMPTY},wa.prototype.requestAsyncId=function(e,t,r){this.delay=e.frame+(r=void 0===r?0:r);r=e.actions;return r.push(this),r.sort(wa.sortActions),1},wa.prototype.recycleAsyncId=function(e,t,r){},wa.prototype._execute=function(e,t){if(!0===this.active)return ga.prototype._execute.call(this,e,t)},wa.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1};var ga,Oa=wa;function wa(e,t,r){void 0===r&&(r=e.index+=1);var n=ga.call(this,e,t)||this;return n.scheduler=e,n.work=t,n.index=r,n.active=!0,n.index=e.index=r,n}ua.VirtualAction=Oa;var Ea,Pa,Ou={},j={},o=(Ea=j,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.empty=Ea.EMPTY=void 0,Pa=s,Ea.EMPTY=new Pa.Observable(function(e){return e.complete()}),Ea.empty=function(e){return e?(t=e,new Pa.Observable(function(e){return t.schedule(function(){return e.complete()})})):Ea.EMPTY;var t},{}),T={},Sa={},Ta=(Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.isScheduler=void 0,g);Sa.isScheduler=function(e){return e&&Ta.isFunction(e.schedule)},Object.defineProperty(T,"__esModule",{value:!0}),T.popNumber=T.popScheduler=T.popResultSelector=void 0;var ja=g,Ca=Sa;function Ia(e){return e[e.length-1]}T.popResultSelector=function(e){return ja.isFunction(Ia(e))?e.pop():void 0},T.popScheduler=function(e){return Ca.isScheduler(Ia(e))?e.pop():void 0},T.popNumber=function(e,t){return"number"==typeof Ia(e)?e.pop():t};var Ra={},ka={},Aa={},C={},Ma={},xa=(Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.isArrayLike=void 0,Ma.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},{}),Na=(Object.defineProperty(xa,"__esModule",{value:!0}),xa.isPromise=void 0,g);xa.isPromise=function(e){return Na.isFunction(null==e?void 0:e.then)};var Ua={},Da=(Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.isInteropObservable=void 0,jr),La=g;Ua.isInteropObservable=function(e){return La.isFunction(e[Da.observable])};var Ba={},Fa=(Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.isAsyncIterable=void 0,g);Ba.isAsyncIterable=function(e){return Symbol.asyncIterator&&Fa.isFunction(null==e?void 0:e[Symbol.asyncIterator])};var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.createInvalidObservableTypeError=void 0,Wa.createInvalidObservableTypeError=function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")};var za={},qa={};function Va(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(qa,"__esModule",{value:!0}),qa.iterator=qa.getSymbolIterator=void 0,qa.getSymbolIterator=Va,qa.iterator=Va(),Object.defineProperty(za,"__esModule",{value:!0}),za.isIterable=void 0;var Ha=qa,Ya=g;za.isIterable=function(e){return Ya.isFunction(null==e?void 0:e[Ha.iterator])};var Ka={},Ga=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Za=r&&r.__await||function(e){return this instanceof Za?(this.v=e,this):new Za(e)},Qa=r&&r.__asyncGenerator||function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=r.apply(e,t||[]),i=[],u={};return n("next"),n("throw"),n("return"),u[Symbol.asyncIterator]=function(){return this},u;function n(n){o[n]&&(u[n]=function(r){return new Promise(function(e,t){1<i.push([n,r,e,t])||a(n,r)})})}function a(e,t){try{(r=o[e](t)).value instanceof Za?Promise.resolve(r.value.v).then(s,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function s(e){a("next",e)}function c(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}},Xa=(Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.isReadableStreamLike=Ka.readableStreamLikeToAsyncGenerator=void 0,g);Ka.readableStreamLikeToAsyncGenerator=function(o){return Qa(this,arguments,function(){var t,r,n;return Ga(this,function(e){switch(e.label){case 0:t=o.getReader(),e.label=1;case 1:e.trys.push([1,,9,10]),e.label=2;case 2:return[4,Za(t.read())];case 3:return(r=e.sent(),n=r.value,r.done)?[4,Za(void 0)]:[3,5];case 4:return[2,e.sent()];case 5:return[4,Za(n)];case 6:return[4,e.sent()];case 7:return e.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})},Ka.isReadableStreamLike=function(e){return Xa.isFunction(null==e?void 0:e.getReader)};var Ja=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},$a=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},es=r&&r.__asyncValues||function(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=u[Symbol.asyncIterator];return t?t.call(u):(u="function"==typeof ts?ts(u):u[Symbol.iterator](),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(i){e[i]=u[i]&&function(o){return new Promise(function(e,t){var r,n;o=u[i](o),r=e,e=t,n=o.done,t=o.value,Promise.resolve(t).then(function(e){r({value:e,done:n})},e)})}}},ts=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},rs=(Object.defineProperty(C,"__esModule",{value:!0}),C.fromReadableStreamLike=C.fromAsyncIterable=C.fromIterable=C.fromPromise=C.fromArrayLike=C.fromInteropObservable=C.innerFrom=void 0,Ma),ns=xa,os=s,is=Ua,us=Ba,as=Wa,ss=za,cs=Ka,ls=g,fs=v,ps=jr;function ds(r){return new os.Observable(function(e){var t=r[ps.observable]();if(ls.isFunction(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function hs(r){return new os.Observable(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function bs(e){return new os.Observable(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,fs.reportUnhandledError)})}function ys(u){return new os.Observable(function(e){var t,r;try{for(var n=ts(u),o=n.next();!o.done;o=n.next()){var i=o.value;if(e.next(i),e.closed)return}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e.complete()})}function _s(e){return new os.Observable(function(t){!function(r,n){var o,i,u,a;return Ja(this,void 0,void 0,function(){var t;return $a(this,function(e){switch(e.label){case 0:e.trys.push([0,5,6,11]),o=es(r),e.label=1;case 1:return[4,o.next()];case 2:if((i=e.sent()).done)return[3,4];if(t=i.value,n.next(t),n.closed)return[2];e.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return t=e.sent(),u={error:t},[3,11];case 6:return(e.trys.push([6,,9,10]),i&&!i.done&&(a=o.return))?[4,a.call(o)]:[3,8];case 7:e.sent(),e.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})}(e,t).catch(function(e){return t.error(e)})})}function vs(e){return _s(cs.readableStreamLikeToAsyncGenerator(e))}C.innerFrom=function(e){if(e instanceof os.Observable)return e;if(null!=e){if(is.isInteropObservable(e))return ds(e);if(rs.isArrayLike(e))return hs(e);if(ns.isPromise(e))return bs(e);if(us.isAsyncIterable(e))return _s(e);if(ss.isIterable(e))return ys(e);if(cs.isReadableStreamLike(e))return vs(e)}throw as.createInvalidObservableTypeError(e)},C.fromInteropObservable=ds,C.fromArrayLike=hs,C.fromPromise=bs,C.fromIterable=ys,C.fromAsyncIterable=_s,C.fromReadableStreamLike=vs;var v={},ms={};Object.defineProperty(ms,"__esModule",{value:!0}),ms.executeSchedule=void 0,ms.executeSchedule=function(e,t,r,n,o){if(void 0===n&&(n=0),void 0===o&&(o=!1),t=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n),e.add(t),!o)return t},Object.defineProperty(v,"__esModule",{value:!0}),v.observeOn=void 0;var gs=ms,Os=S,ws=O;v.observeOn=function(r,n){return void 0===n&&(n=0),Os.operate(function(e,t){e.subscribe(ws.createOperatorSubscriber(t,function(e){return gs.executeSchedule(t,r,function(){return t.next(e)},n)},function(){return gs.executeSchedule(t,r,function(){return t.complete()},n)},function(e){return gs.executeSchedule(t,r,function(){return t.error(e)},n)}))})};var Es={},Ps=(Object.defineProperty(Es,"__esModule",{value:!0}),Es.subscribeOn=void 0,S);Es.subscribeOn=function(r,n){return void 0===n&&(n=0),Ps.operate(function(e,t){t.add(r.schedule(function(){return e.subscribe(t)},n))})},Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.scheduleObservable=void 0;var Ss=C,Ts=v,js=Es;Aa.scheduleObservable=function(e,t){return Ss.innerFrom(e).pipe(js.subscribeOn(t),Ts.observeOn(t))};var Cs={},Is=(Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.schedulePromise=void 0,C),Rs=v,ks=Es;Cs.schedulePromise=function(e,t){return Is.innerFrom(e).pipe(ks.subscribeOn(t),Rs.observeOn(t))};var As={},Ms=(Object.defineProperty(As,"__esModule",{value:!0}),As.scheduleArray=void 0,s);As.scheduleArray=function(r,n){return new Ms.Observable(function(e){var t=0;return n.schedule(function(){t===r.length?e.complete():(e.next(r[t++]),e.closed||this.schedule())})})};var xs={},Ns=(Object.defineProperty(xs,"__esModule",{value:!0}),xs.scheduleIterable=void 0,s),Us=qa,Ds=g,Ls=ms;xs.scheduleIterable=function(e,t){return new Ns.Observable(function(n){var o;return Ls.executeSchedule(n,t,function(){o=e[Us.iterator](),Ls.executeSchedule(n,t,function(){var e,t,r;try{t=(e=o.next()).value,r=e.done}catch(e){return void n.error(e)}r?n.complete():n.next(t)},0,!0)}),function(){return Ds.isFunction(null==o?void 0:o.return)&&o.return()}})};var qa={},Bs=(Object.defineProperty(qa,"__esModule",{value:!0}),qa.scheduleAsyncIterable=void 0,s),Fs=ms;qa.scheduleAsyncIterable=function(r,n){if(r)return new Bs.Observable(function(t){Fs.executeSchedule(t,n,function(){var e=r[Symbol.asyncIterator]();Fs.executeSchedule(t,n,function(){e.next().then(function(e){e.done?t.complete():t.next(e.value)})},0,!0)})});throw new Error("Iterable cannot be null")};var Ws={},zs=(Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.scheduleReadableStreamLike=void 0,qa),qs=Ka;Ws.scheduleReadableStreamLike=function(e,t){return zs.scheduleAsyncIterable(qs.readableStreamLikeToAsyncGenerator(e),t)},Object.defineProperty(ka,"__esModule",{value:!0}),ka.scheduled=void 0;var Vs=Aa,Hs=Cs,Ys=As,Ks=xs,Gs=qa,Zs=Ua,Qs=xa,Xs=Ma,Js=za,$s=Ba,ec=Wa,tc=Ka,rc=Ws;ka.scheduled=function(e,t){if(null!=e){if(Zs.isInteropObservable(e))return Vs.scheduleObservable(e,t);if(Xs.isArrayLike(e))return Ys.scheduleArray(e,t);if(Qs.isPromise(e))return Hs.schedulePromise(e,t);if($s.isAsyncIterable(e))return Gs.scheduleAsyncIterable(e,t);if(Js.isIterable(e))return Ks.scheduleIterable(e,t);if(tc.isReadableStreamLike(e))return rc.scheduleReadableStreamLike(e,t)}throw ec.createInvalidObservableTypeError(e)},Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.from=void 0;var nc=ka,oc=C;Ra.from=function(e,t){return t?nc.scheduled(e,t):oc.innerFrom(e)},Object.defineProperty(o,"__esModule",{value:!0}),o.of=void 0;var ic=T,uc=Ra;o.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ic.popScheduler(e);return uc.from(e,r)};var ac,sc,cc,lc,Aa={},fc=(Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.throwError=void 0,s),pc=g;function dc(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}function hc(e,t){var r,n=e.kind,o=e.value,e=e.error;if("string"!=typeof n)throw new TypeError('Invalid notification, missing "kind"');"N"===n?null!=(r=t.next)&&r.call(t,o):"E"===n?null!=(r=t.error)&&r.call(t,e):null!=(o=t.complete)&&o.call(t)}Aa.throwError=function(e,t){function r(e){return e.error(n())}var n=pc.isFunction(e)?e:function(){return e};return new fc.Observable(t?function(e){return t.schedule(r,0,e)}:r)},Cs=Ou,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.observeNotification=Cs.Notification=Cs.NotificationKind=void 0,ac=j,sc=o,cc=Aa,lc=g,(As=Cs.NotificationKind||(Cs.NotificationKind={})).NEXT="N",As.ERROR="E",As.COMPLETE="C",dc.prototype.observe=function(e){return hc(this,e)},dc.prototype.do=function(e,t,r){var n=this.kind,o=this.value,i=this.error;return"N"===n?null==e?void 0:e(o):"E"===n?null==t?void 0:t(i):null==r?void 0:r()},dc.prototype.accept=function(e,t,r){var n;return lc.isFunction(null==(n=e)?void 0:n.next)?this.observe(e):this.do(e,t,r)},dc.prototype.toObservable=function(){var e=this.kind,t=this.value,r=this.error,t="N"===e?sc.of(t):"E"===e?cc.throwError(function(){return r}):"C"===e?ac.EMPTY:0;if(t)return t;throw new TypeError("Unexpected notification kind "+e)},dc.createNext=function(e){return new dc("N",e)},dc.createError=function(e){return new dc("E",void 0,e)},dc.createComplete=function(){return dc.completeNotification},dc.completeNotification=new dc("C"),As=dc,Cs.Notification=As,Cs.observeNotification=hc;var qa={},bc=(Object.defineProperty(qa,"__esModule",{value:!0}),qa.isObservable=void 0,s),yc=g;qa.isObservable=function(e){return!!e&&(e instanceof bc.Observable||yc.isFunction(e.lift)&&yc.isFunction(e.subscribe))};var Ua={},xa={},za=(Object.defineProperty(xa,"__esModule",{value:!0}),xa.EmptyError=void 0,a),_c=(xa.EmptyError=za.createErrorClass(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}),Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.lastValueFrom=void 0,xa);Ua.lastValueFrom=function(o,i){var u="object"==typeof i;return new Promise(function(e,t){var r,n=!1;o.subscribe({next:function(e){r=e,n=!0},error:t,complete:function(){n?e(r):u?e(i.defaultValue):t(new _c.EmptyError)}})})};var Ba={},vc=(Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.firstValueFrom=void 0,xa),mc=Mr;Ba.firstValueFrom=function(n,o){var i="object"==typeof o;return new Promise(function(t,e){var r=new mc.SafeSubscriber({next:function(e){t(e),r.unsubscribe()},error:e,complete:function(){i?t(o.defaultValue):e(new vc.EmptyError)}});n.subscribe(r)})};var gc,Oc,wc,Ec,Pc,Sc,Tc,Wa={},Ka=(Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.ArgumentOutOfRangeError=void 0,a),Ws=(Wa.ArgumentOutOfRangeError=Ka.createErrorClass(function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}),{}),As=(Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.NotFoundError=void 0,a),Cs=(Ws.NotFoundError=As.createErrorClass(function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}}),{}),za=(Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.SequenceError=void 0,a),Ka=(Cs.SequenceError=za.createErrorClass(function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}),{}),As={};function jc(e){throw new gc.TimeoutError(e)}Object.defineProperty(As,"__esModule",{value:!0}),As.isValidDate=void 0,As.isValidDate=function(e){return e instanceof Date&&!isNaN(e)},gc=Ka,Object.defineProperty(gc,"__esModule",{value:!0}),gc.timeout=gc.TimeoutError=void 0,Oc=gu,wc=As,Ec=S,Pc=C,Sc=O,Tc=ms,gc.TimeoutError=a.createErrorClass(function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}),gc.timeout=function(e,t){var a=(e=wc.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e).first,s=e.each,r=e.with,c=void 0===r?jc:r,l=void 0===(r=e.scheduler)?null!=t?t:Oc.asyncScheduler:r,f=void 0===(t=e.meta)?null:t;if(null==a&&null==s)throw new TypeError("No timeout provided.");return Ec.operate(function(e,t){function r(e){n=Tc.executeSchedule(t,l,function(){try{u.unsubscribe(),Pc.innerFrom(c({meta:f,lastValue:o,seen:i})).subscribe(t)}catch(e){t.error(e)}},e)}var n,o=null,i=0,u=e.subscribe(Sc.createOperatorSubscriber(t,function(e){null!=n&&n.unsubscribe(),i++,t.next(o=e),0<s&&r(s)},void 0,void 0,function(){null!=n&&n.closed||null!=n&&n.unsubscribe(),o=null}));i||r(null!=a?"number"==typeof a?a:+a-l.now():s)})};var za={},a={},Cc={},Ic={},Rc=(Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.map=void 0,S),kc=O;Ic.map=function(n,o){return Rc.operate(function(e,t){var r=0;e.subscribe(kc.createOperatorSubscriber(t,function(e){t.next(n.call(o,e,r++))}))})};var Ac=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Mc=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},xc=(Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.mapOneOrManyArgs=void 0,Ic),Nc=Array.isArray;Cc.mapOneOrManyArgs=function(r){return xc.map(function(e){return t=r,Nc(e=e)?t.apply(void 0,Mc([],Ac(e))):t(e);var t})};var Uc=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Dc=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Lc=(Object.defineProperty(a,"__esModule",{value:!0}),a.bindCallbackInternals=void 0,Sa),Bc=s,Fc=Es,Wc=Cc,zc=v,qc=l;a.bindCallbackInternals=function r(a,s,n,o){if(n){if(!Lc.isScheduler(n))return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(a,s,o).apply(this,e).pipe(Wc.mapOneOrManyArgs(n))};o=n}return o?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(a,s).apply(this,e).pipe(Fc.subscribeOn(o),zc.observeOn(o))}:function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var i=new qc.AsyncSubject,u=!0;return new Bc.Observable(function(e){var n,o,e=i.subscribe(e);return u&&(n=u=!1,o=!1,s.apply(t,Dc(Dc([],Uc(r)),[function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(a){var r=e.shift();if(null!=r)return void i.error(r)}i.next(1<e.length?e:e[0]),o=!0,n&&i.complete()}])),o&&i.complete(),n=!0),e})}},Object.defineProperty(za,"__esModule",{value:!0}),za.bindCallback=void 0;var Vc=a;za.bindCallback=function(e,t,r){return Vc.bindCallbackInternals(!1,e,t,r)};var Hc={},Yc=(Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.bindNodeCallback=void 0,a);Hc.bindNodeCallback=function(e,t,r){return Yc.bindCallbackInternals(!0,e,t,r)};var a={},Kc={},Gc=(Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.argsArgArrayOrObject=void 0,Array.isArray),Zc=Object.getPrototypeOf,Qc=Object.prototype,Xc=Object.keys;Kc.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(Gc(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&Zc(r)===Qc)return{args:(r=Xc(t)).map(function(e){return t[e]}),keys:r}}var r;return{args:e,keys:null}};var Jc={};Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.createObject=void 0,Jc.createObject=function(e,n){return e.reduce(function(e,t,r){return e[t]=n[r],e},{})},Object.defineProperty(a,"__esModule",{value:!0}),a.combineLatestInit=a.combineLatest=void 0;var $c=s,el=Kc,tl=Ra,rl=P,nl=Cc,ol=T,il=Jc,ul=O,al=ms;function sl(a,s,c){return void 0===c&&(c=rl.identity),function(u){cl(s,function(){for(var e=a.length,n=new Array(e),o=e,i=e,t=0;t<e;t++)!function(r){cl(s,function(){var e=tl.from(a[r],s),t=!1;e.subscribe(ul.createOperatorSubscriber(u,function(e){n[r]=e,t||(t=!0,i--),i||u.next(c(n.slice()))},function(){--o||u.complete()}))},u)}(t)},u)}}function cl(e,t,r){e?al.executeSchedule(r,e,t):t()}a.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ol.popScheduler(e),n=ol.popResultSelector(e),o=el.argsArgArrayOrObject(e),i=o.args,u=o.keys;return 0===i.length?tl.from([],r):(o=new $c.Observable(sl(i,r,u?function(e){return il.createObject(u,e)}:rl.identity)),n?o.pipe(nl.mapOneOrManyArgs(n)):o)},a.combineLatestInit=sl;var ll={},fl={},pl={},dl={},hl={},bl=(Object.defineProperty(hl,"__esModule",{value:!0}),hl.mergeInternals=void 0,C),yl=ms,_l=O;hl.mergeInternals=function(e,r,n,o,i,u,a,t){var s=[],c=0,l=0,f=function(){s.length||c||r.complete()},p=function(e){return c<o?d(e):s.push(e)},d=function(e){u&&r.next(e),c++;var t=!1;bl.innerFrom(n(e,l++)).subscribe(_l.createOperatorSubscriber(r,function(e){null!=i&&i(e),u?p(e):r.next(e)},function(){t=!0},void 0,function(){if(t)try{c--;for(;s.length&&c<o;)!function(){var e=s.shift();a?yl.executeSchedule(r,a,function(){return d(e)}):d(e)}();f()}catch(e){r.error(e)}}))};return e.subscribe(_l.createOperatorSubscriber(r,p,function(){f()})),function(){null!=t&&t()}},Object.defineProperty(dl,"__esModule",{value:!0}),dl.mergeMap=void 0;var vl=Ic,ml=C,gl=S,Ol=hl,wl=g;dl.mergeMap=function e(o,i,r){return void 0===r&&(r=1/0),wl.isFunction(i)?e(function(r,n){return vl.map(function(e,t){return i(r,e,n,t)})(ml.innerFrom(o(r,n)))},r):("number"==typeof i&&(r=i),gl.operate(function(e,t){return Ol.mergeInternals(e,t,o,r)}))},Object.defineProperty(pl,"__esModule",{value:!0}),pl.mergeAll=void 0;var El=dl,Pl=P;pl.mergeAll=function(e){return El.mergeMap(Pl.identity,e=void 0===e?1/0:e)},Object.defineProperty(fl,"__esModule",{value:!0}),fl.concatAll=void 0;var Sl=pl;fl.concatAll=function(){return Sl.mergeAll(1)},Object.defineProperty(ll,"__esModule",{value:!0}),ll.concat=void 0;var Tl=fl,jl=T,Cl=Ra;ll.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tl.concatAll()(Cl.from(e,jl.popScheduler(e)))};var Il={},Rl={},kl=(Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.defer=void 0,s),Al=C;Rl.defer=function(t){return new kl.Observable(function(e){Al.innerFrom(t()).subscribe(e)})},Object.defineProperty(Il,"__esModule",{value:!0}),Il.connectable=void 0;var Ml=u,xl=s,Nl=Rl,Ul={connector:function(){return new Ml.Subject},resetOnDisconnect:!0};Il.connectable=function(e,t){var r=null,n=(t=void 0===t?Ul:t).connector,o=void 0===(t=t.resetOnDisconnect)||t,i=n();return(t=new xl.Observable(function(e){return i.subscribe(e)})).connect=function(){return r&&!r.closed||(r=Nl.defer(function(){return e}).subscribe(i),o&&r.add(function(){return i=n()})),r},t};var Dl={},Ll=(Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.forkJoin=void 0,s),Bl=Kc,Fl=C,Wl=T,zl=O,ql=Cc,Vl=Jc;Dl.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Wl.popResultSelector(e),u=(n=Bl.argsArgArrayOrObject(e)).args,a=n.keys,n=new Ll.Observable(function(e){var t=u.length;if(t)for(var n=new Array(t),o=t,i=t,r=0;r<t;r++)!function(t){var r=!1;Fl.innerFrom(u[t]).subscribe(zl.createOperatorSubscriber(e,function(e){r||(r=!0,i--),n[t]=e},function(){return o--},void 0,function(){o&&r||(i||e.next(a?Vl.createObject(a,n):n),e.complete())}))}(r);else e.complete()});return r?n.pipe(ql.mapOneOrManyArgs(r)):n};var Kc={},Hl=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Yl=(Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.fromEvent=void 0,C),Kl=s,Gl=dl,Zl=Ma,Ql=g,Xl=Cc,Jl=["addListener","removeListener"],$l=["addEventListener","removeEventListener"],ef=["on","off"];function tf(r,n){return function(t){return function(e){return r[t](n,e)}}}Kc.fromEvent=function t(r,n,o,e){if(Ql.isFunction(o)&&(e=o,o=void 0),e)return t(r,n,o).pipe(Xl.mapOneOrManyArgs(e));var e=Hl((e=r,Ql.isFunction(e.addEventListener)&&Ql.isFunction(e.removeEventListener)?$l.map(function(t){return function(e){return r[t](n,e,o)}}):(e=r,Ql.isFunction(e.addListener)&&Ql.isFunction(e.removeListener)?Jl.map(tf(r,n)):(e=r,Ql.isFunction(e.on)&&Ql.isFunction(e.off)?ef.map(tf(r,n)):[]))),2),i=e[0],u=e[1];if(!i&&Zl.isArrayLike(r))return Gl.mergeMap(function(e){return t(e,n,o)})(Yl.innerFrom(r));if(i)return new Kl.Observable(function(r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1<e.length?e:e[0])}return i(e),function(){return u(e)}});throw new TypeError("Invalid event target")};var Jc={},rf=(Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.fromEventPattern=void 0,s),nf=g,of=Cc;Jc.fromEventPattern=function e(n,o,t){return t?e(n,o).pipe(of.mapOneOrManyArgs(t)):new rf.Observable(function(r){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.next(1===e.length?e[0]:e)}var t=n(e);return nf.isFunction(o)?function(){return o(e,t)}:void 0})};var Ma={},uf=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},af=(Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.generate=void 0,P),sf=Sa,cf=Rl,lf=xs;Ma.generate=function(e,r,n,t,o){var i,u,a;function s(){var t;return uf(this,function(e){switch(e.label){case 0:t=a,e.label=1;case 1:return r&&!r(t)?[3,4]:[4,u(t)];case 2:e.sent(),e.label=3;case 3:return t=n(t),[3,1];case 4:return[2]}})}return 1===arguments.length?(a=e.initialState,r=e.condition,n=e.iterate,i=e.resultSelector,u=void 0===i?af.identity:i,o=e.scheduler):(a=e,!t||sf.isScheduler(t)?(u=af.identity,o=t):u=t),cf.defer(o?function(){return lf.scheduleIterable(s(),o)}:s)};var xs={},ff=(Object.defineProperty(xs,"__esModule",{value:!0}),xs.iif=void 0,Rl);xs.iif=function(e,t,r){return ff.defer(function(){return e()?t:r})};var pf={},df={},hf=(Object.defineProperty(df,"__esModule",{value:!0}),df.timer=void 0,s),bf=gu,yf=Sa,_f=As;df.timer=function(n,e,o){void 0===n&&(n=0),void 0===o&&(o=bf.async);var i=-1;return null!=e&&(yf.isScheduler(e)?o=e:i=e),new hf.Observable(function(e){var t=_f.isValidDate(n)?+n-o.now():n,r=0;return o.schedule(function(){e.closed||(e.next(r++),0<=i?this.schedule(void 0,i):e.complete())},t=t<0?0:t)})},Object.defineProperty(pf,"__esModule",{value:!0}),pf.interval=void 0;var vf=gu,mf=df;pf.interval=function(e,t){return mf.timer(e=(e=void 0===e?0:e)<0?0:e,e,t=void 0===t?vf.asyncScheduler:t)};var Sa={},gf=(Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.merge=void 0,pl),Of=C,wf=j,Ef=T,Pf=Ra;Sa.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Ef.popScheduler(e),n=Ef.popNumber(e,1/0),o=e;return o.length?1===o.length?Of.innerFrom(o[0]):gf.mergeAll(n)(Pf.from(o,r)):wf.EMPTY};var Sf,Tf={},jf=(Sf=Tf,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.never=Sf.NEVER=void 0,Sf.NEVER=new s.Observable(i.noop),Sf.never=function(){return Sf.NEVER},{}),Cf={},If=(Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.argsOrArgArray=void 0,Array.isArray);Cf.argsOrArgArray=function(e){return 1===e.length&&If(e[0])?e[0]:e},Object.defineProperty(jf,"__esModule",{value:!0}),jf.onErrorResumeNext=void 0;var Rf=s,kf=Cf,Af=O,Mf=i,xf=C;jf.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=kf.argsOrArgArray(e);return new Rf.Observable(function(r){var n=0,o=function(){if(n<i.length){var e=void 0;try{e=xf.innerFrom(i[n++])}catch(e){return void o()}var t=new Af.OperatorSubscriber(r,void 0,Mf.noop,Mf.noop);e.subscribe(t),t.add(o)}else r.complete()};o()})};var Nf={},Uf=(Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.pairs=void 0,Ra);Nf.pairs=function(e,t){return Uf.from(Object.entries(e),t)};var Df={},Lf={};Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.not=void 0,Lf.not=function(r,n){return function(e,t){return!r.call(n,e,t)}};var Bf={},Ff=(Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.filter=void 0,S),Wf=O;Bf.filter=function(n,o){return Ff.operate(function(e,t){var r=0;e.subscribe(Wf.createOperatorSubscriber(t,function(e){return n.call(o,e,r++)&&t.next(e)}))})},Object.defineProperty(Df,"__esModule",{value:!0}),Df.partition=void 0;var zf=Lf,qf=Bf,Vf=C;Df.partition=function(e,t,r){return[qf.filter(t,r)(Vf.innerFrom(e)),qf.filter(zf.not(t,r))(Vf.innerFrom(e))]};var Hf={},Yf=(Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.raceInit=Hf.race=void 0,s),Kf=C,Gf=Cf,Zf=O;function Qf(t){return function(n){for(var o=[],e=0;o&&!n.closed&&e<t.length;e++)!function(r){o.push(Kf.innerFrom(t[r]).subscribe(Zf.createOperatorSubscriber(n,function(e){if(o){for(var t=0;t<o.length;t++)t!==r&&o[t].unsubscribe();o=null}n.next(e)})))}(e)}}Hf.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Gf.argsOrArgArray(e)).length?Kf.innerFrom(e[0]):new Yf.Observable(Qf(e))},Hf.raceInit=Qf;var Xf={},Jf=(Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.range=void 0,s),$f=j;Xf.range=function(r,e,n){if(null==e&&(e=r,r=0),e<=0)return $f.EMPTY;var o=e+r;return new Jf.Observable(n?function(e){var t=r;return n.schedule(function(){t<o?(e.next(t++),this.schedule()):e.complete()})}:function(e){for(var t=r;t<o&&!e.closed;)e.next(t++);e.complete()})};var ep={},tp=(Object.defineProperty(ep,"__esModule",{value:!0}),ep.using=void 0,s),rp=C,np=j;ep.using=function(n,o){return new tp.Observable(function(e){var t=n(),r=o(t);return(r?rp.innerFrom(r):np.EMPTY).subscribe(e),function(){t&&t.unsubscribe()}})};var op={},ip=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},up=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},ap=(Object.defineProperty(op,"__esModule",{value:!0}),op.zip=void 0,s),sp=C,cp=Cf,lp=j,fp=O,pp=T;op.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=pp.popResultSelector(e),u=cp.argsOrArgArray(e);return u.length?new ap.Observable(function(r){for(var n=u.map(function(){return[]}),o=u.map(function(){return!1}),e=(r.add(function(){n=o=null}),0);!r.closed&&e<u.length;e++)!function(t){sp.innerFrom(u[t]).subscribe(fp.createOperatorSubscriber(r,function(e){n[t].push(e),n.every(function(e){return e.length})&&(e=n.map(function(e){return e.shift()}),r.next(i?i.apply(void 0,up([],ip(e))):e),n.some(function(e,t){return!e.length&&o[t]})&&r.complete())},function(){o[t]=!0,n[t].length||r.complete()}))}(e);return function(){n=o=null}}):lp.EMPTY};var dp={},hp=(Object.defineProperty(dp,"__esModule",{value:!0}),{}),bp=(Object.defineProperty(hp,"__esModule",{value:!0}),hp.audit=void 0,S),yp=C,_p=O;hp.audit=function(s){return bp.operate(function(e,t){function r(){var e;null!=u&&u.unsubscribe(),u=null,o&&(o=!1,e=i,i=null,t.next(e)),a&&t.complete()}function n(){u=null,a&&t.complete()}var o=!1,i=null,u=null,a=!1;e.subscribe(_p.createOperatorSubscriber(t,function(e){o=!0,i=e,u||yp.innerFrom(s(e)).subscribe(u=_p.createOperatorSubscriber(t,r,n))},function(){a=!0,o&&u&&!u.closed||t.complete()}))})};var vp={},mp=(Object.defineProperty(vp,"__esModule",{value:!0}),vp.auditTime=void 0,gu),gp=hp,Op=df;vp.auditTime=function(e,t){return void 0===t&&(t=mp.asyncScheduler),gp.audit(function(){return Op.timer(e,t)})};var wp={},Ep=(Object.defineProperty(wp,"__esModule",{value:!0}),wp.buffer=void 0,S),Pp=i,Sp=O,Tp=C;wp.buffer=function(n){return Ep.operate(function(e,t){var r=[];return e.subscribe(Sp.createOperatorSubscriber(t,function(e){return r.push(e)},function(){t.next(r),t.complete()})),Tp.innerFrom(n).subscribe(Sp.createOperatorSubscriber(t,function(){var e=r;r=[],t.next(e)},Pp.noop)),function(){r=null}})};var jp={},Cp=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ip=(Object.defineProperty(jp,"__esModule",{value:!0}),jp.bufferCount=void 0,S),Rp=O,kp=y;jp.bufferCount=function(h,b){return b=null!=(b=void 0===b?null:b)?b:h,Ip.operate(function(e,f){var p=[],d=0;e.subscribe(Rp.createOperatorSubscriber(f,function(e){var t,r,n,o,i=null;d++%b==0&&p.push([]);try{for(var u=Cp(p),a=u.next();!a.done;a=u.next())(l=a.value).push(e),h<=l.length&&(i=null!=i?i:[]).push(l)}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}if(i)try{for(var s=Cp(i),c=s.next();!c.done;c=s.next()){var l=c.value;kp.arrRemove(p,l),f.next(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},function(){var t,e;try{for(var r=Cp(p),n=r.next();!n.done;n=r.next()){var o=n.value;f.next(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}f.complete()},void 0,function(){p=null}))})};var Ap={},Mp=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},xp=(Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.bufferTime=void 0,_),Np=S,Up=O,Dp=y,Lp=gu,Bp=T,Fp=ms;Ap.bufferTime=function(i){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var u=null!=(e=Bp.popScheduler(t))?e:Lp.asyncScheduler,a=null!=(e=t[0])?e:null,l=t[1]||1/0;return Np.operate(function(e,r){var s=[],n=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),Dp.arrRemove(s,e),r.next(t),n&&o()},o=function(){var e,t;s&&(e=new xp.Subscription,r.add(e),s.push(t={buffer:[],subs:e}),Fp.executeSchedule(e,u,function(){return c(t)},i))},t=(null!==a&&0<=a?Fp.executeSchedule(r,u,o,a,!0):n=!0,o(),Up.createOperatorSubscriber(r,function(e){var t,r,n=s.slice();try{for(var o=Mp(n),i=o.next();!i.done;i=o.next()){var u=i.value,a=u.buffer;a.push(e),l<=a.length&&c(u)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},function(){for(;null!=s&&s.length;)r.next(s.shift().buffer);null!=t&&t.unsubscribe(),r.complete(),r.unsubscribe()},void 0,function(){return s=null}));e.subscribe(t)})};var Wp={},zp=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qp=(Object.defineProperty(Wp,"__esModule",{value:!0}),Wp.bufferToggle=void 0,_),Vp=S,Hp=C,Yp=O,Kp=i,Gp=y;Wp.bufferToggle=function(t,o){return Vp.operate(function(e,n){var i=[];Hp.innerFrom(t).subscribe(Yp.createOperatorSubscriber(n,function(e){var t=[],r=(i.push(t),new qp.Subscription);r.add(Hp.innerFrom(o(e)).subscribe(Yp.createOperatorSubscriber(n,function(){Gp.arrRemove(i,t),n.next(t),r.unsubscribe()},Kp.noop)))},Kp.noop)),e.subscribe(Yp.createOperatorSubscriber(n,function(e){var t,r;try{for(var n=zp(i),o=n.next();!o.done;o=n.next())o.value.push(e)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},function(){for(;0<i.length;)n.next(i.shift());n.complete()}))})};var Zp={},Qp=(Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.bufferWhen=void 0,S),Xp=i,Jp=O,$p=C;Zp.bufferWhen=function(i){return Qp.operate(function(e,t){var r=null,n=null,o=function(){null!=n&&n.unsubscribe();var e=r;r=[],e&&t.next(e),$p.innerFrom(i()).subscribe(n=Jp.createOperatorSubscriber(t,o,Xp.noop))};o(),e.subscribe(Jp.createOperatorSubscriber(t,function(e){return null==r?void 0:r.push(e)},function(){r&&t.next(r),t.complete()},void 0,function(){return r=n=null}))})};var ed={},td=(Object.defineProperty(ed,"__esModule",{value:!0}),ed.catchError=void 0,C),rd=O,nd=S;ed.catchError=function u(a){return nd.operate(function(t,r){var n,o=null,i=!1,o=t.subscribe(rd.createOperatorSubscriber(r,void 0,void 0,function(e){n=td.innerFrom(a(e,u(a)(t))),o?(o.unsubscribe(),o=null,n.subscribe(r)):i=!0}));i&&(o.unsubscribe(),o=null,n.subscribe(r))})};var od={},id={},I={},ud={},ad={},sd={},cd=(Object.defineProperty(sd,"__esModule",{value:!0}),sd.scanInternals=void 0,O);sd.scanInternals=function(u,t,a,s,c){return function(e,r){var n=a,o=t,i=0;e.subscribe(cd.createOperatorSubscriber(r,function(e){var t=i++;o=n?u(o,e,t):(n=!0,e),s&&r.next(o)},c&&function(){n&&r.next(o),r.complete()}))}},Object.defineProperty(ad,"__esModule",{value:!0}),ad.reduce=void 0;var ld=sd,fd=S;ad.reduce=function(e,t){return fd.operate(ld.scanInternals(e,t,2<=arguments.length,!1,!0))},Object.defineProperty(ud,"__esModule",{value:!0}),ud.toArray=void 0;function pd(e,t){return e.push(t),e}var dd=ad,hd=S;ud.toArray=function(){return hd.operate(function(e,t){dd.reduce(pd,[])(e).subscribe(t)})},Object.defineProperty(I,"__esModule",{value:!0}),I.joinAllInternals=void 0;var bd=P,yd=Cc,_d=st,vd=dl,md=ud;I.joinAllInternals=function(t,e){return _d.pipe(md.toArray(),vd.mergeMap(function(e){return t(e)}),e?yd.mapOneOrManyArgs(e):bd.identity)},Object.defineProperty(id,"__esModule",{value:!0}),id.combineLatestAll=void 0;var gd=a,Od=I;id.combineLatestAll=function(e){return Od.joinAllInternals(gd.combineLatest,e)},Object.defineProperty(od,"__esModule",{value:!0}),od.combineAll=void 0;od.combineAll=id.combineLatestAll;var wd={},Ed={},Pd=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Sd=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Td=(Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.combineLatest=void 0,a),jd=S,Cd=Cf,Id=Cc,Rd=st,kd=T;function Ad(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=kd.popResultSelector(r);return t?Rd.pipe(Ad.apply(void 0,Sd([],Pd(r))),Id.mapOneOrManyArgs(t)):jd.operate(function(e,t){Td.combineLatestInit(Sd([e],Pd(Cd.argsOrArgArray(r))))(t)})}Ed.combineLatest=Ad;var Md=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},xd=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Nd=(Object.defineProperty(wd,"__esModule",{value:!0}),wd.combineLatestWith=void 0,Ed);wd.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Nd.combineLatest.apply(void 0,xd([],Md(e)))};var Cc={},Ud=(Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.concatMap=void 0,dl),Dd=g;Cc.concatMap=function(e,t){return Dd.isFunction(t)?Ud.mergeMap(e,t,1):Ud.mergeMap(e,1)};var Ld={},Bd=(Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.concatMapTo=void 0,Cc),Fd=g;Ld.concatMapTo=function(e,t){return Fd.isFunction(t)?Bd.concatMap(function(){return e},t):Bd.concatMap(function(){return e})};var Wd={},zd={},qd=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Vd=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Hd=(Object.defineProperty(zd,"__esModule",{value:!0}),zd.concat=void 0,S),Yd=fl,Kd=T,Gd=Ra;zd.concat=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=Kd.popScheduler(r);return Hd.operate(function(e,t){Yd.concatAll()(Gd.from(Vd([e],qd(r)),n)).subscribe(t)})};var Zd=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Qd=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Xd=(Object.defineProperty(Wd,"__esModule",{value:!0}),Wd.concatWith=void 0,zd);Wd.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Xd.concat.apply(void 0,Qd([],Zd(e)))};var Jd={},$d={},eh=(Object.defineProperty($d,"__esModule",{value:!0}),$d.fromSubscribable=void 0,s);$d.fromSubscribable=function(t){return new eh.Observable(function(e){return t.subscribe(e)})},Object.defineProperty(Jd,"__esModule",{value:!0}),Jd.connect=void 0;var th=u,rh=C,nh=S,oh=$d,ih={connector:function(){return new th.Subject}};Jd.connect=function(n,e){var o=(e=void 0===e?ih:e).connector;return nh.operate(function(e,t){var r=o();rh.innerFrom(n(oh.fromSubscribable(r))).subscribe(t),t.add(e.subscribe(r))})};var $d={},uh=(Object.defineProperty($d,"__esModule",{value:!0}),$d.count=void 0,ad);$d.count=function(n){return uh.reduce(function(e,t,r){return!n||n(t,r)?e+1:e},0)};var ah={},sh=(Object.defineProperty(ah,"__esModule",{value:!0}),ah.debounce=void 0,S),ch=i,lh=O,fh=C;ah.debounce=function(u){return sh.operate(function(e,t){function r(){var e;null!=i&&i.unsubscribe(),i=null,n&&(n=!1,e=o,o=null,t.next(e))}var n=!1,o=null,i=null;e.subscribe(lh.createOperatorSubscriber(t,function(e){null!=i&&i.unsubscribe(),n=!0,o=e,i=lh.createOperatorSubscriber(t,r,ch.noop),fh.innerFrom(u(e)).subscribe(i)},function(){r(),t.complete()},void 0,function(){o=i=null}))})};var R={},ph=(Object.defineProperty(R,"__esModule",{value:!0}),R.debounceTime=void 0,gu),dh=S,hh=O;R.debounceTime=function(a,s){return void 0===s&&(s=ph.asyncScheduler),dh.operate(function(e,r){var n=null,t=null,o=null,i=function(){var e;n&&(n.unsubscribe(),e=t,t=n=null,r.next(e))};function u(){var e=o+a,t=s.now();if(t<e)return n=this.schedule(void 0,e-t),void r.add(n);i()}e.subscribe(hh.createOperatorSubscriber(r,function(e){t=e,o=s.now(),n||(n=s.schedule(u,a),r.add(n))},function(){i(),r.complete()},void 0,function(){t=n=null}))})};var bh={},yh=(Object.defineProperty(bh,"__esModule",{value:!0}),bh.defaultIfEmpty=void 0,S),_h=O;bh.defaultIfEmpty=function(n){return yh.operate(function(e,t){var r=!1;e.subscribe(_h.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){r||t.next(n),t.complete()}))})};var vh={},mh={},gh={},Oh=(Object.defineProperty(gh,"__esModule",{value:!0}),gh.take=void 0,j),wh=S,Eh=O;gh.take=function(n){return n<=0?function(){return Oh.EMPTY}:wh.operate(function(e,t){var r=0;e.subscribe(Eh.createOperatorSubscriber(t,function(e){++r<=n&&(t.next(e),n<=r&&t.complete())}))})};var Ph={},Sh=(Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.ignoreElements=void 0,S),Th=O,jh=i;Ph.ignoreElements=function(){return Sh.operate(function(e,t){e.subscribe(Th.createOperatorSubscriber(t,jh.noop))})};var Ch={},Ih=(Object.defineProperty(Ch,"__esModule",{value:!0}),Ch.mapTo=void 0,Ic);Ch.mapTo=function(e){return Ih.map(function(){return e})},Object.defineProperty(mh,"__esModule",{value:!0}),mh.delayWhen=void 0;var Rh=ll,kh=gh,Ah=Ph,Mh=Ch,xh=dl,Nh=C;mh.delayWhen=function t(r,n){return n?function(e){return Rh.concat(n.pipe(kh.take(1),Ah.ignoreElements()),e.pipe(t(r)))}:xh.mergeMap(function(e,t){return Nh.innerFrom(r(e,t)).pipe(kh.take(1),Mh.mapTo(e))})},Object.defineProperty(vh,"__esModule",{value:!0}),vh.delay=void 0;var Uh=gu,Dh=mh,Lh=df;vh.delay=function(e,t){var r=Lh.timer(e,t=void 0===t?Uh.asyncScheduler:t);return Dh.delayWhen(function(){return r})};var Bh={},Fh=(Object.defineProperty(Bh,"__esModule",{value:!0}),Bh.dematerialize=void 0,Ou),Wh=S,zh=O;Bh.dematerialize=function(){return Wh.operate(function(e,t){e.subscribe(zh.createOperatorSubscriber(t,function(e){return Fh.observeNotification(e,t)}))})};var qh={},Vh=(Object.defineProperty(qh,"__esModule",{value:!0}),qh.distinct=void 0,S),Hh=O,Yh=i,Kh=C;qh.distinct=function(o,t){return Vh.operate(function(e,r){var n=new Set;e.subscribe(Hh.createOperatorSubscriber(r,function(e){var t=o?o(e):e;n.has(t)||(n.add(t),r.next(e))})),t&&Kh.innerFrom(t).subscribe(Hh.createOperatorSubscriber(r,function(){return n.clear()},Yh.noop))})};var Gh={},Zh=(Object.defineProperty(Gh,"__esModule",{value:!0}),Gh.distinctUntilChanged=void 0,P),Qh=S,Xh=O;function Jh(e,t){return e===t}Gh.distinctUntilChanged=function(i,u){return void 0===u&&(u=Zh.identity),i=null!=i?i:Jh,Qh.operate(function(e,r){var n,o=!0;e.subscribe(Xh.createOperatorSubscriber(r,function(e){var t=u(e);!o&&i(n,t)||(o=!1,n=t,r.next(e))}))})};var $h={},eb=(Object.defineProperty($h,"__esModule",{value:!0}),$h.distinctUntilKeyChanged=void 0,Gh);$h.distinctUntilKeyChanged=function(r,n){return eb.distinctUntilChanged(function(e,t){return n?n(e[r],t[r]):e[r]===t[r]})};var tb={},rb={},nb=(Object.defineProperty(rb,"__esModule",{value:!0}),rb.throwIfEmpty=void 0,xa),ob=S,ib=O;function ub(){return new nb.EmptyError}rb.throwIfEmpty=function(n){return void 0===n&&(n=ub),ob.operate(function(e,t){var r=!1;e.subscribe(ib.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){return r?t.complete():t.error(n())}))})},Object.defineProperty(tb,"__esModule",{value:!0}),tb.elementAt=void 0;var ab=Wa,sb=Bf,cb=rb,lb=bh,fb=gh;tb.elementAt=function(r,t){if(r<0)throw new ab.ArgumentOutOfRangeError;var n=2<=arguments.length;return function(e){return e.pipe(sb.filter(function(e,t){return t===r}),fb.take(1),n?lb.defaultIfEmpty(t):cb.throwIfEmpty(function(){return new ab.ArgumentOutOfRangeError}))}};var pb={},db=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},hb=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},bb=(Object.defineProperty(pb,"__esModule",{value:!0}),pb.endWith=void 0,ll),yb=o;pb.endWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return bb.concat(e,yb.of.apply(void 0,hb([],db(t))))}};var _b={},vb=(Object.defineProperty(_b,"__esModule",{value:!0}),_b.every=void 0,S),mb=O;_b.every=function(o,i){return vb.operate(function(t,r){var n=0;t.subscribe(mb.createOperatorSubscriber(r,function(e){o.call(i,e,n++,t)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})};var gb={},Ob={},wb={},Eb=(Object.defineProperty(wb,"__esModule",{value:!0}),wb.exhaustMap=void 0,Ic),Pb=C,Sb=S,Tb=O;wb.exhaustMap=function t(i,o){return o?function(e){return e.pipe(t(function(r,n){return Pb.innerFrom(i(r,n)).pipe(Eb.map(function(e,t){return o(r,e,n,t)}))}))}:Sb.operate(function(e,t){var r=0,n=null,o=!1;e.subscribe(Tb.createOperatorSubscriber(t,function(e){n||(n=Tb.createOperatorSubscriber(t,void 0,function(){n=null,o&&t.complete()}),Pb.innerFrom(i(e,r++)).subscribe(n))},function(){o=!0,n||t.complete()}))})},Object.defineProperty(Ob,"__esModule",{value:!0}),Ob.exhaustAll=void 0;var jb=wb,Cb=P;Ob.exhaustAll=function(){return jb.exhaustMap(Cb.identity)},Object.defineProperty(gb,"__esModule",{value:!0}),gb.exhaust=void 0;gb.exhaust=Ob.exhaustAll;var Ib={},Rb=(Object.defineProperty(Ib,"__esModule",{value:!0}),Ib.expand=void 0,S),kb=hl;Ib.expand=function(r,n,o){return n=((n=void 0===n?1/0:n)||0)<1?1/0:n,Rb.operate(function(e,t){return kb.mergeInternals(e,t,r,n,void 0,!0,o)})};var k={},Ab=(Object.defineProperty(k,"__esModule",{value:!0}),k.finalize=void 0,S);k.finalize=function(r){return Ab.operate(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})};var Mb={},xb=(Object.defineProperty(Mb,"__esModule",{value:!0}),Mb.createFind=Mb.find=void 0,S),Nb=O;function Ub(i,u,e){var a="index"===e;return function(r,n){var o=0;r.subscribe(Nb.createOperatorSubscriber(n,function(e){var t=o++;i.call(u,e,t,r)&&(n.next(a?t:e),n.complete())},function(){n.next(a?-1:void 0),n.complete()}))}}Mb.find=function(e,t){return xb.operate(Ub(e,t,"value"))},Mb.createFind=Ub;var Db={},Lb=(Object.defineProperty(Db,"__esModule",{value:!0}),Db.findIndex=void 0,S),Bb=Mb;Db.findIndex=function(e,t){return Lb.operate(Bb.createFind(e,t,"index"))};var Fb={},Wb=(Object.defineProperty(Fb,"__esModule",{value:!0}),Fb.first=void 0,xa),zb=Bf,qb=gh,Vb=bh,Hb=rb,Yb=P;Fb.first=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?zb.filter(function(e,t){return n(e,t,r)}):Yb.identity,qb.take(1),t?Vb.defaultIfEmpty(e):Hb.throwIfEmpty(function(){return new Wb.EmptyError}))}};var Kb={},Gb=(Object.defineProperty(Kb,"__esModule",{value:!0}),Kb.groupBy=void 0,s),Zb=C,Qb=u,Xb=S,Jb=O;Kb.groupBy=function(b,t,y,_){return Xb.operate(function(e,s){function c(t){return r(function(e){return e.error(t)})}t&&"function"!=typeof t?(y=t.duration,l=t.element,_=t.connector):l=t;var l,f=new Map,r=function(e){f.forEach(e),e(s)},p=0,d=!1,h=new Jb.OperatorSubscriber(s,function(e){try{var t,r,n=b(e),o=f.get(n);o||(f.set(n,o=_?_():new Qb.Subject),i=n,u=o,(a=new Gb.Observable(function(e){p++;var t=u.subscribe(e);return function(){t.unsubscribe(),0==--p&&d&&h.unsubscribe()}})).key=i,t=a,s.next(t),y&&(r=Jb.createOperatorSubscriber(o,function(){o.complete(),null!=r&&r.unsubscribe()},void 0,void 0,function(){return f.delete(n)}),h.add(Zb.innerFrom(y(t)).subscribe(r)))),o.next(l?l(e):e)}catch(e){c(e)}var i,u,a},function(){return r(function(e){return e.complete()})},c,function(){return f.clear()},function(){return d=!0,0===p});e.subscribe(h)})};var $b={},ey=(Object.defineProperty($b,"__esModule",{value:!0}),$b.isEmpty=void 0,S),ty=O;$b.isEmpty=function(){return ey.operate(function(e,t){e.subscribe(ty.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})};var ry={},ny={},oy=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},iy=(Object.defineProperty(ny,"__esModule",{value:!0}),ny.takeLast=void 0,j),uy=S,ay=O;ny.takeLast=function(t){return t<=0?function(){return iy.EMPTY}:uy.operate(function(e,i){var u=[];e.subscribe(ay.createOperatorSubscriber(i,function(e){u.push(e),t<u.length&&u.shift()},function(){var t,e;try{for(var r=oy(u),n=r.next();!n.done;n=r.next()){var o=n.value;i.next(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}i.complete()},void 0,function(){u=null}))})},Object.defineProperty(ry,"__esModule",{value:!0}),ry.last=void 0;var sy=xa,cy=Bf,ly=ny,fy=rb,py=bh,dy=P;ry.last=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?cy.filter(function(e,t){return n(e,t,r)}):dy.identity,ly.takeLast(1),t?py.defaultIfEmpty(e):fy.throwIfEmpty(function(){return new sy.EmptyError}))}};var hy={},by=(Object.defineProperty(hy,"__esModule",{value:!0}),hy.materialize=void 0,Ou),yy=S,_y=O;hy.materialize=function(){return yy.operate(function(e,t){e.subscribe(_y.createOperatorSubscriber(t,function(e){t.next(by.Notification.createNext(e))},function(){t.next(by.Notification.createComplete()),t.complete()},function(e){t.next(by.Notification.createError(e)),t.complete()}))})};var vy={},my=(Object.defineProperty(vy,"__esModule",{value:!0}),vy.max=void 0,ad),gy=g;vy.max=function(r){return my.reduce(gy.isFunction(r)?function(e,t){return 0<r(e,t)?e:t}:function(e,t){return t<e?e:t})};var Oy={},wy=(Object.defineProperty(Oy,"__esModule",{value:!0}),Oy.flatMap=void 0,dl),wy=(Oy.flatMap=wy.mergeMap,{}),Ey=(Object.defineProperty(wy,"__esModule",{value:!0}),wy.mergeMapTo=void 0,dl),Py=g;wy.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),Py.isFunction(t)?Ey.mergeMap(function(){return e},t,r):Ey.mergeMap(function(){return e},r="number"==typeof t?t:r)};var Sy={},Ty=(Object.defineProperty(Sy,"__esModule",{value:!0}),Sy.mergeScan=void 0,S),jy=hl;Sy.mergeScan=function(n,o,i){return void 0===i&&(i=1/0),Ty.operate(function(e,t){var r=o;return jy.mergeInternals(e,t,function(e,t){return n(r,e,t)},i,function(e){r=e},!1,void 0,function(){return r=null})})};var hl={},Cy={},Iy=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Ry=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},ky=(Object.defineProperty(Cy,"__esModule",{value:!0}),Cy.merge=void 0,S),Ay=Cf,My=pl,xy=T,Ny=Ra;Cy.merge=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=xy.popScheduler(r),o=xy.popNumber(r,1/0),r=Ay.argsOrArgArray(r);return ky.operate(function(e,t){My.mergeAll(o)(Ny.from(Ry([e],Iy(r)),n)).subscribe(t)})};var Uy=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Dy=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Ly=(Object.defineProperty(hl,"__esModule",{value:!0}),hl.mergeWith=void 0,Cy);hl.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ly.merge.apply(void 0,Dy([],Uy(e)))};var By={},Fy=(Object.defineProperty(By,"__esModule",{value:!0}),By.min=void 0,ad),Wy=g;By.min=function(r){return Fy.reduce(Wy.isFunction(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e<t?e:t})};var zy={},qy=(Object.defineProperty(zy,"__esModule",{value:!0}),zy.multicast=void 0,w),Vy=g,Hy=Jd;zy.multicast=function(e,t){var r=Vy.isFunction(e)?e:function(){return e};return Vy.isFunction(t)?Hy.connect(t,{connector:r}):function(e){return new qy.ConnectableObservable(e,r)}};var Yy={},Ky=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Gy=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Zy=(Object.defineProperty(Yy,"__esModule",{value:!0}),Yy.onErrorResumeNext=Yy.onErrorResumeNextWith=void 0,Cf),Qy=jf;function Xy(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Zy.argsOrArgArray(e);return function(e){return Qy.onErrorResumeNext.apply(void 0,Gy([e],Ky(r)))}}Yy.onErrorResumeNextWith=Xy,Yy.onErrorResumeNext=Xy;var Jy={},$y=(Object.defineProperty(Jy,"__esModule",{value:!0}),Jy.pairwise=void 0,S),e_=O;Jy.pairwise=function(){return $y.operate(function(e,r){var n,o=!1;e.subscribe(e_.createOperatorSubscriber(r,function(e){var t=n;n=e,o&&r.next([t,e]),o=!0}))})};var t_={},r_=(Object.defineProperty(t_,"__esModule",{value:!0}),t_.pluck=void 0,Ic);t_.pluck=function(){for(var o=[],e=0;e<arguments.length;e++)o[e]=arguments[e];var i=o.length;if(0===i)throw new Error("list of properties cannot be empty.");return r_.map(function(e){for(var t=e,r=0;r<i;r++){var n=null==t?void 0:t[o[r]];if(void 0===n)return;t=n}return t})};var n_={},o_=(Object.defineProperty(n_,"__esModule",{value:!0}),n_.publish=void 0,u),i_=zy,u_=Jd;n_.publish=function(t){return t?function(e){return u_.connect(t)(e)}:function(e){return i_.multicast(new o_.Subject)(e)}};var a_={},s_=(Object.defineProperty(a_,"__esModule",{value:!0}),a_.publishBehavior=void 0,t),c_=w;a_.publishBehavior=function(r){return function(e){var t=new s_.BehaviorSubject(r);return new c_.ConnectableObservable(e,function(){return t})}};var l_={},f_=(Object.defineProperty(l_,"__esModule",{value:!0}),l_.publishLast=void 0,l),p_=w;l_.publishLast=function(){return function(e){var t=new f_.AsyncSubject;return new p_.ConnectableObservable(e,function(){return t})}};var d_={},h_=(Object.defineProperty(d_,"__esModule",{value:!0}),d_.publishReplay=void 0,b),b_=zy,y_=g;d_.publishReplay=function(t,r,e,n){e&&!y_.isFunction(e)&&(n=e);var o=y_.isFunction(e)?e:void 0;return function(e){return b_.multicast(new h_.ReplaySubject(t,r,n),o)(e)}};var __={},v_=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},m_=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},g_=(Object.defineProperty(__,"__esModule",{value:!0}),__.raceWith=void 0,Hf),O_=S,w_=P;__.raceWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length?O_.operate(function(e,t){g_.raceInit(m_([e],v_(r)))(t)}):w_.identity};var E_={},P_=(Object.defineProperty(E_,"__esModule",{value:!0}),E_.repeat=void 0,j),S_=S,T_=O,j_=C,C_=df;E_.repeat=function(e){var t,a,s=1/0;return null!=e&&("object"==typeof e?(t=e.count,s=void 0===t?1/0:t,a=e.delay):s=e),s<=0?function(){return P_.EMPTY}:S_.operate(function(t,r){function n(){var e=!1;o=t.subscribe(T_.createOperatorSubscriber(r,void 0,function(){++i<s?o?u():e=!0:r.complete()})),e&&u()}var o,i=0,u=function(){var e,t;null!=o&&o.unsubscribe(),(o=null)!=a?(e="number"==typeof a?C_.timer(a):j_.innerFrom(a(i)),t=T_.createOperatorSubscriber(r,function(){t.unsubscribe(),n()}),e.subscribe(t)):n()};n()})};var I_={},R_=(Object.defineProperty(I_,"__esModule",{value:!0}),I_.repeatWhen=void 0,C),k_=u,A_=S,M_=O;I_.repeatWhen=function(l){return A_.operate(function(e,t){var r,n,o=!1,i=!1,u=!1,a=function(){return u&&i&&(t.complete(),!0)},s=function(){return n||(n=new k_.Subject,R_.innerFrom(l(n)).subscribe(M_.createOperatorSubscriber(t,function(){r?c():o=!0},function(){i=!0,a()}))),n},c=function(){u=!1,r=e.subscribe(M_.createOperatorSubscriber(t,void 0,function(){u=!0,a()||s().next()})),o&&(r.unsubscribe(),r=null,o=!1,c())};c()})};var x_={},N_=(Object.defineProperty(x_,"__esModule",{value:!0}),x_.retry=void 0,S),U_=O,D_=P,L_=df,B_=C;x_.retry=function(e){var t=(e=(e=void 0===e?1/0:e)&&"object"==typeof e?e:{count:e}).count,c=void 0===t?1/0:t,l=e.delay,r=void 0!==(t=e.resetOnSuccess)&&t;return c<=0?D_.identity:N_.operate(function(e,i){var u,a=0,s=function(){var o=!1;u=e.subscribe(U_.createOperatorSubscriber(i,function(e){r&&(a=0),i.next(e)},void 0,function(e){var t,r,n;a++<c?(t=function(){u?(u.unsubscribe(),u=null,s()):o=!0},null!=l?(r="number"==typeof l?L_.timer(l):B_.innerFrom(l(e,a)),n=U_.createOperatorSubscriber(i,function(){n.unsubscribe(),t()},function(){i.complete()}),r.subscribe(n)):t()):i.error(e)})),o&&(u.unsubscribe(),u=null,s())};s()})};var F_={},W_=(Object.defineProperty(F_,"__esModule",{value:!0}),F_.retryWhen=void 0,C),z_=u,q_=S,V_=O;F_.retryWhen=function(u){return q_.operate(function(e,t){var r,n,o=!1,i=function(){r=e.subscribe(V_.createOperatorSubscriber(t,void 0,void 0,function(e){n||(n=new z_.Subject,W_.innerFrom(u(n)).subscribe(V_.createOperatorSubscriber(t,function(){return r?i():o=!0}))),n&&n.next(e)})),o&&(r.unsubscribe(),r=null,o=!1,i())};i()})};var H_={},Y_=(Object.defineProperty(H_,"__esModule",{value:!0}),H_.sample=void 0,C),K_=S,G_=i,Z_=O;H_.sample=function(o){return K_.operate(function(e,t){var r=!1,n=null;e.subscribe(Z_.createOperatorSubscriber(t,function(e){r=!0,n=e})),Y_.innerFrom(o).subscribe(Z_.createOperatorSubscriber(t,function(){var e;r&&(r=!1,e=n,n=null,t.next(e))},G_.noop))})};var Q_={},X_=(Object.defineProperty(Q_,"__esModule",{value:!0}),Q_.sampleTime=void 0,gu),J_=H_,$_=pf;Q_.sampleTime=function(e,t){return J_.sample($_.interval(e,t=void 0===t?X_.asyncScheduler:t))};var ev={},tv=(Object.defineProperty(ev,"__esModule",{value:!0}),ev.scan=void 0,S),rv=sd;ev.scan=function(e,t){return tv.operate(rv.scanInternals(e,t,2<=arguments.length,!0))};var sd={},nv=(Object.defineProperty(sd,"__esModule",{value:!0}),sd.sequenceEqual=void 0,S),ov=O,iv=C;function uv(){return{buffer:[],complete:!1}}sd.sequenceEqual=function(u,a){return void 0===a&&(a=function(e,t){return e===t}),nv.operate(function(e,t){function r(n,o){var r=ov.createOperatorSubscriber(t,function(e){var t=o.buffer,r=o.complete;0===t.length?r?i(!1):n.buffer.push(e):a(e,t.shift())||i(!1)},function(){n.complete=!0;var e=o.complete,t=o.buffer;e&&i(0===t.length),null!=r&&r.unsubscribe()});return r}var n=uv(),o=uv(),i=function(e){t.next(e),t.complete()};e.subscribe(r(n,o)),iv.innerFrom(u).subscribe(r(o,n))})};var av={},sv=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},cv=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},lv=(Object.defineProperty(av,"__esModule",{value:!0}),av.share=void 0,C),fv=u,pv=Mr,dv=S;function hv(e,t){for(var r,n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];if(!0===t)e();else if(!1!==t)return r=new pv.SafeSubscriber({next:function(){r.unsubscribe(),e()}}),lv.innerFrom(t.apply(void 0,cv([],sv(n)))).subscribe(r)}av.share=function(e){var t=(e=void 0===e?{}:e).connector,p=void 0===t?function(){return new fv.Subject}:t,d=void 0===(t=e.resetOnError)||t,h=void 0===(t=e.resetOnComplete)||t,b=void 0===(t=e.resetOnRefCountZero)||t;return function(e){function n(){var e=o;f(),null!=e&&e.unsubscribe()}var o,i,u,a=0,s=!1,c=!1,l=function(){null!=i&&i.unsubscribe(),i=void 0},f=function(){l(),o=u=void 0,s=c=!1};return dv.operate(function(e,t){a++,c||s||l();var r=u=null!=u?u:p();t.add(function(){0!==--a||c||s||(i=hv(n,b))}),r.subscribe(t),!o&&0<a&&(o=new pv.SafeSubscriber({next:function(e){return r.next(e)},error:function(e){c=!0,l(),i=hv(f,d,e),r.error(e)},complete:function(){s=!0,l(),i=hv(f,h),r.complete()}}),lv.innerFrom(e).subscribe(o))})(e)}};var bv={},yv=(Object.defineProperty(bv,"__esModule",{value:!0}),bv.shareReplay=void 0,b),_v=av;bv.shareReplay=function(e,t,r){var n,o,i=!1;return e&&"object"==typeof e?(n=e.bufferSize,o=void 0===n?1/0:n,n=e.windowTime,t=void 0===n?1/0:n,i=void 0!==(n=e.refCount)&&n,r=e.scheduler):o=null!=e?e:1/0,_v.share({connector:function(){return new yv.ReplaySubject(o,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})};var vv={},mv=(Object.defineProperty(vv,"__esModule",{value:!0}),vv.single=void 0,xa),gv=Cs,Ov=Ws,wv=S,Ev=O;vv.single=function(a){return wv.operate(function(t,r){var n,o=!1,i=!1,u=0;t.subscribe(Ev.createOperatorSubscriber(r,function(e){i=!0,a&&!a(e,u++,t)||(o&&r.error(new gv.SequenceError("Too many matching values")),o=!0,n=e)},function(){o?(r.next(n),r.complete()):r.error(i?new Ov.NotFoundError("No matching values"):new mv.EmptyError)}))})};var Pv={},Sv=(Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.skip=void 0,Bf);Pv.skip=function(r){return Sv.filter(function(e,t){return r<=t})};var Tv={},jv=(Object.defineProperty(Tv,"__esModule",{value:!0}),Tv.skipLast=void 0,P),Cv=S,Iv=O;Tv.skipLast=function(u){return u<=0?jv.identity:Cv.operate(function(e,n){var o=new Array(u),i=0;return e.subscribe(Iv.createOperatorSubscriber(n,function(e){var t,r=i++;r<u?o[r]=e:(t=o[r=r%u],o[r]=e,n.next(t))})),function(){o=null}})};var Rv={},kv=(Object.defineProperty(Rv,"__esModule",{value:!0}),Rv.skipUntil=void 0,S),Av=O,Mv=C,xv=i;Rv.skipUntil=function(o){return kv.operate(function(e,t){var r=!1,n=Av.createOperatorSubscriber(t,function(){null!=n&&n.unsubscribe(),r=!0},xv.noop);Mv.innerFrom(o).subscribe(n),e.subscribe(Av.createOperatorSubscriber(t,function(e){return r&&t.next(e)}))})};var Nv={},Uv=(Object.defineProperty(Nv,"__esModule",{value:!0}),Nv.skipWhile=void 0,S),Dv=O;Nv.skipWhile=function(o){return Uv.operate(function(e,t){var r=!1,n=0;e.subscribe(Dv.createOperatorSubscriber(t,function(e){return(r=r||!o(e,n++))&&t.next(e)}))})};var Lv={},Bv=(Object.defineProperty(Lv,"__esModule",{value:!0}),Lv.startWith=void 0,ll),Fv=T,Wv=S;Lv.startWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=Fv.popScheduler(r);return Wv.operate(function(e,t){(n?Bv.concat(r,e,n):Bv.concat(r,e)).subscribe(t)})};var zv={},qv={},Vv=(Object.defineProperty(qv,"__esModule",{value:!0}),qv.switchMap=void 0,C),Hv=S,Yv=O;qv.switchMap=function(s,c){return Hv.operate(function(e,o){function i(){t&&!u&&o.complete()}var u=null,a=0,t=!1;e.subscribe(Yv.createOperatorSubscriber(o,function(t){null!=u&&u.unsubscribe();var r=0,n=a++;Vv.innerFrom(s(t,n)).subscribe(u=Yv.createOperatorSubscriber(o,function(e){return o.next(c?c(t,e,n,r++):e)},function(){u=null,i()}))},function(){t=!0,i()}))})},Object.defineProperty(zv,"__esModule",{value:!0}),zv.switchAll=void 0;var Kv=qv,Gv=P;zv.switchAll=function(){return Kv.switchMap(Gv.identity)};var Zv={},Qv=(Object.defineProperty(Zv,"__esModule",{value:!0}),Zv.switchMapTo=void 0,qv),Xv=g;Zv.switchMapTo=function(e,t){return Xv.isFunction(t)?Qv.switchMap(function(){return e},t):Qv.switchMap(function(){return e})};var Jv={},$v=(Object.defineProperty(Jv,"__esModule",{value:!0}),Jv.switchScan=void 0,qv),em=S;Jv.switchScan=function(n,o){return em.operate(function(e,t){var r=o;return $v.switchMap(function(e,t){return n(r,e,t)},function(e,t){return r=t})(e).subscribe(t),function(){r=null}})};var tm={},rm=(Object.defineProperty(tm,"__esModule",{value:!0}),tm.takeUntil=void 0,S),nm=O,om=C,im=i;tm.takeUntil=function(r){return rm.operate(function(e,t){om.innerFrom(r).subscribe(nm.createOperatorSubscriber(t,function(){return t.complete()},im.noop)),t.closed||e.subscribe(t)})};var um={},am=(Object.defineProperty(um,"__esModule",{value:!0}),um.takeWhile=void 0,S),sm=O;um.takeWhile=function(o,i){return void 0===i&&(i=!1),am.operate(function(e,r){var n=0;e.subscribe(sm.createOperatorSubscriber(r,function(e){var t=o(e,n++);(t||i)&&r.next(e),t||r.complete()}))})};var cm={},lm=(Object.defineProperty(cm,"__esModule",{value:!0}),cm.tap=void 0,g),fm=S,pm=O,dm=P;cm.tap=function(e,t,r){var o=lm.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return o?fm.operate(function(e,r){null!=(t=o.subscribe)&&t.call(o);var t,n=!0;e.subscribe(pm.createOperatorSubscriber(r,function(e){var t;null!=(t=o.next)&&t.call(o,e),r.next(e)},function(){var e;n=!1,null!=(e=o.complete)&&e.call(o),r.complete()},function(e){var t;n=!1,null!=(t=o.error)&&t.call(o,e),r.error(e)},function(){var e;n&&null!=(e=o.unsubscribe)&&e.call(o),null!=(e=o.finalize)&&e.call(o)}))}):dm.identity};var hm,bm,ym,_m,g={},vm=(hm=g,Object.defineProperty(hm,"__esModule",{value:!0}),hm.throttle=hm.defaultThrottleConfig=void 0,bm=S,ym=O,_m=C,hm.defaultThrottleConfig={leading:!0,trailing:!1},hm.throttle=function(p,d){return void 0===d&&(d=hm.defaultThrottleConfig),bm.operate(function(e,t){function r(){var e;i&&(i=!1,e=u,u=null,t.next(e),s||f(e))}var n=d.leading,o=d.trailing,i=!1,u=null,a=null,s=!1,c=function(){null!=a&&a.unsubscribe(),a=null,o&&(r(),s&&t.complete())},l=function(){a=null,s&&t.complete()},f=function(e){return a=_m.innerFrom(p(e)).subscribe(ym.createOperatorSubscriber(t,c,l))};e.subscribe(ym.createOperatorSubscriber(t,function(e){i=!0,u=e,a&&!a.closed||(n?r():f(e))},function(){s=!0,o&&i&&a&&!a.closed||t.complete()}))})},{}),mm=(Object.defineProperty(vm,"__esModule",{value:!0}),vm.throttleTime=void 0,gu),gm=g,Om=df;vm.throttleTime=function(e,t,r){void 0===r&&(r=gm.defaultThrottleConfig);var n=Om.timer(e,t=void 0===t?mm.asyncScheduler:t);return gm.throttle(function(){return n},r)};var wm={},Em=(Object.defineProperty(wm,"__esModule",{value:!0}),wm.TimeInterval=wm.timeInterval=void 0,gu),Pm=S,Sm=O;wm.timeInterval=function(i){return void 0===i&&(i=Em.asyncScheduler),Pm.operate(function(e,n){var o=i.now();e.subscribe(Sm.createOperatorSubscriber(n,function(e){var t=i.now(),r=t-o;o=t,n.next(new Tm(e,r))}))})};var Tm=function(e,t){this.value=e,this.interval=t},jm=(wm.TimeInterval=Tm,{}),Cm=(Object.defineProperty(jm,"__esModule",{value:!0}),jm.timeoutWith=void 0,gu),Im=As,Rm=Ka;jm.timeoutWith=function(e,t,r){var n,o;if(r=null!=r?r:Cm.async,Im.isValidDate(e)?n=e:"number"==typeof e&&(o=e),!t)throw new TypeError("No observable provided to switch to");if(e=function(){return t},null==n&&null==o)throw new TypeError("No timeout provided.");return Rm.timeout({first:n,each:o,scheduler:r,with:e})};var As={},km=(Object.defineProperty(As,"__esModule",{value:!0}),As.timestamp=void 0,h),Am=Ic;As.timestamp=function(t){return void 0===t&&(t=km.dateTimestampProvider),Am.map(function(e){return{value:e,timestamp:t.now()}})};var h={},Mm=(Object.defineProperty(h,"__esModule",{value:!0}),h.window=void 0,u),xm=S,Nm=O,Um=i,Dm=C;h.window=function(o){return xm.operate(function(e,t){function r(e){n.error(e),t.error(e)}var n=new Mm.Subject;t.next(n.asObservable());return e.subscribe(Nm.createOperatorSubscriber(t,function(e){return null==n?void 0:n.next(e)},function(){n.complete(),t.complete()},r)),Dm.innerFrom(o).subscribe(Nm.createOperatorSubscriber(t,function(){n.complete(),t.next(n=new Mm.Subject)},Um.noop,r)),function(){null!=n&&n.unsubscribe(),n=null}})};var Lm={},Bm=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fm=(Object.defineProperty(Lm,"__esModule",{value:!0}),Lm.windowCount=void 0,u),Wm=S,zm=O;Lm.windowCount=function(s,e){var c=0<(e=void 0===e?0:e)?e:s;return Wm.operate(function(e,i){var u=[new Fm.Subject],a=0;i.next(u[0].asObservable()),e.subscribe(zm.createOperatorSubscriber(i,function(e){try{for(var t=Bm(u),r=t.next();!r.done;r=t.next())r.value.next(e)}catch(e){n={error:e}}finally{try{r&&!r.done&&(o=t.return)&&o.call(t)}finally{if(n)throw n.error}}var n,o=a-s+1;0<=o&&o%c==0&&u.shift().complete(),++a%c==0&&(n=new Fm.Subject,u.push(n),i.next(n.asObservable()))},function(){for(;0<u.length;)u.shift().complete();i.complete()},function(e){for(;0<u.length;)u.shift().error(e);i.error(e)},function(){u=null}))})};var qm={},Vm=(Object.defineProperty(qm,"__esModule",{value:!0}),qm.windowTime=void 0,u),Hm=gu,Ym=_,Km=S,Gm=O,Zm=y,Qm=T,Xm=ms;qm.windowTime=function(c){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var l=null!=(e=Qm.popScheduler(t))?e:Hm.asyncScheduler,f=null!=(e=t[0])?e:null,p=t[1]||1/0;return Km.operate(function(e,n){function r(t){s(function(e){e=e.window;return t(e)}),t(n),n.unsubscribe()}var o=[],i=!1,u=function(e){var t=e.window,r=e.subs;t.complete(),r.unsubscribe(),Zm.arrRemove(o,e),i&&a()},a=function(){var e,t,r;o&&(e=new Ym.Subscription,n.add(e),t=new Vm.Subject,o.push(r={window:t,subs:e,seen:0}),n.next(t.asObservable()),Xm.executeSchedule(e,l,function(){return u(r)},c))},s=(null!==f&&0<=f?Xm.executeSchedule(n,l,a,f,!0):i=!0,a(),function(e){return o.slice().forEach(e)});return e.subscribe(Gm.createOperatorSubscriber(n,function(t){s(function(e){e.window.next(t),p<=++e.seen&&u(e)})},function(){return r(function(e){return e.complete()})},function(t){return r(function(e){return e.error(t)})})),function(){o=null}})};var ms={},Jm=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$m=(Object.defineProperty(ms,"__esModule",{value:!0}),ms.windowToggle=void 0,u),e0=_,t0=S,r0=C,n0=O,o0=i,i0=y;ms.windowToggle=function(t,a){return t0.operate(function(e,o){function i(e){for(;0<u.length;)u.shift().error(e);o.error(e)}var u=[];r0.innerFrom(t).subscribe(n0.createOperatorSubscriber(o,function(e){var t,r=new $m.Subject,n=(u.push(r),new e0.Subscription);try{t=r0.innerFrom(a(e))}catch(e){return void i(e)}o.next(r.asObservable()),n.add(t.subscribe(n0.createOperatorSubscriber(o,function(){i0.arrRemove(u,r),r.complete(),n.unsubscribe()},o0.noop,i)))},o0.noop)),e.subscribe(n0.createOperatorSubscriber(o,function(e){var t,r,n=u.slice();try{for(var o=Jm(n),i=o.next();!i.done;i=o.next())i.value.next(e)}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},function(){for(;0<u.length;)u.shift().complete();o.complete()},i,function(){for(;0<u.length;)u.shift().unsubscribe()}))})};var y={},u0=(Object.defineProperty(y,"__esModule",{value:!0}),y.windowWhen=void 0,u),a0=S,s0=O,c0=C;y.windowWhen=function(u){return a0.operate(function(e,t){var r,n,o=function(e){r.error(e),t.error(e)},i=function(){var e;null!=n&&n.unsubscribe(),null!=r&&r.complete(),r=new u0.Subject,t.next(r.asObservable());try{e=c0.innerFrom(u())}catch(e){return void o(e)}e.subscribe(n=s0.createOperatorSubscriber(t,i,i,o))};i(),e.subscribe(s0.createOperatorSubscriber(t,function(e){return r.next(e)},function(){r.complete(),t.complete()},o,function(){null!=n&&n.unsubscribe(),r=null}))})};var l0={},f0=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},p0=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},d0=(Object.defineProperty(l0,"__esModule",{value:!0}),l0.withLatestFrom=void 0,S),h0=O,b0=C,y0=P,_0=i,v0=T;l0.withLatestFrom=function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var s=v0.popResultSelector(a);return d0.operate(function(e,r){for(var t=a.length,n=new Array(t),o=a.map(function(){return!1}),i=!1,u=0;u<t;u++)!function(t){b0.innerFrom(a[t]).subscribe(h0.createOperatorSubscriber(r,function(e){n[t]=e,i||o[t]||(o[t]=!0,(i=o.every(y0.identity))&&(o=null))},_0.noop))}(u);e.subscribe(h0.createOperatorSubscriber(r,function(e){i&&(e=p0([e],f0(n)),r.next(s?s.apply(void 0,p0([],f0(e))):e))}))})};var O={},m0=(Object.defineProperty(O,"__esModule",{value:!0}),O.zipAll=void 0,op),g0=I;O.zipAll=function(e){return g0.joinAllInternals(m0.zip,e)};var C={},T={},O0=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},w0=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},E0=(Object.defineProperty(T,"__esModule",{value:!0}),T.zip=void 0,op),P0=S;T.zip=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return P0.operate(function(e,t){E0.zip.apply(void 0,w0([e],O0(r))).subscribe(t)})};var S0,T0,j0,C0,I0,R0,k0,A0,M0,x0,N0,U0,D0,L0,B0,F0,W0,z0,q0,V0,H0,Y0,K0,G0,Z0,Q0,X0,J0,$0,eg,tg,rg,ng,og,ig,ug,ag,sg,cg,lg,fg,pg,dg,hg,bg,yg,_g,vg,mg,gg,Og,wg,Eg,Pg,Sg,Tg,jg,Cg,Ig,Rg,kg,Ag,Mg,xg,Ng,Ug,Dg,Lg,Bg,Fg,Wg,zg,qg,Vg,Hg,Yg,Kg,Gg,Zg,Qg,Xg,Jg,$g,eO,tO,rO,nO,oO,iO,uO,aO,sO,cO,lO,fO,pO,dO,hO,bO,yO,_O,vO,mO,gO,OO,wO,EO,PO,SO,TO,jO,CO,IO,RO,kO,AO,MO,xO,NO,UO,DO,LO,BO,FO,WO,zO,qO,VO,HO,YO,KO,GO,ZO,QO,XO,JO,$O,ew,tw,rw,nw,ow,iw,uw,aw,sw,cw,lw,fw,pw,dw,hw,bw,yw,_w,vw,mw,gw,Ow,ww,Ew,Pw,Sw,Tw,jw,Cw,Iw,Rw,kw=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Aw=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},Mw=(Object.defineProperty(C,"__esModule",{value:!0}),C.zipWith=void 0,T);C.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Mw.zip.apply(void 0,Aw([],kw(e)))},I=lr,S0=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),S=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||S0(t,e,r)},Object.defineProperty(I,"__esModule",{value:!0}),I.interval=I.iif=I.generate=I.fromEventPattern=I.fromEvent=I.from=I.forkJoin=I.empty=I.defer=I.connectable=I.concat=I.combineLatest=I.bindNodeCallback=I.bindCallback=I.UnsubscriptionError=I.TimeoutError=I.SequenceError=I.ObjectUnsubscribedError=I.NotFoundError=I.EmptyError=I.ArgumentOutOfRangeError=I.firstValueFrom=I.lastValueFrom=I.isObservable=I.identity=I.noop=I.pipe=I.NotificationKind=I.Notification=I.Subscriber=I.Subscription=I.Scheduler=I.VirtualAction=I.VirtualTimeScheduler=I.animationFrameScheduler=I.animationFrame=I.queueScheduler=I.queue=I.asyncScheduler=I.async=I.asapScheduler=I.asap=I.AsyncSubject=I.ReplaySubject=I.BehaviorSubject=I.Subject=I.animationFrames=I.observable=I.ConnectableObservable=I.Observable=void 0,I.filter=I.expand=I.exhaustMap=I.exhaustAll=I.exhaust=I.every=I.endWith=I.elementAt=I.distinctUntilKeyChanged=I.distinctUntilChanged=I.distinct=I.dematerialize=I.delayWhen=I.delay=I.defaultIfEmpty=I.debounceTime=I.debounce=I.count=I.connect=I.concatWith=I.concatMapTo=I.concatMap=I.concatAll=I.combineLatestWith=I.combineLatestAll=I.combineAll=I.catchError=I.bufferWhen=I.bufferToggle=I.bufferTime=I.bufferCount=I.buffer=I.auditTime=I.audit=I.config=I.NEVER=I.EMPTY=I.scheduled=I.zip=I.using=I.timer=I.throwError=I.range=I.race=I.partition=I.pairs=I.onErrorResumeNext=I.of=I.never=I.merge=void 0,I.switchMap=I.switchAll=I.subscribeOn=I.startWith=I.skipWhile=I.skipUntil=I.skipLast=I.skip=I.single=I.shareReplay=I.share=I.sequenceEqual=I.scan=I.sampleTime=I.sample=I.refCount=I.retryWhen=I.retry=I.repeatWhen=I.repeat=I.reduce=I.raceWith=I.publishReplay=I.publishLast=I.publishBehavior=I.publish=I.pluck=I.pairwise=I.onErrorResumeNextWith=I.observeOn=I.multicast=I.min=I.mergeWith=I.mergeScan=I.mergeMapTo=I.mergeMap=I.flatMap=I.mergeAll=I.max=I.materialize=I.mapTo=I.map=I.last=I.isEmpty=I.ignoreElements=I.groupBy=I.first=I.findIndex=I.find=I.finalize=void 0,I.zipWith=I.zipAll=I.withLatestFrom=I.windowWhen=I.windowToggle=I.windowTime=I.windowCount=I.window=I.toArray=I.timestamp=I.timeoutWith=I.timeout=I.timeInterval=I.throwIfEmpty=I.throttleTime=I.throttle=I.tap=I.takeWhile=I.takeUntil=I.takeLast=I.take=I.switchScan=I.switchMapTo=void 0,T0=s,Object.defineProperty(I,"Observable",{enumerable:!0,get:function(){return T0.Observable}}),j0=w,Object.defineProperty(I,"ConnectableObservable",{enumerable:!0,get:function(){return j0.ConnectableObservable}}),C0=jr,Object.defineProperty(I,"observable",{enumerable:!0,get:function(){return C0.observable}}),I0=n,Object.defineProperty(I,"animationFrames",{enumerable:!0,get:function(){return I0.animationFrames}}),R0=u,Object.defineProperty(I,"Subject",{enumerable:!0,get:function(){return R0.Subject}}),k0=t,Object.defineProperty(I,"BehaviorSubject",{enumerable:!0,get:function(){return k0.BehaviorSubject}}),A0=b,Object.defineProperty(I,"ReplaySubject",{enumerable:!0,get:function(){return A0.ReplaySubject}}),M0=l,Object.defineProperty(I,"AsyncSubject",{enumerable:!0,get:function(){return M0.AsyncSubject}}),x0=yu,Object.defineProperty(I,"asap",{enumerable:!0,get:function(){return x0.asap}}),Object.defineProperty(I,"asapScheduler",{enumerable:!0,get:function(){return x0.asapScheduler}}),N0=gu,Object.defineProperty(I,"async",{enumerable:!0,get:function(){return N0.async}}),Object.defineProperty(I,"asyncScheduler",{enumerable:!0,get:function(){return N0.asyncScheduler}}),U0=Yu,Object.defineProperty(I,"queue",{enumerable:!0,get:function(){return U0.queue}}),Object.defineProperty(I,"queueScheduler",{enumerable:!0,get:function(){return U0.queueScheduler}}),D0=ra,Object.defineProperty(I,"animationFrame",{enumerable:!0,get:function(){return D0.animationFrame}}),Object.defineProperty(I,"animationFrameScheduler",{enumerable:!0,get:function(){return D0.animationFrameScheduler}}),L0=ua,Object.defineProperty(I,"VirtualTimeScheduler",{enumerable:!0,get:function(){return L0.VirtualTimeScheduler}}),Object.defineProperty(I,"VirtualAction",{enumerable:!0,get:function(){return L0.VirtualAction}}),B0=Cu,Object.defineProperty(I,"Scheduler",{enumerable:!0,get:function(){return B0.Scheduler}}),F0=_,Object.defineProperty(I,"Subscription",{enumerable:!0,get:function(){return F0.Subscription}}),W0=Mr,Object.defineProperty(I,"Subscriber",{enumerable:!0,get:function(){return W0.Subscriber}}),z0=Ou,Object.defineProperty(I,"Notification",{enumerable:!0,get:function(){return z0.Notification}}),Object.defineProperty(I,"NotificationKind",{enumerable:!0,get:function(){return z0.NotificationKind}}),q0=st,Object.defineProperty(I,"pipe",{enumerable:!0,get:function(){return q0.pipe}}),V0=i,Object.defineProperty(I,"noop",{enumerable:!0,get:function(){return V0.noop}}),H0=P,Object.defineProperty(I,"identity",{enumerable:!0,get:function(){return H0.identity}}),Y0=qa,Object.defineProperty(I,"isObservable",{enumerable:!0,get:function(){return Y0.isObservable}}),K0=Ua,Object.defineProperty(I,"lastValueFrom",{enumerable:!0,get:function(){return K0.lastValueFrom}}),G0=Ba,Object.defineProperty(I,"firstValueFrom",{enumerable:!0,get:function(){return G0.firstValueFrom}}),Z0=Wa,Object.defineProperty(I,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return Z0.ArgumentOutOfRangeError}}),Q0=xa,Object.defineProperty(I,"EmptyError",{enumerable:!0,get:function(){return Q0.EmptyError}}),X0=Ws,Object.defineProperty(I,"NotFoundError",{enumerable:!0,get:function(){return X0.NotFoundError}}),J0=p,Object.defineProperty(I,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return J0.ObjectUnsubscribedError}}),$0=Cs,Object.defineProperty(I,"SequenceError",{enumerable:!0,get:function(){return $0.SequenceError}}),eg=Ka,Object.defineProperty(I,"TimeoutError",{enumerable:!0,get:function(){return eg.TimeoutError}}),tg=m,Object.defineProperty(I,"UnsubscriptionError",{enumerable:!0,get:function(){return tg.UnsubscriptionError}}),rg=za,Object.defineProperty(I,"bindCallback",{enumerable:!0,get:function(){return rg.bindCallback}}),ng=Hc,Object.defineProperty(I,"bindNodeCallback",{enumerable:!0,get:function(){return ng.bindNodeCallback}}),og=a,Object.defineProperty(I,"combineLatest",{enumerable:!0,get:function(){return og.combineLatest}}),ig=ll,Object.defineProperty(I,"concat",{enumerable:!0,get:function(){return ig.concat}}),ug=Il,Object.defineProperty(I,"connectable",{enumerable:!0,get:function(){return ug.connectable}}),ag=Rl,Object.defineProperty(I,"defer",{enumerable:!0,get:function(){return ag.defer}}),sg=j,Object.defineProperty(I,"empty",{enumerable:!0,get:function(){return sg.empty}}),cg=Dl,Object.defineProperty(I,"forkJoin",{enumerable:!0,get:function(){return cg.forkJoin}}),lg=Ra,Object.defineProperty(I,"from",{enumerable:!0,get:function(){return lg.from}}),fg=Kc,Object.defineProperty(I,"fromEvent",{enumerable:!0,get:function(){return fg.fromEvent}}),pg=Jc,Object.defineProperty(I,"fromEventPattern",{enumerable:!0,get:function(){return pg.fromEventPattern}}),dg=Ma,Object.defineProperty(I,"generate",{enumerable:!0,get:function(){return dg.generate}}),hg=xs,Object.defineProperty(I,"iif",{enumerable:!0,get:function(){return hg.iif}}),bg=pf,Object.defineProperty(I,"interval",{enumerable:!0,get:function(){return bg.interval}}),yg=Sa,Object.defineProperty(I,"merge",{enumerable:!0,get:function(){return yg.merge}}),_g=Tf,Object.defineProperty(I,"never",{enumerable:!0,get:function(){return _g.never}}),vg=o,Object.defineProperty(I,"of",{enumerable:!0,get:function(){return vg.of}}),mg=jf,Object.defineProperty(I,"onErrorResumeNext",{enumerable:!0,get:function(){return mg.onErrorResumeNext}}),gg=Nf,Object.defineProperty(I,"pairs",{enumerable:!0,get:function(){return gg.pairs}}),Og=Df,Object.defineProperty(I,"partition",{enumerable:!0,get:function(){return Og.partition}}),wg=Hf,Object.defineProperty(I,"race",{enumerable:!0,get:function(){return wg.race}}),Eg=Xf,Object.defineProperty(I,"range",{enumerable:!0,get:function(){return Eg.range}}),Pg=Aa,Object.defineProperty(I,"throwError",{enumerable:!0,get:function(){return Pg.throwError}}),Sg=df,Object.defineProperty(I,"timer",{enumerable:!0,get:function(){return Sg.timer}}),Tg=ep,Object.defineProperty(I,"using",{enumerable:!0,get:function(){return Tg.using}}),jg=op,Object.defineProperty(I,"zip",{enumerable:!0,get:function(){return jg.zip}}),Cg=ka,Object.defineProperty(I,"scheduled",{enumerable:!0,get:function(){return Cg.scheduled}}),Ig=j,Object.defineProperty(I,"EMPTY",{enumerable:!0,get:function(){return Ig.EMPTY}}),Rg=Tf,Object.defineProperty(I,"NEVER",{enumerable:!0,get:function(){return Rg.NEVER}}),S(dp,I),kg=yn,Object.defineProperty(I,"config",{enumerable:!0,get:function(){return kg.config}}),Ag=hp,Object.defineProperty(I,"audit",{enumerable:!0,get:function(){return Ag.audit}}),Mg=vp,Object.defineProperty(I,"auditTime",{enumerable:!0,get:function(){return Mg.auditTime}}),xg=wp,Object.defineProperty(I,"buffer",{enumerable:!0,get:function(){return xg.buffer}}),Ng=jp,Object.defineProperty(I,"bufferCount",{enumerable:!0,get:function(){return Ng.bufferCount}}),Ug=Ap,Object.defineProperty(I,"bufferTime",{enumerable:!0,get:function(){return Ug.bufferTime}}),Dg=Wp,Object.defineProperty(I,"bufferToggle",{enumerable:!0,get:function(){return Dg.bufferToggle}}),Lg=Zp,Object.defineProperty(I,"bufferWhen",{enumerable:!0,get:function(){return Lg.bufferWhen}}),Bg=ed,Object.defineProperty(I,"catchError",{enumerable:!0,get:function(){return Bg.catchError}}),Fg=od,Object.defineProperty(I,"combineAll",{enumerable:!0,get:function(){return Fg.combineAll}}),Wg=id,Object.defineProperty(I,"combineLatestAll",{enumerable:!0,get:function(){return Wg.combineLatestAll}}),zg=wd,Object.defineProperty(I,"combineLatestWith",{enumerable:!0,get:function(){return zg.combineLatestWith}}),qg=fl,Object.defineProperty(I,"concatAll",{enumerable:!0,get:function(){return qg.concatAll}}),Vg=Cc,Object.defineProperty(I,"concatMap",{enumerable:!0,get:function(){return Vg.concatMap}}),Hg=Ld,Object.defineProperty(I,"concatMapTo",{enumerable:!0,get:function(){return Hg.concatMapTo}}),Yg=Wd,Object.defineProperty(I,"concatWith",{enumerable:!0,get:function(){return Yg.concatWith}}),Kg=Jd,Object.defineProperty(I,"connect",{enumerable:!0,get:function(){return Kg.connect}}),Gg=$d,Object.defineProperty(I,"count",{enumerable:!0,get:function(){return Gg.count}}),Zg=ah,Object.defineProperty(I,"debounce",{enumerable:!0,get:function(){return Zg.debounce}}),Qg=R,Object.defineProperty(I,"debounceTime",{enumerable:!0,get:function(){return Qg.debounceTime}}),Xg=bh,Object.defineProperty(I,"defaultIfEmpty",{enumerable:!0,get:function(){return Xg.defaultIfEmpty}}),Jg=vh,Object.defineProperty(I,"delay",{enumerable:!0,get:function(){return Jg.delay}}),$g=mh,Object.defineProperty(I,"delayWhen",{enumerable:!0,get:function(){return $g.delayWhen}}),eO=Bh,Object.defineProperty(I,"dematerialize",{enumerable:!0,get:function(){return eO.dematerialize}}),tO=qh,Object.defineProperty(I,"distinct",{enumerable:!0,get:function(){return tO.distinct}}),rO=Gh,Object.defineProperty(I,"distinctUntilChanged",{enumerable:!0,get:function(){return rO.distinctUntilChanged}}),nO=$h,Object.defineProperty(I,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return nO.distinctUntilKeyChanged}}),oO=tb,Object.defineProperty(I,"elementAt",{enumerable:!0,get:function(){return oO.elementAt}}),iO=pb,Object.defineProperty(I,"endWith",{enumerable:!0,get:function(){return iO.endWith}}),uO=_b,Object.defineProperty(I,"every",{enumerable:!0,get:function(){return uO.every}}),aO=gb,Object.defineProperty(I,"exhaust",{enumerable:!0,get:function(){return aO.exhaust}}),sO=Ob,Object.defineProperty(I,"exhaustAll",{enumerable:!0,get:function(){return sO.exhaustAll}}),cO=wb,Object.defineProperty(I,"exhaustMap",{enumerable:!0,get:function(){return cO.exhaustMap}}),lO=Ib,Object.defineProperty(I,"expand",{enumerable:!0,get:function(){return lO.expand}}),fO=Bf,Object.defineProperty(I,"filter",{enumerable:!0,get:function(){return fO.filter}}),pO=k,Object.defineProperty(I,"finalize",{enumerable:!0,get:function(){return pO.finalize}}),dO=Mb,Object.defineProperty(I,"find",{enumerable:!0,get:function(){return dO.find}}),hO=Db,Object.defineProperty(I,"findIndex",{enumerable:!0,get:function(){return hO.findIndex}}),bO=Fb,Object.defineProperty(I,"first",{enumerable:!0,get:function(){return bO.first}}),yO=Kb,Object.defineProperty(I,"groupBy",{enumerable:!0,get:function(){return yO.groupBy}}),_O=Ph,Object.defineProperty(I,"ignoreElements",{enumerable:!0,get:function(){return _O.ignoreElements}}),vO=$b,Object.defineProperty(I,"isEmpty",{enumerable:!0,get:function(){return vO.isEmpty}}),mO=ry,Object.defineProperty(I,"last",{enumerable:!0,get:function(){return mO.last}}),gO=Ic,Object.defineProperty(I,"map",{enumerable:!0,get:function(){return gO.map}}),OO=Ch,Object.defineProperty(I,"mapTo",{enumerable:!0,get:function(){return OO.mapTo}}),wO=hy,Object.defineProperty(I,"materialize",{enumerable:!0,get:function(){return wO.materialize}}),EO=vy,Object.defineProperty(I,"max",{enumerable:!0,get:function(){return EO.max}}),PO=pl,Object.defineProperty(I,"mergeAll",{enumerable:!0,get:function(){return PO.mergeAll}}),SO=Oy,Object.defineProperty(I,"flatMap",{enumerable:!0,get:function(){return SO.flatMap}}),TO=dl,Object.defineProperty(I,"mergeMap",{enumerable:!0,get:function(){return TO.mergeMap}}),jO=wy,Object.defineProperty(I,"mergeMapTo",{enumerable:!0,get:function(){return jO.mergeMapTo}}),CO=Sy,Object.defineProperty(I,"mergeScan",{enumerable:!0,get:function(){return CO.mergeScan}}),IO=hl,Object.defineProperty(I,"mergeWith",{enumerable:!0,get:function(){return IO.mergeWith}}),RO=By,Object.defineProperty(I,"min",{enumerable:!0,get:function(){return RO.min}}),kO=zy,Object.defineProperty(I,"multicast",{enumerable:!0,get:function(){return kO.multicast}}),AO=v,Object.defineProperty(I,"observeOn",{enumerable:!0,get:function(){return AO.observeOn}}),MO=Yy,Object.defineProperty(I,"onErrorResumeNextWith",{enumerable:!0,get:function(){return MO.onErrorResumeNextWith}}),xO=Jy,Object.defineProperty(I,"pairwise",{enumerable:!0,get:function(){return xO.pairwise}}),NO=t_,Object.defineProperty(I,"pluck",{enumerable:!0,get:function(){return NO.pluck}}),UO=n_,Object.defineProperty(I,"publish",{enumerable:!0,get:function(){return UO.publish}}),DO=a_,Object.defineProperty(I,"publishBehavior",{enumerable:!0,get:function(){return DO.publishBehavior}}),LO=l_,Object.defineProperty(I,"publishLast",{enumerable:!0,get:function(){return LO.publishLast}}),BO=d_,Object.defineProperty(I,"publishReplay",{enumerable:!0,get:function(){return BO.publishReplay}}),FO=__,Object.defineProperty(I,"raceWith",{enumerable:!0,get:function(){return FO.raceWith}}),WO=ad,Object.defineProperty(I,"reduce",{enumerable:!0,get:function(){return WO.reduce}}),zO=E_,Object.defineProperty(I,"repeat",{enumerable:!0,get:function(){return zO.repeat}}),qO=I_,Object.defineProperty(I,"repeatWhen",{enumerable:!0,get:function(){return qO.repeatWhen}}),VO=x_,Object.defineProperty(I,"retry",{enumerable:!0,get:function(){return VO.retry}}),HO=F_,Object.defineProperty(I,"retryWhen",{enumerable:!0,get:function(){return HO.retryWhen}}),YO=E,Object.defineProperty(I,"refCount",{enumerable:!0,get:function(){return YO.refCount}}),KO=H_,Object.defineProperty(I,"sample",{enumerable:!0,get:function(){return KO.sample}}),GO=Q_,Object.defineProperty(I,"sampleTime",{enumerable:!0,get:function(){return GO.sampleTime}}),ZO=ev,Object.defineProperty(I,"scan",{enumerable:!0,get:function(){return ZO.scan}}),QO=sd,Object.defineProperty(I,"sequenceEqual",{enumerable:!0,get:function(){return QO.sequenceEqual}}),XO=av,Object.defineProperty(I,"share",{enumerable:!0,get:function(){return XO.share}}),JO=bv,Object.defineProperty(I,"shareReplay",{enumerable:!0,get:function(){return JO.shareReplay}}),$O=vv,Object.defineProperty(I,"single",{enumerable:!0,get:function(){return $O.single}}),ew=Pv,Object.defineProperty(I,"skip",{enumerable:!0,get:function(){return ew.skip}}),tw=Tv,Object.defineProperty(I,"skipLast",{enumerable:!0,get:function(){return tw.skipLast}}),rw=Rv,Object.defineProperty(I,"skipUntil",{enumerable:!0,get:function(){return rw.skipUntil}}),nw=Nv,Object.defineProperty(I,"skipWhile",{enumerable:!0,get:function(){return nw.skipWhile}}),ow=Lv,Object.defineProperty(I,"startWith",{enumerable:!0,get:function(){return ow.startWith}}),iw=Es,Object.defineProperty(I,"subscribeOn",{enumerable:!0,get:function(){return iw.subscribeOn}}),uw=zv,Object.defineProperty(I,"switchAll",{enumerable:!0,get:function(){return uw.switchAll}}),aw=qv,Object.defineProperty(I,"switchMap",{enumerable:!0,get:function(){return aw.switchMap}}),sw=Zv,Object.defineProperty(I,"switchMapTo",{enumerable:!0,get:function(){return sw.switchMapTo}}),cw=Jv,Object.defineProperty(I,"switchScan",{enumerable:!0,get:function(){return cw.switchScan}}),lw=gh,Object.defineProperty(I,"take",{enumerable:!0,get:function(){return lw.take}}),fw=ny,Object.defineProperty(I,"takeLast",{enumerable:!0,get:function(){return fw.takeLast}}),pw=tm,Object.defineProperty(I,"takeUntil",{enumerable:!0,get:function(){return pw.takeUntil}}),dw=um,Object.defineProperty(I,"takeWhile",{enumerable:!0,get:function(){return dw.takeWhile}}),hw=cm,Object.defineProperty(I,"tap",{enumerable:!0,get:function(){return hw.tap}}),bw=g,Object.defineProperty(I,"throttle",{enumerable:!0,get:function(){return bw.throttle}}),yw=vm,Object.defineProperty(I,"throttleTime",{enumerable:!0,get:function(){return yw.throttleTime}}),_w=rb,Object.defineProperty(I,"throwIfEmpty",{enumerable:!0,get:function(){return _w.throwIfEmpty}}),vw=wm,Object.defineProperty(I,"timeInterval",{enumerable:!0,get:function(){return vw.timeInterval}}),mw=Ka,Object.defineProperty(I,"timeout",{enumerable:!0,get:function(){return mw.timeout}}),gw=jm,Object.defineProperty(I,"timeoutWith",{enumerable:!0,get:function(){return gw.timeoutWith}}),Ow=As,Object.defineProperty(I,"timestamp",{enumerable:!0,get:function(){return Ow.timestamp}}),ww=ud,Object.defineProperty(I,"toArray",{enumerable:!0,get:function(){return ww.toArray}}),Ew=h,Object.defineProperty(I,"window",{enumerable:!0,get:function(){return Ew.window}}),Pw=Lm,Object.defineProperty(I,"windowCount",{enumerable:!0,get:function(){return Pw.windowCount}}),Sw=qm,Object.defineProperty(I,"windowTime",{enumerable:!0,get:function(){return Sw.windowTime}}),Tw=ms,Object.defineProperty(I,"windowToggle",{enumerable:!0,get:function(){return Tw.windowToggle}}),jw=y,Object.defineProperty(I,"windowWhen",{enumerable:!0,get:function(){return jw.windowWhen}}),Cw=l0,Object.defineProperty(I,"withLatestFrom",{enumerable:!0,get:function(){return Cw.withLatestFrom}}),Iw=O,Object.defineProperty(I,"zipAll",{enumerable:!0,get:function(){return Iw.zipAll}}),Rw=C,Object.defineProperty(I,"zipWith",{enumerable:!0,get:function(){return Rw.zipWith}});var s={},w={},xw=(Object.defineProperty(w,"__esModule",{value:!0}),w.partition=void 0,Lf),Nw=Bf;w.partition=function(t,r){return function(e){return[Nw.filter(t,r)(e),Nw.filter(xw.not(t,r))(e)]}};var Uw,Dw,Lw,Bw,Fw,Ww,zw,qw,Vw,Hw,Yw,Kw,Gw,Zw,Qw,Xw,Jw,$w,eE,tE,rE,nE,oE,iE,uE,aE,sE,cE,lE,fE,pE,dE,hE,bE,yE,_E,vE,mE,gE,OE,wE,EE,PE,SE,TE,jE,CE,IE,RE,kE,AE,ME,xE,NE,UE,DE,LE,BE,FE,WE,zE,qE,VE,HE,YE,KE,GE,ZE,QE,XE,JE,$E,eP,tP,rP,nP,oP,iP,uP,aP,sP,cP,lP,fP,pP,dP,hP,bP,yP,_P,vP,mP,gP,OP,wP,EP,PP,SP,TP,jP,CP,IP,RP,kP,AP,MP,xP,NP,UP,DP,LP,BP,FP,jr={},WP=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},zP=r&&r.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},qP=(Object.defineProperty(jr,"__esModule",{value:!0}),jr.race=void 0,Cf),VP=__;jr.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return VP.raceWith.apply(void 0,zP([],WP(qP.argsOrArgArray(e))))},n=s,Object.defineProperty(n,"__esModule",{value:!0}),n.mergeAll=n.merge=n.max=n.materialize=n.mapTo=n.map=n.last=n.isEmpty=n.ignoreElements=n.groupBy=n.first=n.findIndex=n.find=n.finalize=n.filter=n.expand=n.exhaustMap=n.exhaustAll=n.exhaust=n.every=n.endWith=n.elementAt=n.distinctUntilKeyChanged=n.distinctUntilChanged=n.distinct=n.dematerialize=n.delayWhen=n.delay=n.defaultIfEmpty=n.debounceTime=n.debounce=n.count=n.connect=n.concatWith=n.concatMapTo=n.concatMap=n.concatAll=n.concat=n.combineLatestWith=n.combineLatest=n.combineLatestAll=n.combineAll=n.catchError=n.bufferWhen=n.bufferToggle=n.bufferTime=n.bufferCount=n.buffer=n.auditTime=n.audit=void 0,n.timeInterval=n.throwIfEmpty=n.throttleTime=n.throttle=n.tap=n.takeWhile=n.takeUntil=n.takeLast=n.take=n.switchScan=n.switchMapTo=n.switchMap=n.switchAll=n.subscribeOn=n.startWith=n.skipWhile=n.skipUntil=n.skipLast=n.skip=n.single=n.shareReplay=n.share=n.sequenceEqual=n.scan=n.sampleTime=n.sample=n.refCount=n.retryWhen=n.retry=n.repeatWhen=n.repeat=n.reduce=n.raceWith=n.race=n.publishReplay=n.publishLast=n.publishBehavior=n.publish=n.pluck=n.partition=n.pairwise=n.onErrorResumeNext=n.observeOn=n.multicast=n.min=n.mergeWith=n.mergeScan=n.mergeMapTo=n.mergeMap=n.flatMap=void 0,n.zipWith=n.zipAll=n.zip=n.withLatestFrom=n.windowWhen=n.windowToggle=n.windowTime=n.windowCount=n.window=n.toArray=n.timestamp=n.timeoutWith=n.timeout=void 0,Uw=hp,Object.defineProperty(n,"audit",{enumerable:!0,get:function(){return Uw.audit}}),Dw=vp,Object.defineProperty(n,"auditTime",{enumerable:!0,get:function(){return Dw.auditTime}}),Lw=wp,Object.defineProperty(n,"buffer",{enumerable:!0,get:function(){return Lw.buffer}}),Bw=jp,Object.defineProperty(n,"bufferCount",{enumerable:!0,get:function(){return Bw.bufferCount}}),Fw=Ap,Object.defineProperty(n,"bufferTime",{enumerable:!0,get:function(){return Fw.bufferTime}}),Ww=Wp,Object.defineProperty(n,"bufferToggle",{enumerable:!0,get:function(){return Ww.bufferToggle}}),zw=Zp,Object.defineProperty(n,"bufferWhen",{enumerable:!0,get:function(){return zw.bufferWhen}}),qw=ed,Object.defineProperty(n,"catchError",{enumerable:!0,get:function(){return qw.catchError}}),Vw=od,Object.defineProperty(n,"combineAll",{enumerable:!0,get:function(){return Vw.combineAll}}),Hw=id,Object.defineProperty(n,"combineLatestAll",{enumerable:!0,get:function(){return Hw.combineLatestAll}}),Yw=Ed,Object.defineProperty(n,"combineLatest",{enumerable:!0,get:function(){return Yw.combineLatest}}),Kw=wd,Object.defineProperty(n,"combineLatestWith",{enumerable:!0,get:function(){return Kw.combineLatestWith}}),Gw=zd,Object.defineProperty(n,"concat",{enumerable:!0,get:function(){return Gw.concat}}),Zw=fl,Object.defineProperty(n,"concatAll",{enumerable:!0,get:function(){return Zw.concatAll}}),Qw=Cc,Object.defineProperty(n,"concatMap",{enumerable:!0,get:function(){return Qw.concatMap}}),Xw=Ld,Object.defineProperty(n,"concatMapTo",{enumerable:!0,get:function(){return Xw.concatMapTo}}),Jw=Wd,Object.defineProperty(n,"concatWith",{enumerable:!0,get:function(){return Jw.concatWith}}),$w=Jd,Object.defineProperty(n,"connect",{enumerable:!0,get:function(){return $w.connect}}),eE=$d,Object.defineProperty(n,"count",{enumerable:!0,get:function(){return eE.count}}),tE=ah,Object.defineProperty(n,"debounce",{enumerable:!0,get:function(){return tE.debounce}}),rE=R,Object.defineProperty(n,"debounceTime",{enumerable:!0,get:function(){return rE.debounceTime}}),nE=bh,Object.defineProperty(n,"defaultIfEmpty",{enumerable:!0,get:function(){return nE.defaultIfEmpty}}),oE=vh,Object.defineProperty(n,"delay",{enumerable:!0,get:function(){return oE.delay}}),iE=mh,Object.defineProperty(n,"delayWhen",{enumerable:!0,get:function(){return iE.delayWhen}}),uE=Bh,Object.defineProperty(n,"dematerialize",{enumerable:!0,get:function(){return uE.dematerialize}}),aE=qh,Object.defineProperty(n,"distinct",{enumerable:!0,get:function(){return aE.distinct}}),sE=Gh,Object.defineProperty(n,"distinctUntilChanged",{enumerable:!0,get:function(){return sE.distinctUntilChanged}}),cE=$h,Object.defineProperty(n,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return cE.distinctUntilKeyChanged}}),lE=tb,Object.defineProperty(n,"elementAt",{enumerable:!0,get:function(){return lE.elementAt}}),fE=pb,Object.defineProperty(n,"endWith",{enumerable:!0,get:function(){return fE.endWith}}),pE=_b,Object.defineProperty(n,"every",{enumerable:!0,get:function(){return pE.every}}),dE=gb,Object.defineProperty(n,"exhaust",{enumerable:!0,get:function(){return dE.exhaust}}),hE=Ob,Object.defineProperty(n,"exhaustAll",{enumerable:!0,get:function(){return hE.exhaustAll}}),bE=wb,Object.defineProperty(n,"exhaustMap",{enumerable:!0,get:function(){return bE.exhaustMap}}),yE=Ib,Object.defineProperty(n,"expand",{enumerable:!0,get:function(){return yE.expand}}),_E=Bf,Object.defineProperty(n,"filter",{enumerable:!0,get:function(){return _E.filter}}),vE=k,Object.defineProperty(n,"finalize",{enumerable:!0,get:function(){return vE.finalize}}),mE=Mb,Object.defineProperty(n,"find",{enumerable:!0,get:function(){return mE.find}}),gE=Db,Object.defineProperty(n,"findIndex",{enumerable:!0,get:function(){return gE.findIndex}}),OE=Fb,Object.defineProperty(n,"first",{enumerable:!0,get:function(){return OE.first}}),wE=Kb,Object.defineProperty(n,"groupBy",{enumerable:!0,get:function(){return wE.groupBy}}),EE=Ph,Object.defineProperty(n,"ignoreElements",{enumerable:!0,get:function(){return EE.ignoreElements}}),PE=$b,Object.defineProperty(n,"isEmpty",{enumerable:!0,get:function(){return PE.isEmpty}}),SE=ry,Object.defineProperty(n,"last",{enumerable:!0,get:function(){return SE.last}}),TE=Ic,Object.defineProperty(n,"map",{enumerable:!0,get:function(){return TE.map}}),jE=Ch,Object.defineProperty(n,"mapTo",{enumerable:!0,get:function(){return jE.mapTo}}),CE=hy,Object.defineProperty(n,"materialize",{enumerable:!0,get:function(){return CE.materialize}}),IE=vy,Object.defineProperty(n,"max",{enumerable:!0,get:function(){return IE.max}}),RE=Cy,Object.defineProperty(n,"merge",{enumerable:!0,get:function(){return RE.merge}}),kE=pl,Object.defineProperty(n,"mergeAll",{enumerable:!0,get:function(){return kE.mergeAll}}),AE=Oy,Object.defineProperty(n,"flatMap",{enumerable:!0,get:function(){return AE.flatMap}}),ME=dl,Object.defineProperty(n,"mergeMap",{enumerable:!0,get:function(){return ME.mergeMap}}),xE=wy,Object.defineProperty(n,"mergeMapTo",{enumerable:!0,get:function(){return xE.mergeMapTo}}),NE=Sy,Object.defineProperty(n,"mergeScan",{enumerable:!0,get:function(){return NE.mergeScan}}),UE=hl,Object.defineProperty(n,"mergeWith",{enumerable:!0,get:function(){return UE.mergeWith}}),DE=By,Object.defineProperty(n,"min",{enumerable:!0,get:function(){return DE.min}}),LE=zy,Object.defineProperty(n,"multicast",{enumerable:!0,get:function(){return LE.multicast}}),BE=v,Object.defineProperty(n,"observeOn",{enumerable:!0,get:function(){return BE.observeOn}}),FE=Yy,Object.defineProperty(n,"onErrorResumeNext",{enumerable:!0,get:function(){return FE.onErrorResumeNext}}),WE=Jy,Object.defineProperty(n,"pairwise",{enumerable:!0,get:function(){return WE.pairwise}}),zE=w,Object.defineProperty(n,"partition",{enumerable:!0,get:function(){return zE.partition}}),qE=t_,Object.defineProperty(n,"pluck",{enumerable:!0,get:function(){return qE.pluck}}),VE=n_,Object.defineProperty(n,"publish",{enumerable:!0,get:function(){return VE.publish}}),HE=a_,Object.defineProperty(n,"publishBehavior",{enumerable:!0,get:function(){return HE.publishBehavior}}),YE=l_,Object.defineProperty(n,"publishLast",{enumerable:!0,get:function(){return YE.publishLast}}),KE=d_,Object.defineProperty(n,"publishReplay",{enumerable:!0,get:function(){return KE.publishReplay}}),GE=jr,Object.defineProperty(n,"race",{enumerable:!0,get:function(){return GE.race}}),ZE=__,Object.defineProperty(n,"raceWith",{enumerable:!0,get:function(){return ZE.raceWith}}),QE=ad,Object.defineProperty(n,"reduce",{enumerable:!0,get:function(){return QE.reduce}}),XE=E_,Object.defineProperty(n,"repeat",{enumerable:!0,get:function(){return XE.repeat}}),JE=I_,Object.defineProperty(n,"repeatWhen",{enumerable:!0,get:function(){return JE.repeatWhen}}),$E=x_,Object.defineProperty(n,"retry",{enumerable:!0,get:function(){return $E.retry}}),eP=F_,Object.defineProperty(n,"retryWhen",{enumerable:!0,get:function(){return eP.retryWhen}}),tP=E,Object.defineProperty(n,"refCount",{enumerable:!0,get:function(){return tP.refCount}}),rP=H_,Object.defineProperty(n,"sample",{enumerable:!0,get:function(){return rP.sample}}),nP=Q_,Object.defineProperty(n,"sampleTime",{enumerable:!0,get:function(){return nP.sampleTime}}),oP=ev,Object.defineProperty(n,"scan",{enumerable:!0,get:function(){return oP.scan}}),iP=sd,Object.defineProperty(n,"sequenceEqual",{enumerable:!0,get:function(){return iP.sequenceEqual}}),uP=av,Object.defineProperty(n,"share",{enumerable:!0,get:function(){return uP.share}}),aP=bv,Object.defineProperty(n,"shareReplay",{enumerable:!0,get:function(){return aP.shareReplay}}),sP=vv,Object.defineProperty(n,"single",{enumerable:!0,get:function(){return sP.single}}),cP=Pv,Object.defineProperty(n,"skip",{enumerable:!0,get:function(){return cP.skip}}),lP=Tv,Object.defineProperty(n,"skipLast",{enumerable:!0,get:function(){return lP.skipLast}}),fP=Rv,Object.defineProperty(n,"skipUntil",{enumerable:!0,get:function(){return fP.skipUntil}}),pP=Nv,Object.defineProperty(n,"skipWhile",{enumerable:!0,get:function(){return pP.skipWhile}}),dP=Lv,Object.defineProperty(n,"startWith",{enumerable:!0,get:function(){return dP.startWith}}),hP=Es,Object.defineProperty(n,"subscribeOn",{enumerable:!0,get:function(){return hP.subscribeOn}}),bP=zv,Object.defineProperty(n,"switchAll",{enumerable:!0,get:function(){return bP.switchAll}}),yP=qv,Object.defineProperty(n,"switchMap",{enumerable:!0,get:function(){return yP.switchMap}}),_P=Zv,Object.defineProperty(n,"switchMapTo",{enumerable:!0,get:function(){return _P.switchMapTo}}),vP=Jv,Object.defineProperty(n,"switchScan",{enumerable:!0,get:function(){return vP.switchScan}}),mP=gh,Object.defineProperty(n,"take",{enumerable:!0,get:function(){return mP.take}}),gP=ny,Object.defineProperty(n,"takeLast",{enumerable:!0,get:function(){return gP.takeLast}}),OP=tm,Object.defineProperty(n,"takeUntil",{enumerable:!0,get:function(){return OP.takeUntil}}),wP=um,Object.defineProperty(n,"takeWhile",{enumerable:!0,get:function(){return wP.takeWhile}}),EP=cm,Object.defineProperty(n,"tap",{enumerable:!0,get:function(){return EP.tap}}),PP=g,Object.defineProperty(n,"throttle",{enumerable:!0,get:function(){return PP.throttle}}),SP=vm,Object.defineProperty(n,"throttleTime",{enumerable:!0,get:function(){return SP.throttleTime}}),TP=rb,Object.defineProperty(n,"throwIfEmpty",{enumerable:!0,get:function(){return TP.throwIfEmpty}}),jP=wm,Object.defineProperty(n,"timeInterval",{enumerable:!0,get:function(){return jP.timeInterval}}),CP=Ka,Object.defineProperty(n,"timeout",{enumerable:!0,get:function(){return CP.timeout}}),IP=jm,Object.defineProperty(n,"timeoutWith",{enumerable:!0,get:function(){return IP.timeoutWith}}),RP=As,Object.defineProperty(n,"timestamp",{enumerable:!0,get:function(){return RP.timestamp}}),kP=ud,Object.defineProperty(n,"toArray",{enumerable:!0,get:function(){return kP.toArray}}),AP=h,Object.defineProperty(n,"window",{enumerable:!0,get:function(){return AP.window}}),MP=Lm,Object.defineProperty(n,"windowCount",{enumerable:!0,get:function(){return MP.windowCount}}),xP=qm,Object.defineProperty(n,"windowTime",{enumerable:!0,get:function(){return xP.windowTime}}),NP=ms,Object.defineProperty(n,"windowToggle",{enumerable:!0,get:function(){return NP.windowToggle}}),UP=y,Object.defineProperty(n,"windowWhen",{enumerable:!0,get:function(){return UP.windowWhen}}),DP=l0,Object.defineProperty(n,"withLatestFrom",{enumerable:!0,get:function(){return DP.withLatestFrom}}),LP=T,Object.defineProperty(n,"zip",{enumerable:!0,get:function(){return LP.zip}}),BP=O,Object.defineProperty(n,"zipAll",{enumerable:!0,get:function(){return BP.zipAll}}),FP=C,Object.defineProperty(n,"zipWith",{enumerable:!0,get:function(){return FP.zipWith}});var u={},HP=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},YP=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},KP=(Object.defineProperty(u,"__esModule",{value:!0}),e),GP=lr,ZP=s,QP=0,XP=1,JP=2;function $P(e,t){e=e.pipe((0,ZP.publishReplay)(1),(0,ZP.refCount)());this._result=e,this._keys=e.pipe((0,ZP.mergeMap)(function(e){return(0,GP.from)(e.keys())}),(0,ZP.publishReplay)(1),(0,ZP.refCount)()),this._records=void 0,this._controls=new eS,this._summary=new GP.ReplaySubject,this._state=t||QP}$P.prototype.keys=function(){return this._keys},$P.prototype.records=function(){var r=this,e=this._result.pipe((0,ZP.mergeMap)(function(t){return new GP.Observable(function(e){return r._startStreaming({result:t,recordsObserver:e})})}));return e.push=function(){return r._push()},e},$P.prototype.consume=function(){var r=this;return this._result.pipe((0,ZP.mergeMap)(function(t){return new GP.Observable(function(e){return r._startStreaming({result:t,summaryObserver:e})})}))},$P.prototype.pause=function(){this._controls.pause()},$P.prototype.resume=function(){return this._controls.resume()},$P.prototype.push=function(){return this._controls.push()},$P.prototype._startStreaming=function(e){var e=void 0===e?{}:e,t=e.result,r=e.recordsObserver,r=void 0===r?null:r,e=e.summaryObserver,e=void 0===e?null:e,n=[];return e&&n.push(this._summary.subscribe(e)),this._state<XP?(this._state=XP,this._setupRecordsStream(t),r?n.push(this._records.subscribe(r)):t._cancel(),n.push({unsubscribe:function(){t._cancel&&t._cancel()}})):r&&r.error((0,KP.newError)("Streaming has already started/consumed with a previous records or summary subscription.")),function(){n.forEach(function(e){return e.unsubscribe()})}},$P.prototype._toObservable=function(){var n=this;return new GP.Observable(function(r){n._result.subscribe({complete:function(){return r.complete()},next:function(e){return r.next(new $P((t=e,new GP.Observable(function(e){e.next(t),e.complete()}))),n._state);var t},error:function(e){return r.error(e)}})})},$P.prototype._setupRecordsStream=function(n){var t=this;return this._records||(this._records=function(o,i,u){var e=this;void 0===u&&(u=new eS);var a=new GP.Subject,s=function(n){return HP(e,void 0,void 0,function(){var t,r;return YP(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),u.pushing=!0,[4,n];case 1:return t=e.sent(),r=t.done,t=t.value,r?(a.complete(),i.complete()):(a.next(t),u.paused||s(o.next()).catch(function(){})),[3,4];case 2:return r=e.sent(),a.error(r),i.error(r),[3,4];case 3:return u.pushing=!1,[7];case 4:return[2]}})})};function t(t){return HP(this,void 0,void 0,function(){return YP(this,function(e){switch(e.label){case 0:return[4,s(o.next(t))];case 1:return e.sent(),[2]}})})}return(u.pusher=t)(),a}(n[Symbol.asyncIterator](),{complete:function(){return HP(t,void 0,void 0,function(){var t,r;return YP(this,function(e){switch(e.label){case 0:return this._state=JP,r=(t=this._summary).next,[4,n.summary()];case 1:return r.apply(t,[e.sent()]),this._summary.complete(),[2]}})})},error:function(e){t._state=JP,t._summary.error(e)}},this._controls),this._records)},u.default=$P;tS.prototype.pause=function(){this._paused=!0},Object.defineProperty(tS.prototype,"paused",{get:function(){return this._paused},enumerable:!1,configurable:!0}),Object.defineProperty(tS.prototype,"pushing",{get:function(){return this._pushing},set:function(e){this._pushing=e},enumerable:!1,configurable:!0}),tS.prototype.resume=function(){return HP(this,void 0,void 0,function(){var t;return YP(this,function(e){switch(e.label){case 0:return t=this._paused,this._paused=!1,!t||this._pushing?[3,2]:[4,this._push()];case 1:e.sent(),e.label=2;case 2:return[2]}})})},tS.prototype.push=function(){return HP(this,void 0,void 0,function(){return YP(this,function(e){switch(e.label){case 0:return this.pause(),[4,this._push()];case 1:return[2,e.sent()]}})})},Object.defineProperty(tS.prototype,"pusher",{get:function(){return this._push},set:function(e){this._push=e},enumerable:!1,configurable:!0});var eS=tS;function tS(e){void 0===e&&(e=function(){return HP(t,void 0,void 0,function(){return YP(this,function(e){return[2]})})});var t=this;this._paused=!1,this._pushing=!1,this._push=e}var t={},b=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},rS=(Object.defineProperty(t,"__esModule",{value:!0}),lr),nS=b(u);function oS(e){this._txc=e}b(e),oS.prototype.run=function(e,r){var n=this;return new nS.default(new rS.Observable(function(t){try{t.next(n._txc.run(e,r)),t.complete()}catch(e){t.error(e)}return function(){}}))},oS.prototype.commit=function(){var e=this;return new rS.Observable(function(t){e._txc.commit().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},oS.prototype.rollback=function(){var e=this;return new rS.Observable(function(t){e._txc.rollback().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},oS.prototype.isOpen=function(){return this._txc.isOpen()},oS.prototype.close=function(){var e=this;return new rS.Observable(function(t){e._txc.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},t.default=oS;var l={},yu=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};function iS(e){e=e.run;this._run=e}Object.defineProperty(l,"__esModule",{value:!0}),yu(u),yu(t),iS.fromTransaction=function(e){return new iS({run:e.run.bind(e)})},iS.prototype.run=function(e,t){return this._run(e,t)},l.default=iS;var gu={},uS=(Object.defineProperty(gu,"__esModule",{value:!0}),e),aS=lr,sS=s,cS=(uS.internal.logger.Logger,uS.error.SERVICE_UNAVAILABLE);function lS(e){var e=void 0===e?{}:e,t=e.maxRetryTimeout,r=e.initialDelay,r=void 0===r?1e3:r,n=e.delayMultiplier,n=void 0===n?2:n,o=e.delayJitter,o=void 0===o?.2:o,e=e.logger,e=void 0===e?null:e;this._maxRetryTimeout=fS(void 0===t?3e4:t,3e4),this._initialDelay=fS(r,1e3),this._delayMultiplier=fS(n,2),this._delayJitter=fS(o,.2),this._logger=e}function fS(e,t){return e||0===e?e:t}lS.prototype.retry=function(e){var a=this;return e.pipe((0,sS.retryWhen)(function(e){var n=[],o=Date.now(),i=1,u=a._initialDelay;return e.pipe((0,sS.mergeMap)(function(e){if(!(0,uS.isRetriableError)(e))return(0,aS.throwError)(function(){return e});var t;if(n.push(e),2<=i&&Date.now()-o>=a._maxRetryTimeout)return(t=(0,uS.newError)("Failed after retried for ".concat(i," times in ").concat(a._maxRetryTimeout," ms. Make sure that your database is online and retry again."),cS)).seenErrors=n,(0,aS.throwError)(function(){return t});var r=a._computeNextDelay(u);return u*=a._delayMultiplier,i++,a._logger&&a._logger.warn("Transaction failed and will be retried in ".concat(r)),(0,aS.of)(1).pipe((0,sS.delay)(r))}))}))},lS.prototype._computeNextDelay=function(e){var t=e*this._delayJitter;return e-t+2*t*Math.random()},gu.default=lS;var Yu=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},pS=(Object.defineProperty(kr,"__esModule",{value:!0}),lr),dS=s,hS=Yu(u),ra=e,bS=Yu(t),yS=Yu(l),_S=Yu(gu),ua=ra.internal.constants,vS=ua.ACCESS_MODE_READ,mS=ua.ACCESS_MODE_WRITE,gS=ra.internal.txConfig.TxConfig;function OS(e){var e=void 0===e?{}:e,t=e.session,e=e.config;this._session=t,this._retryLogic=function(e){e=e&&e.maxTransactionRetryTime?e.maxTransactionRetryTime:null;return new _S.default({maxRetryTimeout:e})}(e)}OS.prototype.run=function(e,r,n){var o=this;return new hS.default(new pS.Observable(function(t){try{t.next(o._session.run(e,r,n)),t.complete()}catch(e){t.error(e)}return function(){}}))},OS.prototype.beginTransaction=function(e){return this._beginTransaction(this._session._mode,e)},OS.prototype.readTransaction=function(e,t){return this._runTransaction(vS,e,t)},OS.prototype.writeTransaction=function(e,t){return this._runTransaction(mS,e,t)},OS.prototype.executeRead=function(e,t){return this._executeInTransaction(vS,e,t)},OS.prototype.executeWrite=function(e,t){return this._executeInTransaction(mS,e,t)},OS.prototype._executeInTransaction=function(e,t,r){return this._runTransaction(e,t,r,function(e){return new yS.default({run:e.run.bind(e)})})},OS.prototype.close=function(){var e=this;return new pS.Observable(function(t){e._session.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},OS.prototype.lastBookmark=function(){return this.lastBookmarks()},OS.prototype.lastBookmarks=function(){return this._session.lastBookmarks()},OS.prototype._beginTransaction=function(e,t){var r=this,n=gS.empty();return t&&(n=new gS(t)),new pS.Observable(function(t){try{r._session._beginTransaction(e,n).then(function(e){t.next(new bS.default(e)),t.complete()}).catch(function(e){return t.error(e)})}catch(e){t.error(e)}return function(){}})},OS.prototype._runTransaction=function(e,r,t,n){void 0===n&&(n=function(e){return e});var o=gS.empty();return t&&(o=new gS(t)),this._retryLogic.retry(this._beginTransaction(e,o).pipe((0,dS.mergeMap)(function(t){return(0,pS.defer)(function(){try{return r(n(t))}catch(e){return(0,pS.throwError)(function(){return e})}}).pipe((0,dS.catchError)(function(e){return t.rollback().pipe((0,dS.concatWith)((0,pS.throwError)(function(){return e})))}),(0,dS.concatWith)(t.commit()))})))},kr.default=OS;var wS,ES,Cu=r&&r.__extends||(wS=function(e,t){return(wS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}wS(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Mr=(Object.defineProperty(F,"__esModule",{value:!0}),F.WRITE=F.READ=F.Driver=void 0,e),PS=_(kr),SS=Mr.internal.constants.FETCH_ALL,Ou=Mr.driver.READ,TS=Mr.driver.WRITE,st=(F.READ=Ou,F.WRITE=TS,Cu(jS,ES=Mr.Driver),jS.prototype.rxSession=function(e){var e=void 0===e?{}:e,t=e.defaultAccessMode,r=e.bookmarks,n=e.database,o=e.fetchSize,i=e.impersonatedUser,e=e.bookmarkManager;return new PS.default({session:this._newSession({defaultAccessMode:void 0===t?TS:t,bookmarkOrBookmarks:r,database:void 0===n?"":n,impersonatedUser:i,reactive:!1,fetchSize:function(e,t){e=parseInt(e,10);{if(0<e||e===SS)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(SS," for ALL. However fetchSize = ").concat(e));return t}}(o,this._config.fetchSize),bookmarkManager:e}),config:this._config})},jS);function jS(){return null!==ES&&ES.apply(this,arguments)||this}F.Driver=st,F.default=st;i={},Object.defineProperty(i,"__esModule",{value:!0}),i.default="5.5.0",P={},qa={},Ua={};function CS(){}Object.defineProperty(Ua,"__esModule",{value:!0}),CS.prototype.selectReader=function(e){throw new Error("Abstract function")},CS.prototype.selectWriter=function(e){throw new Error("Abstract function")},Ua.default=CS;Ba={},Wa={};function IS(e){this._offset=e||0}Object.defineProperty(Wa,"__esModule",{value:!0}),IS.prototype.next=function(e){if(0===e)return-1;var t=this._offset;return this._offset+=1,this._offset===Number.MAX_SAFE_INTEGER&&(this._offset=0),t%e},Wa.default=IS;var RS,kS,xa=r&&r.__extends||(RS=function(e,t){return(RS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}RS(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ws=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},AS=(Object.defineProperty(Ba,"__esModule",{value:!0}),Ws(Wa)),p=Ws(Ua),Cs=(kS=p.default,xa(MS,kS),MS.prototype.selectReader=function(e){return this._select(e,this._readersIndex)},MS.prototype.selectWriter=function(e){return this._select(e,this._writersIndex)},MS.prototype._select=function(e,t){var r=e.length;if(0===r)return null;var n=t.next(r),o=n,i=null,u=Number.MAX_SAFE_INTEGER;do{var a=e[o],s=this._connectionPool.activeResourceCount(a)}while(s<u&&(i=a,u=s),o===r-1?o=0:o++,o!==n);return i},MS);function MS(e){var t=kS.call(this)||this;return t._readersIndex=new AS.default,t._writersIndex=new AS.default,t._connectionPool=e,t}Ba.default=Cs;m=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(qa,"__esModule",{value:!0}),qa.LeastConnectedLoadBalancingStrategy=qa.LoadBalancingStrategy=void 0,za=m(Ua),qa.LoadBalancingStrategy=za.default,Hc=m(Ba),qa.LeastConnectedLoadBalancingStrategy=Hc.default,qa.default=Hc.default,a={},ll={},Il={},Rl={},Dl={},Ra={},Kc={},Jc={byteLength:function(e){var e=FS(e),t=e[0],e=e[1];return 3*(t+e)/4-e}};Jc.toByteArray=function(e){var t,r,n=FS(e),o=n[0],n=n[1],i=new US(function(e,t){return 3*(e+t)/4-t}(o,n)),u=0,a=0<n?o-4:o;for(r=0;r<a;r+=4)t=NS[e.charCodeAt(r)]<<18|NS[e.charCodeAt(r+1)]<<12|NS[e.charCodeAt(r+2)]<<6|NS[e.charCodeAt(r+3)],i[u++]=t>>16&255,i[u++]=t>>8&255,i[u++]=255&t;2===n&&(t=NS[e.charCodeAt(r)]<<2|NS[e.charCodeAt(r+1)]>>4,i[u++]=255&t);1===n&&(t=NS[e.charCodeAt(r)]<<10|NS[e.charCodeAt(r+1)]<<4|NS[e.charCodeAt(r+2)]>>2,i[u++]=t>>8&255,i[u++]=255&t);return i},Jc.fromByteArray=function(e){for(var t,r=e.length,n=r%3,o=[],i=0,u=r-n;i<u;i+=16383)o.push(function(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(function(e){return xS[e>>18&63]+xS[e>>12&63]+xS[e>>6&63]+xS[63&e]}(n));return o.join("")}(e,i,u<i+16383?u:i+16383));1==n?(t=e[r-1],o.push(xS[t>>2]+xS[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],o.push(xS[t>>10]+xS[t>>4&63]+xS[t<<2&63]+"="));return o.join("")};for(var xS=[],NS=[],US="undefined"!=typeof Uint8Array?Uint8Array:Array,DS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",LS=0,BS=DS.length;LS<BS;++LS)xS[LS]=DS[LS],NS[DS.charCodeAt(LS)]=LS;function FS(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}NS["-".charCodeAt(0)]=62,NS["_".charCodeAt(0)]=63;Ma={read:function(e,t,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,l=-7,f=r?o-1:0,p=r?-1:1,o=e[t+f];for(f+=p,i=o&(1<<-l)-1,o>>=-l,l+=a;0<l;i=256*i+e[t+f],f+=p,l-=8);for(u=i&(1<<-l)-1,i>>=-l,l+=n;0<l;u=256*u+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(o?-1:1);u+=Math.pow(2,n),i-=c}return(o?-1:1)*u*Math.pow(2,i-n)},write:function(e,t,r,n,o,i){var u,a,s=8*i-o-1,c=(1<<s)-1,l=c>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,i=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,u=c):(u=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-u))<1&&(u--,n*=2),2<=(t+=1<=u+l?f/n:f*Math.pow(2,1-l))*n&&(u++,n/=2),c<=u+l?(a=0,u=c):1<=u+l?(a=(t*n-1)*Math.pow(2,o),u+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),u=0));8<=o;e[r+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,s+=o;0<s;e[r+p]=255&u,p+=d,u/=256,s-=8);e[r+p-d]|=128*i}};{var WS=Kc;const t2=Jc,r2=Ma,n2=(xs="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,WS.Buffer=A,WS.SlowBuffer=function(e){+e!=e&&(e=0);return A.alloc(+e)},WS.INSPECT_MAX_BYTES=50,2147483647);function zS(e){if(e>n2)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return Object.setPrototypeOf(e,A.prototype),e}function A(e,t,r){if("number"!=typeof e)return qS(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return HS(e)}function qS(t,r,e){if("string"==typeof t){var n=t;var o=r;"string"==typeof o&&""!==o||(o="utf8");if(!A.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var i=0|ZS(n,o);let e=zS(i);n=e.write(n,o);n!==i&&(e=e.slice(0,n));return e}if(ArrayBuffer.isView(t))return v1(o=t,Uint8Array)?KS((i=new Uint8Array(o)).buffer,i.byteOffset,i.byteLength):YS(o);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(v1(t,ArrayBuffer)||t&&v1(t.buffer,ArrayBuffer))return KS(t,r,e);if("undefined"!=typeof SharedArrayBuffer&&(v1(t,SharedArrayBuffer)||t&&v1(t.buffer,SharedArrayBuffer)))return KS(t,r,e);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return A.from(n,r,e);var u=function(e){{var t,r;if(A.isBuffer(e))return t=0|GS(e.length),0===(r=zS(t)).length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||m1(e.length)?zS(0):YS(e);if("Buffer"===e.type&&Array.isArray(e.data))return YS(e.data)}(t);if(u)return u;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return A.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function VS(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function HS(e){return VS(e),zS(e<0?0:0|GS(e))}function YS(t){var r=t.length<0?0:0|GS(t.length);const n=zS(r);for(let e=0;e<r;e+=1)n[e]=255&t[e];return n}function KS(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,A.prototype),n}function GS(e){if(e>=n2)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n2.toString(16)+" bytes");return 0|e}function ZS(e,t){if(A.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||v1(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return b1(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return y1(e).length;default:if(o)return n?-1:b1(e).length;t=(""+t).toLowerCase(),o=!0}}function QS(e,r,n){let t=!1;if((r=void 0===r||r<0?0:r)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(r>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":{var o=this;var i=r;var u=n;var a=o.length;(!i||i<0)&&(i=0);(!u||u<0||a<u)&&(u=a);let t="";for(let e=i;e<u;++e)t+=a2[o[e]];return t;return}case"utf8":case"utf-8":return r1(this,r,n);case"ascii":{var s=this;a=r;var c=n;let t="";c=Math.min(s.length,c);for(let e=a;e<c;++e)t+=String.fromCharCode(127&s[e]);return t;return}case"latin1":case"binary":{var l=this;i=r;var f=n;let t="";f=Math.min(l.length,f);for(let e=i;e<f;++e)t+=String.fromCharCode(l[e]);return t;return}case"base64":return d=this,b=n,0===(h=r)&&b===d.length?t2.fromByteArray(d):t2.fromByteArray(d.slice(h,b));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":{d=this;h=r;b=n;var p=d.slice(h,b);let t="";for(let e=0;e<p.length-1;e+=2)t+=String.fromCharCode(p[e]+256*p[e+1]);return t;return}default:if(t)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),t=!0}var d,h,b}function XS(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function JS(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=m1(r=+r)?o?0:e.length-1:r)<0?e.length+r:r)>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=A.from(t,n)),A.isBuffer(t))return 0===t.length?-1:$S(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):$S(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function $S(r,n,t,e,o){let i=1,u=r.length,a=n.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(r.length<2||n.length<2)return-1;i=2,u/=2,a/=2,t/=2}function s(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}let c;if(o){let e=-1;for(c=t;c<u;c++)if(s(r,c)===s(n,-1===e?0:c-e)){if(-1===e&&(e=c),c-e+1===a)return e*i}else-1!==e&&(c-=c-e),e=-1}else for(t+a>u&&(t=u-a),c=t;0<=c;c--){let t=!0;for(let e=0;e<a;e++)if(s(r,c+e)!==s(n,e)){t=!1;break}if(t)return c}return-1}function e1(e,t,r,n){return _1(function(t){const r=[];for(let e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(t),e,r,n)}function t1(e,t,r,n){return _1(function(t,r){var n,o;const i=[];for(let e=0;e<t.length&&!((r-=2)<0);++e)o=t.charCodeAt(e),n=o>>8,o=o%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function r1(u,e,t){t=Math.min(u.length,t);const r=[];let a=e;for(;a<t;){var s=u[a];let o=null,i=239<s?4:223<s?3:191<s?2:1;if(a+i<=t){let e,t,r,n;switch(i){case 1:s<128&&(o=s);break;case 2:128==(192&(e=u[a+1]))&&127<(n=(31&s)<<6|63&e)&&(o=n);break;case 3:e=u[a+1],t=u[a+2],128==(192&e)&&128==(192&t)&&2047<(n=(15&s)<<12|(63&e)<<6|63&t)&&(n<55296||57343<n)&&(o=n);break;case 4:e=u[a+1],t=u[a+2],r=u[a+3],128==(192&e)&&128==(192&t)&&128==(192&r)&&65535<(n=(15&s)<<18|(63&e)<<12|(63&t)<<6|63&r)&&n<1114112&&(o=n)}}null===o?(o=65533,i=1):65535<o&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),a+=i}{var n=r,o=n.length;if(o<=o2)return String.fromCharCode.apply(String,n);let e="",t=0;for(;t<o;)e+=String.fromCharCode.apply(String,n.slice(t,t+=o2));return e}}WS.kMaxLength=n2,(A.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1);var e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.buffer}}),Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.byteOffset}}),A.poolSize=8192,A.from=qS,Object.setPrototypeOf(A.prototype,Uint8Array.prototype),Object.setPrototypeOf(A,Uint8Array),A.alloc=function(e,t,r){return t=t,r=r,VS(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?zS(e).fill(t,r):zS(e).fill(t):zS(e)},A.allocUnsafe=HS,A.allocUnsafeSlow=HS,A.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==A.prototype},A.compare=function(r,n){if(v1(r,Uint8Array)&&(r=A.from(r,r.offset,r.byteLength)),v1(n,Uint8Array)&&(n=A.from(n,n.offset,n.byteLength)),!A.isBuffer(r)||!A.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===n)return 0;let o=r.length,i=n.length;for(let e=0,t=Math.min(o,i);e<t;++e)if(r[e]!==n[e]){o=r[e],i=n[e];break}return o<i?-1:i<o?1:0},A.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return A.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=A.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(v1(e,Uint8Array))o+e.length>n.length?(e=A.isBuffer(e)?e:A.from(e)).copy(n,o):Uint8Array.prototype.set.call(n,e,o);else{if(!A.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},A.byteLength=ZS,A.prototype._isBuffer=!0,A.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)XS(this,e,e+1);return this},A.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)XS(this,e,e+3),XS(this,e+1,e+2);return this},A.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)XS(this,e,e+7),XS(this,e+1,e+6),XS(this,e+2,e+5),XS(this,e+3,e+4);return this},A.prototype.toLocaleString=A.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?r1(this,0,e):QS.apply(this,arguments)},A.prototype.equals=function(e){if(A.isBuffer(e))return this===e||0===A.compare(this,e);throw new TypeError("Argument must be a Buffer")},A.prototype.inspect=function(){let e="";var t=WS.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},xs&&(A.prototype[xs]=A.prototype.inspect),A.prototype.compare=function(e,t,r,n,o){if(v1(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(t=void 0===t?0:t)<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=t)return 0;if(o<=n)return-1;if(r<=t)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(t>>>=0);var a=Math.min(i,u),s=this.slice(n,o),c=e.slice(t,r);for(let e=0;e<a;++e)if(s[e]!==c[e]){i=s[e],u=c[e];break}return i<u?-1:u<i?1:0},A.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},A.prototype.indexOf=function(e,t,r){return JS(this,e,t,r,!0)},A.prototype.lastIndexOf=function(e,t,r){return JS(this,e,t,r,!1)},A.prototype.write=function(t,r,n,e){if(void 0===r)e="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)e=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(n)?(n>>>=0,void 0===e&&(e="utf8")):(e=n,n=void 0)}var o,i,u,a=this.length-r;if((void 0===n||a<n)&&(n=a),0<t.length&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");e=e||"utf8";let s=!1;for(;;)switch(e){case"hex":{var c=this;var l=t;var f=r;var p=n;f=Number(f)||0;var d=c.length-f;(!p||d<(p=Number(p)))&&(p=d),(d=l.length)/2<p&&(p=d/2);let e;for(e=0;e<p;++e){var h=parseInt(l.substr(2*e,2),16);if(m1(h))return e;c[f+e]=h}return e;return}case"utf8":case"utf-8":return d=r,u=n,_1(b1(t,(i=this).length-d),i,d,u);case"ascii":case"latin1":case"binary":return e1(this,t,r,n);case"base64":return i=this,u=r,o=n,_1(y1(t),i,u,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t1(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),s=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const o2=4096;function n1(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function o1(e,t,r,n,o,i){if(!A.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<t||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function i1(e,t,r,n,o){p1(t,n,o,e,r,7);n=Number(t&BigInt(4294967295)),e[r++]=n,e[r++]=n>>=8,e[r++]=n>>=8,e[r++]=n>>=8,o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,e[r++]=o>>=8,e[r++]=o>>=8,e[r++]=o>>=8,r}function u1(e,t,r,n,o){p1(t,n,o,e,r,7);n=Number(t&BigInt(4294967295)),e[r+7]=n,e[r+6]=n>>=8,e[r+5]=n>>=8,e[r+4]=n>>=8,o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,e[r+2]=o>>=8,e[r+1]=o>>=8,e[r]=o>>=8,r+8}function a1(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function s1(e,t,r,n,o){return t=+t,r>>>=0,o||a1(e,0,r,4),r2.write(e,t,r,n,23,4),r+4}function c1(e,t,r,n,o){return t=+t,r>>>=0,o||a1(e,0,r,8),r2.write(e,t,r,n,52,8),r+8}A.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return Object.setPrototypeOf(r,A.prototype),r},A.prototype.readUintLE=A.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||n1(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},A.prototype.readUintBE=A.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||n1(e,t,this.length);let n=this[e+--t],o=1;for(;0<t&&(o*=256);)n+=this[e+--t]*o;return n},A.prototype.readUint8=A.prototype.readUInt8=function(e,t){return e>>>=0,t||n1(e,1,this.length),this[e]},A.prototype.readUint16LE=A.prototype.readUInt16LE=function(e,t){return e>>>=0,t||n1(e,2,this.length),this[e]|this[e+1]<<8},A.prototype.readUint16BE=A.prototype.readUInt16BE=function(e,t){return e>>>=0,t||n1(e,2,this.length),this[e]<<8|this[e+1]},A.prototype.readUint32LE=A.prototype.readUInt32LE=function(e,t){return e>>>=0,t||n1(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},A.prototype.readUint32BE=A.prototype.readUInt32BE=function(e,t){return e>>>=0,t||n1(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},A.prototype.readBigUInt64LE=g1(function(e){d1(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||h1(e,this.length-8),t+256*this[++e]+65536*this[++e]+this[++e]*2**24),e=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(t)+(BigInt(e)<<BigInt(32))}),A.prototype.readBigUInt64BE=g1(function(e){d1(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||h1(e,this.length-8),t*2**24+65536*this[++e]+256*this[++e]+this[++e]),e=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(t)<<BigInt(32))+BigInt(e)}),A.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||n1(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},A.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||n1(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;0<n&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},A.prototype.readInt8=function(e,t){return e>>>=0,t||n1(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},A.prototype.readInt16LE=function(e,t){e>>>=0,t||n1(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},A.prototype.readInt16BE=function(e,t){e>>>=0,t||n1(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},A.prototype.readInt32LE=function(e,t){return e>>>=0,t||n1(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},A.prototype.readInt32BE=function(e,t){return e>>>=0,t||n1(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},A.prototype.readBigInt64LE=g1(function(e){d1(e>>>=0,"offset");var t=this[e],r=this[e+7],r=(void 0!==t&&void 0!==r||h1(e,this.length-8),this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24));return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),A.prototype.readBigInt64BE=g1(function(e){d1(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||h1(e,this.length-8),(t<<24)+65536*this[++e]+256*this[++e]+this[++e]);return(BigInt(t)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),A.prototype.readFloatLE=function(e,t){return e>>>=0,t||n1(e,4,this.length),r2.read(this,e,!0,23,4)},A.prototype.readFloatBE=function(e,t){return e>>>=0,t||n1(e,4,this.length),r2.read(this,e,!1,23,4)},A.prototype.readDoubleLE=function(e,t){return e>>>=0,t||n1(e,8,this.length),r2.read(this,e,!0,52,8)},A.prototype.readDoubleBE=function(e,t){return e>>>=0,t||n1(e,8,this.length),r2.read(this,e,!1,52,8)},A.prototype.writeUintLE=A.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||o1(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},A.prototype.writeUintBE=A.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||o1(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;0<=--o&&(i*=256);)this[t+o]=e/i&255;return t+r},A.prototype.writeUint8=A.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,1,255,0),this[t]=255&e,t+1},A.prototype.writeUint16LE=A.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeUint16BE=A.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeUint32LE=A.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},A.prototype.writeUint32BE=A.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeBigUInt64LE=g1(function(e,t=0){return i1(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),A.prototype.writeBigUInt64BE=g1(function(e,t=0){return u1(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),A.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||o1(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);let o=0,i=1,u=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===u&&0!==this[t+o-1]&&(u=1),this[t+o]=(e/i>>0)-u&255;return t+r},A.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||o1(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);let o=r-1,i=1,u=0;for(this[t+o]=255&e;0<=--o&&(i*=256);)e<0&&0===u&&0!==this[t+o+1]&&(u=1),this[t+o]=(e/i>>0)-u&255;return t+r},A.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},A.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},A.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||o1(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeBigInt64LE=g1(function(e,t=0){return i1(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),A.prototype.writeBigInt64BE=g1(function(e,t=0){return u1(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),A.prototype.writeFloatLE=function(e,t,r){return s1(this,e,t,!0,r)},A.prototype.writeFloatBE=function(e,t,r){return s1(this,e,t,!1,r)},A.prototype.writeDoubleLE=function(e,t,r){return c1(this,e,t,!0,r)},A.prototype.writeDoubleBE=function(e,t,r){return c1(this,e,t,!1,r)},A.prototype.copy=function(e,t,r,n){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var o=(n=e.length-t<n-r?e.length-t+r:n)-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},A.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!A.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o;1===e.length&&(o=e.charCodeAt(0),("utf8"===n&&o<128||"latin1"===n)&&(e=o))}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=void 0===r?this.length:r>>>0;let i;if("number"==typeof(e=e||0))for(i=t;i<r;++i)this[i]=e;else{var u=A.isBuffer(e)?e:A.from(e,n),a=u.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=u[i%a]}return this};const i2={};function l1(e,t,r){i2[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=this.name+` [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return this.name+` [${e}]: `+this.message}}}function f1(e){let t="",r=e.length;for(var n="-"===e[0]?1:0;r>=4+n;r-=3)t="_"+e.slice(r-3,r)+t;return""+e.slice(0,r)+t}function p1(t,r,n,e,o,i){if(n<t||t<r){var u="bigint"==typeof r?"n":"";let e;throw e=3<i?0===r||r===BigInt(0)?`>= 0${u} and < 2${u} ** `+8*(i+1)+u:`>= -(2${u} ** ${8*(i+1)-1}${u}) and < 2 ** `+(8*(i+1)-1)+u:`>= ${r}${u} and <= `+n+u,new i2.ERR_OUT_OF_RANGE("value",e,t)}r=e,n=i,d1(u=o,"offset"),void 0!==r[u]&&void 0!==r[u+n]||h1(u,r.length-(n+1))}function d1(e,t){if("number"!=typeof e)throw new i2.ERR_INVALID_ARG_TYPE(t,"number",e)}function h1(e,t,r){if(Math.floor(e)!==e)throw d1(e,r),new i2.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new i2.ERR_BUFFER_OUT_OF_BOUNDS;throw new i2.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= `+t,e)}l1("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"},RangeError),l1("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type `+typeof t},TypeError),l1("ERR_OUT_OF_RANGE",function(e,t,r){e=`The value of "${e}" is out of range.`;let n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=f1(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=f1(n)),n+="n"),e+=` It must be ${t}. Received `+n},RangeError);const u2=/[^+/0-9A-Za-z-_]/g;function b1(t,r){r=r||1/0;let n;var o=t.length;let i=null;const u=[];for(let e=0;e<o;++e){if(55295<(n=t.charCodeAt(e))&&n<57344){if(!i){if(56319<n){-1<(r-=3)&&u.push(239,191,189);continue}if(e+1===o){-1<(r-=3)&&u.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(r-=3)&&u.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(r-=3)&&u.push(239,191,189);if(i=null,n<128){if(--r<0)break;u.push(n)}else if(n<2048){if((r-=2)<0)break;u.push(n>>6|192,63&n|128)}else if(n<65536){if((r-=3)<0)break;u.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;u.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return u}function y1(e){return t2.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(u2,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function _1(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function v1(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function m1(e){return e!=e}const a2=function(){var r="0123456789abcdef";const n=new Array(256);for(let t=0;t<16;++t){var o=16*t;for(let e=0;e<16;++e)n[o+e]=r[t]+r[e]}return n}();function g1(e){return"undefined"==typeof BigInt?O1:e}function O1(){throw new Error("BigInt not supported")}}var w1,pf={},Sa={},o=r&&r.__extends||(w1=function(e,t){return(w1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}w1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),jf=(Object.defineProperty(Sa,"__esModule",{value:!0}),M.prototype.getUInt8=function(e){throw new Error("Not implemented")},M.prototype.getInt8=function(e){throw new Error("Not implemented")},M.prototype.getFloat64=function(e){throw new Error("Not implemented")},M.prototype.putUInt8=function(e,t){throw new Error("Not implemented")},M.prototype.putInt8=function(e,t){throw new Error("Not implemented")},M.prototype.putFloat64=function(e,t){throw new Error("Not implemented")},M.prototype.getInt16=function(e){return this.getInt8(e)<<8|this.getUInt8(e+1)},M.prototype.getUInt16=function(e){return this.getUInt8(e)<<8|this.getUInt8(e+1)},M.prototype.getInt32=function(e){return this.getInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},M.prototype.getUInt32=function(e){return this.getUInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},M.prototype.getInt64=function(e){return this.getInt8(e)<<56|this.getUInt8(e+1)<<48|this.getUInt8(e+2)<<40|this.getUInt8(e+3)<<32|this.getUInt8(e+4)<<24|this.getUInt8(e+5)<<16|this.getUInt8(e+6)<<8|this.getUInt8(e+7)},M.prototype.getSlice=function(e,t){return new P1(e,t,this)},M.prototype.putInt16=function(e,t){this.putInt8(e,t>>8),this.putUInt8(e+1,255&t)},M.prototype.putUInt16=function(e,t){this.putUInt8(e,t>>8&255),this.putUInt8(e+1,255&t)},M.prototype.putInt32=function(e,t){this.putInt8(e,t>>24),this.putUInt8(e+1,t>>16&255),this.putUInt8(e+2,t>>8&255),this.putUInt8(e+3,255&t)},M.prototype.putUInt32=function(e,t){this.putUInt8(e,t>>24&255),this.putUInt8(e+1,t>>16&255),this.putUInt8(e+2,t>>8&255),this.putUInt8(e+3,255&t)},M.prototype.putInt64=function(e,t){this.putInt8(e,t>>48),this.putUInt8(e+1,t>>42&255),this.putUInt8(e+2,t>>36&255),this.putUInt8(e+3,t>>30&255),this.putUInt8(e+4,t>>24&255),this.putUInt8(e+5,t>>16&255),this.putUInt8(e+6,t>>8&255),this.putUInt8(e+7,255&t)},M.prototype.putBytes=function(e,t){for(var r=0,n=t.remaining();r<n;r++)this.putUInt8(e+r,t.readUInt8())},M.prototype.readUInt8=function(){return this.getUInt8(this._updatePos(1))},M.prototype.readInt8=function(){return this.getInt8(this._updatePos(1))},M.prototype.readUInt16=function(){return this.getUInt16(this._updatePos(2))},M.prototype.readUInt32=function(){return this.getUInt32(this._updatePos(4))},M.prototype.readInt16=function(){return this.getInt16(this._updatePos(2))},M.prototype.readInt32=function(){return this.getInt32(this._updatePos(4))},M.prototype.readInt64=function(){return this.getInt32(this._updatePos(8))},M.prototype.readFloat64=function(){return this.getFloat64(this._updatePos(8))},M.prototype.writeUInt8=function(e){this.putUInt8(this._updatePos(1),e)},M.prototype.writeInt8=function(e){this.putInt8(this._updatePos(1),e)},M.prototype.writeInt16=function(e){this.putInt16(this._updatePos(2),e)},M.prototype.writeInt32=function(e){this.putInt32(this._updatePos(4),e)},M.prototype.writeUInt32=function(e){this.putUInt32(this._updatePos(4),e)},M.prototype.writeInt64=function(e){this.putInt64(this._updatePos(8),e)},M.prototype.writeFloat64=function(e){this.putFloat64(this._updatePos(8),e)},M.prototype.writeBytes=function(e){this.putBytes(this._updatePos(e.remaining()),e)},M.prototype.readSlice=function(e){return this.getSlice(this._updatePos(e),e)},M.prototype._updatePos=function(e){var t=this.position;return this.position+=e,t},M.prototype.remaining=function(){return this.length-this.position},M.prototype.hasRemaining=function(){return 0<this.remaining()},M.prototype.reset=function(){this.position=0},M.prototype.toString=function(){return this.constructor.name+"( position="+this.position+" )\n "+this.toHex()},M.prototype.toHex=function(){for(var e="",t=0;t<this.length;t++){var r=this.getUInt8(t).toString(16);e+=r=1===r.length?"0"+r:r,t!==this.length-1&&(e+=" ")}return e},M);function M(e){this.position=0,this.length=e}Sa.default=jf;o(S1,E1=jf),S1.prototype.putUInt8=function(e,t){this._inner.putUInt8(this._start+e,t)},S1.prototype.getUInt8=function(e){return this._inner.getUInt8(this._start+e)},S1.prototype.putInt8=function(e,t){this._inner.putInt8(this._start+e,t)},S1.prototype.putFloat64=function(e,t){this._inner.putFloat64(this._start+e,t)},S1.prototype.getInt8=function(e){return this._inner.getInt8(this._start+e)},S1.prototype.getFloat64=function(e){return this._inner.getFloat64(this._start+e)};var E1,P1=S1;function S1(e,t,r){t=E1.call(this,t)||this;return t._start=e,t._inner=r,t}var T1,j1,Nf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Df=(Object.defineProperty(pf,"__esModule",{value:!0}),pf.BaseBuffer=void 0,Nf(Sa)),Hf=(pf.BaseBuffer=Df.default,pf.default=Df.default,r&&r.__extends||(T1=function(e,t){return(T1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}T1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Xf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},C1=(Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.alloc=void 0,Xf(Kc)),Aa=Xf(pf),I1=(j1=Aa.default,Hf(R1,j1),R1.prototype.getUInt8=function(e){return this._buffer.readUInt8(e)},R1.prototype.getInt8=function(e){return this._buffer.readInt8(e)},R1.prototype.getFloat64=function(e){return this._buffer.readDoubleBE(e)},R1.prototype.putUInt8=function(e,t){this._buffer.writeUInt8(t,e)},R1.prototype.putInt8=function(e,t){this._buffer.writeInt8(t,e)},R1.prototype.putFloat64=function(e,t){this._buffer.writeDoubleBE(t,e)},R1.prototype.putBytes=function(e,t){var r;t instanceof R1?(r=Math.min(t.length-t.position,this.length-e),t._buffer.copy(this._buffer,e,t.position,t.position+r),t.position+=r):j1.prototype.putBytes.call(this,e,t)},R1.prototype.getSlice=function(e,t){return new R1(this._buffer.slice(e,e+t))},R1);function R1(e){var t=this,e=(e=e)instanceof C1.default.Buffer?e:"number"==typeof e&&"function"==typeof C1.default.Buffer.alloc?C1.default.Buffer.alloc(e):new C1.default.Buffer(e);return(t=j1.call(this,e.length)||this)._buffer=e,t}Ra.default=I1,Ra.alloc=function(e){return new I1(e)};var df=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},k1=(Object.defineProperty(Dl,"__esModule",{value:!0}),df(Ra)),A1=e,ep=A1.internal.util,M1=ep.ENCRYPTION_OFF,x1=ep.ENCRYPTION_ON;function N1(e,t,r){void 0===t&&(t=U1),void 0===r&&(r=function(e){return new WebSocket(e)});var n,o=this,t=(this._open=!0,this._pending=[],this._error=null,this._handleConnectionError=this._handleConnectionError.bind(this),this._config=e,this._receiveTimeout=null,this._receiveTimeoutStarted=!1,this._receiveTimeoutId=null,function(e,t){var r=function(e){return!0===e.encrypted||e.encrypted===x1}(e),n=function(e){return!1===e.encrypted||e.encrypted===M1}(e),e=e.trust,t=function(e){e="function"==typeof e?e():"";return e&&0<=e.toLowerCase().indexOf("https")}(t);if(function(e,t,r){null!==r&&(e&&!r?console.warn("Neo4j driver is configured to use secure WebSocket on a HTTP web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to not use encryption."):t&&r&&console.warn("Neo4j driver is configured to use insecure WebSocket on a HTTPS web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to use encryption."))}(r,n,t),n)return{scheme:"ws",error:null};if(t)return{scheme:"wss",error:null};if(r)return e&&"TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"!==e?{scheme:null,error:(0,A1.newError)("The browser version of this driver only supports one trust strategy, 'TRUST_SYSTEM_CA_SIGNED_CERTIFICATES'. "+e+' is not supported. Please either use TRUST_SYSTEM_CA_SIGNED_CERTIFICATES or disable encryption by setting `encrypted:"'+M1+'"` in the driver configuration.')}:{scheme:"wss",error:null};return{scheme:"ws",error:null}}(e,t)),i=t.scheme,t=t.error;t?this._error=t:(this._ws=function(t,r,n){var o=t+"://"+r.asHostPort();try{return n(o)}catch(e){if(function(e,t){return"SyntaxError"===e.name&&function(e){return"["===e.charAt(0)&&-1!==e.indexOf("]")}(t.asHostPort())}(e,r))return o=function(e,t){var r=t.host().replace(/:/g,"-").replace("%","s")+".ipv6-literal.net";return"".concat(e,"://").concat(r,":").concat(t.port())}(t,r),n(o);throw e}}(i,e.address,r),this._ws.binaryType="arraybuffer",(n=this)._ws.onclose=function(e){e&&!e.wasClean&&n._handleConnectionError(),n._open=!1},this._ws.onopen=function(){n._clearConnectionTimeout();var e=n._pending;n._pending=null;for(var t=0;t<e.length;t++)n.write(e[t])},this._ws.onmessage=function(e){o._resetTimeout(),n.onmessage&&(e=new k1.default(e.data),n.onmessage(e))},this._ws.onerror=this._handleConnectionError,this._connectionTimeoutFired=!1,this._connectionTimeoutId=this._setupConnectionTimeout())}function U1(){return"undefined"!=typeof window&&window.location?window.location.protocol:null}N1.prototype._handleConnectionError=function(){if(this._connectionTimeoutFired)return this._error=(0,A1.newError)("Failed to establish connection in ".concat(this._config.connectionTimeout,"ms"),this._config.connectionErrorCode),void(this.onerror&&this.onerror(this._error));this._open&&!this._timedout&&(this._error=(0,A1.newError)("WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket `readyState` is: "+this._ws.readyState,this._config.connectionErrorCode),this.onerror&&this.onerror(this._error))},N1.prototype.write=function(e){if(null!==this._pending)this._pending.push(e);else{if(!(e instanceof k1.default))throw(0,A1.newError)("Don't know how to send buffer: "+e);try{this._ws.send(e._buffer)}catch(e){if(1===this._ws.readyState)throw e;this._handleConnectionError()}}},N1.prototype.close=function(){var r=this;return new Promise(function(e,t){r._ws&&3!==r._ws.readyState?(r._open=!1,r.stopReceiveTimeout(),r._clearConnectionTimeout(),r._ws.onclose=function(){return e()},r._ws.close()):e()})},N1.prototype.setupReceiveTimeout=function(e){this._receiveTimeout=e},N1.prototype.stopReceiveTimeout=function(){null!==this._receiveTimeout&&this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!1,null!=this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=null)},N1.prototype.startReceiveTimeout=function(){this._open&&null!==this._receiveTimeout&&!this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!0,this._resetTimeout())},N1.prototype._resetTimeout=function(){var e=this;this._receiveTimeoutStarted&&(null!==this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=setTimeout(function(){e._receiveTimeoutId=null,e._timedout=!0,e.stopReceiveTimeout(),e._error=(0,A1.newError)("Connection lost. Server didn't respond in ".concat(e._receiveTimeout,"ms"),e._config.connectionErrorCode),e.close(),e.onerror&&e.onerror(e._error)},this._receiveTimeout))},N1.prototype._setupConnectionTimeout=function(){var e,t=this,r=this._config.connectionTimeout;return r?(e=this._ws,setTimeout(function(){1!==e.readyState&&(t._connectionTimeoutFired=!0,e.close())},r)):null},N1.prototype._clearConnectionTimeout=function(){var e=this._connectionTimeoutId;!e&&0!==e||(this._connectionTimeoutFired=!1,this._connectionTimeoutId=null,clearTimeout(e))},Dl.default=N1;var D1,op={},ka=r&&r.__extends||(D1=function(e,t){return(D1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}D1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(op,"__esModule",{value:!0});var L1,j=e.internal.resolver.BaseHostNameResolver,Tf=(ka(B1,L1=j),B1.prototype.resolve=function(e){return this._resolveToItself(e)},B1);function B1(){return null!==L1&&L1.apply(this,arguments)||this}op.default=Tf;var F1,S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},dp=(Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.HostNameResolver=Rl.Channel=void 0,S(Dl)),yn=S(op),I=(Rl.Channel=dp.default,Rl.HostNameResolver=yn.default,{}),Lf={},Cf=r&&r.__extends||(F1=function(e,t){return(F1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}F1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Lf,"__esModule",{value:!0});var W1,z1=Ra,hp=(W1=pf.BaseBuffer,Cf(q1,W1),q1.prototype.getUInt8=function(e){for(var t=0;t<this._buffers.length;t++){var r=this._buffers[t];if(!(e>=r.length))return r.getUInt8(e);e-=r.length}},q1.prototype.getInt8=function(e){for(var t=0;t<this._buffers.length;t++){var r=this._buffers[t];if(!(e>=r.length))return r.getInt8(e);e-=r.length}},q1.prototype.getFloat64=function(e){for(var t=(0,z1.alloc)(8),r=0;r<8;r++)t.putUInt8(r,this.getUInt8(e+r));return t.getFloat64(0)},q1);function q1(e){for(var t=this,r=0,n=0;n<e.length;n++)r+=e[n].length;return(t=W1.call(this,r)||this)._buffers=e,t}Lf.default=hp;var V1,H1,vp=r&&r.__extends||(V1=function(e,t){return(V1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}V1(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),wp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},jp=(Object.defineProperty(I,"__esModule",{value:!0}),I.Dechunker=I.Chunker=void 0,wp(Sa)),Y1=Ra,K1=wp(Lf),Ap=(H1=jp.default,vp(G1,H1),G1.prototype.putUInt8=function(e,t){this._ensure(1),this._buffer.writeUInt8(t)},G1.prototype.putInt8=function(e,t){this._ensure(1),this._buffer.writeInt8(t)},G1.prototype.putFloat64=function(e,t){this._ensure(8),this._buffer.writeFloat64(t)},G1.prototype.putBytes=function(e,t){for(;0<t.remaining();)this._ensure(1),this._buffer.remaining()>t.remaining()?this._buffer.writeBytes(t):this._buffer.writeBytes(t.readSlice(this._buffer.remaining()));return this},G1.prototype.flush=function(){var e;return 0<this._buffer.position&&(this._closeChunkIfOpen(),e=this._buffer,this._buffer=null,this._ch.write(e.getSlice(0,e.position)),this._buffer=(0,Y1.alloc)(this._bufferSize),this._chunkOpen=!1),this},G1.prototype.messageBoundary=function(){this._closeChunkIfOpen(),this._buffer.remaining()<2&&this.flush(),this._buffer.writeInt16(0)},G1.prototype._ensure=function(e){e=this._chunkOpen?e:e+2;this._buffer.remaining()<e&&this.flush(),this._chunkOpen||(this._currentChunkStart=this._buffer.position,this._buffer.position=this._buffer.position+2,this._chunkOpen=!0)},G1.prototype._closeChunkIfOpen=function(){var e;this._chunkOpen&&(e=this._buffer.position-(this._currentChunkStart+2),this._buffer.putUInt16(this._currentChunkStart,e),this._chunkOpen=!1)},G1);function G1(e,t){var r=H1.call(this,0)||this;return r._bufferSize=t||1400,r._ch=e,r._buffer=(0,Y1.alloc)(r._bufferSize),r._currentChunkStart=0,r._chunkOpen=!1,r}function Z1(){this._currentMessage=[],this._partialChunkHeader=0,this._state=this.AWAITING_CHUNK}I.Chunker=Ap,Z1.prototype.AWAITING_CHUNK=function(e){return 2<=e.remaining()?this._onHeader(e.readUInt16()):(this._partialChunkHeader=e.readUInt8()<<8,this.IN_HEADER)},Z1.prototype.IN_HEADER=function(e){return this._onHeader(65535&(this._partialChunkHeader|e.readUInt8()))},Z1.prototype.IN_CHUNK=function(e){return this._chunkSize<=e.remaining()?(this._currentMessage.push(e.readSlice(this._chunkSize)),this.AWAITING_CHUNK):(this._chunkSize-=e.remaining(),this._currentMessage.push(e.readSlice(e.remaining())),this.IN_CHUNK)},Z1.prototype.CLOSED=function(e){},Z1.prototype._onHeader=function(e){if(0!==e)return this._chunkSize=e,this.IN_CHUNK;var t=void 0;switch(this._currentMessage.length){case 0:return this.AWAITING_CHUNK;case 1:t=this._currentMessage[0];break;default:t=new K1.default(this._currentMessage)}return this._currentMessage=[],this.onmessage(t),this.AWAITING_CHUNK},Z1.prototype.write=function(e){for(;e.hasRemaining();)this._state=this._state(e)},I.Dechunker=Z1;var Wp={},Q1=(Object.defineProperty(Wp,"__esModule",{value:!0}),e),Zp=Q1.internal.util,ed=Zp.ENCRYPTION_OFF,od=Zp.ENCRYPTION_ON,X1=Q1.error.SERVICE_UNAVAILABLE,J1=[null,void 0,!0,!1,od,ed],$1=[null,void 0,"TRUST_ALL_CERTIFICATES","TRUST_CUSTOM_CA_SIGNED_CERTIFICATES","TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"];Wp.default=function(e,t,r){this.address=e,this.encrypted=function(e){e=e.encrypted;if(-1!==J1.indexOf(e))return e;throw(0,Q1.newError)("Illegal value of the encrypted setting ".concat(e,". Expected one of ").concat(J1))}(t),this.trust=function(e){e=e.trust;if(-1!==$1.indexOf(e))return e;throw(0,Q1.newError)("Illegal value of the trust setting ".concat(e,". Expected one of ").concat($1))}(t),this.trustedCertificates=t.trustedCertificates||[],this.knownHostsPath=t.knownHosts||null,this.connectionErrorCode=r||X1,this.connectionTimeout=t.connectionTimeout};var eT,tT,id={},Ed={},wd={exports:{}};function rT(e,t){for(var r in e)t[r]=e[r]}function nT(e,t,r){return tT(e,t,r)}fl=(zd=wd).exports,(tT=(eT=Kc).Buffer).from&&tT.alloc&&tT.allocUnsafe&&tT.allocUnsafeSlow?zd.exports=eT:(rT(eT,fl),fl.Buffer=nT),nT.prototype=Object.create(tT.prototype),rT(tT,nT),nT.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return tT(e,t,r)},nT.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=tT(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},nT.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return tT(e)},nT.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return eT.SlowBuffer(e)};var oT=wd.exports.Buffer,iT=oT.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function uT(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"==typeof t||oT.isEncoding!==iT&&iT(e))return t||e;throw new Error("Unknown encoding: "+e)}function aT(e){var t;switch(this.encoding=uT(e),this.encoding){case"utf16le":this.text=lT,this.end=fT,t=4;break;case"utf8":this.fillLast=cT,t=4;break;case"base64":this.text=pT,this.end=dT,t=3;break;default:return this.write=hT,void(this.end=bT)}this.lastNeed=0,this.lastTotal=0,this.lastChar=oT.allocUnsafe(t)}function sT(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function cT(e){var t,r=this.lastTotal-this.lastNeed,n=(t=this,128!=(192&(n=e)[0])?(t.lastNeed=0,"�"):1<t.lastNeed&&1<n.length?128!=(192&n[1])?(t.lastNeed=1,"�"):2<t.lastNeed&&2<n.length&&128!=(192&n[2])?(t.lastNeed=2,"�"):void 0:void 0);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,r,0,e.length),void(this.lastNeed-=e.length))}function lT(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);t=e.toString("utf16le",t);if(t){var r=t.charCodeAt(t.length-1);if(55296<=r&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}function fT(e){var t,e=e&&e.length?this.write(e):"";return this.lastNeed?(t=this.lastTotal-this.lastNeed,e+this.lastChar.toString("utf16le",0,t)):e}function pT(e,t){var r=(e.length-t)%3;return 0==r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function dT(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function hT(e){return e.toString(this.encoding)}function bT(e){return e&&e.length?this.write(e):""}(Ed.StringDecoder=aT).prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},aT.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},aT.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=sT(t[n]);if(0<=o)return 0<o&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(0<=(o=sT(t[n])))return 0<o&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(0<=(o=sT(t[n])))return 0<o&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;r=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},aT.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var yT,_T,vT,mT,gT,Cc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},OT=(Object.defineProperty(id,"__esModule",{value:!0}),Cc(Ra)),wT=e,ET=Cc(Kc),PT=new Ed.StringDecoder("utf8");id.default={encode:function(e){return new OT.default((e=e,"function"==typeof ET.default.Buffer.from?ET.default.Buffer.from(e,"utf8"):new ET.default.Buffer(e,"utf8")))},decode:function(e,t){if(Object.prototype.hasOwnProperty.call(e,"_buffer"))return n=t,a=(r=e).position,n=a+n,r.position=Math.min(n,r.length),r._buffer.toString("utf8",a,n);var o,i,u,r,n,a;if(Object.prototype.hasOwnProperty.call(e,"_buffers"))return o=function(e){return PT.write(e._buffer)},r=function(){return PT.end()},i=t,u=(a=e).position,a._updatePos(Math.min(t,a.length-u)),a._buffers.reduce(function(e,t){var r,n;return i<=0?e:u>=t.length?(u-=t.length,""):(t._updatePos(u-t.position),r=Math.min(t.length-u,i),n=t.readSlice(r),t._updatePos(r),i=Math.max(i-n.length,0),u=0,e+o(n))},"")+r();throw(0,wT.newError)("Don't know how to decode strings from '".concat(e,"'"))}},Ld=Il,yT=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Wd=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||yT(t,e,r)},_T=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.utf8=Ld.alloc=Ld.ChannelConfig=void 0,Wd(Rl,Ld),Wd(I,Ld),vT=Wp,Object.defineProperty(Ld,"ChannelConfig",{enumerable:!0,get:function(){return _T(vT).default}}),mT=Ra,Object.defineProperty(Ld,"alloc",{enumerable:!0,get:function(){return mT.alloc}}),gT=id,Object.defineProperty(Ld,"utf8",{enumerable:!0,get:function(){return _T(gT).default}}),Object.defineProperty(ll,"__esModule",{value:!0});var ST=Il,TT=e,jT=1616949271;function CT(e,t){return{major:e,minor:t}}function IT(){var e=[CT(5,0),[CT(4,4),CT(4,2)],CT(4,1),CT(3,0)];if(4<e.length)throw(0,TT.newError)("It should not have more than 4 versions of the protocol");var o=(0,ST.alloc)(20);return o.writeInt32(jT),e.forEach(function(e){var t,r,n;e instanceof Array?(r=(n=e[0]).major,n=n.minor,t=e[1].minor,o.writeInt32(n-t<<16|n<<8|r)):(r=e.major,n=e.minor,o.writeInt32(n<<8|r))}),o.reset(),o}ll.default=function(t){var o=this;return new Promise(function(r,n){function e(e){n(e)}t.onerror=e.bind(o),t._error&&e(t._error),t.onmessage=function(t){try{var e=function(e){if(72===(e=[e.readUInt8(),e.readUInt8(),e.readUInt8(),e.readUInt8()])[0]&&84===e[1]&&84===e[2]&&80===e[3])throw(0,TT.newError)("Server responded HTTP. Make sure you are not trying to connect to the http endpoint (HTTP defaults to port 7474 whereas BOLT defaults to port 7687)");return Number(e[3]+"."+e[2])}(t);r({protocolVersion:e,consumeRemainingBuffer:function(e){t.hasRemaining()&&e(t.readSlice(t.remaining()))}})}catch(e){n(e)}},t.write(IT())})};var RT,Jd={},$d={},ah={},R={},bh={},vh=r&&r.__extends||(RT=function(e,t){return(RT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}RT(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),mh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Bh=(Object.defineProperty(bh,"__esModule",{value:!0}),mh(e),kT.ofRecord=function(e){return null===e?kT.ofNull():new BT(e)},kT.ofMessageResponse=function(e){return null===e?kT.ofNull():new MT(e)},kT.ofNull=function(){return new UT},Object.defineProperty(kT.prototype,"ttl",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(kT.prototype,"db",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(kT.prototype,"servers",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(kT.prototype,"isNull",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),kT);function kT(){}bh.default=Bh;vh(xT,AT=Bh),Object.defineProperty(xT.prototype,"ttl",{get:function(){return this._response.rt.ttl},enumerable:!1,configurable:!0}),Object.defineProperty(xT.prototype,"servers",{get:function(){return this._response.rt.servers},enumerable:!1,configurable:!0}),Object.defineProperty(xT.prototype,"db",{get:function(){return this._response.rt.db},enumerable:!1,configurable:!0}),Object.defineProperty(xT.prototype,"isNull",{get:function(){return null===this._response},enumerable:!1,configurable:!0});var AT,MT=xT;function xT(e){var t=AT.call(this)||this;return t._response=e,t}vh(DT,NT=Bh),Object.defineProperty(DT.prototype,"isNull",{get:function(){return!0},enumerable:!1,configurable:!0});var NT,UT=DT;function DT(){return null!==NT&&NT.apply(this,arguments)||this}vh(FT,LT=Bh),Object.defineProperty(FT.prototype,"ttl",{get:function(){return this._record.get("ttl")},enumerable:!1,configurable:!0}),Object.defineProperty(FT.prototype,"servers",{get:function(){return this._record.get("servers")},enumerable:!1,configurable:!0}),Object.defineProperty(FT.prototype,"db",{get:function(){return this._record.has("db")?this._record.get("db"):null},enumerable:!1,configurable:!0}),Object.defineProperty(FT.prototype,"isNull",{get:function(){return null===this._record},enumerable:!1,configurable:!0});var LT,BT=FT;function FT(e){var t=LT.call(this)||this;return t._record=e,t}var WT,qh=r&&r.__extends||(WT=function(e,t){return(WT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}WT(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Gh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},zT=(Object.defineProperty(R,"__esModule",{value:!0}),R.ProcedureRouteObserver=R.RouteObserver=R.CompletedObserver=R.FailedObserver=R.ResetObserver=R.LoginObserver=R.ResultStreamObserver=R.StreamObserver=void 0,e),qT=Gh(bh),VT=zT.internal.constants.FETCH_ALL,HT=zT.error.PROTOCOL_ERROR,$h=(YT.prototype.onNext=function(e){},YT.prototype.onError=function(e){},YT.prototype.onCompleted=function(e){},YT);function YT(){}R.StreamObserver=$h;qh(GT,KT=$h),GT.prototype.pause=function(){this._paused=!0},GT.prototype.resume=function(){this._paused=!1,this._setupAutoPull(!0),this._state.pull(this)},GT.prototype.onNext=function(e){var t=new zT.Record(this._fieldKeys,e,this._fieldLookup);this._observers.some(function(e){return e.onNext})?this._observers.forEach(function(e){e.onNext&&e.onNext(t)}):(this._queuedRecords.push(t),this._queuedRecords.length>this._highRecordWatermark&&(this._autoPull=!1))},GT.prototype.onCompleted=function(e){this._state.onSuccess(this,e)},GT.prototype.onError=function(e){this._state.onError(this,e)},GT.prototype.cancel=function(){this._discard=!0},GT.prototype.prepareToHandleSingleResponse=function(){this._head=[],this._fieldKeys=[],this._setState(aj.STREAMING)},GT.prototype.markCompleted=function(){this._head=[],this._fieldKeys=[],this._tail={},this._setState(aj.SUCCEEDED)},GT.prototype.subscribe=function(e){if(this._head&&e.onKeys&&e.onKeys(this._head),0<this._queuedRecords.length&&e.onNext)for(var t=0;t<this._queuedRecords.length;t++)e.onNext(this._queuedRecords[t]),this._queuedRecords.length-t-1<=this._lowRecordWatermark&&(this._autoPull=!0,this._state===aj.READY&&this._handleStreaming());this._tail&&e.onCompleted&&e.onCompleted(this._tail),this._error&&e.onError(this._error),this._observers.push(e),this._state===aj.READY&&this._handleStreaming()},GT.prototype._handleHasMore=function(e){this._setState(aj.READY),this._handleStreaming(),delete e.has_more},GT.prototype._handlePullSuccess=function(e){var t,r=this,n=Object.assign(this._server?{server:this._server}:{},this._meta,e);[void 0,null,"r","w","rw","s"].includes(n.type)?(this._setState(aj.SUCCEEDED),e=null,t=function(){r._tail=n,r._observers.some(function(e){return e.onCompleted})&&r._observers.forEach(function(e){e.onCompleted&&e.onCompleted(n)}),r._afterComplete&&r._afterComplete(n)},(e=this._beforeComplete?this._beforeComplete(n):e)?Promise.resolve(e).then(t):t()):this.onError((0,zT.newError)('Server returned invalid query type. Expected one of [undefined, null, "r", "w", "rw", "s"] but got \''.concat(n.type,"'"),HT))},GT.prototype._handleRunSuccess=function(e,t){var r=this;if(null===this._fieldKeys){if(this._fieldKeys=[],this._fieldLookup={},e.fields&&0<e.fields.length){this._fieldKeys=e.fields;for(var n=0;n<e.fields.length;n++)this._fieldLookup[e.fields[n]]=n;delete e.fields}null!==e.qid&&void 0!==e.qid&&(this._queryId=e.qid,delete e.qid),this._storeMetadataForCompletion(e);var o=null,i=(this._beforeKeys&&(o=this._beforeKeys(this._fieldKeys)),function(){r._head=r._fieldKeys,r._observers.some(function(e){return e.onKeys})&&r._observers.forEach(function(e){e.onKeys&&e.onKeys(r._fieldKeys)}),r._afterKeys&&r._afterKeys(r._fieldKeys),t()});o?Promise.resolve(o).then(i):i()}},GT.prototype._handleError=function(t){function e(){r._observers.some(function(e){return e.onError})&&r._observers.forEach(function(e){e.onError&&e.onError(t)}),r._afterError&&r._afterError(t)}var r=this,n=(this._setState(aj.FAILED),this._error=t,null);this._beforeError&&(n=this._beforeError(t));n?Promise.resolve(n).then(e):e()},GT.prototype._handleStreaming=function(){this._head&&this._observers.some(function(e){return e.onNext||e.onCompleted})&&(this._paused||!this._discard&&!this._autoPull||this._more())},GT.prototype._more=function(){this._discard?this._discardFunction(this._queryId,this):this._moreFunction(this._queryId,this._fetchSize,this),this._setState(aj.STREAMING)},GT.prototype._storeMetadataForCompletion=function(e){for(var t,r=Object.keys(e),n=r.length;n--;)t=r[n],this._meta[t]=e[t]},GT.prototype._setState=function(e){this._state=e},GT.prototype._setupAutoPull=function(){this._autoPull=!0};var KT,tb=GT;function GT(e){var e=void 0===e?{}:e,t=e.reactive,t=void 0!==t&&t,r=e.moreFunction,n=e.discardFunction,o=e.fetchSize,o=void 0===o?VT:o,i=e.beforeError,u=e.afterError,a=e.beforeKeys,s=e.afterKeys,c=e.beforeComplete,l=e.afterComplete,f=e.server,p=e.highRecordWatermark,p=void 0===p?Number.MAX_VALUE:p,e=e.lowRecordWatermark,e=void 0===e?Number.MAX_VALUE:e,d=KT.call(this)||this;return d._fieldKeys=null,d._fieldLookup=null,d._head=null,d._queuedRecords=[],d._tail=null,d._error=null,d._observers=[],d._meta={},d._server=f,d._beforeError=i,d._afterError=u,d._beforeKeys=a,d._afterKeys=s,d._beforeComplete=c,d._afterComplete=l,d._queryId=null,d._moreFunction=r,d._discardFunction=n,d._discard=!1,d._fetchSize=o,d._lowRecordWatermark=e,d._highRecordWatermark=p,d._setState(t?aj.READY:aj.READY_STREAMING),d._setupAutoPull(),d._paused=!1,d}R.ResultStreamObserver=tb;qh(QT,ZT=$h),QT.prototype.onNext=function(e){this.onError((0,zT.newError)("Received RECORD when initializing "+zT.json.stringify(e)))},QT.prototype.onError=function(e){this._onError&&this._onError(e)},QT.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var ZT,pb=QT;function QT(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=ZT.call(this)||this;return r._onError=t,r._onCompleted=e,r}R.LoginObserver=pb;qh(JT,XT=$h),JT.prototype.onNext=function(e){this.onError((0,zT.newError)("Received RECORD when resetting: received record is: "+zT.json.stringify(e),HT))},JT.prototype.onError=function(e){e.code===HT&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},JT.prototype.onCompleted=function(e){this._onComplete&&this._onComplete(e)};var XT,_b=JT;function JT(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onComplete,n=XT.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onComplete=e,n}R.ResetObserver=_b;qh(ej,$T=tb);var $T,gb=ej;function ej(e){var t=e.error,e=e.onError,e=$T.call(this,{beforeError:e})||this;return e.onError(t),e}R.FailedObserver=gb;qh(rj,tj=tb);var tj,Ob=rj;function rj(){var e=tj.call(this)||this;return tj.prototype.markCompleted.call(e),e}R.CompletedObserver=Ob;qh(oj,nj=$h),oj.prototype.onNext=function(e){this._records.push(e)},oj.prototype.onError=function(e){e.code===HT&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},oj.prototype.onCompleted=function(){null!==this._records&&1!==this._records.length?this.onError((0,zT.newError)("Illegal response from router. Received "+this._records.length+" records but expected only one.\n"+zT.json.stringify(this._records),HT)):this._onCompleted&&this._onCompleted(qT.default.ofRecord(this._records[0]))};var nj,wb=oj;function oj(e){var t=e.resultObserver,r=e.onProtocolError,n=e.onError,e=e.onCompleted,o=nj.call(this)||this;return o._resultObserver=t,o._onError=n,o._onCompleted=e,o._records=[],o._onProtocolError=r,t.subscribe(o),o}R.ProcedureRouteObserver=wb;qh(uj,ij=$h),uj.prototype.onNext=function(e){this.onError((0,zT.newError)("Received RECORD when resetting: received record is: "+zT.json.stringify(e),HT))},uj.prototype.onError=function(e){e.code===HT&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},uj.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(qT.default.ofMessageResponse(e))};var ij,Ib=uj;function uj(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onCompleted,n=ij.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onCompleted=e,n}R.RouteObserver=Ib;var aj={READY_STREAMING:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){e._setState(aj.STREAMING)})},onError:function(e,t){e._handleError(t)},name:function(){return"READY_STREAMING"},pull:function(){}},READY:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){return e._handleStreaming()})},onError:function(e,t){e._handleError(t)},name:function(){return"READY"},pull:function(e){return e._more()}},STREAMING:{onSuccess:function(e,t){t.has_more?e._handleHasMore(t):e._handlePullSuccess(t)},onError:function(e,t){e._handleError(t)},name:function(){return"STREAMING"},pull:function(){}},FAILED:{onError:function(e){},name:function(){return"FAILED"},pull:function(){}},SUCCEEDED:{name:function(){return"SUCCEEDED"},pull:function(){}}},sj=(Object.defineProperty(ah,"__esModule",{value:!0}),ah.assertImpersonatedUserIsEmpty=ah.assertTxConfigIsEmpty=ah.assertDatabaseIsEmpty=void 0,e);ah.assertTxConfigIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e&&!e.isEmpty())throw t((e=(0,sj.newError)("Driver is connected to the database that does not support transaction configuration. Please upgrade to neo4j 3.5.0 or later in order to use this functionality")).message),r.onError(e),e},ah.assertDatabaseIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e)throw t((e=(0,sj.newError)("Driver is connected to the database that does not support multiple databases. Please upgrade to neo4j 4.0.0 or later in order to use this functionality")).message),r.onError(e),e},ah.assertImpersonatedUserIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e)throw t((t=(0,sj.newError)("Driver is connected to the database that does not support user impersonation. Please upgrade to neo4j 4.4.0 or later in order to use this functionality. "+"Trying to impersonate ".concat(e,"."))).message),r.onError(t),t};Bf={},k={},Mb={},Db={};Object.defineProperty(Db,"__esModule",{value:!0}),Db.identity=void 0,Db.identity=function(e){return e};var cj=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),lj=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Fb=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&cj(t,e,r);return lj(t,e),t},Kb=(Object.defineProperty(Mb,"__esModule",{value:!0}),Mb.functional=void 0,Mb.functional=Fb(Db),{}),fj=(Object.defineProperty(Kb,"__esModule",{value:!0}),Kb.verifyStructSize=Kb.Structure=void 0,e),pj=fj.error.PROTOCOL_ERROR,Ph=(Object.defineProperty(dj.prototype,"size",{get:function(){return this.fields.length},enumerable:!1,configurable:!0}),dj.prototype.toString=function(){for(var e="",t=0;t<this.fields.length;t++)0<t&&(e+=", "),e+=this.fields[t];return"Structure("+this.signature+", ["+e+"])"},dj);function dj(e,t){this.signature=e,this.fields=t}Kb.Structure=Ph,Kb.verifyStructSize=function(e,t,r){if(t!==r)throw(0,fj.newError)("Wrong struct size for ".concat(e,", expected ").concat(t," but was ").concat(r),pj)},Kb.default=Ph,Object.defineProperty(k,"__esModule",{value:!0}),k.Unpacker=k.Packer=void 0;var hj=Il,bj=Mb,yj=Kb,_j=e,vj=_j.error.PROTOCOL_ERROR;function mj(e){this._ch=e,this._byteArraysSupported=!0}function gj(e,t){void 0===t&&(t=!1),this._disableLosslessIntegers=e=void 0===e?!1:e,this._useBigInt=t}mj.prototype.packable=function(o,i){var e,u=this;void 0===i&&(i=bj.functional.identity);try{o=i(o)}catch(e){return function(){throw e}}if(null===o)return function(){return u._ch.writeUInt8(192)};if(!0===o)return function(){return u._ch.writeUInt8(195)};if(!1===o)return function(){return u._ch.writeUInt8(194)};if("number"==typeof o)return function(){return u.packFloat(o)};if("string"==typeof o)return function(){return u.packString(o)};if("bigint"==typeof o)return function(){return u.packInteger((0,_j.int)(o))};if((0,_j.isInt)(o))return function(){return u.packInteger(o)};if(o instanceof Int8Array)return function(){return u.packBytes(o)};if(o instanceof Array)return function(){u.packListHeader(o.length);for(var e=0;e<o.length;e++)u.packable(void 0===o[e]?null:o[e],i)()};if(null!=(e=o)&&"function"==typeof e[Symbol.iterator])return this.packableIterable(o,i);if(o instanceof yj.Structure){for(var t=[],r=0;r<o.fields.length;r++)t[r]=this.packable(o.fields[r],i);return function(){return u.packStruct(o.signature,t)}}return"object"==typeof o?function(){for(var e=Object.keys(o),t=0,r=0;r<e.length;r++)void 0!==o[e[r]]&&t++;u.packMapHeader(t);for(r=0;r<e.length;r++){var n=e[r];void 0!==o[n]&&(u.packString(n),u.packable(o[n],i)())}}:this._nonPackableValue("Unable to pack the given value: ".concat(o))},mj.prototype.packableIterable=function(t,e){try{var r=Array.from(t);return this.packable(r,e)}catch(e){throw(0,_j.newError)("Cannot pack given iterable, ".concat(e.message,": ").concat(t))}},mj.prototype.packStruct=function(e,t){this.packStructHeader((t=t||[]).length,e);for(var r=0;r<t.length;r++)t[r]()},mj.prototype.packInteger=function(e){var t=e.high,r=e.low;e.greaterThanOrEqual(-16)&&e.lessThan(128)?this._ch.writeInt8(r):e.greaterThanOrEqual(-128)&&e.lessThan(-16)?(this._ch.writeUInt8(200),this._ch.writeInt8(r)):e.greaterThanOrEqual(-32768)&&e.lessThan(32768)?(this._ch.writeUInt8(201),this._ch.writeInt16(r)):(e.greaterThanOrEqual(-2147483648)&&e.lessThan(2147483648)?this._ch.writeUInt8(202):(this._ch.writeUInt8(203),this._ch.writeInt32(t)),this._ch.writeInt32(r))},mj.prototype.packFloat=function(e){this._ch.writeUInt8(193),this._ch.writeFloat64(e)},mj.prototype.packString=function(e){var e=hj.utf8.encode(e),t=e.length;if(t<16)this._ch.writeUInt8(128|t),this._ch.writeBytes(e);else if(t<256)this._ch.writeUInt8(208),this._ch.writeUInt8(t),this._ch.writeBytes(e);else if(t<65536)this._ch.writeUInt8(209),this._ch.writeUInt8(t/256>>0),this._ch.writeUInt8(t%256),this._ch.writeBytes(e);else{if(!(t<4294967296))throw(0,_j.newError)("UTF-8 strings of size "+t+" are not supported");this._ch.writeUInt8(210),this._ch.writeUInt8((t/16777216>>0)%256),this._ch.writeUInt8((t/65536>>0)%256),this._ch.writeUInt8((t/256>>0)%256),this._ch.writeUInt8(t%256),this._ch.writeBytes(e)}},mj.prototype.packListHeader=function(e){if(e<16)this._ch.writeUInt8(144|e);else if(e<256)this._ch.writeUInt8(212),this._ch.writeUInt8(e);else if(e<65536)this._ch.writeUInt8(213),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256);else{if(!(e<4294967296))throw(0,_j.newError)("Lists of size "+e+" are not supported");this._ch.writeUInt8(214),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},mj.prototype.packBytes=function(e){if(!this._byteArraysSupported)throw(0,_j.newError)("Byte arrays are not supported by the database this driver is connected to");this.packBytesHeader(e.length);for(var t=0;t<e.length;t++)this._ch.writeInt8(e[t])},mj.prototype.packBytesHeader=function(e){if(e<256)this._ch.writeUInt8(204),this._ch.writeUInt8(e);else if(e<65536)this._ch.writeUInt8(205),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256);else{if(!(e<4294967296))throw(0,_j.newError)("Byte arrays of size "+e+" are not supported");this._ch.writeUInt8(206),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},mj.prototype.packMapHeader=function(e){if(e<16)this._ch.writeUInt8(160|e);else if(e<256)this._ch.writeUInt8(216),this._ch.writeUInt8(e);else if(e<65536)this._ch.writeUInt8(217),this._ch.writeUInt8(e/256>>0),this._ch.writeUInt8(e%256);else{if(!(e<4294967296))throw(0,_j.newError)("Maps of size "+e+" are not supported");this._ch.writeUInt8(218),this._ch.writeUInt8((e/16777216>>0)%256),this._ch.writeUInt8((e/65536>>0)%256),this._ch.writeUInt8((e/256>>0)%256),this._ch.writeUInt8(e%256)}},mj.prototype.packStructHeader=function(e,t){if(e<16)this._ch.writeUInt8(176|e),this._ch.writeUInt8(t);else if(e<256)this._ch.writeUInt8(220),this._ch.writeUInt8(e),this._ch.writeUInt8(t);else{if(!(e<65536))throw(0,_j.newError)("Structures of size "+e+" are not supported");this._ch.writeUInt8(221),this._ch.writeUInt8(e/256>>0),this._ch.writeUInt8(e%256)}},mj.prototype.disableByteArrays=function(){this._byteArraysSupported=!1},mj.prototype._nonPackableValue=function(e){return function(){throw(0,_j.newError)(e,vj)}},k.Packer=mj,gj.prototype.unpack=function(e,t){void 0===t&&(t=bj.functional.identity);var r=e.readUInt8(),n=240&r,o=15&r;if(192===r)return null;var i=this._unpackBoolean(r);if(null!==i)return i;i=this._unpackNumberOrInteger(r,e);if(null!==i){if((0,_j.isInt)(i)){if(this._useBigInt)return i.toBigInt();if(this._disableLosslessIntegers)return i.toNumberOrInfinity()}return i}i=this._unpackString(r,n,o,e);if(null!==i)return i;i=this._unpackList(r,n,o,e,t);if(null!==i)return i;i=this._unpackByteArray(r,e);if(null!==i)return i;i=this._unpackMap(r,n,o,e,t);if(null!==i)return i;i=this._unpackStruct(r,n,o,e,t);if(null!==i)return i;throw(0,_j.newError)("Unknown packed value with marker "+r.toString(16))},gj.prototype.unpackInteger=function(e){var t=e.readUInt8(),e=this._unpackInteger(t,e);if(null==e)throw(0,_j.newError)("Unable to unpack integer value with marker "+t.toString(16));return e},gj.prototype._unpackBoolean=function(e){return 195===e||194!==e&&null},gj.prototype._unpackNumberOrInteger=function(e,t){return 193===e?t.readFloat64():this._unpackInteger(e,t)},gj.prototype._unpackInteger=function(e,t){var r;return 0<=e&&e<128?(0,_j.int)(e):240<=e&&e<256?(0,_j.int)(e-256):200===e?(0,_j.int)(t.readInt8()):201===e?(0,_j.int)(t.readInt16()):202===e?(r=t.readInt32(),(0,_j.int)(r)):203===e?(r=t.readInt32(),e=t.readInt32(),new _j.Integer(e,r)):null},gj.prototype._unpackString=function(e,t,r,n){return 128===t?hj.utf8.decode(n,r):208===e?hj.utf8.decode(n,n.readUInt8()):209===e?hj.utf8.decode(n,n.readUInt16()):210===e?hj.utf8.decode(n,n.readUInt32()):null},gj.prototype._unpackList=function(e,t,r,n,o){return 144===t?this._unpackListWithSize(r,n,o):212===e?this._unpackListWithSize(n.readUInt8(),n,o):213===e?this._unpackListWithSize(n.readUInt16(),n,o):214===e?this._unpackListWithSize(n.readUInt32(),n,o):null},gj.prototype._unpackListWithSize=function(e,t,r){for(var n=[],o=0;o<e;o++)n.push(this.unpack(t,r));return n},gj.prototype._unpackByteArray=function(e,t){return 204===e?this._unpackByteArrayWithSize(t.readUInt8(),t):205===e?this._unpackByteArrayWithSize(t.readUInt16(),t):206===e?this._unpackByteArrayWithSize(t.readUInt32(),t):null},gj.prototype._unpackByteArrayWithSize=function(e,t){for(var r=new Int8Array(e),n=0;n<e;n++)r[n]=t.readInt8();return r},gj.prototype._unpackMap=function(e,t,r,n,o){return 160===t?this._unpackMapWithSize(r,n,o):216===e?this._unpackMapWithSize(n.readUInt8(),n,o):217===e?this._unpackMapWithSize(n.readUInt16(),n,o):218===e?this._unpackMapWithSize(n.readUInt32(),n,o):null},gj.prototype._unpackMapWithSize=function(e,t,r){for(var n={},o=0;o<e;o++)n[this.unpack(t,r)]=this.unpack(t,r);return n},gj.prototype._unpackStruct=function(e,t,r,n,o){return 176===t?this._unpackStructWithSize(r,n,o):220===e?this._unpackStructWithSize(n.readUInt8(),n,o):221===e?this._unpackStructWithSize(n.readUInt16(),n,o):null},gj.prototype._unpackStructWithSize=function(e,t,r){for(var n=t.readUInt8(),o=new yj.Structure(n,[]),i=0;i<e;i++)o.fields.push(this.unpack(t,r));return r(o)},k.Unpacker=gj;var Oj,wj,$b={},ry=r&&r.__extends||(Oj=function(e,t){return(Oj=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Oj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ej=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Pj=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ic=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Ej(t,e,r);return Pj(t,e),t},Ch=(Object.defineProperty($b,"__esModule",{value:!0}),$b.Unpacker=$b.Packer=void 0,Ic(k)),hy=(wj=Ch.Packer,ry(Sj,wj),Sj.prototype.disableByteArrays=function(){throw new Error("Bolt V2 should always support byte arrays")},Sj);function Sj(){return null!==wj&&wj.apply(this,arguments)||this}$b.Packer=hy;Tj=Ch.Unpacker,ry(jj,Tj);var Tj,vy=jj;function jj(e,t){return Tj.call(this,e=void 0===e?!1:e,t=void 0===t?!1:t)||this}$b.Unpacker=vy;var Cj=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),Ij=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Cy=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Cj(t,e,r);return Ij(t,e),t},pl=(Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.structure=Bf.v2=Bf.v1=void 0,Cy(k)),Oy=(Bf.v1=pl,Cy($b)),dl=(Bf.v2=Oy,Cy(Kb)),wy=(Bf.structure=dl,Bf.default=Oy,{}),Rj=(Object.defineProperty(wy,"__esModule",{value:!0}),e),Sy=Rj.internal.constants,kj=Sy.ACCESS_MODE_READ,Aj=Sy.FETCH_ALL,Mj=Rj.internal.util.assertString,hl=(xj.init=function(e,t){return new xj(1,[e,t],function(){return"INIT ".concat(e," {...}")})},xj.run=function(e,t){return new xj(16,[e,t],function(){return"RUN ".concat(e," ").concat(Rj.json.stringify(t))})},xj.pullAll=function(){return Dj},xj.reset=function(){return Lj},xj.hello=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);t=Object.assign({user_agent:e},t);return r&&(t.routing=r),n&&(t.patch_bolt=n),new xj(1,[t],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},xj.begin=function(e){var e=void 0===e?{}:e,t=Nj(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser);return new xj(17,[t],function(){return"BEGIN ".concat(Rj.json.stringify(t))})},xj.commit=function(){return Bj},xj.rollback=function(){return Fj},xj.runWithMetadata=function(e,t,r){var r=void 0===r?{}:r,n=Nj(r.bookmarks,r.txConfig,r.database,r.mode,r.impersonatedUser);return new xj(16,[e,t,n],function(){return"RUN ".concat(e," ").concat(Rj.json.stringify(t)," ").concat(Rj.json.stringify(n))})},xj.goodbye=function(){return Wj},xj.pull=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=Uj(null==t?-1:t,(void 0===e?Aj:e)||Aj);return new xj(63,[r],function(){return"PULL ".concat(Rj.json.stringify(r))})},xj.discard=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=Uj(null==t?-1:t,(void 0===e?Aj:e)||Aj);return new xj(47,[r],function(){return"DISCARD ".concat(Rj.json.stringify(r))})},xj.route=function(e,t,r){return new xj(102,[e=void 0===e?{}:e,t=void 0===t?[]:t,r=void 0===r?null:r],function(){return"ROUTE ".concat(Rj.json.stringify(e)," ").concat(Rj.json.stringify(t)," ").concat(r)})},xj.routeV4x4=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t=[]);var n={};return(r=void 0===r?{}:r).databaseName&&(n.db=r.databaseName),r.impersonatedUser&&(n.imp_user=r.impersonatedUser),new xj(102,[e,t,n],function(){return"ROUTE ".concat(Rj.json.stringify(e)," ").concat(Rj.json.stringify(t)," ").concat(Rj.json.stringify(n))})},xj);function xj(e,t,r){this.signature=e,this.fields=t,this.toString=r}function Nj(e,t,r,n,o){var i={};return e.isEmpty()||(i.bookmarks=e.values()),null!==t.timeout&&(i.tx_timeout=t.timeout),t.metadata&&(i.tx_metadata=t.metadata),r&&(i.db=Mj(r,"database")),o&&(i.imp_user=Mj(o,"impersonatedUser")),n===kj&&(i.mode="r"),i}function Uj(e,t){t={n:(0,Rj.int)(t)};return-1!==e&&(t.qid=(0,Rj.int)(e)),t}var Dj=new(wy.default=hl)(63,[],function(){return"PULL_ALL"}),Lj=new hl(15,[],function(){return"RESET"}),Bj=new hl(18,[],function(){return"COMMIT"}),Fj=new hl(19,[],function(){return"ROLLBACK"}),Wj=new hl(2,[],function(){return"GOODBYE"}),By={},zy={},zj=(Object.defineProperty(zy,"__esModule",{value:!0}),zy.TypeTransformer=void 0,Bf),qj=e.internal.objectUtil;function Vj(e){this._transformers=e,this._transformersPerSignature=new Map(e.map(function(e){return[e.signature,e]})),this.fromStructure=this.fromStructure.bind(this),this.toStructure=this.toStructure.bind(this),Object.freeze(this)}function Hj(e){var t=e.signature,r=e.fromStructure,n=e.toStructure,e=e.isTypeInstance;this.signature=t,this.isTypeInstance=e,this.fromStructure=r,this.toStructure=n,Object.freeze(this)}Vj.prototype.fromStructure=function(e){try{return e instanceof zj.structure.Structure&&this._transformersPerSignature.has(e.signature)?(0,this._transformersPerSignature.get(e.signature).fromStructure)(e):e}catch(e){return qj.createBrokenObject(e)}},Vj.prototype.toStructure=function(t){var e=this._transformers.find(function(e){return(0,e.isTypeInstance)(t)});return void 0!==e?e.toStructure(t):t},zy.default=Vj,Hj.prototype.extendsWith=function(e){var t=e.signature,r=e.fromStructure,n=e.toStructure,e=e.isTypeInstance;return new Hj({signature:t||this.signature,fromStructure:r||this.fromStructure,toStructure:n||this.toStructure,isTypeInstance:e||this.isTypeInstance})},zy.TypeTransformer=Hj;var Yj=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Kj=(Object.defineProperty(By,"__esModule",{value:!0}),e),Gj=Bf,Zj=zy,Qj=Kj.error.PROTOCOL_ERROR;By.default={createNodeTransformer:function(){return new Zj.TypeTransformer({signature:78,isTypeInstance:function(e){return e instanceof Kj.Node},toStructure:function(e){throw(0,Kj.newError)("It is not allowed to pass nodes in query parameters, given: ".concat(e),Qj)},fromStructure:function(e){Gj.structure.verifyStructSize("Node",3,e.size);var e=Yj(e.fields,3),t=e[0],r=e[1],e=e[2];return new Kj.Node(t,r,e)}})},createRelationshipTransformer:function(){return new Zj.TypeTransformer({signature:82,isTypeInstance:function(e){return e instanceof Kj.Relationship},toStructure:function(e){throw(0,Kj.newError)("It is not allowed to pass relationships in query parameters, given: ".concat(e),Qj)},fromStructure:function(e){Gj.structure.verifyStructSize("Relationship",5,e.size);var e=Yj(e.fields,5),t=e[0],r=e[1],n=e[2],o=e[3],e=e[4];return new Kj.Relationship(t,r,n,o,e)}})},createUnboundRelationshipTransformer:function(){return new Zj.TypeTransformer({signature:114,isTypeInstance:function(e){return e instanceof Kj.UnboundRelationship},toStructure:function(e){throw(0,Kj.newError)("It is not allowed to pass unbound relationships in query parameters, given: ".concat(e),Qj)},fromStructure:function(e){Gj.structure.verifyStructSize("UnboundRelationship",3,e.size);var e=Yj(e.fields,3),t=e[0],r=e[1],e=e[2];return new Kj.UnboundRelationship(t,r,e)}})},createPathTransformer:function(){return new Zj.TypeTransformer({signature:80,isTypeInstance:function(e){return e instanceof Kj.Path},toStructure:function(e){throw(0,Kj.newError)("It is not allowed to pass paths in query parameters, given: ".concat(e),Qj)},fromStructure:function(e){Gj.structure.verifyStructSize("Path",3,e.size);for(var e=Yj(e.fields,3),t=e[0],r=e[1],n=e[2],o=[],i=t[0],u=0;u<n.length;u+=2){var a=t[n[u+1]],s=(0,Kj.toNumber)(n[u]),c=void 0;0<s?(c=r[s-1])instanceof Kj.UnboundRelationship&&(r[s-1]=c=c.bindTo(i,a)):(c=r[-s-1])instanceof Kj.UnboundRelationship&&(r[-s-1]=c=c.bindTo(a,i)),o.push(new Kj.PathSegment(i,c,a)),i=a}return new Kj.Path(t[0],t[t.length-1],o)}})}};var v=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Xj=(Object.defineProperty($d,"__esModule",{value:!0}),ah),Jj=Bf,$j=v(wy),eC=R,Yy=e,tC=v(By),rC=v(zy),nC=Yy.internal.bookmarks.Bookmarks,Jy=Yy.internal.constants,oC=Jy.ACCESS_MODE_WRITE,iC=Jy.BOLT_PROTOCOL_V1,uC=(Yy.internal.logger.Logger,Yy.internal.txConfig.TxConfig),w=(Object.defineProperty(aC.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new rC.default(Object.values(tC.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(aC.prototype,"version",{get:function(){return iC},enumerable:!1,configurable:!0}),aC.prototype.packer=function(){return this._packer},aC.prototype.packable=function(e){return this._packer.packable(e,this.transformer.toStructure)},aC.prototype.unpacker=function(){return this._unpacker},aC.prototype.unpack=function(e){return this._unpacker.unpack(e,this.transformer.fromStructure)},aC.prototype.transformMetadata=function(e){return e},aC.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new eC.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return t._onLoginCompleted(e,i)}});return this.write($j.default.init(r,n),e,!0),e},aC.prototype.prepareToClose=function(){},aC.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,u=e.beforeError,a=e.afterError,s=e.beforeComplete,e=e.afterComplete;return this.run("BEGIN",t?t.asBeginTransactionParameters():{},{bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,beforeError:u,afterError:a,beforeComplete:s,afterComplete:e,flush:!1})},aC.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete;return this.run("COMMIT",{},{bookmarks:nC.empty(),txConfig:uC.empty(),mode:oC,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},aC.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete;return this.run("ROLLBACK",{},{bookmarks:nC.empty(),txConfig:uC.empty(),mode:oC,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},aC.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=(r.bookmarks,r.txConfig),o=r.database,i=(r.mode,r.impersonatedUser),u=r.beforeKeys,a=r.afterKeys,s=r.beforeError,c=r.afterError,l=r.beforeComplete,f=r.afterComplete,p=r.flush,p=void 0===p||p,d=r.highRecordWatermark,d=void 0===d?Number.MAX_VALUE:d,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,u=new eC.ResultStreamObserver({server:this._server,beforeKeys:u,afterKeys:a,beforeError:s,afterError:c,beforeComplete:l,afterComplete:f,highRecordWatermark:d,lowRecordWatermark:r});return(0,Xj.assertTxConfigIsEmpty)(n,this._onProtocolError,u),(0,Xj.assertDatabaseIsEmpty)(o,this._onProtocolError,u),(0,Xj.assertImpersonatedUserIsEmpty)(i,this._onProtocolError,u),this.write($j.default.run(e,t),u,!1),this.write($j.default.pullAll(),u,p),u},Object.defineProperty(aC.prototype,"currentFailure",{get:function(){return this._responseHandler.currentFailure},enumerable:!1,configurable:!0}),aC.prototype.reset=function(e){var e=void 0===e?{}:e,t=e.onError,e=e.onComplete,t=new eC.ResetObserver({onProtocolError:this._onProtocolError,onError:t,onComplete:e});return this.write($j.default.reset(),t,!0),t},aC.prototype._createPacker=function(e){return new Jj.v1.Packer(e)},aC.prototype._createUnpacker=function(e,t){return new Jj.v1.Unpacker(e,t)},aC.prototype.write=function(e,t,r){this.queueObserverIfProtocolIsNotBroken(t)&&(this._log.isDebugEnabled()&&this._log.debug("C: ".concat(e)),this._lastMessageSignature=e.signature,t=new Jj.structure.Structure(e.signature,e.fields),this.packable(t)(),this._chunker.messageBoundary(),r&&this._chunker.flush())},aC.prototype.isLastMessageLogin=function(){return 1===this._lastMessageSignature},aC.prototype.isLastMessageReset=function(){return 15===this._lastMessageSignature},aC.prototype.notifyFatalError=function(e){return this._fatalError=e,this._responseHandler._notifyErrorToObservers(e)},aC.prototype.updateCurrentObserver=function(){return this._responseHandler._updateCurrentObserver()},aC.prototype.hasOngoingObservableRequests=function(){return this._responseHandler.hasOngoingObservableRequests()},aC.prototype.queueObserverIfProtocolIsNotBroken=function(e){return this.isBroken()?(this.notifyFatalErrorToObserver(e),!1):this._responseHandler._queueObserver(e)},aC.prototype.isBroken=function(){return!!this._fatalError},aC.prototype.notifyFatalErrorToObserver=function(e){e&&e.onError&&e.onError(this._fatalError)},aC.prototype.resetFailure=function(){this._responseHandler._resetFailure()},aC.prototype._onLoginCompleted=function(e,t){var r;e&&(r=e.server,this._server.version||(this._server.version=r)),t&&t(e)},aC.prototype._onLoginError=function(e,t){this._onProtocolError(e.message),t&&t(e)},aC);function aC(e,t,r,n,o,i){var r=void 0===r?{}:r,u=r.disableLosslessIntegers,r=r.useBigInt;void 0===n&&(n=function(){return null}),this._server=e||{},this._chunker=t,this._packer=this._createPacker(t),this._unpacker=this._createUnpacker(u,r),this._responseHandler=n(this),this._log=o,this._onProtocolError=i,this._fatalError=null,this._lastMessageSignature=null,this._config={disableLosslessIntegers:u,useBigInt:r}}$d.default=w;var t_={},n_={},a_={},sC=(Object.defineProperty(a_,"__esModule",{value:!0}),a_.epochSecondAndNanoToLocalDateTime=a_.nanoOfDayToLocalTime=a_.epochDayToDate=void 0,e),l_=sC.internal.temporalUtil,cC=l_.DAYS_0000_TO_1970,lC=l_.DAYS_PER_400_YEAR_CYCLE,fC=l_.NANOS_PER_HOUR,pC=l_.NANOS_PER_MINUTE,dC=l_.NANOS_PER_SECOND,hC=l_.SECONDS_PER_DAY,bC=l_.floorDiv,yC=l_.floorMod;function _C(e){var e=(e=(0,sC.int)(e)).add(cC).subtract(60),t=(0,sC.int)(0),r=(e.lessThan(0)&&(t=(r=e.add(1).div(lC).subtract(1)).multiply(400),e=e.add(r.multiply(-lC))),e.multiply(400).add(591).div(lC)),n=e.subtract(r.multiply(365).add(r.div(4)).subtract(r.div(100)).add(r.div(400))),e=(n.lessThan(0)&&(r=r.subtract(1),n=e.subtract(r.multiply(365).add(r.div(4)).subtract(r.div(100)).add(r.div(400)))),r=r.add(t),n),t=e.multiply(5).add(2).div(153),n=t.add(2).modulo(12).add(1),e=e.subtract(t.multiply(306).add(5).div(10)).add(1),r=r.add(t.div(10));return new sC.Date(r,n,e)}function vC(e){var t=(e=(0,sC.int)(e)).div(fC),r=(e=e.subtract(t.multiply(fC))).div(pC),n=(e=e.subtract(r.multiply(pC))).div(dC),e=e.subtract(n.multiply(dC));return new sC.LocalTime(t,r,n,e)}a_.epochDayToDate=_C,a_.nanoOfDayToLocalTime=vC,a_.epochSecondAndNanoToLocalDateTime=function(e,t){var r=bC(e,hC),e=yC(e,hC).multiply(dC).add(t),t=_C(r),r=vC(e);return new sC.LocalDateTime(t.year,t.month,t.day,r.hour,r.minute,r.second,r.nanosecond)};var mC=r&&r.__assign||function(){return(mC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},gC=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},d_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},OC=(Object.defineProperty(n_,"__esModule",{value:!0}),e),wC=Bf,EC=zy,PC=a_,jr=d_(By),__=OC.internal.temporalUtil,SC=__.dateToEpochDay,TC=__.localDateTimeToEpochSecond,jC=__.localTimeToNanoOfDay;function CC(e,t,r){if(!t&&!r)return e;var n,o,i,u=Object.create(Object.getPrototypeOf(e));for(n in e)!0===Object.prototype.hasOwnProperty.call(e,n)&&(o=e[n],u[n]=(0,OC.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}n_.default=mC(mC({},jr.default),{createPoint2DTransformer:function(){return new EC.TypeTransformer({signature:88,isTypeInstance:function(e){return(0,OC.isPoint)(e)&&(null===e.z||void 0===e.z)},toStructure:function(e){return new wC.structure.Structure(88,[(0,OC.int)(e.srid),e.x,e.y])},fromStructure:function(e){wC.structure.verifyStructSize("Point2D",3,e.size);var e=gC(e.fields,3),t=e[0],r=e[1],e=e[2];return new OC.Point(t,r,e,void 0)}})},createPoint3DTransformer:function(){return new EC.TypeTransformer({signature:89,isTypeInstance:function(e){return(0,OC.isPoint)(e)&&null!==e.z&&void 0!==e.z},toStructure:function(e){return new wC.structure.Structure(89,[(0,OC.int)(e.srid),e.x,e.y,e.z])},fromStructure:function(e){wC.structure.verifyStructSize("Point3D",4,e.size);var e=gC(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new OC.Point(t,r,n,e)}})},createDurationTransformer:function(){return new EC.TypeTransformer({signature:69,isTypeInstance:OC.isDuration,toStructure:function(e){var t=(0,OC.int)(e.months),r=(0,OC.int)(e.days),n=(0,OC.int)(e.seconds),e=(0,OC.int)(e.nanoseconds);return new wC.structure.Structure(69,[t,r,n,e])},fromStructure:function(e){wC.structure.verifyStructSize("Duration",4,e.size);var e=gC(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new OC.Duration(t,r,n,e)}})},createLocalTimeTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new EC.TypeTransformer({signature:116,isTypeInstance:OC.isLocalTime,toStructure:function(e){e=jC(e.hour,e.minute,e.second,e.nanosecond);return new wC.structure.Structure(116,[e])},fromStructure:function(e){wC.structure.verifyStructSize("LocalTime",1,e.size);e=gC(e.fields,1)[0];return CC((0,PC.nanoOfDayToLocalTime)(e),t,r)}})},createTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new EC.TypeTransformer({signature:84,isTypeInstance:OC.isTime,toStructure:function(e){var t=jC(e.hour,e.minute,e.second,e.nanosecond),e=(0,OC.int)(e.timeZoneOffsetSeconds);return new wC.structure.Structure(84,[t,e])},fromStructure:function(e){wC.structure.verifyStructSize("Time",2,e.size);var e=gC(e.fields,2),t=e[0],e=e[1],t=(0,PC.nanoOfDayToLocalTime)(t);return CC(new OC.Time(t.hour,t.minute,t.second,t.nanosecond,e),r,n)}})},createDateTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new EC.TypeTransformer({signature:68,isTypeInstance:OC.isDate,toStructure:function(e){e=SC(e.year,e.month,e.day);return new wC.structure.Structure(68,[e])},fromStructure:function(e){wC.structure.verifyStructSize("Date",1,e.size);e=gC(e.fields,1)[0];return CC((0,PC.epochDayToDate)(e),t,r)}})},createLocalDateTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new EC.TypeTransformer({signature:100,isTypeInstance:OC.isLocalDateTime,toStructure:function(e){var t=TC(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),e=(0,OC.int)(e.nanosecond);return new wC.structure.Structure(100,[t,e])},fromStructure:function(e){wC.structure.verifyStructSize("LocalDateTime",2,e.size);var e=gC(e.fields,2),t=e[0],e=e[1];return CC((0,PC.epochSecondAndNanoToLocalDateTime)(t,e),r,n)}})},createDateTimeWithZoneIdTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new EC.TypeTransformer({signature:102,isTypeInstance:function(e){return(0,OC.isDateTime)(e)&&null!=e.timeZoneId},toStructure:function(e){var t=TC(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,OC.int)(e.nanosecond),e=e.timeZoneId;return new wC.structure.Structure(102,[t,r,e])},fromStructure:function(e){wC.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=gC(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,PC.epochSecondAndNanoToLocalDateTime)(t,r);return CC(new OC.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,null,e),n,o)}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new EC.TypeTransformer({signature:70,isTypeInstance:function(e){return(0,OC.isDateTime)(e)&&null==e.timeZoneId},toStructure:function(e){var t=TC(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,OC.int)(e.nanosecond),e=(0,OC.int)(e.timeZoneOffsetSeconds);return new wC.structure.Structure(70,[t,r,e])},fromStructure:function(e){wC.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=gC(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,PC.epochSecondAndNanoToLocalDateTime)(t,r);return CC(new OC.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}});var IC,RC,ad=r&&r.__extends||(IC=function(e,t){return(IC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}IC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),E_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},I_=(Object.defineProperty(t_,"__esModule",{value:!0}),E_($d)),kC=E_(Bf),x_=e,AC=E_(n_),MC=E_(zy),xC=x_.internal.constants.BOLT_PROTOCOL_V2,F_=(RC=I_.default,ad(NC,RC),NC.prototype._createPacker=function(e){return new kC.default.Packer(e)},NC.prototype._createUnpacker=function(e,t){return new kC.default.Unpacker(e,t)},Object.defineProperty(NC.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new MC.default(Object.values(AC.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(NC.prototype,"version",{get:function(){return xC},enumerable:!1,configurable:!0}),NC);function NC(){return null!==RC&&RC.apply(this,arguments)||this}t_.default=F_;var UC,DC,E={},H_={},LC=r&&r.__assign||function(){return(LC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Q_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ev=(Object.defineProperty(H_,"__esModule",{value:!0}),Q_(n_)),sd=(H_.default=LC({},ev.default),r&&r.__extends||(UC=function(e,t){return(UC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}UC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),BC=r&&r.__assign||function(){return(BC=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},av=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bv=(Object.defineProperty(E,"__esModule",{value:!0}),av(t_)),FC=av(wy),WC=ah,zC=R,qC=av(H_),VC=av(zy),HC=(e.internal.bookmarks.Bookmarks,e.internal.constants.BOLT_PROTOCOL_V3),YC=e.internal.txConfig.TxConfig,KC="context",GC="CALL dbms.cluster.routing.getRoutingTable($".concat(KC,")"),ZC=new zC.StreamObserver,vv=(DC=bv.default,sd(QC,DC),Object.defineProperty(QC.prototype,"version",{get:function(){return HC},enumerable:!1,configurable:!0}),Object.defineProperty(QC.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new VC.default(Object.values(qC.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),QC.prototype.transformMetadata=function(e){return"t_first"in e&&(e.result_available_after=e.t_first,delete e.t_first),"t_last"in e&&(e.result_consumed_after=e.t_last,delete e.t_last),e},QC.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new zC.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return t._onLoginCompleted(e,i)}});return this.write(FC.default.hello(r,n),e,!0),e},QC.prototype.prepareToClose=function(){this.write(FC.default.goodbye(),ZC,!0)},QC.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.mode,u=e.beforeError,a=e.afterError,s=e.beforeComplete,e=e.afterComplete,u=new zC.ResultStreamObserver({server:this._server,beforeError:u,afterError:a,beforeComplete:s,afterComplete:e});return u.prepareToHandleSingleResponse(),(0,WC.assertDatabaseIsEmpty)(n,this._onProtocolError,u),(0,WC.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,u),this.write(FC.default.begin({bookmarks:t,txConfig:r,mode:i}),u,!0),u},QC.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete,t=new zC.ResultStreamObserver({server:this._server,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e});return t.prepareToHandleSingleResponse(),this.write(FC.default.commit(),t,!0),t},QC.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete,t=new zC.ResultStreamObserver({server:this._server,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e});return t.prepareToHandleSingleResponse(),this.write(FC.default.rollback(),t,!0),t},QC.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.impersonatedUser,a=r.mode,s=r.beforeKeys,c=r.afterKeys,l=r.beforeError,f=r.afterError,p=r.beforeComplete,d=r.afterComplete,h=r.flush,h=void 0===h||h,b=r.highRecordWatermark,b=void 0===b?Number.MAX_VALUE:b,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,s=new zC.ResultStreamObserver({server:this._server,beforeKeys:s,afterKeys:c,beforeError:l,afterError:f,beforeComplete:p,afterComplete:d,highRecordWatermark:b,lowRecordWatermark:r});return(0,WC.assertDatabaseIsEmpty)(i,this._onProtocolError,s),(0,WC.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,s),this.write(FC.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,mode:a}),s,!1),this.write(FC.default.pullAll(),s,h),s},QC.prototype.requestRoutingInformation=function(e){var t,r=e.routingContext,n=e.sessionContext,n=void 0===n?{}:n,o=e.onError,e=e.onCompleted,r=this.run(GC,((t={})[KC]=void 0===r?{}:r,t),BC(BC({},n),{txConfig:YC.empty()}));return new zC.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:o,onCompleted:e})},QC);function QC(){return null!==DC&&DC.apply(this,arguments)||this}E.default=vv;var XC,JC,Pv={},Tv={},$C=r&&r.__assign||function(){return($C=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Rv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Nv=(Object.defineProperty(Tv,"__esModule",{value:!0}),Rv(H_)),Lv=(Tv.default=$C({},Nv.default),r&&r.__extends||(XC=function(e,t){return(XC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}XC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),eI=r&&r.__assign||function(){return(eI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Es=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},zv=(Object.defineProperty(Pv,"__esModule",{value:!0}),Es(E)),tI=Es(wy),rI=ah,nI=R,oI=Es(Tv),iI=Es(zy),qv=(e.internal.bookmarks.Bookmarks,e.internal.constants),uI=qv.BOLT_PROTOCOL_V4_0,aI=qv.FETCH_ALL,sI=e.internal.txConfig.TxConfig,cI="context",lI="database",fI="CALL dbms.routing.getRoutingTable($".concat(cI,", $").concat(lI,")"),Zv=(JC=zv.default,Lv(pI,JC),Object.defineProperty(pI.prototype,"version",{get:function(){return uI},enumerable:!1,configurable:!0}),Object.defineProperty(pI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new iI.default(Object.values(oI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),pI.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.mode,u=e.beforeError,a=e.afterError,s=e.beforeComplete,e=e.afterComplete,u=new nI.ResultStreamObserver({server:this._server,beforeError:u,afterError:a,beforeComplete:s,afterComplete:e});return u.prepareToHandleSingleResponse(),(0,rI.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,u),this.write(tI.default.begin({bookmarks:t,txConfig:r,database:n,mode:i}),u,!0),u},pI.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.impersonatedUser,a=r.mode,s=r.beforeKeys,c=r.afterKeys,l=r.beforeError,f=r.afterError,p=r.beforeComplete,d=r.afterComplete,h=r.flush,h=void 0===h||h,b=r.reactive,b=void 0!==b&&b,y=r.fetchSize,y=void 0===y?aI:y,_=r.highRecordWatermark,_=void 0===_?Number.MAX_VALUE:_,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,s=new nI.ResultStreamObserver({server:this._server,reactive:b,fetchSize:y,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:s,afterKeys:c,beforeError:l,afterError:f,beforeComplete:p,afterComplete:d,highRecordWatermark:_,lowRecordWatermark:r}),c=((0,rI.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,s),b);return this.write(tI.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:a}),s,c&&h),b||this.write(tI.default.pull({n:y}),s,h),s},pI.prototype._requestMore=function(e,t,r){this.write(tI.default.pull({stmtId:e,n:t}),r,!0)},pI.prototype._requestDiscard=function(e,t){this.write(tI.default.discard({stmtId:e}),t,!0)},pI.prototype._noOp=function(){},pI.prototype.requestRoutingInformation=function(e){var t,r=e.routingContext,n=e.databaseName,n=void 0===n?null:n,o=e.sessionContext,o=void 0===o?{}:o,i=e.onError,e=e.onCompleted,r=this.run(fI,((t={})[cI]=void 0===r?{}:r,t[lI]=n,t),eI(eI({},o),{txConfig:sI.empty()}));return new nI.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:i,onCompleted:e})},pI);function pI(){return null!==JC&&JC.apply(this,arguments)||this}Pv.default=Zv;var dI,hI,Jv={},gh={},bI=r&&r.__assign||function(){return(bI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ny=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},tm=(Object.defineProperty(gh,"__esModule",{value:!0}),ny(Tv)),um=(gh.default=bI({},tm.default),r&&r.__extends||(dI=function(e,t){return(dI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}dI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),cm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},g=(Object.defineProperty(Jv,"__esModule",{value:!0}),cm(Pv)),yI=cm(wy),_I=R,vm=e,vI=cm(gh),mI=cm(zy),gI=vm.internal.constants.BOLT_PROTOCOL_V4_1,rb=(hI=g.default,um(OI,hI),Object.defineProperty(OI.prototype,"version",{get:function(){return gI},enumerable:!1,configurable:!0}),Object.defineProperty(OI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new mI.default(Object.values(vI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),OI.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new _I.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return t._onLoginCompleted(e,i)}});return this.write(yI.default.hello(r,n,this._serversideRouting),e,!0),e},OI);function OI(e,t,r,n,o,i,u){e=hI.call(this,e,t,r,n=void 0===n?function(){return null}:n,o,i)||this;return e._serversideRouting=u,e}Jv.default=rb;var wI,EI,wm={},Ka={},PI=r&&r.__assign||function(){return(PI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},jm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},As=(Object.defineProperty(Ka,"__esModule",{value:!0}),jm(gh)),ud=(Ka.default=PI({},As.default),r&&r.__extends||(wI=function(e,t){return(wI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}wI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),h=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Lm=(Object.defineProperty(wm,"__esModule",{value:!0}),h(Jv)),qm=e,SI=h(Ka),TI=h(zy),jI=qm.internal.constants.BOLT_PROTOCOL_V4_2,ms=(EI=Lm.default,ud(CI,EI),Object.defineProperty(CI.prototype,"version",{get:function(){return jI},enumerable:!1,configurable:!0}),Object.defineProperty(CI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new TI.default(Object.values(SI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),CI);function CI(){return null!==EI&&EI.apply(this,arguments)||this}wm.default=ms;var y={},l0={},II=r&&r.__assign||function(){return(II=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},T=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},O=(Object.defineProperty(l0,"__esModule",{value:!0}),T(Ka)),C=(l0.default=II({},O.default),{}),n={},RI=r&&r.__assign||function(){return(RI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},b=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yu=(Object.defineProperty(n,"__esModule",{value:!0}),b(l0)),kI=(n.default=RI({},yu.default),r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}),lr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},AI=(Object.defineProperty(C,"__esModule",{value:!0}),Bf),MI=e,xI=lr(n),NI=a_,UI=Db,DI=MI.internal.temporalUtil.localDateTimeToEpochSecond;function LI(e,t,r){e=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,era:"narrow"}),r=(0,MI.int)(t).multiply(1e3).add((0,MI.int)(r).div(1e6)).toNumber(),e=e.formatToParts(r).reduce(function(e,t){return"era"===t.type?e.adjustEra="B"===t.value.toUpperCase()?function(e){return e.subtract(1).negate()}:UI.identity:"literal"!==t.type&&(e[t.type]=(0,MI.int)(t.value)),e},{}),e.year=e.adjustEra(e.year),r=DI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond);return e.timeZoneOffsetSeconds=r.subtract(t),e.hour=e.hour.modulo(24),e}function BI(e,t,r){if(!t&&!r)return e;var n,o,i,u=Object.create(Object.getPrototypeOf(e));for(n in e)!0===Object.prototype.hasOwnProperty.call(e,n)&&(o=e[n],u[n]=(0,MI.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}C.default={createDateTimeWithZoneIdTransformer:function(e,u){var n=e.disableLosslessIntegers,o=e.useBigInt;return xI.default.createDateTimeWithZoneIdTransformer(e).extendsWith({signature:105,fromStructure:function(e){AI.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=kI(e.fields,3),t=e[0],r=e[1],e=e[2],t=LI(e,t,r);return BI(new MI.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,(0,MI.int)(r),t.timeZoneOffsetSeconds,e),n,o)},toStructure:function(e){var t=DI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=null!=e.timeZoneOffsetSeconds?e.timeZoneOffsetSeconds:(r=e.timeZoneId,i=t,o=e.nanosecond,n=LI(r,i,o),n=DI(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i),i=i.subtract(n),n=LI(r,i,o),DI(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i)),n=(null==e.timeZoneOffsetSeconds&&u.warn('DateTime objects without "timeZoneOffsetSeconds" property are prune to bugs related to ambiguous times. For instance, 2022-10-30T2:30:00[Europe/Berlin] could be GMT+1 or GMT+2.'),t.subtract(r)),o=(0,MI.int)(e.nanosecond),i=e.timeZoneId;return new AI.structure.Structure(105,[n,o,i])}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return xI.default.createDateTimeWithOffsetTransformer(e).extendsWith({signature:73,toStructure:function(e){var t=DI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,MI.int)(e.nanosecond),e=(0,MI.int)(e.timeZoneOffsetSeconds),t=t.subtract(e);return new AI.structure.Structure(73,[t,r,e])},fromStructure:function(e){AI.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=kI(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,MI.int)(t).add(e),t=(0,NI.epochSecondAndNanoToLocalDateTime)(t,r);return BI(new MI.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}};var FI,WI,s=r&&r.__extends||(FI=function(e,t){return(FI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}FI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),zI=r&&r.__assign||function(){return(zI=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Yu=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gu=(Object.defineProperty(y,"__esModule",{value:!0}),Yu(wm)),qI=Yu(wy),VI=R,HI=Yu(l0),YI=Yu(C),KI=Yu(zy),GI=e.internal.bookmarks.Bookmarks,ZI=e.internal.constants.BOLT_PROTOCOL_V4_3,ua=(WI=gu.default,s(QI,WI),Object.defineProperty(QI.prototype,"version",{get:function(){return ZI},enumerable:!1,configurable:!0}),Object.defineProperty(QI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new KI.default(Object.values(HI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),QI.prototype.requestRoutingInformation=function(e){var t=e.routingContext,t=void 0===t?{}:t,r=e.databaseName,r=void 0===r?null:r,n=e.sessionContext,n=void 0===n?{}:n,o=e.onError,e=e.onCompleted,o=new VI.RouteObserver({onProtocolError:this._onProtocolError,onError:o,onCompleted:e}),e=n.bookmarks||GI.empty();return this.write(qI.default.route(t,e.values(),r),o,!0),o},QI.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new VI.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return void 0!==e.patch_bolt&&t._applyPatches(e.patch_bolt),t._onLoginCompleted(e,i)}});return this.write(qI.default.hello(r,n,this._serversideRouting,["utc"]),e,!0),e},QI.prototype._applyPatches=function(e){e.includes("utc")&&this._applyUtcPatch()},QI.prototype._applyUtcPatch=function(){var t=this;this._transformer=new KI.default(Object.values(zI(zI({},HI.default),YI.default)).map(function(e){return e(t._config,t._log)}))},QI);function QI(){return null!==WI&&WI.apply(this,arguments)||this}y.default=ua;var XI,JI,ra={},_=r&&r.__extends||(XI=function(e,t){return(XI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}XI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),$I=r&&r.__assign||function(){return($I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ou=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Cu=(Object.defineProperty(ra,"__esModule",{value:!0}),Ou(y)),Mr=e,eR=Ou(wy),tR=R,rR=Ou(n),nR=Ou(C),oR=Ou(zy),st=Mr.internal.constants,iR=st.BOLT_PROTOCOL_V4_4,uR=st.FETCH_ALL,aR=Mr.internal.bookmarks.Bookmarks,Wa=(JI=Cu.default,_(sR,JI),Object.defineProperty(sR.prototype,"version",{get:function(){return iR},enumerable:!1,configurable:!0}),Object.defineProperty(sR.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new oR.default(Object.values(rR.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),sR.prototype.requestRoutingInformation=function(e){var t=e.routingContext,t=void 0===t?{}:t,r=e.databaseName,r=void 0===r?null:r,n=e.impersonatedUser,n=void 0===n?null:n,o=e.sessionContext,o=void 0===o?{}:o,i=e.onError,e=e.onCompleted,i=new tR.RouteObserver({onProtocolError:this._onProtocolError,onError:i,onCompleted:e}),e=o.bookmarks||aR.empty();return this.write(eR.default.routeV4x4(t,e.values(),{databaseName:r,impersonatedUser:n}),i,!0),i},sR.prototype.run=function(e,t,r){var r=void 0===r?{}:r,n=r.bookmarks,o=r.txConfig,i=r.database,u=r.mode,a=r.impersonatedUser,s=r.beforeKeys,c=r.afterKeys,l=r.beforeError,f=r.afterError,p=r.beforeComplete,d=r.afterComplete,h=r.flush,h=void 0===h||h,b=r.reactive,b=void 0!==b&&b,y=r.fetchSize,y=void 0===y?uR:y,_=r.highRecordWatermark,_=void 0===_?Number.MAX_VALUE:_,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,s=new tR.ResultStreamObserver({server:this._server,reactive:b,fetchSize:y,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:s,afterKeys:c,beforeError:l,afterError:f,beforeComplete:p,afterComplete:d,highRecordWatermark:_,lowRecordWatermark:r}),c=b;return this.write(eR.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a}),s,c&&h),b||this.write(eR.default.pull({n:y}),s,h),s},sR.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.mode,i=e.impersonatedUser,u=e.beforeError,a=e.afterError,s=e.beforeComplete,e=e.afterComplete,u=new tR.ResultStreamObserver({server:this._server,beforeError:u,afterError:a,beforeComplete:s,afterComplete:e});return u.prepareToHandleSingleResponse(),this.write(eR.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i}),u,!0),u},sR.prototype._applyUtcPatch=function(){var t=this;this._transformer=new oR.default(Object.values($I($I({},rR.default),nR.default)).map(function(e){return e(t._config,t._log)}))},sR);function sR(){return null!==JI&&JI.apply(this,arguments)||this}ra.default=Wa;var Ws={},p={},cR=r&&r.__assign||function(){return(cR=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},lR=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},xa=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},fR=(Object.defineProperty(p,"__esModule",{value:!0}),Bf),pR=e,dR=xa(n),Cs=xa(C);p.default=cR(cR(cR({},dR.default),Cs.default),{createNodeTransformer:function(e){return dR.default.createNodeTransformer(e).extendsWith({fromStructure:function(e){fR.structure.verifyStructSize("Node",4,e.size);var e=lR(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new pR.Node(t,r,n,e)}})},createRelationshipTransformer:function(e){return dR.default.createRelationshipTransformer(e).extendsWith({fromStructure:function(e){fR.structure.verifyStructSize("Relationship",8,e.size);var e=lR(e.fields,8),t=e[0],r=e[1],n=e[2],o=e[3],i=e[4],u=e[5],a=e[6],e=e[7];return new pR.Relationship(t,r,n,o,i,u,a,e)}})},createUnboundRelationshipTransformer:function(e){return dR.default.createUnboundRelationshipTransformer(e).extendsWith({fromStructure:function(e){fR.structure.verifyStructSize("UnboundRelationship",4,e.size);var e=lR(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new pR.UnboundRelationship(t,r,n,e)}})}});var hR,bR,Ua=r&&r.__extends||(hR=function(e,t){return(hR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}hR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),za=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},m=(Object.defineProperty(Ws,"__esModule",{value:!0}),za(ra)),yR=za(p),_R=za(zy),vR=za(wy),mR=R,gR=e.internal.constants.BOLT_PROTOCOL_V5_0,Ba=(bR=m.default,Ua(OR,bR),Object.defineProperty(OR.prototype,"version",{get:function(){return gR},enumerable:!1,configurable:!0}),Object.defineProperty(OR.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new _R.default(Object.values(yR.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),OR.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.authToken,o=e.onError,i=e.onComplete,e=new mR.LoginObserver({onError:function(e){return t._onLoginError(e,o)},onCompleted:function(e){return t._onLoginCompleted(e,i)}});return this.write(vR.default.hello(r,n,this._serversideRouting),e,!0),e},OR);function OR(){return null!==bR&&bR.apply(this,arguments)||this}Ws.default=Ba;var Hc={},wR=(Object.defineProperty(Hc,"__esModule",{value:!0}),e);function ER(){}function PR(e){return e}var SR={onNext:ER,onCompleted:ER,onError:ER};function TR(e){var e=void 0===e?{}:e,t=e.transformMetadata,r=e.log,e=e.observer;this._pendingObservers=[],this._log=r,this._transformMetadata=t||PR,this._observer=Object.assign({onPendingObserversChange:ER,onError:ER,onFailure:ER,onErrorApplyTransformation:PR},e)}Object.defineProperty(TR.prototype,"currentFailure",{get:function(){return this._currentFailure},enumerable:!1,configurable:!0}),TR.prototype.handleResponse=function(e){var t=e.fields[0];switch(e.signature){case 113:this._log.isDebugEnabled()&&this._log.debug("S: RECORD ".concat(wR.json.stringify(e))),this._currentObserver.onNext(t);break;case 112:this._log.isDebugEnabled()&&this._log.debug("S: SUCCESS ".concat(wR.json.stringify(e)));try{var r=this._transformMetadata(t);this._currentObserver.onCompleted(r)}finally{this._updateCurrentObserver()}break;case 127:this._log.isDebugEnabled()&&this._log.debug("S: FAILURE ".concat(wR.json.stringify(e)));try{var n=function(e){{if("Neo.TransientError.Transaction.Terminated"===e)return"Neo.ClientError.Transaction.Terminated";if("Neo.TransientError.Transaction.LockClientStopped"===e)return"Neo.ClientError.Transaction.LockClientStopped"}return e}(t.code),o=(0,wR.newError)(t.message,n);this._currentFailure=this._observer.onErrorApplyTransformation(o),this._currentObserver.onError(this._currentFailure)}finally{this._updateCurrentObserver(),this._observer.onFailure(this._currentFailure)}break;case 126:this._log.isDebugEnabled()&&this._log.debug("S: IGNORED ".concat(wR.json.stringify(e)));try{this._currentFailure&&this._currentObserver.onError?this._currentObserver.onError(this._currentFailure):this._currentObserver.onError&&this._currentObserver.onError((0,wR.newError)("Ignored either because of an error or RESET"))}finally{this._updateCurrentObserver()}break;default:this._observer.onError((0,wR.newError)("Unknown Bolt protocol message: "+e))}},TR.prototype._updateCurrentObserver=function(){this._currentObserver=this._pendingObservers.shift(),this._observer.onPendingObserversChange(this._pendingObservers.length)},TR.prototype._queueObserver=function(e){return(e=e||SR).onCompleted=e.onCompleted||ER,e.onError=e.onError||ER,e.onNext=e.onNext||ER,void 0===this._currentObserver?this._currentObserver=e:this._pendingObservers.push(e),this._observer.onPendingObserversChange(this._pendingObservers.length),!0},TR.prototype._notifyErrorToObservers=function(e){for(this._currentObserver&&this._currentObserver.onError&&this._currentObserver.onError(e);0<this._pendingObservers.length;){var t=this._pendingObservers.shift();t&&t.onError&&t.onError(e)}},TR.prototype.hasOngoingObservableRequests=function(){return null!=this._currentObserver||0<this._pendingObservers.length},TR.prototype._resetFailure=function(){this._currentFailure=null},Hc.default=TR;var jR,Jc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},CR=(Object.defineProperty(Jd,"__esModule",{value:!0}),e),IR=Jc($d),RR=Jc(t_),kR=Jc(E),AR=Jc(Pv),MR=Jc(Jv),xR=Jc(wm),NR=Jc(y),UR=Jc(ra),DR=Jc(Ws),LR=Jc(Hc);Jd.default=function(e){var t=(e=void 0===e?{}:e).version,r=e.chunker,n=e.dechunker,o=e.channel,i=e.disableLosslessIntegers,u=e.useBigInt,a=e.serversideRouting,s=e.server,c=e.log,l=e.observer,f=t,p=s,d=r,h={disableLosslessIntegers:i,useBigInt:u},b=a,y=function(t){var r=new LR.default({transformMetadata:t.transformMetadata.bind(t),log:c,observer:l});return o.onerror=l.onError.bind(l),o.onmessage=function(e){return n.write(e)},n.onmessage=function(e){try{r.handleResponse(t.unpack(e))}catch(e){return l.onError(e)}},r},_=l.onProtocolError.bind(l),v=c;switch(f){case 1:return new IR.default(p,d,h,y,v,_);case 2:return new RR.default(p,d,h,y,v,_);case 3:return new kR.default(p,d,h,y,v,_);case 4:return new AR.default(p,d,h,y,v,_);case 4.1:return new MR.default(p,d,h,y,v,_,b);case 4.2:return new xR.default(p,d,h,y,v,_,b);case 4.3:return new NR.default(p,d,h,y,v,_,b);case 4.4:return new UR.default(p,d,h,y,v,_,b);case 5:return new DR.default(p,d,h,y,v,_,b);default:throw(0,CR.newError)("Unknown Bolt protocol version: "+f)}},Ma=a,jR=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),xs=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||jR(t,e,r)},o=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.RawRoutingTable=Ma.BoltProtocol=void 0,jf=o(ll),Nf=o(Jd),Df=o(y),o=o(bh),xs(R,Ma),Ma.BoltProtocol=Df.default,Ma.RawRoutingTable=o.default,Ma.default={handshake:jf.default,create:Nf.default};Xf={},Aa={},Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.DEFAULT_ACQUISITION_TIMEOUT=Aa.DEFAULT_MAX_SIZE=void 0,Aa.DEFAULT_MAX_SIZE=100,Aa.DEFAULT_ACQUISITION_TIMEOUT=6e4,BR.defaultConfig=function(){return new BR(100,6e4)},BR.fromDriverConfig=function(e){return new BR(WR(e.maxConnectionPoolSize)?e.maxConnectionPoolSize:100,WR(e.connectionAcquisitionTimeout)?e.connectionAcquisitionTimeout:6e4)},Hf=BR;function BR(e,t){this.maxSize=FR(e,100),this.acquisitionTimeout=FR(t,6e4)}function FR(e,t){return 0===e||e?e:t}function WR(e){return 0===e||e}Aa.default=Hf;var df={},zR=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},qR=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},ep=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},VR=(Object.defineProperty(df,"__esModule",{value:!0}),ep(Aa)),HR=e,YR=HR.internal.logger.Logger,ka=(KR.prototype.acquire=function(o){var i=this,u=o.asKey(),a=this._acquireRequests;return a[u]||(a[u]=[]),new Promise(function(e,t){var r=null,n=setTimeout(function(){var e,t=a[u];t&&(a[u]=t.filter(function(e){return e!==r})),r.isCompleted()||(t=i.activeResourceCount(o),e=i.has(o)?i._pools[u].length:0,r.reject((0,HR.newError)("Connection acquisition timed out in ".concat(i._acquisitionTimeout," ms. Pool status: Active conn count = ").concat(t,", Idle conn count = ").concat(e,"."))))},i._acquisitionTimeout),r=new ZR(u,e,t,n,i._log);a[u].push(r),i._processPendingAcquireRequests(o)})},KR.prototype.purge=function(e){return this._purgeKey(e.asKey())},KR.prototype.close=function(){return zR(this,void 0,void 0,function(){var t=this;return qR(this,function(e){switch(e.label){case 0:return this._closed=!0,[4,Promise.all(Object.keys(this._pools).map(function(e){return t._purgeKey(e)}))];case 1:return[2,e.sent()]}})})},KR.prototype.keepAll=function(e){var t=this,r=e.map(function(e){return e.asKey()}),e=Object.keys(this._pools).filter(function(e){return-1===r.indexOf(e)});return Promise.all(e.map(function(e){return t._purgeKey(e)}))},KR.prototype.has=function(e){return e.asKey()in this._pools},KR.prototype.activeResourceCount=function(e){return this._activeResourceCounts[e.asKey()]||0},KR.prototype._getOrInitializePoolFor=function(e){var t=this._pools[e];return t||(t=new ek,this._pools[e]=t,this._pendingCreates[e]=0),t},KR.prototype._acquire=function(u){return zR(this,void 0,void 0,function(){var t,r,n,o,i=this;return qR(this,function(e){switch(e.label){case 0:if(this._closed)throw(0,HR.newError)("Pool is closed, it is no more able to serve requests.");t=u.asKey(),r=this._getOrInitializePoolFor(t),e.label=1;case 1:return r.length?(n=r.pop(),this._validate(n)?(this._removeIdleObserver&&this._removeIdleObserver(n),GR(t,this._activeResourceCounts),this._log.isDebugEnabled()&&this._log.debug("".concat(n," acquired from the pool ").concat(t)),[2,{resource:n,pool:r}]):[3,2]):[3,5];case 2:return[4,this._destroy(n)];case 3:e.sent(),e.label=4;case 4:return[3,1];case 5:if(0<this._maxSize&&this.activeResourceCount(u)+this._pendingCreates[t]>=this._maxSize)return[2,{resource:null,pool:r}];this._pendingCreates[t]=this._pendingCreates[t]+1,e.label=6;case 6:return e.trys.push([6,,8,9]),[4,this._create(u,function(e,t){return i._release(e,t,r)})];case 7:return o=e.sent(),GR(t,this._activeResourceCounts),this._log.isDebugEnabled()&&this._log.debug("".concat(o," created for the pool ").concat(t)),[3,9];case 8:return this._pendingCreates[t]=this._pendingCreates[t]-1,[7];case 9:return[2,{resource:o,pool:r}]}})})},KR.prototype._release=function(u,a,s){return zR(this,void 0,void 0,function(){var o,i=this;return qR(this,function(e){switch(e.label){case 0:return(o=u.asKey(),s.isActive())?this._validate(a)?[3,2]:(this._log.isDebugEnabled()&&this._log.debug("".concat(a," destroyed and can't be released to the pool ").concat(o," because it is not functional")),[4,this._destroy(a)]):[3,4];case 1:return e.sent(),[3,3];case 2:this._installIdleObserver&&this._installIdleObserver(a,{onError:function(e){i._log.debug("Idle connection ".concat(a," destroyed because of error: ").concat(e));e=i._pools[o];e&&(i._pools[o]=e.filter(function(e){return e!==a})),i._destroy(a).catch(function(){})}}),s.push(a),this._log.isDebugEnabled()&&this._log.debug("".concat(a," released to the pool ").concat(o)),e.label=3;case 3:return[3,6];case 4:return this._log.isDebugEnabled()&&this._log.debug("".concat(a," destroyed and can't be released to the pool ").concat(o," because pool has been purged")),[4,this._destroy(a)];case 5:e.sent(),e.label=6;case 6:return t=o,r=this._activeResourceCounts,0<(n=(r[t]||0)-1)?r[t]=n:delete r[t],this._processPendingAcquireRequests(u),[2]}var t,r,n})})},KR.prototype._purgeKey=function(o){return zR(this,void 0,void 0,function(){var t,r,n;return qR(this,function(e){switch(e.label){case 0:if(t=this._pools[o],r=[],!t)return[3,2];for(;t.length;)n=t.pop(),this._removeIdleObserver&&this._removeIdleObserver(n),r.push(this._destroy(n));return t.close(),delete this._pools[o],[4,Promise.all(r)];case 1:e.sent(),e.label=2;case 2:return[2]}})})},KR.prototype._processPendingAcquireRequests=function(r){var n,o=this,i=r.asKey(),e=this._acquireRequests[i];e&&((n=e.shift())?this._acquire(r).catch(function(e){return n.reject(e),{resource:null}}).then(function(e){var t=e.resource,e=e.pool;t?n.isCompleted()?o._release(r,t,e):n.resolve(t):n.isCompleted()||(o._acquireRequests[i]||(o._acquireRequests[i]=[]),o._acquireRequests[i].unshift(n))}):delete this._acquireRequests[i])},KR);function KR(e){var e=void 0===e?{}:e,t=e.create,t=void 0===t?function(e,t){return Promise.resolve()}:t,r=e.destroy,r=void 0===r?function(e){return Promise.resolve()}:r,n=e.validate,n=void 0===n?function(e){return!0}:n,o=e.installIdleObserver,o=void 0===o?function(e,t){}:o,i=e.removeIdleObserver,i=void 0===i?function(e){}:i,u=e.config,u=void 0===u?VR.default.defaultConfig():u,e=e.log,e=void 0===e?YR.noOp():e;this._create=t,this._destroy=r,this._validate=n,this._installIdleObserver=o,this._removeIdleObserver=i,this._maxSize=u.maxSize,this._acquisitionTimeout=u.acquisitionTimeout,this._pools={},this._pendingCreates={},this._acquireRequests={},this._activeResourceCounts={},this._release=this._release.bind(this),this._log=e,this._closed=!1}function GR(e,t){var r=t[e]||0;t[e]=r+1}QR.prototype.isCompleted=function(){return this._completed},QR.prototype.resolve=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._log.isDebugEnabled()&&this._log.debug("".concat(e," acquired from the pool ").concat(this._key)),this._resolve(e))},QR.prototype.reject=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._reject(e))};var ZR=QR;function QR(e,t,r,n,o){this._key=e,this._resolve=t,this._reject=r,this._timeoutId=n,this._log=o,this._completed=!1}tk.prototype.isActive=function(){return this._active},tk.prototype.close=function(){this._active=!1},tk.prototype.filter=function(e){return this._elements=this._elements.filter(e),this},Object.defineProperty(tk.prototype,"length",{get:function(){return this._elements.length},enumerable:!1,configurable:!0}),tk.prototype.pop=function(){return this._elements.pop()},tk.prototype.push=function(e){return this._elements.push(e)};var XR,JR,$R,ek=tk;function tk(){this._active=!0,this._elements=[]}df.default=ka,j=Xf,XR=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),JR=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Tf=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&XR(t,e,r);return JR(t,e),t},Dl=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(j,"__esModule",{value:!0}),j.DEFAULT_MAX_SIZE=j.DEFAULT_ACQUISITION_TIMEOUT=j.PoolConfig=j.Pool=void 0,$R=Tf(Aa),j.PoolConfig=$R.default,Object.defineProperty(j,"DEFAULT_ACQUISITION_TIMEOUT",{enumerable:!0,get:function(){return $R.DEFAULT_ACQUISITION_TIMEOUT}}),Object.defineProperty(j,"DEFAULT_MAX_SIZE",{enumerable:!0,get:function(){return $R.DEFAULT_MAX_SIZE}}),Tf=Dl(df),j.Pool=Tf.default,j.default=Tf.default;var rk,S={},op={},dp=r&&r.__extends||(rk=function(e,t){return(rk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}rk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(op,"__esModule",{value:!0});dp(ok,nk=e.ConnectionProvider),ok.prototype.acquireConnection=function(e){e=void 0===e?{}:e,e.accessMode,e.database,e.bookmarks,e=this._connection;return this._connection=null,Promise.resolve(e)};var nk,yn=ok;function ok(e){var t=nk.call(this)||this;return t._connection=e,t}op.default=yn;Cf={},hp={},Sa={};function ik(e){this._errorHandler=e}Object.defineProperty(Sa,"__esModule",{value:!0}),Object.defineProperty(ik.prototype,"id",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"databaseId",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),ik.prototype.isOpen=function(){throw new Error("not implemented")},ik.prototype.protocol=function(){throw new Error("not implemented")},Object.defineProperty(ik.prototype,"address",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"version",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"server",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),ik.prototype.connect=function(e,t){throw new Error("not implemented")},ik.prototype.write=function(e,t,r){throw new Error("not implemented")},ik.prototype.resetAndFlush=function(){throw new Error("not implemented")},ik.prototype.hasOngoingObservableRequests=function(){throw new Error("not implemented")},ik.prototype.close=function(){throw new Error("not implemented")},ik.prototype.handleAndTransformError=function(e,t){return this._errorHandler?this._errorHandler.handleAndTransformError(e,t):e},Sa.default=ik;var uk,wp={},Lf=r&&r.__extends||(uk=function(e,t){return(uk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}uk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ak=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},sk=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},jp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ck=(Object.defineProperty(wp,"__esModule",{value:!0}),wp.createChannelConnection=void 0,Il),lk=e,vp=jp(Sa),fk=jp(a),pk=lk.error.PROTOCOL_ERROR,dk=lk.internal.logger.Logger,hk=0;wp.createChannelConnection=function(i,u,a,s,c,e){void 0===c&&(c=null);var l=(e=void 0===e?function(e){return new ck.Channel(e)}:e)(new ck.ChannelConfig(i,u,a.errorCode()));return fk.default.handshake(l).then(function(e){var r=e.protocolVersion,e=e.consumeRemainingBuffer,n=new ck.Chunker(l),o=new ck.Dechunker,t=new yk(l,a,i,s,u.disableLosslessIntegers,c,n,function(t){return fk.default.create({version:r,channel:l,chunker:n,dechunker:o,disableLosslessIntegers:u.disableLosslessIntegers,useBigInt:u.useBigInt,serversideRouting:c,server:t.server,log:t.logger,observer:{onPendingObserversChange:t._handleOngoingRequestsNumberChange.bind(t),onError:t._handleFatalError.bind(t),onFailure:t._resetOnFailure.bind(t),onProtocolError:t._handleProtocolError.bind(t),onErrorApplyTransformation:function(e){return t.handleAndTransformError(e,t._address)}}})});return e(function(e){return o.write(e)}),t}).catch(function(e){return l.close().then(function(){throw e})})};bk=vp.default,Lf(_k,bk),Object.defineProperty(_k.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"databaseId",{get:function(){return this._dbConnectionId},set:function(e){this._dbConnectionId=e},enumerable:!1,configurable:!0}),_k.prototype.connect=function(e,t){return this._initialize(e,t)},_k.prototype._initialize=function(e,n){var o=this,i=this;return new Promise(function(r,t){o._protocol.initialize({userAgent:e,authToken:n,onError:function(e){return t(e)},onComplete:function(e){var t;e&&(t=e.server,o.version&&!t||(o.version=t),t=e.connection_id,o.databaseId||(o.databaseId=t),e.hints&&null!=(t=e.hints["connection.recv_timeout_seconds"])&&(e=(0,lk.toNumber)(t),Number.isInteger(e)&&0<e?o._ch.setupReceiveTimeout(1e3*e):o._log.info("Server located at ".concat(o._address," supplied an invalid connection receive timeout value (").concat(e,"). ")+"Please, verify the server configuration and status because this can be the symptom of a bigger issue."))),r(i)}})})},_k.prototype.protocol=function(){return this._protocol},Object.defineProperty(_k.prototype,"address",{get:function(){return this._address},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"version",{get:function(){return this._server.version},set:function(e){this._server.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"server",{get:function(){return this._server},enumerable:!1,configurable:!0}),Object.defineProperty(_k.prototype,"logger",{get:function(){return this._log},enumerable:!1,configurable:!0}),_k.prototype._handleFatalError=function(e){this._isBroken=!0,this._error=this.handleAndTransformError(this._protocol.currentFailure||e,this._address),this._log.isErrorEnabled()&&this._log.error("experienced a fatal error caused by ".concat(this._error," (").concat(lk.json.stringify(this._error),")")),this._protocol.notifyFatalError(this._error)},_k.prototype._queueObserver=function(e){return this._protocol.queueObserverIfProtocolIsNotBroken(e)},_k.prototype.hasOngoingObservableRequests=function(){return this._protocol.hasOngoingObservableRequests()},_k.prototype.resetAndFlush=function(){var r=this;return new Promise(function(e,t){r._reset({onError:function(e){r._isBroken?t(e):(e=r._handleProtocolError("Received FAILURE as a response for RESET: "+e),t(e))},onComplete:function(){e()}})})},_k.prototype._resetOnFailure=function(){var e=this;this.isOpen()&&this._reset({onError:function(){e._protocol.resetFailure()},onComplete:function(){e._protocol.resetFailure()}})},_k.prototype._reset=function(t){var e,r=this;this._reseting?this._protocol.isLastMessageReset()?this._resetObservers.push(t):this._protocol.reset({onError:function(e){t.onError(e)},onComplete:function(){t.onComplete()}}):(this._resetObservers.push(t),this._reseting=!0,e=function(e){r._reseting=!1;var t=r._resetObservers;r._resetObservers=[],t.forEach(e)},this._protocol.reset({onError:function(t){e(function(e){return e.onError(t)})},onComplete:function(){e(function(e){return e.onComplete()})}}))},_k.prototype._updateCurrentObserver=function(){this._protocol.updateCurrentObserver()},_k.prototype.isOpen=function(){return!this._isBroken&&this._ch._open},_k.prototype._handleOngoingRequestsNumberChange=function(e){0===e?this._ch.stopReceiveTimeout():this._ch.startReceiveTimeout()},_k.prototype.close=function(){return ak(this,void 0,void 0,function(){return sk(this,function(e){switch(e.label){case 0:return this._log.isDebugEnabled()&&this._log.debug("closing"),this._protocol&&this.isOpen()&&this._protocol.prepareToClose(),[4,this._ch.close()];case 1:return e.sent(),this._log.isDebugEnabled()&&this._log.debug("closed"),[2]}})})},_k.prototype.toString=function(){return"Connection [".concat(this.id,"][").concat(this.databaseId||"","]")},_k.prototype._handleProtocolError=function(e){this._protocol.resetFailure(),this._updateCurrentObserver();e=(0,lk.newError)(e,pk);return this._handleFatalError(e),e};var bk,yk=_k;function _k(e,t,r,n,o,i,u,a){void 0===o&&(o=!1),void 0===i&&(i=null);var s,c,t=bk.call(this,t)||this;return t._reseting=!1,t._resetObservers=[],t._id=hk++,t._address=r,t._server={address:r.asHostPort()},t.creationTimestamp=Date.now(),t._disableLosslessIntegers=o,t._ch=e,t._chunker=u,t._log=(s=t,new dk((c=n)._level,function(e,t){return c._loggerFunction(e,"".concat(s," ").concat(t))})),t._serversideRouting=i,t._dbConnectionId=null,t._protocol=a(t),t._isBroken=!1,t._log.isDebugEnabled()&&t._log.debug("created towards ".concat(r)),t}wp.default=yk;var vk,mk,Ap={},Zp=r&&r.__extends||(vk=function(e,t){return(vk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}vk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),od=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ed=(Object.defineProperty(Ap,"__esModule",{value:!0}),od(Sa)),zd=(mk=ed.default,Zp(gk,mk),Object.defineProperty(gk.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(gk.prototype,"databaseId",{get:function(){return this._delegate.databaseId},set:function(e){this._delegate.databaseId=e},enumerable:!1,configurable:!0}),Object.defineProperty(gk.prototype,"server",{get:function(){return this._delegate.server},enumerable:!1,configurable:!0}),Object.defineProperty(gk.prototype,"address",{get:function(){return this._delegate.address},enumerable:!1,configurable:!0}),Object.defineProperty(gk.prototype,"version",{get:function(){return this._delegate.version},set:function(e){this._delegate.version=e},enumerable:!1,configurable:!0}),gk.prototype.isOpen=function(){return this._delegate.isOpen()},gk.prototype.protocol=function(){return this._delegate.protocol()},gk.prototype.connect=function(e,t){return this._delegate.connect(e,t)},gk.prototype.write=function(e,t,r){return this._delegate.write(e,t,r)},gk.prototype.resetAndFlush=function(){return this._delegate.resetAndFlush()},gk.prototype.hasOngoingObservableRequests=function(){return this._delegate.hasOngoingObservableRequests()},gk.prototype.close=function(){return this._delegate.close()},gk.prototype._release=function(){return this._originalErrorHandler&&(this._delegate._errorHandler=this._originalErrorHandler),this._delegate._release()},gk);function gk(e,t){var r=mk.call(this,t)||this;return t&&(r._originalErrorHandler=e._errorHandler,e._errorHandler=r._errorHandler),r._delegate=e,r}Ap.default=zd;fl={};Object.defineProperty(fl,"__esModule",{value:!0});var Ok,wk,Ek,Pk=e.error.SERVICE_UNAVAILABLE,Sk=e.error.SESSION_EXPIRED;function Tk(e,t,r,n){this._errorCode=e,this._handleUnavailability=t||jk,this._handleWriteFailure=r||jk,this._handleAuthorizationExpired=n||jk}function jk(e){return e}Tk.create=function(e){return new Tk(e.errorCode,e.handleUnavailability,e.handleWriteFailure,e.handleAuthorizationExpired)},Tk.prototype.errorCode=function(){return this._errorCode},Tk.prototype.handleAndTransformError=function(e,t){return!(r=e)||"Neo.ClientError.Security.AuthorizationExpired"!==r.code&&"Neo.ClientError.Security.TokenExpired"!==r.code?function(e){if(e)return e.code===Sk||e.code===Pk||"Neo.TransientError.General.DatabaseUnavailable"===e.code;return}(e)?this._handleUnavailability(e,t):function(e){if(e)return"Neo.ClientError.Cluster.NotALeader"===e.code||"Neo.ClientError.General.ForbiddenOnReadOnlyDatabase"===e.code;return}(e)?this._handleWriteFailure(e,t):e:this._handleAuthorizationExpired(e,t);var r},fl.default=Tk,wd=hp,Ok=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),wk=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Cc=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Ok(t,e,r);return wk(t,e),t},Kc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(wd,"__esModule",{value:!0}),wd.createChannelConnection=wd.ConnectionErrorHandler=wd.DelegateConnection=wd.ChannelConnection=wd.Connection=void 0,Ed=Kc(Sa),wd.Connection=Ed.default,Ek=Cc(wp),wd.ChannelConnection=Ek.default,Object.defineProperty(wd,"createChannelConnection",{enumerable:!0,get:function(){return Ek.createChannelConnection}}),Cc=Kc(Ap),wd.DelegateConnection=Cc.default,Cc=Kc(fl),wd.ConnectionErrorHandler=Cc.default,wd.default=Ed.default;var Ck,Ik,Rl=r&&r.__extends||(Ck=function(e,t){return(Ck=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ck(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Rk=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),kk=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Wd=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Rk(t,e,r);return kk(t,e),t},Ak=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},Mk=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},xk=(Object.defineProperty(Cf,"__esModule",{value:!0}),hp),Nk=Wd(Xf),Uk=e,Dk=Uk.error.SERVICE_UNAVAILABLE,I=(Ik=Uk.ConnectionProvider,Rl(Lk,Ik),Lk.prototype._createConnectionErrorHandler=function(){return new xk.ConnectionErrorHandler(Dk)},Lk.prototype._createConnection=function(e,r){var n=this;return this._createChannelConnection(e).then(function(t){return t._release=function(){return r(e,t)},(n._openConnections[t.id]=t).connect(n._userAgent,n._authToken).catch(function(e){throw n._destroyConnection(t),e})})},Lk.prototype._validateConnection=function(e){if(!e.isOpen())return!1;var t=this._config.maxConnectionLifetime;return Date.now()-e.creationTimestamp<=t},Lk.prototype._destroyConnection=function(e){return delete this._openConnections[e.id],e.close()},Lk.prototype._verifyConnectivityAndGetServerVersion=function(e){var n=e.address;return Ak(this,void 0,void 0,function(){var t,r;return Mk(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.acquire(n)];case 1:t=e.sent(),r=new Uk.ServerInfo(t.server,t.protocol().version),e.label=2;case 2:return e.trys.push([2,,5,7]),t.protocol().isLastMessageLogin()?[3,4]:[4,t.resetAndFlush()];case 3:e.sent(),e.label=4;case 4:return[3,7];case 5:return[4,t._release()];case 6:return e.sent(),[7];case 7:return[2,r]}})})},Lk.prototype.close=function(){return Ak(this,void 0,void 0,function(){return Mk(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.close()];case 1:return e.sent(),[4,Promise.all(Object.values(this._openConnections).map(function(e){return e.close()}))];case 2:return e.sent(),[2]}})})},Lk._installIdleObserverOnConnection=function(e,t){e._queueObserver(t)},Lk._removeIdleObserverOnConnection=function(e){e._updateCurrentObserver()},Lk);function Lk(e,t){var r=e.id,n=e.config,o=e.log,i=e.userAgent,e=e.authToken,u=(void 0===t&&(t=null),Ik.call(this)||this);return u._id=r,u._config=n,u._log=o,u._userAgent=i,u._authToken=e,u._createChannelConnection=t||function(e){return(0,xk.createChannelConnection)(e,u._config,u._createConnectionErrorHandler(),u._log)},u._connectionPool=new Nk.default({create:u._createConnection.bind(u),destroy:u._destroyConnection.bind(u),validate:u._validateConnection.bind(u),installIdleObserver:Lk._installIdleObserverOnConnection.bind(u),removeIdleObserver:Lk._removeIdleObserverOnConnection.bind(u),config:Nk.PoolConfig.fromDriverConfig(n),log:u._log}),u._openConnections={},u}Cf.default=I;var Bk,Fk,Wp={},Ra=r&&r.__extends||(Bk=function(e,t){return(Bk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Bk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Wk=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},zk=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},id=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ld=(Object.defineProperty(Wp,"__esModule",{value:!0}),id(Cf)),qk=hp,mh=e.internal.constants,Vk=mh.BOLT_PROTOCOL_V3,Hk=mh.BOLT_PROTOCOL_V4_0,Yk=mh.BOLT_PROTOCOL_V4_4,Kk=e.error.SERVICE_UNAVAILABLE,vh=(Fk=Ld.default,Ra(Gk,Fk),Gk.prototype.acquireConnection=function(e){var r=this,e=void 0===e?{}:e,n=(e.accessMode,e.database),t=(e.bookmarks,qk.ConnectionErrorHandler.create({errorCode:Kk,handleAuthorizationExpired:function(e,t){return r._handleAuthorizationExpired(e,t,n)}}));return this._connectionPool.acquire(this._address).then(function(e){return new qk.DelegateConnection(e,t)})},Gk.prototype._handleAuthorizationExpired=function(e,t,r){return this._log.warn("Direct driver ".concat(this._id," will close connection to ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this._connectionPool.purge(t).catch(function(){}),e},Gk.prototype._hasProtocolVersion=function(n){return Wk(this,void 0,void 0,function(){var t,r;return zk(this,function(e){switch(e.label){case 0:return[4,(0,qk.createChannelConnection)(this._address,this._config,this._createConnectionErrorHandler(),this._log)];case 1:return t=e.sent(),r=t.protocol()?t.protocol().version:null,[4,t.close()];case 2:return e.sent(),r?[2,n(r)]:[2,!1]}})})},Gk.prototype.supportsMultiDb=function(){return Wk(this,void 0,void 0,function(){return zk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return Hk<=e})];case 1:return[2,e.sent()]}})})},Gk.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},Gk.prototype.supportsTransactionConfig=function(){return Wk(this,void 0,void 0,function(){return zk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return Vk<=e})];case 1:return[2,e.sent()]}})})},Gk.prototype.supportsUserImpersonation=function(){return Wk(this,void 0,void 0,function(){return zk(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return Yk<=e})];case 1:return[2,e.sent()]}})})},Gk.prototype.verifyConnectivityAndGetServerInfo=function(){return Wk(this,void 0,void 0,function(){return zk(this,function(e){switch(e.label){case 0:return[4,this._verifyConnectivityAndGetServerVersion({address:this._address})];case 1:return[2,e.sent()]}})})},Gk);function Gk(e){var t=e.id,r=e.config,n=e.log,o=e.address,i=e.userAgent,e=e.authToken,t=Fk.call(this,{id:t,config:r,log:n,userAgent:i,authToken:e})||this;return t._address=o,t}Wp.default=vh;var Bh={},Gh={},pb={},_b={},Zk=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Qk=r&&r.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||((n=n||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},Xk=(Object.defineProperty(_b,"__esModule",{value:!0}),_b.createValidRoutingTable=void 0,e),gb=Xk.internal.constants,Jk=gb.ACCESS_MODE_WRITE,$k=gb.ACCESS_MODE_READ,eA=Xk.internal.serverAddress.ServerAddress,tA=Xk.error.PROTOCOL_ERROR,rA=(nA.fromRawRoutingTable=iA,nA.prototype.forget=function(e){this.readers=oA(this.readers,e),this.writers=oA(this.writers,e)},nA.prototype.forgetRouter=function(e){this.routers=oA(this.routers,e)},nA.prototype.forgetWriter=function(e){this.writers=oA(this.writers,e)},nA.prototype.isStaleFor=function(e){return this.expirationTime.lessThan(Date.now())||this.routers.length<1||e===$k&&0===this.readers.length||e===Jk&&0===this.writers.length},nA.prototype.isExpiredFor=function(e){return this.expirationTime.add(e).lessThan(Date.now())},nA.prototype.allServers=function(){return Qk(Qk(Qk([],Zk(this.routers),!1),Zk(this.readers),!1),Zk(this.writers),!1)},nA.prototype.toString=function(){return"RoutingTable["+"database=".concat(this.databaseName,", ")+"expirationTime=".concat(this.expirationTime,", ")+"currentTime=".concat(Date.now(),", ")+"routers=[".concat(this.routers,"], ")+"readers=[".concat(this.readers,"], ")+"writers=[".concat(this.writers,"]]")},nA);function nA(e){var e=void 0===e?{}:e,t=e.database,r=e.routers,n=e.readers,o=e.writers,i=e.expirationTime,e=e.ttl;this.database=t||null,this.databaseName=t||"default database",this.routers=r||[],this.readers=n||[],this.writers=o||[],this.expirationTime=i||(0,Xk.int)(0),this.ttl=e}function oA(e,t){return e.filter(function(e){return e.asKey()!==t.asKey()})}function iA(e,t,r){var n=r.ttl,o=function(t,r){try{var e=(0,Xk.int)(Date.now()),n=(0,Xk.int)(t.ttl).multiply(1e3).add(e);return n.lessThan(e)?Xk.Integer.MAX_VALUE:n}catch(e){throw(0,Xk.newError)("Unable to parse TTL entry from router ".concat(r," from raw routing table:\n").concat(Xk.json.stringify(t),"\nError message: ").concat(e.message),tA)}}(r,t),i=function(t,r){try{var n=[],o=[],i=[];return t.servers.forEach(function(e){var t=e.role,e=e.addresses;"ROUTE"===t?n=aA(e).map(function(e){return eA.fromUrl(e)}):"WRITE"===t?i=aA(e).map(function(e){return eA.fromUrl(e)}):"READ"===t&&(o=aA(e).map(function(e){return eA.fromUrl(e)}))}),{routers:n,readers:o,writers:i}}catch(e){throw(0,Xk.newError)("Unable to parse servers entry from router ".concat(r," from addresses:\n").concat(Xk.json.stringify(t.servers),"\nError message: ").concat(e.message),tA)}}(r,t),u=i.routers,a=i.readers,i=i.writers;return uA(u,"routers",t),uA(a,"readers",t),new rA({database:e||r.db,routers:u,readers:a,writers:i,expirationTime:o,ttl:n})}function uA(e,t,r){if(0===e.length)throw(0,Xk.newError)("Received no "+t+" from router "+r,tA)}function aA(e){if(Array.isArray(e))return Array.from(e);throw new TypeError("Array expected but got: "+e)}_b.default=rA,_b.createValidRoutingTable=iA;var tb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},sA=(Object.defineProperty(pb,"__esModule",{value:!0}),tb(_b));function cA(e){this._routingContext=e}cA.prototype.lookupRoutingTableOnRouter=function(t,r,n,o){var i=this;return t._acquireConnection(function(e){return i._requestRawRoutingTable(e,t,r,n,o).then(function(e){return e.isNull?null:sA.default.fromRawRoutingTable(r,n,e)})})},cA.prototype._requestRawRoutingTable=function(r,n,o,e,i){var u=this;return new Promise(function(e,t){r.protocol().requestRoutingInformation({routingContext:u._routingContext,databaseName:o,impersonatedUser:i,sessionContext:{bookmarks:n._lastBookmarks,mode:n._mode,database:n._database,afterComplete:n._onComplete},onCompleted:e,onError:t})})},pb.default=cA;var lA,fA,Ob=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},wb=(Object.defineProperty(Gh,"__esModule",{value:!0}),Gh.RoutingTable=Gh.Rediscovery=void 0,Ob(pb)),qh=(Gh.Rediscovery=wb.default,Ob(_b)),$h=(Gh.RoutingTable=qh.default,Gh.default=wb.default,r&&r.__extends||(lA=function(e,t){return(lA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}lA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),pA=r&&r.__assign||function(){return(pA=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},dA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),hA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ib=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&dA(t,e,r);return hA(t,e),t},bA=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},yA=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},_A=r&&r.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},vA=r&&r.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u},Fb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mA=(Object.defineProperty(Bh,"__esModule",{value:!0}),e),gA=Ib(Gh),OA=Il,wA=Fb(op),Ph=Fb(Cf),EA=qa,PA=hp,SA=mA.error.SERVICE_UNAVAILABLE,TA=mA.error.SESSION_EXPIRED,jA=mA.internal.bookmarks.Bookmarks,Mb=mA.internal.constants,CA=Mb.ACCESS_MODE_READ,IA=Mb.ACCESS_MODE_WRITE,RA=Mb.BOLT_PROTOCOL_V3,kA=Mb.BOLT_PROTOCOL_V4_0,AA=Mb.BOLT_PROTOCOL_V4_4,MA=(0,mA.int)(3e4),Ic=(fA=Ph.default,$h(x,fA),x.prototype._createConnectionErrorHandler=function(){return new PA.ConnectionErrorHandler(TA)},x.prototype._handleUnavailability=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will forget ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this.forget(t,r||null),e},x.prototype._handleAuthorizationExpired=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will close connections to ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this._connectionPool.purge(t).catch(function(){}),e},x.prototype._handleWriteFailure=function(e,t,r){return this._log.warn("Routing driver ".concat(this._id," will forget writer ").concat(t," for database '").concat(r,"' because of an error ").concat(e.code," '").concat(e.message,"'")),this.forgetWriter(t,r||null),(0,mA.newError)("No longer possible to write to server at "+t,TA,e)},x.prototype.acquireConnection=function(e){var e=void 0===e?{}:e,s=e.accessMode,c=e.database,l=e.bookmarks,f=e.impersonatedUser,p=e.onDatabaseNameResolved;return bA(this,void 0,void 0,function(){var t,r,n,o,i,u,a=this;return yA(this,function(e){switch(e.label){case 0:return n={database:c||null},o=new PA.ConnectionErrorHandler(TA,function(e,t){return a._handleUnavailability(e,t,n.database)},function(e,t){return a._handleWriteFailure(e,t,n.database)},function(e,t){return a._handleAuthorizationExpired(e,t,n.database)}),[4,this._freshRoutingTable({accessMode:s,database:n.database,bookmarks:l,impersonatedUser:f,onDatabaseNameResolved:function(e){n.database=n.database||e,p&&p(e)}})];case 1:if(i=e.sent(),s===CA)r=this._loadBalancingStrategy.selectReader(i.readers),t="read";else{if(s!==IA)throw(0,mA.newError)("Illegal mode "+s);r=this._loadBalancingStrategy.selectWriter(i.writers),t="write"}if(!r)throw(0,mA.newError)("Failed to obtain connection towards ".concat(t," server. Known routing table is: ").concat(i),TA);e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this._acquireConnectionToServer(r,t,i)];case 3:return u=e.sent(),[2,new PA.DelegateConnection(u,o)];case 4:throw u=e.sent(),o.handleAndTransformError(u,r);case 5:return[2]}})})},x.prototype._hasProtocolVersion=function(u){return bA(this,void 0,void 0,function(){var t,r,n,o,i;return yA(this,function(e){switch(e.label){case 0:return[4,this._resolveSeedRouter(this._seedRouter)];case 1:t=e.sent(),n=0,e.label=2;case 2:if(!(n<t.length))return[3,8];e.label=3;case 3:return e.trys.push([3,6,,7]),[4,(0,PA.createChannelConnection)(t[n],this._config,this._createConnectionErrorHandler(),this._log)];case 4:return i=e.sent(),o=i.protocol()?i.protocol().version:null,[4,i.close()];case 5:return e.sent(),o?[2,u(o)]:[2,!1];case 6:return i=e.sent(),r=i,[3,7];case 7:return n++,[3,2];case 8:if(r)throw r;return[2,!1]}})})},x.prototype.supportsMultiDb=function(){return bA(this,void 0,void 0,function(){return yA(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return kA<=e})];case 1:return[2,e.sent()]}})})},x.prototype.supportsTransactionConfig=function(){return bA(this,void 0,void 0,function(){return yA(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return RA<=e})];case 1:return[2,e.sent()]}})})},x.prototype.supportsUserImpersonation=function(){return bA(this,void 0,void 0,function(){return yA(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return AA<=e})];case 1:return[2,e.sent()]}})})},x.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},x.prototype.verifyConnectivityAndGetServerInfo=function(e){var l=e.database,f=e.accessMode;return bA(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c;return yA(this,function(e){switch(e.label){case 0:return t={database:l||null},[4,this._freshRoutingTable({accessMode:f,database:t.database,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:r=e.sent(),r=f===IA?r.writers:r.readers,n=(0,mA.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(f,"'"),SA),e.label=2;case 2:e.trys.push([2,9,10,11]),o=_A(r),i=o.next(),e.label=3;case 3:if(i.done)return[3,8];u=i.value,e.label=4;case 4:return e.trys.push([4,6,,7]),[4,this._verifyConnectivityAndGetServerVersion({address:u})];case 5:return[2,e.sent()];case 6:return a=e.sent(),n=a,[3,7];case 7:return i=o.next(),[3,3];case 8:return[3,11];case 9:return a=e.sent(),s={error:a},[3,11];case 10:try{i&&!i.done&&(c=o.return)&&c.call(o)}finally{if(s)throw s.error}return[7];case 11:throw n}})})},x.prototype.forget=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forget(t)}}),this._connectionPool.purge(t).catch(function(){})},x.prototype.forgetWriter=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forgetWriter(t)}})},x.prototype._acquireConnectionToServer=function(e,t,r){return this._connectionPool.acquire(e)},x.prototype._freshRoutingTable=function(e){var e=void 0===e?{}:e,t=e.accessMode,r=e.database,n=e.bookmarks,o=e.impersonatedUser,e=e.onDatabaseNameResolved,i=this._routingTableRegistry.get(r,function(){return new gA.RoutingTable({database:r})});return i.isStaleFor(t)?(this._log.info('Routing table is stale for database: "'.concat(r,'" and access mode: "').concat(t,'": ').concat(i)),this._refreshRoutingTable(i,n,o,e)):i},x.prototype._refreshRoutingTable=function(e,t,r,n){var o=e.routers;return this._useSeedRouter?this._fetchRoutingTableFromSeedRouterFallbackToKnownRouters(o,e,t,r,n):this._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter(o,e,t,r,n)},x.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters=function(u,a,s,c,l){return bA(this,void 0,void 0,function(){var t,r,n,o,i;return yA(this,function(e){switch(e.label){case 0:return t=[],[4,this._fetchRoutingTableUsingSeedRouter(t,this._seedRouter,a,s,c)];case 1:return(t=vA.apply(void 0,[e.sent(),2]),r=t[0],n=t[1],r)?(this._useSeedRouter=!1,[3,4]):[3,2];case 2:return[4,this._fetchRoutingTableUsingKnownRouters(u,a,s,c)];case 3:i=vA.apply(void 0,[e.sent(),2]),o=i[0],i=i[1],r=o,n=i||n,e.label=4;case 4:return[4,this._applyRoutingTableIfPossible(a,r,l,n)];case 5:return[2,e.sent()]}})})},x.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter=function(o,i,u,a,s){return bA(this,void 0,void 0,function(){var t,r,n;return yA(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTableUsingKnownRouters(o,i,u,a)];case 1:return r=vA.apply(void 0,[e.sent(),2]),t=r[0],r=r[1],t?[3,3]:[4,this._fetchRoutingTableUsingSeedRouter(o,this._seedRouter,i,u,a)];case 2:n=vA.apply(void 0,[e.sent(),2]),t=n[0],r=n[1],e.label=3;case 3:return[4,this._applyRoutingTableIfPossible(i,t,s,r)];case 4:return[2,e.sent()]}})})},x.prototype._fetchRoutingTableUsingKnownRouters=function(n,o,i,u){return bA(this,void 0,void 0,function(){var t,r;return yA(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTable(n,o,i,u)];case 1:return(t=vA.apply(void 0,[e.sent(),2]),r=t[0],t=t[1],r)?[2,[r,null]]:(r=n.length-1,x._forgetRouter(o,n,r),[2,[null,t]])}})})},x.prototype._fetchRoutingTableUsingSeedRouter=function(r,n,o,i,u){return bA(this,void 0,void 0,function(){var t;return yA(this,function(e){switch(e.label){case 0:return[4,this._resolveSeedRouter(n)];case 1:return t=e.sent(),t=t.filter(function(e){return r.indexOf(e)<0}),[4,this._fetchRoutingTable(t,o,i,u)];case 2:return[2,e.sent()]}})})},x.prototype._resolveSeedRouter=function(n){return bA(this,void 0,void 0,function(){var t,r=this;return yA(this,function(e){switch(e.label){case 0:return[4,this._hostNameResolver.resolve(n)];case 1:return t=e.sent(),[4,Promise.all(t.map(function(e){return r._dnsResolver.resolve(e)}))];case 2:return t=e.sent(),[2,[].concat.apply([],t)]}})})},x.prototype._fetchRoutingTable=function(s,c,l,f){return bA(this,void 0,void 0,function(){var t=this;return yA(this,function(e){return[2,s.reduce(function(i,u,a){return bA(t,void 0,void 0,function(){var t,r,n,o;return yA(this,function(e){switch(e.label){case 0:return[4,i];case 1:return(t=vA.apply(void 0,[e.sent(),1]),t=t[0])?[2,[t,null]]:(x._forgetRouter(c,s,a-1),[4,this._createSessionForRediscovery(u,l,f)]);case 2:if(t=vA.apply(void 0,[e.sent(),2]),r=t[0],n=t[1],!r)return[3,8];e.label=3;case 3:return e.trys.push([3,5,6,7]),[4,this._rediscovery.lookupRoutingTableOnRouter(r,c.database,u,f)];case 4:return[2,[e.sent(),null]];case 5:return o=e.sent(),[2,this._handleRediscoveryError(o,u)];case 6:return r.close(),[7];case 7:return[3,9];case 8:return[2,[null,n]];case 9:return[2]}})})},Promise.resolve([null,null]))]})})},x.prototype._createSessionForRediscovery=function(o,i,u){return bA(this,void 0,void 0,function(){var t,r,n=this;return yA(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this._connectionPool.acquire(o)];case 1:return r=e.sent(),t=PA.ConnectionErrorHandler.create({errorCode:TA,handleAuthorizationExpired:function(e,t){return n._handleAuthorizationExpired(e,t)}}),t=new wA.default(new PA.DelegateConnection(r,t)),r.protocol().version<4?[2,[new mA.Session({mode:IA,bookmarks:jA.empty(),connectionProvider:t}),null]]:[2,[new mA.Session({mode:CA,database:"system",bookmarks:i,connectionProvider:t,impersonatedUser:u}),null]];case 2:return r=e.sent(),[2,this._handleRediscoveryError(r,o)];case 3:return[2]}})})},x.prototype._handleRediscoveryError=function(e,t){if(["Neo.ClientError.Database.DatabaseNotFound","Neo.ClientError.Transaction.InvalidBookmark","Neo.ClientError.Transaction.InvalidBookmarkMixture","Neo.ClientError.Statement.ArgumentError","Neo.ClientError.Request.Invalid","Neo.ClientError.Statement.TypeError"].includes(e.code)||(r=e).code.startsWith("Neo.ClientError.Security.")&&!["Neo.ClientError.Security.AuthorizationExpired"].includes(r.code))throw e;if("Neo.ClientError.Procedure.ProcedureNotFound"===e.code)throw(0,mA.newError)("Server at ".concat(t.asHostPort()," can't perform routing. Make sure you are connecting to a causal cluster"),SA,e);var r;return this._log.warn("unable to fetch routing table because of an error ".concat(e)),[null,e]},x.prototype._applyRoutingTableIfPossible=function(t,r,n,o){return bA(this,void 0,void 0,function(){return yA(this,function(e){switch(e.label){case 0:if(r)return 0===r.writers.length&&(this._useSeedRouter=!0),[4,this._updateRoutingTable(r,n)];throw(0,mA.newError)("Could not perform discovery. No routing servers available. Known routing table: ".concat(t),SA,o);case 1:return e.sent(),[2,r]}})})},x.prototype._updateRoutingTable=function(t,r){return bA(this,void 0,void 0,function(){return yA(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.keepAll(t.allServers())];case 1:return e.sent(),this._routingTableRegistry.removeExpired(),this._routingTableRegistry.register(t),r(t.database),this._log.info("Updated routing table ".concat(t)),[2]}})})},x._forgetRouter=function(e,t,r){t=t[r];e&&t&&e.forgetRouter(t)},x);function x(e){var t=e.id,r=e.address,n=e.routingContext,o=e.hostNameResolver,i=e.config,u=e.log,a=e.userAgent,s=e.authToken,e=e.routingTablePurgeDelay,c=fA.call(this,{id:t,config:i,log:u,userAgent:a,authToken:s},function(e){return(0,PA.createChannelConnection)(e,c._config,c._createConnectionErrorHandler(),c._log,c._routingContext)})||this;return c._routingContext=pA(pA({},n),{address:r.toString()}),c._seedRouter=r,c._rediscovery=new gA.default(c._routingContext),c._loadBalancingStrategy=new EA.LeastConnectedLoadBalancingStrategy(c._connectionPool),c._hostNameResolver=o,c._dnsResolver=new OA.HostNameResolver,c._log=u,c._useSeedRouter=!0,c._routingTableRegistry=new XA(e?(0,mA.int)(e):MA),c}Bh.default=Ic;JA.prototype.register=function(e){return this._tables.set(e.database,e),this},JA.prototype.apply=function(e,t){var t=void 0===t?{}:t,r=t.applyWhenExists,t=t.applyWhenDontExists,t=void 0===t?function(){}:t;return this._tables.has(e)?r(this._tables.get(e)):"string"==typeof e||null===e?t():this._forEach(r),this},JA.prototype.get=function(e,t){return this._tables.has(e)?this._tables.get(e):"function"==typeof t?t():t},JA.prototype.removeExpired=function(){var t=this;return this._removeIf(function(e){return e.isExpiredFor(t._routingTablePurgeDelay)})},JA.prototype._forEach=function(e){var t,r;try{for(var n=_A(this._tables),o=n.next();!o.done;o=n.next())e(vA(o.value,2)[1])}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return this},JA.prototype._remove=function(e){return this._tables.delete(e),this},JA.prototype._removeIf=function(e){var t,r;try{for(var n=_A(this._tables),o=n.next();!o.done;o=n.next()){var i=vA(o.value,2),u=i[0];e(i[1])&&this._remove(u)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return this};var xA,NA,UA,DA,LA,BA,FA,WA,zA,qA,N,VA,HA,YA,KA,GA,ZA,QA,XA=JA;function JA(e){this._tables=new Map,this._routingTablePurgeDelay=e}function $A(e,o,t){void 0===t&&(t={}),YA(e,"Bolt URL");var r,i=ZA.parseDatabaseUrl(e),n=!1,u=!1;switch(i.scheme){case"bolt":break;case"bolt+s":u=!0,r="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";break;case"bolt+ssc":u=!0,r="TRUST_ALL_CERTIFICATES";break;case"neo4j":n=!0;break;case"neo4j+s":r="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",n=u=!0;break;case"neo4j+ssc":r="TRUST_ALL_CERTIFICATES",n=u=!0;break;default:throw new Error("Unknown scheme: ".concat(i.scheme))}if(u){if("encrypted"in t||"trust"in t)throw new Error("Encryption/trust can only be configured either through URL or config, not both");t.encrypted=HA,t.trust=r}(o=o||{}).scheme=o.scheme||"none",t.userAgent=t.userAgent||QA;var a=GA.fromUrl(i.hostAndPort),s={address:a,typename:n?"Routing":"Direct",routing:n};return new qA.Driver(s,t,function(){{if(n)return function(e,t,r,n){return new VA.RoutingConnectionProvider({id:e,config:t,log:r,hostNameResolver:n,authToken:o,address:a,userAgent:t.userAgent,routingContext:i.query})};if(KA(i.query))return function(e,t,r){return new VA.DirectConnectionProvider({id:e,config:t,log:r,authToken:o,address:a,userAgent:t.userAgent})};throw new Error("Parameters are not supported with none routed scheme. Given URL: '".concat(e,"'"))}}())}function e2(r,n){return WA(this,void 0,void 0,function(){var t;return zA(this,function(e){switch(e.label){case 0:t=$A(r,{scheme:"none",principal:"",credentials:""},n),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,t.getNegotiatedProtocolVersion()];case 2:return e.sent(),[2,!0];case 3:return[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})}return hy=S,xA=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(hy,"__esModule",{value:!0}),hy.RoutingConnectionProvider=hy.DirectConnectionProvider=hy.PooledConnectionProvider=hy.SingleConnectionProvider=void 0,NA=op,Object.defineProperty(hy,"SingleConnectionProvider",{enumerable:!0,get:function(){return xA(NA).default}}),UA=Cf,Object.defineProperty(hy,"PooledConnectionProvider",{enumerable:!0,get:function(){return xA(UA).default}}),DA=Wp,Object.defineProperty(hy,"DirectConnectionProvider",{enumerable:!0,get:function(){return xA(DA).default}}),LA=Bh,Object.defineProperty(hy,"RoutingConnectionProvider",{enumerable:!0,get:function(){return xA(LA).default}}),Ch=P,BA=r&&r.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),FA=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ry=r&&r.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&BA(t,e,r);return FA(t,e),t},vy=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||BA(t,e,r)},Object.defineProperty(Ch,"__esModule",{value:!0}),Ch.pool=Ch.packstream=Ch.channel=Ch.buf=Ch.bolt=Ch.loadBalancing=void 0,Ch.loadBalancing=ry(qa),Ch.bolt=ry(a),Ch.buf=ry(pf),Ch.channel=ry(Il),Ch.packstream=ry(Bf),Ch.pool=ry(Xf),vy(S,Ch),k=B,WA=r&&r.__awaiter||function(e,u,a,s){return new(a=a||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())})},zA=r&&r.__generator||function(n,o){var i,u,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function e(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},pl=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(k,"__esModule",{value:!0}),k.PathSegment=k.Path=k.UnboundRelationship=k.Relationship=k.Node=k.Record=k.ServerInfo=k.Notification=k.QueryStatistics=k.ProfiledPlan=k.Plan=k.ResultSummary=k.RxResult=k.RxManagedTransaction=k.RxTransaction=k.RxSession=k.EagerResult=k.Result=k.ManagedTransaction=k.Transaction=k.Session=k.Driver=k.temporal=k.spatial=k.graph=k.error=k.routing=k.session=k.types=k.logging=k.auth=k.isRetryableError=k.Neo4jError=k.integer=k.isUnboundRelationship=k.isRelationship=k.isPathSegment=k.isPath=k.isNode=k.isDateTime=k.isLocalDateTime=k.isDate=k.isTime=k.isLocalTime=k.isDuration=k.isPoint=k.isInt=k.int=k.hasReachableServer=k.driver=void 0,k.resultTransformers=k.bookmarkManager=k.DateTime=k.LocalDateTime=k.Date=k.Time=k.LocalTime=k.Duration=k.Integer=k.Point=void 0,qA=F,Object.defineProperty(k,"Driver",{enumerable:!0,get:function(){return qA.Driver}}),$b=pl(i),N=e,Object.defineProperty(k,"Neo4jError",{enumerable:!0,get:function(){return N.Neo4jError}}),Object.defineProperty(k,"isRetryableError",{enumerable:!0,get:function(){return N.isRetryableError}}),Object.defineProperty(k,"error",{enumerable:!0,get:function(){return N.error}}),Object.defineProperty(k,"Integer",{enumerable:!0,get:function(){return N.Integer}}),Object.defineProperty(k,"int",{enumerable:!0,get:function(){return N.int}}),Object.defineProperty(k,"isInt",{enumerable:!0,get:function(){return N.isInt}}),Object.defineProperty(k,"isPoint",{enumerable:!0,get:function(){return N.isPoint}}),Object.defineProperty(k,"Point",{enumerable:!0,get:function(){return N.Point}}),Object.defineProperty(k,"Date",{enumerable:!0,get:function(){return N.Date}}),Object.defineProperty(k,"DateTime",{enumerable:!0,get:function(){return N.DateTime}}),Object.defineProperty(k,"Duration",{enumerable:!0,get:function(){return N.Duration}}),Object.defineProperty(k,"isDate",{enumerable:!0,get:function(){return N.isDate}}),Object.defineProperty(k,"isDateTime",{enumerable:!0,get:function(){return N.isDateTime}}),Object.defineProperty(k,"isDuration",{enumerable:!0,get:function(){return N.isDuration}}),Object.defineProperty(k,"isLocalDateTime",{enumerable:!0,get:function(){return N.isLocalDateTime}}),Object.defineProperty(k,"isLocalTime",{enumerable:!0,get:function(){return N.isLocalTime}}),Object.defineProperty(k,"isNode",{enumerable:!0,get:function(){return N.isNode}}),Object.defineProperty(k,"isPath",{enumerable:!0,get:function(){return N.isPath}}),Object.defineProperty(k,"isPathSegment",{enumerable:!0,get:function(){return N.isPathSegment}}),Object.defineProperty(k,"isRelationship",{enumerable:!0,get:function(){return N.isRelationship}}),Object.defineProperty(k,"isTime",{enumerable:!0,get:function(){return N.isTime}}),Object.defineProperty(k,"isUnboundRelationship",{enumerable:!0,get:function(){return N.isUnboundRelationship}}),Object.defineProperty(k,"LocalDateTime",{enumerable:!0,get:function(){return N.LocalDateTime}}),Object.defineProperty(k,"LocalTime",{enumerable:!0,get:function(){return N.LocalTime}}),Object.defineProperty(k,"Time",{enumerable:!0,get:function(){return N.Time}}),Object.defineProperty(k,"Node",{enumerable:!0,get:function(){return N.Node}}),Object.defineProperty(k,"Path",{enumerable:!0,get:function(){return N.Path}}),Object.defineProperty(k,"PathSegment",{enumerable:!0,get:function(){return N.PathSegment}}),Object.defineProperty(k,"Relationship",{enumerable:!0,get:function(){return N.Relationship}}),Object.defineProperty(k,"UnboundRelationship",{enumerable:!0,get:function(){return N.UnboundRelationship}}),Object.defineProperty(k,"Record",{enumerable:!0,get:function(){return N.Record}}),Object.defineProperty(k,"ResultSummary",{enumerable:!0,get:function(){return N.ResultSummary}}),Object.defineProperty(k,"Plan",{enumerable:!0,get:function(){return N.Plan}}),Object.defineProperty(k,"ProfiledPlan",{enumerable:!0,get:function(){return N.ProfiledPlan}}),Object.defineProperty(k,"QueryStatistics",{enumerable:!0,get:function(){return N.QueryStatistics}}),Object.defineProperty(k,"Notification",{enumerable:!0,get:function(){return N.Notification}}),Object.defineProperty(k,"ServerInfo",{enumerable:!0,get:function(){return N.ServerInfo}}),Object.defineProperty(k,"Result",{enumerable:!0,get:function(){return N.Result}}),Object.defineProperty(k,"EagerResult",{enumerable:!0,get:function(){return N.EagerResult}}),Object.defineProperty(k,"auth",{enumerable:!0,get:function(){return N.auth}}),Object.defineProperty(k,"Session",{enumerable:!0,get:function(){return N.Session}}),Object.defineProperty(k,"Transaction",{enumerable:!0,get:function(){return N.Transaction}}),Object.defineProperty(k,"ManagedTransaction",{enumerable:!0,get:function(){return N.ManagedTransaction}}),Object.defineProperty(k,"bookmarkManager",{enumerable:!0,get:function(){return N.bookmarkManager}}),Object.defineProperty(k,"routing",{enumerable:!0,get:function(){return N.routing}}),Object.defineProperty(k,"resultTransformers",{enumerable:!0,get:function(){return N.resultTransformers}}),VA=P,Cy=pl(kr),k.RxSession=Cy.default,Kb=pl(t),k.RxTransaction=Kb.default,dl=pl(l),k.RxManagedTransaction=dl.default,pl=pl(u),k.RxResult=pl.default,Oy=N.internal.util,HA=Oy.ENCRYPTION_ON,YA=Oy.assertString,KA=Oy.isEmptyObjectOrNull,GA=N.internal.serverAddress.ServerAddress,ZA=N.internal.urlUtil,k.driver=$A,k.hasReachableServer=e2,QA="neo4j-javascript/"+$b.default,Oy={console:function(e){return{level:e,logger:function(e,t){return console.log("".concat(r.Date.now()," ").concat(e.toUpperCase()," ").concat(t))}}}},k.logging=Oy,$b={Node:N.Node,Relationship:N.Relationship,UnboundRelationship:N.UnboundRelationship,PathSegment:N.PathSegment,Path:N.Path,Result:N.Result,EagerResult:N.EagerResult,ResultSummary:N.ResultSummary,Record:N.Record,Point:N.Point,Date:N.Date,DateTime:N.DateTime,Duration:N.Duration,LocalDateTime:N.LocalDateTime,LocalTime:N.LocalTime,Time:N.Time,Integer:N.Integer},k.types=$b,Sy={READ:qA.READ,WRITE:qA.WRITE},k.session=Sy,hl={toNumber:N.toNumber,toString:N.toString,inSafeRange:N.inSafeRange},k.integer=hl,v={isPoint:N.isPoint},k.spatial=v,Jy={isDuration:N.isDuration,isLocalTime:N.isLocalTime,isTime:N.isTime,isDate:N.isDate,isLocalDateTime:N.isLocalDateTime,isDateTime:N.isDateTime},k.temporal=Jy,Yy={isNode:N.isNode,isPath:N.isPath,isPathSegment:N.isPathSegment,isRelationship:N.isRelationship,isUnboundRelationship:N.isUnboundRelationship},k.graph=Yy,hl={driver:$A,hasReachableServer:e2,int:N.int,isInt:N.isInt,isPoint:N.isPoint,isDuration:N.isDuration,isLocalTime:N.isLocalTime,isTime:N.isTime,isDate:N.isDate,isLocalDateTime:N.isLocalDateTime,isDateTime:N.isDateTime,isNode:N.isNode,isPath:N.isPath,isPathSegment:N.isPathSegment,isRelationship:N.isRelationship,isUnboundRelationship:N.isUnboundRelationship,integer:hl,Neo4jError:N.Neo4jError,isRetryableError:N.isRetryableError,auth:N.auth,logging:Oy,types:$b,session:Sy,routing:N.routing,error:N.error,graph:Yy,spatial:v,temporal:Jy,Driver:qA.Driver,Session:N.Session,Transaction:N.Transaction,ManagedTransaction:N.ManagedTransaction,Result:N.Result,EagerResult:N.EagerResult,RxSession:Cy.default,RxTransaction:Kb.default,RxManagedTransaction:dl.default,RxResult:pl.default,ResultSummary:N.ResultSummary,Plan:N.Plan,ProfiledPlan:N.ProfiledPlan,QueryStatistics:N.QueryStatistics,Notification:N.Notification,ServerInfo:N.ServerInfo,Record:N.Record,Node:N.Node,Relationship:N.Relationship,UnboundRelationship:N.UnboundRelationship,Path:N.Path,PathSegment:N.PathSegment,Point:N.Point,Integer:N.Integer,Duration:N.Duration,LocalTime:N.LocalTime,Time:N.Time,Date:N.Date,LocalDateTime:N.LocalDateTime,DateTime:N.DateTime,bookmarkManager:N.bookmarkManager,resultTransformers:N.resultTransformers},k.default=hl,U(B)});
|