neo4j-driver 5.24.1 → 5.26.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.
@@ -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 D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var U,L,F={},B={},e={},t={},n=r&&r.__extends||(U=function(e,t){return(U=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}U(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"),q=(t.SERVICE_UNAVAILABLE=W,"SessionExpired"),z=(t.SESSION_EXPIRED=q,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===q||"Neo.ClientError.Security.AuthorizationExpired"===r||function(e){return!0===(null==e?void 0:e.includes("TransientError"))}(r),e}t.Neo4jError=z,t.newError=function(e,t,r){return new z(e,null!=t?t:"N/A",r)};n=z.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),G=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*Y+(this.low>>>0)},d.prototype.toBigInt=function(){var e;return this.isZero()?BigInt(0):this.isPositive()?BigInt(this.high>>>0)*BigInt(Y)+BigInt(this.low>>>0):(e=this.negate(),BigInt(-1)*(BigInt(e.high>>>0)*BigInt(Y)+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),e=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=G.get(e)))return t;var t=new d(e,e<0?-1:0);return-128<=e&&e<128&&G.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<=-K?d.MIN_VALUE:K<=e+1?d.MAX_VALUE:e<0?d.fromNumber(-e).negate():new d(e%Y|0,e/Y|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?(!0===t.ceilFloat&&(e=Math.ceil(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 Y=4294967296,K=Y*Y/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={},Q={},J=(Object.defineProperty(Q,"__esModule",{value:!0}),Q.getBrokenObjectReason=Q.isBrokenObject=Q.createBrokenObject=void 0,"__isBrokenObject__"),$="__reason__";Q.createBrokenObject=function(r,e){function n(){throw r}return void 0===e&&(e={}),new Proxy(e,{get:function(e,t){return t===J||(t===$?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})},Q.isBrokenObject=function(e){return null!==e&&"object"==typeof e&&!0===e[J]},Q.getBrokenObjectReason=function(e){return e[$]},Object.defineProperty(X,"__esModule",{value:!0}),X.stringify=void 0;var ee=Q;X.stringify=function(e,r){return JSON.stringify(e,function(e,t){return(0,ee.isBrokenObject)(t)?{__isBrokenObject__:!0,__reason__:(0,ee.getBrokenObjectReason)(t)}:"bigint"==typeof t?"".concat(t,"n"):!0!==(null==r?void 0:r.useCustomToString)||"object"!=typeof t||Array.isArray(t)||"function"!=typeof t.toString||t.toString===Object.prototype.toString?t:null==t?void 0:t.toString()})};var a,te,re,ne,oe,ie,ue,ae=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]}),se=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)&&ae(t,e,r);return se(t,e),t},ce=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.")},le=(Object.defineProperty(u,"__esModule",{value:!0}),u.ENCRYPTION_OFF=u.ENCRYPTION_ON=u.equals=u.validateQueryAndParameters=u.toNumber=u.assertValidDate=u.assertNumberOrInteger=u.assertNumber=u.assertString=u.assertObject=u.isString=u.isObject=u.isEmptyObjectOrNull=void 0,s(n)),fe=X;u.ENCRYPTION_ON="ENCRYPTION_ON";function pe(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}function de(e,t){if(he(e))return e;throw new TypeError((0,fe.stringify)(t)+" expected to be string but was: "+(0,fe.stringify)(e))}function he(e){return"[object String]"===Object.prototype.toString.call(e)}function be(e,t){this._minNumber=e,this._maxNumber=t,this._minInteger=(0,ne.int)(e),this._maxInteger=(0,ne.int)(t)}function ye(e,t,r){e=(0,ne.int)(e),t=(0,ne.int)(t),r=(0,ne.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,ne.int)(e)).modulo(4).equals(0))return!e.modulo(100).equals(0)||!!e.modulo(400).equals(0)}(e)||(n=n.subtract(1))),n.subtract(a.DAYS_0000_TO_1970)}function _e(e,t){return(0,oe.newError)("".concat(t,' is expected to be a valid ZoneId but was: "').concat(e,'"'))}function ve(e,t,r){if((0,ie.assertNumberOrInteger)(e,r),t.contains(e))return e;throw(0,oe.newError)("".concat(r," is expected to be in range ").concat(t.toString()," but was: ").concat(e.toString()))}function me(e,t){e=(0,ne.int)(e),t=(0,ne.int)(t);var r=e.div(t);return r=e.isPositive()!==t.isPositive()&&r.multiply(t).notEquals(e)?r.subtract(1):r}function ge(e,t){return e=(0,ne.int)(e),t=(0,ne.int)(t),e.subtract(me(e,t).multiply(t))}function Oe(e){return(e=(0,ne.int)(e)).equals(0)?"":"."+we(e,9)}function we(e,t,r){var n=(e=(0,ne.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(!pe(e))return!1;for(var t in e)if(void 0!==e[t])return!1;return!0},u.isObject=pe,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(de(e,"Cypher query"),0===e.trim().length)throw new TypeError("Cypher query is expected to be a non-empty string.");r=t;if(!pe(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(pe(e))return e;throw new TypeError(t+" expected to be an object but was: "+(0,fe.stringify)(e))},u.assertString=de,u.assertNumber=function(e,t){if("number"!=typeof e)throw new TypeError(t+" expected to be a number but was: "+(0,fe.stringify)(e));return e},u.assertNumberOrInteger=function(e,t){if("number"==typeof e||"bigint"==typeof e||(0,le.isInt)(e))return e;throw new TypeError(t+" expected to be either a number or an Integer object but was: "+(0,fe.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,fe.stringify)(e));if(Number.isNaN(e.getTime()))throw new TypeError(t+" expected to be valid JavaScript Date but its time was NaN: "+(0,fe.stringify)(e));return e},u.isString=he,u.equals=function e(t,r){var n,o;if(t===r)return!0;if(null===t||null===r)return!1;if("object"!=typeof t||"object"!=typeof r)return!1;var i=Object.keys(t),u=Object.keys(r);if(i.length!==u.length)return!1;try{for(var a=ce(i),s=a.next();!s.done;s=a.next()){var c=s.value;if(!e(t[c],r[c]))return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return!0},u.toNumber=function(e){return e instanceof le.default?e.toNumber():"bigint"==typeof e?(0,le.int)(e).toNumber():e},a=o,te=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]}),re=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)&&te(t,e,r);return re(t,e),t},Object.defineProperty(a,"__esModule",{value:!0}),a.floorMod=a.floorDiv=a.assertValidZoneId=a.assertValidNanosecond=a.assertValidSecond=a.assertValidMinute=a.assertValidHour=a.assertValidDay=a.assertValidMonth=a.assertValidYear=a.timeZoneOffsetInSeconds=a.totalNanoseconds=a.newDate=a.toStandardDate=a.isoStringToStandardDate=a.dateToIsoString=a.timeZoneOffsetToIsoString=a.timeToIsoString=a.durationToIsoString=a.dateToEpochDay=a.localDateTimeToEpochSecond=a.localTimeToNanoOfDay=a.normalizeNanosecondsForDuration=a.normalizeSecondsForDuration=a.SECONDS_PER_DAY=a.DAYS_PER_400_YEAR_CYCLE=a.DAYS_0000_TO_1970=a.NANOS_PER_HOUR=a.NANOS_PER_MINUTE=a.NANOS_PER_MILLISECOND=a.NANOS_PER_SECOND=a.SECONDS_PER_HOUR=a.SECONDS_PER_MINUTE=a.MINUTES_PER_HOUR=a.NANOSECOND_OF_SECOND_RANGE=a.SECOND_OF_MINUTE_RANGE=a.MINUTE_OF_HOUR_RANGE=a.HOUR_OF_DAY_RANGE=a.DAY_OF_MONTH_RANGE=a.MONTH_OF_YEAR_RANGE=a.YEAR_RANGE=void 0,ne=s(n),oe=t,ie=u,be.prototype.contains=function(e){var t;return(0,ne.isInt)(e)&&e instanceof ne.default?e.greaterThanOrEqual(this._minInteger)&&e.lessThanOrEqual(this._maxInteger):"bigint"==typeof e?(t=(0,ne.int)(e)).greaterThanOrEqual(this._minInteger)&&t.lessThanOrEqual(this._maxInteger):e>=this._minNumber&&e<=this._maxNumber},be.prototype.toString=function(){return"[".concat(this._minNumber,", ").concat(this._maxNumber,"]")},s=be,a.YEAR_RANGE=new s(-999999999,999999999),a.MONTH_OF_YEAR_RANGE=new s(1,12),a.DAY_OF_MONTH_RANGE=new s(1,31),a.HOUR_OF_DAY_RANGE=new s(0,23),a.MINUTE_OF_HOUR_RANGE=new s(0,59),a.SECOND_OF_MINUTE_RANGE=new s(0,59),a.NANOSECOND_OF_SECOND_RANGE=new s(0,999999999),a.MINUTES_PER_HOUR=60,a.SECONDS_PER_MINUTE=60,a.SECONDS_PER_HOUR=a.SECONDS_PER_MINUTE*a.MINUTES_PER_HOUR,a.NANOS_PER_SECOND=1e9,a.NANOS_PER_MILLISECOND=1e6,a.NANOS_PER_MINUTE=a.NANOS_PER_SECOND*a.SECONDS_PER_MINUTE,a.NANOS_PER_HOUR=a.NANOS_PER_MINUTE*a.MINUTES_PER_HOUR,a.DAYS_0000_TO_1970=719528,a.DAYS_PER_400_YEAR_CYCLE=146097,a.SECONDS_PER_DAY=86400,a.normalizeSecondsForDuration=function(e,t){return(0,ne.int)(e).add(me(t,a.NANOS_PER_SECOND))},a.normalizeNanosecondsForDuration=function(e){return ge(e,a.NANOS_PER_SECOND)},a.localTimeToNanoOfDay=function(e,t,r,n){return e=(0,ne.int)(e),t=(0,ne.int)(t),r=(0,ne.int)(r),n=(0,ne.int)(n),(e=(e=(e=e.multiply(a.NANOS_PER_HOUR)).add(t.multiply(a.NANOS_PER_MINUTE))).add(r.multiply(a.NANOS_PER_SECOND))).add(n)},a.localDateTimeToEpochSecond=function(e,t,r,n,o,i,u){return e=ye(e,t,r),t=function(e,t,r){e=(0,ne.int)(e),t=(0,ne.int)(t),r=(0,ne.int)(r);e=e.multiply(a.SECONDS_PER_HOUR);return(e=e.add(t.multiply(a.SECONDS_PER_MINUTE))).add(r)}(n,o,i),e.multiply(a.SECONDS_PER_DAY).add(t)},a.dateToEpochDay=ye,a.durationToIsoString=function(e,t,r,n){return e=we(e),t=we(t),r=function(e,t){e=(0,ne.int)(e),t=(0,ne.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=Oe((n?t.negate().add(2*a.NANOS_PER_SECOND):t.add(a.NANOS_PER_SECOND)).modulo(a.NANOS_PER_SECOND)));return null!=r?e+r:e}(r,n),"P".concat(e,"M").concat(t,"DT").concat(r,"S")},a.timeToIsoString=function(e,t,r,n){return e=we(e,2),t=we(t,2),r=we(r,2),n=Oe(n),"".concat(e,":").concat(t,":").concat(r).concat(n)},a.timeZoneOffsetToIsoString=function(e){if((e=(0,ne.int)(e)).equals(0))return"Z";var t=(r=e.isNegative())?"-":"+",r=we((e=r?e.multiply(-1):e).div(a.SECONDS_PER_HOUR),2),n=we(e.div(a.SECONDS_PER_MINUTE).modulo(a.MINUTES_PER_HOUR),2);return null!=(e=(e=e.modulo(a.SECONDS_PER_MINUTE)).equals(0)?null:we(e,2))?"".concat(t).concat(r,":").concat(n,":").concat(e):"".concat(t).concat(r,":").concat(n)},a.dateToIsoString=function(e,t,r){return e=function(e){e=(0,ne.int)(e);if(e.isNegative()||e.greaterThan(9999))return we(e,6,{usePositiveSign:!0});return we(e,4)}(e),t=we(t,2),r=we(r,2),"".concat(e,"-").concat(t,"-").concat(r)},a.isoStringToStandardDate=function(e){return new Date(e)},a.toStandardDate=function(e){return new Date(e)},a.newDate=function(e){return new Date(e)},a.totalNanoseconds=function(e,t){return t=null!=t?t:0,e=e.getMilliseconds()*a.NANOS_PER_MILLISECOND,t instanceof ne.default?t.add(e):"bigint"==typeof t?t+BigInt(e):t+e},a.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*a.SECONDS_PER_MINUTE+t},a.assertValidYear=function(e){return ve(e,a.YEAR_RANGE,"Year")},a.assertValidMonth=function(e){return ve(e,a.MONTH_OF_YEAR_RANGE,"Month")},a.assertValidDay=function(e){return ve(e,a.DAY_OF_MONTH_RANGE,"Day")},a.assertValidHour=function(e){return ve(e,a.HOUR_OF_DAY_RANGE,"Hour")},a.assertValidMinute=function(e){return ve(e,a.MINUTE_OF_HOUR_RANGE,"Minute")},a.assertValidSecond=function(e){return ve(e,a.SECOND_OF_MINUTE_RANGE,"Second")},a.assertValidNanosecond=function(e){return ve(e,a.NANOSECOND_OF_SECOND_RANGE,"Nanosecond")},ue=new Map,a.assertValidZoneId=function(t,r){var e=ue.get(r);if(!0!==e){if(!1===e)throw _e(r,t);try{Intl.DateTimeFormat(void 0,{timeZone:r}),ue.set(r,!0)}catch(e){throw ue.set(r,!1),_e(r,t)}}},a.floorDiv=me,a.floorMod=ge;var 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]}),Pe=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)&&Ee(t,e,r);return Pe(t,e),t},Se=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},c=(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,s(o)),Te=u,je=t,Ce=s(n),s={value:!0,enumerable:!1,configurable:!1,writable:!1},Ie="__isDuration__",Re="__isLocalTime__",Ae="__isTime__",ke="__isDate__",Me="__isLocalDateTime__",Ne="__isDateTime__",l=(xe.prototype.toString=function(){return c.durationToIsoString(this.months,this.days,this.seconds,this.nanoseconds)},xe);function xe(e,t,r,n){this.months=(0,Te.assertNumberOrInteger)(e,"Months"),this.days=(0,Te.assertNumberOrInteger)(t,"Days"),(0,Te.assertNumberOrInteger)(r,"Seconds"),(0,Te.assertNumberOrInteger)(n,"Nanoseconds"),this.seconds=c.normalizeSecondsForDuration(r,n),this.nanoseconds=c.normalizeNanosecondsForDuration(n),Object.freeze(this)}i.Duration=l,Object.defineProperty(l.prototype,Ie,s),i.isDuration=function(e){return We(e,Ie)};De.fromStandardDate=function(e,t){ze(e,t);t=c.totalNanoseconds(e,t);return new De(e.getHours(),e.getMinutes(),e.getSeconds(),t instanceof Ce.default?t.toInt():"bigint"==typeof t?(0,Ce.int)(t).toInt():t)},De.prototype.toString=function(){return c.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)};l=De;function De(e,t,r,n){this.hour=c.assertValidHour(e),this.minute=c.assertValidMinute(t),this.second=c.assertValidSecond(r),this.nanosecond=c.assertValidNanosecond(n),Object.freeze(this)}i.LocalTime=l,Object.defineProperty(l.prototype,Re,s),i.isLocalTime=function(e){return We(e,Re)};Ue.fromStandardDate=function(e,t){return ze(e,t),new Ue(e.getHours(),e.getMinutes(),e.getSeconds(),(0,Ce.toNumber)(c.totalNanoseconds(e,t)),c.timeZoneOffsetInSeconds(e))},Ue.prototype.toString=function(){return c.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)+c.timeZoneOffsetToIsoString(this.timeZoneOffsetSeconds)};l=Ue;function Ue(e,t,r,n,o){this.hour=c.assertValidHour(e),this.minute=c.assertValidMinute(t),this.second=c.assertValidSecond(r),this.nanosecond=c.assertValidNanosecond(n),this.timeZoneOffsetSeconds=(0,Te.assertNumberOrInteger)(o,"Time zone offset in seconds"),Object.freeze(this)}i.Time=l,Object.defineProperty(l.prototype,Ae,s),i.isTime=function(e){return We(e,Ae)};Le.fromStandardDate=function(e){return ze(e),new Le(e.getFullYear(),e.getMonth()+1,e.getDate())},Le.prototype.toStandardDate=function(){return c.isoStringToStandardDate(this.toString())},Le.prototype.toString=function(){return c.dateToIsoString(this.year,this.month,this.day)};l=Le;function Le(e,t,r){this.year=c.assertValidYear(e),this.month=c.assertValidMonth(t),this.day=c.assertValidDay(r),Object.freeze(this)}i.Date=l,Object.defineProperty(l.prototype,ke,s),i.isDate=function(e){return We(e,ke)};Fe.fromStandardDate=function(e,t){return ze(e,t),new Fe(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,Ce.toNumber)(c.totalNanoseconds(e,t)))},Fe.prototype.toStandardDate=function(){return c.isoStringToStandardDate(this.toString())},Fe.prototype.toString=function(){return qe(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)};l=Fe;function Fe(e,t,r,n,o,i,u){this.year=c.assertValidYear(e),this.month=c.assertValidMonth(t),this.day=c.assertValidDay(r),this.hour=c.assertValidHour(n),this.minute=c.assertValidMinute(o),this.second=c.assertValidSecond(i),this.nanosecond=c.assertValidNanosecond(u),Object.freeze(this)}i.LocalDateTime=l,Object.defineProperty(l.prototype,Me,s),i.isLocalDateTime=function(e){return We(e,Me)};Be.fromStandardDate=function(e,t){return ze(e,t),new Be(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,Ce.toNumber)(c.totalNanoseconds(e,t)),c.timeZoneOffsetInSeconds(e),null)},Be.prototype.toStandardDate=function(){return c.toStandardDate(this._toUTC())},Be.prototype.toString=function(){var e;return qe(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)+(null!=this.timeZoneOffsetSeconds?c.timeZoneOffsetToIsoString(null!=(e=this.timeZoneOffsetSeconds)?e:0):"")+(null!=this.timeZoneId?"[".concat(this.timeZoneId,"]"):"")},Be.prototype._toUTC=function(){if(void 0===this.timeZoneOffsetSeconds)throw new Error("Requires DateTime created with time zone offset");var e=c.localDateTimeToEpochSecond(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond).subtract(null!=(e=this.timeZoneOffsetSeconds)?e:0);return(0,Ce.int)(e).multiply(1e3).add((0,Ce.int)(this.nanosecond).div(1e6)).toNumber()};l=Be;function Be(e,t,r,n,o,i,u,a,s){this.year=c.assertValidYear(e),this.month=c.assertValidMonth(t),this.day=c.assertValidDay(r),this.hour=c.assertValidHour(n),this.minute=c.assertValidMinute(o),this.second=c.assertValidSecond(i),this.nanosecond=c.assertValidNanosecond(u);e=Se(function(e,t){var r=null!=e,n=null!=t&&""!==t;if(!r&&!n)throw(0,je.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,Te.assertNumberOrInteger)(e,"Time zone offset in seconds"),o[0]=e);n&&((0,Te.assertString)(t,"Time zone ID"),c.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 We(e,t){return null!=e&&!0===e[t]}function qe(e,t,r,n,o,i,u){return c.dateToIsoString(e,t,r)+"T"+c.timeToIsoString(n,o,i,u)}function ze(e,t){(0,Te.assertValidDate)(e,"Standard date"),null!=t&&(0,Te.assertNumberOrInteger)(t,"Nanosecond")}i.DateTime=l,Object.defineProperty(l.prototype,Ne,s),i.isDateTime=function(e){return We(e,Ne)};var l={},Ve=(Object.defineProperty(l,"__esModule",{value:!0}),l.isPathSegment=l.PathSegment=l.isPath=l.Path=l.isUnboundRelationship=l.UnboundRelationship=l.isRelationship=l.Relationship=l.isNode=l.Node=void 0,X),s={value:!0,enumerable:!1,configurable:!1,writable:!1},He="__isNode__",Ge="__isRelationship__",Ye="__isUnboundRelationship__",Ke="__isPath__",Ze="__isPathSegment__";function Xe(e,t){return null!=e&&!0===e[t]}Je.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,Ve.stringify)(this.properties[r[t]]);e+="}"}return e+=")"};var Qe=Je;function Je(e,t,r,n){this.identity=e,this.labels=t,this.properties=r,this.elementId=ot(n,function(){return e.toString()})}l.Node=Qe,Object.defineProperty(Qe.prototype,He,s),l.isNode=function(e){return Xe(e,He)};et.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,Ve.stringify)(this.properties[t[r]]);e+="}"}return e+="]->("+this.endNodeElementId+")"};var $e=et;function et(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=ot(i,function(){return e.toString()}),this.startNodeElementId=ot(u,function(){return t.toString()}),this.endNodeElementId=ot(a,function(){return r.toString()})}l.Relationship=$e,Object.defineProperty($e.prototype,Ge,s),l.isRelationship=function(e){return Xe(e,Ge)};tt.prototype.bind=function(e,t){return new $e(this.identity,e,t,this.type,this.properties,this.elementId)},tt.prototype.bindTo=function(e,t){return new $e(this.identity,e.identity,t.identity,this.type,this.properties,this.elementId,e.elementId,t.elementId)},tt.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,Ve.stringify)(this.properties[t[r]]);e+="}"}return e+="]->"};Qe=tt;function tt(e,t,r,n){this.identity=e,this.type=t,this.properties=r,this.elementId=ot(n,function(){return e.toString()})}l.UnboundRelationship=Qe,Object.defineProperty(Qe.prototype,Ye,s),l.isUnboundRelationship=function(e){return Xe(e,Ye)};function rt(e,t,r){this.start=e,this.relationship=t,this.end=r}l.PathSegment=rt,Object.defineProperty(rt.prototype,Ze,s),l.isPathSegment=function(e){return Xe(e,Ze)};function nt(e,t,r){this.start=e,this.end=t,this.segments=r,this.length=r.length}function ot(e,t){return null==e?t():e}l.Path=nt,Object.defineProperty(nt.prototype,Ke,s),l.isPath=function(e){return Xe(e,Ke)};var Qe={},it=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}}}},ut=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.")},at=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},st=(Object.defineProperty(Qe,"__esModule",{value:!0}),t);function ct(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)}ct.prototype.forEach=function(e){var t,r;try{for(var n=ut(this.entries()),o=n.next();!o.done;o=n.next()){var i=at(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}}},ct.prototype.map=function(e){var t,r,n=[];try{for(var o=ut(this.entries()),i=o.next();!i.done;i=o.next()){var u=at(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},ct.prototype.entries=function(){var t;return it(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]}})},ct.prototype.values=function(){var t;return it(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]}})},ct.prototype[Symbol.iterator]=function(){var t;return it(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]}})},ct.prototype.toObject=function(){var t,e,r={};try{for(var n=ut(this.entries()),o=n.next();!o.done;o=n.next()){var i=at(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},ct.prototype.get=function(e){var t;if("number"!=typeof e){if(void 0===(t=this._fieldLookup[e]))throw(0,st.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,st.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]},ct.prototype.has=function(e){return"number"==typeof e?0<=e&&e<this._fields.length:void 0!==this._fieldLookup[e]},Qe.default=ct;var s={},lt=(Object.defineProperty(s,"__esModule",{value:!0}),s.isPoint=s.Point=void 0,u),ft="__isPoint__",f=(pt.prototype.toString=function(){return null==this.z||isNaN(this.z)?"Point{srid=".concat(dt(this.srid),", x=").concat(dt(this.x),", y=").concat(dt(this.y),"}"):"Point{srid=".concat(dt(this.srid),", x=").concat(dt(this.x),", y=").concat(dt(this.y),", z=").concat(dt(this.z),"}")},pt);function pt(e,t,r,n){this.srid=(0,lt.assertNumberOrInteger)(e,"SRID"),this.x=(0,lt.assertNumber)(t,"X coordinate"),this.y=(0,lt.assertNumber)(r,"Y coordinate"),this.z=null==n?n:(0,lt.assertNumber)(n,"Z coordinate"),Object.freeze(this)}function dt(e){return Number.isInteger(e)?e.toString()+".0":e.toString()}s.Point=f,Object.defineProperty(f.prototype,ft,{value:!0,enumerable:!1,configurable:!1,writable:!1}),s.isPoint=function(e){return null!=e&&!0===e[ft]};var f={},p={},h={},b=(Object.defineProperty(h,"__esModule",{value:!0}),h.FailedObserver=h.CompletedObserver=void 0,ht.prototype.subscribe=function(e){yt(e,e.onKeys,[]),yt(e,e.onCompleted,{})},ht.prototype.cancel=function(){},ht.prototype.pause=function(){},ht.prototype.resume=function(){},ht.prototype.prepareToHandleSingleResponse=function(){},ht.prototype.markCompleted=function(){},ht.prototype.onError=function(e){throw new Error("CompletedObserver not supposed to call onError",{cause:e})},ht);function ht(){}function bt(e){var t=e.error,e=e.onError;this._error=t,this._beforeError=e,this._observers=[],this.onError(t)}function yt(e,t,r){null!=t&&t.bind(e)(r)}h.CompletedObserver=b,bt.prototype.subscribe=function(e){yt(e,e.onError,this._error),this._observers.push(e)},bt.prototype.onError=function(t){yt(this,this._beforeError,t),this._observers.forEach(function(e){return yt(e,e.onError,t)})},bt.prototype.cancel=function(){},bt.prototype.pause=function(){},bt.prototype.resume=function(){},bt.prototype.markCompleted=function(){},bt.prototype.prepareToHandleSingleResponse=function(){},h.FailedObserver=bt;var b={},_t=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]}),vt=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),y=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(t,e,r);return vt(t,e),t},mt=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},gt=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))},Ot=(Object.defineProperty(b,"__esModule",{value:!0}),b.Bookmarks=void 0,y(u)),y=(wt.empty=function(){return Et},wt.prototype.isEmpty=function(){return 0===this._values.length},wt.prototype.values=function(){return this._values},wt.prototype[Symbol.iterator]=function(){return this._values[Symbol.iterator]()},wt.prototype.asBeginTransactionParameters=function(){var e;return this.isEmpty()?{}:((e={}).bookmarks=this._values,e)},wt);function wt(e){this._values=function(e){if(null==e||""===e)return[];if(Ot.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(!Ot.isString(o))throw new TypeError("Bookmark value should be a string, given: '".concat(o,"'"));t.add(o)}}return gt([],mt(t),!1)}throw new TypeError("Bookmarks should either be a string or a string array, given: '".concat(e,"'"))}(e)}var Et=new(b.Bookmarks=y)(null);var Pt,St,y={},_=(Object.defineProperty(y,"__esModule",{value:!0}),y.TELEMETRY_APIS=y.BOLT_PROTOCOL_V5_6=y.BOLT_PROTOCOL_V5_5=y.BOLT_PROTOCOL_V5_4=y.BOLT_PROTOCOL_V5_3=y.BOLT_PROTOCOL_V5_2=y.BOLT_PROTOCOL_V5_1=y.BOLT_PROTOCOL_V5_0=y.BOLT_PROTOCOL_V4_4=y.BOLT_PROTOCOL_V4_3=y.BOLT_PROTOCOL_V4_2=y.BOLT_PROTOCOL_V4_1=y.BOLT_PROTOCOL_V4_0=y.BOLT_PROTOCOL_V3=y.BOLT_PROTOCOL_V2=y.BOLT_PROTOCOL_V1=y.DEFAULT_POOL_MAX_SIZE=y.DEFAULT_POOL_ACQUISITION_TIMEOUT=y.DEFAULT_CONNECTION_TIMEOUT_MILLIS=y.ACCESS_MODE_WRITE=y.ACCESS_MODE_READ=y.FETCH_ALL=void 0,y.FETCH_ALL=-1,y.DEFAULT_POOL_ACQUISITION_TIMEOUT=6e4,y.DEFAULT_POOL_MAX_SIZE=100,y.DEFAULT_CONNECTION_TIMEOUT_MILLIS=3e4,y.ACCESS_MODE_READ="READ",y.ACCESS_MODE_WRITE="WRITE",y.BOLT_PROTOCOL_V1=1,y.BOLT_PROTOCOL_V2=2,y.BOLT_PROTOCOL_V3=3,y.BOLT_PROTOCOL_V4_0=4,y.BOLT_PROTOCOL_V4_1=4.1,y.BOLT_PROTOCOL_V4_2=4.2,y.BOLT_PROTOCOL_V4_3=4.3,y.BOLT_PROTOCOL_V4_4=4.4,y.BOLT_PROTOCOL_V5_0=5,y.BOLT_PROTOCOL_V5_1=5.1,y.BOLT_PROTOCOL_V5_2=5.2,y.BOLT_PROTOCOL_V5_3=5.3,y.BOLT_PROTOCOL_V5_4=5.4,y.BOLT_PROTOCOL_V5_5=5.5,y.BOLT_PROTOCOL_V5_6=5.6,y.TELEMETRY_APIS={MANAGED_TRANSACTION:0,UNMANAGED_TRANSACTION:1,AUTO_COMMIT_TRANSACTION:2,EXECUTE_QUERY:3},{}),v={},m=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)}),Tt=(Object.defineProperty(v,"__esModule",{value:!0}),v.Logger=void 0,t),jt="error",Ct="warn",It="info",Rt="debug",At=((g={})[jt]=0,g[Ct]=1,g[It]=2,g[Rt]=3,g),g=(kt.create=function(e){return null!=(null==e?void 0:e.logging)?new kt(function(e){if(null==(null==e?void 0:e.level))return"info";var e=e.level,t=At[e];if(null!=t||0===t)return e;throw(0,Tt.newError)("Illegal logging level: ".concat(e,". Supported levels are: ").concat(Object.keys(At).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,Tt.newError)("Illegal logger function: ".concat(null!=(e=null==(t=null==e?void 0:e.logger)?void 0:t.toString())?e:"undefined"))}(e)):this.noOp()},kt.noOp=function(){return Nt},kt.prototype.isErrorEnabled=function(){return xt(this._level,jt)},kt.prototype.error=function(e){this.isErrorEnabled()&&this._loggerFunction(jt,e)},kt.prototype.isWarnEnabled=function(){return xt(this._level,Ct)},kt.prototype.warn=function(e){this.isWarnEnabled()&&this._loggerFunction(Ct,e)},kt.prototype.isInfoEnabled=function(){return xt(this._level,It)},kt.prototype.info=function(e){this.isInfoEnabled()&&this._loggerFunction(It,e)},kt.prototype.isDebugEnabled=function(){return xt(this._level,Rt)},kt.prototype.debug=function(e){this.isDebugEnabled()&&this._loggerFunction(Rt,e)},kt);function kt(e,t){this._level=e,this._loggerFunction=t}function Mt(){return St.call(this,It,function(e,t){})||this}v.Logger=g,m(Mt,St=g),Mt.prototype.isErrorEnabled=function(){return!1},Mt.prototype.error=function(e){},Mt.prototype.isWarnEnabled=function(){return!1},Mt.prototype.warn=function(e){},Mt.prototype.isInfoEnabled=function(){return!1},Mt.prototype.info=function(e){},Mt.prototype.isDebugEnabled=function(){return!1},Mt.prototype.debug=function(e){};var Nt=new Mt;function xt(e,t){return At[e]>=At[t]}var Dt,m=r&&r.__extends||(Dt=function(e,t){return(Dt=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}Dt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ut=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())})},Lt=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}}}},Ft=(Object.defineProperty(_,"__esModule",{value:!0}),_.EMPTY_CONNECTION_HOLDER=_.ReadOnlyConnectionHolder=_.ConnectionHolder=void 0,t),Bt=u,Wt=y,qt=b,zt=v,g=(Vt.prototype.mode=function(){return this._mode},Vt.prototype.database=function(){return this._database},Vt.prototype.setDatabase=function(e){this._database=e},Vt.prototype.bookmarks=function(){return this._bookmarks},Vt.prototype.connectionProvider=function(){return this._connectionProvider},Vt.prototype.referenceCount=function(){return this._referenceCount},Vt.prototype.initializeConnection=function(){return 0!==this._referenceCount||null==this._connectionProvider?(this._referenceCount++,!1):(this._connectionPromise=this._createConnectionPromise(this._connectionProvider),this._referenceCount++,!0)},Vt.prototype._createConnectionPromise=function(o){return Ut(this,void 0,void 0,function(){var t,r,n;return Lt(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.auth=this._auth,n)])];case 2:return[2,e.sent()]}})})},Vt.prototype._getBookmarks=function(){return Ut(this,void 0,void 0,function(){return Lt(this,function(e){switch(e.label){case 0:return[4,this._getConnectionAcquistionBookmarks()];case 1:return[2,e.sent()]}})})},Vt.prototype.getConnection=function(){return this._connectionPromise},Vt.prototype.releaseConnection=function(){return 0===this._referenceCount?this._connectionPromise:(this._referenceCount--,0===this._referenceCount?this._releaseConnection():this._connectionPromise)},Vt.prototype.close=function(e){return this._closed=!0,0===this._referenceCount?this._connectionPromise:(this._referenceCount=0,this._releaseConnection(e))},Vt.prototype.log=function(){return this._log},Vt.prototype._releaseConnection=function(t){return this._connectionPromise=this._connectionPromise.then(function(e){return null!=e?e.isOpen()&&(e.hasOngoingObservableRequests()||!0===t)?e.resetAndFlush().catch(Zt).then(function(){return e.release().then(function(){return null})}):e.release().then(function(){return null}):Promise.resolve(null)}).catch(this._logError),this._connectionPromise},Vt.prototype._logError=function(e){return this._log.isWarnEnabled()&&this._log.warn("ConnectionHolder got an error while releasing the connection. Error ".concat(e,". Stacktrace: ").concat(e.stack)),null},Vt);function Vt(e){var t=e.mode,r=e.database,r=void 0===r?"":r,n=e.bookmarks,o=e.connectionProvider,i=e.impersonatedUser,u=e.onDatabaseNameResolved,a=e.getConnectionAcquistionBookmarks,s=e.auth,e=e.log;this._mode=null!=t?t:Wt.ACCESS_MODE_WRITE,this._closed=!1,this._database=null!=r?(0,Bt.assertString)(r,"database"):"",this._bookmarks=null!=n?n:qt.Bookmarks.empty(),this._connectionProvider=o,this._impersonatedUser=i,this._referenceCount=0,this._connectionPromise=Promise.resolve(null),this._onDatabaseNameResolved=u,this._auth=s,this._log=e,this._logError=this._logError.bind(this),this._getConnectionAcquistionBookmarks=null!=a?a:function(){return Promise.resolve(qt.Bookmarks.empty())}}_.ConnectionHolder=g;m(Yt,Ht=g),Yt.prototype.initializeConnection=function(){return 0!==this._connectionHolder.referenceCount()},Yt.prototype.getConnection=function(){return this._connectionHolder.getConnection()},Yt.prototype.releaseConnection=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})},Yt.prototype.close=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})};var Ht,Gt,O=Yt;function Yt(e){var t=Ht.call(this,{mode:e.mode(),database:e.database(),bookmarks:e.bookmarks(),getConnectionAcquistionBookmarks:e._getConnectionAcquistionBookmarks,connectionProvider:e.connectionProvider(),log:e.log()})||this;return t._connectionHolder=e,t}function Kt(){return Gt.call(this,{log:zt.Logger.create({})})||this}_.ReadOnlyConnectionHolder=O,_.default=O,m(Kt,Gt=g),Kt.prototype.mode=function(){},Kt.prototype.database=function(){},Kt.prototype.initializeConnection=function(){return!0},Kt.prototype.getConnection=function(){return Ut(this,void 0,void 0,function(){return Lt(this,function(e){switch(e.label){case 0:return[4,Promise.reject((0,Ft.newError)("This connection holder does not serve connections"))];case 1:return[2,e.sent()]}})})},Kt.prototype.releaseConnection=function(){return Ut(this,void 0,void 0,function(){return Lt(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})},Kt.prototype.close=function(){return Ut(this,void 0,void 0,function(){return Lt(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})};O=new Kt;function Zt(e){return null}_.EMPTY_CONNECTION_HOLDER=O;var m={},Xt=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]}),Qt=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),g=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)&&Xt(t,e,r);return Qt(t,e),t},Jt=(Object.defineProperty(m,"__esModule",{value:!0}),m.TxConfig=void 0,g(u)),$t=t,er=n,O=(tr.empty=function(){return rr},tr.prototype.isEmpty=function(){return Object.values(this).every(function(e){return null==e})},tr);function tr(e,t){var r;null!=(r=e)&&Jt.assertObject(r,"Transaction config"),this.timeout=function(e,t){if(Jt.isObject(e)&&null!=e.timeout){Jt.assertNumberOrInteger(e.timeout,"Transaction timeout"),!function(e){return"number"==typeof e.timeout&&!Number.isInteger(e.timeout)}(e)||!0!==(null==t?void 0:t.isInfoEnabled())||null==t||t.info("Transaction timeout expected to be an integer, got: ".concat(e.timeout,". The value will be rounded up."));t=(0,er.int)(e.timeout,{ceilFloat:!0});if(t.isNegative())throw(0,$t.newError)("Transaction timeout should not be negative");return t}return null}(e,t),this.metadata=function(e){if(Jt.isObject(e)&&null!=e.metadata){e=e.metadata;if(Jt.assertObject(e,"config.metadata"),0!==Object.keys(e).length)return e}return null}(e)}var rr=new(m.TxConfig=O)({});var g={},nr=r&&r.__assign||function(){return(nr=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)},or=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())})},ir=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}}}},ur=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},ar=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))},sr=(Object.defineProperty(g,"__esModule",{value:!0}),g.TransactionExecutor=void 0,t),cr=y;function lr(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,ar([e,t],ur(r),!1))}function fr(e){return clearTimeout(e)}function pr(e,t,r,n,o){void 0===o&&(o={setTimeout:lr,clearTimeout:fr}),this._maxRetryTimeMs=dr(e,3e4),this._initialRetryDelayMs=dr(t,1e3),this._multiplier=dr(r,2),this._jitterFactor=dr(n,.2),this._setTimeout=o.setTimeout,this._clearTimeout=o.clearTimeout,this._inFlightTimeoutIds=[],this.pipelineBegin=!1,this.telemetryApi=cr.TELEMETRY_APIS.MANAGED_TRANSACTION,this._verifyAfterConstruction()}function dr(e,t){return null!=e?e:t}pr.prototype.execute=function(n,o,i){var u=this,a={apiTransactionConfig:{api:this.telemetryApi,onTelemetrySuccess:function(){a.apiTransactionConfig=void 0}}};return new Promise(function(e,t){u._executeTransactionInsidePromise(n,o,e,t,i,a).catch(t)}).catch(function(e){var t=Date.now(),r=u._initialRetryDelayMs;return u._retryTransactionPromise(n,o,e,t,r,i,a)})},pr.prototype.close=function(){var t=this;this._inFlightTimeoutIds.forEach(function(e){return t._clearTimeout(e)}),this._inFlightTimeoutIds=[]},pr.prototype._retryTransactionPromise=function(o,i,e,r,u,a,s){var c=this;return Date.now()-r>this._maxRetryTimeMs||!(0,sr.isRetriableError)(e)?Promise.reject(e):new Promise(function(e,t){var r=c._computeDelayWithJitter(u),n=c._setTimeout(function(){c._inFlightTimeoutIds=c._inFlightTimeoutIds.filter(function(e){return e!==n}),c._executeTransactionInsidePromise(o,i,e,t,a,s).catch(t)},r);c._inFlightTimeoutIds.push(n)}).catch(function(e){var t=u*c._multiplier;return c._retryTransactionPromise(o,i,e,r,t,a,s)})},pr.prototype._executeTransactionInsidePromise=function(u,a,s,c,l,f){return or(this,void 0,void 0,function(){var t,r,n,o,i=this;return ir(this,function(e){switch(e.label){case 0:return(e.trys.push([0,4,,5]),r=u(null!=(null==f?void 0:f.apiTransactionConfig)?nr({},null==f?void 0:f.apiTransactionConfig):void 0),this.pipelineBegin)?(n=r,[3,3]):[3,1];case 1:return[4,r];case 2:n=e.sent(),e.label=3;case 3:return t=n,[3,5];case 4:return o=e.sent(),c(o),[2];case 5:return o=(null!=l?l:function(e){return e})(t),this._safeExecuteTransactionWork(o,a).then(function(e){return i._handleTransactionWorkSuccess(e,t,s,c)}).catch(function(e){return i._handleTransactionWorkFailure(e,t,c)}),[2]}})})},pr.prototype._safeExecuteTransactionWork=function(e,t){try{var r=t(e);return Promise.resolve(r)}catch(e){return Promise.reject(e)}},pr.prototype._handleTransactionWorkSuccess=function(e,t,r,n){t.isOpen()?t.commit().then(function(){r(e)}).catch(function(e){n(e)}):r(e)},pr.prototype._handleTransactionWorkFailure=function(e,t,r){t.isOpen()?t.rollback().catch(function(e){}).then(function(){return r(e)}).catch(r):r(e)},pr.prototype._computeDelayWithJitter=function(e){var t=e*this._jitterFactor,r=e-t,e=e+t;return Math.random()*(e-r)+r},pr.prototype._verifyAfterConstruction=function(){if(this._maxRetryTimeMs<0)throw(0,sr.newError)("Max retry time should be >= 0: "+this._maxRetryTimeMs.toString());if(this._initialRetryDelayMs<0)throw(0,sr.newError)("Initial retry delay should >= 0: "+this._initialRetryDelayMs.toString());if(this._multiplier<1)throw(0,sr.newError)("Multiplier should be >= 1.0: "+this._multiplier.toString());if(this._jitterFactor<0||1<this._jitterFactor)throw(0,sr.newError)("Jitter factor should be in [0.0, 1.0]: "+this._jitterFactor.toFixed())},g.TransactionExecutor=pr;var O={},hr=r&&r.__assign||function(){return(hr=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)},br=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},yr=(Object.defineProperty(O,"__esModule",{value:!0}),O.Url=O.formatIPv6Address=O.formatIPv4Address=O.defaultPortForScheme=O.parseDatabaseUrl=void 0,u),_r=7687,vr=7474,mr=7473,gr=function(e,t,r,n,o){this.scheme=e,this.host=t,this.port=r,this.hostAndPort=n,this.query=o};function Or(e,t,r){if(""===(e=(null!=e?e:"").trim()))throw new Error("Illegal empty ".concat(t," in URL query '").concat(r,"'"));return e}function wr(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 Er(e){return"http"===e?vr:"https"===e?mr:_r}O.Url=gr,O.parseDatabaseUrl=function(e){(0,yr.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]),br((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=hr(hr({},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(":")?wr(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)?Er(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=Or(e[0],"key",r),e=Or(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)?br(t.split("?"),2)[1]:null,e);return new gr(n,o,u,i,r)},O.formatIPv4Address=function(e,t){return"".concat(e,":").concat(t)},O.formatIPv6Address=function(e,t){return e=wr(e),"".concat(e,":").concat(t)},O.defaultPortForScheme=Er;var w={},Pr=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]}),Sr=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Tr=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)&&Pr(t,e,r);return Sr(t,e),t},jr=(Object.defineProperty(w,"__esModule",{value:!0}),w.ServerAddress=void 0,u),Cr=Tr(O);function Ir(e,t,r,n){this._host=(0,jr.assertString)(e,"host"),this._resolved=null!=t?(0,jr.assertString)(t,"resolved"):null,this._port=(0,jr.assertNumber)(r,"port"),this._hostPort=n,this._stringValue=null!=t?"".concat(n,"(").concat(t,")"):"".concat(n)}Ir.prototype.host=function(){return this._host},Ir.prototype.resolvedHost=function(){return null!=this._resolved?this._resolved:this._host},Ir.prototype.port=function(){return this._port},Ir.prototype.resolveWith=function(e){return new Ir(this._host,e,this._port,this._hostPort)},Ir.prototype.asHostPort=function(){return this._hostPort},Ir.prototype.asKey=function(){return this._hostPort},Ir.prototype.toString=function(){return this._stringValue},Ir.fromUrl=function(e){e=Cr.parseDatabaseUrl(e);return new Ir(e.host,null,e.port,e.hostAndPort)},w.ServerAddress=Ir;var Tr={},E={};function Rr(){}Object.defineProperty(E,"__esModule",{value:!0}),Rr.prototype.resolve=function(){throw new Error("Abstract function")},Rr.prototype._resolveToItself=function(e){return Promise.resolve([e])},E.default=Rr;var Ar={},kr=(Object.defineProperty(Ar,"__esModule",{value:!0}),w);function Mr(e){return Promise.resolve([e])}function Nr(e){this._resolverFunction=null!=e?e:Mr}Nr.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 kr.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))})},Ar.default=Nr;var xr,P=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},E=(Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.ConfiguredCustomResolver=Tr.BaseHostNameResolver=void 0,P(E)),E=(Tr.BaseHostNameResolver=E.default,P(Ar)),P=(Tr.ConfiguredCustomResolver=E.default,{}),E={};Object.defineProperty(E,"__esModule",{value:!0}),E.fromVersion=void 0,E.fromVersion=function(e,t){var r=null!=(t=(t=void 0===t?function(){return{get userAgent(){}}}:t)()).userAgent?t.userAgent.split("(")[1].split(")")[0]:void 0,t=t.userAgent||void 0;return{product:"neo4j-javascript/".concat(e),platform:r,languageDetails:t}},S=P,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]}),Dr=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||xr(t,e,r)},Object.defineProperty(S,"__esModule",{value:!0}),Dr(E,S);var Dr={},E={},S=(Object.defineProperty(E,"__esModule",{value:!0}),E.DEFAULT_ACQUISITION_TIMEOUT=E.DEFAULT_MAX_SIZE=void 0,E.DEFAULT_MAX_SIZE=100,E.DEFAULT_ACQUISITION_TIMEOUT=6e4,Ur.defaultConfig=function(){return new Ur(100,6e4)},Ur.fromDriverConfig=function(e){return new Ur(Fr(e.maxConnectionPoolSize)?e.maxConnectionPoolSize:100,Fr(e.connectionAcquisitionTimeout)?e.connectionAcquisitionTimeout:6e4)},Ur);function Ur(e,t){this.maxSize=Lr(e,100),this.acquisitionTimeout=Lr(t,6e4)}function Lr(e,t){return Fr(e)?e:t}function Fr(e){return 0===e||null!=e}E.default=S;var S={},Br=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())})},Wr=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}}}},qr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},zr=(Object.defineProperty(S,"__esModule",{value:!0}),qr(E)),Vr=t,Hr=v,qr=(Gr.prototype.acquire=function(a,s,c){return Br(this,void 0,void 0,function(){var o,i,u=this;return Wr(this,function(e){switch(e.label){case 0:return o=s.asKey(),i=this._acquireRequests,null==i[o]&&(i[o]=[]),[4,new Promise(function(e,t){var r=setTimeout(function(){var e,t=i[o];null!=t&&(i[o]=t.filter(function(e){return e!==n})),n.isCompleted()||(t=u.activeResourceCount(s),e=u.has(s)?u._pools[o].length:0,n.reject((0,Vr.newError)("Connection acquisition timed out in ".concat(u._acquisitionTimeout," ms. Pool status: Active conn count = ").concat(t,", Idle conn count = ").concat(e,"."))))},u._acquisitionTimeout),n=("object"==typeof r&&r.unref(),new Zr(o,a,c,e,t,r,u._log));i[o].push(n),u._processPendingAcquireRequests(s)})];case 1:return[2,e.sent()]}})})},Gr.prototype.purge=function(t){return Br(this,void 0,void 0,function(){return Wr(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t.asKey())];case 1:return[2,e.sent()]}})})},Gr.prototype.apply=function(e,t){e=e.asKey();e in this._pools&&this._pools[e].apply(t)},Gr.prototype.close=function(){return Br(this,void 0,void 0,function(){var r=this;return Wr(this,function(e){switch(e.label){case 0:return this._closed=!0,[4,Promise.all(Object.keys(this._pools).map(function(t){return Br(r,void 0,void 0,function(){return Wr(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t)];case 1:return[2,e.sent()]}})})})).then()];case 1:return[2,e.sent()]}})})},Gr.prototype.keepAll=function(o){return Br(this,void 0,void 0,function(){var t,r,n=this;return Wr(this,function(e){switch(e.label){case 0:return t=o.map(function(e){return e.asKey()}),r=Object.keys(this._pools),r=r.filter(function(e){return!t.includes(e)}),[4,Promise.all(r.map(function(t){return Br(n,void 0,void 0,function(){return Wr(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t)];case 1:return[2,e.sent()]}})})})).then()];case 1:return[2,e.sent()]}})})},Gr.prototype.has=function(e){return e.asKey()in this._pools},Gr.prototype.activeResourceCount=function(e){return null!=(e=this._activeResourceCounts[e.asKey()])?e:0},Gr.prototype._getOrInitializePoolFor=function(e){var t=this._pools[e];return null==t&&(t=new en,this._pools[e]=t,this._pendingCreates[e]=0),t},Gr.prototype._acquire=function(s,c,l){return Br(this,void 0,void 0,function(){var t,n,r,o,i,u,a=this;return Wr(this,function(e){switch(e.label){case 0:if(this._closed)throw(0,Vr.newError)("Pool is closed, it is no more able to serve requests.");if(t=c.asKey(),n=this._getOrInitializePoolFor(t),l)return[3,9];e.label=1;case 1:if(!(0<n.length))return[3,9];if(null==(r=n.pop()))return[3,1];Yr(t,this._activeResourceCounts),null!=this._removeIdleObserver&&this._removeIdleObserver(r),o=!1,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,this._validateOnAcquire(s,r)];case 3:return o=e.sent(),[3,5];case 4:return u=e.sent(),this._log.isErrorEnabled()&&this._log.error("Failure on validate ".concat(r,". This is a bug, please report it. Caused by: ").concat(u.message)),[3,5];case 5:return o?(this._log.isDebugEnabled()&&this._log.debug("".concat(r," acquired from the pool ").concat(t)),[2,{resource:r,pool:n}]):[3,6];case 6:return Kr(t,this._activeResourceCounts),n.removeInUse(r),[4,this._destroy(r)];case 7:e.sent(),e.label=8;case 8:return[3,1];case 9:if(0<this._maxSize&&this.activeResourceCount(c)+this._pendingCreates[t]>=this._maxSize)return[2,{resource:null,pool:n}];this._pendingCreates[t]=this._pendingCreates[t]+1,e.label=10;case 10:return(e.trys.push([10,,14,15]),this.activeResourceCount(c)+n.length>=this._maxSize&&l)?null==(u=n.pop())?[3,12]:(null!=this._removeIdleObserver&&this._removeIdleObserver(u),n.removeInUse(u),[4,this._destroy(u)]):[3,12];case 11:e.sent(),e.label=12;case 12:return[4,this._create(s,c,function(t,r){return Br(a,void 0,void 0,function(){return Wr(this,function(e){switch(e.label){case 0:return[4,this._release(t,r,n)];case 1:return[2,e.sent()]}})})})];case 13:return i=e.sent(),n.pushInUse(i),Yr(t,this._activeResourceCounts),this._log.isDebugEnabled()&&this._log.debug("".concat(i," created for the pool ").concat(t)),[3,15];case 14:return this._pendingCreates[t]=this._pendingCreates[t]-1,[7];case 15:return[2,{resource:i,pool:n}]}})})},Gr.prototype._release=function(n,o,i){return Br(this,void 0,void 0,function(){var t,r=this;return Wr(this,function(e){switch(e.label){case 0:t=n.asKey(),e.label=1;case 1:return(e.trys.push([1,,9,10]),i.isActive())?[4,this._validateOnRelease(o)]:[3,6];case 2:return e.sent()?[3,4]:(this._log.isDebugEnabled()&&this._log.debug("".concat(o," destroyed and can't be released to the pool ").concat(t," because it is not functional")),i.removeInUse(o),[4,this._destroy(o)]);case 3:return e.sent(),[3,5];case 4:null!=this._installIdleObserver&&this._installIdleObserver(o,{onError:function(e){r._log.debug("Idle connection ".concat(o," destroyed because of error: ").concat(e));e=r._pools[t];null!=e&&(r._pools[t]=e.filter(function(e){return e!==o}),e.removeInUse(o)),r._destroy(o).catch(function(){})}}),i.push(o),this._log.isDebugEnabled()&&this._log.debug("".concat(o," released to the pool ").concat(t)),e.label=5;case 5:return[3,8];case 6:return this._log.isDebugEnabled()&&this._log.debug("".concat(o," destroyed and can't be released to the pool ").concat(t," because pool has been purged")),i.removeInUse(o),[4,this._destroy(o)];case 7:e.sent(),e.label=8;case 8:return[3,10];case 9:return Kr(t,this._activeResourceCounts),this._processPendingAcquireRequests(n),[7];case 10:return[2]}})})},Gr.prototype._purgeKey=function(o){return Br(this,void 0,void 0,function(){var t,r,n;return Wr(this,function(e){switch(e.label){case 0:if(t=this._pools[o],r=[],null==t)return[3,2];for(;0<t.length;)null!=(n=t.pop())&&(null!=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]}})})},Gr.prototype._processPendingAcquireRequests=function(r){var n,o=this,i=r.asKey(),e=this._acquireRequests[i];null!=e&&(null!=(n=e.shift())?this._acquire(n.context,r,n.requireNew).catch(function(e){return n.reject(e),{resource:null,pool:null}}).then(function(e){var t=e.resource,e=e.pool;null!=t&&null!=e?n.isCompleted()?o._release(r,t,e).catch(function(e){o._log.isDebugEnabled()&&o._log.debug("".concat(t," could not be release back to the pool. Cause: ").concat(e))}):n.resolve(t):n.isCompleted()||(null==o._acquireRequests[i]&&(o._acquireRequests[i]=[]),o._acquireRequests[i].unshift(n))}).catch(function(e){return n.reject(e)}):delete this._acquireRequests[i])},Gr);function Gr(e){var t=e.create,t=void 0===t?function(e,t,r){return Br(s,void 0,void 0,function(){return Wr(this,function(e){switch(e.label){case 0:return[4,Promise.reject(new Error("Not implemented"))];case 1:return[2,e.sent()]}})})}:t,r=e.destroy,r=void 0===r?function(e){return Br(s,void 0,void 0,function(){return Wr(this,function(e){switch(e.label){case 0:return[4,Promise.resolve()];case 1:return[2,e.sent()]}})})}:r,n=e.validateOnAcquire,n=void 0===n?function(e,t){return!0}:n,o=e.validateOnRelease,o=void 0===o?function(e){return!0}:o,i=e.installIdleObserver,i=void 0===i?function(e,t){}:i,u=e.removeIdleObserver,u=void 0===u?function(e){}:u,a=e.config,a=void 0===a?zr.default.defaultConfig():a,e=e.log,e=void 0===e?Hr.Logger.noOp():e,s=this;this._create=t,this._destroy=r,this._validateOnAcquire=n,this._validateOnRelease=o,this._installIdleObserver=i,this._removeIdleObserver=u,this._maxSize=a.maxSize,this._acquisitionTimeout=a.acquisitionTimeout,this._pools={},this._pendingCreates={},this._acquireRequests={},this._activeResourceCounts={},this._release=this._release.bind(this),this._log=e,this._closed=!1}function Yr(e,t){var r=null!=(r=t[e])?r:0;t[e]=r+1}function Kr(e,t){var r=(null!=(r=t[e])?r:0)-1;0<r?t[e]=r:delete t[e]}Object.defineProperty(Xr.prototype,"context",{get:function(){return this._context},enumerable:!1,configurable:!0}),Object.defineProperty(Xr.prototype,"requireNew",{get:function(){var e;return null!=(e=this._config.requireNew)&&e},enumerable:!1,configurable:!0}),Xr.prototype.isCompleted=function(){return this._completed},Xr.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))},Xr.prototype.reject=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._reject(e))};var Zr=Xr;function Xr(e,t,r,n,o,i,u){this._key=e,this._context=t,this._resolve=n,this._reject=o,this._timeoutId=i,this._log=u,this._completed=!1,this._config=null!=r?r:{}}tn.prototype.isActive=function(){return this._active},tn.prototype.close=function(){this._active=!1,this._elements=[],this._elementsInUse=new Set},tn.prototype.filter=function(e){return this._elements=this._elements.filter(e),this},tn.prototype.apply=function(e){this._elements.forEach(e),this._elementsInUse.forEach(e)},Object.defineProperty(tn.prototype,"length",{get:function(){return this._elements.length},enumerable:!1,configurable:!0}),tn.prototype.pop=function(){var e=this._elements.pop();return null!=e&&this._elementsInUse.add(e),e},tn.prototype.push=function(e){return this._elementsInUse.delete(e),this._elements.push(e)},tn.prototype.pushInUse=function(e){this._elementsInUse.add(e)},tn.prototype.removeInUse=function(e){this._elementsInUse.delete(e)};var Qr,Jr,$r,en=tn;function tn(){this._active=!0,this._elements=[],this._elementsInUse=new Set}S.default=qr,qr=Dr,Qr=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}),j=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)&&Qr(t,e,r);return Jr(t,e),t},T=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(qr,"__esModule",{value:!0}),qr.DEFAULT_MAX_SIZE=qr.DEFAULT_ACQUISITION_TIMEOUT=qr.PoolConfig=qr.Pool=void 0,$r=j(E),qr.PoolConfig=$r.default,Object.defineProperty(qr,"DEFAULT_ACQUISITION_TIMEOUT",{enumerable:!0,get:function(){return $r.DEFAULT_ACQUISITION_TIMEOUT}}),Object.defineProperty(qr,"DEFAULT_MAX_SIZE",{enumerable:!0,get:function(){return $r.DEFAULT_MAX_SIZE}}),j=T(S),qr.Pool=j.default,qr.default=j.default;var rn=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]}),nn=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),E=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)&&rn(t,e,r);return nn(t,e),t},T=(Object.defineProperty(p,"__esModule",{value:!0}),p.pool=p.boltAgent=p.objectUtil=p.resolver=p.serverAddress=p.urlUtil=p.logger=p.transactionExecutor=p.txConfig=p.connectionHolder=p.constants=p.bookmarks=p.observer=p.temporalUtil=p.util=void 0,E(u)),S=(p.util=T,E(o)),qr=(p.temporalUtil=S,E(h)),j=(p.observer=qr,E(b)),T=(p.bookmarks=j,E(y)),o=(p.constants=T,E(_)),S=(p.connectionHolder=o,E(m)),qr=(p.txConfig=S,E(g)),j=(p.transactionExecutor=qr,E(v)),T=(p.logger=j,E(O)),o=(p.urlUtil=T,E(w)),S=(p.serverAddress=o,E(Tr)),qr=(p.resolver=S,E(Q)),j=(p.objectUtil=qr,E(P)),O=(p.boltAgent=j,E(Dr)),T=(p.pool=O,{}),on=r&&r.__assign||function(){return(on=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)},un=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]}),an=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)&&un(t,e,r);return an(t,e),t},sn=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},cn=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))},ln=(Object.defineProperty(T,"__esModule",{value:!0}),T.buildNotificationsFromMetadata=T.buildGqlStatusObjectFromMetadata=T.polyfillNotification=T.polyfillGqlStatusObject=T.GqlStatusObject=T.Notification=T.notificationClassification=T.notificationCategory=T.notificationSeverityLevel=void 0,w(X)),fn=p,pn={WARNING:{gql_status:"01N42",status_description:"warn: unknown warning"},NO_DATA:{gql_status:"02N42",status_description:"note: no data - unknown subcondition"},INFORMATION:{gql_status:"03N42",status_description:"info: unknown notification"},ERROR:{gql_status:"50N42",status_description:"error: general processing exception - unknown error"}},dn={WARNING:"WARNING",INFORMATION:"INFORMATION",UNKNOWN:"UNKNOWN"},hn=(T.notificationSeverityLevel=dn,Object.freeze(dn),Object.values(dn)),o={HINT:"HINT",UNRECOGNIZED:"UNRECOGNIZED",UNSUPPORTED:"UNSUPPORTED",PERFORMANCE:"PERFORMANCE",DEPRECATION:"DEPRECATION",TOPOLOGY:"TOPOLOGY",SECURITY:"SECURITY",GENERIC:"GENERIC",SCHEMA:"SCHEMA",UNKNOWN:"UNKNOWN"},bn=(T.notificationCategory=o,Object.freeze(o),Object.values(o)),yn=o,_n=(T.notificationClassification=yn,function(e){this.code=e.code,this.title=e.title,this.description=e.description,this.severity=e.severity,this.position=Tn(e.position),this.severityLevel=jn(e.severity),this.rawSeverityLevel=e.severity,this.category=Cn(e.category),this.rawCategory=e.category}),vn=(T.Notification=_n,Object.defineProperty(mn.prototype,"diagnosticRecordAsJsonString",{get:function(){return ln.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),mn);function mn(e){var t;this.gqlStatus=e.gql_status,this.statusDescription=e.status_description,this.diagnosticRecord=null!=(t=e.diagnostic_record)?t:{},this.position=null!=this.diagnosticRecord._position?Tn(this.diagnosticRecord._position):void 0,this.severity=jn(this.diagnosticRecord._severity),this.rawSeverity=this.diagnosticRecord._severity,this.classification=Cn(this.diagnosticRecord._classification),this.rawClassification=this.diagnosticRecord._classification,this.isNotification=null!=e.neo4j_code,Object.freeze(this)}function gn(e){var t;if(null!=e.neo4j_code)return new _n({code:e.neo4j_code,title:e.title,description:e.description,severity:null==(t=e.diagnostic_record)?void 0:t._severity,category:null==(t=e.diagnostic_record)?void 0:t._classification,position:null==(t=e.diagnostic_record)?void 0:t._position})}function On(e){var t=e.severity===dn.WARNING?pn.WARNING:pn.INFORMATION,r={gql_status:t.gql_status,status_description:null!=(r=e.description)?r:t.status_description,neo4j_code:e.code,title:e.title,diagnostic_record:on({},wn)};return null!=e.severity&&(r.diagnostic_record._severity=e.severity),null!=e.category&&(r.diagnostic_record._classification=e.category),null!=e.position&&(r.diagnostic_record._position=e.position),new vn(r)}T.GqlStatusObject=vn,T.polyfillNotification=gn,T.polyfillGqlStatusObject=On;var wn={OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"},En=(Object.freeze(wn),{SUCCESS:new vn({gql_status:"00000",status_description:"note: successful completion",diagnostic_record:wn}),NO_DATA:new vn({gql_status:"02000",status_description:"note: no data",diagnostic_record:wn}),NO_DATA_UNKNOWN_SUBCONDITION:new vn(on(on({},pn.NO_DATA),{diagnostic_record:wn})),OMITTED_RESULT:new vn({gql_status:"00001",status_description:"note: successful completion - omitted result",diagnostic_record:wn})});Object.freeze(En),T.buildGqlStatusObjectFromMetadata=function(e){if(null!=e.statuses)return e.statuses.map(function(e){return new vn(e)});var t=!0===(null==(t=e.stream_summary)?void 0:t.have_records_streamed)?En.SUCCESS:!1===(null==t?void 0:t.has_keys)?En.OMITTED_RESULT:!0===(null==t?void 0:t.pulled)?En.NO_DATA:En.NO_DATA_UNKNOWN_SUBCONDITION;return cn([t],sn(null!=(e=null==(t=e.notifications)?void 0:t.map(On))?e:[]),!1).sort(function(e,t){return Sn(e)-Sn(t)})};var Pn=Object.freeze({"02":0,"01":1,"00":2});function Sn(e){var e=null==(e=e.gqlStatus)?void 0:e.slice(0,2);return null!=(e=Pn[e])?e:9999}function Tn(e){return null==e?{}:{offset:fn.util.toNumber(e.offset),line:fn.util.toNumber(e.line),column:fn.util.toNumber(e.column)}}function jn(e){return hn.includes(e)?e:dn.UNKNOWN}function Cn(e){return bn.includes(e)?e:yn.UNKNOWN}T.buildNotificationsFromMetadata=function(e){return null!=e.notifications?e.notifications.map(function(e){return new _n(e)}):null!=e.statuses?e.statuses.map(gn).filter(function(e){return null!=e}):[]},T.default=_n,Object.defineProperty(f,"__esModule",{value:!0}),f.Stats=f.QueryStatistics=f.ProfiledPlan=f.Plan=f.ServerInfo=f.queryType=void 0;var In=p,Rn=T,Tr=(An.prototype.hasPlan=function(){return this.plan instanceof kn},An.prototype.hasProfile=function(){return this.profile instanceof Mn},An);function An(e,t,r,n){this.query={text:e,parameters:t},this.queryType=r.type,this.counters=new xn(null!=(e=r.stats)?e:{}),this.updateStatistics=this.counters,this.plan=(null!=r.plan||null!=r.profile)&&new kn(null!=(t=r.plan)?t:r.profile),this.profile=null!=r.profile&&new Mn(r.profile),this.notifications=(0,Rn.buildNotificationsFromMetadata)(r),this.gqlStatusObjects=(0,Rn.buildGqlStatusObjectFromMetadata)(r),this.server=new Un(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 kn=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)}):[]},Mn=(f.Plan=kn,Nn.prototype.hasPageCacheStats=function(){return 0<this.pageCacheMisses||0<this.pageCacheHits||0<this.pageCacheHitRatio},Nn);function Nn(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.dbHits=Ln("dbHits",e),this.rows=Ln("rows",e),this.pageCacheMisses=Ln("pageCacheMisses",e),this.pageCacheHits=Ln("pageCacheHits",e),this.pageCacheHitRatio=Ln("pageCacheHitRatio",e),this.time=Ln("time",e),this.children=null!=e.children?e.children.map(function(e){return new Nn(e)}):[]}f.ProfiledPlan=Mn;f.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},Dn.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)},Dn.prototype.updates=function(){return this._stats},Dn.prototype.containsSystemUpdates=function(){return void 0!==this._containsSystemUpdates?this._containsSystemUpdates:0<this._systemUpdates},Dn.prototype.systemUpdates=function(){return this._systemUpdates};var xn=Dn;function Dn(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]=In.util.toNumber(r[e]):"systemUpdates"===t?n._systemUpdates=In.util.toNumber(r[e]):"containsSystemUpdates"===t?n._containsSystemUpdates=r[e]:"containsUpdates"===t&&(n._containsUpdates=r[e])}),this._stats=Object.freeze(this._stats)}f.QueryStatistics=xn;var Un=function(e,t){null!=e&&(this.address=e.address,this.agent=e.version),this.protocolVersion=t};function Ln(e,t,r){return void 0===r&&(r=0),!1!==t&&e in t?(t=t[e],In.util.toNumber(t)):r}f.ServerInfo=Un;function Fn(){throw this.minimumSeverityLevel=void 0,this.disabledCategories=void 0,this.disabledClassifications=void 0,new Error("Not implemented")}function Bn(e){console.log("Uncaught error when processing result: "+e)}function Wn(e){}function qn(e){}f.queryType={READ_ONLY:"r",READ_WRITE:"rw",WRITE_ONLY:"w",SCHEMA_WRITE:"s"},f.default=Tr;var zn,S={},Q=(Object.defineProperty(S,"__esModule",{value:!0}),S.notificationFilterDisabledClassification=S.notificationFilterDisabledCategory=S.notificationFilterMinimumSeverityLevel=void 0,{OFF:"OFF",WARNING:"WARNING",INFORMATION:"INFORMATION"}),qr=(S.notificationFilterMinimumSeverityLevel=Q,Object.freeze(Q),{HINT:"HINT",UNRECOGNIZED:"UNRECOGNIZED",UNSUPPORTED:"UNSUPPORTED",PERFORMANCE:"PERFORMANCE",TOPOLOGY:"TOPOLOGY",SECURITY:"SECURITY",DEPRECATION:"DEPRECATION",GENERIC:"GENERIC",SCHEMA:"SCHEMA"}),P=(S.notificationFilterDisabledCategory=qr,Object.freeze(qr),qr),j=(S.notificationFilterDisabledClassification=P,S.default=Fn,{}),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())})},Hn=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}},Gn=(Object.defineProperty(j,"__esModule",{value:!0}),E(f)),Yn=p,Kn=t,Zn=Yn.connectionHolder.EMPTY_CONNECTION_HOLDER;function Xn(e,t,r,n,o){var i;void 0===o&&(o={high:Number.MAX_VALUE,low:Number.MAX_VALUE}),this[zn]="Result",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:Zn,this._keys=null,this._summary=null,this._error=null,this._watermarks=o}Xn.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)})},Xn.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)})},Xn.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},Xn.prototype[Symbol.asyncIterator]=function(){var e,n=this;if(!this.isOpen())return e=(0,Kn.newError)("Result is already consumed"),{next:function(){return Promise.reject(e)},peek:function(){return Promise.reject(e)}};function o(){return Vn(n,void 0,void 0,function(){var t;return Hn(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,Kn.newError)("InvalidState: Result stream finished without Summary",Kn.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 Vn(n,void 0,void 0,function(){var t;return Hn(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 Vn(n,void 0,void 0,function(){var t;return Hn(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 Vn(n,void 0,void 0,function(){return Hn(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()]}})})}}},Xn.prototype.then=function(e,t){return this._getOrCreatePromise().then(e,t)},Xn.prototype.catch=function(e){return this._getOrCreatePromise().catch(e)},Xn.prototype.finally=function(e){return this._getOrCreatePromise().finally(e)},Xn.prototype.subscribe=function(e){this._subscribe(e).catch(function(){})},Xn.prototype.isOpen=function(){return null===this._summary&&null===this._error},Xn.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)})},Xn.prototype._decorateObserver=function(n){var e,o=this,t=null!=(e=n.onCompleted)?e:Wn,i=null!=(e=n.onError)?e:Bn,r=null!=(e=n.onKeys)?e:qn;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)}}},Xn.prototype._cancel=function(){null===this._summary&&null===this._error&&this._streamObserverPromise.then(function(e){return e.cancel()}).catch(function(){})},Xn.prototype._releaseConnectionAndGetSummary=function(t){var e=Yn.util.validateQueryAndParameters(this._query,this._parameters,{skipAsserts:!0}),r=e.validatedQuery,n=e.params,o=this._connectionHolder;return o.getConnection().then(function(e){return o.releaseConnection().then(function(){return null==e?void 0:e.getProtocolVersion()})},function(e){}).then(function(e){return new Gn.default(r,n,t,e)})},Xn.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 Vn(this,void 0,void 0,function(){var t;return Hn(this,function(e){switch(e.label){case 0:if(0<u.length){if(t=null!=(r=u.shift())?r:(0,Kn.newError)("Unexpected empty buffer",Kn.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 Vn(e,void 0,void 0,function(){var t;return Hn(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 Vn(e,void 0,void 0,function(){var t,r;return Hn(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},zn=Symbol.toStringTag,j.default=Xn;Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.default=function(e,t,r){this.keys=e,this.records=t,this.summary=r};O={},Object.defineProperty(O,"__esModule",{value:!0}),O.Releasable=void 0,Qn.prototype.release=function(){throw new Error("Not implemented")},w=Qn;function Qn(){}function Jn(){}O.Releasable=w,Jn.prototype.acquireConnection=function(e){throw Error("Not implemented")},Jn.prototype.supportsMultiDb=function(){throw Error("Not implemented")},Jn.prototype.supportsTransactionConfig=function(){throw Error("Not implemented")},Jn.prototype.supportsUserImpersonation=function(){throw Error("Not implemented")},Jn.prototype.supportsSessionAuth=function(){throw Error("Not implemented")},Jn.prototype.verifyConnectivityAndGetServerInfo=function(e){throw Error("Not implemented")},Jn.prototype.verifyAuthentication=function(e){throw Error("Not implemented")},Jn.prototype.getNegotiatedProtocolVersion=function(){throw Error("Not Implemented")},Jn.prototype.close=function(){throw Error("Not implemented")},O.default=Jn;o={};function $n(){}Object.defineProperty(o,"__esModule",{value:!0}),$n.prototype.beginTransaction=function(e){throw new Error("Not implemented")},$n.prototype.run=function(e,t,r){throw new Error("Not implemented")},$n.prototype.commitTransaction=function(e){throw new Error("Not implemented")},$n.prototype.rollbackTransaction=function(e){throw new Error("Not implemented")},$n.prototype.resetAndFlush=function(){throw new Error("Not implemented")},$n.prototype.isOpen=function(){throw new Error("Not implemented")},$n.prototype.getProtocolVersion=function(){throw new Error("Not implemented")},$n.prototype.hasOngoingObservableRequests=function(){throw new Error("Not implemented")},o.default=$n;var Tr={},eo=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())})},to=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}}}},Q=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ro=(Object.defineProperty(Tr,"__esModule",{value:!0}),u),no=_,oo=b,io=m,uo=h,ao=t,so=Q(j);function co(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,c=e.lowRecordWatermark,l=e.notificationFilter,e=e.apiTelemetryConfig,f=this;this._connectionHolder=t,this._reactive=i,this._state=lo.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=c,this._highRecordWatermark=s,this._bookmarks=oo.Bookmarks.empty(),this._notificationFilter=l,this._apiTelemetryConfig=e,this._acceptActive=function(){},this._activePromise=new Promise(function(e,t){f._acceptActive=e})}co.prototype._begin=function(o,i,u){var t=this;this._connectionHolder.getConnection().then(function(n){return eo(t,void 0,void 0,function(){var t,r=this;return to(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.beginTransaction({bookmarks:this._bookmarks,txConfig:i,mode:this._connectionHolder.mode(),database:this._connectionHolder.database(),impersonatedUser:this._impersonatedUser,notificationFilter:this._notificationFilter,apiTelemetryConfig:this._apiTelemetryConfig,beforeError:function(e){null!=u&&u.onError(e),r._onError(e).catch(function(){})},afterComplete:function(e){null!=u&&u.onComplete(e),r._onComplete(e)}})];case 2:throw(0,ao.newError)("No connection available")}})})}).catch(function(e){null!=u&&u.onError(e),t._onError(e).catch(function(){})}).finally(function(){return t._acceptActive()})},co.prototype.run=function(e,t){e=(0,ro.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},co.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)}})})},co.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)}})})},co.prototype.isOpen=function(){return this._state===lo.ACTIVE},co.prototype.close=function(){return eo(this,void 0,void 0,function(){return to(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]}})})},co.prototype[Symbol.asyncDispose]=function(){return this.close()},co.prototype._onErrorCallback=function(t){return this._state===lo.FAILED?Promise.resolve(null):(this._state=lo.FAILED,this._onClose(),this._results.forEach(function(e){e.isOpen()&&e._streamObserverPromise.then(function(e){return e.onError(t)}).catch(function(e){})}),this._connectionHolder.releaseConnection())},co.prototype._onCompleteCallback=function(e,t){this._onBookmarks(new oo.Bookmarks(null==e?void 0:e.bookmark),null!=t?t:oo.Bookmarks.empty(),null==e?void 0:e.db)};var lo={ACTIVE:{commit:function(e){return{result:fo(!0,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:lo.SUCCEEDED}},rollback:function(e){return{result:fo(!1,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:lo.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 po(n.getConnection().then(function(e){return f.then(function(){return e})}).then(function(e){if(u(),null!=e)return e.run(t,r,{bookmarks:oo.Bookmarks.empty(),txConfig:io.TxConfig.empty(),beforeError:o,afterComplete:i,reactive:a,fetchSize:s,highRecordWatermark:c,lowRecordWatermark:l});throw(0,ao.newError)("No connection available")}).catch(function(e){return new uo.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:po(new uo.FailedObserver({error:(0,ao.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:lo.FAILED}},rollback:function(e){var t=e.connectionHolder;return e.onError,e.onComplete,{result:po(new uo.CompletedObserver,"ROLLBACK",{},t,0,0),state:lo.FAILED}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,po(new uo.FailedObserver({error:(0,ao.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:po(new uo.FailedObserver({error:(0,ao.newError)("Cannot commit this transaction, because it has already been committed."),onError:r}),"COMMIT",{},no.EMPTY_CONNECTION_HOLDER,0,0),state:lo.SUCCEEDED,connectionHolder:t}},rollback:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:po(new uo.FailedObserver({error:(0,ao.newError)("Cannot rollback this transaction, because it has already been committed."),onError:r}),"ROLLBACK",{},no.EMPTY_CONNECTION_HOLDER,0,0),state:lo.SUCCEEDED,connectionHolder:t}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,po(new uo.FailedObserver({error:(0,ao.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:po(new uo.FailedObserver({error:(0,ao.newError)("Cannot commit this transaction, because it has already been rolled back."),onError:r}),"COMMIT",{},t,0,0),state:lo.ROLLED_BACK}},rollback:function(e){var t=e.connectionHolder;return e.onError,e.onComplete,{result:po(new uo.FailedObserver({error:(0,ao.newError)("Cannot rollback this transaction, because it has already been rolled back.")}),"ROLLBACK",{},t,0,0),state:lo.ROLLED_BACK}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,po(new uo.FailedObserver({error:(0,ao.newError)("Cannot run query in this transaction, because it has already been rolled back."),onError:o}),e,t,n,0,0)}}};function fo(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.commitTransaction({beforeError:n,afterComplete:o}):t.rollbackTransaction({beforeError:n,afterComplete:o});throw(0,ao.newError)("No connection available")})}).catch(function(e){return new uo.FailedObserver({error:e,onError:n})});return new so.default(t,r?"COMMIT":"ROLLBACK",{},e,{high:Number.MAX_VALUE,low:Number.MAX_VALUE})}function po(e,t,r,n,o,i){return void 0===n&&(n=no.EMPTY_CONNECTION_HOLDER),new so.default(Promise.resolve(e),t,r,new no.ReadOnlyConnectionHolder(null!=n?n:no.EMPTY_CONNECTION_HOLDER),{low:i,high:o})}Tr.default=co;qr={};function ho(e){e=e.run;this._run=e}Object.defineProperty(qr,"__esModule",{value:!0}),ho.fromTransaction=function(e){return new ho({run:e.run.bind(e)})},ho.prototype.run=function(e,t){return this._run(e,t)},qr.default=ho;var bo,yo,_o,P={},E=r&&r.__extends||(bo=function(e,t){return(bo=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}bo(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),vo=r&&r.__assign||function(){return(vo=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)},w=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Q=(Object.defineProperty(P,"__esModule",{value:!0}),w(Tr)),w=(_o=Q.default,E(mo,_o),mo.prototype.then=function(e,t){return this._getOrCreateBeginPromise().then(e,t)},mo.prototype.catch=function(e){return this._getOrCreateBeginPromise().catch(e)},mo.prototype.finally=function(e){return this._getOrCreateBeginPromise().finally(e)},mo.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},mo.prototype._toTransaction=function(){return vo(vo({},this),{run:_o.prototype.run.bind(this),commit:_o.prototype.commit.bind(this),rollback:_o.prototype.rollback.bind(this),close:_o.prototype.close.bind(this),isOpen:_o.prototype.isOpen.bind(this),_begin:this._begin.bind(this)})},mo.prototype._begin=function(e,t){return _o.prototype._begin.call(this,e,t,{onError:this._onBeginError.bind(this),onComplete:this._onBeginMetadata.bind(this)})},mo.prototype._onBeginError=function(e){this._beginError=e,null!=this._reject&&this._reject(e)},mo.prototype._onBeginMetadata=function(e){this._beginMetadata=null!=e?e:{},null!=this._resolve&&this._resolve(this._toTransaction())},mo);function mo(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,c=e.lowRecordWatermark,l=e.notificationFilter,e=e.apiTelemetryConfig,t=_o.call(this,{connectionHolder:t,onClose:r,onBookmarks:n,onConnection:o,reactive:i,fetchSize:u,impersonatedUser:a,highRecordWatermark:s,lowRecordWatermark:c,notificationFilter:l,apiTelemetryConfig:e})||this;return t[yo]="TransactionPromise",t}yo=Symbol.toStringTag,P.default=w;var Q={},go=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())})},Oo=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}}}},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,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))},E=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Po=(Object.defineProperty(Q,"__esModule",{value:!0}),h),So=u,To=y,jo=t,Co=E(j),Io=_,Ro=g,Ao=b,ko=m,Mo=E(P),No=E(qr);function xo(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,c=e.bookmarkManager,l=e.notificationFilter,f=e.auth,e=e.log,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 Io.ConnectionHolder({mode:To.ACCESS_MODE_READ,auth:f,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved,getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks,log:e}),this._writeConnectionHolder=new Io.ConnectionHolder({mode:To.ACCESS_MODE_WRITE,auth:f,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved,getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks,log:e}),this._open=!0,this._hasTx=!1,this._impersonatedUser=s,this._lastBookmarks=null!=n?n:Ao.Bookmarks.empty(),this._configuredBookmarks=this._lastBookmarks,this._transactionExecutor=function(e){e=null!=(e=null==e?void 0:e.maxTransactionRetryTime)?e:null;return new Ro.TransactionExecutor(e)}(i),this._databaseNameResolved=""!==this._database,this._calculateWatermaks());this._lowRecordWatermark=t.low,this._highRecordWatermark=t.high,this._results=[],this._bookmarkManager=c,this._notificationFilter=l,this._log=e}xo.prototype.run=function(e,t,r){var o=this,e=(0,So.validateQueryAndParameters)(e,t),i=e.validatedQuery,u=e.params,a=null!=r?new ko.TxConfig(r,this._log):ko.TxConfig.empty(),t=this._run(i,u,function(n){return go(o,void 0,void 0,function(){var t,r=this;return Oo(this,function(e){switch(e.label){case 0:return[4,this._bookmarks()];case 1:return t=e.sent(),this._assertSessionIsOpen(),[2,n.run(i,u,{bookmarks:t,txConfig:a,mode:this._mode,database:this._database,apiTelemetryConfig:{api:To.TELEMETRY_APIS.AUTO_COMMIT_TRANSACTION},impersonatedUser:this._impersonatedUser,afterComplete:function(e){return r._onCompleteCallback(e,t)},reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark,notificationFilter:this._notificationFilter})]}})})});return this._results.push(t),t},xo.prototype._run=function(e,t,r){var r=this._acquireAndConsumeConnection(r),n=r.connectionHolder,r=r.resultPromise.catch(function(e){return Promise.resolve(new Po.FailedObserver({error:e}))}),o={high:this._highRecordWatermark,low:this._lowRecordWatermark};return new Co.default(r,e,t,n,o)},xo.prototype._acquireConnection=function(e){var r=this,e=this._acquireAndConsumeConnection(e),n=e.connectionHolder;return e.resultPromise.then(function(t){return go(r,void 0,void 0,function(){return Oo(this,function(e){switch(e.label){case 0:return[4,n.releaseConnection()];case 1:return e.sent(),[2,t]}})})})},xo.prototype._acquireAndConsumeConnection=function(t){var e=this._connectionHolderWithMode(this._mode),r=this._open?!this._hasTx&&e.initializeConnection()?e.getConnection().then(function(e){return t(e)}):Promise.reject((0,jo.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,jo.newError)("Cannot run query in a closed session."));return{connectionHolder:e,resultPromise:r}},xo.prototype.beginTransaction=function(e){var t=ko.TxConfig.empty();return null!=e&&(t=new ko.TxConfig(e,this._log)),this._beginTransaction(this._mode,t,{api:To.TELEMETRY_APIS.UNMANAGED_TRANSACTION})},xo.prototype._beginTransaction=function(e,t,r){var n=this;if(!this._open)throw(0,jo.newError)("Cannot begin a transaction on a closed session.");if(this._hasTx)throw(0,jo.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=xo._validateSessionMode(e),e=this._connectionHolderWithMode(e),e.initializeConnection(),this._hasTx=!0,e=new Mo.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,notificationFilter:this._notificationFilter,apiTelemetryConfig:r});return e._begin(function(){return n._bookmarks()},t),e},xo.prototype._assertSessionIsOpen=function(){if(!this._open)throw(0,jo.newError)("You cannot run more transactions on a closed session.")},xo.prototype._transactionClosed=function(){this._hasTx=!1},xo.prototype.lastBookmark=function(){return this.lastBookmarks()},xo.prototype.lastBookmarks=function(){return this._lastBookmarks.values()},xo.prototype._bookmarks=function(){var r;return go(this,void 0,void 0,function(){var t;return Oo(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 Ao.Bookmarks(Eo(Eo([],wo(t),!1),wo(this._configuredBookmarks),!1))]}})})},xo.prototype.readTransaction=function(e,t){t=new ko.TxConfig(t,this._log);return this._runTransaction(To.ACCESS_MODE_READ,t,e)},xo.prototype.writeTransaction=function(e,t){t=new ko.TxConfig(t,this._log);return this._runTransaction(To.ACCESS_MODE_WRITE,t,e)},xo.prototype._runTransaction=function(t,r,e){var n=this;return this._transactionExecutor.execute(function(e){return n._beginTransaction(t,r,e)},e)},xo.prototype.executeRead=function(e,t){t=new ko.TxConfig(t,this._log);return this._executeInTransaction(To.ACCESS_MODE_READ,t,e)},xo.prototype.executeWrite=function(e,t){t=new ko.TxConfig(t,this._log);return this._executeInTransaction(To.ACCESS_MODE_WRITE,t,e)},xo.prototype._executeInTransaction=function(t,r,e){var n=this;return this._transactionExecutor.execute(function(e){return n._beginTransaction(t,r,e)},e,No.default.fromTransaction)},xo.prototype._onDatabaseNameResolved=function(e){this._databaseNameResolved||(this._database=e=null!=e?e:"",this._readConnectionHolder.setDatabase(e),this._writeConnectionHolder.setDatabase(e),this._databaseNameResolved=!0)},xo.prototype._getConnectionAcquistionBookmarks=function(){var r;return go(this,void 0,void 0,function(){var t;return Oo(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 Ao.Bookmarks(Eo(Eo([],wo(this._configuredBookmarks),!1),wo(t),!1))]}})})},xo.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:[]).catch(function(){}),this._lastBookmarks=e,this._configuredBookmarks=Ao.Bookmarks.empty())},xo.prototype.close=function(){return go(this,void 0,void 0,function(){return Oo(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]}})})},xo.prototype[Symbol.asyncDispose]=function(){return this.close()},xo.prototype._connectionHolderWithMode=function(e){if(e===To.ACCESS_MODE_READ)return this._readConnectionHolder;if(e===To.ACCESS_MODE_WRITE)return this._writeConnectionHolder;throw(0,jo.newError)("Unknown access mode: "+e)},xo.prototype._onCompleteCallback=function(e,t){this._updateBookmarks(new Ao.Bookmarks(e.bookmark),t,e.db)},xo.prototype._calculateWatermaks=function(){return this._fetchSize===To.FETCH_ALL?{low:Number.MAX_VALUE,high:Number.MAX_VALUE}:{low:.3*this._fetchSize,high:.7*this._fetchSize}},xo.prototype._configureTransactionExecutor=function(e,t){this._transactionExecutor.pipelineBegin=e,this._transactionExecutor.telemetryApi=t},xo._validateSessionMode=function(e){e=null!=e?e:To.ACCESS_MODE_WRITE;if(e!==To.ACCESS_MODE_READ&&e!==To.ACCESS_MODE_WRITE)throw(0,jo.newError)("Illegal session mode "+e);return e},Q.default=xo;var w={},h={},Do=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())})},Uo=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}}}},Lo=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.")},Fo=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},Bo=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))},_=(Object.defineProperty(h,"__esModule",{value:!0}),h.bookmarkManager=void 0,Wo.prototype.updateBookmarks=function(e,t){return Do(this,void 0,void 0,function(){return Uo(this,function(e){throw new Error("Not implemented")})})},Wo.prototype.getBookmarks=function(){return Do(this,void 0,void 0,function(){return Uo(this,function(e){throw new Error("Not implemented")})})},Wo);function Wo(){throw new Error("Not implemented")}h.default=_,h.bookmarkManager=function(e){void 0===e&&(e={});var t=new Set(e.initialBookmarks);return new qo(t,e.bookmarksSupplier,e.bookmarksConsumer)};zo.prototype.updateBookmarks=function(f,p){return Do(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c,l;return Uo(this,function(e){switch(e.label){case 0:t=this._bookmarks;try{for(r=Lo(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=Lo(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(Bo([],Fo(t),!1))];case 1:e.sent(),e.label=2;case 2:return[2]}})})},zo.prototype.getBookmarks=function(){var s;return Do(this,void 0,void 0,function(){var t,r,n,o,i,u,a;return Uo(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=Lo(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,Bo([],Fo(t),!1)]}})})};var qo=zo;function zo(e,t,r){this._bookmarks=e,this._bookmarksSupplier=t,this._bookmarksConsumer=r}var g={},Vo=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())})},Ho=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}}}},m=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Go=(Object.defineProperty(g,"__esModule",{value:!0}),m(Dr)),Yo=t;function Ko(){}Ko.prototype.eagerResultTransformer=function(){return Zo},Ko.prototype.eager=function(){return Zo},Ko.prototype.mappedResultTransformer=function(e){return Xo(e)},Ko.prototype.mapped=function(e){return Xo(e)},Ko.prototype.first=function(){return Qo},Ko.prototype.summary=function(){return Jo};E=new Ko;function Zo(o){return Vo(this,void 0,void 0,function(){var t,r,n;return Ho(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 Go.default(n,r,t)]}})})}function Xo(i){var e=this;if(null==i||null==i.collect&&null==i.map)throw(0,Yo.newError)("Requires a map or/and a collect functions.");return function(o){return Vo(e,void 0,void 0,function(){return Ho(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){var t;null!=i.map?void 0!==(t=i.map(e))&&n.records.push(t):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()]}})})}}function Qo(o){return Vo(this,void 0,void 0,function(){var t,r,n;return Ho(this,function(e){switch(e.label){case 0:return[4,(t=o[Symbol.asyncIterator]()).next()];case 1:n=e.sent(),r=n.value,n=n.done,e.label=2;case 2:return e.trys.push([2,,3,6]),!0===n?[2,void 0]:[2,r];case 3:return null==t.return?[3,5]:[4,t.return()];case 4:e.sent(),e.label=5;case 5:return[7];case 6:return[2]}})})}function Jo(t){return Vo(this,void 0,void 0,function(){return Ho(this,function(e){switch(e.label){case 0:return[4,t.summary()];case 1:return[2,e.sent()]}})})}Object.freeze(E),g.default=E;var _={},$o=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())})},ei=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}}}},ti=(Object.defineProperty(_,"__esModule",{value:!0}),y);function ri(e){this._createSession=e}ri.prototype.execute=function(o,i,u){return $o(this,void 0,void 0,function(){var t,r,n=this;return ei(this,function(e){switch(e.label){case 0:t=this._createSession({database:o.database,bookmarkManager:o.bookmarkManager,impersonatedUser:o.impersonatedUser,auth:o.auth}),r=function(e,t,r){"function"==typeof(null==e?void 0:e.addEventListener)&&e.addEventListener(t,r);return{uninstall:function(){"function"==typeof(null==e?void 0:e.removeEventListener)&&e.removeEventListener(t,r)}}}(o.signal,"abort",function(){return $o(n,void 0,void 0,function(){return ei(this,function(e){switch(e.label){case 0:return[4,t.close()];case 1:return[2,e.sent()]}})})}),t._configureTransactionExecutor(!0,ti.TELEMETRY_APIS.EXECUTE_QUERY),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,("READ"===o.routing?t.executeRead:t.executeWrite).bind(t)(function(r){return $o(n,void 0,void 0,function(){var t;return ei(this,function(e){switch(e.label){case 0:return t=r.run(i,u),[4,o.resultTransformer(t)];case 1:return[2,e.sent()]}})})},o.transactionConfig)];case 2:return[2,e.sent()];case 3:return r.uninstall(),[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})},_.default=ri;function ni(){this.routing=Oi.WRITE,this.resultTransformer=void 0,this.database="",this.impersonatedUser=void 0,this.bookmarkManager=void 0,this.transactionConfig=void 0,this.auth=void 0,this.signal=void 0}var oi=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())})},ii=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}}}},m=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ui=(Object.defineProperty(w,"__esModule",{value:!0}),w.QueryConfig=w.SessionConfig=w.routing=w.WRITE=w.READ=w.Driver=void 0,b),ai=m(Ar),si=y,ci=v,li=m(Q),fi=u,pi=h,di=m(g),hi=m(_),bi=t,yi=36e5,_i=1e3,vi=si.ACCESS_MODE_READ,mi=(w.READ=vi,si.ACCESS_MODE_WRITE),gi=(w.WRITE=mi,0),Oi=(w.SessionConfig=function(){this.defaultAccessMode=mi,this.bookmarks=[],this.database="",this.impersonatedUser=void 0,this.auth=void 0,this.fetchSize=void 0,this.bookmarkManager=void 0,this.notificationFilter=void 0},{WRITE:"WRITE",READ:"READ"}),E=(w.routing=Oi,Object.freeze(Oi),w.QueryConfig=ni,Object.defineProperty(wi.prototype,"executeQueryBookmarkManager",{get:function(){return this._defaultExecuteQueryBookmarkManager},enumerable:!1,configurable:!0}),wi.prototype.executeQuery=function(o,i,u){var a,s;return void 0===u&&(u={}),oi(this,void 0,void 0,function(){var t,r,n;return ii(this,function(e){switch(e.label){case 0:if(t=null===u.bookmarkManager?void 0:null!=(a=u.bookmarkManager)?a:this.executeQueryBookmarkManager,r=null!=(a=u.resultTransformer)?a:di.default.eagerResultTransformer(),(n=null!=(s=u.routing)?s:Oi.WRITE)!==Oi.READ&&n!==Oi.WRITE)throw(0,bi.newError)('Illegal query routing config: "'.concat(n,'"'));return[4,this._queryExecutor.execute({resultTransformer:r,bookmarkManager:t,routing:n,database:u.database,impersonatedUser:u.impersonatedUser,transactionConfig:u.transactionConfig,auth:u.auth,signal:u.signal},o,i)];case 1:return[2,e.sent()]}})})},wi.prototype.verifyConnectivity=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:vi})},wi.prototype.verifyAuthentication=function(e){var e=void 0===e?{}:e,t=e.database,r=e.auth;return oi(this,void 0,void 0,function(){return ii(this,function(e){switch(e.label){case 0:return[4,this._getOrCreateConnectionProvider().verifyAuthentication({database:null!=t?t:"system",auth:r,accessMode:vi})];case 1:return[2,e.sent()]}})})},wi.prototype.getServerInfo=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:vi})},wi.prototype.supportsMultiDb=function(){return this._getOrCreateConnectionProvider().supportsMultiDb()},wi.prototype.supportsTransactionConfig=function(){return this._getOrCreateConnectionProvider().supportsTransactionConfig()},wi.prototype.supportsUserImpersonation=function(){return this._getOrCreateConnectionProvider().supportsUserImpersonation()},wi.prototype.supportsSessionAuth=function(){return this._getOrCreateConnectionProvider().supportsSessionAuth()},wi.prototype.getNegotiatedProtocolVersion=function(){return this._getOrCreateConnectionProvider().getNegotiatedProtocolVersion()},wi.prototype.isEncrypted=function(){return this._isEncrypted()},wi.prototype._supportsRouting=function(){return this._meta.routing},wi.prototype._isEncrypted=function(){return this._config.encrypted===fi.ENCRYPTION_ON||!0===this._config.encrypted},wi.prototype._getTrust=function(){return this._config.trust},wi.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,u=e.bookmarkManager,a=e.notificationFilter,e=e.auth;return this._newSession({defaultAccessMode:void 0===t?mi:t,bookmarkOrBookmarks:r,database:void 0===n?"":n,reactive:!1,impersonatedUser:o,fetchSize:Pi(i,this._config.fetchSize),bookmarkManager:u,notificationFilter:a,auth:e})},wi.prototype.close=function(){return this._log.info("Driver ".concat(this._id," closing")),null!=this._connectionProvider?this._connectionProvider.close():Promise.resolve()},wi.prototype[Symbol.asyncDispose]=function(){return this.close()},wi.prototype._afterConstruction=function(){this._log.info("".concat(this._meta.typename," driver ").concat(this._id," created for server address ").concat(this._meta.address.toString()))},wi.prototype._newSession=function(e){var t=e.defaultAccessMode,r=e.bookmarkOrBookmarks,n=e.database,o=e.reactive,i=e.impersonatedUser,u=e.fetchSize,a=e.bookmarkManager,s=e.notificationFilter,e=e.auth,t=li.default._validateSessionMode(t),c=this._getOrCreateConnectionProvider(),r=null!=r?new ui.Bookmarks(r):ui.Bookmarks.empty();return this._createSession({mode:t,database:null!=n?n:"",connectionProvider:c,bookmarks:r,config:this._config,reactive:o,impersonatedUser:i,fetchSize:u,bookmarkManager:a,notificationFilter:s,auth:e,log:this._log})},wi.prototype._getOrCreateConnectionProvider=function(){var e;return null==this._connectionProvider&&(this._connectionProvider=this._createConnectionProvider(this._id,this._config,this._log,(e=this._config,new ai.default(e.resolver)))),this._connectionProvider},wi);function wi(e,t,r,n,o){void 0===n&&(n=function(e){return new li.default(e)}),void 0===o&&(o=function(e){return new hi.default(e)}),(i=t=void 0===t?{}:t).maxConnectionLifetime=Ei(i.maxConnectionLifetime,yi),i.maxConnectionPoolSize=Ei(i.maxConnectionPoolSize,si.DEFAULT_POOL_MAX_SIZE),i.connectionAcquisitionTimeout=Ei(i.connectionAcquisitionTimeout,si.DEFAULT_POOL_ACQUISITION_TIMEOUT),i.fetchSize=Pi(i.fetchSize,_i),i.connectionTimeout=function(e){e=parseInt(e.connectionTimeout,10);return 0===e||!isNaN(e)&&e<0?null:isNaN(e)?si.DEFAULT_CONNECTION_TIMEOUT_MILLIS:e}(i),i.connectionLivenessCheckTimeout=function(e){if(null==e)return;e=parseInt(e,10);if(e<0||Number.isNaN(e))throw new Error("The connectionLivenessCheckTimeout can only be a positive value or 0 for always. However connectionLivenessCheckTimeout = ".concat(e));return e}(i.connectionLivenessCheckTimeout);var i=ci.Logger.create(t);!function(e,t){var r=e.resolver;if(null!=r&&"function"!=typeof r)throw new TypeError("Configured resolver should be a function. Got: ".concat(typeof r));e.connectionAcquisitionTimeout<e.connectionTimeout&&t.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');if(null==(null==(r=e.notificationFilter)?void 0:r.disabledCategories)||null==(null==(t=e.notificationFilter)?void 0:t.disabledClassifications))return;throw new Error('The notificationFilter can\'t have both "disabledCategories" and "disabledClassifications" configured at the same time.')}(t,i),this._id=gi++,this._meta=e,this._config=t,this._log=i,this._createConnectionProvider=r,this._createSession=n,this._defaultExecuteQueryBookmarkManager=(0,pi.bookmarkManager)(),this._queryExecutor=o(this.session.bind(this)),this._connectionProvider=null,this._afterConstruction()}function Ei(e,t){e=parseInt(e,10);return 0<e||0===e?e:e<0?Number.MAX_SAFE_INTEGER:t}function Pi(e,t){e=parseInt(e,10);if(0<e||e===si.FETCH_ALL)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(si.FETCH_ALL," for ALL. However fetchSize = ").concat(e));return t}w.Driver=E,w.default=E;b={};function Si(e){return null!=e&&""!==e&&(Object.getPrototypeOf(e)!==Object.prototype||0!==Object.keys(e).length)}Object.defineProperty(b,"__esModule",{value:!0}),b.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}},none:function(){return{scheme:"none"}},custom:function(e,t,r,n,o){n={scheme:n,principal:e};return Si(t)&&(n.credentials=t),Si(r)&&(n.realm=r),Si(o)&&(n.parameters=o),n}};var Ar={},Ti=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())})},ji=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}}}},y=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ci=(Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.staticAuthTokenManager=Ar.authTokenManagers=Ar.AuthTokenAndExpiration=void 0,y(b)),Ii=p;function Ri(){}function Ai(){}Ri.prototype.getToken=function(){throw new Error("Not Implemented")},Ri.prototype.handleSecurityException=function(e,t){throw new Error("Not implemented")},Ar.default=Ri,Ar.AuthTokenAndExpiration=function(){this.token=Ci.default.none(),this.expiration=void 0},Ai.prototype.bearer=function(e){e=e.tokenProvider;if("function"!=typeof e)throw new TypeError("tokenProvider should be function, but got: ".concat(typeof e));return new Ni(e,["Neo.ClientError.Security.Unauthorized","Neo.ClientError.Security.TokenExpired"])},Ai.prototype.basic=function(e){var t=this,r=e.tokenProvider;if("function"!=typeof r)throw new TypeError("tokenProvider should be function, but got: ".concat(typeof r));return new Ni(function(){return Ti(t,void 0,void 0,function(){var t;return ji(this,function(e){switch(e.label){case 0:return t={},[4,r()];case 1:return[2,(t.token=e.sent(),t)]}})})},["Neo.ClientError.Security.Unauthorized"])};v=new Ai;Ar.authTokenManagers=v,Object.freeze(v),Ar.staticAuthTokenManager=function(e){return e=e.authToken,new Di(e)};Mi.prototype.subscribe=function(e){this._subscribers.push(e)},Mi.prototype.onCompleted=function(t){this._subscribers.forEach(function(e){return e.onCompleted(t)})},Mi.prototype.onError=function(t){this._subscribers.forEach(function(e){return e.onError(t)})};var ki=Mi;function Mi(e){this._subscribers=e=void 0===e?[]:e}xi.prototype.getToken=function(){var t;return Ti(this,void 0,void 0,function(){return ji(this,function(e){switch(e.label){case 0:return void 0===this._currentAuthData||void 0!==this._currentAuthData.expiration&&this._currentAuthData.expiration<new Date?[4,this._refreshAuthToken()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2,null==(t=this._currentAuthData)?void 0:t.token]}})})},xi.prototype.handleSecurityException=function(e,t){return!!this._handledSecurityCodes.includes(t)&&(Ii.util.equals(e,null==(t=this._currentAuthData)?void 0:t.token)&&this._scheduleRefreshAuthToken(),!0)},xi.prototype._scheduleRefreshAuthToken=function(e){var r=this;void 0===this._refreshObservable&&(this._currentAuthData=void 0,this._refreshObservable=new ki,Promise.resolve(this._tokenProvider()).then(function(e){var t;r._currentAuthData=e,null!=(t=r._refreshObservable)&&t.onCompleted(e)}).catch(function(e){var t;null!=(t=r._refreshObservable)&&t.onError(e)}).finally(function(){r._refreshObservable=void 0})),void 0!==e&&this._refreshObservable.subscribe(e)},xi.prototype._refreshAuthToken=function(){return Ti(this,void 0,void 0,function(){var r=this;return ji(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e,t){r._scheduleRefreshAuthToken({onCompleted:e,onError:t})})];case 1:return[2,e.sent()]}})})};var Ni=xi;function xi(e,t,r,n){this._tokenProvider=e,this._handledSecurityCodes=t,this._currentAuthData=r,this._refreshObservable=n}Ui.prototype.getToken=function(){return this._authToken},Ui.prototype.handleSecurityException=function(e,t){return!1};var Di=Ui;function Ui(e){this._authToken=e}function Li(){this.encrypted=void 0,this.trust=void 0,this.trustedCertificates=[],this.maxConnectionPoolSize=100,this.maxConnectionLifetime=36e5,this.connectionAcquisitionTimeout=6e4,this.maxTransactionRetryTime=3e4,this.connectionLivenessCheckTimeout=void 0,this.connectionTimeout=3e4,this.disableLosslessIntegers=!1,this.useBigInt=!1,this.logging=void 0,this.resolver=void 0,this.notificationFilter=void 0,this.userAgent=void 0,this.telemetryDisabled=!1,this.clientCertificate=void 0}var Fi,Bi,u={},m=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)}),_=(Object.defineProperty(u,"__esModule",{value:!0}),u.InternalConfig=u.Config=void 0,u.Config=Li,m(Wi,Bi=Li),Wi);function Wi(){return null!==Bi&&Bi.apply(this,arguments)||this}u.InternalConfig=_;var qi,E={},y=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)}),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)},Vi=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]}),Hi=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),v=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)&&Vi(t,e,r);return Hi(t,e),t},Gi=(Object.defineProperty(E,"__esModule",{value:!0}),E.resolveCertificateProvider=E.clientCertificateProviders=E.RotatingClientCertificateProvider=E.ClientCertificateProvider=void 0,v(X)),m=(E.default=function(){this.certfile="",this.keyfile="",this.password=void 0},Yi.prototype.hasUpdate=function(){throw new Error("Not Implemented")},Yi.prototype.getClientCertificate=function(){throw new Error("Not Implemented")},Yi);function Yi(){}E.ClientCertificateProvider=m;y(Zi,Ki=m),Zi.prototype.updateCertificate=function(e){throw new Error("Not implemented")};var Ki,_=Zi;function Zi(){return null!==Ki&&Ki.apply(this,arguments)||this}function Xi(){}E.RotatingClientCertificateProvider=_,Xi.prototype.rotating=function(e){e=e.initialCertificate;if(null==e||!Qi(e))throw new TypeError("initialCertificate should be ClientCertificate, but got ".concat(Gi.stringify(e)));e=zi({},e);return new yu(e)};v=new Xi;function Qi(e){return null!=e&&"object"==typeof e&&"certfile"in e&&(Ji(r=e.certfile)||$i(r,Ji))&&"keyfile"in e&&(t(r=e.keyfile)||$i(r,t))&&eu("password",e);function t(e){return"string"==typeof e||null!=e&&"object"==typeof e&&"path"in e&&"string"==typeof e.path&&eu("password",e)}var r}function Ji(e){return"string"==typeof e}function $i(e,t,r){return void 0===r&&(r=!1),Array.isArray(e)&&(r||0<e.length)&&e.filter(t).length===e.length}function eu(e,t){return!(e in t)||null==t[e]||"string"==typeof t[e]}E.clientCertificateProviders=v,Object.freeze(v),E.resolveCertificateProvider=function(e){if(null!=e){if("object"==typeof e&&"hasUpdate"in e&&"getClientCertificate"in e&&"function"==typeof e.getClientCertificate&&"function"==typeof e.hasUpdate)return e;var t;if(Qi(e))return t=zi({},e),{getClientCertificate:function(){return t},hasUpdate:function(){return!1}};throw new TypeError("clientCertificate should be configured with ClientCertificate or ClientCertificateProvider, but got ".concat(Gi.stringify(e)))}};_u.prototype.hasUpdate=function(){try{return this._updated}finally{this._updated=!1}},_u.prototype.getClientCertificate=function(){return this._certificate},_u.prototype.updateCertificate=function(e){if(!Qi(e))throw new TypeError("certificate should be ClientCertificate, but got ".concat(Gi.stringify(e)));this._certificate=zi({},e),this._updated=!0};var tu,ru,nu,ou,iu,uu,au,su,cu,lu,fu,pu,du,hu,bu,yu=_u;function _u(e,t){void 0===t&&(t=!1),this._certificate=e,this._updated=t}y=e,tu=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]}),ru=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)&&tu(t,e,r);return ru(t,e),t},_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(y,"__esModule",{value:!0}),y.Releasable=y.ConnectionProvider=y.EagerResult=y.Result=y.Stats=y.QueryStatistics=y.ProfiledPlan=y.Plan=y.GqlStatusObject=y.Notification=y.ServerInfo=y.queryType=y.ResultSummary=y.Record=y.isPathSegment=y.PathSegment=y.isPath=y.Path=y.isUnboundRelationship=y.UnboundRelationship=y.isRelationship=y.Relationship=y.isNode=y.Node=y.Time=y.LocalTime=y.LocalDateTime=y.isTime=y.isLocalTime=y.isLocalDateTime=y.isDuration=y.isDateTime=y.isDate=y.Duration=y.DateTime=y.Date=y.Point=y.isPoint=y.internal=y.toString=y.toNumber=y.inSafeRange=y.isInt=y.int=y.Integer=y.error=y.isRetriableError=y.Neo4jError=y.newError=y.authTokenManagers=void 0,y.resolveCertificateProvider=y.clientCertificateProviders=y.notificationFilterMinimumSeverityLevel=y.notificationFilterDisabledClassification=y.notificationFilterDisabledCategory=y.notificationSeverityLevel=y.notificationClassification=y.notificationCategory=y.resultTransformers=y.routing=y.staticAuthTokenManager=y.bookmarkManager=y.auth=y.json=y.driver=y.types=y.Driver=y.Session=y.TransactionPromise=y.ManagedTransaction=y.Transaction=y.Connection=void 0,nu=t,Object.defineProperty(y,"newError",{enumerable:!0,get:function(){return nu.newError}}),Object.defineProperty(y,"Neo4jError",{enumerable:!0,get:function(){return nu.Neo4jError}}),Object.defineProperty(y,"isRetriableError",{enumerable:!0,get:function(){return nu.isRetriableError}}),ou=m(n),y.Integer=ou.default,Object.defineProperty(y,"int",{enumerable:!0,get:function(){return ou.int}}),Object.defineProperty(y,"isInt",{enumerable:!0,get:function(){return ou.isInt}}),Object.defineProperty(y,"inSafeRange",{enumerable:!0,get:function(){return ou.inSafeRange}}),Object.defineProperty(y,"toNumber",{enumerable:!0,get:function(){return ou.toNumber}}),Object.defineProperty(y,"toString",{enumerable:!0,get:function(){return ou.toString}}),iu=i,Object.defineProperty(y,"Date",{enumerable:!0,get:function(){return iu.Date}}),Object.defineProperty(y,"DateTime",{enumerable:!0,get:function(){return iu.DateTime}}),Object.defineProperty(y,"Duration",{enumerable:!0,get:function(){return iu.Duration}}),Object.defineProperty(y,"isDate",{enumerable:!0,get:function(){return iu.isDate}}),Object.defineProperty(y,"isDateTime",{enumerable:!0,get:function(){return iu.isDateTime}}),Object.defineProperty(y,"isDuration",{enumerable:!0,get:function(){return iu.isDuration}}),Object.defineProperty(y,"isLocalDateTime",{enumerable:!0,get:function(){return iu.isLocalDateTime}}),Object.defineProperty(y,"isLocalTime",{enumerable:!0,get:function(){return iu.isLocalTime}}),Object.defineProperty(y,"isTime",{enumerable:!0,get:function(){return iu.isTime}}),Object.defineProperty(y,"LocalDateTime",{enumerable:!0,get:function(){return iu.LocalDateTime}}),Object.defineProperty(y,"LocalTime",{enumerable:!0,get:function(){return iu.LocalTime}}),Object.defineProperty(y,"Time",{enumerable:!0,get:function(){return iu.Time}}),uu=l,Object.defineProperty(y,"Node",{enumerable:!0,get:function(){return uu.Node}}),Object.defineProperty(y,"isNode",{enumerable:!0,get:function(){return uu.isNode}}),Object.defineProperty(y,"Relationship",{enumerable:!0,get:function(){return uu.Relationship}}),Object.defineProperty(y,"isRelationship",{enumerable:!0,get:function(){return uu.isRelationship}}),Object.defineProperty(y,"UnboundRelationship",{enumerable:!0,get:function(){return uu.UnboundRelationship}}),Object.defineProperty(y,"isUnboundRelationship",{enumerable:!0,get:function(){return uu.isUnboundRelationship}}),Object.defineProperty(y,"Path",{enumerable:!0,get:function(){return uu.Path}}),Object.defineProperty(y,"isPath",{enumerable:!0,get:function(){return uu.isPath}}),Object.defineProperty(y,"PathSegment",{enumerable:!0,get:function(){return uu.PathSegment}}),Object.defineProperty(y,"isPathSegment",{enumerable:!0,get:function(){return uu.isPathSegment}}),v=_(Qe),y.Record=v.default,au=s,Object.defineProperty(y,"isPoint",{enumerable:!0,get:function(){return au.isPoint}}),Object.defineProperty(y,"Point",{enumerable:!0,get:function(){return au.Point}}),su=m(f),y.ResultSummary=su.default,Object.defineProperty(y,"queryType",{enumerable:!0,get:function(){return su.queryType}}),Object.defineProperty(y,"ServerInfo",{enumerable:!0,get:function(){return su.ServerInfo}}),Object.defineProperty(y,"Plan",{enumerable:!0,get:function(){return su.Plan}}),Object.defineProperty(y,"ProfiledPlan",{enumerable:!0,get:function(){return su.ProfiledPlan}}),Object.defineProperty(y,"QueryStatistics",{enumerable:!0,get:function(){return su.QueryStatistics}}),Object.defineProperty(y,"Stats",{enumerable:!0,get:function(){return su.Stats}}),cu=m(T),y.Notification=cu.default,Object.defineProperty(y,"GqlStatusObject",{enumerable:!0,get:function(){return cu.GqlStatusObject}}),Object.defineProperty(y,"notificationCategory",{enumerable:!0,get:function(){return cu.notificationCategory}}),Object.defineProperty(y,"notificationClassification",{enumerable:!0,get:function(){return cu.notificationClassification}}),Object.defineProperty(y,"notificationSeverityLevel",{enumerable:!0,get:function(){return cu.notificationSeverityLevel}}),lu=S,Object.defineProperty(y,"notificationFilterDisabledCategory",{enumerable:!0,get:function(){return lu.notificationFilterDisabledCategory}}),Object.defineProperty(y,"notificationFilterDisabledClassification",{enumerable:!0,get:function(){return lu.notificationFilterDisabledClassification}}),Object.defineProperty(y,"notificationFilterMinimumSeverityLevel",{enumerable:!0,get:function(){return lu.notificationFilterMinimumSeverityLevel}}),t=_(j),y.Result=t.default,n=_(Dr),y.EagerResult=n.default,fu=m(O),y.ConnectionProvider=fu.default,Object.defineProperty(y,"Releasable",{enumerable:!0,get:function(){return fu.Releasable}}),i=_(o),y.Connection=i.default,l=_(Tr),y.Transaction=l.default,Qe=_(qr),y.ManagedTransaction=Qe.default,s=_(P),y.TransactionPromise=s.default,f=_(Q),y.Session=f.default,T=m(w),S=T,y.Driver=T.default,y.driver=S,j=_(b),y.auth=j.default,pu=h,Object.defineProperty(y,"bookmarkManager",{enumerable:!0,get:function(){return pu.bookmarkManager}}),du=Ar,Object.defineProperty(y,"authTokenManagers",{enumerable:!0,get:function(){return du.authTokenManagers}}),Object.defineProperty(y,"staticAuthTokenManager",{enumerable:!0,get:function(){return du.staticAuthTokenManager}}),hu=w,Object.defineProperty(y,"routing",{enumerable:!0,get:function(){return hu.routing}}),Dr=m(u),y.types=Dr,O=m(X),y.json=O,_=_(g),y.resultTransformers=_.default,bu=E,Object.defineProperty(y,"clientCertificateProviders",{enumerable:!0,get:function(){return bu.clientCertificateProviders}}),Object.defineProperty(y,"resolveCertificateProvider",{enumerable:!0,get:function(){return bu.resolveCertificateProvider}}),m=m(p),y.internal=m,o={SERVICE_UNAVAILABLE:nu.SERVICE_UNAVAILABLE,SESSION_EXPIRED:nu.SESSION_EXPIRED,PROTOCOL_ERROR:nu.PROTOCOL_ERROR},y.error=o,o={authTokenManagers:du.authTokenManagers,newError:nu.newError,Neo4jError:nu.Neo4jError,isRetriableError:nu.isRetriableError,error:o,Integer:ou.default,int:ou.int,isInt:ou.isInt,inSafeRange:ou.inSafeRange,toNumber:ou.toNumber,toString:ou.toString,internal:m,isPoint:au.isPoint,Point:au.Point,Date:iu.Date,DateTime:iu.DateTime,Duration:iu.Duration,isDate:iu.isDate,isDateTime:iu.isDateTime,isDuration:iu.isDuration,isLocalDateTime:iu.isLocalDateTime,isLocalTime:iu.isLocalTime,isTime:iu.isTime,LocalDateTime:iu.LocalDateTime,LocalTime:iu.LocalTime,Time:iu.Time,Node:uu.Node,isNode:uu.isNode,Relationship:uu.Relationship,isRelationship:uu.isRelationship,UnboundRelationship:uu.UnboundRelationship,isUnboundRelationship:uu.isUnboundRelationship,Path:uu.Path,isPath:uu.isPath,PathSegment:uu.PathSegment,isPathSegment:uu.isPathSegment,Record:v.default,ResultSummary:su.default,queryType:su.queryType,ServerInfo:su.ServerInfo,Notification:cu.default,GqlStatusObject:cu.GqlStatusObject,Plan:su.Plan,ProfiledPlan:su.ProfiledPlan,QueryStatistics:su.QueryStatistics,Stats:su.Stats,Result:t.default,EagerResult:n.default,Transaction:l.default,ManagedTransaction:Qe.default,TransactionPromise:s.default,Session:f.default,Driver:T.default,Connection:i.default,Releasable:fu.Releasable,types:Dr,driver:S,json:O,auth:j.default,bookmarkManager:pu.bookmarkManager,routing:hu.routing,resultTransformers:_.default,notificationCategory:cu.notificationCategory,notificationClassification:cu.notificationClassification,notificationSeverityLevel:cu.notificationSeverityLevel,notificationFilterDisabledCategory:lu.notificationFilterDisabledCategory,notificationFilterDisabledClassification:lu.notificationFilterDisabledClassification,notificationFilterMinimumSeverityLevel:lu.notificationFilterMinimumSeverityLevel,clientCertificateProviders:bu.clientCertificateProviders,resolveCertificateProvider:bu.resolveCertificateProvider},y.default=o;Tr={},qr={},P={},Q={},b={};Object.defineProperty(b,"__esModule",{value:!0}),b.isFunction=void 0,b.isFunction=function(e){return"function"==typeof e};h={},Ar={},w={};Object.defineProperty(w,"__esModule",{value:!0}),w.createErrorClass=void 0,w.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(Ar,"__esModule",{value:!0}),Ar.UnsubscriptionError=void 0;u=w,Ar.UnsubscriptionError=u.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 vu=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.")},mu=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},gu=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},Ou=(Object.defineProperty(h,"__esModule",{value:!0}),h.isSubscription=h.EMPTY_SUBSCRIPTION=h.Subscription=void 0,b),wu=Ar,Eu=X,Pu=(Su.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=vu(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(Ou.isFunction(u))try{u()}catch(e){r=e instanceof wu.UnsubscriptionError?e.errors:[e]}var a=this._finalizers;if(a){this._finalizers=null;try{for(var s=vu(a),c=s.next();!c.done;c=s.next()){var l=c.value;try{Tu(l)}catch(e){r=null!=r?r:[],e instanceof wu.UnsubscriptionError?r=gu(gu([],mu(r)),mu(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 wu.UnsubscriptionError(r)}},Su.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Tu(e);else{if(e instanceof Su){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(t=this._finalizers)?t:[]).push(e)}},Su.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},Su.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},Su.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Eu.arrRemove(t,e)},Su.prototype.remove=function(e){var t=this._finalizers;t&&Eu.arrRemove(t,e),e instanceof Su&&e._removeParent(this)},Su.EMPTY=((g=new Su).closed=!0,g),Su);function Su(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}function Tu(e){Ou.isFunction(e)?e():e.unsubscribe()}h.Subscription=Pu,h.EMPTY_SUBSCRIPTION=Pu.EMPTY,h.isSubscription=function(e){return e instanceof Pu||e&&"closed"in e&&Ou.isFunction(e.remove)&&Ou.isFunction(e.add)&&Ou.isFunction(e.unsubscribe)};var ju,Cu,Iu,E={},p=(Object.defineProperty(E,"__esModule",{value:!0}),E.config=void 0,E.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},{}),m={},Ru=(ju=m,Cu=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},Iu=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(ju,"__esModule",{value:!0}),ju.timeoutProvider=void 0,ju.timeoutProvider={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=ju.timeoutProvider.delegate;return null!=o&&o.setTimeout?o.setTimeout.apply(o,Iu([e,t],Cu(r))):setTimeout.apply(void 0,Iu([e,t],Cu(r)))},clearTimeout:function(e){var t=ju.timeoutProvider.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0},Object.defineProperty(p,"__esModule",{value:!0}),p.reportUnhandledError=void 0,E),Au=m;p.reportUnhandledError=function(t){Au.timeoutProvider.setTimeout(function(){var e=Ru.config.onUnhandledError;if(!e)throw t;e(t)})};v={};Object.defineProperty(v,"__esModule",{value:!0}),v.noop=void 0,v.noop=function(){};t={};function ku(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.createNotification=t.nextNotification=t.errorNotification=t.COMPLETE_NOTIFICATION=void 0,t.COMPLETE_NOTIFICATION=ku("C",void 0,void 0),t.errorNotification=function(e){return ku("E",void 0,e)},t.nextNotification=function(e){return ku("N",e,void 0)},t.createNotification=ku;var Mu,Nu,xu,Du,Uu,Lu,Fu,Bu,Wu,qu,zu,Vu,Hu,Gu,n={},Yu=(Object.defineProperty(n,"__esModule",{value:!0}),n.captureError=n.errorContext=void 0,E),Ku=null;function Zu(e){var t=xu.call(this)||this;return t.isStopped=!1,e?(t.destination=e,Uu.isSubscription(e)&&e.add(t)):t.destination=Mu.EMPTY_OBSERVER,t}function Xu(e,t){return zu.call(e,t)}function Qu(e){this.partialObserver=e}function Ju(e,t,r){var n=Hu.call(this)||this;return r=Du.isFunction(e)||!e?{next:null!=e?e:void 0,error:null!=t?t:void 0,complete:null!=r?r:void 0}:n&&Lu.config.useDeprecatedNextContext?((t=Object.create(e)).unsubscribe=function(){return n.unsubscribe()},{next:e.next&&Xu(e.next,t),error:e.error&&Xu(e.error,t),complete:e.complete&&Xu(e.complete,t)}):e,n.destination=new Vu(r),n}function $u(e){Lu.config.useDeprecatedSynchronousErrorHandling?qu.captureError(e):Fu.reportUnhandledError(e)}function ea(e,t){var r=Lu.config.onStoppedNotification;r&&Wu.timeoutProvider.setTimeout(function(){return r(e,t)})}n.errorContext=function(e){if(Yu.config.useDeprecatedSynchronousErrorHandling){var t=!Ku;if(t&&(Ku={errorThrown:!1,error:null}),e(),t){var t=Ku,r=t.errorThrown,t=t.error;if(Ku=null,r)throw t}}else e()},n.captureError=function(e){Yu.config.useDeprecatedSynchronousErrorHandling&&Ku&&(Ku.errorThrown=!0,Ku.error=e)},Mu=Q,l=r&&r.__extends||(Nu=function(e,t){return(Nu=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}Nu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.EMPTY_OBSERVER=Mu.SafeSubscriber=Mu.Subscriber=void 0,Du=b,Lu=E,Fu=p,Qe=v,Bu=t,Wu=m,qu=n,xu=(Uu=h).Subscription,l(Zu,xu),Zu.create=function(e,t,r){return new Gu(e,t,r)},Zu.prototype.next=function(e){this.isStopped?ea(Bu.nextNotification(e),this):this._next(e)},Zu.prototype.error=function(e){this.isStopped?ea(Bu.errorNotification(e),this):(this.isStopped=!0,this._error(e))},Zu.prototype.complete=function(){this.isStopped?ea(Bu.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},Zu.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,xu.prototype.unsubscribe.call(this),this.destination=null)},Zu.prototype._next=function(e){this.destination.next(e)},Zu.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},Zu.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},s=Zu,Mu.Subscriber=s,zu=Function.prototype.bind,Qu.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){$u(e)}},Qu.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){$u(e)}else $u(e)},Qu.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){$u(e)}},Vu=Qu,l(Ju,Hu=s),Gu=Ju,Mu.SafeSubscriber=Gu,Mu.EMPTY_OBSERVER={closed:!0,next:Qe.noop,error:function(e){throw e},complete:Qe.noop};f={},Object.defineProperty(f,"__esModule",{value:!0}),f.observable=void 0,f.observable="function"==typeof Symbol&&Symbol.observable||"@@observable",T={},i={};Object.defineProperty(i,"__esModule",{value:!0}),i.identity=void 0,i.identity=function(e){return e},Object.defineProperty(T,"__esModule",{value:!0}),T.pipeFromArray=T.pipe=void 0;var ta=i;function ra(t){return 0===t.length?ta.identity:1===t.length?t[0]:function(e){return t.reduce(function(e,t){return t(e)},e)}}T.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ra(e)},T.pipeFromArray=ra,Object.defineProperty(P,"__esModule",{value:!0}),P.Observable=void 0;var na=Q,oa=h,Dr=f,ia=T,ua=E,aa=b,sa=n;function ca(e){e&&(this._subscribe=e)}function la(e){return null!=(e=null!=e?e:ua.config.Promise)?e:Promise}ca.prototype.lift=function(e){var t=new ca;return t.source=this,t.operator=e,t},ca.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof na.Subscriber||function(e){return e&&aa.isFunction(e.next)&&aa.isFunction(e.error)&&aa.isFunction(e.complete)}(n)&&oa.isSubscription(n)?e:new na.SafeSubscriber(e,t,r);return sa.errorContext(function(){var e=o.operator,t=o.source;i.add(e?e.call(i,t):t?o._subscribe(i):o._trySubscribe(i))}),i},ca.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},ca.prototype.forEach=function(n,e){var o=this;return new(e=la(e))(function(e,t){var r=new na.SafeSubscriber({next:function(e){try{n(e)}catch(e){t(e),r.unsubscribe()}},error:t,complete:e});o.subscribe(r)})},ca.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},ca.prototype[Dr.observable]=function(){return this},ca.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ia.pipeFromArray(e)(this)},ca.prototype.toPromise=function(e){var n=this;return new(e=la(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},ca.create=function(e){return new ca(e)},P.Observable=ca;var S={},O={},j={},fa=(Object.defineProperty(j,"__esModule",{value:!0}),j.operate=j.hasLift=void 0,b);function pa(e){return fa.isFunction(null==e?void 0:e.lift)}j.hasLift=pa,j.operate=function(t){return function(e){if(pa(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 da,_={},y=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)}),o=(Object.defineProperty(_,"__esModule",{value:!0}),_.OperatorSubscriber=_.createOperatorSubscriber=void 0,Q);_.createOperatorSubscriber=function(e,t,r,n,o){return new ba(e,t,r,n,o)};y(ya,ha=o.Subscriber),ya.prototype.unsubscribe=function(){var e;this.shouldUnsubscribe&&!this.shouldUnsubscribe()||(e=this.closed,ha.prototype.unsubscribe.call(this),e||null==(e=this.onFinalize)||e.call(this))};var ha,ba=ya;function ya(t,r,e,n,o,i){var u=ha.call(this,t)||this;return u.onFinalize=o,u.shouldUnsubscribe=i,u._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:ha.prototype._next,u._error=n?function(e){try{n(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:ha.prototype._error,u._complete=e?function(){try{e()}catch(e){t.error(e)}finally{this.unsubscribe()}}:ha.prototype._complete,u}_.OperatorSubscriber=ba,Object.defineProperty(O,"__esModule",{value:!0}),O.refCount=void 0;var _a=j,va=_;O.refCount=function(){return _a.operate(function(r,n){var o=null,e=(r._refCount++,va.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 ma,u=r&&r.__extends||(ma=function(e,t){return(ma=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}ma(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(S,"__esModule",{value:!0}),S.ConnectableObservable=void 0;var ga,Oa=h,wa=O,Ea=_,Pa=j,g=(ga=P.Observable,u(Sa,ga),Sa.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},Sa.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},Sa.prototype._teardown=function(){this._refCount=0;var e=this._connection;(this._subject=this._connection=null)!=e&&e.unsubscribe()},Sa.prototype.connect=function(){var t,r=this,e=this._connection;return e||(e=this._connection=new Oa.Subscription,t=this.getSubject(),e.add(this.source.subscribe(Ea.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=Oa.Subscription.EMPTY)),e},Sa.prototype.refCount=function(){return wa.refCount()(this)},Sa);function Sa(e,t){var r=ga.call(this)||this;return r.source=e,r.subjectFactory=t,r._subject=null,r._refCount=0,r._connection=null,Pa.hasLift(e)&&(r.lift=e.lift),r}S.ConnectableObservable=g;var Ta,ja,Ca,Ia,Ra,t={},m={},l=(Ta=m,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.performanceTimestampProvider=void 0,Ta.performanceTimestampProvider={now:function(){return(Ta.performanceTimestampProvider.delegate||performance).now()},delegate:void 0},{}),Aa=(ja=l,Ca=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},Ia=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(ja,"__esModule",{value:!0}),ja.animationFrameProvider=void 0,Ra=h,ja.animationFrameProvider={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=ja.animationFrameProvider.delegate,o=(n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame),e(function(e){r=void 0,t(e)}));return new Ra.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=ja.animationFrameProvider.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,Ia([],Ca(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ja.animationFrameProvider.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,Ia([],Ca(e)))},delegate:void 0},Object.defineProperty(t,"__esModule",{value:!0}),t.animationFrames=void 0,P),ka=m,Ma=l;function Na(a){return new Aa.Observable(function(r){var n=a||ka.performanceTimestampProvider,o=n.now(),i=0,u=function(){r.closed||(i=Ma.animationFrameProvider.requestAnimationFrame(function(e){i=0;var t=n.now();r.next({timestamp:a?t:e,elapsed:t-o}),u()}))};return u(),function(){i&&Ma.animationFrameProvider.cancelAnimationFrame(i)}})}t.animationFrames=function(e){return e?Na(e):Ua};var xa,Da,Ua=Na(),s={},Qe={},Dr=(Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.ObjectUnsubscribedError=void 0,w),y=(Qe.ObjectUnsubscribedError=Dr.createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),r&&r.__extends||(xa=function(e,t){return(xa=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}xa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),La=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.")},Fa=(Object.defineProperty(s,"__esModule",{value:!0}),s.AnonymousSubject=s.Subject=void 0,P),Ba=h,Wa=Qe,qa=X,za=n,o=(Da=Fa.Observable,y(Va,Da),Va.prototype.lift=function(e){var t=new Ga(this,this);return t.operator=e,t},Va.prototype._throwIfClosed=function(){if(this.closed)throw new Wa.ObjectUnsubscribedError},Va.prototype.next=function(o){var i=this;za.errorContext(function(){var t,e;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var r=La(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}}}})},Va.prototype.error=function(t){var r=this;za.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)}})},Va.prototype.complete=function(){var t=this;za.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},Va.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(Va.prototype,"observed",{get:function(){var e;return 0<(null==(e=this.observers)?void 0:e.length)},enumerable:!1,configurable:!0}),Va.prototype._trySubscribe=function(e){return this._throwIfClosed(),Da.prototype._trySubscribe.call(this,e)},Va.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},Va.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,o=this.observers;return r||n?Ba.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new Ba.Subscription(function(){t.currentObservers=null,qa.arrRemove(o,e)}))},Va.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},Va.prototype.asObservable=function(){var e=new Fa.Observable;return e.source=this,e},Va.create=function(e,t){return new Ga(e,t)},Va);function Va(){var e=Da.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}s.Subject=o;y(Ya,Ha=o),Ya.prototype.next=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.next)&&r.call(t,e)},Ya.prototype.error=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.error)&&r.call(t,e)},Ya.prototype.complete=function(){var e,t;null!=(t=null==(e=this.destination)?void 0:e.complete)&&t.call(e)},Ya.prototype._subscribe=function(e){var t;return null!=(t=null==(t=this.source)?void 0:t.subscribe(e))?t:Ba.EMPTY_SUBSCRIPTION};var Ha,Ga=Ya;function Ya(e,t){var r=Ha.call(this)||this;return r.destination=e,r.source=t,r}s.AnonymousSubject=Ga;var Ka,u={},g=r&&r.__extends||(Ka=function(e,t){return(Ka=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}Ka(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(u,"__esModule",{value:!0}),u.BehaviorSubject=void 0;Za=s.Subject,g(Xa,Za),Object.defineProperty(Xa.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),Xa.prototype._subscribe=function(e){var t=Za.prototype._subscribe.call(this,e);return t.closed||e.next(this._value),t},Xa.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},Xa.prototype.next=function(e){Za.prototype.next.call(this,this._value=e)};var Za,m=Xa;function Xa(e){var t=Za.call(this)||this;return t._value=e,t}u.BehaviorSubject=m;var Qa,Ja,Dr={},n={},y=(Qa=n,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.dateTimestampProvider=void 0,Qa.dateTimestampProvider={now:function(){return(Qa.dateTimestampProvider.delegate||Date).now()},delegate:void 0},r&&r.__extends||(Ja=function(e,t){return(Ja=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}Ja(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.ReplaySubject=void 0;var $a,es=n,o=($a=s.Subject,y(ts,$a),ts.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(),$a.prototype.next.call(this,e)},ts.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},ts.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)}},ts);function ts(e,t,r){void 0===e&&(e=1/0),void 0===t&&(t=1/0),void 0===r&&(r=es.dateTimestampProvider);var n=$a.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}Dr.ReplaySubject=o;var rs,g={},m=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)});Object.defineProperty(g,"__esModule",{value:!0}),g.AsyncSubject=void 0;ns=s.Subject,m(os,ns),os.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())},os.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},os.prototype.complete=function(){var e=this._hasValue,t=this._value;this._isComplete||(this._isComplete=!0,e&&ns.prototype.next.call(this,t),ns.prototype.complete.call(this))};var ns,y=os;function os(){var e=null!==ns&&ns.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}g.AsyncSubject=y;var is,o={},m={},y={},us={},as=r&&r.__extends||(is=function(e,t){return(is=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}is(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(us,"__esModule",{value:!0}),us.Action=void 0;ss=h.Subscription,as(cs,ss),cs.prototype.schedule=function(e,t){return this};var ss,as=cs;function cs(e,t){return ss.call(this)||this}us.Action=as;var ls,fs,ps,ds,as={},hs=(ls=as,fs=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},ps=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(ls,"__esModule",{value:!0}),ls.intervalProvider=void 0,ls.intervalProvider={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=ls.intervalProvider.delegate;return null!=o&&o.setInterval?o.setInterval.apply(o,ps([e,t],fs(r))):setInterval.apply(void 0,ps([e,t],fs(r)))},clearInterval:function(e){var t=ls.intervalProvider.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},r&&r.__extends||(ds=function(e,t){return(ds=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}ds(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(y,"__esModule",{value:!0}),y.AsyncAction=void 0;var bs,ys=as,_s=X,as=(bs=us.Action,hs(vs,bs),vs.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},vs.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),ys.intervalProvider.setInterval(e.flush.bind(e,this),r)},vs.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)&&this.delay===r&&!1===this.pending)return t;null!=t&&ys.intervalProvider.clearInterval(t)},vs.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))},vs.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},vs.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,_s.arrRemove(r,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,bs.prototype.unsubscribe.call(this))},vs);function vs(e,t){var r=bs.call(this,e,t)||this;return r.scheduler=e,r.work=t,r.pending=!1,r}y.AsyncAction=as;var ms,gs,Os,ws,Es,Ps,us={},hs={},Ss=(Object.defineProperty(hs,"__esModule",{value:!0}),hs.TestTools=hs.Immediate=void 0,1),Ts={};function js(e){return e in Ts&&(delete Ts[e],!0)}hs.Immediate={setImmediate:function(e){var t=Ss++;return Ts[t]=!0,(ms=ms||Promise.resolve()).then(function(){return js(t)&&e()}),t},clearImmediate:function(e){js(e)}},hs.TestTools={pending:function(){return Object.keys(Ts).length}},gs=us,Os=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},ws=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(gs,"__esModule",{value:!0}),gs.immediateProvider=void 0,Es=hs.Immediate.setImmediate,Ps=hs.Immediate.clearImmediate,gs.immediateProvider={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=gs.immediateProvider.delegate;return((null==r?void 0:r.setImmediate)||Es).apply(void 0,ws([],Os(e)))},clearImmediate:function(e){var t=gs.immediateProvider.delegate;return((null==t?void 0:t.clearImmediate)||Ps)(e)},delegate:void 0};var Cs,as=r&&r.__extends||(Cs=function(e,t){return(Cs=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}Cs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(m,"__esModule",{value:!0}),m.AsapAction=void 0;var Is,Rs=us,hs=(Is=y.AsyncAction,as(As,Is),As.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?Is.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Rs.immediateProvider.setImmediate(e.flush.bind(e,void 0))))},As.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return Is.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(Rs.immediateProvider.clearImmediate(t),e._scheduled===t&&(e._scheduled=void 0))},As);function As(e,t){var r=Is.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}m.AsapAction=hs;var us={},as={},hs={},ks=(Object.defineProperty(hs,"__esModule",{value:!0}),hs.Scheduler=void 0,n);function Ms(e,t){void 0===t&&(t=Ms.now),this.schedulerActionCtor=e,this.now=t}Ms.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},Ms.now=ks.dateTimestampProvider.now,hs.Scheduler=Ms;var Ns,xs,ks=r&&r.__extends||(Ns=function(e,t){return(Ns=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}Ns(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ds=(Object.defineProperty(as,"__esModule",{value:!0}),as.AsyncScheduler=void 0,hs),ks=(xs=Ds.Scheduler,ks(Us,xs),Us.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}}},Us);function Us(e,t){void 0===t&&(t=Ds.Scheduler.now);e=xs.call(this,e,t)||this;return e.actions=[],e._active=!1,e}as.AsyncScheduler=ks;var Ls,ks=r&&r.__extends||(Ls=function(e,t){return(Ls=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}Ls(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(us,"__esModule",{value:!0}),us.AsapScheduler=void 0;Fs=as.AsyncScheduler,ks(Bs,Fs),Bs.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 Fs,ks=Bs;function Bs(){return null!==Fs&&Fs.apply(this,arguments)||this}us.AsapScheduler=ks,ks=o,Object.defineProperty(ks,"__esModule",{value:!0}),ks.asap=ks.asapScheduler=void 0,ks.asapScheduler=new us.AsapScheduler(m.AsapAction),ks.asap=ks.asapScheduler;var Ws,us={},ks=(m=us,Object.defineProperty(m,"__esModule",{value:!0}),m.async=m.asyncScheduler=void 0,m.asyncScheduler=new as.AsyncScheduler(y.AsyncAction),m.async=m.asyncScheduler,{}),m={},qs=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)});Object.defineProperty(m,"__esModule",{value:!0}),m.QueueAction=void 0;zs=y.AsyncAction,qs(Vs,zs),Vs.prototype.schedule=function(e,t){return 0<(t=void 0===t?0:t)?zs.prototype.schedule.call(this,e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)},Vs.prototype.execute=function(e,t){return 0<t||this.closed?zs.prototype.execute.call(this,e,t):this._execute(e,t)},Vs.prototype.requestAsyncId=function(e,t,r){return null!=(r=void 0===r?0:r)&&0<r||null==r&&0<this.delay?zs.prototype.requestAsyncId.call(this,e,t,r):(e.flush(this),0)};var zs,qs=Vs;function Vs(e,t){var r=zs.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}m.QueueAction=qs;var Hs,qs={},Gs=r&&r.__extends||(Hs=function(e,t){return(Hs=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}Hs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(qs,"__esModule",{value:!0}),qs.QueueScheduler=void 0;Ys=as.AsyncScheduler,Gs(Ks,Ys);var Ys,Gs=Ks;function Ks(){return null!==Ys&&Ys.apply(this,arguments)||this}qs.QueueScheduler=Gs,Gs=ks,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.queue=Gs.queueScheduler=void 0,Gs.queueScheduler=new qs.QueueScheduler(m.QueueAction),Gs.queue=Gs.queueScheduler;var Zs,qs={},m={},Gs=r&&r.__extends||(Zs=function(e,t){return(Zs=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}Zs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(m,"__esModule",{value:!0}),m.AnimationFrameAction=void 0;var Xs,Qs=l,l=(Xs=y.AsyncAction,Gs(Js,Xs),Js.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?Xs.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Qs.animationFrameProvider.requestAnimationFrame(function(){return e.flush(void 0)})))},Js.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return Xs.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(Qs.animationFrameProvider.cancelAnimationFrame(t),e._scheduled=void 0)},Js);function Js(e,t){var r=Xs.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}m.AnimationFrameAction=l;var $s,Gs={},l=r&&r.__extends||($s=function(e,t){return($s=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}$s(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.AnimationFrameScheduler=void 0;ec=as.AsyncScheduler,l(tc,ec),tc.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 ec,l=tc;function tc(){return null!==ec&&ec.apply(this,arguments)||this}Gs.AnimationFrameScheduler=l,l=qs,Object.defineProperty(l,"__esModule",{value:!0}),l.animationFrame=l.animationFrameScheduler=void 0,l.animationFrameScheduler=new Gs.AnimationFrameScheduler(m.AnimationFrameAction),l.animationFrame=l.animationFrameScheduler;var rc,nc,Gs={},m=r&&r.__extends||(rc=function(e,t){return(rc=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}rc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),l=(Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.VirtualAction=Gs.VirtualTimeScheduler=void 0,y),oc=h,y=(nc=as.AsyncScheduler,m(ic,nc),ic.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}},ic.frameTimeFactor=10,ic);function ic(e,t){void 0===t&&(t=1/0);var r=nc.call(this,e=void 0===e?ac:e,function(){return r.frame})||this;return r.maxFrames=t,r.frame=0,r.index=-1,r}Gs.VirtualTimeScheduler=y;uc=l.AsyncAction,m(sc,uc),sc.prototype.schedule=function(e,t){if(void 0===t&&(t=0),Number.isFinite(t)){if(!this.id)return uc.prototype.schedule.call(this,e,t);this.active=!1;var r=new sc(this.scheduler,this.work);return this.add(r),r.schedule(e,t)}return oc.Subscription.EMPTY},sc.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(sc.sortActions),1},sc.prototype.recycleAsyncId=function(e,t,r){},sc.prototype._execute=function(e,t){if(!0===this.active)return uc.prototype._execute.call(this,e,t)},sc.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 uc,ac=sc;function sc(e,t,r){void 0===r&&(r=e.index+=1);var n=uc.call(this,e,t)||this;return n.scheduler=e,n.work=t,n.index=r,n.active=!0,n.index=e.index=r,n}Gs.VirtualAction=ac;var cc,lc,as={},y={},l=(cc=y,Object.defineProperty(cc,"__esModule",{value:!0}),cc.empty=cc.EMPTY=void 0,lc=P,cc.EMPTY=new lc.Observable(function(e){return e.complete()}),cc.empty=function(e){return e?(t=e,new lc.Observable(function(e){return t.schedule(function(){return e.complete()})})):cc.EMPTY;var t},{}),m={},fc={},pc=(Object.defineProperty(fc,"__esModule",{value:!0}),fc.isScheduler=void 0,b);fc.isScheduler=function(e){return e&&pc.isFunction(e.schedule)},Object.defineProperty(m,"__esModule",{value:!0}),m.popNumber=m.popScheduler=m.popResultSelector=void 0;var dc=b,hc=fc;function bc(e){return e[e.length-1]}m.popResultSelector=function(e){return dc.isFunction(bc(e))?e.pop():void 0},m.popScheduler=function(e){return hc.isScheduler(bc(e))?e.pop():void 0},m.popNumber=function(e,t){return"number"==typeof bc(e)?e.pop():t};var yc={},_c={},vc={},C={},mc={},gc=(Object.defineProperty(mc,"__esModule",{value:!0}),mc.isArrayLike=void 0,mc.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},{}),Oc=(Object.defineProperty(gc,"__esModule",{value:!0}),gc.isPromise=void 0,b);gc.isPromise=function(e){return Oc.isFunction(null==e?void 0:e.then)};var wc={},Ec=(Object.defineProperty(wc,"__esModule",{value:!0}),wc.isInteropObservable=void 0,f),Pc=b;wc.isInteropObservable=function(e){return Pc.isFunction(e[Ec.observable])};var Sc={},Tc=(Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.isAsyncIterable=void 0,b);Sc.isAsyncIterable=function(e){return Symbol.asyncIterator&&Tc.isFunction(null==e?void 0:e[Symbol.asyncIterator])};var jc={};Object.defineProperty(jc,"__esModule",{value:!0}),jc.createInvalidObservableTypeError=void 0,jc.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 Cc={},Ic={};function Rc(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.iterator=Ic.getSymbolIterator=void 0,Ic.getSymbolIterator=Rc,Ic.iterator=Rc(),Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.isIterable=void 0;var Ac=Ic,kc=b;Cc.isIterable=function(e){return kc.isFunction(null==e?void 0:e[Ac.iterator])};var Mc={},Nc=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}}}},xc=r&&r.__await||function(e){return this instanceof xc?(this.v=e,this):new xc(e)},Dc=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 xc?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])}},Uc=(Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.isReadableStreamLike=Mc.readableStreamLikeToAsyncGenerator=void 0,b);Mc.readableStreamLikeToAsyncGenerator=function(o){return Dc(this,arguments,function(){var t,r,n;return Nc(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,xc(t.read())];case 3:return(r=e.sent(),n=r.value,r.done)?[4,xc(void 0)]:[3,5];case 4:return[2,e.sent()];case 5:return[4,xc(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]}})})},Mc.isReadableStreamLike=function(e){return Uc.isFunction(null==e?void 0:e.getReader)};var Lc=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())})},Fc=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}}}},Bc=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 Wc?Wc(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)})}}},Wc=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.")},qc=(Object.defineProperty(C,"__esModule",{value:!0}),C.fromReadableStreamLike=C.fromAsyncIterable=C.fromIterable=C.fromPromise=C.fromArrayLike=C.fromInteropObservable=C.innerFrom=void 0,mc),zc=gc,Vc=P,Hc=wc,Gc=Sc,Yc=jc,Kc=Cc,Zc=Mc,Xc=b,Qc=p,Jc=f;function $c(r){return new Vc.Observable(function(e){var t=r[Jc.observable]();if(Xc.isFunction(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function el(r){return new Vc.Observable(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function tl(e){return new Vc.Observable(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Qc.reportUnhandledError)})}function rl(u){return new Vc.Observable(function(e){var t,r;try{for(var n=Wc(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 nl(e){return new Vc.Observable(function(t){!function(r,n){var o,i,u,a;return Lc(this,void 0,void 0,function(){var t;return Fc(this,function(e){switch(e.label){case 0:e.trys.push([0,5,6,11]),o=Bc(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 ol(e){return nl(Zc.readableStreamLikeToAsyncGenerator(e))}C.innerFrom=function(e){if(e instanceof Vc.Observable)return e;if(null!=e){if(Hc.isInteropObservable(e))return $c(e);if(qc.isArrayLike(e))return el(e);if(zc.isPromise(e))return tl(e);if(Gc.isAsyncIterable(e))return nl(e);if(Kc.isIterable(e))return rl(e);if(Zc.isReadableStreamLike(e))return ol(e)}throw Yc.createInvalidObservableTypeError(e)},C.fromInteropObservable=$c,C.fromArrayLike=el,C.fromPromise=tl,C.fromIterable=rl,C.fromAsyncIterable=nl,C.fromReadableStreamLike=ol;var p={},il={};Object.defineProperty(il,"__esModule",{value:!0}),il.executeSchedule=void 0,il.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(p,"__esModule",{value:!0}),p.observeOn=void 0;var ul=il,al=j,sl=_;p.observeOn=function(r,n){return void 0===n&&(n=0),al.operate(function(e,t){e.subscribe(sl.createOperatorSubscriber(t,function(e){return ul.executeSchedule(t,r,function(){return t.next(e)},n)},function(){return ul.executeSchedule(t,r,function(){return t.complete()},n)},function(e){return ul.executeSchedule(t,r,function(){return t.error(e)},n)}))})};var cl={},ll=(Object.defineProperty(cl,"__esModule",{value:!0}),cl.subscribeOn=void 0,j);cl.subscribeOn=function(r,n){return void 0===n&&(n=0),ll.operate(function(e,t){t.add(r.schedule(function(){return e.subscribe(t)},n))})},Object.defineProperty(vc,"__esModule",{value:!0}),vc.scheduleObservable=void 0;var fl=C,pl=p,dl=cl;vc.scheduleObservable=function(e,t){return fl.innerFrom(e).pipe(dl.subscribeOn(t),pl.observeOn(t))};var hl={},bl=(Object.defineProperty(hl,"__esModule",{value:!0}),hl.schedulePromise=void 0,C),yl=p,_l=cl;hl.schedulePromise=function(e,t){return bl.innerFrom(e).pipe(_l.subscribeOn(t),yl.observeOn(t))};var vl={},ml=(Object.defineProperty(vl,"__esModule",{value:!0}),vl.scheduleArray=void 0,P);vl.scheduleArray=function(r,n){return new ml.Observable(function(e){var t=0;return n.schedule(function(){t===r.length?e.complete():(e.next(r[t++]),e.closed||this.schedule())})})};var gl={},Ol=(Object.defineProperty(gl,"__esModule",{value:!0}),gl.scheduleIterable=void 0,P),wl=Ic,El=b,Pl=il;gl.scheduleIterable=function(e,t){return new Ol.Observable(function(n){var o;return Pl.executeSchedule(n,t,function(){o=e[wl.iterator](),Pl.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 El.isFunction(null==o?void 0:o.return)&&o.return()}})};var Ic={},Sl=(Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.scheduleAsyncIterable=void 0,P),Tl=il;Ic.scheduleAsyncIterable=function(r,n){if(r)return new Sl.Observable(function(t){Tl.executeSchedule(t,n,function(){var e=r[Symbol.asyncIterator]();Tl.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 jl={},Cl=(Object.defineProperty(jl,"__esModule",{value:!0}),jl.scheduleReadableStreamLike=void 0,Ic),Il=Mc;jl.scheduleReadableStreamLike=function(e,t){return Cl.scheduleAsyncIterable(Il.readableStreamLikeToAsyncGenerator(e),t)},Object.defineProperty(_c,"__esModule",{value:!0}),_c.scheduled=void 0;var Rl=vc,Al=hl,kl=vl,Ml=gl,Nl=Ic,xl=wc,Dl=gc,Ul=mc,Ll=Cc,Fl=Sc,Bl=jc,Wl=Mc,ql=jl;_c.scheduled=function(e,t){if(null!=e){if(xl.isInteropObservable(e))return Rl.scheduleObservable(e,t);if(Ul.isArrayLike(e))return kl.scheduleArray(e,t);if(Dl.isPromise(e))return Al.schedulePromise(e,t);if(Fl.isAsyncIterable(e))return Nl.scheduleAsyncIterable(e,t);if(Ll.isIterable(e))return Ml.scheduleIterable(e,t);if(Wl.isReadableStreamLike(e))return ql.scheduleReadableStreamLike(e,t)}throw Bl.createInvalidObservableTypeError(e)},Object.defineProperty(yc,"__esModule",{value:!0}),yc.from=void 0;var zl=_c,Vl=C;yc.from=function(e,t){return t?zl.scheduled(e,t):Vl.innerFrom(e)},Object.defineProperty(l,"__esModule",{value:!0}),l.of=void 0;var Hl=m,Gl=yc;l.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Hl.popScheduler(e);return Gl.from(e,r)};var Yl,Kl,Zl,Xl,vc={},Ql=(Object.defineProperty(vc,"__esModule",{value:!0}),vc.throwError=void 0,P),Jl=b;function $l(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}function ef(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)}vc.throwError=function(e,t){function r(e){return e.error(n())}var n=Jl.isFunction(e)?e:function(){return e};return new Ql.Observable(t?function(e){return t.schedule(r,0,e)}:r)},hl=as,Object.defineProperty(hl,"__esModule",{value:!0}),hl.observeNotification=hl.Notification=hl.NotificationKind=void 0,Yl=y,Kl=l,Zl=vc,Xl=b,(vl=hl.NotificationKind||(hl.NotificationKind={})).NEXT="N",vl.ERROR="E",vl.COMPLETE="C",$l.prototype.observe=function(e){return ef(this,e)},$l.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()},$l.prototype.accept=function(e,t,r){var n;return Xl.isFunction(null==(n=e)?void 0:n.next)?this.observe(e):this.do(e,t,r)},$l.prototype.toObservable=function(){var e=this.kind,t=this.value,r=this.error,t="N"===e?Kl.of(t):"E"===e?Zl.throwError(function(){return r}):"C"===e?Yl.EMPTY:0;if(t)return t;throw new TypeError("Unexpected notification kind "+e)},$l.createNext=function(e){return new $l("N",e)},$l.createError=function(e){return new $l("E",void 0,e)},$l.createComplete=function(){return $l.completeNotification},$l.completeNotification=new $l("C"),vl=$l,hl.Notification=vl,hl.observeNotification=ef;var Ic={},tf=(Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.isObservable=void 0,P),rf=b;Ic.isObservable=function(e){return!!e&&(e instanceof tf.Observable||rf.isFunction(e.lift)&&rf.isFunction(e.subscribe))};var wc={},gc={},Cc=(Object.defineProperty(gc,"__esModule",{value:!0}),gc.EmptyError=void 0,w),nf=(gc.EmptyError=Cc.createErrorClass(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}),Object.defineProperty(wc,"__esModule",{value:!0}),wc.lastValueFrom=void 0,gc);wc.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 nf.EmptyError)}})})};var Sc={},of=(Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.firstValueFrom=void 0,gc),uf=Q;Sc.firstValueFrom=function(n,o){var i="object"==typeof o;return new Promise(function(t,e){var r=new uf.SafeSubscriber({next:function(e){t(e),r.unsubscribe()},error:e,complete:function(){i?t(o.defaultValue):e(new of.EmptyError)}});n.subscribe(r)})};var af,sf,cf,lf,ff,pf,df,jc={},Mc=(Object.defineProperty(jc,"__esModule",{value:!0}),jc.ArgumentOutOfRangeError=void 0,w),jl=(jc.ArgumentOutOfRangeError=Mc.createErrorClass(function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}),{}),vl=(Object.defineProperty(jl,"__esModule",{value:!0}),jl.NotFoundError=void 0,w),hl=(jl.NotFoundError=vl.createErrorClass(function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}}),{}),Cc=(Object.defineProperty(hl,"__esModule",{value:!0}),hl.SequenceError=void 0,w),Mc=(hl.SequenceError=Cc.createErrorClass(function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}),{}),vl={};function hf(e){throw new af.TimeoutError(e)}Object.defineProperty(vl,"__esModule",{value:!0}),vl.isValidDate=void 0,vl.isValidDate=function(e){return e instanceof Date&&!isNaN(e)},af=Mc,Object.defineProperty(af,"__esModule",{value:!0}),af.timeout=af.TimeoutError=void 0,sf=us,cf=vl,lf=j,ff=C,pf=_,df=il,af.TimeoutError=w.createErrorClass(function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}),af.timeout=function(e,t){var a=(e=cf.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e).first,s=e.each,r=e.with,c=void 0===r?hf:r,l=void 0===(r=e.scheduler)?null!=t?t:sf.asyncScheduler:r,f=void 0===(t=e.meta)?null:t;if(null==a&&null==s)throw new TypeError("No timeout provided.");return lf.operate(function(e,t){function r(e){n=df.executeSchedule(t,l,function(){try{u.unsubscribe(),ff.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(pf.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 Cc={},w={},bf={},yf={},_f=(Object.defineProperty(yf,"__esModule",{value:!0}),yf.map=void 0,j),vf=_;yf.map=function(n,o){return _f.operate(function(e,t){var r=0;e.subscribe(vf.createOperatorSubscriber(t,function(e){t.next(n.call(o,e,r++))}))})};var mf=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},gf=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},Of=(Object.defineProperty(bf,"__esModule",{value:!0}),bf.mapOneOrManyArgs=void 0,yf),wf=Array.isArray;bf.mapOneOrManyArgs=function(r){return Of.map(function(e){return t=r,wf(e=e)?t.apply(void 0,gf([],mf(e))):t(e);var t})};var Ef=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},Pf=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},Sf=(Object.defineProperty(w,"__esModule",{value:!0}),w.bindCallbackInternals=void 0,fc),Tf=P,jf=cl,Cf=bf,If=p,Rf=g;w.bindCallbackInternals=function r(a,s,n,o){if(n){if(!Sf.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(Cf.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(jf.subscribeOn(o),If.observeOn(o))}:function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var i=new Rf.AsyncSubject,u=!0;return new Tf.Observable(function(e){var n,o,e=i.subscribe(e);return u&&(n=u=!1,o=!1,s.apply(t,Pf(Pf([],Ef(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(Cc,"__esModule",{value:!0}),Cc.bindCallback=void 0;var Af=w;Cc.bindCallback=function(e,t,r){return Af.bindCallbackInternals(!1,e,t,r)};var kf={},Mf=(Object.defineProperty(kf,"__esModule",{value:!0}),kf.bindNodeCallback=void 0,w);kf.bindNodeCallback=function(e,t,r){return Mf.bindCallbackInternals(!0,e,t,r)};var w={},Nf={},xf=(Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.argsArgArrayOrObject=void 0,Array.isArray),Df=Object.getPrototypeOf,Uf=Object.prototype,Lf=Object.keys;Nf.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(xf(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&Df(r)===Uf)return{args:(r=Lf(t)).map(function(e){return t[e]}),keys:r}}var r;return{args:e,keys:null}};var Ff={};Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.createObject=void 0,Ff.createObject=function(e,n){return e.reduce(function(e,t,r){return e[t]=n[r],e},{})},Object.defineProperty(w,"__esModule",{value:!0}),w.combineLatestInit=w.combineLatest=void 0;var Bf=P,Wf=Nf,qf=yc,zf=i,Vf=bf,Hf=m,Gf=Ff,Yf=_,Kf=il;function Zf(a,s,c){return void 0===c&&(c=zf.identity),function(u){Xf(s,function(){for(var e=a.length,n=new Array(e),o=e,i=e,t=0;t<e;t++)!function(r){Xf(s,function(){var e=qf.from(a[r],s),t=!1;e.subscribe(Yf.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 Xf(e,t,r){e?Kf.executeSchedule(r,e,t):t()}w.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Hf.popScheduler(e),n=Hf.popResultSelector(e),o=Wf.argsArgArrayOrObject(e),i=o.args,u=o.keys;return 0===i.length?qf.from([],r):(o=new Bf.Observable(Zf(i,r,u?function(e){return Gf.createObject(u,e)}:zf.identity)),n?o.pipe(Vf.mapOneOrManyArgs(n)):o)},w.combineLatestInit=Zf;var Qf={},Jf={},$f={},ep={},tp={},rp=(Object.defineProperty(tp,"__esModule",{value:!0}),tp.mergeInternals=void 0,C),np=il,op=_;tp.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;rp.innerFrom(n(e,l++)).subscribe(op.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?np.executeSchedule(r,a,function(){return d(e)}):d(e)}();f()}catch(e){r.error(e)}}))};return e.subscribe(op.createOperatorSubscriber(r,p,function(){f()})),function(){null!=t&&t()}},Object.defineProperty(ep,"__esModule",{value:!0}),ep.mergeMap=void 0;var ip=yf,up=C,ap=j,sp=tp,cp=b;ep.mergeMap=function e(o,i,r){return void 0===r&&(r=1/0),cp.isFunction(i)?e(function(r,n){return ip.map(function(e,t){return i(r,e,n,t)})(up.innerFrom(o(r,n)))},r):("number"==typeof i&&(r=i),ap.operate(function(e,t){return sp.mergeInternals(e,t,o,r)}))},Object.defineProperty($f,"__esModule",{value:!0}),$f.mergeAll=void 0;var lp=ep,fp=i;$f.mergeAll=function(e){return lp.mergeMap(fp.identity,e=void 0===e?1/0:e)},Object.defineProperty(Jf,"__esModule",{value:!0}),Jf.concatAll=void 0;var pp=$f;Jf.concatAll=function(){return pp.mergeAll(1)},Object.defineProperty(Qf,"__esModule",{value:!0}),Qf.concat=void 0;var dp=Jf,hp=m,bp=yc;Qf.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dp.concatAll()(bp.from(e,hp.popScheduler(e)))};var yp={},_p={},vp=(Object.defineProperty(_p,"__esModule",{value:!0}),_p.defer=void 0,P),mp=C;_p.defer=function(t){return new vp.Observable(function(e){mp.innerFrom(t()).subscribe(e)})},Object.defineProperty(yp,"__esModule",{value:!0}),yp.connectable=void 0;var gp=s,Op=P,wp=_p,Ep={connector:function(){return new gp.Subject},resetOnDisconnect:!0};yp.connectable=function(e,t){var r=null,n=(t=void 0===t?Ep:t).connector,o=void 0===(t=t.resetOnDisconnect)||t,i=n();return(t=new Op.Observable(function(e){return i.subscribe(e)})).connect=function(){return r&&!r.closed||(r=wp.defer(function(){return e}).subscribe(i),o&&r.add(function(){return i=n()})),r},t};var Pp={},Sp=(Object.defineProperty(Pp,"__esModule",{value:!0}),Pp.forkJoin=void 0,P),Tp=Nf,jp=C,Cp=m,Ip=_,Rp=bf,Ap=Ff;Pp.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Cp.popResultSelector(e),u=(n=Tp.argsArgArrayOrObject(e)).args,a=n.keys,n=new Sp.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;jp.innerFrom(u[t]).subscribe(Ip.createOperatorSubscriber(e,function(e){r||(r=!0,i--),n[t]=e},function(){return o--},void 0,function(){o&&r||(i||e.next(a?Ap.createObject(a,n):n),e.complete())}))}(r);else e.complete()});return r?n.pipe(Rp.mapOneOrManyArgs(r)):n};var Nf={},kp=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},Mp=(Object.defineProperty(Nf,"__esModule",{value:!0}),Nf.fromEvent=void 0,C),Np=P,xp=ep,Dp=mc,Up=b,Lp=bf,Fp=["addListener","removeListener"],Bp=["addEventListener","removeEventListener"],Wp=["on","off"];function qp(r,n){return function(t){return function(e){return r[t](n,e)}}}Nf.fromEvent=function t(r,n,o,e){if(Up.isFunction(o)&&(e=o,o=void 0),e)return t(r,n,o).pipe(Lp.mapOneOrManyArgs(e));var e=kp((e=r,Up.isFunction(e.addEventListener)&&Up.isFunction(e.removeEventListener)?Bp.map(function(t){return function(e){return r[t](n,e,o)}}):(e=r,Up.isFunction(e.addListener)&&Up.isFunction(e.removeListener)?Fp.map(qp(r,n)):(e=r,Up.isFunction(e.on)&&Up.isFunction(e.off)?Wp.map(qp(r,n)):[]))),2),i=e[0],u=e[1];if(!i&&Dp.isArrayLike(r))return xp.mergeMap(function(e){return t(e,n,o)})(Mp.innerFrom(r));if(i)return new Np.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 Ff={},zp=(Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.fromEventPattern=void 0,P),Vp=b,Hp=bf;Ff.fromEventPattern=function e(n,o,t){return t?e(n,o).pipe(Hp.mapOneOrManyArgs(t)):new zp.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 Vp.isFunction(o)?function(){return o(e,t)}:void 0})};var mc={},Gp=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}}}},Yp=(Object.defineProperty(mc,"__esModule",{value:!0}),mc.generate=void 0,i),Kp=fc,Zp=_p,Xp=gl;mc.generate=function(e,r,n,t,o){var i,u,a;function s(){var t;return Gp(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?Yp.identity:i,o=e.scheduler):(a=e,!t||Kp.isScheduler(t)?(u=Yp.identity,o=t):u=t),Zp.defer(o?function(){return Xp.scheduleIterable(s(),o)}:s)};var gl={},Qp=(Object.defineProperty(gl,"__esModule",{value:!0}),gl.iif=void 0,_p);gl.iif=function(e,t,r){return Qp.defer(function(){return e()?t:r})};var Jp={},$p={},ed=(Object.defineProperty($p,"__esModule",{value:!0}),$p.timer=void 0,P),td=us,rd=fc,nd=vl;$p.timer=function(n,e,o){void 0===n&&(n=0),void 0===o&&(o=td.async);var i=-1;return null!=e&&(rd.isScheduler(e)?o=e:i=e),new ed.Observable(function(e){var t=nd.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(Jp,"__esModule",{value:!0}),Jp.interval=void 0;var od=us,id=$p;Jp.interval=function(e,t){return id.timer(e=(e=void 0===e?0:e)<0?0:e,e,t=void 0===t?od.asyncScheduler:t)};var fc={},ud=(Object.defineProperty(fc,"__esModule",{value:!0}),fc.merge=void 0,$f),ad=C,sd=y,cd=m,ld=yc;fc.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=cd.popScheduler(e),n=cd.popNumber(e,1/0),o=e;return o.length?1===o.length?ad.innerFrom(o[0]):ud.mergeAll(n)(ld.from(o,r)):sd.EMPTY};var fd,pd={},dd=(fd=pd,Object.defineProperty(fd,"__esModule",{value:!0}),fd.never=fd.NEVER=void 0,fd.NEVER=new P.Observable(v.noop),fd.never=function(){return fd.NEVER},{}),hd={},bd=(Object.defineProperty(hd,"__esModule",{value:!0}),hd.argsOrArgArray=void 0,Array.isArray);hd.argsOrArgArray=function(e){return 1===e.length&&bd(e[0])?e[0]:e},Object.defineProperty(dd,"__esModule",{value:!0}),dd.onErrorResumeNext=void 0;var yd=P,_d=hd,vd=_,md=v,gd=C;dd.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=_d.argsOrArgArray(e);return new yd.Observable(function(r){var n=0,o=function(){if(n<i.length){var e=void 0;try{e=gd.innerFrom(i[n++])}catch(e){return void o()}var t=new vd.OperatorSubscriber(r,void 0,md.noop,md.noop);e.subscribe(t),t.add(o)}else r.complete()};o()})};var Od={},wd=(Object.defineProperty(Od,"__esModule",{value:!0}),Od.pairs=void 0,yc);Od.pairs=function(e,t){return wd.from(Object.entries(e),t)};var Ed={},Pd={};Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.not=void 0,Pd.not=function(r,n){return function(e,t){return!r.call(n,e,t)}};var Sd={},Td=(Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.filter=void 0,j),jd=_;Sd.filter=function(n,o){return Td.operate(function(e,t){var r=0;e.subscribe(jd.createOperatorSubscriber(t,function(e){return n.call(o,e,r++)&&t.next(e)}))})},Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.partition=void 0;var Cd=Pd,Id=Sd,Rd=C;Ed.partition=function(e,t,r){return[Id.filter(t,r)(Rd.innerFrom(e)),Id.filter(Cd.not(t,r))(Rd.innerFrom(e))]};var Ad={},kd=(Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.raceInit=Ad.race=void 0,P),Md=C,Nd=hd,xd=_;function Dd(t){return function(n){for(var o=[],e=0;o&&!n.closed&&e<t.length;e++)!function(r){o.push(Md.innerFrom(t[r]).subscribe(xd.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)}}Ad.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Nd.argsOrArgArray(e)).length?Md.innerFrom(e[0]):new kd.Observable(Dd(e))},Ad.raceInit=Dd;var Ud={},Ld=(Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.range=void 0,P),Fd=y;Ud.range=function(r,e,n){if(null==e&&(e=r,r=0),e<=0)return Fd.EMPTY;var o=e+r;return new Ld.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 Bd={},Wd=(Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.using=void 0,P),qd=C,zd=y;Bd.using=function(n,o){return new Wd.Observable(function(e){var t=n(),r=o(t);return(r?qd.innerFrom(r):zd.EMPTY).subscribe(e),function(){t&&t.unsubscribe()}})};var Vd={},Hd=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},Gd=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},Yd=(Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.zip=void 0,P),Kd=C,Zd=hd,Xd=y,Qd=_,Jd=m;Vd.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Jd.popResultSelector(e),u=Zd.argsOrArgArray(e);return u.length?new Yd.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){Kd.innerFrom(u[t]).subscribe(Qd.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,Gd([],Hd(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}}):Xd.EMPTY};var $d={},eh=(Object.defineProperty($d,"__esModule",{value:!0}),{}),th=(Object.defineProperty(eh,"__esModule",{value:!0}),eh.audit=void 0,j),rh=C,nh=_;eh.audit=function(s){return th.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(nh.createOperatorSubscriber(t,function(e){o=!0,i=e,u||rh.innerFrom(s(e)).subscribe(u=nh.createOperatorSubscriber(t,r,n))},function(){a=!0,o&&u&&!u.closed||t.complete()}))})};var oh={},ih=(Object.defineProperty(oh,"__esModule",{value:!0}),oh.auditTime=void 0,us),uh=eh,ah=$p;oh.auditTime=function(e,t){return void 0===t&&(t=ih.asyncScheduler),uh.audit(function(){return ah.timer(e,t)})};var sh={},ch=(Object.defineProperty(sh,"__esModule",{value:!0}),sh.buffer=void 0,j),lh=v,fh=_,ph=C;sh.buffer=function(n){return ch.operate(function(e,t){var r=[];return e.subscribe(fh.createOperatorSubscriber(t,function(e){return r.push(e)},function(){t.next(r),t.complete()})),ph.innerFrom(n).subscribe(fh.createOperatorSubscriber(t,function(){var e=r;r=[],t.next(e)},lh.noop)),function(){r=null}})};var dh={},hh=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.")},bh=(Object.defineProperty(dh,"__esModule",{value:!0}),dh.bufferCount=void 0,j),yh=_,_h=X;dh.bufferCount=function(h,b){return b=null!=(b=void 0===b?null:b)?b:h,bh.operate(function(e,f){var p=[],d=0;e.subscribe(yh.createOperatorSubscriber(f,function(e){var t,r,n,o,i=null;d++%b==0&&p.push([]);try{for(var u=hh(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=hh(i),c=s.next();!c.done;c=s.next()){var l=c.value;_h.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=hh(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 vh={},mh=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.")},gh=(Object.defineProperty(vh,"__esModule",{value:!0}),vh.bufferTime=void 0,h),Oh=j,wh=_,Eh=X,Ph=us,Sh=m,Th=il;vh.bufferTime=function(i){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var u=null!=(e=Sh.popScheduler(t))?e:Ph.asyncScheduler,a=null!=(e=t[0])?e:null,l=t[1]||1/0;return Oh.operate(function(e,r){var s=[],n=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),Eh.arrRemove(s,e),r.next(t),n&&o()},o=function(){var e,t;s&&(e=new gh.Subscription,r.add(e),s.push(t={buffer:[],subs:e}),Th.executeSchedule(e,u,function(){return c(t)},i))},t=(null!==a&&0<=a?Th.executeSchedule(r,u,o,a,!0):n=!0,o(),wh.createOperatorSubscriber(r,function(e){var t,r,n=s.slice();try{for(var o=mh(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 jh={},Ch=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.")},Ih=(Object.defineProperty(jh,"__esModule",{value:!0}),jh.bufferToggle=void 0,h),Rh=j,Ah=C,kh=_,Mh=v,Nh=X;jh.bufferToggle=function(t,o){return Rh.operate(function(e,n){var i=[];Ah.innerFrom(t).subscribe(kh.createOperatorSubscriber(n,function(e){var t=[],r=(i.push(t),new Ih.Subscription);r.add(Ah.innerFrom(o(e)).subscribe(kh.createOperatorSubscriber(n,function(){Nh.arrRemove(i,t),n.next(t),r.unsubscribe()},Mh.noop)))},Mh.noop)),e.subscribe(kh.createOperatorSubscriber(n,function(e){var t,r;try{for(var n=Ch(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 xh={},Dh=(Object.defineProperty(xh,"__esModule",{value:!0}),xh.bufferWhen=void 0,j),Uh=v,Lh=_,Fh=C;xh.bufferWhen=function(i){return Dh.operate(function(e,t){var r=null,n=null,o=function(){null!=n&&n.unsubscribe();var e=r;r=[],e&&t.next(e),Fh.innerFrom(i()).subscribe(n=Lh.createOperatorSubscriber(t,o,Uh.noop))};o(),e.subscribe(Lh.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 Bh={},Wh=(Object.defineProperty(Bh,"__esModule",{value:!0}),Bh.catchError=void 0,C),qh=_,zh=j;Bh.catchError=function u(a){return zh.operate(function(t,r){var n,o=null,i=!1,o=t.subscribe(qh.createOperatorSubscriber(r,void 0,void 0,function(e){n=Wh.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 Vh={},Hh={},I={},Gh={},Yh={},Kh={},Zh=(Object.defineProperty(Kh,"__esModule",{value:!0}),Kh.scanInternals=void 0,_);Kh.scanInternals=function(u,t,a,s,c){return function(e,r){var n=a,o=t,i=0;e.subscribe(Zh.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(Yh,"__esModule",{value:!0}),Yh.reduce=void 0;var Xh=Kh,Qh=j;Yh.reduce=function(e,t){return Qh.operate(Xh.scanInternals(e,t,2<=arguments.length,!1,!0))},Object.defineProperty(Gh,"__esModule",{value:!0}),Gh.toArray=void 0;function Jh(e,t){return e.push(t),e}var $h=Yh,eb=j;Gh.toArray=function(){return eb.operate(function(e,t){$h.reduce(Jh,[])(e).subscribe(t)})},Object.defineProperty(I,"__esModule",{value:!0}),I.joinAllInternals=void 0;var tb=i,rb=bf,nb=T,ob=ep,ib=Gh;I.joinAllInternals=function(t,e){return nb.pipe(ib.toArray(),ob.mergeMap(function(e){return t(e)}),e?rb.mapOneOrManyArgs(e):tb.identity)},Object.defineProperty(Hh,"__esModule",{value:!0}),Hh.combineLatestAll=void 0;var ub=w,ab=I;Hh.combineLatestAll=function(e){return ab.joinAllInternals(ub.combineLatest,e)},Object.defineProperty(Vh,"__esModule",{value:!0}),Vh.combineAll=void 0;Vh.combineAll=Hh.combineLatestAll;var sb={},cb={},lb=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.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},pb=(Object.defineProperty(cb,"__esModule",{value:!0}),cb.combineLatest=void 0,w),db=j,hb=hd,bb=bf,yb=T,_b=m;function vb(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=_b.popResultSelector(r);return t?yb.pipe(vb.apply(void 0,fb([],lb(r))),bb.mapOneOrManyArgs(t)):db.operate(function(e,t){pb.combineLatestInit(fb([e],lb(hb.argsOrArgArray(r))))(t)})}cb.combineLatest=vb;var mb=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},gb=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},Ob=(Object.defineProperty(sb,"__esModule",{value:!0}),sb.combineLatestWith=void 0,cb);sb.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ob.combineLatest.apply(void 0,gb([],mb(e)))};var bf={},wb=(Object.defineProperty(bf,"__esModule",{value:!0}),bf.concatMap=void 0,ep),Eb=b;bf.concatMap=function(e,t){return Eb.isFunction(t)?wb.mergeMap(e,t,1):wb.mergeMap(e,1)};var Pb={},Sb=(Object.defineProperty(Pb,"__esModule",{value:!0}),Pb.concatMapTo=void 0,bf),Tb=b;Pb.concatMapTo=function(e,t){return Tb.isFunction(t)?Sb.concatMap(function(){return e},t):Sb.concatMap(function(){return e})};var jb={},Cb={},Ib=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},Rb=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},Ab=(Object.defineProperty(Cb,"__esModule",{value:!0}),Cb.concat=void 0,j),kb=Jf,Mb=m,Nb=yc;Cb.concat=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=Mb.popScheduler(r);return Ab.operate(function(e,t){kb.concatAll()(Nb.from(Rb([e],Ib(r)),n)).subscribe(t)})};var xb=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},Db=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},Ub=(Object.defineProperty(jb,"__esModule",{value:!0}),jb.concatWith=void 0,Cb);jb.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ub.concat.apply(void 0,Db([],xb(e)))};var Lb={},Fb={},Bb=(Object.defineProperty(Fb,"__esModule",{value:!0}),Fb.fromSubscribable=void 0,P);Fb.fromSubscribable=function(t){return new Bb.Observable(function(e){return t.subscribe(e)})},Object.defineProperty(Lb,"__esModule",{value:!0}),Lb.connect=void 0;var Wb=s,qb=C,zb=j,Vb=Fb,Hb={connector:function(){return new Wb.Subject}};Lb.connect=function(n,e){var o=(e=void 0===e?Hb:e).connector;return zb.operate(function(e,t){var r=o();qb.innerFrom(n(Vb.fromSubscribable(r))).subscribe(t),t.add(e.subscribe(r))})};var Fb={},Gb=(Object.defineProperty(Fb,"__esModule",{value:!0}),Fb.count=void 0,Yh);Fb.count=function(n){return Gb.reduce(function(e,t,r){return!n||n(t,r)?e+1:e},0)};var Yb={},Kb=(Object.defineProperty(Yb,"__esModule",{value:!0}),Yb.debounce=void 0,j),Zb=v,Xb=_,Qb=C;Yb.debounce=function(u){return Kb.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(Xb.createOperatorSubscriber(t,function(e){null!=i&&i.unsubscribe(),n=!0,o=e,i=Xb.createOperatorSubscriber(t,r,Zb.noop),Qb.innerFrom(u(e)).subscribe(i)},function(){r(),t.complete()},void 0,function(){o=i=null}))})};var Jb={},$b=(Object.defineProperty(Jb,"__esModule",{value:!0}),Jb.debounceTime=void 0,us),ey=j,ty=_;Jb.debounceTime=function(a,s){return void 0===s&&(s=$b.asyncScheduler),ey.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(ty.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 ry={},ny=(Object.defineProperty(ry,"__esModule",{value:!0}),ry.defaultIfEmpty=void 0,j),oy=_;ry.defaultIfEmpty=function(n){return ny.operate(function(e,t){var r=!1;e.subscribe(oy.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){r||t.next(n),t.complete()}))})};var R={},iy={},uy={},ay=(Object.defineProperty(uy,"__esModule",{value:!0}),uy.take=void 0,y),sy=j,cy=_;uy.take=function(n){return n<=0?function(){return ay.EMPTY}:sy.operate(function(e,t){var r=0;e.subscribe(cy.createOperatorSubscriber(t,function(e){++r<=n&&(t.next(e),n<=r&&t.complete())}))})};var ly={},fy=(Object.defineProperty(ly,"__esModule",{value:!0}),ly.ignoreElements=void 0,j),py=_,dy=v;ly.ignoreElements=function(){return fy.operate(function(e,t){e.subscribe(py.createOperatorSubscriber(t,dy.noop))})};var hy={},by=(Object.defineProperty(hy,"__esModule",{value:!0}),hy.mapTo=void 0,yf);hy.mapTo=function(e){return by.map(function(){return e})},Object.defineProperty(iy,"__esModule",{value:!0}),iy.delayWhen=void 0;var yy=Qf,_y=uy,vy=ly,my=hy,gy=ep,Oy=C;iy.delayWhen=function t(r,n){return n?function(e){return yy.concat(n.pipe(_y.take(1),vy.ignoreElements()),e.pipe(t(r)))}:gy.mergeMap(function(e,t){return Oy.innerFrom(r(e,t)).pipe(_y.take(1),my.mapTo(e))})},Object.defineProperty(R,"__esModule",{value:!0}),R.delay=void 0;var wy=us,Ey=iy,Py=$p;R.delay=function(e,t){var r=Py.timer(e,t=void 0===t?wy.asyncScheduler:t);return Ey.delayWhen(function(){return r})};var Sy={},Ty=(Object.defineProperty(Sy,"__esModule",{value:!0}),Sy.dematerialize=void 0,as),jy=j,Cy=_;Sy.dematerialize=function(){return jy.operate(function(e,t){e.subscribe(Cy.createOperatorSubscriber(t,function(e){return Ty.observeNotification(e,t)}))})};var Iy={},Ry=(Object.defineProperty(Iy,"__esModule",{value:!0}),Iy.distinct=void 0,j),Ay=_,ky=v,My=C;Iy.distinct=function(o,t){return Ry.operate(function(e,r){var n=new Set;e.subscribe(Ay.createOperatorSubscriber(r,function(e){var t=o?o(e):e;n.has(t)||(n.add(t),r.next(e))})),t&&My.innerFrom(t).subscribe(Ay.createOperatorSubscriber(r,function(){return n.clear()},ky.noop))})};var Ny={},xy=(Object.defineProperty(Ny,"__esModule",{value:!0}),Ny.distinctUntilChanged=void 0,i),Dy=j,Uy=_;function Ly(e,t){return e===t}Ny.distinctUntilChanged=function(i,u){return void 0===u&&(u=xy.identity),i=null!=i?i:Ly,Dy.operate(function(e,r){var n,o=!0;e.subscribe(Uy.createOperatorSubscriber(r,function(e){var t=u(e);!o&&i(n,t)||(o=!1,n=t,r.next(e))}))})};var Fy={},By=(Object.defineProperty(Fy,"__esModule",{value:!0}),Fy.distinctUntilKeyChanged=void 0,Ny);Fy.distinctUntilKeyChanged=function(r,n){return By.distinctUntilChanged(function(e,t){return n?n(e[r],t[r]):e[r]===t[r]})};var Wy={},qy={},zy=(Object.defineProperty(qy,"__esModule",{value:!0}),qy.throwIfEmpty=void 0,gc),Vy=j,Hy=_;function Gy(){return new zy.EmptyError}qy.throwIfEmpty=function(n){return void 0===n&&(n=Gy),Vy.operate(function(e,t){var r=!1;e.subscribe(Hy.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){return r?t.complete():t.error(n())}))})},Object.defineProperty(Wy,"__esModule",{value:!0}),Wy.elementAt=void 0;var Yy=jc,Ky=Sd,Zy=qy,Xy=ry,Qy=uy;Wy.elementAt=function(r,t){if(r<0)throw new Yy.ArgumentOutOfRangeError;var n=2<=arguments.length;return function(e){return e.pipe(Ky.filter(function(e,t){return t===r}),Qy.take(1),n?Xy.defaultIfEmpty(t):Zy.throwIfEmpty(function(){return new Yy.ArgumentOutOfRangeError}))}};var Jy={},$y=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},e_=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},t_=(Object.defineProperty(Jy,"__esModule",{value:!0}),Jy.endWith=void 0,Qf),r_=l;Jy.endWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t_.concat(e,r_.of.apply(void 0,e_([],$y(t))))}};var n_={},o_=(Object.defineProperty(n_,"__esModule",{value:!0}),n_.every=void 0,j),i_=_;n_.every=function(o,i){return o_.operate(function(t,r){var n=0;t.subscribe(i_.createOperatorSubscriber(r,function(e){o.call(i,e,n++,t)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})};var u_={},a_={},s_={},c_=(Object.defineProperty(s_,"__esModule",{value:!0}),s_.exhaustMap=void 0,yf),l_=C,f_=j,p_=_;s_.exhaustMap=function t(i,o){return o?function(e){return e.pipe(t(function(r,n){return l_.innerFrom(i(r,n)).pipe(c_.map(function(e,t){return o(r,e,n,t)}))}))}:f_.operate(function(e,t){var r=0,n=null,o=!1;e.subscribe(p_.createOperatorSubscriber(t,function(e){n||(n=p_.createOperatorSubscriber(t,void 0,function(){n=null,o&&t.complete()}),l_.innerFrom(i(e,r++)).subscribe(n))},function(){o=!0,n||t.complete()}))})},Object.defineProperty(a_,"__esModule",{value:!0}),a_.exhaustAll=void 0;var d_=s_,h_=i;a_.exhaustAll=function(){return d_.exhaustMap(h_.identity)},Object.defineProperty(u_,"__esModule",{value:!0}),u_.exhaust=void 0;u_.exhaust=a_.exhaustAll;var b_={},y_=(Object.defineProperty(b_,"__esModule",{value:!0}),b_.expand=void 0,j),__=tp;b_.expand=function(r,n,o){return n=((n=void 0===n?1/0:n)||0)<1?1/0:n,y_.operate(function(e,t){return __.mergeInternals(e,t,r,n,void 0,!0,o)})};var v_={},m_=(Object.defineProperty(v_,"__esModule",{value:!0}),v_.finalize=void 0,j);v_.finalize=function(r){return m_.operate(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})};var g_={},O_=(Object.defineProperty(g_,"__esModule",{value:!0}),g_.createFind=g_.find=void 0,j),w_=_;function E_(i,u,e){var a="index"===e;return function(r,n){var o=0;r.subscribe(w_.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()}))}}g_.find=function(e,t){return O_.operate(E_(e,t,"value"))},g_.createFind=E_;var P_={},S_=(Object.defineProperty(P_,"__esModule",{value:!0}),P_.findIndex=void 0,j),T_=g_;P_.findIndex=function(e,t){return S_.operate(T_.createFind(e,t,"index"))};var j_={},C_=(Object.defineProperty(j_,"__esModule",{value:!0}),j_.first=void 0,gc),I_=Sd,R_=uy,A_=ry,k_=qy,M_=i;j_.first=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?I_.filter(function(e,t){return n(e,t,r)}):M_.identity,R_.take(1),t?A_.defaultIfEmpty(e):k_.throwIfEmpty(function(){return new C_.EmptyError}))}};var N_={},x_=(Object.defineProperty(N_,"__esModule",{value:!0}),N_.groupBy=void 0,P),D_=C,U_=s,L_=j,F_=_;N_.groupBy=function(b,t,y,_){return L_.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 F_.OperatorSubscriber(s,function(e){try{var t,r,n=b(e),o=f.get(n);o||(f.set(n,o=_?_():new U_.Subject),i=n,u=o,(a=new x_.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=F_.createOperatorSubscriber(o,function(){o.complete(),null!=r&&r.unsubscribe()},void 0,void 0,function(){return f.delete(n)}),h.add(D_.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_={},W_=(Object.defineProperty(B_,"__esModule",{value:!0}),B_.isEmpty=void 0,j),q_=_;B_.isEmpty=function(){return W_.operate(function(e,t){e.subscribe(q_.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})};var z_={},V_={},H_=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.")},G_=(Object.defineProperty(V_,"__esModule",{value:!0}),V_.takeLast=void 0,y),Y_=j,K_=_;V_.takeLast=function(t){return t<=0?function(){return G_.EMPTY}:Y_.operate(function(e,i){var u=[];e.subscribe(K_.createOperatorSubscriber(i,function(e){u.push(e),t<u.length&&u.shift()},function(){var t,e;try{for(var r=H_(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(z_,"__esModule",{value:!0}),z_.last=void 0;var Z_=gc,X_=Sd,Q_=V_,J_=qy,$_=ry,ev=i;z_.last=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?X_.filter(function(e,t){return n(e,t,r)}):ev.identity,Q_.takeLast(1),t?$_.defaultIfEmpty(e):J_.throwIfEmpty(function(){return new Z_.EmptyError}))}};var tv={},rv=(Object.defineProperty(tv,"__esModule",{value:!0}),tv.materialize=void 0,as),nv=j,ov=_;tv.materialize=function(){return nv.operate(function(e,t){e.subscribe(ov.createOperatorSubscriber(t,function(e){t.next(rv.Notification.createNext(e))},function(){t.next(rv.Notification.createComplete()),t.complete()},function(e){t.next(rv.Notification.createError(e)),t.complete()}))})};var iv={},uv=(Object.defineProperty(iv,"__esModule",{value:!0}),iv.max=void 0,Yh),av=b;iv.max=function(r){return uv.reduce(av.isFunction(r)?function(e,t){return 0<r(e,t)?e:t}:function(e,t){return t<e?e:t})};var sv={},cv=(Object.defineProperty(sv,"__esModule",{value:!0}),sv.flatMap=void 0,ep),cv=(sv.flatMap=cv.mergeMap,{}),lv=(Object.defineProperty(cv,"__esModule",{value:!0}),cv.mergeMapTo=void 0,ep),fv=b;cv.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),fv.isFunction(t)?lv.mergeMap(function(){return e},t,r):lv.mergeMap(function(){return e},r="number"==typeof t?t:r)};var pv={},dv=(Object.defineProperty(pv,"__esModule",{value:!0}),pv.mergeScan=void 0,j),hv=tp;pv.mergeScan=function(n,o,i){return void 0===i&&(i=1/0),dv.operate(function(e,t){var r=o;return hv.mergeInternals(e,t,function(e,t){return n(r,e,t)},i,function(e){r=e},!1,void 0,function(){return r=null})})};var tp={},bv={},yv=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},_v=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},vv=(Object.defineProperty(bv,"__esModule",{value:!0}),bv.merge=void 0,j),mv=hd,gv=$f,Ov=m,wv=yc;bv.merge=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=Ov.popScheduler(r),o=Ov.popNumber(r,1/0),r=mv.argsOrArgArray(r);return vv.operate(function(e,t){gv.mergeAll(o)(wv.from(_v([e],yv(r)),n)).subscribe(t)})};var Ev=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},Pv=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},Sv=(Object.defineProperty(tp,"__esModule",{value:!0}),tp.mergeWith=void 0,bv);tp.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Sv.merge.apply(void 0,Pv([],Ev(e)))};var Tv={},jv=(Object.defineProperty(Tv,"__esModule",{value:!0}),Tv.min=void 0,Yh),Cv=b;Tv.min=function(r){return jv.reduce(Cv.isFunction(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e<t?e:t})};var Iv={},Rv=(Object.defineProperty(Iv,"__esModule",{value:!0}),Iv.multicast=void 0,S),Av=b,kv=Lb;Iv.multicast=function(e,t){var r=Av.isFunction(e)?e:function(){return e};return Av.isFunction(t)?kv.connect(t,{connector:r}):function(e){return new Rv.ConnectableObservable(e,r)}};var Mv={},Nv=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},xv=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},Dv=(Object.defineProperty(Mv,"__esModule",{value:!0}),Mv.onErrorResumeNext=Mv.onErrorResumeNextWith=void 0,hd),Uv=dd;function Lv(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Dv.argsOrArgArray(e);return function(e){return Uv.onErrorResumeNext.apply(void 0,xv([e],Nv(r)))}}Mv.onErrorResumeNextWith=Lv,Mv.onErrorResumeNext=Lv;var Fv={},Bv=(Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.pairwise=void 0,j),Wv=_;Fv.pairwise=function(){return Bv.operate(function(e,r){var n,o=!1;e.subscribe(Wv.createOperatorSubscriber(r,function(e){var t=n;n=e,o&&r.next([t,e]),o=!0}))})};var qv={},zv=(Object.defineProperty(qv,"__esModule",{value:!0}),qv.pluck=void 0,yf);qv.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 zv.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 Vv={},Hv=(Object.defineProperty(Vv,"__esModule",{value:!0}),Vv.publish=void 0,s),Gv=Iv,Yv=Lb;Vv.publish=function(t){return t?function(e){return Yv.connect(t)(e)}:function(e){return Gv.multicast(new Hv.Subject)(e)}};var Kv={},Zv=(Object.defineProperty(Kv,"__esModule",{value:!0}),Kv.publishBehavior=void 0,u),Xv=S;Kv.publishBehavior=function(r){return function(e){var t=new Zv.BehaviorSubject(r);return new Xv.ConnectableObservable(e,function(){return t})}};var Qv={},Jv=(Object.defineProperty(Qv,"__esModule",{value:!0}),Qv.publishLast=void 0,g),$v=S;Qv.publishLast=function(){return function(e){var t=new Jv.AsyncSubject;return new $v.ConnectableObservable(e,function(){return t})}};var em={},tm=(Object.defineProperty(em,"__esModule",{value:!0}),em.publishReplay=void 0,Dr),rm=Iv,nm=b;em.publishReplay=function(t,r,e,n){e&&!nm.isFunction(e)&&(n=e);var o=nm.isFunction(e)?e:void 0;return function(e){return rm.multicast(new tm.ReplaySubject(t,r,n),o)(e)}};var om={},im=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},um=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},am=(Object.defineProperty(om,"__esModule",{value:!0}),om.raceWith=void 0,Ad),sm=j,cm=i;om.raceWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length?sm.operate(function(e,t){am.raceInit(um([e],im(r)))(t)}):cm.identity};var lm={},fm=(Object.defineProperty(lm,"__esModule",{value:!0}),lm.repeat=void 0,y),pm=j,dm=_,hm=C,bm=$p;lm.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 fm.EMPTY}:pm.operate(function(t,r){function n(){var e=!1;o=t.subscribe(dm.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?bm.timer(a):hm.innerFrom(a(i)),t=dm.createOperatorSubscriber(r,function(){t.unsubscribe(),n()}),e.subscribe(t)):n()};n()})};var ym={},_m=(Object.defineProperty(ym,"__esModule",{value:!0}),ym.repeatWhen=void 0,C),vm=s,mm=j,gm=_;ym.repeatWhen=function(l){return mm.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 vm.Subject,_m.innerFrom(l(n)).subscribe(gm.createOperatorSubscriber(t,function(){r?c():o=!0},function(){i=!0,a()}))),n},c=function(){u=!1,r=e.subscribe(gm.createOperatorSubscriber(t,void 0,function(){u=!0,a()||s().next()})),o&&(r.unsubscribe(),r=null,o=!1,c())};c()})};var Om={},wm=(Object.defineProperty(Om,"__esModule",{value:!0}),Om.retry=void 0,j),Em=_,Pm=i,Sm=$p,Tm=C;Om.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?Pm.identity:wm.operate(function(e,i){var u,a=0,s=function(){var o=!1;u=e.subscribe(Em.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?Sm.timer(l):Tm.innerFrom(l(e,a)),n=Em.createOperatorSubscriber(i,function(){n.unsubscribe(),t()},function(){i.complete()}),r.subscribe(n)):t()):i.error(e)})),o&&(u.unsubscribe(),u=null,s())};s()})};var jm={},Cm=(Object.defineProperty(jm,"__esModule",{value:!0}),jm.retryWhen=void 0,C),Im=s,Rm=j,Am=_;jm.retryWhen=function(u){return Rm.operate(function(e,t){var r,n,o=!1,i=function(){r=e.subscribe(Am.createOperatorSubscriber(t,void 0,void 0,function(e){n||(n=new Im.Subject,Cm.innerFrom(u(n)).subscribe(Am.createOperatorSubscriber(t,function(){return r?i():o=!0}))),n&&n.next(e)})),o&&(r.unsubscribe(),r=null,o=!1,i())};i()})};var km={},Mm=(Object.defineProperty(km,"__esModule",{value:!0}),km.sample=void 0,C),Nm=j,xm=v,Dm=_;km.sample=function(o){return Nm.operate(function(e,t){var r=!1,n=null;e.subscribe(Dm.createOperatorSubscriber(t,function(e){r=!0,n=e})),Mm.innerFrom(o).subscribe(Dm.createOperatorSubscriber(t,function(){var e;r&&(r=!1,e=n,n=null,t.next(e))},xm.noop))})};var Um={},Lm=(Object.defineProperty(Um,"__esModule",{value:!0}),Um.sampleTime=void 0,us),Fm=km,Bm=Jp;Um.sampleTime=function(e,t){return Fm.sample(Bm.interval(e,t=void 0===t?Lm.asyncScheduler:t))};var Wm={},qm=(Object.defineProperty(Wm,"__esModule",{value:!0}),Wm.scan=void 0,j),zm=Kh;Wm.scan=function(e,t){return qm.operate(zm.scanInternals(e,t,2<=arguments.length,!0))};var Kh={},Vm=(Object.defineProperty(Kh,"__esModule",{value:!0}),Kh.sequenceEqual=void 0,j),Hm=_,Gm=C;function Ym(){return{buffer:[],complete:!1}}Kh.sequenceEqual=function(u,a){return void 0===a&&(a=function(e,t){return e===t}),Vm.operate(function(e,t){function r(n,o){var r=Hm.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=Ym(),o=Ym(),i=function(e){t.next(e),t.complete()};e.subscribe(r(n,o)),Gm.innerFrom(u).subscribe(r(o,n))})};var Km={},Zm=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},Xm=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},Qm=(Object.defineProperty(Km,"__esModule",{value:!0}),Km.share=void 0,C),Jm=s,$m=Q,e0=j;function t0(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 $m.SafeSubscriber({next:function(){r.unsubscribe(),e()}}),Qm.innerFrom(t.apply(void 0,Xm([],Zm(n)))).subscribe(r)}Km.share=function(e){var t=(e=void 0===e?{}:e).connector,p=void 0===t?function(){return new Jm.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 e0.operate(function(e,t){a++,c||s||l();var r=u=null!=u?u:p();t.add(function(){0!==--a||c||s||(i=t0(n,b))}),r.subscribe(t),!o&&0<a&&(o=new $m.SafeSubscriber({next:function(e){return r.next(e)},error:function(e){c=!0,l(),i=t0(f,d,e),r.error(e)},complete:function(){s=!0,l(),i=t0(f,h),r.complete()}}),Qm.innerFrom(e).subscribe(o))})(e)}};var r0={},n0=(Object.defineProperty(r0,"__esModule",{value:!0}),r0.shareReplay=void 0,Dr),o0=Km;r0.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,o0.share({connector:function(){return new n0.ReplaySubject(o,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})};var i0={},u0=(Object.defineProperty(i0,"__esModule",{value:!0}),i0.single=void 0,gc),a0=hl,s0=jl,c0=j,l0=_;i0.single=function(a){return c0.operate(function(t,r){var n,o=!1,i=!1,u=0;t.subscribe(l0.createOperatorSubscriber(r,function(e){i=!0,a&&!a(e,u++,t)||(o&&r.error(new a0.SequenceError("Too many matching values")),o=!0,n=e)},function(){o?(r.next(n),r.complete()):r.error(i?new s0.NotFoundError("No matching values"):new u0.EmptyError)}))})};var f0={},p0=(Object.defineProperty(f0,"__esModule",{value:!0}),f0.skip=void 0,Sd);f0.skip=function(r){return p0.filter(function(e,t){return r<=t})};var d0={},h0=(Object.defineProperty(d0,"__esModule",{value:!0}),d0.skipLast=void 0,i),b0=j,y0=_;d0.skipLast=function(u){return u<=0?h0.identity:b0.operate(function(e,n){var o=new Array(u),i=0;return e.subscribe(y0.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 _0={},v0=(Object.defineProperty(_0,"__esModule",{value:!0}),_0.skipUntil=void 0,j),m0=_,g0=C,O0=v;_0.skipUntil=function(o){return v0.operate(function(e,t){var r=!1,n=m0.createOperatorSubscriber(t,function(){null!=n&&n.unsubscribe(),r=!0},O0.noop);g0.innerFrom(o).subscribe(n),e.subscribe(m0.createOperatorSubscriber(t,function(e){return r&&t.next(e)}))})};var w0={},E0=(Object.defineProperty(w0,"__esModule",{value:!0}),w0.skipWhile=void 0,j),P0=_;w0.skipWhile=function(o){return E0.operate(function(e,t){var r=!1,n=0;e.subscribe(P0.createOperatorSubscriber(t,function(e){return(r=r||!o(e,n++))&&t.next(e)}))})};var S0={},T0=(Object.defineProperty(S0,"__esModule",{value:!0}),S0.startWith=void 0,Qf),j0=m,C0=j;S0.startWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=j0.popScheduler(r);return C0.operate(function(e,t){(n?T0.concat(r,e,n):T0.concat(r,e)).subscribe(t)})};var I0={},R0={},A0=(Object.defineProperty(R0,"__esModule",{value:!0}),R0.switchMap=void 0,C),k0=j,M0=_;R0.switchMap=function(s,c){return k0.operate(function(e,o){function i(){t&&!u&&o.complete()}var u=null,a=0,t=!1;e.subscribe(M0.createOperatorSubscriber(o,function(t){null!=u&&u.unsubscribe();var r=0,n=a++;A0.innerFrom(s(t,n)).subscribe(u=M0.createOperatorSubscriber(o,function(e){return o.next(c?c(t,e,n,r++):e)},function(){u=null,i()}))},function(){t=!0,i()}))})},Object.defineProperty(I0,"__esModule",{value:!0}),I0.switchAll=void 0;var N0=R0,x0=i;I0.switchAll=function(){return N0.switchMap(x0.identity)};var D0={},U0=(Object.defineProperty(D0,"__esModule",{value:!0}),D0.switchMapTo=void 0,R0),L0=b;D0.switchMapTo=function(e,t){return L0.isFunction(t)?U0.switchMap(function(){return e},t):U0.switchMap(function(){return e})};var F0={},B0=(Object.defineProperty(F0,"__esModule",{value:!0}),F0.switchScan=void 0,R0),W0=j;F0.switchScan=function(n,o){return W0.operate(function(e,t){var r=o;return B0.switchMap(function(e,t){return n(r,e,t)},function(e,t){return r=t})(e).subscribe(t),function(){r=null}})};var q0={},z0=(Object.defineProperty(q0,"__esModule",{value:!0}),q0.takeUntil=void 0,j),V0=_,H0=C,G0=v;q0.takeUntil=function(r){return z0.operate(function(e,t){H0.innerFrom(r).subscribe(V0.createOperatorSubscriber(t,function(){return t.complete()},G0.noop)),t.closed||e.subscribe(t)})};var Y0={},K0=(Object.defineProperty(Y0,"__esModule",{value:!0}),Y0.takeWhile=void 0,j),Z0=_;Y0.takeWhile=function(o,i){return void 0===i&&(i=!1),K0.operate(function(e,r){var n=0;e.subscribe(Z0.createOperatorSubscriber(r,function(e){var t=o(e,n++);(t||i)&&r.next(e),t||r.complete()}))})};var X0={},Q0=(Object.defineProperty(X0,"__esModule",{value:!0}),X0.tap=void 0,b),J0=j,$0=_,eg=i;X0.tap=function(e,t,r){var o=Q0.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return o?J0.operate(function(e,r){null!=(t=o.subscribe)&&t.call(o);var t,n=!0;e.subscribe($0.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)}))}):eg.identity};var b={},tg=(Object.defineProperty(b,"__esModule",{value:!0}),b.throttle=void 0,j),rg=_,ng=C;b.throttle=function(h,b){return tg.operate(function(e,t){function r(){var e;a&&(a=!1,e=s,s=null,t.next(e),l||d(e))}var n=null!=b?b:{},o=n.leading,i=void 0===o||o,o=n.trailing,u=void 0!==o&&o,a=!1,s=null,c=null,l=!1,f=function(){null!=c&&c.unsubscribe(),c=null,u&&(r(),l&&t.complete())},p=function(){c=null,l&&t.complete()},d=function(e){return c=ng.innerFrom(h(e)).subscribe(rg.createOperatorSubscriber(t,f,p))};e.subscribe(rg.createOperatorSubscriber(t,function(e){a=!0,s=e,c&&!c.closed||(i?r():d(e))},function(){l=!0,u&&a&&c&&!c.closed||t.complete()}))})};var og={},ig=(Object.defineProperty(og,"__esModule",{value:!0}),og.throttleTime=void 0,us),ug=b,ag=$p;og.throttleTime=function(e,t,r){var n=ag.timer(e,t=void 0===t?ig.asyncScheduler:t);return ug.throttle(function(){return n},r)};var sg={},cg=(Object.defineProperty(sg,"__esModule",{value:!0}),sg.TimeInterval=sg.timeInterval=void 0,us),lg=j,fg=_;sg.timeInterval=function(i){return void 0===i&&(i=cg.asyncScheduler),lg.operate(function(e,n){var o=i.now();e.subscribe(fg.createOperatorSubscriber(n,function(e){var t=i.now(),r=t-o;o=t,n.next(new pg(e,r))}))})};var pg=function(e,t){this.value=e,this.interval=t},dg=(sg.TimeInterval=pg,{}),hg=(Object.defineProperty(dg,"__esModule",{value:!0}),dg.timeoutWith=void 0,us),bg=vl,yg=Mc;dg.timeoutWith=function(e,t,r){var n,o;if(r=null!=r?r:hg.async,bg.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 yg.timeout({first:n,each:o,scheduler:r,with:e})};var vl={},_g=(Object.defineProperty(vl,"__esModule",{value:!0}),vl.timestamp=void 0,n),vg=yf;vl.timestamp=function(t){return void 0===t&&(t=_g.dateTimestampProvider),vg.map(function(e){return{value:e,timestamp:t.now()}})};var n={},mg=(Object.defineProperty(n,"__esModule",{value:!0}),n.window=void 0,s),gg=j,Og=_,wg=v,Eg=C;n.window=function(o){return gg.operate(function(e,t){function r(e){n.error(e),t.error(e)}var n=new mg.Subject;t.next(n.asObservable());return e.subscribe(Og.createOperatorSubscriber(t,function(e){return null==n?void 0:n.next(e)},function(){n.complete(),t.complete()},r)),Eg.innerFrom(o).subscribe(Og.createOperatorSubscriber(t,function(){n.complete(),t.next(n=new mg.Subject)},wg.noop,r)),function(){null!=n&&n.unsubscribe(),n=null}})};var Pg={},Sg=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.")},Tg=(Object.defineProperty(Pg,"__esModule",{value:!0}),Pg.windowCount=void 0,s),jg=j,Cg=_;Pg.windowCount=function(s,e){var c=0<(e=void 0===e?0:e)?e:s;return jg.operate(function(e,i){var u=[new Tg.Subject],a=0;i.next(u[0].asObservable()),e.subscribe(Cg.createOperatorSubscriber(i,function(e){try{for(var t=Sg(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 Tg.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 Ig={},Rg=(Object.defineProperty(Ig,"__esModule",{value:!0}),Ig.windowTime=void 0,s),Ag=us,kg=h,Mg=j,Ng=_,xg=X,Dg=m,Ug=il;Ig.windowTime=function(c){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var l=null!=(e=Dg.popScheduler(t))?e:Ag.asyncScheduler,f=null!=(e=t[0])?e:null,p=t[1]||1/0;return Mg.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(),xg.arrRemove(o,e),i&&a()},a=function(){var e,t,r;o&&(e=new kg.Subscription,n.add(e),t=new Rg.Subject,o.push(r={window:t,subs:e,seen:0}),n.next(t.asObservable()),Ug.executeSchedule(e,l,function(){return u(r)},c))},s=(null!==f&&0<=f?Ug.executeSchedule(n,l,a,f,!0):i=!0,a(),function(e){return o.slice().forEach(e)});return e.subscribe(Ng.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 il={},Lg=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.")},Fg=(Object.defineProperty(il,"__esModule",{value:!0}),il.windowToggle=void 0,s),Bg=h,Wg=j,qg=C,zg=_,Vg=v,Hg=X;il.windowToggle=function(t,a){return Wg.operate(function(e,o){function i(e){for(;0<u.length;)u.shift().error(e);o.error(e)}var u=[];qg.innerFrom(t).subscribe(zg.createOperatorSubscriber(o,function(e){var t,r=new Fg.Subject,n=(u.push(r),new Bg.Subscription);try{t=qg.innerFrom(a(e))}catch(e){return void i(e)}o.next(r.asObservable()),n.add(t.subscribe(zg.createOperatorSubscriber(o,function(){Hg.arrRemove(u,r),r.complete(),n.unsubscribe()},Vg.noop,i)))},Vg.noop)),e.subscribe(zg.createOperatorSubscriber(o,function(e){var t,r,n=u.slice();try{for(var o=Lg(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={},Gg=(Object.defineProperty(X,"__esModule",{value:!0}),X.windowWhen=void 0,s),Yg=j,Kg=_,Zg=C;X.windowWhen=function(u){return Yg.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 Gg.Subject,t.next(r.asObservable());try{e=Zg.innerFrom(u())}catch(e){return void o(e)}e.subscribe(n=Kg.createOperatorSubscriber(t,i,i,o))};i(),e.subscribe(Kg.createOperatorSubscriber(t,function(e){return r.next(e)},function(){r.complete(),t.complete()},o,function(){null!=n&&n.unsubscribe(),r=null}))})};var Xg={},Qg=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},Jg=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(Xg,"__esModule",{value:!0}),Xg.withLatestFrom=void 0,j),eO=_,tO=C,rO=i,nO=v,oO=m;Xg.withLatestFrom=function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var s=oO.popResultSelector(a);return $g.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){tO.innerFrom(a[t]).subscribe(eO.createOperatorSubscriber(r,function(e){n[t]=e,i||o[t]||(o[t]=!0,(i=o.every(rO.identity))&&(o=null))},nO.noop))}(u);e.subscribe(eO.createOperatorSubscriber(r,function(e){i&&(e=Jg([e],Qg(n)),r.next(s?s.apply(void 0,Jg([],Qg(e))):e))}))})};var _={},iO=(Object.defineProperty(_,"__esModule",{value:!0}),_.zipAll=void 0,Vd),uO=I;_.zipAll=function(e){return uO.joinAllInternals(iO.zip,e)};var C={},m={},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},sO=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},cO=(Object.defineProperty(m,"__esModule",{value:!0}),m.zip=void 0,Vd),lO=j;m.zip=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return lO.operate(function(e,t){cO.zip.apply(void 0,sO([e],aO(r))).subscribe(t)})};var fO,pO,dO,hO,bO,yO,_O,vO,mO,gO,OO,wO,EO,PO,SO,TO,jO,CO,IO,RO,AO,kO,MO,NO,xO,DO,UO,LO,FO,BO,WO,qO,zO,VO,HO,GO,YO,KO,ZO,XO,QO,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,Aw,kw,Mw,Nw,xw,Dw,Uw,Lw,Fw,Bw,Ww,qw,zw,Vw,Hw,Gw,Yw,Kw,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,AE,kE,ME,NE,xE,DE,UE,LE,FE,BE,WE,qE,zE,VE,HE,GE,YE,KE,ZE,XE,QE,JE,$E,eP,tP,rP,nP,oP,iP,uP,aP,sP,cP,lP,fP,pP,dP,hP,bP,yP,_P=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},vP=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},mP=(Object.defineProperty(C,"__esModule",{value:!0}),C.zipWith=void 0,m);C.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return mP.zip.apply(void 0,vP([],_P(e)))},I=qr,fO=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]}),j=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||fO(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,pO=P,Object.defineProperty(I,"Observable",{enumerable:!0,get:function(){return pO.Observable}}),dO=S,Object.defineProperty(I,"ConnectableObservable",{enumerable:!0,get:function(){return dO.ConnectableObservable}}),hO=f,Object.defineProperty(I,"observable",{enumerable:!0,get:function(){return hO.observable}}),bO=t,Object.defineProperty(I,"animationFrames",{enumerable:!0,get:function(){return bO.animationFrames}}),yO=s,Object.defineProperty(I,"Subject",{enumerable:!0,get:function(){return yO.Subject}}),_O=u,Object.defineProperty(I,"BehaviorSubject",{enumerable:!0,get:function(){return _O.BehaviorSubject}}),vO=Dr,Object.defineProperty(I,"ReplaySubject",{enumerable:!0,get:function(){return vO.ReplaySubject}}),mO=g,Object.defineProperty(I,"AsyncSubject",{enumerable:!0,get:function(){return mO.AsyncSubject}}),gO=o,Object.defineProperty(I,"asap",{enumerable:!0,get:function(){return gO.asap}}),Object.defineProperty(I,"asapScheduler",{enumerable:!0,get:function(){return gO.asapScheduler}}),OO=us,Object.defineProperty(I,"async",{enumerable:!0,get:function(){return OO.async}}),Object.defineProperty(I,"asyncScheduler",{enumerable:!0,get:function(){return OO.asyncScheduler}}),wO=ks,Object.defineProperty(I,"queue",{enumerable:!0,get:function(){return wO.queue}}),Object.defineProperty(I,"queueScheduler",{enumerable:!0,get:function(){return wO.queueScheduler}}),EO=qs,Object.defineProperty(I,"animationFrame",{enumerable:!0,get:function(){return EO.animationFrame}}),Object.defineProperty(I,"animationFrameScheduler",{enumerable:!0,get:function(){return EO.animationFrameScheduler}}),PO=Gs,Object.defineProperty(I,"VirtualTimeScheduler",{enumerable:!0,get:function(){return PO.VirtualTimeScheduler}}),Object.defineProperty(I,"VirtualAction",{enumerable:!0,get:function(){return PO.VirtualAction}}),SO=hs,Object.defineProperty(I,"Scheduler",{enumerable:!0,get:function(){return SO.Scheduler}}),TO=h,Object.defineProperty(I,"Subscription",{enumerable:!0,get:function(){return TO.Subscription}}),jO=Q,Object.defineProperty(I,"Subscriber",{enumerable:!0,get:function(){return jO.Subscriber}}),CO=as,Object.defineProperty(I,"Notification",{enumerable:!0,get:function(){return CO.Notification}}),Object.defineProperty(I,"NotificationKind",{enumerable:!0,get:function(){return CO.NotificationKind}}),IO=T,Object.defineProperty(I,"pipe",{enumerable:!0,get:function(){return IO.pipe}}),RO=v,Object.defineProperty(I,"noop",{enumerable:!0,get:function(){return RO.noop}}),AO=i,Object.defineProperty(I,"identity",{enumerable:!0,get:function(){return AO.identity}}),kO=Ic,Object.defineProperty(I,"isObservable",{enumerable:!0,get:function(){return kO.isObservable}}),MO=wc,Object.defineProperty(I,"lastValueFrom",{enumerable:!0,get:function(){return MO.lastValueFrom}}),NO=Sc,Object.defineProperty(I,"firstValueFrom",{enumerable:!0,get:function(){return NO.firstValueFrom}}),xO=jc,Object.defineProperty(I,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return xO.ArgumentOutOfRangeError}}),DO=gc,Object.defineProperty(I,"EmptyError",{enumerable:!0,get:function(){return DO.EmptyError}}),UO=jl,Object.defineProperty(I,"NotFoundError",{enumerable:!0,get:function(){return UO.NotFoundError}}),LO=Qe,Object.defineProperty(I,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return LO.ObjectUnsubscribedError}}),FO=hl,Object.defineProperty(I,"SequenceError",{enumerable:!0,get:function(){return FO.SequenceError}}),BO=Mc,Object.defineProperty(I,"TimeoutError",{enumerable:!0,get:function(){return BO.TimeoutError}}),WO=Ar,Object.defineProperty(I,"UnsubscriptionError",{enumerable:!0,get:function(){return WO.UnsubscriptionError}}),qO=Cc,Object.defineProperty(I,"bindCallback",{enumerable:!0,get:function(){return qO.bindCallback}}),zO=kf,Object.defineProperty(I,"bindNodeCallback",{enumerable:!0,get:function(){return zO.bindNodeCallback}}),VO=w,Object.defineProperty(I,"combineLatest",{enumerable:!0,get:function(){return VO.combineLatest}}),HO=Qf,Object.defineProperty(I,"concat",{enumerable:!0,get:function(){return HO.concat}}),GO=yp,Object.defineProperty(I,"connectable",{enumerable:!0,get:function(){return GO.connectable}}),YO=_p,Object.defineProperty(I,"defer",{enumerable:!0,get:function(){return YO.defer}}),KO=y,Object.defineProperty(I,"empty",{enumerable:!0,get:function(){return KO.empty}}),ZO=Pp,Object.defineProperty(I,"forkJoin",{enumerable:!0,get:function(){return ZO.forkJoin}}),XO=yc,Object.defineProperty(I,"from",{enumerable:!0,get:function(){return XO.from}}),QO=Nf,Object.defineProperty(I,"fromEvent",{enumerable:!0,get:function(){return QO.fromEvent}}),JO=Ff,Object.defineProperty(I,"fromEventPattern",{enumerable:!0,get:function(){return JO.fromEventPattern}}),$O=mc,Object.defineProperty(I,"generate",{enumerable:!0,get:function(){return $O.generate}}),ew=gl,Object.defineProperty(I,"iif",{enumerable:!0,get:function(){return ew.iif}}),tw=Jp,Object.defineProperty(I,"interval",{enumerable:!0,get:function(){return tw.interval}}),rw=fc,Object.defineProperty(I,"merge",{enumerable:!0,get:function(){return rw.merge}}),nw=pd,Object.defineProperty(I,"never",{enumerable:!0,get:function(){return nw.never}}),ow=l,Object.defineProperty(I,"of",{enumerable:!0,get:function(){return ow.of}}),iw=dd,Object.defineProperty(I,"onErrorResumeNext",{enumerable:!0,get:function(){return iw.onErrorResumeNext}}),uw=Od,Object.defineProperty(I,"pairs",{enumerable:!0,get:function(){return uw.pairs}}),aw=Ed,Object.defineProperty(I,"partition",{enumerable:!0,get:function(){return aw.partition}}),sw=Ad,Object.defineProperty(I,"race",{enumerable:!0,get:function(){return sw.race}}),cw=Ud,Object.defineProperty(I,"range",{enumerable:!0,get:function(){return cw.range}}),lw=vc,Object.defineProperty(I,"throwError",{enumerable:!0,get:function(){return lw.throwError}}),fw=$p,Object.defineProperty(I,"timer",{enumerable:!0,get:function(){return fw.timer}}),pw=Bd,Object.defineProperty(I,"using",{enumerable:!0,get:function(){return pw.using}}),dw=Vd,Object.defineProperty(I,"zip",{enumerable:!0,get:function(){return dw.zip}}),hw=_c,Object.defineProperty(I,"scheduled",{enumerable:!0,get:function(){return hw.scheduled}}),bw=y,Object.defineProperty(I,"EMPTY",{enumerable:!0,get:function(){return bw.EMPTY}}),yw=pd,Object.defineProperty(I,"NEVER",{enumerable:!0,get:function(){return yw.NEVER}}),j($d,I),_w=E,Object.defineProperty(I,"config",{enumerable:!0,get:function(){return _w.config}}),vw=eh,Object.defineProperty(I,"audit",{enumerable:!0,get:function(){return vw.audit}}),mw=oh,Object.defineProperty(I,"auditTime",{enumerable:!0,get:function(){return mw.auditTime}}),gw=sh,Object.defineProperty(I,"buffer",{enumerable:!0,get:function(){return gw.buffer}}),Ow=dh,Object.defineProperty(I,"bufferCount",{enumerable:!0,get:function(){return Ow.bufferCount}}),ww=vh,Object.defineProperty(I,"bufferTime",{enumerable:!0,get:function(){return ww.bufferTime}}),Ew=jh,Object.defineProperty(I,"bufferToggle",{enumerable:!0,get:function(){return Ew.bufferToggle}}),Pw=xh,Object.defineProperty(I,"bufferWhen",{enumerable:!0,get:function(){return Pw.bufferWhen}}),Sw=Bh,Object.defineProperty(I,"catchError",{enumerable:!0,get:function(){return Sw.catchError}}),Tw=Vh,Object.defineProperty(I,"combineAll",{enumerable:!0,get:function(){return Tw.combineAll}}),jw=Hh,Object.defineProperty(I,"combineLatestAll",{enumerable:!0,get:function(){return jw.combineLatestAll}}),Cw=sb,Object.defineProperty(I,"combineLatestWith",{enumerable:!0,get:function(){return Cw.combineLatestWith}}),Iw=Jf,Object.defineProperty(I,"concatAll",{enumerable:!0,get:function(){return Iw.concatAll}}),Rw=bf,Object.defineProperty(I,"concatMap",{enumerable:!0,get:function(){return Rw.concatMap}}),Aw=Pb,Object.defineProperty(I,"concatMapTo",{enumerable:!0,get:function(){return Aw.concatMapTo}}),kw=jb,Object.defineProperty(I,"concatWith",{enumerable:!0,get:function(){return kw.concatWith}}),Mw=Lb,Object.defineProperty(I,"connect",{enumerable:!0,get:function(){return Mw.connect}}),Nw=Fb,Object.defineProperty(I,"count",{enumerable:!0,get:function(){return Nw.count}}),xw=Yb,Object.defineProperty(I,"debounce",{enumerable:!0,get:function(){return xw.debounce}}),Dw=Jb,Object.defineProperty(I,"debounceTime",{enumerable:!0,get:function(){return Dw.debounceTime}}),Uw=ry,Object.defineProperty(I,"defaultIfEmpty",{enumerable:!0,get:function(){return Uw.defaultIfEmpty}}),Lw=R,Object.defineProperty(I,"delay",{enumerable:!0,get:function(){return Lw.delay}}),Fw=iy,Object.defineProperty(I,"delayWhen",{enumerable:!0,get:function(){return Fw.delayWhen}}),Bw=Sy,Object.defineProperty(I,"dematerialize",{enumerable:!0,get:function(){return Bw.dematerialize}}),Ww=Iy,Object.defineProperty(I,"distinct",{enumerable:!0,get:function(){return Ww.distinct}}),qw=Ny,Object.defineProperty(I,"distinctUntilChanged",{enumerable:!0,get:function(){return qw.distinctUntilChanged}}),zw=Fy,Object.defineProperty(I,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return zw.distinctUntilKeyChanged}}),Vw=Wy,Object.defineProperty(I,"elementAt",{enumerable:!0,get:function(){return Vw.elementAt}}),Hw=Jy,Object.defineProperty(I,"endWith",{enumerable:!0,get:function(){return Hw.endWith}}),Gw=n_,Object.defineProperty(I,"every",{enumerable:!0,get:function(){return Gw.every}}),Yw=u_,Object.defineProperty(I,"exhaust",{enumerable:!0,get:function(){return Yw.exhaust}}),Kw=a_,Object.defineProperty(I,"exhaustAll",{enumerable:!0,get:function(){return Kw.exhaustAll}}),Zw=s_,Object.defineProperty(I,"exhaustMap",{enumerable:!0,get:function(){return Zw.exhaustMap}}),Xw=b_,Object.defineProperty(I,"expand",{enumerable:!0,get:function(){return Xw.expand}}),Qw=Sd,Object.defineProperty(I,"filter",{enumerable:!0,get:function(){return Qw.filter}}),Jw=v_,Object.defineProperty(I,"finalize",{enumerable:!0,get:function(){return Jw.finalize}}),$w=g_,Object.defineProperty(I,"find",{enumerable:!0,get:function(){return $w.find}}),eE=P_,Object.defineProperty(I,"findIndex",{enumerable:!0,get:function(){return eE.findIndex}}),tE=j_,Object.defineProperty(I,"first",{enumerable:!0,get:function(){return tE.first}}),rE=N_,Object.defineProperty(I,"groupBy",{enumerable:!0,get:function(){return rE.groupBy}}),nE=ly,Object.defineProperty(I,"ignoreElements",{enumerable:!0,get:function(){return nE.ignoreElements}}),oE=B_,Object.defineProperty(I,"isEmpty",{enumerable:!0,get:function(){return oE.isEmpty}}),iE=z_,Object.defineProperty(I,"last",{enumerable:!0,get:function(){return iE.last}}),uE=yf,Object.defineProperty(I,"map",{enumerable:!0,get:function(){return uE.map}}),aE=hy,Object.defineProperty(I,"mapTo",{enumerable:!0,get:function(){return aE.mapTo}}),sE=tv,Object.defineProperty(I,"materialize",{enumerable:!0,get:function(){return sE.materialize}}),cE=iv,Object.defineProperty(I,"max",{enumerable:!0,get:function(){return cE.max}}),lE=$f,Object.defineProperty(I,"mergeAll",{enumerable:!0,get:function(){return lE.mergeAll}}),fE=sv,Object.defineProperty(I,"flatMap",{enumerable:!0,get:function(){return fE.flatMap}}),pE=ep,Object.defineProperty(I,"mergeMap",{enumerable:!0,get:function(){return pE.mergeMap}}),dE=cv,Object.defineProperty(I,"mergeMapTo",{enumerable:!0,get:function(){return dE.mergeMapTo}}),hE=pv,Object.defineProperty(I,"mergeScan",{enumerable:!0,get:function(){return hE.mergeScan}}),bE=tp,Object.defineProperty(I,"mergeWith",{enumerable:!0,get:function(){return bE.mergeWith}}),yE=Tv,Object.defineProperty(I,"min",{enumerable:!0,get:function(){return yE.min}}),_E=Iv,Object.defineProperty(I,"multicast",{enumerable:!0,get:function(){return _E.multicast}}),vE=p,Object.defineProperty(I,"observeOn",{enumerable:!0,get:function(){return vE.observeOn}}),mE=Mv,Object.defineProperty(I,"onErrorResumeNextWith",{enumerable:!0,get:function(){return mE.onErrorResumeNextWith}}),gE=Fv,Object.defineProperty(I,"pairwise",{enumerable:!0,get:function(){return gE.pairwise}}),OE=qv,Object.defineProperty(I,"pluck",{enumerable:!0,get:function(){return OE.pluck}}),wE=Vv,Object.defineProperty(I,"publish",{enumerable:!0,get:function(){return wE.publish}}),EE=Kv,Object.defineProperty(I,"publishBehavior",{enumerable:!0,get:function(){return EE.publishBehavior}}),PE=Qv,Object.defineProperty(I,"publishLast",{enumerable:!0,get:function(){return PE.publishLast}}),SE=em,Object.defineProperty(I,"publishReplay",{enumerable:!0,get:function(){return SE.publishReplay}}),TE=om,Object.defineProperty(I,"raceWith",{enumerable:!0,get:function(){return TE.raceWith}}),jE=Yh,Object.defineProperty(I,"reduce",{enumerable:!0,get:function(){return jE.reduce}}),CE=lm,Object.defineProperty(I,"repeat",{enumerable:!0,get:function(){return CE.repeat}}),IE=ym,Object.defineProperty(I,"repeatWhen",{enumerable:!0,get:function(){return IE.repeatWhen}}),RE=Om,Object.defineProperty(I,"retry",{enumerable:!0,get:function(){return RE.retry}}),AE=jm,Object.defineProperty(I,"retryWhen",{enumerable:!0,get:function(){return AE.retryWhen}}),kE=O,Object.defineProperty(I,"refCount",{enumerable:!0,get:function(){return kE.refCount}}),ME=km,Object.defineProperty(I,"sample",{enumerable:!0,get:function(){return ME.sample}}),NE=Um,Object.defineProperty(I,"sampleTime",{enumerable:!0,get:function(){return NE.sampleTime}}),xE=Wm,Object.defineProperty(I,"scan",{enumerable:!0,get:function(){return xE.scan}}),DE=Kh,Object.defineProperty(I,"sequenceEqual",{enumerable:!0,get:function(){return DE.sequenceEqual}}),UE=Km,Object.defineProperty(I,"share",{enumerable:!0,get:function(){return UE.share}}),LE=r0,Object.defineProperty(I,"shareReplay",{enumerable:!0,get:function(){return LE.shareReplay}}),FE=i0,Object.defineProperty(I,"single",{enumerable:!0,get:function(){return FE.single}}),BE=f0,Object.defineProperty(I,"skip",{enumerable:!0,get:function(){return BE.skip}}),WE=d0,Object.defineProperty(I,"skipLast",{enumerable:!0,get:function(){return WE.skipLast}}),qE=_0,Object.defineProperty(I,"skipUntil",{enumerable:!0,get:function(){return qE.skipUntil}}),zE=w0,Object.defineProperty(I,"skipWhile",{enumerable:!0,get:function(){return zE.skipWhile}}),VE=S0,Object.defineProperty(I,"startWith",{enumerable:!0,get:function(){return VE.startWith}}),HE=cl,Object.defineProperty(I,"subscribeOn",{enumerable:!0,get:function(){return HE.subscribeOn}}),GE=I0,Object.defineProperty(I,"switchAll",{enumerable:!0,get:function(){return GE.switchAll}}),YE=R0,Object.defineProperty(I,"switchMap",{enumerable:!0,get:function(){return YE.switchMap}}),KE=D0,Object.defineProperty(I,"switchMapTo",{enumerable:!0,get:function(){return KE.switchMapTo}}),ZE=F0,Object.defineProperty(I,"switchScan",{enumerable:!0,get:function(){return ZE.switchScan}}),XE=uy,Object.defineProperty(I,"take",{enumerable:!0,get:function(){return XE.take}}),QE=V_,Object.defineProperty(I,"takeLast",{enumerable:!0,get:function(){return QE.takeLast}}),JE=q0,Object.defineProperty(I,"takeUntil",{enumerable:!0,get:function(){return JE.takeUntil}}),$E=Y0,Object.defineProperty(I,"takeWhile",{enumerable:!0,get:function(){return $E.takeWhile}}),eP=X0,Object.defineProperty(I,"tap",{enumerable:!0,get:function(){return eP.tap}}),tP=b,Object.defineProperty(I,"throttle",{enumerable:!0,get:function(){return tP.throttle}}),rP=og,Object.defineProperty(I,"throttleTime",{enumerable:!0,get:function(){return rP.throttleTime}}),nP=qy,Object.defineProperty(I,"throwIfEmpty",{enumerable:!0,get:function(){return nP.throwIfEmpty}}),oP=sg,Object.defineProperty(I,"timeInterval",{enumerable:!0,get:function(){return oP.timeInterval}}),iP=Mc,Object.defineProperty(I,"timeout",{enumerable:!0,get:function(){return iP.timeout}}),uP=dg,Object.defineProperty(I,"timeoutWith",{enumerable:!0,get:function(){return uP.timeoutWith}}),aP=vl,Object.defineProperty(I,"timestamp",{enumerable:!0,get:function(){return aP.timestamp}}),sP=Gh,Object.defineProperty(I,"toArray",{enumerable:!0,get:function(){return sP.toArray}}),cP=n,Object.defineProperty(I,"window",{enumerable:!0,get:function(){return cP.window}}),lP=Pg,Object.defineProperty(I,"windowCount",{enumerable:!0,get:function(){return lP.windowCount}}),fP=Ig,Object.defineProperty(I,"windowTime",{enumerable:!0,get:function(){return fP.windowTime}}),pP=il,Object.defineProperty(I,"windowToggle",{enumerable:!0,get:function(){return pP.windowToggle}}),dP=X,Object.defineProperty(I,"windowWhen",{enumerable:!0,get:function(){return dP.windowWhen}}),hP=Xg,Object.defineProperty(I,"withLatestFrom",{enumerable:!0,get:function(){return hP.withLatestFrom}}),bP=_,Object.defineProperty(I,"zipAll",{enumerable:!0,get:function(){return bP.zipAll}}),yP=C,Object.defineProperty(I,"zipWith",{enumerable:!0,get:function(){return yP.zipWith}});var P={},S={},gP=(Object.defineProperty(S,"__esModule",{value:!0}),S.partition=void 0,Pd),OP=Sd;S.partition=function(t,r){return function(e){return[OP.filter(t,r)(e),OP.filter(gP.not(t,r))(e)]}};var wP,EP,PP,SP,TP,jP,CP,IP,RP,AP,kP,MP,NP,xP,DP,UP,LP,FP,BP,WP,qP,zP,VP,HP,GP,YP,KP,ZP,XP,QP,JP,$P,eS,tS,rS,nS,oS,iS,uS,aS,sS,cS,lS,fS,pS,dS,hS,bS,yS,_S,vS,mS,gS,OS,wS,ES,PS,SS,TS,jS,CS,IS,RS,AS,kS,MS,NS,xS,DS,US,LS,FS,BS,WS,qS,zS,VS,HS,GS,YS,KS,ZS,XS,QS,JS,$S,e1,t1,r1,n1,o1,i1,u1,a1,s1,c1,l1,f1,p1,d1,h1,b1,y1,_1,v1,m1,g1,O1,w1,E1,P1,S1,T1,f={},j1=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},C1=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},I1=(Object.defineProperty(f,"__esModule",{value:!0}),f.race=void 0,hd),R1=om;f.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R1.raceWith.apply(void 0,C1([],j1(I1.argsOrArgArray(e))))},t=P,Object.defineProperty(t,"__esModule",{value:!0}),t.mergeAll=t.merge=t.max=t.materialize=t.mapTo=t.map=t.last=t.isEmpty=t.ignoreElements=t.groupBy=t.first=t.findIndex=t.find=t.finalize=t.filter=t.expand=t.exhaustMap=t.exhaustAll=t.exhaust=t.every=t.endWith=t.elementAt=t.distinctUntilKeyChanged=t.distinctUntilChanged=t.distinct=t.dematerialize=t.delayWhen=t.delay=t.defaultIfEmpty=t.debounceTime=t.debounce=t.count=t.connect=t.concatWith=t.concatMapTo=t.concatMap=t.concatAll=t.concat=t.combineLatestWith=t.combineLatest=t.combineLatestAll=t.combineAll=t.catchError=t.bufferWhen=t.bufferToggle=t.bufferTime=t.bufferCount=t.buffer=t.auditTime=t.audit=void 0,t.timeInterval=t.throwIfEmpty=t.throttleTime=t.throttle=t.tap=t.takeWhile=t.takeUntil=t.takeLast=t.take=t.switchScan=t.switchMapTo=t.switchMap=t.switchAll=t.subscribeOn=t.startWith=t.skipWhile=t.skipUntil=t.skipLast=t.skip=t.single=t.shareReplay=t.share=t.sequenceEqual=t.scan=t.sampleTime=t.sample=t.refCount=t.retryWhen=t.retry=t.repeatWhen=t.repeat=t.reduce=t.raceWith=t.race=t.publishReplay=t.publishLast=t.publishBehavior=t.publish=t.pluck=t.partition=t.pairwise=t.onErrorResumeNext=t.observeOn=t.multicast=t.min=t.mergeWith=t.mergeScan=t.mergeMapTo=t.mergeMap=t.flatMap=void 0,t.zipWith=t.zipAll=t.zip=t.withLatestFrom=t.windowWhen=t.windowToggle=t.windowTime=t.windowCount=t.window=t.toArray=t.timestamp=t.timeoutWith=t.timeout=void 0,wP=eh,Object.defineProperty(t,"audit",{enumerable:!0,get:function(){return wP.audit}}),EP=oh,Object.defineProperty(t,"auditTime",{enumerable:!0,get:function(){return EP.auditTime}}),PP=sh,Object.defineProperty(t,"buffer",{enumerable:!0,get:function(){return PP.buffer}}),SP=dh,Object.defineProperty(t,"bufferCount",{enumerable:!0,get:function(){return SP.bufferCount}}),TP=vh,Object.defineProperty(t,"bufferTime",{enumerable:!0,get:function(){return TP.bufferTime}}),jP=jh,Object.defineProperty(t,"bufferToggle",{enumerable:!0,get:function(){return jP.bufferToggle}}),CP=xh,Object.defineProperty(t,"bufferWhen",{enumerable:!0,get:function(){return CP.bufferWhen}}),IP=Bh,Object.defineProperty(t,"catchError",{enumerable:!0,get:function(){return IP.catchError}}),RP=Vh,Object.defineProperty(t,"combineAll",{enumerable:!0,get:function(){return RP.combineAll}}),AP=Hh,Object.defineProperty(t,"combineLatestAll",{enumerable:!0,get:function(){return AP.combineLatestAll}}),kP=cb,Object.defineProperty(t,"combineLatest",{enumerable:!0,get:function(){return kP.combineLatest}}),MP=sb,Object.defineProperty(t,"combineLatestWith",{enumerable:!0,get:function(){return MP.combineLatestWith}}),NP=Cb,Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return NP.concat}}),xP=Jf,Object.defineProperty(t,"concatAll",{enumerable:!0,get:function(){return xP.concatAll}}),DP=bf,Object.defineProperty(t,"concatMap",{enumerable:!0,get:function(){return DP.concatMap}}),UP=Pb,Object.defineProperty(t,"concatMapTo",{enumerable:!0,get:function(){return UP.concatMapTo}}),LP=jb,Object.defineProperty(t,"concatWith",{enumerable:!0,get:function(){return LP.concatWith}}),FP=Lb,Object.defineProperty(t,"connect",{enumerable:!0,get:function(){return FP.connect}}),BP=Fb,Object.defineProperty(t,"count",{enumerable:!0,get:function(){return BP.count}}),WP=Yb,Object.defineProperty(t,"debounce",{enumerable:!0,get:function(){return WP.debounce}}),qP=Jb,Object.defineProperty(t,"debounceTime",{enumerable:!0,get:function(){return qP.debounceTime}}),zP=ry,Object.defineProperty(t,"defaultIfEmpty",{enumerable:!0,get:function(){return zP.defaultIfEmpty}}),VP=R,Object.defineProperty(t,"delay",{enumerable:!0,get:function(){return VP.delay}}),HP=iy,Object.defineProperty(t,"delayWhen",{enumerable:!0,get:function(){return HP.delayWhen}}),GP=Sy,Object.defineProperty(t,"dematerialize",{enumerable:!0,get:function(){return GP.dematerialize}}),YP=Iy,Object.defineProperty(t,"distinct",{enumerable:!0,get:function(){return YP.distinct}}),KP=Ny,Object.defineProperty(t,"distinctUntilChanged",{enumerable:!0,get:function(){return KP.distinctUntilChanged}}),ZP=Fy,Object.defineProperty(t,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return ZP.distinctUntilKeyChanged}}),XP=Wy,Object.defineProperty(t,"elementAt",{enumerable:!0,get:function(){return XP.elementAt}}),QP=Jy,Object.defineProperty(t,"endWith",{enumerable:!0,get:function(){return QP.endWith}}),JP=n_,Object.defineProperty(t,"every",{enumerable:!0,get:function(){return JP.every}}),$P=u_,Object.defineProperty(t,"exhaust",{enumerable:!0,get:function(){return $P.exhaust}}),eS=a_,Object.defineProperty(t,"exhaustAll",{enumerable:!0,get:function(){return eS.exhaustAll}}),tS=s_,Object.defineProperty(t,"exhaustMap",{enumerable:!0,get:function(){return tS.exhaustMap}}),rS=b_,Object.defineProperty(t,"expand",{enumerable:!0,get:function(){return rS.expand}}),nS=Sd,Object.defineProperty(t,"filter",{enumerable:!0,get:function(){return nS.filter}}),oS=v_,Object.defineProperty(t,"finalize",{enumerable:!0,get:function(){return oS.finalize}}),iS=g_,Object.defineProperty(t,"find",{enumerable:!0,get:function(){return iS.find}}),uS=P_,Object.defineProperty(t,"findIndex",{enumerable:!0,get:function(){return uS.findIndex}}),aS=j_,Object.defineProperty(t,"first",{enumerable:!0,get:function(){return aS.first}}),sS=N_,Object.defineProperty(t,"groupBy",{enumerable:!0,get:function(){return sS.groupBy}}),cS=ly,Object.defineProperty(t,"ignoreElements",{enumerable:!0,get:function(){return cS.ignoreElements}}),lS=B_,Object.defineProperty(t,"isEmpty",{enumerable:!0,get:function(){return lS.isEmpty}}),fS=z_,Object.defineProperty(t,"last",{enumerable:!0,get:function(){return fS.last}}),pS=yf,Object.defineProperty(t,"map",{enumerable:!0,get:function(){return pS.map}}),dS=hy,Object.defineProperty(t,"mapTo",{enumerable:!0,get:function(){return dS.mapTo}}),hS=tv,Object.defineProperty(t,"materialize",{enumerable:!0,get:function(){return hS.materialize}}),bS=iv,Object.defineProperty(t,"max",{enumerable:!0,get:function(){return bS.max}}),yS=bv,Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return yS.merge}}),_S=$f,Object.defineProperty(t,"mergeAll",{enumerable:!0,get:function(){return _S.mergeAll}}),vS=sv,Object.defineProperty(t,"flatMap",{enumerable:!0,get:function(){return vS.flatMap}}),mS=ep,Object.defineProperty(t,"mergeMap",{enumerable:!0,get:function(){return mS.mergeMap}}),gS=cv,Object.defineProperty(t,"mergeMapTo",{enumerable:!0,get:function(){return gS.mergeMapTo}}),OS=pv,Object.defineProperty(t,"mergeScan",{enumerable:!0,get:function(){return OS.mergeScan}}),wS=tp,Object.defineProperty(t,"mergeWith",{enumerable:!0,get:function(){return wS.mergeWith}}),ES=Tv,Object.defineProperty(t,"min",{enumerable:!0,get:function(){return ES.min}}),PS=Iv,Object.defineProperty(t,"multicast",{enumerable:!0,get:function(){return PS.multicast}}),SS=p,Object.defineProperty(t,"observeOn",{enumerable:!0,get:function(){return SS.observeOn}}),TS=Mv,Object.defineProperty(t,"onErrorResumeNext",{enumerable:!0,get:function(){return TS.onErrorResumeNext}}),jS=Fv,Object.defineProperty(t,"pairwise",{enumerable:!0,get:function(){return jS.pairwise}}),CS=S,Object.defineProperty(t,"partition",{enumerable:!0,get:function(){return CS.partition}}),IS=qv,Object.defineProperty(t,"pluck",{enumerable:!0,get:function(){return IS.pluck}}),RS=Vv,Object.defineProperty(t,"publish",{enumerable:!0,get:function(){return RS.publish}}),AS=Kv,Object.defineProperty(t,"publishBehavior",{enumerable:!0,get:function(){return AS.publishBehavior}}),kS=Qv,Object.defineProperty(t,"publishLast",{enumerable:!0,get:function(){return kS.publishLast}}),MS=em,Object.defineProperty(t,"publishReplay",{enumerable:!0,get:function(){return MS.publishReplay}}),NS=f,Object.defineProperty(t,"race",{enumerable:!0,get:function(){return NS.race}}),xS=om,Object.defineProperty(t,"raceWith",{enumerable:!0,get:function(){return xS.raceWith}}),DS=Yh,Object.defineProperty(t,"reduce",{enumerable:!0,get:function(){return DS.reduce}}),US=lm,Object.defineProperty(t,"repeat",{enumerable:!0,get:function(){return US.repeat}}),LS=ym,Object.defineProperty(t,"repeatWhen",{enumerable:!0,get:function(){return LS.repeatWhen}}),FS=Om,Object.defineProperty(t,"retry",{enumerable:!0,get:function(){return FS.retry}}),BS=jm,Object.defineProperty(t,"retryWhen",{enumerable:!0,get:function(){return BS.retryWhen}}),WS=O,Object.defineProperty(t,"refCount",{enumerable:!0,get:function(){return WS.refCount}}),qS=km,Object.defineProperty(t,"sample",{enumerable:!0,get:function(){return qS.sample}}),zS=Um,Object.defineProperty(t,"sampleTime",{enumerable:!0,get:function(){return zS.sampleTime}}),VS=Wm,Object.defineProperty(t,"scan",{enumerable:!0,get:function(){return VS.scan}}),HS=Kh,Object.defineProperty(t,"sequenceEqual",{enumerable:!0,get:function(){return HS.sequenceEqual}}),GS=Km,Object.defineProperty(t,"share",{enumerable:!0,get:function(){return GS.share}}),YS=r0,Object.defineProperty(t,"shareReplay",{enumerable:!0,get:function(){return YS.shareReplay}}),KS=i0,Object.defineProperty(t,"single",{enumerable:!0,get:function(){return KS.single}}),ZS=f0,Object.defineProperty(t,"skip",{enumerable:!0,get:function(){return ZS.skip}}),XS=d0,Object.defineProperty(t,"skipLast",{enumerable:!0,get:function(){return XS.skipLast}}),QS=_0,Object.defineProperty(t,"skipUntil",{enumerable:!0,get:function(){return QS.skipUntil}}),JS=w0,Object.defineProperty(t,"skipWhile",{enumerable:!0,get:function(){return JS.skipWhile}}),$S=S0,Object.defineProperty(t,"startWith",{enumerable:!0,get:function(){return $S.startWith}}),e1=cl,Object.defineProperty(t,"subscribeOn",{enumerable:!0,get:function(){return e1.subscribeOn}}),t1=I0,Object.defineProperty(t,"switchAll",{enumerable:!0,get:function(){return t1.switchAll}}),r1=R0,Object.defineProperty(t,"switchMap",{enumerable:!0,get:function(){return r1.switchMap}}),n1=D0,Object.defineProperty(t,"switchMapTo",{enumerable:!0,get:function(){return n1.switchMapTo}}),o1=F0,Object.defineProperty(t,"switchScan",{enumerable:!0,get:function(){return o1.switchScan}}),i1=uy,Object.defineProperty(t,"take",{enumerable:!0,get:function(){return i1.take}}),u1=V_,Object.defineProperty(t,"takeLast",{enumerable:!0,get:function(){return u1.takeLast}}),a1=q0,Object.defineProperty(t,"takeUntil",{enumerable:!0,get:function(){return a1.takeUntil}}),s1=Y0,Object.defineProperty(t,"takeWhile",{enumerable:!0,get:function(){return s1.takeWhile}}),c1=X0,Object.defineProperty(t,"tap",{enumerable:!0,get:function(){return c1.tap}}),l1=b,Object.defineProperty(t,"throttle",{enumerable:!0,get:function(){return l1.throttle}}),f1=og,Object.defineProperty(t,"throttleTime",{enumerable:!0,get:function(){return f1.throttleTime}}),p1=qy,Object.defineProperty(t,"throwIfEmpty",{enumerable:!0,get:function(){return p1.throwIfEmpty}}),d1=sg,Object.defineProperty(t,"timeInterval",{enumerable:!0,get:function(){return d1.timeInterval}}),h1=Mc,Object.defineProperty(t,"timeout",{enumerable:!0,get:function(){return h1.timeout}}),b1=dg,Object.defineProperty(t,"timeoutWith",{enumerable:!0,get:function(){return b1.timeoutWith}}),y1=vl,Object.defineProperty(t,"timestamp",{enumerable:!0,get:function(){return y1.timestamp}}),_1=Gh,Object.defineProperty(t,"toArray",{enumerable:!0,get:function(){return _1.toArray}}),v1=n,Object.defineProperty(t,"window",{enumerable:!0,get:function(){return v1.window}}),m1=Pg,Object.defineProperty(t,"windowCount",{enumerable:!0,get:function(){return m1.windowCount}}),g1=Ig,Object.defineProperty(t,"windowTime",{enumerable:!0,get:function(){return g1.windowTime}}),O1=il,Object.defineProperty(t,"windowToggle",{enumerable:!0,get:function(){return O1.windowToggle}}),w1=X,Object.defineProperty(t,"windowWhen",{enumerable:!0,get:function(){return w1.windowWhen}}),E1=Xg,Object.defineProperty(t,"withLatestFrom",{enumerable:!0,get:function(){return E1.withLatestFrom}}),P1=m,Object.defineProperty(t,"zip",{enumerable:!0,get:function(){return P1.zip}}),S1=_,Object.defineProperty(t,"zipAll",{enumerable:!0,get:function(){return S1.zipAll}}),T1=C,Object.defineProperty(t,"zipWith",{enumerable:!0,get:function(){return T1.zipWith}});var s={},A1=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())})},k1=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}}}},M1=(Object.defineProperty(s,"__esModule",{value:!0}),e),N1=qr,x1=P,D1=0,U1=1,L1=2;function F1(e,t){e=e.pipe((0,x1.publishReplay)(1),(0,x1.refCount)());this._result=e,this._keys=e.pipe((0,x1.mergeMap)(function(e){return(0,N1.from)(e.keys())}),(0,x1.publishReplay)(1),(0,x1.refCount)()),this._records=void 0,this._controls=new B1,this._summary=new N1.ReplaySubject,this._state=t||D1}F1.prototype.keys=function(){return this._keys},F1.prototype.records=function(){var r=this,e=this._result.pipe((0,x1.mergeMap)(function(t){return new N1.Observable(function(e){return r._startStreaming({result:t,recordsObserver:e})})}));return e.push=function(){return r._push()},e},F1.prototype.consume=function(){var r=this;return this._result.pipe((0,x1.mergeMap)(function(t){return new N1.Observable(function(e){return r._startStreaming({result:t,summaryObserver:e})})}))},F1.prototype.pause=function(){this._controls.pause()},F1.prototype.resume=function(){return this._controls.resume()},F1.prototype.push=function(){return this._controls.push()},F1.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<U1?(this._state=U1,this._setupRecordsStream(t),r?n.push(this._records.subscribe(r)):t._cancel(),n.push({unsubscribe:function(){t._cancel&&t._cancel()}})):r&&r.error((0,M1.newError)("Streaming has already started/consumed with a previous records or summary subscription.")),function(){n.forEach(function(e){return e.unsubscribe()})}},F1.prototype._toObservable=function(){var n=this;return new N1.Observable(function(r){n._result.subscribe({complete:function(){return r.complete()},next:function(e){return r.next(new F1((t=e,new N1.Observable(function(e){e.next(t),e.complete()}))),n._state);var t},error:function(e){return r.error(e)}})})},F1.prototype._setupRecordsStream=function(n){var t=this;return this._records||(this._records=function(o,i,u){var e=this;void 0===u&&(u=new B1);var a=new N1.Subject,s=function(n){return A1(e,void 0,void 0,function(){var t,r;return k1(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 A1(this,void 0,void 0,function(){return k1(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 A1(t,void 0,void 0,function(){var t,r;return k1(this,function(e){switch(e.label){case 0:return this._state=L1,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=L1,t._summary.error(e)}},this._controls),this._records)},s.default=F1;W1.prototype.pause=function(){this._paused=!0},Object.defineProperty(W1.prototype,"paused",{get:function(){return this._paused},enumerable:!1,configurable:!0}),Object.defineProperty(W1.prototype,"pushing",{get:function(){return this._pushing},set:function(e){this._pushing=e},enumerable:!1,configurable:!0}),W1.prototype.resume=function(){return A1(this,void 0,void 0,function(){var t;return k1(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]}})})},W1.prototype.push=function(){return A1(this,void 0,void 0,function(){return k1(this,function(e){switch(e.label){case 0:return this.pause(),[4,this._push()];case 1:return[2,e.sent()]}})})},Object.defineProperty(W1.prototype,"pusher",{get:function(){return this._push},set:function(e){this._push=e},enumerable:!1,configurable:!0});var B1=W1;function W1(e){void 0===e&&(e=function(){return A1(t,void 0,void 0,function(){return k1(this,function(e){return[2]})})});var t=this;this._paused=!1,this._pushing=!1,this._push=e}var u={},Dr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},q1=(Object.defineProperty(u,"__esModule",{value:!0}),qr),z1=Dr(s);function V1(e){this._txc=e}Dr(e),V1.prototype.run=function(e,r){var n=this;return new z1.default(new q1.Observable(function(t){try{t.next(n._txc.run(e,r)),t.complete()}catch(e){t.error(e)}return function(){}}))},V1.prototype.commit=function(){var e=this;return new q1.Observable(function(t){e._txc.commit().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},V1.prototype.rollback=function(){var e=this;return new q1.Observable(function(t){e._txc.rollback().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},V1.prototype.isOpen=function(){return this._txc.isOpen()},V1.prototype.close=function(){var e=this;return new q1.Observable(function(t){e._txc.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},u.default=V1;g={},o=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};function H1(e){e=e.run;this._run=e}Object.defineProperty(g,"__esModule",{value:!0}),o(s),o(u),H1.fromTransaction=function(e){return new H1({run:e.run.bind(e)})},H1.prototype.run=function(e,t){return this._run(e,t)},g.default=H1;var us={},G1=(Object.defineProperty(us,"__esModule",{value:!0}),e),Y1=qr,K1=P,Z1=(G1.internal.logger.Logger,G1.error.SERVICE_UNAVAILABLE);function X1(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=Q1(void 0===t?3e4:t,3e4),this._initialDelay=Q1(r,1e3),this._delayMultiplier=Q1(n,2),this._delayJitter=Q1(o,.2),this._logger=e}function Q1(e,t){return e||0===e?e:t}X1.prototype.retry=function(e){var a=this;return e.pipe((0,K1.retryWhen)(function(e){var n=[],o=Date.now(),i=1,u=a._initialDelay;return e.pipe((0,K1.mergeMap)(function(e){if(!(0,G1.isRetriableError)(e))return(0,Y1.throwError)(function(){return e});var t;if(n.push(e),2<=i&&Date.now()-o>=a._maxRetryTimeout)return(t=(0,G1.newError)("Failed after retried for ".concat(i," times in ").concat(a._maxRetryTimeout," ms. Make sure that your database is online and retry again."),Z1)).seenErrors=n,(0,Y1.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,Y1.of)(1).pipe((0,K1.delay)(r))}))}))},X1.prototype._computeNextDelay=function(e){var t=e*this._delayJitter;return e-t+2*t*Math.random()},us.default=X1;var ks=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},J1=(Object.defineProperty(Tr,"__esModule",{value:!0}),qr),$1=P,eT=ks(s),qs=e,tT=ks(u),rT=ks(g),nT=ks(us),Gs=qs.internal.constants,oT=Gs.ACCESS_MODE_READ,iT=Gs.ACCESS_MODE_WRITE,uT=Gs.TELEMETRY_APIS,aT=qs.internal.txConfig.TxConfig;function sT(e){var e=void 0===e?{}:e,t=e.session,r=e.config,e=e.log;this._session=t,this._retryLogic=function(e){e=e&&e.maxTransactionRetryTime?e.maxTransactionRetryTime:null;return new nT.default({maxRetryTimeout:e})}(r),this._log=e}sT.prototype.run=function(e,r,n){var o=this;return new eT.default(new J1.Observable(function(t){try{t.next(o._session.run(e,r,n)),t.complete()}catch(e){t.error(e)}return function(){}}))},sT.prototype.beginTransaction=function(e){return this._beginTransaction(this._session._mode,e,{api:uT.UNMANAGED_TRANSACTION})},sT.prototype.readTransaction=function(e,t){return this._runTransaction(oT,e,t)},sT.prototype.writeTransaction=function(e,t){return this._runTransaction(iT,e,t)},sT.prototype.executeRead=function(e,t){return this._executeInTransaction(oT,e,t)},sT.prototype.executeWrite=function(e,t){return this._executeInTransaction(iT,e,t)},sT.prototype._executeInTransaction=function(e,t,r){return this._runTransaction(e,t,r,function(e){return new rT.default({run:e.run.bind(e)})})},sT.prototype.close=function(){var e=this;return new J1.Observable(function(t){e._session.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},sT.prototype[Symbol.asyncDispose]=function(){return this.close()},sT.prototype.lastBookmark=function(){return this.lastBookmarks()},sT.prototype.lastBookmarks=function(){return this._session.lastBookmarks()},sT.prototype._beginTransaction=function(e,t,r){var n=this,o=aT.empty();return t&&(o=new aT(t,this._log)),new J1.Observable(function(t){try{n._session._beginTransaction(e,o,r).then(function(e){t.next(new tT.default(e)),t.complete()}).catch(function(e){return t.error(e)})}catch(e){t.error(e)}return function(){}})},sT.prototype._runTransaction=function(e,r,t,n){var o=this,i=(void 0===n&&(n=function(e){return e}),aT.empty()),u=(t&&(i=new aT(t)),{apiTelemetryConfig:{api:uT.MANAGED_TRANSACTION,onTelemetrySuccess:function(){u.apiTelemetryConfig=void 0}}});return this._retryLogic.retry((0,J1.of)(1).pipe((0,$1.mergeMap)(function(){return o._beginTransaction(e,i,u.apiTelemetryConfig)}),(0,$1.mergeMap)(function(t){return(0,J1.defer)(function(){try{return r(n(t))}catch(e){return(0,J1.throwError)(function(){return e})}}).pipe((0,$1.catchError)(function(e){return t.rollback().pipe((0,$1.concatWith)((0,J1.throwError)(function(){return e})))}),(0,$1.concatWith)(t.commit()))})))},Tr.default=sT;var cT,lT,hs=r&&r.__extends||(cT=function(e,t){return(cT=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}cT(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}},Q=(Object.defineProperty(B,"__esModule",{value:!0}),B.WRITE=B.READ=B.Driver=void 0,e),fT=h(Tr),pT=Q.internal.constants.FETCH_ALL,as=Q.driver.READ,dT=Q.driver.WRITE,T=(B.READ=as,B.WRITE=dT,hs(hT,lT=Q.Driver),hT.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,u=e.bookmarkManager,a=e.notificationFilter,e=e.auth;return new fT.default({session:this._newSession({defaultAccessMode:void 0===t?dT:t,bookmarkOrBookmarks:r,database:void 0===n?"":n,impersonatedUser:i,auth:e,reactive:!1,fetchSize:function(e,t){e=parseInt(e,10);{if(0<e||e===pT)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(pT," for ALL. However fetchSize = ").concat(e));return t}}(o,this._config.fetchSize),bookmarkManager:u,notificationFilter:a,log:this._log}),config:this._config,log:this._log})},hT);function hT(){return null!==lT&&lT.apply(this,arguments)||this}B.Driver=T,B.default=T;v={},Object.defineProperty(v,"__esModule",{value:!0}),v.default="5.24.1",i={},Ic={},wc={};function bT(){}Object.defineProperty(wc,"__esModule",{value:!0}),bT.prototype.selectReader=function(e){throw new Error("Abstract function")},bT.prototype.selectWriter=function(e){throw new Error("Abstract function")},wc.default=bT;Sc={},jc={};function yT(e){this._offset=e||0}Object.defineProperty(jc,"__esModule",{value:!0}),yT.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},jc.default=yT;var _T,vT,gc=r&&r.__extends||(_T=function(e,t){return(_T=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}_T(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),jl=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},mT=(Object.defineProperty(Sc,"__esModule",{value:!0}),jl(jc)),Qe=jl(wc),hl=(vT=Qe.default,gc(gT,vT),gT.prototype.selectReader=function(e){return this._select(e,this._readersIndex)},gT.prototype.selectWriter=function(e){return this._select(e,this._writersIndex)},gT.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},gT);function gT(e){var t=vT.call(this)||this;return t._readersIndex=new mT.default,t._writersIndex=new mT.default,t._connectionPool=e,t}Sc.default=hl;Ar=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.LeastConnectedLoadBalancingStrategy=Ic.LoadBalancingStrategy=void 0,Cc=Ar(wc),Ic.LoadBalancingStrategy=Cc.default,kf=Ar(Sc),Ic.LeastConnectedLoadBalancingStrategy=kf.default,Ic.default=kf.default,w={},Qf={},yp={},_p={},Pp={},yc={},Nf={},Ff={byteLength:function(e){var e=jT(e),t=e[0],e=e[1];return 3*(t+e)/4-e}};Ff.toByteArray=function(e){var t,r,n=jT(e),o=n[0],n=n[1],i=new ET(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=wT[e.charCodeAt(r)]<<18|wT[e.charCodeAt(r+1)]<<12|wT[e.charCodeAt(r+2)]<<6|wT[e.charCodeAt(r+3)],i[u++]=t>>16&255,i[u++]=t>>8&255,i[u++]=255&t;2===n&&(t=wT[e.charCodeAt(r)]<<2|wT[e.charCodeAt(r+1)]>>4,i[u++]=255&t);1===n&&(t=wT[e.charCodeAt(r)]<<10|wT[e.charCodeAt(r+1)]<<4|wT[e.charCodeAt(r+2)]>>2,i[u++]=t>>8&255,i[u++]=255&t);return i},Ff.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 OT[e>>18&63]+OT[e>>12&63]+OT[e>>6&63]+OT[63&e]}(n));return o.join("")}(e,i,u<i+16383?u:i+16383));1==n?(t=e[r-1],o.push(OT[t>>2]+OT[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],o.push(OT[t>>10]+OT[t>>4&63]+OT[t<<2&63]+"="));return o.join("")};for(var OT=[],wT=[],ET="undefined"!=typeof Uint8Array?Uint8Array:Array,PT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ST=0,TT=PT.length;ST<TT;++ST)OT[ST]=PT[ST],wT[PT.charCodeAt(ST)]=ST;function jT(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]}wT["-".charCodeAt(0)]=62,wT["_".charCodeAt(0)]=63;mc={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 CT=Nf;const jx=Ff,Cx=mc,Ix=(gl="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,CT.Buffer=A,CT.SlowBuffer=function(e){+e!=e&&(e=0);return A.alloc(+e)},CT.INSPECT_MAX_BYTES=50,2147483647);function IT(e){if(e>Ix)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 RT(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return kT(e)}function RT(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|DT(n,o);let e=IT(i);n=e.write(n,o);n!==i&&(e=e.slice(0,n));return e}if(ArrayBuffer.isView(t))return ij(o=t,Uint8Array)?NT((i=new Uint8Array(o)).buffer,i.byteOffset,i.byteLength):MT(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(ij(t,ArrayBuffer)||t&&ij(t.buffer,ArrayBuffer))return NT(t,r,e);if("undefined"!=typeof SharedArrayBuffer&&(ij(t,SharedArrayBuffer)||t&&ij(t.buffer,SharedArrayBuffer)))return NT(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|xT(e.length),0===(r=IT(t)).length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||uj(e.length)?IT(0):MT(e);if("Buffer"===e.type&&Array.isArray(e.data))return MT(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 AT(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 kT(e){return AT(e),IT(e<0?0:0|xT(e))}function MT(t){var r=t.length<0?0:0|xT(t.length);const n=IT(r);for(let e=0;e<r;e+=1)n[e]=255&t[e];return n}function NT(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 xT(e){if(e>=Ix)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ix.toString(16)+" bytes");return 0|e}function DT(e,t){if(A.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ij(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 rj(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return nj(e).length;default:if(o)return n?-1:rj(e).length;t=(""+t).toLowerCase(),o=!0}}function UT(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+=Mx[o[e]];return t;return}case"utf8":case"utf-8":return zT(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?jx.fromByteArray(d):jx.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 LT(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function FT(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=uj(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:BT(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):BT(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function BT(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 WT(e,t,r,n){return oj(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 qT(e,t,r,n){return oj(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 zT(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<=Rx)return String.fromCharCode.apply(String,n);let e="",t=0;for(;t<o;)e+=String.fromCharCode.apply(String,n.slice(t,t+=Rx));return e}}CT.kMaxLength=Ix,(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=RT,Object.setPrototypeOf(A.prototype,Uint8Array.prototype),Object.setPrototypeOf(A,Uint8Array),A.alloc=function(e,t,r){return t=t,r=r,AT(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?IT(e).fill(t,r):IT(e).fill(t):IT(e)},A.allocUnsafe=kT,A.allocUnsafeSlow=kT,A.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==A.prototype},A.compare=function(r,n){if(ij(r,Uint8Array)&&(r=A.from(r,r.offset,r.byteLength)),ij(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(ij(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=DT,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)LT(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)LT(this,e,e+3),LT(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)LT(this,e,e+7),LT(this,e+1,e+6),LT(this,e+2,e+5),LT(this,e+3,e+4);return this},A.prototype.toLocaleString=A.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?zT(this,0,e):UT.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=CT.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},gl&&(A.prototype[gl]=A.prototype.inspect),A.prototype.compare=function(e,t,r,n,o){if(ij(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 FT(this,e,t,r,!0)},A.prototype.lastIndexOf=function(e,t,r){return FT(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(uj(h))return e;c[f+e]=h}return e;return}case"utf8":case"utf-8":return d=r,u=n,oj(rj(t,(i=this).length-d),i,d,u);case"ascii":case"latin1":case"binary":return WT(this,t,r,n);case"base64":return i=this,u=r,o=n,oj(nj(t),i,u,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qT(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 Rx=4096;function VT(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 HT(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 GT(e,t,r,n,o){$T(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 YT(e,t,r,n,o){$T(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 KT(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 ZT(e,t,r,n,o){return t=+t,r>>>=0,o||KT(e,0,r,4),Cx.write(e,t,r,n,23,4),r+4}function XT(e,t,r,n,o){return t=+t,r>>>=0,o||KT(e,0,r,8),Cx.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||VT(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||VT(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||VT(e,1,this.length),this[e]},A.prototype.readUint16LE=A.prototype.readUInt16LE=function(e,t){return e>>>=0,t||VT(e,2,this.length),this[e]|this[e+1]<<8},A.prototype.readUint16BE=A.prototype.readUInt16BE=function(e,t){return e>>>=0,t||VT(e,2,this.length),this[e]<<8|this[e+1]},A.prototype.readUint32LE=A.prototype.readUInt32LE=function(e,t){return e>>>=0,t||VT(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||VT(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},A.prototype.readBigUInt64LE=aj(function(e){ej(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||tj(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=aj(function(e){ej(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||tj(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||VT(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||VT(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||VT(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},A.prototype.readInt16LE=function(e,t){e>>>=0,t||VT(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||VT(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||VT(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||VT(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},A.prototype.readBigInt64LE=aj(function(e){ej(e>>>=0,"offset");var t=this[e],r=this[e+7],r=(void 0!==t&&void 0!==r||tj(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=aj(function(e){ej(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||tj(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||VT(e,4,this.length),Cx.read(this,e,!0,23,4)},A.prototype.readFloatBE=function(e,t){return e>>>=0,t||VT(e,4,this.length),Cx.read(this,e,!1,23,4)},A.prototype.readDoubleLE=function(e,t){return e>>>=0,t||VT(e,8,this.length),Cx.read(this,e,!0,52,8)},A.prototype.readDoubleBE=function(e,t){return e>>>=0,t||VT(e,8,this.length),Cx.read(this,e,!1,52,8)},A.prototype.writeUintLE=A.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||HT(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||HT(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||HT(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||HT(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||HT(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||HT(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||HT(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=aj(function(e,t=0){return GT(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),A.prototype.writeBigUInt64BE=aj(function(e,t=0){return YT(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),A.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||HT(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||HT(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||HT(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||HT(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||HT(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||HT(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||HT(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=aj(function(e,t=0){return GT(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),A.prototype.writeBigInt64BE=aj(function(e,t=0){return YT(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),A.prototype.writeFloatLE=function(e,t,r){return ZT(this,e,t,!0,r)},A.prototype.writeFloatBE=function(e,t,r){return ZT(this,e,t,!1,r)},A.prototype.writeDoubleLE=function(e,t,r){return XT(this,e,t,!0,r)},A.prototype.writeDoubleBE=function(e,t,r){return XT(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 Ax={};function QT(e,t,r){Ax[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 JT(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 $T(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 Ax.ERR_OUT_OF_RANGE("value",e,t)}r=e,n=i,ej(u=o,"offset"),void 0!==r[u]&&void 0!==r[u+n]||tj(u,r.length-(n+1))}function ej(e,t){if("number"!=typeof e)throw new Ax.ERR_INVALID_ARG_TYPE(t,"number",e)}function tj(e,t,r){if(Math.floor(e)!==e)throw ej(e,r),new Ax.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new Ax.ERR_BUFFER_OUT_OF_BOUNDS;throw new Ax.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= `+t,e)}QT("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"},RangeError),QT("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type `+typeof t},TypeError),QT("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=JT(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=JT(n)),n+="n"),e+=` It must be ${t}. Received `+n},RangeError);const kx=/[^+/0-9A-Za-z-_]/g;function rj(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 nj(e){return jx.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(kx,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function oj(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 ij(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function uj(e){return e!=e}const Mx=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 aj(e){return"undefined"==typeof BigInt?sj:e}function sj(){throw new Error("BigInt not supported")}}var cj,Jp={},fc={},l=r&&r.__extends||(cj=function(e,t){return(cj=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}cj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),dd=(Object.defineProperty(fc,"__esModule",{value:!0}),k.prototype.getUInt8=function(e){throw new Error("Not implemented")},k.prototype.getInt8=function(e){throw new Error("Not implemented")},k.prototype.getFloat64=function(e){throw new Error("Not implemented")},k.prototype.putUInt8=function(e,t){throw new Error("Not implemented")},k.prototype.putInt8=function(e,t){throw new Error("Not implemented")},k.prototype.putFloat64=function(e,t){throw new Error("Not implemented")},k.prototype.getInt16=function(e){return this.getInt8(e)<<8|this.getUInt8(e+1)},k.prototype.getUInt16=function(e){return this.getUInt8(e)<<8|this.getUInt8(e+1)},k.prototype.getInt32=function(e){return this.getInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},k.prototype.getUInt32=function(e){return this.getUInt8(e)<<24|this.getUInt8(e+1)<<16|this.getUInt8(e+2)<<8|this.getUInt8(e+3)},k.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)},k.prototype.getSlice=function(e,t){return new fj(e,t,this)},k.prototype.putInt16=function(e,t){this.putInt8(e,t>>8),this.putUInt8(e+1,255&t)},k.prototype.putUInt16=function(e,t){this.putUInt8(e,t>>8&255),this.putUInt8(e+1,255&t)},k.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)},k.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)},k.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)},k.prototype.putBytes=function(e,t){for(var r=0,n=t.remaining();r<n;r++)this.putUInt8(e+r,t.readUInt8())},k.prototype.readUInt8=function(){return this.getUInt8(this._updatePos(1))},k.prototype.readInt8=function(){return this.getInt8(this._updatePos(1))},k.prototype.readUInt16=function(){return this.getUInt16(this._updatePos(2))},k.prototype.readUInt32=function(){return this.getUInt32(this._updatePos(4))},k.prototype.readInt16=function(){return this.getInt16(this._updatePos(2))},k.prototype.readInt32=function(){return this.getInt32(this._updatePos(4))},k.prototype.readInt64=function(){return this.getInt32(this._updatePos(8))},k.prototype.readFloat64=function(){return this.getFloat64(this._updatePos(8))},k.prototype.writeUInt8=function(e){this.putUInt8(this._updatePos(1),e)},k.prototype.writeInt8=function(e){this.putInt8(this._updatePos(1),e)},k.prototype.writeInt16=function(e){this.putInt16(this._updatePos(2),e)},k.prototype.writeInt32=function(e){this.putInt32(this._updatePos(4),e)},k.prototype.writeUInt32=function(e){this.putUInt32(this._updatePos(4),e)},k.prototype.writeInt64=function(e){this.putInt64(this._updatePos(8),e)},k.prototype.writeFloat64=function(e){this.putFloat64(this._updatePos(8),e)},k.prototype.writeBytes=function(e){this.putBytes(this._updatePos(e.remaining()),e)},k.prototype.readSlice=function(e){return this.getSlice(this._updatePos(e),e)},k.prototype._updatePos=function(e){var t=this.position;return this.position+=e,t},k.prototype.remaining=function(){return this.length-this.position},k.prototype.hasRemaining=function(){return 0<this.remaining()},k.prototype.reset=function(){this.position=0},k.prototype.toString=function(){return this.constructor.name+"( position="+this.position+" )\n "+this.toHex()},k.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},k);function k(e){this.position=0,this.length=e}fc.default=dd;l(pj,lj=dd),pj.prototype.putUInt8=function(e,t){this._inner.putUInt8(this._start+e,t)},pj.prototype.getUInt8=function(e){return this._inner.getUInt8(this._start+e)},pj.prototype.putInt8=function(e,t){this._inner.putInt8(this._start+e,t)},pj.prototype.putFloat64=function(e,t){this._inner.putFloat64(this._start+e,t)},pj.prototype.getInt8=function(e){return this._inner.getInt8(this._start+e)},pj.prototype.getFloat64=function(e){return this._inner.getFloat64(this._start+e)};var lj,fj=pj;function pj(e,t,r){t=lj.call(this,t)||this;return t._start=e,t._inner=r,t}var dj,hj,Od=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ed=(Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.BaseBuffer=void 0,Od(fc)),Ad=(Jp.BaseBuffer=Ed.default,Jp.default=Ed.default,r&&r.__extends||(dj=function(e,t){return(dj=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}dj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Ud=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bj=(Object.defineProperty(yc,"__esModule",{value:!0}),yc.alloc=void 0,Ud(Nf)),vc=Ud(Jp),yj=(hj=vc.default,Ad(_j,hj),_j.prototype.getUInt8=function(e){return this._buffer.readUInt8(e)},_j.prototype.getInt8=function(e){return this._buffer.readInt8(e)},_j.prototype.getFloat64=function(e){return this._buffer.readDoubleBE(e)},_j.prototype.putUInt8=function(e,t){this._buffer.writeUInt8(t,e)},_j.prototype.putInt8=function(e,t){this._buffer.writeInt8(t,e)},_j.prototype.putFloat64=function(e,t){this._buffer.writeDoubleBE(t,e)},_j.prototype.putBytes=function(e,t){var r;t instanceof _j?(r=Math.min(t.length-t.position,this.length-e),t._buffer.copy(this._buffer,e,t.position,t.position+r),t.position+=r):hj.prototype.putBytes.call(this,e,t)},_j.prototype.getSlice=function(e,t){return new _j(this._buffer.slice(e,e+t))},_j);function _j(e){var t=this,e=(e=e)instanceof bj.default.Buffer?e:"number"==typeof e&&"function"==typeof bj.default.Buffer.alloc?bj.default.Buffer.alloc(e):new bj.default.Buffer(e);return(t=hj.call(this,e.length)||this)._buffer=e,t}yc.default=yj,yc.alloc=function(e){return new yj(e)};var $p=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vj=(Object.defineProperty(Pp,"__esModule",{value:!0}),$p(yc)),mj=e,Bd=mj.internal.util,gj=Bd.ENCRYPTION_OFF,Oj=Bd.ENCRYPTION_ON;function wj(e,t,r){void 0===t&&(t=Ej),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,this._closingPromise=null,function(e,t){var r=function(e){return!0===e.encrypted||e.encrypted===Oj}(e),n=function(e){return!1===e.encrypted||e.encrypted===gj}(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,mj.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:"'+gj+'"` 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 vj.default(e.data),n.onmessage(e))},this._ws.onerror=this._handleConnectionError,this._connectionTimeoutFired=!1,this._connectionTimeoutId=this._setupConnectionTimeout())}function Ej(){return"undefined"!=typeof window&&window.location?window.location.protocol:null}wj.prototype._handleConnectionError=function(){if(this._connectionTimeoutFired)return this._error=(0,mj.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,mj.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))},wj.prototype.write=function(e){if(null!==this._pending)this._pending.push(e);else{if(!(e instanceof vj.default))throw(0,mj.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()}}},wj.prototype.close=function(){var r=this;return null===this._closingPromise&&(this._closingPromise=new Promise(function(e,t){r._clearConnectionTimeout(),r._ws&&3!==r._ws.readyState?(r._open=!1,r.stopReceiveTimeout(),r._ws.onclose=function(){e()},r._ws.close()):e()})),this._closingPromise},wj.prototype.setupReceiveTimeout=function(e){this._receiveTimeout=e},wj.prototype.stopReceiveTimeout=function(){null!==this._receiveTimeout&&this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!1,null!=this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=null)},wj.prototype.startReceiveTimeout=function(){this._open&&null!==this._receiveTimeout&&!this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!0,this._resetTimeout())},wj.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,mj.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))},wj.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},wj.prototype._clearConnectionTimeout=function(){var e=this._connectionTimeoutId;!e&&0!==e||(this._connectionTimeoutFired=!1,this._connectionTimeoutId=null,clearTimeout(e))},Pp.default=wj;var Pj,Vd={},_c=r&&r.__extends||(Pj=function(e,t){return(Pj=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}Pj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Vd,"__esModule",{value:!0});var Sj,y=e.internal.resolver.BaseHostNameResolver,pd=(_c(Tj,Sj=y),Tj.prototype.resolve=function(e){return this._resolveToItself(e)},Tj);function Tj(){return null!==Sj&&Sj.apply(this,arguments)||this}Vd.default=pd;var jj,j={},Cj=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())})},Ij=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}}}},$d=(Object.defineProperty(j,"__esModule",{value:!0}),j.default={load:function(t){return Cj(this,void 0,void 0,function(){return Ij(this,function(e){return[2,t]})})}},r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}}),E=(Object.defineProperty(_p,"__esModule",{value:!0}),_p.ClientCertificatesLoader=_p.HostNameResolver=_p.Channel=void 0,$d(Pp)),I=$d(Vd),Pd=$d(j),hd=(_p.Channel=E.default,_p.HostNameResolver=I.default,_p.ClientCertificatesLoader=Pd.default,{}),eh={},oh=r&&r.__extends||(jj=function(e,t){return(jj=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}jj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(eh,"__esModule",{value:!0});var Rj,Aj=yc,sh=(Rj=Jp.BaseBuffer,oh(kj,Rj),kj.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}},kj.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}},kj.prototype.getFloat64=function(e){for(var t=(0,Aj.alloc)(8),r=0;r<8;r++)t.putUInt8(r,this.getUInt8(e+r));return t.getFloat64(0)},kj);function kj(e){for(var t=this,r=0,n=0;n<e.length;n++)r+=e[n].length;return(t=Rj.call(this,r)||this)._buffers=e,t}eh.default=sh;var Mj,Nj,dh=r&&r.__extends||(Mj=function(e,t){return(Mj=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}Mj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),vh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},jh=(Object.defineProperty(hd,"__esModule",{value:!0}),hd.Dechunker=hd.Chunker=void 0,vh(fc)),xj=yc,Dj=vh(eh),xh=(Nj=jh.default,dh(Uj,Nj),Uj.prototype.putUInt8=function(e,t){this._ensure(1),this._buffer.writeUInt8(t)},Uj.prototype.putInt8=function(e,t){this._ensure(1),this._buffer.writeInt8(t)},Uj.prototype.putFloat64=function(e,t){this._ensure(8),this._buffer.writeFloat64(t)},Uj.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},Uj.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,xj.alloc)(this._bufferSize),this._chunkOpen=!1),this},Uj.prototype.messageBoundary=function(){this._closeChunkIfOpen(),this._buffer.remaining()<2&&this.flush(),this._buffer.writeInt16(0)},Uj.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)},Uj.prototype._closeChunkIfOpen=function(){var e;this._chunkOpen&&(e=this._buffer.position-(this._currentChunkStart+2),this._buffer.putUInt16(this._currentChunkStart,e),this._chunkOpen=!1)},Uj);function Uj(e,t){var r=Nj.call(this,0)||this;return r._bufferSize=t||1400,r._ch=e,r._buffer=(0,xj.alloc)(r._bufferSize),r._currentChunkStart=0,r._chunkOpen=!1,r}function Lj(){this._currentMessage=[],this._partialChunkHeader=0,this._state=this.AWAITING_CHUNK}hd.Chunker=xh,Lj.prototype.AWAITING_CHUNK=function(e){return 2<=e.remaining()?this._onHeader(e.readUInt16()):(this._partialChunkHeader=e.readUInt8()<<8,this.IN_HEADER)},Lj.prototype.IN_HEADER=function(e){return this._onHeader(65535&(this._partialChunkHeader|e.readUInt8()))},Lj.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)},Lj.prototype.CLOSED=function(e){},Lj.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 Dj.default(this._currentMessage)}return this._currentMessage=[],this.onmessage(t),this.AWAITING_CHUNK},Lj.prototype.write=function(e){for(;e.hasRemaining();)this._state=this._state(e)},hd.Dechunker=Lj;var Bh={},Fj=(Object.defineProperty(Bh,"__esModule",{value:!0}),e),Vh=Fj.internal.util,Hh=Vh.ENCRYPTION_OFF,cb=Vh.ENCRYPTION_ON,Bj=Fj.error.SERVICE_UNAVAILABLE,Wj=[null,void 0,!0,!1,cb,Hh],qj=[null,void 0,"TRUST_ALL_CERTIFICATES","TRUST_CUSTOM_CA_SIGNED_CERTIFICATES","TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"];Bh.default=function(e,t,r,n){this.address=e,this.encrypted=function(e){e=e.encrypted;if(-1!==Wj.indexOf(e))return e;throw(0,Fj.newError)("Illegal value of the encrypted setting ".concat(e,". Expected one of ").concat(Wj))}(t),this.trust=function(e){e=e.trust;if(-1!==qj.indexOf(e))return e;throw(0,Fj.newError)("Illegal value of the trust setting ".concat(e,". Expected one of ").concat(qj))}(t),this.trustedCertificates=t.trustedCertificates||[],this.knownHostsPath=t.knownHosts||null,this.connectionErrorCode=r||Bj,this.connectionTimeout=t.connectionTimeout,this.clientCertificate=n};var zj,Vj,sb={},Cb={},Jf={exports:{}};function Hj(e,t){for(var r in e)t[r]=e[r]}function Gj(e,t,r){return Vj(e,t,r)}Pb=(bf=Jf).exports,(Vj=(zj=Nf).Buffer).from&&Vj.alloc&&Vj.allocUnsafe&&Vj.allocUnsafeSlow?bf.exports=zj:(Hj(zj,Pb),Pb.Buffer=Gj),Gj.prototype=Object.create(Vj.prototype),Hj(Vj,Gj),Gj.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return Vj(e,t,r)},Gj.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=Vj(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},Gj.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Vj(e)},Gj.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return zj.SlowBuffer(e)};var Yj=Jf.exports.Buffer,Kj=Yj.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 Zj(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||Yj.isEncoding!==Kj&&Kj(e))return t||e;throw new Error("Unknown encoding: "+e)}function Xj(e){var t;switch(this.encoding=Zj(e),this.encoding){case"utf16le":this.text=$j,this.end=eC,t=4;break;case"utf8":this.fillLast=Jj,t=4;break;case"base64":this.text=tC,this.end=rC,t=3;break;default:return this.write=nC,void(this.end=oC)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Yj.allocUnsafe(t)}function Qj(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function Jj(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 $j(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 eC(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 tC(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 rC(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function nC(e){return e.toString(this.encoding)}function oC(e){return e&&e.length?this.write(e):""}(Cb.StringDecoder=Xj).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||""},Xj.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},Xj.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=Qj(t[n]);if(0<=o)return 0<o&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(0<=(o=Qj(t[n])))return 0<o&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(0<=(o=Qj(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)},Xj.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 iC,uC,aC,sC,cC,jb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lC=(Object.defineProperty(sb,"__esModule",{value:!0}),jb(yc)),fC=e,pC=jb(Nf),dC=new Cb.StringDecoder("utf8");sb.default={encode:function(e){return new lC.default((e=e,"function"==typeof pC.default.Buffer.from?pC.default.Buffer.from(e,"utf8"):new pC.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 dC.write(e._buffer)},r=function(){return dC.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,fC.newError)("Don't know how to decode strings from '".concat(e,"'"))}},Lb=yp,iC=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]}),Fb=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||iC(t,e,r)},uC=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Lb,"__esModule",{value:!0}),Lb.utf8=Lb.alloc=Lb.ChannelConfig=void 0,Fb(_p,Lb),Fb(hd,Lb),aC=Bh,Object.defineProperty(Lb,"ChannelConfig",{enumerable:!0,get:function(){return uC(aC).default}}),sC=yc,Object.defineProperty(Lb,"alloc",{enumerable:!0,get:function(){return sC.alloc}}),cC=sb,Object.defineProperty(Lb,"utf8",{enumerable:!0,get:function(){return uC(cC).default}}),Object.defineProperty(Qf,"__esModule",{value:!0});var hC=yp,bC=e,yC=1616949271;function _C(e,t){return{major:e,minor:t}}function vC(){var e=[[_C(5,6),_C(5,0)],[_C(4,4),_C(4,2)],_C(4,1),_C(3,0)];if(4<e.length)throw(0,bC.newError)("It should not have more than 4 versions of the protocol");var o=(0,hC.alloc)(20);return o.writeInt32(yC),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}Qf.default=function(t,o){var i=this;return new Promise(function(r,n){function e(e){n(e)}t.onerror=e.bind(i),t._error&&e(t._error),t.onmessage=function(t){try{var e=function(e,t){if(72===(e=[e.readUInt8(),e.readUInt8(),e.readUInt8(),e.readUInt8()])[0]&&84===e[1]&&84===e[2]&&80===e[3])throw t.error("Handshake failed since server responded with HTTP."),(0,bC.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,o);r({protocolVersion:e,consumeRemainingBuffer:function(e){t.hasRemaining()&&e(t.readSlice(t.remaining()))}})}catch(e){n(e)}},t.write(vC())})};var mC,Yb={},Jb={},ry={},R={},iy={},Sy=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)}),Iy=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ny=(Object.defineProperty(iy,"__esModule",{value:!0}),Iy(e),gC.ofRecord=function(e){return null===e?gC.ofNull():new CC(e)},gC.ofMessageResponse=function(e){return null===e?gC.ofNull():new wC(e)},gC.ofNull=function(){return new SC},Object.defineProperty(gC.prototype,"ttl",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(gC.prototype,"db",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(gC.prototype,"servers",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(gC.prototype,"isNull",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),gC);function gC(){}iy.default=Ny;Sy(EC,OC=Ny),Object.defineProperty(EC.prototype,"ttl",{get:function(){return this._response.rt.ttl},enumerable:!1,configurable:!0}),Object.defineProperty(EC.prototype,"servers",{get:function(){return this._response.rt.servers},enumerable:!1,configurable:!0}),Object.defineProperty(EC.prototype,"db",{get:function(){return this._response.rt.db},enumerable:!1,configurable:!0}),Object.defineProperty(EC.prototype,"isNull",{get:function(){return null===this._response},enumerable:!1,configurable:!0});var OC,wC=EC;function EC(e){var t=OC.call(this)||this;return t._response=e,t}Sy(TC,PC=Ny),Object.defineProperty(TC.prototype,"isNull",{get:function(){return!0},enumerable:!1,configurable:!0});var PC,SC=TC;function TC(){return null!==PC&&PC.apply(this,arguments)||this}Sy(IC,jC=Ny),Object.defineProperty(IC.prototype,"ttl",{get:function(){return this._record.get("ttl")},enumerable:!1,configurable:!0}),Object.defineProperty(IC.prototype,"servers",{get:function(){return this._record.get("servers")},enumerable:!1,configurable:!0}),Object.defineProperty(IC.prototype,"db",{get:function(){return this._record.has("db")?this._record.get("db"):null},enumerable:!1,configurable:!0}),Object.defineProperty(IC.prototype,"isNull",{get:function(){return null===this._record},enumerable:!1,configurable:!0});var jC,CC=IC;function IC(e){var t=jC.call(this)||this;return t._record=e,t}var Fy={},Wy={},RC=(Object.defineProperty(Wy,"__esModule",{value:!0}),Wy.reuseOngoingRequest=Wy.identity=void 0,e);Wy.identity=function(e){return e},Wy.reuseOngoingRequest=function(o,i){void 0===i&&(i=null);var u=new Map;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=RC.json.stringify(e);if(u.has(r))return u.get(r);var n=o.apply(i,e);return u.set(r,n),n.finally(function(){u.delete(r)})}};var Jy={},AC=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.")};Object.defineProperty(Jy,"__esModule",{value:!0}),Jy.equals=void 0,Jy.equals=function(e,t){var r,n;if(e===t)return!0;if(null===e||null===t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;try{for(var u=AC(o),a=u.next();!a.done;a=u.next()){var s=a.value;if(e[s]!==t[s])return!1}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!0};var kC,MC=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]}),NC=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n_=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)&&MC(t,e,r);return NC(t,e),t},u_=(Object.defineProperty(Fy,"__esModule",{value:!0}),Fy.object=Fy.functional=void 0,Fy.functional=n_(Wy),Fy.object=n_(Jy),r&&r.__extends||(kC=function(e,t){return(kC=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}kC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),a_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},xC=(Object.defineProperty(R,"__esModule",{value:!0}),R.TelemetryObserver=R.ProcedureRouteObserver=R.RouteObserver=R.CompletedObserver=R.FailedObserver=R.ResetObserver=R.LogoffObserver=R.LoginObserver=R.ResultStreamObserver=R.StreamObserver=void 0,e),DC=a_(iy),UC=Fy,LC=xC.internal.constants.FETCH_ALL,FC=xC.error.PROTOCOL_ERROR,s_=(BC.prototype.onNext=function(e){},BC.prototype.onError=function(e){},BC.prototype.onCompleted=function(e){},BC);function BC(){}R.StreamObserver=s_;u_(qC,WC=s_),qC.prototype.pause=function(){this._paused=!0},qC.prototype.resume=function(){this._paused=!1,this._setupAutoPull(!0),this._state.pull(this)},qC.prototype.onNext=function(e){this._haveRecordStreamed=!0;var t=new xC.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))},qC.prototype.onCompleted=function(e){this._state.onSuccess(this,e)},qC.prototype.onError=function(e){this._state.onError(this,e)},qC.prototype.cancel=function(){this._discard=!0},qC.prototype.prepareToHandleSingleResponse=function(){this._head=[],this._fieldKeys=[],this._setState(iI.STREAMING)},qC.prototype.markCompleted=function(){this._head=[],this._fieldKeys=[],this._tail={},this._setState(iI.SUCCEEDED)},qC.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===iI.READY&&this._handleStreaming());this._tail&&e.onCompleted&&e.onCompleted(this._tail),this._error&&e.onError(this._error),this._observers.push(e),this._state===iI.READY&&this._handleStreaming()},qC.prototype._handleHasMore=function(e){this._setState(iI.READY),this._handleStreaming(),delete e.has_more},qC.prototype._handlePullSuccess=function(e){var t,r=this,n=this._enrichMetadata(Object.assign(this._server?{server:this._server}:{},this._meta,{stream_summary:{have_records_streamed:this._haveRecordStreamed,pulled:this._pulled,has_keys:0<this._fieldKeys.length}},e));[void 0,null,"r","w","rw","s"].includes(n.type)?(this._setState(iI.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,xC.newError)('Server returned invalid query type. Expected one of [undefined, null, "r", "w", "rw", "s"] but got \''.concat(n.type,"'"),FC))},qC.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}null!=e.fields&&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()}},qC.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(iI.FAILED),this._error=t,null);this._beforeError&&(n=this._beforeError(t));n?Promise.resolve(n).then(e):e()},qC.prototype._handleStreaming=function(){this._head&&this._observers.some(function(e){return e.onNext||e.onCompleted})&&(this._paused||!this._discard&&!this._autoPull||this._more())},qC.prototype._more=function(){this._discard?this._discardFunction(this._queryId,this):(this._pulled=!0,this._moreFunction(this._queryId,this._fetchSize,this)),this._setState(iI.STREAMING)},qC.prototype._storeMetadataForCompletion=function(e){for(var t,r=Object.keys(e),n=r.length;n--;)t=r[n],this._meta[t]=e[t]},qC.prototype._setState=function(e){this._state=e},qC.prototype._setupAutoPull=function(){this._autoPull=!0};var WC,b_=qC;function qC(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?LC: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,d=e.lowRecordWatermark,d=void 0===d?Number.MAX_VALUE:d,e=e.enrichMetadata,h=WC.call(this)||this;return h._fieldKeys=null,h._fieldLookup=null,h._head=null,h._queuedRecords=[],h._tail=null,h._error=null,h._observers=[],h._meta={},h._server=f,h._beforeError=i,h._afterError=u,h._beforeKeys=a,h._afterKeys=s,h._beforeComplete=c,h._afterComplete=l,h._enrichMetadata=e||UC.functional.identity,h._queryId=null,h._moreFunction=r,h._discardFunction=n,h._discard=!1,h._fetchSize=o,h._lowRecordWatermark=d,h._highRecordWatermark=p,h._setState(t?iI.READY:iI.READY_STREAMING),h._setupAutoPull(),h._paused=!1,h._pulled=!t,h._haveRecordStreamed=!1,h}R.ResultStreamObserver=b_;u_(VC,zC=s_),VC.prototype.onNext=function(e){this.onError((0,xC.newError)("Received RECORD when initializing "+xC.json.stringify(e)))},VC.prototype.onError=function(e){this._onError&&this._onError(e)},VC.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var zC,Sd=VC;function VC(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=zC.call(this)||this;return r._onError=t,r._onCompleted=e,r}R.LoginObserver=Sd;u_(GC,HC=s_),GC.prototype.onNext=function(e){this.onError((0,xC.newError)("Received RECORD when logging off "+xC.json.stringify(e)))},GC.prototype.onError=function(e){this._onError&&this._onError(e)},GC.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var HC,v_=GC;function GC(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=HC.call(this)||this;return r._onError=t,r._onCompleted=e,r}R.LogoffObserver=v_;u_(KC,YC=s_),KC.prototype.onNext=function(e){this.onError((0,xC.newError)("Received RECORD when resetting: received record is: "+xC.json.stringify(e),FC))},KC.prototype.onError=function(e){e.code===FC&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},KC.prototype.onCompleted=function(e){this._onComplete&&this._onComplete(e)};var YC,g_=KC;function KC(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onComplete,n=YC.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onComplete=e,n}R.ResetObserver=g_;u_(XC,ZC=b_),XC.prototype.onNext=function(e){this.onError((0,xC.newError)("Received RECORD when sending telemetry "+xC.json.stringify(e),FC))},XC.prototype.onError=function(e){this._onError&&this._onError(e)},XC.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var ZC,P_=XC;function XC(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=ZC.call(this)||this;return r._onError=t,r._onCompleted=e,r}R.TelemetryObserver=P_;u_(JC,QC=b_);var QC,j_=JC;function JC(e){var t=e.error,e=e.onError,e=QC.call(this,{beforeError:e})||this;return e.onError(t),e}R.FailedObserver=j_;u_(eI,$C=b_);var $C,N_=eI;function eI(){var e=$C.call(this)||this;return $C.prototype.markCompleted.call(e),e}R.CompletedObserver=N_;u_(rI,tI=s_),rI.prototype.onNext=function(e){this._records.push(e)},rI.prototype.onError=function(e){e.code===FC&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},rI.prototype.onCompleted=function(){null!==this._records&&1!==this._records.length?this.onError((0,xC.newError)("Illegal response from router. Received "+this._records.length+" records but expected only one.\n"+xC.json.stringify(this._records),FC)):this._onCompleted&&this._onCompleted(DC.default.ofRecord(this._records[0]))};var tI,ly=rI;function rI(e){var t=e.resultObserver,r=e.onProtocolError,n=e.onError,e=e.onCompleted,o=tI.call(this)||this;return o._resultObserver=t,o._onError=n,o._onCompleted=e,o._records=[],o._onProtocolError=r,t.subscribe(o),o}R.ProcedureRouteObserver=ly;u_(oI,nI=s_),oI.prototype.onNext=function(e){this.onError((0,xC.newError)("Received RECORD when resetting: received record is: "+xC.json.stringify(e),FC))},oI.prototype.onError=function(e){e.code===FC&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},oI.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(DC.default.ofMessageResponse(e))};var nI,B_=oI;function oI(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onCompleted,n=nI.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onCompleted=e,n}R.RouteObserver=B_;var iI={READY_STREAMING:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){e._setState(iI.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(){}}},uI=(Object.defineProperty(ry,"__esModule",{value:!0}),ry.assertNotificationFilterIsEmpty=ry.assertImpersonatedUserIsEmpty=ry.assertTxConfigIsEmpty=ry.assertDatabaseIsEmpty=void 0,e);ry.assertTxConfigIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e&&!e.isEmpty())throw t((e=(0,uI.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},ry.assertDatabaseIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e)throw t((e=(0,uI.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},ry.assertImpersonatedUserIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e)throw t((t=(0,uI.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},ry.assertNotificationFilterIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),void 0!==e)throw t((t=(0,uI.newError)("Driver is connected to a database that does not support user notification filters. Please upgrade to Neo4j 5.7.0 or later in order to use this functionality. "+"Trying to set notifications to ".concat(uI.json.stringify(e),"."))).message),r.onError(t),t};var z_={},yf={},hy={},aI=(Object.defineProperty(hy,"__esModule",{value:!0}),hy.verifyStructSize=hy.Structure=void 0,e),sI=aI.error.PROTOCOL_ERROR,tv=(Object.defineProperty(cI.prototype,"size",{get:function(){return this.fields.length},enumerable:!1,configurable:!0}),cI.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+"])"},cI);function cI(e,t){this.signature=e,this.fields=t}hy.Structure=tv,hy.verifyStructSize=function(e,t,r){if(t!==r)throw(0,aI.newError)("Wrong struct size for ".concat(e,", expected ").concat(t," but was ").concat(r),sI)},hy.default=tv,Object.defineProperty(yf,"__esModule",{value:!0}),yf.Unpacker=yf.Packer=void 0;var lI=yp,fI=Fy,pI=hy,dI=e,hI=dI.error.PROTOCOL_ERROR;function bI(e){this._ch=e,this._byteArraysSupported=!0}function yI(e,t){void 0===t&&(t=!1),this._disableLosslessIntegers=e=void 0===e?!1:e,this._useBigInt=t}bI.prototype.packable=function(o,i){var e,u=this;void 0===i&&(i=fI.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,dI.int)(o))};if((0,dI.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 pI.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))},bI.prototype.packableIterable=function(t,e){try{var r=Array.from(t);return this.packable(r,e)}catch(e){throw(0,dI.newError)("Cannot pack given iterable, ".concat(e.message,": ").concat(t))}},bI.prototype.packStruct=function(e,t){this.packStructHeader((t=t||[]).length,e);for(var r=0;r<t.length;r++)t[r]()},bI.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))},bI.prototype.packFloat=function(e){this._ch.writeUInt8(193),this._ch.writeFloat64(e)},bI.prototype.packString=function(e){var e=lI.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,dI.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)}},bI.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,dI.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)}},bI.prototype.packBytes=function(e){if(!this._byteArraysSupported)throw(0,dI.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])},bI.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,dI.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)}},bI.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,dI.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)}},bI.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,dI.newError)("Structures of size "+e+" are not supported");this._ch.writeUInt8(221),this._ch.writeUInt8(e/256>>0),this._ch.writeUInt8(e%256)}},bI.prototype.disableByteArrays=function(){this._byteArraysSupported=!1},bI.prototype._nonPackableValue=function(e){return function(){throw(0,dI.newError)(e,hI)}},yf.Packer=bI,yI.prototype.unpack=function(e,t){void 0===t&&(t=fI.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,dI.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,dI.newError)("Unknown packed value with marker "+r.toString(16))},yI.prototype.unpackInteger=function(e){var t=e.readUInt8(),e=this._unpackInteger(t,e);if(null==e)throw(0,dI.newError)("Unable to unpack integer value with marker "+t.toString(16));return e},yI.prototype._unpackBoolean=function(e){return 195===e||194!==e&&null},yI.prototype._unpackNumberOrInteger=function(e,t){return 193===e?t.readFloat64():this._unpackInteger(e,t)},yI.prototype._unpackInteger=function(e,t){var r;return 0<=e&&e<128?(0,dI.int)(e):240<=e&&e<256?(0,dI.int)(e-256):200===e?(0,dI.int)(t.readInt8()):201===e?(0,dI.int)(t.readInt16()):202===e?(r=t.readInt32(),(0,dI.int)(r)):203===e?(r=t.readInt32(),e=t.readInt32(),new dI.Integer(e,r)):null},yI.prototype._unpackString=function(e,t,r,n){return 128===t?lI.utf8.decode(n,r):208===e?lI.utf8.decode(n,n.readUInt8()):209===e?lI.utf8.decode(n,n.readUInt16()):210===e?lI.utf8.decode(n,n.readUInt32()):null},yI.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},yI.prototype._unpackListWithSize=function(e,t,r){for(var n=[],o=0;o<e;o++)n.push(this.unpack(t,r));return n},yI.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},yI.prototype._unpackByteArrayWithSize=function(e,t){for(var r=new Int8Array(e),n=0;n<e;n++)r[n]=t.readInt8();return r},yI.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},yI.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},yI.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},yI.prototype._unpackStructWithSize=function(e,t,r){for(var n=t.readUInt8(),o=new pI.Structure(n,[]),i=0;i<e;i++)o.fields.push(this.unpack(t,r));return r(o)},yf.Unpacker=yI;var _I,vI,iv={},bv=r&&r.__extends||(_I=function(e,t){return(_I=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}_I(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),mI=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]}),gI=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),$f=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)&&mI(t,e,r);return gI(t,e),t},sv=(Object.defineProperty(iv,"__esModule",{value:!0}),iv.Unpacker=iv.Packer=void 0,$f(yf)),ep=(vI=sv.Packer,bv(OI,vI),OI.prototype.disableByteArrays=function(){throw new Error("Bolt V2 should always support byte arrays")},OI);function OI(){return null!==vI&&vI.apply(this,arguments)||this}iv.Packer=ep;wI=sv.Unpacker,bv(EI,wI);var wI,cv=EI;function EI(e,t){return wI.call(this,e=void 0===e?!1:e,t=void 0===t?!1:t)||this}iv.Unpacker=cv;var PI=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]}),SI=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),pv=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)&&PI(t,e,r);return SI(t,e),t},tp=(Object.defineProperty(z_,"__esModule",{value:!0}),z_.structure=z_.v2=z_.v1=void 0,pv(yf)),Tv=(z_.v1=tp,pv(iv)),Iv=(z_.v2=Tv,pv(hy)),p=(z_.structure=Iv,z_.default=Tv,{}),TI=(Object.defineProperty(p,"__esModule",{value:!0}),p.SIGNATURES=void 0,e),Mv=TI.internal.constants,jI=Mv.ACCESS_MODE_READ,CI=Mv.FETCH_ALL,II=TI.internal.util.assertString,Fv=Object.freeze({INIT:1,RESET:15,RUN:16,PULL_ALL:63,HELLO:1,GOODBYE:2,BEGIN:17,COMMIT:18,ROLLBACK:19,TELEMETRY:84,ROUTE:102,LOGON:106,LOGOFF:107,DISCARD:47,PULL:63}),S=(p.SIGNATURES=Fv,M.init=function(e,t){return new M(1,[e,t],function(){return"INIT ".concat(e," {...}")})},M.run=function(e,t){return new M(16,[e,t],function(){return"RUN ".concat(e," ").concat(TI.json.stringify(t))})},M.pullAll=function(){return NI},M.reset=function(){return xI},M.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 M(1,[t],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},M.hello5x1=function(e,t){var r={user_agent:e};return(t=void 0===t?null:t)&&(r.routing=t),new M(1,[r],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},M.hello5x2=function(e,t,r){void 0===r&&(r=null);var n={user_agent:e};return kI(n,t=void 0===t?null:t),r&&(n.routing=r),new M(1,[n],function(){return"HELLO ".concat(TI.json.stringify(n))})},M.hello5x3=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o={};return e&&(o.user_agent=e),t&&(o.bolt_agent={product:t.product,platform:t.platform,language:t.language,language_details:t.languageDetails}),kI(o,r),n&&(o.routing=n),new M(1,[o],function(){return"HELLO ".concat(TI.json.stringify(o))})},M.hello5x5=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o={};return e&&(o.user_agent=e),t&&(o.bolt_agent={product:t.product,platform:t.platform,language:t.language,language_details:t.languageDetails}),MI(o,r),n&&(o.routing=n),new M(1,[o],function(){return"HELLO ".concat(TI.json.stringify(o))})},M.logon=function(e){return new M(106,[e],function(){return"LOGON { ... }"})},M.logoff=function(){return new M(107,[],function(){return"LOGOFF"})},M.begin=function(e){var e=void 0===e?{}:e,t=RI(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter);return new M(17,[t],function(){return"BEGIN ".concat(TI.json.stringify(t))})},M.begin5x5=function(e){var e=void 0===e?{}:e,t=RI(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter,{appendNotificationFilter:MI});return new M(17,[t],function(){return"BEGIN ".concat(TI.json.stringify(t))})},M.commit=function(){return DI},M.rollback=function(){return UI},M.runWithMetadata=function(e,t,r){var r=void 0===r?{}:r,n=RI(r.bookmarks,r.txConfig,r.database,r.mode,r.impersonatedUser,r.notificationFilter);return new M(16,[e,t,n],function(){return"RUN ".concat(e," ").concat(TI.json.stringify(t)," ").concat(TI.json.stringify(n))})},M.runWithMetadata5x5=function(e,t,r){var r=void 0===r?{}:r,n=RI(r.bookmarks,r.txConfig,r.database,r.mode,r.impersonatedUser,r.notificationFilter,{appendNotificationFilter:MI});return new M(16,[e,t,n],function(){return"RUN ".concat(e," ").concat(TI.json.stringify(t)," ").concat(TI.json.stringify(n))})},M.goodbye=function(){return LI},M.pull=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=AI(null==t?-1:t,(void 0===e?CI:e)||CI);return new M(63,[r],function(){return"PULL ".concat(TI.json.stringify(r))})},M.discard=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=AI(null==t?-1:t,(void 0===e?CI:e)||CI);return new M(47,[r],function(){return"DISCARD ".concat(TI.json.stringify(r))})},M.telemetry=function(e){var e=e.api,t=(0,TI.int)(e);return new M(84,[t],function(){return"TELEMETRY ".concat(t.toString())})},M.route=function(e,t,r){return new M(102,[e=void 0===e?{}:e,t=void 0===t?[]:t,r=void 0===r?null:r],function(){return"ROUTE ".concat(TI.json.stringify(e)," ").concat(TI.json.stringify(t)," ").concat(r)})},M.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 M(102,[e,t,n],function(){return"ROUTE ".concat(TI.json.stringify(e)," ").concat(TI.json.stringify(t)," ").concat(TI.json.stringify(n))})},M);function M(e,t,r){this.signature=e,this.fields=t,this.toString=r}function RI(e,t,r,n,o,i,u){void 0===u&&(u={});var a={};return e.isEmpty()||(a.bookmarks=e.values()),null!==t.timeout&&(a.tx_timeout=t.timeout),t.metadata&&(a.tx_metadata=t.metadata),r&&(a.db=II(r,"database")),o&&(a.imp_user=II(o,"impersonatedUser")),n===jI&&(a.mode="r"),(null!=(e=u.appendNotificationFilter)?e:kI)(a,i),a}function AI(e,t){t={n:(0,TI.int)(t)};return-1!==e&&(t.qid=(0,TI.int)(e)),t}function kI(e,t){t&&(t.minimumSeverityLevel&&(e.notifications_minimum_severity=t.minimumSeverityLevel),t.disabledCategories&&(e.notifications_disabled_categories=t.disabledCategories),t.disabledClassifications&&(e.notifications_disabled_categories=t.disabledClassifications))}function MI(e,t){t&&(t.minimumSeverityLevel&&(e.notifications_minimum_severity=t.minimumSeverityLevel),t.disabledCategories&&(e.notifications_disabled_classifications=t.disabledCategories),t.disabledClassifications&&(e.notifications_disabled_classifications=t.disabledClassifications))}var NI=new(p.default=S)(63,[],function(){return"PULL_ALL"}),xI=new S(15,[],function(){return"RESET"}),DI=new S(18,[],function(){return"COMMIT"}),UI=new S(19,[],function(){return"ROLLBACK"}),LI=new S(2,[],function(){return"GOODBYE"}),qv={},Vv={},FI=(Object.defineProperty(Vv,"__esModule",{value:!0}),Vv.TypeTransformer=void 0,z_),BI=e.internal.objectUtil;function WI(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 qI(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)}WI.prototype.fromStructure=function(e){try{return e instanceof FI.structure.Structure&&this._transformersPerSignature.has(e.signature)?(0,this._transformersPerSignature.get(e.signature).fromStructure)(e):e}catch(e){return BI.createBrokenObject(e)}},WI.prototype.toStructure=function(t){var e=this._transformers.find(function(e){return(0,e.isTypeInstance)(t)});return void 0!==e?e.toStructure(t):t},Vv.default=WI,qI.prototype.extendsWith=function(e){var t=e.signature,r=e.fromStructure,n=e.toStructure,e=e.isTypeInstance;return new qI({signature:t||this.signature,fromStructure:r||this.fromStructure,toStructure:n||this.toStructure,isTypeInstance:e||this.isTypeInstance})},Vv.TypeTransformer=qI;var zI=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},VI=(Object.defineProperty(qv,"__esModule",{value:!0}),e),HI=z_,GI=Vv,YI=VI.error.PROTOCOL_ERROR;qv.default={createNodeTransformer:function(){return new GI.TypeTransformer({signature:78,isTypeInstance:function(e){return e instanceof VI.Node},toStructure:function(e){throw(0,VI.newError)("It is not allowed to pass nodes in query parameters, given: ".concat(e),YI)},fromStructure:function(e){HI.structure.verifyStructSize("Node",3,e.size);var e=zI(e.fields,3),t=e[0],r=e[1],e=e[2];return new VI.Node(t,r,e)}})},createRelationshipTransformer:function(){return new GI.TypeTransformer({signature:82,isTypeInstance:function(e){return e instanceof VI.Relationship},toStructure:function(e){throw(0,VI.newError)("It is not allowed to pass relationships in query parameters, given: ".concat(e),YI)},fromStructure:function(e){HI.structure.verifyStructSize("Relationship",5,e.size);var e=zI(e.fields,5),t=e[0],r=e[1],n=e[2],o=e[3],e=e[4];return new VI.Relationship(t,r,n,o,e)}})},createUnboundRelationshipTransformer:function(){return new GI.TypeTransformer({signature:114,isTypeInstance:function(e){return e instanceof VI.UnboundRelationship},toStructure:function(e){throw(0,VI.newError)("It is not allowed to pass unbound relationships in query parameters, given: ".concat(e),YI)},fromStructure:function(e){HI.structure.verifyStructSize("UnboundRelationship",3,e.size);var e=zI(e.fields,3),t=e[0],r=e[1],e=e[2];return new VI.UnboundRelationship(t,r,e)}})},createPathTransformer:function(){return new GI.TypeTransformer({signature:80,isTypeInstance:function(e){return e instanceof VI.Path},toStructure:function(e){throw(0,VI.newError)("It is not allowed to pass paths in query parameters, given: ".concat(e),YI)},fromStructure:function(e){HI.structure.verifyStructSize("Path",3,e.size);for(var e=zI(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,VI.toNumber)(n[u]),c=void 0;0<s?(c=r[s-1])instanceof VI.UnboundRelationship&&(r[s-1]=c=c.bindTo(i,a)):(c=r[-s-1])instanceof VI.UnboundRelationship&&(r[-s-1]=c=c.bindTo(a,i)),o.push(new VI.PathSegment(i,c,a)),i=a}return new VI.Path(t[0],t[t.length-1],o)}})}};var KI=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]}),ZI=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Kv=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)&&KI(t,e,r);return ZI(t,e),t},Qv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},XI=(Object.defineProperty(Jb,"__esModule",{value:!0}),ry),QI=z_,JI=Kv(p),$I=R,eR=e,tR=Qv(qv),rR=Qv(Vv),nR=eR.internal.bookmarks.Bookmarks,em=eR.internal.constants,oR=em.ACCESS_MODE_WRITE,iR=em.BOLT_PROTOCOL_V1,uR=(eR.internal.logger.Logger,eR.internal.txConfig.TxConfig),f=(Object.defineProperty(N.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new rR.default(Object.values(tR.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"version",{get:function(){return iR},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"supportsReAuth",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"initialized",{get:function(){return!!this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"authToken",{get:function(){return this._authToken},enumerable:!1,configurable:!0}),N.prototype.packer=function(){return this._packer},N.prototype.packable=function(e){return this._packer.packable(e,this.transformer.toStructure)},N.prototype.unpacker=function(){return this._unpacker},N.prototype.unpack=function(e){return this._unpacker.unpack(e,this.transformer.fromStructure)},N.prototype.transformMetadata=function(e){return e},N.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new $I.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,u)}});return(0,XI.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(JI.default.init(r,n),e,!0),e},N.prototype.logoff=function(e){var e=void 0===e?{}:e,t=e.onComplete,r=e.onError,e=(e.flush,new $I.LogoffObserver({onCompleted:t,onError:r})),t=(0,eR.newError)("Driver is connected to a database that does not support logoff. Please upgrade to Neo4j 5.5.0 or later in order to use this functionality.");throw this._onProtocolError(t.message),e.onError(t),t},N.prototype.logon=function(e){var t=this,e=void 0===e?{}:e,r=e.authToken,n=e.onComplete,o=e.onError,e=(e.flush,new $I.LoginObserver({onCompleted:function(){return t._onLoginCompleted({},r,n)},onError:function(e){return t._onLoginError(e,o)}})),i=(0,eR.newError)("Driver is connected to a database that does not support logon. Please upgrade to Neo4j 5.5.0 or later in order to use this functionality.");throw this._onProtocolError(i.message),e.onError(i),i},N.prototype.prepareToClose=function(){},N.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.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete;return this.run("BEGIN",t?t.asBeginTransactionParameters():{},{bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e,flush:!1})},N.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:nR.empty(),txConfig:uR.empty(),mode:oR,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},N.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:nR.empty(),txConfig:uR.empty(),mode:oR,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},N.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.notificationFilter,a=r.beforeKeys,s=r.afterKeys,c=r.beforeError,l=r.afterError,f=r.beforeComplete,p=r.afterComplete,d=r.flush,d=void 0===d||d,h=r.highRecordWatermark,h=void 0===h?Number.MAX_VALUE:h,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,a=new $I.ResultStreamObserver({server:this._server,beforeKeys:a,afterKeys:s,beforeError:c,afterError:l,beforeComplete:f,afterComplete:p,highRecordWatermark:h,lowRecordWatermark:r});return(0,XI.assertTxConfigIsEmpty)(n,this._onProtocolError,a),(0,XI.assertDatabaseIsEmpty)(o,this._onProtocolError,a),(0,XI.assertImpersonatedUserIsEmpty)(i,this._onProtocolError,a),(0,XI.assertNotificationFilterIsEmpty)(u,this._onProtocolError,a),this.write(JI.default.run(e,t),a,!1),this.write(JI.default.pullAll(),a,d),a},Object.defineProperty(N.prototype,"currentFailure",{get:function(){return this._responseHandler.currentFailure},enumerable:!1,configurable:!0}),N.prototype.reset=function(e){var e=void 0===e?{}:e,t=e.onError,e=e.onComplete,t=new $I.ResetObserver({onProtocolError:this._onProtocolError,onError:t,onComplete:e});return this.write(JI.default.reset(),t,!0),t},N.prototype.telemetry=function(e,t){e.api;e=void 0===t?{}:t,e.onError,t=e.onCompleted,e=new $I.CompletedObserver;return t&&t(),e},N.prototype._createPacker=function(e){return new QI.v1.Packer(e)},N.prototype._createUnpacker=function(e,t){return new QI.v1.Unpacker(e,t)},N.prototype.write=function(e,t,r){this.queueObserverIfProtocolIsNotBroken(t)&&(this._log.isDebugEnabled()&&this._log.debug("C: ".concat(e)),this._lastMessageSignature=e.signature,t=new QI.structure.Structure(e.signature,e.fields),this.packable(t)(),this._chunker.messageBoundary(),r&&this._chunker.flush())},N.prototype.isLastMessageLogon=function(){return this._lastMessageSignature===JI.SIGNATURES.HELLO||this._lastMessageSignature===JI.SIGNATURES.LOGON},N.prototype.isLastMessageReset=function(){return this._lastMessageSignature===JI.SIGNATURES.RESET},N.prototype.notifyFatalError=function(e){return this._fatalError=e,this._responseHandler._notifyErrorToObservers(e)},N.prototype.updateCurrentObserver=function(){return this._responseHandler._updateCurrentObserver()},N.prototype.hasOngoingObservableRequests=function(){return this._responseHandler.hasOngoingObservableRequests()},N.prototype.queueObserverIfProtocolIsNotBroken=function(e){return this.isBroken()?(this.notifyFatalErrorToObserver(e),!1):this._responseHandler._queueObserver(e)},N.prototype.isBroken=function(){return!!this._fatalError},N.prototype.notifyFatalErrorToObserver=function(e){e&&e.onError&&e.onError(this._fatalError)},N.prototype.resetFailure=function(){this._responseHandler._resetFailure()},N.prototype._onLoginCompleted=function(e,t,r){this._initialized=!0,this._authToken=t,e&&(t=e.server,this._server.version||(this._server.version=t)),r&&r(e)},N.prototype._onLoginError=function(e,t){this._onProtocolError(e.message),t&&t(e)},N);function N(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}}Jb.default=f;var om={},Yh={},lm={},aR=(Object.defineProperty(lm,"__esModule",{value:!0}),lm.epochSecondAndNanoToLocalDateTime=lm.nanoOfDayToLocalTime=lm.epochDayToDate=void 0,e),ym=aR.internal.temporalUtil,sR=ym.DAYS_0000_TO_1970,cR=ym.DAYS_PER_400_YEAR_CYCLE,lR=ym.NANOS_PER_HOUR,fR=ym.NANOS_PER_MINUTE,pR=ym.NANOS_PER_SECOND,dR=ym.SECONDS_PER_DAY,hR=ym.floorDiv,bR=ym.floorMod;function yR(e){var e=(e=(0,aR.int)(e)).add(sR).subtract(60),t=(0,aR.int)(0),r=(e.lessThan(0)&&(t=(r=e.add(1).div(cR).subtract(1)).multiply(400),e=e.add(r.multiply(-cR))),e.multiply(400).add(591).div(cR)),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 aR.Date(r,n,e)}function _R(e){var t=(e=(0,aR.int)(e)).div(lR),r=(e=e.subtract(t.multiply(lR))).div(fR),n=(e=e.subtract(r.multiply(fR))).div(pR),e=e.subtract(n.multiply(pR));return new aR.LocalTime(t,r,n,e)}lm.epochDayToDate=yR,lm.nanoOfDayToLocalTime=_R,lm.epochSecondAndNanoToLocalDateTime=function(e,t){var r=hR(e,dR),e=bR(e,dR).multiply(pR).add(t),t=yR(r),r=_R(e);return new aR.LocalDateTime(t.year,t.month,t.day,r.hour,r.minute,r.second,r.nanosecond)};var vR=r&&r.__assign||function(){return(vR=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)},mR=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},Om=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gR=(Object.defineProperty(Yh,"__esModule",{value:!0}),e),OR=z_,wR=Vv,ER=lm,jm=Om(qv),O=gR.internal.temporalUtil,PR=O.dateToEpochDay,SR=O.localDateTimeToEpochSecond,TR=O.localTimeToNanoOfDay;function jR(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,gR.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}Yh.default=vR(vR({},jm.default),{createPoint2DTransformer:function(){return new wR.TypeTransformer({signature:88,isTypeInstance:function(e){return(0,gR.isPoint)(e)&&(null===e.z||void 0===e.z)},toStructure:function(e){return new OR.structure.Structure(88,[(0,gR.int)(e.srid),e.x,e.y])},fromStructure:function(e){OR.structure.verifyStructSize("Point2D",3,e.size);var e=mR(e.fields,3),t=e[0],r=e[1],e=e[2];return new gR.Point(t,r,e,void 0)}})},createPoint3DTransformer:function(){return new wR.TypeTransformer({signature:89,isTypeInstance:function(e){return(0,gR.isPoint)(e)&&null!==e.z&&void 0!==e.z},toStructure:function(e){return new OR.structure.Structure(89,[(0,gR.int)(e.srid),e.x,e.y,e.z])},fromStructure:function(e){OR.structure.verifyStructSize("Point3D",4,e.size);var e=mR(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new gR.Point(t,r,n,e)}})},createDurationTransformer:function(){return new wR.TypeTransformer({signature:69,isTypeInstance:gR.isDuration,toStructure:function(e){var t=(0,gR.int)(e.months),r=(0,gR.int)(e.days),n=(0,gR.int)(e.seconds),e=(0,gR.int)(e.nanoseconds);return new OR.structure.Structure(69,[t,r,n,e])},fromStructure:function(e){OR.structure.verifyStructSize("Duration",4,e.size);var e=mR(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new gR.Duration(t,r,n,e)}})},createLocalTimeTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new wR.TypeTransformer({signature:116,isTypeInstance:gR.isLocalTime,toStructure:function(e){e=TR(e.hour,e.minute,e.second,e.nanosecond);return new OR.structure.Structure(116,[e])},fromStructure:function(e){OR.structure.verifyStructSize("LocalTime",1,e.size);e=mR(e.fields,1)[0];return jR((0,ER.nanoOfDayToLocalTime)(e),t,r)}})},createTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new wR.TypeTransformer({signature:84,isTypeInstance:gR.isTime,toStructure:function(e){var t=TR(e.hour,e.minute,e.second,e.nanosecond),e=(0,gR.int)(e.timeZoneOffsetSeconds);return new OR.structure.Structure(84,[t,e])},fromStructure:function(e){OR.structure.verifyStructSize("Time",2,e.size);var e=mR(e.fields,2),t=e[0],e=e[1],t=(0,ER.nanoOfDayToLocalTime)(t);return jR(new gR.Time(t.hour,t.minute,t.second,t.nanosecond,e),r,n)}})},createDateTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new wR.TypeTransformer({signature:68,isTypeInstance:gR.isDate,toStructure:function(e){e=PR(e.year,e.month,e.day);return new OR.structure.Structure(68,[e])},fromStructure:function(e){OR.structure.verifyStructSize("Date",1,e.size);e=mR(e.fields,1)[0];return jR((0,ER.epochDayToDate)(e),t,r)}})},createLocalDateTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new wR.TypeTransformer({signature:100,isTypeInstance:gR.isLocalDateTime,toStructure:function(e){var t=SR(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),e=(0,gR.int)(e.nanosecond);return new OR.structure.Structure(100,[t,e])},fromStructure:function(e){OR.structure.verifyStructSize("LocalDateTime",2,e.size);var e=mR(e.fields,2),t=e[0],e=e[1];return jR((0,ER.epochSecondAndNanoToLocalDateTime)(t,e),r,n)}})},createDateTimeWithZoneIdTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new wR.TypeTransformer({signature:102,isTypeInstance:function(e){return(0,gR.isDateTime)(e)&&null!=e.timeZoneId},toStructure:function(e){var t=SR(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,gR.int)(e.nanosecond),e=e.timeZoneId;return new OR.structure.Structure(102,[t,r,e])},fromStructure:function(e){OR.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=mR(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,ER.epochSecondAndNanoToLocalDateTime)(t,r);return jR(new gR.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 wR.TypeTransformer({signature:70,isTypeInstance:function(e){return(0,gR.isDateTime)(e)&&null==e.timeZoneId},toStructure:function(e){var t=SR(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,gR.int)(e.nanosecond),e=(0,gR.int)(e.timeZoneOffsetSeconds);return new OR.structure.Structure(70,[t,r,e])},fromStructure:function(e){OR.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=mR(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,ER.epochSecondAndNanoToLocalDateTime)(t,r);return jR(new gR.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}});var CR,IR,km=r&&r.__extends||(CR=function(e,t){return(CR=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}CR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Um=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Wm=(Object.defineProperty(om,"__esModule",{value:!0}),Um(Jb)),RR=Um(z_),Kh=e,AR=Um(Yh),kR=Um(Vv),MR=Kh.internal.constants.BOLT_PROTOCOL_V2,Km=(IR=Wm.default,km(NR,IR),NR.prototype._createPacker=function(e){return new RR.default.Packer(e)},NR.prototype._createUnpacker=function(e,t){return new RR.default.Unpacker(e,t)},Object.defineProperty(NR.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new kR.default(Object.values(AR.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(NR.prototype,"version",{get:function(){return MR},enumerable:!1,configurable:!0}),NR);function NR(){return null!==IR&&IR.apply(this,arguments)||this}om.default=Km;var xR,DR,r0={},i0={},UR=r&&r.__assign||function(){return(UR=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)},f0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},d0=(Object.defineProperty(i0,"__esModule",{value:!0}),f0(Yh)),_0=(i0.default=UR({},d0.default),r&&r.__extends||(xR=function(e,t){return(xR=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}xR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),LR=r&&r.__assign||function(){return(LR=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)},w0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},S0=(Object.defineProperty(r0,"__esModule",{value:!0}),w0(om)),FR=w0(p),BR=ry,WR=R,qR=w0(i0),zR=w0(Vv),VR=(e.internal.bookmarks.Bookmarks,e.internal.constants.BOLT_PROTOCOL_V3),HR=e.internal.txConfig.TxConfig,GR="context",YR="CALL dbms.cluster.routing.getRoutingTable($".concat(GR,")"),KR=new WR.StreamObserver,cl=(DR=S0.default,_0(ZR,DR),Object.defineProperty(ZR.prototype,"version",{get:function(){return VR},enumerable:!1,configurable:!0}),Object.defineProperty(ZR.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new zR.default(Object.values(qR.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),ZR.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},ZR.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new WR.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,BR.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(FR.default.hello(r,n),e,!0),e},ZR.prototype.prepareToClose=function(){this.write(FR.default.goodbye(),KR,!0)},ZR.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.notificationFilter,u=e.mode,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new WR.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),(0,BR.assertDatabaseIsEmpty)(n,this._onProtocolError,a),(0,BR.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,a),(0,BR.assertNotificationFilterIsEmpty)(i,this._onProtocolError,a),this.write(FR.default.begin({bookmarks:t,txConfig:r,mode:u}),a,!0),a},ZR.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete,t=new WR.ResultStreamObserver({server:this._server,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e});return t.prepareToHandleSingleResponse(),this.write(FR.default.commit(),t,!0),t},ZR.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete,t=new WR.ResultStreamObserver({server:this._server,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e});return t.prepareToHandleSingleResponse(),this.write(FR.default.rollback(),t,!0),t},ZR.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.notificationFilter,s=r.mode,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.highRecordWatermark,y=void 0===y?Number.MAX_VALUE:y,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new WR.ResultStreamObserver({server:this._server,beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:y,lowRecordWatermark:r});return(0,BR.assertDatabaseIsEmpty)(i,this._onProtocolError,c),(0,BR.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,c),(0,BR.assertNotificationFilterIsEmpty)(a,this._onProtocolError,c),this.write(FR.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,mode:s}),c,!1),this.write(FR.default.pullAll(),c,b),c},ZR.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(YR,((t={})[GR]=void 0===r?{}:r,t),LR(LR({},n),{txConfig:HR.empty()}));return new WR.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:o,onCompleted:e})},ZR);function ZR(){return null!==DR&&DR.apply(this,arguments)||this}r0.default=cl;var XR,QR,I0={},R0={},JR=r&&r.__assign||function(){return(JR=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)},D0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},F0=(Object.defineProperty(R0,"__esModule",{value:!0}),D0(i0)),uy=(R0.default=JR({},F0.default),r&&r.__extends||(XR=function(e,t){return(XR=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}XR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),$R=r&&r.__assign||function(){return($R=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)},V_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},q0=(Object.defineProperty(I0,"__esModule",{value:!0}),V_(r0)),eA=V_(p),tA=ry,rA=R,nA=V_(R0),oA=V_(Vv),Y0=(e.internal.bookmarks.Bookmarks,e.internal.constants),iA=Y0.BOLT_PROTOCOL_V4_0,uA=Y0.FETCH_ALL,aA=e.internal.txConfig.TxConfig,sA="context",cA="database",lA="CALL dbms.routing.getRoutingTable($".concat(sA,", $").concat(cA,")"),X0=(QR=q0.default,uy(fA,QR),Object.defineProperty(fA.prototype,"version",{get:function(){return iA},enumerable:!1,configurable:!0}),Object.defineProperty(fA.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new oA.default(Object.values(nA.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),fA.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.notificationFilter,u=e.mode,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new rA.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),(0,tA.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,a),(0,tA.assertNotificationFilterIsEmpty)(i,this._onProtocolError,a),this.write(eA.default.begin({bookmarks:t,txConfig:r,database:n,mode:u}),a,!0),a},fA.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.notificationFilter,s=r.mode,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?uA:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new rA.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=((0,tA.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,c),(0,tA.assertNotificationFilterIsEmpty)(a,this._onProtocolError,c),y);return this.write(eA.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:s}),c,l&&b),y||this.write(eA.default.pull({n:_}),c,b),c},fA.prototype._requestMore=function(e,t,r){this.write(eA.default.pull({stmtId:e,n:t}),r,!0)},fA.prototype._requestDiscard=function(e,t){this.write(eA.default.discard({stmtId:e}),t,!0)},fA.prototype._noOp=function(){},fA.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(lA,((t={})[sA]=void 0===r?{}:r,t[cA]=n,t),$R($R({},o),{txConfig:aA.empty()}));return new rA.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:i,onCompleted:e})},fA);function fA(){return null!==QR&&QR.apply(this,arguments)||this}I0.default=X0;var pA,dA,b={},og={},hA=r&&r.__assign||function(){return(hA=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)},qy=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},sg=(Object.defineProperty(og,"__esModule",{value:!0}),qy(R0)),Mc=(og.default=hA({},sg.default),r&&r.__extends||(pA=function(e,t){return(pA=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}pA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),dg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vl=(Object.defineProperty(b,"__esModule",{value:!0}),dg(I0)),bA=dg(p),yA=R,Gh=e,_A=ry,vA=dg(og),mA=dg(Vv),gA=Gh.internal.constants.BOLT_PROTOCOL_V4_1,n=(dA=vl.default,Mc(OA,dA),Object.defineProperty(OA.prototype,"version",{get:function(){return gA},enumerable:!1,configurable:!0}),Object.defineProperty(OA.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new mA.default(Object.values(vA.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),OA.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new yA.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,_A.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(bA.default.hello(r,n,this._serversideRouting),e,!0),e},OA);function OA(e,t,r,n,o,i,u){e=dA.call(this,e,t,r,n=void 0===n?function(){return null}:n,o,i)||this;return e._serversideRouting=u,e}b.default=n;var wA,EA,Pg={},Ig={},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)},il=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},X=(Object.defineProperty(Ig,"__esModule",{value:!0}),il(og)),Xg=(Ig.default=PA({},X.default),r&&r.__extends||(wA=function(e,t){return(wA=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}wA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),m=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_=(Object.defineProperty(Pg,"__esModule",{value:!0}),m(b)),C=e,SA=m(Ig),TA=m(Vv),jA=C.internal.constants.BOLT_PROTOCOL_V4_2,t=(EA=_.default,Xg(CA,EA),Object.defineProperty(CA.prototype,"version",{get:function(){return jA},enumerable:!1,configurable:!0}),Object.defineProperty(CA.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new TA.default(Object.values(SA.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),CA);function CA(){return null!==EA&&EA.apply(this,arguments)||this}Pg.default=t;var Dr={},o={},IA=r&&r.__assign||function(){return(IA=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)},qr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},P=(Object.defineProperty(o,"__esModule",{value:!0}),qr(Ig)),ks=(o.default=IA({},P.default),{}),us={},RA=r&&r.__assign||function(){return(RA=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)},Gs=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},qs=(Object.defineProperty(us,"__esModule",{value:!0}),Gs(o)),AA=(us.default=RA({},qs.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}),h=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},kA=(Object.defineProperty(ks,"__esModule",{value:!0}),z_),MA=e,NA=h(us),xA=lm,DA=Wy,UA=MA.internal.temporalUtil.localDateTimeToEpochSecond;var LA=new Map;function FA(e,t,r){e=e,LA.has(e)||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,era:"narrow"}),LA.set(e,n));var n=LA.get(e),e=(0,MA.int)(t).multiply(1e3).add((0,MA.int)(r).div(1e6)).toNumber(),r=n.formatToParts(e).reduce(function(e,t){return"era"===t.type?e.adjustEra="B"===t.value.toUpperCase()?function(e){return e.subtract(1).negate()}:DA.identity:"hour"===t.type?e.hour=(0,MA.int)(t.value).modulo(24):"literal"!==t.type&&(e[t.type]=(0,MA.int)(t.value)),e},{}),e=(r.year=r.adjustEra(r.year),UA(r.year,r.month,r.day,r.hour,r.minute,r.second,r.nanosecond));return r.timeZoneOffsetSeconds=e.subtract(t),r.hour=r.hour.modulo(24),r}function BA(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,MA.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}ks.default={createDateTimeWithZoneIdTransformer:function(e,u){var n=e.disableLosslessIntegers,o=e.useBigInt;return NA.default.createDateTimeWithZoneIdTransformer(e).extendsWith({signature:105,fromStructure:function(e){kA.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=AA(e.fields,3),t=e[0],r=e[1],e=e[2],t=FA(e,t,r);return BA(new MA.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,(0,MA.int)(r),t.timeZoneOffsetSeconds,e),n,o)},toStructure:function(e){var t=UA(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=FA(r,i,o),n=UA(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i),i=i.subtract(n),n=FA(r,i,o),UA(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,MA.int)(e.nanosecond),i=e.timeZoneId;return new kA.structure.Structure(105,[n,o,i])}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return NA.default.createDateTimeWithOffsetTransformer(e).extendsWith({signature:73,toStructure:function(e){var t=UA(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,MA.int)(e.nanosecond),e=(0,MA.int)(e.timeZoneOffsetSeconds),t=t.subtract(e);return new kA.structure.Structure(73,[t,r,e])},fromStructure:function(e){kA.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=AA(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,MA.int)(t).add(e),t=(0,xA.epochSecondAndNanoToLocalDateTime)(t,r);return BA(new MA.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}};var WA,qA,as=r&&r.__extends||(WA=function(e,t){return(WA=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}WA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),zA=r&&r.__assign||function(){return(zA=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)},hs=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Q=(Object.defineProperty(Dr,"__esModule",{value:!0}),hs(Pg)),VA=hs(p),HA=R,GA=ry,YA=hs(o),KA=hs(ks),ZA=hs(Vv),XA=e.internal.bookmarks.Bookmarks,QA=e.internal.constants.BOLT_PROTOCOL_V4_3,T=(qA=Q.default,as(JA,qA),Object.defineProperty(JA.prototype,"version",{get:function(){return QA},enumerable:!1,configurable:!0}),Object.defineProperty(JA.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new ZA.default(Object.values(YA.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),JA.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 HA.RouteObserver({onProtocolError:this._onProtocolError,onError:o,onCompleted:e}),e=n.bookmarks||XA.empty();return this.write(VA.default.route(t,e.values(),r),o,!0),o},JA.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new HA.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return void 0!==e.patch_bolt&&t._applyPatches(e.patch_bolt),t._onLoginCompleted(e,n,u)}});return(0,GA.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(VA.default.hello(r,n,this._serversideRouting,["utc"]),e,!0),e},JA.prototype._applyPatches=function(e){e.includes("utc")&&this._applyUtcPatch()},JA.prototype._applyUtcPatch=function(){var t=this;this._transformer=new ZA.default(Object.values(zA(zA({},YA.default),KA.default)).map(function(e){return e(t._config,t._log)}))},JA);function JA(){return null!==qA&&qA.apply(this,arguments)||this}Dr.default=T;var $A,ek,jc={},jl=r&&r.__extends||($A=function(e,t){return($A=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}$A(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),tk=r&&r.__assign||function(){return(tk=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)},Qe=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gc=(Object.defineProperty(jc,"__esModule",{value:!0}),Qe(Dr)),hl=e,rk=Qe(p),nk=R,ok=ry,ik=Qe(us),uk=Qe(ks),ak=Qe(Vv),wc=hl.internal.constants,sk=wc.BOLT_PROTOCOL_V4_4,ck=wc.FETCH_ALL,lk=hl.internal.bookmarks.Bookmarks,Cc=(ek=gc.default,jl(fk,ek),Object.defineProperty(fk.prototype,"version",{get:function(){return sk},enumerable:!1,configurable:!0}),Object.defineProperty(fk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new ak.default(Object.values(ik.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),fk.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 nk.RouteObserver({onProtocolError:this._onProtocolError,onError:i,onCompleted:e}),e=o.bookmarks||lk.empty();return this.write(rk.default.routeV4x4(t,e.values(),{databaseName:r,impersonatedUser:n}),i,!0),i},fk.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.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?ck:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new nk.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=((0,ok.assertNotificationFilterIsEmpty)(s,this._onProtocolError,c),y);return this.write(rk.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a}),c,l&&b),y||this.write(rk.default.pull({n:_}),c,b),c},fk.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.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new nk.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),(0,ok.assertNotificationFilterIsEmpty)(u,this._onProtocolError,a),this.write(rk.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i}),a,!0),a},fk.prototype._applyUtcPatch=function(){var t=this;this._transformer=new ak.default(Object.values(tk(tk({},ik.default),uk.default)).map(function(e){return e(t._config,t._log)}))},fk);function fk(){return null!==ek&&ek.apply(this,arguments)||this}jc.default=Cc;var Ar={},Sc={},pk=r&&r.__assign||function(){return(pk=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)},dk=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},kf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hk=(Object.defineProperty(Sc,"__esModule",{value:!0}),z_),bk=e,yk=kf(us),Ff=kf(ks);Sc.default=pk(pk(pk({},yk.default),Ff.default),{createNodeTransformer:function(e){return yk.default.createNodeTransformer(e).extendsWith({fromStructure:function(e){hk.structure.verifyStructSize("Node",4,e.size);var e=dk(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new bk.Node(t,r,n,e)}})},createRelationshipTransformer:function(e){return yk.default.createRelationshipTransformer(e).extendsWith({fromStructure:function(e){hk.structure.verifyStructSize("Relationship",8,e.size);var e=dk(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 bk.Relationship(t,r,n,o,i,u,a,e)}})},createUnboundRelationshipTransformer:function(e){return yk.default.createUnboundRelationshipTransformer(e).extendsWith({fromStructure:function(e){hk.structure.verifyStructSize("UnboundRelationship",4,e.size);var e=dk(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new bk.UnboundRelationship(t,r,n,e)}})}});var _k,vk,mc=r&&r.__extends||(_k=function(e,t){return(_k=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}_k(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),gl=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},l=(Object.defineProperty(Ar,"__esModule",{value:!0}),gl(jc)),mk=ry,gk=gl(Sc),Ok=gl(Vv),wk=gl(p),Ek=R,Pk=e.internal.constants.BOLT_PROTOCOL_V5_0,dd=(vk=l.default,mc(Sk,vk),Object.defineProperty(Sk.prototype,"version",{get:function(){return Pk},enumerable:!1,configurable:!0}),Object.defineProperty(Sk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Ok.default(Object.values(gk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Sk.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new Ek.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,mk.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(wk.default.hello(r,n,this._serversideRouting),e,!0),e},Sk);function Sk(){return null!==vk&&vk.apply(this,arguments)||this}Ar.default=dd;var Tk,jk,Od={},Ed={},Ck=r&&r.__assign||function(){return(Ck=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)},Ud=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vc=(Object.defineProperty(Ed,"__esModule",{value:!0}),Ud(Sc)),Ad=(Ed.default=Ck({},vc.default),r&&r.__extends||(Tk=function(e,t){return(Tk=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}Tk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Ik=r&&r.__assign||function(){return(Ik=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)},$p=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Bd=(Object.defineProperty(Od,"__esModule",{value:!0}),$p(Ar)),Rk=ry,Ak=$p(Ed),kk=$p(Vv),Mk=$p(p),Nk=R,xk=e.internal.constants.BOLT_PROTOCOL_V5_1,_c=(jk=Bd.default,Ad(Dk,jk),Object.defineProperty(Dk.prototype,"version",{get:function(){return xk},enumerable:!1,configurable:!0}),Object.defineProperty(Dk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new kk.default(Object.values(Ak.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(Dk.prototype,"supportsReAuth",{get:function(){return!0},enumerable:!1,configurable:!0}),Dk.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,a={},e=new Nk.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return a.metadata=e,t._onLoginCompleted(e)}});return(0,Rk.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(Mk.default.hello5x1(r,this._serversideRouting),e,!1),this.logon({authToken:n,onComplete:function(e){return u(Ik(Ik({},e),a.metadata))},onError:i,flush:!0})},Dk.prototype.logon=function(e){var t=this,e=void 0===e?{}:e,r=e.authToken,n=e.onComplete,o=e.onError,e=e.flush,i=new Nk.LoginObserver({onCompleted:function(){return t._onLoginCompleted(null,r,n)},onError:function(e){return t._onLoginError(e,o)}});return this.write(Mk.default.logon(r),i,e),i},Dk.prototype.logoff=function(e){var e=void 0===e?{}:e,t=e.onComplete,r=e.onError,e=e.flush,t=new Nk.LogoffObserver({onCompleted:t,onError:r});return this.write(Mk.default.logoff(),t,e),t},Dk);function Dk(){return null!==jk&&jk.apply(this,arguments)||this}Od.default=_c;var Uk,Lk,y={},pd={},Fk=r&&r.__assign||function(){return(Fk=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)},Pp=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Vd=(Object.defineProperty(pd,"__esModule",{value:!0}),Pp(Ed)),$d=(pd.default=Fk({},Vd.default),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)})),Bk=r&&r.__assign||function(){return(Bk=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)},j=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},E=(Object.defineProperty(y,"__esModule",{value:!0}),j(Od)),Wk=j(pd),qk=j(Vv),zk=j(p),Vk=R,I=e.internal.constants,Hk=I.BOLT_PROTOCOL_V5_2,Gk=I.FETCH_ALL,Pd=(Lk=E.default,$d(Yk,Lk),Object.defineProperty(Yk.prototype,"version",{get:function(){return Hk},enumerable:!1,configurable:!0}),Object.defineProperty(Yk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new qk.default(Object.values(Wk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(Yk.prototype,"supportsReAuth",{get:function(){return!0},enumerable:!1,configurable:!0}),Yk.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,a={},e=new Vk.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return a.metadata=e,t._onLoginCompleted(e)}});return this.write(zk.default.hello5x2(r,o,this._serversideRouting),e,!1),this.logon({authToken:n,onComplete:function(e){return u(Bk(Bk({},e),a.metadata))},onError:i,flush:!0})},Yk.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.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new Vk.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),this.write(zk.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u}),a,!0),a},Yk.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.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?Gk:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new Vk.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=y;return this.write(zk.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a,notificationFilter:s}),c,l&&b),y||this.write(zk.default.pull({n:_}),c,b),c},Yk);function Yk(){return null!==Lk&&Lk.apply(this,arguments)||this}y.default=Pd;var Kk,Zk,oh={},sh={},Xk=r&&r.__assign||function(){return(Xk=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)},fc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},vh=(Object.defineProperty(sh,"__esModule",{value:!0}),fc(pd)),eh=(sh.default=Xk({},vh.default),r&&r.__extends||(Kk=function(e,t){return(Kk=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}Kk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Qk=r&&r.__assign||function(){return(Qk=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)},jh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},dh=(Object.defineProperty(oh,"__esModule",{value:!0}),jh(y)),Jk=jh(sh),$k=jh(Vv),eM=jh(p),tM=R,rM=e.internal.constants.BOLT_PROTOCOL_V5_3,xh=(Zk=dh.default,eh(nM,Zk),Object.defineProperty(nM.prototype,"version",{get:function(){return rM},enumerable:!1,configurable:!0}),Object.defineProperty(nM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new $k.default(Object.values(Jk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),nM.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.boltAgent,o=e.authToken,i=e.notificationFilter,u=e.onError,a=e.onComplete,s={},e=new tM.LoginObserver({onError:function(e){return t._onLoginError(e,u)},onCompleted:function(e){return s.metadata=e,t._onLoginCompleted(e)}});return this.write(eM.default.hello5x3(r,n,i,this._serversideRouting),e,!1),this.logon({authToken:o,onComplete:function(e){return a(Qk(Qk({},e),s.metadata))},onError:u,flush:!0})},nM);function nM(){return null!==Zk&&Zk.apply(this,arguments)||this}oh.default=xh;var oM,iM,Vh={},cb={},uM=r&&r.__assign||function(){return(uM=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)},Hh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bf=(Object.defineProperty(cb,"__esModule",{value:!0}),Hh(sh)),Pb=(cb.default=uM({},bf.default),r&&r.__extends||(oM=function(e,t){return(oM=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}oM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Jf=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},jb=(Object.defineProperty(Vh,"__esModule",{value:!0}),Jf(oh)),aM=Jf(cb),sM=Jf(p),cM=R,lM=Jf(Vv),fM=e.internal.constants.BOLT_PROTOCOL_V5_4,Nf=(iM=jb.default,Pb(pM,iM),Object.defineProperty(pM.prototype,"version",{get:function(){return fM},enumerable:!1,configurable:!0}),Object.defineProperty(pM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new lM.default(Object.values(aM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),pM.prototype.telemetry=function(e,t){var e=e.api,t=void 0===t?{}:t,r=t.onError,t=t.onCompleted,t=new cM.TelemetryObserver({onCompleted:t,onError:r});return this.write(sM.default.telemetry({api:e}),t,!1),t},pM);function pM(){return null!==iM&&iM.apply(this,arguments)||this}Vh.default=Nf;var dM,hM,Cb={},_p={},bM=r&&r.__assign||function(){return(bM=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)},Fb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hd=(Object.defineProperty(_p,"__esModule",{value:!0}),Fb(cb)),Bh=(_p.default=bM({},hd.default),r&&r.__extends||(dM=function(e,t){return(dM=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}dM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),yM=r&&r.__assign||function(){return(yM=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)},yc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},sb=(Object.defineProperty(Cb,"__esModule",{value:!0}),yc(Vh)),_M=yc(_p),vM=yc(Vv),mM=yc(p),gM=R,Lb=e.internal.constants,OM=Lb.BOLT_PROTOCOL_V5_5,wM=Lb.FETCH_ALL,EM=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),Iy=(hM=sb.default,Bh(PM,hM),Object.defineProperty(PM.prototype,"version",{get:function(){return OM},enumerable:!1,configurable:!0}),Object.defineProperty(PM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new vM.default(Object.values(_M.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),PM.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.boltAgent,o=e.authToken,i=e.notificationFilter,u=e.onError,a=e.onComplete,s={},e=new gM.LoginObserver({onError:function(e){return t._onLoginError(e,u)},onCompleted:function(e){return s.metadata=e,t._onLoginCompleted(e)}});return this.write(mM.default.hello5x5(r,n,i,this._serversideRouting),e,!1),this.logon({authToken:o,onComplete:function(e){return a(yM(yM({},e),s.metadata))},onError:u,flush:!0})},PM.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.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new gM.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),this.write(mM.default.begin5x5({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u}),a,!0),a},PM.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.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?wM:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new gM.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r,enrichMetadata:this._enrichMetadata}),l=y;return this.write(mM.default.runWithMetadata5x5(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a,notificationFilter:s}),c,l&&b),y||this.write(mM.default.pull({n:_}),c,b),c},PM.prototype._enrichMetadata=function(e){return Array.isArray(e.statuses)&&(e.statuses=e.statuses.map(function(e){return yM(yM({},e),{description:null!=e.neo4j_code?e.status_description:e.description,diagnostic_record:null!==e.diagnostic_record?yM(yM({},EM),e.diagnostic_record):null})})),e},PM);function PM(){return null!==hM&&hM.apply(this,arguments)||this}Cb.default=Iy;var SM,TM,Sy={},Ny=r&&r.__extends||(SM=function(e,t){return(SM=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}SM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),jM=r&&r.__assign||function(){return(jM=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)},n_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Jy=(Object.defineProperty(Sy,"__esModule",{value:!0}),n_(Cb)),CM=n_(_p),IM=n_(Vv),RM=e.internal.constants.BOLT_PROTOCOL_V5_6,AM=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),a_=(TM=Jy.default,Ny(kM,TM),Object.defineProperty(kM.prototype,"version",{get:function(){return RM},enumerable:!1,configurable:!0}),Object.defineProperty(kM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new IM.default(Object.values(CM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),kM.prototype._enrichMetadata=function(e){return Array.isArray(e.statuses)&&(e.statuses=e.statuses.map(function(e){return jM(jM({},e),{diagnostic_record:null!==e.diagnostic_record?jM(jM({},AM),e.diagnostic_record):null})})),e},kM);function kM(){return null!==TM&&TM.apply(this,arguments)||this}Sy.default=a_;var Sd={},MM=(Object.defineProperty(Sd,"__esModule",{value:!0}),e);function NM(){}function xM(e){return e}var DM={onNext:NM,onCompleted:NM,onError:NM};function UM(e){var e=void 0===e?{}:e,t=e.transformMetadata,r=e.log,e=e.observer;this._pendingObservers=[],this._log=r,this._transformMetadata=t||xM,this._observer=Object.assign({onObserversCountChange:NM,onError:NM,onFailure:NM,onErrorApplyTransformation:xM},e)}Object.defineProperty(UM.prototype,"currentFailure",{get:function(){return this._currentFailure},enumerable:!1,configurable:!0}),UM.prototype.handleResponse=function(e){var t=e.fields[0];switch(e.signature){case 113:this._log.isDebugEnabled()&&this._log.debug("S: RECORD ".concat(MM.json.stringify(e))),this._currentObserver.onNext(t);break;case 112:this._log.isDebugEnabled()&&this._log.debug("S: SUCCESS ".concat(MM.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(MM.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,MM.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(MM.json.stringify(e)));try{this._currentFailure&&this._currentObserver.onError?this._currentObserver.onError(this._currentFailure):this._currentObserver.onError&&this._currentObserver.onError((0,MM.newError)("Ignored either because of an error or RESET"))}finally{this._updateCurrentObserver()}break;default:this._observer.onError((0,MM.newError)("Unknown Bolt protocol message: "+e))}},UM.prototype._updateCurrentObserver=function(){this._currentObserver=this._pendingObservers.shift(),this._observer.onObserversCountChange(this._observersCount)},Object.defineProperty(UM.prototype,"_observersCount",{get:function(){return null==this._currentObserver?this._pendingObservers.length:this._pendingObservers.length+1},enumerable:!1,configurable:!0}),UM.prototype._queueObserver=function(e){return(e=e||DM).onCompleted=e.onCompleted||NM,e.onError=e.onError||NM,e.onNext=e.onNext||NM,void 0===this._currentObserver?this._currentObserver=e:this._pendingObservers.push(e),this._observer.onObserversCountChange(this._observersCount),!0},UM.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)}},UM.prototype.hasOngoingObservableRequests=function(){return null!=this._currentObserver||0<this._pendingObservers.length},UM.prototype._resetFailure=function(){this._currentFailure=null},Sd.default=UM;var LM,v_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},FM=(Object.defineProperty(Yb,"__esModule",{value:!0}),e),BM=v_(Jb),WM=v_(om),qM=v_(r0),zM=v_(I0),VM=v_(b),HM=v_(Pg),GM=v_(Dr),YM=v_(jc),KM=v_(Ar),ZM=v_(Od),XM=v_(y),QM=v_(oh),JM=v_(Vh),$M=v_(Cb),e2=v_(Sy),t2=v_(Sd);Yb.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 t2.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 BM.default(p,d,h,y,v,_);case 2:return new WM.default(p,d,h,y,v,_);case 3:return new qM.default(p,d,h,y,v,_);case 4:return new zM.default(p,d,h,y,v,_);case 4.1:return new VM.default(p,d,h,y,v,_,b);case 4.2:return new HM.default(p,d,h,y,v,_,b);case 4.3:return new GM.default(p,d,h,y,v,_,b);case 4.4:return new YM.default(p,d,h,y,v,_,b);case 5:return new KM.default(p,d,h,y,v,_,b);case 5.1:return new ZM.default(p,d,h,y,v,_,b);case 5.2:return new XM.default(p,d,h,y,v,_,b);case 5.3:return new QM.default(p,d,h,y,v,_,b);case 5.4:return new JM.default(p,d,h,y,v,_,b);case 5.5:return new $M.default(p,d,h,y,v,_,b);case 5.6:return new e2.default(p,d,h,y,v,_,b);default:throw(0,FM.newError)("Unknown Bolt protocol version: "+f)}},g_=w,LM=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]}),P_=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||LM(t,e,r)},j_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(g_,"__esModule",{value:!0}),g_.RawRoutingTable=g_.BoltProtocol=void 0,b_=j_(Qf),N_=j_(Yb),ly=j_(Dr),j_=j_(iy),P_(R,g_),g_.BoltProtocol=ly.default,g_.RawRoutingTable=j_.default,g_.default={handshake:b_.default,create:N_.default};var r2,u_={},s_={},B_=r&&r.__extends||(r2=function(e,t){return(r2=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}r2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(s_,"__esModule",{value:!0});B_(o2,n2=e.ConnectionProvider),o2.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 n2,tv=o2;function o2(e){var t=n2.call(this)||this;return t._connection=e,t}s_.default=tv;var i2,$f={},ep={},sv={},bv=r&&r.__extends||(i2=function(e,t){return(i2=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}i2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(sv,"__esModule",{value:!0});bv(a2,u2=e.Connection),Object.defineProperty(a2.prototype,"id",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"databaseId",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"authToken",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"supportsReAuth",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"creationTimestamp",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"idleTimestamp",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),a2.prototype.protocol=function(){throw new Error("not implemented")},Object.defineProperty(a2.prototype,"address",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"version",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(a2.prototype,"server",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),a2.prototype.connect=function(e,t,r,n){throw new Error("not implemented")},a2.prototype.write=function(e,t,r){throw new Error("not implemented")},a2.prototype.close=function(){throw new Error("not implemented")},a2.prototype.handleAndTransformError=function(e,t){return this._errorHandler?this._errorHandler.handleAndTransformError(e,t,this):e};var u2,cv=a2;function a2(e){var t=u2.call(this)||this;return t._errorHandler=e,t}sv.default=cv;var s2,yf={},tp=r&&r.__extends||(s2=function(e,t){return(s2=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}s2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c2=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())})},l2=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}}}},iv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},f2=(Object.defineProperty(yf,"__esModule",{value:!0}),yf.createChannelConnection=void 0,yp),p2=e,pv=iv(sv),d2=iv(w),h2=p2.error.PROTOCOL_ERROR,b2=p2.internal.logger.Logger,y2=0;yf.createChannelConnection=function(i,u,a,s,e,c,t){void 0===c&&(c=null);var l=(t=void 0===t?function(e){return new f2.Channel(e)}:t)(new f2.ChannelConfig(i,u,a.errorCode(),e));return d2.default.handshake(l,s).then(function(e){var r=e.protocolVersion,e=e.consumeRemainingBuffer,n=new f2.Chunker(l),o=new f2.Dechunker,t=new v2(l,a,i,s,u.disableLosslessIntegers,c,n,u.notificationFilter,function(t){return d2.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:{onObserversCountChange: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)}}})},u.telemetryDisabled);return e(function(e){return o.write(e)}),t}).catch(function(e){return l.close().then(function(){throw e})})};_2=pv.default,tp(m2,_2),m2.prototype.beginTransaction=function(e){return this._sendTelemetryIfEnabled(e),this._protocol.beginTransaction(e)},m2.prototype.run=function(e,t,r){return this._sendTelemetryIfEnabled(r),this._protocol.run(e,t,r)},m2.prototype._sendTelemetryIfEnabled=function(e){this._telemetryDisabledConnection||this._telemetryDisabledDriverConfig||null==e||null==e.apiTelemetryConfig||this._protocol.telemetry({api:e.apiTelemetryConfig.api},{onCompleted:e.apiTelemetryConfig.onTelemetrySuccess,onError:e.beforeError})},m2.prototype.commitTransaction=function(e){return this._protocol.commitTransaction(e)},m2.prototype.rollbackTransaction=function(e){return this._protocol.rollbackTransaction(e)},m2.prototype.getProtocolVersion=function(){return this._protocol.version},Object.defineProperty(m2.prototype,"authToken",{get:function(){return this._authToken},set:function(e){this._authToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(m2.prototype,"supportsReAuth",{get:function(){return this._protocol.supportsReAuth},enumerable:!1,configurable:!0}),Object.defineProperty(m2.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(m2.prototype,"databaseId",{get:function(){return this._dbConnectionId},set:function(e){this._dbConnectionId=e},enumerable:!1,configurable:!0}),Object.defineProperty(m2.prototype,"idleTimestamp",{get:function(){return this._idleTimestamp},set:function(e){this._idleTimestamp=e},enumerable:!1,configurable:!0}),Object.defineProperty(m2.prototype,"creationTimestamp",{get:function(){return this._creationTimestamp},enumerable:!1,configurable:!0}),m2.prototype.connect=function(t,n,o,i){return c2(this,void 0,void 0,function(){var r=this;return l2(this,function(e){switch(e.label){case 0:if(this._protocol.initialized&&!this._protocol.supportsReAuth)throw(0,p2.newError)("Connection does not support re-auth");return this._authToken=o,this._protocol.initialized?[3,2]:[4,this._initialize(t,n,o)];case 1:return[2,e.sent()];case 2:return i?[4,new Promise(function(e,t){r._protocol.logoff({onError:t}),r._protocol.logon({authToken:o,onError:t,onComplete:function(){return e(r)},flush:!0})})]:[3,4];case 3:return[2,e.sent()];case 4:return this._protocol.logoff(),this._protocol.logon({authToken:o,flush:!0}),[2,this]}})})},m2.prototype._initialize=function(e,n,o){var i=this,u=this;return new Promise(function(r,t){i._protocol.initialize({userAgent:e,boltAgent:n,authToken:o,notificationFilter:i._notificationFilter,onError:function(e){return t(e)},onComplete:function(e){var t;e&&(t=e.server,i.version&&!t||(i.version=t),t=e.connection_id,i.databaseId||(i.databaseId=t),e.hints&&(null!=(t=e.hints["connection.recv_timeout_seconds"])&&(t=(0,p2.toNumber)(t),Number.isInteger(t)&&0<t?i._ch.setupReceiveTimeout(1e3*t):i._log.info("Server located at ".concat(i._address," supplied an invalid connection receive timeout value (").concat(t,"). ")+"Please, verify the server configuration and status because this can be the symptom of a bigger issue.")),!0===e.hints["telemetry.enabled"]&&(i._telemetryDisabledConnection=!1))),r(u)}})})},m2.prototype.protocol=function(){return this._protocol},Object.defineProperty(m2.prototype,"address",{get:function(){return this._address},enumerable:!1,configurable:!0}),Object.defineProperty(m2.prototype,"version",{get:function(){return this._server.version},set:function(e){this._server.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(m2.prototype,"server",{get:function(){return this._server},enumerable:!1,configurable:!0}),Object.defineProperty(m2.prototype,"logger",{get:function(){return this._log},enumerable:!1,configurable:!0}),m2.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(p2.json.stringify(this._error),")")),this._protocol.notifyFatalError(this._error)},m2.prototype._setIdle=function(e){this._idle=!0,this._ch.stopReceiveTimeout(),this._protocol.queueObserverIfProtocolIsNotBroken(e)},m2.prototype._unsetIdle=function(){this._idle=!1,this._updateCurrentObserver()},m2.prototype._queueObserver=function(e){return this._protocol.queueObserverIfProtocolIsNotBroken(e)},m2.prototype.hasOngoingObservableRequests=function(){return!this._idle&&this._protocol.hasOngoingObservableRequests()},m2.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()}})})},m2.prototype._resetOnFailure=function(){var e=this;this.isOpen()&&this._reset({onError:function(){e._protocol.resetFailure()},onComplete:function(){e._protocol.resetFailure()}})},m2.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()})}}))},m2.prototype._updateCurrentObserver=function(){this._protocol.updateCurrentObserver()},m2.prototype.isOpen=function(){return!this._isBroken&&this._ch._open},m2.prototype._handleOngoingRequestsNumberChange=function(e){this._idle||(0===e?this._ch.stopReceiveTimeout():this._ch.startReceiveTimeout())},m2.prototype.close=function(){return c2(this,void 0,void 0,function(){return l2(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]}})})},m2.prototype.toString=function(){return"Connection [".concat(this.id,"][").concat(this.databaseId||"","]")},m2.prototype._handleProtocolError=function(e){this._protocol.resetFailure(),this._updateCurrentObserver();e=(0,p2.newError)(e,h2);return this._handleFatalError(e),e};var _2,v2=m2;function m2(e,t,r,n,o,i,u,a,s,c){void 0===o&&(o=!1),void 0===i&&(i=null);var l,f,t=_2.call(this,t)||this;return t._authToken=null,t._idle=!1,t._reseting=!1,t._resetObservers=[],t._id=y2++,t._address=r,t._server={address:r.asHostPort()},t._creationTimestamp=Date.now(),t._disableLosslessIntegers=o,t._ch=e,t._chunker=u,t._log=(l=t,new b2((f=n)._level,function(e,t){return f._loggerFunction(e,"".concat(l," ").concat(t))})),t._serversideRouting=i,t._notificationFilter=a,t._telemetryDisabledDriverConfig=!0===c,t._telemetryDisabledConnection=!0,t._dbConnectionId=null,t._protocol=s(t),t._isBroken=!1,t._log.isDebugEnabled()&&t._log.debug("created towards ".concat(r)),t}yf.default=v2;var g2,O2,hy={},Iv=r&&r.__extends||(g2=function(e,t){return(g2=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}g2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Tv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Mv=(Object.defineProperty(hy,"__esModule",{value:!0}),Tv(sv)),Fv=(O2=Mv.default,Iv(w2,O2),w2.prototype.beginTransaction=function(e){return this._delegate.beginTransaction(e)},w2.prototype.run=function(e,t,r){return this._delegate.run(e,t,r)},w2.prototype.commitTransaction=function(e){return this._delegate.commitTransaction(e)},w2.prototype.rollbackTransaction=function(e){return this._delegate.rollbackTransaction(e)},w2.prototype.getProtocolVersion=function(){return this._delegate.getProtocolVersion()},Object.defineProperty(w2.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(w2.prototype,"databaseId",{get:function(){return this._delegate.databaseId},set:function(e){this._delegate.databaseId=e},enumerable:!1,configurable:!0}),Object.defineProperty(w2.prototype,"server",{get:function(){return this._delegate.server},enumerable:!1,configurable:!0}),Object.defineProperty(w2.prototype,"authToken",{get:function(){return this._delegate.authToken},set:function(e){this._delegate.authToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(w2.prototype,"supportsReAuth",{get:function(){return this._delegate.supportsReAuth},enumerable:!1,configurable:!0}),Object.defineProperty(w2.prototype,"address",{get:function(){return this._delegate.address},enumerable:!1,configurable:!0}),Object.defineProperty(w2.prototype,"version",{get:function(){return this._delegate.version},set:function(e){this._delegate.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(w2.prototype,"creationTimestamp",{get:function(){return this._delegate.creationTimestamp},enumerable:!1,configurable:!0}),Object.defineProperty(w2.prototype,"idleTimestamp",{get:function(){return this._delegate.idleTimestamp},set:function(e){this._delegate.idleTimestamp=e},enumerable:!1,configurable:!0}),w2.prototype.isOpen=function(){return this._delegate.isOpen()},w2.prototype.protocol=function(){return this._delegate.protocol()},w2.prototype.connect=function(e,t,r,n){return this._delegate.connect(e,t,r,n)},w2.prototype.write=function(e,t,r){return this._delegate.write(e,t,r)},w2.prototype.resetAndFlush=function(){return this._delegate.resetAndFlush()},w2.prototype.hasOngoingObservableRequests=function(){return this._delegate.hasOngoingObservableRequests()},w2.prototype.close=function(){return this._delegate.close()},w2.prototype.release=function(){return this._originalErrorHandler&&(this._delegate._errorHandler=this._originalErrorHandler),this._delegate.release()},w2);function w2(e,t){var r=O2.call(this,t)||this;return t&&(r._originalErrorHandler=e._errorHandler,e._errorHandler=r._errorHandler),r._delegate=e,r}hy.default=Fv;S={};Object.defineProperty(S,"__esModule",{value:!0});var E2,P2,S2,T2=e.error.SERVICE_UNAVAILABLE,j2=e.error.SESSION_EXPIRED;function C2(e,t,r,n){this._errorCode=e,this._handleUnavailability=t||I2,this._handleWriteFailure=r||I2,this._handleSecurityError=n||I2}function I2(e){return e}C2.create=function(e){return new C2(e.errorCode,e.handleUnavailability,e.handleWriteFailure,e.handleSecurityError)},C2.prototype.errorCode=function(){return this._errorCode},C2.prototype.handleAndTransformError=function(e,t,r){return null!=(n=e)&&null!=n.code&&n.code.startsWith("Neo.ClientError.Security.")?this._handleSecurityError(e,t,r):function(e){if(e)return e.code===j2||e.code===T2||"Neo.TransientError.General.DatabaseUnavailable"===e.code;return}(e)?this._handleUnavailability(e,t,r):function(e){if(e)return"Neo.ClientError.Cluster.NotALeader"===e.code||"Neo.ClientError.General.ForbiddenOnReadOnlyDatabase"===e.code;return}(e)?this._handleWriteFailure(e,t,r):e;var n},S.default=C2,Kv=ep,E2=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]}),P2=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Qv=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)&&E2(t,e,r);return P2(t,e),t},em=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Kv,"__esModule",{value:!0}),Kv.createChannelConnection=Kv.ConnectionErrorHandler=Kv.DelegateConnection=Kv.ChannelConnection=Kv.Connection=void 0,f=em(sv),Kv.Connection=f.default,S2=Qv(yf),Kv.ChannelConnection=S2.default,Object.defineProperty(Kv,"createChannelConnection",{enumerable:!0,get:function(){return S2.createChannelConnection}}),Qv=em(hy),Kv.DelegateConnection=Qv.default,Qv=em(S),Kv.ConnectionErrorHandler=Qv.default,Kv.default=f.default;var ym={},R2=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())})},A2=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}}}},k2=(Object.defineProperty(ym,"__esModule",{value:!0}),e),M2=Fy;function N2(e){var t=e.authTokenManager,r=e.userAgent,e=e.boltAgent;this._authTokenManager=t||(0,k2.staticAuthTokenManager)({}),this._userAgent=r,this._boltAgent=e}N2.prototype.authenticate=function(e){var r=e.connection,n=e.auth,o=e.skipReAuth,i=e.waitReAuth,u=e.forceReAuth;return R2(this,void 0,void 0,function(){var t;return A2(this,function(e){switch(e.label){case 0:return null==n?[3,3]:(t=!0===r.supportsReAuth&&(!M2.object.equals(r.authToken,n)&&!0!==o||!0===u),null==r.authToken||t?[4,r.connect(this._userAgent,this._boltAgent,n,i||!1)]:[3,2]);case 1:return[2,e.sent()];case 2:return[2,r];case 3:return[4,this._authTokenManager.getToken()];case 4:return t=e.sent(),M2.object.equals(t,r.authToken)?[3,6]:[4,r.connect(this._userAgent,this._boltAgent,t,!1)];case 5:return[2,e.sent()];case 6:return[2,r]}})})},N2.prototype.handleError=function(e){var t=e.connection,e=e.code;return!(!t||!e.startsWith("Neo.ClientError.Security."))&&this._authTokenManager.handleSecurityException(t.authToken,e)},ym.default=N2;var Om={},x2=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())})},D2=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 U2(e){e=e.connectionLivenessCheckTimeout;this._connectionLivenessCheckTimeout=e}Object.defineProperty(Om,"__esModule",{value:!0}),U2.prototype.check=function(r){return x2(this,void 0,void 0,function(){var t;return D2(this,function(e){switch(e.label){case 0:return this._isCheckDisabled||this._isNewlyCreatedConnection(r)?[2,!0]:(t=Date.now()-r.idleTimestamp,0===this._connectionLivenessCheckTimeout||t>this._connectionLivenessCheckTimeout?[4,r.resetAndFlush().then(function(){return!0})]:[3,2]);case 1:return[2,e.sent()];case 2:return[2,!0]}})})},Object.defineProperty(U2.prototype,"_isCheckDisabled",{get:function(){return null==this._connectionLivenessCheckTimeout||this._connectionLivenessCheckTimeout<0},enumerable:!1,configurable:!0}),U2.prototype._isNewlyCreatedConnection=function(e){return null==e.authToken},Om.default=U2;var qv={},L2=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())})},F2=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}}}},B2=(Object.defineProperty(qv,"__esModule",{value:!0}),yp);function W2(e){var t=e.clientCertificateProvider,e=e.loader;this._clientCertificateProvider=t,this._loader=e||B2.ClientCertificatesLoader,this._clientCertificate=null}W2.prototype.getClientCertificate=function(){return L2(this,void 0,void 0,function(){var t,r,n=this;return F2(this,function(e){switch(e.label){case 0:return(t=null!=this._clientCertificateProvider)?(r=null==this._clientCertificate)?[3,2]:[4,this._clientCertificateProvider.hasUpdate()]:[3,3];case 1:r=e.sent(),e.label=2;case 2:t=r,e.label=3;case 3:return t&&(this._clientCertificate=Promise.resolve(this._clientCertificateProvider.getClientCertificate()).then(this._loader.load).then(function(e){return n._clientCertificate=e,n._clientCertificate}).catch(function(e){throw n._clientCertificate=null,e})),[2,this._clientCertificate]}})})},qv.default=W2;var q2,z2,O=r&&r.__extends||(q2=function(e,t){return(q2=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}q2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),V2=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())})},H2=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}}}},G2=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},Y2=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))},jm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},K2=(Object.defineProperty($f,"__esModule",{value:!0}),ep),Z2=e,X2=jm(ym),Q2=Fy,J2=jm(Om),$2=jm(qv),eN=Z2.error.SERVICE_UNAVAILABLE,tN=["Neo.ClientError.Security.CredentialsExpired","Neo.ClientError.Security.Forbidden","Neo.ClientError.Security.TokenExpired","Neo.ClientError.Security.Unauthorized"],Um=Z2.internal.pool,rN=Um.Pool,nN=Um.PoolConfig,Kh=(z2=Z2.ConnectionProvider,O(oN,z2),oN.prototype._createConnectionErrorHandler=function(){return new K2.ConnectionErrorHandler(eN)},oN.prototype._getClientCertificate=function(){return V2(this,void 0,void 0,function(){return H2(this,function(e){return[2,this._config.clientCertificate.getClientCertificate()]})})},oN.prototype._createConnection=function(e,r,n){var o=this,i=e.auth;return this._createChannelConnection(r).then(function(t){return t.release=function(){return t.idleTimestamp=Date.now(),n(r,t)},o._openConnections[t.id]=t,o._authenticationProvider.authenticate({connection:t,auth:i}).catch(function(e){throw o._destroyConnection(t),e})})},oN.prototype._validateConnectionOnAcquire=function(e,r){var n=e.auth,o=e.skipReAuth;return V2(this,void 0,void 0,function(){var t;return H2(this,function(e){switch(e.label){case 0:if(!this._validateConnection(r))return[2,!1];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this._livenessCheckProvider.check(r)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this._log.debug("The connection ".concat(r.id," is not alive because of an error ").concat(t.code," '").concat(t.message,"'")),[2,!1];case 4:return e.trys.push([4,6,,7]),[4,this._authenticationProvider.authenticate({connection:r,auth:n,skipReAuth:o})];case 5:return e.sent(),[2,!0];case 6:return t=e.sent(),this._log.debug("The connection ".concat(r.id," is not valid because of an error ").concat(t.code," '").concat(t.message,"'")),[2,!1];case 7:return[2]}})})},oN.prototype._validateConnectionOnRelease=function(e){return!0!==e._sticky&&this._validateConnection(e)},oN.prototype._validateConnection=function(e){return!!e.isOpen()&&!(this._config.maxConnectionLifetime<Date.now()-e.creationTimestamp)},oN.prototype._destroyConnection=function(e){return delete this._openConnections[e.id],e.close()},oN.prototype._verifyConnectivityAndGetServerVersion=function(e){var n=e.address;return V2(this,void 0,void 0,function(){var t,r;return H2(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.acquire({},n)];case 1:t=e.sent(),r=new Z2.ServerInfo(t.server,t.protocol().version),e.label=2;case 2:return e.trys.push([2,,5,7]),t.protocol().isLastMessageLogon()?[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]}})})},oN.prototype._verifyAuthentication=function(e){var u=e.getAddress,a=e.auth;return V2(this,void 0,void 0,function(){var t,r,n,o,i;return H2(this,function(e){switch(e.label){case 0:t=[],e.label=1;case 1:return e.trys.push([1,8,9,11]),[4,u()];case 2:return r=e.sent(),[4,this._connectionPool.acquire({auth:a,skipReAuth:!0},r)];case 3:if(n=e.sent(),t.push(n),o=!n.protocol().isLastMessageLogon(),n.supportsReAuth)return o&&n.supportsReAuth?[4,this._authenticationProvider.authenticate({connection:n,auth:a,waitReAuth:!0,forceReAuth:!0})]:[3,5];throw(0,Z2.newError)("Driver is connected to a database that does not support user switch.");case 4:return e.sent(),[3,7];case 5:return!o||n.supportsReAuth?[3,7]:[4,this._connectionPool.acquire({auth:a},r,{requireNew:!0})];case 6:(i=e.sent())._sticky=!0,t.push(i),e.label=7;case 7:return[2,!0];case 8:if(i=e.sent(),tN.includes(i.code))return[2,!1];throw i;case 9:return[4,Promise.all(t.map(function(e){return e.release()}))];case 10:return e.sent(),[7];case 11:return[2]}})})},oN.prototype._verifyStickyConnection=function(e){var n=e.auth,o=e.connection;return e.address,V2(this,void 0,void 0,function(){var t,r;return H2(this,function(e){switch(e.label){case 0:return(t=Q2.object.equals(n,o.authToken),r=!t,o._sticky=t&&!o.supportsReAuth,r||o._sticky)?[4,o.release()]:[3,2];case 1:throw e.sent(),(0,Z2.newError)("Driver is connected to a database that does not support user switch.");case 2:return[2]}})})},oN.prototype.close=function(){return V2(this,void 0,void 0,function(){return H2(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]}})})},oN._installIdleObserverOnConnection=function(e,t){e._setIdle(t)},oN._removeIdleObserverOnConnection=function(e){e._unsetIdle()},oN.prototype._handleSecurityError=function(e,t,r){return this._authenticationProvider.handleError({connection:r,code:e.code})&&(e.retriable=!0),"Neo.ClientError.Security.AuthorizationExpired"===e.code&&this._connectionPool.apply(t,function(e){e.authToken=null}),r&&r.close().catch(function(){}),e},oN);function oN(e,t){var r=e.id,n=e.config,o=e.log,i=e.userAgent,u=e.boltAgent,a=e.authTokenManager,e=e.newPool,e=void 0===e?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(rN.bind.apply(rN,Y2([void 0],G2(e),!1)))}:e,s=(void 0===t&&(t=null),z2.call(this)||this);return s._id=r,s._config=n,s._log=o,s._clientCertificateHolder=new $2.default({clientCertificateProvider:s._config.clientCertificate}),s._authenticationProvider=new X2.default({authTokenManager:a,userAgent:i,boltAgent:u}),s._livenessCheckProvider=new J2.default({connectionLivenessCheckTimeout:n.connectionLivenessCheckTimeout}),s._userAgent=i,s._boltAgent=u,s._createChannelConnection=t||function(n){return V2(s,void 0,void 0,function(){var t,r;return H2(this,function(e){switch(e.label){case 0:return t=K2.createChannelConnection,r=[n,this._config,this._createConnectionErrorHandler(),this._log],[4,this._clientCertificateHolder.getClientCertificate()];case 1:return[2,t.apply(void 0,r.concat([e.sent()]))]}})})},s._connectionPool=e({create:s._createConnection.bind(s),destroy:s._destroyConnection.bind(s),validateOnAcquire:s._validateConnectionOnAcquire.bind(s),validateOnRelease:s._validateConnectionOnRelease.bind(s),installIdleObserver:oN._installIdleObserverOnConnection.bind(s),removeIdleObserver:oN._removeIdleObserverOnConnection.bind(s),config:nN.fromDriverConfig(n),log:s._log}),s._openConnections={},s}$f.default=Kh;var iN,uN,Wm={},km=r&&r.__extends||(iN=function(e,t){return(iN=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}iN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),aN=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())})},sN=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}}}},Km=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},f0=(Object.defineProperty(Wm,"__esModule",{value:!0}),Km($f)),cN=ep,Yh=e.internal.constants,lN=Yh.BOLT_PROTOCOL_V3,fN=Yh.BOLT_PROTOCOL_V4_0,pN=Yh.BOLT_PROTOCOL_V4_4,dN=Yh.BOLT_PROTOCOL_V5_1,hN=e.error.SERVICE_UNAVAILABLE,d0=(uN=f0.default,km(bN,uN),bN.prototype.acquireConnection=function(e){var e=void 0===e?{}:e,o=(e.accessMode,e.database),i=(e.bookmarks,e.auth),u=e.forceReAuth;return aN(this,void 0,void 0,function(){var t,r,n=this;return sN(this,function(e){switch(e.label){case 0:return t=cN.ConnectionErrorHandler.create({errorCode:hN,handleSecurityError:function(e,t,r){return n._handleSecurityError(e,t,r,o)}}),[4,this._connectionPool.acquire({auth:i,forceReAuth:u},this._address)];case 1:return(r=e.sent(),i)?[4,this._verifyStickyConnection({auth:i,connection:r,address:this._address})]:[3,3];case 2:return e.sent(),[2,r];case 3:return[2,new cN.DelegateConnection(r,t)]}})})},bN.prototype._handleSecurityError=function(e,t,r,n){return this._log.warn("Direct driver ".concat(this._id," will close connection to ").concat(t," for database '").concat(n,"' because of an error ").concat(e.code," '").concat(e.message,"'")),uN.prototype._handleSecurityError.call(this,e,t,r)},bN.prototype._hasProtocolVersion=function(n){return aN(this,void 0,void 0,function(){var t,r;return sN(this,function(e){switch(e.label){case 0:return[4,this._createChannelConnection(this._address)];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]}})})},bN.prototype.supportsMultiDb=function(){return aN(this,void 0,void 0,function(){return sN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return fN<=e})];case 1:return[2,e.sent()]}})})},bN.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},bN.prototype.supportsTransactionConfig=function(){return aN(this,void 0,void 0,function(){return sN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return lN<=e})];case 1:return[2,e.sent()]}})})},bN.prototype.supportsUserImpersonation=function(){return aN(this,void 0,void 0,function(){return sN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return pN<=e})];case 1:return[2,e.sent()]}})})},bN.prototype.supportsSessionAuth=function(){return aN(this,void 0,void 0,function(){return sN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return dN<=e})];case 1:return[2,e.sent()]}})})},bN.prototype.verifyAuthentication=function(e){var r=e.auth;return aN(this,void 0,void 0,function(){var t=this;return sN(this,function(e){return[2,this._verifyAuthentication({auth:r,getAddress:function(){return t._address}})]})})},bN.prototype.verifyConnectivityAndGetServerInfo=function(){return aN(this,void 0,void 0,function(){return sN(this,function(e){switch(e.label){case 0:return[4,this._verifyConnectivityAndGetServerVersion({address:this._address})];case 1:return[2,e.sent()]}})})},bN);function bN(e){var t=e.id,r=e.config,n=e.log,o=e.address,i=e.userAgent,u=e.boltAgent,a=e.authTokenManager,e=e.newPool,t=uN.call(this,{id:t,config:r,log:n,userAgent:i,boltAgent:u,authTokenManager:a,newPool:e})||this;return t._address=o,t}Wm.default=d0;var w0={},S0={},_0={},cl={},yN=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},_N=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))},vN=(Object.defineProperty(cl,"__esModule",{value:!0}),cl.createValidRoutingTable=void 0,e),D0=vN.internal.constants,mN=D0.ACCESS_MODE_WRITE,gN=D0.ACCESS_MODE_READ,ON=vN.internal.serverAddress.ServerAddress,wN=vN.error.PROTOCOL_ERROR,EN=(PN.fromRawRoutingTable=TN,PN.prototype.forget=function(e){this.readers=SN(this.readers,e),this.writers=SN(this.writers,e)},PN.prototype.forgetRouter=function(e){this.routers=SN(this.routers,e)},PN.prototype.forgetWriter=function(e){this.writers=SN(this.writers,e)},PN.prototype.isStaleFor=function(e){return this.expirationTime.lessThan(Date.now())||this.routers.length<1||e===gN&&0===this.readers.length||e===mN&&0===this.writers.length},PN.prototype.isExpiredFor=function(e){return this.expirationTime.add(e).lessThan(Date.now())},PN.prototype.allServers=function(){return _N(_N(_N([],yN(this.routers),!1),yN(this.readers),!1),yN(this.writers),!1)},PN.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,"]]")},PN);function PN(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,vN.int)(0),this.ttl=e}function SN(e,t){return e.filter(function(e){return e.asKey()!==t.asKey()})}function TN(e,t,r){var n=r.ttl,o=function(t,r){try{var e=(0,vN.int)(Date.now()),n=(0,vN.int)(t.ttl).multiply(1e3).add(e);return n.lessThan(e)?vN.Integer.MAX_VALUE:n}catch(e){throw(0,vN.newError)("Unable to parse TTL entry from router ".concat(r," from raw routing table:\n").concat(vN.json.stringify(t),"\nError message: ").concat(e.message),wN)}}(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=CN(e).map(function(e){return ON.fromUrl(e)}):"WRITE"===t?i=CN(e).map(function(e){return ON.fromUrl(e)}):"READ"===t&&(o=CN(e).map(function(e){return ON.fromUrl(e)}))}),{routers:n,readers:o,writers:i}}catch(e){throw(0,vN.newError)("Unable to parse servers entry from router ".concat(r," from addresses:\n").concat(vN.json.stringify(t.servers),"\nError message: ").concat(e.message),wN)}}(r,t),u=i.routers,a=i.readers,i=i.writers;return jN(u,"routers",t),jN(a,"readers",t),new EN({database:e||r.db,routers:u,readers:a,writers:i,expirationTime:o,ttl:n})}function jN(e,t,r){if(0===e.length)throw(0,vN.newError)("Received no "+t+" from router "+r,wN)}function CN(e){if(Array.isArray(e))return Array.from(e);throw new TypeError("Array expected but got: "+e)}cl.default=EN,cl.createValidRoutingTable=TN;var i0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},IN=(Object.defineProperty(_0,"__esModule",{value:!0}),i0(cl));function RN(e){this._routingContext=e}RN.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:IN.default.fromRawRoutingTable(r,n,e)})})},RN.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})})},_0.default=RN;var AN,kN,F0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},V_=(Object.defineProperty(S0,"__esModule",{value:!0}),S0.RoutingTable=S0.Rediscovery=void 0,F0(_0)),Y0=(S0.Rediscovery=V_.default,F0(cl)),q0=(S0.RoutingTable=Y0.default,S0.default=V_.default,r&&r.__extends||(AN=function(e,t){return(AN=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}AN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),MN=r&&r.__assign||function(){return(MN=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)},NN=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]}),xN=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),uy=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)&&NN(t,e,r);return xN(t,e),t},DN=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())})},UN=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}}}},LN=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.")},FN=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},X0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},BN=(Object.defineProperty(w0,"__esModule",{value:!0}),e),WN=uy(S0),qN=yp,zN=X0(s_),qy=X0($f),VN=Ic,HN=ep,GN=Fy,YN=BN.error.SERVICE_UNAVAILABLE,KN=BN.error.SESSION_EXPIRED,ZN=BN.internal.bookmarks.Bookmarks,R0=BN.internal.constants,XN=R0.ACCESS_MODE_READ,QN=R0.ACCESS_MODE_WRITE,JN=R0.BOLT_PROTOCOL_V3,$N=R0.BOLT_PROTOCOL_V4_0,ex=R0.BOLT_PROTOCOL_V4_4,tx=R0.BOLT_PROTOCOL_V5_1,rx=null,nx=(0,BN.int)(3e4),sg=(kN=qy.default,q0(ox,kN),ox.prototype._createConnectionErrorHandler=function(){return new HN.ConnectionErrorHandler(KN)},ox.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||rx),e},ox.prototype._handleSecurityError=function(e,t,r,n){return this._log.warn("Routing driver ".concat(this._id," will close connections to ").concat(t," for database '").concat(n,"' because of an error ").concat(e.code," '").concat(e.message,"'")),kN.prototype._handleSecurityError.call(this,e,t,r,n)},ox.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||rx),(0,BN.newError)("No longer possible to write to server at "+t,KN,e)},ox.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,d=e.auth;return DN(this,void 0,void 0,function(){var t,r,n,o,i,u,a=this;return UN(this,function(e){switch(e.label){case 0:return n={database:c||rx},o=new HN.ConnectionErrorHandler(KN,function(e,t){return a._handleUnavailability(e,t,n.database)},function(e,t){return a._handleWriteFailure(e,t,n.database)},function(e,t,r){return a._handleSecurityError(e,t,r,n.database)}),[4,this._freshRoutingTable({accessMode:s,database:n.database,bookmarks:l,impersonatedUser:f,auth:d,onDatabaseNameResolved:function(e){n.database=n.database||e,p&&p(e)}})];case 1:if(u=e.sent(),s===XN)r=this._loadBalancingStrategy.selectReader(u.readers),t="read";else{if(s!==QN)throw(0,BN.newError)("Illegal mode "+s);r=this._loadBalancingStrategy.selectWriter(u.writers),t="write"}if(!r)throw(0,BN.newError)("Failed to obtain connection towards ".concat(t," server. Known routing table is: ").concat(u),KN);e.label=2;case 2:return e.trys.push([2,6,,7]),[4,this._connectionPool.acquire({auth:d},r)];case 3:return(i=e.sent(),d)?[4,this._verifyStickyConnection({auth:d,connection:i,address:r})]:[3,5];case 4:return e.sent(),[2,i];case 5:return[2,new HN.DelegateConnection(i,o)];case 6:throw u=e.sent(),o.handleAndTransformError(u,r);case 7:return[2]}})})},ox.prototype._hasProtocolVersion=function(u){return DN(this,void 0,void 0,function(){var t,r,n,o,i;return UN(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,this._createChannelConnection(t[n])];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]}})})},ox.prototype.supportsMultiDb=function(){return DN(this,void 0,void 0,function(){return UN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return $N<=e})];case 1:return[2,e.sent()]}})})},ox.prototype.supportsTransactionConfig=function(){return DN(this,void 0,void 0,function(){return UN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return JN<=e})];case 1:return[2,e.sent()]}})})},ox.prototype.supportsUserImpersonation=function(){return DN(this,void 0,void 0,function(){return UN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return ex<=e})];case 1:return[2,e.sent()]}})})},ox.prototype.supportsSessionAuth=function(){return DN(this,void 0,void 0,function(){return UN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return tx<=e})];case 1:return[2,e.sent()]}})})},ox.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},ox.prototype.verifyAuthentication=function(e){var n=e.database,o=e.accessMode,i=e.auth;return DN(this,void 0,void 0,function(){var t=this;return UN(this,function(e){return[2,this._verifyAuthentication({auth:i,getAddress:function(){return DN(t,void 0,void 0,function(){var t,r;return UN(this,function(e){switch(e.label){case 0:return t={database:n||rx},[4,this._freshRoutingTable({accessMode:o,database:t.database,auth:i,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:if(r=e.sent(),0===(r=o===QN?r.writers:r.readers).length)throw(0,BN.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(o,"'"),YN);return[2,r[0]]}})})}})]})})},ox.prototype.verifyConnectivityAndGetServerInfo=function(e){var l=e.database,f=e.accessMode;return DN(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c;return UN(this,function(e){switch(e.label){case 0:return t={database:l||rx},[4,this._freshRoutingTable({accessMode:f,database:t.database,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:r=e.sent(),r=f===QN?r.writers:r.readers,n=(0,BN.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(f,"'"),YN),e.label=2;case 2:e.trys.push([2,9,10,11]),o=LN(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}})})},ox.prototype.forget=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forget(t)}}),this._connectionPool.purge(t).catch(function(){})},ox.prototype.forgetWriter=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forgetWriter(t)}})},ox.prototype._freshRoutingTable=function(e){var e=void 0===e?{}:e,t=e.accessMode,r=e.database,n=e.bookmarks,o=e.impersonatedUser,i=e.onDatabaseNameResolved,e=e.auth,u=this._routingTableRegistry.get(r,function(){return new WN.RoutingTable({database:r})});return u.isStaleFor(t)?(this._log.info('Routing table is stale for database: "'.concat(r,'" and access mode: "').concat(t,'": ').concat(u)),this._refreshRoutingTable(u,n,o,e).then(function(e){return i(e.database),e})):u},ox.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)},ox.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters=function(u,a,s,c,l){return DN(this,void 0,void 0,function(){var t,r,n,o,i;return UN(this,function(e){switch(e.label){case 0:return t=[],[4,this._fetchRoutingTableUsingSeedRouter(t,this._seedRouter,a,s,c,l)];case 1:return(t=FN.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,l)];case 3:i=FN.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,n)];case 5:return[2,e.sent()]}})})},ox.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter=function(o,i,u,a,s){return DN(this,void 0,void 0,function(){var t,r,n;return UN(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTableUsingKnownRouters(o,i,u,a,s)];case 1:return r=FN.apply(void 0,[e.sent(),2]),t=r[0],r=r[1],t?[3,3]:[4,this._fetchRoutingTableUsingSeedRouter(o,this._seedRouter,i,u,a,s)];case 2:n=FN.apply(void 0,[e.sent(),2]),t=n[0],r=n[1],e.label=3;case 3:return[4,this._applyRoutingTableIfPossible(i,t,r)];case 4:return[2,e.sent()]}})})},ox.prototype._fetchRoutingTableUsingKnownRouters=function(n,o,i,u,a){return DN(this,void 0,void 0,function(){var t,r;return UN(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTable(n,o,i,u,a)];case 1:return(t=FN.apply(void 0,[e.sent(),2]),r=t[0],t=t[1],r)?[2,[r,null]]:(r=n.length-1,ox._forgetRouter(o,n,r),[2,[null,t]])}})})},ox.prototype._fetchRoutingTableUsingSeedRouter=function(r,n,o,i,u,a){return DN(this,void 0,void 0,function(){var t;return UN(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,a)];case 2:return[2,e.sent()]}})})},ox.prototype._resolveSeedRouter=function(n){return DN(this,void 0,void 0,function(){var t,r=this;return UN(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)]}})})},ox.prototype._fetchRoutingTable=function(s,c,l,f,p){return DN(this,void 0,void 0,function(){var t=this;return UN(this,function(e){return[2,s.reduce(function(i,u,a){return DN(t,void 0,void 0,function(){var t,r,n,o;return UN(this,function(e){switch(e.label){case 0:return[4,i];case 1:return(t=FN.apply(void 0,[e.sent(),1]),t=t[0])?[2,[t,null]]:(ox._forgetRouter(c,s,a-1),[4,this._createSessionForRediscovery(u,l,f,p)]);case 2:if(t=FN.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]))]})})},ox.prototype._createSessionForRediscovery=function(o,i,u,a){return DN(this,void 0,void 0,function(){var t,r,n=this;return UN(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),[4,this._connectionPool.acquire({auth:a},o)];case 1:return(t=e.sent(),a)?[4,this._verifyStickyConnection({auth:a,connection:t,address:o})]:[3,3];case 2:e.sent(),e.label=3;case 3:return r=HN.ConnectionErrorHandler.create({errorCode:KN,handleSecurityError:function(e,t,r){return n._handleSecurityError(e,t,r)}}),r=t._sticky?new HN.DelegateConnection(t):new HN.DelegateConnection(t,r),r=new zN.default(r),t.protocol().version<4?[2,[new BN.Session({mode:QN,bookmarks:ZN.empty(),connectionProvider:r}),null]]:[2,[new BN.Session({mode:XN,database:"system",bookmarks:i,connectionProvider:r,impersonatedUser:u}),null]];case 4:return r=e.sent(),[2,this._handleRediscoveryError(r,o)];case 5:return[2]}})})},ox.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","N/A"].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,BN.newError)("Server at ".concat(t.asHostPort()," can't perform routing. Make sure you are connecting to a causal cluster"),YN,e);var r;return this._log.warn("unable to fetch routing table because of an error ".concat(e)),[null,e]},ox.prototype._applyRoutingTableIfPossible=function(t,r,n){return DN(this,void 0,void 0,function(){return UN(this,function(e){switch(e.label){case 0:if(r)return 0===r.writers.length&&(this._useSeedRouter=!0),[4,this._updateRoutingTable(r)];throw(0,BN.newError)("Could not perform discovery. No routing servers available. Known routing table: ".concat(t),YN,n);case 1:return e.sent(),[2,r]}})})},ox.prototype._updateRoutingTable=function(t){return DN(this,void 0,void 0,function(){return UN(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),this._log.info("Updated routing table ".concat(t)),[2]}})})},ox._forgetRouter=function(e,t,r){t=t[r];e&&t&&e.forgetRouter(t)},ox);function ox(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.boltAgent,c=e.authTokenManager,l=e.routingTablePurgeDelay,e=e.newPool,f=kN.call(this,{id:t,config:i,log:u,userAgent:a,boltAgent:s,authTokenManager:c,newPool:e},function(n){return DN(f,void 0,void 0,function(){var t,r;return UN(this,function(e){switch(e.label){case 0:return t=HN.createChannelConnection,r=[n,this._config,this._createConnectionErrorHandler(),this._log],[4,this._clientCertificateHolder.getClientCertificate()];case 1:return[2,t.apply(void 0,r.concat([e.sent(),this._routingContext]))]}})})})||this;return f._routingContext=MN(MN({},n),{address:r.toString()}),f._seedRouter=r,f._rediscovery=new WN.default(f._routingContext),f._loadBalancingStrategy=new VN.LeastConnectedLoadBalancingStrategy(f._connectionPool),f._hostNameResolver=o,f._dnsResolver=new qN.HostNameResolver,f._log=u,f._useSeedRouter=!0,f._routingTableRegistry=new Ex(l?(0,BN.int)(l):nx),f._refreshRoutingTable=GN.functional.reuseOngoingRequest(f._refreshRoutingTable,f),f}w0.default=sg;Px.prototype.register=function(e){return this._tables.set(e.database,e),this},Px.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},Px.prototype.get=function(e,t){return this._tables.has(e)?this._tables.get(e):"function"==typeof t?t():t},Px.prototype.removeExpired=function(){var t=this;return this._removeIf(function(e){return e.isExpiredFor(t._routingTablePurgeDelay)})},Px.prototype._forEach=function(e){var t,r;try{for(var n=LN(this._tables),o=n.next();!o.done;o=n.next())e(FN(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},Px.prototype._remove=function(e){return this._tables.delete(e),this},Px.prototype._removeIf=function(e){var t,r;try{for(var n=LN(this._tables),o=n.next();!o.done;o=n.next()){var i=FN(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 ix,ux,ax,sx,cx,lx,fx,px,dx,hx,bx,x,yx,_x,vx,mx,gx,Ox,wx,Ex=Px;function Px(e){this._tables=new Map,this._routingTablePurgeDelay=e}function Sx(e,t,r){void 0===r&&(r={}),vx(e,"Bolt URL");var n,o=Ox.parseDatabaseUrl(e),i=!1,u=!1;switch(o.scheme){case"bolt":break;case"bolt+s":u=!0,n="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";break;case"bolt+ssc":u=!0,n="TRUST_ALL_CERTIFICATES";break;case"neo4j":i=!0;break;case"neo4j+s":n="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",i=u=!0;break;case"neo4j+ssc":n="TRUST_ALL_CERTIFICATES",i=u=!0;break;default:throw new Error("Unknown scheme: ".concat(o.scheme))}if(u){if("encrypted"in r||"trust"in r)throw new Error("Encryption/trust can only be configured either through URL or config, not both");r.encrypted=_x,r.trust=n,r.clientCertificate=(0,x.resolveCertificateProvider)(r.clientCertificate)}var a=function(e){if("object"==typeof(t=e)&&null!=t&&"getToken"in t&&"handleSecurityException"in t&&"function"==typeof t.getToken&&"function"==typeof t.handleSecurityException)return e;var t=e;return(t=t||{}).scheme=t.scheme||"none",(0,x.staticAuthTokenManager)({authToken:t})}(t),s=(r.userAgent=r.userAgent||wx,r.boltAgent=x.internal.boltAgent.fromVersion(bx.default),gx.fromUrl(o.hostAndPort)),t={address:s,typename:i?"Routing":"Direct",routing:i};return new hx.Driver(t,r,function(){{if(i)return function(e,t,r,n){return new yx.RoutingConnectionProvider({id:e,config:t,log:r,hostNameResolver:n,authTokenManager:a,address:s,userAgent:t.userAgent,boltAgent:t.boltAgent,routingContext:o.query})};if(mx(o.query))return function(e,t,r){return new yx.DirectConnectionProvider({id:e,config:t,log:r,authTokenManager:a,address:s,userAgent:t.userAgent,boltAgent:t.boltAgent})};throw new Error("Parameters are not supported with none routed scheme. Given URL: '".concat(e,"'"))}}())}function Tx(r,n){return px(this,void 0,void 0,function(){var t;return dx(this,function(e){switch(e.label){case 0:t=Sx(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 dg=u_,ix=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(dg,"__esModule",{value:!0}),dg.RoutingConnectionProvider=dg.DirectConnectionProvider=dg.PooledConnectionProvider=dg.SingleConnectionProvider=void 0,ux=s_,Object.defineProperty(dg,"SingleConnectionProvider",{enumerable:!0,get:function(){return ix(ux).default}}),ax=$f,Object.defineProperty(dg,"PooledConnectionProvider",{enumerable:!0,get:function(){return ix(ax).default}}),sx=Wm,Object.defineProperty(dg,"DirectConnectionProvider",{enumerable:!0,get:function(){return ix(sx).default}}),cx=w0,Object.defineProperty(dg,"RoutingConnectionProvider",{enumerable:!0,get:function(){return ix(cx).default}}),Gh=i,lx=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]}),fx=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vl=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)&&lx(t,e,r);return fx(t,e),t},Mc=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||lx(t,e,r)},Object.defineProperty(Gh,"__esModule",{value:!0}),Gh.packstream=Gh.channel=Gh.buf=Gh.bolt=Gh.loadBalancing=void 0,Gh.loadBalancing=vl(Ic),Gh.bolt=vl(w),Gh.buf=vl(Jp),Gh.channel=vl(yp),Gh.packstream=vl(z_),Mc(u_,Gh),n=F,px=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())})},dx=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}}}},il=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(n,"__esModule",{value:!0}),n.UnboundRelationship=n.Relationship=n.Node=n.Record=n.ServerInfo=n.GqlStatusObject=n.Notification=n.QueryStatistics=n.ProfiledPlan=n.Plan=n.ResultSummary=n.RxResult=n.RxManagedTransaction=n.RxTransaction=n.RxSession=n.EagerResult=n.Result=n.ManagedTransaction=n.Transaction=n.Session=n.Driver=n.temporal=n.spatial=n.graph=n.error=n.routing=n.session=n.types=n.logging=n.auth=n.isRetryableError=n.Neo4jError=n.integer=n.isUnboundRelationship=n.isRelationship=n.isPathSegment=n.isPath=n.isNode=n.isDateTime=n.isLocalDateTime=n.isDate=n.isTime=n.isLocalTime=n.isDuration=n.isPoint=n.isInt=n.int=n.hasReachableServer=n.driver=n.authTokenManagers=void 0,n.clientCertificateProviders=n.notificationFilterMinimumSeverityLevel=n.notificationFilterDisabledClassification=n.notificationFilterDisabledCategory=n.notificationSeverityLevel=n.notificationClassification=n.notificationCategory=n.resultTransformers=n.bookmarkManager=n.DateTime=n.LocalDateTime=n.Date=n.Time=n.LocalTime=n.Duration=n.Integer=n.Point=n.PathSegment=n.Path=void 0,hx=B,Object.defineProperty(n,"Driver",{enumerable:!0,get:function(){return hx.Driver}}),bx=il(v),x=e,Object.defineProperty(n,"authTokenManagers",{enumerable:!0,get:function(){return x.authTokenManagers}}),Object.defineProperty(n,"Neo4jError",{enumerable:!0,get:function(){return x.Neo4jError}}),Object.defineProperty(n,"isRetryableError",{enumerable:!0,get:function(){return x.isRetryableError}}),Object.defineProperty(n,"error",{enumerable:!0,get:function(){return x.error}}),Object.defineProperty(n,"Integer",{enumerable:!0,get:function(){return x.Integer}}),Object.defineProperty(n,"int",{enumerable:!0,get:function(){return x.int}}),Object.defineProperty(n,"isInt",{enumerable:!0,get:function(){return x.isInt}}),Object.defineProperty(n,"isPoint",{enumerable:!0,get:function(){return x.isPoint}}),Object.defineProperty(n,"Point",{enumerable:!0,get:function(){return x.Point}}),Object.defineProperty(n,"Date",{enumerable:!0,get:function(){return x.Date}}),Object.defineProperty(n,"DateTime",{enumerable:!0,get:function(){return x.DateTime}}),Object.defineProperty(n,"Duration",{enumerable:!0,get:function(){return x.Duration}}),Object.defineProperty(n,"isDate",{enumerable:!0,get:function(){return x.isDate}}),Object.defineProperty(n,"isDateTime",{enumerable:!0,get:function(){return x.isDateTime}}),Object.defineProperty(n,"isDuration",{enumerable:!0,get:function(){return x.isDuration}}),Object.defineProperty(n,"isLocalDateTime",{enumerable:!0,get:function(){return x.isLocalDateTime}}),Object.defineProperty(n,"isLocalTime",{enumerable:!0,get:function(){return x.isLocalTime}}),Object.defineProperty(n,"isNode",{enumerable:!0,get:function(){return x.isNode}}),Object.defineProperty(n,"isPath",{enumerable:!0,get:function(){return x.isPath}}),Object.defineProperty(n,"isPathSegment",{enumerable:!0,get:function(){return x.isPathSegment}}),Object.defineProperty(n,"isRelationship",{enumerable:!0,get:function(){return x.isRelationship}}),Object.defineProperty(n,"isTime",{enumerable:!0,get:function(){return x.isTime}}),Object.defineProperty(n,"isUnboundRelationship",{enumerable:!0,get:function(){return x.isUnboundRelationship}}),Object.defineProperty(n,"LocalDateTime",{enumerable:!0,get:function(){return x.LocalDateTime}}),Object.defineProperty(n,"LocalTime",{enumerable:!0,get:function(){return x.LocalTime}}),Object.defineProperty(n,"Time",{enumerable:!0,get:function(){return x.Time}}),Object.defineProperty(n,"Node",{enumerable:!0,get:function(){return x.Node}}),Object.defineProperty(n,"Path",{enumerable:!0,get:function(){return x.Path}}),Object.defineProperty(n,"PathSegment",{enumerable:!0,get:function(){return x.PathSegment}}),Object.defineProperty(n,"Relationship",{enumerable:!0,get:function(){return x.Relationship}}),Object.defineProperty(n,"UnboundRelationship",{enumerable:!0,get:function(){return x.UnboundRelationship}}),Object.defineProperty(n,"Record",{enumerable:!0,get:function(){return x.Record}}),Object.defineProperty(n,"ResultSummary",{enumerable:!0,get:function(){return x.ResultSummary}}),Object.defineProperty(n,"Plan",{enumerable:!0,get:function(){return x.Plan}}),Object.defineProperty(n,"ProfiledPlan",{enumerable:!0,get:function(){return x.ProfiledPlan}}),Object.defineProperty(n,"QueryStatistics",{enumerable:!0,get:function(){return x.QueryStatistics}}),Object.defineProperty(n,"Notification",{enumerable:!0,get:function(){return x.Notification}}),Object.defineProperty(n,"GqlStatusObject",{enumerable:!0,get:function(){return x.GqlStatusObject}}),Object.defineProperty(n,"ServerInfo",{enumerable:!0,get:function(){return x.ServerInfo}}),Object.defineProperty(n,"Result",{enumerable:!0,get:function(){return x.Result}}),Object.defineProperty(n,"EagerResult",{enumerable:!0,get:function(){return x.EagerResult}}),Object.defineProperty(n,"auth",{enumerable:!0,get:function(){return x.auth}}),Object.defineProperty(n,"Session",{enumerable:!0,get:function(){return x.Session}}),Object.defineProperty(n,"Transaction",{enumerable:!0,get:function(){return x.Transaction}}),Object.defineProperty(n,"ManagedTransaction",{enumerable:!0,get:function(){return x.ManagedTransaction}}),Object.defineProperty(n,"bookmarkManager",{enumerable:!0,get:function(){return x.bookmarkManager}}),Object.defineProperty(n,"routing",{enumerable:!0,get:function(){return x.routing}}),Object.defineProperty(n,"resultTransformers",{enumerable:!0,get:function(){return x.resultTransformers}}),Object.defineProperty(n,"notificationCategory",{enumerable:!0,get:function(){return x.notificationCategory}}),Object.defineProperty(n,"notificationClassification",{enumerable:!0,get:function(){return x.notificationClassification}}),Object.defineProperty(n,"notificationSeverityLevel",{enumerable:!0,get:function(){return x.notificationSeverityLevel}}),Object.defineProperty(n,"notificationFilterDisabledCategory",{enumerable:!0,get:function(){return x.notificationFilterDisabledCategory}}),Object.defineProperty(n,"notificationFilterDisabledClassification",{enumerable:!0,get:function(){return x.notificationFilterDisabledClassification}}),Object.defineProperty(n,"notificationFilterMinimumSeverityLevel",{enumerable:!0,get:function(){return x.notificationFilterMinimumSeverityLevel}}),Object.defineProperty(n,"clientCertificateProviders",{enumerable:!0,get:function(){return x.clientCertificateProviders}}),yx=i,og=il(Tr),n.RxSession=og.default,X=il(u),n.RxTransaction=X.default,m=il(g),n.RxManagedTransaction=m.default,il=il(s),n.RxResult=il.default,C=x.internal.util,_x=C.ENCRYPTION_ON,vx=C.assertString,mx=C.isEmptyObjectOrNull,gx=x.internal.serverAddress.ServerAddress,Ox=x.internal.urlUtil,wx="neo4j-javascript/"+bx.default,n.driver=Sx,n.hasReachableServer=Tx,C={console:function(e){return{level:e,logger:function(e,t){return console.log("".concat(r.Date.now()," ").concat(e.toUpperCase()," ").concat(t))}}}},n.logging=C,_={Node:x.Node,Relationship:x.Relationship,UnboundRelationship:x.UnboundRelationship,PathSegment:x.PathSegment,Path:x.Path,Result:x.Result,EagerResult:x.EagerResult,ResultSummary:x.ResultSummary,Record:x.Record,Point:x.Point,Date:x.Date,DateTime:x.DateTime,Duration:x.Duration,LocalDateTime:x.LocalDateTime,LocalTime:x.LocalTime,Time:x.Time,Integer:x.Integer},n.types=_,Xg={READ:hx.READ,WRITE:hx.WRITE},n.session=Xg,t={toNumber:x.toNumber,toString:x.toString,inSafeRange:x.inSafeRange},n.integer=t,qr={isPoint:x.isPoint},n.spatial=qr,Ig={isDuration:x.isDuration,isLocalTime:x.isLocalTime,isTime:x.isTime,isDate:x.isDate,isLocalDateTime:x.isLocalDateTime,isDateTime:x.isDateTime},n.temporal=Ig,P={isNode:x.isNode,isPath:x.isPath,isPathSegment:x.isPathSegment,isRelationship:x.isRelationship,isUnboundRelationship:x.isUnboundRelationship},n.graph=P,t={authTokenManagers:x.authTokenManagers,driver:Sx,hasReachableServer:Tx,int:x.int,isInt:x.isInt,isPoint:x.isPoint,isDuration:x.isDuration,isLocalTime:x.isLocalTime,isTime:x.isTime,isDate:x.isDate,isLocalDateTime:x.isLocalDateTime,isDateTime:x.isDateTime,isNode:x.isNode,isPath:x.isPath,isPathSegment:x.isPathSegment,isRelationship:x.isRelationship,isUnboundRelationship:x.isUnboundRelationship,integer:t,Neo4jError:x.Neo4jError,isRetryableError:x.isRetryableError,auth:x.auth,logging:C,types:_,session:Xg,routing:x.routing,error:x.error,graph:P,spatial:qr,temporal:Ig,Driver:hx.Driver,Session:x.Session,Transaction:x.Transaction,ManagedTransaction:x.ManagedTransaction,Result:x.Result,EagerResult:x.EagerResult,RxSession:og.default,RxTransaction:X.default,RxManagedTransaction:m.default,RxResult:il.default,ResultSummary:x.ResultSummary,Plan:x.Plan,ProfiledPlan:x.ProfiledPlan,QueryStatistics:x.QueryStatistics,Notification:x.Notification,GqlStatusObject:x.GqlStatusObject,ServerInfo:x.ServerInfo,Record:x.Record,Node:x.Node,Relationship:x.Relationship,UnboundRelationship:x.UnboundRelationship,Path:x.Path,PathSegment:x.PathSegment,Point:x.Point,Integer:x.Integer,Duration:x.Duration,LocalTime:x.LocalTime,Time:x.Time,Date:x.Date,LocalDateTime:x.LocalDateTime,DateTime:x.DateTime,bookmarkManager:x.bookmarkManager,resultTransformers:x.resultTransformers,notificationCategory:x.notificationCategory,notificationSeverityLevel:x.notificationSeverityLevel,notificationFilterDisabledCategory:x.notificationFilterDisabledCategory,notificationFilterMinimumSeverityLevel:x.notificationFilterMinimumSeverityLevel,clientCertificateProviders:x.clientCertificateProviders},n.default=t,D(F)});
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 D(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L={},U={},e={},t={},n={},o={},F=(Object.defineProperty(o,"__esModule",{value:!0}),o.getBrokenObjectReason=o.isBrokenObject=o.createBrokenObject=void 0,"__isBrokenObject__"),B="__reason__";o.createBrokenObject=function(r,e){function n(){throw r}return void 0===e&&(e={}),new Proxy(e,{get:function(e,t){return t===F||(t===B?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})},o.isBrokenObject=function(e){return null!==e&&"object"==typeof e&&!0===e[F]},o.getBrokenObjectReason=function(e){return e[B]},Object.defineProperty(n,"__esModule",{value:!0}),n.stringify=void 0;var W=o;n.stringify=function(e,r){return JSON.stringify(e,function(e,t){return(0,W.isBrokenObject)(t)?{__isBrokenObject__:!0,__reason__:(0,W.getBrokenObjectReason)(t)}:"bigint"==typeof t?"".concat(t,"n"):!0!==(null==r?void 0:r.useCustomToString)||"object"!=typeof t||Array.isArray(t)||"function"!=typeof t.toString||t.toString===Object.prototype.toString?t:null==t?void 0:t.toString()})};var q,z,V={},i=(i=V,Object.defineProperty(i,"__esModule",{value:!0}),i.rawPolyfilledDiagnosticRecord=void 0,i.rawPolyfilledDiagnosticRecord={OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"},Object.freeze(i.rawPolyfilledDiagnosticRecord),r&&r.__extends||(q=function(e,t){return(q=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}q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),H=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]}),G=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Y=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)&&H(t,e,r);return G(t,e),t},K=(Object.defineProperty(t,"__esModule",{value:!0}),t.PROTOCOL_ERROR=t.SESSION_EXPIRED=t.SERVICE_UNAVAILABLE=t.GQLError=t.Neo4jError=t.isRetriableError=t.newGQLError=t.newError=void 0,Y(n)),Z=V,Y={DATABASE_ERROR:"DATABASE_ERROR",CLIENT_ERROR:"CLIENT_ERROR",TRANSIENT_ERROR:"TRANSIENT_ERROR",UNKNOWN:"UNKNOWN"},Q=(Object.freeze(Y),Object.values(Y)),X="ServiceUnavailable",J=(t.SERVICE_UNAVAILABLE=X,"SessionExpired"),$=(t.SESSION_EXPIRED=J,t.PROTOCOL_ERROR="ProtocolError",z=Error,i(ee,z),Object.defineProperty(ee.prototype,"diagnosticRecordAsJsonString",{get:function(){return K.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),ee);function ee(e,t,r,n,o){var i=this;return(i=z.call(this,e,null!=o?{cause:o}:void 0)||this).constructor=ee,i.__proto__=ee.prototype,i.cause=null!=o?o:void 0,i.gqlStatus=t,i.gqlStatusDescription=r,i.diagnosticRecord=n,i.classification=void 0!==(e=i.diagnosticRecord)&&void 0!==e._classification&&Q.includes(e._classification)?null==e?void 0:e._classification:"UNKNOWN",i.rawClassification=null!=(o=null==n?void 0:n._classification)?o:void 0,i.name="GQLError",i}t.GQLError=$;i(ne,te=$),ne.isRetriable=function(e){return null!=e&&e instanceof ne&&e.retriable};var te,re=ne;function ne(e,t,r,n,o,i){e=te.call(this,e,r,n,o,i)||this;return e.constructor=ne,e.__proto__=ne.prototype,e.code=t,e.name="Neo4jError",e.retriable=(r=t)===X||r===J||"Neo.ClientError.Security.AuthorizationExpired"===r||function(e){return!0===(null==e?void 0:e.includes("TransientError"))}(r),e}t.Neo4jError=re,t.newError=function(e,t,r,n,o,i){return new re(e,null!=t?t:"N/A",null!=n?n:"50N42",null!=o?o:"error: general processing exception - unexpected error. "+e,null!=i?i:Z.rawPolyfilledDiagnosticRecord,r)},t.newGQLError=function(e,t,r,n,o){return new $(e,null!=r?r:"50N42",null!=n?n:"error: general processing exception - unexpected error. "+e,null!=o?o:Z.rawPolyfilledDiagnosticRecord,t)};Y=re.isRetriable;t.isRetriableError=Y;var i={},oe=(Object.defineProperty(i,"__esModule",{value:!0}),i.toString=i.toNumber=i.inSafeRange=i.isInt=i.int=void 0,t),ie=new Map,Y=(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*pe+(this.low>>>0)},d.prototype.toBigInt=function(){var e;return this.isZero()?BigInt(0):this.isPositive()?BigInt(this.high>>>0)*BigInt(pe)+BigInt(this.low>>>0):(e=this.negate(),BigInt(-1)*(BigInt(e.high>>>0)*BigInt(pe)+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(he)&&e.lessThan(he))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,oe.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),e=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=ie.get(e)))return t;var t=new d(e,e<0?-1:0);return-128<=e&&e<128&&ie.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<=-de?d.MIN_VALUE:de<=e+1?d.MAX_VALUE:e<0?d.fromNumber(-e).negate():new d(e%pe|0,e/pe|0)},d.fromString=function(e,t,r){var n=(void 0===r?{}:r).strictStringValidation;if(0===e.length)throw(0,oe.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,oe.newError)("radix out of range: "+t.toString());if(0<(r=e.indexOf("-")))throw(0,oe.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,oe.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?(!0===t.ceilFloat&&(e=Math.ceil(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(Y.prototype,"__isInteger__",{value:!0,enumerable:!1,configurable:!1});var a,ue,ae,se,ce,le,fe,pe=4294967296,de=pe*pe/2,he=Y.fromInt(1<<24),u=Y.fromValue,u=(i.int=u,Y.isInteger),u=(i.isInt=u,Y.inSafeRange),u=(i.inSafeRange=u,Y.toNumber),u=(i.toNumber=u,Y.toString),u=(i.toString=u,i.default=Y,{}),Y={},s={},be=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]}),ye=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)&&be(t,e,r);return ye(t,e),t},_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.")},ve=(Object.defineProperty(s,"__esModule",{value:!0}),s.ENCRYPTION_OFF=s.ENCRYPTION_ON=s.equals=s.validateQueryAndParameters=s.toNumber=s.assertValidDate=s.assertNumberOrInteger=s.assertNumber=s.assertString=s.assertObject=s.isString=s.isObject=s.isEmptyObjectOrNull=void 0,c(i)),me=n;s.ENCRYPTION_ON="ENCRYPTION_ON";function ge(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}function Oe(e,t){if(we(e))return e;throw new TypeError((0,me.stringify)(t)+" expected to be string but was: "+(0,me.stringify)(e))}function we(e){return"[object String]"===Object.prototype.toString.call(e)}function Ee(e,t){this._minNumber=e,this._maxNumber=t,this._minInteger=(0,se.int)(e),this._maxInteger=(0,se.int)(t)}function Pe(e,t,r){e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.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,se.int)(e)).modulo(4).equals(0))return!e.modulo(100).equals(0)||!!e.modulo(400).equals(0)}(e)||(n=n.subtract(1))),n.subtract(a.DAYS_0000_TO_1970)}function Se(e,t){return(0,ce.newError)("".concat(t,' is expected to be a valid ZoneId but was: "').concat(e,'"'))}function Te(e,t,r){if((0,le.assertNumberOrInteger)(e,r),t.contains(e))return e;throw(0,ce.newError)("".concat(r," is expected to be in range ").concat(t.toString()," but was: ").concat(e.toString()))}function je(e,t){e=(0,se.int)(e),t=(0,se.int)(t);var r=e.div(t);return r=e.isPositive()!==t.isPositive()&&r.multiply(t).notEquals(e)?r.subtract(1):r}function Ce(e,t){return e=(0,se.int)(e),t=(0,se.int)(t),e.subtract(je(e,t).multiply(t))}function Re(e){return(e=(0,se.int)(e)).equals(0)?"":"."+Ie(e,9)}function Ie(e,t,r){var n=(e=(0,se.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}s.ENCRYPTION_OFF="ENCRYPTION_OFF",s.isEmptyObjectOrNull=function(e){if(null===e)return!0;if(!ge(e))return!1;for(var t in e)if(void 0!==e[t])return!1;return!0},s.isObject=ge,s.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(Oe(e,"Cypher query"),0===e.trim().length)throw new TypeError("Cypher query is expected to be a non-empty string.");r=t;if(!ge(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}},s.assertObject=function(e,t){if(ge(e))return e;throw new TypeError(t+" expected to be an object but was: "+(0,me.stringify)(e))},s.assertString=Oe,s.assertNumber=function(e,t){if("number"!=typeof e)throw new TypeError(t+" expected to be a number but was: "+(0,me.stringify)(e));return e},s.assertNumberOrInteger=function(e,t){if("number"==typeof e||"bigint"==typeof e||(0,ve.isInt)(e))return e;throw new TypeError(t+" expected to be either a number or an Integer object but was: "+(0,me.stringify)(e))},s.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,me.stringify)(e));if(Number.isNaN(e.getTime()))throw new TypeError(t+" expected to be valid JavaScript Date but its time was NaN: "+(0,me.stringify)(e));return e},s.isString=we,s.equals=function e(t,r){var n,o;if(t===r)return!0;if(null===t||null===r)return!1;if("object"!=typeof t||"object"!=typeof r)return!1;var i=Object.keys(t),u=Object.keys(r);if(i.length!==u.length)return!1;try{for(var a=_e(i),s=a.next();!s.done;s=a.next()){var c=s.value;if(!e(t[c],r[c]))return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return!0},s.toNumber=function(e){return e instanceof ve.default?e.toNumber():"bigint"==typeof e?(0,ve.int)(e).toNumber():e},a=Y,ue=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]}),ae=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)&&ue(t,e,r);return ae(t,e),t},Object.defineProperty(a,"__esModule",{value:!0}),a.floorMod=a.floorDiv=a.assertValidZoneId=a.assertValidNanosecond=a.assertValidSecond=a.assertValidMinute=a.assertValidHour=a.assertValidDay=a.assertValidMonth=a.assertValidYear=a.timeZoneOffsetInSeconds=a.totalNanoseconds=a.newDate=a.toStandardDate=a.isoStringToStandardDate=a.dateToIsoString=a.timeZoneOffsetToIsoString=a.timeToIsoString=a.durationToIsoString=a.dateToEpochDay=a.localDateTimeToEpochSecond=a.localTimeToNanoOfDay=a.normalizeNanosecondsForDuration=a.normalizeSecondsForDuration=a.SECONDS_PER_DAY=a.DAYS_PER_400_YEAR_CYCLE=a.DAYS_0000_TO_1970=a.NANOS_PER_HOUR=a.NANOS_PER_MINUTE=a.NANOS_PER_MILLISECOND=a.NANOS_PER_SECOND=a.SECONDS_PER_HOUR=a.SECONDS_PER_MINUTE=a.MINUTES_PER_HOUR=a.NANOSECOND_OF_SECOND_RANGE=a.SECOND_OF_MINUTE_RANGE=a.MINUTE_OF_HOUR_RANGE=a.HOUR_OF_DAY_RANGE=a.DAY_OF_MONTH_RANGE=a.MONTH_OF_YEAR_RANGE=a.YEAR_RANGE=void 0,se=c(i),ce=t,le=s,Ee.prototype.contains=function(e){var t;return(0,se.isInt)(e)&&e instanceof se.default?e.greaterThanOrEqual(this._minInteger)&&e.lessThanOrEqual(this._maxInteger):"bigint"==typeof e?(t=(0,se.int)(e)).greaterThanOrEqual(this._minInteger)&&t.lessThanOrEqual(this._maxInteger):e>=this._minNumber&&e<=this._maxNumber},Ee.prototype.toString=function(){return"[".concat(this._minNumber,", ").concat(this._maxNumber,"]")},c=Ee,a.YEAR_RANGE=new c(-999999999,999999999),a.MONTH_OF_YEAR_RANGE=new c(1,12),a.DAY_OF_MONTH_RANGE=new c(1,31),a.HOUR_OF_DAY_RANGE=new c(0,23),a.MINUTE_OF_HOUR_RANGE=new c(0,59),a.SECOND_OF_MINUTE_RANGE=new c(0,59),a.NANOSECOND_OF_SECOND_RANGE=new c(0,999999999),a.MINUTES_PER_HOUR=60,a.SECONDS_PER_MINUTE=60,a.SECONDS_PER_HOUR=a.SECONDS_PER_MINUTE*a.MINUTES_PER_HOUR,a.NANOS_PER_SECOND=1e9,a.NANOS_PER_MILLISECOND=1e6,a.NANOS_PER_MINUTE=a.NANOS_PER_SECOND*a.SECONDS_PER_MINUTE,a.NANOS_PER_HOUR=a.NANOS_PER_MINUTE*a.MINUTES_PER_HOUR,a.DAYS_0000_TO_1970=719528,a.DAYS_PER_400_YEAR_CYCLE=146097,a.SECONDS_PER_DAY=86400,a.normalizeSecondsForDuration=function(e,t){return(0,se.int)(e).add(je(t,a.NANOS_PER_SECOND))},a.normalizeNanosecondsForDuration=function(e){return Ce(e,a.NANOS_PER_SECOND)},a.localTimeToNanoOfDay=function(e,t,r,n){return e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.int)(r),n=(0,se.int)(n),(e=(e=(e=e.multiply(a.NANOS_PER_HOUR)).add(t.multiply(a.NANOS_PER_MINUTE))).add(r.multiply(a.NANOS_PER_SECOND))).add(n)},a.localDateTimeToEpochSecond=function(e,t,r,n,o,i,u){return e=Pe(e,t,r),t=function(e,t,r){e=(0,se.int)(e),t=(0,se.int)(t),r=(0,se.int)(r);e=e.multiply(a.SECONDS_PER_HOUR);return(e=e.add(t.multiply(a.SECONDS_PER_MINUTE))).add(r)}(n,o,i),e.multiply(a.SECONDS_PER_DAY).add(t)},a.dateToEpochDay=Pe,a.durationToIsoString=function(e,t,r,n){return e=Ie(e),t=Ie(t),r=function(e,t){e=(0,se.int)(e),t=(0,se.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=Re((n?t.negate().add(2*a.NANOS_PER_SECOND):t.add(a.NANOS_PER_SECOND)).modulo(a.NANOS_PER_SECOND)));return null!=r?e+r:e}(r,n),"P".concat(e,"M").concat(t,"DT").concat(r,"S")},a.timeToIsoString=function(e,t,r,n){return e=Ie(e,2),t=Ie(t,2),r=Ie(r,2),n=Re(n),"".concat(e,":").concat(t,":").concat(r).concat(n)},a.timeZoneOffsetToIsoString=function(e){if((e=(0,se.int)(e)).equals(0))return"Z";var t=(r=e.isNegative())?"-":"+",r=Ie((e=r?e.multiply(-1):e).div(a.SECONDS_PER_HOUR),2),n=Ie(e.div(a.SECONDS_PER_MINUTE).modulo(a.MINUTES_PER_HOUR),2);return null!=(e=(e=e.modulo(a.SECONDS_PER_MINUTE)).equals(0)?null:Ie(e,2))?"".concat(t).concat(r,":").concat(n,":").concat(e):"".concat(t).concat(r,":").concat(n)},a.dateToIsoString=function(e,t,r){return e=function(e){e=(0,se.int)(e);if(e.isNegative()||e.greaterThan(9999))return Ie(e,6,{usePositiveSign:!0});return Ie(e,4)}(e),t=Ie(t,2),r=Ie(r,2),"".concat(e,"-").concat(t,"-").concat(r)},a.isoStringToStandardDate=function(e){return new Date(e)},a.toStandardDate=function(e){return new Date(e)},a.newDate=function(e){return new Date(e)},a.totalNanoseconds=function(e,t){return t=null!=t?t:0,e=e.getMilliseconds()*a.NANOS_PER_MILLISECOND,t instanceof se.default?t.add(e):"bigint"==typeof t?t+BigInt(e):t+e},a.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*a.SECONDS_PER_MINUTE+t},a.assertValidYear=function(e){return Te(e,a.YEAR_RANGE,"Year")},a.assertValidMonth=function(e){return Te(e,a.MONTH_OF_YEAR_RANGE,"Month")},a.assertValidDay=function(e){return Te(e,a.DAY_OF_MONTH_RANGE,"Day")},a.assertValidHour=function(e){return Te(e,a.HOUR_OF_DAY_RANGE,"Hour")},a.assertValidMinute=function(e){return Te(e,a.MINUTE_OF_HOUR_RANGE,"Minute")},a.assertValidSecond=function(e){return Te(e,a.SECOND_OF_MINUTE_RANGE,"Second")},a.assertValidNanosecond=function(e){return Te(e,a.NANOSECOND_OF_SECOND_RANGE,"Nanosecond")},fe=new Map,a.assertValidZoneId=function(t,r){var e=fe.get(r);if(!0!==e){if(!1===e)throw Se(r,t);try{Intl.DateTimeFormat(void 0,{timeZone:r}),fe.set(r,!0)}catch(e){throw fe.set(r,!1),Se(r,t)}}},a.floorDiv=je,a.floorMod=Ce;var Ae=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]}),ke=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)&&Ae(t,e,r);return ke(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(u,"__esModule",{value:!0}),u.isDateTime=u.DateTime=u.isLocalDateTime=u.LocalDateTime=u.isDate=u.Date=u.isTime=u.Time=u.isLocalTime=u.LocalTime=u.isDuration=u.Duration=void 0,c(Y)),Ne=s,xe=t,De=c(i),c={value:!0,enumerable:!1,configurable:!1,writable:!1},Le="__isDuration__",Ue="__isLocalTime__",Fe="__isTime__",Be="__isDate__",We="__isLocalDateTime__",qe="__isDateTime__",f=(ze.prototype.toString=function(){return l.durationToIsoString(this.months,this.days,this.seconds,this.nanoseconds)},ze);function ze(e,t,r,n){this.months=(0,Ne.assertNumberOrInteger)(e,"Months"),this.days=(0,Ne.assertNumberOrInteger)(t,"Days"),(0,Ne.assertNumberOrInteger)(r,"Seconds"),(0,Ne.assertNumberOrInteger)(n,"Nanoseconds"),this.seconds=l.normalizeSecondsForDuration(r,n),this.nanoseconds=l.normalizeNanosecondsForDuration(n),Object.freeze(this)}u.Duration=f,Object.defineProperty(f.prototype,Le,c),u.isDuration=function(e){return Ze(e,Le)};Ve.fromStandardDate=function(e,t){Xe(e,t);t=l.totalNanoseconds(e,t);return new Ve(e.getHours(),e.getMinutes(),e.getSeconds(),t instanceof De.default?t.toInt():"bigint"==typeof t?(0,De.int)(t).toInt():t)},Ve.prototype.toString=function(){return l.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)};f=Ve;function Ve(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)}u.LocalTime=f,Object.defineProperty(f.prototype,Ue,c),u.isLocalTime=function(e){return Ze(e,Ue)};He.fromStandardDate=function(e,t){return Xe(e,t),new He(e.getHours(),e.getMinutes(),e.getSeconds(),(0,De.toNumber)(l.totalNanoseconds(e,t)),l.timeZoneOffsetInSeconds(e))},He.prototype.toString=function(){return l.timeToIsoString(this.hour,this.minute,this.second,this.nanosecond)+l.timeZoneOffsetToIsoString(this.timeZoneOffsetSeconds)};f=He;function He(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,Ne.assertNumberOrInteger)(o,"Time zone offset in seconds"),Object.freeze(this)}u.Time=f,Object.defineProperty(f.prototype,Fe,c),u.isTime=function(e){return Ze(e,Fe)};Ge.fromStandardDate=function(e){return Xe(e),new Ge(e.getFullYear(),e.getMonth()+1,e.getDate())},Ge.prototype.toStandardDate=function(){return l.isoStringToStandardDate(this.toString())},Ge.prototype.toString=function(){return l.dateToIsoString(this.year,this.month,this.day)};f=Ge;function Ge(e,t,r){this.year=l.assertValidYear(e),this.month=l.assertValidMonth(t),this.day=l.assertValidDay(r),Object.freeze(this)}u.Date=f,Object.defineProperty(f.prototype,Be,c),u.isDate=function(e){return Ze(e,Be)};Ye.fromStandardDate=function(e,t){return Xe(e,t),new Ye(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,De.toNumber)(l.totalNanoseconds(e,t)))},Ye.prototype.toStandardDate=function(){return l.isoStringToStandardDate(this.toString())},Ye.prototype.toString=function(){return Qe(this.year,this.month,this.day,this.hour,this.minute,this.second,this.nanosecond)};f=Ye;function Ye(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)}u.LocalDateTime=f,Object.defineProperty(f.prototype,We,c),u.isLocalDateTime=function(e){return Ze(e,We)};Ke.fromStandardDate=function(e,t){return Xe(e,t),new Ke(e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),(0,De.toNumber)(l.totalNanoseconds(e,t)),l.timeZoneOffsetInSeconds(e),null)},Ke.prototype.toStandardDate=function(){return l.toStandardDate(this._toUTC())},Ke.prototype.toString=function(){var e;return Qe(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,"]"):"")},Ke.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,De.int)(e).multiply(1e3).add((0,De.int)(this.nanosecond).div(1e6)).toNumber()};f=Ke;function Ke(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,xe.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,Ne.assertNumberOrInteger)(e,"Time zone offset in seconds"),o[0]=e);n&&((0,Ne.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 Ze(e,t){return null!=e&&!0===e[t]}function Qe(e,t,r,n,o,i,u){return l.dateToIsoString(e,t,r)+"T"+l.timeToIsoString(n,o,i,u)}function Xe(e,t){(0,Ne.assertValidDate)(e,"Standard date"),null!=t&&(0,Ne.assertNumberOrInteger)(t,"Nanosecond")}u.DateTime=f,Object.defineProperty(f.prototype,qe,c),u.isDateTime=function(e){return Ze(e,qe)};var f={},Je=(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,n),c={value:!0,enumerable:!1,configurable:!1,writable:!1},$e="__isNode__",et="__isRelationship__",tt="__isUnboundRelationship__",rt="__isPath__",nt="__isPathSegment__";function ot(e,t){return null!=e&&!0===e[t]}ut.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,Je.stringify)(this.properties[r[t]]);e+="}"}return e+=")"};var it=ut;function ut(e,t,r,n){this.identity=e,this.labels=t,this.properties=r,this.elementId=pt(n,function(){return e.toString()})}f.Node=it,Object.defineProperty(it.prototype,$e,c),f.isNode=function(e){return ot(e,$e)};st.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,Je.stringify)(this.properties[t[r]]);e+="}"}return e+="]->("+this.endNodeElementId+")"};var at=st;function st(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=pt(i,function(){return e.toString()}),this.startNodeElementId=pt(u,function(){return t.toString()}),this.endNodeElementId=pt(a,function(){return r.toString()})}f.Relationship=at,Object.defineProperty(at.prototype,et,c),f.isRelationship=function(e){return ot(e,et)};ct.prototype.bind=function(e,t){return new at(this.identity,e,t,this.type,this.properties,this.elementId)},ct.prototype.bindTo=function(e,t){return new at(this.identity,e.identity,t.identity,this.type,this.properties,this.elementId,e.elementId,t.elementId)},ct.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,Je.stringify)(this.properties[t[r]]);e+="}"}return e+="]->"};it=ct;function ct(e,t,r,n){this.identity=e,this.type=t,this.properties=r,this.elementId=pt(n,function(){return e.toString()})}f.UnboundRelationship=it,Object.defineProperty(it.prototype,tt,c),f.isUnboundRelationship=function(e){return ot(e,tt)};function lt(e,t,r){this.start=e,this.relationship=t,this.end=r}f.PathSegment=lt,Object.defineProperty(lt.prototype,nt,c),f.isPathSegment=function(e){return ot(e,nt)};function ft(e,t,r){this.start=e,this.end=t,this.segments=r,this.length=r.length}function pt(e,t){return null==e?t():e}f.Path=ft,Object.defineProperty(ft.prototype,rt,c),f.isPath=function(e){return ot(e,rt)};var it={},dt=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}}}},ht=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.")},bt=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},yt=(Object.defineProperty(it,"__esModule",{value:!0}),t);function _t(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)}_t.prototype.forEach=function(e){var t,r;try{for(var n=ht(this.entries()),o=n.next();!o.done;o=n.next()){var i=bt(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}}},_t.prototype.map=function(e){var t,r,n=[];try{for(var o=ht(this.entries()),i=o.next();!i.done;i=o.next()){var u=bt(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},_t.prototype.entries=function(){var t;return dt(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]}})},_t.prototype.values=function(){var t;return dt(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]}})},_t.prototype[Symbol.iterator]=function(){var t;return dt(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]}})},_t.prototype.toObject=function(){var t,e,r={};try{for(var n=ht(this.entries()),o=n.next();!o.done;o=n.next()){var i=bt(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},_t.prototype.get=function(e){var t;if("number"!=typeof e){if(void 0===(t=this._fieldLookup[e]))throw(0,yt.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,yt.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]},_t.prototype.has=function(e){return"number"==typeof e?0<=e&&e<this._fields.length:void 0!==this._fieldLookup[e]},it.default=_t;var c={},vt=(Object.defineProperty(c,"__esModule",{value:!0}),c.isPoint=c.Point=void 0,s),mt="__isPoint__",p=(gt.prototype.toString=function(){return null==this.z||isNaN(this.z)?"Point{srid=".concat(Ot(this.srid),", x=").concat(Ot(this.x),", y=").concat(Ot(this.y),"}"):"Point{srid=".concat(Ot(this.srid),", x=").concat(Ot(this.x),", y=").concat(Ot(this.y),", z=").concat(Ot(this.z),"}")},gt);function gt(e,t,r,n){this.srid=(0,vt.assertNumberOrInteger)(e,"SRID"),this.x=(0,vt.assertNumber)(t,"X coordinate"),this.y=(0,vt.assertNumber)(r,"Y coordinate"),this.z=null==n?n:(0,vt.assertNumber)(n,"Z coordinate"),Object.freeze(this)}function Ot(e){return Number.isInteger(e)?e.toString()+".0":e.toString()}c.Point=p,Object.defineProperty(p.prototype,mt,{value:!0,enumerable:!1,configurable:!1,writable:!1}),c.isPoint=function(e){return null!=e&&!0===e[mt]};var p={},h={},b={},y=(Object.defineProperty(b,"__esModule",{value:!0}),b.FailedObserver=b.CompletedObserver=void 0,wt.prototype.subscribe=function(e){Pt(e,e.onKeys,[]),Pt(e,e.onCompleted,{})},wt.prototype.cancel=function(){},wt.prototype.pause=function(){},wt.prototype.resume=function(){},wt.prototype.prepareToHandleSingleResponse=function(){},wt.prototype.markCompleted=function(){},wt.prototype.onError=function(e){throw new Error("CompletedObserver not supposed to call onError",{cause:e})},wt);function wt(){}function Et(e){var t=e.error,e=e.onError;this._error=t,this._beforeError=e,this._observers=[],this.onError(t)}function Pt(e,t,r){null!=t&&t.bind(e)(r)}b.CompletedObserver=y,Et.prototype.subscribe=function(e){Pt(e,e.onError,this._error),this._observers.push(e)},Et.prototype.onError=function(t){Pt(this,this._beforeError,t),this._observers.forEach(function(e){return Pt(e,e.onError,t)})},Et.prototype.cancel=function(){},Et.prototype.pause=function(){},Et.prototype.resume=function(){},Et.prototype.markCompleted=function(){},Et.prototype.prepareToHandleSingleResponse=function(){},b.FailedObserver=Et;var y={},St=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]}),Tt=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),_=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)&&St(t,e,r);return Tt(t,e),t},jt=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},Ct=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))},Rt=(Object.defineProperty(y,"__esModule",{value:!0}),y.Bookmarks=void 0,_(s)),_=(It.empty=function(){return At},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(Rt.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(!Rt.isString(o))throw new TypeError("Bookmark value should be a string, given: '".concat(o,"'"));t.add(o)}}return Ct([],jt(t),!1)}throw new TypeError("Bookmarks should either be a string or a string array, given: '".concat(e,"'"))}(e)}var At=new(y.Bookmarks=_)(null);var kt,Mt,_={},Nt=(Object.defineProperty(_,"__esModule",{value:!0}),_.TELEMETRY_APIS=_.BOLT_PROTOCOL_V5_7=_.BOLT_PROTOCOL_V5_6=_.BOLT_PROTOCOL_V5_5=_.BOLT_PROTOCOL_V5_4=_.BOLT_PROTOCOL_V5_3=_.BOLT_PROTOCOL_V5_2=_.BOLT_PROTOCOL_V5_1=_.BOLT_PROTOCOL_V5_0=_.BOLT_PROTOCOL_V4_4=_.BOLT_PROTOCOL_V4_3=_.BOLT_PROTOCOL_V4_2=_.BOLT_PROTOCOL_V4_1=_.BOLT_PROTOCOL_V4_0=_.BOLT_PROTOCOL_V3=_.BOLT_PROTOCOL_V2=_.BOLT_PROTOCOL_V1=_.DEFAULT_POOL_MAX_SIZE=_.DEFAULT_POOL_ACQUISITION_TIMEOUT=_.DEFAULT_CONNECTION_TIMEOUT_MILLIS=_.ACCESS_MODE_WRITE=_.ACCESS_MODE_READ=_.FETCH_ALL=void 0,_.FETCH_ALL=-1,_.DEFAULT_POOL_ACQUISITION_TIMEOUT=6e4,_.DEFAULT_POOL_MAX_SIZE=100,_.DEFAULT_CONNECTION_TIMEOUT_MILLIS=3e4,_.ACCESS_MODE_READ="READ",_.ACCESS_MODE_WRITE="WRITE",_.BOLT_PROTOCOL_V1=1,_.BOLT_PROTOCOL_V2=2,_.BOLT_PROTOCOL_V3=3,_.BOLT_PROTOCOL_V4_0=4,_.BOLT_PROTOCOL_V4_1=4.1,_.BOLT_PROTOCOL_V4_2=4.2,_.BOLT_PROTOCOL_V4_3=4.3,_.BOLT_PROTOCOL_V4_4=4.4,_.BOLT_PROTOCOL_V5_0=5,_.BOLT_PROTOCOL_V5_1=5.1,_.BOLT_PROTOCOL_V5_2=5.2,_.BOLT_PROTOCOL_V5_3=5.3,_.BOLT_PROTOCOL_V5_4=5.4,_.BOLT_PROTOCOL_V5_5=5.5,_.BOLT_PROTOCOL_V5_6=5.6,_.BOLT_PROTOCOL_V5_7=5.7,_.TELEMETRY_APIS={MANAGED_TRANSACTION:0,UNMANAGED_TRANSACTION:1,AUTO_COMMIT_TRANSACTION:2,EXECUTE_QUERY:3},{}),v={},m=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)}),xt=(Object.defineProperty(v,"__esModule",{value:!0}),v.Logger=void 0,t),Dt="error",Lt="warn",Ut="info",Ft="debug",Bt=((g={})[Dt]=0,g[Lt]=1,g[Ut]=2,g[Ft]=3,g),g=(Wt.create=function(e){return null!=(null==e?void 0:e.logging)?new Wt(function(e){if(null==(null==e?void 0:e.level))return"info";var e=e.level,t=Bt[e];if(null!=t||0===t)return e;throw(0,xt.newError)("Illegal logging level: ".concat(e,". Supported levels are: ").concat(Object.keys(Bt).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,xt.newError)("Illegal logger function: ".concat(null!=(e=null==(t=null==e?void 0:e.logger)?void 0:t.toString())?e:"undefined"))}(e)):this.noOp()},Wt.noOp=function(){return zt},Wt.prototype.isErrorEnabled=function(){return Vt(this._level,Dt)},Wt.prototype.error=function(e){this.isErrorEnabled()&&this._loggerFunction(Dt,e)},Wt.prototype.isWarnEnabled=function(){return Vt(this._level,Lt)},Wt.prototype.warn=function(e){this.isWarnEnabled()&&this._loggerFunction(Lt,e)},Wt.prototype.isInfoEnabled=function(){return Vt(this._level,Ut)},Wt.prototype.info=function(e){this.isInfoEnabled()&&this._loggerFunction(Ut,e)},Wt.prototype.isDebugEnabled=function(){return Vt(this._level,Ft)},Wt.prototype.debug=function(e){this.isDebugEnabled()&&this._loggerFunction(Ft,e)},Wt);function Wt(e,t){this._level=e,this._loggerFunction=t}function qt(){return Mt.call(this,Ut,function(e,t){})||this}v.Logger=g,m(qt,Mt=g),qt.prototype.isErrorEnabled=function(){return!1},qt.prototype.error=function(e){},qt.prototype.isWarnEnabled=function(){return!1},qt.prototype.warn=function(e){},qt.prototype.isInfoEnabled=function(){return!1},qt.prototype.info=function(e){},qt.prototype.isDebugEnabled=function(){return!1},qt.prototype.debug=function(e){};var zt=new qt;function Vt(e,t){return Bt[e]>=Bt[t]}var Ht,m=r&&r.__extends||(Ht=function(e,t){return(Ht=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}Ht(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Gt=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())})},Yt=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}}}},Kt=(Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.EMPTY_CONNECTION_HOLDER=Nt.ReadOnlyConnectionHolder=Nt.ConnectionHolder=void 0,t),Zt=s,Qt=_,Xt=y,Jt=v,g=($t.prototype.mode=function(){return this._mode},$t.prototype.database=function(){return this._database},$t.prototype.setDatabase=function(e){this._database=e},$t.prototype.bookmarks=function(){return this._bookmarks},$t.prototype.connectionProvider=function(){return this._connectionProvider},$t.prototype.referenceCount=function(){return this._referenceCount},$t.prototype.initializeConnection=function(){return 0!==this._referenceCount||null==this._connectionProvider?(this._referenceCount++,!1):(this._connectionPromise=this._createConnectionPromise(this._connectionProvider),this._referenceCount++,!0)},$t.prototype._createConnectionPromise=function(o){return Gt(this,void 0,void 0,function(){var t,r,n;return Yt(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.auth=this._auth,n)])];case 2:return[2,e.sent()]}})})},$t.prototype._getBookmarks=function(){return Gt(this,void 0,void 0,function(){return Yt(this,function(e){switch(e.label){case 0:return[4,this._getConnectionAcquistionBookmarks()];case 1:return[2,e.sent()]}})})},$t.prototype.getConnection=function(){return this._connectionPromise},$t.prototype.releaseConnection=function(){return 0===this._referenceCount?this._connectionPromise:(this._referenceCount--,0===this._referenceCount?this._releaseConnection():this._connectionPromise)},$t.prototype.close=function(e){return this._closed=!0,0===this._referenceCount?this._connectionPromise:(this._referenceCount=0,this._releaseConnection(e))},$t.prototype.log=function(){return this._log},$t.prototype._releaseConnection=function(t){return this._connectionPromise=this._connectionPromise.then(function(e){return null!=e?e.isOpen()&&(e.hasOngoingObservableRequests()||!0===t)?e.resetAndFlush().catch(or).then(function(){return e.release().then(function(){return null})}):e.release().then(function(){return null}):Promise.resolve(null)}).catch(this._logError),this._connectionPromise},$t.prototype._logError=function(e){return this._log.isWarnEnabled()&&this._log.warn("ConnectionHolder got an error while releasing the connection. Error ".concat(e,". Stacktrace: ").concat(e.stack)),null},$t);function $t(e){var t=e.mode,r=e.database,r=void 0===r?"":r,n=e.bookmarks,o=e.connectionProvider,i=e.impersonatedUser,u=e.onDatabaseNameResolved,a=e.getConnectionAcquistionBookmarks,s=e.auth,e=e.log;this._mode=null!=t?t:Qt.ACCESS_MODE_WRITE,this._closed=!1,this._database=null!=r?(0,Zt.assertString)(r,"database"):"",this._bookmarks=null!=n?n:Xt.Bookmarks.empty(),this._connectionProvider=o,this._impersonatedUser=i,this._referenceCount=0,this._connectionPromise=Promise.resolve(null),this._onDatabaseNameResolved=u,this._auth=s,this._log=e,this._logError=this._logError.bind(this),this._getConnectionAcquistionBookmarks=null!=a?a:function(){return Promise.resolve(Xt.Bookmarks.empty())}}Nt.ConnectionHolder=g;m(rr,er=g),rr.prototype.initializeConnection=function(){return 0!==this._connectionHolder.referenceCount()},rr.prototype.getConnection=function(){return this._connectionHolder.getConnection()},rr.prototype.releaseConnection=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})},rr.prototype.close=function(){return this._connectionHolder.getConnection().catch(function(){return Promise.resolve(null)})};var er,tr,O=rr;function rr(e){var t=er.call(this,{mode:e.mode(),database:e.database(),bookmarks:e.bookmarks(),getConnectionAcquistionBookmarks:e._getConnectionAcquistionBookmarks,connectionProvider:e.connectionProvider(),log:e.log()})||this;return t._connectionHolder=e,t}function nr(){return tr.call(this,{log:Jt.Logger.create({})})||this}Nt.ReadOnlyConnectionHolder=O,Nt.default=O,m(nr,tr=g),nr.prototype.mode=function(){},nr.prototype.database=function(){},nr.prototype.initializeConnection=function(){return!0},nr.prototype.getConnection=function(){return Gt(this,void 0,void 0,function(){return Yt(this,function(e){switch(e.label){case 0:return[4,Promise.reject((0,Kt.newError)("This connection holder does not serve connections"))];case 1:return[2,e.sent()]}})})},nr.prototype.releaseConnection=function(){return Gt(this,void 0,void 0,function(){return Yt(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})},nr.prototype.close=function(){return Gt(this,void 0,void 0,function(){return Yt(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(null)];case 1:return[2,e.sent()]}})})};O=new nr;function or(e){return null}Nt.EMPTY_CONNECTION_HOLDER=O;var m={},ir=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]}),ur=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),g=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)&&ir(t,e,r);return ur(t,e),t},ar=(Object.defineProperty(m,"__esModule",{value:!0}),m.TxConfig=void 0,g(s)),sr=t,cr=i,O=(lr.empty=function(){return fr},lr.prototype.isEmpty=function(){return Object.values(this).every(function(e){return null==e})},lr);function lr(e,t){var r;null!=(r=e)&&ar.assertObject(r,"Transaction config"),this.timeout=function(e,t){if(ar.isObject(e)&&null!=e.timeout){ar.assertNumberOrInteger(e.timeout,"Transaction timeout"),!function(e){return"number"==typeof e.timeout&&!Number.isInteger(e.timeout)}(e)||!0!==(null==t?void 0:t.isInfoEnabled())||null==t||t.info("Transaction timeout expected to be an integer, got: ".concat(e.timeout,". The value will be rounded up."));t=(0,cr.int)(e.timeout,{ceilFloat:!0});if(t.isNegative())throw(0,sr.newError)("Transaction timeout should not be negative");return t}return null}(e,t),this.metadata=function(e){if(ar.isObject(e)&&null!=e.metadata){e=e.metadata;if(ar.assertObject(e,"config.metadata"),0!==Object.keys(e).length)return e}return null}(e)}var fr=new(m.TxConfig=O)({});var g={},pr=r&&r.__assign||function(){return(pr=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)},dr=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())})},hr=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}}}},br=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},yr=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))},_r=(Object.defineProperty(g,"__esModule",{value:!0}),g.TransactionExecutor=void 0,t),vr=_;function mr(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,yr([e,t],br(r),!1))}function gr(e){return clearTimeout(e)}function Or(e,t,r,n,o){void 0===o&&(o={setTimeout:mr,clearTimeout:gr}),this._maxRetryTimeMs=wr(e,3e4),this._initialRetryDelayMs=wr(t,1e3),this._multiplier=wr(r,2),this._jitterFactor=wr(n,.2),this._setTimeout=o.setTimeout,this._clearTimeout=o.clearTimeout,this._inFlightTimeoutIds=[],this.pipelineBegin=!1,this.telemetryApi=vr.TELEMETRY_APIS.MANAGED_TRANSACTION,this._verifyAfterConstruction()}function wr(e,t){return null!=e?e:t}Or.prototype.execute=function(n,o,i){var u=this,a={apiTransactionConfig:{api:this.telemetryApi,onTelemetrySuccess:function(){a.apiTransactionConfig=void 0}}};return new Promise(function(e,t){u._executeTransactionInsidePromise(n,o,e,t,i,a).catch(t)}).catch(function(e){var t=Date.now(),r=u._initialRetryDelayMs;return u._retryTransactionPromise(n,o,e,t,r,i,a)})},Or.prototype.close=function(){var t=this;this._inFlightTimeoutIds.forEach(function(e){return t._clearTimeout(e)}),this._inFlightTimeoutIds=[]},Or.prototype._retryTransactionPromise=function(o,i,e,r,u,a,s){var c=this;return Date.now()-r>this._maxRetryTimeMs||!(0,_r.isRetriableError)(e)?Promise.reject(e):new Promise(function(e,t){var r=c._computeDelayWithJitter(u),n=c._setTimeout(function(){c._inFlightTimeoutIds=c._inFlightTimeoutIds.filter(function(e){return e!==n}),c._executeTransactionInsidePromise(o,i,e,t,a,s).catch(t)},r);c._inFlightTimeoutIds.push(n)}).catch(function(e){var t=u*c._multiplier;return c._retryTransactionPromise(o,i,e,r,t,a,s)})},Or.prototype._executeTransactionInsidePromise=function(u,a,s,c,l,f){return dr(this,void 0,void 0,function(){var t,r,n,o,i=this;return hr(this,function(e){switch(e.label){case 0:return(e.trys.push([0,4,,5]),r=u(null!=(null==f?void 0:f.apiTransactionConfig)?pr({},null==f?void 0:f.apiTransactionConfig):void 0),this.pipelineBegin)?(n=r,[3,3]):[3,1];case 1:return[4,r];case 2:n=e.sent(),e.label=3;case 3:return t=n,[3,5];case 4:return o=e.sent(),c(o),[2];case 5:return o=(null!=l?l:function(e){return e})(t),this._safeExecuteTransactionWork(o,a).then(function(e){return i._handleTransactionWorkSuccess(e,t,s,c)}).catch(function(e){return i._handleTransactionWorkFailure(e,t,c)}),[2]}})})},Or.prototype._safeExecuteTransactionWork=function(e,t){try{var r=t(e);return Promise.resolve(r)}catch(e){return Promise.reject(e)}},Or.prototype._handleTransactionWorkSuccess=function(e,t,r,n){t.isOpen()?t.commit().then(function(){r(e)}).catch(function(e){n(e)}):r(e)},Or.prototype._handleTransactionWorkFailure=function(e,t,r){t.isOpen()?t.rollback().catch(function(e){}).then(function(){return r(e)}).catch(r):r(e)},Or.prototype._computeDelayWithJitter=function(e){var t=e*this._jitterFactor,r=e-t,e=e+t;return Math.random()*(e-r)+r},Or.prototype._verifyAfterConstruction=function(){if(this._maxRetryTimeMs<0)throw(0,_r.newError)("Max retry time should be >= 0: "+this._maxRetryTimeMs.toString());if(this._initialRetryDelayMs<0)throw(0,_r.newError)("Initial retry delay should >= 0: "+this._initialRetryDelayMs.toString());if(this._multiplier<1)throw(0,_r.newError)("Multiplier should be >= 1.0: "+this._multiplier.toString());if(this._jitterFactor<0||1<this._jitterFactor)throw(0,_r.newError)("Jitter factor should be in [0.0, 1.0]: "+this._jitterFactor.toFixed())},g.TransactionExecutor=Or;var O={},Er=r&&r.__assign||function(){return(Er=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)},Pr=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},Sr=(Object.defineProperty(O,"__esModule",{value:!0}),O.Url=O.formatIPv6Address=O.formatIPv4Address=O.defaultPortForScheme=O.parseDatabaseUrl=void 0,s),Tr=7687,jr=7474,Cr=7473,Rr=function(e,t,r,n,o){this.scheme=e,this.host=t,this.port=r,this.hostAndPort=n,this.query=o};function Ir(e,t,r){if(""===(e=(null!=e?e:"").trim()))throw new Error("Illegal empty ".concat(t," in URL query '").concat(r,"'"));return e}function Ar(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 kr(e){return"http"===e?jr:"https"===e?Cr:Tr}O.Url=Rr,O.parseDatabaseUrl=function(e){(0,Sr.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]),Pr((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=Er(Er({},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(":")?Ar(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)?kr(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=Ir(e[0],"key",r),e=Ir(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)?Pr(t.split("?"),2)[1]:null,e);return new Rr(n,o,u,i,r)},O.formatIPv4Address=function(e,t){return"".concat(e,":").concat(t)},O.formatIPv6Address=function(e,t){return e=Ar(e),"".concat(e,":").concat(t)},O.defaultPortForScheme=kr;var w={},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]}),Nr=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),xr=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 Nr(t,e),t},Dr=(Object.defineProperty(w,"__esModule",{value:!0}),w.ServerAddress=void 0,s),Lr=xr(O);function Ur(e,t,r,n){this._host=(0,Dr.assertString)(e,"host"),this._resolved=null!=t?(0,Dr.assertString)(t,"resolved"):null,this._port=(0,Dr.assertNumber)(r,"port"),this._hostPort=n,this._stringValue=null!=t?"".concat(n,"(").concat(t,")"):"".concat(n)}Ur.prototype.host=function(){return this._host},Ur.prototype.resolvedHost=function(){return null!=this._resolved?this._resolved:this._host},Ur.prototype.port=function(){return this._port},Ur.prototype.resolveWith=function(e){return new Ur(this._host,e,this._port,this._hostPort)},Ur.prototype.asHostPort=function(){return this._hostPort},Ur.prototype.asKey=function(){return this._hostPort},Ur.prototype.toString=function(){return this._stringValue},Ur.fromUrl=function(e){e=Lr.parseDatabaseUrl(e);return new Ur(e.host,null,e.port,e.hostAndPort)},w.ServerAddress=Ur;var xr={},E={};function Fr(){}Object.defineProperty(E,"__esModule",{value:!0}),Fr.prototype.resolve=function(){throw new Error("Abstract function")},Fr.prototype._resolveToItself=function(e){return Promise.resolve([e])},E.default=Fr;var P={},Br=(Object.defineProperty(P,"__esModule",{value:!0}),w);function Wr(e){return Promise.resolve([e])}function qr(e){this._resolverFunction=null!=e?e:Wr}qr.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 Br.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=qr;var zr,S=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},E=(Object.defineProperty(xr,"__esModule",{value:!0}),xr.ConfiguredCustomResolver=xr.BaseHostNameResolver=void 0,S(E)),E=(xr.BaseHostNameResolver=E.default,S(P)),S=(xr.ConfiguredCustomResolver=E.default,{}),E={};Object.defineProperty(E,"__esModule",{value:!0}),E.fromVersion=void 0,E.fromVersion=function(e,t){var r=null!=(t=(t=void 0===t?function(){return{get userAgent(){}}}:t)()).userAgent?t.userAgent.split("(")[1].split(")")[0]:void 0,t=t.userAgent||void 0;return{product:"neo4j-javascript/".concat(e),platform:r,languageDetails:t}},j=S,zr=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]}),T=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||zr(t,e,r)},Object.defineProperty(j,"__esModule",{value:!0}),T(E,j);var T={},E={},j=(Object.defineProperty(E,"__esModule",{value:!0}),E.DEFAULT_ACQUISITION_TIMEOUT=E.DEFAULT_MAX_SIZE=void 0,E.DEFAULT_MAX_SIZE=100,E.DEFAULT_ACQUISITION_TIMEOUT=6e4,Vr.defaultConfig=function(){return new Vr(100,6e4)},Vr.fromDriverConfig=function(e){return new Vr(Gr(e.maxConnectionPoolSize)?e.maxConnectionPoolSize:100,Gr(e.connectionAcquisitionTimeout)?e.connectionAcquisitionTimeout:6e4)},Vr);function Vr(e,t){this.maxSize=Hr(e,100),this.acquisitionTimeout=Hr(t,6e4)}function Hr(e,t){return Gr(e)?e:t}function Gr(e){return 0===e||null!=e}E.default=j;var j={},Yr=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())})},Kr=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}}}},Zr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Qr=(Object.defineProperty(j,"__esModule",{value:!0}),Zr(E)),Xr=t,Jr=v,Zr=($r.prototype.acquire=function(a,s,c){return Yr(this,void 0,void 0,function(){var o,i,u=this;return Kr(this,function(e){switch(e.label){case 0:return o=s.asKey(),i=this._acquireRequests,null==i[o]&&(i[o]=[]),[4,new Promise(function(e,t){var r=setTimeout(function(){var e,t=i[o];null!=t&&(i[o]=t.filter(function(e){return e!==n})),n.isCompleted()||(t=u.activeResourceCount(s),e=u.has(s)?u._pools[o].length:0,n.reject((0,Xr.newError)("Connection acquisition timed out in ".concat(u._acquisitionTimeout," ms. Pool status: Active conn count = ").concat(t,", Idle conn count = ").concat(e,"."))))},u._acquisitionTimeout),n=("object"==typeof r&&r.unref(),new rn(o,a,c,e,t,r,u._log));i[o].push(n),u._processPendingAcquireRequests(s)})];case 1:return[2,e.sent()]}})})},$r.prototype.purge=function(t){return Yr(this,void 0,void 0,function(){return Kr(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t.asKey())];case 1:return[2,e.sent()]}})})},$r.prototype.apply=function(e,t){e=e.asKey();e in this._pools&&this._pools[e].apply(t)},$r.prototype.close=function(){return Yr(this,void 0,void 0,function(){var r=this;return Kr(this,function(e){switch(e.label){case 0:return this._closed=!0,[4,Promise.all(Object.keys(this._pools).map(function(t){return Yr(r,void 0,void 0,function(){return Kr(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t)];case 1:return[2,e.sent()]}})})})).then()];case 1:return[2,e.sent()]}})})},$r.prototype.keepAll=function(o){return Yr(this,void 0,void 0,function(){var t,r,n=this;return Kr(this,function(e){switch(e.label){case 0:return t=o.map(function(e){return e.asKey()}),r=Object.keys(this._pools),r=r.filter(function(e){return!t.includes(e)}),[4,Promise.all(r.map(function(t){return Yr(n,void 0,void 0,function(){return Kr(this,function(e){switch(e.label){case 0:return[4,this._purgeKey(t)];case 1:return[2,e.sent()]}})})})).then()];case 1:return[2,e.sent()]}})})},$r.prototype.has=function(e){return e.asKey()in this._pools},$r.prototype.activeResourceCount=function(e){return null!=(e=this._activeResourceCounts[e.asKey()])?e:0},$r.prototype._getOrInitializePoolFor=function(e){var t=this._pools[e];return null==t&&(t=new sn,this._pools[e]=t,this._pendingCreates[e]=0),t},$r.prototype._acquire=function(c,l,f){return Yr(this,void 0,void 0,function(){var t,n,r,o,i,u,a,s=this;return Kr(this,function(e){switch(e.label){case 0:if(this._closed)throw(0,Xr.newError)("Pool is closed, it is no more able to serve requests.");if(t=l.asKey(),n=this._getOrInitializePoolFor(t),f)return[3,10];e.label=1;case 1:if(!(0<n.length))return[3,10];if(null==(r=n.pop()))return[3,1];en(t,this._activeResourceCounts),null!=this._removeIdleObserver&&this._removeIdleObserver(r),o=!1,e.label=2;case 2:return e.trys.push([2,4,,6]),[4,this._validateOnAcquire(c,r)];case 3:return o=e.sent(),[3,6];case 4:return i=e.sent(),tn(t,this._activeResourceCounts),n.removeInUse(r),[4,this._destroy(r)];case 5:throw e.sent(),i;case 6:return o?(this._log.isDebugEnabled()&&this._log.debug("".concat(r," acquired from the pool ").concat(t)),[2,{resource:r,pool:n}]):[3,7];case 7:return tn(t,this._activeResourceCounts),n.removeInUse(r),[4,this._destroy(r)];case 8:e.sent(),e.label=9;case 9:return[3,1];case 10:if(0<this._maxSize&&this.activeResourceCount(l)+this._pendingCreates[t]>=this._maxSize)return[2,{resource:null,pool:n}];this._pendingCreates[t]=this._pendingCreates[t]+1,e.label=11;case 11:return(e.trys.push([11,,15,16]),this.activeResourceCount(l)+n.length>=this._maxSize&&f)?null==(a=n.pop())?[3,13]:(null!=this._removeIdleObserver&&this._removeIdleObserver(a),n.removeInUse(a),[4,this._destroy(a)]):[3,13];case 12:e.sent(),e.label=13;case 13:return[4,this._create(c,l,function(t,r){return Yr(s,void 0,void 0,function(){return Kr(this,function(e){switch(e.label){case 0:return[4,this._release(t,r,n)];case 1:return[2,e.sent()]}})})})];case 14:return u=e.sent(),n.pushInUse(u),en(t,this._activeResourceCounts),this._log.isDebugEnabled()&&this._log.debug("".concat(u," created for the pool ").concat(t)),[3,16];case 15:return this._pendingCreates[t]=this._pendingCreates[t]-1,[7];case 16:return[2,{resource:u,pool:n}]}})})},$r.prototype._release=function(n,o,i){return Yr(this,void 0,void 0,function(){var t,r=this;return Kr(this,function(e){switch(e.label){case 0:t=n.asKey(),e.label=1;case 1:return(e.trys.push([1,,9,10]),i.isActive())?[4,this._validateOnRelease(o)]:[3,6];case 2:return e.sent()?[3,4]:(this._log.isDebugEnabled()&&this._log.debug("".concat(o," destroyed and can't be released to the pool ").concat(t," because it is not functional")),i.removeInUse(o),[4,this._destroy(o)]);case 3:return e.sent(),[3,5];case 4:null!=this._installIdleObserver&&this._installIdleObserver(o,{onError:function(e){r._log.debug("Idle connection ".concat(o," destroyed because of error: ").concat(e));e=r._pools[t];null!=e&&(r._pools[t]=e.filter(function(e){return e!==o}),e.removeInUse(o)),r._destroy(o).catch(function(){})}}),i.push(o),this._log.isDebugEnabled()&&this._log.debug("".concat(o," released to the pool ").concat(t)),e.label=5;case 5:return[3,8];case 6:return this._log.isDebugEnabled()&&this._log.debug("".concat(o," destroyed and can't be released to the pool ").concat(t," because pool has been purged")),i.removeInUse(o),[4,this._destroy(o)];case 7:e.sent(),e.label=8;case 8:return[3,10];case 9:return tn(t,this._activeResourceCounts),this._processPendingAcquireRequests(n),[7];case 10:return[2]}})})},$r.prototype._purgeKey=function(o){return Yr(this,void 0,void 0,function(){var t,r,n;return Kr(this,function(e){switch(e.label){case 0:if(t=this._pools[o],r=[],null==t)return[3,2];for(;0<t.length;)null!=(n=t.pop())&&(null!=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]}})})},$r.prototype._processPendingAcquireRequests=function(r){var n,o=this,i=r.asKey(),e=this._acquireRequests[i];null!=e&&(null!=(n=e.shift())?this._acquire(n.context,r,n.requireNew).catch(function(e){return n.reject(e),{resource:null,pool:null}}).then(function(e){var t=e.resource,e=e.pool;null!=t&&null!=e?n.isCompleted()?o._release(r,t,e).catch(function(e){o._log.isDebugEnabled()&&o._log.debug("".concat(t," could not be release back to the pool. Cause: ").concat(e))}):n.resolve(t):n.isCompleted()||(null==o._acquireRequests[i]&&(o._acquireRequests[i]=[]),o._acquireRequests[i].unshift(n))}).catch(function(e){return n.reject(e)}):delete this._acquireRequests[i])},$r);function $r(e){var t=e.create,t=void 0===t?function(e,t,r){return Yr(s,void 0,void 0,function(){return Kr(this,function(e){switch(e.label){case 0:return[4,Promise.reject(new Error("Not implemented"))];case 1:return[2,e.sent()]}})})}:t,r=e.destroy,r=void 0===r?function(e){return Yr(s,void 0,void 0,function(){return Kr(this,function(e){switch(e.label){case 0:return[4,Promise.resolve()];case 1:return[2,e.sent()]}})})}:r,n=e.validateOnAcquire,n=void 0===n?function(e,t){return!0}:n,o=e.validateOnRelease,o=void 0===o?function(e){return!0}:o,i=e.installIdleObserver,i=void 0===i?function(e,t){}:i,u=e.removeIdleObserver,u=void 0===u?function(e){}:u,a=e.config,a=void 0===a?Qr.default.defaultConfig():a,e=e.log,e=void 0===e?Jr.Logger.noOp():e,s=this;this._create=t,this._destroy=r,this._validateOnAcquire=n,this._validateOnRelease=o,this._installIdleObserver=i,this._removeIdleObserver=u,this._maxSize=a.maxSize,this._acquisitionTimeout=a.acquisitionTimeout,this._pools={},this._pendingCreates={},this._acquireRequests={},this._activeResourceCounts={},this._release=this._release.bind(this),this._log=e,this._closed=!1}function en(e,t){var r=null!=(r=t[e])?r:0;t[e]=r+1}function tn(e,t){var r=(null!=(r=t[e])?r:0)-1;0<r?t[e]=r:delete t[e]}Object.defineProperty(nn.prototype,"context",{get:function(){return this._context},enumerable:!1,configurable:!0}),Object.defineProperty(nn.prototype,"requireNew",{get:function(){var e;return null!=(e=this._config.requireNew)&&e},enumerable:!1,configurable:!0}),nn.prototype.isCompleted=function(){return this._completed},nn.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))},nn.prototype.reject=function(e){this._completed||(this._completed=!0,clearTimeout(this._timeoutId),this._reject(e))};var rn=nn;function nn(e,t,r,n,o,i,u){this._key=e,this._context=t,this._resolve=n,this._reject=o,this._timeoutId=i,this._log=u,this._completed=!1,this._config=null!=r?r:{}}cn.prototype.isActive=function(){return this._active},cn.prototype.close=function(){this._active=!1,this._elements=[],this._elementsInUse=new Set},cn.prototype.filter=function(e){return this._elements=this._elements.filter(e),this},cn.prototype.apply=function(e){this._elements.forEach(e),this._elementsInUse.forEach(e)},Object.defineProperty(cn.prototype,"length",{get:function(){return this._elements.length},enumerable:!1,configurable:!0}),cn.prototype.pop=function(){var e=this._elements.pop();return null!=e&&this._elementsInUse.add(e),e},cn.prototype.push=function(e){return this._elementsInUse.delete(e),this._elements.push(e)},cn.prototype.pushInUse=function(e){this._elementsInUse.add(e)},cn.prototype.removeInUse=function(e){this._elementsInUse.delete(e)};var on,un,an,sn=cn;function cn(){this._active=!0,this._elements=[],this._elementsInUse=new Set}j.default=Zr,Zr=T,on=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]}),un=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),pn=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)&&on(t,e,r);return un(t,e),t},C=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.DEFAULT_MAX_SIZE=Zr.DEFAULT_ACQUISITION_TIMEOUT=Zr.PoolConfig=Zr.Pool=void 0,an=pn(E),Zr.PoolConfig=an.default,Object.defineProperty(Zr,"DEFAULT_ACQUISITION_TIMEOUT",{enumerable:!0,get:function(){return an.DEFAULT_ACQUISITION_TIMEOUT}}),Object.defineProperty(Zr,"DEFAULT_MAX_SIZE",{enumerable:!0,get:function(){return an.DEFAULT_MAX_SIZE}}),pn=C(j),Zr.Pool=pn.default,Zr.default=pn.default;var ln=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]}),fn=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),E=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)&&ln(t,e,r);return fn(t,e),t},C=(Object.defineProperty(h,"__esModule",{value:!0}),h.pool=h.boltAgent=h.objectUtil=h.resolver=h.serverAddress=h.urlUtil=h.logger=h.transactionExecutor=h.txConfig=h.connectionHolder=h.constants=h.bookmarks=h.observer=h.temporalUtil=h.util=void 0,E(s)),j=(h.util=C,E(Y)),Zr=(h.temporalUtil=j,E(b)),pn=(h.observer=Zr,E(y)),C=(h.bookmarks=pn,E(_)),Y=(h.constants=C,E(Nt)),j=(h.connectionHolder=Y,E(m)),Zr=(h.txConfig=j,E(g)),pn=(h.transactionExecutor=Zr,E(v)),C=(h.logger=pn,E(O)),Y=(h.urlUtil=C,E(w)),j=(h.serverAddress=Y,E(xr)),Zr=(h.resolver=j,E(o)),pn=(h.objectUtil=Zr,E(S)),O=(h.boltAgent=pn,E(T)),C=(h.pool=O,{}),dn=r&&r.__assign||function(){return(dn=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)},hn=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]}),bn=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)&&hn(t,e,r);return bn(t,e),t},yn=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},_n=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))},vn=(Object.defineProperty(C,"__esModule",{value:!0}),C.buildNotificationsFromMetadata=C.buildGqlStatusObjectFromMetadata=C.polyfillNotification=C.polyfillGqlStatusObject=C.GqlStatusObject=C.Notification=C.notificationClassification=C.notificationCategory=C.notificationSeverityLevel=void 0,w(n)),mn=h,gn=V,On={WARNING:{gql_status:"01N42",status_description:"warn: unknown warning"},NO_DATA:{gql_status:"02N42",status_description:"note: no data - unknown subcondition"},INFORMATION:{gql_status:"03N42",status_description:"info: unknown notification"},ERROR:{gql_status:"50N42",status_description:"error: general processing exception - unexpected error"}},wn={WARNING:"WARNING",INFORMATION:"INFORMATION",UNKNOWN:"UNKNOWN"},En=(C.notificationSeverityLevel=wn,Object.freeze(wn),Object.values(wn)),Y={HINT:"HINT",UNRECOGNIZED:"UNRECOGNIZED",UNSUPPORTED:"UNSUPPORTED",PERFORMANCE:"PERFORMANCE",DEPRECATION:"DEPRECATION",TOPOLOGY:"TOPOLOGY",SECURITY:"SECURITY",GENERIC:"GENERIC",SCHEMA:"SCHEMA",UNKNOWN:"UNKNOWN"},Pn=(C.notificationCategory=Y,Object.freeze(Y),Object.values(Y)),Sn=Y,Tn=(C.notificationClassification=Sn,function(e){this.code=e.code,this.title=e.title,this.description=e.description,this.severity=e.severity,this.position=Nn(e.position),this.severityLevel=xn(e.severity),this.rawSeverityLevel=e.severity,this.category=Dn(e.category),this.rawCategory=e.category}),jn=(C.Notification=Tn,Object.defineProperty(Cn.prototype,"diagnosticRecordAsJsonString",{get:function(){return vn.stringify(this.diagnosticRecord,{useCustomToString:!0})},enumerable:!1,configurable:!0}),Cn);function Cn(e){var t;this.gqlStatus=e.gql_status,this.statusDescription=e.status_description,this.diagnosticRecord=null!=(t=e.diagnostic_record)?t:{},this.position=null!=this.diagnosticRecord._position?Nn(this.diagnosticRecord._position):void 0,this.severity=xn(this.diagnosticRecord._severity),this.rawSeverity=this.diagnosticRecord._severity,this.classification=Dn(this.diagnosticRecord._classification),this.rawClassification=this.diagnosticRecord._classification,this.isNotification=null!=e.neo4j_code,Object.freeze(this)}function Rn(e){var t;if(null!=e.neo4j_code)return new Tn({code:e.neo4j_code,title:e.title,description:e.description,severity:null==(t=e.diagnostic_record)?void 0:t._severity,category:null==(t=e.diagnostic_record)?void 0:t._classification,position:null==(t=e.diagnostic_record)?void 0:t._position})}function In(e){var t=e.severity===wn.WARNING?On.WARNING:On.INFORMATION,r={gql_status:t.gql_status,status_description:null!=(r=e.description)?r:t.status_description,neo4j_code:e.code,title:e.title,diagnostic_record:dn({},gn.rawPolyfilledDiagnosticRecord)};return null!=e.severity&&(r.diagnostic_record._severity=e.severity),null!=e.category&&(r.diagnostic_record._classification=e.category),null!=e.position&&(r.diagnostic_record._position=e.position),new jn(r)}C.GqlStatusObject=jn,C.polyfillNotification=Rn,C.polyfillGqlStatusObject=In;var An={SUCCESS:new jn({gql_status:"00000",status_description:"note: successful completion",diagnostic_record:gn.rawPolyfilledDiagnosticRecord}),NO_DATA:new jn({gql_status:"02000",status_description:"note: no data",diagnostic_record:gn.rawPolyfilledDiagnosticRecord}),NO_DATA_UNKNOWN_SUBCONDITION:new jn(dn(dn({},On.NO_DATA),{diagnostic_record:gn.rawPolyfilledDiagnosticRecord})),OMITTED_RESULT:new jn({gql_status:"00001",status_description:"note: successful completion - omitted result",diagnostic_record:gn.rawPolyfilledDiagnosticRecord})};Object.freeze(An),C.buildGqlStatusObjectFromMetadata=function(e){if(null!=e.statuses)return e.statuses.map(function(e){return new jn(e)});var t=!0===(null==(t=e.stream_summary)?void 0:t.have_records_streamed)?An.SUCCESS:!1===(null==t?void 0:t.has_keys)?An.OMITTED_RESULT:!0===(null==t?void 0:t.pulled)?An.NO_DATA:An.NO_DATA_UNKNOWN_SUBCONDITION;return _n([t],yn(null!=(e=null==(t=e.notifications)?void 0:t.map(In))?e:[]),!1).sort(function(e,t){return Mn(e)-Mn(t)})};var kn=Object.freeze({"02":0,"01":1,"00":2});function Mn(e){var e=null==(e=e.gqlStatus)?void 0:e.slice(0,2);return null!=(e=kn[e])?e:9999}function Nn(e){return null==e?{}:{offset:mn.util.toNumber(e.offset),line:mn.util.toNumber(e.line),column:mn.util.toNumber(e.column)}}function xn(e){return En.includes(e)?e:wn.UNKNOWN}function Dn(e){return Pn.includes(e)?e:Sn.UNKNOWN}C.buildNotificationsFromMetadata=function(e){return null!=e.notifications?e.notifications.map(function(e){return new Tn(e)}):null!=e.statuses?e.statuses.map(Rn).filter(function(e){return null!=e}):[]},C.default=Tn,Object.defineProperty(p,"__esModule",{value:!0}),p.Stats=p.QueryStatistics=p.ProfiledPlan=p.Plan=p.ServerInfo=p.queryType=void 0;var Ln=h,Un=C,xr=(Fn.prototype.hasPlan=function(){return this.plan instanceof Bn},Fn.prototype.hasProfile=function(){return this.profile instanceof Wn},Fn);function Fn(e,t,r,n){this.query={text:e,parameters:t},this.queryType=r.type,this.counters=new zn(null!=(e=r.stats)?e:{}),this.updateStatistics=this.counters,this.plan=(null!=r.plan||null!=r.profile)&&new Bn(null!=(t=r.plan)?t:r.profile),this.profile=null!=r.profile&&new Wn(r.profile),this.notifications=(0,Un.buildNotificationsFromMetadata)(r),this.gqlStatusObjects=(0,Un.buildGqlStatusObjectFromMetadata)(r),this.server=new Hn(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 Bn=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)}):[]},Wn=(p.Plan=Bn,qn.prototype.hasPageCacheStats=function(){return 0<this.pageCacheMisses||0<this.pageCacheHits||0<this.pageCacheHitRatio},qn);function qn(e){this.operatorType=e.operatorType,this.identifiers=e.identifiers,this.arguments=e.args,this.dbHits=Gn("dbHits",e),this.rows=Gn("rows",e),this.pageCacheMisses=Gn("pageCacheMisses",e),this.pageCacheHits=Gn("pageCacheHits",e),this.pageCacheHitRatio=Gn("pageCacheHitRatio",e),this.time=Gn("time",e),this.children=null!=e.children?e.children.map(function(e){return new qn(e)}):[]}p.ProfiledPlan=Wn;p.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},Vn.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)},Vn.prototype.updates=function(){return this._stats},Vn.prototype.containsSystemUpdates=function(){return void 0!==this._containsSystemUpdates?this._containsSystemUpdates:0<this._systemUpdates},Vn.prototype.systemUpdates=function(){return this._systemUpdates};var zn=Vn;function Vn(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]=Ln.util.toNumber(r[e]):"systemUpdates"===t?n._systemUpdates=Ln.util.toNumber(r[e]):"containsSystemUpdates"===t?n._containsSystemUpdates=r[e]:"containsUpdates"===t&&(n._containsUpdates=r[e])}),this._stats=Object.freeze(this._stats)}p.QueryStatistics=zn;var Hn=function(e,t){null!=e&&(this.address=e.address,this.agent=e.version),this.protocolVersion=t};function Gn(e,t,r){return void 0===r&&(r=0),!1!==t&&e in t?(t=t[e],Ln.util.toNumber(t)):r}p.ServerInfo=Hn;function Yn(){throw this.minimumSeverityLevel=void 0,this.disabledCategories=void 0,this.disabledClassifications=void 0,new Error("Not implemented")}function Kn(e){console.log("Uncaught error when processing result: "+e)}function Zn(e){}function Qn(e){}p.queryType={READ_ONLY:"r",READ_WRITE:"rw",WRITE_ONLY:"w",SCHEMA_WRITE:"s"},p.default=xr;var Xn,j={},o=(Object.defineProperty(j,"__esModule",{value:!0}),j.notificationFilterDisabledClassification=j.notificationFilterDisabledCategory=j.notificationFilterMinimumSeverityLevel=void 0,{OFF:"OFF",WARNING:"WARNING",INFORMATION:"INFORMATION"}),Zr=(j.notificationFilterMinimumSeverityLevel=o,Object.freeze(o),{HINT:"HINT",UNRECOGNIZED:"UNRECOGNIZED",UNSUPPORTED:"UNSUPPORTED",PERFORMANCE:"PERFORMANCE",TOPOLOGY:"TOPOLOGY",SECURITY:"SECURITY",DEPRECATION:"DEPRECATION",GENERIC:"GENERIC",SCHEMA:"SCHEMA"}),S=(j.notificationFilterDisabledCategory=Zr,Object.freeze(Zr),Zr),pn=(j.notificationFilterDisabledClassification=S,j.default=Yn,{}),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}}}},E=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},eo=(Object.defineProperty(pn,"__esModule",{value:!0}),E(p)),to=h,ro=t,no=to.connectionHolder.EMPTY_CONNECTION_HOLDER;function oo(e,t,r,n,o){var i;void 0===o&&(o={high:Number.MAX_VALUE,low:Number.MAX_VALUE}),this[Xn]="Result",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:no,this._keys=null,this._summary=null,this._error=null,this._watermarks=o}oo.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)})},oo.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)})},oo.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},oo.prototype[Symbol.asyncIterator]=function(){var e,n=this;if(!this.isOpen())return e=(0,ro.newError)("Result is already consumed"),{next:function(){return Promise.reject(e)},peek:function(){return Promise.reject(e)}};function o(){return Jn(n,void 0,void 0,function(){var t;return $n(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,ro.newError)("InvalidState: Result stream finished without Summary",ro.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 Jn(n,void 0,void 0,function(){var t;return $n(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 Jn(n,void 0,void 0,function(){var t;return $n(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 Jn(n,void 0,void 0,function(){return $n(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()]}})})}}},oo.prototype.then=function(e,t){return this._getOrCreatePromise().then(e,t)},oo.prototype.catch=function(e){return this._getOrCreatePromise().catch(e)},oo.prototype.finally=function(e){return this._getOrCreatePromise().finally(e)},oo.prototype.subscribe=function(e){this._subscribe(e).catch(function(){})},oo.prototype.isOpen=function(){return null===this._summary&&null===this._error},oo.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)})},oo.prototype._decorateObserver=function(n){var e,o=this,t=null!=(e=n.onCompleted)?e:Zn,i=null!=(e=n.onError)?e:Kn,r=null!=(e=n.onKeys)?e:Qn;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)}}},oo.prototype._cancel=function(){null===this._summary&&null===this._error&&this._streamObserverPromise.then(function(e){return e.cancel()}).catch(function(){})},oo.prototype._releaseConnectionAndGetSummary=function(t){var e=to.util.validateQueryAndParameters(this._query,this._parameters,{skipAsserts:!0}),r=e.validatedQuery,n=e.params,o=this._connectionHolder;return o.getConnection().then(function(e){return o.releaseConnection().then(function(){return null==e?void 0:e.getProtocolVersion()})},function(e){}).then(function(e){return new eo.default(r,n,t,e)})},oo.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 Jn(this,void 0,void 0,function(){var t;return $n(this,function(e){switch(e.label){case 0:if(0<u.length){if(t=null!=(r=u.shift())?r:(0,ro.newError)("Unexpected empty buffer",ro.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 Jn(e,void 0,void 0,function(){var t;return $n(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 Jn(e,void 0,void 0,function(){var t,r;return $n(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},Xn=Symbol.toStringTag,pn.default=oo;T={};Object.defineProperty(T,"__esModule",{value:!0});T.default=function(e,t,r){this.keys=e,this.records=t,this.summary=r};O={},Object.defineProperty(O,"__esModule",{value:!0}),O.Releasable=void 0,io.prototype.release=function(){throw new Error("Not implemented")},w=io;function io(){}function uo(){}O.Releasable=w,uo.prototype.acquireConnection=function(e){throw Error("Not implemented")},uo.prototype.supportsMultiDb=function(){throw Error("Not implemented")},uo.prototype.supportsTransactionConfig=function(){throw Error("Not implemented")},uo.prototype.supportsUserImpersonation=function(){throw Error("Not implemented")},uo.prototype.supportsSessionAuth=function(){throw Error("Not implemented")},uo.prototype.verifyConnectivityAndGetServerInfo=function(e){throw Error("Not implemented")},uo.prototype.verifyAuthentication=function(e){throw Error("Not implemented")},uo.prototype.getNegotiatedProtocolVersion=function(){throw Error("Not Implemented")},uo.prototype.close=function(){throw Error("Not implemented")},O.default=uo;V={};function ao(){}Object.defineProperty(V,"__esModule",{value:!0}),ao.prototype.beginTransaction=function(e){throw new Error("Not implemented")},ao.prototype.run=function(e,t,r){throw new Error("Not implemented")},ao.prototype.commitTransaction=function(e){throw new Error("Not implemented")},ao.prototype.rollbackTransaction=function(e){throw new Error("Not implemented")},ao.prototype.resetAndFlush=function(){throw new Error("Not implemented")},ao.prototype.isOpen=function(){throw new Error("Not implemented")},ao.prototype.getProtocolVersion=function(){throw new Error("Not implemented")},ao.prototype.hasOngoingObservableRequests=function(){throw new Error("Not implemented")},V.default=ao;var Y={},so=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())})},co=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}}}},xr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},lo=(Object.defineProperty(Y,"__esModule",{value:!0}),s),fo=Nt,po=y,ho=m,bo=b,yo=t,_o=xr(pn);function vo(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,c=e.lowRecordWatermark,l=e.notificationFilter,e=e.apiTelemetryConfig,f=this;this._connectionHolder=t,this._reactive=i,this._state=mo.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=c,this._highRecordWatermark=s,this._bookmarks=po.Bookmarks.empty(),this._notificationFilter=l,this._apiTelemetryConfig=e,this._acceptActive=function(){},this._activePromise=new Promise(function(e,t){f._acceptActive=e})}vo.prototype._begin=function(o,i,u){var t=this;this._connectionHolder.getConnection().then(function(n){return so(t,void 0,void 0,function(){var t,r=this;return co(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.beginTransaction({bookmarks:this._bookmarks,txConfig:i,mode:this._connectionHolder.mode(),database:this._connectionHolder.database(),impersonatedUser:this._impersonatedUser,notificationFilter:this._notificationFilter,apiTelemetryConfig:this._apiTelemetryConfig,beforeError:function(e){null!=u&&u.onError(e),r._onError(e).catch(function(){})},afterComplete:function(e){null!=u&&u.onComplete(e),r._onComplete(e)}})];case 2:throw(0,yo.newError)("No connection available")}})})}).catch(function(e){null!=u&&u.onError(e),t._onError(e).catch(function(){})}).finally(function(){return t._acceptActive()})},vo.prototype.run=function(e,t){e=(0,lo.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},vo.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)}})})},vo.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)}})})},vo.prototype.isOpen=function(){return this._state===mo.ACTIVE},vo.prototype.close=function(){return so(this,void 0,void 0,function(){return co(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]}})})},vo.prototype[Symbol.asyncDispose]=function(){return this.close()},vo.prototype._onErrorCallback=function(t){return this._state===mo.FAILED?Promise.resolve(null):(this._state=mo.FAILED,this._onClose(),this._results.forEach(function(e){e.isOpen()&&e._streamObserverPromise.then(function(e){return e.onError(t)}).catch(function(e){})}),this._connectionHolder.releaseConnection())},vo.prototype._onCompleteCallback=function(e,t){this._onBookmarks(new po.Bookmarks(null==e?void 0:e.bookmark),null!=t?t:po.Bookmarks.empty(),null==e?void 0:e.db)};var mo={ACTIVE:{commit:function(e){return{result:go(!0,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:mo.SUCCEEDED}},rollback:function(e){return{result:go(!1,e.connectionHolder,e.onError,e.onComplete,e.onConnection,e.pendingResults,e.preparationJob),state:mo.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 Oo(n.getConnection().then(function(e){return f.then(function(){return e})}).then(function(e){if(u(),null!=e)return e.run(t,r,{bookmarks:po.Bookmarks.empty(),txConfig:ho.TxConfig.empty(),beforeError:o,afterComplete:i,reactive:a,fetchSize:s,highRecordWatermark:c,lowRecordWatermark:l});throw(0,yo.newError)("No connection available")}).catch(function(e){return new bo.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:Oo(new bo.FailedObserver({error:(0,yo.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:mo.FAILED}},rollback:function(e){var t=e.connectionHolder;return e.onError,e.onComplete,{result:Oo(new bo.CompletedObserver,"ROLLBACK",{},t,0,0),state:mo.FAILED}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,Oo(new bo.FailedObserver({error:(0,yo.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:Oo(new bo.FailedObserver({error:(0,yo.newError)("Cannot commit this transaction, because it has already been committed."),onError:r}),"COMMIT",{},fo.EMPTY_CONNECTION_HOLDER,0,0),state:mo.SUCCEEDED,connectionHolder:t}},rollback:function(e){var t=e.connectionHolder,r=e.onError;return e.onComplete,{result:Oo(new bo.FailedObserver({error:(0,yo.newError)("Cannot rollback this transaction, because it has already been committed."),onError:r}),"ROLLBACK",{},fo.EMPTY_CONNECTION_HOLDER,0,0),state:mo.SUCCEEDED,connectionHolder:t}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,Oo(new bo.FailedObserver({error:(0,yo.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:Oo(new bo.FailedObserver({error:(0,yo.newError)("Cannot commit this transaction, because it has already been rolled back."),onError:r}),"COMMIT",{},t,0,0),state:mo.ROLLED_BACK}},rollback:function(e){var t=e.connectionHolder;return e.onError,e.onComplete,{result:Oo(new bo.FailedObserver({error:(0,yo.newError)("Cannot rollback this transaction, because it has already been rolled back.")}),"ROLLBACK",{},t,0,0),state:mo.ROLLED_BACK}},run:function(e,t,r){var n=r.connectionHolder,o=r.onError;return r.onComplete,Oo(new bo.FailedObserver({error:(0,yo.newError)("Cannot run query in this transaction, because it has already been rolled back."),onError:o}),e,t,n,0,0)}}};function go(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.commitTransaction({beforeError:n,afterComplete:o}):t.rollbackTransaction({beforeError:n,afterComplete:o});throw(0,yo.newError)("No connection available")})}).catch(function(e){return new bo.FailedObserver({error:e,onError:n})});return new _o.default(t,r?"COMMIT":"ROLLBACK",{},e,{high:Number.MAX_VALUE,low:Number.MAX_VALUE})}function Oo(e,t,r,n,o,i){return void 0===n&&(n=fo.EMPTY_CONNECTION_HOLDER),new _o.default(Promise.resolve(e),t,r,new fo.ReadOnlyConnectionHolder(null!=n?n:fo.EMPTY_CONNECTION_HOLDER),{low:i,high:o})}Y.default=vo;o={};function wo(e){e=e.run;this._run=e}Object.defineProperty(o,"__esModule",{value:!0}),wo.fromTransaction=function(e){return new wo({run:e.run.bind(e)})},wo.prototype.run=function(e,t){return this._run(e,t)},o.default=wo;var Eo,Po,So,Zr={},S=r&&r.__extends||(Eo=function(e,t){return(Eo=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}Eo(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),To=r&&r.__assign||function(){return(To=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)},E=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},w=(Object.defineProperty(Zr,"__esModule",{value:!0}),E(Y)),xr=(So=w.default,S(jo,So),jo.prototype.then=function(e,t){return this._getOrCreateBeginPromise().then(e,t)},jo.prototype.catch=function(e){return this._getOrCreateBeginPromise().catch(e)},jo.prototype.finally=function(e){return this._getOrCreateBeginPromise().finally(e)},jo.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},jo.prototype._toTransaction=function(){return To(To({},this),{run:So.prototype.run.bind(this),commit:So.prototype.commit.bind(this),rollback:So.prototype.rollback.bind(this),close:So.prototype.close.bind(this),isOpen:So.prototype.isOpen.bind(this),_begin:this._begin.bind(this)})},jo.prototype._begin=function(e,t){return So.prototype._begin.call(this,e,t,{onError:this._onBeginError.bind(this),onComplete:this._onBeginMetadata.bind(this)})},jo.prototype._onBeginError=function(e){this._beginError=e,null!=this._reject&&this._reject(e)},jo.prototype._onBeginMetadata=function(e){this._beginMetadata=null!=e?e:{},null!=this._resolve&&this._resolve(this._toTransaction())},jo);function jo(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,c=e.lowRecordWatermark,l=e.notificationFilter,e=e.apiTelemetryConfig,t=So.call(this,{connectionHolder:t,onClose:r,onBookmarks:n,onConnection:o,reactive:i,fetchSize:u,impersonatedUser:a,highRecordWatermark:s,lowRecordWatermark:c,notificationFilter:l,apiTelemetryConfig:e})||this;return t[Po]="TransactionPromise",t}Po=Symbol.toStringTag,Zr.default=xr;var E={},Co=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())})},Ro=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}}}},Io=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},Ao=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=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ko=(Object.defineProperty(E,"__esModule",{value:!0}),b),Mo=s,No=_,xo=t,Do=w(pn),Lo=Nt,Uo=g,Fo=y,Bo=m,Wo=w(Zr),qo=w(o);function zo(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,c=e.bookmarkManager,l=e.notificationFilter,f=e.auth,e=e.log,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 Lo.ConnectionHolder({mode:No.ACCESS_MODE_READ,auth:f,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved,getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks,log:e}),this._writeConnectionHolder=new Lo.ConnectionHolder({mode:No.ACCESS_MODE_WRITE,auth:f,database:o,bookmarks:n,connectionProvider:r,impersonatedUser:s,onDatabaseNameResolved:this._onDatabaseNameResolved,getConnectionAcquistionBookmarks:this._getConnectionAcquistionBookmarks,log:e}),this._open=!0,this._hasTx=!1,this._impersonatedUser=s,this._lastBookmarks=null!=n?n:Fo.Bookmarks.empty(),this._configuredBookmarks=this._lastBookmarks,this._transactionExecutor=function(e){e=null!=(e=null==e?void 0:e.maxTransactionRetryTime)?e:null;return new Uo.TransactionExecutor(e)}(i),this._databaseNameResolved=""!==this._database,this._calculateWatermaks());this._lowRecordWatermark=t.low,this._highRecordWatermark=t.high,this._results=[],this._bookmarkManager=c,this._notificationFilter=l,this._log=e}zo.prototype.run=function(e,t,r){var o=this,e=(0,Mo.validateQueryAndParameters)(e,t),i=e.validatedQuery,u=e.params,a=null!=r?new Bo.TxConfig(r,this._log):Bo.TxConfig.empty(),t=this._run(i,u,function(n){return Co(o,void 0,void 0,function(){var t,r=this;return Ro(this,function(e){switch(e.label){case 0:return[4,this._bookmarks()];case 1:return t=e.sent(),this._assertSessionIsOpen(),[2,n.run(i,u,{bookmarks:t,txConfig:a,mode:this._mode,database:this._database,apiTelemetryConfig:{api:No.TELEMETRY_APIS.AUTO_COMMIT_TRANSACTION},impersonatedUser:this._impersonatedUser,afterComplete:function(e){return r._onCompleteCallback(e,t)},reactive:this._reactive,fetchSize:this._fetchSize,lowRecordWatermark:this._lowRecordWatermark,highRecordWatermark:this._highRecordWatermark,notificationFilter:this._notificationFilter})]}})})});return this._results.push(t),t},zo.prototype._run=function(e,t,r){var r=this._acquireAndConsumeConnection(r),n=r.connectionHolder,r=r.resultPromise.catch(function(e){return Promise.resolve(new ko.FailedObserver({error:e}))}),o={high:this._highRecordWatermark,low:this._lowRecordWatermark};return new Do.default(r,e,t,n,o)},zo.prototype._acquireConnection=function(e){var r=this,e=this._acquireAndConsumeConnection(e),n=e.connectionHolder;return e.resultPromise.then(function(t){return Co(r,void 0,void 0,function(){return Ro(this,function(e){switch(e.label){case 0:return[4,n.releaseConnection()];case 1:return e.sent(),[2,t]}})})})},zo.prototype._acquireAndConsumeConnection=function(t){var e=this._connectionHolderWithMode(this._mode),r=this._open?!this._hasTx&&e.initializeConnection()?e.getConnection().then(function(e){return t(e)}):Promise.reject((0,xo.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,xo.newError)("Cannot run query in a closed session."));return{connectionHolder:e,resultPromise:r}},zo.prototype.beginTransaction=function(e){var t=Bo.TxConfig.empty();return null!=e&&(t=new Bo.TxConfig(e,this._log)),this._beginTransaction(this._mode,t,{api:No.TELEMETRY_APIS.UNMANAGED_TRANSACTION})},zo.prototype._beginTransaction=function(e,t,r){var n=this;if(!this._open)throw(0,xo.newError)("Cannot begin a transaction on a closed session.");if(this._hasTx)throw(0,xo.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=zo._validateSessionMode(e),e=this._connectionHolderWithMode(e),e.initializeConnection(),this._hasTx=!0,e=new Wo.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,notificationFilter:this._notificationFilter,apiTelemetryConfig:r});return e._begin(function(){return n._bookmarks()},t),e},zo.prototype._assertSessionIsOpen=function(){if(!this._open)throw(0,xo.newError)("You cannot run more transactions on a closed session.")},zo.prototype._transactionClosed=function(){this._hasTx=!1},zo.prototype.lastBookmark=function(){return this.lastBookmarks()},zo.prototype.lastBookmarks=function(){return this._lastBookmarks.values()},zo.prototype._bookmarks=function(){var r;return Co(this,void 0,void 0,function(){var t;return Ro(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 Fo.Bookmarks(Ao(Ao([],Io(t),!1),Io(this._configuredBookmarks),!1))]}})})},zo.prototype.readTransaction=function(e,t){t=new Bo.TxConfig(t,this._log);return this._runTransaction(No.ACCESS_MODE_READ,t,e)},zo.prototype.writeTransaction=function(e,t){t=new Bo.TxConfig(t,this._log);return this._runTransaction(No.ACCESS_MODE_WRITE,t,e)},zo.prototype._runTransaction=function(t,r,e){var n=this;return this._transactionExecutor.execute(function(e){return n._beginTransaction(t,r,e)},e)},zo.prototype.executeRead=function(e,t){t=new Bo.TxConfig(t,this._log);return this._executeInTransaction(No.ACCESS_MODE_READ,t,e)},zo.prototype.executeWrite=function(e,t){t=new Bo.TxConfig(t,this._log);return this._executeInTransaction(No.ACCESS_MODE_WRITE,t,e)},zo.prototype._executeInTransaction=function(t,r,e){var n=this;return this._transactionExecutor.execute(function(e){return n._beginTransaction(t,r,e)},e,qo.default.fromTransaction)},zo.prototype._onDatabaseNameResolved=function(e){this._databaseNameResolved||(this._database=e=null!=e?e:"",this._readConnectionHolder.setDatabase(e),this._writeConnectionHolder.setDatabase(e),this._databaseNameResolved=!0)},zo.prototype._getConnectionAcquistionBookmarks=function(){var r;return Co(this,void 0,void 0,function(){var t;return Ro(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 Fo.Bookmarks(Ao(Ao([],Io(this._configuredBookmarks),!1),Io(t),!1))]}})})},zo.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:[]).catch(function(){}),this._lastBookmarks=e,this._configuredBookmarks=Fo.Bookmarks.empty())},zo.prototype.close=function(){return Co(this,void 0,void 0,function(){return Ro(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]}})})},zo.prototype[Symbol.asyncDispose]=function(){return this.close()},zo.prototype._connectionHolderWithMode=function(e){if(e===No.ACCESS_MODE_READ)return this._readConnectionHolder;if(e===No.ACCESS_MODE_WRITE)return this._writeConnectionHolder;throw(0,xo.newError)("Unknown access mode: "+e)},zo.prototype._onCompleteCallback=function(e,t){this._updateBookmarks(new Fo.Bookmarks(e.bookmark),t,e.db)},zo.prototype._calculateWatermaks=function(){return this._fetchSize===No.FETCH_ALL?{low:Number.MAX_VALUE,high:Number.MAX_VALUE}:{low:.3*this._fetchSize,high:.7*this._fetchSize}},zo.prototype._configureTransactionExecutor=function(e,t){this._transactionExecutor.pipelineBegin=e,this._transactionExecutor.telemetryApi=t},zo._validateSessionMode=function(e){e=null!=e?e:No.ACCESS_MODE_WRITE;if(e!==No.ACCESS_MODE_READ&&e!==No.ACCESS_MODE_WRITE)throw(0,xo.newError)("Illegal session mode "+e);return e},E.default=zo;var S={},xr={},Vo=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())})},Ho=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}}}},Go=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.")},Yo=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},Ko=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))},b=(Object.defineProperty(xr,"__esModule",{value:!0}),xr.bookmarkManager=void 0,Zo.prototype.updateBookmarks=function(e,t){return Vo(this,void 0,void 0,function(){return Ho(this,function(e){throw new Error("Not implemented")})})},Zo.prototype.getBookmarks=function(){return Vo(this,void 0,void 0,function(){return Ho(this,function(e){throw new Error("Not implemented")})})},Zo);function Zo(){throw new Error("Not implemented")}xr.default=b,xr.bookmarkManager=function(e){void 0===e&&(e={});var t=new Set(e.initialBookmarks);return new Qo(t,e.bookmarksSupplier,e.bookmarksConsumer)};Xo.prototype.updateBookmarks=function(f,p){return Vo(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c,l;return Ho(this,function(e){switch(e.label){case 0:t=this._bookmarks;try{for(r=Go(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=Go(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(Ko([],Yo(t),!1))];case 1:e.sent(),e.label=2;case 2:return[2]}})})},Xo.prototype.getBookmarks=function(){var s;return Vo(this,void 0,void 0,function(){var t,r,n,o,i,u,a;return Ho(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=Go(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,Ko([],Yo(t),!1)]}})})};var Qo=Xo;function Xo(e,t,r){this._bookmarks=e,this._bookmarksSupplier=t,this._bookmarksConsumer=r}var Nt={},Jo=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())})},$o=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}}}},g=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ei=(Object.defineProperty(Nt,"__esModule",{value:!0}),g(T)),ti=t;function ri(){}ri.prototype.eagerResultTransformer=function(){return ni},ri.prototype.eager=function(){return ni},ri.prototype.mappedResultTransformer=function(e){return oi(e)},ri.prototype.mapped=function(e){return oi(e)},ri.prototype.first=function(){return ii},ri.prototype.summary=function(){return ui};m=new ri;function ni(o){return Jo(this,void 0,void 0,function(){var t,r,n;return $o(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 ei.default(n,r,t)]}})})}function oi(i){var e=this;if(null==i||null==i.collect&&null==i.map)throw(0,ti.newError)("Requires a map or/and a collect functions.");return function(o){return Jo(e,void 0,void 0,function(){return $o(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){var t;null!=i.map?void 0!==(t=i.map(e))&&n.records.push(t):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()]}})})}}function ii(o){return Jo(this,void 0,void 0,function(){var t,r,n;return $o(this,function(e){switch(e.label){case 0:return[4,(t=o[Symbol.asyncIterator]()).next()];case 1:n=e.sent(),r=n.value,n=n.done,e.label=2;case 2:return e.trys.push([2,,3,6]),!0===n?[2,void 0]:[2,r];case 3:return null==t.return?[3,5]:[4,t.return()];case 4:e.sent(),e.label=5;case 5:return[7];case 6:return[2]}})})}function ui(t){return Jo(this,void 0,void 0,function(){return $o(this,function(e){switch(e.label){case 0:return[4,t.summary()];case 1:return[2,e.sent()]}})})}Object.freeze(m),Nt.default=m;var w={},ai=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())})},si=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}}}},ci=(Object.defineProperty(w,"__esModule",{value:!0}),_);function li(e){this._createSession=e}li.prototype.execute=function(o,i,u){return ai(this,void 0,void 0,function(){var t,r,n=this;return si(this,function(e){switch(e.label){case 0:t=this._createSession({database:o.database,bookmarkManager:o.bookmarkManager,impersonatedUser:o.impersonatedUser,auth:o.auth}),r=function(e,t,r){"function"==typeof(null==e?void 0:e.addEventListener)&&e.addEventListener(t,r);return{uninstall:function(){"function"==typeof(null==e?void 0:e.removeEventListener)&&e.removeEventListener(t,r)}}}(o.signal,"abort",function(){return ai(n,void 0,void 0,function(){return si(this,function(e){switch(e.label){case 0:return[4,t.close()];case 1:return[2,e.sent()]}})})}),t._configureTransactionExecutor(!0,ci.TELEMETRY_APIS.EXECUTE_QUERY),e.label=1;case 1:return e.trys.push([1,,3,5]),[4,("READ"===o.routing?t.executeRead:t.executeWrite).bind(t)(function(r){return ai(n,void 0,void 0,function(){var t;return si(this,function(e){switch(e.label){case 0:return t=r.run(i,u),[4,o.resultTransformer(t)];case 1:return[2,e.sent()]}})})},o.transactionConfig)];case 2:return[2,e.sent()];case 3:return r.uninstall(),[4,t.close()];case 4:return e.sent(),[7];case 5:return[2]}})})},w.default=li;function fi(){this.routing=Ri.WRITE,this.resultTransformer=void 0,this.database="",this.impersonatedUser=void 0,this.bookmarkManager=void 0,this.transactionConfig=void 0,this.auth=void 0,this.signal=void 0}var pi=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())})},di=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}}}},b=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},hi=(Object.defineProperty(S,"__esModule",{value:!0}),S.QueryConfig=S.SessionConfig=S.routing=S.WRITE=S.READ=S.Driver=void 0,y),bi=b(P),yi=_,_i=v,vi=b(E),mi=s,gi=xr,Oi=b(Nt),wi=b(w),Ei=t,Pi=36e5,Si=1e3,Ti=yi.ACCESS_MODE_READ,ji=(S.READ=Ti,yi.ACCESS_MODE_WRITE),Ci=(S.WRITE=ji,0),Ri=(S.SessionConfig=function(){this.defaultAccessMode=ji,this.bookmarks=[],this.database="",this.impersonatedUser=void 0,this.auth=void 0,this.fetchSize=void 0,this.bookmarkManager=void 0,this.notificationFilter=void 0},{WRITE:"WRITE",READ:"READ"}),g=(S.routing=Ri,Object.freeze(Ri),S.QueryConfig=fi,Object.defineProperty(Ii.prototype,"executeQueryBookmarkManager",{get:function(){return this._defaultExecuteQueryBookmarkManager},enumerable:!1,configurable:!0}),Ii.prototype.executeQuery=function(o,i,u){var a,s;return void 0===u&&(u={}),pi(this,void 0,void 0,function(){var t,r,n;return di(this,function(e){switch(e.label){case 0:if(t=null===u.bookmarkManager?void 0:null!=(a=u.bookmarkManager)?a:this.executeQueryBookmarkManager,r=null!=(a=u.resultTransformer)?a:Oi.default.eagerResultTransformer(),(n=null!=(s=u.routing)?s:Ri.WRITE)!==Ri.READ&&n!==Ri.WRITE)throw(0,Ei.newError)('Illegal query routing config: "'.concat(n,'"'));return[4,this._queryExecutor.execute({resultTransformer:r,bookmarkManager:t,routing:n,database:u.database,impersonatedUser:u.impersonatedUser,transactionConfig:u.transactionConfig,auth:u.auth,signal:u.signal},o,i)];case 1:return[2,e.sent()]}})})},Ii.prototype.verifyConnectivity=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:Ti})},Ii.prototype.verifyAuthentication=function(e){var e=void 0===e?{}:e,t=e.database,r=e.auth;return pi(this,void 0,void 0,function(){return di(this,function(e){switch(e.label){case 0:return[4,this._getOrCreateConnectionProvider().verifyAuthentication({database:null!=t?t:"system",auth:r,accessMode:Ti})];case 1:return[2,e.sent()]}})})},Ii.prototype.getServerInfo=function(e){e=(void 0===e?{}:e).database,e=void 0===e?"":e;return this._getOrCreateConnectionProvider().verifyConnectivityAndGetServerInfo({database:e,accessMode:Ti})},Ii.prototype.supportsMultiDb=function(){return this._getOrCreateConnectionProvider().supportsMultiDb()},Ii.prototype.supportsTransactionConfig=function(){return this._getOrCreateConnectionProvider().supportsTransactionConfig()},Ii.prototype.supportsUserImpersonation=function(){return this._getOrCreateConnectionProvider().supportsUserImpersonation()},Ii.prototype.supportsSessionAuth=function(){return this._getOrCreateConnectionProvider().supportsSessionAuth()},Ii.prototype.getNegotiatedProtocolVersion=function(){return this._getOrCreateConnectionProvider().getNegotiatedProtocolVersion()},Ii.prototype.isEncrypted=function(){return this._isEncrypted()},Ii.prototype._supportsRouting=function(){return this._meta.routing},Ii.prototype._isEncrypted=function(){return this._config.encrypted===mi.ENCRYPTION_ON||!0===this._config.encrypted},Ii.prototype._getTrust=function(){return this._config.trust},Ii.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,u=e.bookmarkManager,a=e.notificationFilter,e=e.auth;return this._newSession({defaultAccessMode:void 0===t?ji:t,bookmarkOrBookmarks:r,database:void 0===n?"":n,reactive:!1,impersonatedUser:o,fetchSize:ki(i,this._config.fetchSize),bookmarkManager:u,notificationFilter:a,auth:e})},Ii.prototype.close=function(){return this._log.info("Driver ".concat(this._id," closing")),null!=this._connectionProvider?this._connectionProvider.close():Promise.resolve()},Ii.prototype[Symbol.asyncDispose]=function(){return this.close()},Ii.prototype._afterConstruction=function(){this._log.info("".concat(this._meta.typename," driver ").concat(this._id," created for server address ").concat(this._meta.address.toString()))},Ii.prototype._newSession=function(e){var t=e.defaultAccessMode,r=e.bookmarkOrBookmarks,n=e.database,o=e.reactive,i=e.impersonatedUser,u=e.fetchSize,a=e.bookmarkManager,s=e.notificationFilter,e=e.auth,t=vi.default._validateSessionMode(t),c=this._getOrCreateConnectionProvider(),r=null!=r?new hi.Bookmarks(r):hi.Bookmarks.empty();return this._createSession({mode:t,database:null!=n?n:"",connectionProvider:c,bookmarks:r,config:this._config,reactive:o,impersonatedUser:i,fetchSize:u,bookmarkManager:a,notificationFilter:s,auth:e,log:this._log})},Ii.prototype._getOrCreateConnectionProvider=function(){var e;return null==this._connectionProvider&&(this._connectionProvider=this._createConnectionProvider(this._id,this._config,this._log,(e=this._config,new bi.default(e.resolver)))),this._connectionProvider},Ii);function Ii(e,t,r,n,o){void 0===n&&(n=function(e){return new vi.default(e)}),void 0===o&&(o=function(e){return new wi.default(e)}),(i=t=void 0===t?{}:t).maxConnectionLifetime=Ai(i.maxConnectionLifetime,Pi),i.maxConnectionPoolSize=Ai(i.maxConnectionPoolSize,yi.DEFAULT_POOL_MAX_SIZE),i.connectionAcquisitionTimeout=Ai(i.connectionAcquisitionTimeout,yi.DEFAULT_POOL_ACQUISITION_TIMEOUT),i.fetchSize=ki(i.fetchSize,Si),i.connectionTimeout=function(e){e=parseInt(e.connectionTimeout,10);return 0===e||!isNaN(e)&&e<0?null:isNaN(e)?yi.DEFAULT_CONNECTION_TIMEOUT_MILLIS:e}(i),i.connectionLivenessCheckTimeout=function(e){if(null==e)return;e=parseInt(e,10);if(e<0||Number.isNaN(e))throw new Error("The connectionLivenessCheckTimeout can only be a positive value or 0 for always. However connectionLivenessCheckTimeout = ".concat(e));return e}(i.connectionLivenessCheckTimeout);var i=_i.Logger.create(t);!function(e,t){var r=e.resolver;if(null!=r&&"function"!=typeof r)throw new TypeError("Configured resolver should be a function. Got: ".concat(typeof r));e.connectionAcquisitionTimeout<e.connectionTimeout&&t.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');if(null==(null==(r=e.notificationFilter)?void 0:r.disabledCategories)||null==(null==(t=e.notificationFilter)?void 0:t.disabledClassifications))return;throw new Error('The notificationFilter can\'t have both "disabledCategories" and "disabledClassifications" configured at the same time.')}(t,i),this._id=Ci++,this._meta=e,this._config=t,this._log=i,this._createConnectionProvider=r,this._createSession=n,this._defaultExecuteQueryBookmarkManager=(0,gi.bookmarkManager)(),this._queryExecutor=o(this.session.bind(this)),this._connectionProvider=null,this._afterConstruction()}function Ai(e,t){e=parseInt(e,10);return 0<e||0===e?e:e<0?Number.MAX_SAFE_INTEGER:t}function ki(e,t){e=parseInt(e,10);if(0<e||e===yi.FETCH_ALL)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(yi.FETCH_ALL," for ALL. However fetchSize = ").concat(e));return t}S.Driver=g,S.default=g;m={};function Mi(e){return null!=e&&""!==e&&(Object.getPrototypeOf(e)!==Object.prototype||0!==Object.keys(e).length)}Object.defineProperty(m,"__esModule",{value:!0}),m.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}},none:function(){return{scheme:"none"}},custom:function(e,t,r,n,o){n={scheme:n,principal:e};return Mi(t)&&(n.credentials=t),Mi(r)&&(n.realm=r),Mi(o)&&(n.parameters=o),n}};var y={},Ni=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())})},xi=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}}}},P=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Di=(Object.defineProperty(y,"__esModule",{value:!0}),y.staticAuthTokenManager=y.authTokenManagers=y.AuthTokenAndExpiration=void 0,P(m)),Li=h;function Ui(){}function Fi(){}Ui.prototype.getToken=function(){throw new Error("Not Implemented")},Ui.prototype.handleSecurityException=function(e,t){throw new Error("Not implemented")},y.default=Ui,y.AuthTokenAndExpiration=function(){this.token=Di.default.none(),this.expiration=void 0},Fi.prototype.bearer=function(e){e=e.tokenProvider;if("function"!=typeof e)throw new TypeError("tokenProvider should be function, but got: ".concat(typeof e));return new qi(e,["Neo.ClientError.Security.Unauthorized","Neo.ClientError.Security.TokenExpired"])},Fi.prototype.basic=function(e){var t=this,r=e.tokenProvider;if("function"!=typeof r)throw new TypeError("tokenProvider should be function, but got: ".concat(typeof r));return new qi(function(){return Ni(t,void 0,void 0,function(){var t;return xi(this,function(e){switch(e.label){case 0:return t={},[4,r()];case 1:return[2,(t.token=e.sent(),t)]}})})},["Neo.ClientError.Security.Unauthorized"])};_=new Fi;y.authTokenManagers=_,Object.freeze(_),y.staticAuthTokenManager=function(e){return e=e.authToken,new Vi(e)};Wi.prototype.subscribe=function(e){this._subscribers.push(e)},Wi.prototype.onCompleted=function(t){this._subscribers.forEach(function(e){return e.onCompleted(t)})},Wi.prototype.onError=function(t){this._subscribers.forEach(function(e){return e.onError(t)})};var Bi=Wi;function Wi(e){this._subscribers=e=void 0===e?[]:e}zi.prototype.getToken=function(){var t;return Ni(this,void 0,void 0,function(){return xi(this,function(e){switch(e.label){case 0:return void 0===this._currentAuthData||void 0!==this._currentAuthData.expiration&&this._currentAuthData.expiration<new Date?[4,this._refreshAuthToken()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2,null==(t=this._currentAuthData)?void 0:t.token]}})})},zi.prototype.handleSecurityException=function(e,t){return!!this._handledSecurityCodes.includes(t)&&(Li.util.equals(e,null==(t=this._currentAuthData)?void 0:t.token)&&this._scheduleRefreshAuthToken(),!0)},zi.prototype._scheduleRefreshAuthToken=function(e){var r=this;void 0===this._refreshObservable&&(this._currentAuthData=void 0,this._refreshObservable=new Bi,Promise.resolve(this._tokenProvider()).then(function(e){var t;r._currentAuthData=e,null!=(t=r._refreshObservable)&&t.onCompleted(e)}).catch(function(e){var t;null!=(t=r._refreshObservable)&&t.onError(e)}).finally(function(){r._refreshObservable=void 0})),void 0!==e&&this._refreshObservable.subscribe(e)},zi.prototype._refreshAuthToken=function(){return Ni(this,void 0,void 0,function(){var r=this;return xi(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e,t){r._scheduleRefreshAuthToken({onCompleted:e,onError:t})})];case 1:return[2,e.sent()]}})})};var qi=zi;function zi(e,t,r,n){this._tokenProvider=e,this._handledSecurityCodes=t,this._currentAuthData=r,this._refreshObservable=n}Hi.prototype.getToken=function(){return this._authToken},Hi.prototype.handleSecurityException=function(e,t){return!1};var Vi=Hi;function Hi(e){this._authToken=e}function Gi(){this.encrypted=void 0,this.trust=void 0,this.trustedCertificates=[],this.maxConnectionPoolSize=100,this.maxConnectionLifetime=36e5,this.connectionAcquisitionTimeout=6e4,this.maxTransactionRetryTime=3e4,this.connectionLivenessCheckTimeout=void 0,this.connectionTimeout=3e4,this.disableLosslessIntegers=!1,this.useBigInt=!1,this.logging=void 0,this.resolver=void 0,this.notificationFilter=void 0,this.userAgent=void 0,this.telemetryDisabled=!1,this.clientCertificate=void 0}var Yi,Ki,v={},s=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)}),b=(Object.defineProperty(v,"__esModule",{value:!0}),v.InternalConfig=v.Config=void 0,v.Config=Gi,s(Zi,Ki=Gi),Zi);function Zi(){return null!==Ki&&Ki.apply(this,arguments)||this}v.InternalConfig=b;var Qi,w={},g=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)}),Xi=r&&r.__assign||function(){return(Xi=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)},Ji=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]}),$i=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),P=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)&&Ji(t,e,r);return $i(t,e),t},eu=(Object.defineProperty(w,"__esModule",{value:!0}),w.resolveCertificateProvider=w.clientCertificateProviders=w.RotatingClientCertificateProvider=w.ClientCertificateProvider=void 0,P(n)),_=(w.default=function(){this.certfile="",this.keyfile="",this.password=void 0},tu.prototype.hasUpdate=function(){throw new Error("Not Implemented")},tu.prototype.getClientCertificate=function(){throw new Error("Not Implemented")},tu);function tu(){}w.ClientCertificateProvider=_;g(nu,ru=_),nu.prototype.updateCertificate=function(e){throw new Error("Not implemented")};var ru,s=nu;function nu(){return null!==ru&&ru.apply(this,arguments)||this}function ou(){}w.RotatingClientCertificateProvider=s,ou.prototype.rotating=function(e){e=e.initialCertificate;if(null==e||!iu(e))throw new TypeError("initialCertificate should be ClientCertificate, but got ".concat(eu.stringify(e)));e=Xi({},e);return new Pu(e)};b=new ou;function iu(e){return null!=e&&"object"==typeof e&&"certfile"in e&&(uu(r=e.certfile)||au(r,uu))&&"keyfile"in e&&(t(r=e.keyfile)||au(r,t))&&su("password",e);function t(e){return"string"==typeof e||null!=e&&"object"==typeof e&&"path"in e&&"string"==typeof e.path&&su("password",e)}var r}function uu(e){return"string"==typeof e}function au(e,t,r){return void 0===r&&(r=!1),Array.isArray(e)&&(r||0<e.length)&&e.filter(t).length===e.length}function su(e,t){return!(e in t)||null==t[e]||"string"==typeof t[e]}w.clientCertificateProviders=b,Object.freeze(b),w.resolveCertificateProvider=function(e){if(null!=e){if("object"==typeof e&&"hasUpdate"in e&&"getClientCertificate"in e&&"function"==typeof e.getClientCertificate&&"function"==typeof e.hasUpdate)return e;var t;if(iu(e))return t=Xi({},e),{getClientCertificate:function(){return t},hasUpdate:function(){return!1}};throw new TypeError("clientCertificate should be configured with ClientCertificate or ClientCertificateProvider, but got ".concat(eu.stringify(e)))}};Su.prototype.hasUpdate=function(){try{return this._updated}finally{this._updated=!1}},Su.prototype.getClientCertificate=function(){return this._certificate},Su.prototype.updateCertificate=function(e){if(!iu(e))throw new TypeError("certificate should be ClientCertificate, but got ".concat(eu.stringify(e)));this._certificate=Xi({},e),this._updated=!0};var cu,lu,fu,pu,du,hu,bu,yu,_u,vu,mu,gu,Ou,wu,Eu,Pu=Su;function Su(e,t){void 0===t&&(t=!1),this._certificate=e,this._updated=t}P=e,cu=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]}),lu=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),g=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)&&cu(t,e,r);return lu(t,e),t},_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(P,"__esModule",{value:!0}),P.EagerResult=P.Result=P.Stats=P.QueryStatistics=P.ProfiledPlan=P.Plan=P.GqlStatusObject=P.Notification=P.ServerInfo=P.queryType=P.ResultSummary=P.Record=P.isPathSegment=P.PathSegment=P.isPath=P.Path=P.isUnboundRelationship=P.UnboundRelationship=P.isRelationship=P.Relationship=P.isNode=P.Node=P.Time=P.LocalTime=P.LocalDateTime=P.isTime=P.isLocalTime=P.isLocalDateTime=P.isDuration=P.isDateTime=P.isDate=P.Duration=P.DateTime=P.Date=P.Point=P.isPoint=P.internal=P.toString=P.toNumber=P.inSafeRange=P.isInt=P.int=P.Integer=P.error=P.isRetriableError=P.GQLError=P.newGQLError=P.Neo4jError=P.newError=P.authTokenManagers=void 0,P.resolveCertificateProvider=P.clientCertificateProviders=P.notificationFilterMinimumSeverityLevel=P.notificationFilterDisabledClassification=P.notificationFilterDisabledCategory=P.notificationSeverityLevel=P.notificationClassification=P.notificationCategory=P.resultTransformers=P.routing=P.staticAuthTokenManager=P.bookmarkManager=P.auth=P.json=P.driver=P.types=P.Driver=P.Session=P.TransactionPromise=P.ManagedTransaction=P.Transaction=P.Connection=P.Releasable=P.ConnectionProvider=void 0,fu=t,Object.defineProperty(P,"newError",{enumerable:!0,get:function(){return fu.newError}}),Object.defineProperty(P,"Neo4jError",{enumerable:!0,get:function(){return fu.Neo4jError}}),Object.defineProperty(P,"newGQLError",{enumerable:!0,get:function(){return fu.newGQLError}}),Object.defineProperty(P,"GQLError",{enumerable:!0,get:function(){return fu.GQLError}}),Object.defineProperty(P,"isRetriableError",{enumerable:!0,get:function(){return fu.isRetriableError}}),pu=g(i),P.Integer=pu.default,Object.defineProperty(P,"int",{enumerable:!0,get:function(){return pu.int}}),Object.defineProperty(P,"isInt",{enumerable:!0,get:function(){return pu.isInt}}),Object.defineProperty(P,"inSafeRange",{enumerable:!0,get:function(){return pu.inSafeRange}}),Object.defineProperty(P,"toNumber",{enumerable:!0,get:function(){return pu.toNumber}}),Object.defineProperty(P,"toString",{enumerable:!0,get:function(){return pu.toString}}),du=u,Object.defineProperty(P,"Date",{enumerable:!0,get:function(){return du.Date}}),Object.defineProperty(P,"DateTime",{enumerable:!0,get:function(){return du.DateTime}}),Object.defineProperty(P,"Duration",{enumerable:!0,get:function(){return du.Duration}}),Object.defineProperty(P,"isDate",{enumerable:!0,get:function(){return du.isDate}}),Object.defineProperty(P,"isDateTime",{enumerable:!0,get:function(){return du.isDateTime}}),Object.defineProperty(P,"isDuration",{enumerable:!0,get:function(){return du.isDuration}}),Object.defineProperty(P,"isLocalDateTime",{enumerable:!0,get:function(){return du.isLocalDateTime}}),Object.defineProperty(P,"isLocalTime",{enumerable:!0,get:function(){return du.isLocalTime}}),Object.defineProperty(P,"isTime",{enumerable:!0,get:function(){return du.isTime}}),Object.defineProperty(P,"LocalDateTime",{enumerable:!0,get:function(){return du.LocalDateTime}}),Object.defineProperty(P,"LocalTime",{enumerable:!0,get:function(){return du.LocalTime}}),Object.defineProperty(P,"Time",{enumerable:!0,get:function(){return du.Time}}),hu=f,Object.defineProperty(P,"Node",{enumerable:!0,get:function(){return hu.Node}}),Object.defineProperty(P,"isNode",{enumerable:!0,get:function(){return hu.isNode}}),Object.defineProperty(P,"Relationship",{enumerable:!0,get:function(){return hu.Relationship}}),Object.defineProperty(P,"isRelationship",{enumerable:!0,get:function(){return hu.isRelationship}}),Object.defineProperty(P,"UnboundRelationship",{enumerable:!0,get:function(){return hu.UnboundRelationship}}),Object.defineProperty(P,"isUnboundRelationship",{enumerable:!0,get:function(){return hu.isUnboundRelationship}}),Object.defineProperty(P,"Path",{enumerable:!0,get:function(){return hu.Path}}),Object.defineProperty(P,"isPath",{enumerable:!0,get:function(){return hu.isPath}}),Object.defineProperty(P,"PathSegment",{enumerable:!0,get:function(){return hu.PathSegment}}),Object.defineProperty(P,"isPathSegment",{enumerable:!0,get:function(){return hu.isPathSegment}}),s=_(it),P.Record=s.default,bu=c,Object.defineProperty(P,"isPoint",{enumerable:!0,get:function(){return bu.isPoint}}),Object.defineProperty(P,"Point",{enumerable:!0,get:function(){return bu.Point}}),yu=g(p),P.ResultSummary=yu.default,Object.defineProperty(P,"queryType",{enumerable:!0,get:function(){return yu.queryType}}),Object.defineProperty(P,"ServerInfo",{enumerable:!0,get:function(){return yu.ServerInfo}}),Object.defineProperty(P,"Plan",{enumerable:!0,get:function(){return yu.Plan}}),Object.defineProperty(P,"ProfiledPlan",{enumerable:!0,get:function(){return yu.ProfiledPlan}}),Object.defineProperty(P,"QueryStatistics",{enumerable:!0,get:function(){return yu.QueryStatistics}}),Object.defineProperty(P,"Stats",{enumerable:!0,get:function(){return yu.Stats}}),_u=g(C),P.Notification=_u.default,Object.defineProperty(P,"GqlStatusObject",{enumerable:!0,get:function(){return _u.GqlStatusObject}}),Object.defineProperty(P,"notificationCategory",{enumerable:!0,get:function(){return _u.notificationCategory}}),Object.defineProperty(P,"notificationClassification",{enumerable:!0,get:function(){return _u.notificationClassification}}),Object.defineProperty(P,"notificationSeverityLevel",{enumerable:!0,get:function(){return _u.notificationSeverityLevel}}),vu=j,Object.defineProperty(P,"notificationFilterDisabledCategory",{enumerable:!0,get:function(){return vu.notificationFilterDisabledCategory}}),Object.defineProperty(P,"notificationFilterDisabledClassification",{enumerable:!0,get:function(){return vu.notificationFilterDisabledClassification}}),Object.defineProperty(P,"notificationFilterMinimumSeverityLevel",{enumerable:!0,get:function(){return vu.notificationFilterMinimumSeverityLevel}}),b=_(pn),P.Result=b.default,t=_(T),P.EagerResult=t.default,mu=g(O),P.ConnectionProvider=mu.default,Object.defineProperty(P,"Releasable",{enumerable:!0,get:function(){return mu.Releasable}}),i=_(V),P.Connection=i.default,u=_(Y),P.Transaction=u.default,f=_(o),P.ManagedTransaction=f.default,it=_(Zr),P.TransactionPromise=it.default,c=_(E),P.Session=c.default,p=g(S),C=p,P.Driver=p.default,P.driver=C,j=_(m),P.auth=j.default,gu=xr,Object.defineProperty(P,"bookmarkManager",{enumerable:!0,get:function(){return gu.bookmarkManager}}),Ou=y,Object.defineProperty(P,"authTokenManagers",{enumerable:!0,get:function(){return Ou.authTokenManagers}}),Object.defineProperty(P,"staticAuthTokenManager",{enumerable:!0,get:function(){return Ou.staticAuthTokenManager}}),wu=S,Object.defineProperty(P,"routing",{enumerable:!0,get:function(){return wu.routing}}),pn=g(v),P.types=pn,T=g(n),P.json=T,_=_(Nt),P.resultTransformers=_.default,Eu=w,Object.defineProperty(P,"clientCertificateProviders",{enumerable:!0,get:function(){return Eu.clientCertificateProviders}}),Object.defineProperty(P,"resolveCertificateProvider",{enumerable:!0,get:function(){return Eu.resolveCertificateProvider}}),g=g(h),P.internal=g,O={SERVICE_UNAVAILABLE:fu.SERVICE_UNAVAILABLE,SESSION_EXPIRED:fu.SESSION_EXPIRED,PROTOCOL_ERROR:fu.PROTOCOL_ERROR},P.error=O,O={authTokenManagers:Ou.authTokenManagers,newError:fu.newError,Neo4jError:fu.Neo4jError,newGQLError:fu.newGQLError,GQLError:fu.GQLError,isRetriableError:fu.isRetriableError,error:O,Integer:pu.default,int:pu.int,isInt:pu.isInt,inSafeRange:pu.inSafeRange,toNumber:pu.toNumber,toString:pu.toString,internal:g,isPoint:bu.isPoint,Point:bu.Point,Date:du.Date,DateTime:du.DateTime,Duration:du.Duration,isDate:du.isDate,isDateTime:du.isDateTime,isDuration:du.isDuration,isLocalDateTime:du.isLocalDateTime,isLocalTime:du.isLocalTime,isTime:du.isTime,LocalDateTime:du.LocalDateTime,LocalTime:du.LocalTime,Time:du.Time,Node:hu.Node,isNode:hu.isNode,Relationship:hu.Relationship,isRelationship:hu.isRelationship,UnboundRelationship:hu.UnboundRelationship,isUnboundRelationship:hu.isUnboundRelationship,Path:hu.Path,isPath:hu.isPath,PathSegment:hu.PathSegment,isPathSegment:hu.isPathSegment,Record:s.default,ResultSummary:yu.default,queryType:yu.queryType,ServerInfo:yu.ServerInfo,Notification:_u.default,GqlStatusObject:_u.GqlStatusObject,Plan:yu.Plan,ProfiledPlan:yu.ProfiledPlan,QueryStatistics:yu.QueryStatistics,Stats:yu.Stats,Result:b.default,EagerResult:t.default,Transaction:u.default,ManagedTransaction:f.default,TransactionPromise:it.default,Session:c.default,Driver:p.default,Connection:i.default,Releasable:mu.Releasable,types:pn,driver:C,json:T,auth:j.default,bookmarkManager:gu.bookmarkManager,routing:wu.routing,resultTransformers:_.default,notificationCategory:_u.notificationCategory,notificationClassification:_u.notificationClassification,notificationSeverityLevel:_u.notificationSeverityLevel,notificationFilterDisabledCategory:vu.notificationFilterDisabledCategory,notificationFilterDisabledClassification:vu.notificationFilterDisabledClassification,notificationFilterMinimumSeverityLevel:vu.notificationFilterMinimumSeverityLevel,clientCertificateProviders:Eu.clientCertificateProviders,resolveCertificateProvider:Eu.resolveCertificateProvider},P.default=O;V={},Y={},o={},Zr={},E={};Object.defineProperty(E,"__esModule",{value:!0}),E.isFunction=void 0,E.isFunction=function(e){return"function"==typeof e};m={},xr={},y={};Object.defineProperty(y,"__esModule",{value:!0}),y.createErrorClass=void 0,y.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(xr,"__esModule",{value:!0}),xr.UnsubscriptionError=void 0;S=y,xr.UnsubscriptionError=S.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}}),v={};Object.defineProperty(v,"__esModule",{value:!0}),v.arrRemove=void 0,v.arrRemove=function(e,t){e&&0<=(t=e.indexOf(t))&&e.splice(t,1)};var Tu=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.")},ju=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},Cu=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},Ru=(Object.defineProperty(m,"__esModule",{value:!0}),m.isSubscription=m.EMPTY_SUBSCRIPTION=m.Subscription=void 0,E),Iu=xr,Au=v,ku=(Mu.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=Tu(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(Ru.isFunction(u))try{u()}catch(e){r=e instanceof Iu.UnsubscriptionError?e.errors:[e]}var a=this._finalizers;if(a){this._finalizers=null;try{for(var s=Tu(a),c=s.next();!c.done;c=s.next()){var l=c.value;try{Nu(l)}catch(e){r=null!=r?r:[],e instanceof Iu.UnsubscriptionError?r=Cu(Cu([],ju(r)),ju(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 Iu.UnsubscriptionError(r)}},Mu.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Nu(e);else{if(e instanceof Mu){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!=(t=this._finalizers)?t:[]).push(e)}},Mu.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},Mu.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},Mu.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Au.arrRemove(t,e)},Mu.prototype.remove=function(e){var t=this._finalizers;t&&Au.arrRemove(t,e),e instanceof Mu&&e._removeParent(this)},Mu.EMPTY=((n=new Mu).closed=!0,n),Mu);function Mu(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}function Nu(e){Ru.isFunction(e)?e():e.unsubscribe()}m.Subscription=ku,m.EMPTY_SUBSCRIPTION=ku.EMPTY,m.isSubscription=function(e){return e instanceof ku||e&&"closed"in e&&Ru.isFunction(e.remove)&&Ru.isFunction(e.add)&&Ru.isFunction(e.unsubscribe)};var xu,Du,Lu,Nt={},w=(Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.config=void 0,Nt.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},{}),h={},Uu=(xu=h,Du=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},Lu=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.timeoutProvider=void 0,xu.timeoutProvider={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=xu.timeoutProvider.delegate;return null!=o&&o.setTimeout?o.setTimeout.apply(o,Lu([e,t],Du(r))):setTimeout.apply(void 0,Lu([e,t],Du(r)))},clearTimeout:function(e){var t=xu.timeoutProvider.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0},Object.defineProperty(w,"__esModule",{value:!0}),w.reportUnhandledError=void 0,Nt),Fu=h;w.reportUnhandledError=function(t){Fu.timeoutProvider.setTimeout(function(){var e=Uu.config.onUnhandledError;if(!e)throw t;e(t)})};g={};Object.defineProperty(g,"__esModule",{value:!0}),g.noop=void 0,g.noop=function(){};s={};function Bu(e,t,r){return{kind:e,value:t,error:r}}Object.defineProperty(s,"__esModule",{value:!0}),s.createNotification=s.nextNotification=s.errorNotification=s.COMPLETE_NOTIFICATION=void 0,s.COMPLETE_NOTIFICATION=Bu("C",void 0,void 0),s.errorNotification=function(e){return Bu("E",void 0,e)},s.nextNotification=function(e){return Bu("N",e,void 0)},s.createNotification=Bu;var Wu,qu,zu,Vu,Hu,Gu,Yu,Ku,Zu,Qu,Xu,Ju,$u,ea,b={},ta=(Object.defineProperty(b,"__esModule",{value:!0}),b.captureError=b.errorContext=void 0,Nt),ra=null;function na(e){var t=zu.call(this)||this;return t.isStopped=!1,e?(t.destination=e,Hu.isSubscription(e)&&e.add(t)):t.destination=Wu.EMPTY_OBSERVER,t}function oa(e,t){return Xu.call(e,t)}function ia(e){this.partialObserver=e}function ua(e,t,r){var n=$u.call(this)||this;return r=Vu.isFunction(e)||!e?{next:null!=e?e:void 0,error:null!=t?t:void 0,complete:null!=r?r:void 0}:n&&Gu.config.useDeprecatedNextContext?((t=Object.create(e)).unsubscribe=function(){return n.unsubscribe()},{next:e.next&&oa(e.next,t),error:e.error&&oa(e.error,t),complete:e.complete&&oa(e.complete,t)}):e,n.destination=new Ju(r),n}function aa(e){Gu.config.useDeprecatedSynchronousErrorHandling?Qu.captureError(e):Yu.reportUnhandledError(e)}function sa(e,t){var r=Gu.config.onStoppedNotification;r&&Zu.timeoutProvider.setTimeout(function(){return r(e,t)})}b.errorContext=function(e){if(ta.config.useDeprecatedSynchronousErrorHandling){var t=!ra;if(t&&(ra={errorThrown:!1,error:null}),e(),t){var t=ra,r=t.errorThrown,t=t.error;if(ra=null,r)throw t}}else e()},b.captureError=function(e){ta.config.useDeprecatedSynchronousErrorHandling&&ra&&(ra.errorThrown=!0,ra.error=e)},Wu=Zr,t=r&&r.__extends||(qu=function(e,t){return(qu=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}qu(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.EMPTY_OBSERVER=Wu.SafeSubscriber=Wu.Subscriber=void 0,Vu=E,Gu=Nt,Yu=w,u=g,Ku=s,Zu=h,Qu=b,zu=(Hu=m).Subscription,t(na,zu),na.create=function(e,t,r){return new ea(e,t,r)},na.prototype.next=function(e){this.isStopped?sa(Ku.nextNotification(e),this):this._next(e)},na.prototype.error=function(e){this.isStopped?sa(Ku.errorNotification(e),this):(this.isStopped=!0,this._error(e))},na.prototype.complete=function(){this.isStopped?sa(Ku.COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},na.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,zu.prototype.unsubscribe.call(this),this.destination=null)},na.prototype._next=function(e){this.destination.next(e)},na.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},na.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},f=na,Wu.Subscriber=f,Xu=Function.prototype.bind,ia.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){aa(e)}},ia.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){aa(e)}else aa(e)},ia.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){aa(e)}},Ju=ia,t(ua,$u=f),ea=ua,Wu.SafeSubscriber=ea,Wu.EMPTY_OBSERVER={closed:!0,next:u.noop,error:function(e){throw e},complete:u.noop};it={},Object.defineProperty(it,"__esModule",{value:!0}),it.observable=void 0,it.observable="function"==typeof Symbol&&Symbol.observable||"@@observable",c={},p={};Object.defineProperty(p,"__esModule",{value:!0}),p.identity=void 0,p.identity=function(e){return e},Object.defineProperty(c,"__esModule",{value:!0}),c.pipeFromArray=c.pipe=void 0;var ca=p;function la(t){return 0===t.length?ca.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 la(e)},c.pipeFromArray=la,Object.defineProperty(o,"__esModule",{value:!0}),o.Observable=void 0;var fa=Zr,pa=m,i=it,da=c,ha=Nt,ba=E,ya=b;function _a(e){e&&(this._subscribe=e)}function va(e){return null!=(e=null!=e?e:ha.config.Promise)?e:Promise}_a.prototype.lift=function(e){var t=new _a;return t.source=this,t.operator=e,t},_a.prototype.subscribe=function(e,t,r){var n,o=this,i=(n=e)&&n instanceof fa.Subscriber||function(e){return e&&ba.isFunction(e.next)&&ba.isFunction(e.error)&&ba.isFunction(e.complete)}(n)&&pa.isSubscription(n)?e:new fa.SafeSubscriber(e,t,r);return ya.errorContext(function(){var e=o.operator,t=o.source;i.add(e?e.call(i,t):t?o._subscribe(i):o._trySubscribe(i))}),i},_a.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},_a.prototype.forEach=function(n,e){var o=this;return new(e=va(e))(function(e,t){var r=new fa.SafeSubscriber({next:function(e){try{n(e)}catch(e){t(e),r.unsubscribe()}},error:t,complete:e});o.subscribe(r)})},_a.prototype._subscribe=function(e){var t;return null==(t=this.source)?void 0:t.subscribe(e)},_a.prototype[i.observable]=function(){return this},_a.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return da.pipeFromArray(e)(this)},_a.prototype.toPromise=function(e){var n=this;return new(e=va(e))(function(e,t){var r;n.subscribe(function(e){return r=e},function(e){return t(e)},function(){return e(r)})})},_a.create=function(e){return new _a(e)},o.Observable=_a;var pn={},C={},T={},ma=(Object.defineProperty(T,"__esModule",{value:!0}),T.operate=T.hasLift=void 0,E);function ga(e){return ma.isFunction(null==e?void 0:e.lift)}T.hasLift=ga,T.operate=function(t){return function(e){if(ga(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 Oa,j={},_=r&&r.__extends||(Oa=function(e,t){return(Oa=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}Oa(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),P=(Object.defineProperty(j,"__esModule",{value:!0}),j.OperatorSubscriber=j.createOperatorSubscriber=void 0,Zr);j.createOperatorSubscriber=function(e,t,r,n,o){return new Ea(e,t,r,n,o)};_(Pa,wa=P.Subscriber),Pa.prototype.unsubscribe=function(){var e;this.shouldUnsubscribe&&!this.shouldUnsubscribe()||(e=this.closed,wa.prototype.unsubscribe.call(this),e||null==(e=this.onFinalize)||e.call(this))};var wa,Ea=Pa;function Pa(t,r,e,n,o,i){var u=wa.call(this,t)||this;return u.onFinalize=o,u.shouldUnsubscribe=i,u._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:wa.prototype._next,u._error=n?function(e){try{n(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:wa.prototype._error,u._complete=e?function(){try{e()}catch(e){t.error(e)}finally{this.unsubscribe()}}:wa.prototype._complete,u}j.OperatorSubscriber=Ea,Object.defineProperty(C,"__esModule",{value:!0}),C.refCount=void 0;var Sa=T,Ta=j;C.refCount=function(){return Sa.operate(function(r,n){var o=null,e=(r._refCount++,Ta.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 ja,O=r&&r.__extends||(ja=function(e,t){return(ja=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}ja(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(pn,"__esModule",{value:!0}),pn.ConnectableObservable=void 0;var Ca,Ra=m,Ia=C,Aa=j,ka=T,S=(Ca=o.Observable,O(Ma,Ca),Ma.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},Ma.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},Ma.prototype._teardown=function(){this._refCount=0;var e=this._connection;(this._subject=this._connection=null)!=e&&e.unsubscribe()},Ma.prototype.connect=function(){var t,r=this,e=this._connection;return e||(e=this._connection=new Ra.Subscription,t=this.getSubject(),e.add(this.source.subscribe(Aa.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=Ra.Subscription.EMPTY)),e},Ma.prototype.refCount=function(){return Ia.refCount()(this)},Ma);function Ma(e,t){var r=Ca.call(this)||this;return r.source=e,r.subjectFactory=t,r._subject=null,r._refCount=0,r._connection=null,ka.hasLift(e)&&(r.lift=e.lift),r}pn.ConnectableObservable=S;var Na,xa,Da,La,Ua,n={},s={},h=(Na=s,Object.defineProperty(Na,"__esModule",{value:!0}),Na.performanceTimestampProvider=void 0,Na.performanceTimestampProvider={now:function(){return(Na.performanceTimestampProvider.delegate||performance).now()},delegate:void 0},{}),Fa=(xa=h,Da=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},La=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(xa,"__esModule",{value:!0}),xa.animationFrameProvider=void 0,Ua=m,xa.animationFrameProvider={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=xa.animationFrameProvider.delegate,o=(n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame),e(function(e){r=void 0,t(e)}));return new Ua.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=xa.animationFrameProvider.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,La([],Da(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=xa.animationFrameProvider.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,La([],Da(e)))},delegate:void 0},Object.defineProperty(n,"__esModule",{value:!0}),n.animationFrames=void 0,o),Ba=s,Wa=h;function qa(a){return new Fa.Observable(function(r){var n=a||Ba.performanceTimestampProvider,o=n.now(),i=0,u=function(){r.closed||(i=Wa.animationFrameProvider.requestAnimationFrame(function(e){i=0;var t=n.now();r.next({timestamp:a?t:e,elapsed:t-o}),u()}))};return u(),function(){i&&Wa.animationFrameProvider.cancelAnimationFrame(i)}})}n.animationFrames=function(e){return e?qa(e):Ha};var za,Va,Ha=qa(),t={},f={},u=(Object.defineProperty(f,"__esModule",{value:!0}),f.ObjectUnsubscribedError=void 0,y),i=(f.ObjectUnsubscribedError=u.createErrorClass(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),r&&r.__extends||(za=function(e,t){return(za=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}za(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Ga=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.")},Ya=(Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousSubject=t.Subject=void 0,o),Ka=m,Za=f,Qa=v,Xa=b,_=(Va=Ya.Observable,i(Ja,Va),Ja.prototype.lift=function(e){var t=new es(this,this);return t.operator=e,t},Ja.prototype._throwIfClosed=function(){if(this.closed)throw new Za.ObjectUnsubscribedError},Ja.prototype.next=function(o){var i=this;Xa.errorContext(function(){var t,e;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var r=Ga(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}}}})},Ja.prototype.error=function(t){var r=this;Xa.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)}})},Ja.prototype.complete=function(){var t=this;Xa.errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}})},Ja.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(Ja.prototype,"observed",{get:function(){var e;return 0<(null==(e=this.observers)?void 0:e.length)},enumerable:!1,configurable:!0}),Ja.prototype._trySubscribe=function(e){return this._throwIfClosed(),Va.prototype._trySubscribe.call(this,e)},Ja.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},Ja.prototype._innerSubscribe=function(e){var t=this,r=this.hasError,n=this.isStopped,o=this.observers;return r||n?Ka.EMPTY_SUBSCRIPTION:(this.currentObservers=null,o.push(e),new Ka.Subscription(function(){t.currentObservers=null,Qa.arrRemove(o,e)}))},Ja.prototype._checkFinalizedStatuses=function(e){var t=this.hasError,r=this.thrownError,n=this.isStopped;t?e.error(r):n&&e.complete()},Ja.prototype.asObservable=function(){var e=new Ya.Observable;return e.source=this,e},Ja.create=function(e,t){return new es(e,t)},Ja);function Ja(){var e=Va.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}t.Subject=_;i(ts,$a=_),ts.prototype.next=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.next)&&r.call(t,e)},ts.prototype.error=function(e){var t,r;null!=(r=null==(t=this.destination)?void 0:t.error)&&r.call(t,e)},ts.prototype.complete=function(){var e,t;null!=(t=null==(e=this.destination)?void 0:e.complete)&&t.call(e)},ts.prototype._subscribe=function(e){var t;return null!=(t=null==(t=this.source)?void 0:t.subscribe(e))?t:Ka.EMPTY_SUBSCRIPTION};var $a,es=ts;function ts(e,t){var r=$a.call(this)||this;return r.destination=e,r.source=t,r}t.AnonymousSubject=es;var rs,P={},O=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)});Object.defineProperty(P,"__esModule",{value:!0}),P.BehaviorSubject=void 0;ns=t.Subject,O(os,ns),Object.defineProperty(os.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),os.prototype._subscribe=function(e){var t=ns.prototype._subscribe.call(this,e);return t.closed||e.next(this._value),t},os.prototype.getValue=function(){var e=this.hasError,t=this.thrownError,r=this._value;if(e)throw t;return this._throwIfClosed(),r},os.prototype.next=function(e){ns.prototype.next.call(this,this._value=e)};var ns,S=os;function os(e){var t=ns.call(this)||this;return t._value=e,t}P.BehaviorSubject=S;var is,us,s={},u={},b=(is=u,Object.defineProperty(is,"__esModule",{value:!0}),is.dateTimestampProvider=void 0,is.dateTimestampProvider={now:function(){return(is.dateTimestampProvider.delegate||Date).now()},delegate:void 0},r&&r.__extends||(us=function(e,t){return(us=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}us(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(s,"__esModule",{value:!0}),s.ReplaySubject=void 0;var as,ss=u,i=(as=t.Subject,b(cs,as),cs.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(),as.prototype.next.call(this,e)},cs.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},cs.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)}},cs);function cs(e,t,r){void 0===e&&(e=1/0),void 0===t&&(t=1/0),void 0===r&&(r=ss.dateTimestampProvider);var n=as.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}s.ReplaySubject=i;var ls,_={},O=r&&r.__extends||(ls=function(e,t){return(ls=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}ls(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(_,"__esModule",{value:!0}),_.AsyncSubject=void 0;fs=t.Subject,O(ps,fs),ps.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())},ps.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},ps.prototype.complete=function(){var e=this._hasValue,t=this._value;this._isComplete||(this._isComplete=!0,e&&fs.prototype.next.call(this,t),fs.prototype.complete.call(this))};var fs,S=ps;function ps(){var e=null!==fs&&fs.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}_.AsyncSubject=S;var ds,b={},i={},O={},S={},hs=r&&r.__extends||(ds=function(e,t){return(ds=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}ds(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(S,"__esModule",{value:!0}),S.Action=void 0;bs=m.Subscription,hs(ys,bs),ys.prototype.schedule=function(e,t){return this};var bs,hs=ys;function ys(e,t){return bs.call(this)||this}S.Action=hs;var _s,vs,ms,gs,hs={},Os=(_s=hs,vs=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},ms=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(_s,"__esModule",{value:!0}),_s.intervalProvider=void 0,_s.intervalProvider={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=_s.intervalProvider.delegate;return null!=o&&o.setInterval?o.setInterval.apply(o,ms([e,t],vs(r))):setInterval.apply(void 0,ms([e,t],vs(r)))},clearInterval:function(e){var t=_s.intervalProvider.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},r&&r.__extends||(gs=function(e,t){return(gs=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}gs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}));Object.defineProperty(O,"__esModule",{value:!0}),O.AsyncAction=void 0;var ws,Es=hs,Ps=v,hs=(ws=S.Action,Os(Ss,ws),Ss.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},Ss.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),Es.intervalProvider.setInterval(e.flush.bind(e,this),r)},Ss.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)&&this.delay===r&&!1===this.pending)return t;null!=t&&Es.intervalProvider.clearInterval(t)},Ss.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))},Ss.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},Ss.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,Ps.arrRemove(r,this),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,ws.prototype.unsubscribe.call(this))},Ss);function Ss(e,t){var r=ws.call(this,e,t)||this;return r.scheduler=e,r.work=t,r.pending=!1,r}O.AsyncAction=hs;var Ts,js,Cs,Rs,Is,As,S={},Os={},ks=(Object.defineProperty(Os,"__esModule",{value:!0}),Os.TestTools=Os.Immediate=void 0,1),Ms={};function Ns(e){return e in Ms&&(delete Ms[e],!0)}Os.Immediate={setImmediate:function(e){var t=ks++;return Ms[t]=!0,(Ts=Ts||Promise.resolve()).then(function(){return Ns(t)&&e()}),t},clearImmediate:function(e){Ns(e)}},Os.TestTools={pending:function(){return Object.keys(Ms).length}},js=S,Cs=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},Rs=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(js,"__esModule",{value:!0}),js.immediateProvider=void 0,Is=Os.Immediate.setImmediate,As=Os.Immediate.clearImmediate,js.immediateProvider={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=js.immediateProvider.delegate;return((null==r?void 0:r.setImmediate)||Is).apply(void 0,Rs([],Cs(e)))},clearImmediate:function(e){var t=js.immediateProvider.delegate;return((null==t?void 0:t.clearImmediate)||As)(e)},delegate:void 0};var xs,hs=r&&r.__extends||(xs=function(e,t){return(xs=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}xs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0}),i.AsapAction=void 0;var Ds,Ls=S,Os=(Ds=O.AsyncAction,hs(Us,Ds),Us.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?Ds.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=Ls.immediateProvider.setImmediate(e.flush.bind(e,void 0))))},Us.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return Ds.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(Ls.immediateProvider.clearImmediate(t),e._scheduled===t&&(e._scheduled=void 0))},Us);function Us(e,t){var r=Ds.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}i.AsapAction=Os;var S={},hs={},Os={},Fs=(Object.defineProperty(Os,"__esModule",{value:!0}),Os.Scheduler=void 0,u);function Bs(e,t){void 0===t&&(t=Bs.now),this.schedulerActionCtor=e,this.now=t}Bs.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},Bs.now=Fs.dateTimestampProvider.now,Os.Scheduler=Bs;var Ws,qs,Fs=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)}),zs=(Object.defineProperty(hs,"__esModule",{value:!0}),hs.AsyncScheduler=void 0,Os),Fs=(qs=zs.Scheduler,Fs(Vs,qs),Vs.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}}},Vs);function Vs(e,t){void 0===t&&(t=zs.Scheduler.now);e=qs.call(this,e,t)||this;return e.actions=[],e._active=!1,e}hs.AsyncScheduler=Fs;var Hs,Fs=r&&r.__extends||(Hs=function(e,t){return(Hs=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}Hs(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(S,"__esModule",{value:!0}),S.AsapScheduler=void 0;Gs=hs.AsyncScheduler,Fs(Ys,Gs),Ys.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 Gs,Fs=Ys;function Ys(){return null!==Gs&&Gs.apply(this,arguments)||this}S.AsapScheduler=Fs,Fs=b,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.asap=Fs.asapScheduler=void 0,Fs.asapScheduler=new S.AsapScheduler(i.AsapAction),Fs.asap=Fs.asapScheduler;var Ks,S={},Fs=(i=S,Object.defineProperty(i,"__esModule",{value:!0}),i.async=i.asyncScheduler=void 0,i.asyncScheduler=new hs.AsyncScheduler(O.AsyncAction),i.async=i.asyncScheduler,{}),i={},Zs=r&&r.__extends||(Ks=function(e,t){return(Ks=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}Ks(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0}),i.QueueAction=void 0;Qs=O.AsyncAction,Zs(Xs,Qs),Xs.prototype.schedule=function(e,t){return 0<(t=void 0===t?0:t)?Qs.prototype.schedule.call(this,e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)},Xs.prototype.execute=function(e,t){return 0<t||this.closed?Qs.prototype.execute.call(this,e,t):this._execute(e,t)},Xs.prototype.requestAsyncId=function(e,t,r){return null!=(r=void 0===r?0:r)&&0<r||null==r&&0<this.delay?Qs.prototype.requestAsyncId.call(this,e,t,r):(e.flush(this),0)};var Qs,Zs=Xs;function Xs(e,t){var r=Qs.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}i.QueueAction=Zs;var Js,Zs={},$s=r&&r.__extends||(Js=function(e,t){return(Js=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}Js(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.QueueScheduler=void 0;ec=hs.AsyncScheduler,$s(tc,ec);var ec,$s=tc;function tc(){return null!==ec&&ec.apply(this,arguments)||this}Zs.QueueScheduler=$s,$s=Fs,Object.defineProperty($s,"__esModule",{value:!0}),$s.queue=$s.queueScheduler=void 0,$s.queueScheduler=new Zs.QueueScheduler(i.QueueAction),$s.queue=$s.queueScheduler;var rc,Zs={},i={},$s=r&&r.__extends||(rc=function(e,t){return(rc=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}rc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0}),i.AnimationFrameAction=void 0;var nc,oc=h,h=(nc=O.AsyncAction,$s(ic,nc),ic.prototype.requestAsyncId=function(e,t,r){return null!==(r=void 0===r?0:r)&&0<r?nc.prototype.requestAsyncId.call(this,e,t,r):(e.actions.push(this),e._scheduled||(e._scheduled=oc.animationFrameProvider.requestAnimationFrame(function(){return e.flush(void 0)})))},ic.prototype.recycleAsyncId=function(e,t,r){if(null!=(r=void 0===r?0:r)?0<r:0<this.delay)return nc.prototype.recycleAsyncId.call(this,e,t,r);var r=e.actions;null!=t&&(null==(r=r[r.length-1])?void 0:r.id)!==t&&(oc.animationFrameProvider.cancelAnimationFrame(t),e._scheduled=void 0)},ic);function ic(e,t){var r=nc.call(this,e,t)||this;return r.scheduler=e,r.work=t,r}i.AnimationFrameAction=h;var uc,$s={},h=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)});Object.defineProperty($s,"__esModule",{value:!0}),$s.AnimationFrameScheduler=void 0;ac=hs.AsyncScheduler,h(sc,ac),sc.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 ac,h=sc;function sc(){return null!==ac&&ac.apply(this,arguments)||this}$s.AnimationFrameScheduler=h,h=Zs,Object.defineProperty(h,"__esModule",{value:!0}),h.animationFrame=h.animationFrameScheduler=void 0,h.animationFrameScheduler=new $s.AnimationFrameScheduler(i.AnimationFrameAction),h.animationFrame=h.animationFrameScheduler;var cc,lc,$s={},i=r&&r.__extends||(cc=function(e,t){return(cc=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}cc(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),h=(Object.defineProperty($s,"__esModule",{value:!0}),$s.VirtualAction=$s.VirtualTimeScheduler=void 0,O),fc=m,O=(lc=hs.AsyncScheduler,i(pc,lc),pc.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}},pc.frameTimeFactor=10,pc);function pc(e,t){void 0===t&&(t=1/0);var r=lc.call(this,e=void 0===e?hc:e,function(){return r.frame})||this;return r.maxFrames=t,r.frame=0,r.index=-1,r}$s.VirtualTimeScheduler=O;dc=h.AsyncAction,i(bc,dc),bc.prototype.schedule=function(e,t){if(void 0===t&&(t=0),Number.isFinite(t)){if(!this.id)return dc.prototype.schedule.call(this,e,t);this.active=!1;var r=new bc(this.scheduler,this.work);return this.add(r),r.schedule(e,t)}return fc.Subscription.EMPTY},bc.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(bc.sortActions),1},bc.prototype.recycleAsyncId=function(e,t,r){},bc.prototype._execute=function(e,t){if(!0===this.active)return dc.prototype._execute.call(this,e,t)},bc.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 dc,hc=bc;function bc(e,t,r){void 0===r&&(r=e.index+=1);var n=dc.call(this,e,t)||this;return n.scheduler=e,n.work=t,n.index=r,n.active=!0,n.index=e.index=r,n}$s.VirtualAction=hc;var yc,_c,hs={},O={},h=(yc=O,Object.defineProperty(yc,"__esModule",{value:!0}),yc.empty=yc.EMPTY=void 0,_c=o,yc.EMPTY=new _c.Observable(function(e){return e.complete()}),yc.empty=function(e){return e?(t=e,new _c.Observable(function(e){return t.schedule(function(){return e.complete()})})):yc.EMPTY;var t},{}),i={},vc={},mc=(Object.defineProperty(vc,"__esModule",{value:!0}),vc.isScheduler=void 0,E);vc.isScheduler=function(e){return e&&mc.isFunction(e.schedule)},Object.defineProperty(i,"__esModule",{value:!0}),i.popNumber=i.popScheduler=i.popResultSelector=void 0;var gc=E,Oc=vc;function wc(e){return e[e.length-1]}i.popResultSelector=function(e){return gc.isFunction(wc(e))?e.pop():void 0},i.popScheduler=function(e){return Oc.isScheduler(wc(e))?e.pop():void 0},i.popNumber=function(e,t){return"number"==typeof wc(e)?e.pop():t};var Ec={},Pc={},Sc={},R={},Tc={},jc=(Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.isArrayLike=void 0,Tc.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},{}),Cc=(Object.defineProperty(jc,"__esModule",{value:!0}),jc.isPromise=void 0,E);jc.isPromise=function(e){return Cc.isFunction(null==e?void 0:e.then)};var Rc={},Ic=(Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.isInteropObservable=void 0,it),Ac=E;Rc.isInteropObservable=function(e){return Ac.isFunction(e[Ic.observable])};var kc={},Mc=(Object.defineProperty(kc,"__esModule",{value:!0}),kc.isAsyncIterable=void 0,E);kc.isAsyncIterable=function(e){return Symbol.asyncIterator&&Mc.isFunction(null==e?void 0:e[Symbol.asyncIterator])};var Nc={};Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.createInvalidObservableTypeError=void 0,Nc.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 xc={},Dc={};function Lc(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.iterator=Dc.getSymbolIterator=void 0,Dc.getSymbolIterator=Lc,Dc.iterator=Lc(),Object.defineProperty(xc,"__esModule",{value:!0}),xc.isIterable=void 0;var Uc=Dc,Fc=E;xc.isIterable=function(e){return Fc.isFunction(null==e?void 0:e[Uc.iterator])};var Bc={},Wc=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}}}},qc=r&&r.__await||function(e){return this instanceof qc?(this.v=e,this):new qc(e)},zc=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 qc?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])}},Vc=(Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.isReadableStreamLike=Bc.readableStreamLikeToAsyncGenerator=void 0,E);Bc.readableStreamLikeToAsyncGenerator=function(o){return zc(this,arguments,function(){var t,r,n;return Wc(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,qc(t.read())];case 3:return(r=e.sent(),n=r.value,r.done)?[4,qc(void 0)]:[3,5];case 4:return[2,e.sent()];case 5:return[4,qc(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]}})})},Bc.isReadableStreamLike=function(e){return Vc.isFunction(null==e?void 0:e.getReader)};var Hc=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())})},Gc=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}}}},Yc=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 Kc?Kc(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)})}}},Kc=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.")},Zc=(Object.defineProperty(R,"__esModule",{value:!0}),R.fromReadableStreamLike=R.fromAsyncIterable=R.fromIterable=R.fromPromise=R.fromArrayLike=R.fromInteropObservable=R.innerFrom=void 0,Tc),Qc=jc,Xc=o,Jc=Rc,$c=kc,el=Nc,tl=xc,rl=Bc,nl=E,ol=w,il=it;function ul(r){return new Xc.Observable(function(e){var t=r[il.observable]();if(nl.isFunction(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function al(r){return new Xc.Observable(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function sl(e){return new Xc.Observable(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,ol.reportUnhandledError)})}function cl(u){return new Xc.Observable(function(e){var t,r;try{for(var n=Kc(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 ll(e){return new Xc.Observable(function(t){!function(r,n){var o,i,u,a;return Hc(this,void 0,void 0,function(){var t;return Gc(this,function(e){switch(e.label){case 0:e.trys.push([0,5,6,11]),o=Yc(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 fl(e){return ll(rl.readableStreamLikeToAsyncGenerator(e))}R.innerFrom=function(e){if(e instanceof Xc.Observable)return e;if(null!=e){if(Jc.isInteropObservable(e))return ul(e);if(Zc.isArrayLike(e))return al(e);if(Qc.isPromise(e))return sl(e);if($c.isAsyncIterable(e))return ll(e);if(tl.isIterable(e))return cl(e);if(rl.isReadableStreamLike(e))return fl(e)}throw el.createInvalidObservableTypeError(e)},R.fromInteropObservable=ul,R.fromArrayLike=al,R.fromPromise=sl,R.fromIterable=cl,R.fromAsyncIterable=ll,R.fromReadableStreamLike=fl;var w={},pl={};Object.defineProperty(pl,"__esModule",{value:!0}),pl.executeSchedule=void 0,pl.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(w,"__esModule",{value:!0}),w.observeOn=void 0;var dl=pl,hl=T,bl=j;w.observeOn=function(r,n){return void 0===n&&(n=0),hl.operate(function(e,t){e.subscribe(bl.createOperatorSubscriber(t,function(e){return dl.executeSchedule(t,r,function(){return t.next(e)},n)},function(){return dl.executeSchedule(t,r,function(){return t.complete()},n)},function(e){return dl.executeSchedule(t,r,function(){return t.error(e)},n)}))})};var yl={},_l=(Object.defineProperty(yl,"__esModule",{value:!0}),yl.subscribeOn=void 0,T);yl.subscribeOn=function(r,n){return void 0===n&&(n=0),_l.operate(function(e,t){t.add(r.schedule(function(){return e.subscribe(t)},n))})},Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.scheduleObservable=void 0;var vl=R,ml=w,gl=yl;Sc.scheduleObservable=function(e,t){return vl.innerFrom(e).pipe(gl.subscribeOn(t),ml.observeOn(t))};var Ol={},wl=(Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.schedulePromise=void 0,R),El=w,Pl=yl;Ol.schedulePromise=function(e,t){return wl.innerFrom(e).pipe(Pl.subscribeOn(t),El.observeOn(t))};var Sl={},Tl=(Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.scheduleArray=void 0,o);Sl.scheduleArray=function(r,n){return new Tl.Observable(function(e){var t=0;return n.schedule(function(){t===r.length?e.complete():(e.next(r[t++]),e.closed||this.schedule())})})};var jl={},Cl=(Object.defineProperty(jl,"__esModule",{value:!0}),jl.scheduleIterable=void 0,o),Rl=Dc,Il=E,Al=pl;jl.scheduleIterable=function(e,t){return new Cl.Observable(function(n){var o;return Al.executeSchedule(n,t,function(){o=e[Rl.iterator](),Al.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 Il.isFunction(null==o?void 0:o.return)&&o.return()}})};var Dc={},kl=(Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.scheduleAsyncIterable=void 0,o),Ml=pl;Dc.scheduleAsyncIterable=function(r,n){if(r)return new kl.Observable(function(t){Ml.executeSchedule(t,n,function(){var e=r[Symbol.asyncIterator]();Ml.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 Nl={},xl=(Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.scheduleReadableStreamLike=void 0,Dc),Dl=Bc;Nl.scheduleReadableStreamLike=function(e,t){return xl.scheduleAsyncIterable(Dl.readableStreamLikeToAsyncGenerator(e),t)},Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.scheduled=void 0;var Ll=Sc,Ul=Ol,Fl=Sl,Bl=jl,Wl=Dc,ql=Rc,zl=jc,Vl=Tc,Hl=xc,Gl=kc,Yl=Nc,Kl=Bc,Zl=Nl;Pc.scheduled=function(e,t){if(null!=e){if(ql.isInteropObservable(e))return Ll.scheduleObservable(e,t);if(Vl.isArrayLike(e))return Fl.scheduleArray(e,t);if(zl.isPromise(e))return Ul.schedulePromise(e,t);if(Gl.isAsyncIterable(e))return Wl.scheduleAsyncIterable(e,t);if(Hl.isIterable(e))return Bl.scheduleIterable(e,t);if(Kl.isReadableStreamLike(e))return Zl.scheduleReadableStreamLike(e,t)}throw Yl.createInvalidObservableTypeError(e)},Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.from=void 0;var Ql=Pc,Xl=R;Ec.from=function(e,t){return t?Ql.scheduled(e,t):Xl.innerFrom(e)},Object.defineProperty(h,"__esModule",{value:!0}),h.of=void 0;var Jl=i,$l=Ec;h.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Jl.popScheduler(e);return $l.from(e,r)};var ef,tf,rf,nf,Sc={},of=(Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.throwError=void 0,o),uf=E;function af(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}function sf(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)}Sc.throwError=function(e,t){function r(e){return e.error(n())}var n=uf.isFunction(e)?e:function(){return e};return new of.Observable(t?function(e){return t.schedule(r,0,e)}:r)},Ol=hs,Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.observeNotification=Ol.Notification=Ol.NotificationKind=void 0,ef=O,tf=h,rf=Sc,nf=E,(Sl=Ol.NotificationKind||(Ol.NotificationKind={})).NEXT="N",Sl.ERROR="E",Sl.COMPLETE="C",af.prototype.observe=function(e){return sf(this,e)},af.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()},af.prototype.accept=function(e,t,r){var n;return nf.isFunction(null==(n=e)?void 0:n.next)?this.observe(e):this.do(e,t,r)},af.prototype.toObservable=function(){var e=this.kind,t=this.value,r=this.error,t="N"===e?tf.of(t):"E"===e?rf.throwError(function(){return r}):"C"===e?ef.EMPTY:0;if(t)return t;throw new TypeError("Unexpected notification kind "+e)},af.createNext=function(e){return new af("N",e)},af.createError=function(e){return new af("E",void 0,e)},af.createComplete=function(){return af.completeNotification},af.completeNotification=new af("C"),Sl=af,Ol.Notification=Sl,Ol.observeNotification=sf;var Dc={},cf=(Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.isObservable=void 0,o),lf=E;Dc.isObservable=function(e){return!!e&&(e instanceof cf.Observable||lf.isFunction(e.lift)&&lf.isFunction(e.subscribe))};var Rc={},jc={},xc=(Object.defineProperty(jc,"__esModule",{value:!0}),jc.EmptyError=void 0,y),ff=(jc.EmptyError=xc.createErrorClass(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}),Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.lastValueFrom=void 0,jc);Rc.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 ff.EmptyError)}})})};var kc={},pf=(Object.defineProperty(kc,"__esModule",{value:!0}),kc.firstValueFrom=void 0,jc),df=Zr;kc.firstValueFrom=function(n,o){var i="object"==typeof o;return new Promise(function(t,e){var r=new df.SafeSubscriber({next:function(e){t(e),r.unsubscribe()},error:e,complete:function(){i?t(o.defaultValue):e(new pf.EmptyError)}});n.subscribe(r)})};var hf,bf,yf,_f,vf,mf,gf,Nc={},Bc=(Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.ArgumentOutOfRangeError=void 0,y),Nl=(Nc.ArgumentOutOfRangeError=Bc.createErrorClass(function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}),{}),Sl=(Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.NotFoundError=void 0,y),Ol=(Nl.NotFoundError=Sl.createErrorClass(function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}}),{}),xc=(Object.defineProperty(Ol,"__esModule",{value:!0}),Ol.SequenceError=void 0,y),Bc=(Ol.SequenceError=xc.createErrorClass(function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}),{}),Sl={};function Of(e){throw new hf.TimeoutError(e)}Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.isValidDate=void 0,Sl.isValidDate=function(e){return e instanceof Date&&!isNaN(e)},hf=Bc,Object.defineProperty(hf,"__esModule",{value:!0}),hf.timeout=hf.TimeoutError=void 0,bf=S,yf=Sl,_f=T,vf=R,mf=j,gf=pl,hf.TimeoutError=y.createErrorClass(function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}),hf.timeout=function(e,t){var a=(e=yf.isValidDate(e)?{first:e}:"number"==typeof e?{each:e}:e).first,s=e.each,r=e.with,c=void 0===r?Of:r,l=void 0===(r=e.scheduler)?null!=t?t:bf.asyncScheduler:r,f=void 0===(t=e.meta)?null:t;if(null==a&&null==s)throw new TypeError("No timeout provided.");return _f.operate(function(e,t){function r(e){n=gf.executeSchedule(t,l,function(){try{u.unsubscribe(),vf.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(mf.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 xc={},y={},wf={},Ef={},Pf=(Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.map=void 0,T),Sf=j;Ef.map=function(n,o){return Pf.operate(function(e,t){var r=0;e.subscribe(Sf.createOperatorSubscriber(t,function(e){t.next(n.call(o,e,r++))}))})};var Tf=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},jf=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},Cf=(Object.defineProperty(wf,"__esModule",{value:!0}),wf.mapOneOrManyArgs=void 0,Ef),Rf=Array.isArray;wf.mapOneOrManyArgs=function(r){return Cf.map(function(e){return t=r,Rf(e=e)?t.apply(void 0,jf([],Tf(e))):t(e);var t})};var If=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},Af=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},kf=(Object.defineProperty(y,"__esModule",{value:!0}),y.bindCallbackInternals=void 0,vc),Mf=o,Nf=yl,xf=wf,Df=w,Lf=_;y.bindCallbackInternals=function r(a,s,n,o){if(n){if(!kf.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(xf.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(Nf.subscribeOn(o),Df.observeOn(o))}:function(){for(var t=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var i=new Lf.AsyncSubject,u=!0;return new Mf.Observable(function(e){var n,o,e=i.subscribe(e);return u&&(n=u=!1,o=!1,s.apply(t,Af(Af([],If(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(xc,"__esModule",{value:!0}),xc.bindCallback=void 0;var Uf=y;xc.bindCallback=function(e,t,r){return Uf.bindCallbackInternals(!1,e,t,r)};var Ff={},Bf=(Object.defineProperty(Ff,"__esModule",{value:!0}),Ff.bindNodeCallback=void 0,y);Ff.bindNodeCallback=function(e,t,r){return Bf.bindCallbackInternals(!0,e,t,r)};var y={},Wf={},qf=(Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.argsArgArrayOrObject=void 0,Array.isArray),zf=Object.getPrototypeOf,Vf=Object.prototype,Hf=Object.keys;Wf.argsArgArrayOrObject=function(e){if(1===e.length){var t=e[0];if(qf(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&zf(r)===Vf)return{args:(r=Hf(t)).map(function(e){return t[e]}),keys:r}}var r;return{args:e,keys:null}};var Gf={};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.createObject=void 0,Gf.createObject=function(e,n){return e.reduce(function(e,t,r){return e[t]=n[r],e},{})},Object.defineProperty(y,"__esModule",{value:!0}),y.combineLatestInit=y.combineLatest=void 0;var Yf=o,Kf=Wf,Zf=Ec,Qf=p,Xf=wf,Jf=i,$f=Gf,ep=j,tp=pl;function rp(a,s,c){return void 0===c&&(c=Qf.identity),function(u){np(s,function(){for(var e=a.length,n=new Array(e),o=e,i=e,t=0;t<e;t++)!function(r){np(s,function(){var e=Zf.from(a[r],s),t=!1;e.subscribe(ep.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 np(e,t,r){e?tp.executeSchedule(r,e,t):t()}y.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Jf.popScheduler(e),n=Jf.popResultSelector(e),o=Kf.argsArgArrayOrObject(e),i=o.args,u=o.keys;return 0===i.length?Zf.from([],r):(o=new Yf.Observable(rp(i,r,u?function(e){return $f.createObject(u,e)}:Qf.identity)),n?o.pipe(Xf.mapOneOrManyArgs(n)):o)},y.combineLatestInit=rp;var op={},ip={},up={},ap={},sp={},cp=(Object.defineProperty(sp,"__esModule",{value:!0}),sp.mergeInternals=void 0,R),lp=pl,fp=j;sp.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;cp.innerFrom(n(e,l++)).subscribe(fp.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?lp.executeSchedule(r,a,function(){return d(e)}):d(e)}();f()}catch(e){r.error(e)}}))};return e.subscribe(fp.createOperatorSubscriber(r,p,function(){f()})),function(){null!=t&&t()}},Object.defineProperty(ap,"__esModule",{value:!0}),ap.mergeMap=void 0;var pp=Ef,dp=R,hp=T,bp=sp,yp=E;ap.mergeMap=function e(o,i,r){return void 0===r&&(r=1/0),yp.isFunction(i)?e(function(r,n){return pp.map(function(e,t){return i(r,e,n,t)})(dp.innerFrom(o(r,n)))},r):("number"==typeof i&&(r=i),hp.operate(function(e,t){return bp.mergeInternals(e,t,o,r)}))},Object.defineProperty(up,"__esModule",{value:!0}),up.mergeAll=void 0;var _p=ap,vp=p;up.mergeAll=function(e){return _p.mergeMap(vp.identity,e=void 0===e?1/0:e)},Object.defineProperty(ip,"__esModule",{value:!0}),ip.concatAll=void 0;var mp=up;ip.concatAll=function(){return mp.mergeAll(1)},Object.defineProperty(op,"__esModule",{value:!0}),op.concat=void 0;var gp=ip,Op=i,wp=Ec;op.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return gp.concatAll()(wp.from(e,Op.popScheduler(e)))};var Ep={},Pp={},Sp=(Object.defineProperty(Pp,"__esModule",{value:!0}),Pp.defer=void 0,o),Tp=R;Pp.defer=function(t){return new Sp.Observable(function(e){Tp.innerFrom(t()).subscribe(e)})},Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.connectable=void 0;var jp=t,Cp=o,Rp=Pp,Ip={connector:function(){return new jp.Subject},resetOnDisconnect:!0};Ep.connectable=function(e,t){var r=null,n=(t=void 0===t?Ip:t).connector,o=void 0===(t=t.resetOnDisconnect)||t,i=n();return(t=new Cp.Observable(function(e){return i.subscribe(e)})).connect=function(){return r&&!r.closed||(r=Rp.defer(function(){return e}).subscribe(i),o&&r.add(function(){return i=n()})),r},t};var Ap={},kp=(Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.forkJoin=void 0,o),Mp=Wf,Np=R,xp=i,Dp=j,Lp=wf,Up=Gf;Ap.forkJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=xp.popResultSelector(e),u=(n=Mp.argsArgArrayOrObject(e)).args,a=n.keys,n=new kp.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;Np.innerFrom(u[t]).subscribe(Dp.createOperatorSubscriber(e,function(e){r||(r=!0,i--),n[t]=e},function(){return o--},void 0,function(){o&&r||(i||e.next(a?Up.createObject(a,n):n),e.complete())}))}(r);else e.complete()});return r?n.pipe(Lp.mapOneOrManyArgs(r)):n};var Wf={},Fp=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},Bp=(Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.fromEvent=void 0,R),Wp=o,qp=ap,zp=Tc,Vp=E,Hp=wf,Gp=["addListener","removeListener"],Yp=["addEventListener","removeEventListener"],Kp=["on","off"];function Zp(r,n){return function(t){return function(e){return r[t](n,e)}}}Wf.fromEvent=function t(r,n,o,e){if(Vp.isFunction(o)&&(e=o,o=void 0),e)return t(r,n,o).pipe(Hp.mapOneOrManyArgs(e));var e=Fp((e=r,Vp.isFunction(e.addEventListener)&&Vp.isFunction(e.removeEventListener)?Yp.map(function(t){return function(e){return r[t](n,e,o)}}):(e=r,Vp.isFunction(e.addListener)&&Vp.isFunction(e.removeListener)?Gp.map(Zp(r,n)):(e=r,Vp.isFunction(e.on)&&Vp.isFunction(e.off)?Kp.map(Zp(r,n)):[]))),2),i=e[0],u=e[1];if(!i&&zp.isArrayLike(r))return qp.mergeMap(function(e){return t(e,n,o)})(Bp.innerFrom(r));if(i)return new Wp.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 Gf={},Qp=(Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.fromEventPattern=void 0,o),Xp=E,Jp=wf;Gf.fromEventPattern=function e(n,o,t){return t?e(n,o).pipe(Jp.mapOneOrManyArgs(t)):new Qp.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 Xp.isFunction(o)?function(){return o(e,t)}:void 0})};var Tc={},$p=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}}}},ed=(Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.generate=void 0,p),td=vc,rd=Pp,nd=jl;Tc.generate=function(e,r,n,t,o){var i,u,a;function s(){var t;return $p(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?ed.identity:i,o=e.scheduler):(a=e,!t||td.isScheduler(t)?(u=ed.identity,o=t):u=t),rd.defer(o?function(){return nd.scheduleIterable(s(),o)}:s)};var jl={},od=(Object.defineProperty(jl,"__esModule",{value:!0}),jl.iif=void 0,Pp);jl.iif=function(e,t,r){return od.defer(function(){return e()?t:r})};var id={},ud={},ad=(Object.defineProperty(ud,"__esModule",{value:!0}),ud.timer=void 0,o),sd=S,cd=vc,ld=Sl;ud.timer=function(n,e,o){void 0===n&&(n=0),void 0===o&&(o=sd.async);var i=-1;return null!=e&&(cd.isScheduler(e)?o=e:i=e),new ad.Observable(function(e){var t=ld.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(id,"__esModule",{value:!0}),id.interval=void 0;var fd=S,pd=ud;id.interval=function(e,t){return pd.timer(e=(e=void 0===e?0:e)<0?0:e,e,t=void 0===t?fd.asyncScheduler:t)};var vc={},dd=(Object.defineProperty(vc,"__esModule",{value:!0}),vc.merge=void 0,up),hd=R,bd=O,yd=i,_d=Ec;vc.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=yd.popScheduler(e),n=yd.popNumber(e,1/0),o=e;return o.length?1===o.length?hd.innerFrom(o[0]):dd.mergeAll(n)(_d.from(o,r)):bd.EMPTY};var vd,md={},gd=(vd=md,Object.defineProperty(vd,"__esModule",{value:!0}),vd.never=vd.NEVER=void 0,vd.NEVER=new o.Observable(g.noop),vd.never=function(){return vd.NEVER},{}),Od={},wd=(Object.defineProperty(Od,"__esModule",{value:!0}),Od.argsOrArgArray=void 0,Array.isArray);Od.argsOrArgArray=function(e){return 1===e.length&&wd(e[0])?e[0]:e},Object.defineProperty(gd,"__esModule",{value:!0}),gd.onErrorResumeNext=void 0;var Ed=o,Pd=Od,Sd=j,Td=g,jd=R;gd.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Pd.argsOrArgArray(e);return new Ed.Observable(function(r){var n=0,o=function(){if(n<i.length){var e=void 0;try{e=jd.innerFrom(i[n++])}catch(e){return void o()}var t=new Sd.OperatorSubscriber(r,void 0,Td.noop,Td.noop);e.subscribe(t),t.add(o)}else r.complete()};o()})};var Cd={},Rd=(Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.pairs=void 0,Ec);Cd.pairs=function(e,t){return Rd.from(Object.entries(e),t)};var Id={},Ad={};Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.not=void 0,Ad.not=function(r,n){return function(e,t){return!r.call(n,e,t)}};var kd={},Md=(Object.defineProperty(kd,"__esModule",{value:!0}),kd.filter=void 0,T),Nd=j;kd.filter=function(n,o){return Md.operate(function(e,t){var r=0;e.subscribe(Nd.createOperatorSubscriber(t,function(e){return n.call(o,e,r++)&&t.next(e)}))})},Object.defineProperty(Id,"__esModule",{value:!0}),Id.partition=void 0;var xd=Ad,Dd=kd,Ld=R;Id.partition=function(e,t,r){return[Dd.filter(t,r)(Ld.innerFrom(e)),Dd.filter(xd.not(t,r))(Ld.innerFrom(e))]};var Ud={},Fd=(Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.raceInit=Ud.race=void 0,o),Bd=R,Wd=Od,qd=j;function zd(t){return function(n){for(var o=[],e=0;o&&!n.closed&&e<t.length;e++)!function(r){o.push(Bd.innerFrom(t[r]).subscribe(qd.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)}}Ud.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===(e=Wd.argsOrArgArray(e)).length?Bd.innerFrom(e[0]):new Fd.Observable(zd(e))},Ud.raceInit=zd;var Vd={},Hd=(Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.range=void 0,o),Gd=O;Vd.range=function(r,e,n){if(null==e&&(e=r,r=0),e<=0)return Gd.EMPTY;var o=e+r;return new Hd.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 Yd={},Kd=(Object.defineProperty(Yd,"__esModule",{value:!0}),Yd.using=void 0,o),Zd=R,Qd=O;Yd.using=function(n,o){return new Kd.Observable(function(e){var t=n(),r=o(t);return(r?Zd.innerFrom(r):Qd.EMPTY).subscribe(e),function(){t&&t.unsubscribe()}})};var Xd={},Jd=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.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},eh=(Object.defineProperty(Xd,"__esModule",{value:!0}),Xd.zip=void 0,o),th=R,rh=Od,nh=O,oh=j,ih=i;Xd.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=ih.popResultSelector(e),u=rh.argsOrArgArray(e);return u.length?new eh.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){th.innerFrom(u[t]).subscribe(oh.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,$d([],Jd(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}}):nh.EMPTY};var uh={},ah=(Object.defineProperty(uh,"__esModule",{value:!0}),{}),sh=(Object.defineProperty(ah,"__esModule",{value:!0}),ah.audit=void 0,T),ch=R,lh=j;ah.audit=function(s){return sh.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(lh.createOperatorSubscriber(t,function(e){o=!0,i=e,u||ch.innerFrom(s(e)).subscribe(u=lh.createOperatorSubscriber(t,r,n))},function(){a=!0,o&&u&&!u.closed||t.complete()}))})};var fh={},ph=(Object.defineProperty(fh,"__esModule",{value:!0}),fh.auditTime=void 0,S),dh=ah,hh=ud;fh.auditTime=function(e,t){return void 0===t&&(t=ph.asyncScheduler),dh.audit(function(){return hh.timer(e,t)})};var bh={},yh=(Object.defineProperty(bh,"__esModule",{value:!0}),bh.buffer=void 0,T),_h=g,vh=j,mh=R;bh.buffer=function(n){return yh.operate(function(e,t){var r=[];return e.subscribe(vh.createOperatorSubscriber(t,function(e){return r.push(e)},function(){t.next(r),t.complete()})),mh.innerFrom(n).subscribe(vh.createOperatorSubscriber(t,function(){var e=r;r=[],t.next(e)},_h.noop)),function(){r=null}})};var gh={},Oh=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.")},wh=(Object.defineProperty(gh,"__esModule",{value:!0}),gh.bufferCount=void 0,T),Eh=j,Ph=v;gh.bufferCount=function(h,b){return b=null!=(b=void 0===b?null:b)?b:h,wh.operate(function(e,f){var p=[],d=0;e.subscribe(Eh.createOperatorSubscriber(f,function(e){var t,r,n,o,i=null;d++%b==0&&p.push([]);try{for(var u=Oh(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=Oh(i),c=s.next();!c.done;c=s.next()){var l=c.value;Ph.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=Oh(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 Sh={},Th=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.")},jh=(Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.bufferTime=void 0,m),Ch=T,Rh=j,Ih=v,Ah=S,kh=i,Mh=pl;Sh.bufferTime=function(i){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var u=null!=(e=kh.popScheduler(t))?e:Ah.asyncScheduler,a=null!=(e=t[0])?e:null,l=t[1]||1/0;return Ch.operate(function(e,r){var s=[],n=!1,c=function(e){var t=e.buffer;e.subs.unsubscribe(),Ih.arrRemove(s,e),r.next(t),n&&o()},o=function(){var e,t;s&&(e=new jh.Subscription,r.add(e),s.push(t={buffer:[],subs:e}),Mh.executeSchedule(e,u,function(){return c(t)},i))},t=(null!==a&&0<=a?Mh.executeSchedule(r,u,o,a,!0):n=!0,o(),Rh.createOperatorSubscriber(r,function(e){var t,r,n=s.slice();try{for(var o=Th(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 Nh={},xh=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.")},Dh=(Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.bufferToggle=void 0,m),Lh=T,Uh=R,Fh=j,Bh=g,Wh=v;Nh.bufferToggle=function(t,o){return Lh.operate(function(e,n){var i=[];Uh.innerFrom(t).subscribe(Fh.createOperatorSubscriber(n,function(e){var t=[],r=(i.push(t),new Dh.Subscription);r.add(Uh.innerFrom(o(e)).subscribe(Fh.createOperatorSubscriber(n,function(){Wh.arrRemove(i,t),n.next(t),r.unsubscribe()},Bh.noop)))},Bh.noop)),e.subscribe(Fh.createOperatorSubscriber(n,function(e){var t,r;try{for(var n=xh(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 qh={},zh=(Object.defineProperty(qh,"__esModule",{value:!0}),qh.bufferWhen=void 0,T),Vh=g,Hh=j,Gh=R;qh.bufferWhen=function(i){return zh.operate(function(e,t){var r=null,n=null,o=function(){null!=n&&n.unsubscribe();var e=r;r=[],e&&t.next(e),Gh.innerFrom(i()).subscribe(n=Hh.createOperatorSubscriber(t,o,Vh.noop))};o(),e.subscribe(Hh.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 Yh={},Kh=(Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.catchError=void 0,R),Zh=j,Qh=T;Yh.catchError=function u(a){return Qh.operate(function(t,r){var n,o=null,i=!1,o=t.subscribe(Zh.createOperatorSubscriber(r,void 0,void 0,function(e){n=Kh.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 Xh={},Jh={},I={},$h={},eb={},tb={},rb=(Object.defineProperty(tb,"__esModule",{value:!0}),tb.scanInternals=void 0,j);tb.scanInternals=function(u,t,a,s,c){return function(e,r){var n=a,o=t,i=0;e.subscribe(rb.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(eb,"__esModule",{value:!0}),eb.reduce=void 0;var nb=tb,ob=T;eb.reduce=function(e,t){return ob.operate(nb.scanInternals(e,t,2<=arguments.length,!1,!0))},Object.defineProperty($h,"__esModule",{value:!0}),$h.toArray=void 0;function ib(e,t){return e.push(t),e}var ub=eb,ab=T;$h.toArray=function(){return ab.operate(function(e,t){ub.reduce(ib,[])(e).subscribe(t)})},Object.defineProperty(I,"__esModule",{value:!0}),I.joinAllInternals=void 0;var sb=p,cb=wf,lb=c,fb=ap,pb=$h;I.joinAllInternals=function(t,e){return lb.pipe(pb.toArray(),fb.mergeMap(function(e){return t(e)}),e?cb.mapOneOrManyArgs(e):sb.identity)},Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.combineLatestAll=void 0;var db=y,hb=I;Jh.combineLatestAll=function(e){return hb.joinAllInternals(db.combineLatest,e)},Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.combineAll=void 0;Xh.combineAll=Jh.combineLatestAll;var bb={},yb={},_b=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},vb=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},mb=(Object.defineProperty(yb,"__esModule",{value:!0}),yb.combineLatest=void 0,y),gb=T,Ob=Od,wb=wf,Eb=c,Pb=i;function Sb(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Pb.popResultSelector(r);return t?Eb.pipe(Sb.apply(void 0,vb([],_b(r))),wb.mapOneOrManyArgs(t)):gb.operate(function(e,t){mb.combineLatestInit(vb([e],_b(Ob.argsOrArgArray(r))))(t)})}yb.combineLatest=Sb;var Tb=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},jb=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},Cb=(Object.defineProperty(bb,"__esModule",{value:!0}),bb.combineLatestWith=void 0,yb);bb.combineLatestWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Cb.combineLatest.apply(void 0,jb([],Tb(e)))};var wf={},Rb=(Object.defineProperty(wf,"__esModule",{value:!0}),wf.concatMap=void 0,ap),Ib=E;wf.concatMap=function(e,t){return Ib.isFunction(t)?Rb.mergeMap(e,t,1):Rb.mergeMap(e,1)};var Ab={},kb=(Object.defineProperty(Ab,"__esModule",{value:!0}),Ab.concatMapTo=void 0,wf),Mb=E;Ab.concatMapTo=function(e,t){return Mb.isFunction(t)?kb.concatMap(function(){return e},t):kb.concatMap(function(){return e})};var Nb={},xb={},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},Lb=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},Ub=(Object.defineProperty(xb,"__esModule",{value:!0}),xb.concat=void 0,T),Fb=ip,Bb=i,Wb=Ec;xb.concat=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=Bb.popScheduler(r);return Ub.operate(function(e,t){Fb.concatAll()(Wb.from(Lb([e],Db(r)),n)).subscribe(t)})};var qb=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},zb=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},Vb=(Object.defineProperty(Nb,"__esModule",{value:!0}),Nb.concatWith=void 0,xb);Nb.concatWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Vb.concat.apply(void 0,zb([],qb(e)))};var Hb={},Gb={},Yb=(Object.defineProperty(Gb,"__esModule",{value:!0}),Gb.fromSubscribable=void 0,o);Gb.fromSubscribable=function(t){return new Yb.Observable(function(e){return t.subscribe(e)})},Object.defineProperty(Hb,"__esModule",{value:!0}),Hb.connect=void 0;var Kb=t,Zb=R,Qb=T,Xb=Gb,Jb={connector:function(){return new Kb.Subject}};Hb.connect=function(n,e){var o=(e=void 0===e?Jb:e).connector;return Qb.operate(function(e,t){var r=o();Zb.innerFrom(n(Xb.fromSubscribable(r))).subscribe(t),t.add(e.subscribe(r))})};var Gb={},$b=(Object.defineProperty(Gb,"__esModule",{value:!0}),Gb.count=void 0,eb);Gb.count=function(n){return $b.reduce(function(e,t,r){return!n||n(t,r)?e+1:e},0)};var ey={},ty=(Object.defineProperty(ey,"__esModule",{value:!0}),ey.debounce=void 0,T),ry=g,ny=j,oy=R;ey.debounce=function(u){return ty.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(ny.createOperatorSubscriber(t,function(e){null!=i&&i.unsubscribe(),n=!0,o=e,i=ny.createOperatorSubscriber(t,r,ry.noop),oy.innerFrom(u(e)).subscribe(i)},function(){r(),t.complete()},void 0,function(){o=i=null}))})};var iy={},uy=(Object.defineProperty(iy,"__esModule",{value:!0}),iy.debounceTime=void 0,S),ay=T,sy=j;iy.debounceTime=function(a,s){return void 0===s&&(s=uy.asyncScheduler),ay.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(sy.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 cy={},ly=(Object.defineProperty(cy,"__esModule",{value:!0}),cy.defaultIfEmpty=void 0,T),fy=j;cy.defaultIfEmpty=function(n){return ly.operate(function(e,t){var r=!1;e.subscribe(fy.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){r||t.next(n),t.complete()}))})};var A={},py={},dy={},hy=(Object.defineProperty(dy,"__esModule",{value:!0}),dy.take=void 0,O),by=T,yy=j;dy.take=function(n){return n<=0?function(){return hy.EMPTY}:by.operate(function(e,t){var r=0;e.subscribe(yy.createOperatorSubscriber(t,function(e){++r<=n&&(t.next(e),n<=r&&t.complete())}))})};var _y={},vy=(Object.defineProperty(_y,"__esModule",{value:!0}),_y.ignoreElements=void 0,T),my=j,gy=g;_y.ignoreElements=function(){return vy.operate(function(e,t){e.subscribe(my.createOperatorSubscriber(t,gy.noop))})};var Oy={},wy=(Object.defineProperty(Oy,"__esModule",{value:!0}),Oy.mapTo=void 0,Ef);Oy.mapTo=function(e){return wy.map(function(){return e})},Object.defineProperty(py,"__esModule",{value:!0}),py.delayWhen=void 0;var Ey=op,Py=dy,Sy=_y,Ty=Oy,jy=ap,Cy=R;py.delayWhen=function t(r,n){return n?function(e){return Ey.concat(n.pipe(Py.take(1),Sy.ignoreElements()),e.pipe(t(r)))}:jy.mergeMap(function(e,t){return Cy.innerFrom(r(e,t)).pipe(Py.take(1),Ty.mapTo(e))})},Object.defineProperty(A,"__esModule",{value:!0}),A.delay=void 0;var Ry=S,Iy=py,Ay=ud;A.delay=function(e,t){var r=Ay.timer(e,t=void 0===t?Ry.asyncScheduler:t);return Iy.delayWhen(function(){return r})};var ky={},My=(Object.defineProperty(ky,"__esModule",{value:!0}),ky.dematerialize=void 0,hs),Ny=T,xy=j;ky.dematerialize=function(){return Ny.operate(function(e,t){e.subscribe(xy.createOperatorSubscriber(t,function(e){return My.observeNotification(e,t)}))})};var Dy={},Ly=(Object.defineProperty(Dy,"__esModule",{value:!0}),Dy.distinct=void 0,T),Uy=j,Fy=g,By=R;Dy.distinct=function(o,t){return Ly.operate(function(e,r){var n=new Set;e.subscribe(Uy.createOperatorSubscriber(r,function(e){var t=o?o(e):e;n.has(t)||(n.add(t),r.next(e))})),t&&By.innerFrom(t).subscribe(Uy.createOperatorSubscriber(r,function(){return n.clear()},Fy.noop))})};var Wy={},qy=(Object.defineProperty(Wy,"__esModule",{value:!0}),Wy.distinctUntilChanged=void 0,p),zy=T,Vy=j;function Hy(e,t){return e===t}Wy.distinctUntilChanged=function(i,u){return void 0===u&&(u=qy.identity),i=null!=i?i:Hy,zy.operate(function(e,r){var n,o=!0;e.subscribe(Vy.createOperatorSubscriber(r,function(e){var t=u(e);!o&&i(n,t)||(o=!1,n=t,r.next(e))}))})};var Gy={},Yy=(Object.defineProperty(Gy,"__esModule",{value:!0}),Gy.distinctUntilKeyChanged=void 0,Wy);Gy.distinctUntilKeyChanged=function(r,n){return Yy.distinctUntilChanged(function(e,t){return n?n(e[r],t[r]):e[r]===t[r]})};var Ky={},Zy={},Qy=(Object.defineProperty(Zy,"__esModule",{value:!0}),Zy.throwIfEmpty=void 0,jc),Xy=T,Jy=j;function $y(){return new Qy.EmptyError}Zy.throwIfEmpty=function(n){return void 0===n&&(n=$y),Xy.operate(function(e,t){var r=!1;e.subscribe(Jy.createOperatorSubscriber(t,function(e){r=!0,t.next(e)},function(){return r?t.complete():t.error(n())}))})},Object.defineProperty(Ky,"__esModule",{value:!0}),Ky.elementAt=void 0;var e_=Nc,t_=kd,r_=Zy,n_=cy,o_=dy;Ky.elementAt=function(r,t){if(r<0)throw new e_.ArgumentOutOfRangeError;var n=2<=arguments.length;return function(e){return e.pipe(t_.filter(function(e,t){return t===r}),o_.take(1),n?n_.defaultIfEmpty(t):r_.throwIfEmpty(function(){return new e_.ArgumentOutOfRangeError}))}};var i_={},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},a_=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},s_=(Object.defineProperty(i_,"__esModule",{value:!0}),i_.endWith=void 0,op),c_=h;i_.endWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return s_.concat(e,c_.of.apply(void 0,a_([],u_(t))))}};var l_={},f_=(Object.defineProperty(l_,"__esModule",{value:!0}),l_.every=void 0,T),p_=j;l_.every=function(o,i){return f_.operate(function(t,r){var n=0;t.subscribe(p_.createOperatorSubscriber(r,function(e){o.call(i,e,n++,t)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})};var d_={},h_={},b_={},y_=(Object.defineProperty(b_,"__esModule",{value:!0}),b_.exhaustMap=void 0,Ef),__=R,v_=T,m_=j;b_.exhaustMap=function t(i,o){return o?function(e){return e.pipe(t(function(r,n){return __.innerFrom(i(r,n)).pipe(y_.map(function(e,t){return o(r,e,n,t)}))}))}:v_.operate(function(e,t){var r=0,n=null,o=!1;e.subscribe(m_.createOperatorSubscriber(t,function(e){n||(n=m_.createOperatorSubscriber(t,void 0,function(){n=null,o&&t.complete()}),__.innerFrom(i(e,r++)).subscribe(n))},function(){o=!0,n||t.complete()}))})},Object.defineProperty(h_,"__esModule",{value:!0}),h_.exhaustAll=void 0;var g_=b_,O_=p;h_.exhaustAll=function(){return g_.exhaustMap(O_.identity)},Object.defineProperty(d_,"__esModule",{value:!0}),d_.exhaust=void 0;d_.exhaust=h_.exhaustAll;var w_={},E_=(Object.defineProperty(w_,"__esModule",{value:!0}),w_.expand=void 0,T),P_=sp;w_.expand=function(r,n,o){return n=((n=void 0===n?1/0:n)||0)<1?1/0:n,E_.operate(function(e,t){return P_.mergeInternals(e,t,r,n,void 0,!0,o)})};var S_={},T_=(Object.defineProperty(S_,"__esModule",{value:!0}),S_.finalize=void 0,T);S_.finalize=function(r){return T_.operate(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})};var j_={},C_=(Object.defineProperty(j_,"__esModule",{value:!0}),j_.createFind=j_.find=void 0,T),R_=j;function I_(i,u,e){var a="index"===e;return function(r,n){var o=0;r.subscribe(R_.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()}))}}j_.find=function(e,t){return C_.operate(I_(e,t,"value"))},j_.createFind=I_;var A_={},k_=(Object.defineProperty(A_,"__esModule",{value:!0}),A_.findIndex=void 0,T),M_=j_;A_.findIndex=function(e,t){return k_.operate(M_.createFind(e,t,"index"))};var N_={},x_=(Object.defineProperty(N_,"__esModule",{value:!0}),N_.first=void 0,jc),D_=kd,L_=dy,U_=cy,F_=Zy,B_=p;N_.first=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?D_.filter(function(e,t){return n(e,t,r)}):B_.identity,L_.take(1),t?U_.defaultIfEmpty(e):F_.throwIfEmpty(function(){return new x_.EmptyError}))}};var W_={},q_=(Object.defineProperty(W_,"__esModule",{value:!0}),W_.groupBy=void 0,o),z_=R,V_=t,H_=T,G_=j;W_.groupBy=function(b,t,y,_){return H_.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 G_.OperatorSubscriber(s,function(e){try{var t,r,n=b(e),o=f.get(n);o||(f.set(n,o=_?_():new V_.Subject),i=n,u=o,(a=new q_.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=G_.createOperatorSubscriber(o,function(){o.complete(),null!=r&&r.unsubscribe()},void 0,void 0,function(){return f.delete(n)}),h.add(z_.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 Y_={},K_=(Object.defineProperty(Y_,"__esModule",{value:!0}),Y_.isEmpty=void 0,T),Z_=j;Y_.isEmpty=function(){return K_.operate(function(e,t){e.subscribe(Z_.createOperatorSubscriber(t,function(){t.next(!1),t.complete()},function(){t.next(!0),t.complete()}))})};var Q_={},X_={},J_=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.")},$_=(Object.defineProperty(X_,"__esModule",{value:!0}),X_.takeLast=void 0,O),ev=T,tv=j;X_.takeLast=function(t){return t<=0?function(){return $_.EMPTY}:ev.operate(function(e,i){var u=[];e.subscribe(tv.createOperatorSubscriber(i,function(e){u.push(e),t<u.length&&u.shift()},function(){var t,e;try{for(var r=J_(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(Q_,"__esModule",{value:!0}),Q_.last=void 0;var rv=jc,nv=kd,ov=X_,iv=Zy,uv=cy,av=p;Q_.last=function(n,e){var t=2<=arguments.length;return function(r){return r.pipe(n?nv.filter(function(e,t){return n(e,t,r)}):av.identity,ov.takeLast(1),t?uv.defaultIfEmpty(e):iv.throwIfEmpty(function(){return new rv.EmptyError}))}};var sv={},cv=(Object.defineProperty(sv,"__esModule",{value:!0}),sv.materialize=void 0,hs),lv=T,fv=j;sv.materialize=function(){return lv.operate(function(e,t){e.subscribe(fv.createOperatorSubscriber(t,function(e){t.next(cv.Notification.createNext(e))},function(){t.next(cv.Notification.createComplete()),t.complete()},function(e){t.next(cv.Notification.createError(e)),t.complete()}))})};var pv={},dv=(Object.defineProperty(pv,"__esModule",{value:!0}),pv.max=void 0,eb),hv=E;pv.max=function(r){return dv.reduce(hv.isFunction(r)?function(e,t){return 0<r(e,t)?e:t}:function(e,t){return t<e?e:t})};var bv={},yv=(Object.defineProperty(bv,"__esModule",{value:!0}),bv.flatMap=void 0,ap),yv=(bv.flatMap=yv.mergeMap,{}),_v=(Object.defineProperty(yv,"__esModule",{value:!0}),yv.mergeMapTo=void 0,ap),vv=E;yv.mergeMapTo=function(e,t,r){return void 0===r&&(r=1/0),vv.isFunction(t)?_v.mergeMap(function(){return e},t,r):_v.mergeMap(function(){return e},r="number"==typeof t?t:r)};var mv={},gv=(Object.defineProperty(mv,"__esModule",{value:!0}),mv.mergeScan=void 0,T),Ov=sp;mv.mergeScan=function(n,o,i){return void 0===i&&(i=1/0),gv.operate(function(e,t){var r=o;return Ov.mergeInternals(e,t,function(e,t){return n(r,e,t)},i,function(e){r=e},!1,void 0,function(){return r=null})})};var sp={},wv={},Ev=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},Pv=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},Sv=(Object.defineProperty(wv,"__esModule",{value:!0}),wv.merge=void 0,T),Tv=Od,jv=up,Cv=i,Rv=Ec;wv.merge=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=Cv.popScheduler(r),o=Cv.popNumber(r,1/0),r=Tv.argsOrArgArray(r);return Sv.operate(function(e,t){jv.mergeAll(o)(Rv.from(Pv([e],Ev(r)),n)).subscribe(t)})};var Iv=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},Av=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},kv=(Object.defineProperty(sp,"__esModule",{value:!0}),sp.mergeWith=void 0,wv);sp.mergeWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return kv.merge.apply(void 0,Av([],Iv(e)))};var Mv={},Nv=(Object.defineProperty(Mv,"__esModule",{value:!0}),Mv.min=void 0,eb),xv=E;Mv.min=function(r){return Nv.reduce(xv.isFunction(r)?function(e,t){return r(e,t)<0?e:t}:function(e,t){return e<t?e:t})};var Dv={},Lv=(Object.defineProperty(Dv,"__esModule",{value:!0}),Dv.multicast=void 0,pn),Uv=E,Fv=Hb;Dv.multicast=function(e,t){var r=Uv.isFunction(e)?e:function(){return e};return Uv.isFunction(t)?Fv.connect(t,{connector:r}):function(e){return new Lv.ConnectableObservable(e,r)}};var Bv={},Wv=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},qv=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},zv=(Object.defineProperty(Bv,"__esModule",{value:!0}),Bv.onErrorResumeNext=Bv.onErrorResumeNextWith=void 0,Od),Vv=gd;function Hv(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=zv.argsOrArgArray(e);return function(e){return Vv.onErrorResumeNext.apply(void 0,qv([e],Wv(r)))}}Bv.onErrorResumeNextWith=Hv,Bv.onErrorResumeNext=Hv;var Gv={},Yv=(Object.defineProperty(Gv,"__esModule",{value:!0}),Gv.pairwise=void 0,T),Kv=j;Gv.pairwise=function(){return Yv.operate(function(e,r){var n,o=!1;e.subscribe(Kv.createOperatorSubscriber(r,function(e){var t=n;n=e,o&&r.next([t,e]),o=!0}))})};var Zv={},Qv=(Object.defineProperty(Zv,"__esModule",{value:!0}),Zv.pluck=void 0,Ef);Zv.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 Qv.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 Xv={},Jv=(Object.defineProperty(Xv,"__esModule",{value:!0}),Xv.publish=void 0,t),$v=Dv,em=Hb;Xv.publish=function(t){return t?function(e){return em.connect(t)(e)}:function(e){return $v.multicast(new Jv.Subject)(e)}};var tm={},rm=(Object.defineProperty(tm,"__esModule",{value:!0}),tm.publishBehavior=void 0,P),nm=pn;tm.publishBehavior=function(r){return function(e){var t=new rm.BehaviorSubject(r);return new nm.ConnectableObservable(e,function(){return t})}};var om={},im=(Object.defineProperty(om,"__esModule",{value:!0}),om.publishLast=void 0,_),um=pn;om.publishLast=function(){return function(e){var t=new im.AsyncSubject;return new um.ConnectableObservable(e,function(){return t})}};var am={},sm=(Object.defineProperty(am,"__esModule",{value:!0}),am.publishReplay=void 0,s),cm=Dv,lm=E;am.publishReplay=function(t,r,e,n){e&&!lm.isFunction(e)&&(n=e);var o=lm.isFunction(e)?e:void 0;return function(e){return cm.multicast(new sm.ReplaySubject(t,r,n),o)(e)}};var fm={},pm=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},dm=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},hm=(Object.defineProperty(fm,"__esModule",{value:!0}),fm.raceWith=void 0,Ud),bm=T,ym=p;fm.raceWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length?bm.operate(function(e,t){hm.raceInit(dm([e],pm(r)))(t)}):ym.identity};var _m={},vm=(Object.defineProperty(_m,"__esModule",{value:!0}),_m.repeat=void 0,O),mm=T,gm=j,Om=R,wm=ud;_m.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 vm.EMPTY}:mm.operate(function(t,r){function n(){var e=!1;o=t.subscribe(gm.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?wm.timer(a):Om.innerFrom(a(i)),t=gm.createOperatorSubscriber(r,function(){t.unsubscribe(),n()}),e.subscribe(t)):n()};n()})};var Em={},Pm=(Object.defineProperty(Em,"__esModule",{value:!0}),Em.repeatWhen=void 0,R),Sm=t,Tm=T,jm=j;Em.repeatWhen=function(l){return Tm.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 Sm.Subject,Pm.innerFrom(l(n)).subscribe(jm.createOperatorSubscriber(t,function(){r?c():o=!0},function(){i=!0,a()}))),n},c=function(){u=!1,r=e.subscribe(jm.createOperatorSubscriber(t,void 0,function(){u=!0,a()||s().next()})),o&&(r.unsubscribe(),r=null,o=!1,c())};c()})};var Cm={},Rm=(Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.retry=void 0,T),Im=j,Am=p,km=ud,Mm=R;Cm.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?Am.identity:Rm.operate(function(e,i){var u,a=0,s=function(){var o=!1;u=e.subscribe(Im.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?km.timer(l):Mm.innerFrom(l(e,a)),n=Im.createOperatorSubscriber(i,function(){n.unsubscribe(),t()},function(){i.complete()}),r.subscribe(n)):t()):i.error(e)})),o&&(u.unsubscribe(),u=null,s())};s()})};var Nm={},xm=(Object.defineProperty(Nm,"__esModule",{value:!0}),Nm.retryWhen=void 0,R),Dm=t,Lm=T,Um=j;Nm.retryWhen=function(u){return Lm.operate(function(e,t){var r,n,o=!1,i=function(){r=e.subscribe(Um.createOperatorSubscriber(t,void 0,void 0,function(e){n||(n=new Dm.Subject,xm.innerFrom(u(n)).subscribe(Um.createOperatorSubscriber(t,function(){return r?i():o=!0}))),n&&n.next(e)})),o&&(r.unsubscribe(),r=null,o=!1,i())};i()})};var Fm={},Bm=(Object.defineProperty(Fm,"__esModule",{value:!0}),Fm.sample=void 0,R),Wm=T,qm=g,zm=j;Fm.sample=function(o){return Wm.operate(function(e,t){var r=!1,n=null;e.subscribe(zm.createOperatorSubscriber(t,function(e){r=!0,n=e})),Bm.innerFrom(o).subscribe(zm.createOperatorSubscriber(t,function(){var e;r&&(r=!1,e=n,n=null,t.next(e))},qm.noop))})};var Vm={},Hm=(Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.sampleTime=void 0,S),Gm=Fm,Ym=id;Vm.sampleTime=function(e,t){return Gm.sample(Ym.interval(e,t=void 0===t?Hm.asyncScheduler:t))};var Km={},Zm=(Object.defineProperty(Km,"__esModule",{value:!0}),Km.scan=void 0,T),Qm=tb;Km.scan=function(e,t){return Zm.operate(Qm.scanInternals(e,t,2<=arguments.length,!0))};var tb={},Xm=(Object.defineProperty(tb,"__esModule",{value:!0}),tb.sequenceEqual=void 0,T),Jm=j,$m=R;function e0(){return{buffer:[],complete:!1}}tb.sequenceEqual=function(u,a){return void 0===a&&(a=function(e,t){return e===t}),Xm.operate(function(e,t){function r(n,o){var r=Jm.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=e0(),o=e0(),i=function(e){t.next(e),t.complete()};e.subscribe(r(n,o)),$m.innerFrom(u).subscribe(r(o,n))})};var t0={},r0=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},n0=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},o0=(Object.defineProperty(t0,"__esModule",{value:!0}),t0.share=void 0,R),i0=t,u0=Zr,a0=T;function s0(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 u0.SafeSubscriber({next:function(){r.unsubscribe(),e()}}),o0.innerFrom(t.apply(void 0,n0([],r0(n)))).subscribe(r)}t0.share=function(e){var t=(e=void 0===e?{}:e).connector,p=void 0===t?function(){return new i0.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 a0.operate(function(e,t){a++,c||s||l();var r=u=null!=u?u:p();t.add(function(){0!==--a||c||s||(i=s0(n,b))}),r.subscribe(t),!o&&0<a&&(o=new u0.SafeSubscriber({next:function(e){return r.next(e)},error:function(e){c=!0,l(),i=s0(f,d,e),r.error(e)},complete:function(){s=!0,l(),i=s0(f,h),r.complete()}}),o0.innerFrom(e).subscribe(o))})(e)}};var c0={},l0=(Object.defineProperty(c0,"__esModule",{value:!0}),c0.shareReplay=void 0,s),f0=t0;c0.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,f0.share({connector:function(){return new l0.ReplaySubject(o,t,r)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})};var p0={},d0=(Object.defineProperty(p0,"__esModule",{value:!0}),p0.single=void 0,jc),h0=Ol,b0=Nl,y0=T,_0=j;p0.single=function(a){return y0.operate(function(t,r){var n,o=!1,i=!1,u=0;t.subscribe(_0.createOperatorSubscriber(r,function(e){i=!0,a&&!a(e,u++,t)||(o&&r.error(new h0.SequenceError("Too many matching values")),o=!0,n=e)},function(){o?(r.next(n),r.complete()):r.error(i?new b0.NotFoundError("No matching values"):new d0.EmptyError)}))})};var v0={},m0=(Object.defineProperty(v0,"__esModule",{value:!0}),v0.skip=void 0,kd);v0.skip=function(r){return m0.filter(function(e,t){return r<=t})};var g0={},O0=(Object.defineProperty(g0,"__esModule",{value:!0}),g0.skipLast=void 0,p),w0=T,E0=j;g0.skipLast=function(u){return u<=0?O0.identity:w0.operate(function(e,n){var o=new Array(u),i=0;return e.subscribe(E0.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 P0={},S0=(Object.defineProperty(P0,"__esModule",{value:!0}),P0.skipUntil=void 0,T),T0=j,j0=R,C0=g;P0.skipUntil=function(o){return S0.operate(function(e,t){var r=!1,n=T0.createOperatorSubscriber(t,function(){null!=n&&n.unsubscribe(),r=!0},C0.noop);j0.innerFrom(o).subscribe(n),e.subscribe(T0.createOperatorSubscriber(t,function(e){return r&&t.next(e)}))})};var R0={},I0=(Object.defineProperty(R0,"__esModule",{value:!0}),R0.skipWhile=void 0,T),A0=j;R0.skipWhile=function(o){return I0.operate(function(e,t){var r=!1,n=0;e.subscribe(A0.createOperatorSubscriber(t,function(e){return(r=r||!o(e,n++))&&t.next(e)}))})};var k0={},M0=(Object.defineProperty(k0,"__esModule",{value:!0}),k0.startWith=void 0,op),N0=i,x0=T;k0.startWith=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var n=N0.popScheduler(r);return x0.operate(function(e,t){(n?M0.concat(r,e,n):M0.concat(r,e)).subscribe(t)})};var D0={},L0={},U0=(Object.defineProperty(L0,"__esModule",{value:!0}),L0.switchMap=void 0,R),F0=T,B0=j;L0.switchMap=function(s,c){return F0.operate(function(e,o){function i(){t&&!u&&o.complete()}var u=null,a=0,t=!1;e.subscribe(B0.createOperatorSubscriber(o,function(t){null!=u&&u.unsubscribe();var r=0,n=a++;U0.innerFrom(s(t,n)).subscribe(u=B0.createOperatorSubscriber(o,function(e){return o.next(c?c(t,e,n,r++):e)},function(){u=null,i()}))},function(){t=!0,i()}))})},Object.defineProperty(D0,"__esModule",{value:!0}),D0.switchAll=void 0;var W0=L0,q0=p;D0.switchAll=function(){return W0.switchMap(q0.identity)};var z0={},V0=(Object.defineProperty(z0,"__esModule",{value:!0}),z0.switchMapTo=void 0,L0),H0=E;z0.switchMapTo=function(e,t){return H0.isFunction(t)?V0.switchMap(function(){return e},t):V0.switchMap(function(){return e})};var G0={},Y0=(Object.defineProperty(G0,"__esModule",{value:!0}),G0.switchScan=void 0,L0),K0=T;G0.switchScan=function(n,o){return K0.operate(function(e,t){var r=o;return Y0.switchMap(function(e,t){return n(r,e,t)},function(e,t){return r=t})(e).subscribe(t),function(){r=null}})};var Z0={},Q0=(Object.defineProperty(Z0,"__esModule",{value:!0}),Z0.takeUntil=void 0,T),X0=j,J0=R,$0=g;Z0.takeUntil=function(r){return Q0.operate(function(e,t){J0.innerFrom(r).subscribe(X0.createOperatorSubscriber(t,function(){return t.complete()},$0.noop)),t.closed||e.subscribe(t)})};var eg={},tg=(Object.defineProperty(eg,"__esModule",{value:!0}),eg.takeWhile=void 0,T),rg=j;eg.takeWhile=function(o,i){return void 0===i&&(i=!1),tg.operate(function(e,r){var n=0;e.subscribe(rg.createOperatorSubscriber(r,function(e){var t=o(e,n++);(t||i)&&r.next(e),t||r.complete()}))})};var ng={},og=(Object.defineProperty(ng,"__esModule",{value:!0}),ng.tap=void 0,E),ig=T,ug=j,ag=p;ng.tap=function(e,t,r){var o=og.isFunction(e)||t||r?{next:e,error:t,complete:r}:e;return o?ig.operate(function(e,r){null!=(t=o.subscribe)&&t.call(o);var t,n=!0;e.subscribe(ug.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)}))}):ag.identity};var E={},sg=(Object.defineProperty(E,"__esModule",{value:!0}),E.throttle=void 0,T),cg=j,lg=R;E.throttle=function(h,b){return sg.operate(function(e,t){function r(){var e;a&&(a=!1,e=s,s=null,t.next(e),l||d(e))}var n=null!=b?b:{},o=n.leading,i=void 0===o||o,o=n.trailing,u=void 0!==o&&o,a=!1,s=null,c=null,l=!1,f=function(){null!=c&&c.unsubscribe(),c=null,u&&(r(),l&&t.complete())},p=function(){c=null,l&&t.complete()},d=function(e){return c=lg.innerFrom(h(e)).subscribe(cg.createOperatorSubscriber(t,f,p))};e.subscribe(cg.createOperatorSubscriber(t,function(e){a=!0,s=e,c&&!c.closed||(i?r():d(e))},function(){l=!0,u&&a&&c&&!c.closed||t.complete()}))})};var fg={},pg=(Object.defineProperty(fg,"__esModule",{value:!0}),fg.throttleTime=void 0,S),dg=E,hg=ud;fg.throttleTime=function(e,t,r){var n=hg.timer(e,t=void 0===t?pg.asyncScheduler:t);return dg.throttle(function(){return n},r)};var bg={},yg=(Object.defineProperty(bg,"__esModule",{value:!0}),bg.TimeInterval=bg.timeInterval=void 0,S),_g=T,vg=j;bg.timeInterval=function(i){return void 0===i&&(i=yg.asyncScheduler),_g.operate(function(e,n){var o=i.now();e.subscribe(vg.createOperatorSubscriber(n,function(e){var t=i.now(),r=t-o;o=t,n.next(new mg(e,r))}))})};var mg=function(e,t){this.value=e,this.interval=t},gg=(bg.TimeInterval=mg,{}),Og=(Object.defineProperty(gg,"__esModule",{value:!0}),gg.timeoutWith=void 0,S),wg=Sl,Eg=Bc;gg.timeoutWith=function(e,t,r){var n,o;if(r=null!=r?r:Og.async,wg.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 Eg.timeout({first:n,each:o,scheduler:r,with:e})};var Sl={},Pg=(Object.defineProperty(Sl,"__esModule",{value:!0}),Sl.timestamp=void 0,u),Sg=Ef;Sl.timestamp=function(t){return void 0===t&&(t=Pg.dateTimestampProvider),Sg.map(function(e){return{value:e,timestamp:t.now()}})};var u={},Tg=(Object.defineProperty(u,"__esModule",{value:!0}),u.window=void 0,t),jg=T,Cg=j,Rg=g,Ig=R;u.window=function(o){return jg.operate(function(e,t){function r(e){n.error(e),t.error(e)}var n=new Tg.Subject;t.next(n.asObservable());return e.subscribe(Cg.createOperatorSubscriber(t,function(e){return null==n?void 0:n.next(e)},function(){n.complete(),t.complete()},r)),Ig.innerFrom(o).subscribe(Cg.createOperatorSubscriber(t,function(){n.complete(),t.next(n=new Tg.Subject)},Rg.noop,r)),function(){null!=n&&n.unsubscribe(),n=null}})};var Ag={},kg=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.")},Mg=(Object.defineProperty(Ag,"__esModule",{value:!0}),Ag.windowCount=void 0,t),Ng=T,xg=j;Ag.windowCount=function(s,e){var c=0<(e=void 0===e?0:e)?e:s;return Ng.operate(function(e,i){var u=[new Mg.Subject],a=0;i.next(u[0].asObservable()),e.subscribe(xg.createOperatorSubscriber(i,function(e){try{for(var t=kg(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 Mg.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 Dg={},Lg=(Object.defineProperty(Dg,"__esModule",{value:!0}),Dg.windowTime=void 0,t),Ug=S,Fg=m,Bg=T,Wg=j,qg=v,zg=i,Vg=pl;Dg.windowTime=function(c){for(var e,t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var l=null!=(e=zg.popScheduler(t))?e:Ug.asyncScheduler,f=null!=(e=t[0])?e:null,p=t[1]||1/0;return Bg.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(),qg.arrRemove(o,e),i&&a()},a=function(){var e,t,r;o&&(e=new Fg.Subscription,n.add(e),t=new Lg.Subject,o.push(r={window:t,subs:e,seen:0}),n.next(t.asObservable()),Vg.executeSchedule(e,l,function(){return u(r)},c))},s=(null!==f&&0<=f?Vg.executeSchedule(n,l,a,f,!0):i=!0,a(),function(e){return o.slice().forEach(e)});return e.subscribe(Wg.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 pl={},Hg=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.")},Gg=(Object.defineProperty(pl,"__esModule",{value:!0}),pl.windowToggle=void 0,t),Yg=m,Kg=T,Zg=R,Qg=j,Xg=g,Jg=v;pl.windowToggle=function(t,a){return Kg.operate(function(e,o){function i(e){for(;0<u.length;)u.shift().error(e);o.error(e)}var u=[];Zg.innerFrom(t).subscribe(Qg.createOperatorSubscriber(o,function(e){var t,r=new Gg.Subject,n=(u.push(r),new Yg.Subscription);try{t=Zg.innerFrom(a(e))}catch(e){return void i(e)}o.next(r.asObservable()),n.add(t.subscribe(Qg.createOperatorSubscriber(o,function(){Jg.arrRemove(u,r),r.complete(),n.unsubscribe()},Xg.noop,i)))},Xg.noop)),e.subscribe(Qg.createOperatorSubscriber(o,function(e){var t,r,n=u.slice();try{for(var o=Hg(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 v={},$g=(Object.defineProperty(v,"__esModule",{value:!0}),v.windowWhen=void 0,t),eO=T,tO=j,rO=R;v.windowWhen=function(u){return eO.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 $g.Subject,t.next(r.asObservable());try{e=rO.innerFrom(u())}catch(e){return void o(e)}e.subscribe(n=tO.createOperatorSubscriber(t,i,i,o))};i(),e.subscribe(tO.createOperatorSubscriber(t,function(e){return r.next(e)},function(){r.complete(),t.complete()},o,function(){null!=n&&n.unsubscribe(),r=null}))})};var nO={},oO=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},iO=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},uO=(Object.defineProperty(nO,"__esModule",{value:!0}),nO.withLatestFrom=void 0,T),aO=j,sO=R,cO=p,lO=g,fO=i;nO.withLatestFrom=function(){for(var a=[],e=0;e<arguments.length;e++)a[e]=arguments[e];var s=fO.popResultSelector(a);return uO.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){sO.innerFrom(a[t]).subscribe(aO.createOperatorSubscriber(r,function(e){n[t]=e,i||o[t]||(o[t]=!0,(i=o.every(cO.identity))&&(o=null))},lO.noop))}(u);e.subscribe(aO.createOperatorSubscriber(r,function(e){i&&(e=iO([e],oO(n)),r.next(s?s.apply(void 0,iO([],oO(e))):e))}))})};var j={},pO=(Object.defineProperty(j,"__esModule",{value:!0}),j.zipAll=void 0,Xd),dO=I;j.zipAll=function(e){return dO.joinAllInternals(pO.zip,e)};var R={},i={},hO=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},bO=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},yO=(Object.defineProperty(i,"__esModule",{value:!0}),i.zip=void 0,Xd),_O=T;i.zip=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return _O.operate(function(e,t){yO.zip.apply(void 0,bO([e],hO(r))).subscribe(t)})};var vO,mO,gO,OO,wO,EO,PO,SO,TO,jO,CO,RO,IO,AO,kO,MO,NO,xO,DO,LO,UO,FO,BO,WO,qO,zO,VO,HO,GO,YO,KO,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,Rw,Iw,Aw,kw,Mw,Nw,xw,Dw,Lw,Uw,Fw,Bw,Ww,qw,zw,Vw,Hw,Gw,Yw,Kw,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,RE,IE,AE,kE,ME,NE,xE,DE,LE,UE,FE,BE,WE,qE,zE,VE,HE,GE,YE,KE,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=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},SP=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},TP=(Object.defineProperty(R,"__esModule",{value:!0}),R.zipWith=void 0,i);R.zipWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return TP.zip.apply(void 0,SP([],PP(e)))},I=Y,vO=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]}),T=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||vO(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,mO=o,Object.defineProperty(I,"Observable",{enumerable:!0,get:function(){return mO.Observable}}),gO=pn,Object.defineProperty(I,"ConnectableObservable",{enumerable:!0,get:function(){return gO.ConnectableObservable}}),OO=it,Object.defineProperty(I,"observable",{enumerable:!0,get:function(){return OO.observable}}),wO=n,Object.defineProperty(I,"animationFrames",{enumerable:!0,get:function(){return wO.animationFrames}}),EO=t,Object.defineProperty(I,"Subject",{enumerable:!0,get:function(){return EO.Subject}}),PO=P,Object.defineProperty(I,"BehaviorSubject",{enumerable:!0,get:function(){return PO.BehaviorSubject}}),SO=s,Object.defineProperty(I,"ReplaySubject",{enumerable:!0,get:function(){return SO.ReplaySubject}}),TO=_,Object.defineProperty(I,"AsyncSubject",{enumerable:!0,get:function(){return TO.AsyncSubject}}),jO=b,Object.defineProperty(I,"asap",{enumerable:!0,get:function(){return jO.asap}}),Object.defineProperty(I,"asapScheduler",{enumerable:!0,get:function(){return jO.asapScheduler}}),CO=S,Object.defineProperty(I,"async",{enumerable:!0,get:function(){return CO.async}}),Object.defineProperty(I,"asyncScheduler",{enumerable:!0,get:function(){return CO.asyncScheduler}}),RO=Fs,Object.defineProperty(I,"queue",{enumerable:!0,get:function(){return RO.queue}}),Object.defineProperty(I,"queueScheduler",{enumerable:!0,get:function(){return RO.queueScheduler}}),IO=Zs,Object.defineProperty(I,"animationFrame",{enumerable:!0,get:function(){return IO.animationFrame}}),Object.defineProperty(I,"animationFrameScheduler",{enumerable:!0,get:function(){return IO.animationFrameScheduler}}),AO=$s,Object.defineProperty(I,"VirtualTimeScheduler",{enumerable:!0,get:function(){return AO.VirtualTimeScheduler}}),Object.defineProperty(I,"VirtualAction",{enumerable:!0,get:function(){return AO.VirtualAction}}),kO=Os,Object.defineProperty(I,"Scheduler",{enumerable:!0,get:function(){return kO.Scheduler}}),MO=m,Object.defineProperty(I,"Subscription",{enumerable:!0,get:function(){return MO.Subscription}}),NO=Zr,Object.defineProperty(I,"Subscriber",{enumerable:!0,get:function(){return NO.Subscriber}}),xO=hs,Object.defineProperty(I,"Notification",{enumerable:!0,get:function(){return xO.Notification}}),Object.defineProperty(I,"NotificationKind",{enumerable:!0,get:function(){return xO.NotificationKind}}),DO=c,Object.defineProperty(I,"pipe",{enumerable:!0,get:function(){return DO.pipe}}),LO=g,Object.defineProperty(I,"noop",{enumerable:!0,get:function(){return LO.noop}}),UO=p,Object.defineProperty(I,"identity",{enumerable:!0,get:function(){return UO.identity}}),FO=Dc,Object.defineProperty(I,"isObservable",{enumerable:!0,get:function(){return FO.isObservable}}),BO=Rc,Object.defineProperty(I,"lastValueFrom",{enumerable:!0,get:function(){return BO.lastValueFrom}}),WO=kc,Object.defineProperty(I,"firstValueFrom",{enumerable:!0,get:function(){return WO.firstValueFrom}}),qO=Nc,Object.defineProperty(I,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return qO.ArgumentOutOfRangeError}}),zO=jc,Object.defineProperty(I,"EmptyError",{enumerable:!0,get:function(){return zO.EmptyError}}),VO=Nl,Object.defineProperty(I,"NotFoundError",{enumerable:!0,get:function(){return VO.NotFoundError}}),HO=f,Object.defineProperty(I,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return HO.ObjectUnsubscribedError}}),GO=Ol,Object.defineProperty(I,"SequenceError",{enumerable:!0,get:function(){return GO.SequenceError}}),YO=Bc,Object.defineProperty(I,"TimeoutError",{enumerable:!0,get:function(){return YO.TimeoutError}}),KO=xr,Object.defineProperty(I,"UnsubscriptionError",{enumerable:!0,get:function(){return KO.UnsubscriptionError}}),ZO=xc,Object.defineProperty(I,"bindCallback",{enumerable:!0,get:function(){return ZO.bindCallback}}),QO=Ff,Object.defineProperty(I,"bindNodeCallback",{enumerable:!0,get:function(){return QO.bindNodeCallback}}),XO=y,Object.defineProperty(I,"combineLatest",{enumerable:!0,get:function(){return XO.combineLatest}}),JO=op,Object.defineProperty(I,"concat",{enumerable:!0,get:function(){return JO.concat}}),$O=Ep,Object.defineProperty(I,"connectable",{enumerable:!0,get:function(){return $O.connectable}}),ew=Pp,Object.defineProperty(I,"defer",{enumerable:!0,get:function(){return ew.defer}}),tw=O,Object.defineProperty(I,"empty",{enumerable:!0,get:function(){return tw.empty}}),rw=Ap,Object.defineProperty(I,"forkJoin",{enumerable:!0,get:function(){return rw.forkJoin}}),nw=Ec,Object.defineProperty(I,"from",{enumerable:!0,get:function(){return nw.from}}),ow=Wf,Object.defineProperty(I,"fromEvent",{enumerable:!0,get:function(){return ow.fromEvent}}),iw=Gf,Object.defineProperty(I,"fromEventPattern",{enumerable:!0,get:function(){return iw.fromEventPattern}}),uw=Tc,Object.defineProperty(I,"generate",{enumerable:!0,get:function(){return uw.generate}}),aw=jl,Object.defineProperty(I,"iif",{enumerable:!0,get:function(){return aw.iif}}),sw=id,Object.defineProperty(I,"interval",{enumerable:!0,get:function(){return sw.interval}}),cw=vc,Object.defineProperty(I,"merge",{enumerable:!0,get:function(){return cw.merge}}),lw=md,Object.defineProperty(I,"never",{enumerable:!0,get:function(){return lw.never}}),fw=h,Object.defineProperty(I,"of",{enumerable:!0,get:function(){return fw.of}}),pw=gd,Object.defineProperty(I,"onErrorResumeNext",{enumerable:!0,get:function(){return pw.onErrorResumeNext}}),dw=Cd,Object.defineProperty(I,"pairs",{enumerable:!0,get:function(){return dw.pairs}}),hw=Id,Object.defineProperty(I,"partition",{enumerable:!0,get:function(){return hw.partition}}),bw=Ud,Object.defineProperty(I,"race",{enumerable:!0,get:function(){return bw.race}}),yw=Vd,Object.defineProperty(I,"range",{enumerable:!0,get:function(){return yw.range}}),_w=Sc,Object.defineProperty(I,"throwError",{enumerable:!0,get:function(){return _w.throwError}}),vw=ud,Object.defineProperty(I,"timer",{enumerable:!0,get:function(){return vw.timer}}),mw=Yd,Object.defineProperty(I,"using",{enumerable:!0,get:function(){return mw.using}}),gw=Xd,Object.defineProperty(I,"zip",{enumerable:!0,get:function(){return gw.zip}}),Ow=Pc,Object.defineProperty(I,"scheduled",{enumerable:!0,get:function(){return Ow.scheduled}}),ww=O,Object.defineProperty(I,"EMPTY",{enumerable:!0,get:function(){return ww.EMPTY}}),Ew=md,Object.defineProperty(I,"NEVER",{enumerable:!0,get:function(){return Ew.NEVER}}),T(uh,I),Pw=Nt,Object.defineProperty(I,"config",{enumerable:!0,get:function(){return Pw.config}}),Sw=ah,Object.defineProperty(I,"audit",{enumerable:!0,get:function(){return Sw.audit}}),Tw=fh,Object.defineProperty(I,"auditTime",{enumerable:!0,get:function(){return Tw.auditTime}}),jw=bh,Object.defineProperty(I,"buffer",{enumerable:!0,get:function(){return jw.buffer}}),Cw=gh,Object.defineProperty(I,"bufferCount",{enumerable:!0,get:function(){return Cw.bufferCount}}),Rw=Sh,Object.defineProperty(I,"bufferTime",{enumerable:!0,get:function(){return Rw.bufferTime}}),Iw=Nh,Object.defineProperty(I,"bufferToggle",{enumerable:!0,get:function(){return Iw.bufferToggle}}),Aw=qh,Object.defineProperty(I,"bufferWhen",{enumerable:!0,get:function(){return Aw.bufferWhen}}),kw=Yh,Object.defineProperty(I,"catchError",{enumerable:!0,get:function(){return kw.catchError}}),Mw=Xh,Object.defineProperty(I,"combineAll",{enumerable:!0,get:function(){return Mw.combineAll}}),Nw=Jh,Object.defineProperty(I,"combineLatestAll",{enumerable:!0,get:function(){return Nw.combineLatestAll}}),xw=bb,Object.defineProperty(I,"combineLatestWith",{enumerable:!0,get:function(){return xw.combineLatestWith}}),Dw=ip,Object.defineProperty(I,"concatAll",{enumerable:!0,get:function(){return Dw.concatAll}}),Lw=wf,Object.defineProperty(I,"concatMap",{enumerable:!0,get:function(){return Lw.concatMap}}),Uw=Ab,Object.defineProperty(I,"concatMapTo",{enumerable:!0,get:function(){return Uw.concatMapTo}}),Fw=Nb,Object.defineProperty(I,"concatWith",{enumerable:!0,get:function(){return Fw.concatWith}}),Bw=Hb,Object.defineProperty(I,"connect",{enumerable:!0,get:function(){return Bw.connect}}),Ww=Gb,Object.defineProperty(I,"count",{enumerable:!0,get:function(){return Ww.count}}),qw=ey,Object.defineProperty(I,"debounce",{enumerable:!0,get:function(){return qw.debounce}}),zw=iy,Object.defineProperty(I,"debounceTime",{enumerable:!0,get:function(){return zw.debounceTime}}),Vw=cy,Object.defineProperty(I,"defaultIfEmpty",{enumerable:!0,get:function(){return Vw.defaultIfEmpty}}),Hw=A,Object.defineProperty(I,"delay",{enumerable:!0,get:function(){return Hw.delay}}),Gw=py,Object.defineProperty(I,"delayWhen",{enumerable:!0,get:function(){return Gw.delayWhen}}),Yw=ky,Object.defineProperty(I,"dematerialize",{enumerable:!0,get:function(){return Yw.dematerialize}}),Kw=Dy,Object.defineProperty(I,"distinct",{enumerable:!0,get:function(){return Kw.distinct}}),Zw=Wy,Object.defineProperty(I,"distinctUntilChanged",{enumerable:!0,get:function(){return Zw.distinctUntilChanged}}),Qw=Gy,Object.defineProperty(I,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return Qw.distinctUntilKeyChanged}}),Xw=Ky,Object.defineProperty(I,"elementAt",{enumerable:!0,get:function(){return Xw.elementAt}}),Jw=i_,Object.defineProperty(I,"endWith",{enumerable:!0,get:function(){return Jw.endWith}}),$w=l_,Object.defineProperty(I,"every",{enumerable:!0,get:function(){return $w.every}}),eE=d_,Object.defineProperty(I,"exhaust",{enumerable:!0,get:function(){return eE.exhaust}}),tE=h_,Object.defineProperty(I,"exhaustAll",{enumerable:!0,get:function(){return tE.exhaustAll}}),rE=b_,Object.defineProperty(I,"exhaustMap",{enumerable:!0,get:function(){return rE.exhaustMap}}),nE=w_,Object.defineProperty(I,"expand",{enumerable:!0,get:function(){return nE.expand}}),oE=kd,Object.defineProperty(I,"filter",{enumerable:!0,get:function(){return oE.filter}}),iE=S_,Object.defineProperty(I,"finalize",{enumerable:!0,get:function(){return iE.finalize}}),uE=j_,Object.defineProperty(I,"find",{enumerable:!0,get:function(){return uE.find}}),aE=A_,Object.defineProperty(I,"findIndex",{enumerable:!0,get:function(){return aE.findIndex}}),sE=N_,Object.defineProperty(I,"first",{enumerable:!0,get:function(){return sE.first}}),cE=W_,Object.defineProperty(I,"groupBy",{enumerable:!0,get:function(){return cE.groupBy}}),lE=_y,Object.defineProperty(I,"ignoreElements",{enumerable:!0,get:function(){return lE.ignoreElements}}),fE=Y_,Object.defineProperty(I,"isEmpty",{enumerable:!0,get:function(){return fE.isEmpty}}),pE=Q_,Object.defineProperty(I,"last",{enumerable:!0,get:function(){return pE.last}}),dE=Ef,Object.defineProperty(I,"map",{enumerable:!0,get:function(){return dE.map}}),hE=Oy,Object.defineProperty(I,"mapTo",{enumerable:!0,get:function(){return hE.mapTo}}),bE=sv,Object.defineProperty(I,"materialize",{enumerable:!0,get:function(){return bE.materialize}}),yE=pv,Object.defineProperty(I,"max",{enumerable:!0,get:function(){return yE.max}}),_E=up,Object.defineProperty(I,"mergeAll",{enumerable:!0,get:function(){return _E.mergeAll}}),vE=bv,Object.defineProperty(I,"flatMap",{enumerable:!0,get:function(){return vE.flatMap}}),mE=ap,Object.defineProperty(I,"mergeMap",{enumerable:!0,get:function(){return mE.mergeMap}}),gE=yv,Object.defineProperty(I,"mergeMapTo",{enumerable:!0,get:function(){return gE.mergeMapTo}}),OE=mv,Object.defineProperty(I,"mergeScan",{enumerable:!0,get:function(){return OE.mergeScan}}),wE=sp,Object.defineProperty(I,"mergeWith",{enumerable:!0,get:function(){return wE.mergeWith}}),EE=Mv,Object.defineProperty(I,"min",{enumerable:!0,get:function(){return EE.min}}),PE=Dv,Object.defineProperty(I,"multicast",{enumerable:!0,get:function(){return PE.multicast}}),SE=w,Object.defineProperty(I,"observeOn",{enumerable:!0,get:function(){return SE.observeOn}}),TE=Bv,Object.defineProperty(I,"onErrorResumeNextWith",{enumerable:!0,get:function(){return TE.onErrorResumeNextWith}}),jE=Gv,Object.defineProperty(I,"pairwise",{enumerable:!0,get:function(){return jE.pairwise}}),CE=Zv,Object.defineProperty(I,"pluck",{enumerable:!0,get:function(){return CE.pluck}}),RE=Xv,Object.defineProperty(I,"publish",{enumerable:!0,get:function(){return RE.publish}}),IE=tm,Object.defineProperty(I,"publishBehavior",{enumerable:!0,get:function(){return IE.publishBehavior}}),AE=om,Object.defineProperty(I,"publishLast",{enumerable:!0,get:function(){return AE.publishLast}}),kE=am,Object.defineProperty(I,"publishReplay",{enumerable:!0,get:function(){return kE.publishReplay}}),ME=fm,Object.defineProperty(I,"raceWith",{enumerable:!0,get:function(){return ME.raceWith}}),NE=eb,Object.defineProperty(I,"reduce",{enumerable:!0,get:function(){return NE.reduce}}),xE=_m,Object.defineProperty(I,"repeat",{enumerable:!0,get:function(){return xE.repeat}}),DE=Em,Object.defineProperty(I,"repeatWhen",{enumerable:!0,get:function(){return DE.repeatWhen}}),LE=Cm,Object.defineProperty(I,"retry",{enumerable:!0,get:function(){return LE.retry}}),UE=Nm,Object.defineProperty(I,"retryWhen",{enumerable:!0,get:function(){return UE.retryWhen}}),FE=C,Object.defineProperty(I,"refCount",{enumerable:!0,get:function(){return FE.refCount}}),BE=Fm,Object.defineProperty(I,"sample",{enumerable:!0,get:function(){return BE.sample}}),WE=Vm,Object.defineProperty(I,"sampleTime",{enumerable:!0,get:function(){return WE.sampleTime}}),qE=Km,Object.defineProperty(I,"scan",{enumerable:!0,get:function(){return qE.scan}}),zE=tb,Object.defineProperty(I,"sequenceEqual",{enumerable:!0,get:function(){return zE.sequenceEqual}}),VE=t0,Object.defineProperty(I,"share",{enumerable:!0,get:function(){return VE.share}}),HE=c0,Object.defineProperty(I,"shareReplay",{enumerable:!0,get:function(){return HE.shareReplay}}),GE=p0,Object.defineProperty(I,"single",{enumerable:!0,get:function(){return GE.single}}),YE=v0,Object.defineProperty(I,"skip",{enumerable:!0,get:function(){return YE.skip}}),KE=g0,Object.defineProperty(I,"skipLast",{enumerable:!0,get:function(){return KE.skipLast}}),ZE=P0,Object.defineProperty(I,"skipUntil",{enumerable:!0,get:function(){return ZE.skipUntil}}),QE=R0,Object.defineProperty(I,"skipWhile",{enumerable:!0,get:function(){return QE.skipWhile}}),XE=k0,Object.defineProperty(I,"startWith",{enumerable:!0,get:function(){return XE.startWith}}),JE=yl,Object.defineProperty(I,"subscribeOn",{enumerable:!0,get:function(){return JE.subscribeOn}}),$E=D0,Object.defineProperty(I,"switchAll",{enumerable:!0,get:function(){return $E.switchAll}}),eP=L0,Object.defineProperty(I,"switchMap",{enumerable:!0,get:function(){return eP.switchMap}}),tP=z0,Object.defineProperty(I,"switchMapTo",{enumerable:!0,get:function(){return tP.switchMapTo}}),rP=G0,Object.defineProperty(I,"switchScan",{enumerable:!0,get:function(){return rP.switchScan}}),nP=dy,Object.defineProperty(I,"take",{enumerable:!0,get:function(){return nP.take}}),oP=X_,Object.defineProperty(I,"takeLast",{enumerable:!0,get:function(){return oP.takeLast}}),iP=Z0,Object.defineProperty(I,"takeUntil",{enumerable:!0,get:function(){return iP.takeUntil}}),uP=eg,Object.defineProperty(I,"takeWhile",{enumerable:!0,get:function(){return uP.takeWhile}}),aP=ng,Object.defineProperty(I,"tap",{enumerable:!0,get:function(){return aP.tap}}),sP=E,Object.defineProperty(I,"throttle",{enumerable:!0,get:function(){return sP.throttle}}),cP=fg,Object.defineProperty(I,"throttleTime",{enumerable:!0,get:function(){return cP.throttleTime}}),lP=Zy,Object.defineProperty(I,"throwIfEmpty",{enumerable:!0,get:function(){return lP.throwIfEmpty}}),fP=bg,Object.defineProperty(I,"timeInterval",{enumerable:!0,get:function(){return fP.timeInterval}}),pP=Bc,Object.defineProperty(I,"timeout",{enumerable:!0,get:function(){return pP.timeout}}),dP=gg,Object.defineProperty(I,"timeoutWith",{enumerable:!0,get:function(){return dP.timeoutWith}}),hP=Sl,Object.defineProperty(I,"timestamp",{enumerable:!0,get:function(){return hP.timestamp}}),bP=$h,Object.defineProperty(I,"toArray",{enumerable:!0,get:function(){return bP.toArray}}),yP=u,Object.defineProperty(I,"window",{enumerable:!0,get:function(){return yP.window}}),_P=Ag,Object.defineProperty(I,"windowCount",{enumerable:!0,get:function(){return _P.windowCount}}),vP=Dg,Object.defineProperty(I,"windowTime",{enumerable:!0,get:function(){return vP.windowTime}}),mP=pl,Object.defineProperty(I,"windowToggle",{enumerable:!0,get:function(){return mP.windowToggle}}),gP=v,Object.defineProperty(I,"windowWhen",{enumerable:!0,get:function(){return gP.windowWhen}}),OP=nO,Object.defineProperty(I,"withLatestFrom",{enumerable:!0,get:function(){return OP.withLatestFrom}}),wP=j,Object.defineProperty(I,"zipAll",{enumerable:!0,get:function(){return wP.zipAll}}),EP=R,Object.defineProperty(I,"zipWith",{enumerable:!0,get:function(){return EP.zipWith}});var o={},pn={},jP=(Object.defineProperty(pn,"__esModule",{value:!0}),pn.partition=void 0,Ad),CP=kd;pn.partition=function(t,r){return function(e){return[CP.filter(t,r)(e),CP.filter(jP.not(t,r))(e)]}};var RP,IP,AP,kP,MP,NP,xP,DP,LP,UP,FP,BP,WP,qP,zP,VP,HP,GP,YP,KP,ZP,QP,XP,JP,$P,eS,tS,rS,nS,oS,iS,uS,aS,sS,cS,lS,fS,pS,dS,hS,bS,yS,_S,vS,mS,gS,OS,wS,ES,PS,SS,TS,jS,CS,RS,IS,AS,kS,MS,NS,xS,DS,LS,US,FS,BS,WS,qS,zS,VS,HS,GS,YS,KS,ZS,QS,XS,JS,$S,e1,t1,r1,n1,o1,i1,u1,a1,s1,c1,l1,f1,p1,d1,h1,b1,y1,_1,v1,m1,g1,O1,w1,E1,P1,S1,T1,j1,C1,R1,I1,A1,k1,M1,it={},N1=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},x1=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},D1=(Object.defineProperty(it,"__esModule",{value:!0}),it.race=void 0,Od),L1=fm;it.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return L1.raceWith.apply(void 0,x1([],N1(D1.argsOrArgArray(e))))},n=o,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,RP=ah,Object.defineProperty(n,"audit",{enumerable:!0,get:function(){return RP.audit}}),IP=fh,Object.defineProperty(n,"auditTime",{enumerable:!0,get:function(){return IP.auditTime}}),AP=bh,Object.defineProperty(n,"buffer",{enumerable:!0,get:function(){return AP.buffer}}),kP=gh,Object.defineProperty(n,"bufferCount",{enumerable:!0,get:function(){return kP.bufferCount}}),MP=Sh,Object.defineProperty(n,"bufferTime",{enumerable:!0,get:function(){return MP.bufferTime}}),NP=Nh,Object.defineProperty(n,"bufferToggle",{enumerable:!0,get:function(){return NP.bufferToggle}}),xP=qh,Object.defineProperty(n,"bufferWhen",{enumerable:!0,get:function(){return xP.bufferWhen}}),DP=Yh,Object.defineProperty(n,"catchError",{enumerable:!0,get:function(){return DP.catchError}}),LP=Xh,Object.defineProperty(n,"combineAll",{enumerable:!0,get:function(){return LP.combineAll}}),UP=Jh,Object.defineProperty(n,"combineLatestAll",{enumerable:!0,get:function(){return UP.combineLatestAll}}),FP=yb,Object.defineProperty(n,"combineLatest",{enumerable:!0,get:function(){return FP.combineLatest}}),BP=bb,Object.defineProperty(n,"combineLatestWith",{enumerable:!0,get:function(){return BP.combineLatestWith}}),WP=xb,Object.defineProperty(n,"concat",{enumerable:!0,get:function(){return WP.concat}}),qP=ip,Object.defineProperty(n,"concatAll",{enumerable:!0,get:function(){return qP.concatAll}}),zP=wf,Object.defineProperty(n,"concatMap",{enumerable:!0,get:function(){return zP.concatMap}}),VP=Ab,Object.defineProperty(n,"concatMapTo",{enumerable:!0,get:function(){return VP.concatMapTo}}),HP=Nb,Object.defineProperty(n,"concatWith",{enumerable:!0,get:function(){return HP.concatWith}}),GP=Hb,Object.defineProperty(n,"connect",{enumerable:!0,get:function(){return GP.connect}}),YP=Gb,Object.defineProperty(n,"count",{enumerable:!0,get:function(){return YP.count}}),KP=ey,Object.defineProperty(n,"debounce",{enumerable:!0,get:function(){return KP.debounce}}),ZP=iy,Object.defineProperty(n,"debounceTime",{enumerable:!0,get:function(){return ZP.debounceTime}}),QP=cy,Object.defineProperty(n,"defaultIfEmpty",{enumerable:!0,get:function(){return QP.defaultIfEmpty}}),XP=A,Object.defineProperty(n,"delay",{enumerable:!0,get:function(){return XP.delay}}),JP=py,Object.defineProperty(n,"delayWhen",{enumerable:!0,get:function(){return JP.delayWhen}}),$P=ky,Object.defineProperty(n,"dematerialize",{enumerable:!0,get:function(){return $P.dematerialize}}),eS=Dy,Object.defineProperty(n,"distinct",{enumerable:!0,get:function(){return eS.distinct}}),tS=Wy,Object.defineProperty(n,"distinctUntilChanged",{enumerable:!0,get:function(){return tS.distinctUntilChanged}}),rS=Gy,Object.defineProperty(n,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return rS.distinctUntilKeyChanged}}),nS=Ky,Object.defineProperty(n,"elementAt",{enumerable:!0,get:function(){return nS.elementAt}}),oS=i_,Object.defineProperty(n,"endWith",{enumerable:!0,get:function(){return oS.endWith}}),iS=l_,Object.defineProperty(n,"every",{enumerable:!0,get:function(){return iS.every}}),uS=d_,Object.defineProperty(n,"exhaust",{enumerable:!0,get:function(){return uS.exhaust}}),aS=h_,Object.defineProperty(n,"exhaustAll",{enumerable:!0,get:function(){return aS.exhaustAll}}),sS=b_,Object.defineProperty(n,"exhaustMap",{enumerable:!0,get:function(){return sS.exhaustMap}}),cS=w_,Object.defineProperty(n,"expand",{enumerable:!0,get:function(){return cS.expand}}),lS=kd,Object.defineProperty(n,"filter",{enumerable:!0,get:function(){return lS.filter}}),fS=S_,Object.defineProperty(n,"finalize",{enumerable:!0,get:function(){return fS.finalize}}),pS=j_,Object.defineProperty(n,"find",{enumerable:!0,get:function(){return pS.find}}),dS=A_,Object.defineProperty(n,"findIndex",{enumerable:!0,get:function(){return dS.findIndex}}),hS=N_,Object.defineProperty(n,"first",{enumerable:!0,get:function(){return hS.first}}),bS=W_,Object.defineProperty(n,"groupBy",{enumerable:!0,get:function(){return bS.groupBy}}),yS=_y,Object.defineProperty(n,"ignoreElements",{enumerable:!0,get:function(){return yS.ignoreElements}}),_S=Y_,Object.defineProperty(n,"isEmpty",{enumerable:!0,get:function(){return _S.isEmpty}}),vS=Q_,Object.defineProperty(n,"last",{enumerable:!0,get:function(){return vS.last}}),mS=Ef,Object.defineProperty(n,"map",{enumerable:!0,get:function(){return mS.map}}),gS=Oy,Object.defineProperty(n,"mapTo",{enumerable:!0,get:function(){return gS.mapTo}}),OS=sv,Object.defineProperty(n,"materialize",{enumerable:!0,get:function(){return OS.materialize}}),wS=pv,Object.defineProperty(n,"max",{enumerable:!0,get:function(){return wS.max}}),ES=wv,Object.defineProperty(n,"merge",{enumerable:!0,get:function(){return ES.merge}}),PS=up,Object.defineProperty(n,"mergeAll",{enumerable:!0,get:function(){return PS.mergeAll}}),SS=bv,Object.defineProperty(n,"flatMap",{enumerable:!0,get:function(){return SS.flatMap}}),TS=ap,Object.defineProperty(n,"mergeMap",{enumerable:!0,get:function(){return TS.mergeMap}}),jS=yv,Object.defineProperty(n,"mergeMapTo",{enumerable:!0,get:function(){return jS.mergeMapTo}}),CS=mv,Object.defineProperty(n,"mergeScan",{enumerable:!0,get:function(){return CS.mergeScan}}),RS=sp,Object.defineProperty(n,"mergeWith",{enumerable:!0,get:function(){return RS.mergeWith}}),IS=Mv,Object.defineProperty(n,"min",{enumerable:!0,get:function(){return IS.min}}),AS=Dv,Object.defineProperty(n,"multicast",{enumerable:!0,get:function(){return AS.multicast}}),kS=w,Object.defineProperty(n,"observeOn",{enumerable:!0,get:function(){return kS.observeOn}}),MS=Bv,Object.defineProperty(n,"onErrorResumeNext",{enumerable:!0,get:function(){return MS.onErrorResumeNext}}),NS=Gv,Object.defineProperty(n,"pairwise",{enumerable:!0,get:function(){return NS.pairwise}}),xS=pn,Object.defineProperty(n,"partition",{enumerable:!0,get:function(){return xS.partition}}),DS=Zv,Object.defineProperty(n,"pluck",{enumerable:!0,get:function(){return DS.pluck}}),LS=Xv,Object.defineProperty(n,"publish",{enumerable:!0,get:function(){return LS.publish}}),US=tm,Object.defineProperty(n,"publishBehavior",{enumerable:!0,get:function(){return US.publishBehavior}}),FS=om,Object.defineProperty(n,"publishLast",{enumerable:!0,get:function(){return FS.publishLast}}),BS=am,Object.defineProperty(n,"publishReplay",{enumerable:!0,get:function(){return BS.publishReplay}}),WS=it,Object.defineProperty(n,"race",{enumerable:!0,get:function(){return WS.race}}),qS=fm,Object.defineProperty(n,"raceWith",{enumerable:!0,get:function(){return qS.raceWith}}),zS=eb,Object.defineProperty(n,"reduce",{enumerable:!0,get:function(){return zS.reduce}}),VS=_m,Object.defineProperty(n,"repeat",{enumerable:!0,get:function(){return VS.repeat}}),HS=Em,Object.defineProperty(n,"repeatWhen",{enumerable:!0,get:function(){return HS.repeatWhen}}),GS=Cm,Object.defineProperty(n,"retry",{enumerable:!0,get:function(){return GS.retry}}),YS=Nm,Object.defineProperty(n,"retryWhen",{enumerable:!0,get:function(){return YS.retryWhen}}),KS=C,Object.defineProperty(n,"refCount",{enumerable:!0,get:function(){return KS.refCount}}),ZS=Fm,Object.defineProperty(n,"sample",{enumerable:!0,get:function(){return ZS.sample}}),QS=Vm,Object.defineProperty(n,"sampleTime",{enumerable:!0,get:function(){return QS.sampleTime}}),XS=Km,Object.defineProperty(n,"scan",{enumerable:!0,get:function(){return XS.scan}}),JS=tb,Object.defineProperty(n,"sequenceEqual",{enumerable:!0,get:function(){return JS.sequenceEqual}}),$S=t0,Object.defineProperty(n,"share",{enumerable:!0,get:function(){return $S.share}}),e1=c0,Object.defineProperty(n,"shareReplay",{enumerable:!0,get:function(){return e1.shareReplay}}),t1=p0,Object.defineProperty(n,"single",{enumerable:!0,get:function(){return t1.single}}),r1=v0,Object.defineProperty(n,"skip",{enumerable:!0,get:function(){return r1.skip}}),n1=g0,Object.defineProperty(n,"skipLast",{enumerable:!0,get:function(){return n1.skipLast}}),o1=P0,Object.defineProperty(n,"skipUntil",{enumerable:!0,get:function(){return o1.skipUntil}}),i1=R0,Object.defineProperty(n,"skipWhile",{enumerable:!0,get:function(){return i1.skipWhile}}),u1=k0,Object.defineProperty(n,"startWith",{enumerable:!0,get:function(){return u1.startWith}}),a1=yl,Object.defineProperty(n,"subscribeOn",{enumerable:!0,get:function(){return a1.subscribeOn}}),s1=D0,Object.defineProperty(n,"switchAll",{enumerable:!0,get:function(){return s1.switchAll}}),c1=L0,Object.defineProperty(n,"switchMap",{enumerable:!0,get:function(){return c1.switchMap}}),l1=z0,Object.defineProperty(n,"switchMapTo",{enumerable:!0,get:function(){return l1.switchMapTo}}),f1=G0,Object.defineProperty(n,"switchScan",{enumerable:!0,get:function(){return f1.switchScan}}),p1=dy,Object.defineProperty(n,"take",{enumerable:!0,get:function(){return p1.take}}),d1=X_,Object.defineProperty(n,"takeLast",{enumerable:!0,get:function(){return d1.takeLast}}),h1=Z0,Object.defineProperty(n,"takeUntil",{enumerable:!0,get:function(){return h1.takeUntil}}),b1=eg,Object.defineProperty(n,"takeWhile",{enumerable:!0,get:function(){return b1.takeWhile}}),y1=ng,Object.defineProperty(n,"tap",{enumerable:!0,get:function(){return y1.tap}}),_1=E,Object.defineProperty(n,"throttle",{enumerable:!0,get:function(){return _1.throttle}}),v1=fg,Object.defineProperty(n,"throttleTime",{enumerable:!0,get:function(){return v1.throttleTime}}),m1=Zy,Object.defineProperty(n,"throwIfEmpty",{enumerable:!0,get:function(){return m1.throwIfEmpty}}),g1=bg,Object.defineProperty(n,"timeInterval",{enumerable:!0,get:function(){return g1.timeInterval}}),O1=Bc,Object.defineProperty(n,"timeout",{enumerable:!0,get:function(){return O1.timeout}}),w1=gg,Object.defineProperty(n,"timeoutWith",{enumerable:!0,get:function(){return w1.timeoutWith}}),E1=Sl,Object.defineProperty(n,"timestamp",{enumerable:!0,get:function(){return E1.timestamp}}),P1=$h,Object.defineProperty(n,"toArray",{enumerable:!0,get:function(){return P1.toArray}}),S1=u,Object.defineProperty(n,"window",{enumerable:!0,get:function(){return S1.window}}),T1=Ag,Object.defineProperty(n,"windowCount",{enumerable:!0,get:function(){return T1.windowCount}}),j1=Dg,Object.defineProperty(n,"windowTime",{enumerable:!0,get:function(){return j1.windowTime}}),C1=pl,Object.defineProperty(n,"windowToggle",{enumerable:!0,get:function(){return C1.windowToggle}}),R1=v,Object.defineProperty(n,"windowWhen",{enumerable:!0,get:function(){return R1.windowWhen}}),I1=nO,Object.defineProperty(n,"withLatestFrom",{enumerable:!0,get:function(){return I1.withLatestFrom}}),A1=i,Object.defineProperty(n,"zip",{enumerable:!0,get:function(){return A1.zip}}),k1=j,Object.defineProperty(n,"zipAll",{enumerable:!0,get:function(){return k1.zipAll}}),M1=R,Object.defineProperty(n,"zipWith",{enumerable:!0,get:function(){return M1.zipWith}});var t={},U1=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())})},F1=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}}}},B1=(Object.defineProperty(t,"__esModule",{value:!0}),e),W1=Y,q1=o,z1=0,V1=1,H1=2;function G1(e,t){e=e.pipe((0,q1.publishReplay)(1),(0,q1.refCount)());this._result=e,this._keys=e.pipe((0,q1.mergeMap)(function(e){return(0,W1.from)(e.keys())}),(0,q1.publishReplay)(1),(0,q1.refCount)()),this._records=void 0,this._controls=new Y1,this._summary=new W1.ReplaySubject,this._state=t||z1}G1.prototype.keys=function(){return this._keys},G1.prototype.records=function(){var r=this,e=this._result.pipe((0,q1.mergeMap)(function(t){return new W1.Observable(function(e){return r._startStreaming({result:t,recordsObserver:e})})}));return e.push=function(){return r._push()},e},G1.prototype.consume=function(){var r=this;return this._result.pipe((0,q1.mergeMap)(function(t){return new W1.Observable(function(e){return r._startStreaming({result:t,summaryObserver:e})})}))},G1.prototype.pause=function(){this._controls.pause()},G1.prototype.resume=function(){return this._controls.resume()},G1.prototype.push=function(){return this._controls.push()},G1.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<V1?(this._state=V1,this._setupRecordsStream(t),r?n.push(this._records.subscribe(r)):t._cancel(),n.push({unsubscribe:function(){t._cancel&&t._cancel()}})):r&&r.error((0,B1.newError)("Streaming has already started/consumed with a previous records or summary subscription.")),function(){n.forEach(function(e){return e.unsubscribe()})}},G1.prototype._toObservable=function(){var n=this;return new W1.Observable(function(r){n._result.subscribe({complete:function(){return r.complete()},next:function(e){return r.next(new G1((t=e,new W1.Observable(function(e){e.next(t),e.complete()}))),n._state);var t},error:function(e){return r.error(e)}})})},G1.prototype._setupRecordsStream=function(n){var t=this;return this._records||(this._records=function(o,i,u){var e=this;void 0===u&&(u=new Y1);var a=new W1.Subject,s=function(n){return U1(e,void 0,void 0,function(){var t,r;return F1(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 U1(this,void 0,void 0,function(){return F1(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 U1(t,void 0,void 0,function(){var t,r;return F1(this,function(e){switch(e.label){case 0:return this._state=H1,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=H1,t._summary.error(e)}},this._controls),this._records)},t.default=G1;K1.prototype.pause=function(){this._paused=!0},Object.defineProperty(K1.prototype,"paused",{get:function(){return this._paused},enumerable:!1,configurable:!0}),Object.defineProperty(K1.prototype,"pushing",{get:function(){return this._pushing},set:function(e){this._pushing=e},enumerable:!1,configurable:!0}),K1.prototype.resume=function(){return U1(this,void 0,void 0,function(){var t;return F1(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]}})})},K1.prototype.push=function(){return U1(this,void 0,void 0,function(){return F1(this,function(e){switch(e.label){case 0:return this.pause(),[4,this._push()];case 1:return[2,e.sent()]}})})},Object.defineProperty(K1.prototype,"pusher",{get:function(){return this._push},set:function(e){this._push=e},enumerable:!1,configurable:!0});var Y1=K1;function K1(e){void 0===e&&(e=function(){return U1(t,void 0,void 0,function(){return F1(this,function(e){return[2]})})});var t=this;this._paused=!1,this._pushing=!1,this._push=e}var P={},s=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Z1=(Object.defineProperty(P,"__esModule",{value:!0}),Y),Q1=s(t);function X1(e){this._txc=e}s(e),X1.prototype.run=function(e,r){var n=this;return new Q1.default(new Z1.Observable(function(t){try{t.next(n._txc.run(e,r)),t.complete()}catch(e){t.error(e)}return function(){}}))},X1.prototype.commit=function(){var e=this;return new Z1.Observable(function(t){e._txc.commit().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},X1.prototype.rollback=function(){var e=this;return new Z1.Observable(function(t){e._txc.rollback().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},X1.prototype.isOpen=function(){return this._txc.isOpen()},X1.prototype.close=function(){var e=this;return new Z1.Observable(function(t){e._txc.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},P.default=X1;_={},b=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};function J1(e){e=e.run;this._run=e}Object.defineProperty(_,"__esModule",{value:!0}),b(t),b(P),J1.fromTransaction=function(e){return new J1({run:e.run.bind(e)})},J1.prototype.run=function(e,t){return this._run(e,t)},_.default=J1;var S={},$1=(Object.defineProperty(S,"__esModule",{value:!0}),e),eT=Y,tT=o,rT=($1.internal.logger.Logger,$1.error.SERVICE_UNAVAILABLE);function nT(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=oT(void 0===t?3e4:t,3e4),this._initialDelay=oT(r,1e3),this._delayMultiplier=oT(n,2),this._delayJitter=oT(o,.2),this._logger=e}function oT(e,t){return e||0===e?e:t}nT.prototype.retry=function(e){var a=this;return e.pipe((0,tT.retryWhen)(function(e){var n=[],o=Date.now(),i=1,u=a._initialDelay;return e.pipe((0,tT.mergeMap)(function(e){if(!(0,$1.isRetriableError)(e))return(0,eT.throwError)(function(){return e});var t;if(n.push(e),2<=i&&Date.now()-o>=a._maxRetryTimeout)return(t=(0,$1.newError)("Failed after retried for ".concat(i," times in ").concat(a._maxRetryTimeout," ms. Make sure that your database is online and retry again."),rT)).seenErrors=n,(0,eT.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,eT.of)(1).pipe((0,tT.delay)(r))}))}))},nT.prototype._computeNextDelay=function(e){var t=e*this._delayJitter;return e-t+2*t*Math.random()},S.default=nT;var Fs=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},iT=(Object.defineProperty(V,"__esModule",{value:!0}),Y),uT=o,aT=Fs(t),Zs=e,sT=Fs(P),cT=Fs(_),lT=Fs(S),$s=Zs.internal.constants,fT=$s.ACCESS_MODE_READ,pT=$s.ACCESS_MODE_WRITE,dT=$s.TELEMETRY_APIS,hT=Zs.internal.txConfig.TxConfig;function bT(e){var e=void 0===e?{}:e,t=e.session,r=e.config,e=e.log;this._session=t,this._retryLogic=function(e){e=e&&e.maxTransactionRetryTime?e.maxTransactionRetryTime:null;return new lT.default({maxRetryTimeout:e})}(r),this._log=e}bT.prototype.run=function(e,r,n){var o=this;return new aT.default(new iT.Observable(function(t){try{t.next(o._session.run(e,r,n)),t.complete()}catch(e){t.error(e)}return function(){}}))},bT.prototype.beginTransaction=function(e){return this._beginTransaction(this._session._mode,e,{api:dT.UNMANAGED_TRANSACTION})},bT.prototype.readTransaction=function(e,t){return this._runTransaction(fT,e,t)},bT.prototype.writeTransaction=function(e,t){return this._runTransaction(pT,e,t)},bT.prototype.executeRead=function(e,t){return this._executeInTransaction(fT,e,t)},bT.prototype.executeWrite=function(e,t){return this._executeInTransaction(pT,e,t)},bT.prototype._executeInTransaction=function(e,t,r){return this._runTransaction(e,t,r,function(e){return new cT.default({run:e.run.bind(e)})})},bT.prototype.close=function(){var e=this;return new iT.Observable(function(t){e._session.close().then(function(){t.complete()}).catch(function(e){return t.error(e)})})},bT.prototype[Symbol.asyncDispose]=function(){return this.close()},bT.prototype.lastBookmark=function(){return this.lastBookmarks()},bT.prototype.lastBookmarks=function(){return this._session.lastBookmarks()},bT.prototype._beginTransaction=function(e,t,r){var n=this,o=hT.empty();return t&&(o=new hT(t,this._log)),new iT.Observable(function(t){try{n._session._beginTransaction(e,o,r).then(function(e){t.next(new sT.default(e)),t.complete()}).catch(function(e){return t.error(e)})}catch(e){t.error(e)}return function(){}})},bT.prototype._runTransaction=function(e,r,t,n){var o=this,i=(void 0===n&&(n=function(e){return e}),hT.empty()),u=(t&&(i=new hT(t)),{apiTelemetryConfig:{api:dT.MANAGED_TRANSACTION,onTelemetrySuccess:function(){u.apiTelemetryConfig=void 0}}});return this._retryLogic.retry((0,iT.of)(1).pipe((0,uT.mergeMap)(function(){return o._beginTransaction(e,i,u.apiTelemetryConfig)}),(0,uT.mergeMap)(function(t){return(0,iT.defer)(function(){try{return r(n(t))}catch(e){return(0,iT.throwError)(function(){return e})}}).pipe((0,uT.catchError)(function(e){return t.rollback().pipe((0,uT.concatWith)((0,iT.throwError)(function(){return e})))}),(0,uT.concatWith)(t.commit()))})))},V.default=bT;var yT,_T,Os=r&&r.__extends||(yT=function(e,t){return(yT=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}yT(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),m=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Zr=(Object.defineProperty(U,"__esModule",{value:!0}),U.WRITE=U.READ=U.Driver=void 0,e),vT=m(V),mT=Zr.internal.constants.FETCH_ALL,hs=Zr.driver.READ,gT=Zr.driver.WRITE,c=(U.READ=hs,U.WRITE=gT,Os(OT,_T=Zr.Driver),OT.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,u=e.bookmarkManager,a=e.notificationFilter,e=e.auth;return new vT.default({session:this._newSession({defaultAccessMode:void 0===t?gT:t,bookmarkOrBookmarks:r,database:void 0===n?"":n,impersonatedUser:i,auth:e,reactive:!1,fetchSize:function(e,t){e=parseInt(e,10);{if(0<e||e===mT)return e;if(0===e||e<0)throw new Error("The fetch size can only be a positive value or ".concat(mT," for ALL. However fetchSize = ").concat(e));return t}}(o,this._config.fetchSize),bookmarkManager:u,notificationFilter:a,log:this._log}),config:this._config,log:this._log})},OT);function OT(){return null!==_T&&_T.apply(this,arguments)||this}U.Driver=c,U.default=c;g={},Object.defineProperty(g,"__esModule",{value:!0}),g.default="5.26.0",p={},Dc={},Rc={};function wT(){}Object.defineProperty(Rc,"__esModule",{value:!0}),wT.prototype.selectReader=function(e){throw new Error("Abstract function")},wT.prototype.selectWriter=function(e){throw new Error("Abstract function")},Rc.default=wT;kc={},Nc={};function ET(e){this._offset=e||0}Object.defineProperty(Nc,"__esModule",{value:!0}),ET.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},Nc.default=ET;var PT,ST,jc=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)}),Nl=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},TT=(Object.defineProperty(kc,"__esModule",{value:!0}),Nl(Nc)),f=Nl(Rc),Ol=(ST=f.default,jc(jT,ST),jT.prototype.selectReader=function(e){return this._select(e,this._readersIndex)},jT.prototype.selectWriter=function(e){return this._select(e,this._writersIndex)},jT.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},jT);function jT(e){var t=ST.call(this)||this;return t._readersIndex=new TT.default,t._writersIndex=new TT.default,t._connectionPool=e,t}kc.default=Ol;xr=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.LeastConnectedLoadBalancingStrategy=Dc.LoadBalancingStrategy=void 0,xc=xr(Rc),Dc.LoadBalancingStrategy=xc.default,Ff=xr(kc),Dc.LeastConnectedLoadBalancingStrategy=Ff.default,Dc.default=Ff.default,y={},op={},Ep={},Pp={},Ap={},Ec={},Wf={},Gf={byteLength:function(e){var e=NT(e),t=e[0],e=e[1];return 3*(t+e)/4-e}};Gf.toByteArray=function(e){var t,r,n=NT(e),o=n[0],n=n[1],i=new IT(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=RT[e.charCodeAt(r)]<<18|RT[e.charCodeAt(r+1)]<<12|RT[e.charCodeAt(r+2)]<<6|RT[e.charCodeAt(r+3)],i[u++]=t>>16&255,i[u++]=t>>8&255,i[u++]=255&t;2===n&&(t=RT[e.charCodeAt(r)]<<2|RT[e.charCodeAt(r+1)]>>4,i[u++]=255&t);1===n&&(t=RT[e.charCodeAt(r)]<<10|RT[e.charCodeAt(r+1)]<<4|RT[e.charCodeAt(r+2)]>>2,i[u++]=t>>8&255,i[u++]=255&t);return i},Gf.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 CT[e>>18&63]+CT[e>>12&63]+CT[e>>6&63]+CT[63&e]}(n));return o.join("")}(e,i,u<i+16383?u:i+16383));1==n?(t=e[r-1],o.push(CT[t>>2]+CT[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],o.push(CT[t>>10]+CT[t>>4&63]+CT[t<<2&63]+"="));return o.join("")};for(var CT=[],RT=[],IT="undefined"!=typeof Uint8Array?Uint8Array:Array,AT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kT=0,MT=AT.length;kT<MT;++kT)CT[kT]=AT[kT],RT[AT.charCodeAt(kT)]=kT;function NT(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]}RT["-".charCodeAt(0)]=62,RT["_".charCodeAt(0)]=63;Tc={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 xT=Wf;const Gx=Gf,Yx=Tc,Kx=(jl="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,xT.Buffer=k,xT.SlowBuffer=function(e){+e!=e&&(e=0);return k.alloc(+e)},xT.INSPECT_MAX_BYTES=50,2147483647);function DT(e){if(e>Kx)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return Object.setPrototypeOf(e,k.prototype),e}function k(e,t,r){if("number"!=typeof e)return LT(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return FT(e)}function LT(t,r,e){if("string"==typeof t){var n=t;var o=r;"string"==typeof o&&""!==o||(o="utf8");if(!k.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var i=0|zT(n,o);let e=DT(i);n=e.write(n,o);n!==i&&(e=e.slice(0,n));return e}if(ArrayBuffer.isView(t))return pj(o=t,Uint8Array)?WT((i=new Uint8Array(o)).buffer,i.byteOffset,i.byteLength):BT(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(pj(t,ArrayBuffer)||t&&pj(t.buffer,ArrayBuffer))return WT(t,r,e);if("undefined"!=typeof SharedArrayBuffer&&(pj(t,SharedArrayBuffer)||t&&pj(t.buffer,SharedArrayBuffer)))return WT(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 k.from(n,r,e);var u=function(e){{var t,r;if(k.isBuffer(e))return t=0|qT(e.length),0===(r=DT(t)).length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||dj(e.length)?DT(0):BT(e);if("Buffer"===e.type&&Array.isArray(e.data))return BT(e.data)}(t);if(u)return u;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return k.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 UT(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 FT(e){return UT(e),DT(e<0?0:0|qT(e))}function BT(t){var r=t.length<0?0:0|qT(t.length);const n=DT(r);for(let e=0;e<r;e+=1)n[e]=255&t[e];return n}function WT(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,k.prototype),n}function qT(e){if(e>=Kx)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Kx.toString(16)+" bytes");return 0|e}function zT(e,t){if(k.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||pj(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 cj(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return lj(e).length;default:if(o)return n?-1:cj(e).length;t=(""+t).toLowerCase(),o=!0}}function VT(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+=Jx[o[e]];return t;return}case"utf8":case"utf-8":return QT(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?Gx.fromByteArray(d):Gx.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 HT(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function GT(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=dj(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=k.from(t,n)),k.isBuffer(t))return 0===t.length?-1:YT(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):YT(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function YT(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 KT(e,t,r,n){return fj(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 ZT(e,t,r,n){return fj(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 QT(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<=Zx)return String.fromCharCode.apply(String,n);let e="",t=0;for(;t<o;)e+=String.fromCharCode.apply(String,n.slice(t,t+=Zx));return e}}xT.kMaxLength=Kx,(k.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(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}}),k.poolSize=8192,k.from=LT,Object.setPrototypeOf(k.prototype,Uint8Array.prototype),Object.setPrototypeOf(k,Uint8Array),k.alloc=function(e,t,r){return t=t,r=r,UT(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?DT(e).fill(t,r):DT(e).fill(t):DT(e)},k.allocUnsafe=FT,k.allocUnsafeSlow=FT,k.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==k.prototype},k.compare=function(r,n){if(pj(r,Uint8Array)&&(r=k.from(r,r.offset,r.byteLength)),pj(n,Uint8Array)&&(n=k.from(n,n.offset,n.byteLength)),!k.isBuffer(r)||!k.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},k.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}},k.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return k.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=k.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(pj(e,Uint8Array))o+e.length>n.length?(e=k.isBuffer(e)?e:k.from(e)).copy(n,o):Uint8Array.prototype.set.call(n,e,o);else{if(!k.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},k.byteLength=zT,k.prototype._isBuffer=!0,k.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)HT(this,e,e+1);return this},k.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)HT(this,e,e+3),HT(this,e+1,e+2);return this},k.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)HT(this,e,e+7),HT(this,e+1,e+6),HT(this,e+2,e+5),HT(this,e+3,e+4);return this},k.prototype.toLocaleString=k.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?QT(this,0,e):VT.apply(this,arguments)},k.prototype.equals=function(e){if(k.isBuffer(e))return this===e||0===k.compare(this,e);throw new TypeError("Argument must be a Buffer")},k.prototype.inspect=function(){let e="";var t=xT.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},jl&&(k.prototype[jl]=k.prototype.inspect),k.prototype.compare=function(e,t,r,n,o){if(pj(e,Uint8Array)&&(e=k.from(e,e.offset,e.byteLength)),!k.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},k.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},k.prototype.indexOf=function(e,t,r){return GT(this,e,t,r,!0)},k.prototype.lastIndexOf=function(e,t,r){return GT(this,e,t,r,!1)},k.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(dj(h))return e;c[f+e]=h}return e;return}case"utf8":case"utf-8":return d=r,u=n,fj(cj(t,(i=this).length-d),i,d,u);case"ascii":case"latin1":case"binary":return KT(this,t,r,n);case"base64":return i=this,u=r,o=n,fj(lj(t),i,u,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ZT(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),s=!0}},k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const Zx=4096;function XT(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 JT(e,t,r,n,o,i){if(!k.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 $T(e,t,r,n,o){uj(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 ej(e,t,r,n,o){uj(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 tj(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 rj(e,t,r,n,o){return t=+t,r>>>=0,o||tj(e,0,r,4),Yx.write(e,t,r,n,23,4),r+4}function nj(e,t,r,n,o){return t=+t,r>>>=0,o||tj(e,0,r,8),Yx.write(e,t,r,n,52,8),r+8}k.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,k.prototype),r},k.prototype.readUintLE=k.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||XT(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},k.prototype.readUintBE=k.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||XT(e,t,this.length);let n=this[e+--t],o=1;for(;0<t&&(o*=256);)n+=this[e+--t]*o;return n},k.prototype.readUint8=k.prototype.readUInt8=function(e,t){return e>>>=0,t||XT(e,1,this.length),this[e]},k.prototype.readUint16LE=k.prototype.readUInt16LE=function(e,t){return e>>>=0,t||XT(e,2,this.length),this[e]|this[e+1]<<8},k.prototype.readUint16BE=k.prototype.readUInt16BE=function(e,t){return e>>>=0,t||XT(e,2,this.length),this[e]<<8|this[e+1]},k.prototype.readUint32LE=k.prototype.readUInt32LE=function(e,t){return e>>>=0,t||XT(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},k.prototype.readUint32BE=k.prototype.readUInt32BE=function(e,t){return e>>>=0,t||XT(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},k.prototype.readBigUInt64LE=hj(function(e){aj(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||sj(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))}),k.prototype.readBigUInt64BE=hj(function(e){aj(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||sj(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)}),k.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||XT(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},k.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||XT(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},k.prototype.readInt8=function(e,t){return e>>>=0,t||XT(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},k.prototype.readInt16LE=function(e,t){e>>>=0,t||XT(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},k.prototype.readInt16BE=function(e,t){e>>>=0,t||XT(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},k.prototype.readInt32LE=function(e,t){return e>>>=0,t||XT(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},k.prototype.readInt32BE=function(e,t){return e>>>=0,t||XT(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},k.prototype.readBigInt64LE=hj(function(e){aj(e>>>=0,"offset");var t=this[e],r=this[e+7],r=(void 0!==t&&void 0!==r||sj(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)}),k.prototype.readBigInt64BE=hj(function(e){aj(e>>>=0,"offset");var t=this[e],r=this[e+7],t=(void 0!==t&&void 0!==r||sj(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)}),k.prototype.readFloatLE=function(e,t){return e>>>=0,t||XT(e,4,this.length),Yx.read(this,e,!0,23,4)},k.prototype.readFloatBE=function(e,t){return e>>>=0,t||XT(e,4,this.length),Yx.read(this,e,!1,23,4)},k.prototype.readDoubleLE=function(e,t){return e>>>=0,t||XT(e,8,this.length),Yx.read(this,e,!0,52,8)},k.prototype.readDoubleBE=function(e,t){return e>>>=0,t||XT(e,8,this.length),Yx.read(this,e,!1,52,8)},k.prototype.writeUintLE=k.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||JT(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},k.prototype.writeUintBE=k.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||JT(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},k.prototype.writeUint8=k.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||JT(this,e,t,1,255,0),this[t]=255&e,t+1},k.prototype.writeUint16LE=k.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||JT(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},k.prototype.writeUint16BE=k.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||JT(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},k.prototype.writeUint32LE=k.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||JT(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},k.prototype.writeUint32BE=k.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||JT(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},k.prototype.writeBigUInt64LE=hj(function(e,t=0){return $T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeBigUInt64BE=hj(function(e,t=0){return ej(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||JT(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},k.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||JT(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},k.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||JT(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},k.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||JT(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},k.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||JT(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},k.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||JT(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},k.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||JT(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},k.prototype.writeBigInt64LE=hj(function(e,t=0){return $T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeBigInt64BE=hj(function(e,t=0){return ej(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeFloatLE=function(e,t,r){return rj(this,e,t,!0,r)},k.prototype.writeFloatBE=function(e,t,r){return rj(this,e,t,!1,r)},k.prototype.writeDoubleLE=function(e,t,r){return nj(this,e,t,!0,r)},k.prototype.writeDoubleBE=function(e,t,r){return nj(this,e,t,!1,r)},k.prototype.copy=function(e,t,r,n){if(!k.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},k.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&&!k.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=k.isBuffer(e)?e:k.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 Qx={};function oj(e,t,r){Qx[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 ij(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 uj(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 Qx.ERR_OUT_OF_RANGE("value",e,t)}r=e,n=i,aj(u=o,"offset"),void 0!==r[u]&&void 0!==r[u+n]||sj(u,r.length-(n+1))}function aj(e,t){if("number"!=typeof e)throw new Qx.ERR_INVALID_ARG_TYPE(t,"number",e)}function sj(e,t,r){if(Math.floor(e)!==e)throw aj(e,r),new Qx.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new Qx.ERR_BUFFER_OUT_OF_BOUNDS;throw new Qx.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= `+t,e)}oj("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"},RangeError),oj("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type `+typeof t},TypeError),oj("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=ij(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=ij(n)),n+="n"),e+=` It must be ${t}. Received `+n},RangeError);const Xx=/[^+/0-9A-Za-z-_]/g;function cj(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 lj(e){return Gx.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Xx,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function fj(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 pj(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function dj(e){return e!=e}const Jx=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 hj(e){return"undefined"==typeof BigInt?bj:e}function bj(){throw new Error("BigInt not supported")}}var yj,id={},vc={},h=r&&r.__extends||(yj=function(e,t){return(yj=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}yj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),gd=(Object.defineProperty(vc,"__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 vj(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}vc.default=gd;h(mj,_j=gd),mj.prototype.putUInt8=function(e,t){this._inner.putUInt8(this._start+e,t)},mj.prototype.getUInt8=function(e){return this._inner.getUInt8(this._start+e)},mj.prototype.putInt8=function(e,t){this._inner.putInt8(this._start+e,t)},mj.prototype.putFloat64=function(e,t){this._inner.putFloat64(this._start+e,t)},mj.prototype.getInt8=function(e){return this._inner.getInt8(this._start+e)},mj.prototype.getFloat64=function(e){return this._inner.getFloat64(this._start+e)};var _j,vj=mj;function mj(e,t,r){t=_j.call(this,t)||this;return t._start=e,t._inner=r,t}var gj,Oj,Cd=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Id=(Object.defineProperty(id,"__esModule",{value:!0}),id.BaseBuffer=void 0,Cd(vc)),Ud=(id.BaseBuffer=Id.default,id.default=Id.default,r&&r.__extends||(gj=function(e,t){return(gj=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}gj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Vd=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},wj=(Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.alloc=void 0,Vd(Wf)),Sc=Vd(id),Ej=(Oj=Sc.default,Ud(Pj,Oj),Pj.prototype.getUInt8=function(e){return this._buffer.readUInt8(e)},Pj.prototype.getInt8=function(e){return this._buffer.readInt8(e)},Pj.prototype.getFloat64=function(e){return this._buffer.readDoubleBE(e)},Pj.prototype.putUInt8=function(e,t){this._buffer.writeUInt8(t,e)},Pj.prototype.putInt8=function(e,t){this._buffer.writeInt8(t,e)},Pj.prototype.putFloat64=function(e,t){this._buffer.writeDoubleBE(t,e)},Pj.prototype.putBytes=function(e,t){var r;t instanceof Pj?(r=Math.min(t.length-t.position,this.length-e),t._buffer.copy(this._buffer,e,t.position,t.position+r),t.position+=r):Oj.prototype.putBytes.call(this,e,t)},Pj.prototype.getSlice=function(e,t){return new Pj(this._buffer.slice(e,e+t))},Pj);function Pj(e){var t=this,e=(e=e)instanceof wj.default.Buffer?e:"number"==typeof e&&"function"==typeof wj.default.Buffer.alloc?wj.default.Buffer.alloc(e):new wj.default.Buffer(e);return(t=Oj.call(this,e.length)||this)._buffer=e,t}Ec.default=Ej,Ec.alloc=function(e){return new Ej(e)};var ud=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Sj=(Object.defineProperty(Ap,"__esModule",{value:!0}),ud(Ec)),Tj=e,Yd=Tj.internal.util,jj=Yd.ENCRYPTION_OFF,Cj=Yd.ENCRYPTION_ON;function Rj(e,t,r){void 0===t&&(t=Ij),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,this._closingPromise=null,function(e,t){var r=function(e){return!0===e.encrypted||e.encrypted===Cj}(e),n=function(e){return!1===e.encrypted||e.encrypted===jj}(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,Tj.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:"'+jj+'"` 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 Sj.default(e.data),n.onmessage(e))},this._ws.onerror=this._handleConnectionError,this._connectionTimeoutFired=!1,this._connectionTimeoutId=this._setupConnectionTimeout())}function Ij(){return"undefined"!=typeof window&&window.location?window.location.protocol:null}Rj.prototype._handleConnectionError=function(){if(this._connectionTimeoutFired)return this._error=(0,Tj.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,Tj.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))},Rj.prototype.write=function(e){if(null!==this._pending)this._pending.push(e);else{if(!(e instanceof Sj.default))throw(0,Tj.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()}}},Rj.prototype.close=function(){var r=this;return null===this._closingPromise&&(this._closingPromise=new Promise(function(e,t){r._clearConnectionTimeout(),r._ws&&3!==r._ws.readyState?(r._open=!1,r.stopReceiveTimeout(),r._ws.onclose=function(){e()},r._ws.close()):e()})),this._closingPromise},Rj.prototype.setupReceiveTimeout=function(e){this._receiveTimeout=e},Rj.prototype.stopReceiveTimeout=function(){null!==this._receiveTimeout&&this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!1,null!=this._receiveTimeoutId&&clearTimeout(this._receiveTimeoutId),this._receiveTimeoutId=null)},Rj.prototype.startReceiveTimeout=function(){this._open&&null!==this._receiveTimeout&&!this._receiveTimeoutStarted&&(this._receiveTimeoutStarted=!0,this._resetTimeout())},Rj.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,Tj.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))},Rj.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},Rj.prototype._clearConnectionTimeout=function(){var e=this._connectionTimeoutId;!e&&0!==e||(this._connectionTimeoutFired=!1,this._connectionTimeoutId=null,clearTimeout(e))},Ap.default=Rj;var Aj,Xd={},Pc=r&&r.__extends||(Aj=function(e,t){return(Aj=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}Aj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(Xd,"__esModule",{value:!0});var kj,O=e.internal.resolver.BaseHostNameResolver,md=(Pc(Mj,kj=O),Mj.prototype.resolve=function(e){return this._resolveToItself(e)},Mj);function Mj(){return null!==kj&&kj.apply(this,arguments)||this}Xd.default=md;var Nj,T={},xj=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())})},Dj=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}}}},uh=(Object.defineProperty(T,"__esModule",{value:!0}),T.default={load:function(t){return xj(this,void 0,void 0,function(){return Dj(this,function(e){return[2,t]})})}},r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}}),Nt=(Object.defineProperty(Pp,"__esModule",{value:!0}),Pp.ClientCertificatesLoader=Pp.HostNameResolver=Pp.Channel=void 0,uh(Ap)),I=uh(Xd),Ad=uh(T),Od=(Pp.Channel=Nt.default,Pp.HostNameResolver=I.default,Pp.ClientCertificatesLoader=Ad.default,{}),ah={},fh=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)});Object.defineProperty(ah,"__esModule",{value:!0});var Lj,Uj=Ec,bh=(Lj=id.BaseBuffer,fh(Fj,Lj),Fj.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}},Fj.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}},Fj.prototype.getFloat64=function(e){for(var t=(0,Uj.alloc)(8),r=0;r<8;r++)t.putUInt8(r,this.getUInt8(e+r));return t.getFloat64(0)},Fj);function Fj(e){for(var t=this,r=0,n=0;n<e.length;n++)r+=e[n].length;return(t=Lj.call(this,r)||this)._buffers=e,t}ah.default=bh;var Bj,Wj,gh=r&&r.__extends||(Bj=function(e,t){return(Bj=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}Bj(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Sh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Nh=(Object.defineProperty(Od,"__esModule",{value:!0}),Od.Dechunker=Od.Chunker=void 0,Sh(vc)),qj=Ec,zj=Sh(ah),qh=(Wj=Nh.default,gh(Vj,Wj),Vj.prototype.putUInt8=function(e,t){this._ensure(1),this._buffer.writeUInt8(t)},Vj.prototype.putInt8=function(e,t){this._ensure(1),this._buffer.writeInt8(t)},Vj.prototype.putFloat64=function(e,t){this._ensure(8),this._buffer.writeFloat64(t)},Vj.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},Vj.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,qj.alloc)(this._bufferSize),this._chunkOpen=!1),this},Vj.prototype.messageBoundary=function(){this._closeChunkIfOpen(),this._buffer.remaining()<2&&this.flush(),this._buffer.writeInt16(0)},Vj.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)},Vj.prototype._closeChunkIfOpen=function(){var e;this._chunkOpen&&(e=this._buffer.position-(this._currentChunkStart+2),this._buffer.putUInt16(this._currentChunkStart,e),this._chunkOpen=!1)},Vj);function Vj(e,t){var r=Wj.call(this,0)||this;return r._bufferSize=t||1400,r._ch=e,r._buffer=(0,qj.alloc)(r._bufferSize),r._currentChunkStart=0,r._chunkOpen=!1,r}function Hj(){this._currentMessage=[],this._partialChunkHeader=0,this._state=this.AWAITING_CHUNK}Od.Chunker=qh,Hj.prototype.AWAITING_CHUNK=function(e){return 2<=e.remaining()?this._onHeader(e.readUInt16()):(this._partialChunkHeader=e.readUInt8()<<8,this.IN_HEADER)},Hj.prototype.IN_HEADER=function(e){return this._onHeader(65535&(this._partialChunkHeader|e.readUInt8()))},Hj.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)},Hj.prototype.CLOSED=function(e){},Hj.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 zj.default(this._currentMessage)}return this._currentMessage=[],this.onmessage(t),this.AWAITING_CHUNK},Hj.prototype.write=function(e){for(;e.hasRemaining();)this._state=this._state(e)},Od.Dechunker=Hj;var Yh={},Gj=(Object.defineProperty(Yh,"__esModule",{value:!0}),e),Xh=Gj.internal.util,Jh=Xh.ENCRYPTION_OFF,yb=Xh.ENCRYPTION_ON,Yj=Gj.error.SERVICE_UNAVAILABLE,Kj=[null,void 0,!0,!1,yb,Jh],Zj=[null,void 0,"TRUST_ALL_CERTIFICATES","TRUST_CUSTOM_CA_SIGNED_CERTIFICATES","TRUST_SYSTEM_CA_SIGNED_CERTIFICATES"];Yh.default=function(e,t,r,n){this.address=e,this.encrypted=function(e){e=e.encrypted;if(-1!==Kj.indexOf(e))return e;throw(0,Gj.newError)("Illegal value of the encrypted setting ".concat(e,". Expected one of ").concat(Kj))}(t),this.trust=function(e){e=e.trust;if(-1!==Zj.indexOf(e))return e;throw(0,Gj.newError)("Illegal value of the trust setting ".concat(e,". Expected one of ").concat(Zj))}(t),this.trustedCertificates=t.trustedCertificates||[],this.knownHostsPath=t.knownHosts||null,this.connectionErrorCode=r||Yj,this.connectionTimeout=t.connectionTimeout,this.clientCertificate=n};var Qj,Xj,bb={},xb={},ip={exports:{}};function Jj(e,t){for(var r in e)t[r]=e[r]}function $j(e,t,r){return Xj(e,t,r)}Ab=(wf=ip).exports,(Xj=(Qj=Wf).Buffer).from&&Xj.alloc&&Xj.allocUnsafe&&Xj.allocUnsafeSlow?wf.exports=Qj:(Jj(Qj,Ab),Ab.Buffer=$j),$j.prototype=Object.create(Xj.prototype),Jj(Xj,$j),$j.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return Xj(e,t,r)},$j.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");e=Xj(e);return void 0!==t?"string"==typeof r?e.fill(t,r):e.fill(t):e.fill(0),e},$j.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Xj(e)},$j.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return Qj.SlowBuffer(e)};var eC=ip.exports.Buffer,tC=eC.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 rC(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||eC.isEncoding!==tC&&tC(e))return t||e;throw new Error("Unknown encoding: "+e)}function nC(e){var t;switch(this.encoding=rC(e),this.encoding){case"utf16le":this.text=uC,this.end=aC,t=4;break;case"utf8":this.fillLast=iC,t=4;break;case"base64":this.text=sC,this.end=cC,t=3;break;default:return this.write=lC,void(this.end=fC)}this.lastNeed=0,this.lastTotal=0,this.lastChar=eC.allocUnsafe(t)}function oC(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function iC(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 uC(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 aC(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 sC(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 cC(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function lC(e){return e.toString(this.encoding)}function fC(e){return e&&e.length?this.write(e):""}(xb.StringDecoder=nC).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||""},nC.prototype.end=function(e){e=e&&e.length?this.write(e):"";return this.lastNeed?e+"�":e},nC.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=oC(t[n]);if(0<=o)return 0<o&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(0<=(o=oC(t[n])))return 0<o&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(0<=(o=oC(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)},nC.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 pC,dC,hC,bC,yC,Nb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_C=(Object.defineProperty(bb,"__esModule",{value:!0}),Nb(Ec)),vC=e,mC=Nb(Wf),gC=new xb.StringDecoder("utf8");bb.default={encode:function(e){return new _C.default((e=e,"function"==typeof mC.default.Buffer.from?mC.default.Buffer.from(e,"utf8"):new mC.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 gC.write(e._buffer)},r=function(){return gC.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,vC.newError)("Don't know how to decode strings from '".concat(e,"'"))}},Hb=Ep,pC=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]}),Gb=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||pC(t,e,r)},dC=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Hb,"__esModule",{value:!0}),Hb.utf8=Hb.alloc=Hb.ChannelConfig=void 0,Gb(Pp,Hb),Gb(Od,Hb),hC=Yh,Object.defineProperty(Hb,"ChannelConfig",{enumerable:!0,get:function(){return dC(hC).default}}),bC=Ec,Object.defineProperty(Hb,"alloc",{enumerable:!0,get:function(){return bC.alloc}}),yC=bb,Object.defineProperty(Hb,"utf8",{enumerable:!0,get:function(){return dC(yC).default}}),Object.defineProperty(op,"__esModule",{value:!0});var OC=Ep,wC=e,EC=1616949271;function PC(e,t){return{major:e,minor:t}}function SC(){var e=[[PC(5,7),PC(5,0)],[PC(4,4),PC(4,2)],PC(4,1),PC(3,0)];if(4<e.length)throw(0,wC.newError)("It should not have more than 4 versions of the protocol");var o=(0,OC.alloc)(20);return o.writeInt32(EC),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}op.default=function(t,o){var i=this;return new Promise(function(r,n){function e(e){n(e)}t.onerror=e.bind(i),t._error&&e(t._error),t.onmessage=function(t){try{var e=function(e,t){if(72===(e=[e.readUInt8(),e.readUInt8(),e.readUInt8(),e.readUInt8()])[0]&&84===e[1]&&84===e[2]&&80===e[3])throw t.error("Handshake failed since server responded with HTTP."),(0,wC.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,o);r({protocolVersion:e,consumeRemainingBuffer:function(e){t.hasRemaining()&&e(t.readSlice(t.remaining()))}})}catch(e){n(e)}},t.write(SC())})};var TC,ey={},iy={},cy={},A={},py={},ky=r&&r.__extends||(TC=function(e,t){return(TC=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}TC(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Dy=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Wy=(Object.defineProperty(py,"__esModule",{value:!0}),Dy(e),jC.ofRecord=function(e){return null===e?jC.ofNull():new xC(e)},jC.ofMessageResponse=function(e){return null===e?jC.ofNull():new RC(e)},jC.ofNull=function(){return new kC},Object.defineProperty(jC.prototype,"ttl",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(jC.prototype,"db",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(jC.prototype,"servers",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(jC.prototype,"isNull",{get:function(){throw new Error("Not implemented")},enumerable:!1,configurable:!0}),jC);function jC(){}py.default=Wy;ky(IC,CC=Wy),Object.defineProperty(IC.prototype,"ttl",{get:function(){return this._response.rt.ttl},enumerable:!1,configurable:!0}),Object.defineProperty(IC.prototype,"servers",{get:function(){return this._response.rt.servers},enumerable:!1,configurable:!0}),Object.defineProperty(IC.prototype,"db",{get:function(){return this._response.rt.db},enumerable:!1,configurable:!0}),Object.defineProperty(IC.prototype,"isNull",{get:function(){return null===this._response},enumerable:!1,configurable:!0});var CC,RC=IC;function IC(e){var t=CC.call(this)||this;return t._response=e,t}ky(MC,AC=Wy),Object.defineProperty(MC.prototype,"isNull",{get:function(){return!0},enumerable:!1,configurable:!0});var AC,kC=MC;function MC(){return null!==AC&&AC.apply(this,arguments)||this}ky(DC,NC=Wy),Object.defineProperty(DC.prototype,"ttl",{get:function(){return this._record.get("ttl")},enumerable:!1,configurable:!0}),Object.defineProperty(DC.prototype,"servers",{get:function(){return this._record.get("servers")},enumerable:!1,configurable:!0}),Object.defineProperty(DC.prototype,"db",{get:function(){return this._record.has("db")?this._record.get("db"):null},enumerable:!1,configurable:!0}),Object.defineProperty(DC.prototype,"isNull",{get:function(){return null===this._record},enumerable:!1,configurable:!0});var NC,xC=DC;function DC(e){var t=NC.call(this)||this;return t._record=e,t}var Gy={},Ky={},LC=(Object.defineProperty(Ky,"__esModule",{value:!0}),Ky.reuseOngoingRequest=Ky.identity=void 0,e);Ky.identity=function(e){return e},Ky.reuseOngoingRequest=function(o,i){void 0===i&&(i=null);var u=new Map;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=LC.json.stringify(e);if(u.has(r))return u.get(r);var n=o.apply(i,e);return u.set(r,n),n.finally(function(){u.delete(r)})}};var i_={},UC=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.")};Object.defineProperty(i_,"__esModule",{value:!0}),i_.equals=void 0,i_.equals=function(e,t){var r,n;if(e===t)return!0;if(null===e||null===t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;var o=Object.keys(e),i=Object.keys(t);if(o.length!==i.length)return!1;try{for(var u=UC(o),a=u.next();!a.done;a=u.next()){var s=a.value;if(e[s]!==t[s])return!1}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!0};var FC,BC=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]}),WC=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)&&BC(t,e,r);return WC(t,e),t},d_=(Object.defineProperty(Gy,"__esModule",{value:!0}),Gy.object=Gy.functional=void 0,Gy.functional=l_(Ky),Gy.object=l_(i_),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)})),h_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},qC=(Object.defineProperty(A,"__esModule",{value:!0}),A.TelemetryObserver=A.ProcedureRouteObserver=A.RouteObserver=A.CompletedObserver=A.FailedObserver=A.ResetObserver=A.LogoffObserver=A.LoginObserver=A.ResultStreamObserver=A.StreamObserver=void 0,e),zC=h_(py),VC=Gy,HC=qC.internal.constants.FETCH_ALL,GC=qC.error.PROTOCOL_ERROR,b_=(YC.prototype.onNext=function(e){},YC.prototype.onError=function(e){},YC.prototype.onCompleted=function(e){},YC);function YC(){}A.StreamObserver=b_;d_(ZC,KC=b_),ZC.prototype.pause=function(){this._paused=!0},ZC.prototype.resume=function(){this._paused=!1,this._setupAutoPull(!0),this._state.pull(this)},ZC.prototype.onNext=function(e){this._haveRecordStreamed=!0;var t=new qC.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))},ZC.prototype.onCompleted=function(e){this._state.onSuccess(this,e)},ZC.prototype.onError=function(e){this._state.onError(this,e)},ZC.prototype.cancel=function(){this._discard=!0},ZC.prototype.prepareToHandleSingleResponse=function(){this._head=[],this._fieldKeys=[],this._setState(pR.STREAMING)},ZC.prototype.markCompleted=function(){this._head=[],this._fieldKeys=[],this._tail={},this._setState(pR.SUCCEEDED)},ZC.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===pR.READY&&this._handleStreaming());this._tail&&e.onCompleted&&e.onCompleted(this._tail),this._error&&e.onError(this._error),this._observers.push(e),this._state===pR.READY&&this._handleStreaming()},ZC.prototype._handleHasMore=function(e){this._setState(pR.READY),this._handleStreaming(),delete e.has_more},ZC.prototype._handlePullSuccess=function(e){var t,r=this,n=this._enrichMetadata(Object.assign(this._server?{server:this._server}:{},this._meta,{stream_summary:{have_records_streamed:this._haveRecordStreamed,pulled:this._pulled,has_keys:0<this._fieldKeys.length}},e));[void 0,null,"r","w","rw","s"].includes(n.type)?(this._setState(pR.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,qC.newError)('Server returned invalid query type. Expected one of [undefined, null, "r", "w", "rw", "s"] but got \''.concat(n.type,"'"),GC))},ZC.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}null!=e.fields&&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()}},ZC.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(pR.FAILED),this._error=t,null);this._beforeError&&(n=this._beforeError(t));n?Promise.resolve(n).then(e):e()},ZC.prototype._handleStreaming=function(){this._head&&this._observers.some(function(e){return e.onNext||e.onCompleted})&&(this._paused||!this._discard&&!this._autoPull||this._more())},ZC.prototype._more=function(){this._discard?this._discardFunction(this._queryId,this):(this._pulled=!0,this._moreFunction(this._queryId,this._fetchSize,this)),this._setState(pR.STREAMING)},ZC.prototype._storeMetadataForCompletion=function(e){for(var t,r=Object.keys(e),n=r.length;n--;)t=r[n],this._meta[t]=e[t]},ZC.prototype._setState=function(e){this._state=e},ZC.prototype._setupAutoPull=function(){this._autoPull=!0};var KC,w_=ZC;function ZC(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?HC: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,d=e.lowRecordWatermark,d=void 0===d?Number.MAX_VALUE:d,e=e.enrichMetadata,h=KC.call(this)||this;return h._fieldKeys=null,h._fieldLookup=null,h._head=null,h._queuedRecords=[],h._tail=null,h._error=null,h._observers=[],h._meta={},h._server=f,h._beforeError=i,h._afterError=u,h._beforeKeys=a,h._afterKeys=s,h._beforeComplete=c,h._afterComplete=l,h._enrichMetadata=e||VC.functional.identity,h._queryId=null,h._moreFunction=r,h._discardFunction=n,h._discard=!1,h._fetchSize=o,h._lowRecordWatermark=d,h._highRecordWatermark=p,h._setState(t?pR.READY:pR.READY_STREAMING),h._setupAutoPull(),h._paused=!1,h._pulled=!t,h._haveRecordStreamed=!1,h}A.ResultStreamObserver=w_;d_(XC,QC=b_),XC.prototype.onNext=function(e){this.onError((0,qC.newError)("Received RECORD when initializing "+qC.json.stringify(e)))},XC.prototype.onError=function(e){this._onError&&this._onError(e)},XC.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var QC,kd=XC;function XC(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=QC.call(this)||this;return r._onError=t,r._onCompleted=e,r}A.LoginObserver=kd;d_($C,JC=b_),$C.prototype.onNext=function(e){this.onError((0,qC.newError)("Received RECORD when logging off "+qC.json.stringify(e)))},$C.prototype.onError=function(e){this._onError&&this._onError(e)},$C.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var JC,S_=$C;function $C(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=JC.call(this)||this;return r._onError=t,r._onCompleted=e,r}A.LogoffObserver=S_;d_(tR,eR=b_),tR.prototype.onNext=function(e){this.onError((0,qC.newError)("Received RECORD when resetting: received record is: "+qC.json.stringify(e),GC))},tR.prototype.onError=function(e){e.code===GC&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},tR.prototype.onCompleted=function(e){this._onComplete&&this._onComplete(e)};var eR,j_=tR;function tR(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onComplete,n=eR.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onComplete=e,n}A.ResetObserver=j_;d_(nR,rR=w_),nR.prototype.onNext=function(e){this.onError((0,qC.newError)("Received RECORD when sending telemetry "+qC.json.stringify(e),GC))},nR.prototype.onError=function(e){this._onError&&this._onError(e)},nR.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(e)};var rR,A_=nR;function nR(e){var e=void 0===e?{}:e,t=e.onError,e=e.onCompleted,r=rR.call(this)||this;return r._onError=t,r._onCompleted=e,r}A.TelemetryObserver=A_;d_(iR,oR=w_);var oR,N_=iR;function iR(e){var t=e.error,e=e.onError,e=oR.call(this,{beforeError:e})||this;return e.onError(t),e}A.FailedObserver=N_;d_(aR,uR=w_);var uR,W_=aR;function aR(){var e=uR.call(this)||this;return uR.prototype.markCompleted.call(e),e}A.CompletedObserver=W_;d_(cR,sR=b_),cR.prototype.onNext=function(e){this._records.push(e)},cR.prototype.onError=function(e){e.code===GC&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},cR.prototype.onCompleted=function(){null!==this._records&&1!==this._records.length?this.onError((0,qC.newError)("Illegal response from router. Received "+this._records.length+" records but expected only one.\n"+qC.json.stringify(this._records),GC)):this._onCompleted&&this._onCompleted(zC.default.ofRecord(this._records[0]))};var sR,_y=cR;function cR(e){var t=e.resultObserver,r=e.onProtocolError,n=e.onError,e=e.onCompleted,o=sR.call(this)||this;return o._resultObserver=t,o._onError=n,o._onCompleted=e,o._records=[],o._onProtocolError=r,t.subscribe(o),o}A.ProcedureRouteObserver=_y;d_(fR,lR=b_),fR.prototype.onNext=function(e){this.onError((0,qC.newError)("Received RECORD when resetting: received record is: "+qC.json.stringify(e),GC))},fR.prototype.onError=function(e){e.code===GC&&this._onProtocolError&&this._onProtocolError(e.message),this._onError&&this._onError(e)},fR.prototype.onCompleted=function(e){this._onCompleted&&this._onCompleted(zC.default.ofMessageResponse(e))};var lR,Y_=fR;function fR(e){var e=void 0===e?{}:e,t=e.onProtocolError,r=e.onError,e=e.onCompleted,n=lR.call(this)||this;return n._onProtocolError=t,n._onError=r,n._onCompleted=e,n}A.RouteObserver=Y_;var pR={READY_STREAMING:{onSuccess:function(e,t){e._handleRunSuccess(t,function(){e._setState(pR.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(){}}},dR=(Object.defineProperty(cy,"__esModule",{value:!0}),cy.assertNotificationFilterIsEmpty=cy.assertImpersonatedUserIsEmpty=cy.assertTxConfigIsEmpty=cy.assertDatabaseIsEmpty=void 0,e);cy.assertTxConfigIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e&&!e.isEmpty())throw t((e=(0,dR.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},cy.assertDatabaseIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e)throw t((e=(0,dR.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},cy.assertImpersonatedUserIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),e)throw t((t=(0,dR.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},cy.assertNotificationFilterIsEmpty=function(e,t,r){if(void 0===t&&(t=function(){}),void 0!==e)throw t((t=(0,dR.newError)("Driver is connected to a database that does not support user notification filters. Please upgrade to Neo4j 5.7.0 or later in order to use this functionality. "+"Trying to set notifications to ".concat(dR.json.stringify(e),"."))).message),r.onError(t),t};var Q_={},Ef={},Oy={},hR=(Object.defineProperty(Oy,"__esModule",{value:!0}),Oy.verifyStructSize=Oy.Structure=void 0,e),bR=hR.error.PROTOCOL_ERROR,sv=(Object.defineProperty(yR.prototype,"size",{get:function(){return this.fields.length},enumerable:!1,configurable:!0}),yR.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+"])"},yR);function yR(e,t){this.signature=e,this.fields=t}Oy.Structure=sv,Oy.verifyStructSize=function(e,t,r){if(t!==r)throw(0,hR.newError)("Wrong struct size for ".concat(e,", expected ").concat(t," but was ").concat(r),bR)},Oy.default=sv,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.Unpacker=Ef.Packer=void 0;var _R=Ep,vR=Gy,mR=Oy,gR=e,OR=gR.error.PROTOCOL_ERROR;function wR(e){this._ch=e,this._byteArraysSupported=!0}function ER(e,t){void 0===t&&(t=!1),this._disableLosslessIntegers=e=void 0===e?!1:e,this._useBigInt=t}wR.prototype.packable=function(o,i){var e,u=this;void 0===i&&(i=vR.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,gR.int)(o))};if((0,gR.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 mR.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))},wR.prototype.packableIterable=function(t,e){try{var r=Array.from(t);return this.packable(r,e)}catch(e){throw(0,gR.newError)("Cannot pack given iterable, ".concat(e.message,": ").concat(t))}},wR.prototype.packStruct=function(e,t){this.packStructHeader((t=t||[]).length,e);for(var r=0;r<t.length;r++)t[r]()},wR.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))},wR.prototype.packFloat=function(e){this._ch.writeUInt8(193),this._ch.writeFloat64(e)},wR.prototype.packString=function(e){var e=_R.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,gR.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)}},wR.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,gR.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)}},wR.prototype.packBytes=function(e){if(!this._byteArraysSupported)throw(0,gR.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])},wR.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,gR.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)}},wR.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,gR.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)}},wR.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,gR.newError)("Structures of size "+e+" are not supported");this._ch.writeUInt8(221),this._ch.writeUInt8(e/256>>0),this._ch.writeUInt8(e%256)}},wR.prototype.disableByteArrays=function(){this._byteArraysSupported=!1},wR.prototype._nonPackableValue=function(e){return function(){throw(0,gR.newError)(e,OR)}},Ef.Packer=wR,ER.prototype.unpack=function(e,t){void 0===t&&(t=vR.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,gR.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,gR.newError)("Unknown packed value with marker "+r.toString(16))},ER.prototype.unpackInteger=function(e){var t=e.readUInt8(),e=this._unpackInteger(t,e);if(null==e)throw(0,gR.newError)("Unable to unpack integer value with marker "+t.toString(16));return e},ER.prototype._unpackBoolean=function(e){return 195===e||194!==e&&null},ER.prototype._unpackNumberOrInteger=function(e,t){return 193===e?t.readFloat64():this._unpackInteger(e,t)},ER.prototype._unpackInteger=function(e,t){var r;return 0<=e&&e<128?(0,gR.int)(e):240<=e&&e<256?(0,gR.int)(e-256):200===e?(0,gR.int)(t.readInt8()):201===e?(0,gR.int)(t.readInt16()):202===e?(r=t.readInt32(),(0,gR.int)(r)):203===e?(r=t.readInt32(),e=t.readInt32(),new gR.Integer(e,r)):null},ER.prototype._unpackString=function(e,t,r,n){return 128===t?_R.utf8.decode(n,r):208===e?_R.utf8.decode(n,n.readUInt8()):209===e?_R.utf8.decode(n,n.readUInt16()):210===e?_R.utf8.decode(n,n.readUInt32()):null},ER.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},ER.prototype._unpackListWithSize=function(e,t,r){for(var n=[],o=0;o<e;o++)n.push(this.unpack(t,r));return n},ER.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},ER.prototype._unpackByteArrayWithSize=function(e,t){for(var r=new Int8Array(e),n=0;n<e;n++)r[n]=t.readInt8();return r},ER.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},ER.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},ER.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},ER.prototype._unpackStructWithSize=function(e,t,r){for(var n=t.readUInt8(),o=new mR.Structure(n,[]),i=0;i<e;i++)o.fields.push(this.unpack(t,r));return r(o)},Ef.Unpacker=ER;var PR,SR,pv={},wv=r&&r.__extends||(PR=function(e,t){return(PR=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}PR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),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}),up=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},bv=(Object.defineProperty(pv,"__esModule",{value:!0}),pv.Unpacker=pv.Packer=void 0,up(Ef)),ap=(SR=bv.Packer,wv(CR,SR),CR.prototype.disableByteArrays=function(){throw new Error("Bolt V2 should always support byte arrays")},CR);function CR(){return null!==SR&&SR.apply(this,arguments)||this}pv.Packer=ap;RR=bv.Unpacker,wv(IR,RR);var RR,yv=IR;function IR(e,t){return RR.call(this,e=void 0===e?!1:e,t=void 0===t?!1:t)||this}pv.Unpacker=yv;var AR=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]}),kR=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mv=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)&&AR(t,e,r);return kR(t,e),t},sp=(Object.defineProperty(Q_,"__esModule",{value:!0}),Q_.structure=Q_.v2=Q_.v1=void 0,mv(Ef)),Mv=(Q_.v1=sp,mv(pv)),Dv=(Q_.v2=Mv,mv(Oy)),w=(Q_.structure=Dv,Q_.default=Mv,{}),MR=(Object.defineProperty(w,"__esModule",{value:!0}),w.SIGNATURES=void 0,e),Bv=MR.internal.constants,NR=Bv.ACCESS_MODE_READ,xR=Bv.FETCH_ALL,DR=MR.internal.util.assertString,Gv=Object.freeze({INIT:1,RESET:15,RUN:16,PULL_ALL:63,HELLO:1,GOODBYE:2,BEGIN:17,COMMIT:18,ROLLBACK:19,TELEMETRY:84,ROUTE:102,LOGON:106,LOGOFF:107,DISCARD:47,PULL:63}),pn=(w.SIGNATURES=Gv,N.init=function(e,t){return new N(1,[e,t],function(){return"INIT ".concat(e," {...}")})},N.run=function(e,t){return new N(16,[e,t],function(){return"RUN ".concat(e," ").concat(MR.json.stringify(t))})},N.pullAll=function(){return WR},N.reset=function(){return qR},N.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 N(1,[t],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},N.hello5x1=function(e,t){var r={user_agent:e};return(t=void 0===t?null:t)&&(r.routing=t),new N(1,[r],function(){return"HELLO {user_agent: '".concat(e,"', ...}")})},N.hello5x2=function(e,t,r){void 0===r&&(r=null);var n={user_agent:e};return FR(n,t=void 0===t?null:t),r&&(n.routing=r),new N(1,[n],function(){return"HELLO ".concat(MR.json.stringify(n))})},N.hello5x3=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o={};return e&&(o.user_agent=e),t&&(o.bolt_agent={product:t.product,platform:t.platform,language:t.language,language_details:t.languageDetails}),FR(o,r),n&&(o.routing=n),new N(1,[o],function(){return"HELLO ".concat(MR.json.stringify(o))})},N.hello5x5=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=null);var o={};return e&&(o.user_agent=e),t&&(o.bolt_agent={product:t.product,platform:t.platform,language:t.language,language_details:t.languageDetails}),BR(o,r),n&&(o.routing=n),new N(1,[o],function(){return"HELLO ".concat(MR.json.stringify(o))})},N.logon=function(e){return new N(106,[e],function(){return"LOGON { ... }"})},N.logoff=function(){return new N(107,[],function(){return"LOGOFF"})},N.begin=function(e){var e=void 0===e?{}:e,t=LR(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter);return new N(17,[t],function(){return"BEGIN ".concat(MR.json.stringify(t))})},N.begin5x5=function(e){var e=void 0===e?{}:e,t=LR(e.bookmarks,e.txConfig,e.database,e.mode,e.impersonatedUser,e.notificationFilter,{appendNotificationFilter:BR});return new N(17,[t],function(){return"BEGIN ".concat(MR.json.stringify(t))})},N.commit=function(){return zR},N.rollback=function(){return VR},N.runWithMetadata=function(e,t,r){var r=void 0===r?{}:r,n=LR(r.bookmarks,r.txConfig,r.database,r.mode,r.impersonatedUser,r.notificationFilter);return new N(16,[e,t,n],function(){return"RUN ".concat(e," ").concat(MR.json.stringify(t)," ").concat(MR.json.stringify(n))})},N.runWithMetadata5x5=function(e,t,r){var r=void 0===r?{}:r,n=LR(r.bookmarks,r.txConfig,r.database,r.mode,r.impersonatedUser,r.notificationFilter,{appendNotificationFilter:BR});return new N(16,[e,t,n],function(){return"RUN ".concat(e," ").concat(MR.json.stringify(t)," ").concat(MR.json.stringify(n))})},N.goodbye=function(){return HR},N.pull=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=UR(null==t?-1:t,(void 0===e?xR:e)||xR);return new N(63,[r],function(){return"PULL ".concat(MR.json.stringify(r))})},N.discard=function(e){var e=void 0===e?{}:e,t=e.stmtId,t=void 0===t?-1:t,e=e.n,r=UR(null==t?-1:t,(void 0===e?xR:e)||xR);return new N(47,[r],function(){return"DISCARD ".concat(MR.json.stringify(r))})},N.telemetry=function(e){var e=e.api,t=(0,MR.int)(e);return new N(84,[t],function(){return"TELEMETRY ".concat(t.toString())})},N.route=function(e,t,r){return new N(102,[e=void 0===e?{}:e,t=void 0===t?[]:t,r=void 0===r?null:r],function(){return"ROUTE ".concat(MR.json.stringify(e)," ").concat(MR.json.stringify(t)," ").concat(r)})},N.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 N(102,[e,t,n],function(){return"ROUTE ".concat(MR.json.stringify(e)," ").concat(MR.json.stringify(t)," ").concat(MR.json.stringify(n))})},N);function N(e,t,r){this.signature=e,this.fields=t,this.toString=r}function LR(e,t,r,n,o,i,u){void 0===u&&(u={});var a={};return e.isEmpty()||(a.bookmarks=e.values()),null!==t.timeout&&(a.tx_timeout=t.timeout),t.metadata&&(a.tx_metadata=t.metadata),r&&(a.db=DR(r,"database")),o&&(a.imp_user=DR(o,"impersonatedUser")),n===NR&&(a.mode="r"),(null!=(e=u.appendNotificationFilter)?e:FR)(a,i),a}function UR(e,t){t={n:(0,MR.int)(t)};return-1!==e&&(t.qid=(0,MR.int)(e)),t}function FR(e,t){t&&(t.minimumSeverityLevel&&(e.notifications_minimum_severity=t.minimumSeverityLevel),t.disabledCategories&&(e.notifications_disabled_categories=t.disabledCategories),t.disabledClassifications&&(e.notifications_disabled_categories=t.disabledClassifications))}function BR(e,t){t&&(t.minimumSeverityLevel&&(e.notifications_minimum_severity=t.minimumSeverityLevel),t.disabledCategories&&(e.notifications_disabled_classifications=t.disabledCategories),t.disabledClassifications&&(e.notifications_disabled_classifications=t.disabledClassifications))}var WR=new(w.default=pn)(63,[],function(){return"PULL_ALL"}),qR=new pn(15,[],function(){return"RESET"}),zR=new pn(18,[],function(){return"COMMIT"}),VR=new pn(19,[],function(){return"ROLLBACK"}),HR=new pn(2,[],function(){return"GOODBYE"}),Zv={},Xv={},GR=(Object.defineProperty(Xv,"__esModule",{value:!0}),Xv.TypeTransformer=void 0,Q_),YR=e.internal.objectUtil;function KR(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 ZR(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)}KR.prototype.fromStructure=function(e){try{return e instanceof GR.structure.Structure&&this._transformersPerSignature.has(e.signature)?(0,this._transformersPerSignature.get(e.signature).fromStructure)(e):e}catch(e){return YR.createBrokenObject(e)}},KR.prototype.toStructure=function(t){var e=this._transformers.find(function(e){return(0,e.isTypeInstance)(t)});return void 0!==e?e.toStructure(t):t},Xv.default=KR,ZR.prototype.extendsWith=function(e){var t=e.signature,r=e.fromStructure,n=e.toStructure,e=e.isTypeInstance;return new ZR({signature:t||this.signature,fromStructure:r||this.fromStructure,toStructure:n||this.toStructure,isTypeInstance:e||this.isTypeInstance})},Xv.TypeTransformer=ZR;var QR=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},XR=(Object.defineProperty(Zv,"__esModule",{value:!0}),e),JR=Q_,$R=Xv,eI=XR.error.PROTOCOL_ERROR;Zv.default={createNodeTransformer:function(){return new $R.TypeTransformer({signature:78,isTypeInstance:function(e){return e instanceof XR.Node},toStructure:function(e){throw(0,XR.newError)("It is not allowed to pass nodes in query parameters, given: ".concat(e),eI)},fromStructure:function(e){JR.structure.verifyStructSize("Node",3,e.size);var e=QR(e.fields,3),t=e[0],r=e[1],e=e[2];return new XR.Node(t,r,e)}})},createRelationshipTransformer:function(){return new $R.TypeTransformer({signature:82,isTypeInstance:function(e){return e instanceof XR.Relationship},toStructure:function(e){throw(0,XR.newError)("It is not allowed to pass relationships in query parameters, given: ".concat(e),eI)},fromStructure:function(e){JR.structure.verifyStructSize("Relationship",5,e.size);var e=QR(e.fields,5),t=e[0],r=e[1],n=e[2],o=e[3],e=e[4];return new XR.Relationship(t,r,n,o,e)}})},createUnboundRelationshipTransformer:function(){return new $R.TypeTransformer({signature:114,isTypeInstance:function(e){return e instanceof XR.UnboundRelationship},toStructure:function(e){throw(0,XR.newError)("It is not allowed to pass unbound relationships in query parameters, given: ".concat(e),eI)},fromStructure:function(e){JR.structure.verifyStructSize("UnboundRelationship",3,e.size);var e=QR(e.fields,3),t=e[0],r=e[1],e=e[2];return new XR.UnboundRelationship(t,r,e)}})},createPathTransformer:function(){return new $R.TypeTransformer({signature:80,isTypeInstance:function(e){return e instanceof XR.Path},toStructure:function(e){throw(0,XR.newError)("It is not allowed to pass paths in query parameters, given: ".concat(e),eI)},fromStructure:function(e){JR.structure.verifyStructSize("Path",3,e.size);for(var e=QR(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,XR.toNumber)(n[u]),c=void 0;0<s?(c=r[s-1])instanceof XR.UnboundRelationship&&(r[s-1]=c=c.bindTo(i,a)):(c=r[-s-1])instanceof XR.UnboundRelationship&&(r[-s-1]=c=c.bindTo(a,i)),o.push(new XR.PathSegment(i,c,a)),i=a}return new XR.Path(t[0],t[t.length-1],o)}})}};var tI=r&&r.__assign||function(){return(tI=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)},rI=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]}),nI=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tm=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)&&rI(t,e,r);return nI(t,e),t},om=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},oI=(Object.defineProperty(iy,"__esModule",{value:!0}),cy),iI=Q_,uI=tm(w),aI=A,sI=e,cI=om(Zv),lI=om(Xv),fI=sI.internal.bookmarks.Bookmarks,am=sI.internal.constants,pI=am.ACCESS_MODE_WRITE,dI=am.BOLT_PROTOCOL_V1,hI=(sI.internal.logger.Logger,sI.internal.txConfig.TxConfig),bI=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),it=(Object.defineProperty(yI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new lI.default(Object.values(cI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(yI.prototype,"version",{get:function(){return dI},enumerable:!1,configurable:!0}),Object.defineProperty(yI.prototype,"supportsReAuth",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(yI.prototype,"initialized",{get:function(){return!!this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(yI.prototype,"authToken",{get:function(){return this._authToken},enumerable:!1,configurable:!0}),yI.prototype.packer=function(){return this._packer},yI.prototype.packable=function(e){return this._packer.packable(e,this.transformer.toStructure)},yI.prototype.unpacker=function(){return this._unpacker},yI.prototype.unpack=function(e){return this._unpacker.unpack(e,this.transformer.fromStructure)},yI.prototype.transformMetadata=function(e){return e},yI.prototype.enrichErrorMetadata=function(e){return tI(tI({},e),{diagnostic_record:null!==e.diagnostic_record?tI(tI({},bI),e.diagnostic_record):null})},yI.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new aI.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,u)}});return(0,oI.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(uI.default.init(r,n),e,!0),e},yI.prototype.logoff=function(e){var e=void 0===e?{}:e,t=e.onComplete,r=e.onError,e=(e.flush,new aI.LogoffObserver({onCompleted:t,onError:r})),t=(0,sI.newError)("Driver is connected to a database that does not support logoff. Please upgrade to Neo4j 5.5.0 or later in order to use this functionality.");throw this._onProtocolError(t.message),e.onError(t),t},yI.prototype.logon=function(e){var t=this,e=void 0===e?{}:e,r=e.authToken,n=e.onComplete,o=e.onError,e=(e.flush,new aI.LoginObserver({onCompleted:function(){return t._onLoginCompleted({},r,n)},onError:function(e){return t._onLoginError(e,o)}})),i=(0,sI.newError)("Driver is connected to a database that does not support logon. Please upgrade to Neo4j 5.5.0 or later in order to use this functionality.");throw this._onProtocolError(i.message),e.onError(i),i},yI.prototype.prepareToClose=function(){},yI.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.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete;return this.run("BEGIN",t?t.asBeginTransactionParameters():{},{bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e,flush:!1})},yI.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:fI.empty(),txConfig:hI.empty(),mode:pI,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},yI.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:fI.empty(),txConfig:hI.empty(),mode:pI,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e})},yI.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.notificationFilter,a=r.beforeKeys,s=r.afterKeys,c=r.beforeError,l=r.afterError,f=r.beforeComplete,p=r.afterComplete,d=r.flush,d=void 0===d||d,h=r.highRecordWatermark,h=void 0===h?Number.MAX_VALUE:h,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,a=new aI.ResultStreamObserver({server:this._server,beforeKeys:a,afterKeys:s,beforeError:c,afterError:l,beforeComplete:f,afterComplete:p,highRecordWatermark:h,lowRecordWatermark:r});return(0,oI.assertTxConfigIsEmpty)(n,this._onProtocolError,a),(0,oI.assertDatabaseIsEmpty)(o,this._onProtocolError,a),(0,oI.assertImpersonatedUserIsEmpty)(i,this._onProtocolError,a),(0,oI.assertNotificationFilterIsEmpty)(u,this._onProtocolError,a),this.write(uI.default.run(e,t),a,!1),this.write(uI.default.pullAll(),a,d),a},Object.defineProperty(yI.prototype,"currentFailure",{get:function(){return this._responseHandler.currentFailure},enumerable:!1,configurable:!0}),yI.prototype.reset=function(e){var e=void 0===e?{}:e,t=e.onError,e=e.onComplete,t=new aI.ResetObserver({onProtocolError:this._onProtocolError,onError:t,onComplete:e});return this.write(uI.default.reset(),t,!0),t},yI.prototype.telemetry=function(e,t){e.api;e=void 0===t?{}:t,e.onError,t=e.onCompleted,e=new aI.CompletedObserver;return t&&t(),e},yI.prototype._createPacker=function(e){return new iI.v1.Packer(e)},yI.prototype._createUnpacker=function(e,t){return new iI.v1.Unpacker(e,t)},yI.prototype.write=function(e,t,r){this.queueObserverIfProtocolIsNotBroken(t)&&(this._log.isDebugEnabled()&&this._log.debug("C: ".concat(e)),this._lastMessageSignature=e.signature,t=new iI.structure.Structure(e.signature,e.fields),this.packable(t)(),this._chunker.messageBoundary(),r&&this._chunker.flush())},yI.prototype.isLastMessageLogon=function(){return this._lastMessageSignature===uI.SIGNATURES.HELLO||this._lastMessageSignature===uI.SIGNATURES.LOGON},yI.prototype.isLastMessageReset=function(){return this._lastMessageSignature===uI.SIGNATURES.RESET},yI.prototype.notifyFatalError=function(e){return this._fatalError=e,this._responseHandler._notifyErrorToObservers(e)},yI.prototype.updateCurrentObserver=function(){return this._responseHandler._updateCurrentObserver()},yI.prototype.hasOngoingObservableRequests=function(){return this._responseHandler.hasOngoingObservableRequests()},yI.prototype.queueObserverIfProtocolIsNotBroken=function(e){return this.isBroken()?(this.notifyFatalErrorToObserver(e),!1):this._responseHandler._queueObserver(e)},yI.prototype.isBroken=function(){return!!this._fatalError},yI.prototype.notifyFatalErrorToObserver=function(e){e&&e.onError&&e.onError(this._fatalError)},yI.prototype.resetFailure=function(){this._responseHandler._resetFailure()},yI.prototype._onLoginCompleted=function(e,t,r){this._initialized=!0,this._authToken=t,e&&(t=e.server,this._server.version||(this._server.version=t)),r&&r(e)},yI.prototype._onLoginError=function(e,t){this._onProtocolError(e.message),t&&t(e)},yI);function yI(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}}iy.default=it;var fm={},eb={},_m={},_I=(Object.defineProperty(_m,"__esModule",{value:!0}),_m.epochSecondAndNanoToLocalDateTime=_m.nanoOfDayToLocalTime=_m.epochDayToDate=void 0,e),Em=_I.internal.temporalUtil,vI=Em.DAYS_0000_TO_1970,mI=Em.DAYS_PER_400_YEAR_CYCLE,gI=Em.NANOS_PER_HOUR,OI=Em.NANOS_PER_MINUTE,wI=Em.NANOS_PER_SECOND,EI=Em.SECONDS_PER_DAY,PI=Em.floorDiv,SI=Em.floorMod;function TI(e){var e=(e=(0,_I.int)(e)).add(vI).subtract(60),t=(0,_I.int)(0),r=(e.lessThan(0)&&(t=(r=e.add(1).div(mI).subtract(1)).multiply(400),e=e.add(r.multiply(-mI))),e.multiply(400).add(591).div(mI)),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 _I.Date(r,n,e)}function jI(e){var t=(e=(0,_I.int)(e)).div(gI),r=(e=e.subtract(t.multiply(gI))).div(OI),n=(e=e.subtract(r.multiply(OI))).div(wI),e=e.subtract(n.multiply(wI));return new _I.LocalTime(t,r,n,e)}_m.epochDayToDate=TI,_m.nanoOfDayToLocalTime=jI,_m.epochSecondAndNanoToLocalDateTime=function(e,t){var r=PI(e,EI),e=SI(e,EI).multiply(wI).add(t),t=TI(r),r=jI(e);return new _I.LocalDateTime(t.year,t.month,t.day,r.hour,r.minute,r.second,r.nanosecond)};var CI=r&&r.__assign||function(){return(CI=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)},RI=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},Cm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},II=(Object.defineProperty(eb,"__esModule",{value:!0}),e),AI=Q_,kI=Xv,MI=_m,Nm=Cm(Zv),C=II.internal.temporalUtil,NI=C.dateToEpochDay,xI=C.localDateTimeToEpochSecond,DI=C.localTimeToNanoOfDay;function LI(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,II.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}eb.default=CI(CI({},Nm.default),{createPoint2DTransformer:function(){return new kI.TypeTransformer({signature:88,isTypeInstance:function(e){return(0,II.isPoint)(e)&&(null===e.z||void 0===e.z)},toStructure:function(e){return new AI.structure.Structure(88,[(0,II.int)(e.srid),e.x,e.y])},fromStructure:function(e){AI.structure.verifyStructSize("Point2D",3,e.size);var e=RI(e.fields,3),t=e[0],r=e[1],e=e[2];return new II.Point(t,r,e,void 0)}})},createPoint3DTransformer:function(){return new kI.TypeTransformer({signature:89,isTypeInstance:function(e){return(0,II.isPoint)(e)&&null!==e.z&&void 0!==e.z},toStructure:function(e){return new AI.structure.Structure(89,[(0,II.int)(e.srid),e.x,e.y,e.z])},fromStructure:function(e){AI.structure.verifyStructSize("Point3D",4,e.size);var e=RI(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new II.Point(t,r,n,e)}})},createDurationTransformer:function(){return new kI.TypeTransformer({signature:69,isTypeInstance:II.isDuration,toStructure:function(e){var t=(0,II.int)(e.months),r=(0,II.int)(e.days),n=(0,II.int)(e.seconds),e=(0,II.int)(e.nanoseconds);return new AI.structure.Structure(69,[t,r,n,e])},fromStructure:function(e){AI.structure.verifyStructSize("Duration",4,e.size);var e=RI(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new II.Duration(t,r,n,e)}})},createLocalTimeTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new kI.TypeTransformer({signature:116,isTypeInstance:II.isLocalTime,toStructure:function(e){e=DI(e.hour,e.minute,e.second,e.nanosecond);return new AI.structure.Structure(116,[e])},fromStructure:function(e){AI.structure.verifyStructSize("LocalTime",1,e.size);e=RI(e.fields,1)[0];return LI((0,MI.nanoOfDayToLocalTime)(e),t,r)}})},createTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new kI.TypeTransformer({signature:84,isTypeInstance:II.isTime,toStructure:function(e){var t=DI(e.hour,e.minute,e.second,e.nanosecond),e=(0,II.int)(e.timeZoneOffsetSeconds);return new AI.structure.Structure(84,[t,e])},fromStructure:function(e){AI.structure.verifyStructSize("Time",2,e.size);var e=RI(e.fields,2),t=e[0],e=e[1],t=(0,MI.nanoOfDayToLocalTime)(t);return LI(new II.Time(t.hour,t.minute,t.second,t.nanosecond,e),r,n)}})},createDateTransformer:function(e){var t=e.disableLosslessIntegers,r=e.useBigInt;return new kI.TypeTransformer({signature:68,isTypeInstance:II.isDate,toStructure:function(e){e=NI(e.year,e.month,e.day);return new AI.structure.Structure(68,[e])},fromStructure:function(e){AI.structure.verifyStructSize("Date",1,e.size);e=RI(e.fields,1)[0];return LI((0,MI.epochDayToDate)(e),t,r)}})},createLocalDateTimeTransformer:function(e){var r=e.disableLosslessIntegers,n=e.useBigInt;return new kI.TypeTransformer({signature:100,isTypeInstance:II.isLocalDateTime,toStructure:function(e){var t=xI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),e=(0,II.int)(e.nanosecond);return new AI.structure.Structure(100,[t,e])},fromStructure:function(e){AI.structure.verifyStructSize("LocalDateTime",2,e.size);var e=RI(e.fields,2),t=e[0],e=e[1];return LI((0,MI.epochSecondAndNanoToLocalDateTime)(t,e),r,n)}})},createDateTimeWithZoneIdTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return new kI.TypeTransformer({signature:102,isTypeInstance:function(e){return(0,II.isDateTime)(e)&&null!=e.timeZoneId},toStructure:function(e){var t=xI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,II.int)(e.nanosecond),e=e.timeZoneId;return new AI.structure.Structure(102,[t,r,e])},fromStructure:function(e){AI.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=RI(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,MI.epochSecondAndNanoToLocalDateTime)(t,r);return LI(new II.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 kI.TypeTransformer({signature:70,isTypeInstance:function(e){return(0,II.isDateTime)(e)&&null==e.timeZoneId},toStructure:function(e){var t=xI(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,II.int)(e.nanosecond),e=(0,II.int)(e.timeZoneOffsetSeconds);return new AI.structure.Structure(70,[t,r,e])},fromStructure:function(e){AI.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=RI(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,MI.epochSecondAndNanoToLocalDateTime)(t,r);return LI(new II.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}});var UI,FI,Fm=r&&r.__extends||(UI=function(e,t){return(UI=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}UI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Vm=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Km=(Object.defineProperty(fm,"__esModule",{value:!0}),Vm(iy)),BI=Vm(Q_),tb=e,WI=Vm(eb),qI=Vm(Xv),zI=tb.internal.constants.BOLT_PROTOCOL_V2,t0=(FI=Km.default,Fm(VI,FI),VI.prototype._createPacker=function(e){return new BI.default.Packer(e)},VI.prototype._createUnpacker=function(e,t){return new BI.default.Unpacker(e,t)},Object.defineProperty(VI.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new qI.default(Object.values(WI.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(VI.prototype,"version",{get:function(){return zI},enumerable:!1,configurable:!0}),VI);function VI(){return null!==FI&&FI.apply(this,arguments)||this}fm.default=t0;var HI,GI,c0={},p0={},YI=r&&r.__assign||function(){return(YI=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)},v0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},g0=(Object.defineProperty(p0,"__esModule",{value:!0}),v0(eb)),P0=(p0.default=YI({},g0.default),r&&r.__extends||(HI=function(e,t){return(HI=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}HI(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),KI=r&&r.__assign||function(){return(KI=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)},R0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},k0=(Object.defineProperty(c0,"__esModule",{value:!0}),R0(fm)),ZI=R0(w),QI=cy,XI=A,JI=R0(p0),$I=R0(Xv),eA=(e.internal.bookmarks.Bookmarks,e.internal.constants.BOLT_PROTOCOL_V3),tA=e.internal.txConfig.TxConfig,rA="context",nA="CALL dbms.cluster.routing.getRoutingTable($".concat(rA,")"),oA=new XI.StreamObserver,yl=(GI=k0.default,P0(iA,GI),Object.defineProperty(iA.prototype,"version",{get:function(){return eA},enumerable:!1,configurable:!0}),Object.defineProperty(iA.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}),iA.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},iA.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new XI.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,QI.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(ZI.default.hello(r,n),e,!0),e},iA.prototype.prepareToClose=function(){this.write(ZI.default.goodbye(),oA,!0)},iA.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.notificationFilter,u=e.mode,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new XI.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),(0,QI.assertDatabaseIsEmpty)(n,this._onProtocolError,a),(0,QI.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,a),(0,QI.assertNotificationFilterIsEmpty)(i,this._onProtocolError,a),this.write(ZI.default.begin({bookmarks:t,txConfig:r,mode:u}),a,!0),a},iA.prototype.commitTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete,t=new XI.ResultStreamObserver({server:this._server,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e});return t.prepareToHandleSingleResponse(),this.write(ZI.default.commit(),t,!0),t},iA.prototype.rollbackTransaction=function(e){var e=void 0===e?{}:e,t=e.beforeError,r=e.afterError,n=e.beforeComplete,e=e.afterComplete,t=new XI.ResultStreamObserver({server:this._server,beforeError:t,afterError:r,beforeComplete:n,afterComplete:e});return t.prepareToHandleSingleResponse(),this.write(ZI.default.rollback(),t,!0),t},iA.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.notificationFilter,s=r.mode,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.highRecordWatermark,y=void 0===y?Number.MAX_VALUE:y,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new XI.ResultStreamObserver({server:this._server,beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:y,lowRecordWatermark:r});return(0,QI.assertDatabaseIsEmpty)(i,this._onProtocolError,c),(0,QI.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,c),(0,QI.assertNotificationFilterIsEmpty)(a,this._onProtocolError,c),this.write(ZI.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,mode:s}),c,!1),this.write(ZI.default.pullAll(),c,b),c},iA.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(nA,((t={})[rA]=void 0===r?{}:r,t),KI(KI({},n),{txConfig:tA.empty()}));return new XI.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:o,onCompleted:e})},iA);function iA(){return null!==GI&&GI.apply(this,arguments)||this}c0.default=yl;var uA,aA,D0={},L0={},sA=r&&r.__assign||function(){return(sA=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)},z0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},G0=(Object.defineProperty(L0,"__esModule",{value:!0}),z0(p0)),dy=(L0.default=sA({},G0.default),r&&r.__extends||(uA=function(e,t){return(uA=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}uA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),cA=r&&r.__assign||function(){return(cA=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)},X_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Z0=(Object.defineProperty(D0,"__esModule",{value:!0}),X_(c0)),lA=X_(w),fA=cy,pA=A,dA=X_(L0),hA=X_(Xv),eg=(e.internal.bookmarks.Bookmarks,e.internal.constants),bA=eg.BOLT_PROTOCOL_V4_0,yA=eg.FETCH_ALL,_A=e.internal.txConfig.TxConfig,vA="context",mA="database",gA="CALL dbms.routing.getRoutingTable($".concat(vA,", $").concat(mA,")"),ng=(aA=Z0.default,dy(OA,aA),Object.defineProperty(OA.prototype,"version",{get:function(){return bA},enumerable:!1,configurable:!0}),Object.defineProperty(OA.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new hA.default(Object.values(dA.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),OA.prototype.beginTransaction=function(e){var e=void 0===e?{}:e,t=e.bookmarks,r=e.txConfig,n=e.database,o=e.impersonatedUser,i=e.notificationFilter,u=e.mode,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new pA.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),(0,fA.assertImpersonatedUserIsEmpty)(o,this._onProtocolError,a),(0,fA.assertNotificationFilterIsEmpty)(i,this._onProtocolError,a),this.write(lA.default.begin({bookmarks:t,txConfig:r,database:n,mode:u}),a,!0),a},OA.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.notificationFilter,s=r.mode,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?yA:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new pA.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=((0,fA.assertImpersonatedUserIsEmpty)(u,this._onProtocolError,c),(0,fA.assertNotificationFilterIsEmpty)(a,this._onProtocolError,c),y);return this.write(lA.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:s}),c,l&&b),y||this.write(lA.default.pull({n:_}),c,b),c},OA.prototype._requestMore=function(e,t,r){this.write(lA.default.pull({stmtId:e,n:t}),r,!0)},OA.prototype._requestDiscard=function(e,t){this.write(lA.default.discard({stmtId:e}),t,!0)},OA.prototype._noOp=function(){},OA.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(gA,((t={})[vA]=void 0===r?{}:r,t[mA]=n,t),cA(cA({},o),{txConfig:_A.empty()}));return new pA.ProcedureRouteObserver({resultObserver:r,onProtocolError:this._onProtocolError,onError:i,onCompleted:e})},OA);function OA(){return null!==aA&&aA.apply(this,arguments)||this}D0.default=ng;var wA,EA,E={},fg={},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)},Zy=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bg=(Object.defineProperty(fg,"__esModule",{value:!0}),Zy(L0)),Bc=(fg.default=PA({},bg.default),r&&r.__extends||(wA=function(e,t){return(wA=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}wA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),gg=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Sl=(Object.defineProperty(E,"__esModule",{value:!0}),gg(D0)),SA=gg(w),TA=A,$h=e,jA=cy,CA=gg(fg),RA=gg(Xv),IA=$h.internal.constants.BOLT_PROTOCOL_V4_1,u=(EA=Sl.default,Bc(AA,EA),Object.defineProperty(AA.prototype,"version",{get:function(){return IA},enumerable:!1,configurable:!0}),Object.defineProperty(AA.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new RA.default(Object.values(CA.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),AA.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new TA.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,jA.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(SA.default.hello(r,n,this._serversideRouting),e,!0),e},AA);function AA(e,t,r,n,o,i,u){e=EA.call(this,e,t,r,n=void 0===n?function(){return null}:n,o,i)||this;return e._serversideRouting=u,e}E.default=u;var kA,MA,Ag={},Dg={},NA=r&&r.__assign||function(){return(NA=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)},pl=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},v=(Object.defineProperty(Dg,"__esModule",{value:!0}),pl(fg)),nO=(Dg.default=NA({},v.default),r&&r.__extends||(kA=function(e,t){return(kA=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}kA(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}},j=(Object.defineProperty(Ag,"__esModule",{value:!0}),i(E)),R=e,xA=i(Dg),DA=i(Xv),LA=R.internal.constants.BOLT_PROTOCOL_V4_2,n=(MA=j.default,nO(UA,MA),Object.defineProperty(UA.prototype,"version",{get:function(){return LA},enumerable:!1,configurable:!0}),Object.defineProperty(UA.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new DA.default(Object.values(xA.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),UA);function UA(){return null!==MA&&MA.apply(this,arguments)||this}Ag.default=n;var s={},b={},FA=r&&r.__assign||function(){return(FA=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)},Y=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=(Object.defineProperty(b,"__esModule",{value:!0}),Y(Dg)),Fs=(b.default=FA({},o.default),{}),S={},BA=r&&r.__assign||function(){return(BA=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}},Zs=(Object.defineProperty(S,"__esModule",{value:!0}),$s(b)),WA=(S.default=BA({},Zs.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}),m=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},qA=(Object.defineProperty(Fs,"__esModule",{value:!0}),Q_),zA=e,VA=m(S),HA=_m,GA=Ky,YA=zA.internal.temporalUtil.localDateTimeToEpochSecond;var KA=new Map;function ZA(e,t,r){e=e,KA.has(e)||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,era:"narrow"}),KA.set(e,n));var n=KA.get(e),e=(0,zA.int)(t).multiply(1e3).add((0,zA.int)(r).div(1e6)).toNumber(),r=n.formatToParts(e).reduce(function(e,t){return"era"===t.type?e.adjustEra="B"===t.value.toUpperCase()?function(e){return e.subtract(1).negate()}:GA.identity:"hour"===t.type?e.hour=(0,zA.int)(t.value).modulo(24):"literal"!==t.type&&(e[t.type]=(0,zA.int)(t.value)),e},{}),e=(r.year=r.adjustEra(r.year),YA(r.year,r.month,r.day,r.hour,r.minute,r.second,r.nanosecond));return r.timeZoneOffsetSeconds=e.subtract(t),r.hour=r.hour.modulo(24),r}function QA(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,zA.isInt)(o)?(i=o,r?i.toBigInt():i.toNumberOrInfinity()):o);return Object.freeze(u),u}Fs.default={createDateTimeWithZoneIdTransformer:function(e,u){var n=e.disableLosslessIntegers,o=e.useBigInt;return VA.default.createDateTimeWithZoneIdTransformer(e).extendsWith({signature:105,fromStructure:function(e){qA.structure.verifyStructSize("DateTimeWithZoneId",3,e.size);var e=WA(e.fields,3),t=e[0],r=e[1],e=e[2],t=ZA(e,t,r);return QA(new zA.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,(0,zA.int)(r),t.timeZoneOffsetSeconds,e),n,o)},toStructure:function(e){var t=YA(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=ZA(r,i,o),n=YA(n.year,n.month,n.day,n.hour,n.minute,n.second,o).subtract(i),i=i.subtract(n),n=ZA(r,i,o),YA(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,zA.int)(e.nanosecond),i=e.timeZoneId;return new qA.structure.Structure(105,[n,o,i])}})},createDateTimeWithOffsetTransformer:function(e){var n=e.disableLosslessIntegers,o=e.useBigInt;return VA.default.createDateTimeWithOffsetTransformer(e).extendsWith({signature:73,toStructure:function(e){var t=YA(e.year,e.month,e.day,e.hour,e.minute,e.second,e.nanosecond),r=(0,zA.int)(e.nanosecond),e=(0,zA.int)(e.timeZoneOffsetSeconds),t=t.subtract(e);return new qA.structure.Structure(73,[t,r,e])},fromStructure:function(e){qA.structure.verifyStructSize("DateTimeWithZoneOffset",3,e.size);var e=WA(e.fields,3),t=e[0],r=e[1],e=e[2],t=(0,zA.int)(t).add(e),t=(0,HA.epochSecondAndNanoToLocalDateTime)(t,r);return QA(new zA.DateTime(t.year,t.month,t.day,t.hour,t.minute,t.second,t.nanosecond,e,null),n,o)}})}};var XA,JA,hs=r&&r.__extends||(XA=function(e,t){return(XA=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}XA(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),$A=r&&r.__assign||function(){return($A=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)},Os=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Zr=(Object.defineProperty(s,"__esModule",{value:!0}),Os(Ag)),ek=Os(w),tk=A,rk=cy,nk=Os(b),ok=Os(Fs),ik=Os(Xv),uk=e.internal.bookmarks.Bookmarks,ak=e.internal.constants.BOLT_PROTOCOL_V4_3,c=(JA=Zr.default,hs(sk,JA),Object.defineProperty(sk.prototype,"version",{get:function(){return ak},enumerable:!1,configurable:!0}),Object.defineProperty(sk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new ik.default(Object.values(nk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),sk.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 tk.RouteObserver({onProtocolError:this._onProtocolError,onError:o,onCompleted:e}),e=n.bookmarks||uk.empty();return this.write(ek.default.route(t,e.values(),r),o,!0),o},sk.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new tk.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return void 0!==e.patch_bolt&&t._applyPatches(e.patch_bolt),t._onLoginCompleted(e,n,u)}});return(0,rk.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(ek.default.hello(r,n,this._serversideRouting,["utc"]),e,!0),e},sk.prototype._applyPatches=function(e){e.includes("utc")&&this._applyUtcPatch()},sk.prototype._applyUtcPatch=function(){var t=this;this._transformer=new ik.default(Object.values($A($A({},nk.default),ok.default)).map(function(e){return e(t._config,t._log)}))},sk);function sk(){return null!==JA&&JA.apply(this,arguments)||this}s.default=c;var ck,lk,Nc={},Nl=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)}),fk=r&&r.__assign||function(){return(fk=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)},f=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},jc=(Object.defineProperty(Nc,"__esModule",{value:!0}),f(s)),Ol=e,pk=f(w),dk=A,hk=cy,bk=f(S),yk=f(Fs),_k=f(Xv),Rc=Ol.internal.constants,vk=Rc.BOLT_PROTOCOL_V4_4,mk=Rc.FETCH_ALL,gk=Ol.internal.bookmarks.Bookmarks,xc=(lk=jc.default,Nl(Ok,lk),Object.defineProperty(Ok.prototype,"version",{get:function(){return vk},enumerable:!1,configurable:!0}),Object.defineProperty(Ok.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new _k.default(Object.values(bk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Ok.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 dk.RouteObserver({onProtocolError:this._onProtocolError,onError:i,onCompleted:e}),e=o.bookmarks||gk.empty();return this.write(pk.default.routeV4x4(t,e.values(),{databaseName:r,impersonatedUser:n}),i,!0),i},Ok.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.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?mk:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new dk.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=((0,hk.assertNotificationFilterIsEmpty)(s,this._onProtocolError,c),y);return this.write(pk.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a}),c,l&&b),y||this.write(pk.default.pull({n:_}),c,b),c},Ok.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.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new dk.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),(0,hk.assertNotificationFilterIsEmpty)(u,this._onProtocolError,a),this.write(pk.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i}),a,!0),a},Ok.prototype._applyUtcPatch=function(){var t=this;this._transformer=new _k.default(Object.values(fk(fk({},bk.default),yk.default)).map(function(e){return e(t._config,t._log)}))},Ok);function Ok(){return null!==lk&&lk.apply(this,arguments)||this}Nc.default=xc;var xr={},kc={},wk=r&&r.__assign||function(){return(wk=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)},Ek=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},Ff=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Pk=(Object.defineProperty(kc,"__esModule",{value:!0}),Q_),Sk=e,Tk=Ff(S),Gf=Ff(Fs);kc.default=wk(wk(wk({},Tk.default),Gf.default),{createNodeTransformer:function(e){return Tk.default.createNodeTransformer(e).extendsWith({fromStructure:function(e){Pk.structure.verifyStructSize("Node",4,e.size);var e=Ek(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new Sk.Node(t,r,n,e)}})},createRelationshipTransformer:function(e){return Tk.default.createRelationshipTransformer(e).extendsWith({fromStructure:function(e){Pk.structure.verifyStructSize("Relationship",8,e.size);var e=Ek(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 Sk.Relationship(t,r,n,o,i,u,a,e)}})},createUnboundRelationshipTransformer:function(e){return Tk.default.createUnboundRelationshipTransformer(e).extendsWith({fromStructure:function(e){Pk.structure.verifyStructSize("UnboundRelationship",4,e.size);var e=Ek(e.fields,4),t=e[0],r=e[1],n=e[2],e=e[3];return new Sk.UnboundRelationship(t,r,n,e)}})}});var jk,Ck,Tc=r&&r.__extends||(jk=function(e,t){return(jk=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}jk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),jl=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},h=(Object.defineProperty(xr,"__esModule",{value:!0}),jl(Nc)),Rk=cy,Ik=jl(kc),Ak=jl(Xv),kk=jl(w),Mk=A,Nk=e.internal.constants.BOLT_PROTOCOL_V5_0,gd=(Ck=h.default,Tc(xk,Ck),Object.defineProperty(xk.prototype,"version",{get:function(){return Nk},enumerable:!1,configurable:!0}),Object.defineProperty(xk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Ak.default(Object.values(Ik.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),xk.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,e=new Mk.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return t._onLoginCompleted(e,n,u)}});return(0,Rk.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(kk.default.hello(r,n,this._serversideRouting),e,!0),e},xk);function xk(){return null!==Ck&&Ck.apply(this,arguments)||this}xr.default=gd;var Dk,Lk,Cd={},Id={},Uk=r&&r.__assign||function(){return(Uk=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)},Vd=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Sc=(Object.defineProperty(Id,"__esModule",{value:!0}),Vd(kc)),Ud=(Id.default=Uk({},Sc.default),r&&r.__extends||(Dk=function(e,t){return(Dk=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}Dk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),Fk=r&&r.__assign||function(){return(Fk=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)},ud=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Yd=(Object.defineProperty(Cd,"__esModule",{value:!0}),ud(xr)),Bk=cy,Wk=ud(Id),qk=ud(Xv),zk=ud(w),Vk=A,Hk=e.internal.constants.BOLT_PROTOCOL_V5_1,Pc=(Lk=Yd.default,Ud(Gk,Lk),Object.defineProperty(Gk.prototype,"version",{get:function(){return Hk},enumerable:!1,configurable:!0}),Object.defineProperty(Gk.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new qk.default(Object.values(Wk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(Gk.prototype,"supportsReAuth",{get:function(){return!0},enumerable:!1,configurable:!0}),Gk.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,a={},e=new Vk.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return a.metadata=e,t._onLoginCompleted(e)}});return(0,Bk.assertNotificationFilterIsEmpty)(o,this._onProtocolError,e),this.write(zk.default.hello5x1(r,this._serversideRouting),e,!1),this.logon({authToken:n,onComplete:function(e){return u(Fk(Fk({},e),a.metadata))},onError:i,flush:!0})},Gk.prototype.logon=function(e){var t=this,e=void 0===e?{}:e,r=e.authToken,n=e.onComplete,o=e.onError,e=e.flush,i=new Vk.LoginObserver({onCompleted:function(){return t._onLoginCompleted(null,r,n)},onError:function(e){return t._onLoginError(e,o)}});return this.write(zk.default.logon(r),i,e),i},Gk.prototype.logoff=function(e){var e=void 0===e?{}:e,t=e.onComplete,r=e.onError,e=e.flush,t=new Vk.LogoffObserver({onCompleted:t,onError:r});return this.write(zk.default.logoff(),t,e),t},Gk);function Gk(){return null!==Lk&&Lk.apply(this,arguments)||this}Cd.default=Pc;var Yk,Kk,O={},md={},Zk=r&&r.__assign||function(){return(Zk=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)},Ap=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Xd=(Object.defineProperty(md,"__esModule",{value:!0}),Ap(Id)),uh=(md.default=Zk({},Xd.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)})),Qk=r&&r.__assign||function(){return(Qk=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}},Nt=(Object.defineProperty(O,"__esModule",{value:!0}),T(Cd)),Xk=T(md),Jk=T(Xv),$k=T(w),eM=A,I=e.internal.constants,tM=I.BOLT_PROTOCOL_V5_2,rM=I.FETCH_ALL,Ad=(Kk=Nt.default,uh(nM,Kk),Object.defineProperty(nM.prototype,"version",{get:function(){return tM},enumerable:!1,configurable:!0}),Object.defineProperty(nM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new Jk.default(Object.values(Xk.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),Object.defineProperty(nM.prototype,"supportsReAuth",{get:function(){return!0},enumerable:!1,configurable:!0}),nM.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=(e.boltAgent,e.authToken),o=e.notificationFilter,i=e.onError,u=e.onComplete,a={},e=new eM.LoginObserver({onError:function(e){return t._onLoginError(e,i)},onCompleted:function(e){return a.metadata=e,t._onLoginCompleted(e)}});return this.write($k.default.hello5x2(r,o,this._serversideRouting),e,!1),this.logon({authToken:n,onComplete:function(e){return u(Qk(Qk({},e),a.metadata))},onError:i,flush:!0})},nM.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.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new eM.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),this.write($k.default.begin({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u}),a,!0),a},nM.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.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?rM:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new eM.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r}),l=y;return this.write($k.default.runWithMetadata(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a,notificationFilter:s}),c,l&&b),y||this.write($k.default.pull({n:_}),c,b),c},nM);function nM(){return null!==Kk&&Kk.apply(this,arguments)||this}O.default=Ad;var oM,iM,fh={},bh={},uM=r&&r.__assign||function(){return(uM=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)},vc=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Sh=(Object.defineProperty(bh,"__esModule",{value:!0}),vc(md)),ah=(bh.default=uM({},Sh.default),r&&r.__extends||(oM=function(e,t){return(oM=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}oM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),aM=r&&r.__assign||function(){return(aM=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)},Nh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gh=(Object.defineProperty(fh,"__esModule",{value:!0}),Nh(O)),sM=Nh(bh),cM=Nh(Xv),lM=Nh(w),fM=A,pM=e.internal.constants.BOLT_PROTOCOL_V5_3,qh=(iM=gh.default,ah(dM,iM),Object.defineProperty(dM.prototype,"version",{get:function(){return pM},enumerable:!1,configurable:!0}),Object.defineProperty(dM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new cM.default(Object.values(sM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),dM.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.boltAgent,o=e.authToken,i=e.notificationFilter,u=e.onError,a=e.onComplete,s={},e=new fM.LoginObserver({onError:function(e){return t._onLoginError(e,u)},onCompleted:function(e){return s.metadata=e,t._onLoginCompleted(e)}});return this.write(lM.default.hello5x3(r,n,i,this._serversideRouting),e,!1),this.logon({authToken:o,onComplete:function(e){return a(aM(aM({},e),s.metadata))},onError:u,flush:!0})},dM);function dM(){return null!==iM&&iM.apply(this,arguments)||this}fh.default=qh;var hM,bM,Xh={},yb={},yM=r&&r.__assign||function(){return(yM=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)},Jh=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},wf=(Object.defineProperty(yb,"__esModule",{value:!0}),Jh(bh)),Ab=(yb.default=yM({},wf.default),r&&r.__extends||(hM=function(e,t){return(hM=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}hM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),ip=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Nb=(Object.defineProperty(Xh,"__esModule",{value:!0}),ip(fh)),_M=ip(yb),vM=ip(w),mM=A,gM=ip(Xv),OM=e.internal.constants.BOLT_PROTOCOL_V5_4,Wf=(bM=Nb.default,Ab(wM,bM),Object.defineProperty(wM.prototype,"version",{get:function(){return OM},enumerable:!1,configurable:!0}),Object.defineProperty(wM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new gM.default(Object.values(_M.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),wM.prototype.telemetry=function(e,t){var e=e.api,t=void 0===t?{}:t,r=t.onError,t=t.onCompleted,t=new mM.TelemetryObserver({onCompleted:t,onError:r});return this.write(vM.default.telemetry({api:e}),t,!1),t},wM);function wM(){return null!==bM&&bM.apply(this,arguments)||this}Xh.default=Wf;var EM,PM,xb={},Pp={},SM=r&&r.__assign||function(){return(SM=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)},Gb=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Od=(Object.defineProperty(Pp,"__esModule",{value:!0}),Gb(yb)),Yh=(Pp.default=SM({},Od.default),r&&r.__extends||(EM=function(e,t){return(EM=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}EM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),TM=r&&r.__assign||function(){return(TM=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)},Ec=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},bb=(Object.defineProperty(xb,"__esModule",{value:!0}),Ec(Xh)),jM=Ec(Pp),CM=Ec(Xv),RM=Ec(w),IM=A,Hb=e.internal.constants,AM=Hb.BOLT_PROTOCOL_V5_5,kM=Hb.FETCH_ALL,MM=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),Dy=(PM=bb.default,Yh(NM,PM),Object.defineProperty(NM.prototype,"version",{get:function(){return AM},enumerable:!1,configurable:!0}),Object.defineProperty(NM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new CM.default(Object.values(jM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),NM.prototype.initialize=function(e){var t=this,e=void 0===e?{}:e,r=e.userAgent,n=e.boltAgent,o=e.authToken,i=e.notificationFilter,u=e.onError,a=e.onComplete,s={},e=new IM.LoginObserver({onError:function(e){return t._onLoginError(e,u)},onCompleted:function(e){return s.metadata=e,t._onLoginCompleted(e)}});return this.write(RM.default.hello5x5(r,n,i,this._serversideRouting),e,!1),this.logon({authToken:o,onComplete:function(e){return a(TM(TM({},e),s.metadata))},onError:u,flush:!0})},NM.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.notificationFilter,a=e.beforeError,s=e.afterError,c=e.beforeComplete,e=e.afterComplete,a=new IM.ResultStreamObserver({server:this._server,beforeError:a,afterError:s,beforeComplete:c,afterComplete:e});return a.prepareToHandleSingleResponse(),this.write(RM.default.begin5x5({bookmarks:t,txConfig:r,database:n,mode:o,impersonatedUser:i,notificationFilter:u}),a,!0),a},NM.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.notificationFilter,c=r.beforeKeys,l=r.afterKeys,f=r.beforeError,p=r.afterError,d=r.beforeComplete,h=r.afterComplete,b=r.flush,b=void 0===b||b,y=r.reactive,y=void 0!==y&&y,_=r.fetchSize,_=void 0===_?kM:_,v=r.highRecordWatermark,v=void 0===v?Number.MAX_VALUE:v,r=r.lowRecordWatermark,r=void 0===r?Number.MAX_VALUE:r,c=new IM.ResultStreamObserver({server:this._server,reactive:y,fetchSize:_,moreFunction:this._requestMore.bind(this),discardFunction:this._requestDiscard.bind(this),beforeKeys:c,afterKeys:l,beforeError:f,afterError:p,beforeComplete:d,afterComplete:h,highRecordWatermark:v,lowRecordWatermark:r,enrichMetadata:this._enrichMetadata}),l=y;return this.write(RM.default.runWithMetadata5x5(e,t,{bookmarks:n,txConfig:o,database:i,mode:u,impersonatedUser:a,notificationFilter:s}),c,l&&b),y||this.write(RM.default.pull({n:_}),c,b),c},NM.prototype._enrichMetadata=function(e){return Array.isArray(e.statuses)&&(e.statuses=e.statuses.map(function(e){return TM(TM({},e),{description:null!=e.neo4j_code?e.status_description:e.description,diagnostic_record:null!==e.diagnostic_record?TM(TM({},MM),e.diagnostic_record):null})})),e},NM);function NM(){return null!==PM&&PM.apply(this,arguments)||this}xb.default=Dy;var xM,DM,ky={},Wy=r&&r.__extends||(xM=function(e,t){return(xM=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}xM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),LM=r&&r.__assign||function(){return(LM=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)},l_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i_=(Object.defineProperty(ky,"__esModule",{value:!0}),l_(xb)),UM=l_(Pp),FM=l_(Xv),BM=e.internal.constants.BOLT_PROTOCOL_V5_6,WM=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),h_=(DM=i_.default,Wy(qM,DM),Object.defineProperty(qM.prototype,"version",{get:function(){return BM},enumerable:!1,configurable:!0}),Object.defineProperty(qM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new FM.default(Object.values(UM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),qM.prototype._enrichMetadata=function(e){return Array.isArray(e.statuses)&&(e.statuses=e.statuses.map(function(e){return LM(LM({},e),{diagnostic_record:null!==e.diagnostic_record?LM(LM({},WM),e.diagnostic_record):null})})),e},qM);function qM(){return null!==DM&&DM.apply(this,arguments)||this}ky.default=h_;var zM,VM,kd={},S_=r&&r.__extends||(zM=function(e,t){return(zM=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}zM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),HM=r&&r.__assign||function(){return(HM=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)},j_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},A_=(Object.defineProperty(kd,"__esModule",{value:!0}),j_(ky)),GM=j_(Pp),YM=j_(Xv),KM=e.internal.constants.BOLT_PROTOCOL_V5_7,ZM=Object.freeze({OPERATION:"",OPERATION_CODE:"0",CURRENT_SCHEMA:"/"}),N_=(VM=A_.default,S_(QM,VM),Object.defineProperty(QM.prototype,"version",{get:function(){return KM},enumerable:!1,configurable:!0}),Object.defineProperty(QM.prototype,"transformer",{get:function(){var t=this;return void 0===this._transformer&&(this._transformer=new YM.default(Object.values(GM.default).map(function(e){return e(t._config,t._log)}))),this._transformer},enumerable:!1,configurable:!0}),QM.prototype.enrichErrorMetadata=function(e){return HM(HM({},e),{cause:null!==e.cause&&void 0!==e.cause?this.enrichErrorMetadata(e.cause):null,code:e.neo4j_code,diagnostic_record:null!==e.diagnostic_record?HM(HM({},ZM),e.diagnostic_record):null})},QM);function QM(){return null!==VM&&VM.apply(this,arguments)||this}kd.default=N_;var w_={},XM=(Object.defineProperty(w_,"__esModule",{value:!0}),e);function JM(){}function $M(e){return e}var e2={onNext:JM,onCompleted:JM,onError:JM};function t2(e){var e=void 0===e?{}:e,t=e.transformMetadata,r=e.enrichErrorMetadata,n=e.log,e=e.observer;this._pendingObservers=[],this._log=n,this._transformMetadata=t||$M,this._enrichErrorMetadata=r||$M,this._observer=Object.assign({onObserversCountChange:JM,onError:JM,onFailure:JM,onErrorApplyTransformation:$M},e)}Object.defineProperty(t2.prototype,"currentFailure",{get:function(){return this._currentFailure},enumerable:!1,configurable:!0}),t2.prototype.handleResponse=function(e){var t=e.fields[0];switch(e.signature){case 113:this._log.isDebugEnabled()&&this._log.debug("S: RECORD ".concat(XM.json.stringify(e))),this._currentObserver.onNext(t);break;case 112:this._log.isDebugEnabled()&&this._log.debug("S: SUCCESS ".concat(XM.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(XM.json.stringify(e)));try{this._currentFailure=this._handleErrorPayload(this._enrichErrorMetadata(t)),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(XM.json.stringify(e)));try{this._currentFailure&&this._currentObserver.onError?this._currentObserver.onError(this._currentFailure):this._currentObserver.onError&&this._currentObserver.onError((0,XM.newError)("Ignored either because of an error or RESET"))}finally{this._updateCurrentObserver()}break;default:this._observer.onError((0,XM.newError)("Unknown Bolt protocol message: "+e))}},t2.prototype._updateCurrentObserver=function(){this._currentObserver=this._pendingObservers.shift(),this._observer.onObserversCountChange(this._observersCount)},Object.defineProperty(t2.prototype,"_observersCount",{get:function(){return null==this._currentObserver?this._pendingObservers.length:this._pendingObservers.length+1},enumerable:!1,configurable:!0}),t2.prototype._queueObserver=function(e){return(e=e||e2).onCompleted=e.onCompleted||JM,e.onError=e.onError||JM,e.onNext=e.onNext||JM,void 0===this._currentObserver?this._currentObserver=e:this._pendingObservers.push(e),this._observer.onObserversCountChange(this._observersCount),!0},t2.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)}},t2.prototype.hasOngoingObservableRequests=function(){return null!=this._currentObserver||0<this._pendingObservers.length},t2.prototype._resetFailure=function(){this._currentFailure=null},t2.prototype._handleErrorPayload=function(e){var t=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}(e.code),r=null!=e.cause?this._handleErrorCause(e.cause):void 0,t=(0,XM.newError)(e.message,t,r,e.gql_status,e.description,e.diagnostic_record);return this._observer.onErrorApplyTransformation(t)},t2.prototype._handleErrorCause=function(e){var t=null!=e.cause?this._handleErrorCause(e.cause):void 0,t=(0,XM.newGQLError)(e.message,t,e.gql_status,e.description,e.diagnostic_record);return this._observer.onErrorApplyTransformation(t)},w_.default=t2;var r2,W_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},n2=(Object.defineProperty(ey,"__esModule",{value:!0}),e),o2=W_(iy),i2=W_(fm),u2=W_(c0),a2=W_(D0),s2=W_(E),c2=W_(Ag),l2=W_(s),f2=W_(Nc),p2=W_(xr),d2=W_(Cd),h2=W_(O),b2=W_(fh),y2=W_(Xh),_2=W_(xb),v2=W_(ky),m2=W_(kd),g2=W_(w_);ey.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 g2.default({transformMetadata:t.transformMetadata.bind(t),enrichErrorMetadata:t.enrichErrorMetadata.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 o2.default(p,d,h,y,v,_);case 2:return new i2.default(p,d,h,y,v,_);case 3:return new u2.default(p,d,h,y,v,_);case 4:return new a2.default(p,d,h,y,v,_);case 4.1:return new s2.default(p,d,h,y,v,_,b);case 4.2:return new c2.default(p,d,h,y,v,_,b);case 4.3:return new l2.default(p,d,h,y,v,_,b);case 4.4:return new f2.default(p,d,h,y,v,_,b);case 5:return new p2.default(p,d,h,y,v,_,b);case 5.1:return new d2.default(p,d,h,y,v,_,b);case 5.2:return new h2.default(p,d,h,y,v,_,b);case 5.3:return new b2.default(p,d,h,y,v,_,b);case 5.4:return new y2.default(p,d,h,y,v,_,b);case 5.5:return new _2.default(p,d,h,y,v,_,b);case 5.6:return new v2.default(p,d,h,y,v,_,b);case 5.7:return new m2.default(p,d,h,y,v,_,b);default:throw(0,n2.newError)("Unknown Bolt protocol version: "+f)}},_y=y,r2=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]}),d_=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||r2(t,e,r)},b_=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(_y,"__esModule",{value:!0}),_y.RawRoutingTable=_y.BoltProtocol=void 0,Y_=b_(op),sv=b_(ey),up=b_(s),b_=b_(py),d_(A,_y),_y.BoltProtocol=up.default,_y.RawRoutingTable=b_.default,_y.default={handshake:Y_.default,create:sv.default};var O2,ap={},bv={},wv=r&&r.__extends||(O2=function(e,t){return(O2=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}O2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(bv,"__esModule",{value:!0});wv(E2,w2=e.ConnectionProvider),E2.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 w2,yv=E2;function E2(e){var t=w2.call(this)||this;return t._connection=e,t}bv.default=yv;var P2,Ef={},sp={},pv={},mv=r&&r.__extends||(P2=function(e,t){return(P2=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}P2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(pv,"__esModule",{value:!0});mv(T2,S2=e.Connection),Object.defineProperty(T2.prototype,"id",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"databaseId",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"authToken",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"supportsReAuth",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"creationTimestamp",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"idleTimestamp",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),T2.prototype.protocol=function(){throw new Error("not implemented")},Object.defineProperty(T2.prototype,"address",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"version",{get:function(){throw new Error("not implemented")},set:function(e){throw new Error("not implemented")},enumerable:!1,configurable:!0}),Object.defineProperty(T2.prototype,"server",{get:function(){throw new Error("not implemented")},enumerable:!1,configurable:!0}),T2.prototype.connect=function(e,t,r,n){throw new Error("not implemented")},T2.prototype.write=function(e,t,r){throw new Error("not implemented")},T2.prototype.close=function(){throw new Error("not implemented")},T2.prototype.handleAndTransformError=function(e,t){return this._errorHandler?this._errorHandler.handleAndTransformError(e,t,this):e};var S2,Oy=T2;function T2(e){var t=S2.call(this)||this;return t._errorHandler=e,t}pv.default=Oy;var j2,Dv={},Mv=r&&r.__extends||(j2=function(e,t){return(j2=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}j2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),C2=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())})},R2=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}}}},Bv=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},I2=(Object.defineProperty(Dv,"__esModule",{value:!0}),Dv.createChannelConnection=void 0,Ep),A2=e,Gv=Bv(pv),k2=Bv(y),M2=A2.error.PROTOCOL_ERROR,N2=A2.internal.logger.Logger,x2=0;Dv.createChannelConnection=function(i,u,a,s,e,c,t){void 0===c&&(c=null);var l=(t=void 0===t?function(e){return new I2.Channel(e)}:t)(new I2.ChannelConfig(i,u,a.errorCode(),e));return k2.default.handshake(l,s).then(function(e){var r=e.protocolVersion,e=e.consumeRemainingBuffer,n=new I2.Chunker(l),o=new I2.Dechunker,t=new L2(l,a,i,s,u.disableLosslessIntegers,c,n,u.notificationFilter,function(t){return k2.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:{onObserversCountChange: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)}}})},u.telemetryDisabled);return e(function(e){return o.write(e)}),t}).catch(function(e){return l.close().then(function(){throw e})})};D2=Gv.default,Mv(U2,D2),U2.prototype.beginTransaction=function(e){return this._sendTelemetryIfEnabled(e),this._protocol.beginTransaction(e)},U2.prototype.run=function(e,t,r){return this._sendTelemetryIfEnabled(r),this._protocol.run(e,t,r)},U2.prototype._sendTelemetryIfEnabled=function(e){this._telemetryDisabledConnection||this._telemetryDisabledDriverConfig||null==e||null==e.apiTelemetryConfig||this._protocol.telemetry({api:e.apiTelemetryConfig.api},{onCompleted:e.apiTelemetryConfig.onTelemetrySuccess,onError:e.beforeError})},U2.prototype.commitTransaction=function(e){return this._protocol.commitTransaction(e)},U2.prototype.rollbackTransaction=function(e){return this._protocol.rollbackTransaction(e)},U2.prototype.getProtocolVersion=function(){return this._protocol.version},Object.defineProperty(U2.prototype,"authToken",{get:function(){return this._authToken},set:function(e){this._authToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(U2.prototype,"supportsReAuth",{get:function(){return this._protocol.supportsReAuth},enumerable:!1,configurable:!0}),Object.defineProperty(U2.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(U2.prototype,"databaseId",{get:function(){return this._dbConnectionId},set:function(e){this._dbConnectionId=e},enumerable:!1,configurable:!0}),Object.defineProperty(U2.prototype,"idleTimestamp",{get:function(){return this._idleTimestamp},set:function(e){this._idleTimestamp=e},enumerable:!1,configurable:!0}),Object.defineProperty(U2.prototype,"creationTimestamp",{get:function(){return this._creationTimestamp},enumerable:!1,configurable:!0}),U2.prototype.connect=function(t,n,o,i){return C2(this,void 0,void 0,function(){var r=this;return R2(this,function(e){switch(e.label){case 0:if(this._protocol.initialized&&!this._protocol.supportsReAuth)throw(0,A2.newError)("Connection does not support re-auth");return this._authToken=o,this._protocol.initialized?[3,2]:[4,this._initialize(t,n,o)];case 1:return[2,e.sent()];case 2:return i?[4,new Promise(function(e,t){r._protocol.logoff({onError:t}),r._protocol.logon({authToken:o,onError:t,onComplete:function(){return e(r)},flush:!0})})]:[3,4];case 3:return[2,e.sent()];case 4:return this._protocol.logoff(),this._protocol.logon({authToken:o,flush:!0}),[2,this]}})})},U2.prototype._initialize=function(e,n,o){var i=this,u=this;return new Promise(function(r,t){i._protocol.initialize({userAgent:e,boltAgent:n,authToken:o,notificationFilter:i._notificationFilter,onError:function(e){return t(e)},onComplete:function(e){var t;e&&(t=e.server,i.version&&!t||(i.version=t),t=e.connection_id,i.databaseId||(i.databaseId=t),e.hints&&(null!=(t=e.hints["connection.recv_timeout_seconds"])&&(t=(0,A2.toNumber)(t),Number.isInteger(t)&&0<t?i._ch.setupReceiveTimeout(1e3*t):i._log.info("Server located at ".concat(i._address," supplied an invalid connection receive timeout value (").concat(t,"). ")+"Please, verify the server configuration and status because this can be the symptom of a bigger issue.")),!0===e.hints["telemetry.enabled"]&&(i._telemetryDisabledConnection=!1))),r(u)}})})},U2.prototype.protocol=function(){return this._protocol},Object.defineProperty(U2.prototype,"address",{get:function(){return this._address},enumerable:!1,configurable:!0}),Object.defineProperty(U2.prototype,"version",{get:function(){return this._server.version},set:function(e){this._server.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(U2.prototype,"server",{get:function(){return this._server},enumerable:!1,configurable:!0}),Object.defineProperty(U2.prototype,"logger",{get:function(){return this._log},enumerable:!1,configurable:!0}),U2.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(A2.json.stringify(this._error),")")),this._protocol.notifyFatalError(this._error)},U2.prototype._setIdle=function(e){this._idle=!0,this._ch.stopReceiveTimeout(),this._protocol.queueObserverIfProtocolIsNotBroken(e)},U2.prototype._unsetIdle=function(){this._idle=!1,this._updateCurrentObserver()},U2.prototype._queueObserver=function(e){return this._protocol.queueObserverIfProtocolIsNotBroken(e)},U2.prototype.hasOngoingObservableRequests=function(){return!this._idle&&this._protocol.hasOngoingObservableRequests()},U2.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: ".concat(e)),t(e))},onComplete:function(){e()}})})},U2.prototype._resetOnFailure=function(){var e=this;this.isOpen()&&this._reset({onError:function(){e._protocol.resetFailure()},onComplete:function(){e._protocol.resetFailure()}})},U2.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()})}}))},U2.prototype._updateCurrentObserver=function(){this._protocol.updateCurrentObserver()},U2.prototype.isOpen=function(){return!this._isBroken&&this._ch._open},U2.prototype._handleOngoingRequestsNumberChange=function(e){this._idle||(0===e?this._ch.stopReceiveTimeout():this._ch.startReceiveTimeout())},U2.prototype.close=function(){return C2(this,void 0,void 0,function(){return R2(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]}})})},U2.prototype.toString=function(){return"Connection [".concat(this.id,"][").concat(this.databaseId||"","]")},U2.prototype._handleProtocolError=function(e){this._protocol.resetFailure(),this._updateCurrentObserver();e=(0,A2.newError)(e,M2);return this._handleFatalError(e),e};var D2,L2=U2;function U2(e,t,r,n,o,i,u,a,s,c){void 0===o&&(o=!1),void 0===i&&(i=null);var l,f,t=D2.call(this,t)||this;return t._authToken=null,t._idle=!1,t._reseting=!1,t._resetObservers=[],t._id=x2++,t._address=r,t._server={address:r.asHostPort()},t._creationTimestamp=Date.now(),t._disableLosslessIntegers=o,t._ch=e,t._chunker=u,t._log=(l=t,new N2((f=n)._level,function(e,t){return f._loggerFunction(e,"".concat(l," ").concat(t))})),t._serversideRouting=i,t._notificationFilter=a,t._telemetryDisabledDriverConfig=!0===c,t._telemetryDisabledConnection=!0,t._dbConnectionId=null,t._protocol=s(t),t._isBroken=!1,t._log.isDebugEnabled()&&t._log.debug("created towards ".concat(r)),t}Dv.default=L2;var F2,B2,pn={},tm=r&&r.__extends||(F2=function(e,t){return(F2=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}F2(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),om=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},am=(Object.defineProperty(pn,"__esModule",{value:!0}),om(pv)),it=(B2=am.default,tm(W2,B2),W2.prototype.beginTransaction=function(e){return this._delegate.beginTransaction(e)},W2.prototype.run=function(e,t,r){return this._delegate.run(e,t,r)},W2.prototype.commitTransaction=function(e){return this._delegate.commitTransaction(e)},W2.prototype.rollbackTransaction=function(e){return this._delegate.rollbackTransaction(e)},W2.prototype.getProtocolVersion=function(){return this._delegate.getProtocolVersion()},Object.defineProperty(W2.prototype,"id",{get:function(){return this._delegate.id},enumerable:!1,configurable:!0}),Object.defineProperty(W2.prototype,"databaseId",{get:function(){return this._delegate.databaseId},set:function(e){this._delegate.databaseId=e},enumerable:!1,configurable:!0}),Object.defineProperty(W2.prototype,"server",{get:function(){return this._delegate.server},enumerable:!1,configurable:!0}),Object.defineProperty(W2.prototype,"authToken",{get:function(){return this._delegate.authToken},set:function(e){this._delegate.authToken=e},enumerable:!1,configurable:!0}),Object.defineProperty(W2.prototype,"supportsReAuth",{get:function(){return this._delegate.supportsReAuth},enumerable:!1,configurable:!0}),Object.defineProperty(W2.prototype,"address",{get:function(){return this._delegate.address},enumerable:!1,configurable:!0}),Object.defineProperty(W2.prototype,"version",{get:function(){return this._delegate.version},set:function(e){this._delegate.version=e},enumerable:!1,configurable:!0}),Object.defineProperty(W2.prototype,"creationTimestamp",{get:function(){return this._delegate.creationTimestamp},enumerable:!1,configurable:!0}),Object.defineProperty(W2.prototype,"idleTimestamp",{get:function(){return this._delegate.idleTimestamp},set:function(e){this._delegate.idleTimestamp=e},enumerable:!1,configurable:!0}),W2.prototype.isOpen=function(){return this._delegate.isOpen()},W2.prototype.protocol=function(){return this._delegate.protocol()},W2.prototype.connect=function(e,t,r,n){return this._delegate.connect(e,t,r,n)},W2.prototype.write=function(e,t,r){return this._delegate.write(e,t,r)},W2.prototype.resetAndFlush=function(){return this._delegate.resetAndFlush()},W2.prototype.hasOngoingObservableRequests=function(){return this._delegate.hasOngoingObservableRequests()},W2.prototype.close=function(){return this._delegate.close()},W2.prototype.release=function(){return this._originalErrorHandler&&(this._delegate._errorHandler=this._originalErrorHandler),this._delegate.release()},W2);function W2(e,t){var r=B2.call(this,t)||this;return t&&(r._originalErrorHandler=e._errorHandler,e._errorHandler=r._errorHandler),r._delegate=e,r}pn.default=it;Em={};Object.defineProperty(Em,"__esModule",{value:!0});var q2,z2,V2,H2=e.error.SERVICE_UNAVAILABLE,G2=e.error.SESSION_EXPIRED;function Y2(e,t,r,n){this._errorCode=e,this._handleUnavailability=t||K2,this._handleWriteFailure=r||K2,this._handleSecurityError=n||K2}function K2(e){return e}Y2.create=function(e){return new Y2(e.errorCode,e.handleUnavailability,e.handleWriteFailure,e.handleSecurityError)},Y2.prototype.errorCode=function(){return this._errorCode},Y2.prototype.handleAndTransformError=function(e,t,r){return null!=(n=e)&&null!=n.code&&n.code.startsWith("Neo.ClientError.Security.")?this._handleSecurityError(e,t,r):function(e){if(e)return e.code===G2||e.code===H2||"Neo.TransientError.General.DatabaseUnavailable"===e.code;return}(e)?this._handleUnavailability(e,t,r):function(e){if(e)return"Neo.ClientError.Cluster.NotALeader"===e.code||"Neo.ClientError.General.ForbiddenOnReadOnlyDatabase"===e.code;return}(e)?this._handleWriteFailure(e,t,r):e;var n},Em.default=Y2,Cm=sp,q2=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]}),z2=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Zv=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)&&q2(t,e,r);return z2(t,e),t},C=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.createChannelConnection=Cm.ConnectionErrorHandler=Cm.DelegateConnection=Cm.ChannelConnection=Cm.Connection=void 0,Nm=C(pv),Cm.Connection=Nm.default,V2=Zv(Dv),Cm.ChannelConnection=V2.default,Object.defineProperty(Cm,"createChannelConnection",{enumerable:!0,get:function(){return V2.createChannelConnection}}),Zv=C(pn),Cm.DelegateConnection=Zv.default,Zv=C(Em),Cm.ConnectionErrorHandler=Zv.default,Cm.default=Nm.default;var Vm={},Z2=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())})},Q2=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}}}},X2=(Object.defineProperty(Vm,"__esModule",{value:!0}),e),J2=Gy;function $2(e){var t=e.authTokenManager,r=e.userAgent,e=e.boltAgent;this._authTokenManager=t||(0,X2.staticAuthTokenManager)({}),this._userAgent=r,this._boltAgent=e}$2.prototype.authenticate=function(e){var r=e.connection,n=e.auth,o=e.skipReAuth,i=e.waitReAuth,u=e.forceReAuth;return Z2(this,void 0,void 0,function(){var t;return Q2(this,function(e){switch(e.label){case 0:return null==n?[3,3]:(t=!0===r.supportsReAuth&&(!J2.object.equals(r.authToken,n)&&!0!==o||!0===u),null==r.authToken||t?[4,r.connect(this._userAgent,this._boltAgent,n,i||!1)]:[3,2]);case 1:return[2,e.sent()];case 2:return[2,r];case 3:return[4,this._authTokenManager.getToken()];case 4:return t=e.sent(),J2.object.equals(t,r.authToken)?[3,6]:[4,r.connect(this._userAgent,this._boltAgent,t,!1)];case 5:return[2,e.sent()];case 6:return[2,r]}})})},$2.prototype.handleError=function(e){var t=e.connection,e=e.code;return!(!t||!e.startsWith("Neo.ClientError.Security."))&&this._authTokenManager.handleSecurityException(t.authToken,e)},Vm.default=$2;var tb={},eN=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())})},tN=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 rN(e){e=e.connectionLivenessCheckTimeout;this._connectionLivenessCheckTimeout=e}Object.defineProperty(tb,"__esModule",{value:!0}),rN.prototype.check=function(r){return eN(this,void 0,void 0,function(){var t;return tN(this,function(e){switch(e.label){case 0:return this._isCheckDisabled||this._isNewlyCreatedConnection(r)?[2,!0]:(t=Date.now()-r.idleTimestamp,0===this._connectionLivenessCheckTimeout||t>this._connectionLivenessCheckTimeout?[4,r.resetAndFlush().then(function(){return!0})]:[3,2]);case 1:return[2,e.sent()];case 2:return[2,!0]}})})},Object.defineProperty(rN.prototype,"_isCheckDisabled",{get:function(){return null==this._connectionLivenessCheckTimeout||this._connectionLivenessCheckTimeout<0},enumerable:!1,configurable:!0}),rN.prototype._isNewlyCreatedConnection=function(e){return null==e.authToken},tb.default=rN;var Km={},nN=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())})},oN=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}}}},iN=(Object.defineProperty(Km,"__esModule",{value:!0}),Ep);function uN(e){var t=e.clientCertificateProvider,e=e.loader;this._clientCertificateProvider=t,this._loader=e||iN.ClientCertificatesLoader,this._clientCertificate=null}uN.prototype.getClientCertificate=function(){return nN(this,void 0,void 0,function(){var t,r,n=this;return oN(this,function(e){switch(e.label){case 0:return(t=null!=this._clientCertificateProvider)?(r=null==this._clientCertificate)?[3,2]:[4,this._clientCertificateProvider.hasUpdate()]:[3,3];case 1:r=e.sent(),e.label=2;case 2:t=r,e.label=3;case 3:return t&&(this._clientCertificate=Promise.resolve(this._clientCertificateProvider.getClientCertificate()).then(this._loader.load).then(function(e){return n._clientCertificate=e,n._clientCertificate}).catch(function(e){throw n._clientCertificate=null,e})),[2,this._clientCertificate]}})})},Km.default=uN;var aN,sN,Fm=r&&r.__extends||(aN=function(e,t){return(aN=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}aN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),cN=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())})},lN=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}}}},fN=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},pN=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))},t0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},dN=(Object.defineProperty(Ef,"__esModule",{value:!0}),sp),hN=e,bN=t0(Vm),yN=Gy,_N=t0(tb),vN=t0(Km),mN=hN.error.SERVICE_UNAVAILABLE,gN=["Neo.ClientError.Security.CredentialsExpired","Neo.ClientError.Security.Forbidden","Neo.ClientError.Security.TokenExpired","Neo.ClientError.Security.Unauthorized"],v0=hN.internal.pool,ON=v0.Pool,wN=v0.PoolConfig,eb=(sN=hN.ConnectionProvider,Fm(EN,sN),EN.prototype._createConnectionErrorHandler=function(){return new dN.ConnectionErrorHandler(mN)},EN.prototype._getClientCertificate=function(){return cN(this,void 0,void 0,function(){return lN(this,function(e){return[2,this._config.clientCertificate.getClientCertificate()]})})},EN.prototype._createConnection=function(e,r,n){var o=this,i=e.auth;return this._createChannelConnection(r).then(function(t){return t.release=function(){return t.idleTimestamp=Date.now(),n(r,t)},o._openConnections[t.id]=t,o._authenticationProvider.authenticate({connection:t,auth:i}).catch(function(e){throw o._destroyConnection(t),e})})},EN.prototype._validateConnectionOnAcquire=function(e,r){var n=e.auth,o=e.skipReAuth;return cN(this,void 0,void 0,function(){var t;return lN(this,function(e){switch(e.label){case 0:if(!this._validateConnection(r))return[2,!1];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this._livenessCheckProvider.check(r)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this._log.debug("The connection ".concat(r.id," is not alive because of an error ").concat(t.code," '").concat(t.message,"'")),[2,!1];case 4:return e.trys.push([4,6,,7]),[4,this._authenticationProvider.authenticate({connection:r,auth:n,skipReAuth:o})];case 5:return e.sent(),[2,!0];case 6:return t=e.sent(),this._log.debug("The connection ".concat(r.id," is not valid because of an error ").concat(t.code," '").concat(t.message,"'")),[2,!1];case 7:return[2]}})})},EN.prototype._validateConnectionOnRelease=function(e){return!0!==e._sticky&&this._validateConnection(e)},EN.prototype._validateConnection=function(e){return!!e.isOpen()&&!(this._config.maxConnectionLifetime<Date.now()-e.creationTimestamp)},EN.prototype._destroyConnection=function(e){return delete this._openConnections[e.id],e.close()},EN.prototype._verifyConnectivityAndGetServerVersion=function(e){var n=e.address;return cN(this,void 0,void 0,function(){var t,r;return lN(this,function(e){switch(e.label){case 0:return[4,this._connectionPool.acquire({},n)];case 1:t=e.sent(),r=new hN.ServerInfo(t.server,t.protocol().version),e.label=2;case 2:return e.trys.push([2,,5,7]),t.protocol().isLastMessageLogon()?[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]}})})},EN.prototype._verifyAuthentication=function(e){var u=e.getAddress,a=e.auth;return cN(this,void 0,void 0,function(){var t,r,n,o,i;return lN(this,function(e){switch(e.label){case 0:t=[],e.label=1;case 1:return e.trys.push([1,8,9,11]),[4,u()];case 2:return r=e.sent(),[4,this._connectionPool.acquire({auth:a,skipReAuth:!0},r)];case 3:if(n=e.sent(),t.push(n),o=!n.protocol().isLastMessageLogon(),n.supportsReAuth)return o&&n.supportsReAuth?[4,this._authenticationProvider.authenticate({connection:n,auth:a,waitReAuth:!0,forceReAuth:!0})]:[3,5];throw(0,hN.newError)("Driver is connected to a database that does not support user switch.");case 4:return e.sent(),[3,7];case 5:return!o||n.supportsReAuth?[3,7]:[4,this._connectionPool.acquire({auth:a},r,{requireNew:!0})];case 6:(i=e.sent())._sticky=!0,t.push(i),e.label=7;case 7:return[2,!0];case 8:if(i=e.sent(),gN.includes(i.code))return[2,!1];throw i;case 9:return[4,Promise.all(t.map(function(e){return e.release()}))];case 10:return e.sent(),[7];case 11:return[2]}})})},EN.prototype._verifyStickyConnection=function(e){var n=e.auth,o=e.connection;return e.address,cN(this,void 0,void 0,function(){var t,r;return lN(this,function(e){switch(e.label){case 0:return(t=yN.object.equals(n,o.authToken),r=!t,o._sticky=t&&!o.supportsReAuth,r||o._sticky)?[4,o.release()]:[3,2];case 1:throw e.sent(),(0,hN.newError)("Driver is connected to a database that does not support user switch.");case 2:return[2]}})})},EN.prototype.close=function(){return cN(this,void 0,void 0,function(){return lN(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]}})})},EN._installIdleObserverOnConnection=function(e,t){e._setIdle(t)},EN._removeIdleObserverOnConnection=function(e){e._unsetIdle()},EN.prototype._handleSecurityError=function(e,t,r){return this._authenticationProvider.handleError({connection:r,code:e.code})&&(e.retriable=!0),"Neo.ClientError.Security.AuthorizationExpired"===e.code&&this._connectionPool.apply(t,function(e){e.authToken=null}),r&&r.close().catch(function(){}),e},EN);function EN(e,t){var r=e.id,n=e.config,o=e.log,i=e.userAgent,u=e.boltAgent,a=e.authTokenManager,e=e.newPool,e=void 0===e?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(ON.bind.apply(ON,pN([void 0],fN(e),!1)))}:e,s=(void 0===t&&(t=null),sN.call(this)||this);return s._id=r,s._config=n,s._log=o,s._clientCertificateHolder=new vN.default({clientCertificateProvider:s._config.clientCertificate}),s._authenticationProvider=new bN.default({authTokenManager:a,userAgent:i,boltAgent:u}),s._livenessCheckProvider=new _N.default({connectionLivenessCheckTimeout:n.connectionLivenessCheckTimeout}),s._userAgent=i,s._boltAgent=u,s._createChannelConnection=t||function(n){return cN(s,void 0,void 0,function(){var t,r;return lN(this,function(e){switch(e.label){case 0:return t=dN.createChannelConnection,r=[n,this._config,this._createConnectionErrorHandler(),this._log],[4,this._clientCertificateHolder.getClientCertificate()];case 1:return[2,t.apply(void 0,r.concat([e.sent()]))]}})})},s._connectionPool=e({create:s._createConnection.bind(s),destroy:s._destroyConnection.bind(s),validateOnAcquire:s._validateConnectionOnAcquire.bind(s),validateOnRelease:s._validateConnectionOnRelease.bind(s),installIdleObserver:EN._installIdleObserverOnConnection.bind(s),removeIdleObserver:EN._removeIdleObserverOnConnection.bind(s),config:wN.fromDriverConfig(n),log:s._log}),s._openConnections={},s}Ef.default=eb;var PN,SN,g0={},R0=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)}),TN=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())})},jN=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}}}},k0=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},P0=(Object.defineProperty(g0,"__esModule",{value:!0}),k0(Ef)),CN=sp,yl=e.internal.constants,RN=yl.BOLT_PROTOCOL_V3,IN=yl.BOLT_PROTOCOL_V4_0,AN=yl.BOLT_PROTOCOL_V4_4,kN=yl.BOLT_PROTOCOL_V5_1,MN=e.error.SERVICE_UNAVAILABLE,z0=(SN=P0.default,R0(NN,SN),NN.prototype.acquireConnection=function(e){var e=void 0===e?{}:e,o=(e.accessMode,e.database),i=(e.bookmarks,e.auth),u=e.forceReAuth;return TN(this,void 0,void 0,function(){var t,r,n=this;return jN(this,function(e){switch(e.label){case 0:return t=CN.ConnectionErrorHandler.create({errorCode:MN,handleSecurityError:function(e,t,r){return n._handleSecurityError(e,t,r,o)}}),[4,this._connectionPool.acquire({auth:i,forceReAuth:u},this._address)];case 1:return(r=e.sent(),i)?[4,this._verifyStickyConnection({auth:i,connection:r,address:this._address})]:[3,3];case 2:return e.sent(),[2,r];case 3:return[2,new CN.DelegateConnection(r,t)]}})})},NN.prototype._handleSecurityError=function(e,t,r,n){return this._log.warn("Direct driver ".concat(this._id," will close connection to ").concat(t," for database '").concat(n,"' because of an error ").concat(e.code," '").concat(e.message,"'")),SN.prototype._handleSecurityError.call(this,e,t,r)},NN.prototype._hasProtocolVersion=function(n){return TN(this,void 0,void 0,function(){var t,r;return jN(this,function(e){switch(e.label){case 0:return[4,this._createChannelConnection(this._address)];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]}})})},NN.prototype.supportsMultiDb=function(){return TN(this,void 0,void 0,function(){return jN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return IN<=e})];case 1:return[2,e.sent()]}})})},NN.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},NN.prototype.supportsTransactionConfig=function(){return TN(this,void 0,void 0,function(){return jN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return RN<=e})];case 1:return[2,e.sent()]}})})},NN.prototype.supportsUserImpersonation=function(){return TN(this,void 0,void 0,function(){return jN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return AN<=e})];case 1:return[2,e.sent()]}})})},NN.prototype.supportsSessionAuth=function(){return TN(this,void 0,void 0,function(){return jN(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return kN<=e})];case 1:return[2,e.sent()]}})})},NN.prototype.verifyAuthentication=function(e){var r=e.auth;return TN(this,void 0,void 0,function(){var t=this;return jN(this,function(e){return[2,this._verifyAuthentication({auth:r,getAddress:function(){return t._address}})]})})},NN.prototype.verifyConnectivityAndGetServerInfo=function(){return TN(this,void 0,void 0,function(){return jN(this,function(e){switch(e.label){case 0:return[4,this._verifyConnectivityAndGetServerVersion({address:this._address})];case 1:return[2,e.sent()]}})})},NN);function NN(e){var t=e.id,r=e.config,n=e.log,o=e.address,i=e.userAgent,u=e.boltAgent,a=e.authTokenManager,e=e.newPool,t=SN.call(this,{id:t,config:r,log:n,userAgent:i,boltAgent:u,authTokenManager:a,newPool:e})||this;return t._address=o,t}g0.default=z0;var p0={},G0={},X_={},eg={},xN=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},DN=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))},LN=(Object.defineProperty(eg,"__esModule",{value:!0}),eg.createValidRoutingTable=void 0,e),Z0=LN.internal.constants,UN=Z0.ACCESS_MODE_WRITE,FN=Z0.ACCESS_MODE_READ,BN=LN.internal.serverAddress.ServerAddress,WN=LN.error.PROTOCOL_ERROR,qN=(zN.fromRawRoutingTable=HN,zN.prototype.forget=function(e){this.readers=VN(this.readers,e),this.writers=VN(this.writers,e)},zN.prototype.forgetRouter=function(e){this.routers=VN(this.routers,e)},zN.prototype.forgetWriter=function(e){this.writers=VN(this.writers,e)},zN.prototype.isStaleFor=function(e){return this.expirationTime.lessThan(Date.now())||this.routers.length<1||e===FN&&0===this.readers.length||e===UN&&0===this.writers.length},zN.prototype.isExpiredFor=function(e){return this.expirationTime.add(e).lessThan(Date.now())},zN.prototype.allServers=function(){return DN(DN(DN([],xN(this.routers),!1),xN(this.readers),!1),xN(this.writers),!1)},zN.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,"]]")},zN);function zN(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,LN.int)(0),this.ttl=e}function VN(e,t){return e.filter(function(e){return e.asKey()!==t.asKey()})}function HN(e,t,r){var n=r.ttl,o=function(t,r){try{var e=(0,LN.int)(Date.now()),n=(0,LN.int)(t.ttl).multiply(1e3).add(e);return n.lessThan(e)?LN.Integer.MAX_VALUE:n}catch(e){throw(0,LN.newError)("Unable to parse TTL entry from router ".concat(r," from raw routing table:\n").concat(LN.json.stringify(t),"\nError message: ").concat(e.message),WN)}}(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=YN(e).map(function(e){return BN.fromUrl(e)}):"WRITE"===t?i=YN(e).map(function(e){return BN.fromUrl(e)}):"READ"===t&&(o=YN(e).map(function(e){return BN.fromUrl(e)}))}),{routers:n,readers:o,writers:i}}catch(e){throw(0,LN.newError)("Unable to parse servers entry from router ".concat(r," from addresses:\n").concat(LN.json.stringify(t.servers),"\nError message: ").concat(e.message),WN)}}(r,t),u=i.routers,a=i.readers,i=i.writers;return GN(u,"routers",t),GN(a,"readers",t),new qN({database:e||r.db,routers:u,readers:a,writers:i,expirationTime:o,ttl:n})}function GN(e,t,r){if(0===e.length)throw(0,LN.newError)("Received no "+t+" from router "+r,WN)}function YN(e){if(Array.isArray(e))return Array.from(e);throw new TypeError("Array expected but got: "+e)}eg.default=qN,eg.createValidRoutingTable=HN;var dy=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},KN=(Object.defineProperty(X_,"__esModule",{value:!0}),dy(eg));function ZN(e){this._routingContext=e}ZN.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:KN.default.fromRawRoutingTable(r,n,e)})})},ZN.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})})},X_.default=ZN;var QN,XN,ng=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Zy=(Object.defineProperty(G0,"__esModule",{value:!0}),G0.RoutingTable=G0.Rediscovery=void 0,ng(X_)),L0=(G0.Rediscovery=Zy.default,ng(eg)),bg=(G0.RoutingTable=L0.default,G0.default=Zy.default,r&&r.__extends||(QN=function(e,t){return(QN=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}QN(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})),JN=r&&r.__assign||function(){return(JN=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)},$N=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]}),ex=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),gg=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)&&$N(t,e,r);return ex(t,e),t},tx=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())})},rx=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}}}},nx=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.")},ox=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.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ix=(Object.defineProperty(p0,"__esModule",{value:!0}),e),ux=gg(G0),ax=Ep,sx=$h(bv),Sl=$h(Ef),cx=Dc,lx=sp,fx=Gy,px=ix.error.SERVICE_UNAVAILABLE,dx=ix.error.SESSION_EXPIRED,hx=ix.internal.bookmarks.Bookmarks,Bc=ix.internal.constants,bx=Bc.ACCESS_MODE_READ,yx=Bc.ACCESS_MODE_WRITE,_x=Bc.BOLT_PROTOCOL_V3,vx=Bc.BOLT_PROTOCOL_V4_0,mx=Bc.BOLT_PROTOCOL_V4_4,gx=Bc.BOLT_PROTOCOL_V5_1,Ox=null,wx=(0,ix.int)(3e4),u=(XN=Sl.default,bg(Ex,XN),Ex.prototype._createConnectionErrorHandler=function(){return new lx.ConnectionErrorHandler(dx)},Ex.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||Ox),e},Ex.prototype._handleSecurityError=function(e,t,r,n){return this._log.warn("Routing driver ".concat(this._id," will close connections to ").concat(t," for database '").concat(n,"' because of an error ").concat(e.code," '").concat(e.message,"'")),XN.prototype._handleSecurityError.call(this,e,t,r,n)},Ex.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||Ox),(0,ix.newError)("No longer possible to write to server at "+t,dx,e)},Ex.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,d=e.auth;return tx(this,void 0,void 0,function(){var t,r,n,o,i,u,a=this;return rx(this,function(e){switch(e.label){case 0:return n={database:c||Ox},o=new lx.ConnectionErrorHandler(dx,function(e,t){return a._handleUnavailability(e,t,n.database)},function(e,t){return a._handleWriteFailure(e,t,n.database)},function(e,t,r){return a._handleSecurityError(e,t,r,n.database)}),[4,this._freshRoutingTable({accessMode:s,database:n.database,bookmarks:l,impersonatedUser:f,auth:d,onDatabaseNameResolved:function(e){n.database=n.database||e,p&&p(e)}})];case 1:if(u=e.sent(),s===bx)r=this._loadBalancingStrategy.selectReader(u.readers),t="read";else{if(s!==yx)throw(0,ix.newError)("Illegal mode "+s);r=this._loadBalancingStrategy.selectWriter(u.writers),t="write"}if(!r)throw(0,ix.newError)("Failed to obtain connection towards ".concat(t," server. Known routing table is: ").concat(u),dx);e.label=2;case 2:return e.trys.push([2,6,,7]),[4,this._connectionPool.acquire({auth:d},r)];case 3:return(i=e.sent(),d)?[4,this._verifyStickyConnection({auth:d,connection:i,address:r})]:[3,5];case 4:return e.sent(),[2,i];case 5:return[2,new lx.DelegateConnection(i,o)];case 6:throw u=e.sent(),o.handleAndTransformError(u,r);case 7:return[2]}})})},Ex.prototype._hasProtocolVersion=function(u){return tx(this,void 0,void 0,function(){var t,r,n,o,i;return rx(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,this._createChannelConnection(t[n])];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]}})})},Ex.prototype.supportsMultiDb=function(){return tx(this,void 0,void 0,function(){return rx(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return vx<=e})];case 1:return[2,e.sent()]}})})},Ex.prototype.supportsTransactionConfig=function(){return tx(this,void 0,void 0,function(){return rx(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return _x<=e})];case 1:return[2,e.sent()]}})})},Ex.prototype.supportsUserImpersonation=function(){return tx(this,void 0,void 0,function(){return rx(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return mx<=e})];case 1:return[2,e.sent()]}})})},Ex.prototype.supportsSessionAuth=function(){return tx(this,void 0,void 0,function(){return rx(this,function(e){switch(e.label){case 0:return[4,this._hasProtocolVersion(function(e){return gx<=e})];case 1:return[2,e.sent()]}})})},Ex.prototype.getNegotiatedProtocolVersion=function(){var r=this;return new Promise(function(e,t){r._hasProtocolVersion(e).catch(t)})},Ex.prototype.verifyAuthentication=function(e){var n=e.database,o=e.accessMode,i=e.auth;return tx(this,void 0,void 0,function(){var t=this;return rx(this,function(e){return[2,this._verifyAuthentication({auth:i,getAddress:function(){return tx(t,void 0,void 0,function(){var t,r;return rx(this,function(e){switch(e.label){case 0:return t={database:n||Ox},[4,this._freshRoutingTable({accessMode:o,database:t.database,auth:i,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:if(r=e.sent(),0===(r=o===yx?r.writers:r.readers).length)throw(0,ix.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(o,"'"),px);return[2,r[0]]}})})}})]})})},Ex.prototype.verifyConnectivityAndGetServerInfo=function(e){var l=e.database,f=e.accessMode;return tx(this,void 0,void 0,function(){var t,r,n,o,i,u,a,s,c;return rx(this,function(e){switch(e.label){case 0:return t={database:l||Ox},[4,this._freshRoutingTable({accessMode:f,database:t.database,onDatabaseNameResolved:function(e){t.database=t.database||e}})];case 1:r=e.sent(),r=f===yx?r.writers:r.readers,n=(0,ix.newError)("No servers available for database '".concat(t.database,"' with access mode '").concat(f,"'"),px),e.label=2;case 2:e.trys.push([2,9,10,11]),o=nx(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}})})},Ex.prototype.forget=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forget(t)}}),this._connectionPool.purge(t).catch(function(){})},Ex.prototype.forgetWriter=function(t,e){this._routingTableRegistry.apply(e,{applyWhenExists:function(e){return e.forgetWriter(t)}})},Ex.prototype._freshRoutingTable=function(e){var e=void 0===e?{}:e,t=e.accessMode,r=e.database,n=e.bookmarks,o=e.impersonatedUser,i=e.onDatabaseNameResolved,e=e.auth,u=this._routingTableRegistry.get(r,function(){return new ux.RoutingTable({database:r})});return u.isStaleFor(t)?(this._log.info('Routing table is stale for database: "'.concat(r,'" and access mode: "').concat(t,'": ').concat(u)),this._refreshRoutingTable(u,n,o,e).then(function(e){return i(e.database),e})):u},Ex.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)},Ex.prototype._fetchRoutingTableFromSeedRouterFallbackToKnownRouters=function(u,a,s,c,l){return tx(this,void 0,void 0,function(){var t,r,n,o,i;return rx(this,function(e){switch(e.label){case 0:return t=[],[4,this._fetchRoutingTableUsingSeedRouter(t,this._seedRouter,a,s,c,l)];case 1:return(t=ox.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,l)];case 3:i=ox.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,n)];case 5:return[2,e.sent()]}})})},Ex.prototype._fetchRoutingTableFromKnownRoutersFallbackToSeedRouter=function(o,i,u,a,s){return tx(this,void 0,void 0,function(){var t,r,n;return rx(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTableUsingKnownRouters(o,i,u,a,s)];case 1:return r=ox.apply(void 0,[e.sent(),2]),t=r[0],r=r[1],t?[3,3]:[4,this._fetchRoutingTableUsingSeedRouter(o,this._seedRouter,i,u,a,s)];case 2:n=ox.apply(void 0,[e.sent(),2]),t=n[0],r=n[1],e.label=3;case 3:return[4,this._applyRoutingTableIfPossible(i,t,r)];case 4:return[2,e.sent()]}})})},Ex.prototype._fetchRoutingTableUsingKnownRouters=function(n,o,i,u,a){return tx(this,void 0,void 0,function(){var t,r;return rx(this,function(e){switch(e.label){case 0:return[4,this._fetchRoutingTable(n,o,i,u,a)];case 1:return(t=ox.apply(void 0,[e.sent(),2]),r=t[0],t=t[1],r)?[2,[r,null]]:(r=n.length-1,Ex._forgetRouter(o,n,r),[2,[null,t]])}})})},Ex.prototype._fetchRoutingTableUsingSeedRouter=function(r,n,o,i,u,a){return tx(this,void 0,void 0,function(){var t;return rx(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,a)];case 2:return[2,e.sent()]}})})},Ex.prototype._resolveSeedRouter=function(n){return tx(this,void 0,void 0,function(){var t,r=this;return rx(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)]}})})},Ex.prototype._fetchRoutingTable=function(s,c,l,f,p){return tx(this,void 0,void 0,function(){var t=this;return rx(this,function(e){return[2,s.reduce(function(i,u,a){return tx(t,void 0,void 0,function(){var t,r,n,o;return rx(this,function(e){switch(e.label){case 0:return[4,i];case 1:return(t=ox.apply(void 0,[e.sent(),1]),t=t[0])?[2,[t,null]]:(Ex._forgetRouter(c,s,a-1),[4,this._createSessionForRediscovery(u,l,f,p)]);case 2:if(t=ox.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]))]})})},Ex.prototype._createSessionForRediscovery=function(o,i,u,a){return tx(this,void 0,void 0,function(){var t,r,n=this;return rx(this,function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),[4,this._connectionPool.acquire({auth:a},o)];case 1:return(t=e.sent(),a)?[4,this._verifyStickyConnection({auth:a,connection:t,address:o})]:[3,3];case 2:e.sent(),e.label=3;case 3:return r=lx.ConnectionErrorHandler.create({errorCode:dx,handleSecurityError:function(e,t,r){return n._handleSecurityError(e,t,r)}}),r=t._sticky?new lx.DelegateConnection(t):new lx.DelegateConnection(t,r),r=new sx.default(r),t.protocol().version<4?[2,[new ix.Session({mode:yx,bookmarks:hx.empty(),connectionProvider:r}),null]]:[2,[new ix.Session({mode:bx,database:"system",bookmarks:i,connectionProvider:r,impersonatedUser:u}),null]];case 4:return r=e.sent(),[2,this._handleRediscoveryError(r,o)];case 5:return[2]}})})},Ex.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","N/A"].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,ix.newError)("Server at ".concat(t.asHostPort()," can't perform routing. Make sure you are connecting to a causal cluster"),px,e);var r;return this._log.warn("unable to fetch routing table because of an error ".concat(e)),[null,e]},Ex.prototype._applyRoutingTableIfPossible=function(t,r,n){return tx(this,void 0,void 0,function(){return rx(this,function(e){switch(e.label){case 0:if(r)return 0===r.writers.length&&(this._useSeedRouter=!0),[4,this._updateRoutingTable(r)];throw(0,ix.newError)("Could not perform discovery. No routing servers available. Known routing table: ".concat(t),px,n);case 1:return e.sent(),[2,r]}})})},Ex.prototype._updateRoutingTable=function(t){return tx(this,void 0,void 0,function(){return rx(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),this._log.info("Updated routing table ".concat(t)),[2]}})})},Ex._forgetRouter=function(e,t,r){t=t[r];e&&t&&e.forgetRouter(t)},Ex);function Ex(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.boltAgent,c=e.authTokenManager,l=e.routingTablePurgeDelay,e=e.newPool,f=XN.call(this,{id:t,config:i,log:u,userAgent:a,boltAgent:s,authTokenManager:c,newPool:e},function(n){return tx(f,void 0,void 0,function(){var t,r;return rx(this,function(e){switch(e.label){case 0:return t=lx.createChannelConnection,r=[n,this._config,this._createConnectionErrorHandler(),this._log],[4,this._clientCertificateHolder.getClientCertificate()];case 1:return[2,t.apply(void 0,r.concat([e.sent(),this._routingContext]))]}})})})||this;return f._routingContext=JN(JN({},n),{address:r.toString()}),f._seedRouter=r,f._rediscovery=new ux.default(f._routingContext),f._loadBalancingStrategy=new cx.LeastConnectedLoadBalancingStrategy(f._connectionPool),f._hostNameResolver=o,f._dnsResolver=new ax.HostNameResolver,f._log=u,f._useSeedRouter=!0,f._routingTableRegistry=new qx(l?(0,ix.int)(l):wx),f._refreshRoutingTable=fx.functional.reuseOngoingRequest(f._refreshRoutingTable,f),f}p0.default=u;zx.prototype.register=function(e){return this._tables.set(e.database,e),this},zx.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},zx.prototype.get=function(e,t){return this._tables.has(e)?this._tables.get(e):"function"==typeof t?t():t},zx.prototype.removeExpired=function(){var t=this;return this._removeIf(function(e){return e.isExpiredFor(t._routingTablePurgeDelay)})},zx.prototype._forEach=function(e){var t,r;try{for(var n=nx(this._tables),o=n.next();!o.done;o=n.next())e(ox(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},zx.prototype._remove=function(e){return this._tables.delete(e),this},zx.prototype._removeIf=function(e){var t,r;try{for(var n=nx(this._tables),o=n.next();!o.done;o=n.next()){var i=ox(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 Px,Sx,Tx,jx,Cx,Rx,Ix,Ax,kx,Mx,Nx,x,xx,Dx,Lx,Ux,Fx,Bx,Wx,qx=zx;function zx(e){this._tables=new Map,this._routingTablePurgeDelay=e}function Vx(e,t,r){void 0===r&&(r={}),Lx(e,"Bolt URL");var n,o=Bx.parseDatabaseUrl(e),i=!1,u=!1;switch(o.scheme){case"bolt":break;case"bolt+s":u=!0,n="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";break;case"bolt+ssc":u=!0,n="TRUST_ALL_CERTIFICATES";break;case"neo4j":i=!0;break;case"neo4j+s":n="TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",i=u=!0;break;case"neo4j+ssc":n="TRUST_ALL_CERTIFICATES",i=u=!0;break;default:throw new Error("Unknown scheme: ".concat(o.scheme))}if(u){if("encrypted"in r||"trust"in r)throw new Error("Encryption/trust can only be configured either through URL or config, not both");r.encrypted=Dx,r.trust=n,r.clientCertificate=(0,x.resolveCertificateProvider)(r.clientCertificate)}var a=function(e){if("object"==typeof(t=e)&&null!=t&&"getToken"in t&&"handleSecurityException"in t&&"function"==typeof t.getToken&&"function"==typeof t.handleSecurityException)return e;var t=e;return(t=t||{}).scheme=t.scheme||"none",(0,x.staticAuthTokenManager)({authToken:t})}(t),s=(r.userAgent=r.userAgent||Wx,r.boltAgent=x.internal.boltAgent.fromVersion(Nx.default),Fx.fromUrl(o.hostAndPort)),t={address:s,typename:i?"Routing":"Direct",routing:i};return new Mx.Driver(t,r,function(){{if(i)return function(e,t,r,n){return new xx.RoutingConnectionProvider({id:e,config:t,log:r,hostNameResolver:n,authTokenManager:a,address:s,userAgent:t.userAgent,boltAgent:t.boltAgent,routingContext:o.query})};if(Ux(o.query))return function(e,t,r){return new xx.DirectConnectionProvider({id:e,config:t,log:r,authTokenManager:a,address:s,userAgent:t.userAgent,boltAgent:t.boltAgent})};throw new Error("Parameters are not supported with none routed scheme. Given URL: '".concat(e,"'"))}}())}function Hx(r,n){return Ax(this,void 0,void 0,function(){var t;return kx(this,function(e){switch(e.label){case 0:t=Vx(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 pl=ap,Px=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(pl,"__esModule",{value:!0}),pl.RoutingConnectionProvider=pl.DirectConnectionProvider=pl.PooledConnectionProvider=pl.SingleConnectionProvider=void 0,Sx=bv,Object.defineProperty(pl,"SingleConnectionProvider",{enumerable:!0,get:function(){return Px(Sx).default}}),Tx=Ef,Object.defineProperty(pl,"PooledConnectionProvider",{enumerable:!0,get:function(){return Px(Tx).default}}),jx=g0,Object.defineProperty(pl,"DirectConnectionProvider",{enumerable:!0,get:function(){return Px(jx).default}}),Cx=p0,Object.defineProperty(pl,"RoutingConnectionProvider",{enumerable:!0,get:function(){return Px(Cx).default}}),fg=p,Rx=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]}),Ix=r&&r.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),v=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)&&Rx(t,e,r);return Ix(t,e),t},i=r&&r.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Rx(t,e,r)},Object.defineProperty(fg,"__esModule",{value:!0}),fg.packstream=fg.channel=fg.buf=fg.bolt=fg.loadBalancing=void 0,fg.loadBalancing=v(Dc),fg.bolt=v(y),fg.buf=v(id),fg.channel=v(Ep),fg.packstream=v(Q_),i(ap,fg),R=L,Ax=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())})},kx=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}}}},j=r&&r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Object.defineProperty(R,"__esModule",{value:!0}),R.UnboundRelationship=R.Relationship=R.Node=R.Record=R.ServerInfo=R.GqlStatusObject=R.Notification=R.QueryStatistics=R.ProfiledPlan=R.Plan=R.ResultSummary=R.RxResult=R.RxManagedTransaction=R.RxTransaction=R.RxSession=R.EagerResult=R.Result=R.ManagedTransaction=R.Transaction=R.Session=R.Driver=R.temporal=R.spatial=R.graph=R.error=R.routing=R.session=R.types=R.logging=R.auth=R.isRetryableError=R.Neo4jError=R.integer=R.isUnboundRelationship=R.isRelationship=R.isPathSegment=R.isPath=R.isNode=R.isDateTime=R.isLocalDateTime=R.isDate=R.isTime=R.isLocalTime=R.isDuration=R.isPoint=R.isInt=R.int=R.hasReachableServer=R.driver=R.authTokenManagers=void 0,R.clientCertificateProviders=R.notificationFilterMinimumSeverityLevel=R.notificationFilterDisabledClassification=R.notificationFilterDisabledCategory=R.notificationSeverityLevel=R.notificationClassification=R.notificationCategory=R.resultTransformers=R.bookmarkManager=R.DateTime=R.LocalDateTime=R.Date=R.Time=R.LocalTime=R.Duration=R.Integer=R.Point=R.PathSegment=R.Path=void 0,Mx=U,Object.defineProperty(R,"Driver",{enumerable:!0,get:function(){return Mx.Driver}}),Nx=j(g),x=e,Object.defineProperty(R,"authTokenManagers",{enumerable:!0,get:function(){return x.authTokenManagers}}),Object.defineProperty(R,"Neo4jError",{enumerable:!0,get:function(){return x.Neo4jError}}),Object.defineProperty(R,"isRetryableError",{enumerable:!0,get:function(){return x.isRetryableError}}),Object.defineProperty(R,"error",{enumerable:!0,get:function(){return x.error}}),Object.defineProperty(R,"Integer",{enumerable:!0,get:function(){return x.Integer}}),Object.defineProperty(R,"int",{enumerable:!0,get:function(){return x.int}}),Object.defineProperty(R,"isInt",{enumerable:!0,get:function(){return x.isInt}}),Object.defineProperty(R,"isPoint",{enumerable:!0,get:function(){return x.isPoint}}),Object.defineProperty(R,"Point",{enumerable:!0,get:function(){return x.Point}}),Object.defineProperty(R,"Date",{enumerable:!0,get:function(){return x.Date}}),Object.defineProperty(R,"DateTime",{enumerable:!0,get:function(){return x.DateTime}}),Object.defineProperty(R,"Duration",{enumerable:!0,get:function(){return x.Duration}}),Object.defineProperty(R,"isDate",{enumerable:!0,get:function(){return x.isDate}}),Object.defineProperty(R,"isDateTime",{enumerable:!0,get:function(){return x.isDateTime}}),Object.defineProperty(R,"isDuration",{enumerable:!0,get:function(){return x.isDuration}}),Object.defineProperty(R,"isLocalDateTime",{enumerable:!0,get:function(){return x.isLocalDateTime}}),Object.defineProperty(R,"isLocalTime",{enumerable:!0,get:function(){return x.isLocalTime}}),Object.defineProperty(R,"isNode",{enumerable:!0,get:function(){return x.isNode}}),Object.defineProperty(R,"isPath",{enumerable:!0,get:function(){return x.isPath}}),Object.defineProperty(R,"isPathSegment",{enumerable:!0,get:function(){return x.isPathSegment}}),Object.defineProperty(R,"isRelationship",{enumerable:!0,get:function(){return x.isRelationship}}),Object.defineProperty(R,"isTime",{enumerable:!0,get:function(){return x.isTime}}),Object.defineProperty(R,"isUnboundRelationship",{enumerable:!0,get:function(){return x.isUnboundRelationship}}),Object.defineProperty(R,"LocalDateTime",{enumerable:!0,get:function(){return x.LocalDateTime}}),Object.defineProperty(R,"LocalTime",{enumerable:!0,get:function(){return x.LocalTime}}),Object.defineProperty(R,"Time",{enumerable:!0,get:function(){return x.Time}}),Object.defineProperty(R,"Node",{enumerable:!0,get:function(){return x.Node}}),Object.defineProperty(R,"Path",{enumerable:!0,get:function(){return x.Path}}),Object.defineProperty(R,"PathSegment",{enumerable:!0,get:function(){return x.PathSegment}}),Object.defineProperty(R,"Relationship",{enumerable:!0,get:function(){return x.Relationship}}),Object.defineProperty(R,"UnboundRelationship",{enumerable:!0,get:function(){return x.UnboundRelationship}}),Object.defineProperty(R,"Record",{enumerable:!0,get:function(){return x.Record}}),Object.defineProperty(R,"ResultSummary",{enumerable:!0,get:function(){return x.ResultSummary}}),Object.defineProperty(R,"Plan",{enumerable:!0,get:function(){return x.Plan}}),Object.defineProperty(R,"ProfiledPlan",{enumerable:!0,get:function(){return x.ProfiledPlan}}),Object.defineProperty(R,"QueryStatistics",{enumerable:!0,get:function(){return x.QueryStatistics}}),Object.defineProperty(R,"Notification",{enumerable:!0,get:function(){return x.Notification}}),Object.defineProperty(R,"GqlStatusObject",{enumerable:!0,get:function(){return x.GqlStatusObject}}),Object.defineProperty(R,"ServerInfo",{enumerable:!0,get:function(){return x.ServerInfo}}),Object.defineProperty(R,"Result",{enumerable:!0,get:function(){return x.Result}}),Object.defineProperty(R,"EagerResult",{enumerable:!0,get:function(){return x.EagerResult}}),Object.defineProperty(R,"auth",{enumerable:!0,get:function(){return x.auth}}),Object.defineProperty(R,"Session",{enumerable:!0,get:function(){return x.Session}}),Object.defineProperty(R,"Transaction",{enumerable:!0,get:function(){return x.Transaction}}),Object.defineProperty(R,"ManagedTransaction",{enumerable:!0,get:function(){return x.ManagedTransaction}}),Object.defineProperty(R,"bookmarkManager",{enumerable:!0,get:function(){return x.bookmarkManager}}),Object.defineProperty(R,"routing",{enumerable:!0,get:function(){return x.routing}}),Object.defineProperty(R,"resultTransformers",{enumerable:!0,get:function(){return x.resultTransformers}}),Object.defineProperty(R,"notificationCategory",{enumerable:!0,get:function(){return x.notificationCategory}}),Object.defineProperty(R,"notificationClassification",{enumerable:!0,get:function(){return x.notificationClassification}}),Object.defineProperty(R,"notificationSeverityLevel",{enumerable:!0,get:function(){return x.notificationSeverityLevel}}),Object.defineProperty(R,"notificationFilterDisabledCategory",{enumerable:!0,get:function(){return x.notificationFilterDisabledCategory}}),Object.defineProperty(R,"notificationFilterDisabledClassification",{enumerable:!0,get:function(){return x.notificationFilterDisabledClassification}}),Object.defineProperty(R,"notificationFilterMinimumSeverityLevel",{enumerable:!0,get:function(){return x.notificationFilterMinimumSeverityLevel}}),Object.defineProperty(R,"clientCertificateProviders",{enumerable:!0,get:function(){return x.clientCertificateProviders}}),xx=p,nO=j(V),R.RxSession=nO.default,n=j(P),R.RxTransaction=n.default,Y=j(_),R.RxManagedTransaction=Y.default,j=j(t),R.RxResult=j.default,Dg=x.internal.util,Dx=Dg.ENCRYPTION_ON,Lx=Dg.assertString,Ux=Dg.isEmptyObjectOrNull,Fx=x.internal.serverAddress.ServerAddress,Bx=x.internal.urlUtil,Wx="neo4j-javascript/"+Nx.default,R.driver=Vx,R.hasReachableServer=Hx,Dg={console:function(e){return{level:e,logger:function(e,t){return console.log("".concat(r.Date.now()," ").concat(e.toUpperCase()," ").concat(t))}}}},R.logging=Dg,o={Node:x.Node,Relationship:x.Relationship,UnboundRelationship:x.UnboundRelationship,PathSegment:x.PathSegment,Path:x.Path,Result:x.Result,EagerResult:x.EagerResult,ResultSummary:x.ResultSummary,Record:x.Record,Point:x.Point,Date:x.Date,DateTime:x.DateTime,Duration:x.Duration,LocalDateTime:x.LocalDateTime,LocalTime:x.LocalTime,Time:x.Time,Integer:x.Integer},R.types=o,$s={READ:Mx.READ,WRITE:Mx.WRITE},R.session=$s,Zs={toNumber:x.toNumber,toString:x.toString,inSafeRange:x.inSafeRange},R.integer=Zs,m={isPoint:x.isPoint},R.spatial=m,_m={isDuration:x.isDuration,isLocalTime:x.isLocalTime,isTime:x.isTime,isDate:x.isDate,isLocalDateTime:x.isLocalDateTime,isDateTime:x.isDateTime},R.temporal=_m,Ky={isNode:x.isNode,isPath:x.isPath,isPathSegment:x.isPathSegment,isRelationship:x.isRelationship,isUnboundRelationship:x.isUnboundRelationship},R.graph=Ky,Zs={authTokenManagers:x.authTokenManagers,driver:Vx,hasReachableServer:Hx,int:x.int,isInt:x.isInt,isPoint:x.isPoint,isDuration:x.isDuration,isLocalTime:x.isLocalTime,isTime:x.isTime,isDate:x.isDate,isLocalDateTime:x.isLocalDateTime,isDateTime:x.isDateTime,isNode:x.isNode,isPath:x.isPath,isPathSegment:x.isPathSegment,isRelationship:x.isRelationship,isUnboundRelationship:x.isUnboundRelationship,integer:Zs,Neo4jError:x.Neo4jError,isRetryableError:x.isRetryableError,auth:x.auth,logging:Dg,types:o,session:$s,routing:x.routing,error:x.error,graph:Ky,spatial:m,temporal:_m,Driver:Mx.Driver,Session:x.Session,Transaction:x.Transaction,ManagedTransaction:x.ManagedTransaction,Result:x.Result,EagerResult:x.EagerResult,RxSession:nO.default,RxTransaction:n.default,RxManagedTransaction:Y.default,RxResult:j.default,ResultSummary:x.ResultSummary,Plan:x.Plan,ProfiledPlan:x.ProfiledPlan,QueryStatistics:x.QueryStatistics,Notification:x.Notification,GqlStatusObject:x.GqlStatusObject,ServerInfo:x.ServerInfo,Record:x.Record,Node:x.Node,Relationship:x.Relationship,UnboundRelationship:x.UnboundRelationship,Path:x.Path,PathSegment:x.PathSegment,Point:x.Point,Integer:x.Integer,Duration:x.Duration,LocalTime:x.LocalTime,Time:x.Time,Date:x.Date,LocalDateTime:x.LocalDateTime,DateTime:x.DateTime,bookmarkManager:x.bookmarkManager,resultTransformers:x.resultTransformers,notificationCategory:x.notificationCategory,notificationSeverityLevel:x.notificationSeverityLevel,notificationFilterDisabledCategory:x.notificationFilterDisabledCategory,notificationFilterMinimumSeverityLevel:x.notificationFilterMinimumSeverityLevel,clientCertificateProviders:x.clientCertificateProviders},R.default=Zs,D(L)});