@nmshd/transport 1.1.4 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildInformation.js +5 -5
- package/dist/modules/files/FileController.js +2 -1
- package/dist/modules/files/FileController.js.map +1 -1
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js +2 -1
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js.map +1 -1
- package/dist/modules/tokens/TokenController.js +16 -4
- package/dist/modules/tokens/TokenController.js.map +1 -1
- package/lib-web/nmshd.transport.js +257 -124
- package/lib-web/nmshd.transport.js.map +1 -1
- package/lib-web/nmshd.transport.min.js +1 -1
- package/lib-web/nmshd.transport.min.js.map +1 -1
- package/package.json +22 -22
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see nmshd.transport.min.js.LICENSE.txt */
|
|
2
|
-
var NMSHDTransport;(()=>{var e={2500:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildInformation=void 0;const n=r(194),i=r(2890);t.buildInformation={version:"1.1.4",build:"16",date:"2022-01-03T10:30:14+00:00",commit:"d2352a36a63834c46a5fc86dd75e6d703aaba74f",dependencies:{"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.0","@js-soft/ts-utils":"1.1.1",axios:"^0.24.0","deep-equal":"^2.0.5","fast-json-patch":"^3.1.0","form-data":"^4.0.0","json-stringify-safe":"^5.0.1",lodash:"^4.17.21",luxon:"^2.2.0",qs:"^6.10.2","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1",uuid:"^8.3.2"},libraries:{crypto:i.buildInformation,serval:n.buildInformation}}},4093:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreCrypto=void 0;const n=r(2890),i=r(2212),o=r(18),a=r(819);t.CoreCrypto=class CoreCrypto{static async generateSignatureKeypair(e=a.TransportVersion.Latest){if(e===a.TransportVersion.V1)return await n.CryptoSignatures.generateKeypair(3);throw o.TransportErrors.util.crypto.invalidVersion(e)}static async generateExchangeKeypair(e=a.TransportVersion.Latest){if(e===a.TransportVersion.V1)return await n.CryptoExchange.generateKeypair(3);throw o.TransportErrors.util.crypto.invalidVersion(e)}static async generateSecretKey(e=a.TransportVersion.Latest){if(e===a.TransportVersion.V1)return await n.CryptoEncryption.generateKey(3);throw o.TransportErrors.util.crypto.invalidVersion(e)}static async generatePassword(e,t="enmeshed",r=3,i=a.TransportVersion.Latest){const s=n.CoreBuffer.fromString(e,n.Encoding.Utf8),c=n.CoreBuffer.fromString(t,n.Encoding.Utf8);if(i===a.TransportVersion.V1)return await n.CryptoDerivation.deriveKeyFromMaster(s,15e4,r,c);throw o.TransportErrors.util.crypto.invalidVersion(i)}static async deriveKeyFromBase(e,t,r,i=3){let a;if(e instanceof n.CryptoSecretKey)a=e.secretKey;else{if(!(e instanceof n.CoreBuffer))throw o.TransportErrors.util.crypto.invalidSecretType();a=e}return await n.CryptoDerivation.deriveKeyFromBase(a,t,r,i)}static async deriveClient(e,t,r=3,i=a.TransportVersion.Latest){if(i===a.TransportVersion.V1){return await n.CryptoExchange.deriveTemplator(e,t,r)}throw o.TransportErrors.util.crypto.invalidVersion(i)}static async deriveServer(e,t,r=3,i=a.TransportVersion.Latest){if(i===a.TransportVersion.V1){return await n.CryptoExchange.deriveRequestor(e,t,r)}throw o.TransportErrors.util.crypto.invalidVersion(i)}static async sign(e,t,r=a.TransportVersion.Latest){if(r===a.TransportVersion.V1)return await n.CryptoSignatures.sign(e,t,2);throw o.TransportErrors.util.crypto.invalidVersion(r)}static async verify(e,t,r,i=a.TransportVersion.Latest){if(i===a.TransportVersion.V1)return await n.CryptoSignatures.verify(e,t,r);throw o.TransportErrors.util.crypto.invalidVersion(i)}static async encrypt(e,t,r=a.TransportVersion.Latest){if(r===a.TransportVersion.V1)return await n.CryptoEncryption.encrypt(e,t);throw o.TransportErrors.util.crypto.invalidVersion(r)}static async decrypt(e,t,r=a.TransportVersion.Latest){if(r===a.TransportVersion.V1)return await n.CryptoEncryption.decrypt(e,t);throw o.TransportErrors.util.crypto.invalidVersion(r)}static async random(e){return await n.CryptoRandom.bytes(e)}static async createAccountPassword(){return await i.PasswordGenerator.createStrongPassword(100,100)}}},8147:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreError=void 0;const i=n(r(4530));class CoreError extends Error{constructor(e="error.unknown",t="Operation failed unexpectedly.",r=null,n=new Date,o,a){const s=[];s.push(e),t&&s.push(": '",t,"'"),s.push(" at ",n.toISOString()),r&&("function"==typeof r.toJSON?s.push(` with data ${r.toJSON(!1)}`):s.push(` with data ${(0,i.default)(r)}`)),super(s.join("")),this._code=e,this._reason=t,this._time=n,this._data=r,this.name="CoreError",this._rootError=o,this._context=a,void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,null!=a?a:CoreError)}get code(){return this._code}get reason(){return this._reason}get data(){return this._data}get time(){return this._time}get rootError(){return this._rootError}get context(){return this._context}equals(e){return this.code===e.code}logWith(e){return e.error(this),this}}t.CoreError=CoreError},3289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreIdHelper=void 0;const n=r(5833),i=r(9170);t.CoreIdHelper=class CoreIdHelper{constructor(e,t=!1){this.prefix=e,this.validateOnly=t,this.coreIdRegex=new RegExp(`${e}[${n.RandomCharacterRange.Alphanumeric}]{${20-e.length}}`)}async generate(){if(this.validateOnly)throw new Error("This CoreIdHelper is set up for validation only.");return await i.CoreId.generate(this.prefix)}validate(e){return this.coreIdRegex.test(e)}}},6904:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreSerializable=void 0;const o=r(194),a=r(2890);let s=n=class CoreSerializable extends o.Serializable{toBase64(){return a.CoreBuffer.fromUtf8(this.serialize()).toBase64URL()}static from(e,t){return super.fromT(e,t)}static fromT(e,t){return super.fromT(e,t)}static fromBase64T(e,t){const r=a.CoreBuffer.fromBase64URL(e).toUtf8();return n.deserializeT(r,t)}static fromBase64Unknown(e){const t=a.CoreBuffer.fromBase64URL(e).toUtf8();return o.Serializable.deserializeUnknown(t)}};s=n=i([(0,o.type)("CoreSerializable")],s),t.CoreSerializable=s},2970:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreSerializableAsync=void 0;const o=r(194),a=r(2890);let s=n=class CoreSerializableAsync extends o.SerializableAsync{toBase64(){return a.CoreBuffer.fromUtf8(this.serialize()).toBase64URL()}static async from(e,t){return await super.from(e,t)}static async fromT(e,t){return await super.fromT(e,t)}static async fromBase64T(e,t){const r=a.CoreBuffer.fromBase64URL(e).toUtf8();return await n.deserializeT(r,t)}static async fromBase64Unknown(e){const t=a.CoreBuffer.fromBase64URL(e).toUtf8();return await o.SerializableAsync.deserializeUnknown(t)}};s=n=i([(0,o.type)("CoreSerializableAsync")],s),t.CoreSerializableAsync=s},6564:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreSynchronizable=void 0;const o=r(194),a=r(2970),s=r(9170);class CoreSynchronizable extends a.CoreSerializableAsync{constructor(){super(...arguments),this.technicalProperties=[],this.userdataProperties=[],this.metadataProperties=[]}}n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],CoreSynchronizable.prototype,"id",void 0),t.CoreSynchronizable=CoreSynchronizable},1341:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreUtil=void 0;const n=r(194),i=r(2890),o=r(18);t.CoreUtil=class CoreUtil{static toBuffer(e,t=!1){let r;if(e instanceof i.CoreBuffer)return e;if("string"==typeof e)r=i.CoreBuffer.fromUtf8(e);else if(e instanceof n.SerializableAsync||e instanceof n.Serializable)r=i.CoreBuffer.fromUtf8(e.serialize(t));else{if(!(e instanceof ArrayBuffer||e instanceof Uint8Array))throw o.TransportErrors.util.wrongContentForBuffer();r=new i.CoreBuffer(e)}return r}static toSerializable(e){return e instanceof n.SerializableAsync||e instanceof n.Serializable?e:n.Serializable.fromUnknown(e)}}},369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DbCollectionName=void 0,function(e){e.Files="Files",e.Tokens="Tokens",e.Relationships="Relationships",e.RelationshipTemplates="Templates",e.Messages="Messages",e.CertificatesIssued="CertificatesIssued",e.UnpushedDatawalletModifications="UnpushedDatawalletModifications",e.Devices="Devices",e.Secrets="Secrets"}(t.DbCollectionName||(t.DbCollectionName={}))},5796:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2685:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=void 0;const i=r(2391),o=r(2890),a=n(r(6486)),s=r(2016),c=r(981),l=r(18),u=r(392);let p;class Transport{constructor(e,t,r=new i.SimpleLoggerFactory){if(this.databaseConnection=e,this._config=a.default.defaultsDeep({},t,Transport.defaultConfig),u.TransportLoggerFactory.init(r),p=u.TransportLoggerFactory.getLogger(Transport),!this._config.platformClientId)throw l.TransportErrors.general.platformClientIdNotSet().logWith(p);if(!this._config.platformClientSecret)throw l.TransportErrors.general.platformClientSecretNotSet().logWith(p);if(!this._config.baseUrl)throw l.TransportErrors.general.baseUrlNotSet().logWith(p);if(this._config.supportedDatawalletVersion<1)throw l.TransportErrors.general.invalidDatawalletVersion().logWith(p)}get config(){return this._config}async init(){return p.trace("Initializing Libsodium..."),await o.SodiumWrapper.ready(),p.trace("Libsodium initialized"),p.info("Transport initialized"),this}async createDatabase(e){return await this.databaseConnection.getDatabase(e)}static get context(){return c.TransportContext.currentContext()}}t.Transport=Transport,Transport.defaultConfig={supportedDatawalletVersion:1,debug:!1,platformClientId:"",platformClientSecret:"",platformTimeout:6e4,platformMaxRedirects:10,platformMaxUnencryptedFileSize:10485760,baseUrl:"",realm:s.Realm.Prod,datawalletEnabled:!1,httpAgent:{keepAlive:!0,maxSockets:5,maxFreeSockets:2},httpsAgent:{keepAlive:!0,maxSockets:5,maxFreeSockets:2}}},981:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportContext=void 0,function(e){e.Web="Web",e.Cordova="Cordova",e.Node="Node"}(t.TransportContext||(t.TransportContext={})),function(e){let t;e.currentContext=function currentContext(){return t||(t=function _queryContext(){return"undefined"==typeof window?e.Node:window.isCordovaApp?e.Cordova:e.Web}()),t}}(t.TransportContext||(t.TransportContext={}))},2508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportController=t.ControllerName=void 0;const n=r(2970),i=r(18),o=r(392);!function(e){e.Account="Account",e.Attribute="Attribute",e.Certificate="Certificate",e.CertificateIssuer="CertificateIssuer",e.CertificateValidator="CertificateValidator",e.Challenge="Challenge",e.Device="Device",e.Devices="Devices",e.DeviceSecret="DeviceSecret",e.File="File",e.Identity="Identity",e.Message="Message",e.Relationship="Relationship",e.Relationships="Relationships",e.RelationshipTemplate="RelationshipTemplate",e.RelationshipRequest="RelationshipRequest",e.RelationshipRequestor="RelationshipRequestor",e.RelationshipSecret="RelationshipSecret",e.RelationshipTemplator="RelationshipTemplator",e.Secret="Secret",e.Sync="Sync",e.Token="Token"}(t.ControllerName||(t.ControllerName={}));t.TransportController=class TransportController{constructor(e,t){var r;this._dbClosed=!1,this._controllerName=e,this._transport=t.transport,this._parent=t,this._config=t.config,this._db=t.db,this._initialized=!1;let n=e;this.config.debug&&(null===(r=this.parent.activeDeviceOrUndefined)||void 0===r?void 0:r.deviceOrUndefined)&&(n+=` of ${this.parent.activeDevice.device.id}`),this._log=o.TransportLoggerFactory.getLogger(n)}get log(){return this._log}get config(){return this._config}get db(){return this._db}get transport(){return this._transport}get parent(){return this._parent}get initialized(){return this._initialized}get controllerName(){return this._controllerName}init(){if(this._initialized)throw i.TransportErrors.controller.alreadyInitialized(this.controllerName).logWith(this._log);return this._initialized=!0,Promise.resolve(this)}async parseObject(e,t){return await n.CoreSerializableAsync.fromT(e,t)}async parseArray(e,t,r){const n=[];for(let o=0,a=e.length;o<a;o++)if(r){const a=e[o];if(!a[r])throw i.TransportErrors.controller.contentPropertyUndefined(r).logWith(this._log);n.push(this.parseObject(a[r],t))}else n.push(this.parseObject(e[o],t));return await Promise.all(n)}}},18:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TransportErrors=void 0;const i=n(r(4530)),o=r(8147);class Crypto{invalidVersion(e){return new o.CoreError("error.transport.crypto.invalidVersion",`The version ${e} is not supported.`)}invalidSecretType(){return new o.CoreError("error.transport.crypto.invalidSecretType","The secret type is invalid.")}}class Logging{loggerNotInitialized(){return new o.CoreError("error.transport.logging.loggerNotInitialized","The logger factory is not yet initialized")}}class CoreDateErrors{noIsoStringMethod(){return new o.CoreError("error.transport.date.noIsoMethod","The provided object doesn't have an iso string method")}undefined(){return new o.CoreError("error.transport.date.undefined","The provided object is undefined and cannot be deserialized.")}}class Random{minLessThanZero(){return new o.CoreError("error.transport.util.random.minLessThanZero","minlength must not be less than zero")}inputTooLong(){return new o.CoreError("error.transport.util.random.inputTooLong","Input exceeds maximum length of 256!")}maxTooHigh(){return new o.CoreError("error.transport.util.random.maxTooHigh","Max must be below 22.")}mnBiggerThatMax(){return new o.CoreError("error.code.util.random.minBiggerThanMax","Max must be larger than min.")}rangeTooBig(){return new o.CoreError("error.transport.util.random.rangeTooBig","The range between the numbers is too big, 32 bit is the maximum -> 4294967296")}intLength(){return new o.CoreError("error.transport.util.random.length","Length must be between 1 and 21.")}}class TransportErrors{}t.TransportErrors=TransportErrors,TransportErrors.controller=new class Controller{alreadyInitialized(e){return new o.CoreError("error.transport.controller.alreadyInitialized",`The controller ${e} was already initialized.`)}contentPropertyUndefined(e){return new o.CoreError("error.transport.controller.contentPropertyUndefined",`The property ${e} is undefined.`)}},TransportErrors.relationships=new class Relationships{responseCryptoIsMissing(){return new o.CoreError("error.transport.relationships.responseCryptoIsMissing","The response crypto is missing.")}requestContainsWrongTemplateId(){return new o.CoreError("error.transport.relationships.requestContainsWrongTemplateId","The relationship request contains a wrong template id.")}responseContainsWrongRequestId(){return new o.CoreError("error.transport.relationships.requestContainsWrongRequestId","The relationship response contains a wrong request id.")}wrongChangeStatus(e){return new o.CoreError("error.transport.relationships.wrongChangeStatus",`The relationship change has the wrong status (${e}) to run this operation`)}wrongChangeType(e){return new o.CoreError("error.transport.relationships.wrongChangeType",`The relationship change has the wrong type (${e}) to run this operation`)}changeResponseMissing(e){return new o.CoreError("error.transport.relationships.changeResponseMissing",`The response of the relationship change (${e}) is missing`)}emptyOrInvalidContent(e){return new o.CoreError("error.transport.relationships.wrongOrEmptyContent",`The relationship change ${null==e?void 0:e.id} requires a content property or its content property is invalid`)}},TransportErrors.util=new class Util{constructor(){this.date=new CoreDateErrors,this.random=new Random,this.logging=new Logging,this.crypto=new Crypto}passwordMinLengthTooShort(){return new o.CoreError("error.transport.passwordMinLengthTooShort","Minimum password length for a strong password should be 8 characters.")}wrongContentForBuffer(){return new o.CoreError("error.transport.wrongContentForBuffer","The given content cannot be transformed to buffer.")}tooLongCoreIdPrefix(e){return new o.CoreError("error.transport.coreid.tooLongPrefix",`The prefix "${e}" is too long`)}},TransportErrors.general=new class General{invalidDatawalletVersion(){return new o.CoreError("error.transport.general.invalidDatawalletVersion","The given identity version is invalid. The value must be 0 or higher.")}baseUrlNotSet(){return new o.CoreError("error.transport.general.baseUrlNotSet","The baseUrl was not set.")}platformClientIdNotSet(){return new o.CoreError("error.transport.general.platformClientNotSet","The platform clientSecret was not set.")}platformClientSecretNotSet(){return new o.CoreError("error.transport.general.platformClientNotSet","The platform clientId was not set.")}platformClientInvalid(){return new o.CoreError("error.transport.general.platformClientInvalid","The combination of platform clientId and clientSecret is invalid.")}cacheEmpty(e,t){return new o.CoreError("error.transport.general.cacheEmpty",`The cache of ${e instanceof Function?e.name:e} with id "${t}" is empty.`,t)}incompatibleBackbone(){return new o.CoreError("error.transport.incompatibleBackbone","The backbone sent an invalid payload.")}signatureNotValid(e){return new o.CoreError("error.transport.signatureNotValid",`The ${e?`${e}-`:""}signature is not valid.`)}recordNotFound(e,t){return new o.CoreError("error.transport.recordNotFound",`'${e instanceof Function?e.name:e}' not found.`,t)}notImplemented(){return new o.CoreError("error.transport.notImplemented","The method is not yet implemented.")}typeNotInReflection(e){return new o.CoreError("error.transport.typeNotInReflectionClass",`The type ${e} was not in the reflection classes. You might have to install a module first.`)}datawalletNotAvailable(){return new o.CoreError("error.transport.datawalletNotAvailable","The datawallet is not available (yet?) and was requested.")}unsupportedDatabaseTypeForQuery(e,t){return new o.CoreError("error.transport.unsupportedDatabaseTypeForQuery",`The query '${t.name}' does not (yet?) support the database type '${e}'.`)}notAllowedCombinationOfDeviceSharedSecretAndAccount(){return new o.CoreError("error.transport.account","The combination of deviceSharedSecret, existing identity or device is not allowed.")}},TransportErrors.identity=new class Identity{realmLength(){return new o.CoreError("error.transport.identity.realmLength","Realm must be of length 3.")}identityNotSet(){return new o.CoreError("error.transport.identity.identityNotSet","The identity must be set")}noAddressReceived(){return new o.CoreError("error.transport.identity.noAddressReceived","The backbone did not create an address for the created device.")}addressMismatch(){return new o.CoreError("error.transport.identity.addressMismatch","The backbone address does not match the local address.")}},TransportErrors.messages=new class Messages{plaintextMismatch(e){return new o.CoreError("error.transport.messages.plaintextMismatch",`The own address ${e} was not named as a recipient within the signed MessagePlaintext. A replay attack might be the cause of this.`)}signatureListMismatch(e){return new o.CoreError("error.transport.messages.signatureListMismatch",`The signature list didn't contain an entry for address ${e}.`)}signatureNotValid(){return new o.CoreError("error.transport.messages.signatureNotValid","The digital signature on this message for peer key is invalid. An impersonination attack might be the cause of this.")}noRecipientsSet(){return new o.CoreError("error.transport.messages.noRecipientsSet","No recipients set.")}ownAddressNotInList(e){return new o.CoreError("error.transport.messages.ownAddressNotInList",`The recipients list of message ${e} didn't contain an entry for the own address. This message should not have been received.`)}noMatchingRelationship(e){return new o.CoreError("error.transport.messages.noMatchingRelationship",`A relationship with sender ${e} does not exist. This might be spam.`)}noSecretKeyForOwnMessage(e){return new o.CoreError(`No secret key found for own message ${e}`,"The message could not be decrypted, because no secret key was found for it.")}},TransportErrors.secrets=new class Secrets{lengthMismatch(){return new o.CoreError("error.transport.secrets.lengthMismatch","Length mismatch between old number of secrets and new ones.")}wrongBaseKeyType(e){return new o.CoreError("error.transport.secrets.wrongBaseKeyType",`Given BaseKey type "${e}" is not supported!`)}wrongSecretType(e){return new o.CoreError("error.transport.secrets.wrongBaseKeyType","Given Secret type is not supported!",{secretId:e})}secretNotFound(e){return new o.CoreError("error.transport.secrets.secretNotFound",`secret "${e}" not found`)}},TransportErrors.device=new class Device{deviceNotSet(){return new o.CoreError("error.transport.device.deviceNotSet","The device must be set")}notOnboardedYet(){return new o.CoreError("error.transport.devices.notOnboardedYet","The device is not onboarded yet and has no public key.")}alreadyOnboarded(){return new o.CoreError("error.transport.devices.alreadyOnboarded","The device has already been onboarded.")}},TransportErrors.files=new class Files{plaintextHashMismatch(){return new o.CoreError("error.transport.files.plaintextHashMismatch","The actual hash of the plaintext does not match the given plaintextHash. Something went wrong while encrypting/decrypting the file.")}cipherMismatch(){return new o.CoreError("error.transport.files.cipherMismatch","The actual hash of the cipher does not match the given cipherHash. Something went wrong while storing/transmitting the file.")}invalidMetadata(e){return new o.CoreError("error.transport.files.invalidMetadata",`The metadata of file id "${e}" is invalid.`)}invalidTruncatedReference(){return new o.CoreError("error.transport.files.invalidTruncatedReference","invalid truncated reference")}fileContentUndefined(){return new o.CoreError("error.transport.files.fileContentUndefined","The given file content is undefined.")}maxFileSizeExceeded(e,t){return new o.CoreError("error.transport.files.maxFileSizeExceeded",`The given file content size (${e}) exceeds the max file size the backbone accepts (${t}).`)}},TransportErrors.challenges=new class Challenges{challengeTypeRequiredRelationship(){return new o.CoreError("error.transport.challenges.challengeTypeRequiredRelationship","The challenge type ist relationship but the relationship is undefined")}},TransportErrors.datawallet=new class Datawallet{encryptedPayloadIsNoCipher(){return new o.CoreError("error.transport.datawallet.encryptedPayloadIsNoCipher","The given encrypted payload is no cipher.")}unsupportedModification(e,t){const r=t?(0,i.default)(t):"";if("unsupportedCacheChangedModificationCollection"===e)return new o.CoreError("error.transport.datawallet.unsupportedModification",`The following collections were received in CacheChanged datawallet modifications but are not supported by the current version of this library: ${r}.`);throw new Error(`Given type '${e}' is not supported.`)}insufficientSupportedDatawalletVersion(e,t){return new o.CoreError("error.transport.datawallet.insufficientSupportedDatawalletVersion",`The SupportedDatawalletVersion '${e}' is too low. A minimum version of '${t}' is required.`)}currentBiggerThanTarget(e,t){return new o.CoreError("error.transport.datawallet.currentBiggerThanTarget",`The current datawallet version '${e}' is bigger than the target version '${t}'.`)}noMigrationAvailable(e){return new o.CoreError("error.core.datawallet.noMigrationAvailable",`There is no migration available for the datawallet version '${e}'.`)}},TransportErrors.tokens=new class Tokens{invalidTruncatedReference(){return new o.CoreError("error.transport.tokens.invalidTruncatedReference","invalid truncated reference")}invalidTokenContent(e){return new o.CoreError("error.transport.tokens.invalidTokenContent",`The content of token ${e} is not of type TokenContent`)}},TransportErrors.relationshipTemplates=new class RelationshipTemplates{}},8169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportIds=void 0;const n=r(3289);class TransportIds{}t.TransportIds=TransportIds,TransportIds.generic=new n.CoreIdHelper(""),TransportIds.secret=new n.CoreIdHelper("TRPSEC"),TransportIds.relationshipSecret=new n.CoreIdHelper("TRPRSE"),TransportIds.relationshipTemplateKey=new n.CoreIdHelper("TRPRTK"),TransportIds.datawalletModification=new n.CoreIdHelper("TRPDWM"),TransportIds.fileReference=new n.CoreIdHelper("TRPFRF")},392:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportLoggerFactory=void 0;const n=r(18);t.TransportLoggerFactory=class TransportLoggerFactory{static init(e){this.instance=e}static getLogger(e){if(!this.isInitialized())throw n.TransportErrors.util.logging.loggerNotInitialized();return"function"==typeof e?this.instance.getLogger(`Transport.${e.name}`):this.instance.getLogger(`Transport.${e}`)}static isInitialized(){return!!this.instance}}},9369:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthClient=void 0;const i=n(r(129)),o=r(1732),a=r(8892),s=r(8990),c=r(8103);class AuthClient extends c.RESTClient{async authenticate(e){var t;const r="/connect/token";let n;try{n=await this.createAxios().post(r,i.default.stringify({client_id:e.clientId,client_secret:e.clientSecret,grant_type:e.grantType,username:e.username,password:e.password}))}catch(e){const n=new s.RequestError("post",r,void 0,"error.transport.request.noAuthPossible","Authentication was not possible. Is the service up and running?"+(e.message?` Root cause: '${e.message}'`:""),"",null===(t=e.response)||void 0===t?void 0:t.status).setObject(e.isAxiosError?s.RequestError.cleanAxiosError(e):e);return a.ClientResult.fail(n)}const c={requestTime:n.headers["x-request-time"],responseDuration:n.headers["x-response-duration-ms"],responseTime:n.headers["x-response-time"],traceId:n.headers["x-trace-id"]};if(200!==n.status)return a.ClientResult.fail(new s.RequestError("post",r,c,"error.transport.request.noAuthGrant","Backbone did not grant authentication. Are the credentials correct?","",n.status).setObject(n.data.error));const l=n.data;return a.ClientResult.ok({expiry:o.CoreDate.utc().add({seconds:parseInt(l.expires_in)}),token:l.access_token})}}t.AuthClient=AuthClient},4381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Authenticator=void 0;const n=r(9369);t.Authenticator=class Authenticator{constructor(e){this.accountController=e,this.authClient=new n.AuthClient(e.config)}async getToken(){return this.token&&!this.isExpired()||await this.authenticate(),this.token}debugLog(e){var t;e.error("Current token is: ",this.token),e.error("Expiry is: ",null===(t=this.expiry)||void 0===t?void 0:t.toISOString())}clear(){this.token=void 0,this.expiry=void 0}isExpired(){if(!this.expiry)return!0;return this.expiry.subtract({seconds:10}).isExpired()}async authenticate(){if(this.request)return await this.request;this.clear(),this.request=this.authenticateInternal();try{await this.request}finally{this.request=void 0}}async authenticateInternal(){const e=await this.accountController.activeDevice.getCredentials(),t={grantType:"password",clientId:this.accountController.config.platformClientId,clientSecret:this.accountController.config.platformClientSecret,username:e.username,password:e.password},r=await this.authClient.authenticate(t);this.token=r.value.token,this.expiry=r.value.expiry}}},9867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackboneIds=void 0;const n=r(3289);class BackboneIds{}t.BackboneIds=BackboneIds,BackboneIds.file=new n.CoreIdHelper("FIL",!0),BackboneIds.relationship=new n.CoreIdHelper("REL",!0),BackboneIds.message=new n.CoreIdHelper("MSG",!0),BackboneIds.relationshipTemplate=new n.CoreIdHelper("RLT",!0),BackboneIds.token=new n.CoreIdHelper("TOK",!0),BackboneIds.relationshipChange=new n.CoreIdHelper("RCH",!0),BackboneIds.device=new n.CoreIdHelper("DVC",!0)},8892:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientResult=void 0;const n=r(4062);class ClientResult{constructor(e,t,r,i){if(e&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!e&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error");if(void 0!==t&&!e)throw new Error("InvalidOperation: A value is only useful in case of a success.");this._value=t,this._isSuccess=e,this._error=r,i&&(this.requestTime=i.requestTime?n.CoreDate.from(i.requestTime):void 0,this.responseDuration=i.responseDuration?parseInt(i.responseDuration):void 0,this.responseTime=i.responseTime?n.CoreDate.from(i.responseTime):void 0,this.traceId=i.traceId)}get isSuccess(){return this._isSuccess}get isError(){return!this._isSuccess}get error(){if(this._isSuccess)throw new Error("Can't get the error of an succeeded result. Use 'value' instead.");return this._error}get value(){if(!this._isSuccess)throw this.error;return this._value}static fail(e,t){return new ClientResult(!1,void 0,e,t)}static ok(e,t){return new ClientResult(!0,e,void 0,t)}}t.ClientResult=ClientResult},4765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paginator=void 0;class Paginator{constructor(e,t,r){this.currentPage=e,this.paginationProperties=t,this.dataSource=r,this.currentItemIndex=0}hasNext(){return this.hasNextPage()||this.currentItemIndex<this.currentPage.length}async next(){return this.currentItemIndex>=this.currentPage.length&&this.hasNextPage()&&(this.currentItemIndex=0,this.currentPage=await this.nextPage()),this.currentPage[this.currentItemIndex++]}hasNextPage(){return this.paginationProperties.pageNumber<this.paginationProperties.totalPages}async nextPage(){this.paginationProperties.pageNumber++;return await this.dataSource.getPage(this.paginationProperties.pageNumber)}async collect(){const e=this.currentPage;for(;this.hasNextPage();)e.push(...await this.nextPage());return e}[Symbol.asyncIterator](){return{next:async()=>this.hasNext()?{value:await this.next(),done:!1}:{value:void 0,done:!0}}}}t.Paginator=Paginator},8103:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RESTClient=t.RESTClientLogDirective=t.RestPaginationDataSource=void 0;const i=r(2890),o=n(r(9669)),a=n(r(6230)),s=r(2890),c=r(2890),l=n(r(6486)),u=n(r(129)),p=r(392),d=r(1732),h=r(8892),g=r(4765),y=r(8990);class RestPaginationDataSource{constructor(e,t,r){this.client=e,this.path=t,this.args=r}async getPage(e){return this.args.pageNumber=e,(await this.client.get(this.path,this.args)).value}}var m;t.RestPaginationDataSource=RestPaginationDataSource,function(e){e[e.LogNone=0]="LogNone",e[e.LogRequest=1]="LogRequest",e[e.LogResponse=2]="LogResponse",e[e.LogAll=3]="LogAll"}(m=t.RESTClientLogDirective||(t.RESTClientLogDirective={}));class RESTClient{constructor(e,t={}){this.config=e,this.requestConfig=t,this._logDirective=m.LogAll;const r={baseURL:e.baseUrl,timeout:this.config.platformTimeout,maxRedirects:this.config.platformMaxRedirects,maxContentLength:1/0,maxBodyLength:1/0,validateStatus:e=>e<300||400===e||404===e||500===e,paramsSerializer:e=>u.default.stringify(e,{arrayFormat:"repeat",encode:!1,allowDots:!0})};this.config.platformAdditionalHeaders&&(r.headers=l.default.defaultsDeep({},r.headers,this.config.platformAdditionalHeaders)),void 0!==s.Agent&&void 0!==c.Agent&&(r.httpAgent=this.createHTTPAgent(),r.httpsAgent=this.createHTTPSAgent()),this.requestConfig=l.default.defaultsDeep(this.requestConfig,r),this._logger=p.TransportLoggerFactory.getLogger(RESTClient)}logRequest(){return this._logDirective===m.LogRequest||this._logDirective===m.LogAll}logResponse(){return this._logDirective===m.LogResponse||this._logDirective===m.LogAll}createHTTPAgent(){return this._httpAgent||(this._httpAgent=new s.Agent(this.config.httpAgent)),this._httpAgent}createHTTPSAgent(){return this._httpsAgent||(this._httpsAgent=new c.Agent(this.config.httpsAgent)),this._httpsAgent}async generateRequestId(){return(await d.CoreId.generate("HTTP")).toString()}createAxios(){const e=o.default.create(this.requestConfig);return this.config.debug&&this.addAxiosLoggingInterceptors(e),e}addAxiosLoggingInterceptors(e){e.interceptors.request.use((e=>{const t=e;return t.meta=e.meta||{},t.meta.startTime=(new Date).getTime(),e})),e.interceptors.response.use((e=>(logResponseTime(e),e)));const logResponseTime=e=>{const t=e.config.meta.startTime,r=e.headers["x-response-duration-ms"]?Number.parseInt(e.headers["x-response-duration-ms"]):void 0,n=`${e.config.method.toUpperCase()} ${e.request.path} (backbone call): ${r?`${r}ms`:"unknown"}`;r&&r>200?this._logger.warn(n):this._logger.debug(n);const i=(new Date).getTime()-t,o=r?i-r:void 0,a=`${e.config.method.toUpperCase()} ${e.request.path} (latency): ${o}ms`;this._logger.debug(a),this._logger.debug(`${e.config.method.toUpperCase()} ${e.request.path} (backbone call + latency): ${i}ms`)}}getResult(e,t,r,n){var o,a,s;const c={requestTime:r.headers["x-request-time"],responseDuration:r.headers["x-response-duration-ms"],responseTime:r.headers["x-response-time"],traceId:r.headers["x-trace-id"]};if(r.data&&this.logResponse()){const i=`Response ${n}: ${e} ${t} | TraceId: '${c.traceId}' | PlatformDuration: ${c.responseDuration}`;try{this._logger.trace(i,JSON.stringify(r.data,void 0,2))}catch(e){this._logger.trace(i)}}if(400===r.status&&!(null===(o=r.data)||void 0===o?void 0:o.error)&&"application/json; charset=utf-8"===r.headers["content-type"])try{const e=i.CoreBuffer.from(r.data).toUtf8();r.data=JSON.parse(e)}catch(e){}if(null===(a=r.data)||void 0===a?void 0:a.error){const n=r.data.error,i=new y.RequestError(e,t,c,n.code,n.message,n.docs,r.status,n.time,{id:n.id,details:n.details});return this._logger.debug(i),h.ClientResult.fail(i,c)}if(204===r.status)return h.ClientResult.ok({},c);if(404===r.status){const r=new y.RequestError(e,t,c,"error.transport.request.notFound","The requested entity was not found. Make sure the ID exists and the record is not expired.","",404);return this._logger.debug(r),h.ClientResult.fail(r,c)}if(r.status>=400&&r.status<=499){const n=new y.RequestError(e,t,c,"error.transport.request.badRequest","The platform responded with a Bad Request without giving any specific reason.","",r.status).setObject(r.data);return this._logger.debug(n),h.ClientResult.fail(n,c)}if("function"==typeof Buffer&&r.data instanceof Buffer||r.data instanceof ArrayBuffer)return h.ClientResult.ok(r.data,c);if(!(null===(s=r.data)||void 0===s?void 0:s.result)){const n=new y.RequestError(e,t,c,"error.transport.request.resultUndefined","The Platform responded without a result.").setObject(r.data);return this._logger.debug(n),h.ClientResult.fail(n,c)}return h.ClientResult.ok(r.data.result,c)}getPaginator(e,t,r,n){var i,o;const a={requestTime:t.headers["x-request-time"],responseDuration:t.headers["x-response-duration-ms"],responseTime:t.headers["x-response-time"],traceId:t.headers["x-trace-id"]};if(t.data&&this.logResponse()){const n=`Response ${r}: GET ${e} | TraceId: '${a.traceId}' | PlatformDuration: ${a.responseDuration}`;try{this._logger.trace(n,JSON.stringify(t.data,void 0,2))}catch(e){this._logger.trace(n)}}if(null===(i=t.data)||void 0===i?void 0:i.error){const r=t.data.error,n=new y.RequestError("GET",e,a,r.code,r.message,r.docs,t.status,r.time,{id:r.id,details:r.details});return this._logger.debug(n),h.ClientResult.fail(n,a)}if(t.status>=400&&t.status<=499){const r=new y.RequestError("GET",e,a,"error.transport.request.badRequest","The platform responded with a Bad Request without giving any specific reason.","",t.status).setObject(t.data);return this._logger.debug(r),h.ClientResult.fail(r,a)}if(!(null===(o=t.data)||void 0===o?void 0:o.result)){const r=new y.RequestError("GET",e,a,"error.transport.request.resultUndefined","The Platform responded without a result.").setObject(t.data);return this._logger.debug(r),h.ClientResult.fail(r,a)}t.data.pagination||(t.data.pagination={pageNumber:1,pageSize:t.data.result.length,totalPages:1,totalRecords:t.data.result.length});const s=new RestPaginationDataSource(this,e,n),c=new g.Paginator(t.data.result,t.data.pagination,s);return h.ClientResult.ok(c,a)}async get(e,t={},r){const n=await this.generateRequestId(),i=l.default.defaultsDeep({params:t},r,this.requestConfig);if(this.logRequest()){const t=this;t._username?this._logger.trace(`Request ${n} by ${t._username}: GET ${e}`):this._logger.trace(`Request ${n}: GET ${e}`)}try{const t=await this.createAxios().get(e,i);return this.getResult("GET",e,t,n)}catch(t){const r=y.RequestError.fromAxiosError("GET",e,t,n);return this._logger.debug(r),h.ClientResult.fail(r)}}async getPaged(e,t={},r){const n=await this.generateRequestId(),i=l.default.defaultsDeep({params:t},r,this.requestConfig);try{const r=await this.createAxios().get(e,i);return this.getPaginator(e,r,n,t)}catch(t){const r=y.RequestError.fromAxiosError("GET",e,t,n);return this._logger.debug(r),h.ClientResult.fail(r)}}async post(e,t,r={},n){const i=await this.generateRequestId(),o=l.default.defaultsDeep({params:r},n,this.requestConfig);if(this.logRequest()){const r=this;r._username?this._logger.trace(`Request ${i} by ${r._username}: POST ${e}`,t):this._logger.trace(`Request ${i}: POST ${e}`,t)}try{const r=await this.createAxios().post(e,t,o);return this.getResult("POST",e,r,i)}catch(t){const r=y.RequestError.fromAxiosError("POST",e,t,i);return this._logger.debug(r),h.ClientResult.fail(r)}}async postMultipart(e,t,r){const n=await this.generateRequestId(),i=new a.default;for(const e in t)if(t.hasOwnProperty(e))if("content"===e.toLowerCase()){let r=t[e];r instanceof Uint8Array&&"undefined"!=typeof Blob?(r=new Blob([r]),i.append(e,r)):i.append(e,Buffer.from(r),{filename:"cipher.bin"})}else i.append(e,t[e]);const o=l.default.defaultsDeep({},r,this.requestConfig);let s=i;if(void 0!==i.getHeaders){const e=i.getHeaders();o.headers=o.headers||{};for(const t in e)o.headers[t]=e[t];s=i.getBuffer()}if(this.logRequest()){const t=this;t._username?this._logger.trace(`Request ${n} by ${t._username}: POST-Upload ${e}`):this._logger.trace(`Request ${n}: POST-Upload ${e}`)}try{const t=await this.createAxios().post(e,s,o);return this.getResult("POST-Upload",e,t,n)}catch(t){const r=y.RequestError.fromAxiosError("POST-Upload",e,t,n);return this._logger.debug(r),h.ClientResult.fail(r)}}async put(e,t,r){const n=await this.generateRequestId(),i=l.default.defaultsDeep({},r,this.requestConfig);if(this.logRequest()){const r=this;r._username?this._logger.trace(`Request ${n} by ${r._username}: PUT ${e}`,t):this._logger.trace(`Request ${n}: PUT ${e}`,t)}try{const r=await this.createAxios().put(e,t,i);return this.getResult("PUT",e,r,n)}catch(t){const r=y.RequestError.fromAxiosError("PUT",e,t,n);return this._logger.debug(r),h.ClientResult.fail(r)}}async delete(e,t){const r=await this.generateRequestId(),n=l.default.defaultsDeep({},t,this.requestConfig);if(this.logRequest()){const t=this;t._username?this._logger.trace(`Request ${r} by ${t._username}: DELETE ${e}`):this._logger.trace(`Request ${r}: DELETE ${e}`)}try{const t=await this.createAxios().delete(e,n);return this.getResult("DELETE",e,t,r)}catch(t){const n=y.RequestError.fromAxiosError("DELETE",e,t,r);return this._logger.debug(n),h.ClientResult.fail(n)}}async download(e,t){const r=await this.generateRequestId(),n=l.default.defaultsDeep({},t,this.requestConfig);if(n.responseType="arraybuffer",this.logRequest()){const t=this;t._username?this._logger.trace(`Request ${r} by ${t._username}: GET-Download ${e}`):this._logger.trace(`Request ${r}: GET-Download ${e}`)}try{const t=await this.createAxios().get(e,n);return this.getResult("GET-Download",e,t,r)}catch(t){const n=y.RequestError.fromAxiosError("GET-Download",e,t,r);return this._logger.debug(n),h.ClientResult.fail(n)}}}t.RESTClient=RESTClient},6054:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RESTClientAuthenticate=void 0;const i=n(r(6486)),o=r(8892),a=r(8990),s=r(8103);class RESTClientAuthenticate extends s.RESTClient{constructor(e,t,r={}){super(e,r),this.authenticator=t}async runAuthenticated(e){const t=await this.authenticator.getToken(),r=await e(t);if(!r.isError)return r;if(r.error instanceof a.RequestError&&401===r.error.status){this._logger.error("401 Authorization Error: ",r.error.message),this.authenticator.debugLog(this._logger),this.authenticator.clear();const t=await this.authenticator.getToken();return await e(t)}return o.ClientResult.fail(r.error)}async get(e,t="",r={}){return await this.runAuthenticated((async n=>await super.get(e,t,this.buildAuthenticatedConfig(n,r))))}async getPaged(e,t={},r={}){return await this.runAuthenticated((async n=>await super.getPaged(e,t,this.buildAuthenticatedConfig(n,r))))}async post(e,t,r={},n={}){return await this.runAuthenticated((async i=>await super.post(e,t,r,this.buildAuthenticatedConfig(i,n))))}async postMultipart(e,t,r={}){return await this.runAuthenticated((async n=>await super.postMultipart(e,t,this.buildAuthenticatedConfig(n,r))))}async put(e,t,r={}){return await this.runAuthenticated((async n=>await super.put(e,t,this.buildAuthenticatedConfig(n,r))))}async delete(e,t={}){return await this.runAuthenticated((async r=>await super.delete(e,this.buildAuthenticatedConfig(r,t))))}async download(e,t={}){return await this.runAuthenticated((async r=>await super.download(e,this.buildAuthenticatedConfig(r,t))))}buildAuthenticatedConfig(e,t){return i.default.defaultsDeep({headers:{Authorization:`Bearer ${e}`}},t)}}t.RESTClientAuthenticate=RESTClientAuthenticate},8990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestError=void 0;const i=r(5172),o=n(r(4530)),a=r(4062);class RequestError extends i.ApplicationError{constructor(e,t,r,n="error.platform.unexpected",i="Platform operation failed unexpectedly.",o="",s=500,c=a.CoreDate.utc().toISOString(),l){super(n,""),this.method=e,this.path=t,this.platformParameters=r,this.reason=i,this.requestId=o,this.status=s,this.time=c,this.object=l;let u=n;s&&(u+=` (${s})`),i&&(u+=`: '${i}'`),u+=` for ${e} ${t}`,c&&(u+=` at ${c}`),r&&(u+=` with traceId '${r.traceId}'`),super.message=u}setObject(e){return this.object=e,this}toString(){return`${this.name}\n${(0,o.default)(this.object)}\n${this.stack}`}static cleanAxiosError(e){const t=e.toJSON();return delete t.config.adapter,delete t.config.data,delete t.config.headers.Authorization,delete t.config.httpAgent,delete t.config.httpsAgent,delete t.config.transformRequest,delete t.config.transformResponse,delete t.config.validateStatus,delete t.request,delete t.response,t}static fromAxiosError(e,t,r,n,i){try{if(!r.isAxiosError){const n=new RequestError(e,t,i,"error.transport.request.unknown",r.message);return n.stack=r.stack,n}if(!r.response){let n="error.transport.request.unknown",o=500,a=r.message;switch(r.code){case"ERR_FR_MAX_BODY_LENGTH_EXCEEDED":n="error.transport.request.bodyLengthExceeded",o=413;break;case"ECONNABORTED":n="error.transport.request.aborted";break;default:"Network Error"===r.message?(n="error.transport.request.network",a="It seems the platform was available but another network error happened. It could also be a CORS problem."):r.message.includes("ENOTFOUND")&&(n="error.transport.request.addressNotFound")}return new RequestError(e,t,i,n,a,"",o).setObject(this.cleanAxiosError(r))}return 401===r.response.status?new RequestError(e,t,i,"error.platform.unauthorized","Unauthorized.",n,r.response.status).setObject(this.cleanAxiosError(r)):new RequestError(e,t,i,"error.platform.unexpected","Received invalid error content from platform. Contact the platform team.",n,r.response.status).setObject(this.cleanAxiosError(r))}catch(r){return new RequestError(e,t,i,"error.platform.unexpected","An error occured while handling an axios error",n).setObject(r)}}}t.RequestError=RequestError},6699:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4381),t),i(r(9867),t),i(r(8892),t),i(r(4765),t),i(r(8990),t),i(r(8103),t),i(r(6054),t)},2027:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6699),t),i(r(4093),t),i(r(8147),t),i(r(3289),t),i(r(6904),t),i(r(2970),t),i(r(6564),t),i(r(1341),t),i(r(5796),t),i(r(2685),t),i(r(981),t),i(r(2508),t),i(r(18),t),i(r(8169),t),i(r(392),t),i(r(1732),t)},7875:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreAddress=void 0;const a=r(194),s=r(6904);let c=n=class CoreAddress extends s.CoreSerializable{static from(e){return"string"==typeof e?super.fromT({address:e},n):super.fromT(e,n)}static deserialize(e){try{return super.deserializeT(e,n)}catch(t){return this.from(e)}}equals(e){return void 0!==e&&this.address===e.toString()}toString(){return this.address}serialize(){return this.address}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"address",void 0),c=n=i([(0,a.type)("CoreAddress"),(0,a.serializeOnly)("address","string")],c),t.CoreAddress=c},4062:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreDate=void 0;const a=r(194),s=r(9490),c=r(6904),l=r(18);let u=n=class CoreDate extends c.CoreSerializable{constructor(e=s.DateTime.utc()){super(),this._dateTime=e,this.date=e.toISO()}get dateTime(){return this._dateTime}static utc(){return new n(s.DateTime.utc())}static local(){return new n(s.DateTime.local())}equals(e){return this.dateTime.equals(e.dateTime)}add(e){return new n(this.dateTime.plus(e))}subtract(e){return new n(this.dateTime.minus(e))}startOf(e){return new n(this.dateTime.startOf(e))}endOf(e){return new n(this.dateTime.endOf(e))}format(e){return this.dateTime.toFormat(e)}isWithin(e,t,r,i){void 0===t&&(t=e),void 0===r&&(r=n.utc());const o=r.subtract(e),a=r.add(t);return void 0!==i?this.dateTime.startOf(i)>o.dateTime.startOf(i)&&this.dateTime.startOf(i)<a.dateTime.startOf(i):this.dateTime>o.dateTime&&this.dateTime<a.dateTime}isBefore(e,t){return void 0!==t?this.dateTime.startOf(t)<e.dateTime.startOf(t):this.dateTime<e.dateTime}isAfter(e,t){return void 0!==t?this.dateTime.startOf(t)>e.dateTime.startOf(t):this.dateTime>e.dateTime}isSame(e,t){return void 0!==t?this.dateTime.startOf(t).valueOf()===e.dateTime.startOf(t).valueOf():this.dateTime.valueOf()===e.dateTime.valueOf()}isSameOrAfter(e,t){return void 0!==t?this.dateTime.startOf(t)>=e.dateTime.startOf(t):this.dateTime>=e.dateTime}isSameOrBefore(e,t){return void 0!==t?this.dateTime.startOf(t)<=e.dateTime.startOf(t):this.dateTime<=e.dateTime}isBetween(e,t,r){return t?s.Interval.fromDateTimes(e.dateTime,t.dateTime).contains(this.dateTime):this.isAfter(e,r)}isExpired(){return this.isSameOrBefore(n.utc())}compare(e){return this.dateTime.valueOf()-e.dateTime.valueOf()}toString(){return this.dateTime.toISO()}toISOString(){return this.dateTime.toISO()}toLocaleString(){return this.dateTime.toLocaleString()}serialize(){return this.dateTime.toISO()}static from(e){if(void 0===e)throw l.TransportErrors.util.date.undefined();if("object"==typeof e){if(void 0===e.date){if("function"!=typeof e.toISOString)throw l.TransportErrors.util.date.noIsoStringMethod();const t=e.toISOString();return new n(s.DateTime.fromISO(t,{zone:"utc"}))}return new n(s.DateTime.fromISO(e.date,{zone:"utc"}))}return new n("number"==typeof e?s.DateTime.fromMillis(e):s.DateTime.fromISO(e,{zone:"utc"}).toUTC())}static deserialize(e){return this.from(e)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"date",void 0),u=n=i([(0,a.serializeOnly)("date","string"),o("design:paramtypes",[s.DateTime])],u),t.CoreDate=u},2186:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreHash=void 0;const a=r(194),s=r(2890),c=r(6904);let l=n=class CoreHash extends c.CoreSerializable{toString(){return this.hash}static async hash(e,t=2){const r=await s.CryptoHash.hash(s.CoreBuffer.fromString(e,s.Encoding.Base64_UrlSafe_NoPadding),t);return n.from(r.toBase64())}async verify(e,t=2){return await s.CryptoHash.verify(e,s.CoreBuffer.fromString(this.hash,s.Encoding.Base64_UrlSafe_NoPadding),t)}static from(e){return"object"==typeof e?super.fromT(e,n):super.fromT({hash:e},n)}static deserialize(e){return this.from(e)}serialize(){return this.hash}toBase64(){return this.hash}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"hash",void 0),l=n=i([(0,a.serializeOnly)("hash","string")],l),t.CoreHash=l},9170:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreId=void 0;const a=r(194),s=r(5833),c=r(6904),l=r(18);let u=n=class CoreId extends c.CoreSerializable{toString(){return this.id}equals(e){return this.id===e.toString()}static async generate(e=""){if(e.length>6)throw l.TransportErrors.util.tooLongCoreIdPrefix(e);const t=await s.Random.string(20-e.length,s.RandomCharacterRange.Alphanumeric);return this.from(e.toUpperCase()+t)}static from(e){return"string"==typeof e||e instanceof String?super.fromT({id:e},n):super.fromT(e,n)}static deserialize(e){return this.from(e)}serialize(){return this.id}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"id",void 0),u=n=i([(0,a.serializeOnly)("id","string")],u),t.CoreId=u},819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportVersion=void 0,function(e){e.Latest="1",e.V1="1"}(t.TransportVersion||(t.TransportVersion={}))},1732:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7875),t),i(r(4062),t),i(r(2186),t),i(r(9170),t),i(r(819),t)},5590:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(2500),t),i(r(2027),t),i(r(9662),t),i(r(2212),t)},7024:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccountController=void 0;const n=r(2890),i=r(2027),o=r(4381),a=r(4093),s=r(369),c=r(392),l=r(2212),u=r(1615),p=r(2723),d=r(8324),h=r(9626),g=r(8382),y=r(6961),m=r(7896),v=r(4980),w=r(2556),b=r(6453),C=r(413),_=r(9777),S=r(5832),T=r(3666),O=r(3654),R=r(2343),I=r(5739),E=r(1295),L=r(26),M=r(4503),A=r(5366),D=r(2016),P=r(6346),j=r(761);t.AccountController=class AccountController{constructor(e,t,r,n={}){this._transport=e,this._db=t,this._config=r,this.dependencyOverrides=n,this._dbClosed=!1,this.autoSync=!0,this._authenticator=new o.Authenticator(this),this._log=c.TransportLoggerFactory.getLogger(i.ControllerName.Account)}get authenticator(){return this._authenticator}get config(){return this._config}get db(){return this._db}get transport(){return this._transport}get activeDevice(){if(!this._activeDevice)throw new Error("The DeviceController is not initialized yet.");return this._activeDevice}get activeDeviceOrUndefined(){return this._activeDevice}get identity(){return this._identity}async init(e){this.info=await this.db.getMap("AccountInfo"),this.unpushedDatawalletModifications=await this.db.getCollection(s.DbCollectionName.UnpushedDatawalletModifications),this.deviceClient=new y.DeviceClient(this.config),this.identityClient=new A.IdentityClient(this.config),this._identity=new P.IdentityController(this),this._activeDevice=new m.DeviceController(this),this.challenges=await new h.ChallengeController(this).init();const[t,r,o]=await Promise.all([this.info.get("identity"),this.info.get("device"),this.info.get("baseKey")]);let a,c=!1,l=!1;if(t||r){if(e||!t||!r)throw i.TransportErrors.general.notAllowedCombinationOfDeviceSharedSecretAndAccount().logWith(this._log);{if(!o)throw i.TransportErrors.secrets.secretNotFound("BaseKey");const[e,a,s]=await Promise.all([D.Identity.from(t),b.Device.from(r),n.CryptoSecretKey.fromJSON(o)]);await Promise.all([this.identity.init(e),this.activeDevice.init(s,a)]),this.deviceAuthClient=new g.DeviceAuthClient(this.config,this.authenticator)}}else if(e)a=await this.onboardDevice(e),l=!0;else{this._log.trace("No account information found. Creating new account...");c=!0,a=(await this.createIdentityAndDevice(this.config.realm)).device,this.deviceAuthClient=new g.DeviceAuthClient(this.config,this.authenticator)}return this._log.trace(`Using device ${this.activeDevice.id} for identity ${this.identity.address}.`),await this.initControllers(),c?(await this.devices.addExistingDevice(a),await this.synchronization.setInititalDatawalletVersion(this._config.supportedDatawalletVersion)):l&&(await this.syncDatawallet(),await this.devices.update(a)),await this.syncDatawallet(),this}async close(){this._dbClosed||(this._log.trace(`Closing DB for account ${this.identity.identity.address.toString()}.`),await this._db.close(),this._dbClosed=!0)}async initControllers(){this._log.trace("Initializing controllers..."),this.relationshipSecrets=await new O.RelationshipSecretController(this).init(),this.devices=await new v.DevicesController(this).init(),this.certificates=await new u.CertificateController(this).init(),this.certificateIssuer=await new p.CertificateIssuer(this).init(),this.certificateValidator=await new d.CertificateValidator(this).init(),this.files=await new _.FileController(this).init(),this.relationships=await new T.RelationshipsController(this,this.relationshipSecrets).init(),this.relationshipTemplates=await new R.RelationshipTemplateController(this,this.relationshipSecrets).init(),this.messages=await new S.MessageController(this).init(),this.tokens=await new M.TokenController(this).init(),this.synchronization=await new E.SyncController(this,this.dependencyOverrides,this.unpushedDatawalletModifications,this.config.datawalletEnabled).init(),this._log.trace("Initialization of controllers finished.")}disableAutoSync(){this.autoSync=!1}async enableAutoSync(){this.autoSync=!0,await this.syncDatawallet()}async syncDatawallet(e=!1){if(e||this.autoSync)return await this.synchronization.sync("OnlyDatawallet")}async syncEverything(){return await this.synchronization.sync("Everything")}async getLastCompletedSyncTime(){return await this.synchronization.getLastCompletedSyncTime()}async getLastCompletedDatawalletSyncTime(){return await this.synchronization.getLastCompletedDatawalletSyncTime()}async createIdentityAndDevice(e=D.Realm.Prod){this._log.trace(`Creating new identity for realm ${e}...`);const[t,r,n,o,s]=await Promise.all([a.CoreCrypto.generateSignatureKeypair(),await l.PasswordGenerator.createStrongPassword(45,50),a.CoreCrypto.generateSignatureKeypair(),a.CoreCrypto.generateSecretKey(),a.CoreCrypto.generateSecretKey()]);this._log.trace("Created keys. Requesting challenge...");const c=await this.challenges.createAccountCreationChallenge(t);this._log.trace("Challenge signed. Creating device...");const[u,p,d,h]=await Promise.all([this.identityClient.createIdentity({devicePassword:r,identityPublicKey:t.publicKey.toBase64(),signedChallenge:c.toJSON(!1),clientId:this._config.platformClientId,clientSecret:this._config.platformClientSecret}),a.CoreCrypto.generateSecretKey(),j.IdentityUtil.createAddress(t.publicKey,e),this.fetchDeviceInfo()]);if(u.isError){if("error.platform.unauthorized"===u.error.code)throw i.TransportErrors.general.platformClientInvalid().logWith(this._log)}const g=u.value;if(this._log.trace(`Registered identity with address ${g.address}, device id is ${g.device.id}.`),!g.address)throw i.TransportErrors.identity.noAddressReceived().logWith(this._log);if(d.toString()!==g.address)throw i.TransportErrors.identity.addressMismatch().logWith(this._log);const y=await D.Identity.from({address:i.CoreAddress.from(g.address),realm:e,publicKey:t.publicKey}),m=i.CoreId.from(g.device.id),v=await b.Device.from({createdAt:i.CoreDate.from(g.createdAt),createdByDevice:m,id:m,description:"",name:"Device 1",lastLoginAt:i.CoreDate.utc(),operatingSystem:h.operatingSystem,publicKey:n.publicKey,type:h.type,certificate:"",username:g.device.username,datawalletVersion:this._config.supportedDatawalletVersion});await Promise.all([this.identity.init(y),this.activeDevice.init(s,v)]);const _=await C.DeviceSecretCredentials.from({id:v.id,username:g.device.username,password:r});return await Promise.all([this.info.set("device",v.toJSON()),this.info.set("identity",y.toJSON()),this.info.set("baseKey",s.toJSON()),this.activeDevice.secrets.storeSecret(o,w.DeviceSecretType.SharedSecretBaseKey),this.activeDevice.secrets.storeSecret(p,w.DeviceSecretType.IdentitySynchronizationMaster),this.activeDevice.secrets.storeSecret(t.privateKey,w.DeviceSecretType.IdentitySignature),this.activeDevice.secrets.storeSecret(n.privateKey,w.DeviceSecretType.DeviceSignature),this.activeDevice.secrets.storeSecret(_,w.DeviceSecretType.DeviceCredentials)]),{identity:y,device:v}}async onboardDevice(e){this._log.trace("Onboarding device for existing identity...");const[t,r,n,o]=await Promise.all([l.PasswordGenerator.createStrongPassword(45,50),a.CoreCrypto.generateSignatureKeypair(),this.fetchDeviceInfo(),a.CoreCrypto.generateSecretKey()]),s=await b.Device.from({id:e.id,name:e.name?e.name:"",description:e.description?e.name:"",lastLoginAt:i.CoreDate.utc(),createdAt:e.createdAt,createdByDevice:e.createdByDevice,operatingSystem:n.operatingSystem,type:n.type,publicKey:r.publicKey,username:e.username,initialPassword:"",isAdmin:!!e.identityPrivateKey});await Promise.all([this.identity.init(e.identity),this.activeDevice.init(o,s)]);const c=await C.DeviceSecretCredentials.from({id:e.id,username:e.username,password:e.password});return await Promise.all([this.info.set("device",s.toJSON()),this.info.set("identity",e.identity.toJSON()),this.info.set("baseKey",o.toJSON()),this.info.set(I.SecretController.secretNonceKey,1e6*e.deviceIndex),this.activeDevice.secrets.storeSecret(e.secretBaseKey,w.DeviceSecretType.SharedSecretBaseKey),this.activeDevice.secrets.storeSecret(e.synchronizationKey,w.DeviceSecretType.IdentitySynchronizationMaster),this.activeDevice.secrets.storeSecret(r.privateKey,w.DeviceSecretType.DeviceSignature),this.activeDevice.secrets.storeSecret(c,w.DeviceSecretType.DeviceCredentials)]),e.identityPrivateKey&&await this.activeDevice.secrets.storeSecret(e.identityPrivateKey,w.DeviceSecretType.IdentitySignature),this.deviceAuthClient=new g.DeviceAuthClient(this.config,this.authenticator),await this.activeDevice.changePassword(t),s}async registerPushNotificationToken(e){await this.deviceAuthClient.registerPushNotificationToken(e)}fetchDeviceInfo(){return Promise.resolve({operatingSystem:"",type:b.DeviceType.Unknown})}async getSynchronizedCollection(e){const t=await this.db.getCollection(e);return this.config.datawalletEnabled?new L.SynchronizedCollection(t,this.config.supportedDatawalletVersion,this.unpushedDatawalletModifications):new L.SynchronizedCollection(t,this.config.supportedDatawalletVersion)}}},6346:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityController=void 0;const n=r(2890),i=r(2027),o=r(2556);class IdentityController extends i.TransportController{constructor(e){super(i.ControllerName.Identity,e)}get address(){return this._identity.address}get publicKey(){return this._identity.publicKey}get realm(){return this._identity.realm}get identity(){return this._identity}async init(e){if(await super.init(),!e)throw i.TransportErrors.identity.identityNotSet().logWith(this._log);return this._identity=e,this}isMe(e){return this.address.equals(e)}async update(){await this.parent.info.set("identity",this.identity)}async sign(e){const t=await this.parent.activeDevice.secrets.loadSecret(o.DeviceSecretType.IdentitySignature);if(!(t&&t.secret instanceof n.CryptoSignaturePrivateKey))throw i.TransportErrors.secrets.secretNotFound(o.DeviceSecretType.IdentitySignature).logWith(this._log);const r=t.secret,a=await i.CoreCrypto.sign(e,r);return r.clear(),a}async verify(e,t){return await i.CoreCrypto.verify(e,t,this.publicKey)}}t.IdentityController=IdentityController},761:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityUtil=void 0;const n=r(2890),i=r(2027);t.IdentityUtil=class IdentityUtil{static async createAddress(e,t="ID0"){if(t&&3!==t.length)throw i.TransportErrors.identity.realmLength();const r=await n.CryptoHash.hash(e.publicKey,2),o=await n.CryptoHash.hash(r,1),a=new n.CoreBuffer(o.buffer.slice(0,20)),s=n.CoreBuffer.fromUtf8(t);s.append(a);const c=await n.CryptoHash.hash(s,2),l=await n.CryptoHash.hash(c,1),u=new n.CoreBuffer(l.buffer.slice(0,4)),p=a;p.append(u);const d=t+p.toBase58();return i.CoreAddress.from({address:d})}static async checkAddress(e,t,r="id1"){const i=e.toString(),o=i.substr(0,3);if(r&&o!==r)return!1;const a=i.substr(3),s=n.CoreBuffer.fromBase58(a).buffer,c=s.slice(0,s.byteLength-4),l=s.slice(s.byteLength-4,s.byteLength),u=n.CoreBuffer.fromUtf8(o);u.append(new n.CoreBuffer(c));const p=await n.CryptoHash.hash(u,2),d=await n.CryptoHash.hash(p,1);if(!new n.CoreBuffer(d.buffer.slice(0,4)).equals(new n.CoreBuffer(l)))return!1;if(t){const e=await n.CryptoHash.hash(t.publicKey,2);let r=await n.CryptoHash.hash(e,1);if(r=new n.CoreBuffer(r.buffer.slice(0,20)),!r.equals(new n.CoreBuffer(c)))return!1}return!0}}},5366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityClient=void 0;const n=r(2027);class IdentityClient extends n.RESTClient{constructor(){super(...arguments),this._logDirective=n.RESTClientLogDirective.LogResponse}async createIdentity(e){return await this.post("/api/v1/Identities",e,{})}}t.IdentityClient=IdentityClient},2016:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Identity=t.Realm=void 0;const a=r(194),s=r(2890),c=r(2970),l=r(7875),u=r(4062);!function(e){e.Dev="dev",e.Stage="id0",e.Prod="id1"}(t.Realm||(t.Realm={}));let p=n=class Identity extends c.CoreSerializableAsync{static async from(e){const t=await super.fromT(e,n);return t.name="",t.description="",t.type="unknown",t.createdAt=u.CoreDate.from("2020-01-01T00:00:00Z"),t}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.CoreAddress)],p.prototype,"address",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignaturePublicKey)],p.prototype,"publicKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],p.prototype,"realm",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],p.prototype,"name",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],p.prototype,"description",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CoreDate)],p.prototype,"createdAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],p.prototype,"type",void 0),p=n=i([(0,a.type)("Identity")],p),t.Identity=p},1615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateController=void 0;const n=r(2027);class CertificateController extends n.TransportController{constructor(e){super(n.ControllerName.Certificate,e)}}t.CertificateController=CertificateController},2723:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateContentParam=t.CertificateIssuer=void 0;const n=r(2890),i=r(2027),o=r(369),a=r(365),s=r(4507);class CertificateIssuer extends i.TransportController{constructor(e){super(i.ControllerName.CertificateIssuer,e)}async init(){return await super.init(),this.certificatesIssued=await this.db.getCollection(o.DbCollectionName.CertificatesIssued),this}async issueCertificate(e){const t=(await s.CertificateContent.from(e)).serialize(),r=n.CoreBuffer.fromUtf8(t),i=await this.parent.identity.sign(r);return await a.Certificate.from({content:t,signature:i})}}t.CertificateIssuer=CertificateIssuer;t.CertificateContentParam=class CertificateContentParam{constructor(){this.issuedAt=i.CoreDate.utc()}}},8324:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateValidator=void 0;const n=r(2027);class CertificateValidator extends n.TransportController{constructor(e){super(n.ControllerName.CertificateValidator,e)}}t.CertificateValidator=CertificateValidator},365:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Certificate=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class Certificate extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}async verify(e){const t=s.CoreBuffer.fromUtf8(this.content);return await c.CoreCrypto.verify(t,this.signature,e)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"signature",void 0),l=n=i([(0,a.type)("Certificate")],l),t.Certificate=l},8951:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateConstraint=void 0;const o=r(194),a=r(2027);let s=n=class CertificateConstraint extends a.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};s=n=i([(0,o.type)("CertificateConstraint")],s),t.CertificateConstraint=s},4507:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateContent=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(8951),u=r(7584);let p=n=class CertificateContent extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],p.prototype,"issuedAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],p.prototype,"issuer",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreSerializable)],p.prototype,"issuerData",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],p.prototype,"subject",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignaturePublicKey)],p.prototype,"subjectPublicKey",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.CertificateConstraint}),o("design:type",Array)],p.prototype,"constraints",void 0),i([(0,a.validate)(),(0,a.serialize)({type:u.CertificateItem}),o("design:type",Array)],p.prototype,"items",void 0),p=n=i([(0,a.type)("CertificateContent")],p),t.CertificateContent=p},7584:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateItem=void 0;const o=r(194),a=r(2027);let s=n=class CertificateItem extends a.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};s=n=i([(0,o.type)("CertificateItem")],s),t.CertificateItem=s},1949:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateBorderConstraint=void 0;const a=r(194),s=r(8951);let c=n=class CertificateBorderConstraint extends s.CertificateConstraint{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"union",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"country",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"state",void 0),c=n=i([(0,a.type)("CertificateBorderConstraint")],c),t.CertificateBorderConstraint=c},8176:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateCityConstraint=void 0;const a=r(194),s=r(8951);let c=n=class CertificateCityConstraint extends s.CertificateConstraint{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"district",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"city",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"zipCode",void 0),c=n=i([(0,a.type)("CertificateCityConstraint")],c),t.CertificateCityConstraint=c},6578:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateIdentityConstraint=void 0;const a=r(194),s=r(2027),c=r(8951);let l=n=class CertificateIdentityConstraint extends c.CertificateConstraint{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreAddress)],l.prototype,"identity",void 0),l=n=i([(0,a.type)("CertificateIdentityConstraint")],l),t.CertificateIdentityConstraint=l},4220:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateTimeConstraint=void 0;const a=r(194),s=r(2027),c=r(8951);let l=n=class CertificateTimeConstraint extends c.CertificateConstraint{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],l.prototype,"validFrom",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],l.prototype,"validTo",void 0),l=n=i([(0,a.type)("CertificateTimeConstraint")],l),t.CertificateTimeConstraint=l},3327:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateAuthorizationItem=void 0;const a=r(194),s=r(7584);let c=n=class CertificateAuthorizationItem extends s.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"authorization",void 0),c=n=i([(0,a.type)("CertificateAuthorizationItem")],c),t.CertificateAuthorizationItem=c},7376:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateDelegateItem=t.CertificateDelegateType=void 0;const a=r(194),s=r(7584);!function(e){e.Clone="clone",e.Custodian="custodian",e.Sign="sign",e.Ppa="ppa",e.Communication="communication"}(t.CertificateDelegateType||(t.CertificateDelegateType={}));let c=n=class CertificateDelegateItem extends s.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"type",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],c.prototype,"content",void 0),c=n=i([(0,a.type)("CertificateDelegateItem")],c),t.CertificateDelegateItem=c},8579:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificatePrivateAttributeItem=void 0;const a=r(194),s=r(1732),c=r(7584);let l=n=class CertificatePrivateAttributeItem extends c.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreHash)],l.prototype,"hash",void 0),l=n=i([(0,a.type)("CertificatePrivateAttributeItem")],l),t.CertificatePrivateAttributeItem=l},3727:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificatePrivateAttributeItemSource=void 0;const a=r(194),s=r(1732),c=r(7584);let l=n=class CertificatePrivateAttributeItemSource extends c.CertificateItem{async hash(){return await s.CoreHash.hash(`${this.nonce}|${this.name}|${this.value}`)}static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"nonce",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"name",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"value",void 0),l=n=i([(0,a.type)("CertificatePrivateAttributeItem")],l),t.CertificatePrivateAttributeItemSource=l},9745:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificatePublicAttributeItem=void 0;const a=r(194),s=r(7584);let c=n=class CertificatePublicAttributeItem extends s.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"name",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"value",void 0),c=n=i([(0,a.type)("CertificatePublicAttributeItem")],c),t.CertificatePublicAttributeItem=c},1430:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateRoleItem=void 0;const a=r(194),s=r(7584);let c=n=class CertificateRoleItem extends s.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"role",void 0),c=n=i([(0,a.type)("CertificateRoleItem")],c),t.CertificateRoleItem=c},9626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChallengeController=void 0;const n=r(2890),i=r(2027),o=r(2508),a=r(2182),s=r(3122),c=r(1772),l=r(9643),u=r(8565);class ChallengeController extends o.TransportController{constructor(e){super(o.ControllerName.Challenge,e)}async init(){return await super.init(),this.client=new c.ChallengeClient(this.config),this.authClient=new s.ChallengeAuthClient(this.config,this.parent.authenticator),this}async verifyChallengeLocally(e,t){if(!e.createdBy)return;const r=await this.parent.relationships.getActiveRelationshipToIdentity(e.createdBy);if(!r)throw i.TransportErrors.general.recordNotFound(a.Relationship,e.createdBy.toString());const o=n.CoreBuffer.fromUtf8(t.challenge);let s=!1;switch(e.type){case l.ChallengeType.Identity:s=await this.parent.relationships.verifyIdentity(r,o,t.signature);break;case l.ChallengeType.Device:throw i.TransportErrors.general.notImplemented().logWith(this._log);case l.ChallengeType.Relationship:s=await this.parent.relationships.verify(r,o,t.signature)}return s?r:void 0}async checkChallenge(e,t){const r=await l.Challenge.deserialize(e.challenge);if(t&&r.type!==t)return;if(r.expiresAt.isExpired())return;const[n,i]=await Promise.all([this.verifyChallengeLocally(r,e),this.authClient.getChallenge(r.id.toString())]);return!n||r.createdBy&&i.value.createdBy!==r.createdBy.toString()||i.value.id!==r.id.toString()?void 0:n}async createAccountCreationChallenge(e){const t=(await this.client.createChallenge()).value,r=(await l.Challenge.from({id:i.CoreId.from(t.id),expiresAt:i.CoreDate.from(t.expiresAt),type:l.ChallengeType.Identity})).serialize(!1),o=n.CoreBuffer.fromUtf8(r),a=await i.CoreCrypto.sign(o,e.privateKey);return await u.ChallengeSigned.from({challenge:r,signature:a})}async createChallenge(e=l.ChallengeType.Identity,t){if(e===l.ChallengeType.Relationship&&!t)throw i.TransportErrors.challenges.challengeTypeRequiredRelationship().logWith(this._log);const r=(await this.authClient.createChallenge()).value,o=(await l.Challenge.from({id:i.CoreId.from(r.id),expiresAt:i.CoreDate.from(r.expiresAt),createdBy:r.createdBy?i.CoreAddress.from(r.createdBy):void 0,createdByDevice:r.createdByDevice?i.CoreId.from(r.createdByDevice):void 0,type:e})).serialize(!1),a=n.CoreBuffer.fromUtf8(o);let s;switch(e){case l.ChallengeType.Identity:s=await this.parent.identity.sign(a);break;case l.ChallengeType.Device:s=await this.parent.activeDevice.sign(a);break;case l.ChallengeType.Relationship:if(!t)throw i.TransportErrors.challenges.challengeTypeRequiredRelationship().logWith(this._log);s=await this.parent.relationships.sign(t,a)}return await u.ChallengeSigned.from({challenge:o,signature:s})}}t.ChallengeController=ChallengeController},3122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChallengeAuthClient=void 0;const n=r(6054);class ChallengeAuthClient extends n.RESTClientAuthenticate{async createChallenge(){return await this.post("/api/v1/Challenges",{})}async getChallenge(e){return await this.get(`/api/v1/Challenges/${e}`)}}t.ChallengeAuthClient=ChallengeAuthClient},1772:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChallengeClient=void 0;const n=r(2027);class ChallengeClient extends n.RESTClient{async createChallenge(){return await this.post("/api/v1/Challenges",{})}}t.ChallengeClient=ChallengeClient},9643:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Challenge=t.ChallengeType=void 0;const a=r(194),s=r(2027);!function(e){e.Identity="Identity",e.Device="Device",e.Relationship="Relationship"}(t.ChallengeType||(t.ChallengeType={}));let c=n=class Challenge extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await this.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"id",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],c.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreAddress)],c.prototype,"createdBy",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"type",void 0),c=n=i([(0,a.type)("Challenge")],c),t.Challenge=c},8565:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ChallengeSigned=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class ChallengeSigned extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async fromJSON(e){const t=await s.CryptoSignature.fromBase64(e.signature);return await this.from({signature:t,challenge:e.challenge})}toJSON(e=!0){const t={challenge:this.challenge,signature:this.signature.toBase64()};return e&&(t["@type"]="ChallengeSigned"),t}};i([(0,a.validate)(),(0,a.serialize)({enforceString:!0}),o("design:type",String)],l.prototype,"challenge",void 0),i([(0,a.validate)(),(0,a.serialize)({enforceString:!0}),o("design:type",s.CryptoSignature)],l.prototype,"signature",void 0),l=n=i([(0,a.type)("ChallengeSigned")],l),t.ChallengeSigned=l},7896:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceController=void 0;const n=r(2890),i=r(2027),o=r(2556),a=r(413);class DeviceController extends i.TransportController{constructor(e){super(i.ControllerName.Device,e)}get secrets(){return this._secrets}get id(){return this.device.id}get publicKey(){return this.device.publicKey}get certificate(){return this.device.certificate}get name(){return this.device.name}get description(){return this.device.description}get operatingSystem(){return this.device.operatingSystem}get createdAt(){return this.device.createdAt}get type(){return this.device.type}get device(){if(!this._device)throw i.TransportErrors.device.deviceNotSet();return this._device}get deviceOrUndefined(){return this._device}async init(e,t){if(await super.init(),!t)throw i.TransportErrors.device.deviceNotSet().logWith(this._log);if(!e)throw i.TransportErrors.secrets.secretNotFound("BaseKey").logWith(this._log);return this._device=t,this._secrets=await new o.DeviceSecretController(this.parent,e).init(),this}async changePassword(e){const t=(await this.getCredentials()).password;await this.parent.deviceAuthClient.changeDevicePassword({oldPassword:t,newPassword:e});try{const t=await this.secrets.loadSecret(o.DeviceSecretType.DeviceCredentials);if(!t)throw new Error("There was an error while accessing the device_credentials secret.");const r=t.secret;r.password=e,await this.secrets.storeSecret(r,o.DeviceSecretType.DeviceCredentials)}catch(t){throw this.log.warn(`We've changed the device password on the backboen but weren't able to store it to the database. The new password is '${e}'.`),t}}async update(e){e.name&&(this.device.name=e.name),e.description&&(this.device.description=e.description),e.datawalletVersion&&(this.device.datawalletVersion=e.datawalletVersion),await this.parent.devices.update(this.device),await this.parent.info.set("device",this.device.toJSON())}async sign(e){const t=await this.secrets.loadSecret(o.DeviceSecretType.DeviceSignature);if(!(t&&t.secret instanceof n.CryptoSignaturePrivateKey))throw i.TransportErrors.secrets.secretNotFound(o.DeviceSecretType.DeviceSignature).logWith(this._log);const r=t.secret,a=await i.CoreCrypto.sign(e,r);return r.privateKey.clear(),a}async verify(e,t){if(!this.publicKey)throw i.TransportErrors.device.notOnboardedYet().logWith(this._log);return await i.CoreCrypto.verify(e,t,this.publicKey)}async getCredentials(){const e=await this.secrets.loadSecret(o.DeviceSecretType.DeviceCredentials);if(!e)throw i.TransportErrors.secrets.secretNotFound(o.DeviceSecretType.DeviceCredentials).logWith(this._log);if(!(e.secret instanceof a.DeviceSecretCredentials))throw i.TransportErrors.secrets.wrongSecretType(o.DeviceSecretType.DeviceCredentials).logWith(this._log);const t=e.secret;if(!t.username||!t.password)throw i.TransportErrors.secrets.wrongSecretType(o.DeviceSecretType.DeviceCredentials).logWith(this._log);return{username:t.username,password:t.password}}}t.DeviceController=DeviceController},2556:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceSecretController=t.DeviceSecretType=void 0;const n=r(194),i=r(2890),o=r(2027),a=r(2508),s=r(8169),c=r(9423),l=r(7636),u=r(6758);var p;!function(e){e.IdentitySynchronizationMaster="identity_synchronization_master",e.IdentitySignature="identity_signature",e.SharedSecretBaseKey="shared_basekey",e.DeviceSecretBaseKey="secret_basekey",e.DeviceSignature="device_signature",e.DeviceCredentials="device_credentials"}(p=t.DeviceSecretType||(t.DeviceSecretType={}));class DeviceSecretController extends a.TransportController{constructor(e,t){super(a.ControllerName.DeviceSecret,e),this.baseKey=t}async init(){return await super.init(),this.secrets=await this.db.getMap("DeviceSecrets"),this}async storeSecret(e,t){const r=e.serialize(),n=i.CoreBuffer.fromUtf8(r),a=await o.CoreCrypto.deriveKeyFromBase(this.getBaseKey(),1,DeviceSecretController.secretContext),l=await o.CoreCrypto.encrypt(n,a),u=o.CoreDate.utc(),p={cipher:l,createdAt:u,name:t,id:await s.TransportIds.secret.generate(),validFrom:u,active:!0},d=await c.SecretContainerCipher.from(p);return this.log.trace(`Created device secret id:${d.id} name:${d.name} on ${d.createdAt.toISOString()}.`),await this.secrets.set(t,d.toJSON()),d}async loadSecret(e){const t=await this.secrets.get(e);if(!t)return;const r=this.getBaseKey(),i=await c.SecretContainerCipher.from(t),a=await o.CoreCrypto.deriveKeyFromBase(r,1,DeviceSecretController.secretContext),s=(await o.CoreCrypto.decrypt(i.cipher,a)).toUtf8(),u=await n.SerializableAsync.deserializeUnknown(s),p=await l.SecretContainerPlain.from({id:i.id,createdAt:i.createdAt,name:i.name,secret:u,validFrom:i.validFrom,validTo:i.validTo,active:i.active});return this.log.trace(`Accessed device secret id:${p.id} name:${p.name} on ${o.CoreDate.utc().toISOString()}.`),p}async deleteSecret(e){const t=await this.secrets.get(e);return!!t&&(await this.secrets.delete(e),this.log.trace(`Deleted device secret id:${t.id} name:${t.name} on ${o.CoreDate.utc().toISOString()}.`),!0)}async createDeviceSharedSecret(e,t,r=!1){const n=await this.loadSecret(p.IdentitySynchronizationMaster);if(!(n&&n.secret instanceof i.CryptoSecretKey))throw o.TransportErrors.secrets.secretNotFound("SynchronizationKey").logWith(this._log);const a=await this.loadSecret(p.SharedSecretBaseKey);if(!(a&&a.secret instanceof i.CryptoSecretKey))throw o.TransportErrors.secrets.secretNotFound("baseKey").logWith(this._log);let s;if(r&&(s=await this.loadSecret(p.IdentitySignature),!(s&&s.secret instanceof i.CryptoSignaturePrivateKey)))throw o.TransportErrors.secrets.secretNotFound("IdentityKey").logWith(this._log);return await u.DeviceSharedSecret.from({id:e.id,createdAt:e.createdAt,createdByDevice:e.createdByDevice,deviceIndex:t,secretBaseKey:a.secret,name:e.name,description:e.description,synchronizationKey:n.secret,identityPrivateKey:null==s?void 0:s.secret,username:e.username,password:e.initialPassword,identity:this.parent.identity.identity})}async encryptDatawalletModificationPayload(e,t){if(!e.payload)return;const r=i.CoreBuffer.fromUtf8(JSON.stringify(e.payload)),n=await this.loadSecret(p.IdentitySynchronizationMaster);if(!(n&&n.secret instanceof i.CryptoSecretKey))throw o.TransportErrors.secrets.secretNotFound(p.IdentitySynchronizationMaster).logWith(this._log);const a=await o.CoreCrypto.deriveKeyFromBase(n.secret,t,"DataSync"),s=await o.CoreCrypto.encrypt(r,a);return n.secret.clear(),s.toBase64()}async decryptDatawalletModificationPayload(e,t){if(!e)return;const r=await i.CryptoCipher.fromBase64(e),n=await this.loadSecret(p.IdentitySynchronizationMaster);if(!(n&&n.secret instanceof i.CryptoSecretKey))throw o.TransportErrors.secrets.secretNotFound(p.IdentitySynchronizationMaster).logWith(this._log);const a=await o.CoreCrypto.deriveKeyFromBase(n.secret,t,"DataSync"),s=await o.CoreCrypto.decrypt(r,a);n.secret.clear();return JSON.parse(s.toUtf8())}getBaseKey(){if(!this.baseKey)throw o.TransportErrors.general.recordNotFound(i.CryptoSecretKey,p.SharedSecretBaseKey).logWith(this._log);return this.baseKey}}t.DeviceSecretController=DeviceSecretController,DeviceSecretController.secretContext="DEVICE01"},4980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DevicesController=void 0;const n=r(2027),i=r(369),o=r(2508),a=r(2212),s=r(9643),c=r(8382),l=r(6453),u=r(9798);class DevicesController extends o.TransportController{constructor(e){super(o.ControllerName.Devices,e)}async init(){return await super.init(),this.client=new c.DeviceAuthClient(this.config,this.parent.authenticator),this.devices=await this.parent.getSynchronizedCollection(i.DbCollectionName.Devices),this}async get(e){const t=await this.devices.read(e.toString());if(t)return await l.Device.from(t)}async addExistingDevice(e){await this.devices.create(e)}async createDevice(e="",t="",r=!1){const[i,o]=await Promise.all([this.parent.challenges.createChallenge(s.ChallengeType.Identity),a.PasswordGenerator.createStrongPassword(45,50)]);this.log.trace("Device Creation Challenge signed. Creating device on backbone...");const c=(await this.client.createDevice({signedChallenge:i.toJSON(),devicePassword:o})).value;this.log.trace(`Created device with id ${c.id}.`);return await l.Device.from({createdAt:n.CoreDate.from(c.createdAt),createdByDevice:n.CoreId.from(c.createdByDevice),id:n.CoreId.from(c.id),name:e,description:t,type:l.DeviceType.Unknown,username:c.username,initialPassword:o,isAdmin:r})}async sendDevice(e){if(!(e=await u.SendDeviceParameters.from(e)).name){const t=await this.parent.devices.list();e.name=`Device ${t.length+1}`}const t=await this.createDevice(e.name,e.description,e.isAdmin);return await this.devices.create(t),t}async getSharedSecret(e){const t=await this.devices.read(e.toString());if(!t)throw n.TransportErrors.general.recordNotFound(l.Device,e.toString());const r=await this.devices.count(),i=await l.Device.from(t);if(!i.initialPassword||i.publicKey||i.lastLoginAt)throw n.TransportErrors.device.alreadyOnboarded();const o=!0===i.isAdmin;return await this.parent.activeDevice.secrets.createDeviceSharedSecret(i,r,o)}async update(e){const t=await this.devices.read(e.id.toString());if(!t)throw n.TransportErrors.general.recordNotFound(l.Device,e.id.toString());await this.devices.update(t,e)}async delete(e){await this.devices.delete(e)}async list(){const e=await this.devices.list();return await this.parseArray(e,l.Device)}}t.DevicesController=DevicesController},8185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceAuthClient=void 0;const n=r(2027);class DeviceAuthClient extends n.RESTClientAuthenticate{constructor(){super(...arguments),this._logDirective=n.RESTClientLogDirective.LogResponse}async changeDevicePassword(e){return await this.put("/api/v1/Devices/Self/Password",e,{})}async createDevice(e){return await this.post("/api/v1/Devices",e,{})}async registerPushNotificationToken(e){return await this.put("/api/v1/Devices/Self/PushNotifications",e)}}t.DeviceAuthClient=DeviceAuthClient},6961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceClient=void 0;const n=r(2027);class DeviceClient extends n.RESTClient{constructor(){super(...arguments),this._logDirective=n.RESTClientLogDirective.LogResponse}async createDevice(e){return await this.post("/api/v1/Devices",e,{})}}t.DeviceClient=DeviceClient},6453:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Device=t.DeviceType=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(4062),p=r(9170);!function(e){e[e.Unknown=0]="Unknown",e[e.Phone=1]="Phone",e[e.Tablet=2]="Tablet",e[e.Desktop=3]="Desktop",e[e.Connector=4]="Connector"}(t.DeviceType||(t.DeviceType={}));let d=n=class Device extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.isAdmin)),(0,c.nameof)((e=>e.publicKey)),(0,c.nameof)((e=>e.certificate)),(0,c.nameof)((e=>e.operatingSystem)),(0,c.nameof)((e=>e.type)),(0,c.nameof)((e=>e.createdAt)),(0,c.nameof)((e=>e.createdByDevice)),(0,c.nameof)((e=>e.lastLoginAt)),(0,c.nameof)((e=>e.username)),(0,c.nameof)((e=>e.initialPassword)),(0,c.nameof)((e=>e.datawalletVersion))],this.userdataProperties=[(0,c.nameof)((e=>e.name)),(0,c.nameof)((e=>e.description))]}static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CryptoSignaturePublicKey)],d.prototype,"publicKey",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"certificate",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],d.prototype,"name",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"description",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"operatingSystem",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",u.CoreDate)],d.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",p.CoreId)],d.prototype,"createdByDevice",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CoreDate)],d.prototype,"lastLoginAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Number)],d.prototype,"type",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"username",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"initialPassword",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Boolean)],d.prototype,"isAdmin",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Number)],d.prototype,"datawalletVersion",void 0),d=n=i([(0,a.type)("Device")],d),t.Device=d},413:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceSecretCredentials=void 0;const a=r(194),s=r(2027);let c=n=class DeviceSecretCredentials extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}};i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CoreId)],c.prototype,"id",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],c.prototype,"password",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],c.prototype,"username",void 0),c=n=i([(0,a.type)("DeviceSecretCredentials")],c),t.DeviceSecretCredentials=c},9798:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendDeviceParameters=void 0;const a=r(194),s=r(2027);let c=n=class SendDeviceParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],c.prototype,"name",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],c.prototype,"description",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Boolean)],c.prototype,"isAdmin",void 0),c=n=i([(0,a.type)("SendDeviceParameters")],c),t.SendDeviceParameters=c},6758:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceSharedSecret=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(2016);let u=n=class DeviceSharedSecret extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.serialize)(),(0,a.validate)(),o("design:type",c.CoreId)],u.prototype,"id",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",c.CoreId)],u.prototype,"createdByDevice",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",c.CoreDate)],u.prototype,"createdAt",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],u.prototype,"name",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],u.prototype,"description",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CryptoSecretKey)],u.prototype,"synchronizationKey",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CryptoSecretKey)],u.prototype,"secretBaseKey",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",Number)],u.prototype,"deviceIndex",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",s.CryptoSignaturePrivateKey)],u.prototype,"identityPrivateKey",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",l.Identity)],u.prototype,"identity",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",String)],u.prototype,"username",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",String)],u.prototype,"password",void 0),u=n=i([(0,a.type)("DeviceSharedSecret")],u),t.DeviceSharedSecret=u},9777:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileController=void 0;const n=r(2890),i=r(2027),o=r(369),a=r(2508),s=r(7145),c=r(7373),l=r(9873),u=r(8340),p=r(3159),d=r(9579);class FileController extends a.TransportController{constructor(e){super(a.ControllerName.File,e)}async init(){return await super.init(),this.client=new s.FileClient(this.config,this.parent.authenticator),this.files=await this.parent.getSynchronizedCollection(o.DbCollectionName.Files),this}async getFiles(e){const t=await this.files.find(e);return await this.parseArray(t,l.File)}async getFile(e){const t=await this.files.read(e.toString());return t?await l.File.from(t):void 0}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getFiles({ids:e.map((e=>e.id))})).value.collect()).map((async e=>{const t=await this.files.read(e.id),r=await l.File.from(t);return{id:i.CoreId.from(e.id),cache:await this.decryptFile(e,r.secretKey)}}));return await Promise.all(t)}async updateCache(e){if(e.length<1)return[];const t=[];for(const r of e){const e=await this.client.getFile(r);if(e.isError){if("error.transport.recordNotFound"===e.error.code||"error.transport.request.notFound"===e.error.code){this.log.warn(`Record id ${r} could not be found on backbone. It might be expired.`,e.error);continue}throw e.error}const n=e.value;t.push(this.updateCacheOfExistingFileInDb(n.id,n))}return await Promise.all(t)}async updateCacheOfExistingFileInDb(e,t){const r=await this.files.read(e);if(!r)throw i.TransportErrors.general.recordNotFound(l.File,e).logWith(this._log);const n=await l.File.from(r);return await this.updateCacheOfFile(n,t),await this.files.update(r,n),n}async updateCacheOfFile(e,t){const r=e.id.toString();t||(t=(await this.client.getFile(r)).value);const n=await this.decryptFile(t,e.secretKey);e.setCache(n),e.isOwn=this.parent.identity.isMe(n.createdBy)}async decryptFile(e,t){const r=await n.CryptoCipher.fromBase64(e.encryptedProperties),o=await i.CoreCrypto.decrypt(r,t),a=await p.FileMetadata.deserialize(o.toUtf8());if(!(a instanceof p.FileMetadata))throw i.TransportErrors.files.invalidMetadata(e.id).logWith(this._log);return await c.CachedFile.fromBackbone(e,a)}async loadPeerFileByTruncated(e){const t=await d.FileReference.fromTruncated(e);return await this.loadPeerFileByReference(t)}async loadPeerFileByReference(e){return await this.loadPeerFile(e.id,e.key)}async loadPeerFile(e,t){if(await this.files.read(e.toString()))return await this.updateCacheOfExistingFileInDb(e.toString());const r=await l.File.from({id:e,secretKey:t,isOwn:!1});return await this.updateCacheOfFile(r),await this.files.create(r),r}async setFileMetadata(e,t){const r=e instanceof i.CoreId?e.toString():e.id.toString(),n=await this.files.read(r);if(!n)throw i.TransportErrors.general.recordNotFound(l.File,r.toString()).logWith(this._log);const o=await l.File.from(n);return o.setMetadata(t),await this.files.update(n,o),o}async sendFile(e){const t=await u.SendFileParameters.from(e),r=t.buffer,o=r.length;if(o>this.config.platformMaxUnencryptedFileSize)throw i.TransportErrors.files.maxFileSizeExceeded(o,this.config.platformMaxUnencryptedFileSize);const a=await n.CryptoHash.hash(r,2),s=i.CoreHash.from(a.toBase64URL()),d=await this.parent.activeDevice.sign(a),h=d.toBase64(),g=await i.CoreCrypto.generateSecretKey(),y=await i.CoreCrypto.encrypt(r,g),m=n.CoreBuffer.fromBase64URL(y.toBase64()),v=await n.CryptoHash.hash(m,2),w=i.CoreHash.from(v.toBase64URL()),b=(await p.FileMetadata.from({title:t.title,description:t.description,filename:t.filename,filesize:o,plaintextHash:s,secretKey:g,filemodified:t.filemodified,mimetype:t.mimetype})).serialize(),C=n.CoreBuffer.fromString(b,n.Encoding.Utf8),_=await i.CoreCrypto.generateSecretKey(),S=await i.CoreCrypto.encrypt(C,_),T=this.parent.identity.address,O=(await this.client.createFile({content:m.buffer,cipherHash:v.toBase64URL(),owner:T.toString(),ownerSignature:h,expiresAt:t.expiresAt.toString(),encryptedProperties:S.toBase64()})).value,R=await c.CachedFile.from({title:t.title,description:t.description,filename:t.filename,filesize:o,filemodified:t.filemodified,cipherKey:g,cipherHash:w,createdAt:i.CoreDate.from(O.createdAt),createdBy:i.CoreAddress.from(O.createdBy),createdByDevice:i.CoreId.from(O.createdByDevice),expiresAt:i.CoreDate.from(O.expiresAt),mimetype:t.mimetype,owner:i.CoreAddress.from(O.owner),ownerSignature:d,plaintextHash:s}),I=await l.File.from({id:i.CoreId.from(O.id),secretKey:_,isOwn:!0});return I.setCache(R),await this.files.create(I),I}async downloadFileContent(e){const t=e instanceof l.File?e:await this.getFile(e);if(!t)throw i.TransportErrors.general.recordNotFound(l.File,e.toString()).logWith(this._log);if(!t.cache)throw i.TransportErrors.general.cacheEmpty(l.File,t.id.toString()).logWith(this._log);const r=(await this.client.downloadFile(t.id.toString())).value,o=n.CoreBuffer.fromObject(r);if((await n.CryptoHash.hash(o,2)).toBase64URL()!==t.cache.cipherHash.hash)throw i.TransportErrors.files.cipherMismatch().logWith(this._log);const a=await n.CryptoCipher.fromBase64(o.toBase64URL()),s=await i.CoreCrypto.decrypt(a,t.cache.cipherKey);if(!await t.cache.plaintextHash.verify(s,2))throw i.TransportErrors.files.plaintextHashMismatch().logWith(this._log);return s}}t.FileController=FileController},2153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5560:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7145:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileClient=void 0;const n=r(6054);class FileClient extends n.RESTClientAuthenticate{async createFile(e){return await this.postMultipart("/api/v1/Files",e)}async getFiles(e){return await this.getPaged("/api/v1/Files",e)}async getFile(e){return await this.get(`/api/v1/Files/${e}/metadata`)}async deleteFile(e){return await this.delete(`/api/v1/Files/${e}`)}async downloadFile(e){return await this.download(`/api/v1/Files/${e}`)}}t.FileClient=FileClient},7373:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedFile=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class CachedFile extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async fromBackbone(e,t){return await n.from({title:t.title,description:t.description,cipherKey:t.secretKey,filemodified:t.filemodified,filename:t.filename,filesize:t.filesize,plaintextHash:t.plaintextHash,deletedAt:e.deletedAt?c.CoreDate.from(e.deletedAt):void 0,deletedBy:e.deletedBy?c.CoreAddress.from(e.deletedBy):void 0,deletedByDevice:e.deletedByDevice?c.CoreId.from(e.deletedByDevice):void 0,cipherHash:c.CoreHash.from(e.cipherHash),createdAt:c.CoreDate.from(e.createdAt),createdBy:c.CoreAddress.from(e.createdBy),createdByDevice:c.CoreId.from(e.createdByDevice),expiresAt:c.CoreDate.from(e.expiresAt),mimetype:t.mimetype,owner:c.CoreAddress.from(e.owner),ownerSignature:await s.CryptoSignature.fromBase64(e.ownerSignature)})}};i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],l.prototype,"title",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"filename",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Number)],l.prototype,"filesize",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"filemodified",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"mimetype",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreHash)],l.prototype,"cipherHash",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],l.prototype,"description",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],l.prototype,"owner",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"ownerSignature",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreHash)],l.prototype,"plaintextHash",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],l.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"cipherKey",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"deletedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreAddress)],l.prototype,"deletedBy",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"deletedByDevice",void 0),l=n=i([(0,a.type)("CachedFile")],l),t.CachedFile=l},9873:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.File=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(9579),p=r(7373);let d=n=class File extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.secretKey)),(0,c.nameof)((e=>e.isOwn))],this.metadataProperties=[(0,c.nameof)((e=>e.metadata)),(0,c.nameof)((e=>e.metadataModifiedAt))]}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}async toFileReference(){return await u.FileReference.from({id:this.id,key:this.secretKey})}setCache(e){return this.cache=e,this.cachedAt=l.CoreDate.utc(),this}setMetadata(e){return this.metadata=e,this.metadataModifiedAt=l.CoreDate.utc(),this}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],d.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],d.prototype,"isOwn",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",p.CachedFile)],d.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],d.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],d.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],d.prototype,"metadataModifiedAt",void 0),d=n=i([(0,a.type)("File")],d),t.File=d},8340:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendFileParameters=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(4062);let u=n=class SendFileParameters extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"title",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"description",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"filename",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"mimetype",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.CoreDate)],u.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],u.prototype,"filemodified",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreBuffer)],u.prototype,"buffer",void 0),u=n=i([(0,a.type)("SendFileParameters")],u),t.SendFileParameters=u},3159:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.FileMetadata=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class FileMetadata extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],l.prototype,"title",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],l.prototype,"description",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"filename",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreHash)],l.prototype,"plaintextHash",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Number)],l.prototype,"filesize",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"filemodified",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"mimetype",void 0),l=n=i([(0,a.type)("FileMetadata")],l),t.FileMetadata=l},9579:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.FileReference=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class FileReference extends c.CoreSerializableAsync{truncate(){return s.CoreBuffer.fromUtf8(`${this.id.toString()}|${this.key.algorithm}|${this.key.secretKey.toBase64URL()}`).toBase64URL()}static async fromTruncated(e){const t=s.CoreBuffer.fromBase64URL(e).toUtf8().split("|");if(3!==t.length)throw c.TransportErrors.files.invalidTruncatedReference();try{const e=c.CoreId.from(t[0]),r=parseInt(t[1]),i=t[2],o=await s.CryptoSecretKey.from({algorithm:r,secretKey:s.CoreBuffer.fromBase64URL(i)});return await n.from({id:c.CoreId.from(e),key:o})}catch(e){throw c.TransportErrors.files.invalidTruncatedReference()}}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"id",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"key",void 0),l=n=i([(0,a.type)("FileReference")],l),t.FileReference=l},9662:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7024),t),i(r(5366),t),i(r(2016),t),i(r(6346),t),i(r(761),t),i(r(1615),t),i(r(2723),t),i(r(8324),t),i(r(365),t),i(r(8951),t),i(r(4507),t),i(r(7584),t),i(r(1949),t),i(r(8176),t),i(r(6578),t),i(r(4220),t),i(r(3327),t),i(r(7376),t),i(r(8579),t),i(r(3727),t),i(r(9745),t),i(r(1430),t),i(r(3122),t),i(r(1772),t),i(r(9626),t),i(r(9643),t),i(r(8565),t),i(r(8185),t),i(r(8382),t),i(r(6961),t),i(r(7896),t),i(r(4980),t),i(r(2556),t),i(r(6453),t),i(r(413),t),i(r(9798),t),i(r(6758),t),i(r(2153),t),i(r(5560),t),i(r(7145),t),i(r(9777),t),i(r(7373),t),i(r(9873),t),i(r(8340),t),i(r(3159),t),i(r(9579),t),i(r(7239),t),i(r(5523),t),i(r(3125),t),i(r(2510),t),i(r(6614),t),i(r(4949),t),i(r(5832),t),i(r(8909),t),i(r(4937),t),i(r(4226),t),i(r(8009),t),i(r(7242),t),i(r(6164),t),i(r(7902),t),i(r(1903),t),i(r(4002),t),i(r(169),t),i(r(2182),t),i(r(8440),t),i(r(3666),t),i(r(3654),t),i(r(3582),t),i(r(1512),t),i(r(3771),t),i(r(3611),t),i(r(6411),t),i(r(5289),t),i(r(5784),t),i(r(3857),t),i(r(8174),t),i(r(3861),t),i(r(334),t),i(r(7262),t),i(r(8805),t),i(r(8572),t),i(r(7215),t),i(r(9270),t),i(r(1752),t),i(r(3778),t),i(r(2343),t),i(r(3522),t),i(r(3293),t),i(r(3129),t),i(r(9423),t),i(r(7636),t),i(r(5739),t),i(r(6890),t),i(r(3670),t),i(r(8571),t),i(r(4401),t),i(r(1541),t),i(r(7224),t),i(r(5079),t),i(r(7596),t),i(r(9267),t),i(r(8222),t),i(r(9761),t),i(r(9750),t),i(r(1295),t),i(r(26),t),i(r(8697),t),i(r(7653),t),i(r(7267),t),i(r(6591),t),i(r(8342),t),i(r(5898),t),i(r(4102),t),i(r(4503),t),i(r(5083),t),i(r(2238),t),i(r(1488),t),i(r(7776),t)},5832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageController=void 0;const n=r(2890),i=r(4714),o=r(2027),a=r(369),s=r(2508),c=r(9873),l=r(2182),u=r(3654),p=r(3125),d=r(2510),h=r(6614),g=r(4949),y=r(8909),m=r(4937),v=r(4226),w=r(8009),b=r(7242);class MessageController extends s.TransportController{constructor(e){super(s.ControllerName.Message,e),this.relationships=e.relationships}async init(){return await super.init(),this.secrets=new u.RelationshipSecretController(this.parent),await this.secrets.init(),this.client=new p.MessageClient(this.config,this.parent.authenticator),this.messages=await this.parent.getSynchronizedCollection(a.DbCollectionName.Messages),this}async getMessages(e){const t=await this.messages.find(e);return await this.parseArray(t,h.Message)}async getMessagesByRelationshipId(e){return await this.getMessages({[(0,i.nameof)((e=>e.relationshipIds))]:{$contains:e.toString()}})}async getMessagesByAddress(e){const t=await this.parent.relationships.getActiveRelationshipToIdentity(e);if(!t)throw o.TransportErrors.messages.noMatchingRelationship(e.toString()).logWith(this._log);return await this.getMessagesByRelationshipId(t.id)}async getReceivedMessages(){return await this.getMessages({[(0,i.nameof)((e=>e.isOwn))]:!1})}async getMessage(e){const t=await this.messages.read(e.toString());return t?await h.Message.from(t):void 0}async updateCache(e){if(e.length<1)return[];const t=(await this.client.getMessages({ids:e})).value,r=[];for await(const e of t)r.push(this.updateCacheOfExistingMessageInDb(e.id,e));return await Promise.all(r)}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getMessages({ids:e.map((e=>e.toString()))})).value.collect()).map((async e=>{const t=await this.messages.read(e.id),r=await h.Message.from(t),n=await this.getEnvelopeFromBackboneGetMessagesResponse(e),i=(await this.decryptMessage(n,r.secretKey))[0];return{id:o.CoreId.from(e.id),cache:i}}));return await Promise.all(t)}async updateCacheOfExistingMessageInDb(e,t){const r=await this.messages.read(e);if(!r)throw o.TransportErrors.general.recordNotFound(h.Message,e).logWith(this._log);const n=await h.Message.from(r);return await this.updateCacheOfMessage(n,t),await this.messages.update(r,n),n}async updateCacheOfMessage(e,t){const r=e.id.toString();t||(t=(await this.client.getMessage(r)).value);const n=await this.getEnvelopeFromBackboneGetMessagesResponse(t),[i,o]=await this.decryptMessage(n,e.secretKey);e.secretKey=o,e.setCache(i)}async loadPeerMessage(e){const t=(await this.client.getMessage(e.toString())).value,r=await this.getEnvelopeFromBackboneGetMessagesResponse(t),[n,i,a]=await this.decryptMessage(r);if(!a)throw o.TransportErrors.general.recordNotFound(l.Relationship,r.id.toString()).logWith(this._log);const s=await h.Message.from({id:r.id,isOwn:!1,secretKey:i,relationshipIds:[a.id]});return s.setCache(n),await this.messages.create(s),s}async getEnvelopeFromBackboneGetMessagesResponse(e){const t=[];for(const r of e.recipients){const e=await m.MessageEnvelopeRecipient.from({encryptedKey:await n.CryptoCipher.fromBase64(r.encryptedKey),address:o.CoreAddress.from(r.address),receivedAt:r.receivedAt?o.CoreDate.from(r.receivedAt):void 0,receivedByDevice:r.receivedByDevice?o.CoreId.from(r.receivedByDevice):void 0});t.push(e)}return await y.MessageEnvelope.from({id:o.CoreId.from(e.id),createdAt:o.CoreDate.from(e.createdAt),createdBy:o.CoreAddress.from(e.createdBy),createdByDevice:o.CoreId.from(e.createdByDevice),cipher:await n.CryptoCipher.fromBase64(e.body),attachments:e.attachments,recipients:t})}async setMessageMetadata(e,t){const r=e instanceof o.CoreId?e.toString():e.id.toString(),n=await this.messages.read(r);if(!n)throw o.TransportErrors.general.recordNotFound(h.Message,r.toString()).logWith(this._log);const i=await h.Message.from(n);return i.setMetadata(t),await this.messages.update(n,i),i}async sendMessage(e){(e=await g.SendMessageParameters.from(e)).attachments||(e.attachments=[]);const t=await o.CoreCrypto.generateSecretKey(),r=t.serialize(!1),i=[],a=[];for(const t of e.recipients){const e=await this.relationships.getActiveRelationshipToIdentity(o.CoreAddress.from(t));if(!e)throw o.TransportErrors.general.recordNotFound(l.Relationship,t.toString()).logWith(this._log);const n=await this.secrets.encrypt(e.relationshipSecretId,r);a.push(await m.MessageEnvelopeRecipient.from({address:t,encryptedKey:n})),i.push(t)}const s=[],u=[];for(const t of e.attachments){const e=await c.File.from(t);u.push(await e.toFileReference()),s.push(e.id)}const p=(await v.MessagePlain.from({content:e.content,recipients:i,createdAt:o.CoreDate.utc(),attachments:u})).serialize(),y=n.CoreBuffer.fromUtf8(p),C=[],_=[];for(const t of e.recipients){const e=await this.relationships.getActiveRelationshipToIdentity(o.CoreAddress.from(t));if(!e)throw o.TransportErrors.general.recordNotFound(l.Relationship,t.toString()).logWith(this._log);const r=await this.secrets.sign(e.relationshipSecretId,y),n=await w.MessageSignature.from({recipient:t,signature:r});C.push(n),_.push(e.id)}const S=(await b.MessageSigned.from({message:p,signatures:C})).serialize(),T=await o.CoreCrypto.encrypt(n.CoreBuffer.fromUtf8(S),t),O=a.map((e=>({address:e.address.toString(),encryptedKey:e.encryptedKey.toBase64()}))),R=s.map((e=>({id:e.id}))),I=(await this.client.createMessage({attachments:R,body:T.toBase64(),recipients:O})).value,E=await d.CachedMessage.from({content:e.content,createdAt:o.CoreDate.from(I.createdAt),createdBy:this.parent.identity.identity.address,createdByDevice:this.parent.activeDevice.id,recipients:a,attachments:s,receivedByEveryone:!1}),L=await h.Message.from({id:o.CoreId.from(I.id),secretKey:t,cache:E,cachedAt:o.CoreDate.utc(),isOwn:!0,relationshipIds:_});return await this.messages.create(L),L}async decryptOwnEnvelope(e,t){this.log.trace(`Decrypting own envelope with id ${e.id.toString()}...`);const r=await o.CoreCrypto.decrypt(e.cipher,t),n=await b.MessageSigned.deserialize(r.toUtf8());return await v.MessagePlain.from(JSON.parse(n.message))}async decryptPeerEnvelope(e,t){var r,i;const a=null===(r=e.recipients.find((e=>this.parent.identity.isMe(e.address))))||void 0===r?void 0:r.encryptedKey;if(!a)throw o.TransportErrors.messages.ownAddressNotInList(e.id.toString()).logWith(this._log);const s=await this.secrets.decryptPeer(t.relationshipSecretId,a,!0),c=await n.CryptoSecretKey.deserialize(s.toUtf8()),l=await o.CoreCrypto.decrypt(e.cipher,c),u=await b.MessageSigned.deserialize(l.toUtf8()),p=null===(i=u.signatures.find((e=>this.parent.identity.isMe(e.recipient))))||void 0===i?void 0:i.signature;if(!p)throw o.TransportErrors.messages.signatureListMismatch(e.id.toString()).logWith(this._log);const d=await v.MessagePlain.from(JSON.parse(u.message));u.signatures.length!==d.recipients.length&&this.log.debug(`Number of signatures does not match number of recipients from envelope ${e.id}.`);const h=n.CoreBuffer.fromUtf8(u.message);if(!await this.secrets.verifyPeer(t.relationshipSecretId,h,p))throw o.TransportErrors.messages.signatureNotValid().logWith(this._log);d.recipients.length!==e.recipients.length&&this.log.debug(`Number of signed recipients within the message does not match number of recipients from envelope ${e.id}.`),d.recipients.length!==u.signatures.length&&this.log.debug(`Number of signed recipients within the message does not match number of signatures from envelope ${e.id}.`);if(!d.recipients.some((e=>this.parent.identity.isMe(e))))throw o.TransportErrors.messages.plaintextMismatch(e.id.toString()).logWith(this._log);return[d,c]}async decryptMessage(e,t){let r,n,i;if(this.log.trace(`Decrypting MessageEnvelope with id ${e.id}...`),this.parent.identity.isMe(e.createdBy)){if(!t)throw o.TransportErrors.messages.noSecretKeyForOwnMessage(e.id.toString()).logWith(this._log);n=t,r=await this.decryptOwnEnvelope(e,t)}else{if(i=await this.relationships.getActiveRelationshipToIdentity(e.createdBy),!i)throw o.TransportErrors.messages.noMatchingRelationship(e.createdBy.toString()).logWith(this._log);const[t,a]=await this.decryptPeerEnvelope(e,i);r=t,n=a}this.log.trace("Message is valid. Fetching attachments for message...");const a=[],s=[];for(const e of r.attachments)s.push(this.parent.files.loadPeerFileByReference(e)),a.push(e.id);await Promise.all(s),this.log.trace("Attachments fetched. Creating message...");return[await d.CachedMessage.from({createdBy:e.createdBy,createdByDevice:e.createdByDevice,recipients:e.recipients,attachments:a,content:r.content,createdAt:e.createdAt,receivedByEveryone:!1}),n,i]}}t.MessageController=MessageController},7239:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageClient=void 0;const n=r(6054);class MessageClient extends n.RESTClientAuthenticate{async getMessages(e){return await this.getPaged("/api/v1/Messages",e)}async createMessage(e){return await this.post("/api/v1/Messages",e)}async getMessage(e){return await this.get(`/api/v1/Messages/${e}`)}async deleteMessage(e){return await this.delete(`/api/v1/Messages/${e}`)}async setRead(e){return await this.put(`/api/v1/Messages/${e}/setReadFlag`,void 0)}}t.MessageClient=MessageClient},2510:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedMessage=void 0;const a=r(194),s=r(2027),c=r(4062),l=r(4937);let u=n=class CachedMessage extends s.CoreSerializableAsync{constructor(){super(...arguments),this.receivedByEveryone=!1}static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreAddress)],u.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],u.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.MessageEnvelopeRecipient}),o("design:type",Array)],u.prototype,"recipients",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],u.prototype,"createdAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)({type:s.CoreId}),o("design:type",Array)],u.prototype,"attachments",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],u.prototype,"receivedByEveryone",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],u.prototype,"content",void 0),u=n=i([(0,a.type)("CachedMessage")],u),t.CachedMessage=u},6614:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Message=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(2510);let p=n=class Message extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.secretKey)),(0,c.nameof)((e=>e.isOwn)),(0,c.nameof)((e=>e.relationshipIds))],this.metadataProperties=[(0,c.nameof)((e=>e.metadata)),(0,c.nameof)((e=>e.metadataModifiedAt))]}static async from(e){return await super.fromT(e,n)}setCache(e){return this.cache=e,this.cachedAt=l.CoreDate.utc(),this}setMetadata(e){return this.metadata=e,this.metadataModifiedAt=l.CoreDate.utc(),this}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],p.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],p.prototype,"isOwn",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CachedMessage)],p.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],p.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],p.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],p.prototype,"metadataModifiedAt",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.CoreId}),o("design:type",Array)],p.prototype,"relationshipIds",void 0),p=n=i([(0,a.type)("Message")],p),t.Message=p},4949:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendMessageParameters=void 0;const a=r(194),s=r(2027),c=r(9873);let l=n=class SendMessageParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)({type:s.CoreAddress}),o("design:type",Array)],l.prototype,"recipients",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],l.prototype,"content",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)({type:c.File}),o("design:type",Array)],l.prototype,"attachments",void 0),l=n=i([(0,a.type)("SendMessageParameters")],l),t.SendMessageParameters=l},8909:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageEnvelope=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(4937);let u=n=class MessageEnvelope extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static mapToJSON(e){const t={};for(const[r,n]of e.entries()){const e=r.serialize(),i=n.serialize();t[e]=i}return t}static async deserializeMap(e){const t=new Map;for(const r in e){const n=e[r],i=c.CoreAddress.deserialize(r),o=await s.CryptoCipher.deserialize(n);t.set(i,o)}return t}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],u.prototype,"id",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],u.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],u.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],u.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.MessageEnvelopeRecipient}),o("design:type",Array)],u.prototype,"recipients",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoCipher)],u.prototype,"cipher",void 0),i([(0,a.validate)(),(0,a.serialize)({type:c.CoreId}),o("design:type",Array)],u.prototype,"attachments",void 0),u=n=i([(0,a.type)("MessageEnvelope")],u),t.MessageEnvelope=u},4937:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageEnvelopeRecipient=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(7875);let u=n=class MessageEnvelopeRecipient extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.CoreAddress)],u.prototype,"address",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoCipher)],u.prototype,"encryptedKey",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],u.prototype,"receivedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreId)],u.prototype,"receivedByDevice",void 0),u=n=i([(0,a.type)("MessageEnvelopeRecipient")],u),t.MessageEnvelopeRecipient=u},4226:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePlain=void 0;const a=r(194),s=r(2027),c=r(7875),l=r(4062),u=r(9579);let p=n=class MessagePlain extends s.CoreSerializableAsync{constructor(){super(...arguments),this.attachments=[]}static async from(e){return void 0===e.attachments&&(e.attachments=[]),await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)({type:u.FileReference}),o("design:type",Array)],p.prototype,"attachments",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],p.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.CoreDate)],p.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)({type:c.CoreAddress}),o("design:type",Array)],p.prototype,"recipients",void 0),p=n=i([(0,a.type)("MessagePlain")],p),t.MessagePlain=p},8009:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageSignature=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class MessageSignature extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],l.prototype,"recipient",void 0),i([(0,a.validate)(),(0,a.serialize)({enforceString:!0}),o("design:type",s.CryptoSignature)],l.prototype,"signature",void 0),l=n=i([(0,a.type)("MessageSignature")],l),t.MessageSignature=l},7242:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageSigned=void 0;const a=r(194),s=r(2027),c=r(8009);let l=n=class MessageSigned extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){const t=JSON.parse(e);return await this.from(t)}};i([(0,a.validate)(),(0,a.serialize)({type:c.MessageSignature}),o("design:type",Array)],l.prototype,"signatures",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"message",void 0),l=n=i([(0,a.type)("MessageSigned")],l),t.MessageSigned=l},2343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplateController=void 0;const n=r(2890),i=r(2027),o=r(369),a=r(2508),s=r(7215),c=r(9270),l=r(1752),u=r(3778),p=r(3522),d=r(3129);class RelationshipTemplateController extends a.TransportController{constructor(e,t,r){super(r||a.ControllerName.RelationshipTemplate,e),this.secrets=t,this.client=new s.RelationshipTemplateClient(this.config,this.parent.authenticator)}async init(){return await super.init(),this.templates=await this.parent.getSynchronizedCollection(o.DbCollectionName.RelationshipTemplates),this}async sendRelationshipTemplate(e){var t;e=await u.SendRelationshipTemplateParameters.from(e);const r=await this.secrets.createTemplateKey(),o=await p.RelationshipTemplateContent.from({content:e.content,identity:this.parent.identity.identity,templateKey:r}),a=await i.CoreCrypto.generateSecretKey(),s=o.serialize(),h=n.CoreBuffer.fromUtf8(s),g=await this.parent.identity.sign(h),y=await d.RelationshipTemplateSigned.from({deviceSignature:g,serializedTemplate:s}),m=n.CoreBuffer.fromUtf8(y.serialize()),v=await i.CoreCrypto.encrypt(m,a),w=(await this.client.createRelationshipTemplate({expiresAt:e.expiresAt.toString(),maxNumberOfRelationships:e.maxNumberOfRelationships,content:v.toBase64()})).value,b=await c.CachedRelationshipTemplate.from({content:e.content,createdAt:i.CoreDate.from(w.createdAt),createdBy:this.parent.identity.address,createdByDevice:this.parent.activeDevice.id,expiresAt:e.expiresAt,identity:this.parent.identity.identity,maxNumberOfRelationships:null!==(t=e.maxNumberOfRelationships)&&void 0!==t?t:void 0,templateKey:r}),C=await l.RelationshipTemplate.from({id:i.CoreId.from(w.id),secretKey:a,isOwn:!0,cache:b,cachedAt:i.CoreDate.utc()});return await this.templates.create(C),C}async deleteRelationshipTemplate(e){await this.client.deleteRelationshipTemplate(e.id.toString()),await this.templates.delete(e)}async getRelationshipTemplates(e){const t=await this.templates.find(e);return await this.parseArray(t,l.RelationshipTemplate)}async updateCache(e){if(e.length<1)return[];const t=[];for(const r of e){const e=await this.client.getRelationshipTemplate(r);if(e.isError){if("error.transport.recordNotFound"===e.error.code||"error.transport.request.notFound"===e.error.code){this.log.warn(`Record id ${r} could not be found on backbone. It might be expired.`,e.error);continue}throw e.error}const n=e.value;t.push(this.updateCacheOfExistingTemplateInDb(n.id,n))}return await Promise.all(t)}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getRelationshipTemplates({ids:e.map((e=>e.id))})).value.collect()).map((async e=>{const t=await this.templates.read(e.id),r=await l.RelationshipTemplate.from(t);return{id:i.CoreId.from(e.id),cache:await this.decryptRelationshipTemplate(e,r.secretKey)}}));return await Promise.all(t)}async updateCacheOfExistingTemplateInDb(e,t){const r=await this.templates.read(e);if(!r)throw i.TransportErrors.general.recordNotFound(l.RelationshipTemplate,e).logWith(this._log);const n=await l.RelationshipTemplate.from(r);return await this.updateCacheOfTemplate(n,t),await this.templates.update(r,n),n}async updateCacheOfTemplate(e,t){t||(t=(await this.client.getRelationshipTemplate(e.id.toString())).value);const r=await this.decryptRelationshipTemplate(t,e.secretKey);e.setCache(r),e.isOwn=this.parent.identity.isMe(r.createdBy)}async decryptRelationshipTemplate(e,t){var r;const o=await n.CryptoCipher.fromBase64(e.content),a=await this.secrets.decryptTemplate(o,t),s=await d.RelationshipTemplateSigned.deserialize(a.toUtf8()),l=await p.RelationshipTemplateContent.deserialize(s.serializedTemplate);if(!await this.secrets.verifyTemplate(n.CoreBuffer.fromUtf8(s.serializedTemplate),s.deviceSignature,l.identity.publicKey))throw i.TransportErrors.general.signatureNotValid("template").logWith(this._log);return await c.CachedRelationshipTemplate.from({content:l.content,createdBy:i.CoreAddress.from(e.createdBy),createdByDevice:i.CoreId.from(e.createdByDevice),createdAt:i.CoreDate.from(e.createdAt),expiresAt:e.expiresAt?i.CoreDate.from(e.expiresAt):void 0,identity:l.identity,maxNumberOfRelationships:null!==(r=e.maxNumberOfRelationships)&&void 0!==r?r:void 0,templateKey:l.templateKey})}async getRelationshipTemplate(e){const t=await this.templates.read(e.toString());if(t)return await l.RelationshipTemplate.from(t)}async setRelationshipTemplateMetadata(e,t){const r=e instanceof i.CoreId?e.toString():e.id.toString(),n=await this.templates.read(r);if(!n)throw i.TransportErrors.general.recordNotFound(l.RelationshipTemplate,r.toString()).logWith(this._log);const o=await l.RelationshipTemplate.from(n);return o.setMetadata(t),await this.templates.update(n,o),o}async loadPeerRelationshipTemplate(e,t){if(await this.templates.read(e.toString()))return await this.updateCacheOfExistingTemplateInDb(e.toString());const r=await l.RelationshipTemplate.from({id:e,secretKey:t,isOwn:!1});return await this.updateCacheOfTemplate(r),await this.templates.create(r),r}}t.RelationshipTemplateController=RelationshipTemplateController},8805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8572:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7215:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplateClient=void 0;const n=r(2027);class RelationshipTemplateClient extends n.RESTClientAuthenticate{async getRelationshipTemplates(e){return await this.getPaged("/api/v1/RelationshipTemplates",e)}async getRelationshipTemplate(e){return await this.get(`/api/v1/RelationshipTemplates/${e}`)}async deleteRelationshipTemplate(e){return await this.delete(`/api/v1/RelationshipTemplates/${e}`)}async createRelationshipTemplate(e){return await this.post("/api/v1/RelationshipTemplates",e)}}t.RelationshipTemplateClient=RelationshipTemplateClient},9270:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedRelationshipTemplate=void 0;const a=r(194),s=r(2027),c=r(9170),l=r(2016),u=r(3293);let p=n=class CachedRelationshipTemplate extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}static validateMaxNumberOfRelationships(e){return void 0===e?"":e<=0?"maxNumberOfRelationships must be greater than 0":""}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.Identity)],p.prototype,"identity",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreAddress)],p.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],p.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",u.RelationshipTemplatePublicKey)],p.prototype,"templateKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],p.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],p.prototype,"createdAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreDate)],p.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0,customValidator:n.validateMaxNumberOfRelationships}),(0,a.serialize)(),o("design:type",Number)],p.prototype,"maxNumberOfRelationships",void 0),p=n=i([(0,a.type)("CachedRelationshipTemplate")],p),t.CachedRelationshipTemplate=p},1752:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplate=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(4062),p=r(9270);let d=n=class RelationshipTemplate extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.secretKey)),(0,c.nameof)((e=>e.isOwn))],this.metadataProperties=[(0,c.nameof)((e=>e.metadata)),(0,c.nameof)((e=>e.metadataModifiedAt))]}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}setCache(e){return this.cache=e,this.cachedAt=u.CoreDate.utc(),this}setMetadata(e){return this.metadata=e,this.metadataModifiedAt=u.CoreDate.utc(),this}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],d.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],d.prototype,"isOwn",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",p.CachedRelationshipTemplate)],d.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CoreDate)],d.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],d.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CoreDate)],d.prototype,"metadataModifiedAt",void 0),d=n=i([(0,a.type)("RelationshipTemplate")],d),t.RelationshipTemplate=d},3778:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendRelationshipTemplateParameters=void 0;const a=r(194),s=r(2027),c=r(9270);let l=n=class SendRelationshipTemplateParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],l.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],l.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0,customValidator:c.CachedRelationshipTemplate.validateMaxNumberOfRelationships}),(0,a.serialize)(),o("design:type",Number)],l.prototype,"maxNumberOfRelationships",void 0),l=n=i([(0,a.type)("SendRelationshipTemplateParameters")],l),t.SendRelationshipTemplateParameters=l},3522:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplateContent=void 0;const a=r(194),s=r(2027),c=r(2016),l=r(3293);let u=n=class RelationshipTemplateContent extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.Identity)],u.prototype,"identity",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.RelationshipTemplatePublicKey)],u.prototype,"templateKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],u.prototype,"content",void 0),u=n=i([(0,a.type)("RelationshipTemplateContent")],u),t.RelationshipTemplateContent=u},3293:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplatePublicKey=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipTemplatePublicKey extends s.CryptoExchangePublicKey{constructor(e,t,r){super(t,r),this.id=e}toJSON(e=!0){const t={id:this.id.toString(),pub:this.publicKey.toBase64URL(),alg:this.algorithm};return e&&(t["@type"]="RelationshipTemplatePublicKey"),t}toBase64(){return s.CoreBuffer.utf8_base64(this.serialize())}serialize(e=!0){return JSON.stringify(this.toJSON(e))}static async fromJSON(e){const t=await s.CryptoExchangePublicKey.fromJSON(e);return new n(c.CoreId.from(e.id),t.algorithm,t.publicKey)}static from(e){return Promise.resolve(new n(c.CoreId.from(e.id),e.algorithm,e.publicKey))}static async deserialize(e){const t=JSON.parse(e);return await this.fromJSON(t)}};i([(0,a.serialize)({enforceString:!0}),(0,a.validate)(),o("design:type",c.CoreId)],l.prototype,"id",void 0),l=n=i([(0,a.type)("RelationshipTemplatePublicKey"),o("design:paramtypes",[c.CoreId,Number,s.CoreBuffer])],l),t.RelationshipTemplatePublicKey=l},3129:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplateSigned=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipTemplateSigned extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"serializedTemplate",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"deviceSignature",void 0),l=n=i([(0,a.type)("RelationshipTemplateSigned")],l),t.RelationshipTemplateSigned=l},3654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipSecretController=void 0;const n=r(2890),i=r(2027),o=r(1341),a=r(18),s=r(8169),c=r(3293),l=r(5739);class RelationshipSecretController extends l.SecretController{constructor(e){super(e,i.ControllerName.RelationshipSecret),this.cache=new Map}async getSecret(e){const t=e.toString(),r=this.cache.get(e);if(r)return r;const i=await this.loadActiveSecretByName(t);if(!i)throw a.TransportErrors.general.recordNotFound("CryptoRelationshipRequestSecrets | CryptoRelationshipSecrets",t).logWith(this._log);if(!(i.secret instanceof n.CryptoRelationshipRequestSecrets||i.secret instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(t).logWith(this._log);const o=i.secret;return this.cache.set(e,o),o}async createRequestorSecrets(e,t){const r=await n.CryptoRelationshipRequestSecrets.fromPeer(e.templateKey,e.identity.publicKey);await this.storeSecret(r,t.toString(),"");return await r.toPublicRequest()}async createTemplatorSecrets(e,t,r){const i=t.templateKey.id.toString(),o=await this.loadActiveSecretByName(i);if(!o)throw a.TransportErrors.general.recordNotFound(n.CryptoExchangeKeypair,i).logWith(this._log);if(!(o.secret instanceof n.CryptoExchangeKeypair))throw a.TransportErrors.secrets.wrongSecretType(i).logWith(this._log);const s=o.secret,c=await n.CryptoRelationshipSecrets.fromRelationshipRequest(r,s);return await this.storeSecret(c,e.toString())}async getPublicResponse(e){const t=await this.loadActiveSecretByName(e.toString());if(!t)throw a.TransportErrors.general.recordNotFound(n.CryptoRelationshipSecrets,e.toString()).logWith(this._log);if(!(t.secret instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(t.id.toString()).logWith(this._log);return await t.secret.toPublicResponse()}async convertSecrets(e,t){const r=await this.getSecret(e);if(r instanceof n.CryptoRelationshipSecrets)throw a.TransportErrors.secrets.wrongSecretType().logWith(this._log);const i=await n.CryptoRelationshipSecrets.fromRelationshipResponse(t,r),o=await this.succeedSecretWithName(i,e.toString());return this.cache.set(e,i),o}async deleteSecretForRequest(e){const t=await this.loadActiveSecretByName(`request_to_${e.address}`);return!!t&&await this.deleteSecretById(t.id)}async decryptTemplate(e,t){return await i.CoreCrypto.decrypt(e,t)}async verifyTemplate(e,t,r){return await i.CoreCrypto.verify(e,t,r)}async encryptRequest(e,t){const r=o.CoreUtil.toBuffer(t),i=await this.getSecret(e);if(!(i instanceof n.CryptoRelationshipRequestSecrets))throw a.TransportErrors.secrets.wrongSecretType(i.id).logWith(this._log);return await i.encryptRequest(r)}async encrypt(e,t){const r=o.CoreUtil.toBuffer(t),i=await this.getSecret(e);if(!(i instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(i.id).logWith(this._log);return await i.encrypt(r)}async decryptRequest(e,t){const r=await this.getSecret(e);if(!(r instanceof n.CryptoRelationshipRequestSecrets||r instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(e.toString()).logWith(this._log);return await r.decryptRequest(t)}async createTemplateKey(){const e=await s.TransportIds.relationshipTemplateKey.generate(),t=(await this.createExchangeKey(`${e.toString()}`))[0];return new c.RelationshipTemplatePublicKey(e,t.algorithm,t.publicKey)}async decryptPeer(e,t,r=!1){const i=await this.getSecret(e);if(!(i instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(i.id).logWith(this._log);return await i.decryptPeer(t,r)}async hasCryptoRelationshipSecrets(e){return await this.getSecret(e)instanceof n.CryptoRelationshipSecrets}async decryptOwn(e,t){const r=await this.getSecret(e);if(!(r instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(r.id).logWith(this._log);return await r.decryptOwn(t)}async sign(e,t){const r=o.CoreUtil.toBuffer(t),n=await this.getSecret(e);return await n.sign(r)}async verifyOwn(e,t,r){const n=o.CoreUtil.toBuffer(t),i=await this.getSecret(e);return await i.verifyOwn(n,r)}async verifyPeer(e,t,r){const i=o.CoreUtil.toBuffer(t),s=await this.getSecret(e);if(s instanceof n.CryptoRelationshipRequestSecrets)throw a.TransportErrors.secrets.wrongSecretType(s.id).logWith(this._log);return await s.verifyPeer(i,r)}}t.RelationshipSecretController=RelationshipSecretController},3666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipsController=void 0;const n=r(2890),i=r(4714),o=r(2027),a=r(1341),s=r(369),c=r(18),l=r(8169),u=r(1752),p=r(4002),d=r(169),h=r(2182),g=r(8440),y=r(3582),m=r(3771),v=r(3611),w=r(6411),b=r(5289),C=r(5784),_=r(3857),S=r(8174),T=r(3861),O=r(334),R=r(7262);class RelationshipsController extends o.TransportController{constructor(e,t){super(o.ControllerName.Relationships,e),this.secrets=t}async init(){return await super.init(),this.client=new p.RelationshipClient(this.config,this.parent.authenticator),this.relationships=await this.parent.getSynchronizedCollection(s.DbCollectionName.Relationships),this}async getRelationships(e){const t=await this.relationships.find(e);return await this.parseArray(t,h.Relationship)}async updateCache(e){if(e.length<1)return[];const t=(await this.client.getRelationships({ids:e})).value,r=[];for await(const e of t)r.push(this.updateCacheOfExistingRelationshipInDb(e.id,e));return await Promise.all(r)}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getRelationships({ids:e.map((e=>e.id))})).value.collect()).map((async e=>{const t=await this.relationships.read(e.id),r=await h.Relationship.from(t);return{id:o.CoreId.from(e.id),cache:await this.decryptRelationship(e,r.relationshipSecretId)}}));return await Promise.all(t)}async updateCacheOfExistingRelationshipInDb(e,t){const r=await this.relationships.read(e);if(!r)throw c.TransportErrors.general.recordNotFound(h.Relationship,e).logWith(this._log);const n=await h.Relationship.from(r);return await this.updateCacheOfRelationship(n,t),await this.relationships.update(r,n),n}async getRelationshipToIdentity(e,t){const r={[`${(0,i.nameof)((e=>e.peer))}.${(0,i.nameof)((e=>e.address))}`]:e.toString()};t&&(r[`${(0,i.nameof)((e=>e.status))}`]=t);const n=await this.relationships.findOne(r);if(n)return await h.Relationship.from(n)}async getActiveRelationshipToIdentity(e){return await this.getRelationshipToIdentity(e,b.RelationshipStatus.Active)}async getRelationship(e){const t=await this.relationships.read(e.toString());if(t)return await h.Relationship.from(t)}async sign(e,t){return await this.secrets.sign(e.relationshipSecretId,t)}async verify(e,t,r){return await this.secrets.verifyPeer(e.relationshipSecretId,t,r)}async verifyIdentity(e,t,r){return await o.CoreCrypto.verify(t,r,e.peer.publicKey)}async sendRelationship(e){const t=(e=await g.SendRelationshipParameters.from(e)).template;if(!t.cache)throw c.TransportErrors.general.cacheEmpty(u.RelationshipTemplate,t.id.toString()).logWith(this._log);const r=await l.TransportIds.relationshipSecret.generate(),{requestCipher:n,requestContent:i}=await this.prepareRequest(r,t,e.content),a=(await this.client.createRelationship({content:n.toBase64(),relationshipTemplateId:t.id.toString()})).value,s=await h.Relationship.fromRequestSent(o.CoreId.from(a.id),t,t.cache.identity,await y.RelationshipChange.fromBackbone(a.changes[0],i.content),r);return await this.relationships.create(s),s}async setRelationshipMetadata(e,t){const r=e instanceof o.CoreId?e.toString():e.id.toString(),n=await this.relationships.read(r);if(!n)throw c.TransportErrors.general.recordNotFound(h.Relationship,r.toString()).logWith(this._log);const i=await h.Relationship.from(n);return i.metadata=t,i.metadataModifiedAt=o.CoreDate.utc(),await this.relationships.update(n,i),i}requestTermination(){throw c.TransportErrors.general.notImplemented()}async acceptChange(e,t){return await this.completeChange(v.RelationshipChangeStatus.Accepted,e,t)}async rejectChange(e,t){return await this.completeChange(v.RelationshipChangeStatus.Rejected,e,t)}async revokeChange(e,t){return await this.completeChange(v.RelationshipChangeStatus.Revoked,e,t)}async updateCacheOfRelationship(e,t){t||(t=(await this.client.getRelationship(e.id.toString())).value);const r=await this.decryptRelationship(t,e.relationshipSecretId);e.setCache(r)}async decryptRelationship(e,t){const r=o.CoreId.from(e.relationshipTemplateId);this._log.trace(`Parsing relationship template ${r} for ${e.id}...`);const n=await this.parent.relationshipTemplates.getRelationshipTemplate(r);if(!n)throw c.TransportErrors.general.recordNotFound(u.RelationshipTemplate,r.toString());this._log.trace(`Parsing relationship changes of ${e.id}...`);const i=[];for(const n of e.changes)if(n.type===w.RelationshipChangeType.Creation)i.push(this.parseCreationChange(n,t,r));const a=await Promise.all(i);return await d.CachedRelationship.from({changes:a,template:n})}async prepareRequest(e,t,r){if(!t.cache)throw c.TransportErrors.general.cacheEmpty(u.RelationshipTemplate,t.id.toString()).logWith(this._log);const n=await this.secrets.createRequestorSecrets(t.cache,e),i=await _.RelationshipCreationChangeRequestContent.from({content:r,identity:this.parent.identity.identity,templateId:t.id}),o=i.serialize(),s=a.CoreUtil.toBuffer(o),[l,p]=await Promise.all([this.parent.activeDevice.sign(s),this.secrets.sign(e,s)]),d=await S.RelationshipCreationChangeRequestSigned.from({serializedRequest:o,deviceSignature:l,relationshipSignature:p}),h=await this.secrets.encryptRequest(e,d);return{requestCipher:await C.RelationshipCreationChangeRequestCipher.from({cipher:h,publicRequestCrypto:n}),requestContent:i}}async applyChangeById(e){const t=(await this.client.getRelationshipChange(e.toString())).value;return await this.applyChange(t)}async applyChange(e){switch(e.type){case w.RelationshipChangeType.Creation:return await this.applyCreationChange(e);case w.RelationshipChangeType.Termination:return await this.applyTerminationChange(e);case w.RelationshipChangeType.TerminationCancellation:return await this.applyTerminationCancellationChange(e);default:throw c.TransportErrors.general.incompatibleBackbone().logWith(this._log)}}async applyCreationChange(e){const t=await this.relationships.read(e.relationshipId);if(t)return e.response?await this.updatePendingRelationshipWithPeerResponse(t,e):void 0;const r=await this.createNewRelationshipByIncomingCreationChange(e);if(e.response){const t=await this.relationships.read(e.relationshipId);return await this.updatePendingRelationshipWithPeerResponse(t,e)}return r}async parseCreationChange(e,t,r){if(e.type!==w.RelationshipChangeType.Creation)throw c.TransportErrors.relationships.wrongChangeType(e.type).logWith(this._log);const n=[];n.push(this.decryptCreationChangeRequest(e.request,t,r));const i=await this.secrets.hasCryptoRelationshipSecrets(t);e.response&&i&&n.push(this.decryptCreationChangeResponse(e,t));const[o,a]=await Promise.all(n);return await y.RelationshipChange.fromBackbone(e,o.content,null==a?void 0:a.content)}async decryptCreationChangeRequest(e,t,r){if(!e.content)throw c.TransportErrors.relationships.emptyOrInvalidContent().logWith(this._log);const i=this.parent.identity.isMe(o.CoreAddress.from(e.createdBy)),a=await C.RelationshipCreationChangeRequestCipher.fromBase64(e.content),s=await this.secrets.decryptRequest(t,a.cipher),l=await S.RelationshipCreationChangeRequestSigned.deserialize(s.toUtf8());let u;if(u=i?await this.secrets.verifyOwn(t,n.CoreBuffer.fromUtf8(l.serializedRequest),l.relationshipSignature):await this.secrets.verifyPeer(t,n.CoreBuffer.fromUtf8(l.serializedRequest),l.relationshipSignature),!u)throw c.TransportErrors.general.signatureNotValid("relationshipRequest").logWith(this._log);const p=await _.RelationshipCreationChangeRequestContent.deserialize(l.serializedRequest);if(p.templateId.toString()!==r.toString())throw c.TransportErrors.relationships.requestContainsWrongTemplateId().logWith(this._log);return p}async decryptCreationChangeResponse(e,t){if(!e.response)throw c.TransportErrors.relationships.changeResponseMissing(e.id).logWith(this._log);if(e.type!==w.RelationshipChangeType.Creation)throw c.TransportErrors.relationships.wrongChangeType(e.type).logWith(this._log);if(!e.response.content)throw c.TransportErrors.relationships.emptyOrInvalidContent(e).logWith(this._log);const r=this.parent.identity.isMe(o.CoreAddress.from(e.response.createdBy)),i=await T.RelationshipCreationChangeResponseCipher.fromBase64(e.response.content);let a;a=e.status!==v.RelationshipChangeStatus.Revoked?r?await this.secrets.decryptOwn(t,i.cipher):await this.secrets.decryptPeer(t,i.cipher,!0):await this.secrets.decryptRequest(t,i.cipher);const s=await R.RelationshipCreationChangeResponseSigned.deserialize(a.toUtf8());let l;if(l=r?await this.secrets.verifyOwn(t,n.CoreBuffer.fromUtf8(s.serializedResponse),s.relationshipSignature):await this.secrets.verifyPeer(t,n.CoreBuffer.fromUtf8(s.serializedResponse),s.relationshipSignature),!l)throw c.TransportErrors.general.signatureNotValid("relationshipResponse").logWith(this._log);const u=await O.RelationshipCreationChangeResponseContent.deserialize(s.serializedResponse);if(u.relationshipId.toString()!==e.relationshipId.toString())throw c.TransportErrors.relationships.responseContainsWrongRequestId().logWith(this._log);return u}async updatePendingRelationshipWithPeerResponse(e,t){const r=await h.Relationship.from(e);if(r.status!==b.RelationshipStatus.Pending)return void this.log.debug("Trying to update non-pending relationship with creation change",t);if(r.cache||await this.updateCacheOfRelationship(r,void 0),!t.response)throw c.TransportErrors.relationships.changeResponseMissing(t.id).logWith(this._log);if(!t.response.content)throw c.TransportErrors.relationships.emptyOrInvalidContent(t).logWith(this._log);const n=await T.RelationshipCreationChangeResponseCipher.fromBase64(t.response.content);if(t.status!==v.RelationshipChangeStatus.Revoked){if(!n.publicResponseCrypto)throw c.TransportErrors.relationships.responseCryptoIsMissing().logWith(this._log);await this.secrets.convertSecrets(r.relationshipSecretId,n.publicResponseCrypto)}const i=await this.decryptCreationChangeResponse(t,r.relationshipSecretId),o=await m.RelationshipChangeResponse.fromBackbone(t.response,i.content);if(!r.cache)throw c.TransportErrors.general.cacheEmpty(h.Relationship,r.id.toString());switch(r.cache.changes[0].status=t.status,t.status){case v.RelationshipChangeStatus.Accepted:r.toActive(o);break;case v.RelationshipChangeStatus.Rejected:r.toRejected(o);break;case v.RelationshipChangeStatus.Revoked:r.toRevoked(o);break;default:throw c.TransportErrors.general.incompatibleBackbone().logWith(this._log)}return await this.relationships.update(e,r),r}async createNewRelationshipByIncomingCreationChange(e){const t=(await this.client.getRelationship(e.relationshipId)).value,r=o.CoreId.from(t.relationshipTemplateId),n=await this.parent.relationshipTemplates.getRelationshipTemplate(r);if(!n)throw c.TransportErrors.general.recordNotFound(u.RelationshipTemplate,r.toString()).logWith(this._log);if(!n.cache)throw c.TransportErrors.general.cacheEmpty(u.RelationshipTemplate,n.id.toString()).logWith(this._log);if(!e.request.content)throw c.TransportErrors.relationships.emptyOrInvalidContent(e).logWith(this._log);const i=await l.TransportIds.relationshipSecret.generate(),a=await C.RelationshipCreationChangeRequestCipher.fromBase64(e.request.content);await this.secrets.createTemplatorSecrets(i,n.cache,a.publicRequestCrypto);const s=await this.decryptCreationChangeRequest(t.changes[0].request,i,r),p=await y.RelationshipChange.fromBackbone(e,s.content),d=await h.Relationship.fromCreationChangeReceived(t,n,s.identity,p,i);return await this.relationships.create(d),d}applyTerminationChange(e){throw c.TransportErrors.general.notImplemented()}applyTerminationCancellationChange(e){throw c.TransportErrors.general.notImplemented()}async completeChange(e,t,r){const n=await this.relationships.read(t.relationshipId.toString());if(!n)throw c.TransportErrors.general.recordNotFound(h.Relationship,t.relationshipId.toString()).logWith(this._log);const i=await h.Relationship.from(n);if(i.cache||await this.updateCacheOfRelationship(i),!i.cache)throw c.TransportErrors.general.cacheEmpty(h.Relationship,i.id.toString());const o=i.cache.changes.find((e=>e.id.toString()===t.id.toString()));if(!o)throw c.TransportErrors.general.recordNotFound(y.RelationshipChange,t.id.toString()).logWith(this._log);if(o.status!==v.RelationshipChangeStatus.Pending)throw c.TransportErrors.relationships.wrongChangeStatus(o.status).logWith(this._log);let a,s;switch(r&&(a=e===v.RelationshipChangeStatus.Revoked?await this.encryptRevokeContent(i,r):await this.encryptAcceptRejectContent(i,r)),e){case v.RelationshipChangeStatus.Accepted:s=(await this.client.acceptRelationshipChange(i.id.toString(),t.id.toString(),a)).value;break;case v.RelationshipChangeStatus.Rejected:s=(await this.client.rejectRelationshipChange(i.id.toString(),t.id.toString(),a)).value;break;case v.RelationshipChangeStatus.Revoked:s=(await this.client.revokeRelationshipChange(i.id.toString(),t.id.toString(),a)).value;break;default:throw new Error("target change status not supported")}const l=s.changes[s.changes.length-1];return o.response=await m.RelationshipChangeResponse.fromBackbone(s.changes[s.changes.length-1].response,r),o.status=l.status,i.status=s.status,await this.relationships.update(n,i),i}async encryptRevokeContent(e,t){const r=(await O.RelationshipCreationChangeResponseContent.from({relationshipId:e.id,content:t})).serialize(),n=a.CoreUtil.toBuffer(r),[i,o]=await Promise.all([this.parent.activeDevice.sign(n),this.secrets.sign(e.relationshipSecretId,n)]),s=await R.RelationshipCreationChangeResponseSigned.from({serializedResponse:r,deviceSignature:i,relationshipSignature:o}),c=await this.secrets.encryptRequest(e.relationshipSecretId,s);return(await T.RelationshipCreationChangeResponseCipher.from({cipher:c})).toBase64()}async encryptAcceptRejectContent(e,t){const r=await this.secrets.getPublicResponse(e.relationshipSecretId),n=(await O.RelationshipCreationChangeResponseContent.from({relationshipId:e.id,content:t})).serialize(),i=a.CoreUtil.toBuffer(n),[o,s]=await Promise.all([this.parent.activeDevice.sign(i),this.secrets.sign(e.relationshipSecretId,i)]),c=await R.RelationshipCreationChangeResponseSigned.from({serializedResponse:n,deviceSignature:o,relationshipSignature:s}),l=await this.secrets.encrypt(e.relationshipSecretId,c);return(await T.RelationshipCreationChangeResponseCipher.from({cipher:l,publicResponseCrypto:r})).toBase64()}}t.RelationshipsController=RelationshipsController},6164:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1903:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipClient=void 0;const n=r(6054);class RelationshipClient extends n.RESTClientAuthenticate{async createRelationship(e){return await this.post("/api/v1/Relationships",e)}async createRelationshipChange(e,t){return await this.post(`/api/v1/Relationships/${e}/Changes`,t)}async acceptRelationshipChange(e,t,r){return await this.put(`/api/v1/Relationships/${e}/Changes/${t}/Accept`,{content:r})}async rejectRelationshipChange(e,t,r){return await this.put(`/api/v1/Relationships/${e}/Changes/${t}/Reject`,{content:r})}async revokeRelationshipChange(e,t,r){return await this.put(`/api/v1/Relationships/${e}/Changes/${t}/Revoke`,{content:r})}async getRelationships(e){return await this.getPaged("/api/v1/Relationships",e)}async getRelationship(e){return await this.get(`/api/v1/Relationships/${e}`)}async getRelationshipChanges(e){return await this.getPaged("/api/v1/Relationships/Changes",e)}async getRelationshipChange(e){return await this.get(`/api/v1/Relationships/Changes/${e}`)}}t.RelationshipClient=RelationshipClient},169:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedRelationship=void 0;const a=r(194),s=r(2027),c=r(1752),l=r(3582);let u=n=class CachedRelationship extends s.CoreSerializableAsync{get creationChange(){return this.changes[0]}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.RelationshipTemplate)],u.prototype,"template",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.RelationshipChange}),o("design:type",Array)],u.prototype,"changes",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreDate)],u.prototype,"lastMessageSentAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreDate)],u.prototype,"lastMessageReceivedAt",void 0),u=n=i([(0,a.type)("CachedRelationship")],u),t.CachedRelationship=u},2182:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Relationship=void 0;const a=r(194),s=r(4714),c=r(2027),l=r(2016),u=r(5289),p=r(169);let d=n=class Relationship extends c.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,s.nameof)((e=>e.relationshipSecretId)),(0,s.nameof)((e=>e.peer)),(0,s.nameof)((e=>e.status))],this.metadataProperties=[(0,s.nameof)((e=>e.metadata)),(0,s.nameof)((e=>e.metadataModifiedAt))]}static async fromRequestSent(e,t,r,i,o){const a=await p.CachedRelationship.from({changes:[i],template:t});return await n.from({id:e,peer:r,status:u.RelationshipStatus.Pending,cache:a,cachedAt:c.CoreDate.utc(),relationshipSecretId:o})}static async fromCreationChangeReceived(e,t,r,i,o){const a=await p.CachedRelationship.from({changes:[i],template:t});return await n.from({id:c.CoreId.from(e.id),relationshipSecretId:o,peer:r,status:u.RelationshipStatus.Pending,cache:a,cachedAt:c.CoreDate.utc()})}toActive(e){if(!this.cache)throw c.TransportErrors.general.cacheEmpty(n,this.id.toString());this.cache.changes[0].response=e,this.status=u.RelationshipStatus.Active}toRejected(e){if(!this.cache)throw c.TransportErrors.general.cacheEmpty(n,this.id.toString());this.cache.changes[0].response=e,this.status=u.RelationshipStatus.Rejected}toRevoked(e){if(!this.cache)throw c.TransportErrors.general.cacheEmpty(n,this.id.toString());this.cache.changes[0].response=e,this.status=u.RelationshipStatus.Revoked}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}setCache(e){return this.cache=e,this.cachedAt=c.CoreDate.utc(),this}setMetadata(e){return this.metadata=e,this.metadataModifiedAt=c.CoreDate.utc(),this}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],d.prototype,"relationshipSecretId",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.Identity)],d.prototype,"peer",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],d.prototype,"status",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",p.CachedRelationship)],d.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],d.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],d.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],d.prototype,"metadataModifiedAt",void 0),d=n=i([(0,a.type)("Relationship")],d),t.Relationship=d},8440:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendRelationshipParameters=void 0;const a=r(194),s=r(2027),c=r(1752);let l=n=class SendRelationshipParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],l.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.RelationshipTemplate)],l.prototype,"template",void 0),l=n=i([(0,a.type)("SendRelationshipParameters")],l),t.SendRelationshipParameters=l},5289:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipStatus=void 0,function(e){e.Pending="Pending",e.Active="Active",e.Rejected="Rejected",e.Revoked="Revoked",e.Terminating="Terminating",e.Terminated="Terminated"}(t.RelationshipStatus||(t.RelationshipStatus={}))},3582:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChange=void 0;const o=r(194),a=r(2027),s=r(9170),c=r(1512),l=r(3771);r(3611),r(6411);class RelationshipChange extends a.CoreSerializableAsync{static async fromBackbone(e,t,r){const n=await this.from({id:s.CoreId.from(e.id),relationshipId:s.CoreId.from(e.relationshipId),type:e.type,status:e.status,request:await c.RelationshipChangeRequest.fromBackbone(e.request,t)});return e.response&&(n.response=await l.RelationshipChangeResponse.fromBackbone(e.response,r)),n}static async from(e){return await super.fromT(e,RelationshipChange)}static async deserialize(e){return await super.deserializeT(e,RelationshipChange)}}n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],RelationshipChange.prototype,"id",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],RelationshipChange.prototype,"relationshipId",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",c.RelationshipChangeRequest)],RelationshipChange.prototype,"request",void 0),n([(0,o.validate)({nullable:!0}),(0,o.serialize)(),i("design:type",l.RelationshipChangeResponse)],RelationshipChange.prototype,"response",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",String)],RelationshipChange.prototype,"status",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",String)],RelationshipChange.prototype,"type",void 0),t.RelationshipChange=RelationshipChange},1512:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChangeRequest=void 0;const o=r(194),a=r(2027),s=r(9170);class RelationshipChangeRequest extends a.CoreSerializableAsync{static async fromBackbone(e,t){return await this.from({createdBy:a.CoreAddress.from(e.createdBy),createdByDevice:s.CoreId.from(e.createdByDevice),createdAt:a.CoreDate.from(e.createdAt),content:t})}static async from(e){return await super.fromT(e,RelationshipChangeRequest)}static async deserialize(e){return await super.deserializeT(e,RelationshipChangeRequest)}}n([(0,o.validate)(),(0,o.serialize)(),i("design:type",a.CoreAddress)],RelationshipChangeRequest.prototype,"createdBy",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],RelationshipChangeRequest.prototype,"createdByDevice",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",a.CoreDate)],RelationshipChangeRequest.prototype,"createdAt",void 0),n([(0,o.validate)({nullable:!0}),(0,o.serialize)(),i("design:type",o.SerializableAsync)],RelationshipChangeRequest.prototype,"content",void 0),t.RelationshipChangeRequest=RelationshipChangeRequest},3771:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChangeResponse=void 0;const o=r(194),a=r(2027),s=r(9170);class RelationshipChangeResponse extends a.CoreSerializableAsync{static async fromBackbone(e,t){return await this.from({createdBy:a.CoreAddress.from(e.createdBy),createdByDevice:s.CoreId.from(e.createdByDevice),createdAt:a.CoreDate.from(e.createdAt),content:t})}static async from(e){return await super.fromT(e,RelationshipChangeResponse)}static async deserialize(e){return await super.deserializeT(e,RelationshipChangeResponse)}}n([(0,o.validate)(),(0,o.serialize)(),i("design:type",a.CoreAddress)],RelationshipChangeResponse.prototype,"createdBy",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],RelationshipChangeResponse.prototype,"createdByDevice",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",a.CoreDate)],RelationshipChangeResponse.prototype,"createdAt",void 0),n([(0,o.validate)({nullable:!0}),(0,o.serialize)(),i("design:type",o.SerializableAsync)],RelationshipChangeResponse.prototype,"content",void 0),t.RelationshipChangeResponse=RelationshipChangeResponse},3611:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChangeStatus=void 0,function(e){e.Pending="Pending",e.Rejected="Rejected",e.Revoked="Revoked",e.Accepted="Accepted"}(t.RelationshipChangeStatus||(t.RelationshipChangeStatus={}))},6411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChangeType=void 0,function(e){e.Creation="Creation",e.Termination="Termination",e.TerminationCancellation="TerminationCancellation"}(t.RelationshipChangeType||(t.RelationshipChangeType={}))},5784:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeRequestCipher=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipCreationChangeRequestCipher extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async fromBase64(e){return await super.fromBase64T(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoCipher)],l.prototype,"cipher",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoRelationshipPublicRequest)],l.prototype,"publicRequestCrypto",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeRequestCipher")],l),t.RelationshipCreationChangeRequestCipher=l},3857:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeRequestContent=void 0;const a=r(194),s=r(2027),c=r(2016);let l=n=class RelationshipCreationChangeRequestContent extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.Identity)],l.prototype,"identity",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],l.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],l.prototype,"templateId",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeRequestContent")],l),t.RelationshipCreationChangeRequestContent=l},8174:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeRequestSigned=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipCreationChangeRequestSigned extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"serializedRequest",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"deviceSignature",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"relationshipSignature",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeRequestSigned")],l),t.RelationshipCreationChangeRequestSigned=l},3861:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeResponseCipher=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipCreationChangeResponseCipher extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async fromBase64(e){return await super.fromBase64T(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoCipher)],l.prototype,"cipher",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CryptoRelationshipPublicResponse)],l.prototype,"publicResponseCrypto",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeResponseCipher")],l),t.RelationshipCreationChangeResponseCipher=l},334:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeResponseContent=void 0;const a=r(194),s=r(2027);let c=n=class RelationshipCreationChangeResponseContent extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],c.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"relationshipId",void 0),c=n=i([(0,a.type)("RelationshipCreationChangeResponseContent")],c),t.RelationshipCreationChangeResponseContent=c},7262:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeResponseSigned=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipCreationChangeResponseSigned extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"serializedResponse",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"deviceSignature",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"relationshipSignature",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeResponseSigned")],l),t.RelationshipCreationChangeResponseSigned=l},5739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SecretController=t.SecretBaseKeyType=void 0;const n=r(194),i=r(2890),o=r(2027),a=r(369),s=r(2508),c=r(2556),l=r(9423),u=r(7636);!function(e){e.Random="random",e.Password="password",e.External="external"}(t.SecretBaseKeyType||(t.SecretBaseKeyType={}));class SecretController extends s.TransportController{constructor(e,t=s.ControllerName.Secret){super(t,e),this.nonce=0}async init(){await super.init(),this.secrets=await this.parent.getSynchronizedCollection(a.DbCollectionName.Secrets);const e=await this.parent.info.get(SecretController.secretNonceKey);return e&&(this.nonce=e),this}async storeSecret(e,t,r="",n){const a=e.serialize(),s=i.CoreBuffer.fromUtf8(a),c=await this.increaseNonce(),u=await o.CoreCrypto.deriveKeyFromBase(await this.getBaseKey(),c,SecretController.secretContext),p=await o.CoreCrypto.encrypt(s,u),d=o.CoreDate.utc(),h={cipher:p,createdAt:d,name:t,description:r,id:await o.TransportIds.secret.generate(),nonce:c,validFrom:d,validTo:n,active:!0},g=await l.SecretContainerCipher.from(h);return this.log.trace(`Created secret id:${g.id} name:${g.name} on ${g.createdAt.toISOString()}.`),await this.secrets.create(g),g}async loadSecretsByName(e){const t=await this.secrets.find({name:e}),r=[];for(const e of t){const t=await l.SecretContainerCipher.from(e),n=await this.loadSecretById(t.id);n&&r.push(n)}return r}async loadActiveSecretByName(e){const t=await this.getActiveSecretContainerByName(e);if(!t)return;return await this.loadSecretById(t.id)}async getActiveSecretContainerByName(e){const t=await this.secrets.find({name:e,active:!0});if(!t.length)return;t.length>1&&this.log.warn(`More than one active secret has been found for secret name '${e}'.`);return await l.SecretContainerCipher.from(t[0])}async succeedSecretWithName(e,t,r="",n){const i=await this.secrets.findOne({name:t,active:!0});if(i){const e=await l.SecretContainerCipher.from(i);e.validTo=o.CoreDate.utc(),e.active=!1,await this.secrets.update(i,e)}return await this.storeSecret(e,t,r,n)}async decryptSecret(e){const t=await this.getBaseKey(),r=await o.CoreCrypto.deriveKeyFromBase(t,e.nonce?e.nonce:0,SecretController.secretContext),i=(await o.CoreCrypto.decrypt(e.cipher,r)).toUtf8(),a=await n.SerializableAsync.deserializeUnknown(i),s=await u.SecretContainerPlain.from({id:e.id,createdAt:e.createdAt,description:e.description,nonce:e.nonce,name:e.name,secret:a,active:e.active,validFrom:e.validFrom,validTo:e.validTo});return this.log.trace(`Accessed secret id:${s.id} name:${s.name} on ${o.CoreDate.utc().toISOString()}.`),s}async loadSecretById(e){const t=await this.secrets.findOne({id:e.toString()});if(!t)return;const r=await l.SecretContainerCipher.from(t);return await this.decryptSecret(r)}async deleteSecretById(e){const t=await this.secrets.findOne({id:e.toString()});return!!t&&(await this.secrets.delete({id:e}),this.log.trace(`Deleted secret id:${t.id} name:${t.name} on ${o.CoreDate.utc().toISOString()}.`),!0)}async createExchangeKey(e="",t="",r){const n=await o.CoreCrypto.generateExchangeKeypair(),i=await this.storeSecret(n,e,t,r);return[n.publicKey,i]}async getBaseKey(){if(this.baseKey)return this.baseKey;const e=await this.parent.activeDevice.secrets.loadSecret(c.DeviceSecretType.SharedSecretBaseKey);if(!e)throw o.TransportErrors.general.recordNotFound(i.CryptoSecretKey,c.DeviceSecretType.SharedSecretBaseKey).logWith(this._log);return this.baseKey=e.secret,this.baseKey}async increaseNonce(){const e=this.nonce++;return await this.parent.info.set(SecretController.secretNonceKey,e),e}}t.SecretController=SecretController,SecretController.secretContext="SECRET01",SecretController.secretNonceKey="secret_lastnonce"},9423:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SecretContainerCipher=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(6564),u=r(4062);let p=n=class SecretContainerCipher extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.name)),(0,c.nameof)((e=>e.description)),(0,c.nameof)((e=>e.createdAt)),(0,c.nameof)((e=>e.validFrom)),(0,c.nameof)((e=>e.validTo)),(0,c.nameof)((e=>e.nonce)),(0,c.nameof)((e=>e.active)),(0,c.nameof)((e=>e.cipher))],this.name="",this.description=""}static async from(e){return await super.fromT(e,n)}};i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],p.prototype,"name",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],p.prototype,"description",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",u.CoreDate)],p.prototype,"createdAt",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",u.CoreDate)],p.prototype,"validFrom",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",u.CoreDate)],p.prototype,"validTo",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",Number)],p.prototype,"nonce",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",Boolean)],p.prototype,"active",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CryptoCipher)],p.prototype,"cipher",void 0),p=n=i([(0,a.type)("SecretContainerCipher")],p),t.SecretContainerCipher=p},7636:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SecretContainerPlain=void 0;const a=r(194),s=r(2027);let c=n=class SecretContainerPlain extends s.CoreSerializableAsync{constructor(){super(...arguments),this.name="",this.description=""}static async from(e){return await super.fromT(e,n)}};i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CoreId)],c.prototype,"id",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],c.prototype,"name",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],c.prototype,"description",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CoreDate)],c.prototype,"createdAt",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CoreDate)],c.prototype,"validFrom",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",s.CoreDate)],c.prototype,"validTo",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",Number)],c.prototype,"nonce",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",Boolean)],c.prototype,"active",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",a.SerializableAsync)],c.prototype,"secret",void 0),c=n=i([(0,a.type)("SecretContainerPlain")],c),t.SecretContainerPlain=c},9267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangedItems=void 0;t.ChangedItems=class ChangedItems{constructor(e=[],t=[]){this.relationships=e,this.messages=t}addRelationship(e){this.relationships.push(e)}addMessage(e){this.messages.push(e)}}},8189:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DatawalletModificationMapper=void 0;const n=r(2027),i=r(9750);t.DatawalletModificationMapper=class DatawalletModificationMapper{static async fromBackboneDatawalletModification(e,t,r){let o,a;switch(e.type){case"Create":o=i.DatawalletModificationType.Create;break;case"Update":o=i.DatawalletModificationType.Update;break;case"Delete":o=i.DatawalletModificationType.Delete;break;case"CacheChanged":o=i.DatawalletModificationType.CacheChanged;break;default:throw new Error("Unsupported DatawalletModificationType '${backboneDatawalletModification.type}'")}switch(e.payloadCategory){case"TechnicalData":a=i.DatawalletModificationCategory.TechnicalData;break;case"Userdata":a=i.DatawalletModificationCategory.Userdata;break;case"Metadata":a=i.DatawalletModificationCategory.Metadata;break;case null:a=void 0;break;default:throw new Error(`Unsupported DatawalletModificationCategory '${e.payloadCategory}'`)}return i.DatawalletModification.from({localId:await n.TransportIds.datawalletModification.generate(),objectIdentifier:n.CoreId.from(e.objectIdentifier),payloadCategory:a,collection:e.collection,type:o,payload:t,datawalletVersion:r})}static toCreateDatawalletModificationsRequestItem(e,t){var r;return{objectIdentifier:e.objectIdentifier.toString(),payloadCategory:e.payloadCategory,collection:e.collection,type:e.type,encryptedPayload:t,datawalletVersion:null!==(r=e.datawalletVersion)&&void 0!==r?r:0}}}},8222:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CacheFetcher=t.DatawalletModificationsProcessor=void 0;const i=n(r(6486)),o=r(2027),a=r(369),s=r(9873),c=r(6614),l=r(2182),u=r(1752),p=r(4102),d=r(9750);t.DatawalletModificationsProcessor=class DatawalletModificationsProcessor{constructor(e,t,r,n){var o,s,c,l;this.cacheFetcher=t,this.collectionProvider=r,this.logger=n,this.collectionsWithCacheableItems=[a.DbCollectionName.Files,a.DbCollectionName.Messages,a.DbCollectionName.Relationships,a.DbCollectionName.RelationshipTemplates,a.DbCollectionName.Tokens];const u=i.default.groupBy(e,(e=>e.type));this.creates=null!==(o=u[d.DatawalletModificationType.Create])&&void 0!==o?o:[],this.updates=null!==(s=u[d.DatawalletModificationType.Update])&&void 0!==s?s:[],this.deletes=null!==(c=u[d.DatawalletModificationType.Delete])&&void 0!==c?c:[],this.cacheChanges=null!==(l=u[d.DatawalletModificationType.CacheChanged])&&void 0!==l?l:[]}async execute(){await this.applyCreates(),await this.applyUpdates(),await this.applyCacheChanges(),await this.applyDeletes()}async applyCreates(){if(0===this.creates.length)return;const e=i.default.groupBy(this.creates,(e=>e.objectIdentifier));for(const t in e){const r=e[t],n=r[0].collection,i=await this.collectionProvider.getCollection(n);let a={id:t};for(const e of r)a={...a,...e.payload};const s=await o.CoreSerializableAsync.fromUnknown(a),c=await i.read(t);if(c){const e={...(await o.CoreSerializableAsync.fromUnknown(c)).toJSON(),...s.toJSON()};await i.update(c,e)}if(this.collectionsWithCacheableItems.includes(n)){const e=d.DatawalletModification.from({localId:await o.TransportIds.datawalletModification.generate(),type:d.DatawalletModificationType.CacheChanged,collection:n,objectIdentifier:o.CoreId.from(t)});this.cacheChanges.push(e)}await i.create(s)}}async applyUpdates(){if(0!==this.updates.length)for(const e of this.updates){const t=await this.collectionProvider.getCollection(e.collection),r=await t.read(e.objectIdentifier.toString());if(!r)throw new Error("Document to update was not found.");const n={...(await o.CoreSerializableAsync.fromUnknown(r)).toJSON(),...e.payload};await t.update(r,n)}}async applyCacheChanges(){if(0===this.cacheChanges.length)return;this.ensureAllItemsAreCacheable();const e=this.groupCacheChangesByCollection(this.cacheChanges),t=await this.cacheFetcher.fetchCacheFor({files:e.fileIds,messages:e.messageIds,relationshipTemplates:e.relationshipTemplateIds,tokens:e.tokenIds});await this.saveNewCaches(t.files,a.DbCollectionName.Files,s.File),await this.saveNewCaches(t.messages,a.DbCollectionName.Messages,c.Message),await this.saveNewCaches(t.relationshipTemplates,a.DbCollectionName.RelationshipTemplates,u.RelationshipTemplate),await this.saveNewCaches(t.tokens,a.DbCollectionName.Tokens,p.Token);const r=await this.cacheFetcher.fetchCacheFor({relationships:e.relationshipIds});await this.saveNewCaches(r.relationships,a.DbCollectionName.Relationships,l.Relationship)}ensureAllItemsAreCacheable(){const e=this.cacheChanges.map((e=>e.collection)),t=[...new Set(e)].filter((e=>!this.collectionsWithCacheableItems.includes(e)));if(t.length>0)throw o.TransportErrors.datawallet.unsupportedModification("unsupportedCacheChangedModificationCollection",t).logWith(this.logger)}groupCacheChangesByCollection(e){var t,r,n,o,s;const c=i.default.groupBy(e,(e=>e.collection)),l=(null!==(t=c[a.DbCollectionName.Files])&&void 0!==t?t:[]).map((e=>e.objectIdentifier)),u=(null!==(r=c[a.DbCollectionName.Messages])&&void 0!==r?r:[]).map((e=>e.objectIdentifier)),p=(null!==(n=c[a.DbCollectionName.Relationships])&&void 0!==n?n:[]).map((e=>e.objectIdentifier));return{fileIds:l,messageIds:u,relationshipTemplateIds:(null!==(o=c[a.DbCollectionName.RelationshipTemplates])&&void 0!==o?o:[]).map((e=>e.objectIdentifier)),tokenIds:(null!==(s=c[a.DbCollectionName.Tokens])&&void 0!==s?s:[]).map((e=>e.objectIdentifier)),relationshipIds:p}}async saveNewCaches(e,t,r){const n=await this.collectionProvider.getCollection(t);await Promise.all(e.map((async e=>{const t=await n.read(e.id.toString()),i=await o.CoreSerializableAsync.fromT(t,r);i.setCache(e.cache),await n.update(t,i)})))}async applyDeletes(){if(0!==this.deletes.length)for(const e of this.deletes){const t=await this.collectionProvider.getCollection(e.collection);await t.delete({id:e.objectIdentifier})}}};t.CacheFetcher=class CacheFetcher{constructor(e,t,r,n,i){this.fileController=e,this.messageController=t,this.relationshipTemplateController=r,this.relationshipController=n,this.tokenController=i}async fetchCacheFor(e){const t=await Promise.all([this.fetchCaches(this.fileController,e.files),this.fetchCaches(this.messageController,e.messages),this.fetchCaches(this.relationshipController,e.relationships),this.fetchCaches(this.relationshipTemplateController,e.relationshipTemplates),this.fetchCaches(this.tokenController,e.tokens)]);return{files:t[0],messages:t[1],relationships:t[2],relationshipTemplates:t[3],tokens:t[4]}}async fetchCaches(e,t){if(!t)return[];return await e.fetchCaches(t)}}},9761:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalEventsProcessor=void 0;const n=r(2027),i=r(9267);class ExternalEventsProcessor{constructor(e,t,r){this.messagesController=e,this.relationshipsController=t,this.externalEvents=r,this.changedItems=new i.ChangedItems,this.results=[],this.log=n.TransportLoggerFactory.getLogger(ExternalEventsProcessor)}async execute(){for(const e of this.externalEvents)try{switch(e.type){case"MessageReceived":await this.applyMessageReceivedEvent(e);break;case"MessageDelivered":await this.applyMessageDeliveredEvent(e);break;case"RelationshipChangeCreated":await this.applyRelationshipChangeCreatedEvent(e);break;case"RelationshipChangeCompleted":await this.applyRelationshipChangeCompletedEvent(e);break;default:throw new Error(`'${e.type}' is not a supported external event type.`)}this.results.push({externalEventId:e.id})}catch(t){let r;this.log.error("There was an error while trying to apply an external event: ",t),r=t.code?t.code:t.message?t.message:JSON.stringify(t),this.results.push({externalEventId:e.id,errorCode:r})}}async applyRelationshipChangeCompletedEvent(e){const t=e.payload,r=await this.relationshipsController.applyChangeById(t.changeId);r&&this.changedItems.addRelationship(r)}async applyRelationshipChangeCreatedEvent(e){const t=e.payload,r=await this.relationshipsController.applyChangeById(t.changeId);r&&this.changedItems.addRelationship(r)}async applyMessageDeliveredEvent(e){const t=e.payload,r=await this.messagesController.updateCache([t.id]);this.changedItems.addMessage(r[0])}async applyMessageReceivedEvent(e){const t=e.payload,r=await this.messagesController.loadPeerMessage(n.CoreId.from(t.id));this.changedItems.addMessage(r)}}t.ExternalEventsProcessor=ExternalEventsProcessor},1295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncController=void 0;const n=r(2027),i=r(5079),o=r(7596),a=r(9267),s=r(8189),c=r(8222),l=r(9761),u=r(9750),p=r(9258),d=r(2864);class SyncController extends n.TransportController{constructor(e,t,r,i){var a;super(n.ControllerName.Sync,e),this.unpushedDatawalletModifications=r,this.datawalletEnabled=i,this.client=null!==(a=t.syncClient)&&void 0!==a?a:new o.SyncClient(this.config,this.parent.authenticator),this.identityMigrations=new d.IdentityMigrations(this.parent),this.deviceMigrations=new p.DeviceMigrations(this.parent)}get cacheFetcher(){return this._cacheFetcher||(this._cacheFetcher=new c.CacheFetcher(this.parent.files,this.parent.messages,this.parent.relationshipTemplates,this.parent.relationships,this.parent.tokens)),this._cacheFetcher}async init(){return await super.init(),this.syncInfo=await this.db.getMap("SyncInfo"),this}async sync(e="Everything"){var t;if(null===(t=this.currentSync)||void 0===t?void 0:t.includes(e))return await this.currentSync.promise;if(this.currentSync&&!this.currentSync.includes(e))return await this.currentSync.promise,await this.sync(e);const r=this._sync(e);this.currentSync=new LocalSyncRun(r,e);try{return await this.currentSync.promise}finally{this.datawalletEnabled&&await this.unpushedDatawalletModifications.exists()&&await this.syncDatawallet().catch((e=>this.log.error(e))),this.currentSync=void 0}}async _sync(e){if("OnlyDatawallet"===e)return await this.syncDatawallet();const t=await this.syncExternalEvents();if(await this.setLastCompletedSyncTime(),t.externalEventResults.some((e=>void 0!==e.errorCode)))throw new n.CoreError("error.transport.errorWhileApplyingExternalEvents",t.externalEventResults.filter((e=>void 0!==e.errorCode)).map((e=>e.errorCode)).join(" | ")).logWith(this.log);return t.changedItems}async syncExternalEvents(){if(!await this.startExternalEventsSyncRun())return await this.syncDatawallet(),{changedItems:new a.ChangedItems,externalEventResults:[]};await this.applyIncomingDatawalletModifications();const e=await this.applyIncomingExternalEvents();return await this.finalizeExternalEventsSyncRun(e.externalEventResults),e}async syncDatawallet(){if(!this.datawalletEnabled)return;const e=await this.getIdentityDatawalletVersion();if(this.config.supportedDatawalletVersion<e)throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion,e).logWith(this.log);this.log.trace("Synchronization of Datawallet events started...");try{await this.applyIncomingDatawalletModifications(),await this.pushLocalDatawalletModifications(),await this.setLastCompletedDatawalletSyncTime()}catch(t){const r="error.platform.validation.datawallet.insufficientSupportedDatawalletVersion";if(!(t instanceof n.RequestError)||t.code!==r)throw t;throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion,e).logWith(this.log)}this.log.trace("Synchronization of Datawallet events ended..."),await this.checkDatawalletVersion(e)}async checkDatawalletVersion(e){var t;if(this.config.supportedDatawalletVersion<e)throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion,e).logWith(this.log);this.config.supportedDatawalletVersion>e&&await this.upgradeIdentityDatawalletVersion(e,this.config.supportedDatawalletVersion);const r=null!==(t=this.parent.activeDevice.device.datawalletVersion)&&void 0!==t?t:0;r<e&&await this.upgradeDeviceDatawalletVersion(r,this.config.supportedDatawalletVersion)}async upgradeIdentityDatawalletVersion(e,t){if(e!==t){if(this.config.supportedDatawalletVersion<t)throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(t,e).logWith(this.log);if(e>t)throw n.TransportErrors.datawallet.currentBiggerThanTarget(e,t).logWith(this.log);for(;e<t;){e++,await this.startDatawalletVersionUpgradeSyncRun();const t=this.identityMigrations[`v${e}`];if(!t)throw n.TransportErrors.datawallet.noMigrationAvailable(e).logWith(this.log);await t.call(this.identityMigrations),await this.finalizeDatawalletVersionUpgradeSyncRun(e)}}}async upgradeDeviceDatawalletVersion(e,t){if(e!==t){if(this.config.supportedDatawalletVersion<t)throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(t,e).logWith(this.log);if(e>t)throw n.TransportErrors.datawallet.currentBiggerThanTarget(e,t).logWith(this.log);for(;e<t;){e++;const t=this.deviceMigrations[`v${e}`];if(!t)throw n.TransportErrors.datawallet.noMigrationAvailable(e).logWith(this.log);await t.call(this.deviceMigrations),await this.parent.activeDevice.update({datawalletVersion:e})}}}async applyIncomingDatawalletModifications(){const e=await this.client.getDatawalletModifications({localIndex:await this.getLocalDatawalletModificationIndex()}),t=await e.value.collect();if(0===t.length)return;const r=await this.decryptDatawalletModifications(t);this.log.trace(`${r.length} incoming modifications found`);const i=new c.DatawalletModificationsProcessor(r,this.cacheFetcher,this._db,n.TransportLoggerFactory.getLogger(c.DatawalletModificationsProcessor));await i.execute(),this.log.trace(`${r.length} incoming modifications executed`,r),await this.updateLocalDatawalletModificationIndex(t.sort(descending)[0].index)}async decryptDatawalletModifications(e){const t=[];for(const r of e){const e=await this.parent.activeDevice.secrets.decryptDatawalletModificationPayload(r.encryptedPayload,r.index),n=await s.DatawalletModificationMapper.fromBackboneDatawalletModification(r,e,this.config.supportedDatawalletVersion);t.push(n)}return t}async pushLocalDatawalletModifications(){const{backboneModifications:e,localModificationIds:t}=await this.prepareLocalDatawalletModificationsForPush();if(0===e.length)return;const r=await this.client.createDatawalletModifications({localIndex:await this.getLocalDatawalletModificationIndex(),modifications:e});await this.deleteUnpushedDatawalletModifications(t),await this.updateLocalDatawalletModificationIndex(r.value.newIndex)}async prepareLocalDatawalletModificationsForPush(){const e=[],t=[];if(!this.datawalletEnabled)return{backboneModifications:e,localModificationIds:t};const r=await this.parseArray(await this.unpushedDatawalletModifications.list(),u.DatawalletModification),n=await this.getLocalDatawalletModificationIndex();let i="number"!=typeof n?0:n+1;for(const n of r){const r=await this.parent.activeDevice.secrets.encryptDatawalletModificationPayload(n,i++),o=s.DatawalletModificationMapper.toCreateDatawalletModificationsRequestItem(n,r);t.push(n.localId),e.push(o)}return{backboneModifications:e,localModificationIds:t}}async deleteUnpushedDatawalletModifications(e){for(const t of e)await this.unpushedDatawalletModifications.delete({localId:t.toString()})}async setInititalDatawalletVersion(e){await this.startDatawalletVersionUpgradeSyncRun(),await this.finalizeDatawalletVersionUpgradeSyncRun(e)}async getIdentityDatawalletVersion(){return(await this.client.getDatawallet()).value.version}async startExternalEventsSyncRun(){var e;const t=await this.client.startSyncRun({type:i.SyncRunType.ExternalEventSync});return t.value.status!==i.StartSyncRunStatus.NoNewEvents&&(this.currentSyncRun=null!==(e=t.value.syncRun)&&void 0!==e?e:void 0,void 0!==this.currentSyncRun)}async startDatawalletVersionUpgradeSyncRun(){var e;const t=await this.client.startSyncRun({type:i.SyncRunType.DatawalletVersionUpgrade});return this.currentSyncRun=null!==(e=t.value.syncRun)&&void 0!==e?e:void 0,void 0!==this.currentSyncRun}async applyIncomingExternalEvents(){const e=await this.client.getExternalEventsOfSyncRun(this.currentSyncRun.id.toString());if(e.isError)throw e.error;const t=await e.value.collect(),r=new l.ExternalEventsProcessor(this.parent.messages,this.parent.relationships,t);return await r.execute(),{externalEventResults:r.results,changedItems:r.changedItems}}async finalizeExternalEventsSyncRun(e){if(!this.currentSyncRun)throw new Error("There is no active sync run to finalize");const{backboneModifications:t,localModificationIds:r}=await this.prepareLocalDatawalletModificationsForPush();await this.client.finalizeExternalEventSync(this.currentSyncRun.id.toString(),{datawalletModifications:t,externalEventResults:e}),await this.deleteUnpushedDatawalletModifications(r);const n=(await this.getLocalDatawalletModificationIndex()||-1)+t.length;await this.updateLocalDatawalletModificationIndex(n),this.currentSyncRun=void 0}async finalizeDatawalletVersionUpgradeSyncRun(e){if(!this.currentSyncRun)throw new Error("There is no active sync run to finalize");const{backboneModifications:t,localModificationIds:r}=await this.prepareLocalDatawalletModificationsForPush();await this.client.finalizeDatawalletVersionUpgrade(this.currentSyncRun.id.toString(),{newDatawalletVersion:e,datawalletModifications:t}),await this.deleteUnpushedDatawalletModifications(r);const n=(await this.getLocalDatawalletModificationIndex()||-1)+t.length;await this.updateLocalDatawalletModificationIndex(n),this.currentSyncRun=void 0}async getLocalDatawalletModificationIndex(){return await this.syncInfo.get("localDatawalletModificationIndex")}async updateLocalDatawalletModificationIndex(e){await this.syncInfo.set("localDatawalletModificationIndex",e)}async getSyncTimeByName(e){const t=await this.syncInfo.get(`SyncTime-${e}`);return t?n.CoreDate.from(t):void 0}async setSyncTimeByName(e){const t=n.CoreDate.utc().toISOString();await this.syncInfo.set(`SyncTime-${e}`,t)}async getLastCompletedSyncTime(){return await this.getSyncTimeByName("Everything")}async getLastCompletedDatawalletSyncTime(){return await this.getSyncTimeByName("Datawallet")}async setLastCompletedSyncTime(){await this.setSyncTimeByName("Everything")}async setLastCompletedDatawalletSyncTime(){await this.setSyncTimeByName("Datawallet")}}function descending(e,t){return t.index-e.index}t.SyncController=SyncController;class LocalSyncRun{constructor(e,t){this.promise=e,this.whatToSync=t}includes(e){return"Everything"===this.whatToSync||"OnlyDatawallet"===e}}},26:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SynchronizedCollection=void 0;const i=n(r(4901)),o=n(r(6486)),a=r(4714),s=r(2970),c=r(8169),l=r(9750);t.SynchronizedCollection=class SynchronizedCollection{constructor(e,t,r){this.parent=e,this.datawalletVersion=t,this.datawalletModifications=r,this.name=e.name,this.databaseType=e.databaseType}async create(e){const t=e.toJSON();if(!this.datawalletModifications)return await this.parent.create(e);const r=o.default.pickBy(t,((t,r)=>void 0!==t&&e.technicalProperties.includes(r))),n=o.default.pickBy(t,((t,r)=>void 0!==t&&e.metadataProperties.includes(r))),i=o.default.pickBy(t,((t,r)=>void 0!==t&&e.userdataProperties.includes(r))),a=e.id;0!==Object.getOwnPropertyNames(r).length&&await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Create,collection:this.name,objectIdentifier:a,payloadCategory:l.DatawalletModificationCategory.TechnicalData,payload:r,datawalletVersion:this.datawalletVersion})),0!==Object.getOwnPropertyNames(n).length&&await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Create,collection:this.name,objectIdentifier:a,payloadCategory:l.DatawalletModificationCategory.Metadata,payload:n,datawalletVersion:this.datawalletVersion})),0!==Object.getOwnPropertyNames(i).length&&await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Create,collection:this.name,objectIdentifier:a,payloadCategory:l.DatawalletModificationCategory.Userdata,payload:i,datawalletVersion:this.datawalletVersion})),await this.parent.create(e)}async read(e){return await this.parent.read(e)}async update(e,t){const r=await s.CoreSerializableAsync.fromUnknown(e),n=t.toJSON();if(!this.datawalletModifications)return await this.parent.update(e,t);const u=i.default.compare(r.toJSON(),n),p=[];for(const e of u){const t=e.path.split("/").find((e=>e));p.push(t)}const d=0!==o.default.intersection(t.technicalProperties,p).length,h=0!==o.default.intersection(t.metadataProperties,p).length,g=0!==o.default.intersection(t.userdataProperties,p).length,y=p.some((e=>e===(0,a.nameof)((e=>e.cache)))),m=t.id;if(d){const e=o.default.pick(n,t.technicalProperties);await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Update,collection:this.name,objectIdentifier:m,payloadCategory:l.DatawalletModificationCategory.TechnicalData,payload:e,datawalletVersion:this.datawalletVersion}))}if(h){const e=o.default.pick(n,t.metadataProperties);await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Update,collection:this.name,objectIdentifier:m,payloadCategory:l.DatawalletModificationCategory.Metadata,payload:e,datawalletVersion:this.datawalletVersion}))}if(g){const e=o.default.pick(n,t.userdataProperties);await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Update,collection:this.name,objectIdentifier:m,payloadCategory:l.DatawalletModificationCategory.Userdata,payload:e,datawalletVersion:this.datawalletVersion}))}return y&&await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.CacheChanged,collection:this.name,objectIdentifier:m,datawalletVersion:this.datawalletVersion})),await this.parent.update(e,t)}async delete(e){return this.datawalletModifications?(await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Delete,collection:this.name,objectIdentifier:e.id,datawalletVersion:this.datawalletVersion})),await this.parent.delete({id:e.id.toString()})):await this.parent.delete({id:e.id.toString()})}async list(){return await this.parent.list()}async find(e){return await this.parent.find(e)}async count(e){return await this.parent.count(e)}async exists(e){return await this.parent.exists(e)}async findOne(e){return await this.parent.findOne(e)}}},6890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3670:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8571:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1541:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7224:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StartSyncRunStatus=t.SyncRunType=void 0,function(e){e.ExternalEventSync="ExternalEventSync",e.DatawalletVersionUpgrade="DatawalletVersionUpgrade"}(t.SyncRunType||(t.SyncRunType={})),function(e){e.Created="Created",e.NoNewEvents="NoNewEvents"}(t.StartSyncRunStatus||(t.StartSyncRunStatus={}))},7596:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncClient=void 0;const n=r(2027);class SyncClient extends n.RESTClientAuthenticate{constructor(e,t){super(e,t,{headers:{"x-supported-datawallet-version":e.supportedDatawalletVersion.toString()}})}async startSyncRun(e){return await this.post("/api/v1/SyncRuns",e)}async finalizeExternalEventSync(e,t){return await this.put(`/api/v1/SyncRuns/${e}/FinalizeExternalEventSync`,t)}async finalizeDatawalletVersionUpgrade(e,t){return await this.put(`/api/v1/SyncRuns/${e}/FinalizeDatawalletVersionUpgrade`,t)}async getExternalEventsOfSyncRun(e){return await this.getPaged(`/api/v1/SyncRuns/${e}/ExternalEvents`,{})}async getDatawallet(){return await this.get("/api/v1/Datawallet")}async getDatawalletModifications(e){return await this.getPaged("/api/v1/Datawallet/Modifications",e)}async createDatawalletModifications(e){return await this.post("/api/v1/Datawallet/Modifications",e)}}t.SyncClient=SyncClient},9750:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DatawalletModification=t.DatawalletModificationCategory=t.DatawalletModificationType=void 0;const a=r(194),s=r(2027);!function(e){e.Create="Create",e.Update="Update",e.Delete="Delete",e.CacheChanged="CacheChanged"}(t.DatawalletModificationType||(t.DatawalletModificationType={})),function(e){e.TechnicalData="TechnicalData",e.Userdata="Userdata",e.Metadata="Metadata"}(t.DatawalletModificationCategory||(t.DatawalletModificationCategory={}));let c=n=class DatawalletModification extends s.CoreSerializable{static from(e){return super.fromT(e,n)}static deserialize(e){return super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"localId",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"objectIdentifier",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],c.prototype,"payloadCategory",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"collection",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"type",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],c.prototype,"payload",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Number)],c.prototype,"datawalletVersion",void 0),c=n=i([(0,a.type)("DatawalletModification")],c),t.DatawalletModification=c},9258:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceMigrations=void 0;t.DeviceMigrations=class DeviceMigrations{constructor(e){this.accountController=e}async v1(){const e={cache:{$exists:!1}},synchronizableToId=e=>e.id.toString(),t=await this.accountController.files.getFiles(e);await this.accountController.files.updateCache(t.map(synchronizableToId));const r=await this.accountController.messages.getMessages(e);await this.accountController.messages.updateCache(r.map(synchronizableToId));const n=await this.accountController.relationships.getRelationships(e);await this.accountController.relationships.updateCache(n.map(synchronizableToId));const i=await this.accountController.relationshipTemplates.getRelationshipTemplates(e);await this.accountController.relationshipTemplates.updateCache(i.map(synchronizableToId));const o=await this.accountController.tokens.getTokens(e);await this.accountController.tokens.updateCache(o.map(synchronizableToId))}}},2864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityMigrations=void 0;t.IdentityMigrations=class IdentityMigrations{constructor(e){this.accountController=e}v1(){return Promise.resolve()}}},8697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousTokenController=void 0;const n=r(194),i=r(2890),o=r(2027),a=r(2069),s=r(8342),c=r(4102),l=r(7776);t.AnonymousTokenController=class AnonymousTokenController{constructor(e){this.client=new a.AnonymousTokenClient(e)}async loadPeerTokenByTruncated(e){const t=await l.TokenReference.fromTruncated(e);return await this.loadPeerTokenByReference(t)}async loadPeerTokenByReference(e){return await this.loadPeerToken(e.id,e.key)}async loadPeerToken(e,t){const r=(await this.client.getToken(e.toString())).value,a=await i.CryptoCipher.fromBase64(r.content),l=await o.CoreCrypto.decrypt(a,t),u=await o.CoreSerializableAsync.deserializeUnknown(l.toUtf8());if(!(u instanceof n.SerializableAsync))throw o.TransportErrors.tokens.invalidTokenContent(e.toString());const p=await c.Token.from({id:e,secretKey:t,isOwn:!1}),d=await s.CachedToken.from({createdAt:o.CoreDate.from(r.createdAt),expiresAt:o.CoreDate.from(r.expiresAt),createdBy:o.CoreAddress.from(r.createdBy),createdByDevice:o.CoreId.from(r.createdByDevice),content:u});return p.setCache(d),p}}},4503:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenController=void 0;const n=r(194),i=r(2890),o=r(2027),a=r(369),s=r(2508),c=r(6591),l=r(8342),u=r(5898),p=r(4102),d=r(7776);class TokenController extends s.TransportController{constructor(e){super(s.ControllerName.Token,e)}async init(){return await super.init(),this.client=new c.TokenClient(this.config,this.parent.authenticator),this.tokens=await this.parent.getSynchronizedCollection(a.DbCollectionName.Tokens),this}async getTokens(e){const t=await this.tokens.find(e);return await this.parseArray(t,p.Token)}async sendToken(e){const t=await u.SendTokenParameters.from(e),r=await o.CoreCrypto.generateSecretKey(),n=t.content.serialize(),a=i.CoreBuffer.fromUtf8(n),s=await o.CoreCrypto.encrypt(a,r),c=(await this.client.createToken({content:s.toBase64(),expiresAt:t.expiresAt.toString()})).value,d=await l.CachedToken.from({createdAt:o.CoreDate.from(c.createdAt),expiresAt:t.expiresAt,createdBy:this.parent.identity.address,createdByDevice:this.parent.activeDevice.id,content:t.content}),h=await p.Token.from({id:o.CoreId.from(c.id),secretKey:r,isOwn:!0,cache:d,cachedAt:o.CoreDate.utc()});return t.ephemeral||await this.tokens.create(h),h}async setTokenMetadata(e,t){const r=e instanceof o.CoreId?e.toString():e.id.toString(),n=await this.tokens.read(r);if(!n)throw o.TransportErrors.general.recordNotFound(p.Token,r.toString()).logWith(this._log);const i=await p.Token.from(n);return i.setMetadata(t),await this.tokens.update(n,i),i}async getToken(e){const t=await this.tokens.read(e.toString());return t?await p.Token.from(t):void 0}async updateCache(e){if(e.length<1)return[];const t=[];for(const r of e){const e=await this.client.getToken(r);if(e.isError){if("error.transport.recordNotFound"===e.error.code||"error.transport.request.notFound"===e.error.code){this.log.warn(`Record id ${r} could not be found on backbone. It might be expired.`,e.error);continue}throw e.error}const n=e.value;t.push(this.updateCacheOfExistingTokenInDb(n.id,n))}return await Promise.all(t)}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getTokens({ids:e.map((e=>e.id))})).value.collect()).map((async e=>{const t=await this.tokens.read(e.id),r=await p.Token.from(t);return{id:o.CoreId.from(e),cache:await this.decryptToken(e,r.secretKey)}}));return await Promise.all(t)}async updateCacheOfExistingTokenInDb(e,t){const r=await this.tokens.read(e);if(!r)throw o.TransportErrors.general.recordNotFound(p.Token,e).logWith(this._log);const n=await p.Token.from(r);return await this.updateCacheOfToken(n,t),await this.tokens.update(r,n),n}async updateCacheOfToken(e,t){const r=e.id.toString();t||(t=(await this.client.getToken(r)).value);const n=await this.decryptToken(t,e.secretKey);e.setCache(n),e.isOwn=this.parent.identity.isMe(n.createdBy)}async decryptToken(e,t){const r=await i.CryptoCipher.fromBase64(e.content),a=await o.CoreCrypto.decrypt(r,t),s=await o.CoreSerializableAsync.deserializeUnknown(a.toUtf8());if(!(s instanceof n.SerializableAsync))throw o.TransportErrors.tokens.invalidTokenContent(e.id).logWith(this._log);return await l.CachedToken.from({createdAt:o.CoreDate.from(e.createdAt),expiresAt:o.CoreDate.from(e.expiresAt),createdBy:o.CoreAddress.from(e.createdBy),createdByDevice:o.CoreId.from(e.createdByDevice),content:s})}async loadPeerTokenByTruncated(e,t){const r=await d.TokenReference.fromTruncated(e);return await this.loadPeerTokenByReference(r,t)}async loadPeerTokenByReference(e,t){return await this.loadPeerToken(e.id,e.key,t)}async loadPeerToken(e,t,r){if(await this.tokens.read(e.toString()))return await this.updateCacheOfExistingTokenInDb(e.toString());const n=await p.Token.from({id:e,secretKey:t,isOwn:!1});return await this.updateCacheOfToken(n),r||await this.tokens.create(n),n}}t.TokenController=TokenController},2069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousTokenClient=void 0;const n=r(2027);class AnonymousTokenClient extends n.RESTClient{async getToken(e){return await this.get(`/api/v1/Tokens/${e}`)}}t.AnonymousTokenClient=AnonymousTokenClient},7653:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClient=void 0;const n=r(6054);class TokenClient extends n.RESTClientAuthenticate{async createToken(e){return await this.post("/api/v1/Tokens",e)}async getTokens(e){return await this.getPaged("/api/v1/Tokens",e)}async getToken(e){return await this.get(`/api/v1/Tokens/${e}`)}async deleteToken(e){return await this.delete(`/api/v1/Tokens/${e}`)}}t.TokenClient=TokenClient},8342:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedToken=void 0;const a=r(194),s=r(2027);let c=n=class CachedToken extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreAddress)],c.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],c.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],c.prototype,"expiresAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],c.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"createdByDevice",void 0),c=n=i([(0,a.type)("CachedToken")],c),t.CachedToken=c},5898:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendTokenParameters=void 0;const a=r(194),s=r(2027);let c=n=class SendTokenParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],c.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],c.prototype,"expiresAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],c.prototype,"ephemeral",void 0),c=n=i([(0,a.type)("SendTokenParameters")],c),t.SendTokenParameters=c},4102:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Token=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(7776),p=r(8342);let d=n=class Token extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.secretKey)),(0,c.nameof)((e=>e.isOwn))],this.metadataProperties=[(0,c.nameof)((e=>e.metadata)),(0,c.nameof)((e=>e.metadataModifiedAt))]}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}async toTokenReference(){return await u.TokenReference.from({id:this.id,key:this.secretKey})}async truncate(){return(await this.toTokenReference()).truncate()}setCache(e){return this.cache=e,this.cachedAt=l.CoreDate.utc(),this}setMetadata(e){this.metadata=e,this.metadataModifiedAt=l.CoreDate.utc()}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],d.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],d.prototype,"isOwn",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",p.CachedToken)],d.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],d.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],d.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],d.prototype,"metadataModifiedAt",void 0),d=n=i([(0,a.type)("Token")],d),t.Token=d},5083:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenContentDeviceSharedSecret=void 0;const a=r(194),s=r(2027),c=r(6758);let l=n=class TokenContentDeviceSharedSecret extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.DeviceSharedSecret)],l.prototype,"sharedSecret",void 0),l=n=i([(0,a.type)("TokenContentDeviceSharedSecret")],l),t.TokenContentDeviceSharedSecret=l},2238:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenContentFile=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class TokenContentFile extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"fileId",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"secretKey",void 0),l=n=i([(0,a.type)("TokenContentFile")],l),t.TokenContentFile=l},1488:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenContentRelationshipTemplate=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class TokenContentRelationshipTemplate extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"templateId",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"secretKey",void 0),l=n=i([(0,a.type)("TokenContentRelationshipTemplate")],l),t.TokenContentRelationshipTemplate=l},7776:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenReference=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class TokenReference extends c.CoreSerializableAsync{truncate(){return s.CoreBuffer.fromUtf8(`${this.id.toString()}|${this.key.algorithm}|${this.key.secretKey.toBase64URL()}`).toBase64URL()}static async fromTruncated(e){const t=s.CoreBuffer.fromBase64URL(e).toUtf8().split("|");if(3!==t.length)throw c.TransportErrors.tokens.invalidTruncatedReference();try{const e=c.CoreId.from(t[0]),r=parseInt(t[1]),i=t[2],o=await s.CryptoSecretKey.from({algorithm:r,secretKey:s.CoreBuffer.fromBase64URL(i)});return await n.from({id:e,key:o})}catch(e){throw c.TransportErrors.tokens.invalidTruncatedReference()}}static async from(e){return await super.fromT(e,n)}static async deserialize(e){try{return await super.deserializeT(e,n)}catch(t){return await this.from(e)}}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"id",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"key",void 0),l=n=i([(0,a.type)("TokenReference")],l),t.TokenReference=l},1577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordGenerator=void 0;const n=r(18),i=r(5833),o=i.RandomCharacterRange.AlphanumericEase+i.RandomCharacterRange.SpecialCharacters;class PasswordGenerator{static async createPassword(e,t=0,r=o){return t<=0&&(t=e),await i.Random.stringRandomLength(e,t,r)}static async createStrongPassword(e=8,t=12){if(e>t&&(t=e),e<8)throw n.TransportErrors.util.passwordMinLengthTooShort();const r={minLength:1,maxLength:1,allowedChars:i.RandomCharacterRange.SpecialCharacters},a={minLength:1,maxLength:1,allowedChars:i.RandomCharacterRange.LowerCaseEase},s={minLength:1,maxLength:1,allowedChars:i.RandomCharacterRange.UpperCaseEase},c={minLength:e-4,maxLength:t-4,allowedChars:o},l=await i.Random.stringWithBuckets([r,a,s,{minLength:1,maxLength:1,allowedChars:"123456789"},c]);return await i.Random.scramble(l)}static async createUnitPassword(){return`${await i.Random.stringWithBuckets([{minLength:1,maxLength:1,allowedChars:"123456789"},{minLength:0,maxLength:2,allowedChars:"0123456789"},{minLength:0,maxLength:1,allowedChars:","},{minLength:0,maxLength:1,allowedChars:"0123456789"},{minLength:1,maxLength:1,allowedChars:"123456789"}])} ${await this.createPassword(1,0,this.unitsGerman)}`}static async createElementPassword(){return`${await this.createPassword(1,0,this.elementsGerman)} ${await this.createPassword(1,0,i.RandomCharacterRange.Digit)}`}}t.PasswordGenerator=PasswordGenerator,PasswordGenerator.elementsGerman=["Wasserstoff","Helium","Lithium","Beryllium","Bor","Kohlenstoff","Stickstoff","Sauerstoff","Fluor","Neon","Natrium","Magnesium","Aluminium","Silicium","Phosphor","Schwefel","Chlor","Argon","Kalium","Calcium","Scandium","Titan","Vanadium","Chrom","Mangan","Eisen","Cobalt","Nickel","Kupfer","Zink"],PasswordGenerator.unitsGerman=["Kelvin","Mol","Candela","Mikrosekunden","Nanosekunden","Millisekunden","Sekunden","Minuten","Stunden","Tage","Wochen","Monate","Jahre","Seemeilen","Astronomische Einheiten","Parsecs","Lichtjahre","Millimeter","Zentimeter","Meter","Kilometer","Quadratmeter","Ar","Hektar","Milliliter","Zentiliter","Liter","Kubikmeter","Barrel","Gramm","Kilogramm","Tonnen","Pfund","Zentner","Knoten","Newton","Pascal","Bar","Joule","Kilojoule","Megajoule","Wattstunden","Kilowattstunden","Megawattstunden","Kalorien","Kilokalorien","Elektronenvolt","Watt","Kilowatt","Megawatt","Voltampere","Ampere","Milliampere","Ohm","Siemens","Coulomb","Amperestunde","Milliamperestunde","Farad","Kelvin","Grad Celsius","Lumen","Lux","Bit","Byte","Kilobyte","Megabyte","Gigabyte","Terabyte","Etabyte"]},5833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Random=t.RandomCharacterRange=void 0;const n=r(2890),i=r(1614),o=r(18);var a;!function(e){e.Digit="0123456789",e.DigitEase="123456789",e.Hex="0123456789ABCDEF",e.LowerCase="abcdefghijklmnopqrstuvwxyz",e.LowerCaseEase="abcdefghijkmnpqrstuvwxyz",e.UpperCase="ABCDEFGHIJKLMNOPQRSTUVWXYZ",e.UpperCaseEase="ABCDEFGHJKLMNPQRSTUVWXYZ",e.Alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",e.Alphanumeric="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e.AlphanumericEase="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz123456789",e.AlphanumericUpperCaseEase="ABCDEFGHJKLMNPQRSTUVWXYZ0123456789",e.GermanUmlaut="ÄÖÜäöü",e.SpecialCharacters="!?-_.:,;#+"}(a=t.RandomCharacterRange||(t.RandomCharacterRange={}));class Random{static async bytes(e){return await n.CryptoRandom.bytes(e)}static async int(e){if(e>21||e<=0)throw o.TransportErrors.util.random.intLength();return parseInt(await this.string(e,a.Digit))}static async array(e){return(await n.CryptoRandom.bytes(e)).toArray()}static uuid(){return(0,i.v4)()}static async scramble(e){const t=[],r=e.split(""),n=e.length;for(let e=0;e<n-1;e++){const i=await Random.intBetween(0,n-1-e);t.push(r.splice(i,1)[0])}return t.push(r[0]),t.join("")}static async intBetween(e,t){if(t<=e)throw o.TransportErrors.util.random.mnBiggerThatMax();const r=t-e+1,n=Math.abs(Math.ceil(Math.log2(r)));if(n>32)throw o.TransportErrors.util.random.rangeTooBig();const i=Math.ceil(n/8),a=Math.pow(2,n)-1,s=await this.bytes(i);let c=0,l=8*(i-1);for(let e=0;e<i;e++)c+=s.buffer[e]*Math.pow(2,l),l-=8;return c&=a,c>=r?await this.intBetween(e,t):e+c}static async intRandomLength(e,t){return t>21&&o.TransportErrors.util.random.maxTooHigh(),parseInt(await this.stringRandomLength(e,t,a.Digit))}static async scrambleWithBuckets(e){const t=await this.stringWithBuckets(e);return await this.scramble(t)}static async stringWithBuckets(e){const t=[];for(const r of e)t.push(await this.stringRandomLength(r.minLength,r.maxLength,r.allowedChars));return t.join("")}static async string(e,t=a.Alphanumeric){if(e<=0)return"";if(t.length>256)throw o.TransportErrors.util.random.inputTooLong();const r=[],n=t.length,i=await this.array(e+10),s=255-255%n;for(let o=0;o<e;o++){const e=i[o];e>s||r.push(t[e%n])}let c=r.join("");return c.length<e&&(c+=await this.string(e-c.length,t)),c}static async stringRandomLength(e,t,r){if(e>t)throw o.TransportErrors.util.random.mnBiggerThatMax();if(e<0)throw o.TransportErrors.util.random.minLessThanZero();const n=t>e?await this.intBetween(e,t):t;return await this.string(n,r)}}t.Random=Random},2212:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1577),t),i(r(5833),t)},4225:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLogger=void 0;const i=n(r(4530));t.SimpleLogger=class SimpleLogger{constructor(e){this.logger=e}trace(...e){this.logger.trace(this.formatMessage(e))}debug(...e){this.logger.debug(this.formatMessage(e))}info(...e){this.logger.info(this.formatMessage(e))}warn(...e){this.logger.warn(this.formatMessage(e))}error(...e){this.logger.error(this.formatMessage(e))}fatal(...e){this.logger.fatal(this.formatMessage(e))}formatMessage(e){return{msg:e.map((e=>{var t;return e instanceof Error?null!==(t=e.stack)&&void 0!==t?t:`${e.name}: ${e.message}`:i.default(e)})).join("\n")}}}},7004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLoggerFactory=void 0;const n=r(9290),i=r(4225);t.SimpleLoggerFactory=class SimpleLoggerFactory{constructor(e=n.LogLevel.Warn,t=Math.random().toString(36).substring(7)){this.loggerFactory=n.LFService.createNamedLoggerFactory(t,(new n.LoggerFactoryOptions).addLogGroupRule(new n.LogGroupRule(new RegExp(".*"),e)))}getLogger(e){const t=this.loggerFactory.getLogger(e instanceof Function?e.name:e);return new i.SimpleLogger(t)}}},2391:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4225),t),i(r(7004),t)},1174:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9159:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEventNamespaceFromObject=t.EventBus=void 0;t.EventBus=class EventBus{},t.getEventNamespaceFromObject=function getEventNamespaceFromObject(e){return e.namespace}},5970:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionTargetInfo=void 0;class SubscriptionTargetInfo{namespace;constructor(e){this.namespace=e}static from(e){return e instanceof Function?new ConstructorSubscriptionTargetInfo(e):new NamespaceSubscriptionTargetInfo(e)}}t.SubscriptionTargetInfo=SubscriptionTargetInfo;class ConstructorSubscriptionTargetInfo extends SubscriptionTargetInfo{constructorFunction;constructor(e){super(function getEventNamespaceFromClass(e){return e.namespace}(e)),this.constructorFunction=e}isCompatibleWith(e){return e instanceof this.constructorFunction}}class NamespaceSubscriptionTargetInfo extends SubscriptionTargetInfo{constructor(e){super(e)}isCompatibleWith(e){return!0}}},9729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter2EventBus=void 0;const n=r(6387);r(8660);const i=r(9159),o=r(5970);t.EventEmitter2EventBus=class EventEmitter2EventBus{emitter;wrappers=new Map;nextId=0;constructor(){this.emitter=new n.EventEmitter2({wildcard:!0,maxListeners:50,verboseMemoryLeak:!0})}subscribe(e,t){return this.registerHandler(e,t)}subscribeOnce(e,t){return this.registerHandler(e,t,!0)}unsubscribe(e,t){return this.unregisterHandler(e,t)}registerHandler(e,t,r=!1){const n=o.SubscriptionTargetInfo.from(e),i=this.nextId++,handlerWrapper=o=>{n.isCompatibleWith(o)&&(t(o),r&&this.unsubscribe(e,i))};return this.wrappers.set(i,handlerWrapper),this.emitter.on(n.namespace,handlerWrapper),i}unregisterHandler(e,t){const r=o.SubscriptionTargetInfo.from(e),n=this.wrappers.get(t);return!!n&&(this.emitter.off(r.namespace,n),this.wrappers.delete(t),!0)}publish(e){const t=(0,i.getEventNamespaceFromObject)(e);if(!t)throw Error("The event needs a namespace. Use the EventNamespace-decorator in order to define a namespace for a event.");this.emitter.emit(t,e)}}},9256:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9159),t),i(r(9729),t)},5917:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataEvent=void 0;const n=r(8267);class DataEvent extends n.Event{data;constructor(e,t){super(e),this.data=t}}t.DataEvent=DataEvent},8267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;t.Event=class Event{namespace;constructor(e){this.namespace=e}}},2636:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5917),t),i(r(8267),t)},5172:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9256),t),i(r(2636),t),i(r(9855),t),i(r(1809),t),i(r(4569),t),i(r(1174),t),i(r(7226),t),i(r(7374),t)},9855:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=void 0,t.log=function log(e,t,r){const n=r.value;return r.value=function(...e){const r=e.map((e=>JSON.stringify(e))).join();try{const i=n.apply(this,e),o=JSON.stringify(i);return console.log(`Call: ${t}(${r}) => ${o}`),i}catch(e){throw console.log(e),e}},r}},1809:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.measureExcecutionTime=void 0,t.measureExcecutionTime=function measureExcecutionTime(e,t,r){const n=r.value;return r.value=async function(...e){const t=Date.now(),r=await n.apply(this,e),i=Date.now();return console.info(`Execution time: ${i-t}ms`),r},r}},4569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomString=void 0,t.randomString=function randomString(e,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){let r="";const n=t.length;for(let i=0;i<e;i++)r+=t.charAt(Math.floor(Math.random()*n));return r}},7807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationError=void 0;class ApplicationError extends Error{code;data;constructor(e,t,r){super(t),this.code=e,this.data=r}equals(e){return this.code===e.code}}t.ApplicationError=ApplicationError},9278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Result=void 0;class Result{_isSuccess;_error;_value;constructor(e,t,r){if(e&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!e&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error");if(void 0!==t&&!e)throw new Error("InvalidOperation: A value is only useful in case of a success.");this._value=t,this._isSuccess=e,this._error=r}get isSuccess(){return this._isSuccess}get isError(){return!this._isSuccess}get error(){return this._error}get value(){if(!this.isSuccess)throw new Error("Can't get the value of an error result. Use 'error' instead.");return this._value}static ok(e){return new Result(!0,e)}static fail(e){return new Result(!1,void 0,e)}}t.Result=Result},7226:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7807),t),i(r(9278),t)},7374:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sleep=void 0,t.sleep=function sleep(e){return new Promise((t=>{setTimeout(t,e)}))}},9669:(e,t,r)=>{e.exports=r(1609)},5448:(e,t,r)=>{"use strict";var n=r(4867),i=r(6026),o=r(4372),a=r(5327),s=r(4097),c=r(4109),l=r(7985),u=r(5061),p=r(5655),d=r(5263);e.exports=function xhrAdapter(e){return new Promise((function dispatchXhrRequest(t,r){var h,g=e.data,y=e.headers,m=e.responseType;function done(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(g)&&delete y["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.Authorization="Basic "+btoa(w+":"+b)}var C=s(e.baseURL,e.url);function onloadend(){if(v){var n="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,o={data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function _resolve(e){t(e),done()}),(function _reject(e){r(e),done()}),o),v=null}}if(v.open(e.method.toUpperCase(),a(C,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=onloadend:v.onreadystatechange=function handleLoad(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(onloadend)},v.onabort=function handleAbort(){v&&(r(u("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function handleError(){r(u("Network Error",e,null,v)),v=null},v.ontimeout=function handleTimeout(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||p.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(u(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},n.isStandardBrowserEnv()){var _=(e.withCredentials||l(C))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;_&&(y[e.xsrfHeaderName]=_)}"setRequestHeader"in v&&n.forEach(y,(function setRequestHeader(e,t){void 0===g&&"content-type"===t.toLowerCase()?delete y[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),m&&"json"!==m&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(r(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),g||(g=null),v.send(g)}))}},1609:(e,t,r)=>{"use strict";var n=r(4867),i=r(1849),o=r(321),a=r(7185);var s=function createInstance(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r.create=function create(t){return createInstance(a(e,t))},r}(r(5655));s.Axios=o,s.Cancel=r(5263),s.CancelToken=r(4972),s.isCancel=r(6502),s.VERSION=r(7288).version,s.all=function all(e){return Promise.all(e)},s.spread=r(8713),s.isAxiosError=r(6268),e.exports=s,e.exports.default=s},5263:e=>{"use strict";function Cancel(e){this.message=e}Cancel.prototype.toString=function toString(){return"Cancel"+(this.message?": "+this.message:"")},Cancel.prototype.__CANCEL__=!0,e.exports=Cancel},4972:(e,t,r)=>{"use strict";var n=r(5263);function CancelToken(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function promiseExecutor(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function reject(){r.unsubscribe(t)},n},e((function cancel(e){r.reason||(r.reason=new n(e),t(r.reason))}))}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.prototype.subscribe=function subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},CancelToken.prototype.unsubscribe=function unsubscribe(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},CancelToken.source=function source(){var e;return{token:new CancelToken((function executor(t){e=t})),cancel:e}},e.exports=CancelToken},6502:e=>{"use strict";e.exports=function isCancel(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(4867),i=r(5327),o=r(782),a=r(3572),s=r(7185),c=r(4875),l=c.validators;function Axios(e){this.defaults=e,this.interceptors={request:new o,response:new o}}Axios.prototype.request=function request(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function unshiftRequestInterceptors(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function pushResponseInterceptors(e){o.push(e.fulfilled,e.rejected)})),!n){var u=[a,void 0];for(Array.prototype.unshift.apply(u,r),u=u.concat(o),i=Promise.resolve(e);u.length;)i=i.then(u.shift(),u.shift());return i}for(var p=e;r.length;){var d=r.shift(),h=r.shift();try{p=d(p)}catch(e){h(e);break}}try{i=a(p)}catch(e){return Promise.reject(e)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},Axios.prototype.getUri=function getUri(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function forEachMethodNoData(e){Axios.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function forEachMethodWithData(e){Axios.prototype[e]=function(t,r,n){return this.request(s(n||{},{method:e,url:t,data:r}))}})),e.exports=Axios},782:(e,t,r)=>{"use strict";var n=r(4867);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager.prototype.forEach=function forEach(e){n.forEach(this.handlers,(function forEachHandler(t){null!==t&&e(t)}))},e.exports=InterceptorManager},4097:(e,t,r)=>{"use strict";var n=r(1793),i=r(7303);e.exports=function buildFullPath(e,t){return e&&!n(t)?i(e,t):t}},5061:(e,t,r)=>{"use strict";var n=r(481);e.exports=function createError(e,t,r,i,o){var a=new Error(e);return n(a,t,r,i,o)}},3572:(e,t,r)=>{"use strict";var n=r(4867),i=r(8527),o=r(6502),a=r(5655),s=r(5263);function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function cleanHeaderConfig(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function onAdapterResolution(t){return throwIfCancellationRequested(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function onAdapterRejection(t){return o(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function enhanceError(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function mergeConfig(e,t){t=t||{};var r={};function getMergedValue(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function mergeDeepProperties(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:getMergedValue(void 0,e[r]):getMergedValue(e[r],t[r])}function valueFromConfig2(e){if(!n.isUndefined(t[e]))return getMergedValue(void 0,t[e])}function defaultToConfig2(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:getMergedValue(void 0,e[r]):getMergedValue(void 0,t[r])}function mergeDirectKeys(r){return r in t?getMergedValue(e[r],t[r]):r in e?getMergedValue(void 0,e[r]):void 0}var i={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function computeConfigValue(e){var t=i[e]||mergeDeepProperties,o=t(e);n.isUndefined(o)&&t!==mergeDirectKeys||(r[e]=o)})),r}},6026:(e,t,r)=>{"use strict";var n=r(5061);e.exports=function settle(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},8527:(e,t,r)=>{"use strict";var n=r(4867),i=r(5655);e.exports=function transformData(e,t,r){var o=this||i;return n.forEach(r,(function transform(r){e=r.call(o,e,t)})),e}},5655:(e,t,r)=>{"use strict";var n=r(4867),i=r(6016),o=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function getDefaultAdapter(){var e;return("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(e=r(5448)),e}(),transformRequest:[function transformRequest(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(setContentTypeIfUnset(t,"application/json"),function stringifySafely(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function transformResponse(e){var t=this.transitional||s.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function validateStatus(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function forEachMethodNoData(e){s.headers[e]={}})),n.forEach(["post","put","patch"],(function forEachMethodWithData(e){s.headers[e]=n.merge(a)})),e.exports=s},7288:e=>{e.exports={version:"0.24.0"}},1849:e=>{"use strict";e.exports=function bind(e,t){return function wrap(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},5327:(e,t,r)=>{"use strict";var n=r(4867);function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function buildURL(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var o=[];n.forEach(t,(function serialize(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function parseValue(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(encode(t)+"="+encode(e))})))})),i=o.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},7303:e=>{"use strict";e.exports=function combineURLs(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function standardBrowserEnv(){return{write:function write(e,t,r,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function read(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function remove(e){this.write(e,"",Date.now()-864e5)}}}():{write:function write(){},read:function read(){return null},remove:function remove(){}}},1793:e=>{"use strict";e.exports=function isAbsoluteURL(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function isAxiosError(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function standardBrowserEnv(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function resolveURL(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=resolveURL(window.location.href),function isURLSameOrigin(t){var r=n.isString(t)?resolveURL(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function isURLSameOrigin(){return!0}},6016:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function normalizeHeaderName(e,t){n.forEach(e,(function processHeader(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4109:(e,t,r)=>{"use strict";var n=r(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function parseHeaders(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function parser(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},8713:e=>{"use strict";e.exports=function spread(e){return function wrap(t){return e.apply(null,t)}}},4875:(e,t,r)=>{"use strict";var n=r(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function validator(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={};i.transitional=function transitional(e,t,r){function formatMessage(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,i){if(!1===e)throw new Error(formatMessage(n," has been removed"+(t?" in "+t:"")));return t&&!o[n]&&(o[n]=!0,console.warn(formatMessage(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,i)}},e.exports={assertOptions:function assertOptions(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],a=t[o];if(a){var s=e[o],c=void 0===s||a(s,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},4867:(e,t,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function isArray(e){return"[object Array]"===i.call(e)}function isUndefined(e){return void 0===e}function isObject(e){return null!==e&&"object"==typeof e}function isPlainObject(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function isFunction(e){return"[object Function]"===i.call(e)}function forEach(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),isArray(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray,isArrayBuffer:function isArrayBuffer(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function isBuffer(e){return null!==e&&!isUndefined(e)&&null!==e.constructor&&!isUndefined(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function isFormData(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function isArrayBufferView(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function isString(e){return"string"==typeof e},isNumber:function isNumber(e){return"number"==typeof e},isObject,isPlainObject,isUndefined,isDate:function isDate(e){return"[object Date]"===i.call(e)},isFile:function isFile(e){return"[object File]"===i.call(e)},isBlob:function isBlob(e){return"[object Blob]"===i.call(e)},isFunction,isStream:function isStream(e){return isObject(e)&&isFunction(e.pipe)},isURLSearchParams:function isURLSearchParams(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function isStandardBrowserEnv(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach,merge:function merge(){var e={};function assignValue(t,r){isPlainObject(e[r])&&isPlainObject(t)?e[r]=merge(e[r],t):isPlainObject(t)?e[r]=merge({},t):isArray(t)?e[r]=t.slice():e[r]=t}for(var t=0,r=arguments.length;t<r;t++)forEach(arguments[t],assignValue);return e},extend:function extend(e,t,r){return forEach(t,(function assignValue(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function stripBOM(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},1924:(e,t,r)=>{"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));e.exports=function callBoundIntrinsic(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),c=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function callBind(e){var t=s(n,a,arguments);if(c&&l){var r=c(t,"length");r.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function applyBind(){return s(n,o,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},9180:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(9829)],void 0===(o="function"==typeof(n=function ErrorStackParser(e){var t=/(^|@)\S+\:\d+/,r=/^\s*at .*(\S+\:\d+|\(native\))/m,n=/^(eval@)?(\[native code\])?$/;function _map(e,t,r){if("function"==typeof Array.prototype.map)return e.map(t,r);for(var n=new Array(e.length),i=0;i<e.length;i++)n[i]=t.call(r,e[i]);return n}function _filter(e,t,r){if("function"==typeof Array.prototype.filter)return e.filter(t,r);for(var n=[],i=0;i<e.length;i++)t.call(r,e[i])&&n.push(e[i]);return n}function _indexOf(e,t){if("function"==typeof Array.prototype.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1}return{parse:function ErrorStackParser$$parse(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(r))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function ErrorStackParser$$extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(e.replace(/[\(\)]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function ErrorStackParser$$parseV8OrIE(t){return _map(_filter(t.stack.split("\n"),(function(e){return!!e.match(r)}),this),(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(r.pop()),i=r.join(" ")||void 0,o=_indexOf(["eval","<anonymous>"],n[0])>-1?void 0:n[0];return new e(i,void 0,o,n[1],n[2],t)}),this)},parseFFOrSafari:function ErrorStackParser$$parseFFOrSafari(t){return _map(_filter(t.stack.split("\n"),(function(e){return!e.match(n)}),this),(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e(t);var r=t.split("@"),n=this.extractLocation(r.pop()),i=r.join("@")||void 0;return new e(i,void 0,n[0],n[1],n[2],t)}),this)},parseOpera:function ErrorStackParser$$parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function ErrorStackParser$$parseOpera9(t){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[],o=2,a=n.length;o<a;o+=2){var s=r.exec(n[o]);s&&i.push(new e(void 0,void 0,s[2],s[1],void 0,n[o]))}return i},parseOpera10:function ErrorStackParser$$parseOpera10(t){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[],o=0,a=n.length;o<a;o+=2){var s=r.exec(n[o]);s&&i.push(new e(s[3]||void 0,void 0,s[2],s[1],void 0,n[o]))}return i},parseOpera11:function ErrorStackParser$$parseOpera11(r){return _map(_filter(r.stack.split("\n"),(function(e){return!!e.match(t)&&!e.match(/^Error created at/)}),this),(function(t){var r,n=t.split("@"),i=this.extractLocation(n.pop()),o=n.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(r=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new e(a,s,i[0],i[1],i[2],t)}),this)}}})?n.apply(t,i):n)||(e.exports=o)}()},6387:(e,t,r)=>{var n;!function(i){var o=Object.hasOwnProperty,a=Array.isArray?Array.isArray:function _isArray(e){return"[object Array]"===Object.prototype.toString.call(e)},s="object"==typeof process&&"function"==typeof process.nextTick,c="function"==typeof Symbol,l="object"==typeof Reflect,u="function"==typeof setImmediate?setImmediate:setTimeout,p=c?l&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function init(){this._events={},this._conf&&configure.call(this,this._conf)}function configure(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners!==i&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function logPossibleMemoryLeak(e,t){var r="(node) warning: possible EventEmitter memory leak detected. "+e+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(r+=" Event name: "+t+"."),"undefined"!=typeof process&&process.emitWarning){var n=new Error(r);n.name="MaxListenersExceededWarning",n.emitter=this,n.count=e,process.emitWarning(n)}else console.error(r),console.trace&&console.trace()}var toArray=function(e,t,r){var n=arguments.length;switch(n){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,r];default:for(var i=new Array(n);n--;)i[n]=arguments[n];return i}};function toObject(e,t){for(var r={},n=e.length,o=t?value.length:0,a=0;a<n;a++)r[e[a]]=a<o?t[a]:i;return r}function TargetObserver(e,t,r){var n,i;if(this._emitter=e,this._target=t,this._listeners={},this._listenersCount=0,(r.on||r.off)&&(n=r.on,i=r.off),t.addEventListener?(n=t.addEventListener,i=t.removeEventListener):t.addListener?(n=t.addListener,i=t.removeListener):t.on&&(n=t.on,i=t.off),!n&&!i)throw Error("target does not implement any known event API");if("function"!=typeof n)throw TypeError("on method must be a function");if("function"!=typeof i)throw TypeError("off method must be a function");this._on=n,this._off=i;var o=e._observers;o?o.push(this):e._observers=[this]}function resolveOptions(e,t,r,n){var a=Object.assign({},t);if(!e)return a;if("object"!=typeof e)throw TypeError("options must be an object");var s,c,l,u=Object.keys(e),p=u.length;function reject(e){throw Error('Invalid "'+s+'" option value'+(e?". Reason: "+e:""))}for(var d=0;d<p;d++){if(s=u[d],!n&&!o.call(t,s))throw Error('Unknown "'+s+'" option');(c=e[s])!==i&&(l=r[s],a[s]=l?l(c,reject):c)}return a}function constructorReducer(e,t){return"function"==typeof e&&e.hasOwnProperty("prototype")||t("value must be a constructor"),e}function makeTypeReducer(e){var t="value must be type of "+e.join("|"),r=e.length,n=e[0],i=e[1];return 1===r?function(e,r){if(typeof e===n)return e;r(t)}:2===r?function(e,r){var o=typeof e;if(o===n||o===i)return e;r(t)}:function(n,i){for(var o=typeof n,a=r;a-- >0;)if(o===e[a])return n;i(t)}}Object.assign(TargetObserver.prototype,{subscribe:function(e,t,r){var n=this,i=this._target,o=this._emitter,a=this._listeners,handler=function(){var n=toArray.apply(null,arguments),a={data:n,name:t,original:e};if(r){var s=r.call(i,a);!1!==s&&o.emit.apply(o,[a.name].concat(n))}else o.emit.apply(o,[t].concat(n))};if(a[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!n._onNewListener?(this._onNewListener=function(r){r===t&&null===a[e]&&(a[e]=handler,n._on.call(i,e,handler))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(r){r===t&&!o.hasListeners(r)&&a[e]&&(a[e]=null,n._off.call(i,e,handler))},a[e]=null,o.on("removeListener",this._onRemoveListener)):(a[e]=handler,n._on.call(i,e,handler))},unsubscribe:function(e){var t,r,n,i=this,o=this._listeners,a=this._emitter,s=this._off,c=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function clearRefs(){i._onNewListener&&(a.off("newListener",i._onNewListener),a.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=findTargetIndex.call(a,i);a._observers.splice(e,1)}if(e){if(!(t=o[e]))return;s.call(c,e,t),delete o[e],--this._listenersCount||clearRefs()}else{for(n=(r=p(o)).length;n-- >0;)e=r[n],s.call(c,e,o[e]);this._listeners={},this._listenersCount=0,clearRefs()}}});var d=makeTypeReducer(["function"]),h=makeTypeReducer(["object","function"]);function makeCancelablePromise(e,t,r){var n,i,o,a=0,s=new e((function(c,l,u){function cleanup(){i&&(i=null),a&&(clearTimeout(a),a=0)}r=resolveOptions(r,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),n=!r.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof u;var _resolve=function(e){cleanup(),c(e)},_reject=function(e){cleanup(),l(e)};n?t(_resolve,_reject,u):(i=[function(e){_reject(e||Error("canceled"))}],t(_resolve,_reject,(function(e){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");i.push(e)})),o=!0),r.timeout>0&&(a=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",a=0,s.cancel(e),l(e)}),r.timeout))}));return n||(s.cancel=function(e){if(i){for(var t=i.length,r=1;r<t;r++)i[r](e);i[0](e),i=null}}),s}function findTargetIndex(e){var t=this._observers;if(!t)return-1;for(var r=t.length,n=0;n<r;n++)if(t[n]._target===e)return n;return-1}function searchListenerTree(e,t,r,n,i){if(!r)return null;if(0===n){var o=typeof t;if("string"===o){var a,s,c=0,l=0,u=this.delimiter,d=u.length;if(-1!==(s=t.indexOf(u))){a=new Array(5);do{a[c++]=t.slice(l,s),l=s+d}while(-1!==(s=t.indexOf(u,l)));a[c++]=t.slice(l),t=a,i=c}else t=[t],i=1}else"object"===o?i=t.length:(t=[t],i=1)}var h,g,y,m,v,w,b,C=null,_=t[n],S=t[n+1];if(n===i)r._listeners&&("function"==typeof r._listeners?(e&&e.push(r._listeners),C=[r]):(e&&e.push.apply(e,r._listeners),C=[r]));else{if("*"===_){for(s=(w=p(r)).length;s-- >0;)"_listeners"!==(h=w[s])&&(b=searchListenerTree(e,t,r[h],n+1,i))&&(C?C.push.apply(C,b):C=b);return C}if("**"===_){for((v=n+1===i||n+2===i&&"*"===S)&&r._listeners&&(C=searchListenerTree(e,t,r,i,i)),s=(w=p(r)).length;s-- >0;)"_listeners"!==(h=w[s])&&("*"===h||"**"===h?(r[h]._listeners&&!v&&(b=searchListenerTree(e,t,r[h],i,i))&&(C?C.push.apply(C,b):C=b),b=searchListenerTree(e,t,r[h],n,i)):b=searchListenerTree(e,t,r[h],h===S?n+2:n,i),b&&(C?C.push.apply(C,b):C=b));return C}r[_]&&(C=searchListenerTree(e,t,r[_],n+1,i))}if((g=r["*"])&&searchListenerTree(e,t,g,n+1,i),y=r["**"])if(n<i)for(y._listeners&&searchListenerTree(e,t,y,i,i),s=(w=p(y)).length;s-- >0;)"_listeners"!==(h=w[s])&&(h===S?searchListenerTree(e,t,y[h],n+2,i):h===_?searchListenerTree(e,t,y[h],n+1,i):((m={})[h]=y[h],searchListenerTree(e,t,{"**":m},n+1,i)));else y._listeners?searchListenerTree(e,t,y,i,i):y["*"]&&y["*"]._listeners&&searchListenerTree(e,t,y["*"],i,i);return C}function growListenerTree(e,t,r){var n,i,o=0,a=0,s=this.delimiter,c=s.length;if("string"==typeof e)if(-1!==(n=e.indexOf(s))){i=new Array(5);do{i[o++]=e.slice(a,n),a=n+c}while(-1!==(n=e.indexOf(s,a)));i[o++]=e.slice(a)}else i=[e],o=1;else i=e,o=e.length;if(o>1)for(n=0;n+1<o;n++)if("**"===i[n]&&"**"===i[n+1])return;var l,u=this.listenerTree;for(n=0;n<o;n++)if(u=u[l=i[n]]||(u[l]={}),n===o-1)return u._listeners?("function"==typeof u._listeners&&(u._listeners=[u._listeners]),r?u._listeners.unshift(t):u._listeners.push(t),!u._listeners.warned&&this._maxListeners>0&&u._listeners.length>this._maxListeners&&(u._listeners.warned=!0,logPossibleMemoryLeak.call(this,u._listeners.length,l))):u._listeners=t,!0;return!0}function collectTreeEvents(e,t,r,n){for(var i,o,a,s,c=p(e),l=c.length,u=e._listeners;l-- >0;)i=e[o=c[l]],a="_listeners"===o?r:r?r.concat(o):[o],s=n||"symbol"==typeof o,u&&t.push(s?a:a.join(this.delimiter)),"object"==typeof i&&collectTreeEvents.call(this,i,t,a,s);return t}function recursivelyGarbageCollect(e){for(var t,r,n,i=p(e),o=i.length;o-- >0;)(t=e[r=i[o]])&&(n=!0,"_listeners"===r||recursivelyGarbageCollect(t)||delete e[r]);return n}function Listener(e,t,r){this.emitter=e,this.event=t,this.listener=r}function setupListener(e,t,r){if(!0===r)o=!0;else if(!1===r)n=!0;else{if(!r||"object"!=typeof r)throw TypeError("options should be an object or true");var n=r.async,o=r.promisify,a=r.nextTick,c=r.objectify}if(n||a||o){var l=t,p=t._origin||t;if(a&&!s)throw Error("process.nextTick is not supported");o===i&&(o="AsyncFunction"===t.constructor.name),t=function(){var e=arguments,t=this,r=this.event;return o?a?Promise.resolve():new Promise((function(e){u(e)})).then((function(){return t.event=r,l.apply(t,e)})):(a?process.nextTick:u)((function(){t.event=r,l.apply(t,e)}))},t._async=!0,t._origin=p}return[t,c?new Listener(this,e,t):this]}function EventEmitter(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,configure.call(this,e)}Listener.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},EventEmitter.EventEmitter2=EventEmitter,EventEmitter.prototype.listenTo=function(e,t,r){if("object"!=typeof e)throw TypeError("target musts be an object");var n=this;function listen(t){if("object"!=typeof t)throw TypeError("events must be an object");var i,o=r.reducers,a=findTargetIndex.call(n,e);i=-1===a?new TargetObserver(n,e,r):n._observers[a];for(var s,c=p(t),l=c.length,u="function"==typeof o,d=0;d<l;d++)s=c[d],i.subscribe(s,t[s]||s,u?o:o&&o[s])}return r=resolveOptions(r,{on:i,off:i,reducers:i},{on:d,off:d,reducers:h}),a(t)?listen(toObject(t)):listen("string"==typeof t?toObject(t.split(/\s+/)):t),this},EventEmitter.prototype.stopListeningTo=function(e,t){var r=this._observers;if(!r)return!1;var n,i=r.length,o=!1;if(e&&"object"!=typeof e)throw TypeError("target should be an object");for(;i-- >0;)n=r[i],e&&n._target!==e||(n.unsubscribe(t),o=!0);return o},EventEmitter.prototype.delimiter=".",EventEmitter.prototype.setMaxListeners=function(e){e!==i&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},EventEmitter.prototype.getMaxListeners=function(){return this._maxListeners},EventEmitter.prototype.event="",EventEmitter.prototype.once=function(e,t,r){return this._once(e,t,!1,r)},EventEmitter.prototype.prependOnceListener=function(e,t,r){return this._once(e,t,!0,r)},EventEmitter.prototype._once=function(e,t,r,n){return this._many(e,1,t,r,n)},EventEmitter.prototype.many=function(e,t,r,n){return this._many(e,t,r,!1,n)},EventEmitter.prototype.prependMany=function(e,t,r,n){return this._many(e,t,r,!0,n)},EventEmitter.prototype._many=function(e,t,r,n,i){var o=this;if("function"!=typeof r)throw new Error("many only accepts instances of Function");function listener(){return 0==--t&&o.off(e,listener),r.apply(this,arguments)}return listener._origin=r,this._on(e,listener,n,i)},EventEmitter.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||init.call(this);var e,t,r,n,i,o,a=arguments[0],s=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return!1;if(s&&(e=a,"newListener"!==a&&"removeListener"!==a&&"object"==typeof a)){if(r=a.length,c)for(n=0;n<r;n++)if("symbol"==typeof a[n]){o=!0;break}o||(a=a.join(this.delimiter))}var l,u=arguments.length;if(this._all&&this._all.length)for(n=0,r=(l=this._all.slice()).length;n<r;n++)switch(this.event=a,u){case 1:l[n].call(this,a);break;case 2:l[n].call(this,a,arguments[1]);break;case 3:l[n].call(this,a,arguments[1],arguments[2]);break;default:l[n].apply(this,arguments)}if(s)l=[],searchListenerTree.call(this,l,e,this.listenerTree,0,r);else{if("function"==typeof(l=this._events[a])){switch(this.event=a,u){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;default:for(t=new Array(u-1),i=1;i<u;i++)t[i-1]=arguments[i];l.apply(this,t)}return!0}l&&(l=l.slice())}if(l&&l.length){if(u>3)for(t=new Array(u-1),i=1;i<u;i++)t[i-1]=arguments[i];for(n=0,r=l.length;n<r;n++)switch(this.event=a,u){case 1:l[n].call(this);break;case 2:l[n].call(this,arguments[1]);break;case 3:l[n].call(this,arguments[1],arguments[2]);break;default:l[n].apply(this,t)}return!0}if(!this.ignoreErrors&&!this._all&&"error"===a)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},EventEmitter.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||init.call(this);var e,t,r,n,i,o,a=arguments[0],s=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(s&&(e=a,"newListener"!==a&&"removeListener"!==a&&"object"==typeof a)){if(n=a.length,c)for(i=0;i<n;i++)if("symbol"==typeof a[i]){t=!0;break}t||(a=a.join(this.delimiter))}var l,u=[],p=arguments.length;if(this._all)for(i=0,n=this._all.length;i<n;i++)switch(this.event=a,p){case 1:u.push(this._all[i].call(this,a));break;case 2:u.push(this._all[i].call(this,a,arguments[1]));break;case 3:u.push(this._all[i].call(this,a,arguments[1],arguments[2]));break;default:u.push(this._all[i].apply(this,arguments))}if(s?(l=[],searchListenerTree.call(this,l,e,this.listenerTree,0)):l=this._events[a],"function"==typeof l)switch(this.event=a,p){case 1:u.push(l.call(this));break;case 2:u.push(l.call(this,arguments[1]));break;case 3:u.push(l.call(this,arguments[1],arguments[2]));break;default:for(r=new Array(p-1),o=1;o<p;o++)r[o-1]=arguments[o];u.push(l.apply(this,r))}else if(l&&l.length){if(l=l.slice(),p>3)for(r=new Array(p-1),o=1;o<p;o++)r[o-1]=arguments[o];for(i=0,n=l.length;i<n;i++)switch(this.event=a,p){case 1:u.push(l[i].call(this));break;case 2:u.push(l[i].call(this,arguments[1]));break;case 3:u.push(l[i].call(this,arguments[1],arguments[2]));break;default:u.push(l[i].apply(this,r))}}else if(!this.ignoreErrors&&!this._all&&"error"===a)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(u)},EventEmitter.prototype.on=function(e,t,r){return this._on(e,t,!1,r)},EventEmitter.prototype.prependListener=function(e,t,r){return this._on(e,t,!0,r)},EventEmitter.prototype.onAny=function(e){return this._onAny(e,!1)},EventEmitter.prototype.prependAny=function(e){return this._onAny(e,!0)},EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prototype._onAny=function(e,t){if("function"!=typeof e)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),t?this._all.unshift(e):this._all.push(e),this},EventEmitter.prototype._on=function(e,t,r,n){if("function"==typeof e)return this._onAny(e,t),this;if("function"!=typeof t)throw new Error("on only accepts instances of Function");this._events||init.call(this);var o,a=this;return n!==i&&(t=(o=setupListener.call(this,e,t,n))[0],a=o[1]),this._newListener&&this.emit("newListener",e,t),this.wildcard?(growListenerTree.call(this,e,t,r),a):(this._events[e]?("function"==typeof this._events[e]&&(this._events[e]=[this._events[e]]),r?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&this._maxListeners>0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,logPossibleMemoryLeak.call(this,this._events[e].length,e))):this._events[e]=t,a)},EventEmitter.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var r,n=[];if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice();if(!(n=searchListenerTree.call(this,null,i,this.listenerTree,0)))return this}else{if(!this._events[e])return this;r=this._events[e],n.push({_listeners:r})}for(var o=0;o<n.length;o++){var s=n[o];if(r=s._listeners,a(r)){for(var c=-1,l=0,u=r.length;l<u;l++)if(r[l]===t||r[l].listener&&r[l].listener===t||r[l]._origin&&r[l]._origin===t){c=l;break}if(c<0)continue;return this.wildcard?s._listeners.splice(c,1):this._events[e].splice(c,1),0===r.length&&(this.wildcard?delete s._listeners:delete this._events[e]),this._removeListener&&this.emit("removeListener",e,t),this}(r===t||r.listener&&r.listener===t||r._origin&&r._origin===t)&&(this.wildcard?delete s._listeners:delete this._events[e],this._removeListener&&this.emit("removeListener",e,t))}return this.listenerTree&&recursivelyGarbageCollect(this.listenerTree),this},EventEmitter.prototype.offAny=function(e){var t,r=0,n=0;if(e&&this._all&&this._all.length>0){for(r=0,n=(t=this._all).length;r<n;r++)if(e===t[r])return t.splice(r,1),this._removeListener&&this.emit("removeListenerAny",e),this}else{if(t=this._all,this._removeListener)for(r=0,n=t.length;r<n;r++)this.emit("removeListenerAny",t[r]);this._all=[]}return this},EventEmitter.prototype.removeListener=EventEmitter.prototype.off,EventEmitter.prototype.removeAllListeners=function(e){if(e===i)return!this._events||init.call(this),this;if(this.wildcard){var t,r=searchListenerTree.call(this,null,e,this.listenerTree,0);if(!r)return this;for(t=0;t<r.length;t++)r[t]._listeners=null;this.listenerTree&&recursivelyGarbageCollect(this.listenerTree)}else this._events&&(this._events[e]=null);return this},EventEmitter.prototype.listeners=function(e){var t,r,n,o,a,s=this._events;if(e===i){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!s)return[];for(o=(t=p(s)).length,n=[];o-- >0;)"function"==typeof(r=s[t[o]])?n.push(r):n.push.apply(n,r);return n}if(this.wildcard){if(!(a=this.listenerTree))return[];var c=[],l="string"==typeof e?e.split(this.delimiter):e.slice();return searchListenerTree.call(this,c,l,a,0),c}return s&&(r=s[e])?"function"==typeof r?[r]:r:[]},EventEmitter.prototype.eventNames=function(e){var t=this._events;return this.wildcard?collectTreeEvents.call(this,this.listenerTree,[],null,e):t?p(t):[]},EventEmitter.prototype.listenerCount=function(e){return this.listeners(e).length},EventEmitter.prototype.hasListeners=function(e){if(this.wildcard){var t=[],r="string"==typeof e?e.split(this.delimiter):e.slice();return searchListenerTree.call(this,t,r,this.listenerTree,0),t.length>0}var n=this._events,o=this._all;return!!(o&&o.length||n&&(e===i?p(n).length:n[e]))},EventEmitter.prototype.listenersAny=function(){return this._all?this._all:[]},EventEmitter.prototype.waitFor=function(e,t){var r=this,n=typeof t;return"number"===n?t={timeout:t}:"function"===n&&(t={filter:t}),makeCancelablePromise((t=resolveOptions(t,{timeout:0,filter:i,handleError:!1,Promise,overload:!1},{filter:d,Promise:constructorReducer})).Promise,(function(n,i,o){function listener(){var o=t.filter;if(!o||o.apply(r,arguments))if(r.off(e,listener),t.handleError){var a=arguments[0];a?i(a):n(toArray.apply(null,arguments).slice(1))}else n(toArray.apply(null,arguments))}o((function(){r.off(e,listener)})),r._on(e,listener,!1)}),{timeout:t.timeout,overload:t.overload})};var g=EventEmitter.prototype;Object.defineProperties(EventEmitter,{defaultMaxListeners:{get:function(){return g._maxListeners},set:function(e){if("number"!=typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");g._maxListeners=e},enumerable:!0},once:{value:function once(e,t,r){return makeCancelablePromise((r=resolveOptions(r,{Promise,timeout:0,overload:!1},{Promise:constructorReducer})).Promise,(function(r,n,i){var o;if("function"==typeof e.addEventListener)return o=function(){r(toArray.apply(null,arguments))},i((function(){e.removeEventListener(t,o)})),void e.addEventListener(t,o,{once:!0});var a,eventListener=function(){a&&e.removeListener("error",a),r(toArray.apply(null,arguments))};"error"!==t&&(a=function(r){e.removeListener(t,eventListener),n(r)},e.once("error",a)),i((function(){a&&e.removeListener("error",a),e.removeListener(t,eventListener)})),e.once(t,eventListener)}),{timeout:r.timeout,overload:r.overload})},writable:!0,configurable:!0}}),Object.defineProperties(g,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),(n=function(){return EventEmitter}.call(t,r,t,e))===i||(e.exports=n)}()},6230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},7648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function bind(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var a,s=r.call(arguments,1),binder=function(){if(this instanceof a){var t=o.apply(this,s.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,s.concat(r.call(arguments)))},c=Math.max(0,o.length-s.length),l=[],u=0;u<c;u++)l.push("$"+u);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(binder),o.prototype){var p=function Empty(){};p.prototype=o.prototype,a.prototype=new p,p.prototype=null}return a}},8612:(e,t,r)=>{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,getEvalledConstructor=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(e){s=null}var throwTypeError=function(){throw new a},c=s?function(){try{return throwTypeError}catch(e){try{return s(arguments,"callee").get}catch(e){return throwTypeError}}}():throwTypeError,l=r(1405)(),u=Object.getPrototypeOf||function(e){return e.__proto__},p={},d="undefined"==typeof Uint8Array?n:u(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?u([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?u(u([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?u((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?u((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?u(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function doEval(e){var t;if("%AsyncFunction%"===e)t=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===e)t=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===e)t=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===e){var r=doEval("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=doEval("%AsyncGenerator%");n&&(t=u(n.prototype))}return h[e]=t,t},y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),b=m.call(Function.apply,Array.prototype.splice),C=m.call(Function.call,String.prototype.replace),_=m.call(Function.call,String.prototype.slice),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,O=function stringToPath(e){var t=_(e,0,1),r=_(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return C(e,S,(function(e,t,r,i){n[n.length]=r?C(i,T,"$1"):t||e})),n},R=function getBaseIntrinsic(e,t){var r,n=e;if(v(y,n)&&(n="%"+(r=y[n])[0]+"%"),v(h,n)){var o=h[n];if(o===p&&(o=g(n)),void 0===o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function GetIntrinsic(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');var r=O(e),n=r.length>0?r[0]:"",o=R("%"+n+"%",t),c=o.name,l=o.value,u=!1,p=o.alias;p&&(n=p[0],b(r,w([0,1],p)));for(var d=1,g=!0;d<r.length;d+=1){var y=r[d],m=_(y,0,1),C=_(y,-1);if(('"'===m||"'"===m||"`"===m||'"'===C||"'"===C||"`"===C)&&m!==C)throw new i("property names with quotes must have matching quotes");if("constructor"!==y&&g||(u=!0),v(h,c="%"+(n+="."+y)+"%"))l=h[c];else if(null!=l){if(!(y in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(s&&d+1>=r.length){var S=s(l,y);l=(g=!!S)&&"get"in S&&!("originalValue"in S.get)?S.get:l[y]}else g=v(l,y),l=l[y];g&&!u&&(h[c]=l)}}return l}},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function hasNativeSymbols(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},5419:e=>{"use strict";e.exports=function hasSymbols(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7642:(e,t,r)=>{"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4530:(e,t)=>{function serializer(e,t){var r=[],n=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(i,o){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?n.splice(a,1/0,i):n.push(i),~r.indexOf(o)&&(o=t.call(this,i,o))}else r.push(o);return null==e?o:e.call(this,i,o)}}(e.exports=function stringify(e,t,r,n){return JSON.stringify(e,serializer(t,n),r)}).getSerialize=serializer},6486:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",c=16,l=32,u=64,p=128,d=256,h=1/0,g=9007199254740991,y=NaN,m=4294967295,v=[["ary",p],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",l],["partialRight",u],["rearg",d]],w="[object Arguments]",b="[object Array]",C="[object Boolean]",_="[object Date]",S="[object Error]",T="[object Function]",O="[object GeneratorFunction]",R="[object Map]",I="[object Number]",E="[object Object]",L="[object Promise]",M="[object RegExp]",A="[object Set]",D="[object String]",P="[object Symbol]",j="[object WeakMap]",k="[object ArrayBuffer]",x="[object DataView]",F="[object Float32Array]",N="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",U="[object Int32Array]",q="[object Uint8Array]",W="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",K=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,J=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,Y=RegExp(J.source),Q=RegExp(Z.source),X=/<%-([\s\S]+?)%>/g,ee=/<%([\s\S]+?)%>/g,te=/<%=([\s\S]+?)%>/g,re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oe=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(oe.source),se=/^\s+/,ce=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,pe=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,we=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,Ce=/^(?:0|[1-9]\d*)$/,_e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,Te=/['\n\r\u2028\u2029\\]/g,Oe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Re="\\u2700-\\u27bf",Ie="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",Le="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="['’]",De="[\\ud800-\\udfff]",Pe="["+Me+"]",je="["+Oe+"]",ke="\\d+",xe="[\\u2700-\\u27bf]",Fe="["+Ie+"]",Ne="[^\\ud800-\\udfff"+Me+ke+Re+Ie+Ee+"]",ze="\\ud83c[\\udffb-\\udfff]",Be="[^\\ud800-\\udfff]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",qe="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Ee+"]",Ve="(?:"+Fe+"|"+Ne+")",Ge="(?:"+We+"|"+Ne+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+je+"|"+ze+")"+"?",Je="[\\ufe0e\\ufe0f]?",Ze=Je+He+("(?:\\u200d(?:"+[Be,Ue,qe].join("|")+")"+Je+He+")*"),Ye="(?:"+[xe,Ue,qe].join("|")+")"+Ze,Qe="(?:"+[Be+je+"?",je,Ue,qe,De].join("|")+")",Xe=RegExp(Ae,"g"),et=RegExp(je,"g"),tt=RegExp(ze+"(?="+ze+")|"+Qe+Ze,"g"),rt=RegExp([We+"?"+Fe+"+"+Ke+"(?="+[Pe,We,"$"].join("|")+")",Ge+"+"+$e+"(?="+[Pe,We+Ve,"$"].join("|")+")",We+"?"+Ve+"+"+Ke,We+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ke,Ye].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Oe+Le+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[F]=st[N]=st[z]=st[B]=st[U]=st[q]=st[W]=st[V]=st[G]=!0,st[w]=st[b]=st[k]=st[C]=st[x]=st[_]=st[S]=st[T]=st[R]=st[I]=st[E]=st[M]=st[A]=st[D]=st[j]=!1;var ct={};ct[w]=ct[b]=ct[k]=ct[x]=ct[C]=ct[_]=ct[F]=ct[N]=ct[z]=ct[B]=ct[U]=ct[R]=ct[I]=ct[E]=ct[M]=ct[A]=ct[D]=ct[P]=ct[q]=ct[W]=ct[V]=ct[G]=!0,ct[S]=ct[T]=ct[j]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,pt=parseInt,ft="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,dt="object"==typeof self&&self&&self.Object===Object&&self,ht=ft||dt||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&e&&!e.nodeType&&e,mt=yt&&yt.exports===gt,vt=mt&&ft.process,wt=function(){try{var e=yt&&yt.require&&yt.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),bt=wt&&wt.isArrayBuffer,Ct=wt&&wt.isDate,_t=wt&&wt.isMap,St=wt&&wt.isRegExp,Tt=wt&&wt.isSet,Ot=wt&&wt.isTypedArray;function apply(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function arrayAggregator(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function arrayEach(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function arrayEachRight(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function arrayEvery(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function arrayFilter(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function arrayIncludes(e,t){return!!(null==e?0:e.length)&&baseIndexOf(e,t,0)>-1}function arrayIncludesWith(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function arrayPush(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function arrayReduce(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function arrayReduceRight(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function arraySome(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Rt=baseProperty("length");function baseFindKey(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function baseFindIndex(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function baseIndexOf(e,t,r){return t==t?function strictIndexOf(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):baseFindIndex(e,baseIsNaN,r)}function baseIndexOfWith(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function baseIsNaN(e){return e!=e}function baseMean(e,t){var r=null==e?0:e.length;return r?baseSum(e,t)/r:y}function baseProperty(e){return function(t){return null==t?i:t[e]}}function basePropertyOf(e){return function(t){return null==e?i:e[t]}}function baseReduce(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function baseSum(e,t){for(var r,n=-1,o=e.length;++n<o;){var a=t(e[n]);a!==i&&(r=r===i?a:r+a)}return r}function baseTimes(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function baseTrim(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(se,""):e}function baseUnary(e){return function(t){return e(t)}}function baseValues(e,t){return arrayMap(t,(function(t){return e[t]}))}function cacheHas(e,t){return e.has(t)}function charsStartIndex(e,t){for(var r=-1,n=e.length;++r<n&&baseIndexOf(t,e[r],0)>-1;);return r}function charsEndIndex(e,t){for(var r=e.length;r--&&baseIndexOf(t,e[r],0)>-1;);return r}function countHolders(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var It=basePropertyOf({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Et=basePropertyOf({"&":"&","<":"<",">":">",'"':""","'":"'"});function escapeStringChar(e){return"\\"+lt[e]}function hasUnicode(e){return nt.test(e)}function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function overArg(e,t){return function(r){return e(t(r))}}function replaceHolders(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r];a!==t&&a!==s||(e[r]=s,o[i++]=r)}return o}function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function setToPairs(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function stringSize(e){return hasUnicode(e)?function unicodeSize(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):Rt(e)}function stringToArray(e){return hasUnicode(e)?function unicodeToArray(e){return e.match(tt)||[]}(e):function asciiToArray(e){return e.split("")}(e)}function trimmedEndIndex(e){for(var t=e.length;t--&&ce.test(e.charAt(t)););return t}var Lt=basePropertyOf({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Mt=function runInContext(e){var t,r=(e=null==e?ht:Mt.defaults(ht.Object(),e,Mt.pick(ht,ot))).Array,n=e.Date,ce=e.Error,Oe=e.Function,Re=e.Math,Ie=e.Object,Ee=e.RegExp,Le=e.String,Me=e.TypeError,Ae=r.prototype,De=Oe.prototype,Pe=Ie.prototype,je=e["__core-js_shared__"],ke=De.toString,xe=Pe.hasOwnProperty,Fe=0,Ne=(t=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",ze=Pe.toString,Be=ke.call(Ie),Ue=ht._,qe=Ee("^"+ke.call(xe).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=mt?e.Buffer:i,Ve=e.Symbol,Ge=e.Uint8Array,Ke=We?We.allocUnsafe:i,$e=overArg(Ie.getPrototypeOf,Ie),He=Ie.create,Je=Pe.propertyIsEnumerable,Ze=Ae.splice,Ye=Ve?Ve.isConcatSpreadable:i,Qe=Ve?Ve.iterator:i,tt=Ve?Ve.toStringTag:i,nt=function(){try{var e=getNative(Ie,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=e.clearTimeout!==ht.clearTimeout&&e.clearTimeout,ft=n&&n.now!==ht.Date.now&&n.now,dt=e.setTimeout!==ht.setTimeout&&e.setTimeout,gt=Re.ceil,yt=Re.floor,vt=Ie.getOwnPropertySymbols,wt=We?We.isBuffer:i,Rt=e.isFinite,At=Ae.join,Dt=overArg(Ie.keys,Ie),Pt=Re.max,jt=Re.min,kt=n.now,xt=e.parseInt,Ft=Re.random,Nt=Ae.reverse,zt=getNative(e,"DataView"),Bt=getNative(e,"Map"),Ut=getNative(e,"Promise"),qt=getNative(e,"Set"),Wt=getNative(e,"WeakMap"),Vt=getNative(Ie,"create"),Gt=Wt&&new Wt,Kt={},$t=toSource(zt),Ht=toSource(Bt),Jt=toSource(Ut),Zt=toSource(qt),Yt=toSource(Wt),Qt=Ve?Ve.prototype:i,Xt=Qt?Qt.valueOf:i,er=Qt?Qt.toString:i;function lodash(e){if(isObjectLike(e)&&!on(e)&&!(e instanceof LazyWrapper)){if(e instanceof LodashWrapper)return e;if(xe.call(e,"__wrapped__"))return wrapperClone(e)}return new LodashWrapper(e)}var tr=function(){function object(){}return function(e){if(!isObject(e))return{};if(He)return He(e);object.prototype=e;var t=new object;return object.prototype=i,t}}();function baseLodash(){}function LodashWrapper(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function LazyWrapper(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayLikeKeys(e,t){var r=on(e),n=!r&&nn(e),i=!r&&!n&&sn(e),o=!r&&!n&&!i&&fn(e),a=r||n||i||o,s=a?baseTimes(e.length,Le):[],c=s.length;for(var l in e)!t&&!xe.call(e,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||isIndex(l,c))||s.push(l);return s}function arraySample(e){var t=e.length;return t?e[baseRandom(0,t-1)]:i}function arraySampleSize(e,t){return shuffleSelf(copyArray(e),baseClamp(t,0,e.length))}function arrayShuffle(e){return shuffleSelf(copyArray(e))}function assignMergeValue(e,t,r){(r!==i&&!eq(e[t],r)||r===i&&!(t in e))&&baseAssignValue(e,t,r)}function assignValue(e,t,r){var n=e[t];xe.call(e,t)&&eq(n,r)&&(r!==i||t in e)||baseAssignValue(e,t,r)}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseAggregator(e,t,r,n){return rr(e,(function(e,i,o){t(n,e,r(e),o)})),n}function baseAssign(e,t){return e&©Object(t,keys(t),e)}function baseAssignValue(e,t,r){"__proto__"==t&&nt?nt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function baseAt(e,t){for(var n=-1,o=t.length,a=r(o),s=null==e;++n<o;)a[n]=s?i:get(e,t[n]);return a}function baseClamp(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function baseClone(e,t,r,n,o,a){var s,c=1&t,l=2&t,u=4&t;if(r&&(s=o?r(e,n,o,a):r(e)),s!==i)return s;if(!isObject(e))return e;var p=on(e);if(p){if(s=function initCloneArray(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return copyArray(e,s)}else{var d=hr(e),h=d==T||d==O;if(sn(e))return cloneBuffer(e,c);if(d==E||d==w||h&&!o){if(s=l||h?{}:initCloneObject(e),!c)return l?function copySymbolsIn(e,t){return copyObject(e,dr(e),t)}(e,function baseAssignIn(e,t){return e&©Object(t,keysIn(t),e)}(s,e)):function copySymbols(e,t){return copyObject(e,fr(e),t)}(e,baseAssign(s,e))}else{if(!ct[d])return o?e:{};s=function initCloneByTag(e,t,r){var n=e.constructor;switch(t){case k:return cloneArrayBuffer(e);case C:case _:return new n(+e);case x:return function cloneDataView(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case F:case N:case z:case B:case U:case q:case W:case V:case G:return cloneTypedArray(e,r);case R:return new n;case I:case D:return new n(e);case M:return function cloneRegExp(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new n;case P:return function cloneSymbol(e){return Xt?Ie(Xt.call(e)):{}}(e)}}(e,d,c)}}a||(a=new Stack);var g=a.get(e);if(g)return g;a.set(e,s),pn(e)?e.forEach((function(n){s.add(baseClone(n,t,r,n,e,a))})):ln(e)&&e.forEach((function(n,i){s.set(i,baseClone(n,t,r,i,e,a))}));var y=p?i:(u?l?getAllKeysIn:getAllKeys:l?keysIn:keys)(e);return arrayEach(y||e,(function(n,i){y&&(n=e[i=n]),assignValue(s,i,baseClone(n,t,r,i,e,a))})),s}function baseConformsTo(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ie(e);n--;){var o=r[n],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function baseDelay(e,t,r){if("function"!=typeof e)throw new Me(o);return mr((function(){e.apply(i,r)}),t)}function baseDifference(e,t,r,n){var i=-1,o=arrayIncludes,a=!0,s=e.length,c=[],l=t.length;if(!s)return c;r&&(t=arrayMap(t,baseUnary(r))),n?(o=arrayIncludesWith,a=!1):t.length>=200&&(o=cacheHas,a=!1,t=new SetCache(t));e:for(;++i<s;){var u=e[i],p=null==r?u:r(u);if(u=n||0!==u?u:0,a&&p==p){for(var d=l;d--;)if(t[d]===p)continue e;c.push(u)}else o(t,p,n)||c.push(u)}return c}lodash.templateSettings={escape:X,evaluate:ee,interpolate:te,variable:"",imports:{_:lodash}},lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=tr(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=tr(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=function hashClear(){this.__data__=Vt?Vt(null):{},this.size=0},Hash.prototype.delete=function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hash.prototype.get=function hashGet(e){var t=this.__data__;if(Vt){var r=t[e];return r===a?i:r}return xe.call(t,e)?t[e]:i},Hash.prototype.has=function hashHas(e){var t=this.__data__;return Vt?t[e]!==i:xe.call(t,e)},Hash.prototype.set=function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Vt&&t===i?a:t,this},ListCache.prototype.clear=function listCacheClear(){this.__data__=[],this.size=0},ListCache.prototype.delete=function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ze.call(t,r,1),--this.size,!0)},ListCache.prototype.get=function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?i:t[r][1]},ListCache.prototype.has=function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1},ListCache.prototype.set=function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},MapCache.prototype.clear=function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Bt||ListCache),string:new Hash}},MapCache.prototype.delete=function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t},MapCache.prototype.get=function mapCacheGet(e){return getMapData(this,e).get(e)},MapCache.prototype.has=function mapCacheHas(e){return getMapData(this,e).has(e)},MapCache.prototype.set=function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},SetCache.prototype.add=SetCache.prototype.push=function setCacheAdd(e){return this.__data__.set(e,a),this},SetCache.prototype.has=function setCacheHas(e){return this.__data__.has(e)},Stack.prototype.clear=function stackClear(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Stack.prototype.get=function stackGet(e){return this.__data__.get(e)},Stack.prototype.has=function stackHas(e){return this.__data__.has(e)},Stack.prototype.set=function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var n=r.__data__;if(!Bt||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(n)}return r.set(e,t),this.size=r.size,this};var rr=createBaseEach(baseForOwn),nr=createBaseEach(baseForOwnRight,!0);function baseEvery(e,t){var r=!0;return rr(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function baseExtremum(e,t,r){for(var n=-1,o=e.length;++n<o;){var a=e[n],s=t(a);if(null!=s&&(c===i?s==s&&!isSymbol(s):r(s,c)))var c=s,l=a}return l}function baseFilter(e,t){var r=[];return rr(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function baseFlatten(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=isFlattenable),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?baseFlatten(s,t-1,r,n,i):arrayPush(i,s):n||(i[i.length]=s)}return i}var ir=createBaseFor(),or=createBaseFor(!0);function baseForOwn(e,t){return e&&ir(e,t,keys)}function baseForOwnRight(e,t){return e&&or(e,t,keys)}function baseFunctions(e,t){return arrayFilter(t,(function(t){return isFunction(e[t])}))}function baseGet(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:i}function baseGetAllKeys(e,t,r){var n=t(e);return on(e)?n:arrayPush(n,r(e))}function baseGetTag(e){return null==e?e===i?"[object Undefined]":"[object Null]":tt&&tt in Ie(e)?function getRawTag(e){var t=xe.call(e,tt),r=e[tt];try{e[tt]=i;var n=!0}catch(e){}var o=ze.call(e);n&&(t?e[tt]=r:delete e[tt]);return o}(e):function objectToString(e){return ze.call(e)}(e)}function baseGt(e,t){return e>t}function baseHas(e,t){return null!=e&&xe.call(e,t)}function baseHasIn(e,t){return null!=e&&t in Ie(e)}function baseIntersection(e,t,n){for(var o=n?arrayIncludesWith:arrayIncludes,a=e[0].length,s=e.length,c=s,l=r(s),u=1/0,p=[];c--;){var d=e[c];c&&t&&(d=arrayMap(d,baseUnary(t))),u=jt(d.length,u),l[c]=!n&&(t||a>=120&&d.length>=120)?new SetCache(c&&d):i}d=e[0];var h=-1,g=l[0];e:for(;++h<a&&p.length<u;){var y=d[h],m=t?t(y):y;if(y=n||0!==y?y:0,!(g?cacheHas(g,m):o(p,m,n))){for(c=s;--c;){var v=l[c];if(!(v?cacheHas(v,m):o(e[c],m,n)))continue e}g&&g.push(m),p.push(y)}}return p}function baseInvoke(e,t,r){var n=null==(e=parent(e,t=castPath(t,e)))?e:e[toKey(last(t))];return null==n?i:apply(n,e,r)}function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==w}function baseIsEqual(e,t,r,n,o){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:function baseIsEqualDeep(e,t,r,n,o,a){var s=on(e),c=on(t),l=s?b:hr(e),u=c?b:hr(t),p=(l=l==w?E:l)==E,d=(u=u==w?E:u)==E,h=l==u;if(h&&sn(e)){if(!sn(t))return!1;s=!0,p=!1}if(h&&!p)return a||(a=new Stack),s||fn(e)?equalArrays(e,t,r,n,o,a):function equalByTag(e,t,r,n,i,o,a){switch(r){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!o(new Ge(e),new Ge(t)));case C:case _:case I:return eq(+e,+t);case S:return e.name==t.name&&e.message==t.message;case M:case D:return e==t+"";case R:var s=mapToArray;case A:var c=1&n;if(s||(s=setToArray),e.size!=t.size&&!c)return!1;var l=a.get(e);if(l)return l==t;n|=2,a.set(e,t);var u=equalArrays(s(e),s(t),n,i,o,a);return a.delete(e),u;case P:if(Xt)return Xt.call(e)==Xt.call(t)}return!1}(e,t,l,r,n,o,a);if(!(1&r)){var g=p&&xe.call(e,"__wrapped__"),y=d&&xe.call(t,"__wrapped__");if(g||y){var m=g?e.value():e,v=y?t.value():t;return a||(a=new Stack),o(m,v,r,n,a)}}if(!h)return!1;return a||(a=new Stack),function equalObjects(e,t,r,n,o,a){var s=1&r,c=getAllKeys(e),l=c.length,u=getAllKeys(t).length;if(l!=u&&!s)return!1;var p=l;for(;p--;){var d=c[p];if(!(s?d in t:xe.call(t,d)))return!1}var h=a.get(e),g=a.get(t);if(h&&g)return h==t&&g==e;var y=!0;a.set(e,t),a.set(t,e);var m=s;for(;++p<l;){var v=e[d=c[p]],w=t[d];if(n)var b=s?n(w,v,d,t,e,a):n(v,w,d,e,t,a);if(!(b===i?v===w||o(v,w,r,n,a):b)){y=!1;break}m||(m="constructor"==d)}if(y&&!m){var C=e.constructor,_=t.constructor;C==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof C&&C instanceof C&&"function"==typeof _&&_ instanceof _||(y=!1)}return a.delete(e),a.delete(t),y}(e,t,r,n,o,a)}(e,t,r,n,baseIsEqual,o))}function baseIsMatch(e,t,r,n){var o=r.length,a=o,s=!n;if(null==e)return!a;for(e=Ie(e);o--;){var c=r[o];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<a;){var l=(c=r[o])[0],u=e[l],p=c[1];if(s&&c[2]){if(u===i&&!(l in e))return!1}else{var d=new Stack;if(n)var h=n(u,p,l,e,t,d);if(!(h===i?baseIsEqual(p,u,3,n,d):h))return!1}}return!0}function baseIsNative(e){return!(!isObject(e)||function isMasked(e){return!!Ne&&Ne in e}(e))&&(isFunction(e)?qe:we).test(toSource(e))}function baseIteratee(e){return"function"==typeof e?e:null==e?identity:"object"==typeof e?on(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function baseKeys(e){if(!isPrototype(e))return Dt(e);var t=[];for(var r in Ie(e))xe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function baseKeysIn(e){if(!isObject(e))return function nativeKeysIn(e){var t=[];if(null!=e)for(var r in Ie(e))t.push(r);return t}(e);var t=isPrototype(e),r=[];for(var n in e)("constructor"!=n||!t&&xe.call(e,n))&&r.push(n);return r}function baseLt(e,t){return e<t}function baseMap(e,t){var n=-1,i=isArrayLike(e)?r(e.length):[];return rr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function baseMatches(e){var t=getMatchData(e);return 1==t.length&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||baseIsMatch(r,e,t)}}function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(r){var n=get(r,e);return n===i&&n===t?hasIn(r,e):baseIsEqual(t,n,3)}}function baseMerge(e,t,r,n,o){e!==t&&ir(t,(function(a,s){if(o||(o=new Stack),isObject(a))!function baseMergeDeep(e,t,r,n,o,a,s){var c=safeGet(e,r),l=safeGet(t,r),u=s.get(l);if(u)return void assignMergeValue(e,r,u);var p=a?a(c,l,r+"",e,t,s):i,d=p===i;if(d){var h=on(l),g=!h&&sn(l),y=!h&&!g&&fn(l);p=l,h||g||y?on(c)?p=c:isArrayLikeObject(c)?p=copyArray(c):g?(d=!1,p=cloneBuffer(l,!0)):y?(d=!1,p=cloneTypedArray(l,!0)):p=[]:isPlainObject(l)||nn(l)?(p=c,nn(c)?p=toPlainObject(c):isObject(c)&&!isFunction(c)||(p=initCloneObject(l))):d=!1}d&&(s.set(l,p),o(p,l,n,a,s),s.delete(l));assignMergeValue(e,r,p)}(e,t,s,r,baseMerge,n,o);else{var c=n?n(safeGet(e,s),a,s+"",e,t,o):i;c===i&&(c=a),assignMergeValue(e,s,c)}}),keysIn)}function baseNth(e,t){var r=e.length;if(r)return isIndex(t+=t<0?r:0,r)?e[t]:i}function baseOrderBy(e,t,r){t=t.length?arrayMap(t,(function(e){return on(e)?function(t){return baseGet(t,1===e.length?e[0]:e)}:e})):[identity];var n=-1;t=arrayMap(t,baseUnary(getIteratee()));var i=baseMap(e,(function(e,r,i){var o=arrayMap(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function baseSortBy(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function compareMultiple(e,t,r){var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;for(;++n<a;){var c=compareAscending(i[n],o[n]);if(c)return n>=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function basePickBy(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=baseGet(e,a);r(s,a)&&baseSet(o,castPath(a,e),s)}return o}function basePullAll(e,t,r,n){var i=n?baseIndexOfWith:baseIndexOf,o=-1,a=t.length,s=e;for(e===t&&(t=copyArray(t)),r&&(s=arrayMap(e,baseUnary(r)));++o<a;)for(var c=0,l=t[o],u=r?r(l):l;(c=i(s,u,c,n))>-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function basePullAt(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;isIndex(i)?Ze.call(e,i,1):baseUnset(e,i)}}return e}function baseRandom(e,t){return e+yt(Ft()*(t-e+1))}function baseRepeat(e,t){var r="";if(!e||t<1||t>g)return r;do{t%2&&(r+=e),(t=yt(t/2))&&(e+=e)}while(t);return r}function baseRest(e,t){return vr(overRest(e,t,identity),e+"")}function baseSample(e){return arraySample(values(e))}function baseSampleSize(e,t){var r=values(e);return shuffleSelf(r,baseClamp(t,0,r.length))}function baseSet(e,t,r,n){if(!isObject(e))return e;for(var o=-1,a=(t=castPath(t,e)).length,s=a-1,c=e;null!=c&&++o<a;){var l=toKey(t[o]),u=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=s){var p=c[l];(u=n?n(p,l,c):i)===i&&(u=isObject(p)?p:isIndex(t[o+1])?[]:{})}assignValue(c,l,u),c=c[l]}return e}var ar=Gt?function(e,t){return Gt.set(e,t),e}:identity,sr=nt?function(e,t){return nt(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity;function baseShuffle(e){return shuffleSelf(values(e))}function baseSlice(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function baseSome(e,t){var r;return rr(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function baseSortedIndex(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!isSymbol(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return baseSortedIndexBy(e,t,identity,r)}function baseSortedIndexBy(e,t,r,n){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,c=null===t,l=isSymbol(t),u=t===i;o<a;){var p=yt((o+a)/2),d=r(e[p]),h=d!==i,g=null===d,y=d==d,m=isSymbol(d);if(s)var v=n||y;else v=u?y&&(n||h):c?y&&h&&(n||!g):l?y&&h&&!g&&(n||!m):!g&&!m&&(n?d<=t:d<t);v?o=p+1:a=p}return jt(a,4294967294)}function baseSortedUniq(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!eq(s,c)){var c=s;o[i++]=0===a?0:a}}return o}function baseToNumber(e){return"number"==typeof e?e:isSymbol(e)?y:+e}function baseToString(e){if("string"==typeof e)return e;if(on(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return er?er.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseUniq(e,t,r){var n=-1,i=arrayIncludes,o=e.length,a=!0,s=[],c=s;if(r)a=!1,i=arrayIncludesWith;else if(o>=200){var l=t?null:ur(e);if(l)return setToArray(l);a=!1,i=cacheHas,c=new SetCache}else c=t?[]:s;e:for(;++n<o;){var u=e[n],p=t?t(u):u;if(u=r||0!==u?u:0,a&&p==p){for(var d=c.length;d--;)if(c[d]===p)continue e;t&&c.push(p),s.push(u)}else i(c,p,r)||(c!==s&&c.push(p),s.push(u))}return s}function baseUnset(e,t){return null==(e=parent(e,t=castPath(t,e)))||delete e[toKey(last(t))]}function baseUpdate(e,t,r,n){return baseSet(e,t,r(baseGet(e,t)),n)}function baseWhile(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?baseSlice(e,n?0:o,n?o+1:i):baseSlice(e,n?o+1:0,n?i:o)}function baseWrapperValue(e,t){var r=e;return r instanceof LazyWrapper&&(r=r.value()),arrayReduce(t,(function(e,t){return t.func.apply(t.thisArg,arrayPush([e],t.args))}),r)}function baseXor(e,t,n){var i=e.length;if(i<2)return i?baseUniq(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],c=-1;++c<i;)c!=o&&(a[o]=baseDifference(a[o]||s,e[c],t,n));return baseUniq(baseFlatten(a,1),t,n)}function baseZipObject(e,t,r){for(var n=-1,o=e.length,a=t.length,s={};++n<o;){var c=n<a?t[n]:i;r(s,e[n],c)}return s}function castArrayLikeObject(e){return isArrayLikeObject(e)?e:[]}function castFunction(e){return"function"==typeof e?e:identity}function castPath(e,t){return on(e)?e:isKey(e,t)?[e]:wr(toString(e))}var cr=baseRest;function castSlice(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:baseSlice(e,t,r)}var lr=lt||function(e){return ht.clearTimeout(e)};function cloneBuffer(e,t){if(t)return e.slice();var r=e.length,n=Ke?Ke(r):new e.constructor(r);return e.copy(n),n}function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function compareAscending(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,a=isSymbol(e),s=t!==i,c=null===t,l=t==t,u=isSymbol(t);if(!c&&!u&&!a&&e>t||a&&s&&l&&!c&&!u||n&&s&&l||!r&&l||!o)return 1;if(!n&&!a&&!u&&e<t||u&&r&&o&&!n&&!a||c&&r&&o||!s&&o||!l)return-1}return 0}function composeArgs(e,t,n,i){for(var o=-1,a=e.length,s=n.length,c=-1,l=t.length,u=Pt(a-s,0),p=r(l+u),d=!i;++c<l;)p[c]=t[c];for(;++o<s;)(d||o<a)&&(p[n[o]]=e[o]);for(;u--;)p[c++]=e[o++];return p}function composeArgsRight(e,t,n,i){for(var o=-1,a=e.length,s=-1,c=n.length,l=-1,u=t.length,p=Pt(a-c,0),d=r(p+u),h=!i;++o<p;)d[o]=e[o];for(var g=o;++l<u;)d[g+l]=t[l];for(;++s<c;)(h||o<a)&&(d[g+n[s]]=e[o++]);return d}function copyArray(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function copyObject(e,t,r,n){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var c=t[a],l=n?n(r[c],e[c],c,r,e):i;l===i&&(l=e[c]),o?baseAssignValue(r,c,l):assignValue(r,c,l)}return r}function createAggregator(e,t){return function(r,n){var i=on(r)?arrayAggregator:baseAggregator,o=t?t():{};return i(r,e,getIteratee(n,2),o)}}function createAssigner(e){return baseRest((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:i,s=o>2?r[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&isIterateeCall(r[0],r[1],s)&&(a=o<3?i:a,o=1),t=Ie(t);++n<o;){var c=r[n];c&&e(t,c,n,a)}return t}))}function createBaseEach(e,t){return function(r,n){if(null==r)return r;if(!isArrayLike(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Ie(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function createBaseFor(e){return function(t,r,n){for(var i=-1,o=Ie(t),a=n(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===r(o[c],c,o))break}return t}}function createCaseFirst(e){return function(t){var r=hasUnicode(t=toString(t))?stringToArray(t):i,n=r?r[0]:t.charAt(0),o=r?castSlice(r,1).join(""):t.slice(1);return n[e]()+o}}function createCompounder(e){return function(t){return arrayReduce(words(deburr(t).replace(Xe,"")),e,"")}}function createCtor(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=tr(e.prototype),n=e.apply(r,t);return isObject(n)?n:r}}function createFind(e){return function(t,r,n){var o=Ie(t);if(!isArrayLike(t)){var a=getIteratee(r,3);t=keys(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,n);return s>-1?o[a?t[s]:s]:i}}function createFlow(e){return flatRest((function(t){var r=t.length,n=r,a=LodashWrapper.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new Me(o);if(a&&!c&&"wrapper"==getFuncName(s))var c=new LodashWrapper([],!0)}for(n=c?n:r;++n<r;){var l=getFuncName(s=t[n]),u="wrapper"==l?pr(s):i;c=u&&isLaziable(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[getFuncName(u[0])].apply(c,u[3]):1==s.length&&isLaziable(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&1==e.length&&on(n))return c.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function createHybrid(e,t,n,o,a,s,c,l,u,d){var h=t&p,g=1&t,y=2&t,m=24&t,v=512&t,w=y?i:createCtor(e);return function wrapper(){for(var i=arguments.length,p=r(i),b=i;b--;)p[b]=arguments[b];if(m)var C=getHolder(wrapper),_=countHolders(p,C);if(o&&(p=composeArgs(p,o,a,m)),s&&(p=composeArgsRight(p,s,c,m)),i-=_,m&&i<d){var S=replaceHolders(p,C);return createRecurry(e,t,createHybrid,wrapper.placeholder,n,p,S,l,u,d-i)}var T=g?n:this,O=y?T[e]:e;return i=p.length,l?p=reorder(p,l):v&&i>1&&p.reverse(),h&&u<i&&(p.length=u),this&&this!==ht&&this instanceof wrapper&&(O=w||createCtor(O)),O.apply(T,p)}}function createInverter(e,t){return function(r,n){return function baseInverter(e,t,r,n){return baseForOwn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function createMathOperation(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=baseToString(r),n=baseToString(n)):(r=baseToNumber(r),n=baseToNumber(n)),o=e(r,n)}return o}}function createOver(e){return flatRest((function(t){return t=arrayMap(t,baseUnary(getIteratee())),baseRest((function(r){var n=this;return e(t,(function(e){return apply(e,n,r)}))}))}))}function createPadding(e,t){var r=(t=t===i?" ":baseToString(t)).length;if(r<2)return r?baseRepeat(t,e):t;var n=baseRepeat(t,gt(e/stringSize(t)));return hasUnicode(t)?castSlice(stringToArray(n),0,e).join(""):n.slice(0,e)}function createRange(e){return function(t,n,o){return o&&"number"!=typeof o&&isIterateeCall(t,n,o)&&(n=o=i),t=toFinite(t),n===i?(n=t,t=0):n=toFinite(n),function baseRange(e,t,n,i){for(var o=-1,a=Pt(gt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,o=o===i?t<n?1:-1:toFinite(o),e)}}function createRelationalOperation(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=toNumber(t),r=toNumber(r)),e(t,r)}}function createRecurry(e,t,r,n,o,a,s,c,p,d){var h=8&t;t|=h?l:u,4&(t&=~(h?u:l))||(t&=-4);var g=[e,t,o,h?a:i,h?s:i,h?i:a,h?i:s,c,p,d],y=r.apply(i,g);return isLaziable(e)&&yr(y,g),y.placeholder=n,setWrapToString(y,e,t)}function createRound(e){var t=Re[e];return function(e,r){if(e=toNumber(e),(r=null==r?0:jt(toInteger(r),292))&&Rt(e)){var n=(toString(e)+"e").split("e");return+((n=(toString(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var ur=qt&&1/setToArray(new qt([,-0]))[1]==h?function(e){return new qt(e)}:noop;function createToPairs(e){return function(t){var r=hr(t);return r==R?mapToArray(t):r==A?setToPairs(t):function baseToPairs(e,t){return arrayMap(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function createWrap(e,t,n,a,h,g,y,m){var v=2&t;if(!v&&"function"!=typeof e)throw new Me(o);var w=a?a.length:0;if(w||(t&=-97,a=h=i),y=y===i?y:Pt(toInteger(y),0),m=m===i?m:toInteger(m),w-=h?h.length:0,t&u){var b=a,C=h;a=h=i}var _=v?i:pr(e),S=[e,t,n,a,h,b,C,g,y,m];if(_&&function mergeData(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,a=n==p&&8==r||n==p&&r==d&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!a)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var l=e[3];e[3]=l?composeArgs(l,c,t[4]):c,e[4]=l?replaceHolders(e[3],s):t[4]}(c=t[5])&&(l=e[5],e[5]=l?composeArgsRight(l,c,t[6]):c,e[6]=l?replaceHolders(e[5],s):t[6]);(c=t[7])&&(e[7]=c);n&p&&(e[8]=null==e[8]?t[8]:jt(e[8],t[8]));null==e[9]&&(e[9]=t[9]);return e[0]=t[0],e[1]=i,e}(S,_),e=S[0],t=S[1],n=S[2],a=S[3],h=S[4],!(m=S[9]=S[9]===i?v?0:e.length:Pt(S[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)T=8==t||t==c?function createCurry(e,t,n){var o=createCtor(e);return function wrapper(){for(var a=arguments.length,s=r(a),c=a,l=getHolder(wrapper);c--;)s[c]=arguments[c];var u=a<3&&s[0]!==l&&s[a-1]!==l?[]:replaceHolders(s,l);return(a-=u.length)<n?createRecurry(e,t,createHybrid,wrapper.placeholder,i,s,u,i,i,n-a):apply(this&&this!==ht&&this instanceof wrapper?o:e,this,s)}}(e,t,m):t!=l&&33!=t||h.length?createHybrid.apply(i,S):function createPartial(e,t,n,i){var o=1&t,a=createCtor(e);return function wrapper(){for(var t=-1,s=arguments.length,c=-1,l=i.length,u=r(l+s),p=this&&this!==ht&&this instanceof wrapper?a:e;++c<l;)u[c]=i[c];for(;s--;)u[c++]=arguments[++t];return apply(p,o?n:this,u)}}(e,t,n,a);else var T=function createBind(e,t,r){var n=1&t,i=createCtor(e);return function wrapper(){return(this&&this!==ht&&this instanceof wrapper?i:e).apply(n?r:this,arguments)}}(e,t,n);return setWrapToString((_?ar:yr)(T,S),e,t)}function customDefaultsAssignIn(e,t,r,n){return e===i||eq(e,Pe[r])&&!xe.call(n,r)?t:e}function customDefaultsMerge(e,t,r,n,o,a){return isObject(e)&&isObject(t)&&(a.set(t,e),baseMerge(e,t,i,customDefaultsMerge,a),a.delete(t)),e}function customOmitClone(e){return isPlainObject(e)?i:e}function equalArrays(e,t,r,n,o,a){var s=1&r,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=a.get(e),p=a.get(t);if(u&&p)return u==t&&p==e;var d=-1,h=!0,g=2&r?new SetCache:i;for(a.set(e,t),a.set(t,e);++d<c;){var y=e[d],m=t[d];if(n)var v=s?n(m,y,d,t,e,a):n(y,m,d,e,t,a);if(v!==i){if(v)continue;h=!1;break}if(g){if(!arraySome(t,(function(e,t){if(!cacheHas(g,t)&&(y===e||o(y,e,r,n,a)))return g.push(t)}))){h=!1;break}}else if(y!==m&&!o(y,m,r,n,a)){h=!1;break}}return a.delete(e),a.delete(t),h}function flatRest(e){return vr(overRest(e,i,flatten),e+"")}function getAllKeys(e){return baseGetAllKeys(e,keys,fr)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,dr)}var pr=Gt?function(e){return Gt.get(e)}:noop;function getFuncName(e){for(var t=e.name+"",r=Kt[t],n=xe.call(Kt,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function getHolder(e){return(xe.call(lodash,"placeholder")?lodash:e).placeholder}function getIteratee(){var e=lodash.iteratee||iteratee;return e=e===iteratee?baseIteratee:e,arguments.length?e(arguments[0],arguments[1]):e}function getMapData(e,t){var r=e.__data__;return function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function getMatchData(e){for(var t=keys(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,isStrictComparable(i)]}return t}function getNative(e,t){var r=function getValue(e,t){return null==e?i:e[t]}(e,t);return baseIsNative(r)?r:i}var fr=vt?function(e){return null==e?[]:(e=Ie(e),arrayFilter(vt(e),(function(t){return Je.call(e,t)})))}:stubArray,dr=vt?function(e){for(var t=[];e;)arrayPush(t,fr(e)),e=$e(e);return t}:stubArray,hr=baseGetTag;function hasPath(e,t,r){for(var n=-1,i=(t=castPath(t,e)).length,o=!1;++n<i;){var a=toKey(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&isLength(i)&&isIndex(a,i)&&(on(e)||nn(e))}function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:tr($e(e))}function isFlattenable(e){return on(e)||nn(e)||!!(Ye&&e&&e[Ye])}function isIndex(e,t){var r=typeof e;return!!(t=null==t?g:t)&&("number"==r||"symbol"!=r&&Ce.test(e))&&e>-1&&e%1==0&&e<t}function isIterateeCall(e,t,r){if(!isObject(r))return!1;var n=typeof t;return!!("number"==n?isArrayLike(r)&&isIndex(t,r.length):"string"==n&&t in r)&&eq(r[t],e)}function isKey(e,t){if(on(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(ne.test(e)||!re.test(e)||null!=t&&e in Ie(t))}function isLaziable(e){var t=getFuncName(e),r=lodash[t];if("function"!=typeof r||!(t in LazyWrapper.prototype))return!1;if(e===r)return!0;var n=pr(r);return!!n&&e===n[0]}(zt&&hr(new zt(new ArrayBuffer(1)))!=x||Bt&&hr(new Bt)!=R||Ut&&hr(Ut.resolve())!=L||qt&&hr(new qt)!=A||Wt&&hr(new Wt)!=j)&&(hr=function(e){var t=baseGetTag(e),r=t==E?e.constructor:i,n=r?toSource(r):"";if(n)switch(n){case $t:return x;case Ht:return R;case Jt:return L;case Zt:return A;case Yt:return j}return t});var gr=je?isFunction:stubFalse;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)}function isStrictComparable(e){return e==e&&!isObject(e)}function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==i||e in Ie(r)))}}function overRest(e,t,n){return t=Pt(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=Pt(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var c=r(t+1);++o<t;)c[o]=i[o];return c[t]=n(s),apply(e,this,c)}}function parent(e,t){return t.length<2?e:baseGet(e,baseSlice(t,0,-1))}function reorder(e,t){for(var r=e.length,n=jt(t.length,r),o=copyArray(e);n--;){var a=t[n];e[n]=isIndex(a,r)?o[a]:i}return e}function safeGet(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var yr=shortOut(ar),mr=dt||function(e,t){return ht.setTimeout(e,t)},vr=shortOut(sr);function setWrapToString(e,t,r){var n=t+"";return vr(e,function insertWrapDetails(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(n,function updateWrapDetails(e,t){return arrayEach(v,(function(r){var n="_."+r[0];t&r[1]&&!arrayIncludes(e,n)&&e.push(n)})),e.sort()}(function getWrapDetails(e){var t=e.match(ue);return t?t[1].split(pe):[]}(n),r)))}function shortOut(e){var t=0,r=0;return function(){var n=kt(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function shuffleSelf(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var a=baseRandom(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var wr=function memoizeCapped(e){var t=memoize(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ie,(function(e,r,n,i){t.push(n?i.replace(he,"$1"):r||e)})),t}));function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toSource(e){if(null!=e){try{return ke.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function wrapperClone(e){if(e instanceof LazyWrapper)return e.clone();var t=new LodashWrapper(e.__wrapped__,e.__chain__);return t.__actions__=copyArray(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var br=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0)):[]})),Cr=baseRest((function(e,t){var r=last(t);return isArrayLikeObject(r)&&(r=i),isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0),getIteratee(r,2)):[]})),_r=baseRest((function(e,t){var r=last(t);return isArrayLikeObject(r)&&(r=i),isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0),i,r):[]}));function findIndex(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:toInteger(r);return i<0&&(i=Pt(n+i,0)),baseFindIndex(e,getIteratee(t,3),i)}function findLastIndex(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=toInteger(r),o=r<0?Pt(n+o,0):jt(o,n-1)),baseFindIndex(e,getIteratee(t,3),o,!0)}function flatten(e){return(null==e?0:e.length)?baseFlatten(e,1):[]}function head(e){return e&&e.length?e[0]:i}var Sr=baseRest((function(e){var t=arrayMap(e,castArrayLikeObject);return t.length&&t[0]===e[0]?baseIntersection(t):[]})),Tr=baseRest((function(e){var t=last(e),r=arrayMap(e,castArrayLikeObject);return t===last(r)?t=i:r.pop(),r.length&&r[0]===e[0]?baseIntersection(r,getIteratee(t,2)):[]})),Or=baseRest((function(e){var t=last(e),r=arrayMap(e,castArrayLikeObject);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?baseIntersection(r,i,t):[]}));function last(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Rr=baseRest(pullAll);function pullAll(e,t){return e&&e.length&&t&&t.length?basePullAll(e,t):e}var Ir=flatRest((function(e,t){var r=null==e?0:e.length,n=baseAt(e,t);return basePullAt(e,arrayMap(t,(function(e){return isIndex(e,r)?+e:e})).sort(compareAscending)),n}));function reverse(e){return null==e?e:Nt.call(e)}var Er=baseRest((function(e){return baseUniq(baseFlatten(e,1,isArrayLikeObject,!0))})),Lr=baseRest((function(e){var t=last(e);return isArrayLikeObject(t)&&(t=i),baseUniq(baseFlatten(e,1,isArrayLikeObject,!0),getIteratee(t,2))})),Mr=baseRest((function(e){var t=last(e);return t="function"==typeof t?t:i,baseUniq(baseFlatten(e,1,isArrayLikeObject,!0),i,t)}));function unzip(e){if(!e||!e.length)return[];var t=0;return e=arrayFilter(e,(function(e){if(isArrayLikeObject(e))return t=Pt(e.length,t),!0})),baseTimes(t,(function(t){return arrayMap(e,baseProperty(t))}))}function unzipWith(e,t){if(!e||!e.length)return[];var r=unzip(e);return null==t?r:arrayMap(r,(function(e){return apply(t,i,e)}))}var Ar=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,t):[]})),Dr=baseRest((function(e){return baseXor(arrayFilter(e,isArrayLikeObject))})),Pr=baseRest((function(e){var t=last(e);return isArrayLikeObject(t)&&(t=i),baseXor(arrayFilter(e,isArrayLikeObject),getIteratee(t,2))})),jr=baseRest((function(e){var t=last(e);return t="function"==typeof t?t:i,baseXor(arrayFilter(e,isArrayLikeObject),i,t)})),kr=baseRest(unzip);var xr=baseRest((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,unzipWith(e,r)}));function chain(e){var t=lodash(e);return t.__chain__=!0,t}function thru(e,t){return t(e)}var Fr=flatRest((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,interceptor=function(t){return baseAt(t,e)};return!(t>1||this.__actions__.length)&&n instanceof LazyWrapper&&isIndex(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:thru,args:[interceptor],thisArg:i}),new LodashWrapper(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(interceptor)}));var Nr=createAggregator((function(e,t,r){xe.call(e,r)?++e[r]:baseAssignValue(e,r,1)}));var zr=createFind(findIndex),Br=createFind(findLastIndex);function forEach(e,t){return(on(e)?arrayEach:rr)(e,getIteratee(t,3))}function forEachRight(e,t){return(on(e)?arrayEachRight:nr)(e,getIteratee(t,3))}var Ur=createAggregator((function(e,t,r){xe.call(e,r)?e[r].push(t):baseAssignValue(e,r,[t])}));var qr=baseRest((function(e,t,n){var i=-1,o="function"==typeof t,a=isArrayLike(e)?r(e.length):[];return rr(e,(function(e){a[++i]=o?apply(t,e,n):baseInvoke(e,t,n)})),a})),Wr=createAggregator((function(e,t,r){baseAssignValue(e,r,t)}));function map(e,t){return(on(e)?arrayMap:baseMap)(e,getIteratee(t,3))}var Vr=createAggregator((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Gr=baseRest((function(e,t){if(null==e)return[];var r=t.length;return r>1&&isIterateeCall(e,t[0],t[1])?t=[]:r>2&&isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),baseOrderBy(e,baseFlatten(t,1),[])})),Kr=ft||function(){return ht.Date.now()};function ary(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,createWrap(e,p,i,i,i,i,t)}function before(e,t){var r;if("function"!=typeof t)throw new Me(o);return e=toInteger(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var $r=baseRest((function(e,t,r){var n=1;if(r.length){var i=replaceHolders(r,getHolder($r));n|=l}return createWrap(e,n,t,r,i)})),Hr=baseRest((function(e,t,r){var n=3;if(r.length){var i=replaceHolders(r,getHolder(Hr));n|=l}return createWrap(t,n,e,r,i)}));function debounce(e,t,r){var n,a,s,c,l,u,p=0,d=!1,h=!1,g=!0;if("function"!=typeof e)throw new Me(o);function invokeFunc(t){var r=n,o=a;return n=a=i,p=t,c=e.apply(o,r)}function leadingEdge(e){return p=e,l=mr(timerExpired,t),d?invokeFunc(e):c}function shouldInvoke(e){var r=e-u;return u===i||r>=t||r<0||h&&e-p>=s}function timerExpired(){var e=Kr();if(shouldInvoke(e))return trailingEdge(e);l=mr(timerExpired,function remainingWait(e){var r=t-(e-u);return h?jt(r,s-(e-p)):r}(e))}function trailingEdge(e){return l=i,g&&n?invokeFunc(e):(n=a=i,c)}function debounced(){var e=Kr(),r=shouldInvoke(e);if(n=arguments,a=this,u=e,r){if(l===i)return leadingEdge(u);if(h)return lr(l),l=mr(timerExpired,t),invokeFunc(u)}return l===i&&(l=mr(timerExpired,t)),c}return t=toNumber(t)||0,isObject(r)&&(d=!!r.leading,s=(h="maxWait"in r)?Pt(toNumber(r.maxWait)||0,t):s,g="trailing"in r?!!r.trailing:g),debounced.cancel=function cancel(){l!==i&&lr(l),p=0,n=u=a=l=i},debounced.flush=function flush(){return l===i?c:trailingEdge(Kr())},debounced}var Jr=baseRest((function(e,t){return baseDelay(e,1,t)})),Zr=baseRest((function(e,t,r){return baseDelay(e,toNumber(t)||0,r)}));function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(o);var memoized=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=memoized.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return memoized.cache=i.set(n,o)||i,o};return memoized.cache=new(memoize.Cache||MapCache),memoized}function negate(e){if("function"!=typeof e)throw new Me(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}memoize.Cache=MapCache;var Yr=cr((function(e,t){var r=(t=1==t.length&&on(t[0])?arrayMap(t[0],baseUnary(getIteratee())):arrayMap(baseFlatten(t,1),baseUnary(getIteratee()))).length;return baseRest((function(n){for(var i=-1,o=jt(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return apply(e,this,n)}))})),Qr=baseRest((function(e,t){var r=replaceHolders(t,getHolder(Qr));return createWrap(e,l,i,t,r)})),Xr=baseRest((function(e,t){var r=replaceHolders(t,getHolder(Xr));return createWrap(e,u,i,t,r)})),en=flatRest((function(e,t){return createWrap(e,d,i,i,i,t)}));function eq(e,t){return e===t||e!=e&&t!=t}var tn=createRelationalOperation(baseGt),rn=createRelationalOperation((function(e,t){return e>=t})),nn=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&xe.call(e,"callee")&&!Je.call(e,"callee")},on=r.isArray,an=bt?baseUnary(bt):function baseIsArrayBuffer(e){return isObjectLike(e)&&baseGetTag(e)==k};function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}var sn=wt||stubFalse,cn=Ct?baseUnary(Ct):function baseIsDate(e){return isObjectLike(e)&&baseGetTag(e)==_};function isError(e){if(!isObjectLike(e))return!1;var t=baseGetTag(e);return t==S||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!isPlainObject(e)}function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==T||t==O||"[object AsyncFunction]"==t||"[object Proxy]"==t}function isInteger(e){return"number"==typeof e&&e==toInteger(e)}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function isObjectLike(e){return null!=e&&"object"==typeof e}var ln=_t?baseUnary(_t):function baseIsMap(e){return isObjectLike(e)&&hr(e)==R};function isNumber(e){return"number"==typeof e||isObjectLike(e)&&baseGetTag(e)==I}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=E)return!1;var t=$e(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ke.call(r)==Be}var un=St?baseUnary(St):function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==M};var pn=Tt?baseUnary(Tt):function baseIsSet(e){return isObjectLike(e)&&hr(e)==A};function isString(e){return"string"==typeof e||!on(e)&&isObjectLike(e)&&baseGetTag(e)==D}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&baseGetTag(e)==P}var fn=Ot?baseUnary(Ot):function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!st[baseGetTag(e)]};var dn=createRelationalOperation(baseLt),hn=createRelationalOperation((function(e,t){return e<=t}));function toArray(e){if(!e)return[];if(isArrayLike(e))return isString(e)?stringToArray(e):copyArray(e);if(Qe&&e[Qe])return function iteratorToArray(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=hr(e);return(t==R?mapToArray:t==A?setToArray:values)(e)}function toFinite(e){return e?(e=toNumber(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function toInteger(e){var t=toFinite(e),r=t%1;return t==t?r?t-r:t:0}function toLength(e){return e?baseClamp(toInteger(e),0,m):0}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return y;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=baseTrim(e);var r=ve.test(e);return r||be.test(e)?pt(e.slice(2),r?2:8):me.test(e)?y:+e}function toPlainObject(e){return copyObject(e,keysIn(e))}function toString(e){return null==e?"":baseToString(e)}var gn=createAssigner((function(e,t){if(isPrototype(t)||isArrayLike(t))copyObject(t,keys(t),e);else for(var r in t)xe.call(t,r)&&assignValue(e,r,t[r])})),yn=createAssigner((function(e,t){copyObject(t,keysIn(t),e)})),mn=createAssigner((function(e,t,r,n){copyObject(t,keysIn(t),e,n)})),vn=createAssigner((function(e,t,r,n){copyObject(t,keys(t),e,n)})),wn=flatRest(baseAt);var bn=baseRest((function(e,t){e=Ie(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&isIterateeCall(t[0],t[1],o)&&(n=1);++r<n;)for(var a=t[r],s=keysIn(a),c=-1,l=s.length;++c<l;){var u=s[c],p=e[u];(p===i||eq(p,Pe[u])&&!xe.call(e,u))&&(e[u]=a[u])}return e})),Cn=baseRest((function(e){return e.push(i,customDefaultsMerge),apply(Rn,i,e)}));function get(e,t,r){var n=null==e?i:baseGet(e,t);return n===i?r:n}function hasIn(e,t){return null!=e&&hasPath(e,t,baseHasIn)}var _n=createInverter((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ze.call(t)),e[t]=r}),constant(identity)),Sn=createInverter((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ze.call(t)),xe.call(e,t)?e[t].push(r):e[t]=[r]}),getIteratee),Tn=baseRest(baseInvoke);function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var On=createAssigner((function(e,t,r){baseMerge(e,t,r)})),Rn=createAssigner((function(e,t,r,n){baseMerge(e,t,r,n)})),In=flatRest((function(e,t){var r={};if(null==e)return r;var n=!1;t=arrayMap(t,(function(t){return t=castPath(t,e),n||(n=t.length>1),t})),copyObject(e,getAllKeysIn(e),r),n&&(r=baseClone(r,7,customOmitClone));for(var i=t.length;i--;)baseUnset(r,t[i]);return r}));var En=flatRest((function(e,t){return null==e?{}:function basePick(e,t){return basePickBy(e,t,(function(t,r){return hasIn(e,r)}))}(e,t)}));function pickBy(e,t){if(null==e)return{};var r=arrayMap(getAllKeysIn(e),(function(e){return[e]}));return t=getIteratee(t),basePickBy(e,r,(function(e,r){return t(e,r[0])}))}var Ln=createToPairs(keys),Mn=createToPairs(keysIn);function values(e){return null==e?[]:baseValues(e,keys(e))}var An=createCompounder((function(e,t,r){return t=t.toLowerCase(),e+(r?capitalize(t):t)}));function capitalize(e){return Nn(toString(e).toLowerCase())}function deburr(e){return(e=toString(e))&&e.replace(_e,It).replace(et,"")}var Dn=createCompounder((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Pn=createCompounder((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),jn=createCaseFirst("toLowerCase");var kn=createCompounder((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var xn=createCompounder((function(e,t,r){return e+(r?" ":"")+Nn(t)}));var Fn=createCompounder((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Nn=createCaseFirst("toUpperCase");function words(e,t,r){return e=toString(e),(t=r?i:t)===i?function hasUnicodeWord(e){return it.test(e)}(e)?function unicodeWords(e){return e.match(rt)||[]}(e):function asciiWords(e){return e.match(fe)||[]}(e):e.match(t)||[]}var zn=baseRest((function(e,t){try{return apply(e,i,t)}catch(e){return isError(e)?e:new ce(e)}})),Bn=flatRest((function(e,t){return arrayEach(t,(function(t){t=toKey(t),baseAssignValue(e,t,$r(e[t],e))})),e}));function constant(e){return function(){return e}}var Un=createFlow(),qn=createFlow(!0);function identity(e){return e}function iteratee(e){return baseIteratee("function"==typeof e?e:baseClone(e,1))}var Wn=baseRest((function(e,t){return function(r){return baseInvoke(r,e,t)}})),Vn=baseRest((function(e,t){return function(r){return baseInvoke(e,r,t)}}));function mixin(e,t,r){var n=keys(t),i=baseFunctions(t,n);null!=r||isObject(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=baseFunctions(t,keys(t)));var o=!(isObject(r)&&"chain"in r&&!r.chain),a=isFunction(e);return arrayEach(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__),i=r.__actions__=copyArray(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,arrayPush([this.value()],arguments))})})),e}function noop(){}var Gn=createOver(arrayMap),Kn=createOver(arrayEvery),$n=createOver(arraySome);function property(e){return isKey(e)?baseProperty(toKey(e)):function basePropertyDeep(e){return function(t){return baseGet(t,e)}}(e)}var Hn=createRange(),Jn=createRange(!0);function stubArray(){return[]}function stubFalse(){return!1}var Zn=createMathOperation((function(e,t){return e+t}),0),Yn=createRound("ceil"),Qn=createMathOperation((function(e,t){return e/t}),1),Xn=createRound("floor");var ei,ti=createMathOperation((function(e,t){return e*t}),1),ri=createRound("round"),ni=createMathOperation((function(e,t){return e-t}),0);return lodash.after=function after(e,t){if("function"!=typeof t)throw new Me(o);return e=toInteger(e),function(){if(--e<1)return t.apply(this,arguments)}},lodash.ary=ary,lodash.assign=gn,lodash.assignIn=yn,lodash.assignInWith=mn,lodash.assignWith=vn,lodash.at=wn,lodash.before=before,lodash.bind=$r,lodash.bindAll=Bn,lodash.bindKey=Hr,lodash.castArray=function castArray(){if(!arguments.length)return[];var e=arguments[0];return on(e)?e:[e]},lodash.chain=chain,lodash.chunk=function chunk(e,t,n){t=(n?isIterateeCall(e,t,n):t===i)?1:Pt(toInteger(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,c=r(gt(o/t));a<o;)c[s++]=baseSlice(e,a,a+=t);return c},lodash.compact=function compact(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},lodash.concat=function concat(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return arrayPush(on(n)?copyArray(n):[n],baseFlatten(t,1))},lodash.cond=function cond(e){var t=null==e?0:e.length,r=getIteratee();return e=t?arrayMap(e,(function(e){if("function"!=typeof e[1])throw new Me(o);return[r(e[0]),e[1]]})):[],baseRest((function(r){for(var n=-1;++n<t;){var i=e[n];if(apply(i[0],this,r))return apply(i[1],this,r)}}))},lodash.conforms=function conforms(e){return function baseConforms(e){var t=keys(e);return function(r){return baseConformsTo(r,e,t)}}(baseClone(e,1))},lodash.constant=constant,lodash.countBy=Nr,lodash.create=function create(e,t){var r=tr(e);return null==t?r:baseAssign(r,t)},lodash.curry=function curry(e,t,r){var n=createWrap(e,8,i,i,i,i,i,t=r?i:t);return n.placeholder=curry.placeholder,n},lodash.curryRight=function curryRight(e,t,r){var n=createWrap(e,c,i,i,i,i,i,t=r?i:t);return n.placeholder=curryRight.placeholder,n},lodash.debounce=debounce,lodash.defaults=bn,lodash.defaultsDeep=Cn,lodash.defer=Jr,lodash.delay=Zr,lodash.difference=br,lodash.differenceBy=Cr,lodash.differenceWith=_r,lodash.drop=function drop(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,(t=r||t===i?1:toInteger(t))<0?0:t,n):[]},lodash.dropRight=function dropRight(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,0,(t=n-(t=r||t===i?1:toInteger(t)))<0?0:t):[]},lodash.dropRightWhile=function dropRightWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!0,!0):[]},lodash.dropWhile=function dropWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!0):[]},lodash.fill=function fill(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(r=0,n=o),function baseFill(e,t,r,n){var o=e.length;for((r=toInteger(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:toInteger(n))<0&&(n+=o),n=r>n?0:toLength(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},lodash.filter=function filter(e,t){return(on(e)?arrayFilter:baseFilter)(e,getIteratee(t,3))},lodash.flatMap=function flatMap(e,t){return baseFlatten(map(e,t),1)},lodash.flatMapDeep=function flatMapDeep(e,t){return baseFlatten(map(e,t),h)},lodash.flatMapDepth=function flatMapDepth(e,t,r){return r=r===i?1:toInteger(r),baseFlatten(map(e,t),r)},lodash.flatten=flatten,lodash.flattenDeep=function flattenDeep(e){return(null==e?0:e.length)?baseFlatten(e,h):[]},lodash.flattenDepth=function flattenDepth(e,t){return(null==e?0:e.length)?baseFlatten(e,t=t===i?1:toInteger(t)):[]},lodash.flip=function flip(e){return createWrap(e,512)},lodash.flow=Un,lodash.flowRight=qn,lodash.fromPairs=function fromPairs(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},lodash.functions=function functions(e){return null==e?[]:baseFunctions(e,keys(e))},lodash.functionsIn=function functionsIn(e){return null==e?[]:baseFunctions(e,keysIn(e))},lodash.groupBy=Ur,lodash.initial=function initial(e){return(null==e?0:e.length)?baseSlice(e,0,-1):[]},lodash.intersection=Sr,lodash.intersectionBy=Tr,lodash.intersectionWith=Or,lodash.invert=_n,lodash.invertBy=Sn,lodash.invokeMap=qr,lodash.iteratee=iteratee,lodash.keyBy=Wr,lodash.keys=keys,lodash.keysIn=keysIn,lodash.map=map,lodash.mapKeys=function mapKeys(e,t){var r={};return t=getIteratee(t,3),baseForOwn(e,(function(e,n,i){baseAssignValue(r,t(e,n,i),e)})),r},lodash.mapValues=function mapValues(e,t){var r={};return t=getIteratee(t,3),baseForOwn(e,(function(e,n,i){baseAssignValue(r,n,t(e,n,i))})),r},lodash.matches=function matches(e){return baseMatches(baseClone(e,1))},lodash.matchesProperty=function matchesProperty(e,t){return baseMatchesProperty(e,baseClone(t,1))},lodash.memoize=memoize,lodash.merge=On,lodash.mergeWith=Rn,lodash.method=Wn,lodash.methodOf=Vn,lodash.mixin=mixin,lodash.negate=negate,lodash.nthArg=function nthArg(e){return e=toInteger(e),baseRest((function(t){return baseNth(t,e)}))},lodash.omit=In,lodash.omitBy=function omitBy(e,t){return pickBy(e,negate(getIteratee(t)))},lodash.once=function once(e){return before(2,e)},lodash.orderBy=function orderBy(e,t,r,n){return null==e?[]:(on(t)||(t=null==t?[]:[t]),on(r=n?i:r)||(r=null==r?[]:[r]),baseOrderBy(e,t,r))},lodash.over=Gn,lodash.overArgs=Yr,lodash.overEvery=Kn,lodash.overSome=$n,lodash.partial=Qr,lodash.partialRight=Xr,lodash.partition=Vr,lodash.pick=En,lodash.pickBy=pickBy,lodash.property=property,lodash.propertyOf=function propertyOf(e){return function(t){return null==e?i:baseGet(e,t)}},lodash.pull=Rr,lodash.pullAll=pullAll,lodash.pullAllBy=function pullAllBy(e,t,r){return e&&e.length&&t&&t.length?basePullAll(e,t,getIteratee(r,2)):e},lodash.pullAllWith=function pullAllWith(e,t,r){return e&&e.length&&t&&t.length?basePullAll(e,t,i,r):e},lodash.pullAt=Ir,lodash.range=Hn,lodash.rangeRight=Jn,lodash.rearg=en,lodash.reject=function reject(e,t){return(on(e)?arrayFilter:baseFilter)(e,negate(getIteratee(t,3)))},lodash.remove=function remove(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=getIteratee(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return basePullAt(e,i),r},lodash.rest=function rest(e,t){if("function"!=typeof e)throw new Me(o);return baseRest(e,t=t===i?t:toInteger(t))},lodash.reverse=reverse,lodash.sampleSize=function sampleSize(e,t,r){return t=(r?isIterateeCall(e,t,r):t===i)?1:toInteger(t),(on(e)?arraySampleSize:baseSampleSize)(e,t)},lodash.set=function set(e,t,r){return null==e?e:baseSet(e,t,r)},lodash.setWith=function setWith(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:baseSet(e,t,r,n)},lodash.shuffle=function shuffle(e){return(on(e)?arrayShuffle:baseShuffle)(e)},lodash.slice=function slice(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&isIterateeCall(e,t,r)?(t=0,r=n):(t=null==t?0:toInteger(t),r=r===i?n:toInteger(r)),baseSlice(e,t,r)):[]},lodash.sortBy=Gr,lodash.sortedUniq=function sortedUniq(e){return e&&e.length?baseSortedUniq(e):[]},lodash.sortedUniqBy=function sortedUniqBy(e,t){return e&&e.length?baseSortedUniq(e,getIteratee(t,2)):[]},lodash.split=function split(e,t,r){return r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=i),(r=r===i?m:r>>>0)?(e=toString(e))&&("string"==typeof t||null!=t&&!un(t))&&!(t=baseToString(t))&&hasUnicode(e)?castSlice(stringToArray(e),0,r):e.split(t,r):[]},lodash.spread=function spread(e,t){if("function"!=typeof e)throw new Me(o);return t=null==t?0:Pt(toInteger(t),0),baseRest((function(r){var n=r[t],i=castSlice(r,0,t);return n&&arrayPush(i,n),apply(e,this,i)}))},lodash.tail=function tail(e){var t=null==e?0:e.length;return t?baseSlice(e,1,t):[]},lodash.take=function take(e,t,r){return e&&e.length?baseSlice(e,0,(t=r||t===i?1:toInteger(t))<0?0:t):[]},lodash.takeRight=function takeRight(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,(t=n-(t=r||t===i?1:toInteger(t)))<0?0:t,n):[]},lodash.takeRightWhile=function takeRightWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!1,!0):[]},lodash.takeWhile=function takeWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3)):[]},lodash.tap=function tap(e,t){return t(e),e},lodash.throttle=function throttle(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Me(o);return isObject(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),debounce(e,t,{leading:n,maxWait:t,trailing:i})},lodash.thru=thru,lodash.toArray=toArray,lodash.toPairs=Ln,lodash.toPairsIn=Mn,lodash.toPath=function toPath(e){return on(e)?arrayMap(e,toKey):isSymbol(e)?[e]:copyArray(wr(toString(e)))},lodash.toPlainObject=toPlainObject,lodash.transform=function transform(e,t,r){var n=on(e),i=n||sn(e)||fn(e);if(t=getIteratee(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:isObject(e)&&isFunction(o)?tr($e(e)):{}}return(i?arrayEach:baseForOwn)(e,(function(e,n,i){return t(r,e,n,i)})),r},lodash.unary=function unary(e){return ary(e,1)},lodash.union=Er,lodash.unionBy=Lr,lodash.unionWith=Mr,lodash.uniq=function uniq(e){return e&&e.length?baseUniq(e):[]},lodash.uniqBy=function uniqBy(e,t){return e&&e.length?baseUniq(e,getIteratee(t,2)):[]},lodash.uniqWith=function uniqWith(e,t){return t="function"==typeof t?t:i,e&&e.length?baseUniq(e,i,t):[]},lodash.unset=function unset(e,t){return null==e||baseUnset(e,t)},lodash.unzip=unzip,lodash.unzipWith=unzipWith,lodash.update=function update(e,t,r){return null==e?e:baseUpdate(e,t,castFunction(r))},lodash.updateWith=function updateWith(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:baseUpdate(e,t,castFunction(r),n)},lodash.values=values,lodash.valuesIn=function valuesIn(e){return null==e?[]:baseValues(e,keysIn(e))},lodash.without=Ar,lodash.words=words,lodash.wrap=function wrap(e,t){return Qr(castFunction(t),e)},lodash.xor=Dr,lodash.xorBy=Pr,lodash.xorWith=jr,lodash.zip=kr,lodash.zipObject=function zipObject(e,t){return baseZipObject(e||[],t||[],assignValue)},lodash.zipObjectDeep=function zipObjectDeep(e,t){return baseZipObject(e||[],t||[],baseSet)},lodash.zipWith=xr,lodash.entries=Ln,lodash.entriesIn=Mn,lodash.extend=yn,lodash.extendWith=mn,mixin(lodash,lodash),lodash.add=Zn,lodash.attempt=zn,lodash.camelCase=An,lodash.capitalize=capitalize,lodash.ceil=Yn,lodash.clamp=function clamp(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=toNumber(r))==r?r:0),t!==i&&(t=(t=toNumber(t))==t?t:0),baseClamp(toNumber(e),t,r)},lodash.clone=function clone(e){return baseClone(e,4)},lodash.cloneDeep=function cloneDeep(e){return baseClone(e,5)},lodash.cloneDeepWith=function cloneDeepWith(e,t){return baseClone(e,5,t="function"==typeof t?t:i)},lodash.cloneWith=function cloneWith(e,t){return baseClone(e,4,t="function"==typeof t?t:i)},lodash.conformsTo=function conformsTo(e,t){return null==t||baseConformsTo(e,t,keys(t))},lodash.deburr=deburr,lodash.defaultTo=function defaultTo(e,t){return null==e||e!=e?t:e},lodash.divide=Qn,lodash.endsWith=function endsWith(e,t,r){e=toString(e),t=baseToString(t);var n=e.length,o=r=r===i?n:baseClamp(toInteger(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},lodash.eq=eq,lodash.escape=function escape(e){return(e=toString(e))&&Q.test(e)?e.replace(Z,Et):e},lodash.escapeRegExp=function escapeRegExp(e){return(e=toString(e))&&ae.test(e)?e.replace(oe,"\\$&"):e},lodash.every=function every(e,t,r){var n=on(e)?arrayEvery:baseEvery;return r&&isIterateeCall(e,t,r)&&(t=i),n(e,getIteratee(t,3))},lodash.find=zr,lodash.findIndex=findIndex,lodash.findKey=function findKey(e,t){return baseFindKey(e,getIteratee(t,3),baseForOwn)},lodash.findLast=Br,lodash.findLastIndex=findLastIndex,lodash.findLastKey=function findLastKey(e,t){return baseFindKey(e,getIteratee(t,3),baseForOwnRight)},lodash.floor=Xn,lodash.forEach=forEach,lodash.forEachRight=forEachRight,lodash.forIn=function forIn(e,t){return null==e?e:ir(e,getIteratee(t,3),keysIn)},lodash.forInRight=function forInRight(e,t){return null==e?e:or(e,getIteratee(t,3),keysIn)},lodash.forOwn=function forOwn(e,t){return e&&baseForOwn(e,getIteratee(t,3))},lodash.forOwnRight=function forOwnRight(e,t){return e&&baseForOwnRight(e,getIteratee(t,3))},lodash.get=get,lodash.gt=tn,lodash.gte=rn,lodash.has=function has(e,t){return null!=e&&hasPath(e,t,baseHas)},lodash.hasIn=hasIn,lodash.head=head,lodash.identity=identity,lodash.includes=function includes(e,t,r,n){e=isArrayLike(e)?e:values(e),r=r&&!n?toInteger(r):0;var i=e.length;return r<0&&(r=Pt(i+r,0)),isString(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&baseIndexOf(e,t,r)>-1},lodash.indexOf=function indexOf(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:toInteger(r);return i<0&&(i=Pt(n+i,0)),baseIndexOf(e,t,i)},lodash.inRange=function inRange(e,t,r){return t=toFinite(t),r===i?(r=t,t=0):r=toFinite(r),function baseInRange(e,t,r){return e>=jt(t,r)&&e<Pt(t,r)}(e=toNumber(e),t,r)},lodash.invoke=Tn,lodash.isArguments=nn,lodash.isArray=on,lodash.isArrayBuffer=an,lodash.isArrayLike=isArrayLike,lodash.isArrayLikeObject=isArrayLikeObject,lodash.isBoolean=function isBoolean(e){return!0===e||!1===e||isObjectLike(e)&&baseGetTag(e)==C},lodash.isBuffer=sn,lodash.isDate=cn,lodash.isElement=function isElement(e){return isObjectLike(e)&&1===e.nodeType&&!isPlainObject(e)},lodash.isEmpty=function isEmpty(e){if(null==e)return!0;if(isArrayLike(e)&&(on(e)||"string"==typeof e||"function"==typeof e.splice||sn(e)||fn(e)||nn(e)))return!e.length;var t=hr(e);if(t==R||t==A)return!e.size;if(isPrototype(e))return!baseKeys(e).length;for(var r in e)if(xe.call(e,r))return!1;return!0},lodash.isEqual=function isEqual(e,t){return baseIsEqual(e,t)},lodash.isEqualWith=function isEqualWith(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?baseIsEqual(e,t,i,r):!!n},lodash.isError=isError,lodash.isFinite=function isFinite(e){return"number"==typeof e&&Rt(e)},lodash.isFunction=isFunction,lodash.isInteger=isInteger,lodash.isLength=isLength,lodash.isMap=ln,lodash.isMatch=function isMatch(e,t){return e===t||baseIsMatch(e,t,getMatchData(t))},lodash.isMatchWith=function isMatchWith(e,t,r){return r="function"==typeof r?r:i,baseIsMatch(e,t,getMatchData(t),r)},lodash.isNaN=function isNaN(e){return isNumber(e)&&e!=+e},lodash.isNative=function isNative(e){if(gr(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return baseIsNative(e)},lodash.isNil=function isNil(e){return null==e},lodash.isNull=function isNull(e){return null===e},lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isObjectLike=isObjectLike,lodash.isPlainObject=isPlainObject,lodash.isRegExp=un,lodash.isSafeInteger=function isSafeInteger(e){return isInteger(e)&&e>=-9007199254740991&&e<=g},lodash.isSet=pn,lodash.isString=isString,lodash.isSymbol=isSymbol,lodash.isTypedArray=fn,lodash.isUndefined=function isUndefined(e){return e===i},lodash.isWeakMap=function isWeakMap(e){return isObjectLike(e)&&hr(e)==j},lodash.isWeakSet=function isWeakSet(e){return isObjectLike(e)&&"[object WeakSet]"==baseGetTag(e)},lodash.join=function join(e,t){return null==e?"":At.call(e,t)},lodash.kebabCase=Dn,lodash.last=last,lodash.lastIndexOf=function lastIndexOf(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=toInteger(r))<0?Pt(n+o,0):jt(o,n-1)),t==t?function strictLastIndexOf(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):baseFindIndex(e,baseIsNaN,o,!0)},lodash.lowerCase=Pn,lodash.lowerFirst=jn,lodash.lt=dn,lodash.lte=hn,lodash.max=function max(e){return e&&e.length?baseExtremum(e,identity,baseGt):i},lodash.maxBy=function maxBy(e,t){return e&&e.length?baseExtremum(e,getIteratee(t,2),baseGt):i},lodash.mean=function mean(e){return baseMean(e,identity)},lodash.meanBy=function meanBy(e,t){return baseMean(e,getIteratee(t,2))},lodash.min=function min(e){return e&&e.length?baseExtremum(e,identity,baseLt):i},lodash.minBy=function minBy(e,t){return e&&e.length?baseExtremum(e,getIteratee(t,2),baseLt):i},lodash.stubArray=stubArray,lodash.stubFalse=stubFalse,lodash.stubObject=function stubObject(){return{}},lodash.stubString=function stubString(){return""},lodash.stubTrue=function stubTrue(){return!0},lodash.multiply=ti,lodash.nth=function nth(e,t){return e&&e.length?baseNth(e,toInteger(t)):i},lodash.noConflict=function noConflict(){return ht._===this&&(ht._=Ue),this},lodash.noop=noop,lodash.now=Kr,lodash.pad=function pad(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return createPadding(yt(i),r)+e+createPadding(gt(i),r)},lodash.padEnd=function padEnd(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;return t&&n<t?e+createPadding(t-n,r):e},lodash.padStart=function padStart(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;return t&&n<t?createPadding(t-n,r)+e:e},lodash.parseInt=function parseInt(e,t,r){return r||null==t?t=0:t&&(t=+t),xt(toString(e).replace(se,""),t||0)},lodash.random=function random(e,t,r){if(r&&"boolean"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=toFinite(e),t===i?(t=e,e=0):t=toFinite(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=Ft();return jt(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return baseRandom(e,t)},lodash.reduce=function reduce(e,t,r){var n=on(e)?arrayReduce:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,rr)},lodash.reduceRight=function reduceRight(e,t,r){var n=on(e)?arrayReduceRight:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,nr)},lodash.repeat=function repeat(e,t,r){return t=(r?isIterateeCall(e,t,r):t===i)?1:toInteger(t),baseRepeat(toString(e),t)},lodash.replace=function replace(){var e=arguments,t=toString(e[0]);return e.length<3?t:t.replace(e[1],e[2])},lodash.result=function result(e,t,r){var n=-1,o=(t=castPath(t,e)).length;for(o||(o=1,e=i);++n<o;){var a=null==e?i:e[toKey(t[n])];a===i&&(n=o,a=r),e=isFunction(a)?a.call(e):a}return e},lodash.round=ri,lodash.runInContext=runInContext,lodash.sample=function sample(e){return(on(e)?arraySample:baseSample)(e)},lodash.size=function size(e){if(null==e)return 0;if(isArrayLike(e))return isString(e)?stringSize(e):e.length;var t=hr(e);return t==R||t==A?e.size:baseKeys(e).length},lodash.snakeCase=kn,lodash.some=function some(e,t,r){var n=on(e)?arraySome:baseSome;return r&&isIterateeCall(e,t,r)&&(t=i),n(e,getIteratee(t,3))},lodash.sortedIndex=function sortedIndex(e,t){return baseSortedIndex(e,t)},lodash.sortedIndexBy=function sortedIndexBy(e,t,r){return baseSortedIndexBy(e,t,getIteratee(r,2))},lodash.sortedIndexOf=function sortedIndexOf(e,t){var r=null==e?0:e.length;if(r){var n=baseSortedIndex(e,t);if(n<r&&eq(e[n],t))return n}return-1},lodash.sortedLastIndex=function sortedLastIndex(e,t){return baseSortedIndex(e,t,!0)},lodash.sortedLastIndexBy=function sortedLastIndexBy(e,t,r){return baseSortedIndexBy(e,t,getIteratee(r,2),!0)},lodash.sortedLastIndexOf=function sortedLastIndexOf(e,t){if(null==e?0:e.length){var r=baseSortedIndex(e,t,!0)-1;if(eq(e[r],t))return r}return-1},lodash.startCase=xn,lodash.startsWith=function startsWith(e,t,r){return e=toString(e),r=null==r?0:baseClamp(toInteger(r),0,e.length),t=baseToString(t),e.slice(r,r+t.length)==t},lodash.subtract=ni,lodash.sum=function sum(e){return e&&e.length?baseSum(e,identity):0},lodash.sumBy=function sumBy(e,t){return e&&e.length?baseSum(e,getIteratee(t,2)):0},lodash.template=function template(e,t,r){var n=lodash.templateSettings;r&&isIterateeCall(e,t,r)&&(t=i),e=toString(e),t=mn({},t,n,customDefaultsAssignIn);var o,a,s=mn({},t.imports,n.imports,customDefaultsAssignIn),c=keys(s),l=baseValues(s,c),u=0,p=t.interpolate||Se,d="__p += '",h=Ee((t.escape||Se).source+"|"+p.source+"|"+(p===te?ge:Se).source+"|"+(t.evaluate||Se).source+"|$","g"),g="//# sourceURL="+(xe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";e.replace(h,(function(t,r,n,i,s,c){return n||(n=i),d+=e.slice(u,c).replace(Te,escapeStringChar),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var y=xe.call(t,"variable")&&t.variable;if(y){if(de.test(y))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(K,""):d).replace($,"$1").replace(H,"$1;"),d="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=zn((function(){return Oe(c,g+"return "+d).apply(i,l)}));if(m.source=d,isError(m))throw m;return m},lodash.times=function times(e,t){if((e=toInteger(e))<1||e>g)return[];var r=m,n=jt(e,m);t=getIteratee(t),e-=m;for(var i=baseTimes(n,t);++r<e;)t(r);return i},lodash.toFinite=toFinite,lodash.toInteger=toInteger,lodash.toLength=toLength,lodash.toLower=function toLower(e){return toString(e).toLowerCase()},lodash.toNumber=toNumber,lodash.toSafeInteger=function toSafeInteger(e){return e?baseClamp(toInteger(e),-9007199254740991,g):0===e?e:0},lodash.toString=toString,lodash.toUpper=function toUpper(e){return toString(e).toUpperCase()},lodash.trim=function trim(e,t,r){if((e=toString(e))&&(r||t===i))return baseTrim(e);if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e),o=stringToArray(t);return castSlice(n,charsStartIndex(n,o),charsEndIndex(n,o)+1).join("")},lodash.trimEnd=function trimEnd(e,t,r){if((e=toString(e))&&(r||t===i))return e.slice(0,trimmedEndIndex(e)+1);if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e);return castSlice(n,0,charsEndIndex(n,stringToArray(t))+1).join("")},lodash.trimStart=function trimStart(e,t,r){if((e=toString(e))&&(r||t===i))return e.replace(se,"");if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e);return castSlice(n,charsStartIndex(n,stringToArray(t))).join("")},lodash.truncate=function truncate(e,t){var r=30,n="...";if(isObject(t)){var o="separator"in t?t.separator:o;r="length"in t?toInteger(t.length):r,n="omission"in t?baseToString(t.omission):n}var a=(e=toString(e)).length;if(hasUnicode(e)){var s=stringToArray(e);a=s.length}if(r>=a)return e;var c=r-stringSize(n);if(c<1)return n;var l=s?castSlice(s,0,c).join(""):e.slice(0,c);if(o===i)return l+n;if(s&&(c+=l.length-c),un(o)){if(e.slice(c).search(o)){var u,p=l;for(o.global||(o=Ee(o.source,toString(ye.exec(o))+"g")),o.lastIndex=0;u=o.exec(p);)var d=u.index;l=l.slice(0,d===i?c:d)}}else if(e.indexOf(baseToString(o),c)!=c){var h=l.lastIndexOf(o);h>-1&&(l=l.slice(0,h))}return l+n},lodash.unescape=function unescape(e){return(e=toString(e))&&Y.test(e)?e.replace(J,Lt):e},lodash.uniqueId=function uniqueId(e){var t=++Fe;return toString(e)+t},lodash.upperCase=Fn,lodash.upperFirst=Nn,lodash.each=forEach,lodash.eachRight=forEachRight,lodash.first=head,mixin(lodash,(ei={},baseForOwn(lodash,(function(e,t){xe.call(lodash.prototype,t)||(ei[t]=e)})),ei),{chain:!1}),lodash.VERSION="4.17.21",arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){lodash[e].placeholder=lodash})),arrayEach(["drop","take"],(function(e,t){LazyWrapper.prototype[e]=function(r){r=r===i?1:Pt(toInteger(r),0);var n=this.__filtered__&&!t?new LazyWrapper(this):this.clone();return n.__filtered__?n.__takeCount__=jt(r,n.__takeCount__):n.__views__.push({size:jt(r,m),type:e+(n.__dir__<0?"Right":"")}),n},LazyWrapper.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),arrayEach(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;LazyWrapper.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:getIteratee(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),arrayEach(["head","last"],(function(e,t){var r="take"+(t?"Right":"");LazyWrapper.prototype[e]=function(){return this[r](1).value()[0]}})),arrayEach(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");LazyWrapper.prototype[e]=function(){return this.__filtered__?new LazyWrapper(this):this[r](1)}})),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(e){return this.filter(e).head()},LazyWrapper.prototype.findLast=function(e){return this.reverse().find(e)},LazyWrapper.prototype.invokeMap=baseRest((function(e,t){return"function"==typeof e?new LazyWrapper(this):this.map((function(r){return baseInvoke(r,e,t)}))})),LazyWrapper.prototype.reject=function(e){return this.filter(negate(getIteratee(e)))},LazyWrapper.prototype.slice=function(e,t){e=toInteger(e);var r=this;return r.__filtered__&&(e>0||t<0)?new LazyWrapper(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=toInteger(t))<0?r.dropRight(-t):r.take(t-e)),r)},LazyWrapper.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(m)},baseForOwn(LazyWrapper.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=lodash[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);o&&(lodash.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,c=t instanceof LazyWrapper,l=s[0],u=c||on(t),interceptor=function(e){var t=o.apply(lodash,arrayPush([e],s));return n&&p?t[0]:t};u&&r&&"function"==typeof l&&1!=l.length&&(c=u=!1);var p=this.__chain__,d=!!this.__actions__.length,h=a&&!p,g=c&&!d;if(!a&&u){t=g?t:new LazyWrapper(this);var y=e.apply(t,s);return y.__actions__.push({func:thru,args:[interceptor],thisArg:i}),new LodashWrapper(y,p)}return h&&g?e.apply(this,s):(y=this.thru(interceptor),h?n?y.value()[0]:y.value():y)})})),arrayEach(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);lodash.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(on(i)?i:[],e)}return this[r]((function(r){return t.apply(on(r)?r:[],e)}))}})),baseForOwn(LazyWrapper.prototype,(function(e,t){var r=lodash[t];if(r){var n=r.name+"";xe.call(Kt,n)||(Kt[n]=[]),Kt[n].push({name:t,func:r})}})),Kt[createHybrid(i,2).name]=[{name:"wrapper",func:i}],LazyWrapper.prototype.clone=function lazyClone(){var e=new LazyWrapper(this.__wrapped__);return e.__actions__=copyArray(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=copyArray(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=copyArray(this.__views__),e},LazyWrapper.prototype.reverse=function lazyReverse(){if(this.__filtered__){var e=new LazyWrapper(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},LazyWrapper.prototype.value=function lazyValue(){var e=this.__wrapped__.value(),t=this.__dir__,r=on(e),n=t<0,i=r?e.length:0,o=function getView(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=jt(t,e+a);break;case"takeRight":e=Pt(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,c=s-a,l=n?s:a-1,u=this.__iteratees__,p=u.length,d=0,h=jt(c,this.__takeCount__);if(!r||!n&&i==c&&h==c)return baseWrapperValue(e,this.__actions__);var g=[];e:for(;c--&&d<h;){for(var y=-1,m=e[l+=t];++y<p;){var v=u[y],w=v.iteratee,b=v.type,C=w(m);if(2==b)m=C;else if(!C){if(1==b)continue e;break e}}g[d++]=m}return g},lodash.prototype.at=Fr,lodash.prototype.chain=function wrapperChain(){return chain(this)},lodash.prototype.commit=function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)},lodash.prototype.next=function wrapperNext(){this.__values__===i&&(this.__values__=toArray(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},lodash.prototype.plant=function wrapperPlant(e){for(var t,r=this;r instanceof baseLodash;){var n=wrapperClone(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},lodash.prototype.reverse=function wrapperReverse(){var e=this.__wrapped__;if(e instanceof LazyWrapper){var t=e;return this.__actions__.length&&(t=new LazyWrapper(this)),(t=t.reverse()).__actions__.push({func:thru,args:[reverse],thisArg:i}),new LodashWrapper(t,this.__chain__)}return this.thru(reverse)},lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)},lodash.prototype.first=lodash.prototype.head,Qe&&(lodash.prototype[Qe]=function wrapperToIterator(){return this}),lodash}();ht._=Mt,(n=function(){return Mt}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},9490:(e,t)=>{"use strict";function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _extends(){return _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,t,r){return _construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(i,r.prototype),i},_construct.apply(null,arguments)}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(e){if(null===e||!function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,e)},_wrapNativeSuper(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _createForOfIteratorHelperLoose(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function LuxonError(){return e.apply(this,arguments)||this}return _inheritsLoose(LuxonError,e),LuxonError}(_wrapNativeSuper(Error)),n=function(e){function InvalidDateTimeError(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return _inheritsLoose(InvalidDateTimeError,e),InvalidDateTimeError}(r),i=function(e){function InvalidIntervalError(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return _inheritsLoose(InvalidIntervalError,e),InvalidIntervalError}(r),o=function(e){function InvalidDurationError(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return _inheritsLoose(InvalidDurationError,e),InvalidDurationError}(r),a=function(e){function ConflictingSpecificationError(){return e.apply(this,arguments)||this}return _inheritsLoose(ConflictingSpecificationError,e),ConflictingSpecificationError}(r),s=function(e){function InvalidUnitError(t){return e.call(this,"Invalid unit "+t)||this}return _inheritsLoose(InvalidUnitError,e),InvalidUnitError}(r),c=function(e){function InvalidArgumentError(){return e.apply(this,arguments)||this}return _inheritsLoose(InvalidArgumentError,e),InvalidArgumentError}(r),l=function(e){function ZoneIsAbstractError(){return e.call(this,"Zone is an abstract class")||this}return _inheritsLoose(ZoneIsAbstractError,e),ZoneIsAbstractError}(r),u="numeric",p="short",d="long",h={year:u,month:u,day:u},g={year:u,month:p,day:u},y={year:u,month:p,day:u,weekday:p},m={year:u,month:d,day:u},v={year:u,month:d,day:u,weekday:d},w={hour:u,minute:u},b={hour:u,minute:u,second:u},C={hour:u,minute:u,second:u,timeZoneName:p},_={hour:u,minute:u,second:u,timeZoneName:d},S={hour:u,minute:u,hourCycle:"h23"},T={hour:u,minute:u,second:u,hourCycle:"h23"},O={hour:u,minute:u,second:u,hourCycle:"h23",timeZoneName:p},R={hour:u,minute:u,second:u,hourCycle:"h23",timeZoneName:d},I={year:u,month:u,day:u,hour:u,minute:u},E={year:u,month:u,day:u,hour:u,minute:u,second:u},L={year:u,month:p,day:u,hour:u,minute:u},M={year:u,month:p,day:u,hour:u,minute:u,second:u},A={year:u,month:p,day:u,weekday:p,hour:u,minute:u},D={year:u,month:d,day:u,hour:u,minute:u,timeZoneName:p},P={year:u,month:d,day:u,hour:u,minute:u,second:u,timeZoneName:p},j={year:u,month:d,day:u,weekday:d,hour:u,minute:u,timeZoneName:d},k={year:u,month:d,day:u,weekday:d,hour:u,minute:u,second:u,timeZoneName:d};function isUndefined(e){return void 0===e}function isNumber(e){return"number"==typeof e}function isInteger(e){return"number"==typeof e&&e%1==0}function hasRelative(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function bestBy(e,t,r){if(0!==e.length)return e.reduce((function(e,n){var i=[t(n),n];return e&&r(e[0],i[0])===e[0]?e:i}),null)[1]}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function integerBetween(e,t,r){return isInteger(e)&&e>=t&&e<=r}function padStart(e,t){void 0===t&&(t=2);var r=e<0?"-":"",n=r?-1*e:e;return""+r+(n.toString().length<t?("0".repeat(t)+n).slice(-t):n.toString())}function parseInteger(e){return isUndefined(e)||null===e||""===e?void 0:parseInt(e,10)}function parseFloating(e){return isUndefined(e)||null===e||""===e?void 0:parseFloat(e)}function parseMillis(e){if(!isUndefined(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function roundTo(e,t,r){void 0===r&&(r=!1);var n=Math.pow(10,t);return(r?Math.trunc:Math.round)(e*n)/n}function isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}function daysInYear(e){return isLeapYear(e)?366:365}function daysInMonth(e,t){var r=function floorMod(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===r?isLeapYear(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function objToLocalTS(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(t.getUTCFullYear()-1900),+t}function weeksInWeekYear(e){var t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,r=e-1,n=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return 4===t||3===n?53:52}function untruncateYear(e){return e>99?e:e>60?1900+e:2e3+e}function parseZoneInfo(e,t,r,n){void 0===n&&(n=null);var i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);var a=_extends({timeZoneName:t},o),s=new Intl.DateTimeFormat(r,a).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return s?s.value:null}function signedOffset(e,t){var r=parseInt(e,10);Number.isNaN(r)&&(r=0);var n=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-n:n)}function asNumber(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new c("Invalid unit value "+e);return t}function normalizeObject(e,t){var r={};for(var n in e)if(hasOwnProperty(e,n)){var i=e[n];if(null==i)continue;r[t(n)]=asNumber(i)}return r}function formatOffset(e,t){var r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return""+i+padStart(r,2)+":"+padStart(n,2);case"narrow":return""+i+r+(n>0?":"+n:"");case"techie":return""+i+padStart(r,2)+padStart(n,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function timeObject(e){return function pick(e,t){return t.reduce((function(t,r){return t[r]=e[r],t}),{})}(e,["hour","minute","second","millisecond"])}var x=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z0-9_+-]{1,256}(\/[A-Za-z0-9_+-]{1,256})?)?/,F=["January","February","March","April","May","June","July","August","September","October","November","December"],N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],z=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(e){switch(e){case"narrow":return[].concat(z);case"short":return[].concat(N);case"long":return[].concat(F);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var B=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],U=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],q=["M","T","W","T","F","S","S"];function weekdays(e){switch(e){case"narrow":return[].concat(q);case"short":return[].concat(U);case"long":return[].concat(B);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var W=["AM","PM"],V=["Before Christ","Anno Domini"],G=["BC","AD"],K=["B","A"];function eras(e){switch(e){case"narrow":return[].concat(K);case"short":return[].concat(G);case"long":return[].concat(V);default:return null}}function stringifyTokens(e,t){for(var r,n="",i=_createForOfIteratorHelperLoose(e);!(r=i()).done;){var o=r.value;o.literal?n+=o.val:n+=t(o.val)}return n}var $={D:h,DD:g,DDD:m,DDDD:v,t:w,tt:b,ttt:C,tttt:_,T:S,TT:T,TTT:O,TTTT:R,f:I,ff:L,fff:D,ffff:j,F:E,FF:M,FFF:P,FFFF:k},H=function(){function Formatter(e,t){this.opts=t,this.loc=e,this.systemLoc=null}Formatter.create=function create(e,t){return void 0===t&&(t={}),new Formatter(e,t)},Formatter.parseFormat=function parseFormat(e){for(var t=null,r="",n=!1,i=[],o=0;o<e.length;o++){var a=e.charAt(o);"'"===a?(r.length>0&&i.push({literal:n,val:r}),t=null,r="",n=!n):n||a===t?r+=a:(r.length>0&&i.push({literal:!1,val:r}),r=a,t=a)}return r.length>0&&i.push({literal:n,val:r}),i},Formatter.macroTokenToFormatOpts=function macroTokenToFormatOpts(e){return $[e]};var e=Formatter.prototype;return e.formatWithSystemDefault=function formatWithSystemDefault(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,_extends({},this.opts,t)).format()},e.formatDateTime=function formatDateTime(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,_extends({},this.opts,t)).format()},e.formatDateTimeParts=function formatDateTimeParts(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,_extends({},this.opts,t)).formatToParts()},e.resolvedOptions=function resolvedOptions(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,_extends({},this.opts,t)).resolvedOptions()},e.num=function num(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return padStart(e,t);var r=_extends({},this.opts);return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)},e.formatDateTimeFromString=function formatDateTimeFromString(e,t){var r=this,n="en"===this.loc.listingMode(),i=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=function string(t,n){return r.loc.extract(e,t,n)},a=function formatOffset(t){return e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):""},s=function meridiem(){return n?function meridiemForDateTime(e){return W[e.hour<12?0:1]}(e):o({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function month(t,r){return n?function monthForDateTime(e,t){return months(t)[e.month-1]}(e,t):o(r?{month:t}:{month:t,day:"numeric"},"month")},l=function weekday(t,r){return n?function weekdayForDateTime(e,t){return weekdays(t)[e.weekday-1]}(e,t):o(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday")},u=function era(t){return n?function eraForDateTime(e,t){return eras(t)[e.year<0?0:1]}(e,t):o({era:t},"era")};return stringifyTokens(Formatter.parseFormat(t),(function tokenToString(t){switch(t){case"S":return r.num(e.millisecond);case"u":case"SSS":return r.num(e.millisecond,3);case"s":return r.num(e.second);case"ss":return r.num(e.second,2);case"uu":return r.num(Math.floor(e.millisecond/10),2);case"uuu":return r.num(Math.floor(e.millisecond/100));case"m":return r.num(e.minute);case"mm":return r.num(e.minute,2);case"h":return r.num(e.hour%12==0?12:e.hour%12);case"hh":return r.num(e.hour%12==0?12:e.hour%12,2);case"H":return r.num(e.hour);case"HH":return r.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return a({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:r.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return i?o({day:"numeric"},"day"):r.num(e.day);case"dd":return i?o({day:"2-digit"},"day"):r.num(e.day,2);case"c":case"E":return r.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):r.num(e.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):r.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return i?o({month:"numeric"},"month"):r.num(e.month);case"MM":return i?o({month:"2-digit"},"month"):r.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return i?o({year:"numeric"},"year"):r.num(e.year);case"yy":return i?o({year:"2-digit"},"year"):r.num(e.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):r.num(e.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):r.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return r.num(e.weekYear.toString().slice(-2),2);case"kkkk":return r.num(e.weekYear,4);case"W":return r.num(e.weekNumber);case"WW":return r.num(e.weekNumber,2);case"o":return r.num(e.ordinal);case"ooo":return r.num(e.ordinal,3);case"q":return r.num(e.quarter);case"qq":return r.num(e.quarter,2);case"X":return r.num(Math.floor(e.ts/1e3));case"x":return r.num(e.ts);default:return function maybeMacro(t){var n=Formatter.macroTokenToFormatOpts(t);return n?r.formatWithSystemDefault(e,n):t}(t)}}))},e.formatDurationFromString=function formatDurationFromString(e,t){var r=this,n=function tokenToField(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}},i=Formatter.parseFormat(t),o=i.reduce((function(e,t){var r=t.literal,n=t.val;return r?e:e.concat(n)}),[]);return stringifyTokens(i,function tokenToString(e){return function(t){var i=n(t);return i?r.num(e.get(i),t.length):t}}(e.shiftTo.apply(e,o.map(n).filter((function(e){return e})))))},Formatter}(),J=function(){function Invalid(e,t){this.reason=e,this.explanation=t}return Invalid.prototype.toMessage=function toMessage(){return this.explanation?this.reason+": "+this.explanation:this.reason},Invalid}(),Z=function(){function Zone(){}var e=Zone.prototype;return e.offsetName=function offsetName(e,t){throw new l},e.formatOffset=function formatOffset(e,t){throw new l},e.offset=function offset(e){throw new l},e.equals=function equals(e){throw new l},_createClass(Zone,[{key:"type",get:function get(){throw new l}},{key:"name",get:function get(){throw new l}},{key:"isUniversal",get:function get(){throw new l}},{key:"isValid",get:function get(){throw new l}}]),Zone}(),Y=null,Q=function(e){function SystemZone(){return e.apply(this,arguments)||this}_inheritsLoose(SystemZone,e);var t=SystemZone.prototype;return t.offsetName=function offsetName(e,t){return parseZoneInfo(e,t.format,t.locale)},t.formatOffset=function formatOffset$1(e,t){return formatOffset(this.offset(e),t)},t.offset=function offset(e){return-new Date(e).getTimezoneOffset()},t.equals=function equals(e){return"system"===e.type},_createClass(SystemZone,[{key:"type",get:function get(){return"system"}},{key:"name",get:function get(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function get(){return!1}},{key:"isValid",get:function get(){return!0}}],[{key:"instance",get:function get(){return null===Y&&(Y=new SystemZone),Y}}]),SystemZone}(Z),X=RegExp("^"+x.source+"$"),ee={};var te={year:0,month:1,day:2,hour:3,minute:4,second:5};var re={},ne=function(e){function IANAZone(t){var r;return(r=e.call(this)||this).zoneName=t,r.valid=IANAZone.isValidZone(t),r}_inheritsLoose(IANAZone,e),IANAZone.create=function create(e){return re[e]||(re[e]=new IANAZone(e)),re[e]},IANAZone.resetCache=function resetCache(){re={},ee={}},IANAZone.isValidSpecifier=function isValidSpecifier(e){return!(!e||!e.match(X))},IANAZone.isValidZone=function isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var t=IANAZone.prototype;return t.offsetName=function offsetName(e,t){return parseZoneInfo(e,t.format,t.locale,this.name)},t.formatOffset=function formatOffset$1(e,t){return formatOffset(this.offset(e),t)},t.offset=function offset(e){var t=new Date(e);if(isNaN(t))return NaN;var r=function makeDTF(e){return ee[e]||(ee[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ee[e]}(this.name),n=r.formatToParts?function partsOffset(e,t){for(var r=e.formatToParts(t),n=[],i=0;i<r.length;i++){var o=r[i],a=o.type,s=o.value,c=te[a];isUndefined(c)||(n[c]=parseInt(s,10))}return n}(r,t):function hackyOffset(e,t){var r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r),i=n[1],o=n[2];return[n[3],i,o,n[4],n[5],n[6]]}(r,t),i=n[0],o=n[1],a=n[2],s=n[3],c=+t,l=c%1e3;return(objToLocalTS({year:i,month:o,day:a,hour:24===s?0:s,minute:n[4],second:n[5],millisecond:0})-(c-=l>=0?l:1e3+l))/6e4},t.equals=function equals(e){return"iana"===e.type&&e.name===this.name},_createClass(IANAZone,[{key:"type",get:function get(){return"iana"}},{key:"name",get:function get(){return this.zoneName}},{key:"isUniversal",get:function get(){return!1}},{key:"isValid",get:function get(){return this.valid}}]),IANAZone}(Z),ie=null,oe=function(e){function FixedOffsetZone(t){var r;return(r=e.call(this)||this).fixed=t,r}_inheritsLoose(FixedOffsetZone,e),FixedOffsetZone.instance=function instance(e){return 0===e?FixedOffsetZone.utcInstance:new FixedOffsetZone(e)},FixedOffsetZone.parseSpecifier=function parseSpecifier(e){if(e){var t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new FixedOffsetZone(signedOffset(t[1],t[2]))}return null};var t=FixedOffsetZone.prototype;return t.offsetName=function offsetName(){return this.name},t.formatOffset=function formatOffset$1(e,t){return formatOffset(this.fixed,t)},t.offset=function offset(){return this.fixed},t.equals=function equals(e){return"fixed"===e.type&&e.fixed===this.fixed},_createClass(FixedOffsetZone,[{key:"type",get:function get(){return"fixed"}},{key:"name",get:function get(){return 0===this.fixed?"UTC":"UTC"+formatOffset(this.fixed,"narrow")}},{key:"isUniversal",get:function get(){return!0}},{key:"isValid",get:function get(){return!0}}],[{key:"utcInstance",get:function get(){return null===ie&&(ie=new FixedOffsetZone(0)),ie}}]),FixedOffsetZone}(Z),ae=function(e){function InvalidZone(t){var r;return(r=e.call(this)||this).zoneName=t,r}_inheritsLoose(InvalidZone,e);var t=InvalidZone.prototype;return t.offsetName=function offsetName(){return null},t.formatOffset=function formatOffset(){return""},t.offset=function offset(){return NaN},t.equals=function equals(){return!1},_createClass(InvalidZone,[{key:"type",get:function get(){return"invalid"}},{key:"name",get:function get(){return this.zoneName}},{key:"isUniversal",get:function get(){return!1}},{key:"isValid",get:function get(){return!1}}]),InvalidZone}(Z);function normalizeZone(e,t){if(isUndefined(e)||null===e)return t;if(e instanceof Z)return e;if(function isString(e){return"string"==typeof e}(e)){var r=e.toLowerCase();return"local"===r||"system"===r?t:"utc"===r||"gmt"===r?oe.utcInstance:ne.isValidSpecifier(r)?ne.create(e):oe.parseSpecifier(r)||new ae(e)}return isNumber(e)?oe.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new ae(e)}var se,ce=function now(){return Date.now()},le="system",ue=null,pe=null,fe=null,de=function(){function Settings(){}return Settings.resetCaches=function resetCaches(){_e.resetCache(),ne.resetCache()},_createClass(Settings,null,[{key:"now",get:function get(){return ce},set:function set(e){ce=e}},{key:"defaultZone",get:function get(){return normalizeZone(le,Q.instance)},set:function set(e){le=e}},{key:"defaultLocale",get:function get(){return ue},set:function set(e){ue=e}},{key:"defaultNumberingSystem",get:function get(){return pe},set:function set(e){pe=e}},{key:"defaultOutputCalendar",get:function get(){return fe},set:function set(e){fe=e}},{key:"throwOnInvalid",get:function get(){return se},set:function set(e){se=e}}]),Settings}(),he=["base"],ge={};function getCachedDTF(e,t){void 0===t&&(t={});var r=JSON.stringify([e,t]),n=ge[r];return n||(n=new Intl.DateTimeFormat(e,t),ge[r]=n),n}var ye={};var me={};function getCachedRTF(e,t){void 0===t&&(t={});var r=t;r.base;var n=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(r,he),i=JSON.stringify([e,n]),o=me[i];return o||(o=new Intl.RelativeTimeFormat(e,t),me[i]=o),o}var ve=null;function listStuff(e,t,r,n,i){var o=e.listingMode(r);return"error"===o?null:"en"===o?n(t):i(t)}var we=function(){function PolyNumberFormatter(e,t,r){if(this.padTo=r.padTo||0,this.floor=r.floor||!1,!t){var n={useGrouping:!1};r.padTo>0&&(n.minimumIntegerDigits=r.padTo),this.inf=function getCachedINF(e,t){void 0===t&&(t={});var r=JSON.stringify([e,t]),n=ye[r];return n||(n=new Intl.NumberFormat(e,t),ye[r]=n),n}(e,n)}}return PolyNumberFormatter.prototype.format=function format(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return padStart(this.floor?Math.floor(e):roundTo(e,3),this.padTo)},PolyNumberFormatter}(),be=function(){function PolyDateFormatter(e,t,r){var n;if(this.opts=r,e.zone.isUniversal){var i=e.offset/60*-1,o=i>=0?"Etc/GMT+"+i:"Etc/GMT"+i;0!==e.offset&&ne.create(o).valid?(n=o,this.dt=e):(n="UTC",r.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Ot.fromMillis(e.ts+60*e.offset*1e3))}else"system"===e.zone.type?this.dt=e:(this.dt=e,n=e.zone.name);var a=_extends({},this.opts);n&&(a.timeZone=n),this.dtf=getCachedDTF(t,a)}var e=PolyDateFormatter.prototype;return e.format=function format(){return this.dtf.format(this.dt.toJSDate())},e.formatToParts=function formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())},e.resolvedOptions=function resolvedOptions(){return this.dtf.resolvedOptions()},PolyDateFormatter}(),Ce=function(){function PolyRelFormatter(e,t,r){this.opts=_extends({style:"long"},r),!t&&hasRelative()&&(this.rtf=getCachedRTF(e,r))}var e=PolyRelFormatter.prototype;return e.format=function format(e,t){return this.rtf?this.rtf.format(e,t):function formatRelativeTime(e,t,r,n){void 0===r&&(r="always"),void 0===n&&(n=!1);var i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&o){var a="days"===e;switch(t){case 1:return a?"tomorrow":"next "+i[e][0];case-1:return a?"yesterday":"last "+i[e][0];case 0:return a?"today":"this "+i[e][0]}}var s=Object.is(t,-0)||t<0,c=Math.abs(t),l=1===c,u=i[e],p=n?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?c+" "+p+" ago":"in "+c+" "+p}(t,e,this.opts.numeric,"long"!==this.opts.style)},e.formatToParts=function formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},PolyRelFormatter}(),_e=function(){function Locale(e,t,r,n){var i=function parseLocaleString(e){var t=e.indexOf("-u-");if(-1===t)return[e];var r,n=e.substring(0,t);try{r=getCachedDTF(e).resolvedOptions()}catch(e){r=getCachedDTF(n).resolvedOptions()}var i=r;return[n,i.numberingSystem,i.calendar]}(e),o=i[0],a=i[1],s=i[2];this.locale=o,this.numberingSystem=t||a||null,this.outputCalendar=r||s||null,this.intl=function intlConfigString(e,t,r){return r||t?(e+="-u",r&&(e+="-ca-"+r),t&&(e+="-nu-"+t),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}Locale.fromOpts=function fromOpts(e){return Locale.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)},Locale.create=function create(e,t,r,n){void 0===n&&(n=!1);var i=e||de.defaultLocale;return new Locale(i||(n?"en-US":function systemLocale(){return ve||(ve=(new Intl.DateTimeFormat).resolvedOptions().locale)}()),t||de.defaultNumberingSystem,r||de.defaultOutputCalendar,i)},Locale.resetCache=function resetCache(){ve=null,ge={},ye={},me={}},Locale.fromObject=function fromObject(e){var t=void 0===e?{}:e,r=t.locale,n=t.numberingSystem,i=t.outputCalendar;return Locale.create(r,n,i)};var e=Locale.prototype;return e.listingMode=function listingMode(e){var t=this.isEnglish(),r=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&r?"en":"intl"},e.clone=function clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Locale.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this},e.redefaultToEN=function redefaultToEN(e){return void 0===e&&(e={}),this.clone(_extends({},e,{defaultToEN:!0}))},e.redefaultToSystem=function redefaultToSystem(e){return void 0===e&&(e={}),this.clone(_extends({},e,{defaultToEN:!1}))},e.months=function months$1(e,t,r){var n=this;return void 0===t&&(t=!1),void 0===r&&(r=!0),listStuff(this,e,r,months,(function(){var r=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return n.monthsCache[i][e]||(n.monthsCache[i][e]=function mapMonths(e){for(var t=[],r=1;r<=12;r++){var n=Ot.utc(2016,r,1);t.push(e(n))}return t}((function(e){return n.extract(e,r,"month")}))),n.monthsCache[i][e]}))},e.weekdays=function weekdays$1(e,t,r){var n=this;return void 0===t&&(t=!1),void 0===r&&(r=!0),listStuff(this,e,r,weekdays,(function(){var r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return n.weekdaysCache[i][e]||(n.weekdaysCache[i][e]=function mapWeekdays(e){for(var t=[],r=1;r<=7;r++){var n=Ot.utc(2016,11,13+r);t.push(e(n))}return t}((function(e){return n.extract(e,r,"weekday")}))),n.weekdaysCache[i][e]}))},e.meridiems=function meridiems$1(e){var t=this;return void 0===e&&(e=!0),listStuff(this,void 0,e,(function(){return W}),(function(){if(!t.meridiemCache){var e={hour:"numeric",hourCycle:"h12"};t.meridiemCache=[Ot.utc(2016,11,13,9),Ot.utc(2016,11,13,19)].map((function(r){return t.extract(r,e,"dayperiod")}))}return t.meridiemCache}))},e.eras=function eras$1(e,t){var r=this;return void 0===t&&(t=!0),listStuff(this,e,t,eras,(function(){var t={era:e};return r.eraCache[e]||(r.eraCache[e]=[Ot.utc(-40,1,1),Ot.utc(2017,1,1)].map((function(e){return r.extract(e,t,"era")}))),r.eraCache[e]}))},e.extract=function extract(e,t,r){var n=this.dtFormatter(e,t).formatToParts().find((function(e){return e.type.toLowerCase()===r}));return n?n.value:null},e.numberFormatter=function numberFormatter(e){return void 0===e&&(e={}),new we(this.intl,e.forceSimple||this.fastNumbers,e)},e.dtFormatter=function dtFormatter(e,t){return void 0===t&&(t={}),new be(e,this.intl,t)},e.relFormatter=function relFormatter(e){return void 0===e&&(e={}),new Ce(this.intl,this.isEnglish(),e)},e.isEnglish=function isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},e.equals=function equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},_createClass(Locale,[{key:"fastNumbers",get:function get(){return null==this.fastNumbersCached&&(this.fastNumbersCached=function supportsFastNumbers(e){return(!e.numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)}(this)),this.fastNumbersCached}}]),Locale}();function combineRegexes(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.reduce((function(e,t){return e+t.source}),"");return RegExp("^"+n+"$")}function combineExtractors(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduce((function(t,r){var n=t[0],i=t[1],o=t[2],a=r(e,o),s=a[0],c=a[1],l=a[2];return[_extends({},n,s),i||c,l]}),[{},null,1]).slice(0,2)}}function parse(e){if(null==e)return[null,null];for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,o=r;i<o.length;i++){var a=o[i],s=a[0],c=a[1],l=s.exec(e);if(l)return c(l)}return[null,null]}function simpleParse(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e,r){var n,i={};for(n=0;n<t.length;n++)i[t[n]]=parseInteger(e[r+n]);return[i,null,r+n]}}var Se=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Te=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Oe=RegExp(""+Te.source+Se.source+"?"),Re=RegExp("(?:T"+Oe.source+")?"),Ie=simpleParse("weekYear","weekNumber","weekDay"),Ee=simpleParse("year","ordinal"),Le=RegExp(Te.source+" ?(?:"+Se.source+"|("+x.source+"))?"),Me=RegExp("(?: "+Le.source+")?");function int(e,t,r){var n=e[t];return isUndefined(n)?r:parseInteger(n)}function extractISOYmd(e,t){return[{year:int(e,t),month:int(e,t+1,1),day:int(e,t+2,1)},null,t+3]}function extractISOTime(e,t){return[{hours:int(e,t,0),minutes:int(e,t+1,0),seconds:int(e,t+2,0),milliseconds:parseMillis(e[t+3])},null,t+4]}function extractISOOffset(e,t){var r=!e[t]&&!e[t+1],n=signedOffset(e[t+1],e[t+2]);return[{},r?null:oe.instance(n),t+3]}function extractIANAZone(e,t){return[{},e[t]?ne.create(e[t]):null,t+1]}var Ae=RegExp("^T?"+Te.source+"$"),De=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function extractISODuration(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u="-"===t[0],p=c&&"-"===c[0],d=function maybeNegate(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&u)?-e:e};return[{years:d(parseFloating(r)),months:d(parseFloating(n)),weeks:d(parseFloating(i)),days:d(parseFloating(o)),hours:d(parseFloating(a)),minutes:d(parseFloating(s)),seconds:d(parseFloating(c),"-0"===c),milliseconds:d(parseMillis(l),p)}]}var Pe={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fromStrings(e,t,r,n,i,o,a){var s={year:2===t.length?untruncateYear(parseInteger(t)):parseInteger(t),month:N.indexOf(r)+1,day:parseInteger(n),hour:parseInteger(i),minute:parseInteger(o)};return a&&(s.second=parseInteger(a)),e&&(s.weekday=e.length>3?B.indexOf(e)+1:U.indexOf(e)+1),s}var je=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(e){var t,r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],p=e[10],d=e[11],h=fromStrings(r,o,i,n,a,s,c);return t=l?Pe[l]:u?0:signedOffset(p,d),[h,new oe(t)]}var ke=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,xe=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Fe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(e){var t=e[1],r=e[2],n=e[3];return[fromStrings(t,e[4],n,r,e[5],e[6],e[7]),oe.utcInstance]}function extractASCII(e){var t=e[1],r=e[2],n=e[3],i=e[4],o=e[5],a=e[6];return[fromStrings(t,e[7],r,n,i,o,a),oe.utcInstance]}var Ne=combineRegexes(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Re),ze=combineRegexes(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Re),Be=combineRegexes(/(\d{4})-?(\d{3})/,Re),Ue=combineRegexes(Oe),qe=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset),We=combineExtractors(Ie,extractISOTime,extractISOOffset),Ve=combineExtractors(Ee,extractISOTime,extractISOOffset),Ge=combineExtractors(extractISOTime,extractISOOffset);var Ke=combineExtractors(extractISOTime);var $e=combineRegexes(/(\d{4})-(\d\d)-(\d\d)/,Me),He=combineRegexes(Le),Je=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone),Ze=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);var Ye={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Qe=_extends({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Ye),Xe=365.2425,et=30.436875,tt=_extends({years:{quarters:4,months:12,weeks:52.1775,days:Xe,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:et,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Ye),rt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],nt=rt.slice(0).reverse();function clone$1(e,t,r){void 0===r&&(r=!1);var n={values:r?t.values:_extends({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new it(n)}function convert(e,t,r,n,i){var o=e[i][r],a=t[r]/o,s=!(Math.sign(a)===Math.sign(n[i]))&&0!==n[i]&&Math.abs(a)<=1?function antiTrunc(e){return e<0?Math.floor(e):Math.ceil(e)}(a):Math.trunc(a);n[i]+=s,t[r]-=s*o}var it=function(){function Duration(e){var t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||_e.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?tt:Qe,this.isLuxonDuration=!0}Duration.fromMillis=function fromMillis(e,t){return Duration.fromObject({milliseconds:e},t)},Duration.fromObject=function fromObject(e,t){if(void 0===t&&(t={}),null==e||"object"!=typeof e)throw new c("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Duration({values:normalizeObject(e,Duration.normalizeUnit),loc:_e.fromObject(t),conversionAccuracy:t.conversionAccuracy})},Duration.fromDurationLike=function fromDurationLike(e){if(isNumber(e))return Duration.fromMillis(e);if(Duration.isDuration(e))return e;if("object"==typeof e)return Duration.fromObject(e);throw new c("Unknown duration argument "+e+" of type "+typeof e)},Duration.fromISO=function fromISO(e,t){var r=function parseISODuration(e){return parse(e,[De,extractISODuration])}(e),n=r[0];return n?Duration.fromObject(n,t):Duration.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},Duration.fromISOTime=function fromISOTime(e,t){var r=function parseISOTimeOnly(e){return parse(e,[Ae,Ke])}(e),n=r[0];return n?Duration.fromObject(n,t):Duration.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},Duration.invalid=function invalid(e,t){if(void 0===t&&(t=null),!e)throw new c("need to specify a reason the Duration is invalid");var invalid=e instanceof J?e:new J(e,t);if(de.throwOnInvalid)throw new o(invalid);return new Duration({invalid})},Duration.normalizeUnit=function normalizeUnit(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new s(e);return t},Duration.isDuration=function isDuration(e){return e&&e.isLuxonDuration||!1};var e=Duration.prototype;return e.toFormat=function toFormat(e,t){void 0===t&&(t={});var r=_extends({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?H.create(this.loc,r).formatDurationFromString(this,e):"Invalid Duration"},e.toObject=function toObject(){return this.isValid?_extends({},this.values):{}},e.toISO=function toISO(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=roundTo(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},e.toISOTime=function toISOTime(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();if(t<0||t>=864e5)return null;e=_extends({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e);var r=this.shiftTo("hours","minutes","seconds","milliseconds"),n="basic"===e.format?"hhmm":"hh:mm";e.suppressSeconds&&0===r.seconds&&0===r.milliseconds||(n+="basic"===e.format?"ss":":ss",e.suppressMilliseconds&&0===r.milliseconds||(n+=".SSS"));var i=r.toFormat(n);return e.includePrefix&&(i="T"+i),i},e.toJSON=function toJSON(){return this.toISO()},e.toString=function toString(){return this.toISO()},e.toMillis=function toMillis(){return this.as("milliseconds")},e.valueOf=function valueOf(){return this.toMillis()},e.plus=function plus(e){if(!this.isValid)return this;for(var t,r=Duration.fromDurationLike(e),n={},i=_createForOfIteratorHelperLoose(rt);!(t=i()).done;){var o=t.value;(hasOwnProperty(r.values,o)||hasOwnProperty(this.values,o))&&(n[o]=r.get(o)+this.get(o))}return clone$1(this,{values:n},!0)},e.minus=function minus(e){if(!this.isValid)return this;var t=Duration.fromDurationLike(e);return this.plus(t.negate())},e.mapUnits=function mapUnits(e){if(!this.isValid)return this;for(var t={},r=0,n=Object.keys(this.values);r<n.length;r++){var i=n[r];t[i]=asNumber(e(this.values[i],i))}return clone$1(this,{values:t},!0)},e.get=function get(e){return this[Duration.normalizeUnit(e)]},e.set=function set(e){return this.isValid?clone$1(this,{values:_extends({},this.values,normalizeObject(e,Duration.normalizeUnit))}):this},e.reconfigure=function reconfigure(e){var t=void 0===e?{}:e,r=t.locale,n=t.numberingSystem,i=t.conversionAccuracy,o={loc:this.loc.clone({locale:r,numberingSystem:n})};return i&&(o.conversionAccuracy=i),clone$1(this,o)},e.as=function as(e){return this.isValid?this.shiftTo(e).get(e):NaN},e.normalize=function normalize(){if(!this.isValid)return this;var e=this.toObject();return function normalizeValues(e,t){nt.reduce((function(r,n){return isUndefined(t[n])?r:(r&&convert(e,t,r,t,n),n)}),null)}(this.matrix,e),clone$1(this,{values:e},!0)},e.shiftTo=function shiftTo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!this.isValid)return this;if(0===t.length)return this;t=t.map((function(e){return Duration.normalizeUnit(e)}));for(var n,i,o={},a={},s=this.toObject(),c=_createForOfIteratorHelperLoose(rt);!(i=c()).done;){var l=i.value;if(t.indexOf(l)>=0){n=l;var u=0;for(var p in a)u+=this.matrix[p][l]*a[p],a[p]=0;isNumber(s[l])&&(u+=s[l]);var d=Math.trunc(u);for(var h in o[l]=d,a[l]=(1e3*u-1e3*d)/1e3,s)rt.indexOf(h)>rt.indexOf(l)&&convert(this.matrix,s,h,o,l)}else isNumber(s[l])&&(a[l]=s[l])}for(var g in a)0!==a[g]&&(o[n]+=g===n?a[g]:a[g]/this.matrix[n][g]);return clone$1(this,{values:o},!0).normalize()},e.negate=function negate(){if(!this.isValid)return this;for(var e={},t=0,r=Object.keys(this.values);t<r.length;t++){var n=r[t];e[n]=-this.values[n]}return clone$1(this,{values:e},!0)},e.equals=function equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t,r=_createForOfIteratorHelperLoose(rt);!(t=r()).done;){var n=t.value;if(i=this.values[n],o=e.values[n],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},_createClass(Duration,[{key:"locale",get:function get(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function get(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function get(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function get(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function get(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function get(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function get(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function get(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function get(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function get(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function get(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function get(){return null===this.invalid}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null}}]),Duration}(),ot="Invalid Interval";function validateStartEnd(e,t){return e&&e.isValid?t&&t.isValid?t<e?at.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+t.toISO()):null:at.invalid("missing or invalid end"):at.invalid("missing or invalid start")}var at=function(){function Interval(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}Interval.invalid=function invalid(e,t){if(void 0===t&&(t=null),!e)throw new c("need to specify a reason the Interval is invalid");var invalid=e instanceof J?e:new J(e,t);if(de.throwOnInvalid)throw new i(invalid);return new Interval({invalid})},Interval.fromDateTimes=function fromDateTimes(e,t){var r=friendlyDateTime(e),n=friendlyDateTime(t),i=validateStartEnd(r,n);return null==i?new Interval({start:r,end:n}):i},Interval.after=function after(e,t){var r=it.fromDurationLike(t),n=friendlyDateTime(e);return Interval.fromDateTimes(n,n.plus(r))},Interval.before=function before(e,t){var r=it.fromDurationLike(t),n=friendlyDateTime(e);return Interval.fromDateTimes(n.minus(r),n)},Interval.fromISO=function fromISO(e,t){var r=(e||"").split("/",2),n=r[0],i=r[1];if(n&&i){var o,a,s,c;try{a=(o=Ot.fromISO(n,t)).isValid}catch(i){a=!1}try{c=(s=Ot.fromISO(i,t)).isValid}catch(i){c=!1}if(a&&c)return Interval.fromDateTimes(o,s);if(a){var l=it.fromISO(i,t);if(l.isValid)return Interval.after(o,l)}else if(c){var u=it.fromISO(n,t);if(u.isValid)return Interval.before(s,u)}}return Interval.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},Interval.isInterval=function isInterval(e){return e&&e.isLuxonInterval||!1};var e=Interval.prototype;return e.length=function length(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},e.count=function count(e){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var t=this.start.startOf(e),r=this.end.startOf(e);return Math.floor(r.diff(t,e).get(e))+1},e.hasSame=function hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},e.isEmpty=function isEmpty(){return this.s.valueOf()===this.e.valueOf()},e.isAfter=function isAfter(e){return!!this.isValid&&this.s>e},e.isBefore=function isBefore(e){return!!this.isValid&&this.e<=e},e.contains=function contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)},e.set=function set(e){var t=void 0===e?{}:e,r=t.start,n=t.end;return this.isValid?Interval.fromDateTimes(r||this.s,n||this.e):this},e.splitAt=function splitAt(){var e=this;if(!this.isValid)return[];for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=r.map(friendlyDateTime).filter((function(t){return e.contains(t)})).sort(),o=[],a=this.s,s=0;a<this.e;){var c=i[s]||this.e,l=+c>+this.e?this.e:c;o.push(Interval.fromDateTimes(a,l)),a=l,s+=1}return o},e.splitBy=function splitBy(e){var t=it.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];for(var r,n=this.s,i=1,o=[];n<this.e;){var a=this.start.plus(t.mapUnits((function(e){return e*i})));r=+a>+this.e?this.e:a,o.push(Interval.fromDateTimes(n,r)),n=r,i+=1}return o},e.divideEqually=function divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},e.overlaps=function overlaps(e){return this.e>e.s&&this.s<e.e},e.abutsStart=function abutsStart(e){return!!this.isValid&&+this.e==+e.s},e.abutsEnd=function abutsEnd(e){return!!this.isValid&&+e.e==+this.s},e.engulfs=function engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},e.equals=function equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},e.intersection=function intersection(e){if(!this.isValid)return this;var t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:Interval.fromDateTimes(t,r)},e.union=function union(e){if(!this.isValid)return this;var t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return Interval.fromDateTimes(t,r)},Interval.merge=function merge(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var r=e[0],n=e[1];return n?n.overlaps(t)||n.abutsStart(t)?[r,n.union(t)]:[r.concat([n]),t]:[r,t]}),[[],null]),r=t[0],n=t[1];return n&&r.push(n),r},Interval.xor=function xor(e){for(var t,r,n=null,i=0,o=[],a=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),s=_createForOfIteratorHelperLoose((t=Array.prototype).concat.apply(t,a).sort((function(e,t){return e.time-t.time})));!(r=s()).done;){var c=r.value;1===(i+="s"===c.type?1:-1)?n=c.time:(n&&+n!=+c.time&&o.push(Interval.fromDateTimes(n,c.time)),n=null)}return Interval.merge(o)},e.difference=function difference(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Interval.xor([this].concat(r)).map((function(t){return e.intersection(t)})).filter((function(e){return e&&!e.isEmpty()}))},e.toString=function toString(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":ot},e.toISO=function toISO(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):ot},e.toISODate=function toISODate(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():ot},e.toISOTime=function toISOTime(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):ot},e.toFormat=function toFormat(e,t){var r=(void 0===t?{}:t).separator,n=void 0===r?" – ":r;return this.isValid?""+this.s.toFormat(e)+n+this.e.toFormat(e):ot},e.toDuration=function toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):it.invalid(this.invalidReason)},e.mapEndpoints=function mapEndpoints(e){return Interval.fromDateTimes(e(this.s),e(this.e))},_createClass(Interval,[{key:"start",get:function get(){return this.isValid?this.s:null}},{key:"end",get:function get(){return this.isValid?this.e:null}},{key:"isValid",get:function get(){return null===this.invalidReason}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null}}]),Interval}(),st=function(){function Info(){}return Info.hasDST=function hasDST(e){void 0===e&&(e=de.defaultZone);var t=Ot.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},Info.isValidIANAZone=function isValidIANAZone(e){return ne.isValidSpecifier(e)&&ne.isValidZone(e)},Info.normalizeZone=function normalizeZone$1(e){return normalizeZone(e,de.defaultZone)},Info.months=function months(e,t){void 0===e&&(e="long");var r=void 0===t?{}:t,n=r.locale,i=void 0===n?null:n,o=r.numberingSystem,a=void 0===o?null:o,s=r.locObj,c=void 0===s?null:s,l=r.outputCalendar,u=void 0===l?"gregory":l;return(c||_e.create(i,a,u)).months(e)},Info.monthsFormat=function monthsFormat(e,t){void 0===e&&(e="long");var r=void 0===t?{}:t,n=r.locale,i=void 0===n?null:n,o=r.numberingSystem,a=void 0===o?null:o,s=r.locObj,c=void 0===s?null:s,l=r.outputCalendar,u=void 0===l?"gregory":l;return(c||_e.create(i,a,u)).months(e,!0)},Info.weekdays=function weekdays(e,t){void 0===e&&(e="long");var r=void 0===t?{}:t,n=r.locale,i=void 0===n?null:n,o=r.numberingSystem,a=void 0===o?null:o,s=r.locObj;return((void 0===s?null:s)||_e.create(i,a,null)).weekdays(e)},Info.weekdaysFormat=function weekdaysFormat(e,t){void 0===e&&(e="long");var r=void 0===t?{}:t,n=r.locale,i=void 0===n?null:n,o=r.numberingSystem,a=void 0===o?null:o,s=r.locObj;return((void 0===s?null:s)||_e.create(i,a,null)).weekdays(e,!0)},Info.meridiems=function meridiems(e){var t=(void 0===e?{}:e).locale,r=void 0===t?null:t;return _e.create(r).meridiems()},Info.eras=function eras(e,t){void 0===e&&(e="short");var r=(void 0===t?{}:t).locale,n=void 0===r?null:r;return _e.create(n,null,"gregory").eras(e)},Info.features=function features(){return{relative:hasRelative()}},Info}();function dayDiff(e,t){var r=function utcDayStart(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},n=r(t)-r(e);return Math.floor(it.fromMillis(n).as("days"))}function _diff(e,t,r,n){var i=function highOrderDiffs(e,t,r){for(var n,i,o={},a=0,s=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var r=dayDiff(e,t);return(r-r%7)/7}],["days",dayDiff]];a<s.length;a++){var c=s[a],l=c[0],u=c[1];if(r.indexOf(l)>=0){var p;n=l;var d,h=u(e,t);(i=e.plus(((p={})[l]=h,p)))>t?(e=e.plus(((d={})[l]=h-1,d)),h-=1):e=i,o[l]=h}}return[e,o,i,n]}(e,t,r),o=i[0],a=i[1],s=i[2],c=i[3],l=t-o,u=r.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));if(0===u.length){var p;if(s<t)s=o.plus(((p={})[c]=1,p));s!==o&&(a[c]=(a[c]||0)+l/(s-o))}var d,h=it.fromObject(a,n);return u.length>0?(d=it.fromMillis(l,n)).shiftTo.apply(d,u).plus(h):h}var ct={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},lt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ut=ct.hanidec.replace(/[\[|\]]/g,"").split("");function digitRegex(e,t){var r=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+ct[r||"latn"]+t)}function intUnit(e,t){return void 0===t&&(t=function post(e){return e}),{regex:e,deser:function deser(e){var r=e[0];return t(function parseDigits(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);if(-1!==e[r].search(ct.hanidec))t+=ut.indexOf(e[r]);else for(var i in lt){var o=lt[i],a=o[0],s=o[1];n>=a&&n<=s&&(t+=n-a)}}return parseInt(t,10)}return t}(r))}}}var pt="( |"+String.fromCharCode(160)+")",ft=new RegExp(pt,"g");function fixListRegex(e){return e.replace(/\./g,"\\.?").replace(ft,pt)}function stripInsensitivities(e){return e.replace(/\./g,"").replace(ft," ").toLowerCase()}function oneOf(e,t){return null===e?null:{regex:RegExp(e.map(fixListRegex).join("|")),deser:function deser(r){var n=r[0];return e.findIndex((function(e){return stripInsensitivities(n)===stripInsensitivities(e)}))+t}}}function offset(e,t){return{regex:e,deser:function deser(e){return signedOffset(e[1],e[2])},groups:t}}function simple(e){return{regex:e,deser:function deser(e){return e[0]}}}function escapeToken(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var dt={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};var ht=null;function maybeExpandMacroToken(e,t){if(e.literal)return e;var r=H.macroTokenToFormatOpts(e.val);if(!r)return e;var n=H.create(t,r).formatDateTimeParts(function getDummyDateTime(){return ht||(ht=Ot.fromMillis(1555555555555)),ht}()).map((function(e){return function tokenForPart(e,t,r){var n=e.type,i=e.value;if("literal"===n)return{literal:!0,val:i};var o=r[n],a=dt[n];return"object"==typeof a&&(a=a[o]),a?{literal:!1,val:a}:void 0}(e,0,r)}));return n.includes(void 0)?e:n}function explainFromTokens(e,t,r){var n=function expandMacroTokens(e,t){var r;return(r=Array.prototype).concat.apply(r,e.map((function(e){return maybeExpandMacroToken(e,t)})))}(H.parseFormat(r),e),i=n.map((function(t){return function unitForToken(e,t){var r=digitRegex(t),n=digitRegex(t,"{2}"),i=digitRegex(t,"{3}"),o=digitRegex(t,"{4}"),a=digitRegex(t,"{6}"),s=digitRegex(t,"{1,2}"),c=digitRegex(t,"{1,3}"),l=digitRegex(t,"{1,6}"),u=digitRegex(t,"{1,9}"),p=digitRegex(t,"{2,4}"),d=digitRegex(t,"{4,6}"),h=function literal(e){return{regex:RegExp(escapeToken(e.val)),deser:function deser(e){return e[0]},literal:!0}},g=function unitate(g){if(e.literal)return h(g);switch(g.val){case"G":return oneOf(t.eras("short",!1),0);case"GG":return oneOf(t.eras("long",!1),0);case"y":return intUnit(l);case"yy":case"kk":return intUnit(p,untruncateYear);case"yyyy":case"kkkk":return intUnit(o);case"yyyyy":return intUnit(d);case"yyyyyy":return intUnit(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return intUnit(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return intUnit(n);case"MMM":return oneOf(t.months("short",!0,!1),1);case"MMMM":return oneOf(t.months("long",!0,!1),1);case"LLL":return oneOf(t.months("short",!1,!1),1);case"LLLL":return oneOf(t.months("long",!1,!1),1);case"o":case"S":return intUnit(c);case"ooo":case"SSS":return intUnit(i);case"u":return simple(u);case"uu":return simple(s);case"uuu":case"E":case"c":return intUnit(r);case"a":return oneOf(t.meridiems(),0);case"EEE":return oneOf(t.weekdays("short",!1,!1),1);case"EEEE":return oneOf(t.weekdays("long",!1,!1),1);case"ccc":return oneOf(t.weekdays("short",!0,!1),1);case"cccc":return oneOf(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return offset(new RegExp("([+-]"+s.source+")(?::("+n.source+"))?"),2);case"ZZZ":return offset(new RegExp("([+-]"+s.source+")("+n.source+")?"),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);default:return h(g)}}(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return g.token=e,g}(t,e)})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:n,invalidReason:o.invalidReason};var s=function buildRegex(e){return["^"+e.map((function(e){return e.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"")+"$",e]}(i),c=s[0],l=s[1],u=RegExp(c,"i"),p=function match(e,t,r){var n=e.match(t);if(n){var i={},o=1;for(var a in r)if(hasOwnProperty(r,a)){var s=r[a],c=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(n.slice(o,o+c))),o+=c}return[n,i]}return[n,{}]}(t,u,l),d=p[0],h=p[1],g=h?function dateTimeFromMatches(e){var t,r=null;return isUndefined(e.z)||(r=ne.create(e.z)),isUndefined(e.Z)||(r||(r=new oe(e.Z)),t=e.Z),isUndefined(e.q)||(e.M=3*(e.q-1)+1),isUndefined(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),isUndefined(e.u)||(e.S=parseMillis(e.u)),[Object.keys(e).reduce((function(t,r){var n=function toField(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(r);return n&&(t[n]=e[r]),t}),{}),r,t]}(h):[null,null,void 0],y=g[0],m=g[1],v=g[2];if(hasOwnProperty(h,"a")&&hasOwnProperty(h,"H"))throw new a("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:u,rawMatches:d,matches:h,result:y,zone:m,specificOffset:v}}var gt=[0,31,59,90,120,151,181,212,243,273,304,334],yt=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(e,t){return new J("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function dayOfWeek(e,t,r){var n=new Date(Date.UTC(e,t-1,r)).getUTCDay();return 0===n?7:n}function computeOrdinal(e,t,r){return r+(isLeapYear(e)?yt:gt)[t-1]}function uncomputeOrdinal(e,t){var r=isLeapYear(e)?yt:gt,n=r.findIndex((function(e){return e<t}));return{month:n+1,day:t-r[n]}}function gregorianToWeek(e){var t,r=e.year,n=e.month,i=e.day,o=computeOrdinal(r,n,i),a=dayOfWeek(r,n,i),s=Math.floor((o-a+10)/7);return s<1?s=weeksInWeekYear(t=r-1):s>weeksInWeekYear(r)?(t=r+1,s=1):t=r,_extends({weekYear:t,weekNumber:s,weekday:a},timeObject(e))}function weekToGregorian(e){var t,r=e.weekYear,n=e.weekNumber,i=e.weekday,o=dayOfWeek(r,1,4),a=daysInYear(r),s=7*n+i-o-3;s<1?s+=daysInYear(t=r-1):s>a?(t=r+1,s-=daysInYear(r)):t=r;var c=uncomputeOrdinal(t,s);return _extends({year:t,month:c.month,day:c.day},timeObject(e))}function gregorianToOrdinal(e){var t=e.year;return _extends({year:t,ordinal:computeOrdinal(t,e.month,e.day)},timeObject(e))}function ordinalToGregorian(e){var t=e.year,r=uncomputeOrdinal(t,e.ordinal);return _extends({year:t,month:r.month,day:r.day},timeObject(e))}function hasInvalidGregorianData(e){var t=isInteger(e.year),r=integerBetween(e.month,1,12),n=integerBetween(e.day,1,daysInMonth(e.year,e.month));return t?r?!n&&unitOutOfRange("day",e.day):unitOutOfRange("month",e.month):unitOutOfRange("year",e.year)}function hasInvalidTimeData(e){var t=e.hour,r=e.minute,n=e.second,i=e.millisecond,o=integerBetween(t,0,23)||24===t&&0===r&&0===n&&0===i,a=integerBetween(r,0,59),s=integerBetween(n,0,59),c=integerBetween(i,0,999);return o?a?s?!c&&unitOutOfRange("millisecond",i):unitOutOfRange("second",n):unitOutOfRange("minute",r):unitOutOfRange("hour",t)}var mt="Invalid DateTime",vt=864e13;function unsupportedZone(e){return new J("unsupported zone",'the zone "'+e.name+'" is not supported')}function possiblyCachedWeekData(e){return null===e.weekData&&(e.weekData=gregorianToWeek(e.c)),e.weekData}function clone(e,t){var r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ot(_extends({},r,t,{old:r}))}function fixOffset(e,t,r){var n=e-60*t*1e3,i=r.offset(n);if(t===i)return[n,t];n-=60*(i-t)*1e3;var o=r.offset(n);return i===o?[n,i]:[e-60*Math.min(i,o)*1e3,Math.max(i,o)]}function tsToObj(e,t){var r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function objToTS(e,t,r){return fixOffset(objToLocalTS(e),t,r)}function adjustTime(e,t){var r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=_extends({},e.c,{year:n,month:i,day:Math.min(e.c.day,daysInMonth(n,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),a=it.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=fixOffset(objToLocalTS(o),r,e.zone),c=s[0],l=s[1];return 0!==a&&(c+=a,l=e.zone.offset(c)),{ts:c,o:l}}function parseDataToDateTime(e,t,r,n,i,o){var a=r.setZone,s=r.zone;if(e&&0!==Object.keys(e).length){var c=t||s,l=Ot.fromObject(e,_extends({},r,{zone:c,specificOffset:o}));return a?l:l.setZone(s)}return Ot.invalid(new J("unparsable",'the input "'+i+"\" can't be parsed as "+n))}function toTechFormat(e,t,r){return void 0===r&&(r=!0),e.isValid?H.create(_e.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function toTechTimeFormat(e,t){var r=t.suppressSeconds,n=void 0!==r&&r,i=t.suppressMilliseconds,o=void 0!==i&&i,a=t.includeOffset,s=t.includePrefix,c=void 0!==s&&s,l=t.includeZone,u=void 0!==l&&l,p=t.spaceZone,d=void 0!==p&&p,h=t.format,g=void 0===h?"extended":h,y="basic"===g?"HHmm":"HH:mm";n&&0===e.second&&0===e.millisecond||(y+="basic"===g?"ss":":ss",o&&0===e.millisecond||(y+=".SSS")),(u||a)&&d&&(y+=" "),u?y+="z":a&&(y+="basic"===g?"ZZZ":"ZZ");var m=toTechFormat(e,y);return c&&(m="T"+m),m}var wt={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},bt={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ct={ordinal:1,hour:0,minute:0,second:0,millisecond:0},_t=["year","month","day","hour","minute","second","millisecond"],St=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Tt=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnit(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new s(e);return t}function quickDT(e,t){var r,n,i=normalizeZone(t.zone,de.defaultZone),o=_e.fromObject(t),a=de.now();if(isUndefined(e.year))r=a;else{for(var s,c=_createForOfIteratorHelperLoose(_t);!(s=c()).done;){var l=s.value;isUndefined(e[l])&&(e[l]=wt[l])}var u=hasInvalidGregorianData(e)||hasInvalidTimeData(e);if(u)return Ot.invalid(u);var p=objToTS(e,i.offset(a),i);r=p[0],n=p[1]}return new Ot({ts:r,zone:i,loc:o,o:n})}function diffRelative(e,t,r){var n=!!isUndefined(r.round)||r.round,i=function format(e,i){return e=roundTo(e,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(e,i)},o=function differ(n){return r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n)};if(r.unit)return i(o(r.unit),r.unit);for(var a,s=_createForOfIteratorHelperLoose(r.units);!(a=s()).done;){var c=a.value,l=o(c);if(Math.abs(l)>=1)return i(l,c)}return i(e>t?-0:0,r.units[r.units.length-1])}function lastOpts(e){var t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}var Ot=function(){function DateTime(e){var t=e.zone||de.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new J("invalid input"):null)||(t.isValid?null:unsupportedZone(t));this.ts=isUndefined(e.ts)?de.now():e.ts;var n=null,i=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];n=o[0],i=o[1]}else{var a=t.offset(this.ts);n=tsToObj(this.ts,a),n=(r=Number.isNaN(n.year)?new J("invalid input"):null)?null:n,i=r?null:a}this._zone=t,this.loc=e.loc||_e.create(),this.invalid=r,this.weekData=null,this.c=n,this.o=i,this.isLuxonDateTime=!0}DateTime.now=function now(){return new DateTime({})},DateTime.local=function local(){var e=lastOpts(arguments),t=e[0],r=e[1],n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],l=r[6];return quickDT({year:n,month:i,day:o,hour:a,minute:s,second:c,millisecond:l},t)},DateTime.utc=function utc(){var e=lastOpts(arguments),t=e[0],r=e[1],n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],l=r[6];return t.zone=oe.utcInstance,quickDT({year:n,month:i,day:o,hour:a,minute:s,second:c,millisecond:l},t)},DateTime.fromJSDate=function fromJSDate(e,t){void 0===t&&(t={});var r=function isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return DateTime.invalid("invalid input");var n=normalizeZone(t.zone,de.defaultZone);return n.isValid?new DateTime({ts:r,zone:n,loc:_e.fromObject(t)}):DateTime.invalid(unsupportedZone(n))},DateTime.fromMillis=function fromMillis(e,t){if(void 0===t&&(t={}),isNumber(e))return e<-vt||e>vt?DateTime.invalid("Timestamp out of range"):new DateTime({ts:e,zone:normalizeZone(t.zone,de.defaultZone),loc:_e.fromObject(t)});throw new c("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},DateTime.fromSeconds=function fromSeconds(e,t){if(void 0===t&&(t={}),isNumber(e))return new DateTime({ts:1e3*e,zone:normalizeZone(t.zone,de.defaultZone),loc:_e.fromObject(t)});throw new c("fromSeconds requires a numerical input")},DateTime.fromObject=function fromObject(e,t){void 0===t&&(t={}),e=e||{};var r=normalizeZone(t.zone,de.defaultZone);if(!r.isValid)return DateTime.invalid(unsupportedZone(r));var n=de.now(),i=isUndefined(t.specificOffset)?r.offset(n):t.specificOffset,o=normalizeObject(e,normalizeUnit),s=!isUndefined(o.ordinal),c=!isUndefined(o.year),l=!isUndefined(o.month)||!isUndefined(o.day),u=c||l,p=o.weekYear||o.weekNumber,d=_e.fromObject(t);if((u||s)&&p)throw new a("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new a("Can't mix ordinal dates with month/day");var h,g,y=p||o.weekday&&!u,m=tsToObj(n,i);y?(h=St,g=bt,m=gregorianToWeek(m)):s?(h=Tt,g=Ct,m=gregorianToOrdinal(m)):(h=_t,g=wt);for(var v,w=!1,b=_createForOfIteratorHelperLoose(h);!(v=b()).done;){var C=v.value;isUndefined(o[C])?o[C]=w?g[C]:m[C]:w=!0}var _=y?function hasInvalidWeekData(e){var t=isInteger(e.weekYear),r=integerBetween(e.weekNumber,1,weeksInWeekYear(e.weekYear)),n=integerBetween(e.weekday,1,7);return t?r?!n&&unitOutOfRange("weekday",e.weekday):unitOutOfRange("week",e.week):unitOutOfRange("weekYear",e.weekYear)}(o):s?function hasInvalidOrdinalData(e){var t=isInteger(e.year),r=integerBetween(e.ordinal,1,daysInYear(e.year));return t?!r&&unitOutOfRange("ordinal",e.ordinal):unitOutOfRange("year",e.year)}(o):hasInvalidGregorianData(o),S=_||hasInvalidTimeData(o);if(S)return DateTime.invalid(S);var T=objToTS(y?weekToGregorian(o):s?ordinalToGregorian(o):o,i,r),O=new DateTime({ts:T[0],zone:r,o:T[1],loc:d});return o.weekday&&u&&e.weekday!==O.weekday?DateTime.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+O.toISO()):O},DateTime.fromISO=function fromISO(e,t){void 0===t&&(t={});var r=function parseISODate(e){return parse(e,[Ne,qe],[ze,We],[Be,Ve],[Ue,Ge])}(e);return parseDataToDateTime(r[0],r[1],t,"ISO 8601",e)},DateTime.fromRFC2822=function fromRFC2822(e,t){void 0===t&&(t={});var r=function parseRFC2822Date(e){return parse(function preprocessRFC2822(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[je,extractRFC2822])}(e);return parseDataToDateTime(r[0],r[1],t,"RFC 2822",e)},DateTime.fromHTTP=function fromHTTP(e,t){void 0===t&&(t={});var r=function parseHTTPDate(e){return parse(e,[ke,extractRFC1123Or850],[xe,extractRFC1123Or850],[Fe,extractASCII])}(e);return parseDataToDateTime(r[0],r[1],t,"HTTP",t)},DateTime.fromFormat=function fromFormat(e,t,r){if(void 0===r&&(r={}),isUndefined(e)||isUndefined(t))throw new c("fromFormat requires an input string and a format");var n=r,i=n.locale,o=void 0===i?null:i,a=n.numberingSystem,s=void 0===a?null:a,l=function parseFromTokens(e,t,r){var n=explainFromTokens(e,t,r);return[n.result,n.zone,n.specificOffset,n.invalidReason]}(_e.fromOpts({locale:o,numberingSystem:s,defaultToEN:!0}),e,t),u=l[0],p=l[1],d=l[2],h=l[3];return h?DateTime.invalid(h):parseDataToDateTime(u,p,r,"format "+t,e,d)},DateTime.fromString=function fromString(e,t,r){return void 0===r&&(r={}),DateTime.fromFormat(e,t,r)},DateTime.fromSQL=function fromSQL(e,t){void 0===t&&(t={});var r=function parseSQL(e){return parse(e,[$e,Je],[He,Ze])}(e);return parseDataToDateTime(r[0],r[1],t,"SQL",e)},DateTime.invalid=function invalid(e,t){if(void 0===t&&(t=null),!e)throw new c("need to specify a reason the DateTime is invalid");var invalid=e instanceof J?e:new J(e,t);if(de.throwOnInvalid)throw new n(invalid);return new DateTime({invalid})},DateTime.isDateTime=function isDateTime(e){return e&&e.isLuxonDateTime||!1};var e=DateTime.prototype;return e.get=function get(e){return this[e]},e.resolvedLocaleOptions=function resolvedLocaleOptions(e){void 0===e&&(e={});var t=H.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},e.toUTC=function toUTC(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(oe.instance(e),t)},e.toLocal=function toLocal(){return this.setZone(de.defaultZone)},e.setZone=function setZone(e,t){var r=void 0===t?{}:t,n=r.keepLocalTime,i=void 0!==n&&n,o=r.keepCalendarTime,a=void 0!==o&&o;if((e=normalizeZone(e,de.defaultZone)).equals(this.zone))return this;if(e.isValid){var s=this.ts;if(i||a){var c=e.offset(this.ts);s=objToTS(this.toObject(),c,e)[0]}return clone(this,{ts:s,zone:e})}return DateTime.invalid(unsupportedZone(e))},e.reconfigure=function reconfigure(e){var t=void 0===e?{}:e,r=t.locale,n=t.numberingSystem,i=t.outputCalendar;return clone(this,{loc:this.loc.clone({locale:r,numberingSystem:n,outputCalendar:i})})},e.setLocale=function setLocale(e){return this.reconfigure({locale:e})},e.set=function set(e){if(!this.isValid)return this;var t,r=normalizeObject(e,normalizeUnit),n=!isUndefined(r.weekYear)||!isUndefined(r.weekNumber)||!isUndefined(r.weekday),i=!isUndefined(r.ordinal),o=!isUndefined(r.year),s=!isUndefined(r.month)||!isUndefined(r.day),c=o||s,l=r.weekYear||r.weekNumber;if((c||i)&&l)throw new a("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new a("Can't mix ordinal dates with month/day");n?t=weekToGregorian(_extends({},gregorianToWeek(this.c),r)):isUndefined(r.ordinal)?(t=_extends({},this.toObject(),r),isUndefined(r.day)&&(t.day=Math.min(daysInMonth(t.year,t.month),t.day))):t=ordinalToGregorian(_extends({},gregorianToOrdinal(this.c),r));var u=objToTS(t,this.o,this.zone);return clone(this,{ts:u[0],o:u[1]})},e.plus=function plus(e){return this.isValid?clone(this,adjustTime(this,it.fromDurationLike(e))):this},e.minus=function minus(e){return this.isValid?clone(this,adjustTime(this,it.fromDurationLike(e).negate())):this},e.startOf=function startOf(e){if(!this.isValid)return this;var t={},r=it.normalizeUnit(e);switch(r){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===r&&(t.weekday=1),"quarters"===r){var n=Math.ceil(this.month/3);t.month=3*(n-1)+1}return this.set(t)},e.endOf=function endOf(e){var t;return this.isValid?this.plus((t={},t[e]=1,t)).startOf(e).minus(1):this},e.toFormat=function toFormat(e,t){return void 0===t&&(t={}),this.isValid?H.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):mt},e.toLocaleString=function toLocaleString(e,t){return void 0===e&&(e=h),void 0===t&&(t={}),this.isValid?H.create(this.loc.clone(t),e).formatDateTime(this):mt},e.toLocaleParts=function toLocaleParts(e){return void 0===e&&(e={}),this.isValid?H.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},e.toISO=function toISO(e){return void 0===e&&(e={}),this.isValid?this.toISODate(e)+"T"+this.toISOTime(e):null},e.toISODate=function toISODate(e){var t=(void 0===e?{}:e).format,r="basic"===(void 0===t?"extended":t)?"yyyyMMdd":"yyyy-MM-dd";return this.year>9999&&(r="+"+r),toTechFormat(this,r)},e.toISOWeekDate=function toISOWeekDate(){return toTechFormat(this,"kkkk-'W'WW-c")},e.toISOTime=function toISOTime(e){var t=void 0===e?{}:e,r=t.suppressMilliseconds,n=void 0!==r&&r,i=t.suppressSeconds,o=void 0!==i&&i,a=t.includeOffset,s=void 0===a||a,c=t.includePrefix,l=void 0!==c&&c,u=t.format;return toTechTimeFormat(this,{suppressSeconds:o,suppressMilliseconds:n,includeOffset:s,includePrefix:l,format:void 0===u?"extended":u})},e.toRFC2822=function toRFC2822(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},e.toHTTP=function toHTTP(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},e.toSQLDate=function toSQLDate(){return toTechFormat(this,"yyyy-MM-dd")},e.toSQLTime=function toSQLTime(e){var t=void 0===e?{}:e,r=t.includeOffset,n=void 0===r||r,i=t.includeZone;return toTechTimeFormat(this,{includeOffset:n,includeZone:void 0!==i&&i,spaceZone:!0})},e.toSQL=function toSQL(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},e.toString=function toString(){return this.isValid?this.toISO():mt},e.valueOf=function valueOf(){return this.toMillis()},e.toMillis=function toMillis(){return this.isValid?this.ts:NaN},e.toSeconds=function toSeconds(){return this.isValid?this.ts/1e3:NaN},e.toJSON=function toJSON(){return this.toISO()},e.toBSON=function toBSON(){return this.toJSDate()},e.toObject=function toObject(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=_extends({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},e.toJSDate=function toJSDate(){return new Date(this.isValid?this.ts:NaN)},e.diff=function diff(e,t,r){if(void 0===t&&(t="milliseconds"),void 0===r&&(r={}),!this.isValid||!e.isValid)return it.invalid("created by diffing an invalid DateTime");var n=_extends({locale:this.locale,numberingSystem:this.numberingSystem},r),i=function maybeArray(e){return Array.isArray(e)?e:[e]}(t).map(it.normalizeUnit),o=e.valueOf()>this.valueOf(),a=_diff(o?this:e,o?e:this,i,n);return o?a.negate():a},e.diffNow=function diffNow(e,t){return void 0===e&&(e="milliseconds"),void 0===t&&(t={}),this.diff(DateTime.now(),e,t)},e.until=function until(e){return this.isValid?at.fromDateTimes(this,e):this},e.hasSame=function hasSame(e,t){if(!this.isValid)return!1;var r=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(t)<=r&&r<=n.endOf(t)},e.equals=function equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},e.toRelative=function toRelative(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=e.base||DateTime.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0,n=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(n=e.unit,i=void 0),diffRelative(t,this.plus(r),_extends({},e,{numeric:"always",units:n,unit:i}))},e.toRelativeCalendar=function toRelativeCalendar(e){return void 0===e&&(e={}),this.isValid?diffRelative(e.base||DateTime.fromObject({},{zone:this.zone}),this,_extends({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},DateTime.min=function min(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every(DateTime.isDateTime))throw new c("min requires all arguments be DateTimes");return bestBy(t,(function(e){return e.valueOf()}),Math.min)},DateTime.max=function max(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every(DateTime.isDateTime))throw new c("max requires all arguments be DateTimes");return bestBy(t,(function(e){return e.valueOf()}),Math.max)},DateTime.fromFormatExplain=function fromFormatExplain(e,t,r){void 0===r&&(r={});var n=r,i=n.locale,o=void 0===i?null:i,a=n.numberingSystem,s=void 0===a?null:a;return explainFromTokens(_e.fromOpts({locale:o,numberingSystem:s,defaultToEN:!0}),e,t)},DateTime.fromStringExplain=function fromStringExplain(e,t,r){return void 0===r&&(r={}),DateTime.fromFormatExplain(e,t,r)},_createClass(DateTime,[{key:"isValid",get:function get(){return null===this.invalid}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function get(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function get(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function get(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function get(){return this._zone}},{key:"zoneName",get:function get(){return this.isValid?this.zone.name:null}},{key:"year",get:function get(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function get(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function get(){return this.isValid?this.c.month:NaN}},{key:"day",get:function get(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function get(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function get(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function get(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function get(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN}},{key:"weekNumber",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN}},{key:"weekday",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN}},{key:"ordinal",get:function get(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN}},{key:"monthShort",get:function get(){return this.isValid?st.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function get(){return this.isValid?st.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function get(){return this.isValid?st.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function get(){return this.isValid?st.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function get(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function get(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function get(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function get(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function get(){return!this.isOffsetFixed&&(this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function get(){return isLeapYear(this.year)}},{key:"daysInMonth",get:function get(){return daysInMonth(this.year,this.month)}},{key:"daysInYear",get:function get(){return this.isValid?daysInYear(this.year):NaN}},{key:"weeksInWeekYear",get:function get(){return this.isValid?weeksInWeekYear(this.weekYear):NaN}}],[{key:"DATE_SHORT",get:function get(){return h}},{key:"DATE_MED",get:function get(){return g}},{key:"DATE_MED_WITH_WEEKDAY",get:function get(){return y}},{key:"DATE_FULL",get:function get(){return m}},{key:"DATE_HUGE",get:function get(){return v}},{key:"TIME_SIMPLE",get:function get(){return w}},{key:"TIME_WITH_SECONDS",get:function get(){return b}},{key:"TIME_WITH_SHORT_OFFSET",get:function get(){return C}},{key:"TIME_WITH_LONG_OFFSET",get:function get(){return _}},{key:"TIME_24_SIMPLE",get:function get(){return S}},{key:"TIME_24_WITH_SECONDS",get:function get(){return T}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function get(){return O}},{key:"TIME_24_WITH_LONG_OFFSET",get:function get(){return R}},{key:"DATETIME_SHORT",get:function get(){return I}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function get(){return E}},{key:"DATETIME_MED",get:function get(){return L}},{key:"DATETIME_MED_WITH_SECONDS",get:function get(){return M}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function get(){return A}},{key:"DATETIME_FULL",get:function get(){return D}},{key:"DATETIME_FULL_WITH_SECONDS",get:function get(){return P}},{key:"DATETIME_HUGE",get:function get(){return j}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function get(){return k}}]),DateTime}();function friendlyDateTime(e){if(Ot.isDateTime(e))return e;if(e&&e.valueOf&&isNumber(e.valueOf()))return Ot.fromJSDate(e);if(e&&"object"==typeof e)return Ot.fromObject(e);throw new c("Unknown datetime argument: "+e+", of type "+typeof e)}t.DateTime=Ot,t.Duration=it,t.FixedOffsetZone=oe,t.IANAZone=ne,t.Info=st,t.Interval=at,t.InvalidZone=ae,t.Settings=de,t.SystemZone=Q,t.VERSION="2.2.0",t.Zone=Z},631:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&c&&"function"==typeof c.get?c.get:null,u=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,g=Boolean.prototype.valueOf,y=Object.prototype.toString,m=Function.prototype.toString,v=String.prototype.match,w="function"==typeof BigInt?BigInt.prototype.valueOf:null,b=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,_="function"==typeof Symbol&&"object"==typeof Symbol.iterator,S=Object.prototype.propertyIsEnumerable,T=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),O=r(4654).custom,R=O&&isSymbol(O)?O:null,I="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function wrapQuotes(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function quote(e){return String(e).replace(/"/g,""")}function isArray(e){return!("[object Array]"!==toStr(e)||I&&"object"==typeof e&&I in e)}function isSymbol(e){if(_)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function inspect_(e,t,r,n){var i=t||{};if(has(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!has(i,"customInspect")||i.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return inspectString(e,i);if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);if("bigint"==typeof e)return String(e)+"n";var c=void 0===i.depth?5:i.depth;if(void 0===r&&(r=0),r>=c&&c>0&&"object"==typeof e)return isArray(e)?"[Array]":"[Object]";var y=function getIndent(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=Array(e.indent+1).join(" ")}return{base:r,prev:Array(t+1).join(r)}}(i,r);if(void 0===n)n=[];else if(indexOf(n,e)>=0)return"[Circular]";function inspect(e,t,o){if(t&&(n=n.slice()).push(t),o){var a={depth:i.depth};return has(i,"quoteStyle")&&(a.quoteStyle=i.quoteStyle),inspect_(e,a,r+1,n)}return inspect_(e,i,r+1,n)}if("function"==typeof e){var b=function nameOf(e){if(e.name)return e.name;var t=v.call(m.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(e),S=arrObjKeys(e,inspect);return"[Function"+(b?": "+b:" (anonymous)")+"]"+(S.length>0?" { "+S.join(", ")+" }":"")}if(isSymbol(e)){var O=_?String(e).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||_?O:markBoxed(O)}if(function isElement(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(e)){for(var E="<"+String(e.nodeName).toLowerCase(),L=e.attributes||[],M=0;M<L.length;M++)E+=" "+L[M].name+"="+wrapQuotes(quote(L[M].value),"double",i);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+String(e.nodeName).toLowerCase()+">"}if(isArray(e)){if(0===e.length)return"[]";var A=arrObjKeys(e,inspect);return y&&!function singleLineValues(e){for(var t=0;t<e.length;t++)if(indexOf(e[t],"\n")>=0)return!1;return!0}(A)?"["+indentedJoin(A,y)+"]":"[ "+A.join(", ")+" ]"}if(function isError(e){return!("[object Error]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e)){var D=arrObjKeys(e,inspect);return 0===D.length?"["+String(e)+"]":"{ ["+String(e)+"] "+D.join(", ")+" }"}if("object"==typeof e&&s){if(R&&"function"==typeof e[R])return e[R]();if("symbol"!==s&&"function"==typeof e.inspect)return e.inspect()}if(function isMap(e){if(!o||!e||"object"!=typeof e)return!1;try{o.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(e)){var P=[];return a.call(e,(function(t,r){P.push(inspect(r,e,!0)+" => "+inspect(t,e))})),collectionOf("Map",o.call(e),P,y)}if(function isSet(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{o.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(e)){var j=[];return u.call(e,(function(t){j.push(inspect(t,e))})),collectionOf("Set",l.call(e),j,y)}if(function isWeakMap(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(e))return weakCollectionOf("WeakMap");if(function isWeakSet(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(e))return weakCollectionOf("WeakSet");if(function isWeakRef(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(e))return weakCollectionOf("WeakRef");if(function isNumber(e){return!("[object Number]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e))return markBoxed(inspect(Number(e)));if(function isBigInt(e){if(!e||"object"!=typeof e||!w)return!1;try{return w.call(e),!0}catch(e){}return!1}(e))return markBoxed(inspect(w.call(e)));if(function isBoolean(e){return!("[object Boolean]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e))return markBoxed(g.call(e));if(function isString(e){return!("[object String]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e))return markBoxed(inspect(String(e)));if(!function isDate(e){return!("[object Date]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e)&&!function isRegExp(e){return!("[object RegExp]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e)){var k=arrObjKeys(e,inspect),x=T?T(e)===Object.prototype:e instanceof Object||e.constructor===Object,F=e instanceof Object?"":"null prototype",N=!x&&I&&Object(e)===e&&I in e?toStr(e).slice(8,-1):F?"Object":"",z=(x||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(N||F?"["+[].concat(N||[],F||[]).join(": ")+"] ":"");return 0===k.length?z+"{}":y?z+"{"+indentedJoin(k,y)+"}":z+"{ "+k.join(", ")+" }"}return String(e)};var E=Object.prototype.hasOwnProperty||function(e){return e in this};function has(e,t){return E.call(e,t)}function toStr(e){return y.call(e)}function indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function inspectString(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString(e.slice(0,t.maxStringLength),t)+n}return wrapQuotes(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,lowbyte),"single",t)}function lowbyte(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function markBoxed(e){return"Object("+e+")"}function weakCollectionOf(e){return e+" { ? }"}function collectionOf(e,t,r,n){return e+" ("+t+") {"+(n?indentedJoin(r,n):r.join(", "))+"}"}function indentedJoin(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+e.join(","+r)+"\n"+t.prev}function arrObjKeys(e,t){var r=isArray(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=has(e,i)?t(e[i],e):""}var o,a="function"==typeof b?b(e):[];if(_){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var c in e)has(e,c)&&(r&&String(Number(c))===c&&c<e.length||_&&o["$"+c]instanceof Symbol||(/[^\w$]/.test(c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if("function"==typeof b)for(var l=0;l<a.length;l++)S.call(e,a[l])&&n.push("["+t(a[l])+"]: "+t(e[a[l]],e));return n}},5798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC1738",i="RFC3986";e.exports={default:i,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:n,RFC3986:i}},129:(e,t,r)=>{"use strict";var n=r(8261),i=r(5235),o=r(5798);e.exports={formats:o,parse:i,stringify:n}},5235:(e,t,r)=>{"use strict";var n=r(2769),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},parseArrayValue=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s=function parseQueryStringKeys(e,t,r,n){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=s?o.slice(0,s.index):o,l=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var u=0;r.depth>0&&null!==(s=a.exec(o))&&u<r.depth;){if(u+=1,!r.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(s[1])}return s&&l.push("["+o.slice(s.index)+"]"),function(e,t,r,n){for(var i=n?t:parseArrayValue(t,r),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&s!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(a=[])[l]=i:a[c]=i:a={0:i}}i=a}return i}(l,t,r,n)}};e.exports=function(e,t){var r=function normalizeParseOptions(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var c="string"==typeof e?function parseQueryStringValues(e,t){var r,s={},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,l=t.parameterLimit===1/0?void 0:t.parameterLimit,u=c.split(t.delimiter,l),p=-1,d=t.charset;if(t.charsetSentinel)for(r=0;r<u.length;++r)0===u[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===u[r]?d="utf-8":"utf8=%26%2310003%3B"===u[r]&&(d="iso-8859-1"),p=r,r=u.length);for(r=0;r<u.length;++r)if(r!==p){var h,g,y=u[r],m=y.indexOf("]="),v=-1===m?y.indexOf("="):m+1;-1===v?(h=t.decoder(y,a.decoder,d,"key"),g=t.strictNullHandling?null:""):(h=t.decoder(y.slice(0,v),a.decoder,d,"key"),g=n.maybeMap(parseArrayValue(y.slice(v+1),t),(function(e){return t.decoder(e,a.decoder,d,"value")}))),g&&t.interpretNumericEntities&&"iso-8859-1"===d&&(g=interpretNumericEntities(g)),y.indexOf("[]=")>-1&&(g=o(g)?[g]:g),i.call(s,h)?s[h]=n.combine(s[h],g):s[h]=g}return s}(e,r):e,l=r.plainObjects?Object.create(null):{},u=Object.keys(c),p=0;p<u.length;++p){var d=u[p],h=s(d,c[d],r,"string"==typeof e);l=n.merge(l,h,r)}return!0===r.allowSparse?l:n.compact(l)}},8261:(e,t,r)=>{"use strict";var n=r(7478),i=r(2769),o=r(5798),a=Object.prototype.hasOwnProperty,s={brackets:function brackets(e){return e+"[]"},comma:"comma",indices:function indices(e,t){return e+"["+t+"]"},repeat:function repeat(e){return e}},c=Array.isArray,l=String.prototype.split,u=Array.prototype.push,pushToArray=function(e,t){u.apply(e,c(t)?t:[t])},p=Date.prototype.toISOString,d=o.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:d,formatter:o.formatters[d],indices:!1,serializeDate:function serializeDate(e){return p.call(e)},skipNulls:!1,strictNullHandling:!1},g={},y=function stringify(e,t,r,o,a,s,u,p,d,y,m,v,w,b,C){for(var _=e,S=C,T=0,O=!1;void 0!==(S=S.get(g))&&!O;){var R=S.get(e);if(T+=1,void 0!==R){if(R===T)throw new RangeError("Cyclic object value");O=!0}void 0===S.get(g)&&(T=0)}if("function"==typeof u?_=u(t,_):_ instanceof Date?_=y(_):"comma"===r&&c(_)&&(_=i.maybeMap(_,(function(e){return e instanceof Date?y(e):e}))),null===_){if(o)return s&&!w?s(t,h.encoder,b,"key",m):t;_=""}if(function isNonNullishPrimitive(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e}(_)||i.isBuffer(_)){if(s){var I=w?t:s(t,h.encoder,b,"key",m);if("comma"===r&&w){for(var E=l.call(String(_),","),L="",M=0;M<E.length;++M)L+=(0===M?"":",")+v(s(E[M],h.encoder,b,"value",m));return[v(I)+"="+L]}return[v(I)+"="+v(s(_,h.encoder,b,"value",m))]}return[v(t)+"="+v(String(_))]}var A,D=[];if(void 0===_)return D;if("comma"===r&&c(_))A=[{value:_.length>0?_.join(",")||null:void 0}];else if(c(u))A=u;else{var P=Object.keys(_);A=p?P.sort(p):P}for(var j=0;j<A.length;++j){var k=A[j],x="object"==typeof k&&void 0!==k.value?k.value:_[k];if(!a||null!==x){var F=c(_)?"function"==typeof r?r(t,k):t:t+(d?"."+k:"["+k+"]");C.set(e,T);var N=n();N.set(g,C),pushToArray(D,stringify(x,F,r,o,a,s,u,p,d,y,m,v,w,b,N))}}return D};e.exports=function(e,t){var r,i=e,l=function normalizeStringifyOptions(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o.default;if(void 0!==e.format){if(!a.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=o.formatters[r],i=h.filter;return("function"==typeof e.filter||c(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof l.filter?i=(0,l.filter)("",i):c(l.filter)&&(r=l.filter);var u,p=[];if("object"!=typeof i||null===i)return"";u=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var d=s[u];r||(r=Object.keys(i)),l.sort&&r.sort(l.sort);for(var g=n(),m=0;m<r.length;++m){var v=r[m];l.skipNulls&&null===i[v]||pushToArray(p,y(i[v],v,d,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,g))}var w=p.join(l.delimiter),b=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),w.length>0?b+w:""}},2769:(e,t,r)=>{"use strict";var n=r(5798),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function arrayToObject(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:s,assign:function assignSingleSource(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function combine(e,t){return[].concat(e,t)},compact:function compact(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],a=i.obj[i.prop],s=Object.keys(a),c=0;c<s.length;++c){var l=s[c],u=a[l];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:a,prop:l}),r.push(u))}return function compactQueue(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function encode(e,t,r,i,o){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===r)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<s.length;++l){var u=s.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===n.RFC1738&&(40===u||41===u)?c+=s.charAt(l):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(l)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},isBuffer:function isBuffer(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function isRegExp(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function maybeMap(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function merge(e,t,r){if(!t)return e;if("object"!=typeof t){if(o(e))e.push(t);else{if(!e||"object"!=typeof e)return[e,t];(r&&(r.plainObjects||r.allowPrototypes)||!i.call(Object.prototype,t))&&(e[t]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(t);var n=e;return o(e)&&!o(t)&&(n=s(e,r)),o(e)&&o(t)?(t.forEach((function(t,n){if(i.call(e,n)){var o=e[n];o&&"object"==typeof o&&t&&"object"==typeof t?e[n]=merge(o,t,r):e.push(t)}else e[n]=t})),e):Object.keys(t).reduce((function(e,n){var o=t[n];return i.call(e,n)?e[n]=merge(e[n],o,r):e[n]=o,e}),n)}}},8660:(e,t,r)=>{var n;!function(e){!function(t){var n="object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=makeExporter(e);function makeExporter(e,t){return function(r,n){"function"!=typeof e[r]&&Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0===n.Reflect?n.Reflect=e:i=makeExporter(n.Reflect,i),function(e){var t=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,c={create:o?function(){return MakeDictionary(Object.create(null))}:a?function(){return MakeDictionary({__proto__:null})}:function(){return MakeDictionary({})},has:s?function(e,r){return t.call(e,r)}:function(e,t){return t in e},get:s?function(e,r){return t.call(e,r)?e[r]:void 0}:function(e,t){return e[t]}},l=Object.getPrototypeOf(Function),u="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=u||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?CreateMapPolyfill():Map,d=u||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?CreateSetPolyfill():Set,h=new(u||"function"!=typeof WeakMap?CreateWeakMapPolyfill():WeakMap);function decorate(e,t,r,n){if(IsUndefined(r)){if(!IsArray(e))throw new TypeError;if(!IsConstructor(t))throw new TypeError;return DecorateConstructor(e,t)}if(!IsArray(e))throw new TypeError;if(!IsObject(t))throw new TypeError;if(!IsObject(n)&&!IsUndefined(n)&&!IsNull(n))throw new TypeError;return IsNull(n)&&(n=void 0),DecorateProperty(e,t,r=ToPropertyKey(r),n)}function metadata(e,t){function decorator(r,n){if(!IsObject(r))throw new TypeError;if(!IsUndefined(n)&&!IsPropertyKey(n))throw new TypeError;OrdinaryDefineOwnMetadata(e,t,r,n)}return decorator}function defineMetadata(e,t,r,n){if(!IsObject(r))throw new TypeError;return IsUndefined(n)||(n=ToPropertyKey(n)),OrdinaryDefineOwnMetadata(e,t,r,n)}function hasMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryHasMetadata(e,t,r)}function hasOwnMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryHasOwnMetadata(e,t,r)}function getMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryGetMetadata(e,t,r)}function getOwnMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryGetOwnMetadata(e,t,r)}function getMetadataKeys(e,t){if(!IsObject(e))throw new TypeError;return IsUndefined(t)||(t=ToPropertyKey(t)),OrdinaryMetadataKeys(e,t)}function getOwnMetadataKeys(e,t){if(!IsObject(e))throw new TypeError;return IsUndefined(t)||(t=ToPropertyKey(t)),OrdinaryOwnMetadataKeys(e,t)}function deleteMetadata(e,t,r){if(!IsObject(t))throw new TypeError;IsUndefined(r)||(r=ToPropertyKey(r));var n=GetOrCreateMetadataMap(t,r,!1);if(IsUndefined(n))return!1;if(!n.delete(e))return!1;if(n.size>0)return!0;var i=h.get(t);return i.delete(r),i.size>0||h.delete(t),!0}function DecorateConstructor(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!IsUndefined(n)&&!IsNull(n)){if(!IsConstructor(n))throw new TypeError;t=n}}return t}function DecorateProperty(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,r,n);if(!IsUndefined(o)&&!IsNull(o)){if(!IsObject(o))throw new TypeError;n=o}}return n}function GetOrCreateMetadataMap(e,t,r){var n=h.get(e);if(IsUndefined(n)){if(!r)return;n=new p,h.set(e,n)}var i=n.get(t);if(IsUndefined(i)){if(!r)return;i=new p,n.set(t,i)}return i}function OrdinaryHasMetadata(e,t,r){if(OrdinaryHasOwnMetadata(e,t,r))return!0;var n=OrdinaryGetPrototypeOf(t);return!IsNull(n)&&OrdinaryHasMetadata(e,n,r)}function OrdinaryHasOwnMetadata(e,t,r){var n=GetOrCreateMetadataMap(t,r,!1);return!IsUndefined(n)&&ToBoolean(n.has(e))}function OrdinaryGetMetadata(e,t,r){if(OrdinaryHasOwnMetadata(e,t,r))return OrdinaryGetOwnMetadata(e,t,r);var n=OrdinaryGetPrototypeOf(t);return IsNull(n)?void 0:OrdinaryGetMetadata(e,n,r)}function OrdinaryGetOwnMetadata(e,t,r){var n=GetOrCreateMetadataMap(t,r,!1);if(!IsUndefined(n))return n.get(e)}function OrdinaryDefineOwnMetadata(e,t,r,n){GetOrCreateMetadataMap(r,n,!0).set(e,t)}function OrdinaryMetadataKeys(e,t){var r=OrdinaryOwnMetadataKeys(e,t),n=OrdinaryGetPrototypeOf(e);if(null===n)return r;var i=OrdinaryMetadataKeys(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var o=new d,a=[],s=0,c=r;s<c.length;s++){var l=c[s];o.has(l)||(o.add(l),a.push(l))}for(var u=0,p=i;u<p.length;u++){l=p[u];o.has(l)||(o.add(l),a.push(l))}return a}function OrdinaryOwnMetadataKeys(e,t){var r=[],n=GetOrCreateMetadataMap(e,t,!1);if(IsUndefined(n))return r;for(var i=GetIterator(n.keys()),o=0;;){var a=IteratorStep(i);if(!a)return r.length=o,r;var s=IteratorValue(a);try{r[o]=s}catch(e){try{IteratorClose(i)}finally{throw e}}o++}}function Type(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function IsUndefined(e){return void 0===e}function IsNull(e){return null===e}function IsSymbol(e){return"symbol"==typeof e}function IsObject(e){return"object"==typeof e?null!==e:"function"==typeof e}function ToPrimitive(e,t){switch(Type(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",i=GetMethod(e,n);if(void 0!==i){var o=i.call(e,r);if(IsObject(o))throw new TypeError;return o}return OrdinaryToPrimitive(e,"default"===r?"number":r)}function OrdinaryToPrimitive(e,t){if("string"===t){var r=e.toString;if(IsCallable(r))if(!IsObject(i=r.call(e)))return i;if(IsCallable(n=e.valueOf))if(!IsObject(i=n.call(e)))return i}else{var n;if(IsCallable(n=e.valueOf))if(!IsObject(i=n.call(e)))return i;var i,o=e.toString;if(IsCallable(o))if(!IsObject(i=o.call(e)))return i}throw new TypeError}function ToBoolean(e){return!!e}function ToString(e){return""+e}function ToPropertyKey(e){var t=ToPrimitive(e,3);return IsSymbol(t)?t:ToString(t)}function IsArray(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function IsCallable(e){return"function"==typeof e}function IsConstructor(e){return"function"==typeof e}function IsPropertyKey(e){switch(Type(e)){case 3:case 4:return!0;default:return!1}}function GetMethod(e,t){var r=e[t];if(null!=r){if(!IsCallable(r))throw new TypeError;return r}}function GetIterator(e){var t=GetMethod(e,i);if(!IsCallable(t))throw new TypeError;var r=t.call(e);if(!IsObject(r))throw new TypeError;return r}function IteratorValue(e){return e.value}function IteratorStep(e){var t=e.next();return!t.done&&t}function IteratorClose(e){var t=e.return;t&&t.call(e)}function OrdinaryGetPrototypeOf(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===l)return t;if(t!==l)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var i=n.constructor;return"function"!=typeof i||i===e?t:i}function CreateMapPolyfill(){var e={},t=[],r=function(){function MapIterator(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return MapIterator.prototype["@@iterator"]=function(){return this},MapIterator.prototype[i]=function(){return this},MapIterator.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},MapIterator.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},MapIterator.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},MapIterator}();return function(){function Map(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(Map.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Map.prototype.has=function(e){return this._find(e,!1)>=0},Map.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},Map.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},Map.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},Map.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},Map.prototype.keys=function(){return new r(this._keys,this._values,getKey)},Map.prototype.values=function(){return new r(this._keys,this._values,getValue)},Map.prototype.entries=function(){return new r(this._keys,this._values,getEntry)},Map.prototype["@@iterator"]=function(){return this.entries()},Map.prototype[i]=function(){return this.entries()},Map.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},Map}();function getKey(e,t){return e}function getValue(e,t){return t}function getEntry(e,t){return[e,t]}}function CreateSetPolyfill(){return function(){function Set(){this._map=new p}return Object.defineProperty(Set.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),Set.prototype.has=function(e){return this._map.has(e)},Set.prototype.add=function(e){return this._map.set(e,e),this},Set.prototype.delete=function(e){return this._map.delete(e)},Set.prototype.clear=function(){this._map.clear()},Set.prototype.keys=function(){return this._map.keys()},Set.prototype.values=function(){return this._map.values()},Set.prototype.entries=function(){return this._map.entries()},Set.prototype["@@iterator"]=function(){return this.keys()},Set.prototype[i]=function(){return this.keys()},Set}()}function CreateWeakMapPolyfill(){var e=16,r=c.create(),n=CreateUniqueKey();return function(){function WeakMap(){this._key=CreateUniqueKey()}return WeakMap.prototype.has=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t&&c.has(t,this._key)},WeakMap.prototype.get=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t?c.get(t,this._key):void 0},WeakMap.prototype.set=function(e,t){return GetOrCreateWeakMapTable(e,!0)[this._key]=t,this},WeakMap.prototype.delete=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t&&delete t[this._key]},WeakMap.prototype.clear=function(){this._key=CreateUniqueKey()},WeakMap}();function CreateUniqueKey(){var e;do{e="@@WeakMap@@"+CreateUUID()}while(c.has(r,e));return r[e]=!0,e}function GetOrCreateWeakMapTable(e,r){if(!t.call(e,n)){if(!r)return;Object.defineProperty(e,n,{value:c.create()})}return e[n]}function FillRandomBytes(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function GenRandomBytes(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):FillRandomBytes(new Uint8Array(e),e):FillRandomBytes(new Array(e),e)}function CreateUUID(){var t=GenRandomBytes(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var r="",n=0;n<e;++n){var i=t[n];4!==n&&6!==n&&8!==n||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}function MakeDictionary(e){return e.__=void 0,delete e.__,e}e("decorate",decorate),e("metadata",metadata),e("defineMetadata",defineMetadata),e("hasMetadata",hasMetadata),e("hasOwnMetadata",hasOwnMetadata),e("getMetadata",getMetadata),e("getOwnMetadata",getOwnMetadata),e("getMetadataKeys",getMetadataKeys),e("getOwnMetadataKeys",getOwnMetadataKeys),e("deleteMetadata",deleteMetadata)}(i)}()}(n||(n={}))},7478:(e,t,r)=>{"use strict";var n=r(210),i=r(1924),o=r(631),a=n("%TypeError%"),s=n("%WeakMap%",!0),c=n("%Map%",!0),l=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),p=i("WeakMap.prototype.has",!0),d=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),g=i("Map.prototype.has",!0),listGetNode=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function getSideChannel(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new a("Side channel does not contain "+o(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return l(e,n)}else if(c){if(t)return d(t,n)}else if(r)return function(e,t){var r=listGetNode(e,t);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(c){if(t)return g(t,n)}else if(r)return function(e,t){return!!listGetNode(e,t)}(r,n);return!1},set:function(n,i){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),u(e,n,i)):c?(t||(t=new c),h(t,n,i)):(r||(r={key:{},next:null}),function(e,t,r){var n=listGetNode(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,i))}};return n}},3120:function(e,t){var r,n,i;!function(o,a){"use strict";n=[],void 0===(i="function"==typeof(r=function(){function _isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}function _capitalize(e){return e.charAt(0).toUpperCase()+e.substring(1)}function _getter(e){return function(){return this[e]}}var e=["isConstructor","isEval","isNative","isToplevel"],t=["columnNumber","lineNumber"],r=["fileName","functionName","source"],n=["args"],i=["evalOrigin"],o=e.concat(t,r,n,i);function StackFrame(e){if(e)for(var t=0;t<o.length;t++)void 0!==e[o[t]]&&this["set"+_capitalize(o[t])](e[o[t]])}StackFrame.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof StackFrame)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new StackFrame(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},StackFrame.fromString=function StackFrame$$fromString(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),i=e.substring(t+1,r).split(","),o=e.substring(r+1);if(0===o.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(o,""),s=a[1],c=a[2],l=a[3];return new StackFrame({functionName:n,args:i||void 0,fileName:s,lineNumber:c||void 0,columnNumber:l||void 0})};for(var a=0;a<e.length;a++)StackFrame.prototype["get"+_capitalize(e[a])]=_getter(e[a]),StackFrame.prototype["set"+_capitalize(e[a])]=function(e){return function(t){this[e]=Boolean(t)}}(e[a]);for(var s=0;s<t.length;s++)StackFrame.prototype["get"+_capitalize(t[s])]=_getter(t[s]),StackFrame.prototype["set"+_capitalize(t[s])]=function(e){return function(t){if(!_isNumber(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(t[s]);for(var c=0;c<r.length;c++)StackFrame.prototype["get"+_capitalize(r[c])]=_getter(r[c]),StackFrame.prototype["set"+_capitalize(r[c])]=function(e){return function(t){this[e]=String(t)}}(r[c]);return StackFrame})?r.apply(t,n):r)||(e.exports=i)}()},4595:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(3120)],n=function(e){return{backtrace:function StackGenerator$$backtrace(t){var r=[],n=10;"object"==typeof t&&"number"==typeof t.maxStackSize&&(n=t.maxStackSize);for(var i=arguments.callee;i&&r.length<n;){for(var o=new Array(i.arguments.length),a=0;a<o.length;++a)o[a]=i.arguments[a];/function(?:\s+([\w$]+))+\s*\(/.test(i.toString())?r.push(new e({functionName:RegExp.$1||void 0,args:o})):r.push(new e({args:o}));try{i=i.caller}catch(e){break}}return r}}},void 0===(o="function"==typeof n?n.apply(t,i):n)||(e.exports=o)}()},9829:function(e,t){var r,n,i;!function(o,a){"use strict";n=[],void 0===(i="function"==typeof(r=function(){function _isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}function StackFrame(e,t,r,n,i,o){void 0!==e&&this.setFunctionName(e),void 0!==t&&this.setArgs(t),void 0!==r&&this.setFileName(r),void 0!==n&&this.setLineNumber(n),void 0!==i&&this.setColumnNumber(i),void 0!==o&&this.setSource(o)}return StackFrame.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(e){this.functionName=String(e)},getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getFileName:function(){return this.fileName},setFileName:function(e){this.fileName=String(e)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(e){if(!_isNumber(e))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(e)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(e){if(!_isNumber(e))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(e)},getSource:function(){return this.source},setSource:function(e){this.source=String(e)},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(_isNumber(this.getLineNumber())?":"+this.getLineNumber():"")+(_isNumber(this.getColumnNumber())?":"+this.getColumnNumber():"")}},StackFrame})?r.apply(t,n):r)||(e.exports=i)}()},9817:(e,t,r)=>{var n=r(9479),i=Object.prototype.hasOwnProperty;function ArraySet(){this._array=[],this._set=Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,t){for(var r=new ArraySet,n=0,i=e.length;n<i;n++)r.add(e[n],t);return r},ArraySet.prototype.size=function ArraySet_size(){return Object.getOwnPropertyNames(this._set).length},ArraySet.prototype.add=function ArraySet_add(e,t){var r=n.toSetString(e),o=i.call(this._set,r),a=this._array.length;o&&!t||this._array.push(e),o||(this._set[r]=a)},ArraySet.prototype.has=function ArraySet_has(e){var t=n.toSetString(e);return i.call(this._set,t)},ArraySet.prototype.indexOf=function ArraySet_indexOf(e){var t=n.toSetString(e);if(i.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()},t.I=ArraySet},647:(e,t,r)=>{var n=r(8855);t.encode=function base64VLQ_encode(e){var t,r="",i=function toVLQSigned(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&i,(i>>>=5)>0&&(t|=32),r+=n.encode(t)}while(i>0);return r},t.decode=function base64VLQ_decode(e,t,r){var i,o,a=e.length,s=0,c=0;do{if(t>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=n.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));i=!!(32&o),s+=(o&=31)<<c,c+=5}while(i);r.value=function fromVLQSigned(e){var t=e>>1;return 1==(1&e)?-t:t}(s),r.rest=t}},8855:(e,t)=>{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},4274:(e,t)=>{function recursiveSearch(e,r,n,i,o,a){var s=Math.floor((r-e)/2)+e,c=o(n,i[s],!0);return 0===c?s:c>0?r-s>1?recursiveSearch(s,r,n,i,o,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:s:s-e>1?recursiveSearch(e,s,n,i,o,a):a==t.LEAST_UPPER_BOUND?s:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function search(e,r,n,i){if(0===r.length)return-1;var o=recursiveSearch(-1,r.length,e,r,n,i||t.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===n(r[o],r[o-1],!0);)--o;return o}},1027:(e,t,r)=>{var n=r(9479);function MappingList(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,t){this._array.forEach(e,t)},MappingList.prototype.add=function MappingList_add(e){!function generatedPositionAfter(e,t){var r=e.generatedLine,i=t.generatedLine,o=e.generatedColumn,a=t.generatedColumn;return i>r||i==r&&a>=o||n.compareByGeneratedPositionsInflated(e,t)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))},MappingList.prototype.toArray=function MappingList_toArray(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=MappingList},1956:(e,t)=>{function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function doQuickSort(e,t,r,n){if(r<n){var i=r-1;swap(e,function randomIntInRange(e,t){return Math.round(e+Math.random()*(t-e))}(r,n),n);for(var o=e[n],a=r;a<n;a++)t(e[a],o)<=0&&swap(e,i+=1,a);swap(e,i+1,a);var s=i+1;doQuickSort(e,t,r,s-1),doQuickSort(e,t,s+1,n)}}t.U=function(e,t){doQuickSort(e,t,0,e.length-1)}},5667:(e,t,r)=>{var n=r(9479),i=r(4274),o=r(9817).I,a=r(647),s=r(1956).U;function SourceMapConsumer(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new IndexedSourceMapConsumer(t):new BasicSourceMapConsumer(t)}function BasicSourceMapConsumer(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),i=n.getArg(t,"sources"),a=n.getArg(t,"names",[]),s=n.getArg(t,"sourceRoot",null),c=n.getArg(t,"sourcesContent",null),l=n.getArg(t,"mappings"),u=n.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);i=i.map(String).map(n.normalize).map((function(e){return s&&n.isAbsolute(s)&&n.isAbsolute(e)?n.relative(s,e):e})),this._names=o.fromArray(a.map(String),!0),this._sources=o.fromArray(i,!0),this.sourceRoot=s,this.sourcesContent=c,this._mappings=l,this.file=u}function Mapping(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function IndexedSourceMapConsumer(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),i=n.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new o,this._names=new o;var a={line:-1,column:0};this._sections=i.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=n.getArg(e,"offset"),r=n.getArg(t,"line"),i=n.getArg(t,"column");if(r<a.line||r===a.line&&i<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=t,{generatedOffset:{generatedLine:r+1,generatedColumn:i+1},consumer:new SourceMapConsumer(n.getArg(e,"map"))}}))}SourceMapConsumer.fromSourceMap=function(e){return BasicSourceMapConsumer.fromSourceMap(e)},SourceMapConsumer.prototype._version=3,SourceMapConsumer.prototype.__generatedMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),SourceMapConsumer.prototype.__originalMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,t){var r=e.charAt(t);return";"===r||","===r},SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,t){throw new Error("Subclasses must implement _parseMappings")},SourceMapConsumer.GENERATED_ORDER=1,SourceMapConsumer.ORIGINAL_ORDER=2,SourceMapConsumer.GREATEST_LOWER_BOUND=1,SourceMapConsumer.LEAST_UPPER_BOUND=2,SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,t,r){var i,o=t||null;switch(r||SourceMapConsumer.GENERATED_ORDER){case SourceMapConsumer.GENERATED_ORDER:i=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;i.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=a&&(t=n.join(a,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,o)},SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var t=n.getArg(e,"line"),r={source:n.getArg(e,"source"),originalLine:t,originalColumn:n.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=n.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var o=[],a=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var s=this._originalMappings[a];if(void 0===e.column)for(var c=s.originalLine;s&&s.originalLine===c;)o.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)o.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return o},t.SourceMapConsumer=SourceMapConsumer,BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer,BasicSourceMapConsumer.fromSourceMap=function SourceMapConsumer_fromSourceMap(e){var t=Object.create(BasicSourceMapConsumer.prototype),r=t._names=o.fromArray(e._names.toArray(),!0),i=t._sources=o.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),c=t.__generatedMappings=[],l=t.__originalMappings=[],u=0,p=a.length;u<p;u++){var d=a[u],h=new Mapping;h.generatedLine=d.generatedLine,h.generatedColumn=d.generatedColumn,d.source&&(h.source=i.indexOf(d.source),h.originalLine=d.originalLine,h.originalColumn=d.originalColumn,d.name&&(h.name=r.indexOf(d.name)),l.push(h)),c.push(h)}return s(t.__originalMappings,n.compareByOriginalPositions),t},BasicSourceMapConsumer.prototype._version=3,Object.defineProperty(BasicSourceMapConsumer.prototype,"sources",{get:function(){return this._sources.toArray().map((function(e){return null!=this.sourceRoot?n.join(this.sourceRoot,e):e}),this)}}),BasicSourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,t){for(var r,i,o,c,l,u=1,p=0,d=0,h=0,g=0,y=0,m=e.length,v=0,w={},b={},C=[],_=[];v<m;)if(";"===e.charAt(v))u++,v++,p=0;else if(","===e.charAt(v))v++;else{for((r=new Mapping).generatedLine=u,c=v;c<m&&!this._charIsMappingSeparator(e,c);c++);if(o=w[i=e.slice(v,c)])v+=i.length;else{for(o=[];v<c;)a.decode(e,v,b),l=b.value,v=b.rest,o.push(l);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");w[i]=o}r.generatedColumn=p+o[0],p=r.generatedColumn,o.length>1&&(r.source=g+o[1],g+=o[1],r.originalLine=d+o[2],d=r.originalLine,r.originalLine+=1,r.originalColumn=h+o[3],h=r.originalColumn,o.length>4&&(r.name=y+o[4],y+=o[4])),_.push(r),"number"==typeof r.originalLine&&C.push(r)}s(_,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=_,s(C,n.compareByOriginalPositions),this.__originalMappings=C},BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,t,r,n,o,a){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return i.search(e,t,o,a)},BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},BasicSourceMapConsumer.prototype.originalPositionFor=function SourceMapConsumer_originalPositionFor(e){var t={generatedLine:n.getArg(e,"line"),generatedColumn:n.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",n.compareByGeneratedPositionsDeflated,n.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(r>=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var o=n.getArg(i,"source",null);null!==o&&(o=this._sources.at(o),null!=this.sourceRoot&&(o=n.join(this.sourceRoot,o)));var a=n.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:o,line:n.getArg(i,"originalLine",null),column:n.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=n.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=n.urlParse(this.sourceRoot))){var i=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var t=n.getArg(e,"source");if(null!=this.sourceRoot&&(t=n.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var r={source:t=this._sources.indexOf(t),originalLine:n.getArg(e,"line"),originalColumn:n.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===r.source)return{line:n.getArg(o,"generatedLine",null),column:n.getArg(o,"generatedColumn",null),lastColumn:n.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},IndexedSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),IndexedSourceMapConsumer.prototype.constructor=SourceMapConsumer,IndexedSourceMapConsumer.prototype._version=3,Object.defineProperty(IndexedSourceMapConsumer.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),IndexedSourceMapConsumer.prototype.originalPositionFor=function IndexedSourceMapConsumer_originalPositionFor(e){var t={generatedLine:n.getArg(e,"line"),generatedColumn:n.getArg(e,"column")},r=i.search(t,this._sections,(function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn})),o=this._sections[r];return o?o.consumer.originalPositionFor({line:t.generatedLine-(o.generatedOffset.generatedLine-1),column:t.generatedColumn-(o.generatedOffset.generatedLine===t.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},IndexedSourceMapConsumer.prototype.hasContentsOfAllSources=function IndexedSourceMapConsumer_hasContentsOfAllSources(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},IndexedSourceMapConsumer.prototype.sourceContentFor=function IndexedSourceMapConsumer_sourceContentFor(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r].consumer.sourceContentFor(e,!0);if(n)return n}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},IndexedSourceMapConsumer.prototype.generatedPositionFor=function IndexedSourceMapConsumer_generatedPositionFor(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer.sources.indexOf(n.getArg(e,"source"))){var i=r.consumer.generatedPositionFor(e);if(i)return{line:i.line+(r.generatedOffset.generatedLine-1),column:i.column+(r.generatedOffset.generatedLine===i.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},IndexedSourceMapConsumer.prototype._parseMappings=function IndexedSourceMapConsumer_parseMappings(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var i=this._sections[r],o=i.consumer._generatedMappings,a=0;a<o.length;a++){var c=o[a],l=i.consumer._sources.at(c.source);null!==i.consumer.sourceRoot&&(l=n.join(i.consumer.sourceRoot,l)),this._sources.add(l),l=this._sources.indexOf(l);var u=i.consumer._names.at(c.name);this._names.add(u),u=this._names.indexOf(u);var p={source:l,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:u};this.__generatedMappings.push(p),"number"==typeof p.originalLine&&this.__originalMappings.push(p)}s(this.__generatedMappings,n.compareByGeneratedPositionsDeflated),s(this.__originalMappings,n.compareByOriginalPositions)}},8902:(e,t,r)=>{var n=r(647),i=r(9479),o=r(9817).I,a=r(1027).H;function SourceMapGenerator(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new o,this._names=new o,this._mappings=new a,this._sourcesContents=null}SourceMapGenerator.prototype._version=3,SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var t=e.sourceRoot,r=new SourceMapGenerator({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=i.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)})),r},SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var t=i.getArg(e,"generated"),r=i.getArg(e,"original",null),n=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:o})},SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,t){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var a=this._sourceRoot;null!=a&&(n=i.relative(a,n));var s=new o,c=new o;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var o=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=o.source&&(t.source=o.source,null!=r&&(t.source=i.join(r,t.source)),null!=a&&(t.source=i.relative(a,t.source)),t.originalLine=o.line,t.originalColumn=o.column,null!=o.name&&(t.name=o.name))}var l=t.source;null==l||s.has(l)||s.add(l);var u=t.name;null==u||c.has(u)||c.add(u)}),this),this._sources=s,this._names=c,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=i.join(r,t)),null!=a&&(t=i.relative(a,t)),this.setSourceContent(t,n))}),this)},SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){for(var e,t,r,o,a=0,s=1,c=0,l=0,u=0,p=0,d="",h=this._mappings.toArray(),g=0,y=h.length;g<y;g++){if(e="",(t=h[g]).generatedLine!==s)for(a=0;t.generatedLine!==s;)e+=";",s++;else if(g>0){if(!i.compareByGeneratedPositionsInflated(t,h[g-1]))continue;e+=","}e+=n.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(o=this._sources.indexOf(t.source),e+=n.encode(o-p),p=o,e+=n.encode(t.originalLine-1-l),l=t.originalLine-1,e+=n.encode(t.originalColumn-c),c=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=n.encode(r-u),u=r)),d+=e}return d},SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=i.relative(t,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=SourceMapGenerator},5786:(e,t,r)=>{var n=r(8902).SourceMapGenerator,i=r(9479),o=/(\r?\n)/,a="$$$isSourceNode$$$";function SourceNode(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[a]=!0,null!=n&&this.add(n)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,t,r){var n=new SourceNode,a=e.split(o),shiftNextLine=function(){return a.shift()+(a.shift()||"")},s=1,c=0,l=null;return t.eachMapping((function(e){if(null!==l){if(!(s<e.generatedLine)){var t=(r=a[0]).substr(0,e.generatedColumn-c);return a[0]=r.substr(e.generatedColumn-c),c=e.generatedColumn,addMappingWithCode(l,t),void(l=e)}addMappingWithCode(l,shiftNextLine()),s++,c=0}for(;s<e.generatedLine;)n.add(shiftNextLine()),s++;if(c<e.generatedColumn){var r=a[0];n.add(r.substr(0,e.generatedColumn)),a[0]=r.substr(e.generatedColumn),c=e.generatedColumn}l=e}),this),a.length>0&&(l&&addMappingWithCode(l,shiftNextLine()),n.add(a.join(""))),t.sources.forEach((function(e){var o=t.sourceContentFor(e);null!=o&&(null!=r&&(e=i.join(r,e)),n.setSourceContent(e,o))})),n;function addMappingWithCode(e,t){if(null===e||void 0===e.source)n.add(t);else{var o=r?i.join(r,e.source):e.source;n.add(new SourceNode(e.originalLine,e.originalColumn,o,t,e.name))}}},SourceNode.prototype.add=function SourceNode_add(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},SourceNode.prototype.prepend=function SourceNode_prepend(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},SourceNode.prototype.walk=function SourceNode_walk(e){for(var t,r=0,n=this.children.length;r<n;r++)(t=this.children[r])[a]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},SourceNode.prototype.join=function SourceNode_join(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},SourceNode.prototype.replaceRight=function SourceNode_replaceRight(e,t){var r=this.children[this.children.length-1];return r[a]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},SourceNode.prototype.setSourceContent=function SourceNode_setSourceContent(e,t){this.sourceContents[i.toSetString(e)]=t},SourceNode.prototype.walkSourceContents=function SourceNode_walkSourceContents(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][a]&&this.children[t].walkSourceContents(e);var n=Object.keys(this.sourceContents);for(t=0,r=n.length;t<r;t++)e(i.fromSetString(n[t]),this.sourceContents[n[t]])},SourceNode.prototype.toString=function SourceNode_toString(){var e="";return this.walk((function(t){e+=t})),e},SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(e){var t={code:"",line:1,column:0},r=new n(e),i=!1,o=null,a=null,s=null,c=null;return this.walk((function(e,n){t.code+=e,null!==n.source&&null!==n.line&&null!==n.column?(o===n.source&&a===n.line&&s===n.column&&c===n.name||r.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:t.line,column:t.column},name:n.name}),o=n.source,a=n.line,s=n.column,c=n.name,i=!0):i&&(r.addMapping({generated:{line:t.line,column:t.column}}),o=null,i=!1);for(var l=0,u=e.length;l<u;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===u?(o=null,i=!1):i&&r.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:t.line,column:t.column},name:n.name})):t.column++})),this.walkSourceContents((function(e,t){r.setSourceContent(e,t)})),{code:t.code,map:r}},t.SourceNode=SourceNode},9479:(e,t)=>{t.getArg=function getArg(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,n=/^data:.+\,.+$/;function urlParse(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function urlGenerate(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function normalize(e){var r=e,n=urlParse(e);if(n){if(!n.path)return e;r=n.path}for(var i,o=t.isAbsolute(r),a=r.split(/\/+/),s=0,c=a.length-1;c>=0;c--)"."===(i=a[c])?a.splice(c,1):".."===i?s++:s>0&&(""===i?(a.splice(c+1,s),s=0):(a.splice(c,2),s--));return""===(r=a.join("/"))&&(r=o?"/":"."),n?(n.path=r,urlGenerate(n)):r}t.urlParse=urlParse,t.urlGenerate=urlGenerate,t.normalize=normalize,t.join=function join(e,t){""===e&&(e="."),""===t&&(t=".");var r=urlParse(t),i=urlParse(e);if(i&&(e=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),urlGenerate(r);if(r||t.match(n))return t;if(i&&!i.host&&!i.path)return i.host=t,urlGenerate(i);var o="/"===t.charAt(0)?t:normalize(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=o,urlGenerate(i)):o},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(r)},t.relative=function relative(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var i=!("__proto__"in Object.create(null));function identity(e){return e}function isProtoString(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function strcmp(e,t){return e===t?0:e>t?1:-1}t.toSetString=i?identity:function toSetString(e){return isProtoString(e)?"$"+e:e},t.fromSetString=i?identity:function fromSetString(e){return isProtoString(e)?e.slice(1):e},t.compareByOriginalPositions=function compareByOriginalPositions(e,t,r){var n=e.source-t.source;return 0!==n||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:e.name-t.name},t.compareByGeneratedPositionsDeflated=function compareByGeneratedPositionsDeflated(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=e.source-t.source)||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:e.name-t.name},t.compareByGeneratedPositionsInflated=function compareByGeneratedPositionsInflated(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=strcmp(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:strcmp(e.name,t.name)}},7252:(e,t,r)=>{t.SourceMapGenerator=r(8902).SourceMapGenerator,t.SourceMapConsumer=r(5667).SourceMapConsumer,t.SourceNode=r(5786).SourceNode},4358:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(7252),r(9829)],void 0===(o="function"==typeof(n=function(e,t){function _xdr(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.open("get",e),n.onerror=r,n.onreadystatechange=function onreadystatechange(){4===n.readyState&&(n.status>=200&&n.status<300?t(n.responseText):r(new Error("HTTP status: "+n.status+" retrieving "+e)))},n.send()}))}function _atob(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function _parseJson(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function _findFunctionName(e,t){for(var r,n=/function\s+([^(]*?)\s*\(([^)]*)\)/,i=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,o=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,a=e.split("\n"),s="",c=Math.min(t,20),l=0;l<c;++l){var u=a[t-l-1],p=u.indexOf("//");if(p>=0&&(u=u.substr(0,p)),u){if(s=u+s,(r=i.exec(s))&&r[1])return r[1];if((r=n.exec(s))&&r[1])return r[1];if((r=o.exec(s))&&r[1])return r[1]}}}function _ensureSupportedEnvironment(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function _ensureStackFrameIsLegit(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function _findSourceMappingURL(e){var t=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/.exec(e);if(t&&t[1])return t[1];throw new Error("sourceMappingURL not found")}function _extractLocationInfoFromSourceMap(r,n,i){return new Promise((function(o,a){var s=new e.SourceMapConsumer(n),c=s.originalPositionFor({line:r.lineNumber,column:r.columnNumber});if(c.source){var l=s.sourceContentFor(c.source);l&&(i[c.source]=l),o(new t(c.name||r.functionName,r.args,c.source,c.line,c.column))}else a(new Error("Could not get original source for given stackframe and source map"))}))}return function StackTraceGPS(e){if(!(this instanceof StackTraceGPS))return new StackTraceGPS(e);e=e||{},this.sourceCache=e.sourceCache||{},this.ajax=e.ajax||_xdr,this._atob=e.atob||_atob,this._get=function _get(t){return new Promise(function(r,n){var i="data:"===t.substr(0,5);if(this.sourceCache[t])r(this.sourceCache[t]);else if(e.offline&&!i)n(new Error("Cannot make network requests in offline mode"));else if(i){var o=/^data:application\/json;([\w=:"-]+;)*base64,/,a=t.match(o);if(a){var s=a[0].length,c=t.substr(s),l=this._atob(c);this.sourceCache[t]=l,r(l)}else n(new Error("The encoding of the inline sourcemap is not supported"))}else{var u=this.ajax(t,{method:"get"});this.sourceCache[t]=u,u.then(r,n)}}.bind(this))},this.pinpoint=function StackTraceGPS$$pinpoint(e){return new Promise(function(t,r){this.getMappedLocation(e).then(function(e){function resolveMappedStackFrame(){t(e)}this.findFunctionName(e).then(t,resolveMappedStackFrame).catch(resolveMappedStackFrame)}.bind(this),r)}.bind(this))},this.findFunctionName=function StackTraceGPS$$findFunctionName(e){return new Promise(function(r,n){_ensureStackFrameIsLegit(e),this._get(e.fileName).then((function getSourceCallback(n){var i=e.lineNumber,o=e.columnNumber,a=_findFunctionName(n,i,o);r(a?new t(a,e.args,e.fileName,i,o):e)}),n).catch(n)}.bind(this))},this.getMappedLocation=function StackTraceGPS$$getMappedLocation(e){return new Promise(function(t,r){_ensureSupportedEnvironment(),_ensureStackFrameIsLegit(e);var n=this.sourceCache,i=e.fileName;this._get(i).then(function(o){var a=_findSourceMappingURL(o),s="data:"===a.substr(0,5),c=i.substring(0,i.lastIndexOf("/")+1);"/"===a[0]||s||/^https?:\/\/|^\/\//i.test(a)||(a=c+a),this._get(a).then((function(r){"string"==typeof r&&(r=_parseJson(r.replace(/^\)\]\}'/,""))),void 0===r.sourceRoot&&(r.sourceRoot=c),_extractLocationInfoFromSourceMap(e,r,n).then(t).catch((function(){t(e)}))}),r).catch(r)}.bind(this),r).catch(r)}.bind(this))}}})?n.apply(t,i):n)||(e.exports=o)}()},401:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(9180),r(4595),r(4358)],n=function StackTrace(e,t,r){var n={filter:function(e){return-1===(e.functionName||"").indexOf("StackTrace$$")&&-1===(e.functionName||"").indexOf("ErrorStackParser$$")&&-1===(e.functionName||"").indexOf("StackTraceGPS$$")&&-1===(e.functionName||"").indexOf("StackGenerator$$")},sourceCache:{}},i=function StackTrace$$GenerateError(){try{throw new Error}catch(e){return e}};function _merge(e,t){var r={};return[e,t].forEach((function(e){for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r})),r}function _isShapedLikeParsableError(e){return e.stack||e["opera#sourceloc"]}function _filtered(e,t){return"function"==typeof t?e.filter(t):e}return{get:function StackTrace$$get(e){var t=i();return _isShapedLikeParsableError(t)?this.fromError(t,e):this.generateArtificially(e)},getSync:function StackTrace$$getSync(r){r=_merge(n,r);var o=i();return _filtered(_isShapedLikeParsableError(o)?e.parse(o):t.backtrace(r),r.filter)},fromError:function StackTrace$$fromError(t,i){i=_merge(n,i);var o=new r(i);return new Promise(function(r){var n=_filtered(e.parse(t),i.filter);r(Promise.all(n.map((function(e){return new Promise((function(t){function resolveOriginal(){t(e)}o.pinpoint(e).then(t,resolveOriginal).catch(resolveOriginal)}))}))))}.bind(this))},generateArtificially:function StackTrace$$generateArtificially(e){e=_merge(n,e);var r=t.backtrace(e);return"function"==typeof e.filter&&(r=r.filter(e.filter)),Promise.resolve(r)},instrument:function StackTrace$$instrument(e,t,r,n){if("function"!=typeof e)throw new Error("Cannot instrument non-function object");if("function"==typeof e.__stacktraceOriginalFn)return e;var i=function StackTrace$$instrumented(){try{return this.get().then(t,r).catch(r),e.apply(n||this,arguments)}catch(e){throw _isShapedLikeParsableError(e)&&this.fromError(e).then(t,r).catch(r),e}}.bind(this);return i.__stacktraceOriginalFn=e,i},deinstrument:function StackTrace$$deinstrument(e){if("function"!=typeof e)throw new Error("Cannot de-instrument non-function object");return"function"==typeof e.__stacktraceOriginalFn?e.__stacktraceOriginalFn:e},report:function StackTrace$$report(e,t,r){return new Promise((function(n,i){var o=new XMLHttpRequest;o.onerror=i,o.onreadystatechange=function onreadystatechange(){4===o.readyState&&(o.status>=200&&o.status<400?n(o.responseText):i(new Error("POST to "+t+" failed with status: "+o.status)))},o.open("post",t),o.setRequestHeader("Content-Type","application/json");var a={stack:e};void 0!==r&&(a.message=r),o.send(JSON.stringify(a))}))}}},void 0===(o="function"==typeof n?n.apply(t,i):n)||(e.exports=o)}()},4714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nameof=void 0;var n=r(6898);Object.defineProperty(t,"nameof",{enumerable:!0,get:function(){return n.nameof}})},6898:(e,t)=>{"use strict";function cleanseAssertionOperators(e){return e.replace(/[?!]/g,"")}Object.defineProperty(t,"__esModule",{value:!0}),t.nameof=void 0,t.nameof=function nameof(e,t){var r=e.toString();if(r.startsWith("class ")&&!r.startsWith("class =>"))return cleanseAssertionOperators(r.substring("class ".length,r.indexOf(" {")));if(r.includes("=>"))return cleanseAssertionOperators(r.substring(r.indexOf(".")+1));var n=r.match(/function\s*\(\w+\)\s*\{[\r\n\s]*return\s+\w+\.((\w+\.)*(\w+))/i);if(n)return t&&t.lastProp?n[3]:n[1];if(r.startsWith("function "))return cleanseAssertionOperators(r.substring("function ".length,r.indexOf("(")));throw new Error("ts-simple-nameof: Invalid function.")}},3315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2837),i=r(3533),o=r(1674),a=function(){function CategoryServiceControlImpl(){}return CategoryServiceControlImpl.prototype.help=function(){console.log(CategoryServiceControlImpl._help)},CategoryServiceControlImpl.prototype.example=function(){console.log(CategoryServiceControlImpl._example)},CategoryServiceControlImpl.prototype.showSettings=function(e){void 0===e&&(e="all");var t=new o.StringBuilder,r=CategoryServiceControlImpl._getCategoryService();CategoryServiceControlImpl._getCategories(e).forEach((function(e){CategoryServiceControlImpl._processCategory(r,e,t,0)})),console.log(t.toString())},CategoryServiceControlImpl.prototype.change=function(e){var t=CategoryServiceControlImpl._getCategoryService(),r=CategoryServiceControlImpl._getCategories(e.category),n=null,o=null,a=null,s=null,c=null,addResult=function(e){null!==c&&(c+=", "),null===c?c=e:c+=e};addResult("recursive="+e.recursive),"string"==typeof e.logLevel&&(n=i.LogLevel.fromString(e.logLevel),addResult("logLevel="+e.logLevel)),"string"==typeof e.logFormat&&(o=i.DateFormatEnum.fromString(e.logFormat),addResult("logFormat="+e.logFormat)),"boolean"==typeof e.showCategoryName&&(a=e.showCategoryName,addResult("showCategoryName="+e.showCategoryName)),"boolean"==typeof e.showTimestamp&&(s=e.showTimestamp,addResult("showTimestamp="+e.showTimestamp));var applyChanges=function(e){var r=t.getCategorySettings(e);null!==r&&(null!==n&&(r.logLevel=n),null!==o&&(r.logFormat.dateFormat.formatEnum=o),null!==s&&(r.logFormat.showTimeStamp=s),null!==a&&(r.logFormat.showCategoryName=a))};r.forEach((function(t){return CategoryServiceControlImpl._applyToCategory(t,e.recursive,applyChanges)})),console.log("Applied changes: "+c+" to categories '"+e.category+"'.")},CategoryServiceControlImpl.prototype.reset=function(e){void 0===e&&(e="all");var t=CategoryServiceControlImpl._getCategoryService(),r=CategoryServiceControlImpl._getCategories(e),applyChanges=function(e){var r=t.getCategorySettings(e),n=t.getOriginalCategorySettings(e);null!==r&&null!==n&&(r.logLevel=n.logLevel,r.logFormat.dateFormat.formatEnum=n.logFormat.dateFormat.formatEnum,r.logFormat.showTimeStamp=n.logFormat.showTimeStamp,r.logFormat.showCategoryName=n.logFormat.showCategoryName)};r.forEach((function(e){return CategoryServiceControlImpl._applyToCategory(e,!0,applyChanges)})),console.log("Applied reset to category: "+e+".")},CategoryServiceControlImpl._processCategory=function(e,t,r,n){var o=e.getCategorySettings(t);if(null!==o){if(r.append(" "+t.id+": "),n>0)for(var a=0;a<n;a++)r.append(" ");r.append(t.name+" ("+i.LogLevel[o.logLevel].toString()+"@"+i.LoggerType[o.loggerType].toString()+")\n"),t.children.length>0&&t.children.forEach((function(t){CategoryServiceControlImpl._processCategory(e,t,r,n+1)}))}},CategoryServiceControlImpl._applyToCategory=function(e,t,r){r(e),t&&e.children.forEach((function(e){CategoryServiceControlImpl._applyToCategory(e,t,r)}))},CategoryServiceControlImpl._getCategoryService=function(){return n.CategoryServiceImpl.getInstance()},CategoryServiceControlImpl._getCategories=function(e){var t=CategoryServiceControlImpl._getCategoryService(),r=[];if("all"===e)r=t.getRootCategories();else{var n=t.getCategoryById(e);if(null===n)throw new Error("Failed to find category with id "+e);r.push(n)}return r},CategoryServiceControlImpl._help='\n help(): void\n ** Shows this help.\n\n example(): void\n ** Shows an example on how to use this.\n\n showSettings(id: number | "all" = "all"): void\n ** Shows settings for a specific category, or for all. The id of categories can be found by calling this method without parameter.\n\n change(settings: CategoryServiceControlSettings): void\n ** Changes the current settings for one or all categories.\n **\n CategoryServiceControlSettings, properties of object:\n category: number | "all"\n ** Apply to specific category, or "all".\n ** Required\n\n recursive: boolean\n ** Apply to child categories (true) or not.\n ** Required\n\n logLevel: "Fatal" | "Error" | "Warn" | "Info" | "Debug" | "Trace" | undefined\n ** Set log level, undefined will not change the setting.\n ** Optional\n\n logFormat: "Default" | "YearMonthDayTime" | "YearDayMonthWithFullTime" | "YearDayMonthTime" | undefined\n ** Set the log format, undefined will not change the setting.\n ** Optional\n\n showTimestamp: boolean | undefined\n ** Whether to show timestamp, undefined will not change the setting.\n ** Optional\n\n showCategoryName: boolean | undefined\n ** Whether to show the category name, undefined will not change the setting.\n ** Optional\n\n reset(id: number | "all"): void\n ** Resets everything to original values, for one specific or for all categories.\n',CategoryServiceControlImpl._example='\n Examples:\n change({category: "all", recursive:true, logLevel: "Info"})\n ** Change loglevel to Info for all categories, apply to child categories as well.\n\n change({category: 1, recursive:false, logLevel: "Warn"})\n ** Change logLevel for category 1, do not recurse.\n\n change({category: "all", recursive:true, logLevel: "Debug", logFormat: "YearDayMonthTime", showTimestamp:false, showCategoryName:false})\n ** Change loglevel to Debug for all categories, apply format, do not show timestamp and category names - recursively to child categories.\n\n',CategoryServiceControlImpl}();t.CategoryServiceControlImpl=a},9791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=r(8225),o=r(1674),a=function(){function LoggerControlImpl(){}return LoggerControlImpl.prototype.help=function(){console.log(LoggerControlImpl._help)},LoggerControlImpl.prototype.listFactories=function(){var e=LoggerControlImpl._getRuntimeSettingsLoggerFactories(),t=new o.StringBuilder;t.appendLine("Registered LoggerFactories (index / name)");for(var r=0;r<e.length;r++){var n=e[r];t.append(" "+r).append(": "+n.getName()+"\n")}console.log(t.toString())},LoggerControlImpl.prototype.showSettings=function(e){void 0===e&&(e="all");var t=[];if("all"===e){var r=0;LoggerControlImpl._getRuntimeSettingsLoggerFactories().forEach((function(e){t.push(new o.TuplePair(r++,e))}))}else{var i=LoggerControlImpl._getRuntimeSettingsLoggerFactories();if(!(e>=0&&e<i.length))throw new Error("Requested number: "+e+" was not found.");t.push(new o.TuplePair(e,i[e]))}for(var a=0,s=t;a<s.length;a++){var c=s[a];console.log(" LoggerFactory: "+c.y.getName()+" (id="+c.x+")");for(var l=c.y.getLogGroupRuntimeSettings(),u=0;u<l.length;u++){var p=l[u];console.log(" LogGroup: (id="+u+")"),console.log(" RegExp: "+p.logGroupRule.regExp.source),console.log(" Level: "+n.LogLevel[p.level].toString()),console.log(" LoggerType: "+n.LoggerType[p.loggerType].toString())}}},LoggerControlImpl.prototype.reset=function(e){void 0===e&&(e="all");var t=LoggerControlImpl._getRuntimeSettingsLoggerFactories(),r=[];"all"===e?r=t:e>=0&&e<t.length&&r.push(t[e]),r.forEach((function(t){console.log("Reset all settings for factory "+e),new s(t).reset()}))},LoggerControlImpl.prototype.getLoggerFactoryControl=function(e){var t=LoggerControlImpl._getRuntimeSettingsLoggerFactories();if(e>=0&&e<t.length)return new s(t[e]);throw new Error("idFactory is invalid (less than 0) or non existing id.")},LoggerControlImpl._getRuntimeSettingsLoggerFactories=function(){return LoggerControlImpl._getSettings().getRuntimeSettingsForLoggerFactories()},LoggerControlImpl._getSettings=function(){return i.LFService.getRuntimeSettings()},LoggerControlImpl._help='\n help(): void\n ** Shows this help.\n\n listFactories(): void\n ** List all registered LoggerFactories with associated log groups with respective ids (ids can be used to target a factory and/or group).\n\n showSettings(idFactory: number | "all"): void\n ** Show log group settings for idFactory (use listFactories to find id for a LoggerFactory). If idFactory is "all" shows all factories.\n\n getLoggerFactoryControl(idFactory: number): LoggerFactoryControl\n ** Return LoggerFactoryControl when found for given idFactory or throws Error if invalid or null, get the id by using listFactories()\n\n reset(idFactory: number | "all"): void\n ** Resets given factory or all factories back to original values.\n',LoggerControlImpl}();t.LoggerControlImpl=a;var s=function(){function LoggerFactoryControlImpl(e){this._settings=e}return LoggerFactoryControlImpl.prototype.help=function(){console.log(LoggerFactoryControlImpl._help)},LoggerFactoryControlImpl.prototype.example=function(){console.log(LoggerFactoryControlImpl._example)},LoggerFactoryControlImpl.prototype.showSettings=function(e){void 0===e&&(e="all");var t=new o.StringBuilder,r=this._settings.getLogGroupRuntimeSettings();t.appendLine("Registered LogGroups (index / expression)");for(var i=0;i<r.length;i++){var a=r[i];t.appendLine(" "+i+": "+a.logGroupRule.regExp.source+", logLevel="+n.LogLevel[a.level].toString()+", showTimestamp="+a.logFormat.showTimeStamp+", showLoggerName="+a.logFormat.showLoggerName+", format="+n.DateFormatEnum[a.logFormat.dateFormat.formatEnum].toString())}console.log(t.toString())},LoggerFactoryControlImpl.prototype.change=function(e){var t=this._getLogGroupRunTimeSettingsFor(e.group),r=null,i=null,o=null,a=null,s=null,addResult=function(e){null!==s&&(s+=", "),null===s?s=e:s+=e};"string"==typeof e.logLevel&&(r=n.LogLevel.fromString(e.logLevel),addResult("logLevel="+e.logLevel)),"string"==typeof e.logFormat&&(i=n.DateFormatEnum.fromString(e.logFormat),addResult("logFormat="+e.logFormat)),"boolean"==typeof e.showLoggerName&&(o=e.showLoggerName,addResult("showLoggerName="+e.showLoggerName)),"boolean"==typeof e.showTimestamp&&(a=e.showTimestamp,addResult("showTimestamp="+e.showTimestamp)),t.forEach((function(e){null!==r&&(e.level=r),null!==i&&(e.logFormat.dateFormat.formatEnum=i),null!==a&&(e.logFormat.showTimeStamp=a),null!==o&&(e.logFormat.showLoggerName=o)})),console.log("Applied changes: "+s+" to log groups '"+e.group+"'.")},LoggerFactoryControlImpl.prototype.reset=function(e){void 0===e&&(e="all");for(var t=0,r=this._getLogGroupRunTimeSettingsFor(e);t<r.length;t++){var n=r[t];n.level=n.logGroupRule.level,n.logFormat.showTimeStamp=n.logGroupRule.logFormat.showTimeStamp,n.logFormat.showLoggerName=n.logGroupRule.logFormat.showLoggerName,n.logFormat.dateFormat.formatEnum=n.logGroupRule.logFormat.dateFormat.formatEnum}console.log("Reset all settings for group "+e)},LoggerFactoryControlImpl.prototype._getLogGroupRunTimeSettingsFor=function(e){var t=[];return"all"===e?t=this._settings.getLogGroupRuntimeSettings():(this._checkIndex(e),t.push(this._settings.getLogGroupRuntimeSettings()[e])),t},LoggerFactoryControlImpl.prototype._checkIndex=function(e){if(e<0||e>=this._settings.getLogGroupRuntimeSettings().length)throw new Error("Invalid index, use listLogGroups to find out a valid one.")},LoggerFactoryControlImpl._help='\n help(): void\n ** Shows this help.\n\n example(): void\n ** Shows an example of usage.\n\n showSettings(id: number | "all"): void\n ** Prints settings for given group id, "all" for all group.\n\n change(settings: LogGroupControlSettings): void\n ** Changes the current settings for one or all log groups.\n **\n LogGroupControlSettings, properties of object:\n group: number | "all"\n ** Apply to specific group, or "all".\n ** Required\n\n logLevel: "Fatal" | "Error" | "Warn" | "Info" | "Debug" | "Trace" | undefined\n ** Set log level, undefined will not change the setting.\n ** Optional\n\n logFormat: "Default" | "YearMonthDayTime" | "YearDayMonthWithFullTime" | "YearDayMonthTime" | undefined\n ** Set the log format, undefined will not change the setting.\n ** Optional\n\n showTimestamp: boolean | undefined\n ** Whether to show timestamp, undefined will not change the setting.\n ** Optional\n\n showLoggerName: boolean | undefined\n ** Whether to show the logger name, undefined will not change the setting.\n ** Optional\n\n reset(id: number | "all"): void\n ** Resets everything to original values, for one specific or for all groups.\n\n help():\n ** Shows this help.\n',LoggerFactoryControlImpl._example='\n Examples:\n change({group: "all", logLevel: "Info"})\n ** Change loglevel to Info for all groups.\n\n change({group: 1, recursive:false, logLevel: "Warn"})\n ** Change logLevel for group 1 to Warn.\n\n change({group: "all", logLevel: "Debug", logFormat: "YearDayMonthTime", showTimestamp:false, showLoggerName:false})\n ** Change loglevel to Debug for all groups, apply format, do not show timestamp and logger names.\n',LoggerFactoryControlImpl}()},7163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2837),i=r(3533),o=r(9014),a=function(){function ExtensionHelper(){}return ExtensionHelper.register=function(){if(!ExtensionHelper.registered){var listener=function(e){var t=e.data;null!==t&&ExtensionHelper.processMessageFromExtension(t)};"undefined"!=typeof window&&void 0!==window.removeEventListener&&void 0!==window.addEventListener&&(window.removeEventListener("message",listener),window.addEventListener("message",listener),ExtensionHelper.registered=!0)}},ExtensionHelper.processMessageFromExtension=function(e){if(ExtensionHelper.registered&&"tsl-extension"===e.from){var t=e.data;switch(t.type){case"register":ExtensionHelper.enableExtensionIntegration();break;case"request-change-loglevel":var r=t.value,n=ExtensionHelper.applyLogLevel(r.categoryId,r.logLevel,r.recursive);n.length>0&&ExtensionHelper.sendCategoriesRuntimeUpdateMessage(n);break;default:console.log("Unknown command to process message from extension, command was: "+t.type)}}},ExtensionHelper.sendCategoryLogMessage=function(e){if(ExtensionHelper.registered){var t={data:{type:"log-message",value:{categories:e.categories.map((function(e){return e.id})),errorAsStack:e.errorAsStack,formattedMessage:o.MessageFormatUtils.renderDefaultMessage(e,!1),logLevel:i.LogLevel[e.level].toString(),message:e.messageAsString,resolvedErrorMessage:e.isResolvedErrorMessage}},from:"tsl-logging"};ExtensionHelper.sendMessage(t)}},ExtensionHelper.sendCategoriesRuntimeUpdateMessage=function(e){if(ExtensionHelper.registered){var t=n.CategoryServiceImpl.getInstance(),r={categories:Array()};e.forEach((function(e){var n=t.getCategorySettings(e);null!=n&&r.categories.push({id:e.id,logLevel:i.LogLevel[n.logLevel].toString()})}));var o={data:{type:"categories-rt-update",value:r},from:"tsl-logging"};ExtensionHelper.sendMessage(o)}},ExtensionHelper.sendRootCategoriesToExtension=function(){if(ExtensionHelper.registered){var e={data:{type:"root-categories-tree",value:n.CategoryServiceImpl.getInstance().getRootCategories().map((function(e){return ExtensionHelper.getCategoryAsJSON(e)}))},from:"tsl-logging"};ExtensionHelper.sendMessage(e)}},ExtensionHelper.getCategoryAsJSON=function(e){return{children:e.children.map((function(e){return ExtensionHelper.getCategoryAsJSON(e)})),id:e.id,logLevel:i.LogLevel[e.logLevel].toString(),name:e.name,parentId:null!=e.parent?e.parent.id:null}},ExtensionHelper.applyLogLevel=function(e,t,r){var o=[],a=n.CategoryServiceImpl.getInstance().getCategoryById(e);return null!=a?ExtensionHelper._applyLogLevelRecursive(a,i.LogLevel.fromString(t),r,o):console.log("Could not change log level, failed to find category with id: "+e),o},ExtensionHelper._applyLogLevelRecursive=function(e,t,r,i){var o=n.CategoryServiceImpl.getInstance().getCategorySettings(e);null!=o&&(o.logLevel=t,i.push(e),r&&e.children.forEach((function(e){ExtensionHelper._applyLogLevelRecursive(e,t,r,i)})))},ExtensionHelper.getAllCategories=function(){var e=[],addCats=function(e,t){t.push(e),e.children.forEach((function(e){addCats(e,t)}))};return n.CategoryServiceImpl.getInstance().getRootCategories().forEach((function(t){addCats(t,e)})),e},ExtensionHelper.sendMessage=function(e){ExtensionHelper.registered&&"undefined"!=typeof window&&void 0!==window.postMessage&&window.postMessage(e,"*")},ExtensionHelper.enableExtensionIntegration=function(){if(ExtensionHelper.registered){n.CategoryServiceImpl.getInstance().enableExtensionIntegration(),ExtensionHelper.sendRootCategoriesToExtension();var e=ExtensionHelper.getAllCategories();ExtensionHelper.sendCategoriesRuntimeUpdateMessage(e)}},ExtensionHelper.registered=!1,ExtensionHelper}();t.ExtensionHelper=a},3533:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.Fatal=5]="Fatal"}(t.LogLevel||(t.LogLevel={})),function(e){e.fromString=function fromString(t){if(null==t)throw new Error("Argument must be set");switch(t.toLowerCase()){case"trace":return e.Trace;case"debug":return e.Debug;case"info":return e.Info;case"warn":return e.Warn;case"error":return e.Error;case"fatal":return e.Fatal;default:throw new Error("Unsupported value for conversion: "+t)}}}(t.LogLevel||(t.LogLevel={})),function(e){e[e.Console=0]="Console",e[e.MessageBuffer=1]="MessageBuffer",e[e.Custom=2]="Custom"}(t.LoggerType||(t.LoggerType={})),function(e){e[e.Default=0]="Default",e[e.YearMonthDayTime=1]="YearMonthDayTime",e[e.YearDayMonthWithFullTime=2]="YearDayMonthWithFullTime",e[e.YearDayMonthTime=3]="YearDayMonthTime"}(t.DateFormatEnum||(t.DateFormatEnum={})),function(e){e.fromString=function fromString(t){if(null==t)throw new Error("Argument must be set");switch(t.toLowerCase()){case"default":return e.Default;case"yearmonthdayTime":return e.YearMonthDayTime;case"yeardaymonthwithfulltime":return e.YearDayMonthWithFullTime;case"yeardaymonthtime":return e.YearDayMonthTime;default:throw new Error("Unsupported value for conversion: "+t)}}}(r=t.DateFormatEnum||(t.DateFormatEnum={}));var n=function(){function DateFormat(e,t){void 0===e&&(e=r.Default),void 0===t&&(t="-"),this._formatEnum=e,this._dateSeparator=t}return Object.defineProperty(DateFormat.prototype,"formatEnum",{get:function(){return this._formatEnum},set:function(e){this._formatEnum=e},enumerable:!0,configurable:!0}),Object.defineProperty(DateFormat.prototype,"dateSeparator",{get:function(){return this._dateSeparator},set:function(e){this._dateSeparator=e},enumerable:!0,configurable:!0}),DateFormat.prototype.copy=function(){return new DateFormat(this._formatEnum,this._dateSeparator)},DateFormat}();t.DateFormat=n;var i=function(){function LogFormat(e,t,r){void 0===e&&(e=new n),void 0===t&&(t=!0),void 0===r&&(r=!0),this._showTimeStamp=!0,this._showLoggerName=!0,this._dateFormat=e,this._showTimeStamp=t,this._showLoggerName=r}return Object.defineProperty(LogFormat.prototype,"dateFormat",{get:function(){return this._dateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(LogFormat.prototype,"showTimeStamp",{get:function(){return this._showTimeStamp},set:function(e){this._showTimeStamp=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogFormat.prototype,"showLoggerName",{get:function(){return this._showLoggerName},set:function(e){this._showLoggerName=e},enumerable:!0,configurable:!0}),LogFormat}();t.LogFormat=i;var o=function(){function CategoryLogFormat(e,t,r){void 0===e&&(e=new n),void 0===t&&(t=!0),void 0===r&&(r=!0),this._dateFormat=e,this._showTimeStamp=t,this._showCategoryName=r}return Object.defineProperty(CategoryLogFormat.prototype,"dateFormat",{get:function(){return this._dateFormat},set:function(e){this._dateFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogFormat.prototype,"showTimeStamp",{get:function(){return this._showTimeStamp},set:function(e){this._showTimeStamp=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogFormat.prototype,"showCategoryName",{get:function(){return this._showCategoryName},set:function(e){this._showCategoryName=e},enumerable:!0,configurable:!0}),CategoryLogFormat.prototype.copy=function(){return new CategoryLogFormat(this._dateFormat.copy(),this._showTimeStamp,this._showCategoryName)},CategoryLogFormat}();t.CategoryLogFormat=o},8717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1674),i=r(9014),o=r(3533),a=function(){function CategoryLogMessageImpl(e,t,r,n,i,o,a){this._resolvedErrorMessage=!1,this._errorAsStack=null,this._message=e,this._error=t,this._categories=r,this._date=n,this._level=i,this._logFormat=o,this._ready=a}return Object.defineProperty(CategoryLogMessageImpl.prototype,"message",{get:function(){return this._message},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"error",{get:function(){return this._error},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"categories",{get:function(){return this._categories},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"date",{get:function(){return this._date},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"logFormat",{get:function(){return this._logFormat},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"isMessageLogData",{get:function(){return"string"!=typeof this._message},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"messageAsString",{get:function(){return"string"==typeof this._message?this._message:this._message.msg},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"logData",{get:function(){var e=null;return"string"!=typeof this._message&&(e=this.message),e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"isResolvedErrorMessage",{get:function(){return this._resolvedErrorMessage},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"errorAsStack",{get:function(){return this._errorAsStack},set:function(e){this._errorAsStack=e},enumerable:!0,configurable:!0}),CategoryLogMessageImpl.prototype.isReady=function(){return this._ready},CategoryLogMessageImpl.prototype.setReady=function(e){this._ready=e},Object.defineProperty(CategoryLogMessageImpl.prototype,"resolvedErrorMessage",{get:function(){return this._resolvedErrorMessage},set:function(e){this._resolvedErrorMessage=e},enumerable:!0,configurable:!0}),CategoryLogMessageImpl}(),s=function(){function AbstractCategoryLogger(e,t){this.allMessages=new n.LinkedList,this.rootCategory=e,this.runtimeSettings=t}return AbstractCategoryLogger.prototype.trace=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._log.apply(this,[o.LogLevel.Trace,e,null,!1].concat(t))},AbstractCategoryLogger.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._log.apply(this,[o.LogLevel.Debug,e,null,!1].concat(t))},AbstractCategoryLogger.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._log.apply(this,[o.LogLevel.Info,e,null,!1].concat(t))},AbstractCategoryLogger.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._log.apply(this,[o.LogLevel.Warn,e,null,!1].concat(t))},AbstractCategoryLogger.prototype.error=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this._log.apply(this,[o.LogLevel.Error,e,t,!1].concat(r))},AbstractCategoryLogger.prototype.fatal=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this._log.apply(this,[o.LogLevel.Fatal,e,t,!1].concat(r))},AbstractCategoryLogger.prototype.resolved=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this._log.apply(this,[o.LogLevel.Error,e,t,!0].concat(r))},AbstractCategoryLogger.prototype.log=function(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];this._log.apply(this,[e,t,r,!1].concat(n))},AbstractCategoryLogger.prototype.getRootCategory=function(){return this.rootCategory},AbstractCategoryLogger.prototype.createDefaultLogMessage=function(e){return i.MessageFormatUtils.renderDefaultMessage(e,!0)},AbstractCategoryLogger.prototype._getMessageFormatter=function(){var e=this.runtimeSettings.getCategorySettings(this.rootCategory);if(null===e)throw new Error("Did not find CategorySettings for rootCategory: "+this.rootCategory.name);return e.formatterLogMessage},AbstractCategoryLogger.prototype._log=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=!1);for(var i=[],o=4;o<arguments.length;o++)i[o-4]=arguments[o];var functionMessage=function(){return"function"==typeof t?t():t},functionError=function(){return"function"==typeof r?r():r};this._logInternal.apply(this,[e,functionMessage,functionError,n].concat(i))},AbstractCategoryLogger.prototype._logInternal=function(e,t,r,n){for(var o=this,s=[],c=4;c<arguments.length;c++)s[c-4]=arguments[c];var l=[this.rootCategory];void 0!==s&&s.length>0&&(l=l.concat(s.filter((function(e){return e!==o.rootCategory}))));for(var _loop_1=function(s){var c=l[s];if(null===c)throw new Error("Cannot have a null element within categories, at index="+s);var p=u.runtimeSettings.getCategorySettings(c);if(null===p)throw new Error("Category with path: "+c.getCategoryPath()+" is not registered with this logger, maybe you registered it with a different root logger?");if(p.logLevel<=e){var d=null!==r?r():null;if(null===d){var h=new a(t(),d,l,new Date,e,p.logFormat,!0);h.resolvedErrorMessage=n,u.allMessages.addTail(h),u.processMessages()}else{var g=new a(t(),d,l,new Date,e,p.logFormat,!1);g.resolvedErrorMessage=n,u.allMessages.addTail(g),i.MessageFormatUtils.renderError(d).then((function(e){g.errorAsStack=e,g.setReady(!0),o.processMessages()})).catch((function(){g.errorAsStack="<UNKNOWN> unable to get stack.",g.setReady(!0),o.processMessages()}))}return"break"}},u=this,p=0;p<l.length;p++){var d=_loop_1(p);if("break"===d)break}},AbstractCategoryLogger.prototype.processMessages=function(){var e=this.allMessages;if(e.getSize()>0)do{var t=e.getHead();if(null!=t){if(!t.isReady())break;e.removeHead(),this.doLog(t)}}while(e.getSize()>0)},AbstractCategoryLogger}();t.AbstractCategoryLogger=s},1802:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=r(2837),o=function(){function Category(e,t){if(void 0===t&&(t=null),this._children=[],this._logLevel=n.LogLevel.Error,-1!==e.indexOf("#"))throw new Error("Cannot use # in a name of a Category");this._id=Category.nextId(),this._name=e,this._parent=t,null!==this._parent&&this._parent._children.push(this),i.CategoryServiceImpl.getInstance().registerCategory(this)}return Object.defineProperty(Category.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(Category.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(Category.prototype,"children",{get:function(){return this._children},enumerable:!0,configurable:!0}),Object.defineProperty(Category.prototype,"logLevel",{get:function(){return this._logLevel},enumerable:!0,configurable:!0}),Category.prototype.trace=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.loadCategoryLogger(),(t=this._logger).trace.apply(t,[e].concat(r))},Category.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.loadCategoryLogger(),(t=this._logger).debug.apply(t,[e].concat(r))},Category.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.loadCategoryLogger(),(t=this._logger).info.apply(t,[e].concat(r))},Category.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.loadCategoryLogger(),(t=this._logger).warn.apply(t,[e].concat(r))},Category.prototype.error=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.loadCategoryLogger(),(r=this._logger).error.apply(r,[e,t].concat(n))},Category.prototype.fatal=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.loadCategoryLogger(),(r=this._logger).fatal.apply(r,[e,t].concat(n))},Category.prototype.resolved=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.loadCategoryLogger(),(r=this._logger).resolved.apply(r,[e,t].concat(n))},Category.prototype.log=function(e,t,r){for(var n,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];this.loadCategoryLogger(),(n=this._logger).log.apply(n,[e,t,r].concat(i))},Category.prototype.getCategoryPath=function(){for(var e=this.name,t=this.parent;null!=t;)e=t.name+"#"+e,t=t.parent;return e},Object.defineProperty(Category.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Category.prototype.loadCategoryLogger=function(){if(this._logger||(this._logger=i.CategoryServiceImpl.getInstance().getLogger(this)),void 0===this._logger||null===this._logger)throw new Error("Failed to load a logger for category (should not happen): "+this.name)},Category.nextId=function(){return Category.currentId++},Category.currentId=1,Category}();t.Category=o},4182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=function(){function CategoryConfiguration(e,t,r,i){if(void 0===e&&(e=n.LogLevel.Error),void 0===t&&(t=n.LoggerType.Console),void 0===r&&(r=new n.CategoryLogFormat),void 0===i&&(i=null),this._formatterLogMessage=null,this._logLevel=e,this._loggerType=t,this._logFormat=r,this._callBackLogger=i,this._loggerType===n.LoggerType.Custom&&null===this.callBackLogger)throw new Error("If you specify loggerType to be Custom, you must provide the callBackLogger argument")}return Object.defineProperty(CategoryConfiguration.prototype,"logLevel",{get:function(){return this._logLevel},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryConfiguration.prototype,"loggerType",{get:function(){return this._loggerType},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryConfiguration.prototype,"logFormat",{get:function(){return this._logFormat},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryConfiguration.prototype,"callBackLogger",{get:function(){return this._callBackLogger},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryConfiguration.prototype,"formatterLogMessage",{get:function(){return this._formatterLogMessage},set:function(e){if(null!==e&&this._loggerType===n.LoggerType.Custom)throw new Error("You cannot specify a formatter for log messages if your loggerType is Custom");this._formatterLogMessage=e},enumerable:!0,configurable:!0}),CategoryConfiguration.prototype.copy=function(){var e=new CategoryConfiguration(this.logLevel,this.loggerType,this.logFormat.copy(),this.callBackLogger);return e.formatterLogMessage=this.formatterLogMessage,e},CategoryConfiguration}();t.CategoryConfiguration=i},9939:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3533),a=function(e){function CategoryConsoleLoggerImpl(t,r){return e.call(this,t,r)||this}return i(CategoryConsoleLoggerImpl,e),CategoryConsoleLoggerImpl.prototype.doLog=function(e){if(void 0===console)throw new Error("Console is not defined, cannot log msg: "+e.messageAsString);var t=this._getMessageFormatter(),r=void 0;r=null===t?this.createDefaultLogMessage(e):t(e);var n=!1;switch(e.level){case o.LogLevel.Trace:case o.LogLevel.Debug:break;case o.LogLevel.Info:console.info&&(console.info(r),n=!0);break;case o.LogLevel.Warn:console.warn&&(console.warn(r),n=!0);break;case o.LogLevel.Error:case o.LogLevel.Fatal:console.error&&(console.error(r),n=!0);break;default:throw new Error("Unsupported level: "+e.level)}n||console.log(r)},CategoryConsoleLoggerImpl}(r(8717).AbstractCategoryLogger);t.CategoryConsoleLoggerImpl=a},8057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function CategoryDelegateLoggerImpl(e){this._delegate=e}return Object.defineProperty(CategoryDelegateLoggerImpl.prototype,"delegate",{get:function(){return this._delegate},set:function(e){this._delegate=e},enumerable:!0,configurable:!0}),CategoryDelegateLoggerImpl.prototype.trace=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=this._delegate).trace.apply(t,[e].concat(r))},CategoryDelegateLoggerImpl.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=this._delegate).debug.apply(t,[e].concat(r))},CategoryDelegateLoggerImpl.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=this._delegate).info.apply(t,[e].concat(r))},CategoryDelegateLoggerImpl.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=this._delegate).warn.apply(t,[e].concat(r))},CategoryDelegateLoggerImpl.prototype.error=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];(r=this._delegate).error.apply(r,[e,t].concat(n))},CategoryDelegateLoggerImpl.prototype.fatal=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];(r=this._delegate).fatal.apply(r,[e,t].concat(n))},CategoryDelegateLoggerImpl.prototype.resolved=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];(r=this._delegate).resolved.apply(r,[e,t].concat(n))},CategoryDelegateLoggerImpl.prototype.log=function(e,t,r){for(var n,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];(n=this._delegate).log.apply(n,[e,t,r].concat(i))},CategoryDelegateLoggerImpl}();t.CategoryDelegateLoggerImpl=r},4792:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(7163),a=function(e){function CategoryExtensionLoggerImpl(t,r){return e.call(this,t,r)||this}return i(CategoryExtensionLoggerImpl,e),CategoryExtensionLoggerImpl.prototype.doLog=function(e){"undefined"!=typeof window?o.ExtensionHelper.sendCategoryLogMessage(e):console.log("window is not available, you must be running in a browser for this. Dropped message.")},CategoryExtensionLoggerImpl}(r(8717).AbstractCategoryLogger);t.CategoryExtensionLoggerImpl=a},7329:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function CategoryMessageBufferLoggerImpl(){var t=null!==e&&e.apply(this,arguments)||this;return t.messages=[],t}return i(CategoryMessageBufferLoggerImpl,e),CategoryMessageBufferLoggerImpl.prototype.getMessages=function(){return this.messages},CategoryMessageBufferLoggerImpl.prototype.toString=function(){return this.messages.map((function(e){return e})).join("\n")},CategoryMessageBufferLoggerImpl.prototype.doLog=function(e){var t,r=this._getMessageFormatter();t=null===r?this.createDefaultLogMessage(e):r(e),this.messages.push(t)},CategoryMessageBufferLoggerImpl}(r(8717).AbstractCategoryLogger);t.CategoryMessageBufferLoggerImpl=o},4365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=function(){function CategoryRuntimeSettings(e,t,r,i,o,a){void 0===t&&(t=n.LogLevel.Error),void 0===r&&(r=n.LoggerType.Console),void 0===i&&(i=new n.CategoryLogFormat),void 0===o&&(o=null),void 0===a&&(a=null),this._formatterLogMessage=null,this._category=e,this._logLevel=t,this._loggerType=r,this._logFormat=i,this._callBackLogger=o,this._formatterLogMessage=a}return Object.defineProperty(CategoryRuntimeSettings.prototype,"category",{get:function(){return this._category},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){this._logLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"loggerType",{get:function(){return this._loggerType},set:function(e){this._loggerType=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"logFormat",{get:function(){return this._logFormat},set:function(e){this._logFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"callBackLogger",{get:function(){return this._callBackLogger},set:function(e){this._callBackLogger=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"formatterLogMessage",{get:function(){return this._formatterLogMessage},set:function(e){this._formatterLogMessage=e},enumerable:!0,configurable:!0}),CategoryRuntimeSettings}();t.CategoryRuntimeSettings=i},2837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1674),i=r(3533),o=r(9939),a=r(8057),s=r(4792),c=r(7329),l=r(7163),u=r(4365),p=r(4182),d=function(){function CategoryServiceImpl(){this._defaultConfig=new p.CategoryConfiguration,this._mapState=new n.SimpleMap,l.ExtensionHelper.register()}return CategoryServiceImpl.getInstance=function(){return null===CategoryServiceImpl._INSTANCE&&(CategoryServiceImpl._INSTANCE=new CategoryServiceImpl),CategoryServiceImpl._INSTANCE},CategoryServiceImpl.prototype.getLogger=function(e){return this.createOrGetCategoryState(e).logger},CategoryServiceImpl.prototype.clear=function(){this._mapState.clear(),this.setDefaultConfiguration(new p.CategoryConfiguration)},CategoryServiceImpl.prototype.getCategorySettings=function(e){return this.createOrGetCategoryState(e).currentRuntimeSettings},CategoryServiceImpl.prototype.getOriginalCategorySettings=function(e){return this.createOrGetCategoryState(e).originalRuntimeSettings},CategoryServiceImpl.prototype.setDefaultConfiguration=function(e,t){void 0===t&&(t=!0),this._defaultConfig=e,t&&this._mapState.forEachValue((function(t){t.updateSettings(e)}))},CategoryServiceImpl.prototype.setConfigurationCategory=function(e,t,r){var n=this;void 0===r&&(r=!1),this.createOrGetCategoryState(t).updateSettings(e),r&&t.children.forEach((function(t){n.setConfigurationCategory(e,t,r)}))},CategoryServiceImpl.prototype.registerCategory=function(e){if(null==e)throw new Error("Category CANNOT be null/undefined");if(this._mapState.exists(CategoryServiceImpl.getCategoryKey(e)))throw new Error("Cannot add this root category with name: "+e.name+", it already exists (same name in hierarchy).");this.createOrGetCategoryState(e)},CategoryServiceImpl.prototype.enableExtensionIntegration=function(){var e=this;this._mapState.forEachValue((function(t){return t.enableForExtension(e)}))},CategoryServiceImpl.prototype.getRootCategories=function(){return this._mapState.values().filter((function(e){return null==e.category.parent})).map((function(e){return e.category}))},CategoryServiceImpl.prototype.getCategoryById=function(e){var t=this._mapState.values().filter((function(t){return t.category.id===e})).map((function(e){return e.category}));return 1===t.length?t[0]:null},CategoryServiceImpl.prototype.createOrGetCategoryState=function(e){var t=CategoryServiceImpl.getCategoryKey(e),r=this._mapState.get(t);if(void 0!==r)return r;var n=this.createState(e);return this._mapState.put(t,n),n},CategoryServiceImpl.prototype.createState=function(e){var t=this;return new h(e,(function(){return t._defaultConfig}),(function(e,r){return t.createLogger(e,r)}))},CategoryServiceImpl.prototype.createLogger=function(e,t){switch(e.loggerType){case i.LoggerType.Console:return new o.CategoryConsoleLoggerImpl(t,this);case i.LoggerType.MessageBuffer:return new c.CategoryMessageBufferLoggerImpl(t,this);case i.LoggerType.Custom:if(null===e.callBackLogger)throw new Error("Cannot create custom logger, custom callback is null");return e.callBackLogger(t,this);default:throw new Error("Cannot create a Logger for LoggerType: "+e.loggerType)}},CategoryServiceImpl.getCategoryKey=function(e){return e.getCategoryPath()},CategoryServiceImpl._INSTANCE=null,CategoryServiceImpl}();t.CategoryServiceImpl=d;var h=function(){function CategoryState(e,t,r){this._category=e,this._lazyState=new g(e,t,r)}return Object.defineProperty(CategoryState.prototype,"category",{get:function(){return this._category},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryState.prototype,"logger",{get:function(){return this._lazyState.getLogger()},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryState.prototype,"originalRuntimeSettings",{get:function(){return this._lazyState.getOriginalRuntimeSettings()},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryState.prototype,"currentRuntimeSettings",{get:function(){return this._lazyState.getCurrentRuntimeSettings()},enumerable:!0,configurable:!0}),CategoryState.prototype.enableForExtension=function(e){this._lazyState.enableForExtension(e)},CategoryState.prototype.updateSettings=function(e){this._lazyState.updateSettings(e)},CategoryState}(),g=function(){function LazyState(e,t,r){this._category=e,this._defaultConfig=t,this._createLogger=r}return LazyState.prototype.isLoaded=function(){return void 0!==this._logger},LazyState.prototype.getLogger=function(){return this.loadLoggerOnDemand(),this._delegateLogger},LazyState.prototype.getOriginalRuntimeSettings=function(){return this.loadLoggerOnDemand(),this._originalRuntimeSettings},LazyState.prototype.getCurrentRuntimeSettings=function(){return this.loadLoggerOnDemand(),this._currentRuntimeSettings},LazyState.prototype.enableForExtension=function(e){this.loadLoggerOnDemand(),this._wrappedLogger instanceof s.CategoryExtensionLoggerImpl||(console.log("Reconfiguring logger for extension for category: "+this._category.name),this._wrappedLogger=new s.CategoryExtensionLoggerImpl(this._category,e),this._delegateLogger.delegate=this._wrappedLogger)},LazyState.prototype.updateSettings=function(e){this.isLoaded()?(this._currentRuntimeSettings.logLevel=e.logLevel,this._currentRuntimeSettings.loggerType=e.loggerType,this._currentRuntimeSettings.logFormat=e.logFormat,this._currentRuntimeSettings.callBackLogger=e.callBackLogger,this._currentRuntimeSettings.formatterLogMessage=e.formatterLogMessage,this._logger=this._createLogger(e,this._category),this._wrappedLogger instanceof s.CategoryExtensionLoggerImpl||(this._wrappedLogger=this._logger),this._delegateLogger.delegate=this._wrappedLogger):this._defaultConfig=function(){return e}},LazyState.prototype.loadLoggerOnDemand=function(){this.isLoaded()||(this._logger=this._createLogger(this._defaultConfig(),this._category),this._wrappedLogger=this._logger,this._delegateLogger=new a.CategoryDelegateLoggerImpl(this._wrappedLogger),this._originalRuntimeSettings=this.initNewSettings(),this._currentRuntimeSettings=this.initNewSettings())},LazyState.prototype.initNewSettings=function(){var e=this._defaultConfig().copy();return new u.CategoryRuntimeSettings(this._category,e.logLevel,e.loggerType,e.logFormat,e.callBackLogger,e.formatterLogMessage)},LazyState}()},2399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2837),i=function(){function CategoryServiceFactory(){}return CategoryServiceFactory.getLogger=function(e){return n.CategoryServiceImpl.getInstance().getLogger(e)},CategoryServiceFactory.clear=function(){return n.CategoryServiceImpl.getInstance().clear()},CategoryServiceFactory.setDefaultConfiguration=function(e,t){void 0===t&&(t=!0),n.CategoryServiceImpl.getInstance().setDefaultConfiguration(e,t)},CategoryServiceFactory.setConfigurationCategory=function(e,t,r){void 0===r&&(r=!1),n.CategoryServiceImpl.getInstance().setConfigurationCategory(e,t,r)},CategoryServiceFactory}();t.CategoryServiceFactory=i},6843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=r(1674),o=r(9014),a=function(){function LogMessageInternalImpl(e,t,r,n,i,o,a,s){this._errorAsStack=null,this._error=null,this._loggerName=e,this._message=t,this._errorAsStack=r,this._error=n,this._logGroupRule=i,this._date=o,this._level=a,this._ready=s}return Object.defineProperty(LogMessageInternalImpl.prototype,"loggerName",{get:function(){return this._loggerName},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"message",{get:function(){return this._message},set:function(e){this._message=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"errorAsStack",{get:function(){return this._errorAsStack},set:function(e){this._errorAsStack=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"error",{get:function(){return this._error},set:function(e){this._error=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"logGroupRule",{get:function(){return this._logGroupRule},set:function(e){this._logGroupRule=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"level",{get:function(){return this._level},set:function(e){this._level=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"isMessageLogData",{get:function(){return"string"!=typeof this._message},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"ready",{get:function(){return this._ready},set:function(e){this._ready=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"messageAsString",{get:function(){return"string"==typeof this._message?this._message:this._message.msg},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"logData",{get:function(){var e=null;return"string"!=typeof this._message&&(e=this.message),e},enumerable:!0,configurable:!0}),LogMessageInternalImpl}(),s=function(){function AbstractLogger(e,t){this._allMessages=new i.LinkedList,this._open=!0,this._name=e,this._logGroupRuntimeSettings=t}return Object.defineProperty(AbstractLogger.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),AbstractLogger.prototype.trace=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Trace,e,t)},AbstractLogger.prototype.debug=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Debug,e,t)},AbstractLogger.prototype.info=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Info,e,t)},AbstractLogger.prototype.warn=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Warn,e,t)},AbstractLogger.prototype.error=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Error,e,t)},AbstractLogger.prototype.fatal=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Fatal,e,t)},AbstractLogger.prototype.isTraceEnabled=function(){return this._logGroupRuntimeSettings.level===n.LogLevel.Trace},AbstractLogger.prototype.isDebugEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Debug},AbstractLogger.prototype.isInfoEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Info},AbstractLogger.prototype.isWarnEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Warn},AbstractLogger.prototype.isErrorEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Error},AbstractLogger.prototype.isFatalEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Fatal},AbstractLogger.prototype.getLogLevel=function(){return this._logGroupRuntimeSettings.level},AbstractLogger.prototype.isOpen=function(){return this._open},AbstractLogger.prototype.close=function(){this._open=!1,this._allMessages.clear()},AbstractLogger.prototype.createDefaultLogMessage=function(e){return o.MessageFormatUtils.renderDefaultLog4jMessage(e,!0)},AbstractLogger.prototype._getMessageFormatter=function(){return this._logGroupRuntimeSettings.formatterLogMessage},AbstractLogger.prototype._log=function(e,t,r){if(void 0===r&&(r=null),this._open&&this._logGroupRuntimeSettings.level<=e){this._allMessages.addTail(this.createMessage(e,(function(){return"function"==typeof t?t():t}),(function(){return"function"==typeof r?r():r}),new Date)),this.processMessages()}},AbstractLogger.prototype.createMessage=function(e,t,r,n){var i=this,s=r();if(null!==s){var c=new a(this._name,t(),null,s,this._logGroupRuntimeSettings.logGroupRule,n,e,!1);return o.MessageFormatUtils.renderError(s).then((function(e){c.errorAsStack=e,c.ready=!0,i.processMessages()})).catch((function(){c.errorAsStack="<UNKNOWN> unable to get stack.",c.ready=!0,i.processMessages()})),c}return new a(this._name,t(),null,s,this._logGroupRuntimeSettings.logGroupRule,n,e,!0)},AbstractLogger.prototype.processMessages=function(){var e=this._allMessages;if(e.getSize()>0)do{var t=e.getHead();if(null!=t){if(!t.ready)break;e.removeHead(),null!==t.message&&this.doLog(t)}}while(e.getSize()>0)},AbstractLogger}();t.AbstractLogger=s},6580:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6843),a=r(3533),s=function(e){function ConsoleLoggerImpl(t,r){return e.call(this,t,r)||this}return i(ConsoleLoggerImpl,e),ConsoleLoggerImpl.prototype.doLog=function(e){if(void 0===console)throw new Error("Console is not defined, cannot log msg: "+e.message);var t=!1,r=e.level,n=this._getMessageFormatter(),i=void 0;switch(i=null===n?this.createDefaultLogMessage(e):n(e),r){case a.LogLevel.Trace:case a.LogLevel.Debug:break;case a.LogLevel.Info:console.info&&(console.info(i),t=!0);break;case a.LogLevel.Warn:console.warn&&(console.warn(i),t=!0);break;case a.LogLevel.Error:case a.LogLevel.Fatal:console.error&&(console.error(i),t=!0);break;default:throw new Error("Log level not supported: "+r)}t||console.log(i)},ConsoleLoggerImpl}(o.AbstractLogger);t.ConsoleLoggerImpl=s},8225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1674),i=r(3533),o=r(8983),a=r(7163),s=r(6616),c=r(8594),l=function(){function LFServiceImpl(){this._nameCounter=1,this._mapFactories=new n.SimpleMap,a.ExtensionHelper.register()}return LFServiceImpl.getInstance=function(){return null===LFServiceImpl._INSTANCE&&(LFServiceImpl._INSTANCE=new LFServiceImpl),LFServiceImpl._INSTANCE},LFServiceImpl.prototype.createLoggerFactory=function(e){void 0===e&&(e=null);var t="LoggerFactory"+this._nameCounter++;return this.createNamedLoggerFactory(t,e)},LFServiceImpl.prototype.createNamedLoggerFactory=function(e,t){if(void 0===t&&(t=null),this._mapFactories.exists(e))throw new Error("LoggerFactory with name "+e+" already exists.");var r;return r=null!==t?new o.LoggerFactoryImpl(e,t):new o.LoggerFactoryImpl(e,LFServiceImpl.createDefaultOptions()),this._mapFactories.put(e,r),r},LFServiceImpl.prototype.closeLoggers=function(){this._mapFactories.values().forEach((function(e){e.closeLoggers()})),this._mapFactories.clear(),this._nameCounter=1},LFServiceImpl.prototype.getRuntimeSettingsForLoggerFactories=function(){var e=[];return this._mapFactories.forEachValue((function(t){return e.push(t)})),e},LFServiceImpl.prototype.getLogGroupSettings=function(e,t){var r=this._mapFactories.get(e);return void 0===r?null:r.getLogGroupRuntimeSettingsByIndex(t)},LFServiceImpl.prototype.getLoggerFactoryRuntimeSettingsByName=function(e){var t=this._mapFactories.get(e);return void 0===t?null:t},LFServiceImpl.createDefaultOptions=function(){return(new c.LoggerFactoryOptions).addLogGroupRule(new s.LogGroupRule(new RegExp(".+"),i.LogLevel.Info))},LFServiceImpl._INSTANCE=null,LFServiceImpl}(),u=function(){function LFService(){}return LFService.createLoggerFactory=function(e){return void 0===e&&(e=null),LFService.INSTANCE_SERVICE.createLoggerFactory(e)},LFService.createNamedLoggerFactory=function(e,t){if(void 0===t&&(t=null),e===LFService.DEFAULT_LOGGER_FACTORY_NAME)throw new Error("LoggerFactory name: "+LFService.DEFAULT_LOGGER_FACTORY_NAME+" is reserved and cannot be used.");return LFService.INSTANCE_SERVICE.createNamedLoggerFactory(e,t)},LFService.closeLoggers=function(){return LFService.INSTANCE_SERVICE.closeLoggers()},LFService.getRuntimeSettings=function(){return LFService.INSTANCE_SERVICE},Object.defineProperty(LFService,"DEFAULT",{get:function(){return LFService.getDefault()},enumerable:!0,configurable:!0}),LFService.getDefault=function(){return null===LFService.DEFAULT_LOGGER_FACTORY&&(LFService.DEFAULT_LOGGER_FACTORY=LFService.DEFAULT_LOGGER_FACTORY=LFService.INSTANCE_SERVICE.createNamedLoggerFactory(LFService.DEFAULT_LOGGER_FACTORY_NAME,(new c.LoggerFactoryOptions).addLogGroupRule(new s.LogGroupRule(new RegExp(".+"),i.LogLevel.Error)))),LFService.DEFAULT_LOGGER_FACTORY},LFService.DEFAULT_LOGGER_FACTORY_NAME="DEFAULT",LFService.INSTANCE_SERVICE=l.getInstance(),LFService.DEFAULT_LOGGER_FACTORY=null,LFService}();t.LFService=u},6616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=function(){function LogGroupRule(e,t,r,i,o){void 0===r&&(r=new n.LogFormat),void 0===i&&(i=n.LoggerType.Console),void 0===o&&(o=null),this._formatterLogMessage=null,this._regExp=e,this._level=t,this._logFormat=r,this._loggerType=i,this._callBackLogger=o}return Object.defineProperty(LogGroupRule.prototype,"regExp",{get:function(){return this._regExp},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"loggerType",{get:function(){return this._loggerType},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"logFormat",{get:function(){return this._logFormat},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"callBackLogger",{get:function(){return this._callBackLogger},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"formatterLogMessage",{get:function(){return this._formatterLogMessage},set:function(e){if(null!==e&&this._loggerType===n.LoggerType.Custom)throw new Error("You cannot specify a formatter for log messages if your loggerType is Custom");this._formatterLogMessage=e},enumerable:!0,configurable:!0}),LogGroupRule}();t.LogGroupRule=i},1902:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=function(){function LogGroupRuntimeSettings(e){this._formatterLogMessage=null,this._logGroupRule=e,this._level=e.level,this._loggerType=e.loggerType,this._logFormat=new n.LogFormat(new n.DateFormat(e.logFormat.dateFormat.formatEnum,e.logFormat.dateFormat.dateSeparator),e.logFormat.showTimeStamp,e.logFormat.showLoggerName),this._callBackLogger=e.callBackLogger,this._formatterLogMessage=e.formatterLogMessage}return Object.defineProperty(LogGroupRuntimeSettings.prototype,"logGroupRule",{get:function(){return this._logGroupRule},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"level",{get:function(){return this._level},set:function(e){this._level=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"loggerType",{get:function(){return this._loggerType},set:function(e){this._loggerType=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"logFormat",{get:function(){return this._logFormat},set:function(e){this._logFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"callBackLogger",{get:function(){return this._callBackLogger},set:function(e){this._callBackLogger=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"formatterLogMessage",{get:function(){return this._formatterLogMessage},set:function(e){this._formatterLogMessage=e},enumerable:!0,configurable:!0}),LogGroupRuntimeSettings}();t.LogGroupRuntimeSettings=i},8983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1674),i=r(3533),o=r(6580),a=r(4570),s=r(6843),c=r(1902),l=function(){function LoggerFactoryImpl(e,t){this._loggers=new n.SimpleMap,this._logGroupRuntimeSettingsIndexed=[],this._loggerToLogGroupSettings=new n.SimpleMap,this._name=e,this.configure(t)}return LoggerFactoryImpl.prototype.configure=function(e){this._options=e,this.closeLoggers(),this._loggerToLogGroupSettings.clear(),this._logGroupRuntimeSettingsIndexed=[];for(var t=this._options.logGroupRules,r=0;r<t.length;r++)this._logGroupRuntimeSettingsIndexed.push(new c.LogGroupRuntimeSettings(t[r]))},LoggerFactoryImpl.prototype.getLogger=function(e){if(!this._options.enabled)throw new Error("LoggerFactory is not enabled, please check your options passed in");var t=this._loggers.get(e);return void 0!==t||(t=this.loadLogger(e),this._loggers.put(e,t)),t},LoggerFactoryImpl.prototype.isEnabled=function(){return this._options.enabled},LoggerFactoryImpl.prototype.closeLoggers=function(){this._loggers.forEachValue((function(e){e instanceof s.AbstractLogger&&e.close()})),this._loggers.clear()},LoggerFactoryImpl.prototype.getName=function(){return this._name},LoggerFactoryImpl.prototype.getLogGroupRuntimeSettingsByIndex=function(e){return e>=0&&e<this._logGroupRuntimeSettingsIndexed.length?this._logGroupRuntimeSettingsIndexed[e]:null},LoggerFactoryImpl.prototype.getLogGroupRuntimeSettingsByLoggerName=function(e){var t=this._loggerToLogGroupSettings.get(e);return void 0===t?null:t},LoggerFactoryImpl.prototype.getLogGroupRuntimeSettings=function(){return this._logGroupRuntimeSettingsIndexed.slice(0)},LoggerFactoryImpl.prototype.loadLogger=function(e){for(var t=this._options.logGroupRules,r=0;r<t.length;r++){var n=t[r];if(n.regExp.test(e)){var s=this._logGroupRuntimeSettingsIndexed[r],c=void 0;switch(n.loggerType){case i.LoggerType.Console:c=new o.ConsoleLoggerImpl(e,s);break;case i.LoggerType.MessageBuffer:c=new a.MessageBufferLoggerImpl(e,s);break;case i.LoggerType.Custom:if(null==n.callBackLogger)throw new Error("Cannot create a custom logger, custom callback is null");c=n.callBackLogger(e,s);break;default:throw new Error("Cannot create a Logger for LoggerType: "+n.loggerType)}return this._loggerToLogGroupSettings.put(e,s),c}}throw new Error("Failed to find a match to create a Logger for: "+e)},LoggerFactoryImpl}();t.LoggerFactoryImpl=l},8594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function LoggerFactoryOptions(){this._logGroupRules=[],this._enabled=!0}return LoggerFactoryOptions.prototype.addLogGroupRule=function(e){return this._logGroupRules.push(e),this},LoggerFactoryOptions.prototype.setEnabled=function(e){return this._enabled=e,this},Object.defineProperty(LoggerFactoryOptions.prototype,"logGroupRules",{get:function(){return this._logGroupRules},enumerable:!0,configurable:!0}),Object.defineProperty(LoggerFactoryOptions.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),LoggerFactoryOptions}();t.LoggerFactoryOptions=r},4570:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function MessageBufferLoggerImpl(t,r){var n=e.call(this,t,r)||this;return n.messages=[],n}return i(MessageBufferLoggerImpl,e),MessageBufferLoggerImpl.prototype.close=function(){this.messages=[],e.prototype.close.call(this)},MessageBufferLoggerImpl.prototype.getMessages=function(){return this.messages},MessageBufferLoggerImpl.prototype.toString=function(){return this.messages.map((function(e){return e})).join("\n")},MessageBufferLoggerImpl.prototype.doLog=function(e){var t,r=this._getMessageFormatter();t=null===r?this.createDefaultLogMessage(e):r(e),this.messages.push(t)},MessageBufferLoggerImpl}(r(6843).AbstractLogger);t.MessageBufferLoggerImpl=o},9290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9791),i=r(3315),o=r(7163);t.ExtensionHelper=o.ExtensionHelper;var a=r(8717);t.AbstractCategoryLogger=a.AbstractCategoryLogger;var s=r(9939);t.CategoryConsoleLoggerImpl=s.CategoryConsoleLoggerImpl;var c=r(8057);t.CategoryDelegateLoggerImpl=c.CategoryDelegateLoggerImpl;var l=r(1802);t.Category=l.Category;var u=r(4365);t.CategoryRuntimeSettings=u.CategoryRuntimeSettings;var p=r(4182);t.CategoryConfiguration=p.CategoryConfiguration;var d=r(7329);t.CategoryMessageBufferLoggerImpl=d.CategoryMessageBufferLoggerImpl;var h=r(2399);t.CategoryServiceFactory=h.CategoryServiceFactory;var g=r(8594);t.LoggerFactoryOptions=g.LoggerFactoryOptions;var y=r(6616);t.LogGroupRule=y.LogGroupRule;var m=r(8225);t.LFService=m.LFService;var v=r(6843);t.AbstractLogger=v.AbstractLogger;var w=r(6580);t.ConsoleLoggerImpl=w.ConsoleLoggerImpl;var b=r(4570);t.MessageBufferLoggerImpl=b.MessageBufferLoggerImpl;var C=r(3533);t.CategoryLogFormat=C.CategoryLogFormat,t.DateFormat=C.DateFormat,t.DateFormatEnum=C.DateFormatEnum,t.LogFormat=C.LogFormat,t.LoggerType=C.LoggerType,t.LogLevel=C.LogLevel;var _=r(1674);t.SimpleMap=_.SimpleMap,t.LinkedList=_.LinkedList,function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(6071));var S=r(9014);t.MessageFormatUtils=S.MessageFormatUtils,t.help=function help(){console.log("help()\n ** Shows this help\n\n getLogControl(): LoggerControl\n ** Returns LoggerControl Object, use to dynamically change loglevels for log4j logging.\n ** Call .help() on LoggerControl object for available options.\n\n getCategoryControl(): CategoryServiceControl\n ** Returns CategoryServiceControl Object, use to dynamically change loglevels for category logging.\n ** Call .help() on CategoryServiceControl object for available options.\n")},t.getLogControl=function getLogControl(){return new n.LoggerControlImpl},t.getCategoryControl=function getCategoryControl(){return new i.CategoryServiceControlImpl}},1674:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function LinkedNode(e){this._previous=null,this._next=null,this._value=e}return Object.defineProperty(LinkedNode.prototype,"previous",{get:function(){return this._previous},set:function(e){this._previous=e},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedNode.prototype,"next",{get:function(){return this._next},set:function(e){this._next=e},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedNode.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),LinkedNode}(),n=function(){function LinkedList(){this.head=null,this.size=0}return LinkedList.prototype.addHead=function(e){if(!this.createHeadIfNeeded(e)){if(null==this.head)throw new Error("This should never happen, list implementation broken");var t=this.head.next,n=new r(e);null!=t&&(t.previous=n,n.next=t),this.head=n}this.size++},LinkedList.prototype.addTail=function(e){if(!this.createHeadIfNeeded(e)){var t=this.getTailNode();if(null==t)throw new Error("List implementation broken");var n=new r(e);t.next=n,n.previous=t}this.size++},LinkedList.prototype.clear=function(){this.head=null,this.size=0},LinkedList.prototype.getHead=function(){return null!=this.head?this.head.value:null},LinkedList.prototype.removeHead=function(){if(null!=this.head){var e=this.head,t=e.value;return this.head=e.next,this.size--,t}return null},LinkedList.prototype.getTail=function(){var e=this.getTailNode();return null!=e?e.value:null},LinkedList.prototype.removeTail=function(){var e=this.getTailNode();if(null!=e){if(e===this.head)this.head=null;else{var t=e.previous;if(null==t)throw new Error("List implementation is broken");t.next=null}return this.size--,e.value}return null},LinkedList.prototype.getSize=function(){return this.size},LinkedList.prototype.filter=function(e){var recurse=function(e,t,r){e(t.value)&&r.push(t.value);var n=t.next;null!=n&&recurse(e,n,r)},t=[],r=this.head;return null!=r&&recurse(e,r,t),t},LinkedList.prototype.createHeadIfNeeded=function(e){return null==this.head&&(this.head=new r(e),!0)},LinkedList.prototype.getTailNode=function(){if(null==this.head)return null;for(var e=this.head;null!=e.next;)e=e.next;return e},LinkedList}();t.LinkedList=n;var i=function(){function SimpleMap(){this.array={}}return SimpleMap.prototype.put=function(e,t){this.array[e]=t},SimpleMap.prototype.get=function(e){return this.array[e]},SimpleMap.prototype.exists=function(e){return void 0!==this.array[e]},SimpleMap.prototype.remove=function(e){var t=this.array[e];return void 0!==t&&delete this.array[e],t},SimpleMap.prototype.keys=function(){var e=[];for(var t in this.array)this.array.hasOwnProperty(t)&&e.push(t);return e},SimpleMap.prototype.values=function(){var e=[];for(var t in this.array)this.array.hasOwnProperty(t)&&e.push(this.get(t));return e},SimpleMap.prototype.size=function(){return this.keys().length},SimpleMap.prototype.isEmpty=function(){return 0===this.size()},SimpleMap.prototype.clear=function(){this.array={}},SimpleMap.prototype.forEach=function(e){var t=0;for(var r in this.array){if(this.array.hasOwnProperty(r))e(r,this.array[r],t),t++}},SimpleMap.prototype.forEachValue=function(e){var t=0;for(var r in this.array){if(this.array.hasOwnProperty(r))e(this.array[r],t),t++}},SimpleMap}();t.SimpleMap=i;var o=function(){function TuplePair(e,t){this._x=e,this._y=t}return Object.defineProperty(TuplePair.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e},enumerable:!0,configurable:!0}),Object.defineProperty(TuplePair.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e},enumerable:!0,configurable:!0}),TuplePair}();t.TuplePair=o;var a=function(){function StringBuilder(){this.data=[]}return StringBuilder.prototype.append=function(e){if(void 0===e||null==e)throw new Error("String must be set, cannot append null or undefined");return this.data.push(e),this},StringBuilder.prototype.appendLine=function(e){return this.data.push(e+"\n"),this},StringBuilder.prototype.isEmpty=function(){return 0===this.data.length},StringBuilder.prototype.clear=function(){this.data=[]},StringBuilder.prototype.toString=function(e){return void 0===e&&(e=""),this.data.join(e)},StringBuilder}();t.StringBuilder=a},6071:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3533),a=r(1674),s=function(){function JSONTypeImpl(e){this._value=e}return JSONTypeImpl.prototype.getValue=function(){return this._value},JSONTypeImpl.prototype.toString=function(){var e=this.getValue();return null!=e?e.toString():"null"},JSONTypeImpl}(),c=function(e){function JSONBooleanType(t){return e.call(this,t)||this}return i(JSONBooleanType,e),JSONBooleanType}(s),l=function(e){function JSONNumberType(t){return e.call(this,t)||this}return i(JSONNumberType,e),JSONNumberType}(s),u=function(e){function JSONStringType(t){return e.call(this,t)||this}return i(JSONStringType,e),JSONStringType.prototype.toString=function(){var e=this.getValue();return null!=e?JSON.stringify(e.toString()):"null"},JSONStringType}(s),p=function(e){function JSONObjectType(t){return e.call(this,t)||this}return i(JSONObjectType,e),JSONObjectType}(s),d=function(e){function JSONArrayType(t){return e.call(this,t)||this}return i(JSONArrayType,e),JSONArrayType.prototype.toString=function(){var e=this.getValue();return null!=e?e.toString():"null"},JSONArrayType}(s),h=function(e){function JSONNullType(){return e.call(this,null)||this}return i(JSONNullType,e),JSONNullType.prototype.toString=function(){return"null"},JSONNullType}(s),g=function(){function JSONTypeConverter(){}return JSONTypeConverter.toJSONType=function(e){if(null===e)return new h;if("string"==typeof e)return new u(e);if("number"==typeof e)return new l(e);if("boolean"==typeof e)return new c(e);if(e instanceof y)return new p(e);throw new Error("Type not supported for value: "+e)},JSONTypeConverter}(),y=function(){function JSONObject(){this.values=new a.SimpleMap}return JSONObject.prototype.addBoolean=function(e,t){return this.checkName(e),JSONObject.checkValue(t),this.values.put(e,new c(t)),this},JSONObject.prototype.addNumber=function(e,t){return this.checkName(e),JSONObject.checkValue(t),this.values.put(e,new l(t)),this},JSONObject.prototype.addString=function(e,t){return this.checkName(e),JSONObject.checkValue(t),this.values.put(e,new u(t)),this},JSONObject.prototype.addNull=function(e){return this.checkName(e),this.values.put(e,new h),this},JSONObject.prototype.addArray=function(e,t){if(this.checkName(e),JSONObject.checkValue(t),null==t)throw new Error("Cannot add array as null");return this.values.put(e,new d(t)),this},JSONObject.prototype.addObject=function(e,t){if(this.checkName(e),JSONObject.checkValue(t),null==t)throw new Error("Cannot add object as null");return this.values.put(e,new p(t)),this},JSONObject.prototype.toString=function(e){var t=this;void 0===e&&(e=!1);var r=!1,n=new a.StringBuilder;return n.append("{"),this.values.keys().forEach((function(e){var i=t.values.get(e);null!=i&&(r&&n.append(","),n.append('"').append(e).append('":').append(i.toString()),r=!0)})),n.append("}"),n.toString()},JSONObject.prototype.checkName=function(e){if(null==e||void 0===e)throw new Error("Name is null or undefined");if(this.values.exists(e))throw new Error("Name "+e+" is already present for this object")},JSONObject.checkValue=function(e){if(void 0===e)throw new Error("Value is undefined")},JSONObject}();t.JSONObject=y;var m=function(){function JSONArray(){this.objects=[]}return JSONArray.prototype.add=function(e){if(void 0===e)throw new Error("Object is not allowed to be undefined");return this.objects.push(g.toJSONType(e)),this},JSONArray.prototype.toString=function(e){void 0===e&&(e=!1);var t=new a.StringBuilder;return t.append("["),this.objects.forEach((function(e,r){r>0&&t.append(","),t.append(e.toString())})),t.append("]"),t.toString()},JSONArray}();t.JSONArray=m;var v=function(){function JSONHelper(){}return JSONHelper.categoryToJSON=function(e,t){var r=new m;JSONHelper._categoryToJSON(e,r,t);var n=new y;return n.addArray("categories",r),n},JSONHelper._categoryToJSON=function(e,t,r){var n=new y;n.addNumber("id",e.id),n.addString("name",e.name),n.addString("logLevel",o.LogLevel[e.logLevel].toString()),null!=e.parent?n.addNumber("parent",e.parent.id):n.addNull("parent"),t.add(n),r&&e.children.forEach((function(e){JSONHelper._categoryToJSON(e,t,r)}))},JSONHelper}();t.JSONHelper=v},9014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(401),i=r(3533),o=function(){function MessageFormatUtils(){}return MessageFormatUtils.renderDate=function(e,t){var lpad=function(e,t,r){var n=t-e.length;if(n>0){for(var i="",o=0;o<n;o++)i+=r;return i+=e}return e},fullYear=function(e){return lpad(e.getFullYear().toString(),4,"0")},month=function(e){return lpad((e.getMonth()+1).toString(),2,"0")},day=function(e){return lpad(e.getDate().toString(),2,"0")},hours=function(e){return lpad(e.getHours().toString(),2,"0")},minutes=function(e){return lpad(e.getMinutes().toString(),2,"0")},seconds=function(e){return lpad(e.getSeconds().toString(),2,"0")},millis=function(e){return lpad(e.getMilliseconds().toString(),3,"0")},r=t.dateSeparator,n="";switch(t.formatEnum){case i.DateFormatEnum.Default:n=fullYear(e)+r+month(e)+r+day(e)+" "+hours(e)+":"+minutes(e)+":"+seconds(e)+","+millis(e);break;case i.DateFormatEnum.YearMonthDayTime:n=fullYear(e)+r+month(e)+r+day(e)+" "+hours(e)+":"+minutes(e)+":"+seconds(e);break;case i.DateFormatEnum.YearDayMonthWithFullTime:n=fullYear(e)+r+day(e)+r+month(e)+" "+hours(e)+":"+minutes(e)+":"+seconds(e)+","+millis(e);break;case i.DateFormatEnum.YearDayMonthTime:n=fullYear(e)+r+day(e)+r+month(e)+" "+hours(e)+":"+minutes(e)+":"+seconds(e);break;default:throw new Error("Unsupported date format enum: "+t.formatEnum)}return n},MessageFormatUtils.renderDefaultMessage=function(e,t){var r="",n=e.logFormat;n.showTimeStamp&&(r+=MessageFormatUtils.renderDate(e.date,n.dateFormat)+" "),r+=i.LogLevel[e.level].toUpperCase(),e.isResolvedErrorMessage&&(r+=" (resolved)"),r+=" ",n.showCategoryName&&(r+="[",e.categories.forEach((function(e,t){t>0&&(r+=", "),r+=e.name})),r+="]");var o="",a="",s=e.message;if("string"==typeof s)o=s;else{var c=s;o=c.msg,c.data&&(a=" [data]: "+(c.ds?c.ds(c.data):JSON.stringify(c.data)))}return r+=" "+o+a,t&&null!==e.errorAsStack&&(r+="\n"+e.errorAsStack),r},MessageFormatUtils.renderDefaultLog4jMessage=function(e,t){var r=e.logGroupRule.logFormat,n="";r.showTimeStamp&&(n+=MessageFormatUtils.renderDate(e.date,r.dateFormat)+" "),n+=i.LogLevel[e.level].toUpperCase()+" ",r.showLoggerName&&(n+="["+e.loggerName+"]");var o="",a="";if("string"==typeof e.message)o=e.message;else{var s=e.message;o=s.msg,s.data&&(a=" [data]: "+(s.ds?s.ds(s.data):JSON.stringify(s.data)))}return n+=" "+o+a,t&&null!==e.errorAsStack&&(n+="\n"+e.errorAsStack),n},MessageFormatUtils.renderError=function(e){var t=e.name+": "+e.message+"\n@";return new Promise((function(r){n.fromError(e,{offline:!0}).then((function(e){var n=e.map((function(e){return e.toString()})).join("\n ");r(t+="\n"+n)})).catch((function(){t="Unexpected error object was passed in. ";try{t+="Could not resolve it, stringified object: "+JSON.stringify(e)}catch(e){t+="Could not resolve it or stringify it."}r(t)}))}))},MessageFormatUtils}();t.MessageFormatUtils=o},1614:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{NIL:()=>_,parse:()=>y,stringify:()=>l,v1:()=>g,v3:()=>v,v4:()=>w,v5:()=>C,validate:()=>a,version:()=>S});var i=new Uint8Array(16);function rng(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function validate(e){return"string"==typeof e&&o.test(e)};for(var s=[],c=0;c<256;++c)s.push((c+256).toString(16).substr(1));const l=function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var u,p,d=0,h=0;const g=function v1(e,t,r){var n=t&&r||0,i=t||new Array(16),o=(e=e||{}).node||u,a=void 0!==e.clockseq?e.clockseq:p;if(null==o||null==a){var s=e.random||(e.rng||rng)();null==o&&(o=u=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=p=16383&(s[6]<<8|s[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),g=void 0!==e.nsecs?e.nsecs:h+1,y=c-d+(g-h)/1e4;if(y<0&&void 0===e.clockseq&&(a=a+1&16383),(y<0||c>d)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=c,h=g,p=a;var m=(1e4*(268435455&(c+=122192928e5))+g)%4294967296;i[n++]=m>>>24&255,i[n++]=m>>>16&255,i[n++]=m>>>8&255,i[n++]=255&m;var v=c/4294967296*1e4&268435455;i[n++]=v>>>8&255,i[n++]=255&v,i[n++]=v>>>24&15|16,i[n++]=v>>>16&255,i[n++]=a>>>8|128,i[n++]=255&a;for(var w=0;w<6;++w)i[n+w]=o[w];return t||l(i)};const y=function parse(e){if(!a(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function v35(e,t,r){function generateUUID(e,n,i,o){if("string"==typeof e&&(e=function stringToBytes(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=y(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),(a=r(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,i){o=o||0;for(var s=0;s<16;++s)i[o+s]=a[s];return i}return l(a)}try{generateUUID.name=e}catch(e){}return generateUUID.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",generateUUID.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",generateUUID}function getOutputLength(e){return 14+(e+64>>>9<<4)+1}function safeAdd(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function md5cmn(e,t,r,n,i,o){return safeAdd(function bitRotateLeft(e,t){return e<<t|e>>>32-t}(safeAdd(safeAdd(t,e),safeAdd(n,o)),i),r)}function md5ff(e,t,r,n,i,o,a){return md5cmn(t&r|~t&n,e,t,i,o,a)}function md5gg(e,t,r,n,i,o,a){return md5cmn(t&n|r&~n,e,t,i,o,a)}function md5hh(e,t,r,n,i,o,a){return md5cmn(t^r^n,e,t,i,o,a)}function md5ii(e,t,r,n,i,o,a){return md5cmn(r^(t|~n),e,t,i,o,a)}const m=function md5(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function md5ToHexEncodedArray(e){for(var t=[],r=32*e.length,n="0123456789abcdef",i=0;i<r;i+=8){var o=e[i>>5]>>>i%32&255,a=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);t.push(a)}return t}(function wordsToMd5(e,t){e[t>>5]|=128<<t%32,e[getOutputLength(t)-1]=t;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,a=0;a<e.length;a+=16){var s=r,c=n,l=i,u=o;r=md5ff(r,n,i,o,e[a],7,-680876936),o=md5ff(o,r,n,i,e[a+1],12,-389564586),i=md5ff(i,o,r,n,e[a+2],17,606105819),n=md5ff(n,i,o,r,e[a+3],22,-1044525330),r=md5ff(r,n,i,o,e[a+4],7,-176418897),o=md5ff(o,r,n,i,e[a+5],12,1200080426),i=md5ff(i,o,r,n,e[a+6],17,-1473231341),n=md5ff(n,i,o,r,e[a+7],22,-45705983),r=md5ff(r,n,i,o,e[a+8],7,1770035416),o=md5ff(o,r,n,i,e[a+9],12,-1958414417),i=md5ff(i,o,r,n,e[a+10],17,-42063),n=md5ff(n,i,o,r,e[a+11],22,-1990404162),r=md5ff(r,n,i,o,e[a+12],7,1804603682),o=md5ff(o,r,n,i,e[a+13],12,-40341101),i=md5ff(i,o,r,n,e[a+14],17,-1502002290),r=md5gg(r,n=md5ff(n,i,o,r,e[a+15],22,1236535329),i,o,e[a+1],5,-165796510),o=md5gg(o,r,n,i,e[a+6],9,-1069501632),i=md5gg(i,o,r,n,e[a+11],14,643717713),n=md5gg(n,i,o,r,e[a],20,-373897302),r=md5gg(r,n,i,o,e[a+5],5,-701558691),o=md5gg(o,r,n,i,e[a+10],9,38016083),i=md5gg(i,o,r,n,e[a+15],14,-660478335),n=md5gg(n,i,o,r,e[a+4],20,-405537848),r=md5gg(r,n,i,o,e[a+9],5,568446438),o=md5gg(o,r,n,i,e[a+14],9,-1019803690),i=md5gg(i,o,r,n,e[a+3],14,-187363961),n=md5gg(n,i,o,r,e[a+8],20,1163531501),r=md5gg(r,n,i,o,e[a+13],5,-1444681467),o=md5gg(o,r,n,i,e[a+2],9,-51403784),i=md5gg(i,o,r,n,e[a+7],14,1735328473),r=md5hh(r,n=md5gg(n,i,o,r,e[a+12],20,-1926607734),i,o,e[a+5],4,-378558),o=md5hh(o,r,n,i,e[a+8],11,-2022574463),i=md5hh(i,o,r,n,e[a+11],16,1839030562),n=md5hh(n,i,o,r,e[a+14],23,-35309556),r=md5hh(r,n,i,o,e[a+1],4,-1530992060),o=md5hh(o,r,n,i,e[a+4],11,1272893353),i=md5hh(i,o,r,n,e[a+7],16,-155497632),n=md5hh(n,i,o,r,e[a+10],23,-1094730640),r=md5hh(r,n,i,o,e[a+13],4,681279174),o=md5hh(o,r,n,i,e[a],11,-358537222),i=md5hh(i,o,r,n,e[a+3],16,-722521979),n=md5hh(n,i,o,r,e[a+6],23,76029189),r=md5hh(r,n,i,o,e[a+9],4,-640364487),o=md5hh(o,r,n,i,e[a+12],11,-421815835),i=md5hh(i,o,r,n,e[a+15],16,530742520),r=md5ii(r,n=md5hh(n,i,o,r,e[a+2],23,-995338651),i,o,e[a],6,-198630844),o=md5ii(o,r,n,i,e[a+7],10,1126891415),i=md5ii(i,o,r,n,e[a+14],15,-1416354905),n=md5ii(n,i,o,r,e[a+5],21,-57434055),r=md5ii(r,n,i,o,e[a+12],6,1700485571),o=md5ii(o,r,n,i,e[a+3],10,-1894986606),i=md5ii(i,o,r,n,e[a+10],15,-1051523),n=md5ii(n,i,o,r,e[a+1],21,-2054922799),r=md5ii(r,n,i,o,e[a+8],6,1873313359),o=md5ii(o,r,n,i,e[a+15],10,-30611744),i=md5ii(i,o,r,n,e[a+6],15,-1560198380),n=md5ii(n,i,o,r,e[a+13],21,1309151649),r=md5ii(r,n,i,o,e[a+4],6,-145523070),o=md5ii(o,r,n,i,e[a+11],10,-1120210379),i=md5ii(i,o,r,n,e[a+2],15,718787259),n=md5ii(n,i,o,r,e[a+9],21,-343485551),r=safeAdd(r,s),n=safeAdd(n,c),i=safeAdd(i,l),o=safeAdd(o,u)}return[r,n,i,o]}(function bytesToWords(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(getOutputLength(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))};const v=v35("v3",48,m);const w=function v4(e,t,r){var n=(e=e||{}).random||(e.rng||rng)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return l(n)};function f(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function ROTL(e,t){return e<<t|e>>>32-t}const b=function sha1(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i<n.length;++i)e.push(n.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a),c=0;c<a;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=e[64*c+4*u]<<24|e[64*c+4*u+1]<<16|e[64*c+4*u+2]<<8|e[64*c+4*u+3];s[c]=l}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(var p=0;p<a;++p){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=s[p][h];for(var g=16;g<80;++g)d[g]=ROTL(d[g-3]^d[g-8]^d[g-14]^d[g-16],1);for(var y=r[0],m=r[1],v=r[2],w=r[3],b=r[4],C=0;C<80;++C){var _=Math.floor(C/20),S=ROTL(y,5)+f(_,m,v,w)+b+t[_]+d[C]>>>0;b=w,w=v,v=ROTL(m,30)>>>0,m=y,y=S}r[0]=r[0]+y>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+w>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};const C=v35("v5",80,b),_="00000000-0000-0000-0000-000000000000";const S=function version(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},2890:e=>{"use strict";e.exports=NMSHDCrypto},194:e=>{"use strict";e.exports=TSServal},4654:()=>{},4901:(e,t,r)=>{"use strict";r.r(t),r.d(t,{JsonPatchError:()=>c,_areEquals:()=>_areEquals,applyOperation:()=>applyOperation,applyPatch:()=>applyPatch,applyReducer:()=>applyReducer,compare:()=>compare,deepClone:()=>_deepClone,default:()=>m,escapePathComponent:()=>escapePathComponent,generate:()=>generate,getValueByPointer:()=>getValueByPointer,observe:()=>observe,unescapePathComponent:()=>unescapePathComponent,unobserve:()=>unobserve,validate:()=>validate,validator:()=>validator});var n={};r.r(n),r.d(n,{JsonPatchError:()=>l,_areEquals:()=>_areEquals,applyOperation:()=>applyOperation,applyPatch:()=>applyPatch,applyReducer:()=>applyReducer,deepClone:()=>u,getValueByPointer:()=>getValueByPointer,validate:()=>validate,validator:()=>validator});var i={};r.r(i),r.d(i,{compare:()=>compare,generate:()=>generate,observe:()=>observe,unobserve:()=>unobserve});var o,a=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},o(e,t)},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),s=Object.prototype.hasOwnProperty;function helpers_hasOwnProperty(e,t){return s.call(e,t)}function _objectKeys(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);t=[];for(var n in e)helpers_hasOwnProperty(e,n)&&t.push(n);return t}function _deepClone(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function isInteger(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function escapePathComponent(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapePathComponent(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function hasUndefined(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(hasUndefined(e[t]))return!0}else if("object"==typeof e){var n=_objectKeys(e),i=n.length;for(t=0;t<i;t++)if(hasUndefined(e[n[t]]))return!0}return!1}function patchErrorMessageFormatter(e,t){var r=[e];for(var n in t){var i="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==i&&r.push(n+": "+i)}return r.join("\n")}var c=function(e){function PatchError(t,r,n,i,o){var a=this.constructor,s=e.call(this,patchErrorMessageFormatter(t,{name:r,index:n,operation:i,tree:o}))||this;return s.name=r,s.index=n,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=patchErrorMessageFormatter(t,{name:r,index:n,operation:i,tree:o}),s}return a(PatchError,e),PatchError}(Error),l=c,u=_deepClone,p={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=getValueByPointer(r,this.path);n&&(n=_deepClone(n));var i=applyOperation(r,{op:"remove",path:this.from}).removed;return applyOperation(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=getValueByPointer(r,this.from);return applyOperation(r,{op:"add",path:this.path,value:_deepClone(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:_areEquals(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},d={add:function(e,t,r){return isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:p.move,copy:p.copy,test:p.test,_get:p._get};function getValueByPointer(e,t){if(""==t)return e;var r={op:"_get",path:t};return applyOperation(e,r),r.value}function applyOperation(e,t,r,n,i,o){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=0),r&&("function"==typeof r?r(t,0,e,t.path):validator(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=getValueByPointer(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=_areEquals(e,t.value),!1===a.test)throw new l("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(r)throw new l("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}n||(e=_deepClone(e));var s=(t.path||"").split("/"),c=e,u=1,h=s.length,g=void 0,y=void 0,m=void 0;for(m="function"==typeof r?r:validator;;){if((y=s[u])&&-1!=y.indexOf("~")&&(y=unescapePathComponent(y)),i&&"__proto__"==y)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===g&&(void 0===c[y]?g=s.slice(0,u).join("/"):u==h-1&&(g=t.path),void 0!==g&&m(t,0,e,g)),u++,Array.isArray(c)){if("-"===y)y=c.length;else{if(r&&!isInteger(y))throw new l("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);isInteger(y)&&(y=~~y)}if(u>=h){if(r&&"add"===t.op&&y>c.length)throw new l("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=d[t.op].call(t,c,y,e)).test)throw new l("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(u>=h){if(!1===(a=p[t.op].call(t,c,y,e)).test)throw new l("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(c=c[y],r&&u<h&&(!c||"object"!=typeof c))throw new l("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}function applyPatch(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!0),r&&!Array.isArray(t))throw new l("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=_deepClone(e));for(var o=new Array(t.length),a=0,s=t.length;a<s;a++)o[a]=applyOperation(e,t[a],r,!0,i,a),e=o[a].newDocument;return o.newDocument=e,o}function applyReducer(e,t,r){var n=applyOperation(e,t);if(!1===n.test)throw new l("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function validator(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new l("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!p[e.op])throw new l("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new l("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new l('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new l("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new l("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&hasUndefined(e.value))throw new l("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,o=n.split("/").length;if(i!==o+1&&i!==o)throw new l("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new l("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var a=validate([{op:"_get",path:e.from,value:void 0}],r);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new l("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function validate(e,t,r){try{if(!Array.isArray(e))throw new l("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)applyPatch(_deepClone(t),_deepClone(e),r||!0);else{r=r||validator;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof l)return e;throw e}}function _areEquals(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,i,o=Array.isArray(e),a=Array.isArray(t);if(o&&a){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!_areEquals(e[r],t[r]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(e);if((n=s.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(s[r]))return!1;for(r=n;0!=r--;)if(!_areEquals(e[i=s[r]],t[i]))return!1;return!0}return e!=e&&t!=t}var h=new WeakMap,g=function g(e){this.observers=new Map,this.obj=e},y=function y(e,t){this.callback=e,this.observer=t};function unobserve(e,t){t.unobserve()}function observe(e,t){var r,n=function getMirror(e){return h.get(e)}(e);if(n){var i=function getObserverFromMirror(e,t){return e.observers.get(t)}(n,t);r=i&&i.observer}else n=new g(e),h.set(e,n);if(r)return r;if(r={},n.value=_deepClone(e),t){r.callback=t,r.next=null;var dirtyCheck=function(){generate(r)},fastCheck=function(){clearTimeout(r.next),r.next=setTimeout(dirtyCheck)};"undefined"!=typeof window&&(window.addEventListener("mouseup",fastCheck),window.addEventListener("keyup",fastCheck),window.addEventListener("mousedown",fastCheck),window.addEventListener("keydown",fastCheck),window.addEventListener("change",fastCheck))}return r.patches=[],r.object=e,r.unobserve=function(){generate(r),clearTimeout(r.next),function removeObserverFromMirror(e,t){e.observers.delete(t.callback)}(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",fastCheck),window.removeEventListener("keyup",fastCheck),window.removeEventListener("mousedown",fastCheck),window.removeEventListener("keydown",fastCheck),window.removeEventListener("change",fastCheck))},n.observers.set(t,new y(t,r)),r}function generate(e,t){void 0===t&&(t=!1);var r=h.get(e.object);_generate(r.value,e.object,e.patches,"",t),e.patches.length&&applyPatch(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function _generate(e,t,r,n,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=_objectKeys(t),a=_objectKeys(e),s=!1,c=a.length-1;c>=0;c--){var l=e[p=a[c]];if(!helpers_hasOwnProperty(t,p)||void 0===t[p]&&void 0!==l&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&r.push({op:"test",path:n+"/"+escapePathComponent(p),value:_deepClone(l)}),r.push({op:"remove",path:n+"/"+escapePathComponent(p)}),s=!0):(i&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),!0);else{var u=t[p];"object"==typeof l&&null!=l&&"object"==typeof u&&null!=u&&Array.isArray(l)===Array.isArray(u)?_generate(l,u,r,n+"/"+escapePathComponent(p),i):l!==u&&(!0,i&&r.push({op:"test",path:n+"/"+escapePathComponent(p),value:_deepClone(l)}),r.push({op:"replace",path:n+"/"+escapePathComponent(p),value:_deepClone(u)}))}}if(s||o.length!=a.length)for(c=0;c<o.length;c++){var p;helpers_hasOwnProperty(e,p=o[c])||void 0===t[p]||r.push({op:"add",path:n+"/"+escapePathComponent(p),value:_deepClone(t[p])})}}}function compare(e,t,r){void 0===r&&(r=!1);var n=[];return _generate(e,t,n,"",r),n}const m=Object.assign({},n,i,{JsonPatchError:c,deepClone:_deepClone,escapePathComponent,unescapePathComponent})}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r=__webpack_require__(5590);NMSHDTransport=r})();
|
|
2
|
+
var NMSHDTransport;(()=>{var e={2500:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildInformation=void 0;const n=r(194),i=r(2890);t.buildInformation={version:"1.1.8",build:"20",date:"2022-02-01T06:24:18+00:00",commit:"800bbdcdec148918ad48e3c0d8851fd04876a2df",dependencies:{"@js-soft/docdb-access-abstractions":"1.0.1","@js-soft/logging-abstractions":"1.0.0","@js-soft/simple-logger":"1.0.1","@js-soft/ts-utils":"1.1.1",axios:"^0.25.0","deep-equal":"^2.0.5","fast-json-patch":"^3.1.0","form-data":"^4.0.0","json-stringify-safe":"^5.0.1",lodash:"^4.17.21",luxon:"^2.3.0",qs:"^6.10.3","reflect-metadata":"^0.1.13","ts-simple-nameof":"^1.3.1",uuid:"^8.3.2"},libraries:{crypto:i.buildInformation,serval:n.buildInformation}}},4093:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreCrypto=void 0;const n=r(2890),i=r(2212),o=r(18),a=r(819);t.CoreCrypto=class CoreCrypto{static async generateSignatureKeypair(e=a.TransportVersion.Latest){if(e===a.TransportVersion.V1)return await n.CryptoSignatures.generateKeypair(3);throw o.TransportErrors.util.crypto.invalidVersion(e)}static async generateExchangeKeypair(e=a.TransportVersion.Latest){if(e===a.TransportVersion.V1)return await n.CryptoExchange.generateKeypair(3);throw o.TransportErrors.util.crypto.invalidVersion(e)}static async generateSecretKey(e=a.TransportVersion.Latest){if(e===a.TransportVersion.V1)return await n.CryptoEncryption.generateKey(3);throw o.TransportErrors.util.crypto.invalidVersion(e)}static async generatePassword(e,t="enmeshed",r=3,i=a.TransportVersion.Latest){const s=n.CoreBuffer.fromString(e,n.Encoding.Utf8),c=n.CoreBuffer.fromString(t,n.Encoding.Utf8);if(i===a.TransportVersion.V1)return await n.CryptoDerivation.deriveKeyFromMaster(s,15e4,r,c);throw o.TransportErrors.util.crypto.invalidVersion(i)}static async deriveKeyFromBase(e,t,r,i=3){let a;if(e instanceof n.CryptoSecretKey)a=e.secretKey;else{if(!(e instanceof n.CoreBuffer))throw o.TransportErrors.util.crypto.invalidSecretType();a=e}return await n.CryptoDerivation.deriveKeyFromBase(a,t,r,i)}static async deriveClient(e,t,r=3,i=a.TransportVersion.Latest){if(i===a.TransportVersion.V1){return await n.CryptoExchange.deriveTemplator(e,t,r)}throw o.TransportErrors.util.crypto.invalidVersion(i)}static async deriveServer(e,t,r=3,i=a.TransportVersion.Latest){if(i===a.TransportVersion.V1){return await n.CryptoExchange.deriveRequestor(e,t,r)}throw o.TransportErrors.util.crypto.invalidVersion(i)}static async sign(e,t,r=a.TransportVersion.Latest){if(r===a.TransportVersion.V1)return await n.CryptoSignatures.sign(e,t,2);throw o.TransportErrors.util.crypto.invalidVersion(r)}static async verify(e,t,r,i=a.TransportVersion.Latest){if(i===a.TransportVersion.V1)return await n.CryptoSignatures.verify(e,t,r);throw o.TransportErrors.util.crypto.invalidVersion(i)}static async encrypt(e,t,r=a.TransportVersion.Latest){if(r===a.TransportVersion.V1)return await n.CryptoEncryption.encrypt(e,t);throw o.TransportErrors.util.crypto.invalidVersion(r)}static async decrypt(e,t,r=a.TransportVersion.Latest){if(r===a.TransportVersion.V1)return await n.CryptoEncryption.decrypt(e,t);throw o.TransportErrors.util.crypto.invalidVersion(r)}static async random(e){return await n.CryptoRandom.bytes(e)}static async createAccountPassword(){return await i.PasswordGenerator.createStrongPassword(100,100)}}},8147:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreError=void 0;const i=n(r(4530));class CoreError extends Error{constructor(e="error.unknown",t="Operation failed unexpectedly.",r=null,n=new Date,o,a){const s=[];s.push(e),t&&s.push(": '",t,"'"),s.push(" at ",n.toISOString()),r&&("function"==typeof r.toJSON?s.push(` with data ${r.toJSON(!1)}`):s.push(` with data ${(0,i.default)(r)}`)),super(s.join("")),this._code=e,this._reason=t,this._time=n,this._data=r,this.name="CoreError",this._rootError=o,this._context=a,void 0!==Error.captureStackTrace&&Error.captureStackTrace(this,null!=a?a:CoreError)}get code(){return this._code}get reason(){return this._reason}get data(){return this._data}get time(){return this._time}get rootError(){return this._rootError}get context(){return this._context}equals(e){return this.code===e.code}logWith(e){return e.error(this),this}}t.CoreError=CoreError},3289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreIdHelper=void 0;const n=r(5833),i=r(9170);t.CoreIdHelper=class CoreIdHelper{constructor(e,t=!1){this.prefix=e,this.validateOnly=t,this.coreIdRegex=new RegExp(`${e}[${n.RandomCharacterRange.Alphanumeric}]{${20-e.length}}`)}async generate(){if(this.validateOnly)throw new Error("This CoreIdHelper is set up for validation only.");return await i.CoreId.generate(this.prefix)}validate(e){return this.coreIdRegex.test(e)}}},6904:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreSerializable=void 0;const o=r(194),a=r(2890);let s=n=class CoreSerializable extends o.Serializable{toBase64(){return a.CoreBuffer.fromUtf8(this.serialize()).toBase64URL()}static from(e,t){return super.fromT(e,t)}static fromT(e,t){return super.fromT(e,t)}static fromBase64T(e,t){const r=a.CoreBuffer.fromBase64URL(e).toUtf8();return n.deserializeT(r,t)}static fromBase64Unknown(e){const t=a.CoreBuffer.fromBase64URL(e).toUtf8();return o.Serializable.deserializeUnknown(t)}};s=n=i([(0,o.type)("CoreSerializable")],s),t.CoreSerializable=s},2970:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreSerializableAsync=void 0;const o=r(194),a=r(2890);let s=n=class CoreSerializableAsync extends o.SerializableAsync{toBase64(){return a.CoreBuffer.fromUtf8(this.serialize()).toBase64URL()}static async from(e,t){return await super.from(e,t)}static async fromT(e,t){return await super.fromT(e,t)}static async fromBase64T(e,t){const r=a.CoreBuffer.fromBase64URL(e).toUtf8();return await n.deserializeT(r,t)}static async fromBase64Unknown(e){const t=a.CoreBuffer.fromBase64URL(e).toUtf8();return await o.SerializableAsync.deserializeUnknown(t)}};s=n=i([(0,o.type)("CoreSerializableAsync")],s),t.CoreSerializableAsync=s},6564:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreSynchronizable=void 0;const o=r(194),a=r(2970),s=r(9170);class CoreSynchronizable extends a.CoreSerializableAsync{constructor(){super(...arguments),this.technicalProperties=[],this.userdataProperties=[],this.metadataProperties=[]}}n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],CoreSynchronizable.prototype,"id",void 0),t.CoreSynchronizable=CoreSynchronizable},1341:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreUtil=void 0;const n=r(194),i=r(2890),o=r(18);t.CoreUtil=class CoreUtil{static toBuffer(e,t=!1){let r;if(e instanceof i.CoreBuffer)return e;if("string"==typeof e)r=i.CoreBuffer.fromUtf8(e);else if(e instanceof n.SerializableAsync||e instanceof n.Serializable)r=i.CoreBuffer.fromUtf8(e.serialize(t));else{if(!(e instanceof ArrayBuffer||e instanceof Uint8Array))throw o.TransportErrors.util.wrongContentForBuffer();r=new i.CoreBuffer(e)}return r}static toSerializable(e){return e instanceof n.SerializableAsync||e instanceof n.Serializable?e:n.Serializable.fromUnknown(e)}}},369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DbCollectionName=void 0,function(e){e.Files="Files",e.Tokens="Tokens",e.Relationships="Relationships",e.RelationshipTemplates="Templates",e.Messages="Messages",e.CertificatesIssued="CertificatesIssued",e.UnpushedDatawalletModifications="UnpushedDatawalletModifications",e.Devices="Devices",e.Secrets="Secrets"}(t.DbCollectionName||(t.DbCollectionName={}))},5796:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2685:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=void 0;const i=r(2391),o=r(2890),a=n(r(6486)),s=r(2016),c=r(981),l=r(18),u=r(392);let p;class Transport{constructor(e,t,r=new i.SimpleLoggerFactory){if(this.databaseConnection=e,this._config=a.default.defaultsDeep({},t,Transport.defaultConfig),u.TransportLoggerFactory.init(r),p=u.TransportLoggerFactory.getLogger(Transport),!this._config.platformClientId)throw l.TransportErrors.general.platformClientIdNotSet().logWith(p);if(!this._config.platformClientSecret)throw l.TransportErrors.general.platformClientSecretNotSet().logWith(p);if(!this._config.baseUrl)throw l.TransportErrors.general.baseUrlNotSet().logWith(p);if(this._config.supportedDatawalletVersion<1)throw l.TransportErrors.general.invalidDatawalletVersion().logWith(p)}get config(){return this._config}async init(){return p.trace("Initializing Libsodium..."),await o.SodiumWrapper.ready(),p.trace("Libsodium initialized"),p.info("Transport initialized"),this}async createDatabase(e){return await this.databaseConnection.getDatabase(e)}static get context(){return c.TransportContext.currentContext()}}t.Transport=Transport,Transport.defaultConfig={supportedDatawalletVersion:1,debug:!1,platformClientId:"",platformClientSecret:"",platformTimeout:6e4,platformMaxRedirects:10,platformMaxUnencryptedFileSize:10485760,baseUrl:"",realm:s.Realm.Prod,datawalletEnabled:!1,httpAgent:{keepAlive:!0,maxSockets:5,maxFreeSockets:2},httpsAgent:{keepAlive:!0,maxSockets:5,maxFreeSockets:2}}},981:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportContext=void 0,function(e){e.Web="Web",e.Cordova="Cordova",e.Node="Node"}(t.TransportContext||(t.TransportContext={})),function(e){let t;e.currentContext=function currentContext(){return t||(t=function _queryContext(){return"undefined"==typeof window?e.Node:window.isCordovaApp?e.Cordova:e.Web}()),t}}(t.TransportContext||(t.TransportContext={}))},2508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportController=t.ControllerName=void 0;const n=r(2970),i=r(18),o=r(392);!function(e){e.Account="Account",e.Attribute="Attribute",e.Certificate="Certificate",e.CertificateIssuer="CertificateIssuer",e.CertificateValidator="CertificateValidator",e.Challenge="Challenge",e.Device="Device",e.Devices="Devices",e.DeviceSecret="DeviceSecret",e.File="File",e.Identity="Identity",e.Message="Message",e.Relationship="Relationship",e.Relationships="Relationships",e.RelationshipTemplate="RelationshipTemplate",e.RelationshipRequest="RelationshipRequest",e.RelationshipRequestor="RelationshipRequestor",e.RelationshipSecret="RelationshipSecret",e.RelationshipTemplator="RelationshipTemplator",e.Secret="Secret",e.Sync="Sync",e.Token="Token"}(t.ControllerName||(t.ControllerName={}));t.TransportController=class TransportController{constructor(e,t){var r;this._dbClosed=!1,this._controllerName=e,this._transport=t.transport,this._parent=t,this._config=t.config,this._db=t.db,this._initialized=!1;let n=e;this.config.debug&&(null===(r=this.parent.activeDeviceOrUndefined)||void 0===r?void 0:r.deviceOrUndefined)&&(n+=` of ${this.parent.activeDevice.device.id}`),this._log=o.TransportLoggerFactory.getLogger(n)}get log(){return this._log}get config(){return this._config}get db(){return this._db}get transport(){return this._transport}get parent(){return this._parent}get initialized(){return this._initialized}get controllerName(){return this._controllerName}init(){if(this._initialized)throw i.TransportErrors.controller.alreadyInitialized(this.controllerName).logWith(this._log);return this._initialized=!0,Promise.resolve(this)}async parseObject(e,t){return await n.CoreSerializableAsync.fromT(e,t)}async parseArray(e,t,r){const n=[];for(let o=0,a=e.length;o<a;o++)if(r){const a=e[o];if(!a[r])throw i.TransportErrors.controller.contentPropertyUndefined(r).logWith(this._log);n.push(this.parseObject(a[r],t))}else n.push(this.parseObject(e[o],t));return await Promise.all(n)}}},18:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TransportErrors=void 0;const i=n(r(4530)),o=r(8147);class Crypto{invalidVersion(e){return new o.CoreError("error.transport.crypto.invalidVersion",`The version ${e} is not supported.`)}invalidSecretType(){return new o.CoreError("error.transport.crypto.invalidSecretType","The secret type is invalid.")}}class Logging{loggerNotInitialized(){return new o.CoreError("error.transport.logging.loggerNotInitialized","The logger factory is not yet initialized")}}class CoreDateErrors{noIsoStringMethod(){return new o.CoreError("error.transport.date.noIsoMethod","The provided object doesn't have an iso string method")}undefined(){return new o.CoreError("error.transport.date.undefined","The provided object is undefined and cannot be deserialized.")}}class Random{minLessThanZero(){return new o.CoreError("error.transport.util.random.minLessThanZero","minlength must not be less than zero")}inputTooLong(){return new o.CoreError("error.transport.util.random.inputTooLong","Input exceeds maximum length of 256!")}maxTooHigh(){return new o.CoreError("error.transport.util.random.maxTooHigh","Max must be below 22.")}mnBiggerThatMax(){return new o.CoreError("error.code.util.random.minBiggerThanMax","Max must be larger than min.")}rangeTooBig(){return new o.CoreError("error.transport.util.random.rangeTooBig","The range between the numbers is too big, 32 bit is the maximum -> 4294967296")}intLength(){return new o.CoreError("error.transport.util.random.length","Length must be between 1 and 21.")}}class TransportErrors{}t.TransportErrors=TransportErrors,TransportErrors.controller=new class Controller{alreadyInitialized(e){return new o.CoreError("error.transport.controller.alreadyInitialized",`The controller ${e} was already initialized.`)}contentPropertyUndefined(e){return new o.CoreError("error.transport.controller.contentPropertyUndefined",`The property ${e} is undefined.`)}},TransportErrors.relationships=new class Relationships{responseCryptoIsMissing(){return new o.CoreError("error.transport.relationships.responseCryptoIsMissing","The response crypto is missing.")}requestContainsWrongTemplateId(){return new o.CoreError("error.transport.relationships.requestContainsWrongTemplateId","The relationship request contains a wrong template id.")}responseContainsWrongRequestId(){return new o.CoreError("error.transport.relationships.requestContainsWrongRequestId","The relationship response contains a wrong request id.")}wrongChangeStatus(e){return new o.CoreError("error.transport.relationships.wrongChangeStatus",`The relationship change has the wrong status (${e}) to run this operation`)}wrongChangeType(e){return new o.CoreError("error.transport.relationships.wrongChangeType",`The relationship change has the wrong type (${e}) to run this operation`)}changeResponseMissing(e){return new o.CoreError("error.transport.relationships.changeResponseMissing",`The response of the relationship change (${e}) is missing`)}emptyOrInvalidContent(e){return new o.CoreError("error.transport.relationships.wrongOrEmptyContent",`The relationship change ${null==e?void 0:e.id} requires a content property or its content property is invalid`)}},TransportErrors.util=new class Util{constructor(){this.date=new CoreDateErrors,this.random=new Random,this.logging=new Logging,this.crypto=new Crypto}passwordMinLengthTooShort(){return new o.CoreError("error.transport.passwordMinLengthTooShort","Minimum password length for a strong password should be 8 characters.")}wrongContentForBuffer(){return new o.CoreError("error.transport.wrongContentForBuffer","The given content cannot be transformed to buffer.")}tooLongCoreIdPrefix(e){return new o.CoreError("error.transport.coreid.tooLongPrefix",`The prefix "${e}" is too long`)}},TransportErrors.general=new class General{invalidDatawalletVersion(){return new o.CoreError("error.transport.general.invalidDatawalletVersion","The given identity version is invalid. The value must be 0 or higher.")}baseUrlNotSet(){return new o.CoreError("error.transport.general.baseUrlNotSet","The baseUrl was not set.")}platformClientIdNotSet(){return new o.CoreError("error.transport.general.platformClientNotSet","The platform clientSecret was not set.")}platformClientSecretNotSet(){return new o.CoreError("error.transport.general.platformClientNotSet","The platform clientId was not set.")}platformClientInvalid(){return new o.CoreError("error.transport.general.platformClientInvalid","The combination of platform clientId and clientSecret is invalid.")}cacheEmpty(e,t){return new o.CoreError("error.transport.general.cacheEmpty",`The cache of ${e instanceof Function?e.name:e} with id "${t}" is empty.`,t)}incompatibleBackbone(){return new o.CoreError("error.transport.incompatibleBackbone","The backbone sent an invalid payload.")}signatureNotValid(e){return new o.CoreError("error.transport.signatureNotValid",`The ${e?`${e}-`:""}signature is not valid.`)}recordNotFound(e,t){return new o.CoreError("error.transport.recordNotFound",`'${e instanceof Function?e.name:e}' not found.`,t)}notImplemented(){return new o.CoreError("error.transport.notImplemented","The method is not yet implemented.")}typeNotInReflection(e){return new o.CoreError("error.transport.typeNotInReflectionClass",`The type ${e} was not in the reflection classes. You might have to install a module first.`)}datawalletNotAvailable(){return new o.CoreError("error.transport.datawalletNotAvailable","The datawallet is not available (yet?) and was requested.")}unsupportedDatabaseTypeForQuery(e,t){return new o.CoreError("error.transport.unsupportedDatabaseTypeForQuery",`The query '${t.name}' does not (yet?) support the database type '${e}'.`)}notAllowedCombinationOfDeviceSharedSecretAndAccount(){return new o.CoreError("error.transport.account","The combination of deviceSharedSecret, existing identity or device is not allowed.")}},TransportErrors.identity=new class Identity{realmLength(){return new o.CoreError("error.transport.identity.realmLength","Realm must be of length 3.")}identityNotSet(){return new o.CoreError("error.transport.identity.identityNotSet","The identity must be set")}noAddressReceived(){return new o.CoreError("error.transport.identity.noAddressReceived","The backbone did not create an address for the created device.")}addressMismatch(){return new o.CoreError("error.transport.identity.addressMismatch","The backbone address does not match the local address.")}},TransportErrors.messages=new class Messages{plaintextMismatch(e){return new o.CoreError("error.transport.messages.plaintextMismatch",`The own address ${e} was not named as a recipient within the signed MessagePlaintext. A replay attack might be the cause of this.`)}signatureListMismatch(e){return new o.CoreError("error.transport.messages.signatureListMismatch",`The signature list didn't contain an entry for address ${e}.`)}signatureNotValid(){return new o.CoreError("error.transport.messages.signatureNotValid","The digital signature on this message for peer key is invalid. An impersonination attack might be the cause of this.")}noRecipientsSet(){return new o.CoreError("error.transport.messages.noRecipientsSet","No recipients set.")}ownAddressNotInList(e){return new o.CoreError("error.transport.messages.ownAddressNotInList",`The recipients list of message ${e} didn't contain an entry for the own address. This message should not have been received.`)}noMatchingRelationship(e){return new o.CoreError("error.transport.messages.noMatchingRelationship",`A relationship with sender ${e} does not exist. This might be spam.`)}noSecretKeyForOwnMessage(e){return new o.CoreError(`No secret key found for own message ${e}`,"The message could not be decrypted, because no secret key was found for it.")}},TransportErrors.secrets=new class Secrets{lengthMismatch(){return new o.CoreError("error.transport.secrets.lengthMismatch","Length mismatch between old number of secrets and new ones.")}wrongBaseKeyType(e){return new o.CoreError("error.transport.secrets.wrongBaseKeyType",`Given BaseKey type "${e}" is not supported!`)}wrongSecretType(e){return new o.CoreError("error.transport.secrets.wrongBaseKeyType","Given Secret type is not supported!",{secretId:e})}secretNotFound(e){return new o.CoreError("error.transport.secrets.secretNotFound",`secret "${e}" not found`)}},TransportErrors.device=new class Device{deviceNotSet(){return new o.CoreError("error.transport.device.deviceNotSet","The device must be set")}notOnboardedYet(){return new o.CoreError("error.transport.devices.notOnboardedYet","The device is not onboarded yet and has no public key.")}alreadyOnboarded(){return new o.CoreError("error.transport.devices.alreadyOnboarded","The device has already been onboarded.")}},TransportErrors.files=new class Files{plaintextHashMismatch(){return new o.CoreError("error.transport.files.plaintextHashMismatch","The actual hash of the plaintext does not match the given plaintextHash. Something went wrong while encrypting/decrypting the file.")}cipherMismatch(){return new o.CoreError("error.transport.files.cipherMismatch","The actual hash of the cipher does not match the given cipherHash. Something went wrong while storing/transmitting the file.")}invalidMetadata(e){return new o.CoreError("error.transport.files.invalidMetadata",`The metadata of file id "${e}" is invalid.`)}invalidTruncatedReference(){return new o.CoreError("error.transport.files.invalidTruncatedReference","invalid truncated reference")}fileContentUndefined(){return new o.CoreError("error.transport.files.fileContentUndefined","The given file content is undefined.")}maxFileSizeExceeded(e,t){return new o.CoreError("error.transport.files.maxFileSizeExceeded",`The given file content size (${e}) exceeds the max file size the backbone accepts (${t}).`)}},TransportErrors.challenges=new class Challenges{challengeTypeRequiredRelationship(){return new o.CoreError("error.transport.challenges.challengeTypeRequiredRelationship","The challenge type ist relationship but the relationship is undefined")}},TransportErrors.datawallet=new class Datawallet{encryptedPayloadIsNoCipher(){return new o.CoreError("error.transport.datawallet.encryptedPayloadIsNoCipher","The given encrypted payload is no cipher.")}unsupportedModification(e,t){const r=t?(0,i.default)(t):"";if("unsupportedCacheChangedModificationCollection"===e)return new o.CoreError("error.transport.datawallet.unsupportedModification",`The following collections were received in CacheChanged datawallet modifications but are not supported by the current version of this library: ${r}.`);throw new Error(`Given type '${e}' is not supported.`)}insufficientSupportedDatawalletVersion(e,t){return new o.CoreError("error.transport.datawallet.insufficientSupportedDatawalletVersion",`The SupportedDatawalletVersion '${e}' is too low. A minimum version of '${t}' is required.`)}currentBiggerThanTarget(e,t){return new o.CoreError("error.transport.datawallet.currentBiggerThanTarget",`The current datawallet version '${e}' is bigger than the target version '${t}'.`)}noMigrationAvailable(e){return new o.CoreError("error.core.datawallet.noMigrationAvailable",`There is no migration available for the datawallet version '${e}'.`)}},TransportErrors.tokens=new class Tokens{invalidTruncatedReference(){return new o.CoreError("error.transport.tokens.invalidTruncatedReference","invalid truncated reference")}invalidTokenContent(e){return new o.CoreError("error.transport.tokens.invalidTokenContent",`The content of token ${e} is not of type TokenContent`)}},TransportErrors.relationshipTemplates=new class RelationshipTemplates{}},8169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportIds=void 0;const n=r(3289);class TransportIds{}t.TransportIds=TransportIds,TransportIds.generic=new n.CoreIdHelper(""),TransportIds.secret=new n.CoreIdHelper("TRPSEC"),TransportIds.relationshipSecret=new n.CoreIdHelper("TRPRSE"),TransportIds.relationshipTemplateKey=new n.CoreIdHelper("TRPRTK"),TransportIds.datawalletModification=new n.CoreIdHelper("TRPDWM"),TransportIds.fileReference=new n.CoreIdHelper("TRPFRF")},392:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportLoggerFactory=void 0;const n=r(18);t.TransportLoggerFactory=class TransportLoggerFactory{static init(e){this.instance=e}static getLogger(e){if(!this.isInitialized())throw n.TransportErrors.util.logging.loggerNotInitialized();return"function"==typeof e?this.instance.getLogger(`Transport.${e.name}`):this.instance.getLogger(`Transport.${e}`)}static isInitialized(){return!!this.instance}}},9369:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AuthClient=void 0;const i=n(r(129)),o=r(1732),a=r(8892),s=r(8990),c=r(8103);class AuthClient extends c.RESTClient{async authenticate(e){var t;const r="/connect/token";let n;try{n=await this.createAxios().post(r,i.default.stringify({client_id:e.clientId,client_secret:e.clientSecret,grant_type:e.grantType,username:e.username,password:e.password}))}catch(e){const n=new s.RequestError("post",r,void 0,"error.transport.request.noAuthPossible","Authentication was not possible. Is the service up and running?"+(e.message?` Root cause: '${e.message}'`:""),"",null===(t=e.response)||void 0===t?void 0:t.status).setObject(e.isAxiosError?s.RequestError.cleanAxiosError(e):e);return a.ClientResult.fail(n)}const c={requestTime:n.headers["x-request-time"],responseDuration:n.headers["x-response-duration-ms"],responseTime:n.headers["x-response-time"],traceId:n.headers["x-trace-id"]};if(200!==n.status)return a.ClientResult.fail(new s.RequestError("post",r,c,"error.transport.request.noAuthGrant","Backbone did not grant authentication. Are the credentials correct?","",n.status).setObject(n.data.error));const l=n.data;return a.ClientResult.ok({expiry:o.CoreDate.utc().add({seconds:parseInt(l.expires_in)}),token:l.access_token})}}t.AuthClient=AuthClient},4381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Authenticator=void 0;const n=r(9369);t.Authenticator=class Authenticator{constructor(e){this.accountController=e,this.authClient=new n.AuthClient(e.config)}async getToken(){return this.token&&!this.isExpired()||await this.authenticate(),this.token}debugLog(e){var t;e.error("Current token is: ",this.token),e.error("Expiry is: ",null===(t=this.expiry)||void 0===t?void 0:t.toISOString())}clear(){this.token=void 0,this.expiry=void 0}isExpired(){if(!this.expiry)return!0;return this.expiry.subtract({seconds:10}).isExpired()}async authenticate(){if(this.request)return await this.request;this.clear(),this.request=this.authenticateInternal();try{await this.request}finally{this.request=void 0}}async authenticateInternal(){const e=await this.accountController.activeDevice.getCredentials(),t={grantType:"password",clientId:this.accountController.config.platformClientId,clientSecret:this.accountController.config.platformClientSecret,username:e.username,password:e.password},r=await this.authClient.authenticate(t);this.token=r.value.token,this.expiry=r.value.expiry}}},9867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BackboneIds=void 0;const n=r(3289);class BackboneIds{}t.BackboneIds=BackboneIds,BackboneIds.file=new n.CoreIdHelper("FIL",!0),BackboneIds.relationship=new n.CoreIdHelper("REL",!0),BackboneIds.message=new n.CoreIdHelper("MSG",!0),BackboneIds.relationshipTemplate=new n.CoreIdHelper("RLT",!0),BackboneIds.token=new n.CoreIdHelper("TOK",!0),BackboneIds.relationshipChange=new n.CoreIdHelper("RCH",!0),BackboneIds.device=new n.CoreIdHelper("DVC",!0)},8892:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientResult=void 0;const n=r(4062);class ClientResult{constructor(e,t,r,i){if(e&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!e&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error");if(void 0!==t&&!e)throw new Error("InvalidOperation: A value is only useful in case of a success.");this._value=t,this._isSuccess=e,this._error=r,i&&(this.requestTime=i.requestTime?n.CoreDate.from(i.requestTime):void 0,this.responseDuration=i.responseDuration?parseInt(i.responseDuration):void 0,this.responseTime=i.responseTime?n.CoreDate.from(i.responseTime):void 0,this.traceId=i.traceId)}get isSuccess(){return this._isSuccess}get isError(){return!this._isSuccess}get error(){if(this._isSuccess)throw new Error("Can't get the error of an succeeded result. Use 'value' instead.");return this._error}get value(){if(!this._isSuccess)throw this.error;return this._value}static fail(e,t){return new ClientResult(!1,void 0,e,t)}static ok(e,t){return new ClientResult(!0,e,void 0,t)}}t.ClientResult=ClientResult},4765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Paginator=void 0;class Paginator{constructor(e,t,r){this.currentPage=e,this.paginationProperties=t,this.dataSource=r,this.currentItemIndex=0}hasNext(){return this.hasNextPage()||this.currentItemIndex<this.currentPage.length}async next(){return this.currentItemIndex>=this.currentPage.length&&this.hasNextPage()&&(this.currentItemIndex=0,this.currentPage=await this.nextPage()),this.currentPage[this.currentItemIndex++]}hasNextPage(){return this.paginationProperties.pageNumber<this.paginationProperties.totalPages}async nextPage(){this.paginationProperties.pageNumber++;return await this.dataSource.getPage(this.paginationProperties.pageNumber)}async collect(){const e=this.currentPage;for(;this.hasNextPage();)e.push(...await this.nextPage());return e}[Symbol.asyncIterator](){return{next:async()=>this.hasNext()?{value:await this.next(),done:!1}:{value:void 0,done:!0}}}}t.Paginator=Paginator},8103:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RESTClient=t.RESTClientLogDirective=t.RestPaginationDataSource=void 0;const i=r(2890),o=n(r(9669)),a=n(r(6230)),s=r(2890),c=r(2890),l=n(r(6486)),u=n(r(129)),p=r(392),d=r(1732),h=r(8892),g=r(4765),y=r(8990);class RestPaginationDataSource{constructor(e,t,r){this.client=e,this.path=t,this.args=r}async getPage(e){return this.args.pageNumber=e,(await this.client.get(this.path,this.args)).value}}var m;t.RestPaginationDataSource=RestPaginationDataSource,function(e){e[e.LogNone=0]="LogNone",e[e.LogRequest=1]="LogRequest",e[e.LogResponse=2]="LogResponse",e[e.LogAll=3]="LogAll"}(m=t.RESTClientLogDirective||(t.RESTClientLogDirective={}));class RESTClient{constructor(e,t={}){this.config=e,this.requestConfig=t,this._logDirective=m.LogAll;const r={baseURL:e.baseUrl,timeout:this.config.platformTimeout,maxRedirects:this.config.platformMaxRedirects,maxContentLength:1/0,maxBodyLength:1/0,validateStatus:e=>e<300||400===e||404===e||500===e,paramsSerializer:e=>u.default.stringify(e,{arrayFormat:"repeat",encode:!1,allowDots:!0})};this.config.platformAdditionalHeaders&&(r.headers=l.default.defaultsDeep({},r.headers,this.config.platformAdditionalHeaders)),void 0!==s.Agent&&void 0!==c.Agent&&(r.httpAgent=this.createHTTPAgent(),r.httpsAgent=this.createHTTPSAgent()),this.requestConfig=l.default.defaultsDeep(this.requestConfig,r),this._logger=p.TransportLoggerFactory.getLogger(RESTClient)}logRequest(){return this._logDirective===m.LogRequest||this._logDirective===m.LogAll}logResponse(){return this._logDirective===m.LogResponse||this._logDirective===m.LogAll}createHTTPAgent(){return this._httpAgent||(this._httpAgent=new s.Agent(this.config.httpAgent)),this._httpAgent}createHTTPSAgent(){return this._httpsAgent||(this._httpsAgent=new c.Agent(this.config.httpsAgent)),this._httpsAgent}async generateRequestId(){return(await d.CoreId.generate("HTTP")).toString()}createAxios(){const e=o.default.create(this.requestConfig);return this.config.debug&&this.addAxiosLoggingInterceptors(e),e}addAxiosLoggingInterceptors(e){e.interceptors.request.use((e=>{const t=e;return t.meta=e.meta||{},t.meta.startTime=(new Date).getTime(),e})),e.interceptors.response.use((e=>(logResponseTime(e),e)));const logResponseTime=e=>{const t=e.config.meta.startTime,r=e.headers["x-response-duration-ms"]?Number.parseInt(e.headers["x-response-duration-ms"]):void 0,n=`${e.config.method.toUpperCase()} ${e.request.path} (backbone call): ${r?`${r}ms`:"unknown"}`;r&&r>200?this._logger.warn(n):this._logger.debug(n);const i=(new Date).getTime()-t,o=r?i-r:void 0,a=`${e.config.method.toUpperCase()} ${e.request.path} (latency): ${o}ms`;this._logger.debug(a),this._logger.debug(`${e.config.method.toUpperCase()} ${e.request.path} (backbone call + latency): ${i}ms`)}}getResult(e,t,r,n){var o,a,s;const c={requestTime:r.headers["x-request-time"],responseDuration:r.headers["x-response-duration-ms"],responseTime:r.headers["x-response-time"],traceId:r.headers["x-trace-id"]};if(r.data&&this.logResponse()){const i=`Response ${n}: ${e} ${t} | TraceId: '${c.traceId}' | PlatformDuration: ${c.responseDuration}`;try{this._logger.trace(i,JSON.stringify(r.data,void 0,2))}catch(e){this._logger.trace(i)}}if(400===r.status&&!(null===(o=r.data)||void 0===o?void 0:o.error)&&"application/json; charset=utf-8"===r.headers["content-type"])try{const e=i.CoreBuffer.from(r.data).toUtf8();r.data=JSON.parse(e)}catch(e){}if(null===(a=r.data)||void 0===a?void 0:a.error){const n=r.data.error,i=new y.RequestError(e,t,c,n.code,n.message,n.docs,r.status,n.time,{id:n.id,details:n.details});return this._logger.debug(i),h.ClientResult.fail(i,c)}if(204===r.status)return h.ClientResult.ok({},c);if(404===r.status){const r=new y.RequestError(e,t,c,"error.transport.request.notFound","The requested entity was not found. Make sure the ID exists and the record is not expired.","",404);return this._logger.debug(r),h.ClientResult.fail(r,c)}if(r.status>=400&&r.status<=499){const n=new y.RequestError(e,t,c,"error.transport.request.badRequest","The platform responded with a Bad Request without giving any specific reason.","",r.status).setObject(r.data);return this._logger.debug(n),h.ClientResult.fail(n,c)}if("function"==typeof Buffer&&r.data instanceof Buffer||r.data instanceof ArrayBuffer)return h.ClientResult.ok(r.data,c);if(!(null===(s=r.data)||void 0===s?void 0:s.result)){const n=new y.RequestError(e,t,c,"error.transport.request.resultUndefined","The Platform responded without a result.").setObject(r.data);return this._logger.debug(n),h.ClientResult.fail(n,c)}return h.ClientResult.ok(r.data.result,c)}getPaginator(e,t,r,n){var i,o;const a={requestTime:t.headers["x-request-time"],responseDuration:t.headers["x-response-duration-ms"],responseTime:t.headers["x-response-time"],traceId:t.headers["x-trace-id"]};if(t.data&&this.logResponse()){const n=`Response ${r}: GET ${e} | TraceId: '${a.traceId}' | PlatformDuration: ${a.responseDuration}`;try{this._logger.trace(n,JSON.stringify(t.data,void 0,2))}catch(e){this._logger.trace(n)}}if(null===(i=t.data)||void 0===i?void 0:i.error){const r=t.data.error,n=new y.RequestError("GET",e,a,r.code,r.message,r.docs,t.status,r.time,{id:r.id,details:r.details});return this._logger.debug(n),h.ClientResult.fail(n,a)}if(t.status>=400&&t.status<=499){const r=new y.RequestError("GET",e,a,"error.transport.request.badRequest","The platform responded with a Bad Request without giving any specific reason.","",t.status).setObject(t.data);return this._logger.debug(r),h.ClientResult.fail(r,a)}if(!(null===(o=t.data)||void 0===o?void 0:o.result)){const r=new y.RequestError("GET",e,a,"error.transport.request.resultUndefined","The Platform responded without a result.").setObject(t.data);return this._logger.debug(r),h.ClientResult.fail(r,a)}t.data.pagination||(t.data.pagination={pageNumber:1,pageSize:t.data.result.length,totalPages:1,totalRecords:t.data.result.length});const s=new RestPaginationDataSource(this,e,n),c=new g.Paginator(t.data.result,t.data.pagination,s);return h.ClientResult.ok(c,a)}async get(e,t={},r){const n=await this.generateRequestId(),i=l.default.defaultsDeep({params:t},r,this.requestConfig);if(this.logRequest()){const t=this;t._username?this._logger.trace(`Request ${n} by ${t._username}: GET ${e}`):this._logger.trace(`Request ${n}: GET ${e}`)}try{const t=await this.createAxios().get(e,i);return this.getResult("GET",e,t,n)}catch(t){const r=y.RequestError.fromAxiosError("GET",e,t,n);return this._logger.debug(r),h.ClientResult.fail(r)}}async getPaged(e,t={},r){const n=await this.generateRequestId(),i=l.default.defaultsDeep({params:t},r,this.requestConfig);try{const r=await this.createAxios().get(e,i);return this.getPaginator(e,r,n,t)}catch(t){const r=y.RequestError.fromAxiosError("GET",e,t,n);return this._logger.debug(r),h.ClientResult.fail(r)}}async post(e,t,r={},n){const i=await this.generateRequestId(),o=l.default.defaultsDeep({params:r},n,this.requestConfig);if(this.logRequest()){const r=this;r._username?this._logger.trace(`Request ${i} by ${r._username}: POST ${e}`,t):this._logger.trace(`Request ${i}: POST ${e}`,t)}try{const r=await this.createAxios().post(e,t,o);return this.getResult("POST",e,r,i)}catch(t){const r=y.RequestError.fromAxiosError("POST",e,t,i);return this._logger.debug(r),h.ClientResult.fail(r)}}async postMultipart(e,t,r){const n=await this.generateRequestId(),i=new a.default;for(const e in t)if(t.hasOwnProperty(e))if("content"===e.toLowerCase()){let r=t[e];r instanceof Uint8Array&&"undefined"!=typeof Blob?(r=new Blob([r]),i.append(e,r)):i.append(e,Buffer.from(r),{filename:"cipher.bin"})}else i.append(e,t[e]);const o=l.default.defaultsDeep({},r,this.requestConfig);let s=i;if(void 0!==i.getHeaders){const e=i.getHeaders();o.headers=o.headers||{};for(const t in e)o.headers[t]=e[t];s=i.getBuffer()}if(this.logRequest()){const t=this;t._username?this._logger.trace(`Request ${n} by ${t._username}: POST-Upload ${e}`):this._logger.trace(`Request ${n}: POST-Upload ${e}`)}try{const t=await this.createAxios().post(e,s,o);return this.getResult("POST-Upload",e,t,n)}catch(t){const r=y.RequestError.fromAxiosError("POST-Upload",e,t,n);return this._logger.debug(r),h.ClientResult.fail(r)}}async put(e,t,r){const n=await this.generateRequestId(),i=l.default.defaultsDeep({},r,this.requestConfig);if(this.logRequest()){const r=this;r._username?this._logger.trace(`Request ${n} by ${r._username}: PUT ${e}`,t):this._logger.trace(`Request ${n}: PUT ${e}`,t)}try{const r=await this.createAxios().put(e,t,i);return this.getResult("PUT",e,r,n)}catch(t){const r=y.RequestError.fromAxiosError("PUT",e,t,n);return this._logger.debug(r),h.ClientResult.fail(r)}}async delete(e,t){const r=await this.generateRequestId(),n=l.default.defaultsDeep({},t,this.requestConfig);if(this.logRequest()){const t=this;t._username?this._logger.trace(`Request ${r} by ${t._username}: DELETE ${e}`):this._logger.trace(`Request ${r}: DELETE ${e}`)}try{const t=await this.createAxios().delete(e,n);return this.getResult("DELETE",e,t,r)}catch(t){const n=y.RequestError.fromAxiosError("DELETE",e,t,r);return this._logger.debug(n),h.ClientResult.fail(n)}}async download(e,t){const r=await this.generateRequestId(),n=l.default.defaultsDeep({},t,this.requestConfig);if(n.responseType="arraybuffer",this.logRequest()){const t=this;t._username?this._logger.trace(`Request ${r} by ${t._username}: GET-Download ${e}`):this._logger.trace(`Request ${r}: GET-Download ${e}`)}try{const t=await this.createAxios().get(e,n);return this.getResult("GET-Download",e,t,r)}catch(t){const n=y.RequestError.fromAxiosError("GET-Download",e,t,r);return this._logger.debug(n),h.ClientResult.fail(n)}}}t.RESTClient=RESTClient},6054:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RESTClientAuthenticate=void 0;const i=n(r(6486)),o=r(8892),a=r(8990),s=r(8103);class RESTClientAuthenticate extends s.RESTClient{constructor(e,t,r={}){super(e,r),this.authenticator=t}async runAuthenticated(e){const t=await this.authenticator.getToken(),r=await e(t);if(!r.isError)return r;if(r.error instanceof a.RequestError&&401===r.error.status){this._logger.error("401 Authorization Error: ",r.error.message),this.authenticator.debugLog(this._logger),this.authenticator.clear();const t=await this.authenticator.getToken();return await e(t)}return o.ClientResult.fail(r.error)}async get(e,t="",r={}){return await this.runAuthenticated((async n=>await super.get(e,t,this.buildAuthenticatedConfig(n,r))))}async getPaged(e,t={},r={}){return await this.runAuthenticated((async n=>await super.getPaged(e,t,this.buildAuthenticatedConfig(n,r))))}async post(e,t,r={},n={}){return await this.runAuthenticated((async i=>await super.post(e,t,r,this.buildAuthenticatedConfig(i,n))))}async postMultipart(e,t,r={}){return await this.runAuthenticated((async n=>await super.postMultipart(e,t,this.buildAuthenticatedConfig(n,r))))}async put(e,t,r={}){return await this.runAuthenticated((async n=>await super.put(e,t,this.buildAuthenticatedConfig(n,r))))}async delete(e,t={}){return await this.runAuthenticated((async r=>await super.delete(e,this.buildAuthenticatedConfig(r,t))))}async download(e,t={}){return await this.runAuthenticated((async r=>await super.download(e,this.buildAuthenticatedConfig(r,t))))}buildAuthenticatedConfig(e,t){return i.default.defaultsDeep({headers:{Authorization:`Bearer ${e}`}},t)}}t.RESTClientAuthenticate=RESTClientAuthenticate},8990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RequestError=void 0;const i=r(5172),o=n(r(4530)),a=r(4062);class RequestError extends i.ApplicationError{constructor(e,t,r,n="error.platform.unexpected",i="Platform operation failed unexpectedly.",o="",s=500,c=a.CoreDate.utc().toISOString(),l){super(n,""),this.method=e,this.path=t,this.platformParameters=r,this.reason=i,this.requestId=o,this.status=s,this.time=c,this.object=l;let u=n;s&&(u+=` (${s})`),i&&(u+=`: '${i}'`),u+=` for ${e} ${t}`,c&&(u+=` at ${c}`),r&&(u+=` with traceId '${r.traceId}'`),super.message=u}setObject(e){return this.object=e,this}toString(){return`${this.name}\n${(0,o.default)(this.object)}\n${this.stack}`}static cleanAxiosError(e){const t=e.toJSON();return delete t.config.adapter,delete t.config.data,delete t.config.headers.Authorization,delete t.config.httpAgent,delete t.config.httpsAgent,delete t.config.transformRequest,delete t.config.transformResponse,delete t.config.validateStatus,delete t.request,delete t.response,t}static fromAxiosError(e,t,r,n,i){try{if(!r.isAxiosError){const n=new RequestError(e,t,i,"error.transport.request.unknown",r.message);return n.stack=r.stack,n}if(!r.response){let n="error.transport.request.unknown",o=500,a=r.message;switch(r.code){case"ERR_FR_MAX_BODY_LENGTH_EXCEEDED":n="error.transport.request.bodyLengthExceeded",o=413;break;case"ECONNABORTED":n="error.transport.request.aborted";break;default:"Network Error"===r.message?(n="error.transport.request.network",a="It seems the platform was available but another network error happened. It could also be a CORS problem."):r.message.includes("ENOTFOUND")&&(n="error.transport.request.addressNotFound")}return new RequestError(e,t,i,n,a,"",o).setObject(this.cleanAxiosError(r))}return 401===r.response.status?new RequestError(e,t,i,"error.platform.unauthorized","Unauthorized.",n,r.response.status).setObject(this.cleanAxiosError(r)):new RequestError(e,t,i,"error.platform.unexpected","Received invalid error content from platform. Contact the platform team.",n,r.response.status).setObject(this.cleanAxiosError(r))}catch(r){return new RequestError(e,t,i,"error.platform.unexpected","An error occured while handling an axios error",n).setObject(r)}}}t.RequestError=RequestError},6699:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4381),t),i(r(9867),t),i(r(8892),t),i(r(4765),t),i(r(8990),t),i(r(8103),t),i(r(6054),t)},2027:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6699),t),i(r(4093),t),i(r(8147),t),i(r(3289),t),i(r(6904),t),i(r(2970),t),i(r(6564),t),i(r(1341),t),i(r(5796),t),i(r(2685),t),i(r(981),t),i(r(2508),t),i(r(18),t),i(r(8169),t),i(r(392),t),i(r(1732),t)},7875:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreAddress=void 0;const a=r(194),s=r(6904);let c=n=class CoreAddress extends s.CoreSerializable{static from(e){return"string"==typeof e?super.fromT({address:e},n):super.fromT(e,n)}static deserialize(e){try{return super.deserializeT(e,n)}catch(t){return this.from(e)}}equals(e){return void 0!==e&&this.address===e.toString()}toString(){return this.address}serialize(){return this.address}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"address",void 0),c=n=i([(0,a.type)("CoreAddress"),(0,a.serializeOnly)("address","string")],c),t.CoreAddress=c},4062:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreDate=void 0;const a=r(194),s=r(9490),c=r(6904),l=r(18);let u=n=class CoreDate extends c.CoreSerializable{constructor(e=s.DateTime.utc()){super(),this._dateTime=e,this.date=e.toISO()}get dateTime(){return this._dateTime}static utc(){return new n(s.DateTime.utc())}static local(){return new n(s.DateTime.local())}equals(e){return this.dateTime.equals(e.dateTime)}add(e){return new n(this.dateTime.plus(e))}subtract(e){return new n(this.dateTime.minus(e))}startOf(e){return new n(this.dateTime.startOf(e))}endOf(e){return new n(this.dateTime.endOf(e))}format(e){return this.dateTime.toFormat(e)}isWithin(e,t,r,i){void 0===t&&(t=e),void 0===r&&(r=n.utc());const o=r.subtract(e),a=r.add(t);return void 0!==i?this.dateTime.startOf(i)>o.dateTime.startOf(i)&&this.dateTime.startOf(i)<a.dateTime.startOf(i):this.dateTime>o.dateTime&&this.dateTime<a.dateTime}isBefore(e,t){return void 0!==t?this.dateTime.startOf(t)<e.dateTime.startOf(t):this.dateTime<e.dateTime}isAfter(e,t){return void 0!==t?this.dateTime.startOf(t)>e.dateTime.startOf(t):this.dateTime>e.dateTime}isSame(e,t){return void 0!==t?this.dateTime.startOf(t).valueOf()===e.dateTime.startOf(t).valueOf():this.dateTime.valueOf()===e.dateTime.valueOf()}isSameOrAfter(e,t){return void 0!==t?this.dateTime.startOf(t)>=e.dateTime.startOf(t):this.dateTime>=e.dateTime}isSameOrBefore(e,t){return void 0!==t?this.dateTime.startOf(t)<=e.dateTime.startOf(t):this.dateTime<=e.dateTime}isBetween(e,t,r){return t?s.Interval.fromDateTimes(e.dateTime,t.dateTime).contains(this.dateTime):this.isAfter(e,r)}isExpired(){return this.isSameOrBefore(n.utc())}compare(e){return this.dateTime.valueOf()-e.dateTime.valueOf()}toString(){return this.dateTime.toISO()}toISOString(){return this.dateTime.toISO()}toLocaleString(){return this.dateTime.toLocaleString()}serialize(){return this.dateTime.toISO()}static from(e){if(void 0===e)throw l.TransportErrors.util.date.undefined();if("object"==typeof e){if(void 0===e.date){if("function"!=typeof e.toISOString)throw l.TransportErrors.util.date.noIsoStringMethod();const t=e.toISOString();return new n(s.DateTime.fromISO(t,{zone:"utc"}))}return new n(s.DateTime.fromISO(e.date,{zone:"utc"}))}return new n("number"==typeof e?s.DateTime.fromMillis(e):s.DateTime.fromISO(e,{zone:"utc"}).toUTC())}static deserialize(e){return this.from(e)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"date",void 0),u=n=i([(0,a.serializeOnly)("date","string"),o("design:paramtypes",[s.DateTime])],u),t.CoreDate=u},2186:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreHash=void 0;const a=r(194),s=r(2890),c=r(6904);let l=n=class CoreHash extends c.CoreSerializable{toString(){return this.hash}static async hash(e,t=2){const r=await s.CryptoHash.hash(s.CoreBuffer.fromString(e,s.Encoding.Base64_UrlSafe_NoPadding),t);return n.from(r.toBase64())}async verify(e,t=2){return await s.CryptoHash.verify(e,s.CoreBuffer.fromString(this.hash,s.Encoding.Base64_UrlSafe_NoPadding),t)}static from(e){return"object"==typeof e?super.fromT(e,n):super.fromT({hash:e},n)}static deserialize(e){return this.from(e)}serialize(){return this.hash}toBase64(){return this.hash}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"hash",void 0),l=n=i([(0,a.serializeOnly)("hash","string")],l),t.CoreHash=l},9170:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreId=void 0;const a=r(194),s=r(5833),c=r(6904),l=r(18);let u=n=class CoreId extends c.CoreSerializable{toString(){return this.id}equals(e){return this.id===e.toString()}static async generate(e=""){if(e.length>6)throw l.TransportErrors.util.tooLongCoreIdPrefix(e);const t=await s.Random.string(20-e.length,s.RandomCharacterRange.Alphanumeric);return this.from(e.toUpperCase()+t)}static from(e){return"string"==typeof e||e instanceof String?super.fromT({id:e},n):super.fromT(e,n)}static deserialize(e){return this.from(e)}serialize(){return this.id}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"id",void 0),u=n=i([(0,a.serializeOnly)("id","string")],u),t.CoreId=u},819:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportVersion=void 0,function(e){e.Latest="1",e.V1="1"}(t.TransportVersion||(t.TransportVersion={}))},1732:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7875),t),i(r(4062),t),i(r(2186),t),i(r(9170),t),i(r(819),t)},5590:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(2500),t),i(r(2027),t),i(r(9662),t),i(r(2212),t)},7024:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccountController=void 0;const n=r(2890),i=r(2027),o=r(4381),a=r(4093),s=r(369),c=r(392),l=r(2212),u=r(1615),p=r(2723),d=r(8324),h=r(9626),g=r(8382),y=r(6961),m=r(7896),v=r(4980),w=r(2556),b=r(6453),C=r(413),_=r(9777),S=r(5832),T=r(3666),O=r(3654),R=r(2343),I=r(5739),E=r(1295),L=r(26),M=r(4503),A=r(5366),D=r(2016),P=r(6346),j=r(761);t.AccountController=class AccountController{constructor(e,t,r,n={}){this._transport=e,this._db=t,this._config=r,this.dependencyOverrides=n,this._dbClosed=!1,this.autoSync=!0,this._authenticator=new o.Authenticator(this),this._log=c.TransportLoggerFactory.getLogger(i.ControllerName.Account)}get authenticator(){return this._authenticator}get config(){return this._config}get db(){return this._db}get transport(){return this._transport}get activeDevice(){if(!this._activeDevice)throw new Error("The DeviceController is not initialized yet.");return this._activeDevice}get activeDeviceOrUndefined(){return this._activeDevice}get identity(){return this._identity}async init(e){this.info=await this.db.getMap("AccountInfo"),this.unpushedDatawalletModifications=await this.db.getCollection(s.DbCollectionName.UnpushedDatawalletModifications),this.deviceClient=new y.DeviceClient(this.config),this.identityClient=new A.IdentityClient(this.config),this._identity=new P.IdentityController(this),this._activeDevice=new m.DeviceController(this),this.challenges=await new h.ChallengeController(this).init();const[t,r,o]=await Promise.all([this.info.get("identity"),this.info.get("device"),this.info.get("baseKey")]);let a,c=!1,l=!1;if(t||r){if(e||!t||!r)throw i.TransportErrors.general.notAllowedCombinationOfDeviceSharedSecretAndAccount().logWith(this._log);{if(!o)throw i.TransportErrors.secrets.secretNotFound("BaseKey");const[e,a,s]=await Promise.all([D.Identity.from(t),b.Device.from(r),n.CryptoSecretKey.fromJSON(o)]);await Promise.all([this.identity.init(e),this.activeDevice.init(s,a)]),this.deviceAuthClient=new g.DeviceAuthClient(this.config,this.authenticator)}}else if(e)a=await this.onboardDevice(e),l=!0;else{this._log.trace("No account information found. Creating new account...");c=!0,a=(await this.createIdentityAndDevice(this.config.realm)).device,this.deviceAuthClient=new g.DeviceAuthClient(this.config,this.authenticator)}return this._log.trace(`Using device ${this.activeDevice.id} for identity ${this.identity.address}.`),await this.initControllers(),c?(await this.devices.addExistingDevice(a),await this.synchronization.setInititalDatawalletVersion(this._config.supportedDatawalletVersion)):l&&(await this.syncDatawallet(),await this.devices.update(a)),await this.syncDatawallet(),this}async close(){this._dbClosed||(this._log.trace(`Closing DB for account ${this.identity.identity.address.toString()}.`),await this._db.close(),this._dbClosed=!0)}async initControllers(){this._log.trace("Initializing controllers..."),this.relationshipSecrets=await new O.RelationshipSecretController(this).init(),this.devices=await new v.DevicesController(this).init(),this.certificates=await new u.CertificateController(this).init(),this.certificateIssuer=await new p.CertificateIssuer(this).init(),this.certificateValidator=await new d.CertificateValidator(this).init(),this.files=await new _.FileController(this).init(),this.relationships=await new T.RelationshipsController(this,this.relationshipSecrets).init(),this.relationshipTemplates=await new R.RelationshipTemplateController(this,this.relationshipSecrets).init(),this.messages=await new S.MessageController(this).init(),this.tokens=await new M.TokenController(this).init(),this.synchronization=await new E.SyncController(this,this.dependencyOverrides,this.unpushedDatawalletModifications,this.config.datawalletEnabled).init(),this._log.trace("Initialization of controllers finished.")}disableAutoSync(){this.autoSync=!1}async enableAutoSync(){this.autoSync=!0,await this.syncDatawallet()}async syncDatawallet(e=!1){if(e||this.autoSync)return await this.synchronization.sync("OnlyDatawallet")}async syncEverything(){return await this.synchronization.sync("Everything")}async getLastCompletedSyncTime(){return await this.synchronization.getLastCompletedSyncTime()}async getLastCompletedDatawalletSyncTime(){return await this.synchronization.getLastCompletedDatawalletSyncTime()}async createIdentityAndDevice(e=D.Realm.Prod){this._log.trace(`Creating new identity for realm ${e}...`);const[t,r,n,o,s]=await Promise.all([a.CoreCrypto.generateSignatureKeypair(),await l.PasswordGenerator.createStrongPassword(45,50),a.CoreCrypto.generateSignatureKeypair(),a.CoreCrypto.generateSecretKey(),a.CoreCrypto.generateSecretKey()]);this._log.trace("Created keys. Requesting challenge...");const c=await this.challenges.createAccountCreationChallenge(t);this._log.trace("Challenge signed. Creating device...");const[u,p,d,h]=await Promise.all([this.identityClient.createIdentity({devicePassword:r,identityPublicKey:t.publicKey.toBase64(),signedChallenge:c.toJSON(!1),clientId:this._config.platformClientId,clientSecret:this._config.platformClientSecret}),a.CoreCrypto.generateSecretKey(),j.IdentityUtil.createAddress(t.publicKey,e),this.fetchDeviceInfo()]);if(u.isError){if("error.platform.unauthorized"===u.error.code)throw i.TransportErrors.general.platformClientInvalid().logWith(this._log)}const g=u.value;if(this._log.trace(`Registered identity with address ${g.address}, device id is ${g.device.id}.`),!g.address)throw i.TransportErrors.identity.noAddressReceived().logWith(this._log);if(d.toString()!==g.address)throw i.TransportErrors.identity.addressMismatch().logWith(this._log);const y=await D.Identity.from({address:i.CoreAddress.from(g.address),realm:e,publicKey:t.publicKey}),m=i.CoreId.from(g.device.id),v=await b.Device.from({createdAt:i.CoreDate.from(g.createdAt),createdByDevice:m,id:m,description:"",name:"Device 1",lastLoginAt:i.CoreDate.utc(),operatingSystem:h.operatingSystem,publicKey:n.publicKey,type:h.type,certificate:"",username:g.device.username,datawalletVersion:this._config.supportedDatawalletVersion});await Promise.all([this.identity.init(y),this.activeDevice.init(s,v)]);const _=await C.DeviceSecretCredentials.from({id:v.id,username:g.device.username,password:r});return await Promise.all([this.info.set("device",v.toJSON()),this.info.set("identity",y.toJSON()),this.info.set("baseKey",s.toJSON()),this.activeDevice.secrets.storeSecret(o,w.DeviceSecretType.SharedSecretBaseKey),this.activeDevice.secrets.storeSecret(p,w.DeviceSecretType.IdentitySynchronizationMaster),this.activeDevice.secrets.storeSecret(t.privateKey,w.DeviceSecretType.IdentitySignature),this.activeDevice.secrets.storeSecret(n.privateKey,w.DeviceSecretType.DeviceSignature),this.activeDevice.secrets.storeSecret(_,w.DeviceSecretType.DeviceCredentials)]),{identity:y,device:v}}async onboardDevice(e){this._log.trace("Onboarding device for existing identity...");const[t,r,n,o]=await Promise.all([l.PasswordGenerator.createStrongPassword(45,50),a.CoreCrypto.generateSignatureKeypair(),this.fetchDeviceInfo(),a.CoreCrypto.generateSecretKey()]),s=await b.Device.from({id:e.id,name:e.name?e.name:"",description:e.description?e.name:"",lastLoginAt:i.CoreDate.utc(),createdAt:e.createdAt,createdByDevice:e.createdByDevice,operatingSystem:n.operatingSystem,type:n.type,publicKey:r.publicKey,username:e.username,initialPassword:"",isAdmin:!!e.identityPrivateKey});await Promise.all([this.identity.init(e.identity),this.activeDevice.init(o,s)]);const c=await C.DeviceSecretCredentials.from({id:e.id,username:e.username,password:e.password});return await Promise.all([this.info.set("device",s.toJSON()),this.info.set("identity",e.identity.toJSON()),this.info.set("baseKey",o.toJSON()),this.info.set(I.SecretController.secretNonceKey,1e6*e.deviceIndex),this.activeDevice.secrets.storeSecret(e.secretBaseKey,w.DeviceSecretType.SharedSecretBaseKey),this.activeDevice.secrets.storeSecret(e.synchronizationKey,w.DeviceSecretType.IdentitySynchronizationMaster),this.activeDevice.secrets.storeSecret(r.privateKey,w.DeviceSecretType.DeviceSignature),this.activeDevice.secrets.storeSecret(c,w.DeviceSecretType.DeviceCredentials)]),e.identityPrivateKey&&await this.activeDevice.secrets.storeSecret(e.identityPrivateKey,w.DeviceSecretType.IdentitySignature),this.deviceAuthClient=new g.DeviceAuthClient(this.config,this.authenticator),await this.activeDevice.changePassword(t),s}async registerPushNotificationToken(e){await this.deviceAuthClient.registerPushNotificationToken(e)}fetchDeviceInfo(){return Promise.resolve({operatingSystem:"",type:b.DeviceType.Unknown})}async getSynchronizedCollection(e){const t=await this.db.getCollection(e);return this.config.datawalletEnabled?new L.SynchronizedCollection(t,this.config.supportedDatawalletVersion,this.unpushedDatawalletModifications):new L.SynchronizedCollection(t,this.config.supportedDatawalletVersion)}}},6346:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityController=void 0;const n=r(2890),i=r(2027),o=r(2556);class IdentityController extends i.TransportController{constructor(e){super(i.ControllerName.Identity,e)}get address(){return this._identity.address}get publicKey(){return this._identity.publicKey}get realm(){return this._identity.realm}get identity(){return this._identity}async init(e){if(await super.init(),!e)throw i.TransportErrors.identity.identityNotSet().logWith(this._log);return this._identity=e,this}isMe(e){return this.address.equals(e)}async update(){await this.parent.info.set("identity",this.identity)}async sign(e){const t=await this.parent.activeDevice.secrets.loadSecret(o.DeviceSecretType.IdentitySignature);if(!(t&&t.secret instanceof n.CryptoSignaturePrivateKey))throw i.TransportErrors.secrets.secretNotFound(o.DeviceSecretType.IdentitySignature).logWith(this._log);const r=t.secret,a=await i.CoreCrypto.sign(e,r);return r.clear(),a}async verify(e,t){return await i.CoreCrypto.verify(e,t,this.publicKey)}}t.IdentityController=IdentityController},761:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityUtil=void 0;const n=r(2890),i=r(2027);t.IdentityUtil=class IdentityUtil{static async createAddress(e,t="ID0"){if(t&&3!==t.length)throw i.TransportErrors.identity.realmLength();const r=await n.CryptoHash.hash(e.publicKey,2),o=await n.CryptoHash.hash(r,1),a=new n.CoreBuffer(o.buffer.slice(0,20)),s=n.CoreBuffer.fromUtf8(t);s.append(a);const c=await n.CryptoHash.hash(s,2),l=await n.CryptoHash.hash(c,1),u=new n.CoreBuffer(l.buffer.slice(0,4)),p=a;p.append(u);const d=t+p.toBase58();return i.CoreAddress.from({address:d})}static async checkAddress(e,t,r="id1"){const i=e.toString(),o=i.substr(0,3);if(r&&o!==r)return!1;const a=i.substr(3),s=n.CoreBuffer.fromBase58(a).buffer,c=s.slice(0,s.byteLength-4),l=s.slice(s.byteLength-4,s.byteLength),u=n.CoreBuffer.fromUtf8(o);u.append(new n.CoreBuffer(c));const p=await n.CryptoHash.hash(u,2),d=await n.CryptoHash.hash(p,1);if(!new n.CoreBuffer(d.buffer.slice(0,4)).equals(new n.CoreBuffer(l)))return!1;if(t){const e=await n.CryptoHash.hash(t.publicKey,2);let r=await n.CryptoHash.hash(e,1);if(r=new n.CoreBuffer(r.buffer.slice(0,20)),!r.equals(new n.CoreBuffer(c)))return!1}return!0}}},5366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityClient=void 0;const n=r(2027);class IdentityClient extends n.RESTClient{constructor(){super(...arguments),this._logDirective=n.RESTClientLogDirective.LogResponse}async createIdentity(e){return await this.post("/api/v1/Identities",e,{})}}t.IdentityClient=IdentityClient},2016:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Identity=t.Realm=void 0;const a=r(194),s=r(2890),c=r(2970),l=r(7875),u=r(4062);!function(e){e.Dev="dev",e.Stage="id0",e.Prod="id1"}(t.Realm||(t.Realm={}));let p=n=class Identity extends c.CoreSerializableAsync{static async from(e){const t=await super.fromT(e,n);return t.name="",t.description="",t.type="unknown",t.createdAt=u.CoreDate.from("2020-01-01T00:00:00Z"),t}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.CoreAddress)],p.prototype,"address",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignaturePublicKey)],p.prototype,"publicKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],p.prototype,"realm",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],p.prototype,"name",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],p.prototype,"description",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CoreDate)],p.prototype,"createdAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],p.prototype,"type",void 0),p=n=i([(0,a.type)("Identity")],p),t.Identity=p},1615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateController=void 0;const n=r(2027);class CertificateController extends n.TransportController{constructor(e){super(n.ControllerName.Certificate,e)}}t.CertificateController=CertificateController},2723:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateContentParam=t.CertificateIssuer=void 0;const n=r(2890),i=r(2027),o=r(369),a=r(365),s=r(4507);class CertificateIssuer extends i.TransportController{constructor(e){super(i.ControllerName.CertificateIssuer,e)}async init(){return await super.init(),this.certificatesIssued=await this.db.getCollection(o.DbCollectionName.CertificatesIssued),this}async issueCertificate(e){const t=(await s.CertificateContent.from(e)).serialize(),r=n.CoreBuffer.fromUtf8(t),i=await this.parent.identity.sign(r);return await a.Certificate.from({content:t,signature:i})}}t.CertificateIssuer=CertificateIssuer;t.CertificateContentParam=class CertificateContentParam{constructor(){this.issuedAt=i.CoreDate.utc()}}},8324:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateValidator=void 0;const n=r(2027);class CertificateValidator extends n.TransportController{constructor(e){super(n.ControllerName.CertificateValidator,e)}}t.CertificateValidator=CertificateValidator},365:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Certificate=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class Certificate extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}async verify(e){const t=s.CoreBuffer.fromUtf8(this.content);return await c.CoreCrypto.verify(t,this.signature,e)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"signature",void 0),l=n=i([(0,a.type)("Certificate")],l),t.Certificate=l},8951:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateConstraint=void 0;const o=r(194),a=r(2027);let s=n=class CertificateConstraint extends a.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};s=n=i([(0,o.type)("CertificateConstraint")],s),t.CertificateConstraint=s},4507:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateContent=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(8951),u=r(7584);let p=n=class CertificateContent extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],p.prototype,"issuedAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],p.prototype,"issuer",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreSerializable)],p.prototype,"issuerData",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],p.prototype,"subject",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignaturePublicKey)],p.prototype,"subjectPublicKey",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.CertificateConstraint}),o("design:type",Array)],p.prototype,"constraints",void 0),i([(0,a.validate)(),(0,a.serialize)({type:u.CertificateItem}),o("design:type",Array)],p.prototype,"items",void 0),p=n=i([(0,a.type)("CertificateContent")],p),t.CertificateContent=p},7584:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateItem=void 0;const o=r(194),a=r(2027);let s=n=class CertificateItem extends a.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};s=n=i([(0,o.type)("CertificateItem")],s),t.CertificateItem=s},1949:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateBorderConstraint=void 0;const a=r(194),s=r(8951);let c=n=class CertificateBorderConstraint extends s.CertificateConstraint{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"union",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"country",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"state",void 0),c=n=i([(0,a.type)("CertificateBorderConstraint")],c),t.CertificateBorderConstraint=c},8176:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateCityConstraint=void 0;const a=r(194),s=r(8951);let c=n=class CertificateCityConstraint extends s.CertificateConstraint{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"district",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"city",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"zipCode",void 0),c=n=i([(0,a.type)("CertificateCityConstraint")],c),t.CertificateCityConstraint=c},6578:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateIdentityConstraint=void 0;const a=r(194),s=r(2027),c=r(8951);let l=n=class CertificateIdentityConstraint extends c.CertificateConstraint{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreAddress)],l.prototype,"identity",void 0),l=n=i([(0,a.type)("CertificateIdentityConstraint")],l),t.CertificateIdentityConstraint=l},4220:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateTimeConstraint=void 0;const a=r(194),s=r(2027),c=r(8951);let l=n=class CertificateTimeConstraint extends c.CertificateConstraint{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],l.prototype,"validFrom",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],l.prototype,"validTo",void 0),l=n=i([(0,a.type)("CertificateTimeConstraint")],l),t.CertificateTimeConstraint=l},3327:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateAuthorizationItem=void 0;const a=r(194),s=r(7584);let c=n=class CertificateAuthorizationItem extends s.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"authorization",void 0),c=n=i([(0,a.type)("CertificateAuthorizationItem")],c),t.CertificateAuthorizationItem=c},7376:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateDelegateItem=t.CertificateDelegateType=void 0;const a=r(194),s=r(7584);!function(e){e.Clone="clone",e.Custodian="custodian",e.Sign="sign",e.Ppa="ppa",e.Communication="communication"}(t.CertificateDelegateType||(t.CertificateDelegateType={}));let c=n=class CertificateDelegateItem extends s.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"type",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],c.prototype,"content",void 0),c=n=i([(0,a.type)("CertificateDelegateItem")],c),t.CertificateDelegateItem=c},8579:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificatePrivateAttributeItem=void 0;const a=r(194),s=r(1732),c=r(7584);let l=n=class CertificatePrivateAttributeItem extends c.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreHash)],l.prototype,"hash",void 0),l=n=i([(0,a.type)("CertificatePrivateAttributeItem")],l),t.CertificatePrivateAttributeItem=l},3727:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificatePrivateAttributeItemSource=void 0;const a=r(194),s=r(1732),c=r(7584);let l=n=class CertificatePrivateAttributeItemSource extends c.CertificateItem{async hash(){return await s.CoreHash.hash(`${this.nonce}|${this.name}|${this.value}`)}static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"nonce",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"name",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"value",void 0),l=n=i([(0,a.type)("CertificatePrivateAttributeItem")],l),t.CertificatePrivateAttributeItemSource=l},9745:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificatePublicAttributeItem=void 0;const a=r(194),s=r(7584);let c=n=class CertificatePublicAttributeItem extends s.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"name",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"value",void 0),c=n=i([(0,a.type)("CertificatePublicAttributeItem")],c),t.CertificatePublicAttributeItem=c},1430:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CertificateRoleItem=void 0;const a=r(194),s=r(7584);let c=n=class CertificateRoleItem extends s.CertificateItem{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"role",void 0),c=n=i([(0,a.type)("CertificateRoleItem")],c),t.CertificateRoleItem=c},9626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChallengeController=void 0;const n=r(2890),i=r(2027),o=r(2508),a=r(2182),s=r(3122),c=r(1772),l=r(9643),u=r(8565);class ChallengeController extends o.TransportController{constructor(e){super(o.ControllerName.Challenge,e)}async init(){return await super.init(),this.client=new c.ChallengeClient(this.config),this.authClient=new s.ChallengeAuthClient(this.config,this.parent.authenticator),this}async verifyChallengeLocally(e,t){if(!e.createdBy)return;const r=await this.parent.relationships.getActiveRelationshipToIdentity(e.createdBy);if(!r)throw i.TransportErrors.general.recordNotFound(a.Relationship,e.createdBy.toString());const o=n.CoreBuffer.fromUtf8(t.challenge);let s=!1;switch(e.type){case l.ChallengeType.Identity:s=await this.parent.relationships.verifyIdentity(r,o,t.signature);break;case l.ChallengeType.Device:throw i.TransportErrors.general.notImplemented().logWith(this._log);case l.ChallengeType.Relationship:s=await this.parent.relationships.verify(r,o,t.signature)}return s?r:void 0}async checkChallenge(e,t){const r=await l.Challenge.deserialize(e.challenge);if(t&&r.type!==t)return;if(r.expiresAt.isExpired())return;const[n,i]=await Promise.all([this.verifyChallengeLocally(r,e),this.authClient.getChallenge(r.id.toString())]);return!n||r.createdBy&&i.value.createdBy!==r.createdBy.toString()||i.value.id!==r.id.toString()?void 0:n}async createAccountCreationChallenge(e){const t=(await this.client.createChallenge()).value,r=(await l.Challenge.from({id:i.CoreId.from(t.id),expiresAt:i.CoreDate.from(t.expiresAt),type:l.ChallengeType.Identity})).serialize(!1),o=n.CoreBuffer.fromUtf8(r),a=await i.CoreCrypto.sign(o,e.privateKey);return await u.ChallengeSigned.from({challenge:r,signature:a})}async createChallenge(e=l.ChallengeType.Identity,t){if(e===l.ChallengeType.Relationship&&!t)throw i.TransportErrors.challenges.challengeTypeRequiredRelationship().logWith(this._log);const r=(await this.authClient.createChallenge()).value,o=(await l.Challenge.from({id:i.CoreId.from(r.id),expiresAt:i.CoreDate.from(r.expiresAt),createdBy:r.createdBy?i.CoreAddress.from(r.createdBy):void 0,createdByDevice:r.createdByDevice?i.CoreId.from(r.createdByDevice):void 0,type:e})).serialize(!1),a=n.CoreBuffer.fromUtf8(o);let s;switch(e){case l.ChallengeType.Identity:s=await this.parent.identity.sign(a);break;case l.ChallengeType.Device:s=await this.parent.activeDevice.sign(a);break;case l.ChallengeType.Relationship:if(!t)throw i.TransportErrors.challenges.challengeTypeRequiredRelationship().logWith(this._log);s=await this.parent.relationships.sign(t,a)}return await u.ChallengeSigned.from({challenge:o,signature:s})}}t.ChallengeController=ChallengeController},3122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChallengeAuthClient=void 0;const n=r(6054);class ChallengeAuthClient extends n.RESTClientAuthenticate{async createChallenge(){return await this.post("/api/v1/Challenges",{})}async getChallenge(e){return await this.get(`/api/v1/Challenges/${e}`)}}t.ChallengeAuthClient=ChallengeAuthClient},1772:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChallengeClient=void 0;const n=r(2027);class ChallengeClient extends n.RESTClient{async createChallenge(){return await this.post("/api/v1/Challenges",{})}}t.ChallengeClient=ChallengeClient},9643:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Challenge=t.ChallengeType=void 0;const a=r(194),s=r(2027);!function(e){e.Identity="Identity",e.Device="Device",e.Relationship="Relationship"}(t.ChallengeType||(t.ChallengeType={}));let c=n=class Challenge extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await this.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"id",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],c.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreAddress)],c.prototype,"createdBy",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"type",void 0),c=n=i([(0,a.type)("Challenge")],c),t.Challenge=c},8565:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ChallengeSigned=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class ChallengeSigned extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async fromJSON(e){const t=await s.CryptoSignature.fromBase64(e.signature);return await this.from({signature:t,challenge:e.challenge})}toJSON(e=!0){const t={challenge:this.challenge,signature:this.signature.toBase64()};return e&&(t["@type"]="ChallengeSigned"),t}};i([(0,a.validate)(),(0,a.serialize)({enforceString:!0}),o("design:type",String)],l.prototype,"challenge",void 0),i([(0,a.validate)(),(0,a.serialize)({enforceString:!0}),o("design:type",s.CryptoSignature)],l.prototype,"signature",void 0),l=n=i([(0,a.type)("ChallengeSigned")],l),t.ChallengeSigned=l},7896:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceController=void 0;const n=r(2890),i=r(2027),o=r(2556),a=r(413);class DeviceController extends i.TransportController{constructor(e){super(i.ControllerName.Device,e)}get secrets(){return this._secrets}get id(){return this.device.id}get publicKey(){return this.device.publicKey}get certificate(){return this.device.certificate}get name(){return this.device.name}get description(){return this.device.description}get operatingSystem(){return this.device.operatingSystem}get createdAt(){return this.device.createdAt}get type(){return this.device.type}get device(){if(!this._device)throw i.TransportErrors.device.deviceNotSet();return this._device}get deviceOrUndefined(){return this._device}async init(e,t){if(await super.init(),!t)throw i.TransportErrors.device.deviceNotSet().logWith(this._log);if(!e)throw i.TransportErrors.secrets.secretNotFound("BaseKey").logWith(this._log);return this._device=t,this._secrets=await new o.DeviceSecretController(this.parent,e).init(),this}async changePassword(e){const t=(await this.getCredentials()).password;await this.parent.deviceAuthClient.changeDevicePassword({oldPassword:t,newPassword:e});try{const t=await this.secrets.loadSecret(o.DeviceSecretType.DeviceCredentials);if(!t)throw new Error("There was an error while accessing the device_credentials secret.");const r=t.secret;r.password=e,await this.secrets.storeSecret(r,o.DeviceSecretType.DeviceCredentials)}catch(t){throw this.log.warn(`We've changed the device password on the backboen but weren't able to store it to the database. The new password is '${e}'.`),t}}async update(e){e.name&&(this.device.name=e.name),e.description&&(this.device.description=e.description),e.datawalletVersion&&(this.device.datawalletVersion=e.datawalletVersion),await this.parent.devices.update(this.device),await this.parent.info.set("device",this.device.toJSON())}async sign(e){const t=await this.secrets.loadSecret(o.DeviceSecretType.DeviceSignature);if(!(t&&t.secret instanceof n.CryptoSignaturePrivateKey))throw i.TransportErrors.secrets.secretNotFound(o.DeviceSecretType.DeviceSignature).logWith(this._log);const r=t.secret,a=await i.CoreCrypto.sign(e,r);return r.privateKey.clear(),a}async verify(e,t){if(!this.publicKey)throw i.TransportErrors.device.notOnboardedYet().logWith(this._log);return await i.CoreCrypto.verify(e,t,this.publicKey)}async getCredentials(){const e=await this.secrets.loadSecret(o.DeviceSecretType.DeviceCredentials);if(!e)throw i.TransportErrors.secrets.secretNotFound(o.DeviceSecretType.DeviceCredentials).logWith(this._log);if(!(e.secret instanceof a.DeviceSecretCredentials))throw i.TransportErrors.secrets.wrongSecretType(o.DeviceSecretType.DeviceCredentials).logWith(this._log);const t=e.secret;if(!t.username||!t.password)throw i.TransportErrors.secrets.wrongSecretType(o.DeviceSecretType.DeviceCredentials).logWith(this._log);return{username:t.username,password:t.password}}}t.DeviceController=DeviceController},2556:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceSecretController=t.DeviceSecretType=void 0;const n=r(194),i=r(2890),o=r(2027),a=r(2508),s=r(8169),c=r(9423),l=r(7636),u=r(6758);var p;!function(e){e.IdentitySynchronizationMaster="identity_synchronization_master",e.IdentitySignature="identity_signature",e.SharedSecretBaseKey="shared_basekey",e.DeviceSecretBaseKey="secret_basekey",e.DeviceSignature="device_signature",e.DeviceCredentials="device_credentials"}(p=t.DeviceSecretType||(t.DeviceSecretType={}));class DeviceSecretController extends a.TransportController{constructor(e,t){super(a.ControllerName.DeviceSecret,e),this.baseKey=t}async init(){return await super.init(),this.secrets=await this.db.getMap("DeviceSecrets"),this}async storeSecret(e,t){const r=e.serialize(),n=i.CoreBuffer.fromUtf8(r),a=await o.CoreCrypto.deriveKeyFromBase(this.getBaseKey(),1,DeviceSecretController.secretContext),l=await o.CoreCrypto.encrypt(n,a),u=o.CoreDate.utc(),p={cipher:l,createdAt:u,name:t,id:await s.TransportIds.secret.generate(),validFrom:u,active:!0},d=await c.SecretContainerCipher.from(p);return this.log.trace(`Created device secret id:${d.id} name:${d.name} on ${d.createdAt.toISOString()}.`),await this.secrets.set(t,d.toJSON()),d}async loadSecret(e){const t=await this.secrets.get(e);if(!t)return;const r=this.getBaseKey(),i=await c.SecretContainerCipher.from(t),a=await o.CoreCrypto.deriveKeyFromBase(r,1,DeviceSecretController.secretContext),s=(await o.CoreCrypto.decrypt(i.cipher,a)).toUtf8(),u=await n.SerializableAsync.deserializeUnknown(s),p=await l.SecretContainerPlain.from({id:i.id,createdAt:i.createdAt,name:i.name,secret:u,validFrom:i.validFrom,validTo:i.validTo,active:i.active});return this.log.trace(`Accessed device secret id:${p.id} name:${p.name} on ${o.CoreDate.utc().toISOString()}.`),p}async deleteSecret(e){const t=await this.secrets.get(e);return!!t&&(await this.secrets.delete(e),this.log.trace(`Deleted device secret id:${t.id} name:${t.name} on ${o.CoreDate.utc().toISOString()}.`),!0)}async createDeviceSharedSecret(e,t,r=!1){const n=await this.loadSecret(p.IdentitySynchronizationMaster);if(!(n&&n.secret instanceof i.CryptoSecretKey))throw o.TransportErrors.secrets.secretNotFound("SynchronizationKey").logWith(this._log);const a=await this.loadSecret(p.SharedSecretBaseKey);if(!(a&&a.secret instanceof i.CryptoSecretKey))throw o.TransportErrors.secrets.secretNotFound("baseKey").logWith(this._log);let s;if(r&&(s=await this.loadSecret(p.IdentitySignature),!(s&&s.secret instanceof i.CryptoSignaturePrivateKey)))throw o.TransportErrors.secrets.secretNotFound("IdentityKey").logWith(this._log);return await u.DeviceSharedSecret.from({id:e.id,createdAt:e.createdAt,createdByDevice:e.createdByDevice,deviceIndex:t,secretBaseKey:a.secret,name:e.name,description:e.description,synchronizationKey:n.secret,identityPrivateKey:null==s?void 0:s.secret,username:e.username,password:e.initialPassword,identity:this.parent.identity.identity})}async encryptDatawalletModificationPayload(e,t){if(!e.payload)return;const r=i.CoreBuffer.fromUtf8(JSON.stringify(e.payload)),n=await this.loadSecret(p.IdentitySynchronizationMaster);if(!(n&&n.secret instanceof i.CryptoSecretKey))throw o.TransportErrors.secrets.secretNotFound(p.IdentitySynchronizationMaster).logWith(this._log);const a=await o.CoreCrypto.deriveKeyFromBase(n.secret,t,"DataSync"),s=await o.CoreCrypto.encrypt(r,a);return n.secret.clear(),s.toBase64()}async decryptDatawalletModificationPayload(e,t){if(!e)return;const r=await i.CryptoCipher.fromBase64(e),n=await this.loadSecret(p.IdentitySynchronizationMaster);if(!(n&&n.secret instanceof i.CryptoSecretKey))throw o.TransportErrors.secrets.secretNotFound(p.IdentitySynchronizationMaster).logWith(this._log);const a=await o.CoreCrypto.deriveKeyFromBase(n.secret,t,"DataSync"),s=await o.CoreCrypto.decrypt(r,a);n.secret.clear();return JSON.parse(s.toUtf8())}getBaseKey(){if(!this.baseKey)throw o.TransportErrors.general.recordNotFound(i.CryptoSecretKey,p.SharedSecretBaseKey).logWith(this._log);return this.baseKey}}t.DeviceSecretController=DeviceSecretController,DeviceSecretController.secretContext="DEVICE01"},4980:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DevicesController=void 0;const n=r(2027),i=r(369),o=r(2508),a=r(2212),s=r(9643),c=r(8382),l=r(6453),u=r(9798);class DevicesController extends o.TransportController{constructor(e){super(o.ControllerName.Devices,e)}async init(){return await super.init(),this.client=new c.DeviceAuthClient(this.config,this.parent.authenticator),this.devices=await this.parent.getSynchronizedCollection(i.DbCollectionName.Devices),this}async get(e){const t=await this.devices.read(e.toString());if(t)return await l.Device.from(t)}async addExistingDevice(e){await this.devices.create(e)}async createDevice(e="",t="",r=!1){const[i,o]=await Promise.all([this.parent.challenges.createChallenge(s.ChallengeType.Identity),a.PasswordGenerator.createStrongPassword(45,50)]);this.log.trace("Device Creation Challenge signed. Creating device on backbone...");const c=(await this.client.createDevice({signedChallenge:i.toJSON(),devicePassword:o})).value;this.log.trace(`Created device with id ${c.id}.`);return await l.Device.from({createdAt:n.CoreDate.from(c.createdAt),createdByDevice:n.CoreId.from(c.createdByDevice),id:n.CoreId.from(c.id),name:e,description:t,type:l.DeviceType.Unknown,username:c.username,initialPassword:o,isAdmin:r})}async sendDevice(e){if(!(e=await u.SendDeviceParameters.from(e)).name){const t=await this.parent.devices.list();e.name=`Device ${t.length+1}`}const t=await this.createDevice(e.name,e.description,e.isAdmin);return await this.devices.create(t),t}async getSharedSecret(e){const t=await this.devices.read(e.toString());if(!t)throw n.TransportErrors.general.recordNotFound(l.Device,e.toString());const r=await this.devices.count(),i=await l.Device.from(t);if(!i.initialPassword||i.publicKey||i.lastLoginAt)throw n.TransportErrors.device.alreadyOnboarded();const o=!0===i.isAdmin;return await this.parent.activeDevice.secrets.createDeviceSharedSecret(i,r,o)}async update(e){const t=await this.devices.read(e.id.toString());if(!t)throw n.TransportErrors.general.recordNotFound(l.Device,e.id.toString());await this.devices.update(t,e)}async delete(e){await this.devices.delete(e)}async list(){const e=await this.devices.list();return await this.parseArray(e,l.Device)}}t.DevicesController=DevicesController},8185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8382:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceAuthClient=void 0;const n=r(2027);class DeviceAuthClient extends n.RESTClientAuthenticate{constructor(){super(...arguments),this._logDirective=n.RESTClientLogDirective.LogResponse}async changeDevicePassword(e){return await this.put("/api/v1/Devices/Self/Password",e,{})}async createDevice(e){return await this.post("/api/v1/Devices",e,{})}async registerPushNotificationToken(e){return await this.put("/api/v1/Devices/Self/PushNotifications",e)}}t.DeviceAuthClient=DeviceAuthClient},6961:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceClient=void 0;const n=r(2027);class DeviceClient extends n.RESTClient{constructor(){super(...arguments),this._logDirective=n.RESTClientLogDirective.LogResponse}async createDevice(e){return await this.post("/api/v1/Devices",e,{})}}t.DeviceClient=DeviceClient},6453:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Device=t.DeviceType=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(4062),p=r(9170);!function(e){e[e.Unknown=0]="Unknown",e[e.Phone=1]="Phone",e[e.Tablet=2]="Tablet",e[e.Desktop=3]="Desktop",e[e.Connector=4]="Connector"}(t.DeviceType||(t.DeviceType={}));let d=n=class Device extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.isAdmin)),(0,c.nameof)((e=>e.publicKey)),(0,c.nameof)((e=>e.certificate)),(0,c.nameof)((e=>e.operatingSystem)),(0,c.nameof)((e=>e.type)),(0,c.nameof)((e=>e.createdAt)),(0,c.nameof)((e=>e.createdByDevice)),(0,c.nameof)((e=>e.lastLoginAt)),(0,c.nameof)((e=>e.username)),(0,c.nameof)((e=>e.initialPassword)),(0,c.nameof)((e=>e.datawalletVersion))],this.userdataProperties=[(0,c.nameof)((e=>e.name)),(0,c.nameof)((e=>e.description))]}static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CryptoSignaturePublicKey)],d.prototype,"publicKey",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"certificate",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],d.prototype,"name",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"description",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"operatingSystem",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",u.CoreDate)],d.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",p.CoreId)],d.prototype,"createdByDevice",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CoreDate)],d.prototype,"lastLoginAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Number)],d.prototype,"type",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"username",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],d.prototype,"initialPassword",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Boolean)],d.prototype,"isAdmin",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Number)],d.prototype,"datawalletVersion",void 0),d=n=i([(0,a.type)("Device")],d),t.Device=d},413:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceSecretCredentials=void 0;const a=r(194),s=r(2027);let c=n=class DeviceSecretCredentials extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}};i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CoreId)],c.prototype,"id",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],c.prototype,"password",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],c.prototype,"username",void 0),c=n=i([(0,a.type)("DeviceSecretCredentials")],c),t.DeviceSecretCredentials=c},9798:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendDeviceParameters=void 0;const a=r(194),s=r(2027);let c=n=class SendDeviceParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],c.prototype,"name",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],c.prototype,"description",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Boolean)],c.prototype,"isAdmin",void 0),c=n=i([(0,a.type)("SendDeviceParameters")],c),t.SendDeviceParameters=c},6758:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceSharedSecret=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(2016);let u=n=class DeviceSharedSecret extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.serialize)(),(0,a.validate)(),o("design:type",c.CoreId)],u.prototype,"id",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",c.CoreId)],u.prototype,"createdByDevice",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",c.CoreDate)],u.prototype,"createdAt",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],u.prototype,"name",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],u.prototype,"description",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CryptoSecretKey)],u.prototype,"synchronizationKey",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CryptoSecretKey)],u.prototype,"secretBaseKey",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",Number)],u.prototype,"deviceIndex",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",s.CryptoSignaturePrivateKey)],u.prototype,"identityPrivateKey",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",l.Identity)],u.prototype,"identity",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",String)],u.prototype,"username",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",String)],u.prototype,"password",void 0),u=n=i([(0,a.type)("DeviceSharedSecret")],u),t.DeviceSharedSecret=u},9777:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileController=void 0;const n=r(2890),i=r(2027),o=r(369),a=r(2508),s=r(7145),c=r(7373),l=r(9873),u=r(8340),p=r(3159),d=r(9579);class FileController extends a.TransportController{constructor(e){super(a.ControllerName.File,e)}async init(){return await super.init(),this.client=new s.FileClient(this.config,this.parent.authenticator),this.files=await this.parent.getSynchronizedCollection(o.DbCollectionName.Files),this}async getFiles(e){const t=await this.files.find(e);return await this.parseArray(t,l.File)}async getFile(e){const t=await this.files.read(e.toString());return t?await l.File.from(t):void 0}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getFiles({ids:e.map((e=>e.id))})).value.collect()).map((async e=>{const t=await this.files.read(e.id),r=await l.File.from(t);return{id:i.CoreId.from(e.id),cache:await this.decryptFile(e,r.secretKey)}}));return await Promise.all(t)}async updateCache(e){if(e.length<1)return[];const t=[];for(const r of e){const e=await this.client.getFile(r);if(e.isError){if("error.transport.recordNotFound"===e.error.code||"error.transport.request.notFound"===e.error.code||"error.platform.recordNotFound"===e.error.code){this.log.warn(`Record id ${r} could not be found on backbone. It might be expired.`,e.error);continue}throw e.error}const n=e.value;t.push(this.updateCacheOfExistingFileInDb(n.id,n))}return await Promise.all(t)}async updateCacheOfExistingFileInDb(e,t){const r=await this.files.read(e);if(!r)throw i.TransportErrors.general.recordNotFound(l.File,e).logWith(this._log);const n=await l.File.from(r);return await this.updateCacheOfFile(n,t),await this.files.update(r,n),n}async updateCacheOfFile(e,t){const r=e.id.toString();t||(t=(await this.client.getFile(r)).value);const n=await this.decryptFile(t,e.secretKey);e.setCache(n),e.isOwn=this.parent.identity.isMe(n.createdBy)}async decryptFile(e,t){const r=await n.CryptoCipher.fromBase64(e.encryptedProperties),o=await i.CoreCrypto.decrypt(r,t),a=await p.FileMetadata.deserialize(o.toUtf8());if(!(a instanceof p.FileMetadata))throw i.TransportErrors.files.invalidMetadata(e.id).logWith(this._log);return await c.CachedFile.fromBackbone(e,a)}async loadPeerFileByTruncated(e){const t=await d.FileReference.fromTruncated(e);return await this.loadPeerFileByReference(t)}async loadPeerFileByReference(e){return await this.loadPeerFile(e.id,e.key)}async loadPeerFile(e,t){if(await this.files.read(e.toString()))return await this.updateCacheOfExistingFileInDb(e.toString());const r=await l.File.from({id:e,secretKey:t,isOwn:!1});return await this.updateCacheOfFile(r),await this.files.create(r),r}async setFileMetadata(e,t){const r=e instanceof i.CoreId?e.toString():e.id.toString(),n=await this.files.read(r);if(!n)throw i.TransportErrors.general.recordNotFound(l.File,r.toString()).logWith(this._log);const o=await l.File.from(n);return o.setMetadata(t),await this.files.update(n,o),o}async sendFile(e){const t=await u.SendFileParameters.from(e),r=t.buffer,o=r.length;if(o>this.config.platformMaxUnencryptedFileSize)throw i.TransportErrors.files.maxFileSizeExceeded(o,this.config.platformMaxUnencryptedFileSize);const a=await n.CryptoHash.hash(r,2),s=i.CoreHash.from(a.toBase64URL()),d=await this.parent.activeDevice.sign(a),h=d.toBase64(),g=await i.CoreCrypto.generateSecretKey(),y=await i.CoreCrypto.encrypt(r,g),m=n.CoreBuffer.fromBase64URL(y.toBase64()),v=await n.CryptoHash.hash(m,2),w=i.CoreHash.from(v.toBase64URL()),b=(await p.FileMetadata.from({title:t.title,description:t.description,filename:t.filename,filesize:o,plaintextHash:s,secretKey:g,filemodified:t.filemodified,mimetype:t.mimetype})).serialize(),C=n.CoreBuffer.fromString(b,n.Encoding.Utf8),_=await i.CoreCrypto.generateSecretKey(),S=await i.CoreCrypto.encrypt(C,_),T=this.parent.identity.address,O=(await this.client.createFile({content:m.buffer,cipherHash:v.toBase64URL(),owner:T.toString(),ownerSignature:h,expiresAt:t.expiresAt.toString(),encryptedProperties:S.toBase64()})).value,R=await c.CachedFile.from({title:t.title,description:t.description,filename:t.filename,filesize:o,filemodified:t.filemodified,cipherKey:g,cipherHash:w,createdAt:i.CoreDate.from(O.createdAt),createdBy:i.CoreAddress.from(O.createdBy),createdByDevice:i.CoreId.from(O.createdByDevice),expiresAt:i.CoreDate.from(O.expiresAt),mimetype:t.mimetype,owner:i.CoreAddress.from(O.owner),ownerSignature:d,plaintextHash:s}),I=await l.File.from({id:i.CoreId.from(O.id),secretKey:_,isOwn:!0});return I.setCache(R),await this.files.create(I),I}async downloadFileContent(e){const t=e instanceof l.File?e:await this.getFile(e);if(!t)throw i.TransportErrors.general.recordNotFound(l.File,e.toString()).logWith(this._log);if(!t.cache)throw i.TransportErrors.general.cacheEmpty(l.File,t.id.toString()).logWith(this._log);const r=(await this.client.downloadFile(t.id.toString())).value,o=n.CoreBuffer.fromObject(r);if((await n.CryptoHash.hash(o,2)).toBase64URL()!==t.cache.cipherHash.hash)throw i.TransportErrors.files.cipherMismatch().logWith(this._log);const a=await n.CryptoCipher.fromBase64(o.toBase64URL()),s=await i.CoreCrypto.decrypt(a,t.cache.cipherKey);if(!await t.cache.plaintextHash.verify(s,2))throw i.TransportErrors.files.plaintextHashMismatch().logWith(this._log);return s}}t.FileController=FileController},2153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5560:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7145:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileClient=void 0;const n=r(6054);class FileClient extends n.RESTClientAuthenticate{async createFile(e){return await this.postMultipart("/api/v1/Files",e)}async getFiles(e){return await this.getPaged("/api/v1/Files",e)}async getFile(e){return await this.get(`/api/v1/Files/${e}/metadata`)}async deleteFile(e){return await this.delete(`/api/v1/Files/${e}`)}async downloadFile(e){return await this.download(`/api/v1/Files/${e}`)}}t.FileClient=FileClient},7373:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedFile=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class CachedFile extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async fromBackbone(e,t){return await n.from({title:t.title,description:t.description,cipherKey:t.secretKey,filemodified:t.filemodified,filename:t.filename,filesize:t.filesize,plaintextHash:t.plaintextHash,deletedAt:e.deletedAt?c.CoreDate.from(e.deletedAt):void 0,deletedBy:e.deletedBy?c.CoreAddress.from(e.deletedBy):void 0,deletedByDevice:e.deletedByDevice?c.CoreId.from(e.deletedByDevice):void 0,cipherHash:c.CoreHash.from(e.cipherHash),createdAt:c.CoreDate.from(e.createdAt),createdBy:c.CoreAddress.from(e.createdBy),createdByDevice:c.CoreId.from(e.createdByDevice),expiresAt:c.CoreDate.from(e.expiresAt),mimetype:t.mimetype,owner:c.CoreAddress.from(e.owner),ownerSignature:await s.CryptoSignature.fromBase64(e.ownerSignature)})}};i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],l.prototype,"title",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"filename",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Number)],l.prototype,"filesize",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"filemodified",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"mimetype",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreHash)],l.prototype,"cipherHash",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],l.prototype,"description",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],l.prototype,"owner",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"ownerSignature",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreHash)],l.prototype,"plaintextHash",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],l.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"cipherKey",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"deletedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreAddress)],l.prototype,"deletedBy",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"deletedByDevice",void 0),l=n=i([(0,a.type)("CachedFile")],l),t.CachedFile=l},9873:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.File=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(9579),p=r(7373);let d=n=class File extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.secretKey)),(0,c.nameof)((e=>e.isOwn))],this.metadataProperties=[(0,c.nameof)((e=>e.metadata)),(0,c.nameof)((e=>e.metadataModifiedAt))]}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}async toFileReference(){return await u.FileReference.from({id:this.id,key:this.secretKey})}setCache(e){return this.cache=e,this.cachedAt=l.CoreDate.utc(),this}setMetadata(e){return this.metadata=e,this.metadataModifiedAt=l.CoreDate.utc(),this}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],d.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],d.prototype,"isOwn",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",p.CachedFile)],d.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],d.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],d.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],d.prototype,"metadataModifiedAt",void 0),d=n=i([(0,a.type)("File")],d),t.File=d},8340:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendFileParameters=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(4062);let u=n=class SendFileParameters extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"title",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"description",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"filename",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],u.prototype,"mimetype",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.CoreDate)],u.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],u.prototype,"filemodified",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreBuffer)],u.prototype,"buffer",void 0),u=n=i([(0,a.type)("SendFileParameters")],u),t.SendFileParameters=u},3159:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.FileMetadata=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class FileMetadata extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],l.prototype,"title",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],l.prototype,"description",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"filename",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreHash)],l.prototype,"plaintextHash",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Number)],l.prototype,"filesize",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],l.prototype,"filemodified",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"mimetype",void 0),l=n=i([(0,a.type)("FileMetadata")],l),t.FileMetadata=l},9579:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.FileReference=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class FileReference extends c.CoreSerializableAsync{truncate(){return s.CoreBuffer.fromUtf8(`${this.id.toString()}|${this.key.algorithm}|${this.key.secretKey.toBase64URL()}`).toBase64URL()}static async fromTruncated(e){const t=s.CoreBuffer.fromBase64URL(e).toUtf8().split("|");if(3!==t.length)throw c.TransportErrors.files.invalidTruncatedReference();try{const e=c.CoreId.from(t[0]),r=parseInt(t[1]),i=t[2],o=await s.CryptoSecretKey.from({algorithm:r,secretKey:s.CoreBuffer.fromBase64URL(i)});return await n.from({id:c.CoreId.from(e),key:o})}catch(e){throw c.TransportErrors.files.invalidTruncatedReference()}}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"id",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"key",void 0),l=n=i([(0,a.type)("FileReference")],l),t.FileReference=l},9662:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7024),t),i(r(5366),t),i(r(2016),t),i(r(6346),t),i(r(761),t),i(r(1615),t),i(r(2723),t),i(r(8324),t),i(r(365),t),i(r(8951),t),i(r(4507),t),i(r(7584),t),i(r(1949),t),i(r(8176),t),i(r(6578),t),i(r(4220),t),i(r(3327),t),i(r(7376),t),i(r(8579),t),i(r(3727),t),i(r(9745),t),i(r(1430),t),i(r(3122),t),i(r(1772),t),i(r(9626),t),i(r(9643),t),i(r(8565),t),i(r(8185),t),i(r(8382),t),i(r(6961),t),i(r(7896),t),i(r(4980),t),i(r(2556),t),i(r(6453),t),i(r(413),t),i(r(9798),t),i(r(6758),t),i(r(2153),t),i(r(5560),t),i(r(7145),t),i(r(9777),t),i(r(7373),t),i(r(9873),t),i(r(8340),t),i(r(3159),t),i(r(9579),t),i(r(7239),t),i(r(5523),t),i(r(3125),t),i(r(2510),t),i(r(6614),t),i(r(4949),t),i(r(5832),t),i(r(8909),t),i(r(4937),t),i(r(4226),t),i(r(8009),t),i(r(7242),t),i(r(6164),t),i(r(7902),t),i(r(1903),t),i(r(4002),t),i(r(169),t),i(r(2182),t),i(r(8440),t),i(r(3666),t),i(r(3654),t),i(r(3582),t),i(r(1512),t),i(r(3771),t),i(r(3611),t),i(r(6411),t),i(r(5289),t),i(r(5784),t),i(r(3857),t),i(r(8174),t),i(r(3861),t),i(r(334),t),i(r(7262),t),i(r(8805),t),i(r(8572),t),i(r(7215),t),i(r(9270),t),i(r(1752),t),i(r(3778),t),i(r(2343),t),i(r(3522),t),i(r(3293),t),i(r(3129),t),i(r(9423),t),i(r(7636),t),i(r(5739),t),i(r(6890),t),i(r(3670),t),i(r(8571),t),i(r(4401),t),i(r(1541),t),i(r(7224),t),i(r(5079),t),i(r(7596),t),i(r(9267),t),i(r(8222),t),i(r(9761),t),i(r(9750),t),i(r(1295),t),i(r(26),t),i(r(8697),t),i(r(7653),t),i(r(7267),t),i(r(6591),t),i(r(8342),t),i(r(5898),t),i(r(4102),t),i(r(4503),t),i(r(5083),t),i(r(2238),t),i(r(1488),t),i(r(7776),t)},5832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageController=void 0;const n=r(2890),i=r(4714),o=r(2027),a=r(369),s=r(2508),c=r(9873),l=r(2182),u=r(3654),p=r(3125),d=r(2510),h=r(6614),g=r(4949),y=r(8909),m=r(4937),v=r(4226),w=r(8009),b=r(7242);class MessageController extends s.TransportController{constructor(e){super(s.ControllerName.Message,e),this.relationships=e.relationships}async init(){return await super.init(),this.secrets=new u.RelationshipSecretController(this.parent),await this.secrets.init(),this.client=new p.MessageClient(this.config,this.parent.authenticator),this.messages=await this.parent.getSynchronizedCollection(a.DbCollectionName.Messages),this}async getMessages(e){const t=await this.messages.find(e);return await this.parseArray(t,h.Message)}async getMessagesByRelationshipId(e){return await this.getMessages({[(0,i.nameof)((e=>e.relationshipIds))]:{$contains:e.toString()}})}async getMessagesByAddress(e){const t=await this.parent.relationships.getActiveRelationshipToIdentity(e);if(!t)throw o.TransportErrors.messages.noMatchingRelationship(e.toString()).logWith(this._log);return await this.getMessagesByRelationshipId(t.id)}async getReceivedMessages(){return await this.getMessages({[(0,i.nameof)((e=>e.isOwn))]:!1})}async getMessage(e){const t=await this.messages.read(e.toString());return t?await h.Message.from(t):void 0}async updateCache(e){if(e.length<1)return[];const t=(await this.client.getMessages({ids:e})).value,r=[];for await(const e of t)r.push(this.updateCacheOfExistingMessageInDb(e.id,e));return await Promise.all(r)}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getMessages({ids:e.map((e=>e.toString()))})).value.collect()).map((async e=>{const t=await this.messages.read(e.id),r=await h.Message.from(t),n=await this.getEnvelopeFromBackboneGetMessagesResponse(e),i=(await this.decryptMessage(n,r.secretKey))[0];return{id:o.CoreId.from(e.id),cache:i}}));return await Promise.all(t)}async updateCacheOfExistingMessageInDb(e,t){const r=await this.messages.read(e);if(!r)throw o.TransportErrors.general.recordNotFound(h.Message,e).logWith(this._log);const n=await h.Message.from(r);return await this.updateCacheOfMessage(n,t),await this.messages.update(r,n),n}async updateCacheOfMessage(e,t){const r=e.id.toString();t||(t=(await this.client.getMessage(r)).value);const n=await this.getEnvelopeFromBackboneGetMessagesResponse(t),[i,o]=await this.decryptMessage(n,e.secretKey);e.secretKey=o,e.setCache(i)}async loadPeerMessage(e){const t=(await this.client.getMessage(e.toString())).value,r=await this.getEnvelopeFromBackboneGetMessagesResponse(t),[n,i,a]=await this.decryptMessage(r);if(!a)throw o.TransportErrors.general.recordNotFound(l.Relationship,r.id.toString()).logWith(this._log);const s=await h.Message.from({id:r.id,isOwn:!1,secretKey:i,relationshipIds:[a.id]});return s.setCache(n),await this.messages.create(s),s}async getEnvelopeFromBackboneGetMessagesResponse(e){const t=[];for(const r of e.recipients){const e=await m.MessageEnvelopeRecipient.from({encryptedKey:await n.CryptoCipher.fromBase64(r.encryptedKey),address:o.CoreAddress.from(r.address),receivedAt:r.receivedAt?o.CoreDate.from(r.receivedAt):void 0,receivedByDevice:r.receivedByDevice?o.CoreId.from(r.receivedByDevice):void 0});t.push(e)}return await y.MessageEnvelope.from({id:o.CoreId.from(e.id),createdAt:o.CoreDate.from(e.createdAt),createdBy:o.CoreAddress.from(e.createdBy),createdByDevice:o.CoreId.from(e.createdByDevice),cipher:await n.CryptoCipher.fromBase64(e.body),attachments:e.attachments,recipients:t})}async setMessageMetadata(e,t){const r=e instanceof o.CoreId?e.toString():e.id.toString(),n=await this.messages.read(r);if(!n)throw o.TransportErrors.general.recordNotFound(h.Message,r.toString()).logWith(this._log);const i=await h.Message.from(n);return i.setMetadata(t),await this.messages.update(n,i),i}async sendMessage(e){(e=await g.SendMessageParameters.from(e)).attachments||(e.attachments=[]);const t=await o.CoreCrypto.generateSecretKey(),r=t.serialize(!1),i=[],a=[];for(const t of e.recipients){const e=await this.relationships.getActiveRelationshipToIdentity(o.CoreAddress.from(t));if(!e)throw o.TransportErrors.general.recordNotFound(l.Relationship,t.toString()).logWith(this._log);const n=await this.secrets.encrypt(e.relationshipSecretId,r);a.push(await m.MessageEnvelopeRecipient.from({address:t,encryptedKey:n})),i.push(t)}const s=[],u=[];for(const t of e.attachments){const e=await c.File.from(t);u.push(await e.toFileReference()),s.push(e.id)}const p=(await v.MessagePlain.from({content:e.content,recipients:i,createdAt:o.CoreDate.utc(),attachments:u})).serialize(),y=n.CoreBuffer.fromUtf8(p),C=[],_=[];for(const t of e.recipients){const e=await this.relationships.getActiveRelationshipToIdentity(o.CoreAddress.from(t));if(!e)throw o.TransportErrors.general.recordNotFound(l.Relationship,t.toString()).logWith(this._log);const r=await this.secrets.sign(e.relationshipSecretId,y),n=await w.MessageSignature.from({recipient:t,signature:r});C.push(n),_.push(e.id)}const S=(await b.MessageSigned.from({message:p,signatures:C})).serialize(),T=await o.CoreCrypto.encrypt(n.CoreBuffer.fromUtf8(S),t),O=a.map((e=>({address:e.address.toString(),encryptedKey:e.encryptedKey.toBase64()}))),R=s.map((e=>({id:e.id}))),I=(await this.client.createMessage({attachments:R,body:T.toBase64(),recipients:O})).value,E=await d.CachedMessage.from({content:e.content,createdAt:o.CoreDate.from(I.createdAt),createdBy:this.parent.identity.identity.address,createdByDevice:this.parent.activeDevice.id,recipients:a,attachments:s,receivedByEveryone:!1}),L=await h.Message.from({id:o.CoreId.from(I.id),secretKey:t,cache:E,cachedAt:o.CoreDate.utc(),isOwn:!0,relationshipIds:_});return await this.messages.create(L),L}async decryptOwnEnvelope(e,t){this.log.trace(`Decrypting own envelope with id ${e.id.toString()}...`);const r=await o.CoreCrypto.decrypt(e.cipher,t),n=await b.MessageSigned.deserialize(r.toUtf8());return await v.MessagePlain.from(JSON.parse(n.message))}async decryptPeerEnvelope(e,t){var r,i;const a=null===(r=e.recipients.find((e=>this.parent.identity.isMe(e.address))))||void 0===r?void 0:r.encryptedKey;if(!a)throw o.TransportErrors.messages.ownAddressNotInList(e.id.toString()).logWith(this._log);const s=await this.secrets.decryptPeer(t.relationshipSecretId,a,!0),c=await n.CryptoSecretKey.deserialize(s.toUtf8()),l=await o.CoreCrypto.decrypt(e.cipher,c),u=await b.MessageSigned.deserialize(l.toUtf8()),p=null===(i=u.signatures.find((e=>this.parent.identity.isMe(e.recipient))))||void 0===i?void 0:i.signature;if(!p)throw o.TransportErrors.messages.signatureListMismatch(e.id.toString()).logWith(this._log);const d=await v.MessagePlain.from(JSON.parse(u.message));u.signatures.length!==d.recipients.length&&this.log.debug(`Number of signatures does not match number of recipients from envelope ${e.id}.`);const h=n.CoreBuffer.fromUtf8(u.message);if(!await this.secrets.verifyPeer(t.relationshipSecretId,h,p))throw o.TransportErrors.messages.signatureNotValid().logWith(this._log);d.recipients.length!==e.recipients.length&&this.log.debug(`Number of signed recipients within the message does not match number of recipients from envelope ${e.id}.`),d.recipients.length!==u.signatures.length&&this.log.debug(`Number of signed recipients within the message does not match number of signatures from envelope ${e.id}.`);if(!d.recipients.some((e=>this.parent.identity.isMe(e))))throw o.TransportErrors.messages.plaintextMismatch(e.id.toString()).logWith(this._log);return[d,c]}async decryptMessage(e,t){let r,n,i;if(this.log.trace(`Decrypting MessageEnvelope with id ${e.id}...`),this.parent.identity.isMe(e.createdBy)){if(!t)throw o.TransportErrors.messages.noSecretKeyForOwnMessage(e.id.toString()).logWith(this._log);n=t,r=await this.decryptOwnEnvelope(e,t)}else{if(i=await this.relationships.getActiveRelationshipToIdentity(e.createdBy),!i)throw o.TransportErrors.messages.noMatchingRelationship(e.createdBy.toString()).logWith(this._log);const[t,a]=await this.decryptPeerEnvelope(e,i);r=t,n=a}this.log.trace("Message is valid. Fetching attachments for message...");const a=[],s=[];for(const e of r.attachments)s.push(this.parent.files.loadPeerFileByReference(e)),a.push(e.id);await Promise.all(s),this.log.trace("Attachments fetched. Creating message...");return[await d.CachedMessage.from({createdBy:e.createdBy,createdByDevice:e.createdByDevice,recipients:e.recipients,attachments:a,content:r.content,createdAt:e.createdAt,receivedByEveryone:!1}),n,i]}}t.MessageController=MessageController},7239:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageClient=void 0;const n=r(6054);class MessageClient extends n.RESTClientAuthenticate{async getMessages(e){return await this.getPaged("/api/v1/Messages",e)}async createMessage(e){return await this.post("/api/v1/Messages",e)}async getMessage(e){return await this.get(`/api/v1/Messages/${e}`)}async deleteMessage(e){return await this.delete(`/api/v1/Messages/${e}`)}async setRead(e){return await this.put(`/api/v1/Messages/${e}/setReadFlag`,void 0)}}t.MessageClient=MessageClient},2510:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedMessage=void 0;const a=r(194),s=r(2027),c=r(4062),l=r(4937);let u=n=class CachedMessage extends s.CoreSerializableAsync{constructor(){super(...arguments),this.receivedByEveryone=!1}static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreAddress)],u.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],u.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.MessageEnvelopeRecipient}),o("design:type",Array)],u.prototype,"recipients",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],u.prototype,"createdAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)({type:s.CoreId}),o("design:type",Array)],u.prototype,"attachments",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],u.prototype,"receivedByEveryone",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],u.prototype,"content",void 0),u=n=i([(0,a.type)("CachedMessage")],u),t.CachedMessage=u},6614:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Message=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(2510);let p=n=class Message extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.secretKey)),(0,c.nameof)((e=>e.isOwn)),(0,c.nameof)((e=>e.relationshipIds))],this.metadataProperties=[(0,c.nameof)((e=>e.metadata)),(0,c.nameof)((e=>e.metadataModifiedAt))]}static async from(e){return await super.fromT(e,n)}setCache(e){return this.cache=e,this.cachedAt=l.CoreDate.utc(),this}setMetadata(e){return this.metadata=e,this.metadataModifiedAt=l.CoreDate.utc(),this}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],p.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],p.prototype,"isOwn",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CachedMessage)],p.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],p.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],p.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],p.prototype,"metadataModifiedAt",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.CoreId}),o("design:type",Array)],p.prototype,"relationshipIds",void 0),p=n=i([(0,a.type)("Message")],p),t.Message=p},4949:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendMessageParameters=void 0;const a=r(194),s=r(2027),c=r(9873);let l=n=class SendMessageParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)({type:s.CoreAddress}),o("design:type",Array)],l.prototype,"recipients",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],l.prototype,"content",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)({type:c.File}),o("design:type",Array)],l.prototype,"attachments",void 0),l=n=i([(0,a.type)("SendMessageParameters")],l),t.SendMessageParameters=l},8909:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageEnvelope=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(4937);let u=n=class MessageEnvelope extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static mapToJSON(e){const t={};for(const[r,n]of e.entries()){const e=r.serialize(),i=n.serialize();t[e]=i}return t}static async deserializeMap(e){const t=new Map;for(const r in e){const n=e[r],i=c.CoreAddress.deserialize(r),o=await s.CryptoCipher.deserialize(n);t.set(i,o)}return t}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],u.prototype,"id",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreDate)],u.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],u.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],u.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.MessageEnvelopeRecipient}),o("design:type",Array)],u.prototype,"recipients",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoCipher)],u.prototype,"cipher",void 0),i([(0,a.validate)(),(0,a.serialize)({type:c.CoreId}),o("design:type",Array)],u.prototype,"attachments",void 0),u=n=i([(0,a.type)("MessageEnvelope")],u),t.MessageEnvelope=u},4937:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageEnvelopeRecipient=void 0;const a=r(194),s=r(2890),c=r(2027),l=r(7875);let u=n=class MessageEnvelopeRecipient extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.CoreAddress)],u.prototype,"address",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoCipher)],u.prototype,"encryptedKey",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],u.prototype,"receivedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreId)],u.prototype,"receivedByDevice",void 0),u=n=i([(0,a.type)("MessageEnvelopeRecipient")],u),t.MessageEnvelopeRecipient=u},4226:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePlain=void 0;const a=r(194),s=r(2027),c=r(7875),l=r(4062),u=r(9579);let p=n=class MessagePlain extends s.CoreSerializableAsync{constructor(){super(...arguments),this.attachments=[]}static async from(e){return void 0===e.attachments&&(e.attachments=[]),await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)({type:u.FileReference}),o("design:type",Array)],p.prototype,"attachments",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],p.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.CoreDate)],p.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)({type:c.CoreAddress}),o("design:type",Array)],p.prototype,"recipients",void 0),p=n=i([(0,a.type)("MessagePlain")],p),t.MessagePlain=p},8009:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageSignature=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class MessageSignature extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreAddress)],l.prototype,"recipient",void 0),i([(0,a.validate)(),(0,a.serialize)({enforceString:!0}),o("design:type",s.CryptoSignature)],l.prototype,"signature",void 0),l=n=i([(0,a.type)("MessageSignature")],l),t.MessageSignature=l},7242:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageSigned=void 0;const a=r(194),s=r(2027),c=r(8009);let l=n=class MessageSigned extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){const t=JSON.parse(e);return await this.from(t)}};i([(0,a.validate)(),(0,a.serialize)({type:c.MessageSignature}),o("design:type",Array)],l.prototype,"signatures",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"message",void 0),l=n=i([(0,a.type)("MessageSigned")],l),t.MessageSigned=l},2343:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplateController=void 0;const n=r(2890),i=r(2027),o=r(369),a=r(2508),s=r(7215),c=r(9270),l=r(1752),u=r(3778),p=r(3522),d=r(3129);class RelationshipTemplateController extends a.TransportController{constructor(e,t,r){super(r||a.ControllerName.RelationshipTemplate,e),this.secrets=t,this.client=new s.RelationshipTemplateClient(this.config,this.parent.authenticator)}async init(){return await super.init(),this.templates=await this.parent.getSynchronizedCollection(o.DbCollectionName.RelationshipTemplates),this}async sendRelationshipTemplate(e){var t;e=await u.SendRelationshipTemplateParameters.from(e);const r=await this.secrets.createTemplateKey(),o=await p.RelationshipTemplateContent.from({content:e.content,identity:this.parent.identity.identity,templateKey:r}),a=await i.CoreCrypto.generateSecretKey(),s=o.serialize(),h=n.CoreBuffer.fromUtf8(s),g=await this.parent.identity.sign(h),y=await d.RelationshipTemplateSigned.from({deviceSignature:g,serializedTemplate:s}),m=n.CoreBuffer.fromUtf8(y.serialize()),v=await i.CoreCrypto.encrypt(m,a),w=(await this.client.createRelationshipTemplate({expiresAt:e.expiresAt.toString(),maxNumberOfRelationships:e.maxNumberOfRelationships,content:v.toBase64()})).value,b=await c.CachedRelationshipTemplate.from({content:e.content,createdAt:i.CoreDate.from(w.createdAt),createdBy:this.parent.identity.address,createdByDevice:this.parent.activeDevice.id,expiresAt:e.expiresAt,identity:this.parent.identity.identity,maxNumberOfRelationships:null!==(t=e.maxNumberOfRelationships)&&void 0!==t?t:void 0,templateKey:r}),C=await l.RelationshipTemplate.from({id:i.CoreId.from(w.id),secretKey:a,isOwn:!0,cache:b,cachedAt:i.CoreDate.utc()});return await this.templates.create(C),C}async deleteRelationshipTemplate(e){await this.client.deleteRelationshipTemplate(e.id.toString()),await this.templates.delete(e)}async getRelationshipTemplates(e){const t=await this.templates.find(e);return await this.parseArray(t,l.RelationshipTemplate)}async updateCache(e){if(e.length<1)return[];const t=[];for(const r of e){const e=await this.client.getRelationshipTemplate(r);if(e.isError){if("error.transport.recordNotFound"===e.error.code||"error.transport.request.notFound"===e.error.code||"error.platform.recordNotFound"===e.error.code){this.log.warn(`Record id ${r} could not be found on backbone. It might be expired.`,e.error);continue}throw e.error}const n=e.value;t.push(this.updateCacheOfExistingTemplateInDb(n.id,n))}return await Promise.all(t)}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getRelationshipTemplates({ids:e.map((e=>e.id))})).value.collect()).map((async e=>{const t=await this.templates.read(e.id),r=await l.RelationshipTemplate.from(t);return{id:i.CoreId.from(e.id),cache:await this.decryptRelationshipTemplate(e,r.secretKey)}}));return await Promise.all(t)}async updateCacheOfExistingTemplateInDb(e,t){const r=await this.templates.read(e);if(!r)throw i.TransportErrors.general.recordNotFound(l.RelationshipTemplate,e).logWith(this._log);const n=await l.RelationshipTemplate.from(r);return await this.updateCacheOfTemplate(n,t),await this.templates.update(r,n),n}async updateCacheOfTemplate(e,t){t||(t=(await this.client.getRelationshipTemplate(e.id.toString())).value);const r=await this.decryptRelationshipTemplate(t,e.secretKey);e.setCache(r),e.isOwn=this.parent.identity.isMe(r.createdBy)}async decryptRelationshipTemplate(e,t){var r;const o=await n.CryptoCipher.fromBase64(e.content),a=await this.secrets.decryptTemplate(o,t),s=await d.RelationshipTemplateSigned.deserialize(a.toUtf8()),l=await p.RelationshipTemplateContent.deserialize(s.serializedTemplate);if(!await this.secrets.verifyTemplate(n.CoreBuffer.fromUtf8(s.serializedTemplate),s.deviceSignature,l.identity.publicKey))throw i.TransportErrors.general.signatureNotValid("template").logWith(this._log);return await c.CachedRelationshipTemplate.from({content:l.content,createdBy:i.CoreAddress.from(e.createdBy),createdByDevice:i.CoreId.from(e.createdByDevice),createdAt:i.CoreDate.from(e.createdAt),expiresAt:e.expiresAt?i.CoreDate.from(e.expiresAt):void 0,identity:l.identity,maxNumberOfRelationships:null!==(r=e.maxNumberOfRelationships)&&void 0!==r?r:void 0,templateKey:l.templateKey})}async getRelationshipTemplate(e){const t=await this.templates.read(e.toString());if(t)return await l.RelationshipTemplate.from(t)}async setRelationshipTemplateMetadata(e,t){const r=e instanceof i.CoreId?e.toString():e.id.toString(),n=await this.templates.read(r);if(!n)throw i.TransportErrors.general.recordNotFound(l.RelationshipTemplate,r.toString()).logWith(this._log);const o=await l.RelationshipTemplate.from(n);return o.setMetadata(t),await this.templates.update(n,o),o}async loadPeerRelationshipTemplate(e,t){if(await this.templates.read(e.toString()))return await this.updateCacheOfExistingTemplateInDb(e.toString());const r=await l.RelationshipTemplate.from({id:e,secretKey:t,isOwn:!1});return await this.updateCacheOfTemplate(r),await this.templates.create(r),r}}t.RelationshipTemplateController=RelationshipTemplateController},8805:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8572:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7215:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplateClient=void 0;const n=r(2027);class RelationshipTemplateClient extends n.RESTClientAuthenticate{async getRelationshipTemplates(e){return await this.getPaged("/api/v1/RelationshipTemplates",e)}async getRelationshipTemplate(e){return await this.get(`/api/v1/RelationshipTemplates/${e}`)}async deleteRelationshipTemplate(e){return await this.delete(`/api/v1/RelationshipTemplates/${e}`)}async createRelationshipTemplate(e){return await this.post("/api/v1/RelationshipTemplates",e)}}t.RelationshipTemplateClient=RelationshipTemplateClient},9270:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedRelationshipTemplate=void 0;const a=r(194),s=r(2027),c=r(9170),l=r(2016),u=r(3293);let p=n=class CachedRelationshipTemplate extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}static validateMaxNumberOfRelationships(e){return void 0===e?"":e<=0?"maxNumberOfRelationships must be greater than 0":""}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.Identity)],p.prototype,"identity",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreAddress)],p.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],p.prototype,"createdByDevice",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",u.RelationshipTemplatePublicKey)],p.prototype,"templateKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],p.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],p.prototype,"createdAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreDate)],p.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0,customValidator:n.validateMaxNumberOfRelationships}),(0,a.serialize)(),o("design:type",Number)],p.prototype,"maxNumberOfRelationships",void 0),p=n=i([(0,a.type)("CachedRelationshipTemplate")],p),t.CachedRelationshipTemplate=p},1752:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplate=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(4062),p=r(9270);let d=n=class RelationshipTemplate extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.secretKey)),(0,c.nameof)((e=>e.isOwn))],this.metadataProperties=[(0,c.nameof)((e=>e.metadata)),(0,c.nameof)((e=>e.metadataModifiedAt))]}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}setCache(e){return this.cache=e,this.cachedAt=u.CoreDate.utc(),this}setMetadata(e){return this.metadata=e,this.metadataModifiedAt=u.CoreDate.utc(),this}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],d.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],d.prototype,"isOwn",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",p.CachedRelationshipTemplate)],d.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CoreDate)],d.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],d.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",u.CoreDate)],d.prototype,"metadataModifiedAt",void 0),d=n=i([(0,a.type)("RelationshipTemplate")],d),t.RelationshipTemplate=d},3778:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendRelationshipTemplateParameters=void 0;const a=r(194),s=r(2027),c=r(9270);let l=n=class SendRelationshipTemplateParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],l.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],l.prototype,"expiresAt",void 0),i([(0,a.validate)({nullable:!0,customValidator:c.CachedRelationshipTemplate.validateMaxNumberOfRelationships}),(0,a.serialize)(),o("design:type",Number)],l.prototype,"maxNumberOfRelationships",void 0),l=n=i([(0,a.type)("SendRelationshipTemplateParameters")],l),t.SendRelationshipTemplateParameters=l},3522:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplateContent=void 0;const a=r(194),s=r(2027),c=r(2016),l=r(3293);let u=n=class RelationshipTemplateContent extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.Identity)],u.prototype,"identity",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.RelationshipTemplatePublicKey)],u.prototype,"templateKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],u.prototype,"content",void 0),u=n=i([(0,a.type)("RelationshipTemplateContent")],u),t.RelationshipTemplateContent=u},3293:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplatePublicKey=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipTemplatePublicKey extends s.CryptoExchangePublicKey{constructor(e,t,r){super(t,r),this.id=e}toJSON(e=!0){const t={id:this.id.toString(),pub:this.publicKey.toBase64URL(),alg:this.algorithm};return e&&(t["@type"]="RelationshipTemplatePublicKey"),t}toBase64(){return s.CoreBuffer.utf8_base64(this.serialize())}serialize(e=!0){return JSON.stringify(this.toJSON(e))}static async fromJSON(e){const t=await s.CryptoExchangePublicKey.fromJSON(e);return new n(c.CoreId.from(e.id),t.algorithm,t.publicKey)}static from(e){return Promise.resolve(new n(c.CoreId.from(e.id),e.algorithm,e.publicKey))}static async deserialize(e){const t=JSON.parse(e);return await this.fromJSON(t)}};i([(0,a.serialize)({enforceString:!0}),(0,a.validate)(),o("design:type",c.CoreId)],l.prototype,"id",void 0),l=n=i([(0,a.type)("RelationshipTemplatePublicKey"),o("design:paramtypes",[c.CoreId,Number,s.CoreBuffer])],l),t.RelationshipTemplatePublicKey=l},3129:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipTemplateSigned=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipTemplateSigned extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"serializedTemplate",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"deviceSignature",void 0),l=n=i([(0,a.type)("RelationshipTemplateSigned")],l),t.RelationshipTemplateSigned=l},3654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipSecretController=void 0;const n=r(2890),i=r(2027),o=r(1341),a=r(18),s=r(8169),c=r(3293),l=r(5739);class RelationshipSecretController extends l.SecretController{constructor(e){super(e,i.ControllerName.RelationshipSecret),this.cache=new Map}async getSecret(e){const t=e.toString(),r=this.cache.get(e);if(r)return r;const i=await this.loadActiveSecretByName(t);if(!i)throw a.TransportErrors.general.recordNotFound("CryptoRelationshipRequestSecrets | CryptoRelationshipSecrets",t).logWith(this._log);if(!(i.secret instanceof n.CryptoRelationshipRequestSecrets||i.secret instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(t).logWith(this._log);const o=i.secret;return this.cache.set(e,o),o}async createRequestorSecrets(e,t){const r=await n.CryptoRelationshipRequestSecrets.fromPeer(e.templateKey,e.identity.publicKey);await this.storeSecret(r,t.toString(),"");return await r.toPublicRequest()}async createTemplatorSecrets(e,t,r){const i=t.templateKey.id.toString(),o=await this.loadActiveSecretByName(i);if(!o)throw a.TransportErrors.general.recordNotFound(n.CryptoExchangeKeypair,i).logWith(this._log);if(!(o.secret instanceof n.CryptoExchangeKeypair))throw a.TransportErrors.secrets.wrongSecretType(i).logWith(this._log);const s=o.secret,c=await n.CryptoRelationshipSecrets.fromRelationshipRequest(r,s);return await this.storeSecret(c,e.toString())}async getPublicResponse(e){const t=await this.loadActiveSecretByName(e.toString());if(!t)throw a.TransportErrors.general.recordNotFound(n.CryptoRelationshipSecrets,e.toString()).logWith(this._log);if(!(t.secret instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(t.id.toString()).logWith(this._log);return await t.secret.toPublicResponse()}async convertSecrets(e,t){const r=await this.getSecret(e);if(r instanceof n.CryptoRelationshipSecrets)throw a.TransportErrors.secrets.wrongSecretType().logWith(this._log);const i=await n.CryptoRelationshipSecrets.fromRelationshipResponse(t,r),o=await this.succeedSecretWithName(i,e.toString());return this.cache.set(e,i),o}async deleteSecretForRequest(e){const t=await this.loadActiveSecretByName(`request_to_${e.address}`);return!!t&&await this.deleteSecretById(t.id)}async decryptTemplate(e,t){return await i.CoreCrypto.decrypt(e,t)}async verifyTemplate(e,t,r){return await i.CoreCrypto.verify(e,t,r)}async encryptRequest(e,t){const r=o.CoreUtil.toBuffer(t),i=await this.getSecret(e);if(!(i instanceof n.CryptoRelationshipRequestSecrets))throw a.TransportErrors.secrets.wrongSecretType(i.id).logWith(this._log);return await i.encryptRequest(r)}async encrypt(e,t){const r=o.CoreUtil.toBuffer(t),i=await this.getSecret(e);if(!(i instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(i.id).logWith(this._log);return await i.encrypt(r)}async decryptRequest(e,t){const r=await this.getSecret(e);if(!(r instanceof n.CryptoRelationshipRequestSecrets||r instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(e.toString()).logWith(this._log);return await r.decryptRequest(t)}async createTemplateKey(){const e=await s.TransportIds.relationshipTemplateKey.generate(),t=(await this.createExchangeKey(`${e.toString()}`))[0];return new c.RelationshipTemplatePublicKey(e,t.algorithm,t.publicKey)}async decryptPeer(e,t,r=!1){const i=await this.getSecret(e);if(!(i instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(i.id).logWith(this._log);return await i.decryptPeer(t,r)}async hasCryptoRelationshipSecrets(e){return await this.getSecret(e)instanceof n.CryptoRelationshipSecrets}async decryptOwn(e,t){const r=await this.getSecret(e);if(!(r instanceof n.CryptoRelationshipSecrets))throw a.TransportErrors.secrets.wrongSecretType(r.id).logWith(this._log);return await r.decryptOwn(t)}async sign(e,t){const r=o.CoreUtil.toBuffer(t),n=await this.getSecret(e);return await n.sign(r)}async verifyOwn(e,t,r){const n=o.CoreUtil.toBuffer(t),i=await this.getSecret(e);return await i.verifyOwn(n,r)}async verifyPeer(e,t,r){const i=o.CoreUtil.toBuffer(t),s=await this.getSecret(e);if(s instanceof n.CryptoRelationshipRequestSecrets)throw a.TransportErrors.secrets.wrongSecretType(s.id).logWith(this._log);return await s.verifyPeer(i,r)}}t.RelationshipSecretController=RelationshipSecretController},3666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipsController=void 0;const n=r(2890),i=r(4714),o=r(2027),a=r(1341),s=r(369),c=r(18),l=r(8169),u=r(1752),p=r(4002),d=r(169),h=r(2182),g=r(8440),y=r(3582),m=r(3771),v=r(3611),w=r(6411),b=r(5289),C=r(5784),_=r(3857),S=r(8174),T=r(3861),O=r(334),R=r(7262);class RelationshipsController extends o.TransportController{constructor(e,t){super(o.ControllerName.Relationships,e),this.secrets=t}async init(){return await super.init(),this.client=new p.RelationshipClient(this.config,this.parent.authenticator),this.relationships=await this.parent.getSynchronizedCollection(s.DbCollectionName.Relationships),this}async getRelationships(e){const t=await this.relationships.find(e);return await this.parseArray(t,h.Relationship)}async updateCache(e){if(e.length<1)return[];const t=(await this.client.getRelationships({ids:e})).value,r=[];for await(const e of t)r.push(this.updateCacheOfExistingRelationshipInDb(e.id,e));return await Promise.all(r)}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getRelationships({ids:e.map((e=>e.id))})).value.collect()).map((async e=>{const t=await this.relationships.read(e.id),r=await h.Relationship.from(t);return{id:o.CoreId.from(e.id),cache:await this.decryptRelationship(e,r.relationshipSecretId)}}));return await Promise.all(t)}async updateCacheOfExistingRelationshipInDb(e,t){const r=await this.relationships.read(e);if(!r)throw c.TransportErrors.general.recordNotFound(h.Relationship,e).logWith(this._log);const n=await h.Relationship.from(r);return await this.updateCacheOfRelationship(n,t),await this.relationships.update(r,n),n}async getRelationshipToIdentity(e,t){const r={[`${(0,i.nameof)((e=>e.peer))}.${(0,i.nameof)((e=>e.address))}`]:e.toString()};t&&(r[`${(0,i.nameof)((e=>e.status))}`]=t);const n=await this.relationships.findOne(r);if(n)return await h.Relationship.from(n)}async getActiveRelationshipToIdentity(e){return await this.getRelationshipToIdentity(e,b.RelationshipStatus.Active)}async getRelationship(e){const t=await this.relationships.read(e.toString());if(t)return await h.Relationship.from(t)}async sign(e,t){return await this.secrets.sign(e.relationshipSecretId,t)}async verify(e,t,r){return await this.secrets.verifyPeer(e.relationshipSecretId,t,r)}async verifyIdentity(e,t,r){return await o.CoreCrypto.verify(t,r,e.peer.publicKey)}async sendRelationship(e){const t=(e=await g.SendRelationshipParameters.from(e)).template;if(!t.cache)throw c.TransportErrors.general.cacheEmpty(u.RelationshipTemplate,t.id.toString()).logWith(this._log);const r=await l.TransportIds.relationshipSecret.generate(),{requestCipher:n,requestContent:i}=await this.prepareRequest(r,t,e.content),a=(await this.client.createRelationship({content:n.toBase64(),relationshipTemplateId:t.id.toString()})).value,s=await h.Relationship.fromRequestSent(o.CoreId.from(a.id),t,t.cache.identity,await y.RelationshipChange.fromBackbone(a.changes[0],i.content),r);return await this.relationships.create(s),s}async setRelationshipMetadata(e,t){const r=e instanceof o.CoreId?e.toString():e.id.toString(),n=await this.relationships.read(r);if(!n)throw c.TransportErrors.general.recordNotFound(h.Relationship,r.toString()).logWith(this._log);const i=await h.Relationship.from(n);return i.metadata=t,i.metadataModifiedAt=o.CoreDate.utc(),await this.relationships.update(n,i),i}requestTermination(){throw c.TransportErrors.general.notImplemented()}async acceptChange(e,t){return await this.completeChange(v.RelationshipChangeStatus.Accepted,e,t)}async rejectChange(e,t){return await this.completeChange(v.RelationshipChangeStatus.Rejected,e,t)}async revokeChange(e,t){return await this.completeChange(v.RelationshipChangeStatus.Revoked,e,t)}async updateCacheOfRelationship(e,t){t||(t=(await this.client.getRelationship(e.id.toString())).value);const r=await this.decryptRelationship(t,e.relationshipSecretId);e.setCache(r)}async decryptRelationship(e,t){const r=o.CoreId.from(e.relationshipTemplateId);this._log.trace(`Parsing relationship template ${r} for ${e.id}...`);const n=await this.parent.relationshipTemplates.getRelationshipTemplate(r);if(!n)throw c.TransportErrors.general.recordNotFound(u.RelationshipTemplate,r.toString());this._log.trace(`Parsing relationship changes of ${e.id}...`);const i=[];for(const n of e.changes)if(n.type===w.RelationshipChangeType.Creation)i.push(this.parseCreationChange(n,t,r));const a=await Promise.all(i);return await d.CachedRelationship.from({changes:a,template:n})}async prepareRequest(e,t,r){if(!t.cache)throw c.TransportErrors.general.cacheEmpty(u.RelationshipTemplate,t.id.toString()).logWith(this._log);const n=await this.secrets.createRequestorSecrets(t.cache,e),i=await _.RelationshipCreationChangeRequestContent.from({content:r,identity:this.parent.identity.identity,templateId:t.id}),o=i.serialize(),s=a.CoreUtil.toBuffer(o),[l,p]=await Promise.all([this.parent.activeDevice.sign(s),this.secrets.sign(e,s)]),d=await S.RelationshipCreationChangeRequestSigned.from({serializedRequest:o,deviceSignature:l,relationshipSignature:p}),h=await this.secrets.encryptRequest(e,d);return{requestCipher:await C.RelationshipCreationChangeRequestCipher.from({cipher:h,publicRequestCrypto:n}),requestContent:i}}async applyChangeById(e){const t=(await this.client.getRelationshipChange(e.toString())).value;return await this.applyChange(t)}async applyChange(e){switch(e.type){case w.RelationshipChangeType.Creation:return await this.applyCreationChange(e);case w.RelationshipChangeType.Termination:return await this.applyTerminationChange(e);case w.RelationshipChangeType.TerminationCancellation:return await this.applyTerminationCancellationChange(e);default:throw c.TransportErrors.general.incompatibleBackbone().logWith(this._log)}}async applyCreationChange(e){const t=await this.relationships.read(e.relationshipId);if(t)return e.response?await this.updatePendingRelationshipWithPeerResponse(t,e):void 0;const r=await this.createNewRelationshipByIncomingCreationChange(e);if(e.response){const t=await this.relationships.read(e.relationshipId);return await this.updatePendingRelationshipWithPeerResponse(t,e)}return r}async parseCreationChange(e,t,r){if(e.type!==w.RelationshipChangeType.Creation)throw c.TransportErrors.relationships.wrongChangeType(e.type).logWith(this._log);const n=[];n.push(this.decryptCreationChangeRequest(e.request,t,r));const i=await this.secrets.hasCryptoRelationshipSecrets(t);e.response&&i&&n.push(this.decryptCreationChangeResponse(e,t));const[o,a]=await Promise.all(n);return await y.RelationshipChange.fromBackbone(e,o.content,null==a?void 0:a.content)}async decryptCreationChangeRequest(e,t,r){if(!e.content)throw c.TransportErrors.relationships.emptyOrInvalidContent().logWith(this._log);const i=this.parent.identity.isMe(o.CoreAddress.from(e.createdBy)),a=await C.RelationshipCreationChangeRequestCipher.fromBase64(e.content),s=await this.secrets.decryptRequest(t,a.cipher),l=await S.RelationshipCreationChangeRequestSigned.deserialize(s.toUtf8());let u;if(u=i?await this.secrets.verifyOwn(t,n.CoreBuffer.fromUtf8(l.serializedRequest),l.relationshipSignature):await this.secrets.verifyPeer(t,n.CoreBuffer.fromUtf8(l.serializedRequest),l.relationshipSignature),!u)throw c.TransportErrors.general.signatureNotValid("relationshipRequest").logWith(this._log);const p=await _.RelationshipCreationChangeRequestContent.deserialize(l.serializedRequest);if(p.templateId.toString()!==r.toString())throw c.TransportErrors.relationships.requestContainsWrongTemplateId().logWith(this._log);return p}async decryptCreationChangeResponse(e,t){if(!e.response)throw c.TransportErrors.relationships.changeResponseMissing(e.id).logWith(this._log);if(e.type!==w.RelationshipChangeType.Creation)throw c.TransportErrors.relationships.wrongChangeType(e.type).logWith(this._log);if(!e.response.content)throw c.TransportErrors.relationships.emptyOrInvalidContent(e).logWith(this._log);const r=this.parent.identity.isMe(o.CoreAddress.from(e.response.createdBy)),i=await T.RelationshipCreationChangeResponseCipher.fromBase64(e.response.content);let a;a=e.status!==v.RelationshipChangeStatus.Revoked?r?await this.secrets.decryptOwn(t,i.cipher):await this.secrets.decryptPeer(t,i.cipher,!0):await this.secrets.decryptRequest(t,i.cipher);const s=await R.RelationshipCreationChangeResponseSigned.deserialize(a.toUtf8());let l;if(l=r?await this.secrets.verifyOwn(t,n.CoreBuffer.fromUtf8(s.serializedResponse),s.relationshipSignature):await this.secrets.verifyPeer(t,n.CoreBuffer.fromUtf8(s.serializedResponse),s.relationshipSignature),!l)throw c.TransportErrors.general.signatureNotValid("relationshipResponse").logWith(this._log);const u=await O.RelationshipCreationChangeResponseContent.deserialize(s.serializedResponse);if(u.relationshipId.toString()!==e.relationshipId.toString())throw c.TransportErrors.relationships.responseContainsWrongRequestId().logWith(this._log);return u}async updatePendingRelationshipWithPeerResponse(e,t){const r=await h.Relationship.from(e);if(r.status!==b.RelationshipStatus.Pending)return void this.log.debug("Trying to update non-pending relationship with creation change",t);if(r.cache||await this.updateCacheOfRelationship(r,void 0),!t.response)throw c.TransportErrors.relationships.changeResponseMissing(t.id).logWith(this._log);if(!t.response.content)throw c.TransportErrors.relationships.emptyOrInvalidContent(t).logWith(this._log);const n=await T.RelationshipCreationChangeResponseCipher.fromBase64(t.response.content);if(t.status!==v.RelationshipChangeStatus.Revoked){if(!n.publicResponseCrypto)throw c.TransportErrors.relationships.responseCryptoIsMissing().logWith(this._log);await this.secrets.convertSecrets(r.relationshipSecretId,n.publicResponseCrypto)}const i=await this.decryptCreationChangeResponse(t,r.relationshipSecretId),o=await m.RelationshipChangeResponse.fromBackbone(t.response,i.content);if(!r.cache)throw c.TransportErrors.general.cacheEmpty(h.Relationship,r.id.toString());switch(r.cache.changes[0].status=t.status,t.status){case v.RelationshipChangeStatus.Accepted:r.toActive(o);break;case v.RelationshipChangeStatus.Rejected:r.toRejected(o);break;case v.RelationshipChangeStatus.Revoked:r.toRevoked(o);break;default:throw c.TransportErrors.general.incompatibleBackbone().logWith(this._log)}return await this.relationships.update(e,r),r}async createNewRelationshipByIncomingCreationChange(e){const t=(await this.client.getRelationship(e.relationshipId)).value,r=o.CoreId.from(t.relationshipTemplateId),n=await this.parent.relationshipTemplates.getRelationshipTemplate(r);if(!n)throw c.TransportErrors.general.recordNotFound(u.RelationshipTemplate,r.toString()).logWith(this._log);if(!n.cache)throw c.TransportErrors.general.cacheEmpty(u.RelationshipTemplate,n.id.toString()).logWith(this._log);if(!e.request.content)throw c.TransportErrors.relationships.emptyOrInvalidContent(e).logWith(this._log);const i=await l.TransportIds.relationshipSecret.generate(),a=await C.RelationshipCreationChangeRequestCipher.fromBase64(e.request.content);await this.secrets.createTemplatorSecrets(i,n.cache,a.publicRequestCrypto);const s=await this.decryptCreationChangeRequest(t.changes[0].request,i,r),p=await y.RelationshipChange.fromBackbone(e,s.content),d=await h.Relationship.fromCreationChangeReceived(t,n,s.identity,p,i);return await this.relationships.create(d),d}applyTerminationChange(e){throw c.TransportErrors.general.notImplemented()}applyTerminationCancellationChange(e){throw c.TransportErrors.general.notImplemented()}async completeChange(e,t,r){const n=await this.relationships.read(t.relationshipId.toString());if(!n)throw c.TransportErrors.general.recordNotFound(h.Relationship,t.relationshipId.toString()).logWith(this._log);const i=await h.Relationship.from(n);if(i.cache||await this.updateCacheOfRelationship(i),!i.cache)throw c.TransportErrors.general.cacheEmpty(h.Relationship,i.id.toString());const o=i.cache.changes.find((e=>e.id.toString()===t.id.toString()));if(!o)throw c.TransportErrors.general.recordNotFound(y.RelationshipChange,t.id.toString()).logWith(this._log);if(o.status!==v.RelationshipChangeStatus.Pending)throw c.TransportErrors.relationships.wrongChangeStatus(o.status).logWith(this._log);let a,s;switch(r&&(a=e===v.RelationshipChangeStatus.Revoked?await this.encryptRevokeContent(i,r):await this.encryptAcceptRejectContent(i,r)),e){case v.RelationshipChangeStatus.Accepted:s=(await this.client.acceptRelationshipChange(i.id.toString(),t.id.toString(),a)).value;break;case v.RelationshipChangeStatus.Rejected:s=(await this.client.rejectRelationshipChange(i.id.toString(),t.id.toString(),a)).value;break;case v.RelationshipChangeStatus.Revoked:s=(await this.client.revokeRelationshipChange(i.id.toString(),t.id.toString(),a)).value;break;default:throw new Error("target change status not supported")}const l=s.changes[s.changes.length-1];return o.response=await m.RelationshipChangeResponse.fromBackbone(s.changes[s.changes.length-1].response,r),o.status=l.status,i.status=s.status,await this.relationships.update(n,i),i}async encryptRevokeContent(e,t){const r=(await O.RelationshipCreationChangeResponseContent.from({relationshipId:e.id,content:t})).serialize(),n=a.CoreUtil.toBuffer(r),[i,o]=await Promise.all([this.parent.activeDevice.sign(n),this.secrets.sign(e.relationshipSecretId,n)]),s=await R.RelationshipCreationChangeResponseSigned.from({serializedResponse:r,deviceSignature:i,relationshipSignature:o}),c=await this.secrets.encryptRequest(e.relationshipSecretId,s);return(await T.RelationshipCreationChangeResponseCipher.from({cipher:c})).toBase64()}async encryptAcceptRejectContent(e,t){const r=await this.secrets.getPublicResponse(e.relationshipSecretId),n=(await O.RelationshipCreationChangeResponseContent.from({relationshipId:e.id,content:t})).serialize(),i=a.CoreUtil.toBuffer(n),[o,s]=await Promise.all([this.parent.activeDevice.sign(i),this.secrets.sign(e.relationshipSecretId,i)]),c=await R.RelationshipCreationChangeResponseSigned.from({serializedResponse:n,deviceSignature:o,relationshipSignature:s}),l=await this.secrets.encrypt(e.relationshipSecretId,c);return(await T.RelationshipCreationChangeResponseCipher.from({cipher:l,publicResponseCrypto:r})).toBase64()}}t.RelationshipsController=RelationshipsController},6164:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1903:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipClient=void 0;const n=r(6054);class RelationshipClient extends n.RESTClientAuthenticate{async createRelationship(e){return await this.post("/api/v1/Relationships",e)}async createRelationshipChange(e,t){return await this.post(`/api/v1/Relationships/${e}/Changes`,t)}async acceptRelationshipChange(e,t,r){return await this.put(`/api/v1/Relationships/${e}/Changes/${t}/Accept`,{content:r})}async rejectRelationshipChange(e,t,r){return await this.put(`/api/v1/Relationships/${e}/Changes/${t}/Reject`,{content:r})}async revokeRelationshipChange(e,t,r){return await this.put(`/api/v1/Relationships/${e}/Changes/${t}/Revoke`,{content:r})}async getRelationships(e){return await this.getPaged("/api/v1/Relationships",e)}async getRelationship(e){return await this.get(`/api/v1/Relationships/${e}`)}async getRelationshipChanges(e){return await this.getPaged("/api/v1/Relationships/Changes",e)}async getRelationshipChange(e){return await this.get(`/api/v1/Relationships/Changes/${e}`)}}t.RelationshipClient=RelationshipClient},169:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedRelationship=void 0;const a=r(194),s=r(2027),c=r(1752),l=r(3582);let u=n=class CachedRelationship extends s.CoreSerializableAsync{get creationChange(){return this.changes[0]}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.RelationshipTemplate)],u.prototype,"template",void 0),i([(0,a.validate)(),(0,a.serialize)({type:l.RelationshipChange}),o("design:type",Array)],u.prototype,"changes",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreDate)],u.prototype,"lastMessageSentAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CoreDate)],u.prototype,"lastMessageReceivedAt",void 0),u=n=i([(0,a.type)("CachedRelationship")],u),t.CachedRelationship=u},2182:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Relationship=void 0;const a=r(194),s=r(4714),c=r(2027),l=r(2016),u=r(5289),p=r(169);let d=n=class Relationship extends c.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,s.nameof)((e=>e.relationshipSecretId)),(0,s.nameof)((e=>e.peer)),(0,s.nameof)((e=>e.status))],this.metadataProperties=[(0,s.nameof)((e=>e.metadata)),(0,s.nameof)((e=>e.metadataModifiedAt))]}static async fromRequestSent(e,t,r,i,o){const a=await p.CachedRelationship.from({changes:[i],template:t});return await n.from({id:e,peer:r,status:u.RelationshipStatus.Pending,cache:a,cachedAt:c.CoreDate.utc(),relationshipSecretId:o})}static async fromCreationChangeReceived(e,t,r,i,o){const a=await p.CachedRelationship.from({changes:[i],template:t});return await n.from({id:c.CoreId.from(e.id),relationshipSecretId:o,peer:r,status:u.RelationshipStatus.Pending,cache:a,cachedAt:c.CoreDate.utc()})}toActive(e){if(!this.cache)throw c.TransportErrors.general.cacheEmpty(n,this.id.toString());this.cache.changes[0].response=e,this.status=u.RelationshipStatus.Active}toRejected(e){if(!this.cache)throw c.TransportErrors.general.cacheEmpty(n,this.id.toString());this.cache.changes[0].response=e,this.status=u.RelationshipStatus.Rejected}toRevoked(e){if(!this.cache)throw c.TransportErrors.general.cacheEmpty(n,this.id.toString());this.cache.changes[0].response=e,this.status=u.RelationshipStatus.Revoked}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}setCache(e){return this.cache=e,this.cachedAt=c.CoreDate.utc(),this}setMetadata(e){return this.metadata=e,this.metadataModifiedAt=c.CoreDate.utc(),this}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],d.prototype,"relationshipSecretId",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",l.Identity)],d.prototype,"peer",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],d.prototype,"status",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",p.CachedRelationship)],d.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],d.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],d.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",c.CoreDate)],d.prototype,"metadataModifiedAt",void 0),d=n=i([(0,a.type)("Relationship")],d),t.Relationship=d},8440:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendRelationshipParameters=void 0;const a=r(194),s=r(2027),c=r(1752);let l=n=class SendRelationshipParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],l.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.RelationshipTemplate)],l.prototype,"template",void 0),l=n=i([(0,a.type)("SendRelationshipParameters")],l),t.SendRelationshipParameters=l},5289:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipStatus=void 0,function(e){e.Pending="Pending",e.Active="Active",e.Rejected="Rejected",e.Revoked="Revoked",e.Terminating="Terminating",e.Terminated="Terminated"}(t.RelationshipStatus||(t.RelationshipStatus={}))},3582:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChange=void 0;const o=r(194),a=r(2027),s=r(9170),c=r(1512),l=r(3771);r(3611),r(6411);class RelationshipChange extends a.CoreSerializableAsync{static async fromBackbone(e,t,r){const n=await this.from({id:s.CoreId.from(e.id),relationshipId:s.CoreId.from(e.relationshipId),type:e.type,status:e.status,request:await c.RelationshipChangeRequest.fromBackbone(e.request,t)});return e.response&&(n.response=await l.RelationshipChangeResponse.fromBackbone(e.response,r)),n}static async from(e){return await super.fromT(e,RelationshipChange)}static async deserialize(e){return await super.deserializeT(e,RelationshipChange)}}n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],RelationshipChange.prototype,"id",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],RelationshipChange.prototype,"relationshipId",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",c.RelationshipChangeRequest)],RelationshipChange.prototype,"request",void 0),n([(0,o.validate)({nullable:!0}),(0,o.serialize)(),i("design:type",l.RelationshipChangeResponse)],RelationshipChange.prototype,"response",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",String)],RelationshipChange.prototype,"status",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",String)],RelationshipChange.prototype,"type",void 0),t.RelationshipChange=RelationshipChange},1512:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChangeRequest=void 0;const o=r(194),a=r(2027),s=r(9170);class RelationshipChangeRequest extends a.CoreSerializableAsync{static async fromBackbone(e,t){return await this.from({createdBy:a.CoreAddress.from(e.createdBy),createdByDevice:s.CoreId.from(e.createdByDevice),createdAt:a.CoreDate.from(e.createdAt),content:t})}static async from(e){return await super.fromT(e,RelationshipChangeRequest)}static async deserialize(e){return await super.deserializeT(e,RelationshipChangeRequest)}}n([(0,o.validate)(),(0,o.serialize)(),i("design:type",a.CoreAddress)],RelationshipChangeRequest.prototype,"createdBy",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],RelationshipChangeRequest.prototype,"createdByDevice",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",a.CoreDate)],RelationshipChangeRequest.prototype,"createdAt",void 0),n([(0,o.validate)({nullable:!0}),(0,o.serialize)(),i("design:type",o.SerializableAsync)],RelationshipChangeRequest.prototype,"content",void 0),t.RelationshipChangeRequest=RelationshipChangeRequest},3771:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChangeResponse=void 0;const o=r(194),a=r(2027),s=r(9170);class RelationshipChangeResponse extends a.CoreSerializableAsync{static async fromBackbone(e,t){return await this.from({createdBy:a.CoreAddress.from(e.createdBy),createdByDevice:s.CoreId.from(e.createdByDevice),createdAt:a.CoreDate.from(e.createdAt),content:t})}static async from(e){return await super.fromT(e,RelationshipChangeResponse)}static async deserialize(e){return await super.deserializeT(e,RelationshipChangeResponse)}}n([(0,o.validate)(),(0,o.serialize)(),i("design:type",a.CoreAddress)],RelationshipChangeResponse.prototype,"createdBy",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",s.CoreId)],RelationshipChangeResponse.prototype,"createdByDevice",void 0),n([(0,o.validate)(),(0,o.serialize)(),i("design:type",a.CoreDate)],RelationshipChangeResponse.prototype,"createdAt",void 0),n([(0,o.validate)({nullable:!0}),(0,o.serialize)(),i("design:type",o.SerializableAsync)],RelationshipChangeResponse.prototype,"content",void 0),t.RelationshipChangeResponse=RelationshipChangeResponse},3611:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChangeStatus=void 0,function(e){e.Pending="Pending",e.Rejected="Rejected",e.Revoked="Revoked",e.Accepted="Accepted"}(t.RelationshipChangeStatus||(t.RelationshipChangeStatus={}))},6411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipChangeType=void 0,function(e){e.Creation="Creation",e.Termination="Termination",e.TerminationCancellation="TerminationCancellation"}(t.RelationshipChangeType||(t.RelationshipChangeType={}))},5784:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeRequestCipher=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipCreationChangeRequestCipher extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async fromBase64(e){return await super.fromBase64T(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoCipher)],l.prototype,"cipher",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoRelationshipPublicRequest)],l.prototype,"publicRequestCrypto",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeRequestCipher")],l),t.RelationshipCreationChangeRequestCipher=l},3857:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeRequestContent=void 0;const a=r(194),s=r(2027),c=r(2016);let l=n=class RelationshipCreationChangeRequestContent extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.Identity)],l.prototype,"identity",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],l.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],l.prototype,"templateId",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeRequestContent")],l),t.RelationshipCreationChangeRequestContent=l},8174:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeRequestSigned=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipCreationChangeRequestSigned extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"serializedRequest",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"deviceSignature",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"relationshipSignature",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeRequestSigned")],l),t.RelationshipCreationChangeRequestSigned=l},3861:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeResponseCipher=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipCreationChangeResponseCipher extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async fromBase64(e){return await super.fromBase64T(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoCipher)],l.prototype,"cipher",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",s.CryptoRelationshipPublicResponse)],l.prototype,"publicResponseCrypto",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeResponseCipher")],l),t.RelationshipCreationChangeResponseCipher=l},334:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeResponseContent=void 0;const a=r(194),s=r(2027);let c=n=class RelationshipCreationChangeResponseContent extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],c.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"relationshipId",void 0),c=n=i([(0,a.type)("RelationshipCreationChangeResponseContent")],c),t.RelationshipCreationChangeResponseContent=c},7262:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RelationshipCreationChangeResponseSigned=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class RelationshipCreationChangeResponseSigned extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],l.prototype,"serializedResponse",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"deviceSignature",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSignature)],l.prototype,"relationshipSignature",void 0),l=n=i([(0,a.type)("RelationshipCreationChangeResponseSigned")],l),t.RelationshipCreationChangeResponseSigned=l},5739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SecretController=t.SecretBaseKeyType=void 0;const n=r(194),i=r(2890),o=r(2027),a=r(369),s=r(2508),c=r(2556),l=r(9423),u=r(7636);!function(e){e.Random="random",e.Password="password",e.External="external"}(t.SecretBaseKeyType||(t.SecretBaseKeyType={}));class SecretController extends s.TransportController{constructor(e,t=s.ControllerName.Secret){super(t,e),this.nonce=0}async init(){await super.init(),this.secrets=await this.parent.getSynchronizedCollection(a.DbCollectionName.Secrets);const e=await this.parent.info.get(SecretController.secretNonceKey);return e&&(this.nonce=e),this}async storeSecret(e,t,r="",n){const a=e.serialize(),s=i.CoreBuffer.fromUtf8(a),c=await this.increaseNonce(),u=await o.CoreCrypto.deriveKeyFromBase(await this.getBaseKey(),c,SecretController.secretContext),p=await o.CoreCrypto.encrypt(s,u),d=o.CoreDate.utc(),h={cipher:p,createdAt:d,name:t,description:r,id:await o.TransportIds.secret.generate(),nonce:c,validFrom:d,validTo:n,active:!0},g=await l.SecretContainerCipher.from(h);return this.log.trace(`Created secret id:${g.id} name:${g.name} on ${g.createdAt.toISOString()}.`),await this.secrets.create(g),g}async loadSecretsByName(e){const t=await this.secrets.find({name:e}),r=[];for(const e of t){const t=await l.SecretContainerCipher.from(e),n=await this.loadSecretById(t.id);n&&r.push(n)}return r}async loadActiveSecretByName(e){const t=await this.getActiveSecretContainerByName(e);if(!t)return;return await this.loadSecretById(t.id)}async getActiveSecretContainerByName(e){const t=await this.secrets.find({name:e,active:!0});if(!t.length)return;t.length>1&&this.log.warn(`More than one active secret has been found for secret name '${e}'.`);return await l.SecretContainerCipher.from(t[0])}async succeedSecretWithName(e,t,r="",n){const i=await this.secrets.findOne({name:t,active:!0});if(i){const e=await l.SecretContainerCipher.from(i);e.validTo=o.CoreDate.utc(),e.active=!1,await this.secrets.update(i,e)}return await this.storeSecret(e,t,r,n)}async decryptSecret(e){const t=await this.getBaseKey(),r=await o.CoreCrypto.deriveKeyFromBase(t,e.nonce?e.nonce:0,SecretController.secretContext),i=(await o.CoreCrypto.decrypt(e.cipher,r)).toUtf8(),a=await n.SerializableAsync.deserializeUnknown(i),s=await u.SecretContainerPlain.from({id:e.id,createdAt:e.createdAt,description:e.description,nonce:e.nonce,name:e.name,secret:a,active:e.active,validFrom:e.validFrom,validTo:e.validTo});return this.log.trace(`Accessed secret id:${s.id} name:${s.name} on ${o.CoreDate.utc().toISOString()}.`),s}async loadSecretById(e){const t=await this.secrets.findOne({id:e.toString()});if(!t)return;const r=await l.SecretContainerCipher.from(t);return await this.decryptSecret(r)}async deleteSecretById(e){const t=await this.secrets.findOne({id:e.toString()});return!!t&&(await this.secrets.delete({id:e}),this.log.trace(`Deleted secret id:${t.id} name:${t.name} on ${o.CoreDate.utc().toISOString()}.`),!0)}async createExchangeKey(e="",t="",r){const n=await o.CoreCrypto.generateExchangeKeypair(),i=await this.storeSecret(n,e,t,r);return[n.publicKey,i]}async getBaseKey(){if(this.baseKey)return this.baseKey;const e=await this.parent.activeDevice.secrets.loadSecret(c.DeviceSecretType.SharedSecretBaseKey);if(!e)throw o.TransportErrors.general.recordNotFound(i.CryptoSecretKey,c.DeviceSecretType.SharedSecretBaseKey).logWith(this._log);return this.baseKey=e.secret,this.baseKey}async increaseNonce(){const e=this.nonce++;return await this.parent.info.set(SecretController.secretNonceKey,e),e}}t.SecretController=SecretController,SecretController.secretContext="SECRET01",SecretController.secretNonceKey="secret_lastnonce"},9423:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SecretContainerCipher=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(6564),u=r(4062);let p=n=class SecretContainerCipher extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.name)),(0,c.nameof)((e=>e.description)),(0,c.nameof)((e=>e.createdAt)),(0,c.nameof)((e=>e.validFrom)),(0,c.nameof)((e=>e.validTo)),(0,c.nameof)((e=>e.nonce)),(0,c.nameof)((e=>e.active)),(0,c.nameof)((e=>e.cipher))],this.name="",this.description=""}static async from(e){return await super.fromT(e,n)}};i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],p.prototype,"name",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],p.prototype,"description",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",u.CoreDate)],p.prototype,"createdAt",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",u.CoreDate)],p.prototype,"validFrom",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",u.CoreDate)],p.prototype,"validTo",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",Number)],p.prototype,"nonce",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",Boolean)],p.prototype,"active",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CryptoCipher)],p.prototype,"cipher",void 0),p=n=i([(0,a.type)("SecretContainerCipher")],p),t.SecretContainerCipher=p},7636:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SecretContainerPlain=void 0;const a=r(194),s=r(2027);let c=n=class SecretContainerPlain extends s.CoreSerializableAsync{constructor(){super(...arguments),this.name="",this.description=""}static async from(e){return await super.fromT(e,n)}};i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CoreId)],c.prototype,"id",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],c.prototype,"name",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",String)],c.prototype,"description",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CoreDate)],c.prototype,"createdAt",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",s.CoreDate)],c.prototype,"validFrom",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",s.CoreDate)],c.prototype,"validTo",void 0),i([(0,a.serialize)(),(0,a.validate)({nullable:!0}),o("design:type",Number)],c.prototype,"nonce",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",Boolean)],c.prototype,"active",void 0),i([(0,a.serialize)(),(0,a.validate)(),o("design:type",a.SerializableAsync)],c.prototype,"secret",void 0),c=n=i([(0,a.type)("SecretContainerPlain")],c),t.SecretContainerPlain=c},9267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangedItems=void 0;t.ChangedItems=class ChangedItems{constructor(e=[],t=[]){this.relationships=e,this.messages=t}addRelationship(e){this.relationships.push(e)}addMessage(e){this.messages.push(e)}}},8189:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DatawalletModificationMapper=void 0;const n=r(2027),i=r(9750);t.DatawalletModificationMapper=class DatawalletModificationMapper{static async fromBackboneDatawalletModification(e,t,r){let o,a;switch(e.type){case"Create":o=i.DatawalletModificationType.Create;break;case"Update":o=i.DatawalletModificationType.Update;break;case"Delete":o=i.DatawalletModificationType.Delete;break;case"CacheChanged":o=i.DatawalletModificationType.CacheChanged;break;default:throw new Error("Unsupported DatawalletModificationType '${backboneDatawalletModification.type}'")}switch(e.payloadCategory){case"TechnicalData":a=i.DatawalletModificationCategory.TechnicalData;break;case"Userdata":a=i.DatawalletModificationCategory.Userdata;break;case"Metadata":a=i.DatawalletModificationCategory.Metadata;break;case null:a=void 0;break;default:throw new Error(`Unsupported DatawalletModificationCategory '${e.payloadCategory}'`)}return i.DatawalletModification.from({localId:await n.TransportIds.datawalletModification.generate(),objectIdentifier:n.CoreId.from(e.objectIdentifier),payloadCategory:a,collection:e.collection,type:o,payload:t,datawalletVersion:r})}static toCreateDatawalletModificationsRequestItem(e,t){var r;return{objectIdentifier:e.objectIdentifier.toString(),payloadCategory:e.payloadCategory,collection:e.collection,type:e.type,encryptedPayload:t,datawalletVersion:null!==(r=e.datawalletVersion)&&void 0!==r?r:0}}}},8222:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CacheFetcher=t.DatawalletModificationsProcessor=void 0;const i=n(r(6486)),o=r(2027),a=r(369),s=r(9873),c=r(6614),l=r(2182),u=r(1752),p=r(4102),d=r(9750);t.DatawalletModificationsProcessor=class DatawalletModificationsProcessor{constructor(e,t,r,n){var o,s,c,l;this.cacheFetcher=t,this.collectionProvider=r,this.logger=n,this.collectionsWithCacheableItems=[a.DbCollectionName.Files,a.DbCollectionName.Messages,a.DbCollectionName.Relationships,a.DbCollectionName.RelationshipTemplates,a.DbCollectionName.Tokens];const u=i.default.groupBy(e,(e=>e.type));this.creates=null!==(o=u[d.DatawalletModificationType.Create])&&void 0!==o?o:[],this.updates=null!==(s=u[d.DatawalletModificationType.Update])&&void 0!==s?s:[],this.deletes=null!==(c=u[d.DatawalletModificationType.Delete])&&void 0!==c?c:[],this.cacheChanges=null!==(l=u[d.DatawalletModificationType.CacheChanged])&&void 0!==l?l:[]}async execute(){await this.applyCreates(),await this.applyUpdates(),await this.applyCacheChanges(),await this.applyDeletes()}async applyCreates(){if(0===this.creates.length)return;const e=i.default.groupBy(this.creates,(e=>e.objectIdentifier));for(const t in e){const r=e[t],n=r[0].collection,i=await this.collectionProvider.getCollection(n);let a={id:t};for(const e of r)a={...a,...e.payload};const s=await o.CoreSerializableAsync.fromUnknown(a),c=await i.read(t);if(c){const e={...(await o.CoreSerializableAsync.fromUnknown(c)).toJSON(),...s.toJSON()};await i.update(c,e)}if(this.collectionsWithCacheableItems.includes(n)){const e=d.DatawalletModification.from({localId:await o.TransportIds.datawalletModification.generate(),type:d.DatawalletModificationType.CacheChanged,collection:n,objectIdentifier:o.CoreId.from(t)});this.cacheChanges.push(e)}await i.create(s)}}async applyUpdates(){if(0!==this.updates.length)for(const e of this.updates){const t=await this.collectionProvider.getCollection(e.collection),r=await t.read(e.objectIdentifier.toString());if(!r)throw new Error("Document to update was not found.");const n={...(await o.CoreSerializableAsync.fromUnknown(r)).toJSON(),...e.payload};await t.update(r,n)}}async applyCacheChanges(){if(0===this.cacheChanges.length)return;this.ensureAllItemsAreCacheable();const e=this.groupCacheChangesByCollection(this.cacheChanges),t=await this.cacheFetcher.fetchCacheFor({files:e.fileIds,messages:e.messageIds,relationshipTemplates:e.relationshipTemplateIds,tokens:e.tokenIds});await this.saveNewCaches(t.files,a.DbCollectionName.Files,s.File),await this.saveNewCaches(t.messages,a.DbCollectionName.Messages,c.Message),await this.saveNewCaches(t.relationshipTemplates,a.DbCollectionName.RelationshipTemplates,u.RelationshipTemplate),await this.saveNewCaches(t.tokens,a.DbCollectionName.Tokens,p.Token);const r=await this.cacheFetcher.fetchCacheFor({relationships:e.relationshipIds});await this.saveNewCaches(r.relationships,a.DbCollectionName.Relationships,l.Relationship)}ensureAllItemsAreCacheable(){const e=this.cacheChanges.map((e=>e.collection)),t=[...new Set(e)].filter((e=>!this.collectionsWithCacheableItems.includes(e)));if(t.length>0)throw o.TransportErrors.datawallet.unsupportedModification("unsupportedCacheChangedModificationCollection",t).logWith(this.logger)}groupCacheChangesByCollection(e){var t,r,n,o,s;const c=i.default.groupBy(e,(e=>e.collection)),l=(null!==(t=c[a.DbCollectionName.Files])&&void 0!==t?t:[]).map((e=>e.objectIdentifier)),u=(null!==(r=c[a.DbCollectionName.Messages])&&void 0!==r?r:[]).map((e=>e.objectIdentifier)),p=(null!==(n=c[a.DbCollectionName.Relationships])&&void 0!==n?n:[]).map((e=>e.objectIdentifier));return{fileIds:l,messageIds:u,relationshipTemplateIds:(null!==(o=c[a.DbCollectionName.RelationshipTemplates])&&void 0!==o?o:[]).map((e=>e.objectIdentifier)),tokenIds:(null!==(s=c[a.DbCollectionName.Tokens])&&void 0!==s?s:[]).map((e=>e.objectIdentifier)),relationshipIds:p}}async saveNewCaches(e,t,r){const n=await this.collectionProvider.getCollection(t);await Promise.all(e.map((async e=>{const t=await n.read(e.id.toString()),i=await o.CoreSerializableAsync.fromT(t,r);i.setCache(e.cache),await n.update(t,i)})))}async applyDeletes(){if(0!==this.deletes.length)for(const e of this.deletes){const t=await this.collectionProvider.getCollection(e.collection);await t.delete({id:e.objectIdentifier})}}};t.CacheFetcher=class CacheFetcher{constructor(e,t,r,n,i){this.fileController=e,this.messageController=t,this.relationshipTemplateController=r,this.relationshipController=n,this.tokenController=i}async fetchCacheFor(e){const t=await Promise.all([this.fetchCaches(this.fileController,e.files),this.fetchCaches(this.messageController,e.messages),this.fetchCaches(this.relationshipController,e.relationships),this.fetchCaches(this.relationshipTemplateController,e.relationshipTemplates),this.fetchCaches(this.tokenController,e.tokens)]);return{files:t[0],messages:t[1],relationships:t[2],relationshipTemplates:t[3],tokens:t[4]}}async fetchCaches(e,t){if(!t)return[];return await e.fetchCaches(t)}}},9761:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalEventsProcessor=void 0;const n=r(2027),i=r(9267);class ExternalEventsProcessor{constructor(e,t,r){this.messagesController=e,this.relationshipsController=t,this.externalEvents=r,this.changedItems=new i.ChangedItems,this.results=[],this.log=n.TransportLoggerFactory.getLogger(ExternalEventsProcessor)}async execute(){for(const e of this.externalEvents)try{switch(e.type){case"MessageReceived":await this.applyMessageReceivedEvent(e);break;case"MessageDelivered":await this.applyMessageDeliveredEvent(e);break;case"RelationshipChangeCreated":await this.applyRelationshipChangeCreatedEvent(e);break;case"RelationshipChangeCompleted":await this.applyRelationshipChangeCompletedEvent(e);break;default:throw new Error(`'${e.type}' is not a supported external event type.`)}this.results.push({externalEventId:e.id})}catch(t){let r;this.log.error("There was an error while trying to apply an external event: ",t),r=t.code?t.code:t.message?t.message:JSON.stringify(t),this.results.push({externalEventId:e.id,errorCode:r})}}async applyRelationshipChangeCompletedEvent(e){const t=e.payload,r=await this.relationshipsController.applyChangeById(t.changeId);r&&this.changedItems.addRelationship(r)}async applyRelationshipChangeCreatedEvent(e){const t=e.payload,r=await this.relationshipsController.applyChangeById(t.changeId);r&&this.changedItems.addRelationship(r)}async applyMessageDeliveredEvent(e){const t=e.payload,r=await this.messagesController.updateCache([t.id]);this.changedItems.addMessage(r[0])}async applyMessageReceivedEvent(e){const t=e.payload,r=await this.messagesController.loadPeerMessage(n.CoreId.from(t.id));this.changedItems.addMessage(r)}}t.ExternalEventsProcessor=ExternalEventsProcessor},1295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncController=void 0;const n=r(2027),i=r(5079),o=r(7596),a=r(9267),s=r(8189),c=r(8222),l=r(9761),u=r(9750),p=r(9258),d=r(2864);class SyncController extends n.TransportController{constructor(e,t,r,i){var a;super(n.ControllerName.Sync,e),this.unpushedDatawalletModifications=r,this.datawalletEnabled=i,this.client=null!==(a=t.syncClient)&&void 0!==a?a:new o.SyncClient(this.config,this.parent.authenticator),this.identityMigrations=new d.IdentityMigrations(this.parent),this.deviceMigrations=new p.DeviceMigrations(this.parent)}get cacheFetcher(){return this._cacheFetcher||(this._cacheFetcher=new c.CacheFetcher(this.parent.files,this.parent.messages,this.parent.relationshipTemplates,this.parent.relationships,this.parent.tokens)),this._cacheFetcher}async init(){return await super.init(),this.syncInfo=await this.db.getMap("SyncInfo"),this}async sync(e="Everything"){var t;if(null===(t=this.currentSync)||void 0===t?void 0:t.includes(e))return await this.currentSync.promise;if(this.currentSync&&!this.currentSync.includes(e))return await this.currentSync.promise,await this.sync(e);const r=this._sync(e);this.currentSync=new LocalSyncRun(r,e);try{return await this.currentSync.promise}finally{this.datawalletEnabled&&await this.unpushedDatawalletModifications.exists()&&await this.syncDatawallet().catch((e=>this.log.error(e))),this.currentSync=void 0}}async _sync(e){if("OnlyDatawallet"===e)return await this.syncDatawallet();const t=await this.syncExternalEvents();if(await this.setLastCompletedSyncTime(),t.externalEventResults.some((e=>void 0!==e.errorCode)))throw new n.CoreError("error.transport.errorWhileApplyingExternalEvents",t.externalEventResults.filter((e=>void 0!==e.errorCode)).map((e=>e.errorCode)).join(" | ")).logWith(this.log);return t.changedItems}async syncExternalEvents(){if(!await this.startExternalEventsSyncRun())return await this.syncDatawallet(),{changedItems:new a.ChangedItems,externalEventResults:[]};await this.applyIncomingDatawalletModifications();const e=await this.applyIncomingExternalEvents();return await this.finalizeExternalEventsSyncRun(e.externalEventResults),e}async syncDatawallet(){if(!this.datawalletEnabled)return;const e=await this.getIdentityDatawalletVersion();if(this.config.supportedDatawalletVersion<e)throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion,e).logWith(this.log);this.log.trace("Synchronization of Datawallet events started...");try{await this.applyIncomingDatawalletModifications(),await this.pushLocalDatawalletModifications(),await this.setLastCompletedDatawalletSyncTime()}catch(t){const r="error.platform.validation.datawallet.insufficientSupportedDatawalletVersion";if(!(t instanceof n.RequestError)||t.code!==r)throw t;throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion,e).logWith(this.log)}this.log.trace("Synchronization of Datawallet events ended..."),await this.checkDatawalletVersion(e)}async checkDatawalletVersion(e){var t;if(this.config.supportedDatawalletVersion<e)throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(this.config.supportedDatawalletVersion,e).logWith(this.log);this.config.supportedDatawalletVersion>e&&await this.upgradeIdentityDatawalletVersion(e,this.config.supportedDatawalletVersion);const r=null!==(t=this.parent.activeDevice.device.datawalletVersion)&&void 0!==t?t:0;r<e&&await this.upgradeDeviceDatawalletVersion(r,this.config.supportedDatawalletVersion)}async upgradeIdentityDatawalletVersion(e,t){if(e!==t){if(this.config.supportedDatawalletVersion<t)throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(t,e).logWith(this.log);if(e>t)throw n.TransportErrors.datawallet.currentBiggerThanTarget(e,t).logWith(this.log);for(;e<t;){e++,await this.startDatawalletVersionUpgradeSyncRun();const t=this.identityMigrations[`v${e}`];if(!t)throw n.TransportErrors.datawallet.noMigrationAvailable(e).logWith(this.log);await t.call(this.identityMigrations),await this.finalizeDatawalletVersionUpgradeSyncRun(e)}}}async upgradeDeviceDatawalletVersion(e,t){if(e!==t){if(this.config.supportedDatawalletVersion<t)throw n.TransportErrors.datawallet.insufficientSupportedDatawalletVersion(t,e).logWith(this.log);if(e>t)throw n.TransportErrors.datawallet.currentBiggerThanTarget(e,t).logWith(this.log);for(;e<t;){e++;const t=this.deviceMigrations[`v${e}`];if(!t)throw n.TransportErrors.datawallet.noMigrationAvailable(e).logWith(this.log);await t.call(this.deviceMigrations),await this.parent.activeDevice.update({datawalletVersion:e})}}}async applyIncomingDatawalletModifications(){const e=await this.client.getDatawalletModifications({localIndex:await this.getLocalDatawalletModificationIndex()}),t=await e.value.collect();if(0===t.length)return;const r=await this.decryptDatawalletModifications(t);this.log.trace(`${r.length} incoming modifications found`);const i=new c.DatawalletModificationsProcessor(r,this.cacheFetcher,this._db,n.TransportLoggerFactory.getLogger(c.DatawalletModificationsProcessor));await i.execute(),this.log.trace(`${r.length} incoming modifications executed`,r),await this.updateLocalDatawalletModificationIndex(t.sort(descending)[0].index)}async decryptDatawalletModifications(e){const t=[];for(const r of e){const e=await this.parent.activeDevice.secrets.decryptDatawalletModificationPayload(r.encryptedPayload,r.index),n=await s.DatawalletModificationMapper.fromBackboneDatawalletModification(r,e,this.config.supportedDatawalletVersion);t.push(n)}return t}async pushLocalDatawalletModifications(){const{backboneModifications:e,localModificationIds:t}=await this.prepareLocalDatawalletModificationsForPush();if(0===e.length)return;const r=await this.client.createDatawalletModifications({localIndex:await this.getLocalDatawalletModificationIndex(),modifications:e});await this.deleteUnpushedDatawalletModifications(t),await this.updateLocalDatawalletModificationIndex(r.value.newIndex)}async prepareLocalDatawalletModificationsForPush(){const e=[],t=[];if(!this.datawalletEnabled)return{backboneModifications:e,localModificationIds:t};const r=await this.parseArray(await this.unpushedDatawalletModifications.list(),u.DatawalletModification),n=await this.getLocalDatawalletModificationIndex();let i="number"!=typeof n?0:n+1;for(const n of r){const r=await this.parent.activeDevice.secrets.encryptDatawalletModificationPayload(n,i++),o=s.DatawalletModificationMapper.toCreateDatawalletModificationsRequestItem(n,r);t.push(n.localId),e.push(o)}return{backboneModifications:e,localModificationIds:t}}async deleteUnpushedDatawalletModifications(e){for(const t of e)await this.unpushedDatawalletModifications.delete({localId:t.toString()})}async setInititalDatawalletVersion(e){await this.startDatawalletVersionUpgradeSyncRun(),await this.finalizeDatawalletVersionUpgradeSyncRun(e)}async getIdentityDatawalletVersion(){return(await this.client.getDatawallet()).value.version}async startExternalEventsSyncRun(){var e;const t=await this.client.startSyncRun({type:i.SyncRunType.ExternalEventSync});return t.value.status!==i.StartSyncRunStatus.NoNewEvents&&(this.currentSyncRun=null!==(e=t.value.syncRun)&&void 0!==e?e:void 0,void 0!==this.currentSyncRun)}async startDatawalletVersionUpgradeSyncRun(){var e;const t=await this.client.startSyncRun({type:i.SyncRunType.DatawalletVersionUpgrade});return this.currentSyncRun=null!==(e=t.value.syncRun)&&void 0!==e?e:void 0,void 0!==this.currentSyncRun}async applyIncomingExternalEvents(){const e=await this.client.getExternalEventsOfSyncRun(this.currentSyncRun.id.toString());if(e.isError)throw e.error;const t=await e.value.collect(),r=new l.ExternalEventsProcessor(this.parent.messages,this.parent.relationships,t);return await r.execute(),{externalEventResults:r.results,changedItems:r.changedItems}}async finalizeExternalEventsSyncRun(e){if(!this.currentSyncRun)throw new Error("There is no active sync run to finalize");const{backboneModifications:t,localModificationIds:r}=await this.prepareLocalDatawalletModificationsForPush();await this.client.finalizeExternalEventSync(this.currentSyncRun.id.toString(),{datawalletModifications:t,externalEventResults:e}),await this.deleteUnpushedDatawalletModifications(r);const n=(await this.getLocalDatawalletModificationIndex()||-1)+t.length;await this.updateLocalDatawalletModificationIndex(n),this.currentSyncRun=void 0}async finalizeDatawalletVersionUpgradeSyncRun(e){if(!this.currentSyncRun)throw new Error("There is no active sync run to finalize");const{backboneModifications:t,localModificationIds:r}=await this.prepareLocalDatawalletModificationsForPush();await this.client.finalizeDatawalletVersionUpgrade(this.currentSyncRun.id.toString(),{newDatawalletVersion:e,datawalletModifications:t}),await this.deleteUnpushedDatawalletModifications(r);const n=(await this.getLocalDatawalletModificationIndex()||-1)+t.length;await this.updateLocalDatawalletModificationIndex(n),this.currentSyncRun=void 0}async getLocalDatawalletModificationIndex(){return await this.syncInfo.get("localDatawalletModificationIndex")}async updateLocalDatawalletModificationIndex(e){await this.syncInfo.set("localDatawalletModificationIndex",e)}async getSyncTimeByName(e){const t=await this.syncInfo.get(`SyncTime-${e}`);return t?n.CoreDate.from(t):void 0}async setSyncTimeByName(e){const t=n.CoreDate.utc().toISOString();await this.syncInfo.set(`SyncTime-${e}`,t)}async getLastCompletedSyncTime(){return await this.getSyncTimeByName("Everything")}async getLastCompletedDatawalletSyncTime(){return await this.getSyncTimeByName("Datawallet")}async setLastCompletedSyncTime(){await this.setSyncTimeByName("Everything")}async setLastCompletedDatawalletSyncTime(){await this.setSyncTimeByName("Datawallet")}}function descending(e,t){return t.index-e.index}t.SyncController=SyncController;class LocalSyncRun{constructor(e,t){this.promise=e,this.whatToSync=t}includes(e){return"Everything"===this.whatToSync||"OnlyDatawallet"===e}}},26:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SynchronizedCollection=void 0;const i=n(r(4901)),o=n(r(6486)),a=r(4714),s=r(2970),c=r(8169),l=r(9750);t.SynchronizedCollection=class SynchronizedCollection{constructor(e,t,r){this.parent=e,this.datawalletVersion=t,this.datawalletModifications=r,this.name=e.name,this.databaseType=e.databaseType}async create(e){const t=e.toJSON();if(!this.datawalletModifications)return await this.parent.create(e);const r=o.default.pickBy(t,((t,r)=>void 0!==t&&e.technicalProperties.includes(r))),n=o.default.pickBy(t,((t,r)=>void 0!==t&&e.metadataProperties.includes(r))),i=o.default.pickBy(t,((t,r)=>void 0!==t&&e.userdataProperties.includes(r))),a=e.id;0!==Object.getOwnPropertyNames(r).length&&await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Create,collection:this.name,objectIdentifier:a,payloadCategory:l.DatawalletModificationCategory.TechnicalData,payload:r,datawalletVersion:this.datawalletVersion})),0!==Object.getOwnPropertyNames(n).length&&await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Create,collection:this.name,objectIdentifier:a,payloadCategory:l.DatawalletModificationCategory.Metadata,payload:n,datawalletVersion:this.datawalletVersion})),0!==Object.getOwnPropertyNames(i).length&&await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Create,collection:this.name,objectIdentifier:a,payloadCategory:l.DatawalletModificationCategory.Userdata,payload:i,datawalletVersion:this.datawalletVersion})),await this.parent.create(e)}async read(e){return await this.parent.read(e)}async update(e,t){const r=await s.CoreSerializableAsync.fromUnknown(e),n=t.toJSON();if(!this.datawalletModifications)return await this.parent.update(e,t);const u=i.default.compare(r.toJSON(),n),p=[];for(const e of u){const t=e.path.split("/").find((e=>e));p.push(t)}const d=0!==o.default.intersection(t.technicalProperties,p).length,h=0!==o.default.intersection(t.metadataProperties,p).length,g=0!==o.default.intersection(t.userdataProperties,p).length,y=p.some((e=>e===(0,a.nameof)((e=>e.cache)))),m=t.id;if(d){const e=o.default.pick(n,t.technicalProperties);await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Update,collection:this.name,objectIdentifier:m,payloadCategory:l.DatawalletModificationCategory.TechnicalData,payload:e,datawalletVersion:this.datawalletVersion}))}if(h){const e=o.default.pick(n,t.metadataProperties);await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Update,collection:this.name,objectIdentifier:m,payloadCategory:l.DatawalletModificationCategory.Metadata,payload:e,datawalletVersion:this.datawalletVersion}))}if(g){const e=o.default.pick(n,t.userdataProperties);await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Update,collection:this.name,objectIdentifier:m,payloadCategory:l.DatawalletModificationCategory.Userdata,payload:e,datawalletVersion:this.datawalletVersion}))}return y&&await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.CacheChanged,collection:this.name,objectIdentifier:m,datawalletVersion:this.datawalletVersion})),await this.parent.update(e,t)}async delete(e){return this.datawalletModifications?(await this.datawalletModifications.create(l.DatawalletModification.from({localId:await c.TransportIds.datawalletModification.generate(),type:l.DatawalletModificationType.Delete,collection:this.name,objectIdentifier:e.id,datawalletVersion:this.datawalletVersion})),await this.parent.delete({id:e.id.toString()})):await this.parent.delete({id:e.id.toString()})}async list(){return await this.parent.list()}async find(e){return await this.parent.find(e)}async count(e){return await this.parent.count(e)}async exists(e){return await this.parent.exists(e)}async findOne(e){return await this.parent.findOne(e)}}},6890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3670:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8571:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1541:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7224:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StartSyncRunStatus=t.SyncRunType=void 0,function(e){e.ExternalEventSync="ExternalEventSync",e.DatawalletVersionUpgrade="DatawalletVersionUpgrade"}(t.SyncRunType||(t.SyncRunType={})),function(e){e.Created="Created",e.NoNewEvents="NoNewEvents"}(t.StartSyncRunStatus||(t.StartSyncRunStatus={}))},7596:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncClient=void 0;const n=r(2027);class SyncClient extends n.RESTClientAuthenticate{constructor(e,t){super(e,t,{headers:{"x-supported-datawallet-version":e.supportedDatawalletVersion.toString()}})}async startSyncRun(e){return await this.post("/api/v1/SyncRuns",e)}async finalizeExternalEventSync(e,t){return await this.put(`/api/v1/SyncRuns/${e}/FinalizeExternalEventSync`,t)}async finalizeDatawalletVersionUpgrade(e,t){return await this.put(`/api/v1/SyncRuns/${e}/FinalizeDatawalletVersionUpgrade`,t)}async getExternalEventsOfSyncRun(e){return await this.getPaged(`/api/v1/SyncRuns/${e}/ExternalEvents`,{})}async getDatawallet(){return await this.get("/api/v1/Datawallet")}async getDatawalletModifications(e){return await this.getPaged("/api/v1/Datawallet/Modifications",e)}async createDatawalletModifications(e){return await this.post("/api/v1/Datawallet/Modifications",e)}}t.SyncClient=SyncClient},9750:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DatawalletModification=t.DatawalletModificationCategory=t.DatawalletModificationType=void 0;const a=r(194),s=r(2027);!function(e){e.Create="Create",e.Update="Update",e.Delete="Delete",e.CacheChanged="CacheChanged"}(t.DatawalletModificationType||(t.DatawalletModificationType={})),function(e){e.TechnicalData="TechnicalData",e.Userdata="Userdata",e.Metadata="Metadata"}(t.DatawalletModificationCategory||(t.DatawalletModificationCategory={}));let c=n=class DatawalletModification extends s.CoreSerializable{static from(e){return super.fromT(e,n)}static deserialize(e){return super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"localId",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"objectIdentifier",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",String)],c.prototype,"payloadCategory",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"collection",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",String)],c.prototype,"type",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],c.prototype,"payload",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Number)],c.prototype,"datawalletVersion",void 0),c=n=i([(0,a.type)("DatawalletModification")],c),t.DatawalletModification=c},9258:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceMigrations=void 0;t.DeviceMigrations=class DeviceMigrations{constructor(e){this.accountController=e}async v1(){const e={cache:{$exists:!1}},synchronizableToId=e=>e.id.toString(),t=await this.accountController.files.getFiles(e);await this.accountController.files.updateCache(t.map(synchronizableToId));const r=await this.accountController.messages.getMessages(e);await this.accountController.messages.updateCache(r.map(synchronizableToId));const n=await this.accountController.relationships.getRelationships(e);await this.accountController.relationships.updateCache(n.map(synchronizableToId));const i=await this.accountController.relationshipTemplates.getRelationshipTemplates(e);await this.accountController.relationshipTemplates.updateCache(i.map(synchronizableToId));const o=await this.accountController.tokens.getTokens(e);await this.accountController.tokens.updateCache(o.map(synchronizableToId))}}},2864:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityMigrations=void 0;t.IdentityMigrations=class IdentityMigrations{constructor(e){this.accountController=e}v1(){return Promise.resolve()}}},8697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousTokenController=void 0;const n=r(194),i=r(2890),o=r(2027),a=r(2069),s=r(8342),c=r(4102),l=r(7776);t.AnonymousTokenController=class AnonymousTokenController{constructor(e){this.client=new a.AnonymousTokenClient(e)}async loadPeerTokenByTruncated(e){const t=await l.TokenReference.fromTruncated(e);return await this.loadPeerTokenByReference(t)}async loadPeerTokenByReference(e){return await this.loadPeerToken(e.id,e.key)}async loadPeerToken(e,t){const r=(await this.client.getToken(e.toString())).value,a=await i.CryptoCipher.fromBase64(r.content),l=await o.CoreCrypto.decrypt(a,t),u=await o.CoreSerializableAsync.deserializeUnknown(l.toUtf8());if(!(u instanceof n.SerializableAsync))throw o.TransportErrors.tokens.invalidTokenContent(e.toString());const p=await c.Token.from({id:e,secretKey:t,isOwn:!1}),d=await s.CachedToken.from({createdAt:o.CoreDate.from(r.createdAt),expiresAt:o.CoreDate.from(r.expiresAt),createdBy:o.CoreAddress.from(r.createdBy),createdByDevice:o.CoreId.from(r.createdByDevice),content:u});return p.setCache(d),p}}},4503:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenController=void 0;const n=r(194),i=r(2890),o=r(2027),a=r(369),s=r(2508),c=r(6591),l=r(8342),u=r(5898),p=r(4102),d=r(7776);class TokenController extends s.TransportController{constructor(e){super(s.ControllerName.Token,e)}async init(){return await super.init(),this.client=new c.TokenClient(this.config,this.parent.authenticator),this.tokens=await this.parent.getSynchronizedCollection(a.DbCollectionName.Tokens),this}async getTokens(e){const t=await this.tokens.find(e);return await this.parseArray(t,p.Token)}async sendToken(e){const t=await u.SendTokenParameters.from(e),r=await o.CoreCrypto.generateSecretKey(),n=t.content.serialize(),a=i.CoreBuffer.fromUtf8(n),s=await o.CoreCrypto.encrypt(a,r),c=(await this.client.createToken({content:s.toBase64(),expiresAt:t.expiresAt.toString()})).value,d=await l.CachedToken.from({createdAt:o.CoreDate.from(c.createdAt),expiresAt:t.expiresAt,createdBy:this.parent.identity.address,createdByDevice:this.parent.activeDevice.id,content:t.content}),h=await p.Token.from({id:o.CoreId.from(c.id),secretKey:r,isOwn:!0,cache:d,cachedAt:o.CoreDate.utc()});return t.ephemeral||await this.tokens.create(h),h}async setTokenMetadata(e,t){const r=e instanceof o.CoreId?e.toString():e.id.toString(),n=await this.tokens.read(r);if(!n)throw o.TransportErrors.general.recordNotFound(p.Token,r.toString()).logWith(this._log);const i=await p.Token.from(n);return i.setMetadata(t),await this.tokens.update(n,i),i}async getToken(e){const t=await this.tokens.read(e.toString());return t?await p.Token.from(t):void 0}async updateCache(e){if(e.length<1)return[];const t=[];for(const r of e){const e=await this.client.getToken(r);if(e.isError){if("error.transport.recordNotFound"===e.error.code||"error.transport.request.notFound"===e.error.code||"error.platform.recordNotFound"===e.error.code){this.log.warn(`Record id ${r} could not be found on backbone. It might be expired.`,e.error);continue}throw e.error}const n=e.value;t.push(this.updateCacheOfExistingTokenInDb(n.id,n))}return(await Promise.all(t)).filter((e=>!!e))}async fetchCaches(e){if(0===e.length)return[];const t=(await(await this.client.getTokens({ids:e.map((e=>e.id))})).value.collect()).map((async e=>{const t=await this.tokens.read(e.id),r=await p.Token.from(t);return{id:o.CoreId.from(e),cache:await this.decryptToken(e,r.secretKey)}}));return await Promise.all(t)}async updateCacheOfExistingTokenInDb(e,t){const r=await this.tokens.read(e);if(!r)return void o.TransportErrors.general.recordNotFound(p.Token,e).logWith(this._log);const n=await p.Token.from(r);return await this.updateCacheOfToken(n,t),await this.tokens.update(r,n),n}async updateCacheOfToken(e,t){const r=e.id.toString();t||(t=(await this.client.getToken(r)).value);const n=await this.decryptToken(t,e.secretKey);e.setCache(n),e.isOwn=this.parent.identity.isMe(n.createdBy)}async decryptToken(e,t){const r=await i.CryptoCipher.fromBase64(e.content),a=await o.CoreCrypto.decrypt(r,t),s=await o.CoreSerializableAsync.deserializeUnknown(a.toUtf8());if(!(s instanceof n.SerializableAsync))throw o.TransportErrors.tokens.invalidTokenContent(e.id).logWith(this._log);return await l.CachedToken.from({createdAt:o.CoreDate.from(e.createdAt),expiresAt:o.CoreDate.from(e.expiresAt),createdBy:o.CoreAddress.from(e.createdBy),createdByDevice:o.CoreId.from(e.createdByDevice),content:s})}async loadPeerTokenByTruncated(e,t){const r=await d.TokenReference.fromTruncated(e);return await this.loadPeerTokenByReference(r,t)}async loadPeerTokenByReference(e,t){return await this.loadPeerToken(e.id,e.key,t)}async loadPeerToken(e,t,r){const n=await this.tokens.read(e.toString());if(n){let t=await p.Token.from(n);if(t.cache)return t;if(t=await this.updateCacheOfExistingTokenInDb(e.toString()),!t)throw new Error(`Tried to update a token (with ID: '${e.toString()}') that doesn't exist in the local database.`);return t}const i=await p.Token.from({id:e,secretKey:t,isOwn:!1});return await this.updateCacheOfToken(i),r||await this.tokens.create(i),i}}t.TokenController=TokenController},2069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousTokenClient=void 0;const n=r(2027);class AnonymousTokenClient extends n.RESTClient{async getToken(e){return await this.get(`/api/v1/Tokens/${e}`)}}t.AnonymousTokenClient=AnonymousTokenClient},7653:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenClient=void 0;const n=r(6054);class TokenClient extends n.RESTClientAuthenticate{async createToken(e){return await this.post("/api/v1/Tokens",e)}async getTokens(e){return await this.getPaged("/api/v1/Tokens",e)}async getToken(e){return await this.get(`/api/v1/Tokens/${e}`)}async deleteToken(e){return await this.delete(`/api/v1/Tokens/${e}`)}}t.TokenClient=TokenClient},8342:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CachedToken=void 0;const a=r(194),s=r(2027);let c=n=class CachedToken extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreAddress)],c.prototype,"createdBy",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],c.prototype,"createdAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],c.prototype,"expiresAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],c.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreId)],c.prototype,"createdByDevice",void 0),c=n=i([(0,a.type)("CachedToken")],c),t.CachedToken=c},5898:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendTokenParameters=void 0;const a=r(194),s=r(2027);let c=n=class SendTokenParameters extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",a.SerializableAsync)],c.prototype,"content",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CoreDate)],c.prototype,"expiresAt",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],c.prototype,"ephemeral",void 0),c=n=i([(0,a.type)("SendTokenParameters")],c),t.SendTokenParameters=c},4102:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Token=void 0;const a=r(194),s=r(2890),c=r(4714),l=r(2027),u=r(7776),p=r(8342);let d=n=class Token extends l.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.secretKey)),(0,c.nameof)((e=>e.isOwn))],this.metadataProperties=[(0,c.nameof)((e=>e.metadata)),(0,c.nameof)((e=>e.metadataModifiedAt))]}static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}async toTokenReference(){return await u.TokenReference.from({id:this.id,key:this.secretKey})}async truncate(){return(await this.toTokenReference()).truncate()}setCache(e){return this.cache=e,this.cachedAt=l.CoreDate.utc(),this}setMetadata(e){this.metadata=e,this.metadataModifiedAt=l.CoreDate.utc()}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],d.prototype,"secretKey",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",Boolean)],d.prototype,"isOwn",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",p.CachedToken)],d.prototype,"cache",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],d.prototype,"cachedAt",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",Object)],d.prototype,"metadata",void 0),i([(0,a.validate)({nullable:!0}),(0,a.serialize)(),o("design:type",l.CoreDate)],d.prototype,"metadataModifiedAt",void 0),d=n=i([(0,a.type)("Token")],d),t.Token=d},5083:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenContentDeviceSharedSecret=void 0;const a=r(194),s=r(2027),c=r(6758);let l=n=class TokenContentDeviceSharedSecret extends s.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.DeviceSharedSecret)],l.prototype,"sharedSecret",void 0),l=n=i([(0,a.type)("TokenContentDeviceSharedSecret")],l),t.TokenContentDeviceSharedSecret=l},2238:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenContentFile=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class TokenContentFile extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"fileId",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"secretKey",void 0),l=n=i([(0,a.type)("TokenContentFile")],l),t.TokenContentFile=l},1488:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenContentRelationshipTemplate=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class TokenContentRelationshipTemplate extends c.CoreSerializableAsync{static async from(e){return await super.fromT(e,n)}static async deserialize(e){return await super.deserializeT(e,n)}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"templateId",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"secretKey",void 0),l=n=i([(0,a.type)("TokenContentRelationshipTemplate")],l),t.TokenContentRelationshipTemplate=l},7776:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenReference=void 0;const a=r(194),s=r(2890),c=r(2027);let l=n=class TokenReference extends c.CoreSerializableAsync{truncate(){return s.CoreBuffer.fromUtf8(`${this.id.toString()}|${this.key.algorithm}|${this.key.secretKey.toBase64URL()}`).toBase64URL()}static async fromTruncated(e){const t=s.CoreBuffer.fromBase64URL(e).toUtf8().split("|");if(3!==t.length)throw c.TransportErrors.tokens.invalidTruncatedReference();try{const e=c.CoreId.from(t[0]),r=parseInt(t[1]),i=t[2],o=await s.CryptoSecretKey.from({algorithm:r,secretKey:s.CoreBuffer.fromBase64URL(i)});return await n.from({id:e,key:o})}catch(e){throw c.TransportErrors.tokens.invalidTruncatedReference()}}static async from(e){return await super.fromT(e,n)}static async deserialize(e){try{return await super.deserializeT(e,n)}catch(t){return await this.from(e)}}};i([(0,a.validate)(),(0,a.serialize)(),o("design:type",c.CoreId)],l.prototype,"id",void 0),i([(0,a.validate)(),(0,a.serialize)(),o("design:type",s.CryptoSecretKey)],l.prototype,"key",void 0),l=n=i([(0,a.type)("TokenReference")],l),t.TokenReference=l},1577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordGenerator=void 0;const n=r(18),i=r(5833),o=i.RandomCharacterRange.AlphanumericEase+i.RandomCharacterRange.SpecialCharacters;class PasswordGenerator{static async createPassword(e,t=0,r=o){return t<=0&&(t=e),await i.Random.stringRandomLength(e,t,r)}static async createStrongPassword(e=8,t=12){if(e>t&&(t=e),e<8)throw n.TransportErrors.util.passwordMinLengthTooShort();const r={minLength:1,maxLength:1,allowedChars:i.RandomCharacterRange.SpecialCharacters},a={minLength:1,maxLength:1,allowedChars:i.RandomCharacterRange.LowerCaseEase},s={minLength:1,maxLength:1,allowedChars:i.RandomCharacterRange.UpperCaseEase},c={minLength:e-4,maxLength:t-4,allowedChars:o},l=await i.Random.stringWithBuckets([r,a,s,{minLength:1,maxLength:1,allowedChars:"123456789"},c]);return await i.Random.scramble(l)}static async createUnitPassword(){return`${await i.Random.stringWithBuckets([{minLength:1,maxLength:1,allowedChars:"123456789"},{minLength:0,maxLength:2,allowedChars:"0123456789"},{minLength:0,maxLength:1,allowedChars:","},{minLength:0,maxLength:1,allowedChars:"0123456789"},{minLength:1,maxLength:1,allowedChars:"123456789"}])} ${await this.createPassword(1,0,this.unitsGerman)}`}static async createElementPassword(){return`${await this.createPassword(1,0,this.elementsGerman)} ${await this.createPassword(1,0,i.RandomCharacterRange.Digit)}`}}t.PasswordGenerator=PasswordGenerator,PasswordGenerator.elementsGerman=["Wasserstoff","Helium","Lithium","Beryllium","Bor","Kohlenstoff","Stickstoff","Sauerstoff","Fluor","Neon","Natrium","Magnesium","Aluminium","Silicium","Phosphor","Schwefel","Chlor","Argon","Kalium","Calcium","Scandium","Titan","Vanadium","Chrom","Mangan","Eisen","Cobalt","Nickel","Kupfer","Zink"],PasswordGenerator.unitsGerman=["Kelvin","Mol","Candela","Mikrosekunden","Nanosekunden","Millisekunden","Sekunden","Minuten","Stunden","Tage","Wochen","Monate","Jahre","Seemeilen","Astronomische Einheiten","Parsecs","Lichtjahre","Millimeter","Zentimeter","Meter","Kilometer","Quadratmeter","Ar","Hektar","Milliliter","Zentiliter","Liter","Kubikmeter","Barrel","Gramm","Kilogramm","Tonnen","Pfund","Zentner","Knoten","Newton","Pascal","Bar","Joule","Kilojoule","Megajoule","Wattstunden","Kilowattstunden","Megawattstunden","Kalorien","Kilokalorien","Elektronenvolt","Watt","Kilowatt","Megawatt","Voltampere","Ampere","Milliampere","Ohm","Siemens","Coulomb","Amperestunde","Milliamperestunde","Farad","Kelvin","Grad Celsius","Lumen","Lux","Bit","Byte","Kilobyte","Megabyte","Gigabyte","Terabyte","Etabyte"]},5833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Random=t.RandomCharacterRange=void 0;const n=r(2890),i=r(1614),o=r(18);var a;!function(e){e.Digit="0123456789",e.DigitEase="123456789",e.Hex="0123456789ABCDEF",e.LowerCase="abcdefghijklmnopqrstuvwxyz",e.LowerCaseEase="abcdefghijkmnpqrstuvwxyz",e.UpperCase="ABCDEFGHIJKLMNOPQRSTUVWXYZ",e.UpperCaseEase="ABCDEFGHJKLMNPQRSTUVWXYZ",e.Alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",e.Alphanumeric="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e.AlphanumericEase="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz123456789",e.AlphanumericUpperCaseEase="ABCDEFGHJKLMNPQRSTUVWXYZ0123456789",e.GermanUmlaut="ÄÖÜäöü",e.SpecialCharacters="!?-_.:,;#+"}(a=t.RandomCharacterRange||(t.RandomCharacterRange={}));class Random{static async bytes(e){return await n.CryptoRandom.bytes(e)}static async int(e){if(e>21||e<=0)throw o.TransportErrors.util.random.intLength();return parseInt(await this.string(e,a.Digit))}static async array(e){return(await n.CryptoRandom.bytes(e)).toArray()}static uuid(){return(0,i.v4)()}static async scramble(e){const t=[],r=e.split(""),n=e.length;for(let e=0;e<n-1;e++){const i=await Random.intBetween(0,n-1-e);t.push(r.splice(i,1)[0])}return t.push(r[0]),t.join("")}static async intBetween(e,t){if(t<=e)throw o.TransportErrors.util.random.mnBiggerThatMax();const r=t-e+1,n=Math.abs(Math.ceil(Math.log2(r)));if(n>32)throw o.TransportErrors.util.random.rangeTooBig();const i=Math.ceil(n/8),a=Math.pow(2,n)-1,s=await this.bytes(i);let c=0,l=8*(i-1);for(let e=0;e<i;e++)c+=s.buffer[e]*Math.pow(2,l),l-=8;return c&=a,c>=r?await this.intBetween(e,t):e+c}static async intRandomLength(e,t){return t>21&&o.TransportErrors.util.random.maxTooHigh(),parseInt(await this.stringRandomLength(e,t,a.Digit))}static async scrambleWithBuckets(e){const t=await this.stringWithBuckets(e);return await this.scramble(t)}static async stringWithBuckets(e){const t=[];for(const r of e)t.push(await this.stringRandomLength(r.minLength,r.maxLength,r.allowedChars));return t.join("")}static async string(e,t=a.Alphanumeric){if(e<=0)return"";if(t.length>256)throw o.TransportErrors.util.random.inputTooLong();const r=[],n=t.length,i=await this.array(e+10),s=255-255%n;for(let o=0;o<e;o++){const e=i[o];e>s||r.push(t[e%n])}let c=r.join("");return c.length<e&&(c+=await this.string(e-c.length,t)),c}static async stringRandomLength(e,t,r){if(e>t)throw o.TransportErrors.util.random.mnBiggerThatMax();if(e<0)throw o.TransportErrors.util.random.minLessThanZero();const n=t>e?await this.intBetween(e,t):t;return await this.string(n,r)}}t.Random=Random},2212:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1577),t),i(r(5833),t)},4225:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLogger=void 0;const i=n(r(4530));t.SimpleLogger=class SimpleLogger{constructor(e){this.logger=e}trace(...e){this.logger.trace(this.formatMessage(e))}debug(...e){this.logger.debug(this.formatMessage(e))}info(...e){this.logger.info(this.formatMessage(e))}warn(...e){this.logger.warn(this.formatMessage(e))}error(...e){this.logger.error(this.formatMessage(e))}fatal(...e){this.logger.fatal(this.formatMessage(e))}formatMessage(e){return{msg:e.map((e=>{var t;return e instanceof Error?null!==(t=e.stack)&&void 0!==t?t:`${e.name}: ${e.message}`:(0,i.default)(e)})).join("\n")}}}},7004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleLoggerFactory=void 0;const n=r(9290),i=r(4225);t.SimpleLoggerFactory=class SimpleLoggerFactory{constructor(e=n.LogLevel.Warn,t=Math.random().toString(36).substring(7)){this.loggerFactory=n.LFService.createNamedLoggerFactory(t,(new n.LoggerFactoryOptions).addLogGroupRule(new n.LogGroupRule(new RegExp(".*"),e)))}getLogger(e){const t=this.loggerFactory.getLogger(e instanceof Function?e.name:e);return new i.SimpleLogger(t)}}},2391:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4225),t),i(r(7004),t)},1174:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9159:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEventNamespaceFromObject=t.EventBus=void 0;t.EventBus=class EventBus{},t.getEventNamespaceFromObject=function getEventNamespaceFromObject(e){return e.namespace}},5970:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionTargetInfo=void 0;class SubscriptionTargetInfo{namespace;constructor(e){this.namespace=e}static from(e){return e instanceof Function?new ConstructorSubscriptionTargetInfo(e):new NamespaceSubscriptionTargetInfo(e)}}t.SubscriptionTargetInfo=SubscriptionTargetInfo;class ConstructorSubscriptionTargetInfo extends SubscriptionTargetInfo{constructorFunction;constructor(e){super(function getEventNamespaceFromClass(e){return e.namespace}(e)),this.constructorFunction=e}isCompatibleWith(e){return e instanceof this.constructorFunction}}class NamespaceSubscriptionTargetInfo extends SubscriptionTargetInfo{constructor(e){super(e)}isCompatibleWith(e){return!0}}},9729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter2EventBus=void 0;const n=r(6387);r(8660);const i=r(9159),o=r(5970);t.EventEmitter2EventBus=class EventEmitter2EventBus{emitter;wrappers=new Map;nextId=0;constructor(){this.emitter=new n.EventEmitter2({wildcard:!0,maxListeners:50,verboseMemoryLeak:!0})}subscribe(e,t){return this.registerHandler(e,t)}subscribeOnce(e,t){return this.registerHandler(e,t,!0)}unsubscribe(e,t){return this.unregisterHandler(e,t)}registerHandler(e,t,r=!1){const n=o.SubscriptionTargetInfo.from(e),i=this.nextId++,handlerWrapper=o=>{n.isCompatibleWith(o)&&(t(o),r&&this.unsubscribe(e,i))};return this.wrappers.set(i,handlerWrapper),this.emitter.on(n.namespace,handlerWrapper),i}unregisterHandler(e,t){const r=o.SubscriptionTargetInfo.from(e),n=this.wrappers.get(t);return!!n&&(this.emitter.off(r.namespace,n),this.wrappers.delete(t),!0)}publish(e){const t=(0,i.getEventNamespaceFromObject)(e);if(!t)throw Error("The event needs a namespace. Use the EventNamespace-decorator in order to define a namespace for a event.");this.emitter.emit(t,e)}}},9256:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9159),t),i(r(9729),t)},5917:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataEvent=void 0;const n=r(8267);class DataEvent extends n.Event{data;constructor(e,t){super(e),this.data=t}}t.DataEvent=DataEvent},8267:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;t.Event=class Event{namespace;constructor(e){this.namespace=e}}},2636:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5917),t),i(r(8267),t)},5172:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9256),t),i(r(2636),t),i(r(9855),t),i(r(1809),t),i(r(4569),t),i(r(1174),t),i(r(7226),t),i(r(7374),t)},9855:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=void 0,t.log=function log(e,t,r){const n=r.value;return r.value=function(...e){const r=e.map((e=>JSON.stringify(e))).join();try{const i=n.apply(this,e),o=JSON.stringify(i);return console.log(`Call: ${t}(${r}) => ${o}`),i}catch(e){throw console.log(e),e}},r}},1809:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.measureExcecutionTime=void 0,t.measureExcecutionTime=function measureExcecutionTime(e,t,r){const n=r.value;return r.value=async function(...e){const t=Date.now(),r=await n.apply(this,e),i=Date.now();return console.info(`Execution time: ${i-t}ms`),r},r}},4569:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomString=void 0,t.randomString=function randomString(e,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){let r="";const n=t.length;for(let i=0;i<e;i++)r+=t.charAt(Math.floor(Math.random()*n));return r}},7807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationError=void 0;class ApplicationError extends Error{code;data;constructor(e,t,r){super(t),this.code=e,this.data=r}equals(e){return this.code===e.code}}t.ApplicationError=ApplicationError},9278:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Result=void 0;class Result{_isSuccess;_error;_value;constructor(e,t,r){if(e&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!e&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error");if(void 0!==t&&!e)throw new Error("InvalidOperation: A value is only useful in case of a success.");this._value=t,this._isSuccess=e,this._error=r}get isSuccess(){return this._isSuccess}get isError(){return!this._isSuccess}get error(){return this._error}get value(){if(!this.isSuccess)throw new Error("Can't get the value of an error result. Use 'error' instead.");return this._value}static ok(e){return new Result(!0,e)}static fail(e){return new Result(!1,void 0,e)}}t.Result=Result},7226:function(e,t,r){"use strict";var n=this&&this.__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){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7807),t),i(r(9278),t)},7374:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sleep=void 0,t.sleep=function sleep(e){return new Promise((t=>{setTimeout(t,e)}))}},9669:(e,t,r)=>{e.exports=r(1609)},5448:(e,t,r)=>{"use strict";var n=r(4867),i=r(6026),o=r(4372),a=r(5327),s=r(4097),c=r(4109),l=r(7985),u=r(5061),p=r(5655),d=r(5263);e.exports=function xhrAdapter(e){return new Promise((function dispatchXhrRequest(t,r){var h,g=e.data,y=e.headers,m=e.responseType;function done(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(g)&&delete y["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",b=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.Authorization="Basic "+btoa(w+":"+b)}var C=s(e.baseURL,e.url);function onloadend(){if(v){var n="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,o={data:m&&"text"!==m&&"json"!==m?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function _resolve(e){t(e),done()}),(function _reject(e){r(e),done()}),o),v=null}}if(v.open(e.method.toUpperCase(),a(C,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=onloadend:v.onreadystatechange=function handleLoad(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(onloadend)},v.onabort=function handleAbort(){v&&(r(u("Request aborted",e,"ECONNABORTED",v)),v=null)},v.onerror=function handleError(){r(u("Network Error",e,null,v)),v=null},v.ontimeout=function handleTimeout(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||p.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(u(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},n.isStandardBrowserEnv()){var _=(e.withCredentials||l(C))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;_&&(y[e.xsrfHeaderName]=_)}"setRequestHeader"in v&&n.forEach(y,(function setRequestHeader(e,t){void 0===g&&"content-type"===t.toLowerCase()?delete y[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),m&&"json"!==m&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(r(!e||e&&e.type?new d("canceled"):e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),g||(g=null),v.send(g)}))}},1609:(e,t,r)=>{"use strict";var n=r(4867),i=r(1849),o=r(321),a=r(7185);var s=function createInstance(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r.create=function create(t){return createInstance(a(e,t))},r}(r(5655));s.Axios=o,s.Cancel=r(5263),s.CancelToken=r(4972),s.isCancel=r(6502),s.VERSION=r(7288).version,s.all=function all(e){return Promise.all(e)},s.spread=r(8713),s.isAxiosError=r(6268),e.exports=s,e.exports.default=s},5263:e=>{"use strict";function Cancel(e){this.message=e}Cancel.prototype.toString=function toString(){return"Cancel"+(this.message?": "+this.message:"")},Cancel.prototype.__CANCEL__=!0,e.exports=Cancel},4972:(e,t,r)=>{"use strict";var n=r(5263);function CancelToken(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function promiseExecutor(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function reject(){r.unsubscribe(t)},n},e((function cancel(e){r.reason||(r.reason=new n(e),t(r.reason))}))}CancelToken.prototype.throwIfRequested=function throwIfRequested(){if(this.reason)throw this.reason},CancelToken.prototype.subscribe=function subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},CancelToken.prototype.unsubscribe=function unsubscribe(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},CancelToken.source=function source(){var e;return{token:new CancelToken((function executor(t){e=t})),cancel:e}},e.exports=CancelToken},6502:e=>{"use strict";e.exports=function isCancel(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(4867),i=r(5327),o=r(782),a=r(3572),s=r(7185),c=r(4875),l=c.validators;function Axios(e){this.defaults=e,this.interceptors={request:new o,response:new o}}Axios.prototype.request=function request(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function unshiftRequestInterceptors(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function pushResponseInterceptors(e){u.push(e.fulfilled,e.rejected)})),!i){var p=[a,void 0];for(Array.prototype.unshift.apply(p,n),p=p.concat(u),o=Promise.resolve(t);p.length;)o=o.then(p.shift(),p.shift());return o}for(var d=t;n.length;){var h=n.shift(),g=n.shift();try{d=h(d)}catch(e){g(e);break}}try{o=a(d)}catch(e){return Promise.reject(e)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},Axios.prototype.getUri=function getUri(e){if(!e.url)throw new Error("Provided config url is not valid");return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function forEachMethodNoData(e){Axios.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function forEachMethodWithData(e){Axios.prototype[e]=function(t,r,n){return this.request(s(n||{},{method:e,url:t,data:r}))}})),e.exports=Axios},782:(e,t,r)=>{"use strict";var n=r(4867);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},InterceptorManager.prototype.eject=function eject(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager.prototype.forEach=function forEach(e){n.forEach(this.handlers,(function forEachHandler(t){null!==t&&e(t)}))},e.exports=InterceptorManager},4097:(e,t,r)=>{"use strict";var n=r(1793),i=r(7303);e.exports=function buildFullPath(e,t){return e&&!n(t)?i(e,t):t}},5061:(e,t,r)=>{"use strict";var n=r(481);e.exports=function createError(e,t,r,i,o){var a=new Error(e);return n(a,t,r,i,o)}},3572:(e,t,r)=>{"use strict";var n=r(4867),i=r(8527),o=r(6502),a=r(5655),s=r(5263);function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function cleanHeaderConfig(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function onAdapterResolution(t){return throwIfCancellationRequested(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function onAdapterRejection(t){return o(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function enhanceError(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function mergeConfig(e,t){t=t||{};var r={};function getMergedValue(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function mergeDeepProperties(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:getMergedValue(void 0,e[r]):getMergedValue(e[r],t[r])}function valueFromConfig2(e){if(!n.isUndefined(t[e]))return getMergedValue(void 0,t[e])}function defaultToConfig2(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:getMergedValue(void 0,e[r]):getMergedValue(void 0,t[r])}function mergeDirectKeys(r){return r in t?getMergedValue(e[r],t[r]):r in e?getMergedValue(void 0,e[r]):void 0}var i={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function computeConfigValue(e){var t=i[e]||mergeDeepProperties,o=t(e);n.isUndefined(o)&&t!==mergeDirectKeys||(r[e]=o)})),r}},6026:(e,t,r)=>{"use strict";var n=r(5061);e.exports=function settle(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},8527:(e,t,r)=>{"use strict";var n=r(4867),i=r(5655);e.exports=function transformData(e,t,r){var o=this||i;return n.forEach(r,(function transform(r){e=r.call(o,e,t)})),e}},5655:(e,t,r)=>{"use strict";var n=r(4867),i=r(6016),o=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function getDefaultAdapter(){var e;return("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(e=r(5448)),e}(),transformRequest:[function transformRequest(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(setContentTypeIfUnset(t,"application/json"),function stringifySafely(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function transformResponse(e){var t=this.transitional||s.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function validateStatus(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function forEachMethodNoData(e){s.headers[e]={}})),n.forEach(["post","put","patch"],(function forEachMethodWithData(e){s.headers[e]=n.merge(a)})),e.exports=s},7288:e=>{e.exports={version:"0.25.0"}},1849:e=>{"use strict";e.exports=function bind(e,t){return function wrap(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},5327:(e,t,r)=>{"use strict";var n=r(4867);function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function buildURL(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var o=[];n.forEach(t,(function serialize(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function parseValue(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(encode(t)+"="+encode(e))})))})),i=o.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},7303:e=>{"use strict";e.exports=function combineURLs(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function standardBrowserEnv(){return{write:function write(e,t,r,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function read(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function remove(e){this.write(e,"",Date.now()-864e5)}}}():{write:function write(){},read:function read(){return null},remove:function remove(){}}},1793:e=>{"use strict";e.exports=function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},6268:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function isAxiosError(e){return n.isObject(e)&&!0===e.isAxiosError}},7985:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function standardBrowserEnv(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function resolveURL(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=resolveURL(window.location.href),function isURLSameOrigin(t){var r=n.isString(t)?resolveURL(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function isURLSameOrigin(){return!0}},6016:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function normalizeHeaderName(e,t){n.forEach(e,(function processHeader(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4109:(e,t,r)=>{"use strict";var n=r(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function parseHeaders(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function parser(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},8713:e=>{"use strict";e.exports=function spread(e){return function wrap(t){return e.apply(null,t)}}},4875:(e,t,r)=>{"use strict";var n=r(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function validator(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={};i.transitional=function transitional(e,t,r){function formatMessage(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,i){if(!1===e)throw new Error(formatMessage(n," has been removed"+(t?" in "+t:"")));return t&&!o[n]&&(o[n]=!0,console.warn(formatMessage(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,i)}},e.exports={assertOptions:function assertOptions(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],a=t[o];if(a){var s=e[o],c=void 0===s||a(s,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},4867:(e,t,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function isArray(e){return Array.isArray(e)}function isUndefined(e){return void 0===e}function isArrayBuffer(e){return"[object ArrayBuffer]"===i.call(e)}function isObject(e){return null!==e&&"object"==typeof e}function isPlainObject(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function isFunction(e){return"[object Function]"===i.call(e)}function forEach(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),isArray(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray,isArrayBuffer,isBuffer:function isBuffer(e){return null!==e&&!isUndefined(e)&&null!==e.constructor&&!isUndefined(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function isFormData(e){return"[object FormData]"===i.call(e)},isArrayBufferView:function isArrayBufferView(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&isArrayBuffer(e.buffer)},isString:function isString(e){return"string"==typeof e},isNumber:function isNumber(e){return"number"==typeof e},isObject,isPlainObject,isUndefined,isDate:function isDate(e){return"[object Date]"===i.call(e)},isFile:function isFile(e){return"[object File]"===i.call(e)},isBlob:function isBlob(e){return"[object Blob]"===i.call(e)},isFunction,isStream:function isStream(e){return isObject(e)&&isFunction(e.pipe)},isURLSearchParams:function isURLSearchParams(e){return"[object URLSearchParams]"===i.call(e)},isStandardBrowserEnv:function isStandardBrowserEnv(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach,merge:function merge(){var e={};function assignValue(t,r){isPlainObject(e[r])&&isPlainObject(t)?e[r]=merge(e[r],t):isPlainObject(t)?e[r]=merge({},t):isArray(t)?e[r]=t.slice():e[r]=t}for(var t=0,r=arguments.length;t<r;t++)forEach(arguments[t],assignValue);return e},extend:function extend(e,t,r){return forEach(t,(function assignValue(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function stripBOM(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},1924:(e,t,r)=>{"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));e.exports=function callBoundIntrinsic(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),c=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function callBind(e){var t=s(n,a,arguments);if(c&&l){var r=c(t,"length");r.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var p=function applyBind(){return s(n,o,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},9180:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(9829)],void 0===(o="function"==typeof(n=function ErrorStackParser(e){var t=/(^|@)\S+\:\d+/,r=/^\s*at .*(\S+\:\d+|\(native\))/m,n=/^(eval@)?(\[native code\])?$/;function _map(e,t,r){if("function"==typeof Array.prototype.map)return e.map(t,r);for(var n=new Array(e.length),i=0;i<e.length;i++)n[i]=t.call(r,e[i]);return n}function _filter(e,t,r){if("function"==typeof Array.prototype.filter)return e.filter(t,r);for(var n=[],i=0;i<e.length;i++)t.call(r,e[i])&&n.push(e[i]);return n}function _indexOf(e,t){if("function"==typeof Array.prototype.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1}return{parse:function ErrorStackParser$$parse(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(r))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function ErrorStackParser$$extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(e.replace(/[\(\)]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function ErrorStackParser$$parseV8OrIE(t){return _map(_filter(t.stack.split("\n"),(function(e){return!!e.match(r)}),this),(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(r.pop()),i=r.join(" ")||void 0,o=_indexOf(["eval","<anonymous>"],n[0])>-1?void 0:n[0];return new e(i,void 0,o,n[1],n[2],t)}),this)},parseFFOrSafari:function ErrorStackParser$$parseFFOrSafari(t){return _map(_filter(t.stack.split("\n"),(function(e){return!e.match(n)}),this),(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e(t);var r=t.split("@"),n=this.extractLocation(r.pop()),i=r.join("@")||void 0;return new e(i,void 0,n[0],n[1],n[2],t)}),this)},parseOpera:function ErrorStackParser$$parseOpera(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function ErrorStackParser$$parseOpera9(t){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[],o=2,a=n.length;o<a;o+=2){var s=r.exec(n[o]);s&&i.push(new e(void 0,void 0,s[2],s[1],void 0,n[o]))}return i},parseOpera10:function ErrorStackParser$$parseOpera10(t){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[],o=0,a=n.length;o<a;o+=2){var s=r.exec(n[o]);s&&i.push(new e(s[3]||void 0,void 0,s[2],s[1],void 0,n[o]))}return i},parseOpera11:function ErrorStackParser$$parseOpera11(r){return _map(_filter(r.stack.split("\n"),(function(e){return!!e.match(t)&&!e.match(/^Error created at/)}),this),(function(t){var r,n=t.split("@"),i=this.extractLocation(n.pop()),o=n.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(r=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new e(a,s,i[0],i[1],i[2],t)}),this)}}})?n.apply(t,i):n)||(e.exports=o)}()},6387:(e,t,r)=>{var n;!function(i){var o=Object.hasOwnProperty,a=Array.isArray?Array.isArray:function _isArray(e){return"[object Array]"===Object.prototype.toString.call(e)},s="object"==typeof process&&"function"==typeof process.nextTick,c="function"==typeof Symbol,l="object"==typeof Reflect,u="function"==typeof setImmediate?setImmediate:setTimeout,p=c?l&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function init(){this._events={},this._conf&&configure.call(this,this._conf)}function configure(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners!==i&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function logPossibleMemoryLeak(e,t){var r="(node) warning: possible EventEmitter memory leak detected. "+e+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(r+=" Event name: "+t+"."),"undefined"!=typeof process&&process.emitWarning){var n=new Error(r);n.name="MaxListenersExceededWarning",n.emitter=this,n.count=e,process.emitWarning(n)}else console.error(r),console.trace&&console.trace()}var toArray=function(e,t,r){var n=arguments.length;switch(n){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,r];default:for(var i=new Array(n);n--;)i[n]=arguments[n];return i}};function toObject(e,t){for(var r={},n=e.length,o=t?value.length:0,a=0;a<n;a++)r[e[a]]=a<o?t[a]:i;return r}function TargetObserver(e,t,r){var n,i;if(this._emitter=e,this._target=t,this._listeners={},this._listenersCount=0,(r.on||r.off)&&(n=r.on,i=r.off),t.addEventListener?(n=t.addEventListener,i=t.removeEventListener):t.addListener?(n=t.addListener,i=t.removeListener):t.on&&(n=t.on,i=t.off),!n&&!i)throw Error("target does not implement any known event API");if("function"!=typeof n)throw TypeError("on method must be a function");if("function"!=typeof i)throw TypeError("off method must be a function");this._on=n,this._off=i;var o=e._observers;o?o.push(this):e._observers=[this]}function resolveOptions(e,t,r,n){var a=Object.assign({},t);if(!e)return a;if("object"!=typeof e)throw TypeError("options must be an object");var s,c,l,u=Object.keys(e),p=u.length;function reject(e){throw Error('Invalid "'+s+'" option value'+(e?". Reason: "+e:""))}for(var d=0;d<p;d++){if(s=u[d],!n&&!o.call(t,s))throw Error('Unknown "'+s+'" option');(c=e[s])!==i&&(l=r[s],a[s]=l?l(c,reject):c)}return a}function constructorReducer(e,t){return"function"==typeof e&&e.hasOwnProperty("prototype")||t("value must be a constructor"),e}function makeTypeReducer(e){var t="value must be type of "+e.join("|"),r=e.length,n=e[0],i=e[1];return 1===r?function(e,r){if(typeof e===n)return e;r(t)}:2===r?function(e,r){var o=typeof e;if(o===n||o===i)return e;r(t)}:function(n,i){for(var o=typeof n,a=r;a-- >0;)if(o===e[a])return n;i(t)}}Object.assign(TargetObserver.prototype,{subscribe:function(e,t,r){var n=this,i=this._target,o=this._emitter,a=this._listeners,handler=function(){var n=toArray.apply(null,arguments),a={data:n,name:t,original:e};if(r){var s=r.call(i,a);!1!==s&&o.emit.apply(o,[a.name].concat(n))}else o.emit.apply(o,[t].concat(n))};if(a[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!n._onNewListener?(this._onNewListener=function(r){r===t&&null===a[e]&&(a[e]=handler,n._on.call(i,e,handler))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(r){r===t&&!o.hasListeners(r)&&a[e]&&(a[e]=null,n._off.call(i,e,handler))},a[e]=null,o.on("removeListener",this._onRemoveListener)):(a[e]=handler,n._on.call(i,e,handler))},unsubscribe:function(e){var t,r,n,i=this,o=this._listeners,a=this._emitter,s=this._off,c=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function clearRefs(){i._onNewListener&&(a.off("newListener",i._onNewListener),a.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=findTargetIndex.call(a,i);a._observers.splice(e,1)}if(e){if(!(t=o[e]))return;s.call(c,e,t),delete o[e],--this._listenersCount||clearRefs()}else{for(n=(r=p(o)).length;n-- >0;)e=r[n],s.call(c,e,o[e]);this._listeners={},this._listenersCount=0,clearRefs()}}});var d=makeTypeReducer(["function"]),h=makeTypeReducer(["object","function"]);function makeCancelablePromise(e,t,r){var n,i,o,a=0,s=new e((function(c,l,u){function cleanup(){i&&(i=null),a&&(clearTimeout(a),a=0)}r=resolveOptions(r,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),n=!r.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof u;var _resolve=function(e){cleanup(),c(e)},_reject=function(e){cleanup(),l(e)};n?t(_resolve,_reject,u):(i=[function(e){_reject(e||Error("canceled"))}],t(_resolve,_reject,(function(e){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");i.push(e)})),o=!0),r.timeout>0&&(a=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",a=0,s.cancel(e),l(e)}),r.timeout))}));return n||(s.cancel=function(e){if(i){for(var t=i.length,r=1;r<t;r++)i[r](e);i[0](e),i=null}}),s}function findTargetIndex(e){var t=this._observers;if(!t)return-1;for(var r=t.length,n=0;n<r;n++)if(t[n]._target===e)return n;return-1}function searchListenerTree(e,t,r,n,i){if(!r)return null;if(0===n){var o=typeof t;if("string"===o){var a,s,c=0,l=0,u=this.delimiter,d=u.length;if(-1!==(s=t.indexOf(u))){a=new Array(5);do{a[c++]=t.slice(l,s),l=s+d}while(-1!==(s=t.indexOf(u,l)));a[c++]=t.slice(l),t=a,i=c}else t=[t],i=1}else"object"===o?i=t.length:(t=[t],i=1)}var h,g,y,m,v,w,b,C=null,_=t[n],S=t[n+1];if(n===i)r._listeners&&("function"==typeof r._listeners?(e&&e.push(r._listeners),C=[r]):(e&&e.push.apply(e,r._listeners),C=[r]));else{if("*"===_){for(s=(w=p(r)).length;s-- >0;)"_listeners"!==(h=w[s])&&(b=searchListenerTree(e,t,r[h],n+1,i))&&(C?C.push.apply(C,b):C=b);return C}if("**"===_){for((v=n+1===i||n+2===i&&"*"===S)&&r._listeners&&(C=searchListenerTree(e,t,r,i,i)),s=(w=p(r)).length;s-- >0;)"_listeners"!==(h=w[s])&&("*"===h||"**"===h?(r[h]._listeners&&!v&&(b=searchListenerTree(e,t,r[h],i,i))&&(C?C.push.apply(C,b):C=b),b=searchListenerTree(e,t,r[h],n,i)):b=searchListenerTree(e,t,r[h],h===S?n+2:n,i),b&&(C?C.push.apply(C,b):C=b));return C}r[_]&&(C=searchListenerTree(e,t,r[_],n+1,i))}if((g=r["*"])&&searchListenerTree(e,t,g,n+1,i),y=r["**"])if(n<i)for(y._listeners&&searchListenerTree(e,t,y,i,i),s=(w=p(y)).length;s-- >0;)"_listeners"!==(h=w[s])&&(h===S?searchListenerTree(e,t,y[h],n+2,i):h===_?searchListenerTree(e,t,y[h],n+1,i):((m={})[h]=y[h],searchListenerTree(e,t,{"**":m},n+1,i)));else y._listeners?searchListenerTree(e,t,y,i,i):y["*"]&&y["*"]._listeners&&searchListenerTree(e,t,y["*"],i,i);return C}function growListenerTree(e,t,r){var n,i,o=0,a=0,s=this.delimiter,c=s.length;if("string"==typeof e)if(-1!==(n=e.indexOf(s))){i=new Array(5);do{i[o++]=e.slice(a,n),a=n+c}while(-1!==(n=e.indexOf(s,a)));i[o++]=e.slice(a)}else i=[e],o=1;else i=e,o=e.length;if(o>1)for(n=0;n+1<o;n++)if("**"===i[n]&&"**"===i[n+1])return;var l,u=this.listenerTree;for(n=0;n<o;n++)if(u=u[l=i[n]]||(u[l]={}),n===o-1)return u._listeners?("function"==typeof u._listeners&&(u._listeners=[u._listeners]),r?u._listeners.unshift(t):u._listeners.push(t),!u._listeners.warned&&this._maxListeners>0&&u._listeners.length>this._maxListeners&&(u._listeners.warned=!0,logPossibleMemoryLeak.call(this,u._listeners.length,l))):u._listeners=t,!0;return!0}function collectTreeEvents(e,t,r,n){for(var i,o,a,s,c=p(e),l=c.length,u=e._listeners;l-- >0;)i=e[o=c[l]],a="_listeners"===o?r:r?r.concat(o):[o],s=n||"symbol"==typeof o,u&&t.push(s?a:a.join(this.delimiter)),"object"==typeof i&&collectTreeEvents.call(this,i,t,a,s);return t}function recursivelyGarbageCollect(e){for(var t,r,n,i=p(e),o=i.length;o-- >0;)(t=e[r=i[o]])&&(n=!0,"_listeners"===r||recursivelyGarbageCollect(t)||delete e[r]);return n}function Listener(e,t,r){this.emitter=e,this.event=t,this.listener=r}function setupListener(e,t,r){if(!0===r)o=!0;else if(!1===r)n=!0;else{if(!r||"object"!=typeof r)throw TypeError("options should be an object or true");var n=r.async,o=r.promisify,a=r.nextTick,c=r.objectify}if(n||a||o){var l=t,p=t._origin||t;if(a&&!s)throw Error("process.nextTick is not supported");o===i&&(o="AsyncFunction"===t.constructor.name),t=function(){var e=arguments,t=this,r=this.event;return o?a?Promise.resolve():new Promise((function(e){u(e)})).then((function(){return t.event=r,l.apply(t,e)})):(a?process.nextTick:u)((function(){t.event=r,l.apply(t,e)}))},t._async=!0,t._origin=p}return[t,c?new Listener(this,e,t):this]}function EventEmitter(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,configure.call(this,e)}Listener.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},EventEmitter.EventEmitter2=EventEmitter,EventEmitter.prototype.listenTo=function(e,t,r){if("object"!=typeof e)throw TypeError("target musts be an object");var n=this;function listen(t){if("object"!=typeof t)throw TypeError("events must be an object");var i,o=r.reducers,a=findTargetIndex.call(n,e);i=-1===a?new TargetObserver(n,e,r):n._observers[a];for(var s,c=p(t),l=c.length,u="function"==typeof o,d=0;d<l;d++)s=c[d],i.subscribe(s,t[s]||s,u?o:o&&o[s])}return r=resolveOptions(r,{on:i,off:i,reducers:i},{on:d,off:d,reducers:h}),a(t)?listen(toObject(t)):listen("string"==typeof t?toObject(t.split(/\s+/)):t),this},EventEmitter.prototype.stopListeningTo=function(e,t){var r=this._observers;if(!r)return!1;var n,i=r.length,o=!1;if(e&&"object"!=typeof e)throw TypeError("target should be an object");for(;i-- >0;)n=r[i],e&&n._target!==e||(n.unsubscribe(t),o=!0);return o},EventEmitter.prototype.delimiter=".",EventEmitter.prototype.setMaxListeners=function(e){e!==i&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},EventEmitter.prototype.getMaxListeners=function(){return this._maxListeners},EventEmitter.prototype.event="",EventEmitter.prototype.once=function(e,t,r){return this._once(e,t,!1,r)},EventEmitter.prototype.prependOnceListener=function(e,t,r){return this._once(e,t,!0,r)},EventEmitter.prototype._once=function(e,t,r,n){return this._many(e,1,t,r,n)},EventEmitter.prototype.many=function(e,t,r,n){return this._many(e,t,r,!1,n)},EventEmitter.prototype.prependMany=function(e,t,r,n){return this._many(e,t,r,!0,n)},EventEmitter.prototype._many=function(e,t,r,n,i){var o=this;if("function"!=typeof r)throw new Error("many only accepts instances of Function");function listener(){return 0==--t&&o.off(e,listener),r.apply(this,arguments)}return listener._origin=r,this._on(e,listener,n,i)},EventEmitter.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||init.call(this);var e,t,r,n,i,o,a=arguments[0],s=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return!1;if(s&&(e=a,"newListener"!==a&&"removeListener"!==a&&"object"==typeof a)){if(r=a.length,c)for(n=0;n<r;n++)if("symbol"==typeof a[n]){o=!0;break}o||(a=a.join(this.delimiter))}var l,u=arguments.length;if(this._all&&this._all.length)for(n=0,r=(l=this._all.slice()).length;n<r;n++)switch(this.event=a,u){case 1:l[n].call(this,a);break;case 2:l[n].call(this,a,arguments[1]);break;case 3:l[n].call(this,a,arguments[1],arguments[2]);break;default:l[n].apply(this,arguments)}if(s)l=[],searchListenerTree.call(this,l,e,this.listenerTree,0,r);else{if("function"==typeof(l=this._events[a])){switch(this.event=a,u){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;default:for(t=new Array(u-1),i=1;i<u;i++)t[i-1]=arguments[i];l.apply(this,t)}return!0}l&&(l=l.slice())}if(l&&l.length){if(u>3)for(t=new Array(u-1),i=1;i<u;i++)t[i-1]=arguments[i];for(n=0,r=l.length;n<r;n++)switch(this.event=a,u){case 1:l[n].call(this);break;case 2:l[n].call(this,arguments[1]);break;case 3:l[n].call(this,arguments[1],arguments[2]);break;default:l[n].apply(this,t)}return!0}if(!this.ignoreErrors&&!this._all&&"error"===a)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},EventEmitter.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||init.call(this);var e,t,r,n,i,o,a=arguments[0],s=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(s&&(e=a,"newListener"!==a&&"removeListener"!==a&&"object"==typeof a)){if(n=a.length,c)for(i=0;i<n;i++)if("symbol"==typeof a[i]){t=!0;break}t||(a=a.join(this.delimiter))}var l,u=[],p=arguments.length;if(this._all)for(i=0,n=this._all.length;i<n;i++)switch(this.event=a,p){case 1:u.push(this._all[i].call(this,a));break;case 2:u.push(this._all[i].call(this,a,arguments[1]));break;case 3:u.push(this._all[i].call(this,a,arguments[1],arguments[2]));break;default:u.push(this._all[i].apply(this,arguments))}if(s?(l=[],searchListenerTree.call(this,l,e,this.listenerTree,0)):l=this._events[a],"function"==typeof l)switch(this.event=a,p){case 1:u.push(l.call(this));break;case 2:u.push(l.call(this,arguments[1]));break;case 3:u.push(l.call(this,arguments[1],arguments[2]));break;default:for(r=new Array(p-1),o=1;o<p;o++)r[o-1]=arguments[o];u.push(l.apply(this,r))}else if(l&&l.length){if(l=l.slice(),p>3)for(r=new Array(p-1),o=1;o<p;o++)r[o-1]=arguments[o];for(i=0,n=l.length;i<n;i++)switch(this.event=a,p){case 1:u.push(l[i].call(this));break;case 2:u.push(l[i].call(this,arguments[1]));break;case 3:u.push(l[i].call(this,arguments[1],arguments[2]));break;default:u.push(l[i].apply(this,r))}}else if(!this.ignoreErrors&&!this._all&&"error"===a)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(u)},EventEmitter.prototype.on=function(e,t,r){return this._on(e,t,!1,r)},EventEmitter.prototype.prependListener=function(e,t,r){return this._on(e,t,!0,r)},EventEmitter.prototype.onAny=function(e){return this._onAny(e,!1)},EventEmitter.prototype.prependAny=function(e){return this._onAny(e,!0)},EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prototype._onAny=function(e,t){if("function"!=typeof e)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),t?this._all.unshift(e):this._all.push(e),this},EventEmitter.prototype._on=function(e,t,r,n){if("function"==typeof e)return this._onAny(e,t),this;if("function"!=typeof t)throw new Error("on only accepts instances of Function");this._events||init.call(this);var o,a=this;return n!==i&&(t=(o=setupListener.call(this,e,t,n))[0],a=o[1]),this._newListener&&this.emit("newListener",e,t),this.wildcard?(growListenerTree.call(this,e,t,r),a):(this._events[e]?("function"==typeof this._events[e]&&(this._events[e]=[this._events[e]]),r?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&this._maxListeners>0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,logPossibleMemoryLeak.call(this,this._events[e].length,e))):this._events[e]=t,a)},EventEmitter.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var r,n=[];if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice();if(!(n=searchListenerTree.call(this,null,i,this.listenerTree,0)))return this}else{if(!this._events[e])return this;r=this._events[e],n.push({_listeners:r})}for(var o=0;o<n.length;o++){var s=n[o];if(r=s._listeners,a(r)){for(var c=-1,l=0,u=r.length;l<u;l++)if(r[l]===t||r[l].listener&&r[l].listener===t||r[l]._origin&&r[l]._origin===t){c=l;break}if(c<0)continue;return this.wildcard?s._listeners.splice(c,1):this._events[e].splice(c,1),0===r.length&&(this.wildcard?delete s._listeners:delete this._events[e]),this._removeListener&&this.emit("removeListener",e,t),this}(r===t||r.listener&&r.listener===t||r._origin&&r._origin===t)&&(this.wildcard?delete s._listeners:delete this._events[e],this._removeListener&&this.emit("removeListener",e,t))}return this.listenerTree&&recursivelyGarbageCollect(this.listenerTree),this},EventEmitter.prototype.offAny=function(e){var t,r=0,n=0;if(e&&this._all&&this._all.length>0){for(r=0,n=(t=this._all).length;r<n;r++)if(e===t[r])return t.splice(r,1),this._removeListener&&this.emit("removeListenerAny",e),this}else{if(t=this._all,this._removeListener)for(r=0,n=t.length;r<n;r++)this.emit("removeListenerAny",t[r]);this._all=[]}return this},EventEmitter.prototype.removeListener=EventEmitter.prototype.off,EventEmitter.prototype.removeAllListeners=function(e){if(e===i)return!this._events||init.call(this),this;if(this.wildcard){var t,r=searchListenerTree.call(this,null,e,this.listenerTree,0);if(!r)return this;for(t=0;t<r.length;t++)r[t]._listeners=null;this.listenerTree&&recursivelyGarbageCollect(this.listenerTree)}else this._events&&(this._events[e]=null);return this},EventEmitter.prototype.listeners=function(e){var t,r,n,o,a,s=this._events;if(e===i){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!s)return[];for(o=(t=p(s)).length,n=[];o-- >0;)"function"==typeof(r=s[t[o]])?n.push(r):n.push.apply(n,r);return n}if(this.wildcard){if(!(a=this.listenerTree))return[];var c=[],l="string"==typeof e?e.split(this.delimiter):e.slice();return searchListenerTree.call(this,c,l,a,0),c}return s&&(r=s[e])?"function"==typeof r?[r]:r:[]},EventEmitter.prototype.eventNames=function(e){var t=this._events;return this.wildcard?collectTreeEvents.call(this,this.listenerTree,[],null,e):t?p(t):[]},EventEmitter.prototype.listenerCount=function(e){return this.listeners(e).length},EventEmitter.prototype.hasListeners=function(e){if(this.wildcard){var t=[],r="string"==typeof e?e.split(this.delimiter):e.slice();return searchListenerTree.call(this,t,r,this.listenerTree,0),t.length>0}var n=this._events,o=this._all;return!!(o&&o.length||n&&(e===i?p(n).length:n[e]))},EventEmitter.prototype.listenersAny=function(){return this._all?this._all:[]},EventEmitter.prototype.waitFor=function(e,t){var r=this,n=typeof t;return"number"===n?t={timeout:t}:"function"===n&&(t={filter:t}),makeCancelablePromise((t=resolveOptions(t,{timeout:0,filter:i,handleError:!1,Promise,overload:!1},{filter:d,Promise:constructorReducer})).Promise,(function(n,i,o){function listener(){var o=t.filter;if(!o||o.apply(r,arguments))if(r.off(e,listener),t.handleError){var a=arguments[0];a?i(a):n(toArray.apply(null,arguments).slice(1))}else n(toArray.apply(null,arguments))}o((function(){r.off(e,listener)})),r._on(e,listener,!1)}),{timeout:t.timeout,overload:t.overload})};var g=EventEmitter.prototype;Object.defineProperties(EventEmitter,{defaultMaxListeners:{get:function(){return g._maxListeners},set:function(e){if("number"!=typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");g._maxListeners=e},enumerable:!0},once:{value:function once(e,t,r){return makeCancelablePromise((r=resolveOptions(r,{Promise,timeout:0,overload:!1},{Promise:constructorReducer})).Promise,(function(r,n,i){var o;if("function"==typeof e.addEventListener)return o=function(){r(toArray.apply(null,arguments))},i((function(){e.removeEventListener(t,o)})),void e.addEventListener(t,o,{once:!0});var a,eventListener=function(){a&&e.removeListener("error",a),r(toArray.apply(null,arguments))};"error"!==t&&(a=function(r){e.removeListener(t,eventListener),n(r)},e.once("error",a)),i((function(){a&&e.removeListener("error",a),e.removeListener(t,eventListener)})),e.once(t,eventListener)}),{timeout:r.timeout,overload:r.overload})},writable:!0,configurable:!0}}),Object.defineProperties(g,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),(n=function(){return EventEmitter}.call(t,r,t,e))===i||(e.exports=n)}()},6230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},7648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function bind(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var a,s=r.call(arguments,1),binder=function(){if(this instanceof a){var t=o.apply(this,s.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,s.concat(r.call(arguments)))},c=Math.max(0,o.length-s.length),l=[],u=0;u<c;u++)l.push("$"+u);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(binder),o.prototype){var p=function Empty(){};p.prototype=o.prototype,a.prototype=new p,p.prototype=null}return a}},8612:(e,t,r)=>{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,getEvalledConstructor=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(e){s=null}var throwTypeError=function(){throw new a},c=s?function(){try{return throwTypeError}catch(e){try{return s(arguments,"callee").get}catch(e){return throwTypeError}}}():throwTypeError,l=r(1405)(),u=Object.getPrototypeOf||function(e){return e.__proto__},p={},d="undefined"==typeof Uint8Array?n:u(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?u([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?u(u([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?u((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?u((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?u(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function doEval(e){var t;if("%AsyncFunction%"===e)t=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===e)t=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===e)t=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===e){var r=doEval("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=doEval("%AsyncGenerator%");n&&(t=u(n.prototype))}return h[e]=t,t},y={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),b=m.call(Function.apply,Array.prototype.splice),C=m.call(Function.call,String.prototype.replace),_=m.call(Function.call,String.prototype.slice),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,O=function stringToPath(e){var t=_(e,0,1),r=_(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return C(e,S,(function(e,t,r,i){n[n.length]=r?C(i,T,"$1"):t||e})),n},R=function getBaseIntrinsic(e,t){var r,n=e;if(v(y,n)&&(n="%"+(r=y[n])[0]+"%"),v(h,n)){var o=h[n];if(o===p&&(o=g(n)),void 0===o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function GetIntrinsic(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');var r=O(e),n=r.length>0?r[0]:"",o=R("%"+n+"%",t),c=o.name,l=o.value,u=!1,p=o.alias;p&&(n=p[0],b(r,w([0,1],p)));for(var d=1,g=!0;d<r.length;d+=1){var y=r[d],m=_(y,0,1),C=_(y,-1);if(('"'===m||"'"===m||"`"===m||'"'===C||"'"===C||"`"===C)&&m!==C)throw new i("property names with quotes must have matching quotes");if("constructor"!==y&&g||(u=!0),v(h,c="%"+(n+="."+y)+"%"))l=h[c];else if(null!=l){if(!(y in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(s&&d+1>=r.length){var S=s(l,y);l=(g=!!S)&&"get"in S&&!("originalValue"in S.get)?S.get:l[y]}else g=v(l,y),l=l[y];g&&!u&&(h[c]=l)}}return l}},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function hasNativeSymbols(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},5419:e=>{"use strict";e.exports=function hasSymbols(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7642:(e,t,r)=>{"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4530:(e,t)=>{function serializer(e,t){var r=[],n=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(i,o){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?n.splice(a,1/0,i):n.push(i),~r.indexOf(o)&&(o=t.call(this,i,o))}else r.push(o);return null==e?o:e.call(this,i,o)}}(e.exports=function stringify(e,t,r,n){return JSON.stringify(e,serializer(t,n),r)}).getSerialize=serializer},6486:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",c=16,l=32,u=64,p=128,d=256,h=1/0,g=9007199254740991,y=NaN,m=4294967295,v=[["ary",p],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",l],["partialRight",u],["rearg",d]],w="[object Arguments]",b="[object Array]",C="[object Boolean]",_="[object Date]",S="[object Error]",T="[object Function]",O="[object GeneratorFunction]",R="[object Map]",I="[object Number]",E="[object Object]",L="[object Promise]",M="[object RegExp]",A="[object Set]",D="[object String]",P="[object Symbol]",j="[object WeakMap]",k="[object ArrayBuffer]",x="[object DataView]",F="[object Float32Array]",N="[object Float64Array]",z="[object Int8Array]",B="[object Int16Array]",U="[object Int32Array]",W="[object Uint8Array]",q="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",K=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,J=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,Y=RegExp(J.source),Q=RegExp(Z.source),X=/<%-([\s\S]+?)%>/g,ee=/<%([\s\S]+?)%>/g,te=/<%=([\s\S]+?)%>/g,re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oe=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(oe.source),se=/^\s+/,ce=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,pe=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,we=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,Ce=/^(?:0|[1-9]\d*)$/,_e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,Te=/['\n\r\u2028\u2029\\]/g,Oe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Re="\\u2700-\\u27bf",Ie="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",Le="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="['’]",De="[\\ud800-\\udfff]",Pe="["+Me+"]",je="["+Oe+"]",ke="\\d+",xe="[\\u2700-\\u27bf]",Fe="["+Ie+"]",Ne="[^\\ud800-\\udfff"+Me+ke+Re+Ie+Ee+"]",ze="\\ud83c[\\udffb-\\udfff]",Be="[^\\ud800-\\udfff]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",We="[\\ud800-\\udbff][\\udc00-\\udfff]",qe="["+Ee+"]",Ve="(?:"+Fe+"|"+Ne+")",Ge="(?:"+qe+"|"+Ne+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",He="(?:"+je+"|"+ze+")"+"?",Je="[\\ufe0e\\ufe0f]?",Ze=Je+He+("(?:\\u200d(?:"+[Be,Ue,We].join("|")+")"+Je+He+")*"),Ye="(?:"+[xe,Ue,We].join("|")+")"+Ze,Qe="(?:"+[Be+je+"?",je,Ue,We,De].join("|")+")",Xe=RegExp(Ae,"g"),et=RegExp(je,"g"),tt=RegExp(ze+"(?="+ze+")|"+Qe+Ze,"g"),rt=RegExp([qe+"?"+Fe+"+"+Ke+"(?="+[Pe,qe,"$"].join("|")+")",Ge+"+"+$e+"(?="+[Pe,qe+Ve,"$"].join("|")+")",qe+"?"+Ve+"+"+Ke,qe+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ke,Ye].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Oe+Le+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[F]=st[N]=st[z]=st[B]=st[U]=st[W]=st[q]=st[V]=st[G]=!0,st[w]=st[b]=st[k]=st[C]=st[x]=st[_]=st[S]=st[T]=st[R]=st[I]=st[E]=st[M]=st[A]=st[D]=st[j]=!1;var ct={};ct[w]=ct[b]=ct[k]=ct[x]=ct[C]=ct[_]=ct[F]=ct[N]=ct[z]=ct[B]=ct[U]=ct[R]=ct[I]=ct[E]=ct[M]=ct[A]=ct[D]=ct[P]=ct[W]=ct[q]=ct[V]=ct[G]=!0,ct[S]=ct[T]=ct[j]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,pt=parseInt,ft="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,dt="object"==typeof self&&self&&self.Object===Object&&self,ht=ft||dt||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&e&&!e.nodeType&&e,mt=yt&&yt.exports===gt,vt=mt&&ft.process,wt=function(){try{var e=yt&&yt.require&&yt.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),bt=wt&&wt.isArrayBuffer,Ct=wt&&wt.isDate,_t=wt&&wt.isMap,St=wt&&wt.isRegExp,Tt=wt&&wt.isSet,Ot=wt&&wt.isTypedArray;function apply(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function arrayAggregator(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function arrayEach(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function arrayEachRight(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function arrayEvery(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function arrayFilter(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function arrayIncludes(e,t){return!!(null==e?0:e.length)&&baseIndexOf(e,t,0)>-1}function arrayIncludesWith(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function arrayPush(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function arrayReduce(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function arrayReduceRight(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function arraySome(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Rt=baseProperty("length");function baseFindKey(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function baseFindIndex(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function baseIndexOf(e,t,r){return t==t?function strictIndexOf(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):baseFindIndex(e,baseIsNaN,r)}function baseIndexOfWith(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function baseIsNaN(e){return e!=e}function baseMean(e,t){var r=null==e?0:e.length;return r?baseSum(e,t)/r:y}function baseProperty(e){return function(t){return null==t?i:t[e]}}function basePropertyOf(e){return function(t){return null==e?i:e[t]}}function baseReduce(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function baseSum(e,t){for(var r,n=-1,o=e.length;++n<o;){var a=t(e[n]);a!==i&&(r=r===i?a:r+a)}return r}function baseTimes(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function baseTrim(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(se,""):e}function baseUnary(e){return function(t){return e(t)}}function baseValues(e,t){return arrayMap(t,(function(t){return e[t]}))}function cacheHas(e,t){return e.has(t)}function charsStartIndex(e,t){for(var r=-1,n=e.length;++r<n&&baseIndexOf(t,e[r],0)>-1;);return r}function charsEndIndex(e,t){for(var r=e.length;r--&&baseIndexOf(t,e[r],0)>-1;);return r}function countHolders(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var It=basePropertyOf({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Et=basePropertyOf({"&":"&","<":"<",">":">",'"':""","'":"'"});function escapeStringChar(e){return"\\"+lt[e]}function hasUnicode(e){return nt.test(e)}function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function overArg(e,t){return function(r){return e(t(r))}}function replaceHolders(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r];a!==t&&a!==s||(e[r]=s,o[i++]=r)}return o}function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function setToPairs(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function stringSize(e){return hasUnicode(e)?function unicodeSize(e){var t=tt.lastIndex=0;for(;tt.test(e);)++t;return t}(e):Rt(e)}function stringToArray(e){return hasUnicode(e)?function unicodeToArray(e){return e.match(tt)||[]}(e):function asciiToArray(e){return e.split("")}(e)}function trimmedEndIndex(e){for(var t=e.length;t--&&ce.test(e.charAt(t)););return t}var Lt=basePropertyOf({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Mt=function runInContext(e){var t,r=(e=null==e?ht:Mt.defaults(ht.Object(),e,Mt.pick(ht,ot))).Array,n=e.Date,ce=e.Error,Oe=e.Function,Re=e.Math,Ie=e.Object,Ee=e.RegExp,Le=e.String,Me=e.TypeError,Ae=r.prototype,De=Oe.prototype,Pe=Ie.prototype,je=e["__core-js_shared__"],ke=De.toString,xe=Pe.hasOwnProperty,Fe=0,Ne=(t=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",ze=Pe.toString,Be=ke.call(Ie),Ue=ht._,We=Ee("^"+ke.call(xe).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=mt?e.Buffer:i,Ve=e.Symbol,Ge=e.Uint8Array,Ke=qe?qe.allocUnsafe:i,$e=overArg(Ie.getPrototypeOf,Ie),He=Ie.create,Je=Pe.propertyIsEnumerable,Ze=Ae.splice,Ye=Ve?Ve.isConcatSpreadable:i,Qe=Ve?Ve.iterator:i,tt=Ve?Ve.toStringTag:i,nt=function(){try{var e=getNative(Ie,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=e.clearTimeout!==ht.clearTimeout&&e.clearTimeout,ft=n&&n.now!==ht.Date.now&&n.now,dt=e.setTimeout!==ht.setTimeout&&e.setTimeout,gt=Re.ceil,yt=Re.floor,vt=Ie.getOwnPropertySymbols,wt=qe?qe.isBuffer:i,Rt=e.isFinite,At=Ae.join,Dt=overArg(Ie.keys,Ie),Pt=Re.max,jt=Re.min,kt=n.now,xt=e.parseInt,Ft=Re.random,Nt=Ae.reverse,zt=getNative(e,"DataView"),Bt=getNative(e,"Map"),Ut=getNative(e,"Promise"),Wt=getNative(e,"Set"),qt=getNative(e,"WeakMap"),Vt=getNative(Ie,"create"),Gt=qt&&new qt,Kt={},$t=toSource(zt),Ht=toSource(Bt),Jt=toSource(Ut),Zt=toSource(Wt),Yt=toSource(qt),Qt=Ve?Ve.prototype:i,Xt=Qt?Qt.valueOf:i,er=Qt?Qt.toString:i;function lodash(e){if(isObjectLike(e)&&!on(e)&&!(e instanceof LazyWrapper)){if(e instanceof LodashWrapper)return e;if(xe.call(e,"__wrapped__"))return wrapperClone(e)}return new LodashWrapper(e)}var tr=function(){function object(){}return function(e){if(!isObject(e))return{};if(He)return He(e);object.prototype=e;var t=new object;return object.prototype=i,t}}();function baseLodash(){}function LodashWrapper(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function LazyWrapper(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayLikeKeys(e,t){var r=on(e),n=!r&&nn(e),i=!r&&!n&&sn(e),o=!r&&!n&&!i&&fn(e),a=r||n||i||o,s=a?baseTimes(e.length,Le):[],c=s.length;for(var l in e)!t&&!xe.call(e,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||isIndex(l,c))||s.push(l);return s}function arraySample(e){var t=e.length;return t?e[baseRandom(0,t-1)]:i}function arraySampleSize(e,t){return shuffleSelf(copyArray(e),baseClamp(t,0,e.length))}function arrayShuffle(e){return shuffleSelf(copyArray(e))}function assignMergeValue(e,t,r){(r!==i&&!eq(e[t],r)||r===i&&!(t in e))&&baseAssignValue(e,t,r)}function assignValue(e,t,r){var n=e[t];xe.call(e,t)&&eq(n,r)&&(r!==i||t in e)||baseAssignValue(e,t,r)}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseAggregator(e,t,r,n){return rr(e,(function(e,i,o){t(n,e,r(e),o)})),n}function baseAssign(e,t){return e&©Object(t,keys(t),e)}function baseAssignValue(e,t,r){"__proto__"==t&&nt?nt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function baseAt(e,t){for(var n=-1,o=t.length,a=r(o),s=null==e;++n<o;)a[n]=s?i:get(e,t[n]);return a}function baseClamp(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function baseClone(e,t,r,n,o,a){var s,c=1&t,l=2&t,u=4&t;if(r&&(s=o?r(e,n,o,a):r(e)),s!==i)return s;if(!isObject(e))return e;var p=on(e);if(p){if(s=function initCloneArray(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return copyArray(e,s)}else{var d=hr(e),h=d==T||d==O;if(sn(e))return cloneBuffer(e,c);if(d==E||d==w||h&&!o){if(s=l||h?{}:initCloneObject(e),!c)return l?function copySymbolsIn(e,t){return copyObject(e,dr(e),t)}(e,function baseAssignIn(e,t){return e&©Object(t,keysIn(t),e)}(s,e)):function copySymbols(e,t){return copyObject(e,fr(e),t)}(e,baseAssign(s,e))}else{if(!ct[d])return o?e:{};s=function initCloneByTag(e,t,r){var n=e.constructor;switch(t){case k:return cloneArrayBuffer(e);case C:case _:return new n(+e);case x:return function cloneDataView(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case F:case N:case z:case B:case U:case W:case q:case V:case G:return cloneTypedArray(e,r);case R:return new n;case I:case D:return new n(e);case M:return function cloneRegExp(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new n;case P:return function cloneSymbol(e){return Xt?Ie(Xt.call(e)):{}}(e)}}(e,d,c)}}a||(a=new Stack);var g=a.get(e);if(g)return g;a.set(e,s),pn(e)?e.forEach((function(n){s.add(baseClone(n,t,r,n,e,a))})):ln(e)&&e.forEach((function(n,i){s.set(i,baseClone(n,t,r,i,e,a))}));var y=p?i:(u?l?getAllKeysIn:getAllKeys:l?keysIn:keys)(e);return arrayEach(y||e,(function(n,i){y&&(n=e[i=n]),assignValue(s,i,baseClone(n,t,r,i,e,a))})),s}function baseConformsTo(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ie(e);n--;){var o=r[n],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function baseDelay(e,t,r){if("function"!=typeof e)throw new Me(o);return mr((function(){e.apply(i,r)}),t)}function baseDifference(e,t,r,n){var i=-1,o=arrayIncludes,a=!0,s=e.length,c=[],l=t.length;if(!s)return c;r&&(t=arrayMap(t,baseUnary(r))),n?(o=arrayIncludesWith,a=!1):t.length>=200&&(o=cacheHas,a=!1,t=new SetCache(t));e:for(;++i<s;){var u=e[i],p=null==r?u:r(u);if(u=n||0!==u?u:0,a&&p==p){for(var d=l;d--;)if(t[d]===p)continue e;c.push(u)}else o(t,p,n)||c.push(u)}return c}lodash.templateSettings={escape:X,evaluate:ee,interpolate:te,variable:"",imports:{_:lodash}},lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=tr(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=tr(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=function hashClear(){this.__data__=Vt?Vt(null):{},this.size=0},Hash.prototype.delete=function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hash.prototype.get=function hashGet(e){var t=this.__data__;if(Vt){var r=t[e];return r===a?i:r}return xe.call(t,e)?t[e]:i},Hash.prototype.has=function hashHas(e){var t=this.__data__;return Vt?t[e]!==i:xe.call(t,e)},Hash.prototype.set=function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Vt&&t===i?a:t,this},ListCache.prototype.clear=function listCacheClear(){this.__data__=[],this.size=0},ListCache.prototype.delete=function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ze.call(t,r,1),--this.size,!0)},ListCache.prototype.get=function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?i:t[r][1]},ListCache.prototype.has=function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1},ListCache.prototype.set=function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},MapCache.prototype.clear=function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Bt||ListCache),string:new Hash}},MapCache.prototype.delete=function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t},MapCache.prototype.get=function mapCacheGet(e){return getMapData(this,e).get(e)},MapCache.prototype.has=function mapCacheHas(e){return getMapData(this,e).has(e)},MapCache.prototype.set=function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},SetCache.prototype.add=SetCache.prototype.push=function setCacheAdd(e){return this.__data__.set(e,a),this},SetCache.prototype.has=function setCacheHas(e){return this.__data__.has(e)},Stack.prototype.clear=function stackClear(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Stack.prototype.get=function stackGet(e){return this.__data__.get(e)},Stack.prototype.has=function stackHas(e){return this.__data__.has(e)},Stack.prototype.set=function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var n=r.__data__;if(!Bt||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(n)}return r.set(e,t),this.size=r.size,this};var rr=createBaseEach(baseForOwn),nr=createBaseEach(baseForOwnRight,!0);function baseEvery(e,t){var r=!0;return rr(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function baseExtremum(e,t,r){for(var n=-1,o=e.length;++n<o;){var a=e[n],s=t(a);if(null!=s&&(c===i?s==s&&!isSymbol(s):r(s,c)))var c=s,l=a}return l}function baseFilter(e,t){var r=[];return rr(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function baseFlatten(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=isFlattenable),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?baseFlatten(s,t-1,r,n,i):arrayPush(i,s):n||(i[i.length]=s)}return i}var ir=createBaseFor(),or=createBaseFor(!0);function baseForOwn(e,t){return e&&ir(e,t,keys)}function baseForOwnRight(e,t){return e&&or(e,t,keys)}function baseFunctions(e,t){return arrayFilter(t,(function(t){return isFunction(e[t])}))}function baseGet(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:i}function baseGetAllKeys(e,t,r){var n=t(e);return on(e)?n:arrayPush(n,r(e))}function baseGetTag(e){return null==e?e===i?"[object Undefined]":"[object Null]":tt&&tt in Ie(e)?function getRawTag(e){var t=xe.call(e,tt),r=e[tt];try{e[tt]=i;var n=!0}catch(e){}var o=ze.call(e);n&&(t?e[tt]=r:delete e[tt]);return o}(e):function objectToString(e){return ze.call(e)}(e)}function baseGt(e,t){return e>t}function baseHas(e,t){return null!=e&&xe.call(e,t)}function baseHasIn(e,t){return null!=e&&t in Ie(e)}function baseIntersection(e,t,n){for(var o=n?arrayIncludesWith:arrayIncludes,a=e[0].length,s=e.length,c=s,l=r(s),u=1/0,p=[];c--;){var d=e[c];c&&t&&(d=arrayMap(d,baseUnary(t))),u=jt(d.length,u),l[c]=!n&&(t||a>=120&&d.length>=120)?new SetCache(c&&d):i}d=e[0];var h=-1,g=l[0];e:for(;++h<a&&p.length<u;){var y=d[h],m=t?t(y):y;if(y=n||0!==y?y:0,!(g?cacheHas(g,m):o(p,m,n))){for(c=s;--c;){var v=l[c];if(!(v?cacheHas(v,m):o(e[c],m,n)))continue e}g&&g.push(m),p.push(y)}}return p}function baseInvoke(e,t,r){var n=null==(e=parent(e,t=castPath(t,e)))?e:e[toKey(last(t))];return null==n?i:apply(n,e,r)}function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==w}function baseIsEqual(e,t,r,n,o){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:function baseIsEqualDeep(e,t,r,n,o,a){var s=on(e),c=on(t),l=s?b:hr(e),u=c?b:hr(t),p=(l=l==w?E:l)==E,d=(u=u==w?E:u)==E,h=l==u;if(h&&sn(e)){if(!sn(t))return!1;s=!0,p=!1}if(h&&!p)return a||(a=new Stack),s||fn(e)?equalArrays(e,t,r,n,o,a):function equalByTag(e,t,r,n,i,o,a){switch(r){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!o(new Ge(e),new Ge(t)));case C:case _:case I:return eq(+e,+t);case S:return e.name==t.name&&e.message==t.message;case M:case D:return e==t+"";case R:var s=mapToArray;case A:var c=1&n;if(s||(s=setToArray),e.size!=t.size&&!c)return!1;var l=a.get(e);if(l)return l==t;n|=2,a.set(e,t);var u=equalArrays(s(e),s(t),n,i,o,a);return a.delete(e),u;case P:if(Xt)return Xt.call(e)==Xt.call(t)}return!1}(e,t,l,r,n,o,a);if(!(1&r)){var g=p&&xe.call(e,"__wrapped__"),y=d&&xe.call(t,"__wrapped__");if(g||y){var m=g?e.value():e,v=y?t.value():t;return a||(a=new Stack),o(m,v,r,n,a)}}if(!h)return!1;return a||(a=new Stack),function equalObjects(e,t,r,n,o,a){var s=1&r,c=getAllKeys(e),l=c.length,u=getAllKeys(t).length;if(l!=u&&!s)return!1;var p=l;for(;p--;){var d=c[p];if(!(s?d in t:xe.call(t,d)))return!1}var h=a.get(e),g=a.get(t);if(h&&g)return h==t&&g==e;var y=!0;a.set(e,t),a.set(t,e);var m=s;for(;++p<l;){var v=e[d=c[p]],w=t[d];if(n)var b=s?n(w,v,d,t,e,a):n(v,w,d,e,t,a);if(!(b===i?v===w||o(v,w,r,n,a):b)){y=!1;break}m||(m="constructor"==d)}if(y&&!m){var C=e.constructor,_=t.constructor;C==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof C&&C instanceof C&&"function"==typeof _&&_ instanceof _||(y=!1)}return a.delete(e),a.delete(t),y}(e,t,r,n,o,a)}(e,t,r,n,baseIsEqual,o))}function baseIsMatch(e,t,r,n){var o=r.length,a=o,s=!n;if(null==e)return!a;for(e=Ie(e);o--;){var c=r[o];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<a;){var l=(c=r[o])[0],u=e[l],p=c[1];if(s&&c[2]){if(u===i&&!(l in e))return!1}else{var d=new Stack;if(n)var h=n(u,p,l,e,t,d);if(!(h===i?baseIsEqual(p,u,3,n,d):h))return!1}}return!0}function baseIsNative(e){return!(!isObject(e)||function isMasked(e){return!!Ne&&Ne in e}(e))&&(isFunction(e)?We:we).test(toSource(e))}function baseIteratee(e){return"function"==typeof e?e:null==e?identity:"object"==typeof e?on(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function baseKeys(e){if(!isPrototype(e))return Dt(e);var t=[];for(var r in Ie(e))xe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function baseKeysIn(e){if(!isObject(e))return function nativeKeysIn(e){var t=[];if(null!=e)for(var r in Ie(e))t.push(r);return t}(e);var t=isPrototype(e),r=[];for(var n in e)("constructor"!=n||!t&&xe.call(e,n))&&r.push(n);return r}function baseLt(e,t){return e<t}function baseMap(e,t){var n=-1,i=isArrayLike(e)?r(e.length):[];return rr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function baseMatches(e){var t=getMatchData(e);return 1==t.length&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||baseIsMatch(r,e,t)}}function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(r){var n=get(r,e);return n===i&&n===t?hasIn(r,e):baseIsEqual(t,n,3)}}function baseMerge(e,t,r,n,o){e!==t&&ir(t,(function(a,s){if(o||(o=new Stack),isObject(a))!function baseMergeDeep(e,t,r,n,o,a,s){var c=safeGet(e,r),l=safeGet(t,r),u=s.get(l);if(u)return void assignMergeValue(e,r,u);var p=a?a(c,l,r+"",e,t,s):i,d=p===i;if(d){var h=on(l),g=!h&&sn(l),y=!h&&!g&&fn(l);p=l,h||g||y?on(c)?p=c:isArrayLikeObject(c)?p=copyArray(c):g?(d=!1,p=cloneBuffer(l,!0)):y?(d=!1,p=cloneTypedArray(l,!0)):p=[]:isPlainObject(l)||nn(l)?(p=c,nn(c)?p=toPlainObject(c):isObject(c)&&!isFunction(c)||(p=initCloneObject(l))):d=!1}d&&(s.set(l,p),o(p,l,n,a,s),s.delete(l));assignMergeValue(e,r,p)}(e,t,s,r,baseMerge,n,o);else{var c=n?n(safeGet(e,s),a,s+"",e,t,o):i;c===i&&(c=a),assignMergeValue(e,s,c)}}),keysIn)}function baseNth(e,t){var r=e.length;if(r)return isIndex(t+=t<0?r:0,r)?e[t]:i}function baseOrderBy(e,t,r){t=t.length?arrayMap(t,(function(e){return on(e)?function(t){return baseGet(t,1===e.length?e[0]:e)}:e})):[identity];var n=-1;t=arrayMap(t,baseUnary(getIteratee()));var i=baseMap(e,(function(e,r,i){var o=arrayMap(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function baseSortBy(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function compareMultiple(e,t,r){var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;for(;++n<a;){var c=compareAscending(i[n],o[n]);if(c)return n>=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function basePickBy(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=baseGet(e,a);r(s,a)&&baseSet(o,castPath(a,e),s)}return o}function basePullAll(e,t,r,n){var i=n?baseIndexOfWith:baseIndexOf,o=-1,a=t.length,s=e;for(e===t&&(t=copyArray(t)),r&&(s=arrayMap(e,baseUnary(r)));++o<a;)for(var c=0,l=t[o],u=r?r(l):l;(c=i(s,u,c,n))>-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function basePullAt(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;isIndex(i)?Ze.call(e,i,1):baseUnset(e,i)}}return e}function baseRandom(e,t){return e+yt(Ft()*(t-e+1))}function baseRepeat(e,t){var r="";if(!e||t<1||t>g)return r;do{t%2&&(r+=e),(t=yt(t/2))&&(e+=e)}while(t);return r}function baseRest(e,t){return vr(overRest(e,t,identity),e+"")}function baseSample(e){return arraySample(values(e))}function baseSampleSize(e,t){var r=values(e);return shuffleSelf(r,baseClamp(t,0,r.length))}function baseSet(e,t,r,n){if(!isObject(e))return e;for(var o=-1,a=(t=castPath(t,e)).length,s=a-1,c=e;null!=c&&++o<a;){var l=toKey(t[o]),u=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=s){var p=c[l];(u=n?n(p,l,c):i)===i&&(u=isObject(p)?p:isIndex(t[o+1])?[]:{})}assignValue(c,l,u),c=c[l]}return e}var ar=Gt?function(e,t){return Gt.set(e,t),e}:identity,sr=nt?function(e,t){return nt(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity;function baseShuffle(e){return shuffleSelf(values(e))}function baseSlice(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function baseSome(e,t){var r;return rr(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function baseSortedIndex(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!isSymbol(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return baseSortedIndexBy(e,t,identity,r)}function baseSortedIndexBy(e,t,r,n){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,c=null===t,l=isSymbol(t),u=t===i;o<a;){var p=yt((o+a)/2),d=r(e[p]),h=d!==i,g=null===d,y=d==d,m=isSymbol(d);if(s)var v=n||y;else v=u?y&&(n||h):c?y&&h&&(n||!g):l?y&&h&&!g&&(n||!m):!g&&!m&&(n?d<=t:d<t);v?o=p+1:a=p}return jt(a,4294967294)}function baseSortedUniq(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!eq(s,c)){var c=s;o[i++]=0===a?0:a}}return o}function baseToNumber(e){return"number"==typeof e?e:isSymbol(e)?y:+e}function baseToString(e){if("string"==typeof e)return e;if(on(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return er?er.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseUniq(e,t,r){var n=-1,i=arrayIncludes,o=e.length,a=!0,s=[],c=s;if(r)a=!1,i=arrayIncludesWith;else if(o>=200){var l=t?null:ur(e);if(l)return setToArray(l);a=!1,i=cacheHas,c=new SetCache}else c=t?[]:s;e:for(;++n<o;){var u=e[n],p=t?t(u):u;if(u=r||0!==u?u:0,a&&p==p){for(var d=c.length;d--;)if(c[d]===p)continue e;t&&c.push(p),s.push(u)}else i(c,p,r)||(c!==s&&c.push(p),s.push(u))}return s}function baseUnset(e,t){return null==(e=parent(e,t=castPath(t,e)))||delete e[toKey(last(t))]}function baseUpdate(e,t,r,n){return baseSet(e,t,r(baseGet(e,t)),n)}function baseWhile(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?baseSlice(e,n?0:o,n?o+1:i):baseSlice(e,n?o+1:0,n?i:o)}function baseWrapperValue(e,t){var r=e;return r instanceof LazyWrapper&&(r=r.value()),arrayReduce(t,(function(e,t){return t.func.apply(t.thisArg,arrayPush([e],t.args))}),r)}function baseXor(e,t,n){var i=e.length;if(i<2)return i?baseUniq(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],c=-1;++c<i;)c!=o&&(a[o]=baseDifference(a[o]||s,e[c],t,n));return baseUniq(baseFlatten(a,1),t,n)}function baseZipObject(e,t,r){for(var n=-1,o=e.length,a=t.length,s={};++n<o;){var c=n<a?t[n]:i;r(s,e[n],c)}return s}function castArrayLikeObject(e){return isArrayLikeObject(e)?e:[]}function castFunction(e){return"function"==typeof e?e:identity}function castPath(e,t){return on(e)?e:isKey(e,t)?[e]:wr(toString(e))}var cr=baseRest;function castSlice(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:baseSlice(e,t,r)}var lr=lt||function(e){return ht.clearTimeout(e)};function cloneBuffer(e,t){if(t)return e.slice();var r=e.length,n=Ke?Ke(r):new e.constructor(r);return e.copy(n),n}function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function compareAscending(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,a=isSymbol(e),s=t!==i,c=null===t,l=t==t,u=isSymbol(t);if(!c&&!u&&!a&&e>t||a&&s&&l&&!c&&!u||n&&s&&l||!r&&l||!o)return 1;if(!n&&!a&&!u&&e<t||u&&r&&o&&!n&&!a||c&&r&&o||!s&&o||!l)return-1}return 0}function composeArgs(e,t,n,i){for(var o=-1,a=e.length,s=n.length,c=-1,l=t.length,u=Pt(a-s,0),p=r(l+u),d=!i;++c<l;)p[c]=t[c];for(;++o<s;)(d||o<a)&&(p[n[o]]=e[o]);for(;u--;)p[c++]=e[o++];return p}function composeArgsRight(e,t,n,i){for(var o=-1,a=e.length,s=-1,c=n.length,l=-1,u=t.length,p=Pt(a-c,0),d=r(p+u),h=!i;++o<p;)d[o]=e[o];for(var g=o;++l<u;)d[g+l]=t[l];for(;++s<c;)(h||o<a)&&(d[g+n[s]]=e[o++]);return d}function copyArray(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function copyObject(e,t,r,n){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var c=t[a],l=n?n(r[c],e[c],c,r,e):i;l===i&&(l=e[c]),o?baseAssignValue(r,c,l):assignValue(r,c,l)}return r}function createAggregator(e,t){return function(r,n){var i=on(r)?arrayAggregator:baseAggregator,o=t?t():{};return i(r,e,getIteratee(n,2),o)}}function createAssigner(e){return baseRest((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:i,s=o>2?r[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&isIterateeCall(r[0],r[1],s)&&(a=o<3?i:a,o=1),t=Ie(t);++n<o;){var c=r[n];c&&e(t,c,n,a)}return t}))}function createBaseEach(e,t){return function(r,n){if(null==r)return r;if(!isArrayLike(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Ie(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function createBaseFor(e){return function(t,r,n){for(var i=-1,o=Ie(t),a=n(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===r(o[c],c,o))break}return t}}function createCaseFirst(e){return function(t){var r=hasUnicode(t=toString(t))?stringToArray(t):i,n=r?r[0]:t.charAt(0),o=r?castSlice(r,1).join(""):t.slice(1);return n[e]()+o}}function createCompounder(e){return function(t){return arrayReduce(words(deburr(t).replace(Xe,"")),e,"")}}function createCtor(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=tr(e.prototype),n=e.apply(r,t);return isObject(n)?n:r}}function createFind(e){return function(t,r,n){var o=Ie(t);if(!isArrayLike(t)){var a=getIteratee(r,3);t=keys(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,n);return s>-1?o[a?t[s]:s]:i}}function createFlow(e){return flatRest((function(t){var r=t.length,n=r,a=LodashWrapper.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new Me(o);if(a&&!c&&"wrapper"==getFuncName(s))var c=new LodashWrapper([],!0)}for(n=c?n:r;++n<r;){var l=getFuncName(s=t[n]),u="wrapper"==l?pr(s):i;c=u&&isLaziable(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[getFuncName(u[0])].apply(c,u[3]):1==s.length&&isLaziable(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&1==e.length&&on(n))return c.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function createHybrid(e,t,n,o,a,s,c,l,u,d){var h=t&p,g=1&t,y=2&t,m=24&t,v=512&t,w=y?i:createCtor(e);return function wrapper(){for(var i=arguments.length,p=r(i),b=i;b--;)p[b]=arguments[b];if(m)var C=getHolder(wrapper),_=countHolders(p,C);if(o&&(p=composeArgs(p,o,a,m)),s&&(p=composeArgsRight(p,s,c,m)),i-=_,m&&i<d){var S=replaceHolders(p,C);return createRecurry(e,t,createHybrid,wrapper.placeholder,n,p,S,l,u,d-i)}var T=g?n:this,O=y?T[e]:e;return i=p.length,l?p=reorder(p,l):v&&i>1&&p.reverse(),h&&u<i&&(p.length=u),this&&this!==ht&&this instanceof wrapper&&(O=w||createCtor(O)),O.apply(T,p)}}function createInverter(e,t){return function(r,n){return function baseInverter(e,t,r,n){return baseForOwn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function createMathOperation(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=baseToString(r),n=baseToString(n)):(r=baseToNumber(r),n=baseToNumber(n)),o=e(r,n)}return o}}function createOver(e){return flatRest((function(t){return t=arrayMap(t,baseUnary(getIteratee())),baseRest((function(r){var n=this;return e(t,(function(e){return apply(e,n,r)}))}))}))}function createPadding(e,t){var r=(t=t===i?" ":baseToString(t)).length;if(r<2)return r?baseRepeat(t,e):t;var n=baseRepeat(t,gt(e/stringSize(t)));return hasUnicode(t)?castSlice(stringToArray(n),0,e).join(""):n.slice(0,e)}function createRange(e){return function(t,n,o){return o&&"number"!=typeof o&&isIterateeCall(t,n,o)&&(n=o=i),t=toFinite(t),n===i?(n=t,t=0):n=toFinite(n),function baseRange(e,t,n,i){for(var o=-1,a=Pt(gt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,o=o===i?t<n?1:-1:toFinite(o),e)}}function createRelationalOperation(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=toNumber(t),r=toNumber(r)),e(t,r)}}function createRecurry(e,t,r,n,o,a,s,c,p,d){var h=8&t;t|=h?l:u,4&(t&=~(h?u:l))||(t&=-4);var g=[e,t,o,h?a:i,h?s:i,h?i:a,h?i:s,c,p,d],y=r.apply(i,g);return isLaziable(e)&&yr(y,g),y.placeholder=n,setWrapToString(y,e,t)}function createRound(e){var t=Re[e];return function(e,r){if(e=toNumber(e),(r=null==r?0:jt(toInteger(r),292))&&Rt(e)){var n=(toString(e)+"e").split("e");return+((n=(toString(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var ur=Wt&&1/setToArray(new Wt([,-0]))[1]==h?function(e){return new Wt(e)}:noop;function createToPairs(e){return function(t){var r=hr(t);return r==R?mapToArray(t):r==A?setToPairs(t):function baseToPairs(e,t){return arrayMap(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function createWrap(e,t,n,a,h,g,y,m){var v=2&t;if(!v&&"function"!=typeof e)throw new Me(o);var w=a?a.length:0;if(w||(t&=-97,a=h=i),y=y===i?y:Pt(toInteger(y),0),m=m===i?m:toInteger(m),w-=h?h.length:0,t&u){var b=a,C=h;a=h=i}var _=v?i:pr(e),S=[e,t,n,a,h,b,C,g,y,m];if(_&&function mergeData(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,a=n==p&&8==r||n==p&&r==d&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!a)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var l=e[3];e[3]=l?composeArgs(l,c,t[4]):c,e[4]=l?replaceHolders(e[3],s):t[4]}(c=t[5])&&(l=e[5],e[5]=l?composeArgsRight(l,c,t[6]):c,e[6]=l?replaceHolders(e[5],s):t[6]);(c=t[7])&&(e[7]=c);n&p&&(e[8]=null==e[8]?t[8]:jt(e[8],t[8]));null==e[9]&&(e[9]=t[9]);return e[0]=t[0],e[1]=i,e}(S,_),e=S[0],t=S[1],n=S[2],a=S[3],h=S[4],!(m=S[9]=S[9]===i?v?0:e.length:Pt(S[9]-w,0))&&24&t&&(t&=-25),t&&1!=t)T=8==t||t==c?function createCurry(e,t,n){var o=createCtor(e);return function wrapper(){for(var a=arguments.length,s=r(a),c=a,l=getHolder(wrapper);c--;)s[c]=arguments[c];var u=a<3&&s[0]!==l&&s[a-1]!==l?[]:replaceHolders(s,l);return(a-=u.length)<n?createRecurry(e,t,createHybrid,wrapper.placeholder,i,s,u,i,i,n-a):apply(this&&this!==ht&&this instanceof wrapper?o:e,this,s)}}(e,t,m):t!=l&&33!=t||h.length?createHybrid.apply(i,S):function createPartial(e,t,n,i){var o=1&t,a=createCtor(e);return function wrapper(){for(var t=-1,s=arguments.length,c=-1,l=i.length,u=r(l+s),p=this&&this!==ht&&this instanceof wrapper?a:e;++c<l;)u[c]=i[c];for(;s--;)u[c++]=arguments[++t];return apply(p,o?n:this,u)}}(e,t,n,a);else var T=function createBind(e,t,r){var n=1&t,i=createCtor(e);return function wrapper(){return(this&&this!==ht&&this instanceof wrapper?i:e).apply(n?r:this,arguments)}}(e,t,n);return setWrapToString((_?ar:yr)(T,S),e,t)}function customDefaultsAssignIn(e,t,r,n){return e===i||eq(e,Pe[r])&&!xe.call(n,r)?t:e}function customDefaultsMerge(e,t,r,n,o,a){return isObject(e)&&isObject(t)&&(a.set(t,e),baseMerge(e,t,i,customDefaultsMerge,a),a.delete(t)),e}function customOmitClone(e){return isPlainObject(e)?i:e}function equalArrays(e,t,r,n,o,a){var s=1&r,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=a.get(e),p=a.get(t);if(u&&p)return u==t&&p==e;var d=-1,h=!0,g=2&r?new SetCache:i;for(a.set(e,t),a.set(t,e);++d<c;){var y=e[d],m=t[d];if(n)var v=s?n(m,y,d,t,e,a):n(y,m,d,e,t,a);if(v!==i){if(v)continue;h=!1;break}if(g){if(!arraySome(t,(function(e,t){if(!cacheHas(g,t)&&(y===e||o(y,e,r,n,a)))return g.push(t)}))){h=!1;break}}else if(y!==m&&!o(y,m,r,n,a)){h=!1;break}}return a.delete(e),a.delete(t),h}function flatRest(e){return vr(overRest(e,i,flatten),e+"")}function getAllKeys(e){return baseGetAllKeys(e,keys,fr)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,dr)}var pr=Gt?function(e){return Gt.get(e)}:noop;function getFuncName(e){for(var t=e.name+"",r=Kt[t],n=xe.call(Kt,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function getHolder(e){return(xe.call(lodash,"placeholder")?lodash:e).placeholder}function getIteratee(){var e=lodash.iteratee||iteratee;return e=e===iteratee?baseIteratee:e,arguments.length?e(arguments[0],arguments[1]):e}function getMapData(e,t){var r=e.__data__;return function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function getMatchData(e){for(var t=keys(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,isStrictComparable(i)]}return t}function getNative(e,t){var r=function getValue(e,t){return null==e?i:e[t]}(e,t);return baseIsNative(r)?r:i}var fr=vt?function(e){return null==e?[]:(e=Ie(e),arrayFilter(vt(e),(function(t){return Je.call(e,t)})))}:stubArray,dr=vt?function(e){for(var t=[];e;)arrayPush(t,fr(e)),e=$e(e);return t}:stubArray,hr=baseGetTag;function hasPath(e,t,r){for(var n=-1,i=(t=castPath(t,e)).length,o=!1;++n<i;){var a=toKey(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&isLength(i)&&isIndex(a,i)&&(on(e)||nn(e))}function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:tr($e(e))}function isFlattenable(e){return on(e)||nn(e)||!!(Ye&&e&&e[Ye])}function isIndex(e,t){var r=typeof e;return!!(t=null==t?g:t)&&("number"==r||"symbol"!=r&&Ce.test(e))&&e>-1&&e%1==0&&e<t}function isIterateeCall(e,t,r){if(!isObject(r))return!1;var n=typeof t;return!!("number"==n?isArrayLike(r)&&isIndex(t,r.length):"string"==n&&t in r)&&eq(r[t],e)}function isKey(e,t){if(on(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(ne.test(e)||!re.test(e)||null!=t&&e in Ie(t))}function isLaziable(e){var t=getFuncName(e),r=lodash[t];if("function"!=typeof r||!(t in LazyWrapper.prototype))return!1;if(e===r)return!0;var n=pr(r);return!!n&&e===n[0]}(zt&&hr(new zt(new ArrayBuffer(1)))!=x||Bt&&hr(new Bt)!=R||Ut&&hr(Ut.resolve())!=L||Wt&&hr(new Wt)!=A||qt&&hr(new qt)!=j)&&(hr=function(e){var t=baseGetTag(e),r=t==E?e.constructor:i,n=r?toSource(r):"";if(n)switch(n){case $t:return x;case Ht:return R;case Jt:return L;case Zt:return A;case Yt:return j}return t});var gr=je?isFunction:stubFalse;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)}function isStrictComparable(e){return e==e&&!isObject(e)}function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==i||e in Ie(r)))}}function overRest(e,t,n){return t=Pt(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=Pt(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var c=r(t+1);++o<t;)c[o]=i[o];return c[t]=n(s),apply(e,this,c)}}function parent(e,t){return t.length<2?e:baseGet(e,baseSlice(t,0,-1))}function reorder(e,t){for(var r=e.length,n=jt(t.length,r),o=copyArray(e);n--;){var a=t[n];e[n]=isIndex(a,r)?o[a]:i}return e}function safeGet(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var yr=shortOut(ar),mr=dt||function(e,t){return ht.setTimeout(e,t)},vr=shortOut(sr);function setWrapToString(e,t,r){var n=t+"";return vr(e,function insertWrapDetails(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(n,function updateWrapDetails(e,t){return arrayEach(v,(function(r){var n="_."+r[0];t&r[1]&&!arrayIncludes(e,n)&&e.push(n)})),e.sort()}(function getWrapDetails(e){var t=e.match(ue);return t?t[1].split(pe):[]}(n),r)))}function shortOut(e){var t=0,r=0;return function(){var n=kt(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function shuffleSelf(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var a=baseRandom(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var wr=function memoizeCapped(e){var t=memoize(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ie,(function(e,r,n,i){t.push(n?i.replace(he,"$1"):r||e)})),t}));function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toSource(e){if(null!=e){try{return ke.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function wrapperClone(e){if(e instanceof LazyWrapper)return e.clone();var t=new LodashWrapper(e.__wrapped__,e.__chain__);return t.__actions__=copyArray(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var br=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0)):[]})),Cr=baseRest((function(e,t){var r=last(t);return isArrayLikeObject(r)&&(r=i),isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0),getIteratee(r,2)):[]})),_r=baseRest((function(e,t){var r=last(t);return isArrayLikeObject(r)&&(r=i),isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0),i,r):[]}));function findIndex(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:toInteger(r);return i<0&&(i=Pt(n+i,0)),baseFindIndex(e,getIteratee(t,3),i)}function findLastIndex(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=toInteger(r),o=r<0?Pt(n+o,0):jt(o,n-1)),baseFindIndex(e,getIteratee(t,3),o,!0)}function flatten(e){return(null==e?0:e.length)?baseFlatten(e,1):[]}function head(e){return e&&e.length?e[0]:i}var Sr=baseRest((function(e){var t=arrayMap(e,castArrayLikeObject);return t.length&&t[0]===e[0]?baseIntersection(t):[]})),Tr=baseRest((function(e){var t=last(e),r=arrayMap(e,castArrayLikeObject);return t===last(r)?t=i:r.pop(),r.length&&r[0]===e[0]?baseIntersection(r,getIteratee(t,2)):[]})),Or=baseRest((function(e){var t=last(e),r=arrayMap(e,castArrayLikeObject);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?baseIntersection(r,i,t):[]}));function last(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Rr=baseRest(pullAll);function pullAll(e,t){return e&&e.length&&t&&t.length?basePullAll(e,t):e}var Ir=flatRest((function(e,t){var r=null==e?0:e.length,n=baseAt(e,t);return basePullAt(e,arrayMap(t,(function(e){return isIndex(e,r)?+e:e})).sort(compareAscending)),n}));function reverse(e){return null==e?e:Nt.call(e)}var Er=baseRest((function(e){return baseUniq(baseFlatten(e,1,isArrayLikeObject,!0))})),Lr=baseRest((function(e){var t=last(e);return isArrayLikeObject(t)&&(t=i),baseUniq(baseFlatten(e,1,isArrayLikeObject,!0),getIteratee(t,2))})),Mr=baseRest((function(e){var t=last(e);return t="function"==typeof t?t:i,baseUniq(baseFlatten(e,1,isArrayLikeObject,!0),i,t)}));function unzip(e){if(!e||!e.length)return[];var t=0;return e=arrayFilter(e,(function(e){if(isArrayLikeObject(e))return t=Pt(e.length,t),!0})),baseTimes(t,(function(t){return arrayMap(e,baseProperty(t))}))}function unzipWith(e,t){if(!e||!e.length)return[];var r=unzip(e);return null==t?r:arrayMap(r,(function(e){return apply(t,i,e)}))}var Ar=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,t):[]})),Dr=baseRest((function(e){return baseXor(arrayFilter(e,isArrayLikeObject))})),Pr=baseRest((function(e){var t=last(e);return isArrayLikeObject(t)&&(t=i),baseXor(arrayFilter(e,isArrayLikeObject),getIteratee(t,2))})),jr=baseRest((function(e){var t=last(e);return t="function"==typeof t?t:i,baseXor(arrayFilter(e,isArrayLikeObject),i,t)})),kr=baseRest(unzip);var xr=baseRest((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,unzipWith(e,r)}));function chain(e){var t=lodash(e);return t.__chain__=!0,t}function thru(e,t){return t(e)}var Fr=flatRest((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,interceptor=function(t){return baseAt(t,e)};return!(t>1||this.__actions__.length)&&n instanceof LazyWrapper&&isIndex(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:thru,args:[interceptor],thisArg:i}),new LodashWrapper(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(interceptor)}));var Nr=createAggregator((function(e,t,r){xe.call(e,r)?++e[r]:baseAssignValue(e,r,1)}));var zr=createFind(findIndex),Br=createFind(findLastIndex);function forEach(e,t){return(on(e)?arrayEach:rr)(e,getIteratee(t,3))}function forEachRight(e,t){return(on(e)?arrayEachRight:nr)(e,getIteratee(t,3))}var Ur=createAggregator((function(e,t,r){xe.call(e,r)?e[r].push(t):baseAssignValue(e,r,[t])}));var Wr=baseRest((function(e,t,n){var i=-1,o="function"==typeof t,a=isArrayLike(e)?r(e.length):[];return rr(e,(function(e){a[++i]=o?apply(t,e,n):baseInvoke(e,t,n)})),a})),qr=createAggregator((function(e,t,r){baseAssignValue(e,r,t)}));function map(e,t){return(on(e)?arrayMap:baseMap)(e,getIteratee(t,3))}var Vr=createAggregator((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Gr=baseRest((function(e,t){if(null==e)return[];var r=t.length;return r>1&&isIterateeCall(e,t[0],t[1])?t=[]:r>2&&isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),baseOrderBy(e,baseFlatten(t,1),[])})),Kr=ft||function(){return ht.Date.now()};function ary(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,createWrap(e,p,i,i,i,i,t)}function before(e,t){var r;if("function"!=typeof t)throw new Me(o);return e=toInteger(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var $r=baseRest((function(e,t,r){var n=1;if(r.length){var i=replaceHolders(r,getHolder($r));n|=l}return createWrap(e,n,t,r,i)})),Hr=baseRest((function(e,t,r){var n=3;if(r.length){var i=replaceHolders(r,getHolder(Hr));n|=l}return createWrap(t,n,e,r,i)}));function debounce(e,t,r){var n,a,s,c,l,u,p=0,d=!1,h=!1,g=!0;if("function"!=typeof e)throw new Me(o);function invokeFunc(t){var r=n,o=a;return n=a=i,p=t,c=e.apply(o,r)}function leadingEdge(e){return p=e,l=mr(timerExpired,t),d?invokeFunc(e):c}function shouldInvoke(e){var r=e-u;return u===i||r>=t||r<0||h&&e-p>=s}function timerExpired(){var e=Kr();if(shouldInvoke(e))return trailingEdge(e);l=mr(timerExpired,function remainingWait(e){var r=t-(e-u);return h?jt(r,s-(e-p)):r}(e))}function trailingEdge(e){return l=i,g&&n?invokeFunc(e):(n=a=i,c)}function debounced(){var e=Kr(),r=shouldInvoke(e);if(n=arguments,a=this,u=e,r){if(l===i)return leadingEdge(u);if(h)return lr(l),l=mr(timerExpired,t),invokeFunc(u)}return l===i&&(l=mr(timerExpired,t)),c}return t=toNumber(t)||0,isObject(r)&&(d=!!r.leading,s=(h="maxWait"in r)?Pt(toNumber(r.maxWait)||0,t):s,g="trailing"in r?!!r.trailing:g),debounced.cancel=function cancel(){l!==i&&lr(l),p=0,n=u=a=l=i},debounced.flush=function flush(){return l===i?c:trailingEdge(Kr())},debounced}var Jr=baseRest((function(e,t){return baseDelay(e,1,t)})),Zr=baseRest((function(e,t,r){return baseDelay(e,toNumber(t)||0,r)}));function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(o);var memoized=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=memoized.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return memoized.cache=i.set(n,o)||i,o};return memoized.cache=new(memoize.Cache||MapCache),memoized}function negate(e){if("function"!=typeof e)throw new Me(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}memoize.Cache=MapCache;var Yr=cr((function(e,t){var r=(t=1==t.length&&on(t[0])?arrayMap(t[0],baseUnary(getIteratee())):arrayMap(baseFlatten(t,1),baseUnary(getIteratee()))).length;return baseRest((function(n){for(var i=-1,o=jt(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return apply(e,this,n)}))})),Qr=baseRest((function(e,t){var r=replaceHolders(t,getHolder(Qr));return createWrap(e,l,i,t,r)})),Xr=baseRest((function(e,t){var r=replaceHolders(t,getHolder(Xr));return createWrap(e,u,i,t,r)})),en=flatRest((function(e,t){return createWrap(e,d,i,i,i,t)}));function eq(e,t){return e===t||e!=e&&t!=t}var tn=createRelationalOperation(baseGt),rn=createRelationalOperation((function(e,t){return e>=t})),nn=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&xe.call(e,"callee")&&!Je.call(e,"callee")},on=r.isArray,an=bt?baseUnary(bt):function baseIsArrayBuffer(e){return isObjectLike(e)&&baseGetTag(e)==k};function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}var sn=wt||stubFalse,cn=Ct?baseUnary(Ct):function baseIsDate(e){return isObjectLike(e)&&baseGetTag(e)==_};function isError(e){if(!isObjectLike(e))return!1;var t=baseGetTag(e);return t==S||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!isPlainObject(e)}function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==T||t==O||"[object AsyncFunction]"==t||"[object Proxy]"==t}function isInteger(e){return"number"==typeof e&&e==toInteger(e)}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function isObjectLike(e){return null!=e&&"object"==typeof e}var ln=_t?baseUnary(_t):function baseIsMap(e){return isObjectLike(e)&&hr(e)==R};function isNumber(e){return"number"==typeof e||isObjectLike(e)&&baseGetTag(e)==I}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=E)return!1;var t=$e(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ke.call(r)==Be}var un=St?baseUnary(St):function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==M};var pn=Tt?baseUnary(Tt):function baseIsSet(e){return isObjectLike(e)&&hr(e)==A};function isString(e){return"string"==typeof e||!on(e)&&isObjectLike(e)&&baseGetTag(e)==D}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&baseGetTag(e)==P}var fn=Ot?baseUnary(Ot):function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!st[baseGetTag(e)]};var dn=createRelationalOperation(baseLt),hn=createRelationalOperation((function(e,t){return e<=t}));function toArray(e){if(!e)return[];if(isArrayLike(e))return isString(e)?stringToArray(e):copyArray(e);if(Qe&&e[Qe])return function iteratorToArray(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=hr(e);return(t==R?mapToArray:t==A?setToArray:values)(e)}function toFinite(e){return e?(e=toNumber(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function toInteger(e){var t=toFinite(e),r=t%1;return t==t?r?t-r:t:0}function toLength(e){return e?baseClamp(toInteger(e),0,m):0}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return y;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=baseTrim(e);var r=ve.test(e);return r||be.test(e)?pt(e.slice(2),r?2:8):me.test(e)?y:+e}function toPlainObject(e){return copyObject(e,keysIn(e))}function toString(e){return null==e?"":baseToString(e)}var gn=createAssigner((function(e,t){if(isPrototype(t)||isArrayLike(t))copyObject(t,keys(t),e);else for(var r in t)xe.call(t,r)&&assignValue(e,r,t[r])})),yn=createAssigner((function(e,t){copyObject(t,keysIn(t),e)})),mn=createAssigner((function(e,t,r,n){copyObject(t,keysIn(t),e,n)})),vn=createAssigner((function(e,t,r,n){copyObject(t,keys(t),e,n)})),wn=flatRest(baseAt);var bn=baseRest((function(e,t){e=Ie(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&isIterateeCall(t[0],t[1],o)&&(n=1);++r<n;)for(var a=t[r],s=keysIn(a),c=-1,l=s.length;++c<l;){var u=s[c],p=e[u];(p===i||eq(p,Pe[u])&&!xe.call(e,u))&&(e[u]=a[u])}return e})),Cn=baseRest((function(e){return e.push(i,customDefaultsMerge),apply(Rn,i,e)}));function get(e,t,r){var n=null==e?i:baseGet(e,t);return n===i?r:n}function hasIn(e,t){return null!=e&&hasPath(e,t,baseHasIn)}var _n=createInverter((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ze.call(t)),e[t]=r}),constant(identity)),Sn=createInverter((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ze.call(t)),xe.call(e,t)?e[t].push(r):e[t]=[r]}),getIteratee),Tn=baseRest(baseInvoke);function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var On=createAssigner((function(e,t,r){baseMerge(e,t,r)})),Rn=createAssigner((function(e,t,r,n){baseMerge(e,t,r,n)})),In=flatRest((function(e,t){var r={};if(null==e)return r;var n=!1;t=arrayMap(t,(function(t){return t=castPath(t,e),n||(n=t.length>1),t})),copyObject(e,getAllKeysIn(e),r),n&&(r=baseClone(r,7,customOmitClone));for(var i=t.length;i--;)baseUnset(r,t[i]);return r}));var En=flatRest((function(e,t){return null==e?{}:function basePick(e,t){return basePickBy(e,t,(function(t,r){return hasIn(e,r)}))}(e,t)}));function pickBy(e,t){if(null==e)return{};var r=arrayMap(getAllKeysIn(e),(function(e){return[e]}));return t=getIteratee(t),basePickBy(e,r,(function(e,r){return t(e,r[0])}))}var Ln=createToPairs(keys),Mn=createToPairs(keysIn);function values(e){return null==e?[]:baseValues(e,keys(e))}var An=createCompounder((function(e,t,r){return t=t.toLowerCase(),e+(r?capitalize(t):t)}));function capitalize(e){return Nn(toString(e).toLowerCase())}function deburr(e){return(e=toString(e))&&e.replace(_e,It).replace(et,"")}var Dn=createCompounder((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Pn=createCompounder((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),jn=createCaseFirst("toLowerCase");var kn=createCompounder((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var xn=createCompounder((function(e,t,r){return e+(r?" ":"")+Nn(t)}));var Fn=createCompounder((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Nn=createCaseFirst("toUpperCase");function words(e,t,r){return e=toString(e),(t=r?i:t)===i?function hasUnicodeWord(e){return it.test(e)}(e)?function unicodeWords(e){return e.match(rt)||[]}(e):function asciiWords(e){return e.match(fe)||[]}(e):e.match(t)||[]}var zn=baseRest((function(e,t){try{return apply(e,i,t)}catch(e){return isError(e)?e:new ce(e)}})),Bn=flatRest((function(e,t){return arrayEach(t,(function(t){t=toKey(t),baseAssignValue(e,t,$r(e[t],e))})),e}));function constant(e){return function(){return e}}var Un=createFlow(),Wn=createFlow(!0);function identity(e){return e}function iteratee(e){return baseIteratee("function"==typeof e?e:baseClone(e,1))}var qn=baseRest((function(e,t){return function(r){return baseInvoke(r,e,t)}})),Vn=baseRest((function(e,t){return function(r){return baseInvoke(e,r,t)}}));function mixin(e,t,r){var n=keys(t),i=baseFunctions(t,n);null!=r||isObject(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=baseFunctions(t,keys(t)));var o=!(isObject(r)&&"chain"in r&&!r.chain),a=isFunction(e);return arrayEach(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__),i=r.__actions__=copyArray(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,arrayPush([this.value()],arguments))})})),e}function noop(){}var Gn=createOver(arrayMap),Kn=createOver(arrayEvery),$n=createOver(arraySome);function property(e){return isKey(e)?baseProperty(toKey(e)):function basePropertyDeep(e){return function(t){return baseGet(t,e)}}(e)}var Hn=createRange(),Jn=createRange(!0);function stubArray(){return[]}function stubFalse(){return!1}var Zn=createMathOperation((function(e,t){return e+t}),0),Yn=createRound("ceil"),Qn=createMathOperation((function(e,t){return e/t}),1),Xn=createRound("floor");var ei,ti=createMathOperation((function(e,t){return e*t}),1),ri=createRound("round"),ni=createMathOperation((function(e,t){return e-t}),0);return lodash.after=function after(e,t){if("function"!=typeof t)throw new Me(o);return e=toInteger(e),function(){if(--e<1)return t.apply(this,arguments)}},lodash.ary=ary,lodash.assign=gn,lodash.assignIn=yn,lodash.assignInWith=mn,lodash.assignWith=vn,lodash.at=wn,lodash.before=before,lodash.bind=$r,lodash.bindAll=Bn,lodash.bindKey=Hr,lodash.castArray=function castArray(){if(!arguments.length)return[];var e=arguments[0];return on(e)?e:[e]},lodash.chain=chain,lodash.chunk=function chunk(e,t,n){t=(n?isIterateeCall(e,t,n):t===i)?1:Pt(toInteger(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,c=r(gt(o/t));a<o;)c[s++]=baseSlice(e,a,a+=t);return c},lodash.compact=function compact(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},lodash.concat=function concat(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return arrayPush(on(n)?copyArray(n):[n],baseFlatten(t,1))},lodash.cond=function cond(e){var t=null==e?0:e.length,r=getIteratee();return e=t?arrayMap(e,(function(e){if("function"!=typeof e[1])throw new Me(o);return[r(e[0]),e[1]]})):[],baseRest((function(r){for(var n=-1;++n<t;){var i=e[n];if(apply(i[0],this,r))return apply(i[1],this,r)}}))},lodash.conforms=function conforms(e){return function baseConforms(e){var t=keys(e);return function(r){return baseConformsTo(r,e,t)}}(baseClone(e,1))},lodash.constant=constant,lodash.countBy=Nr,lodash.create=function create(e,t){var r=tr(e);return null==t?r:baseAssign(r,t)},lodash.curry=function curry(e,t,r){var n=createWrap(e,8,i,i,i,i,i,t=r?i:t);return n.placeholder=curry.placeholder,n},lodash.curryRight=function curryRight(e,t,r){var n=createWrap(e,c,i,i,i,i,i,t=r?i:t);return n.placeholder=curryRight.placeholder,n},lodash.debounce=debounce,lodash.defaults=bn,lodash.defaultsDeep=Cn,lodash.defer=Jr,lodash.delay=Zr,lodash.difference=br,lodash.differenceBy=Cr,lodash.differenceWith=_r,lodash.drop=function drop(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,(t=r||t===i?1:toInteger(t))<0?0:t,n):[]},lodash.dropRight=function dropRight(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,0,(t=n-(t=r||t===i?1:toInteger(t)))<0?0:t):[]},lodash.dropRightWhile=function dropRightWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!0,!0):[]},lodash.dropWhile=function dropWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!0):[]},lodash.fill=function fill(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(r=0,n=o),function baseFill(e,t,r,n){var o=e.length;for((r=toInteger(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:toInteger(n))<0&&(n+=o),n=r>n?0:toLength(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},lodash.filter=function filter(e,t){return(on(e)?arrayFilter:baseFilter)(e,getIteratee(t,3))},lodash.flatMap=function flatMap(e,t){return baseFlatten(map(e,t),1)},lodash.flatMapDeep=function flatMapDeep(e,t){return baseFlatten(map(e,t),h)},lodash.flatMapDepth=function flatMapDepth(e,t,r){return r=r===i?1:toInteger(r),baseFlatten(map(e,t),r)},lodash.flatten=flatten,lodash.flattenDeep=function flattenDeep(e){return(null==e?0:e.length)?baseFlatten(e,h):[]},lodash.flattenDepth=function flattenDepth(e,t){return(null==e?0:e.length)?baseFlatten(e,t=t===i?1:toInteger(t)):[]},lodash.flip=function flip(e){return createWrap(e,512)},lodash.flow=Un,lodash.flowRight=Wn,lodash.fromPairs=function fromPairs(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},lodash.functions=function functions(e){return null==e?[]:baseFunctions(e,keys(e))},lodash.functionsIn=function functionsIn(e){return null==e?[]:baseFunctions(e,keysIn(e))},lodash.groupBy=Ur,lodash.initial=function initial(e){return(null==e?0:e.length)?baseSlice(e,0,-1):[]},lodash.intersection=Sr,lodash.intersectionBy=Tr,lodash.intersectionWith=Or,lodash.invert=_n,lodash.invertBy=Sn,lodash.invokeMap=Wr,lodash.iteratee=iteratee,lodash.keyBy=qr,lodash.keys=keys,lodash.keysIn=keysIn,lodash.map=map,lodash.mapKeys=function mapKeys(e,t){var r={};return t=getIteratee(t,3),baseForOwn(e,(function(e,n,i){baseAssignValue(r,t(e,n,i),e)})),r},lodash.mapValues=function mapValues(e,t){var r={};return t=getIteratee(t,3),baseForOwn(e,(function(e,n,i){baseAssignValue(r,n,t(e,n,i))})),r},lodash.matches=function matches(e){return baseMatches(baseClone(e,1))},lodash.matchesProperty=function matchesProperty(e,t){return baseMatchesProperty(e,baseClone(t,1))},lodash.memoize=memoize,lodash.merge=On,lodash.mergeWith=Rn,lodash.method=qn,lodash.methodOf=Vn,lodash.mixin=mixin,lodash.negate=negate,lodash.nthArg=function nthArg(e){return e=toInteger(e),baseRest((function(t){return baseNth(t,e)}))},lodash.omit=In,lodash.omitBy=function omitBy(e,t){return pickBy(e,negate(getIteratee(t)))},lodash.once=function once(e){return before(2,e)},lodash.orderBy=function orderBy(e,t,r,n){return null==e?[]:(on(t)||(t=null==t?[]:[t]),on(r=n?i:r)||(r=null==r?[]:[r]),baseOrderBy(e,t,r))},lodash.over=Gn,lodash.overArgs=Yr,lodash.overEvery=Kn,lodash.overSome=$n,lodash.partial=Qr,lodash.partialRight=Xr,lodash.partition=Vr,lodash.pick=En,lodash.pickBy=pickBy,lodash.property=property,lodash.propertyOf=function propertyOf(e){return function(t){return null==e?i:baseGet(e,t)}},lodash.pull=Rr,lodash.pullAll=pullAll,lodash.pullAllBy=function pullAllBy(e,t,r){return e&&e.length&&t&&t.length?basePullAll(e,t,getIteratee(r,2)):e},lodash.pullAllWith=function pullAllWith(e,t,r){return e&&e.length&&t&&t.length?basePullAll(e,t,i,r):e},lodash.pullAt=Ir,lodash.range=Hn,lodash.rangeRight=Jn,lodash.rearg=en,lodash.reject=function reject(e,t){return(on(e)?arrayFilter:baseFilter)(e,negate(getIteratee(t,3)))},lodash.remove=function remove(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=getIteratee(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return basePullAt(e,i),r},lodash.rest=function rest(e,t){if("function"!=typeof e)throw new Me(o);return baseRest(e,t=t===i?t:toInteger(t))},lodash.reverse=reverse,lodash.sampleSize=function sampleSize(e,t,r){return t=(r?isIterateeCall(e,t,r):t===i)?1:toInteger(t),(on(e)?arraySampleSize:baseSampleSize)(e,t)},lodash.set=function set(e,t,r){return null==e?e:baseSet(e,t,r)},lodash.setWith=function setWith(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:baseSet(e,t,r,n)},lodash.shuffle=function shuffle(e){return(on(e)?arrayShuffle:baseShuffle)(e)},lodash.slice=function slice(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&isIterateeCall(e,t,r)?(t=0,r=n):(t=null==t?0:toInteger(t),r=r===i?n:toInteger(r)),baseSlice(e,t,r)):[]},lodash.sortBy=Gr,lodash.sortedUniq=function sortedUniq(e){return e&&e.length?baseSortedUniq(e):[]},lodash.sortedUniqBy=function sortedUniqBy(e,t){return e&&e.length?baseSortedUniq(e,getIteratee(t,2)):[]},lodash.split=function split(e,t,r){return r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=i),(r=r===i?m:r>>>0)?(e=toString(e))&&("string"==typeof t||null!=t&&!un(t))&&!(t=baseToString(t))&&hasUnicode(e)?castSlice(stringToArray(e),0,r):e.split(t,r):[]},lodash.spread=function spread(e,t){if("function"!=typeof e)throw new Me(o);return t=null==t?0:Pt(toInteger(t),0),baseRest((function(r){var n=r[t],i=castSlice(r,0,t);return n&&arrayPush(i,n),apply(e,this,i)}))},lodash.tail=function tail(e){var t=null==e?0:e.length;return t?baseSlice(e,1,t):[]},lodash.take=function take(e,t,r){return e&&e.length?baseSlice(e,0,(t=r||t===i?1:toInteger(t))<0?0:t):[]},lodash.takeRight=function takeRight(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,(t=n-(t=r||t===i?1:toInteger(t)))<0?0:t,n):[]},lodash.takeRightWhile=function takeRightWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!1,!0):[]},lodash.takeWhile=function takeWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3)):[]},lodash.tap=function tap(e,t){return t(e),e},lodash.throttle=function throttle(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Me(o);return isObject(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),debounce(e,t,{leading:n,maxWait:t,trailing:i})},lodash.thru=thru,lodash.toArray=toArray,lodash.toPairs=Ln,lodash.toPairsIn=Mn,lodash.toPath=function toPath(e){return on(e)?arrayMap(e,toKey):isSymbol(e)?[e]:copyArray(wr(toString(e)))},lodash.toPlainObject=toPlainObject,lodash.transform=function transform(e,t,r){var n=on(e),i=n||sn(e)||fn(e);if(t=getIteratee(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:isObject(e)&&isFunction(o)?tr($e(e)):{}}return(i?arrayEach:baseForOwn)(e,(function(e,n,i){return t(r,e,n,i)})),r},lodash.unary=function unary(e){return ary(e,1)},lodash.union=Er,lodash.unionBy=Lr,lodash.unionWith=Mr,lodash.uniq=function uniq(e){return e&&e.length?baseUniq(e):[]},lodash.uniqBy=function uniqBy(e,t){return e&&e.length?baseUniq(e,getIteratee(t,2)):[]},lodash.uniqWith=function uniqWith(e,t){return t="function"==typeof t?t:i,e&&e.length?baseUniq(e,i,t):[]},lodash.unset=function unset(e,t){return null==e||baseUnset(e,t)},lodash.unzip=unzip,lodash.unzipWith=unzipWith,lodash.update=function update(e,t,r){return null==e?e:baseUpdate(e,t,castFunction(r))},lodash.updateWith=function updateWith(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:baseUpdate(e,t,castFunction(r),n)},lodash.values=values,lodash.valuesIn=function valuesIn(e){return null==e?[]:baseValues(e,keysIn(e))},lodash.without=Ar,lodash.words=words,lodash.wrap=function wrap(e,t){return Qr(castFunction(t),e)},lodash.xor=Dr,lodash.xorBy=Pr,lodash.xorWith=jr,lodash.zip=kr,lodash.zipObject=function zipObject(e,t){return baseZipObject(e||[],t||[],assignValue)},lodash.zipObjectDeep=function zipObjectDeep(e,t){return baseZipObject(e||[],t||[],baseSet)},lodash.zipWith=xr,lodash.entries=Ln,lodash.entriesIn=Mn,lodash.extend=yn,lodash.extendWith=mn,mixin(lodash,lodash),lodash.add=Zn,lodash.attempt=zn,lodash.camelCase=An,lodash.capitalize=capitalize,lodash.ceil=Yn,lodash.clamp=function clamp(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=toNumber(r))==r?r:0),t!==i&&(t=(t=toNumber(t))==t?t:0),baseClamp(toNumber(e),t,r)},lodash.clone=function clone(e){return baseClone(e,4)},lodash.cloneDeep=function cloneDeep(e){return baseClone(e,5)},lodash.cloneDeepWith=function cloneDeepWith(e,t){return baseClone(e,5,t="function"==typeof t?t:i)},lodash.cloneWith=function cloneWith(e,t){return baseClone(e,4,t="function"==typeof t?t:i)},lodash.conformsTo=function conformsTo(e,t){return null==t||baseConformsTo(e,t,keys(t))},lodash.deburr=deburr,lodash.defaultTo=function defaultTo(e,t){return null==e||e!=e?t:e},lodash.divide=Qn,lodash.endsWith=function endsWith(e,t,r){e=toString(e),t=baseToString(t);var n=e.length,o=r=r===i?n:baseClamp(toInteger(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},lodash.eq=eq,lodash.escape=function escape(e){return(e=toString(e))&&Q.test(e)?e.replace(Z,Et):e},lodash.escapeRegExp=function escapeRegExp(e){return(e=toString(e))&&ae.test(e)?e.replace(oe,"\\$&"):e},lodash.every=function every(e,t,r){var n=on(e)?arrayEvery:baseEvery;return r&&isIterateeCall(e,t,r)&&(t=i),n(e,getIteratee(t,3))},lodash.find=zr,lodash.findIndex=findIndex,lodash.findKey=function findKey(e,t){return baseFindKey(e,getIteratee(t,3),baseForOwn)},lodash.findLast=Br,lodash.findLastIndex=findLastIndex,lodash.findLastKey=function findLastKey(e,t){return baseFindKey(e,getIteratee(t,3),baseForOwnRight)},lodash.floor=Xn,lodash.forEach=forEach,lodash.forEachRight=forEachRight,lodash.forIn=function forIn(e,t){return null==e?e:ir(e,getIteratee(t,3),keysIn)},lodash.forInRight=function forInRight(e,t){return null==e?e:or(e,getIteratee(t,3),keysIn)},lodash.forOwn=function forOwn(e,t){return e&&baseForOwn(e,getIteratee(t,3))},lodash.forOwnRight=function forOwnRight(e,t){return e&&baseForOwnRight(e,getIteratee(t,3))},lodash.get=get,lodash.gt=tn,lodash.gte=rn,lodash.has=function has(e,t){return null!=e&&hasPath(e,t,baseHas)},lodash.hasIn=hasIn,lodash.head=head,lodash.identity=identity,lodash.includes=function includes(e,t,r,n){e=isArrayLike(e)?e:values(e),r=r&&!n?toInteger(r):0;var i=e.length;return r<0&&(r=Pt(i+r,0)),isString(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&baseIndexOf(e,t,r)>-1},lodash.indexOf=function indexOf(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:toInteger(r);return i<0&&(i=Pt(n+i,0)),baseIndexOf(e,t,i)},lodash.inRange=function inRange(e,t,r){return t=toFinite(t),r===i?(r=t,t=0):r=toFinite(r),function baseInRange(e,t,r){return e>=jt(t,r)&&e<Pt(t,r)}(e=toNumber(e),t,r)},lodash.invoke=Tn,lodash.isArguments=nn,lodash.isArray=on,lodash.isArrayBuffer=an,lodash.isArrayLike=isArrayLike,lodash.isArrayLikeObject=isArrayLikeObject,lodash.isBoolean=function isBoolean(e){return!0===e||!1===e||isObjectLike(e)&&baseGetTag(e)==C},lodash.isBuffer=sn,lodash.isDate=cn,lodash.isElement=function isElement(e){return isObjectLike(e)&&1===e.nodeType&&!isPlainObject(e)},lodash.isEmpty=function isEmpty(e){if(null==e)return!0;if(isArrayLike(e)&&(on(e)||"string"==typeof e||"function"==typeof e.splice||sn(e)||fn(e)||nn(e)))return!e.length;var t=hr(e);if(t==R||t==A)return!e.size;if(isPrototype(e))return!baseKeys(e).length;for(var r in e)if(xe.call(e,r))return!1;return!0},lodash.isEqual=function isEqual(e,t){return baseIsEqual(e,t)},lodash.isEqualWith=function isEqualWith(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?baseIsEqual(e,t,i,r):!!n},lodash.isError=isError,lodash.isFinite=function isFinite(e){return"number"==typeof e&&Rt(e)},lodash.isFunction=isFunction,lodash.isInteger=isInteger,lodash.isLength=isLength,lodash.isMap=ln,lodash.isMatch=function isMatch(e,t){return e===t||baseIsMatch(e,t,getMatchData(t))},lodash.isMatchWith=function isMatchWith(e,t,r){return r="function"==typeof r?r:i,baseIsMatch(e,t,getMatchData(t),r)},lodash.isNaN=function isNaN(e){return isNumber(e)&&e!=+e},lodash.isNative=function isNative(e){if(gr(e))throw new ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return baseIsNative(e)},lodash.isNil=function isNil(e){return null==e},lodash.isNull=function isNull(e){return null===e},lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isObjectLike=isObjectLike,lodash.isPlainObject=isPlainObject,lodash.isRegExp=un,lodash.isSafeInteger=function isSafeInteger(e){return isInteger(e)&&e>=-9007199254740991&&e<=g},lodash.isSet=pn,lodash.isString=isString,lodash.isSymbol=isSymbol,lodash.isTypedArray=fn,lodash.isUndefined=function isUndefined(e){return e===i},lodash.isWeakMap=function isWeakMap(e){return isObjectLike(e)&&hr(e)==j},lodash.isWeakSet=function isWeakSet(e){return isObjectLike(e)&&"[object WeakSet]"==baseGetTag(e)},lodash.join=function join(e,t){return null==e?"":At.call(e,t)},lodash.kebabCase=Dn,lodash.last=last,lodash.lastIndexOf=function lastIndexOf(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=toInteger(r))<0?Pt(n+o,0):jt(o,n-1)),t==t?function strictLastIndexOf(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):baseFindIndex(e,baseIsNaN,o,!0)},lodash.lowerCase=Pn,lodash.lowerFirst=jn,lodash.lt=dn,lodash.lte=hn,lodash.max=function max(e){return e&&e.length?baseExtremum(e,identity,baseGt):i},lodash.maxBy=function maxBy(e,t){return e&&e.length?baseExtremum(e,getIteratee(t,2),baseGt):i},lodash.mean=function mean(e){return baseMean(e,identity)},lodash.meanBy=function meanBy(e,t){return baseMean(e,getIteratee(t,2))},lodash.min=function min(e){return e&&e.length?baseExtremum(e,identity,baseLt):i},lodash.minBy=function minBy(e,t){return e&&e.length?baseExtremum(e,getIteratee(t,2),baseLt):i},lodash.stubArray=stubArray,lodash.stubFalse=stubFalse,lodash.stubObject=function stubObject(){return{}},lodash.stubString=function stubString(){return""},lodash.stubTrue=function stubTrue(){return!0},lodash.multiply=ti,lodash.nth=function nth(e,t){return e&&e.length?baseNth(e,toInteger(t)):i},lodash.noConflict=function noConflict(){return ht._===this&&(ht._=Ue),this},lodash.noop=noop,lodash.now=Kr,lodash.pad=function pad(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return createPadding(yt(i),r)+e+createPadding(gt(i),r)},lodash.padEnd=function padEnd(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;return t&&n<t?e+createPadding(t-n,r):e},lodash.padStart=function padStart(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;return t&&n<t?createPadding(t-n,r)+e:e},lodash.parseInt=function parseInt(e,t,r){return r||null==t?t=0:t&&(t=+t),xt(toString(e).replace(se,""),t||0)},lodash.random=function random(e,t,r){if(r&&"boolean"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=toFinite(e),t===i?(t=e,e=0):t=toFinite(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=Ft();return jt(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return baseRandom(e,t)},lodash.reduce=function reduce(e,t,r){var n=on(e)?arrayReduce:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,rr)},lodash.reduceRight=function reduceRight(e,t,r){var n=on(e)?arrayReduceRight:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,nr)},lodash.repeat=function repeat(e,t,r){return t=(r?isIterateeCall(e,t,r):t===i)?1:toInteger(t),baseRepeat(toString(e),t)},lodash.replace=function replace(){var e=arguments,t=toString(e[0]);return e.length<3?t:t.replace(e[1],e[2])},lodash.result=function result(e,t,r){var n=-1,o=(t=castPath(t,e)).length;for(o||(o=1,e=i);++n<o;){var a=null==e?i:e[toKey(t[n])];a===i&&(n=o,a=r),e=isFunction(a)?a.call(e):a}return e},lodash.round=ri,lodash.runInContext=runInContext,lodash.sample=function sample(e){return(on(e)?arraySample:baseSample)(e)},lodash.size=function size(e){if(null==e)return 0;if(isArrayLike(e))return isString(e)?stringSize(e):e.length;var t=hr(e);return t==R||t==A?e.size:baseKeys(e).length},lodash.snakeCase=kn,lodash.some=function some(e,t,r){var n=on(e)?arraySome:baseSome;return r&&isIterateeCall(e,t,r)&&(t=i),n(e,getIteratee(t,3))},lodash.sortedIndex=function sortedIndex(e,t){return baseSortedIndex(e,t)},lodash.sortedIndexBy=function sortedIndexBy(e,t,r){return baseSortedIndexBy(e,t,getIteratee(r,2))},lodash.sortedIndexOf=function sortedIndexOf(e,t){var r=null==e?0:e.length;if(r){var n=baseSortedIndex(e,t);if(n<r&&eq(e[n],t))return n}return-1},lodash.sortedLastIndex=function sortedLastIndex(e,t){return baseSortedIndex(e,t,!0)},lodash.sortedLastIndexBy=function sortedLastIndexBy(e,t,r){return baseSortedIndexBy(e,t,getIteratee(r,2),!0)},lodash.sortedLastIndexOf=function sortedLastIndexOf(e,t){if(null==e?0:e.length){var r=baseSortedIndex(e,t,!0)-1;if(eq(e[r],t))return r}return-1},lodash.startCase=xn,lodash.startsWith=function startsWith(e,t,r){return e=toString(e),r=null==r?0:baseClamp(toInteger(r),0,e.length),t=baseToString(t),e.slice(r,r+t.length)==t},lodash.subtract=ni,lodash.sum=function sum(e){return e&&e.length?baseSum(e,identity):0},lodash.sumBy=function sumBy(e,t){return e&&e.length?baseSum(e,getIteratee(t,2)):0},lodash.template=function template(e,t,r){var n=lodash.templateSettings;r&&isIterateeCall(e,t,r)&&(t=i),e=toString(e),t=mn({},t,n,customDefaultsAssignIn);var o,a,s=mn({},t.imports,n.imports,customDefaultsAssignIn),c=keys(s),l=baseValues(s,c),u=0,p=t.interpolate||Se,d="__p += '",h=Ee((t.escape||Se).source+"|"+p.source+"|"+(p===te?ge:Se).source+"|"+(t.evaluate||Se).source+"|$","g"),g="//# sourceURL="+(xe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";e.replace(h,(function(t,r,n,i,s,c){return n||(n=i),d+=e.slice(u,c).replace(Te,escapeStringChar),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var y=xe.call(t,"variable")&&t.variable;if(y){if(de.test(y))throw new ce("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(K,""):d).replace($,"$1").replace(H,"$1;"),d="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=zn((function(){return Oe(c,g+"return "+d).apply(i,l)}));if(m.source=d,isError(m))throw m;return m},lodash.times=function times(e,t){if((e=toInteger(e))<1||e>g)return[];var r=m,n=jt(e,m);t=getIteratee(t),e-=m;for(var i=baseTimes(n,t);++r<e;)t(r);return i},lodash.toFinite=toFinite,lodash.toInteger=toInteger,lodash.toLength=toLength,lodash.toLower=function toLower(e){return toString(e).toLowerCase()},lodash.toNumber=toNumber,lodash.toSafeInteger=function toSafeInteger(e){return e?baseClamp(toInteger(e),-9007199254740991,g):0===e?e:0},lodash.toString=toString,lodash.toUpper=function toUpper(e){return toString(e).toUpperCase()},lodash.trim=function trim(e,t,r){if((e=toString(e))&&(r||t===i))return baseTrim(e);if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e),o=stringToArray(t);return castSlice(n,charsStartIndex(n,o),charsEndIndex(n,o)+1).join("")},lodash.trimEnd=function trimEnd(e,t,r){if((e=toString(e))&&(r||t===i))return e.slice(0,trimmedEndIndex(e)+1);if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e);return castSlice(n,0,charsEndIndex(n,stringToArray(t))+1).join("")},lodash.trimStart=function trimStart(e,t,r){if((e=toString(e))&&(r||t===i))return e.replace(se,"");if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e);return castSlice(n,charsStartIndex(n,stringToArray(t))).join("")},lodash.truncate=function truncate(e,t){var r=30,n="...";if(isObject(t)){var o="separator"in t?t.separator:o;r="length"in t?toInteger(t.length):r,n="omission"in t?baseToString(t.omission):n}var a=(e=toString(e)).length;if(hasUnicode(e)){var s=stringToArray(e);a=s.length}if(r>=a)return e;var c=r-stringSize(n);if(c<1)return n;var l=s?castSlice(s,0,c).join(""):e.slice(0,c);if(o===i)return l+n;if(s&&(c+=l.length-c),un(o)){if(e.slice(c).search(o)){var u,p=l;for(o.global||(o=Ee(o.source,toString(ye.exec(o))+"g")),o.lastIndex=0;u=o.exec(p);)var d=u.index;l=l.slice(0,d===i?c:d)}}else if(e.indexOf(baseToString(o),c)!=c){var h=l.lastIndexOf(o);h>-1&&(l=l.slice(0,h))}return l+n},lodash.unescape=function unescape(e){return(e=toString(e))&&Y.test(e)?e.replace(J,Lt):e},lodash.uniqueId=function uniqueId(e){var t=++Fe;return toString(e)+t},lodash.upperCase=Fn,lodash.upperFirst=Nn,lodash.each=forEach,lodash.eachRight=forEachRight,lodash.first=head,mixin(lodash,(ei={},baseForOwn(lodash,(function(e,t){xe.call(lodash.prototype,t)||(ei[t]=e)})),ei),{chain:!1}),lodash.VERSION="4.17.21",arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){lodash[e].placeholder=lodash})),arrayEach(["drop","take"],(function(e,t){LazyWrapper.prototype[e]=function(r){r=r===i?1:Pt(toInteger(r),0);var n=this.__filtered__&&!t?new LazyWrapper(this):this.clone();return n.__filtered__?n.__takeCount__=jt(r,n.__takeCount__):n.__views__.push({size:jt(r,m),type:e+(n.__dir__<0?"Right":"")}),n},LazyWrapper.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),arrayEach(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;LazyWrapper.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:getIteratee(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),arrayEach(["head","last"],(function(e,t){var r="take"+(t?"Right":"");LazyWrapper.prototype[e]=function(){return this[r](1).value()[0]}})),arrayEach(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");LazyWrapper.prototype[e]=function(){return this.__filtered__?new LazyWrapper(this):this[r](1)}})),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(e){return this.filter(e).head()},LazyWrapper.prototype.findLast=function(e){return this.reverse().find(e)},LazyWrapper.prototype.invokeMap=baseRest((function(e,t){return"function"==typeof e?new LazyWrapper(this):this.map((function(r){return baseInvoke(r,e,t)}))})),LazyWrapper.prototype.reject=function(e){return this.filter(negate(getIteratee(e)))},LazyWrapper.prototype.slice=function(e,t){e=toInteger(e);var r=this;return r.__filtered__&&(e>0||t<0)?new LazyWrapper(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=toInteger(t))<0?r.dropRight(-t):r.take(t-e)),r)},LazyWrapper.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(m)},baseForOwn(LazyWrapper.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=lodash[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);o&&(lodash.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,c=t instanceof LazyWrapper,l=s[0],u=c||on(t),interceptor=function(e){var t=o.apply(lodash,arrayPush([e],s));return n&&p?t[0]:t};u&&r&&"function"==typeof l&&1!=l.length&&(c=u=!1);var p=this.__chain__,d=!!this.__actions__.length,h=a&&!p,g=c&&!d;if(!a&&u){t=g?t:new LazyWrapper(this);var y=e.apply(t,s);return y.__actions__.push({func:thru,args:[interceptor],thisArg:i}),new LodashWrapper(y,p)}return h&&g?e.apply(this,s):(y=this.thru(interceptor),h?n?y.value()[0]:y.value():y)})})),arrayEach(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);lodash.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(on(i)?i:[],e)}return this[r]((function(r){return t.apply(on(r)?r:[],e)}))}})),baseForOwn(LazyWrapper.prototype,(function(e,t){var r=lodash[t];if(r){var n=r.name+"";xe.call(Kt,n)||(Kt[n]=[]),Kt[n].push({name:t,func:r})}})),Kt[createHybrid(i,2).name]=[{name:"wrapper",func:i}],LazyWrapper.prototype.clone=function lazyClone(){var e=new LazyWrapper(this.__wrapped__);return e.__actions__=copyArray(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=copyArray(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=copyArray(this.__views__),e},LazyWrapper.prototype.reverse=function lazyReverse(){if(this.__filtered__){var e=new LazyWrapper(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},LazyWrapper.prototype.value=function lazyValue(){var e=this.__wrapped__.value(),t=this.__dir__,r=on(e),n=t<0,i=r?e.length:0,o=function getView(e,t,r){var n=-1,i=r.length;for(;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=jt(t,e+a);break;case"takeRight":e=Pt(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,c=s-a,l=n?s:a-1,u=this.__iteratees__,p=u.length,d=0,h=jt(c,this.__takeCount__);if(!r||!n&&i==c&&h==c)return baseWrapperValue(e,this.__actions__);var g=[];e:for(;c--&&d<h;){for(var y=-1,m=e[l+=t];++y<p;){var v=u[y],w=v.iteratee,b=v.type,C=w(m);if(2==b)m=C;else if(!C){if(1==b)continue e;break e}}g[d++]=m}return g},lodash.prototype.at=Fr,lodash.prototype.chain=function wrapperChain(){return chain(this)},lodash.prototype.commit=function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)},lodash.prototype.next=function wrapperNext(){this.__values__===i&&(this.__values__=toArray(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},lodash.prototype.plant=function wrapperPlant(e){for(var t,r=this;r instanceof baseLodash;){var n=wrapperClone(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},lodash.prototype.reverse=function wrapperReverse(){var e=this.__wrapped__;if(e instanceof LazyWrapper){var t=e;return this.__actions__.length&&(t=new LazyWrapper(this)),(t=t.reverse()).__actions__.push({func:thru,args:[reverse],thisArg:i}),new LodashWrapper(t,this.__chain__)}return this.thru(reverse)},lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)},lodash.prototype.first=lodash.prototype.head,Qe&&(lodash.prototype[Qe]=function wrapperToIterator(){return this}),lodash}();ht._=Mt,(n=function(){return Mt}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},9490:(e,t)=>{"use strict";function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _extends(){return _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _construct(e,t,r){return _construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(i,r.prototype),i},_construct.apply(null,arguments)}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(e){if(null===e||!function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,e)},_wrapNativeSuper(e)}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _createForOfIteratorHelperLoose(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function LuxonError(){return e.apply(this,arguments)||this}return _inheritsLoose(LuxonError,e),LuxonError}(_wrapNativeSuper(Error)),n=function(e){function InvalidDateTimeError(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return _inheritsLoose(InvalidDateTimeError,e),InvalidDateTimeError}(r),i=function(e){function InvalidIntervalError(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return _inheritsLoose(InvalidIntervalError,e),InvalidIntervalError}(r),o=function(e){function InvalidDurationError(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return _inheritsLoose(InvalidDurationError,e),InvalidDurationError}(r),a=function(e){function ConflictingSpecificationError(){return e.apply(this,arguments)||this}return _inheritsLoose(ConflictingSpecificationError,e),ConflictingSpecificationError}(r),s=function(e){function InvalidUnitError(t){return e.call(this,"Invalid unit "+t)||this}return _inheritsLoose(InvalidUnitError,e),InvalidUnitError}(r),c=function(e){function InvalidArgumentError(){return e.apply(this,arguments)||this}return _inheritsLoose(InvalidArgumentError,e),InvalidArgumentError}(r),l=function(e){function ZoneIsAbstractError(){return e.call(this,"Zone is an abstract class")||this}return _inheritsLoose(ZoneIsAbstractError,e),ZoneIsAbstractError}(r),u="numeric",p="short",d="long",h={year:u,month:u,day:u},g={year:u,month:p,day:u},y={year:u,month:p,day:u,weekday:p},m={year:u,month:d,day:u},v={year:u,month:d,day:u,weekday:d},w={hour:u,minute:u},b={hour:u,minute:u,second:u},C={hour:u,minute:u,second:u,timeZoneName:p},_={hour:u,minute:u,second:u,timeZoneName:d},S={hour:u,minute:u,hourCycle:"h23"},T={hour:u,minute:u,second:u,hourCycle:"h23"},O={hour:u,minute:u,second:u,hourCycle:"h23",timeZoneName:p},R={hour:u,minute:u,second:u,hourCycle:"h23",timeZoneName:d},I={year:u,month:u,day:u,hour:u,minute:u},E={year:u,month:u,day:u,hour:u,minute:u,second:u},L={year:u,month:p,day:u,hour:u,minute:u},M={year:u,month:p,day:u,hour:u,minute:u,second:u},A={year:u,month:p,day:u,weekday:p,hour:u,minute:u},D={year:u,month:d,day:u,hour:u,minute:u,timeZoneName:p},P={year:u,month:d,day:u,hour:u,minute:u,second:u,timeZoneName:p},j={year:u,month:d,day:u,weekday:d,hour:u,minute:u,timeZoneName:d},k={year:u,month:d,day:u,weekday:d,hour:u,minute:u,second:u,timeZoneName:d};function isUndefined(e){return void 0===e}function isNumber(e){return"number"==typeof e}function isInteger(e){return"number"==typeof e&&e%1==0}function hasRelative(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function bestBy(e,t,r){if(0!==e.length)return e.reduce((function(e,n){var i=[t(n),n];return e&&r(e[0],i[0])===e[0]?e:i}),null)[1]}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function integerBetween(e,t,r){return isInteger(e)&&e>=t&&e<=r}function padStart(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function parseInteger(e){return isUndefined(e)||null===e||""===e?void 0:parseInt(e,10)}function parseFloating(e){return isUndefined(e)||null===e||""===e?void 0:parseFloat(e)}function parseMillis(e){if(!isUndefined(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function roundTo(e,t,r){void 0===r&&(r=!1);var n=Math.pow(10,t);return(r?Math.trunc:Math.round)(e*n)/n}function isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}function daysInYear(e){return isLeapYear(e)?366:365}function daysInMonth(e,t){var r=function floorMod(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===r?isLeapYear(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function objToLocalTS(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(t.getUTCFullYear()-1900),+t}function weeksInWeekYear(e){var t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,r=e-1,n=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return 4===t||3===n?53:52}function untruncateYear(e){return e>99?e:e>60?1900+e:2e3+e}function parseZoneInfo(e,t,r,n){void 0===n&&(n=null);var i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);var a=_extends({timeZoneName:t},o),s=new Intl.DateTimeFormat(r,a).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return s?s.value:null}function signedOffset(e,t){var r=parseInt(e,10);Number.isNaN(r)&&(r=0);var n=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-n:n)}function asNumber(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new c("Invalid unit value "+e);return t}function normalizeObject(e,t){var r={};for(var n in e)if(hasOwnProperty(e,n)){var i=e[n];if(null==i)continue;r[t(n)]=asNumber(i)}return r}function formatOffset(e,t){var r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return""+i+padStart(r,2)+":"+padStart(n,2);case"narrow":return""+i+r+(n>0?":"+n:"");case"techie":return""+i+padStart(r,2)+padStart(n,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function timeObject(e){return function pick(e,t){return t.reduce((function(t,r){return t[r]=e[r],t}),{})}(e,["hour","minute","second","millisecond"])}var x=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z0-9_+-]{1,256}(\/[A-Za-z0-9_+-]{1,256})?)?/,F=["January","February","March","April","May","June","July","August","September","October","November","December"],N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],z=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(e){switch(e){case"narrow":return[].concat(z);case"short":return[].concat(N);case"long":return[].concat(F);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var B=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],U=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],W=["M","T","W","T","F","S","S"];function weekdays(e){switch(e){case"narrow":return[].concat(W);case"short":return[].concat(U);case"long":return[].concat(B);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var q=["AM","PM"],V=["Before Christ","Anno Domini"],G=["BC","AD"],K=["B","A"];function eras(e){switch(e){case"narrow":return[].concat(K);case"short":return[].concat(G);case"long":return[].concat(V);default:return null}}function stringifyTokens(e,t){for(var r,n="",i=_createForOfIteratorHelperLoose(e);!(r=i()).done;){var o=r.value;o.literal?n+=o.val:n+=t(o.val)}return n}var $={D:h,DD:g,DDD:m,DDDD:v,t:w,tt:b,ttt:C,tttt:_,T:S,TT:T,TTT:O,TTTT:R,f:I,ff:L,fff:D,ffff:j,F:E,FF:M,FFF:P,FFFF:k},H=function(){function Formatter(e,t){this.opts=t,this.loc=e,this.systemLoc=null}Formatter.create=function create(e,t){return void 0===t&&(t={}),new Formatter(e,t)},Formatter.parseFormat=function parseFormat(e){for(var t=null,r="",n=!1,i=[],o=0;o<e.length;o++){var a=e.charAt(o);"'"===a?(r.length>0&&i.push({literal:n,val:r}),t=null,r="",n=!n):n||a===t?r+=a:(r.length>0&&i.push({literal:!1,val:r}),r=a,t=a)}return r.length>0&&i.push({literal:n,val:r}),i},Formatter.macroTokenToFormatOpts=function macroTokenToFormatOpts(e){return $[e]};var e=Formatter.prototype;return e.formatWithSystemDefault=function formatWithSystemDefault(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,_extends({},this.opts,t)).format()},e.formatDateTime=function formatDateTime(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,_extends({},this.opts,t)).format()},e.formatDateTimeParts=function formatDateTimeParts(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,_extends({},this.opts,t)).formatToParts()},e.resolvedOptions=function resolvedOptions(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,_extends({},this.opts,t)).resolvedOptions()},e.num=function num(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return padStart(e,t);var r=_extends({},this.opts);return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)},e.formatDateTimeFromString=function formatDateTimeFromString(e,t){var r=this,n="en"===this.loc.listingMode(),i=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,o=function string(t,n){return r.loc.extract(e,t,n)},a=function formatOffset(t){return e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):""},s=function meridiem(){return n?function meridiemForDateTime(e){return q[e.hour<12?0:1]}(e):o({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function month(t,r){return n?function monthForDateTime(e,t){return months(t)[e.month-1]}(e,t):o(r?{month:t}:{month:t,day:"numeric"},"month")},l=function weekday(t,r){return n?function weekdayForDateTime(e,t){return weekdays(t)[e.weekday-1]}(e,t):o(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday")},u=function era(t){return n?function eraForDateTime(e,t){return eras(t)[e.year<0?0:1]}(e,t):o({era:t},"era")};return stringifyTokens(Formatter.parseFormat(t),(function tokenToString(t){switch(t){case"S":return r.num(e.millisecond);case"u":case"SSS":return r.num(e.millisecond,3);case"s":return r.num(e.second);case"ss":return r.num(e.second,2);case"uu":return r.num(Math.floor(e.millisecond/10),2);case"uuu":return r.num(Math.floor(e.millisecond/100));case"m":return r.num(e.minute);case"mm":return r.num(e.minute,2);case"h":return r.num(e.hour%12==0?12:e.hour%12);case"hh":return r.num(e.hour%12==0?12:e.hour%12,2);case"H":return r.num(e.hour);case"HH":return r.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return a({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:r.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return i?o({day:"numeric"},"day"):r.num(e.day);case"dd":return i?o({day:"2-digit"},"day"):r.num(e.day,2);case"c":case"E":return r.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):r.num(e.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):r.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return i?o({month:"numeric"},"month"):r.num(e.month);case"MM":return i?o({month:"2-digit"},"month"):r.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return i?o({year:"numeric"},"year"):r.num(e.year);case"yy":return i?o({year:"2-digit"},"year"):r.num(e.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):r.num(e.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):r.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return r.num(e.weekYear.toString().slice(-2),2);case"kkkk":return r.num(e.weekYear,4);case"W":return r.num(e.weekNumber);case"WW":return r.num(e.weekNumber,2);case"o":return r.num(e.ordinal);case"ooo":return r.num(e.ordinal,3);case"q":return r.num(e.quarter);case"qq":return r.num(e.quarter,2);case"X":return r.num(Math.floor(e.ts/1e3));case"x":return r.num(e.ts);default:return function maybeMacro(t){var n=Formatter.macroTokenToFormatOpts(t);return n?r.formatWithSystemDefault(e,n):t}(t)}}))},e.formatDurationFromString=function formatDurationFromString(e,t){var r=this,n=function tokenToField(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}},i=Formatter.parseFormat(t),o=i.reduce((function(e,t){var r=t.literal,n=t.val;return r?e:e.concat(n)}),[]);return stringifyTokens(i,function tokenToString(e){return function(t){var i=n(t);return i?r.num(e.get(i),t.length):t}}(e.shiftTo.apply(e,o.map(n).filter((function(e){return e})))))},Formatter}(),J=function(){function Invalid(e,t){this.reason=e,this.explanation=t}return Invalid.prototype.toMessage=function toMessage(){return this.explanation?this.reason+": "+this.explanation:this.reason},Invalid}(),Z=function(){function Zone(){}var e=Zone.prototype;return e.offsetName=function offsetName(e,t){throw new l},e.formatOffset=function formatOffset(e,t){throw new l},e.offset=function offset(e){throw new l},e.equals=function equals(e){throw new l},_createClass(Zone,[{key:"type",get:function get(){throw new l}},{key:"name",get:function get(){throw new l}},{key:"isUniversal",get:function get(){throw new l}},{key:"isValid",get:function get(){throw new l}}]),Zone}(),Y=null,Q=function(e){function SystemZone(){return e.apply(this,arguments)||this}_inheritsLoose(SystemZone,e);var t=SystemZone.prototype;return t.offsetName=function offsetName(e,t){return parseZoneInfo(e,t.format,t.locale)},t.formatOffset=function formatOffset$1(e,t){return formatOffset(this.offset(e),t)},t.offset=function offset(e){return-new Date(e).getTimezoneOffset()},t.equals=function equals(e){return"system"===e.type},_createClass(SystemZone,[{key:"type",get:function get(){return"system"}},{key:"name",get:function get(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function get(){return!1}},{key:"isValid",get:function get(){return!0}}],[{key:"instance",get:function get(){return null===Y&&(Y=new SystemZone),Y}}]),SystemZone}(Z),X=RegExp("^"+x.source+"$"),ee={};var te={year:0,month:1,day:2,hour:3,minute:4,second:5};var re={},ne=function(e){function IANAZone(t){var r;return(r=e.call(this)||this).zoneName=t,r.valid=IANAZone.isValidZone(t),r}_inheritsLoose(IANAZone,e),IANAZone.create=function create(e){return re[e]||(re[e]=new IANAZone(e)),re[e]},IANAZone.resetCache=function resetCache(){re={},ee={}},IANAZone.isValidSpecifier=function isValidSpecifier(e){return!(!e||!e.match(X))},IANAZone.isValidZone=function isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var t=IANAZone.prototype;return t.offsetName=function offsetName(e,t){return parseZoneInfo(e,t.format,t.locale,this.name)},t.formatOffset=function formatOffset$1(e,t){return formatOffset(this.offset(e),t)},t.offset=function offset(e){var t=new Date(e);if(isNaN(t))return NaN;var r=function makeDTF(e){return ee[e]||(ee[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ee[e]}(this.name),n=r.formatToParts?function partsOffset(e,t){for(var r=e.formatToParts(t),n=[],i=0;i<r.length;i++){var o=r[i],a=o.type,s=o.value,c=te[a];isUndefined(c)||(n[c]=parseInt(s,10))}return n}(r,t):function hackyOffset(e,t){var r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r),i=n[1],o=n[2];return[n[3],i,o,n[4],n[5],n[6]]}(r,t),i=n[0],o=n[1],a=n[2],s=n[3],c=+t,l=c%1e3;return(objToLocalTS({year:i,month:o,day:a,hour:24===s?0:s,minute:n[4],second:n[5],millisecond:0})-(c-=l>=0?l:1e3+l))/6e4},t.equals=function equals(e){return"iana"===e.type&&e.name===this.name},_createClass(IANAZone,[{key:"type",get:function get(){return"iana"}},{key:"name",get:function get(){return this.zoneName}},{key:"isUniversal",get:function get(){return!1}},{key:"isValid",get:function get(){return this.valid}}]),IANAZone}(Z),ie=null,oe=function(e){function FixedOffsetZone(t){var r;return(r=e.call(this)||this).fixed=t,r}_inheritsLoose(FixedOffsetZone,e),FixedOffsetZone.instance=function instance(e){return 0===e?FixedOffsetZone.utcInstance:new FixedOffsetZone(e)},FixedOffsetZone.parseSpecifier=function parseSpecifier(e){if(e){var t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new FixedOffsetZone(signedOffset(t[1],t[2]))}return null};var t=FixedOffsetZone.prototype;return t.offsetName=function offsetName(){return this.name},t.formatOffset=function formatOffset$1(e,t){return formatOffset(this.fixed,t)},t.offset=function offset(){return this.fixed},t.equals=function equals(e){return"fixed"===e.type&&e.fixed===this.fixed},_createClass(FixedOffsetZone,[{key:"type",get:function get(){return"fixed"}},{key:"name",get:function get(){return 0===this.fixed?"UTC":"UTC"+formatOffset(this.fixed,"narrow")}},{key:"isUniversal",get:function get(){return!0}},{key:"isValid",get:function get(){return!0}}],[{key:"utcInstance",get:function get(){return null===ie&&(ie=new FixedOffsetZone(0)),ie}}]),FixedOffsetZone}(Z),ae=function(e){function InvalidZone(t){var r;return(r=e.call(this)||this).zoneName=t,r}_inheritsLoose(InvalidZone,e);var t=InvalidZone.prototype;return t.offsetName=function offsetName(){return null},t.formatOffset=function formatOffset(){return""},t.offset=function offset(){return NaN},t.equals=function equals(){return!1},_createClass(InvalidZone,[{key:"type",get:function get(){return"invalid"}},{key:"name",get:function get(){return this.zoneName}},{key:"isUniversal",get:function get(){return!1}},{key:"isValid",get:function get(){return!1}}]),InvalidZone}(Z);function normalizeZone(e,t){if(isUndefined(e)||null===e)return t;if(e instanceof Z)return e;if(function isString(e){return"string"==typeof e}(e)){var r=e.toLowerCase();return"local"===r||"system"===r?t:"utc"===r||"gmt"===r?oe.utcInstance:ne.isValidSpecifier(r)?ne.create(e):oe.parseSpecifier(r)||new ae(e)}return isNumber(e)?oe.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new ae(e)}var se,ce=function now(){return Date.now()},le="system",ue=null,pe=null,fe=null,de=function(){function Settings(){}return Settings.resetCaches=function resetCaches(){Te.resetCache(),ne.resetCache()},_createClass(Settings,null,[{key:"now",get:function get(){return ce},set:function set(e){ce=e}},{key:"defaultZone",get:function get(){return normalizeZone(le,Q.instance)},set:function set(e){le=e}},{key:"defaultLocale",get:function get(){return ue},set:function set(e){ue=e}},{key:"defaultNumberingSystem",get:function get(){return pe},set:function set(e){pe=e}},{key:"defaultOutputCalendar",get:function get(){return fe},set:function set(e){fe=e}},{key:"throwOnInvalid",get:function get(){return se},set:function set(e){se=e}}]),Settings}(),he=["base"],ge=["padTo","floor"],ye={};var me={};function getCachedDTF(e,t){void 0===t&&(t={});var r=JSON.stringify([e,t]),n=me[r];return n||(n=new Intl.DateTimeFormat(e,t),me[r]=n),n}var ve={};var we={};var be=null;function listStuff(e,t,r,n,i){var o=e.listingMode(r);return"error"===o?null:"en"===o?n(t):i(t)}var Ce=function(){function PolyNumberFormatter(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1,r.padTo,r.floor;var n=_objectWithoutPropertiesLoose(r,ge);if(!t||Object.keys(n).length>0){var i=_extends({useGrouping:!1},r);r.padTo>0&&(i.minimumIntegerDigits=r.padTo),this.inf=function getCachedINF(e,t){void 0===t&&(t={});var r=JSON.stringify([e,t]),n=ve[r];return n||(n=new Intl.NumberFormat(e,t),ve[r]=n),n}(e,i)}}return PolyNumberFormatter.prototype.format=function format(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return padStart(this.floor?Math.floor(e):roundTo(e,3),this.padTo)},PolyNumberFormatter}(),_e=function(){function PolyDateFormatter(e,t,r){var n;if(this.opts=r,e.zone.isUniversal){var i=e.offset/60*-1,o=i>=0?"Etc/GMT+"+i:"Etc/GMT"+i;0!==e.offset&&ne.create(o).valid?(n=o,this.dt=e):(n="UTC",r.timeZoneName?this.dt=e:this.dt=0===e.offset?e:It.fromMillis(e.ts+60*e.offset*1e3))}else"system"===e.zone.type?this.dt=e:(this.dt=e,n=e.zone.name);var a=_extends({},this.opts);n&&(a.timeZone=n),this.dtf=getCachedDTF(t,a)}var e=PolyDateFormatter.prototype;return e.format=function format(){return this.dtf.format(this.dt.toJSDate())},e.formatToParts=function formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())},e.resolvedOptions=function resolvedOptions(){return this.dtf.resolvedOptions()},PolyDateFormatter}(),Se=function(){function PolyRelFormatter(e,t,r){this.opts=_extends({style:"long"},r),!t&&hasRelative()&&(this.rtf=function getCachedRTF(e,t){void 0===t&&(t={});var r=t;r.base;var n=_objectWithoutPropertiesLoose(r,he),i=JSON.stringify([e,n]),o=we[i];return o||(o=new Intl.RelativeTimeFormat(e,t),we[i]=o),o}(e,r))}var e=PolyRelFormatter.prototype;return e.format=function format(e,t){return this.rtf?this.rtf.format(e,t):function formatRelativeTime(e,t,r,n){void 0===r&&(r="always"),void 0===n&&(n=!1);var i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&o){var a="days"===e;switch(t){case 1:return a?"tomorrow":"next "+i[e][0];case-1:return a?"yesterday":"last "+i[e][0];case 0:return a?"today":"this "+i[e][0]}}var s=Object.is(t,-0)||t<0,c=Math.abs(t),l=1===c,u=i[e],p=n?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?c+" "+p+" ago":"in "+c+" "+p}(t,e,this.opts.numeric,"long"!==this.opts.style)},e.formatToParts=function formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},PolyRelFormatter}(),Te=function(){function Locale(e,t,r,n){var i=function parseLocaleString(e){var t=e.indexOf("-u-");if(-1===t)return[e];var r,n=e.substring(0,t);try{r=getCachedDTF(e).resolvedOptions()}catch(e){r=getCachedDTF(n).resolvedOptions()}var i=r;return[n,i.numberingSystem,i.calendar]}(e),o=i[0],a=i[1],s=i[2];this.locale=o,this.numberingSystem=t||a||null,this.outputCalendar=r||s||null,this.intl=function intlConfigString(e,t,r){return r||t?(e+="-u",r&&(e+="-ca-"+r),t&&(e+="-nu-"+t),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}Locale.fromOpts=function fromOpts(e){return Locale.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)},Locale.create=function create(e,t,r,n){void 0===n&&(n=!1);var i=e||de.defaultLocale;return new Locale(i||(n?"en-US":function systemLocale(){return be||(be=(new Intl.DateTimeFormat).resolvedOptions().locale)}()),t||de.defaultNumberingSystem,r||de.defaultOutputCalendar,i)},Locale.resetCache=function resetCache(){be=null,me={},ve={},we={}},Locale.fromObject=function fromObject(e){var t=void 0===e?{}:e,r=t.locale,n=t.numberingSystem,i=t.outputCalendar;return Locale.create(r,n,i)};var e=Locale.prototype;return e.listingMode=function listingMode(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},e.clone=function clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Locale.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this},e.redefaultToEN=function redefaultToEN(e){return void 0===e&&(e={}),this.clone(_extends({},e,{defaultToEN:!0}))},e.redefaultToSystem=function redefaultToSystem(e){return void 0===e&&(e={}),this.clone(_extends({},e,{defaultToEN:!1}))},e.months=function months$1(e,t,r){var n=this;return void 0===t&&(t=!1),void 0===r&&(r=!0),listStuff(this,e,r,months,(function(){var r=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return n.monthsCache[i][e]||(n.monthsCache[i][e]=function mapMonths(e){for(var t=[],r=1;r<=12;r++){var n=It.utc(2016,r,1);t.push(e(n))}return t}((function(e){return n.extract(e,r,"month")}))),n.monthsCache[i][e]}))},e.weekdays=function weekdays$1(e,t,r){var n=this;return void 0===t&&(t=!1),void 0===r&&(r=!0),listStuff(this,e,r,weekdays,(function(){var r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return n.weekdaysCache[i][e]||(n.weekdaysCache[i][e]=function mapWeekdays(e){for(var t=[],r=1;r<=7;r++){var n=It.utc(2016,11,13+r);t.push(e(n))}return t}((function(e){return n.extract(e,r,"weekday")}))),n.weekdaysCache[i][e]}))},e.meridiems=function meridiems$1(e){var t=this;return void 0===e&&(e=!0),listStuff(this,void 0,e,(function(){return q}),(function(){if(!t.meridiemCache){var e={hour:"numeric",hourCycle:"h12"};t.meridiemCache=[It.utc(2016,11,13,9),It.utc(2016,11,13,19)].map((function(r){return t.extract(r,e,"dayperiod")}))}return t.meridiemCache}))},e.eras=function eras$1(e,t){var r=this;return void 0===t&&(t=!0),listStuff(this,e,t,eras,(function(){var t={era:e};return r.eraCache[e]||(r.eraCache[e]=[It.utc(-40,1,1),It.utc(2017,1,1)].map((function(e){return r.extract(e,t,"era")}))),r.eraCache[e]}))},e.extract=function extract(e,t,r){var n=this.dtFormatter(e,t).formatToParts().find((function(e){return e.type.toLowerCase()===r}));return n?n.value:null},e.numberFormatter=function numberFormatter(e){return void 0===e&&(e={}),new Ce(this.intl,e.forceSimple||this.fastNumbers,e)},e.dtFormatter=function dtFormatter(e,t){return void 0===t&&(t={}),new _e(e,this.intl,t)},e.relFormatter=function relFormatter(e){return void 0===e&&(e={}),new Se(this.intl,this.isEnglish(),e)},e.listFormatter=function listFormatter(e){return void 0===e&&(e={}),function getCachedLF(e,t){void 0===t&&(t={});var r=JSON.stringify([e,t]),n=ye[r];return n||(n=new Intl.ListFormat(e,t),ye[r]=n),n}(this.intl,e)},e.isEnglish=function isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},e.equals=function equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},_createClass(Locale,[{key:"fastNumbers",get:function get(){return null==this.fastNumbersCached&&(this.fastNumbersCached=function supportsFastNumbers(e){return(!e.numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)}(this)),this.fastNumbersCached}}]),Locale}();function combineRegexes(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.reduce((function(e,t){return e+t.source}),"");return RegExp("^"+n+"$")}function combineExtractors(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduce((function(t,r){var n=t[0],i=t[1],o=t[2],a=r(e,o),s=a[0],c=a[1],l=a[2];return[_extends({},n,s),i||c,l]}),[{},null,1]).slice(0,2)}}function parse(e){if(null==e)return[null,null];for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,o=r;i<o.length;i++){var a=o[i],s=a[0],c=a[1],l=s.exec(e);if(l)return c(l)}return[null,null]}function simpleParse(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e,r){var n,i={};for(n=0;n<t.length;n++)i[t[n]]=parseInteger(e[r+n]);return[i,null,r+n]}}var Oe=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Re=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ie=RegExp(""+Re.source+Oe.source+"?"),Ee=RegExp("(?:T"+Ie.source+")?"),Le=simpleParse("weekYear","weekNumber","weekDay"),Me=simpleParse("year","ordinal"),Ae=RegExp(Re.source+" ?(?:"+Oe.source+"|("+x.source+"))?"),De=RegExp("(?: "+Ae.source+")?");function int(e,t,r){var n=e[t];return isUndefined(n)?r:parseInteger(n)}function extractISOYmd(e,t){return[{year:int(e,t),month:int(e,t+1,1),day:int(e,t+2,1)},null,t+3]}function extractISOTime(e,t){return[{hours:int(e,t,0),minutes:int(e,t+1,0),seconds:int(e,t+2,0),milliseconds:parseMillis(e[t+3])},null,t+4]}function extractISOOffset(e,t){var r=!e[t]&&!e[t+1],n=signedOffset(e[t+1],e[t+2]);return[{},r?null:oe.instance(n),t+3]}function extractIANAZone(e,t){return[{},e[t]?ne.create(e[t]):null,t+1]}var Pe=RegExp("^T?"+Re.source+"$"),je=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function extractISODuration(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u="-"===t[0],p=c&&"-"===c[0],d=function maybeNegate(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&u)?-e:e};return[{years:d(parseFloating(r)),months:d(parseFloating(n)),weeks:d(parseFloating(i)),days:d(parseFloating(o)),hours:d(parseFloating(a)),minutes:d(parseFloating(s)),seconds:d(parseFloating(c),"-0"===c),milliseconds:d(parseMillis(l),p)}]}var ke={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fromStrings(e,t,r,n,i,o,a){var s={year:2===t.length?untruncateYear(parseInteger(t)):parseInteger(t),month:N.indexOf(r)+1,day:parseInteger(n),hour:parseInteger(i),minute:parseInteger(o)};return a&&(s.second=parseInteger(a)),e&&(s.weekday=e.length>3?B.indexOf(e)+1:U.indexOf(e)+1),s}var xe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(e){var t,r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],p=e[10],d=e[11],h=fromStrings(r,o,i,n,a,s,c);return t=l?ke[l]:u?0:signedOffset(p,d),[h,new oe(t)]}var Fe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ne=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ze=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(e){var t=e[1],r=e[2],n=e[3];return[fromStrings(t,e[4],n,r,e[5],e[6],e[7]),oe.utcInstance]}function extractASCII(e){var t=e[1],r=e[2],n=e[3],i=e[4],o=e[5],a=e[6];return[fromStrings(t,e[7],r,n,i,o,a),oe.utcInstance]}var Be=combineRegexes(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ee),Ue=combineRegexes(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ee),We=combineRegexes(/(\d{4})-?(\d{3})/,Ee),qe=combineRegexes(Ie),Ve=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset),Ge=combineExtractors(Le,extractISOTime,extractISOOffset),Ke=combineExtractors(Me,extractISOTime,extractISOOffset),$e=combineExtractors(extractISOTime,extractISOOffset);var He=combineExtractors(extractISOTime);var Je=combineRegexes(/(\d{4})-(\d\d)-(\d\d)/,De),Ze=combineRegexes(Ae),Ye=combineExtractors(extractISOYmd,extractISOTime,extractISOOffset,extractIANAZone),Qe=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);var Xe={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},et=_extends({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Xe),tt=365.2425,rt=30.436875,nt=_extends({years:{quarters:4,months:12,weeks:52.1775,days:tt,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:rt,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Xe),it=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ot=it.slice(0).reverse();function clone$1(e,t,r){void 0===r&&(r=!1);var n={values:r?t.values:_extends({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new at(n)}function convert(e,t,r,n,i){var o=e[i][r],a=t[r]/o,s=!(Math.sign(a)===Math.sign(n[i]))&&0!==n[i]&&Math.abs(a)<=1?function antiTrunc(e){return e<0?Math.floor(e):Math.ceil(e)}(a):Math.trunc(a);n[i]+=s,t[r]-=s*o}var at=function(){function Duration(e){var t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||Te.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?nt:et,this.isLuxonDuration=!0}Duration.fromMillis=function fromMillis(e,t){return Duration.fromObject({milliseconds:e},t)},Duration.fromObject=function fromObject(e,t){if(void 0===t&&(t={}),null==e||"object"!=typeof e)throw new c("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Duration({values:normalizeObject(e,Duration.normalizeUnit),loc:Te.fromObject(t),conversionAccuracy:t.conversionAccuracy})},Duration.fromDurationLike=function fromDurationLike(e){if(isNumber(e))return Duration.fromMillis(e);if(Duration.isDuration(e))return e;if("object"==typeof e)return Duration.fromObject(e);throw new c("Unknown duration argument "+e+" of type "+typeof e)},Duration.fromISO=function fromISO(e,t){var r=function parseISODuration(e){return parse(e,[je,extractISODuration])}(e),n=r[0];return n?Duration.fromObject(n,t):Duration.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},Duration.fromISOTime=function fromISOTime(e,t){var r=function parseISOTimeOnly(e){return parse(e,[Pe,He])}(e),n=r[0];return n?Duration.fromObject(n,t):Duration.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},Duration.invalid=function invalid(e,t){if(void 0===t&&(t=null),!e)throw new c("need to specify a reason the Duration is invalid");var invalid=e instanceof J?e:new J(e,t);if(de.throwOnInvalid)throw new o(invalid);return new Duration({invalid})},Duration.normalizeUnit=function normalizeUnit(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new s(e);return t},Duration.isDuration=function isDuration(e){return e&&e.isLuxonDuration||!1};var e=Duration.prototype;return e.toFormat=function toFormat(e,t){void 0===t&&(t={});var r=_extends({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?H.create(this.loc,r).formatDurationFromString(this,e):"Invalid Duration"},e.toHuman=function toHuman(e){var t=this;void 0===e&&(e={});var r=it.map((function(r){var n=t.values[r];return isUndefined(n)?null:t.loc.numberFormatter(_extends({style:"unit",unitDisplay:"long"},e,{unit:r.slice(0,-1)})).format(n)})).filter((function(e){return e}));return this.loc.listFormatter(_extends({type:"conjunction",style:e.listStyle||"narrow"},e)).format(r)},e.toObject=function toObject(){return this.isValid?_extends({},this.values):{}},e.toISO=function toISO(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=roundTo(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},e.toISOTime=function toISOTime(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();if(t<0||t>=864e5)return null;e=_extends({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e);var r=this.shiftTo("hours","minutes","seconds","milliseconds"),n="basic"===e.format?"hhmm":"hh:mm";e.suppressSeconds&&0===r.seconds&&0===r.milliseconds||(n+="basic"===e.format?"ss":":ss",e.suppressMilliseconds&&0===r.milliseconds||(n+=".SSS"));var i=r.toFormat(n);return e.includePrefix&&(i="T"+i),i},e.toJSON=function toJSON(){return this.toISO()},e.toString=function toString(){return this.toISO()},e.toMillis=function toMillis(){return this.as("milliseconds")},e.valueOf=function valueOf(){return this.toMillis()},e.plus=function plus(e){if(!this.isValid)return this;for(var t,r=Duration.fromDurationLike(e),n={},i=_createForOfIteratorHelperLoose(it);!(t=i()).done;){var o=t.value;(hasOwnProperty(r.values,o)||hasOwnProperty(this.values,o))&&(n[o]=r.get(o)+this.get(o))}return clone$1(this,{values:n},!0)},e.minus=function minus(e){if(!this.isValid)return this;var t=Duration.fromDurationLike(e);return this.plus(t.negate())},e.mapUnits=function mapUnits(e){if(!this.isValid)return this;for(var t={},r=0,n=Object.keys(this.values);r<n.length;r++){var i=n[r];t[i]=asNumber(e(this.values[i],i))}return clone$1(this,{values:t},!0)},e.get=function get(e){return this[Duration.normalizeUnit(e)]},e.set=function set(e){return this.isValid?clone$1(this,{values:_extends({},this.values,normalizeObject(e,Duration.normalizeUnit))}):this},e.reconfigure=function reconfigure(e){var t=void 0===e?{}:e,r=t.locale,n=t.numberingSystem,i=t.conversionAccuracy,o={loc:this.loc.clone({locale:r,numberingSystem:n})};return i&&(o.conversionAccuracy=i),clone$1(this,o)},e.as=function as(e){return this.isValid?this.shiftTo(e).get(e):NaN},e.normalize=function normalize(){if(!this.isValid)return this;var e=this.toObject();return function normalizeValues(e,t){ot.reduce((function(r,n){return isUndefined(t[n])?r:(r&&convert(e,t,r,t,n),n)}),null)}(this.matrix,e),clone$1(this,{values:e},!0)},e.shiftTo=function shiftTo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!this.isValid)return this;if(0===t.length)return this;t=t.map((function(e){return Duration.normalizeUnit(e)}));for(var n,i,o={},a={},s=this.toObject(),c=_createForOfIteratorHelperLoose(it);!(i=c()).done;){var l=i.value;if(t.indexOf(l)>=0){n=l;var u=0;for(var p in a)u+=this.matrix[p][l]*a[p],a[p]=0;isNumber(s[l])&&(u+=s[l]);var d=Math.trunc(u);for(var h in o[l]=d,a[l]=(1e3*u-1e3*d)/1e3,s)it.indexOf(h)>it.indexOf(l)&&convert(this.matrix,s,h,o,l)}else isNumber(s[l])&&(a[l]=s[l])}for(var g in a)0!==a[g]&&(o[n]+=g===n?a[g]:a[g]/this.matrix[n][g]);return clone$1(this,{values:o},!0).normalize()},e.negate=function negate(){if(!this.isValid)return this;for(var e={},t=0,r=Object.keys(this.values);t<r.length;t++){var n=r[t];e[n]=-this.values[n]}return clone$1(this,{values:e},!0)},e.equals=function equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t,r=_createForOfIteratorHelperLoose(it);!(t=r()).done;){var n=t.value;if(i=this.values[n],o=e.values[n],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},_createClass(Duration,[{key:"locale",get:function get(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function get(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function get(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function get(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function get(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function get(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function get(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function get(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function get(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function get(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function get(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function get(){return null===this.invalid}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null}}]),Duration}(),st="Invalid Interval";function validateStartEnd(e,t){return e&&e.isValid?t&&t.isValid?t<e?ct.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+t.toISO()):null:ct.invalid("missing or invalid end"):ct.invalid("missing or invalid start")}var ct=function(){function Interval(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}Interval.invalid=function invalid(e,t){if(void 0===t&&(t=null),!e)throw new c("need to specify a reason the Interval is invalid");var invalid=e instanceof J?e:new J(e,t);if(de.throwOnInvalid)throw new i(invalid);return new Interval({invalid})},Interval.fromDateTimes=function fromDateTimes(e,t){var r=friendlyDateTime(e),n=friendlyDateTime(t),i=validateStartEnd(r,n);return null==i?new Interval({start:r,end:n}):i},Interval.after=function after(e,t){var r=at.fromDurationLike(t),n=friendlyDateTime(e);return Interval.fromDateTimes(n,n.plus(r))},Interval.before=function before(e,t){var r=at.fromDurationLike(t),n=friendlyDateTime(e);return Interval.fromDateTimes(n.minus(r),n)},Interval.fromISO=function fromISO(e,t){var r=(e||"").split("/",2),n=r[0],i=r[1];if(n&&i){var o,a,s,c;try{a=(o=It.fromISO(n,t)).isValid}catch(i){a=!1}try{c=(s=It.fromISO(i,t)).isValid}catch(i){c=!1}if(a&&c)return Interval.fromDateTimes(o,s);if(a){var l=at.fromISO(i,t);if(l.isValid)return Interval.after(o,l)}else if(c){var u=at.fromISO(n,t);if(u.isValid)return Interval.before(s,u)}}return Interval.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},Interval.isInterval=function isInterval(e){return e&&e.isLuxonInterval||!1};var e=Interval.prototype;return e.length=function length(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},e.count=function count(e){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var t=this.start.startOf(e),r=this.end.startOf(e);return Math.floor(r.diff(t,e).get(e))+1},e.hasSame=function hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},e.isEmpty=function isEmpty(){return this.s.valueOf()===this.e.valueOf()},e.isAfter=function isAfter(e){return!!this.isValid&&this.s>e},e.isBefore=function isBefore(e){return!!this.isValid&&this.e<=e},e.contains=function contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)},e.set=function set(e){var t=void 0===e?{}:e,r=t.start,n=t.end;return this.isValid?Interval.fromDateTimes(r||this.s,n||this.e):this},e.splitAt=function splitAt(){var e=this;if(!this.isValid)return[];for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=r.map(friendlyDateTime).filter((function(t){return e.contains(t)})).sort(),o=[],a=this.s,s=0;a<this.e;){var c=i[s]||this.e,l=+c>+this.e?this.e:c;o.push(Interval.fromDateTimes(a,l)),a=l,s+=1}return o},e.splitBy=function splitBy(e){var t=at.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];for(var r,n=this.s,i=1,o=[];n<this.e;){var a=this.start.plus(t.mapUnits((function(e){return e*i})));r=+a>+this.e?this.e:a,o.push(Interval.fromDateTimes(n,r)),n=r,i+=1}return o},e.divideEqually=function divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},e.overlaps=function overlaps(e){return this.e>e.s&&this.s<e.e},e.abutsStart=function abutsStart(e){return!!this.isValid&&+this.e==+e.s},e.abutsEnd=function abutsEnd(e){return!!this.isValid&&+e.e==+this.s},e.engulfs=function engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},e.equals=function equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},e.intersection=function intersection(e){if(!this.isValid)return this;var t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:Interval.fromDateTimes(t,r)},e.union=function union(e){if(!this.isValid)return this;var t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return Interval.fromDateTimes(t,r)},Interval.merge=function merge(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var r=e[0],n=e[1];return n?n.overlaps(t)||n.abutsStart(t)?[r,n.union(t)]:[r.concat([n]),t]:[r,t]}),[[],null]),r=t[0],n=t[1];return n&&r.push(n),r},Interval.xor=function xor(e){for(var t,r,n=null,i=0,o=[],a=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),s=_createForOfIteratorHelperLoose((t=Array.prototype).concat.apply(t,a).sort((function(e,t){return e.time-t.time})));!(r=s()).done;){var c=r.value;1===(i+="s"===c.type?1:-1)?n=c.time:(n&&+n!=+c.time&&o.push(Interval.fromDateTimes(n,c.time)),n=null)}return Interval.merge(o)},e.difference=function difference(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Interval.xor([this].concat(r)).map((function(t){return e.intersection(t)})).filter((function(e){return e&&!e.isEmpty()}))},e.toString=function toString(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":st},e.toISO=function toISO(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):st},e.toISODate=function toISODate(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():st},e.toISOTime=function toISOTime(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):st},e.toFormat=function toFormat(e,t){var r=(void 0===t?{}:t).separator,n=void 0===r?" – ":r;return this.isValid?""+this.s.toFormat(e)+n+this.e.toFormat(e):st},e.toDuration=function toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):at.invalid(this.invalidReason)},e.mapEndpoints=function mapEndpoints(e){return Interval.fromDateTimes(e(this.s),e(this.e))},_createClass(Interval,[{key:"start",get:function get(){return this.isValid?this.s:null}},{key:"end",get:function get(){return this.isValid?this.e:null}},{key:"isValid",get:function get(){return null===this.invalidReason}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null}}]),Interval}(),lt=function(){function Info(){}return Info.hasDST=function hasDST(e){void 0===e&&(e=de.defaultZone);var t=It.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},Info.isValidIANAZone=function isValidIANAZone(e){return ne.isValidSpecifier(e)&&ne.isValidZone(e)},Info.normalizeZone=function normalizeZone$1(e){return normalizeZone(e,de.defaultZone)},Info.months=function months(e,t){void 0===e&&(e="long");var r=void 0===t?{}:t,n=r.locale,i=void 0===n?null:n,o=r.numberingSystem,a=void 0===o?null:o,s=r.locObj,c=void 0===s?null:s,l=r.outputCalendar,u=void 0===l?"gregory":l;return(c||Te.create(i,a,u)).months(e)},Info.monthsFormat=function monthsFormat(e,t){void 0===e&&(e="long");var r=void 0===t?{}:t,n=r.locale,i=void 0===n?null:n,o=r.numberingSystem,a=void 0===o?null:o,s=r.locObj,c=void 0===s?null:s,l=r.outputCalendar,u=void 0===l?"gregory":l;return(c||Te.create(i,a,u)).months(e,!0)},Info.weekdays=function weekdays(e,t){void 0===e&&(e="long");var r=void 0===t?{}:t,n=r.locale,i=void 0===n?null:n,o=r.numberingSystem,a=void 0===o?null:o,s=r.locObj;return((void 0===s?null:s)||Te.create(i,a,null)).weekdays(e)},Info.weekdaysFormat=function weekdaysFormat(e,t){void 0===e&&(e="long");var r=void 0===t?{}:t,n=r.locale,i=void 0===n?null:n,o=r.numberingSystem,a=void 0===o?null:o,s=r.locObj;return((void 0===s?null:s)||Te.create(i,a,null)).weekdays(e,!0)},Info.meridiems=function meridiems(e){var t=(void 0===e?{}:e).locale,r=void 0===t?null:t;return Te.create(r).meridiems()},Info.eras=function eras(e,t){void 0===e&&(e="short");var r=(void 0===t?{}:t).locale,n=void 0===r?null:r;return Te.create(n,null,"gregory").eras(e)},Info.features=function features(){return{relative:hasRelative()}},Info}();function dayDiff(e,t){var r=function utcDayStart(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},n=r(t)-r(e);return Math.floor(at.fromMillis(n).as("days"))}function _diff(e,t,r,n){var i=function highOrderDiffs(e,t,r){for(var n,i,o={},a=0,s=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var r=dayDiff(e,t);return(r-r%7)/7}],["days",dayDiff]];a<s.length;a++){var c=s[a],l=c[0],u=c[1];if(r.indexOf(l)>=0){var p;n=l;var d,h=u(e,t);(i=e.plus(((p={})[l]=h,p)))>t?(e=e.plus(((d={})[l]=h-1,d)),h-=1):e=i,o[l]=h}}return[e,o,i,n]}(e,t,r),o=i[0],a=i[1],s=i[2],c=i[3],l=t-o,u=r.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));if(0===u.length){var p;if(s<t)s=o.plus(((p={})[c]=1,p));s!==o&&(a[c]=(a[c]||0)+l/(s-o))}var d,h=at.fromObject(a,n);return u.length>0?(d=at.fromMillis(l,n)).shiftTo.apply(d,u).plus(h):h}var ut={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},pt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ft=ut.hanidec.replace(/[\[|\]]/g,"").split("");function digitRegex(e,t){var r=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+ut[r||"latn"]+t)}function intUnit(e,t){return void 0===t&&(t=function post(e){return e}),{regex:e,deser:function deser(e){var r=e[0];return t(function parseDigits(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);if(-1!==e[r].search(ut.hanidec))t+=ft.indexOf(e[r]);else for(var i in pt){var o=pt[i],a=o[0],s=o[1];n>=a&&n<=s&&(t+=n-a)}}return parseInt(t,10)}return t}(r))}}}var dt="( |"+String.fromCharCode(160)+")",ht=new RegExp(dt,"g");function fixListRegex(e){return e.replace(/\./g,"\\.?").replace(ht,dt)}function stripInsensitivities(e){return e.replace(/\./g,"").replace(ht," ").toLowerCase()}function oneOf(e,t){return null===e?null:{regex:RegExp(e.map(fixListRegex).join("|")),deser:function deser(r){var n=r[0];return e.findIndex((function(e){return stripInsensitivities(n)===stripInsensitivities(e)}))+t}}}function offset(e,t){return{regex:e,deser:function deser(e){return signedOffset(e[1],e[2])},groups:t}}function simple(e){return{regex:e,deser:function deser(e){return e[0]}}}function escapeToken(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var gt={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};var yt=null;function maybeExpandMacroToken(e,t){if(e.literal)return e;var r=H.macroTokenToFormatOpts(e.val);if(!r)return e;var n=H.create(t,r).formatDateTimeParts(function getDummyDateTime(){return yt||(yt=It.fromMillis(1555555555555)),yt}()).map((function(e){return function tokenForPart(e,t,r){var n=e.type,i=e.value;if("literal"===n)return{literal:!0,val:i};var o=r[n],a=gt[n];return"object"==typeof a&&(a=a[o]),a?{literal:!1,val:a}:void 0}(e,0,r)}));return n.includes(void 0)?e:n}function explainFromTokens(e,t,r){var n=function expandMacroTokens(e,t){var r;return(r=Array.prototype).concat.apply(r,e.map((function(e){return maybeExpandMacroToken(e,t)})))}(H.parseFormat(r),e),i=n.map((function(t){return function unitForToken(e,t){var r=digitRegex(t),n=digitRegex(t,"{2}"),i=digitRegex(t,"{3}"),o=digitRegex(t,"{4}"),a=digitRegex(t,"{6}"),s=digitRegex(t,"{1,2}"),c=digitRegex(t,"{1,3}"),l=digitRegex(t,"{1,6}"),u=digitRegex(t,"{1,9}"),p=digitRegex(t,"{2,4}"),d=digitRegex(t,"{4,6}"),h=function literal(e){return{regex:RegExp(escapeToken(e.val)),deser:function deser(e){return e[0]},literal:!0}},g=function unitate(g){if(e.literal)return h(g);switch(g.val){case"G":return oneOf(t.eras("short",!1),0);case"GG":return oneOf(t.eras("long",!1),0);case"y":return intUnit(l);case"yy":case"kk":return intUnit(p,untruncateYear);case"yyyy":case"kkkk":return intUnit(o);case"yyyyy":return intUnit(d);case"yyyyyy":return intUnit(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return intUnit(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return intUnit(n);case"MMM":return oneOf(t.months("short",!0,!1),1);case"MMMM":return oneOf(t.months("long",!0,!1),1);case"LLL":return oneOf(t.months("short",!1,!1),1);case"LLLL":return oneOf(t.months("long",!1,!1),1);case"o":case"S":return intUnit(c);case"ooo":case"SSS":return intUnit(i);case"u":return simple(u);case"uu":return simple(s);case"uuu":case"E":case"c":return intUnit(r);case"a":return oneOf(t.meridiems(),0);case"EEE":return oneOf(t.weekdays("short",!1,!1),1);case"EEEE":return oneOf(t.weekdays("long",!1,!1),1);case"ccc":return oneOf(t.weekdays("short",!0,!1),1);case"cccc":return oneOf(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return offset(new RegExp("([+-]"+s.source+")(?::("+n.source+"))?"),2);case"ZZZ":return offset(new RegExp("([+-]"+s.source+")("+n.source+")?"),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);default:return h(g)}}(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return g.token=e,g}(t,e)})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:n,invalidReason:o.invalidReason};var s=function buildRegex(e){return["^"+e.map((function(e){return e.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"")+"$",e]}(i),c=s[0],l=s[1],u=RegExp(c,"i"),p=function match(e,t,r){var n=e.match(t);if(n){var i={},o=1;for(var a in r)if(hasOwnProperty(r,a)){var s=r[a],c=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(n.slice(o,o+c))),o+=c}return[n,i]}return[n,{}]}(t,u,l),d=p[0],h=p[1],g=h?function dateTimeFromMatches(e){var t,r=null;return isUndefined(e.z)||(r=ne.create(e.z)),isUndefined(e.Z)||(r||(r=new oe(e.Z)),t=e.Z),isUndefined(e.q)||(e.M=3*(e.q-1)+1),isUndefined(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),isUndefined(e.u)||(e.S=parseMillis(e.u)),[Object.keys(e).reduce((function(t,r){var n=function toField(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(r);return n&&(t[n]=e[r]),t}),{}),r,t]}(h):[null,null,void 0],y=g[0],m=g[1],v=g[2];if(hasOwnProperty(h,"a")&&hasOwnProperty(h,"H"))throw new a("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:u,rawMatches:d,matches:h,result:y,zone:m,specificOffset:v}}var mt=[0,31,59,90,120,151,181,212,243,273,304,334],vt=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(e,t){return new J("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function dayOfWeek(e,t,r){var n=new Date(Date.UTC(e,t-1,r)).getUTCDay();return 0===n?7:n}function computeOrdinal(e,t,r){return r+(isLeapYear(e)?vt:mt)[t-1]}function uncomputeOrdinal(e,t){var r=isLeapYear(e)?vt:mt,n=r.findIndex((function(e){return e<t}));return{month:n+1,day:t-r[n]}}function gregorianToWeek(e){var t,r=e.year,n=e.month,i=e.day,o=computeOrdinal(r,n,i),a=dayOfWeek(r,n,i),s=Math.floor((o-a+10)/7);return s<1?s=weeksInWeekYear(t=r-1):s>weeksInWeekYear(r)?(t=r+1,s=1):t=r,_extends({weekYear:t,weekNumber:s,weekday:a},timeObject(e))}function weekToGregorian(e){var t,r=e.weekYear,n=e.weekNumber,i=e.weekday,o=dayOfWeek(r,1,4),a=daysInYear(r),s=7*n+i-o-3;s<1?s+=daysInYear(t=r-1):s>a?(t=r+1,s-=daysInYear(r)):t=r;var c=uncomputeOrdinal(t,s);return _extends({year:t,month:c.month,day:c.day},timeObject(e))}function gregorianToOrdinal(e){var t=e.year;return _extends({year:t,ordinal:computeOrdinal(t,e.month,e.day)},timeObject(e))}function ordinalToGregorian(e){var t=e.year,r=uncomputeOrdinal(t,e.ordinal);return _extends({year:t,month:r.month,day:r.day},timeObject(e))}function hasInvalidGregorianData(e){var t=isInteger(e.year),r=integerBetween(e.month,1,12),n=integerBetween(e.day,1,daysInMonth(e.year,e.month));return t?r?!n&&unitOutOfRange("day",e.day):unitOutOfRange("month",e.month):unitOutOfRange("year",e.year)}function hasInvalidTimeData(e){var t=e.hour,r=e.minute,n=e.second,i=e.millisecond,o=integerBetween(t,0,23)||24===t&&0===r&&0===n&&0===i,a=integerBetween(r,0,59),s=integerBetween(n,0,59),c=integerBetween(i,0,999);return o?a?s?!c&&unitOutOfRange("millisecond",i):unitOutOfRange("second",n):unitOutOfRange("minute",r):unitOutOfRange("hour",t)}var wt="Invalid DateTime",bt=864e13;function unsupportedZone(e){return new J("unsupported zone",'the zone "'+e.name+'" is not supported')}function possiblyCachedWeekData(e){return null===e.weekData&&(e.weekData=gregorianToWeek(e.c)),e.weekData}function clone(e,t){var r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new It(_extends({},r,t,{old:r}))}function fixOffset(e,t,r){var n=e-60*t*1e3,i=r.offset(n);if(t===i)return[n,t];n-=60*(i-t)*1e3;var o=r.offset(n);return i===o?[n,i]:[e-60*Math.min(i,o)*1e3,Math.max(i,o)]}function tsToObj(e,t){var r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function objToTS(e,t,r){return fixOffset(objToLocalTS(e),t,r)}function adjustTime(e,t){var r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=_extends({},e.c,{year:n,month:i,day:Math.min(e.c.day,daysInMonth(n,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),a=at.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=fixOffset(objToLocalTS(o),r,e.zone),c=s[0],l=s[1];return 0!==a&&(c+=a,l=e.zone.offset(c)),{ts:c,o:l}}function parseDataToDateTime(e,t,r,n,i,o){var a=r.setZone,s=r.zone;if(e&&0!==Object.keys(e).length){var c=t||s,l=It.fromObject(e,_extends({},r,{zone:c,specificOffset:o}));return a?l:l.setZone(s)}return It.invalid(new J("unparsable",'the input "'+i+"\" can't be parsed as "+n))}function toTechFormat(e,t,r){return void 0===r&&(r=!0),e.isValid?H.create(Te.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function _toISODate(e,t){var r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=padStart(e.c.year,r?6:4),t?(n+="-",n+=padStart(e.c.month),n+="-",n+=padStart(e.c.day)):(n+=padStart(e.c.month),n+=padStart(e.c.day)),n}function _toISOTime(e,t,r,n,i){var o=padStart(e.c.hour);return t?(o+=":",o+=padStart(e.c.minute),0===e.c.second&&r||(o+=":")):o+=padStart(e.c.minute),0===e.c.second&&r||(o+=padStart(e.c.second),0===e.c.millisecond&&n||(o+=".",o+=padStart(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset?o+="Z":e.o<0?(o+="-",o+=padStart(Math.trunc(-e.o/60)),o+=":",o+=padStart(Math.trunc(-e.o%60))):(o+="+",o+=padStart(Math.trunc(e.o/60)),o+=":",o+=padStart(Math.trunc(e.o%60)))),o}var Ct={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},_t={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},St={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Tt=["year","month","day","hour","minute","second","millisecond"],Ot=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Rt=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnit(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new s(e);return t}function quickDT(e,t){var r,n,i=normalizeZone(t.zone,de.defaultZone),o=Te.fromObject(t),a=de.now();if(isUndefined(e.year))r=a;else{for(var s,c=_createForOfIteratorHelperLoose(Tt);!(s=c()).done;){var l=s.value;isUndefined(e[l])&&(e[l]=Ct[l])}var u=hasInvalidGregorianData(e)||hasInvalidTimeData(e);if(u)return It.invalid(u);var p=objToTS(e,i.offset(a),i);r=p[0],n=p[1]}return new It({ts:r,zone:i,loc:o,o:n})}function diffRelative(e,t,r){var n=!!isUndefined(r.round)||r.round,i=function format(e,i){return e=roundTo(e,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(e,i)},o=function differ(n){return r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n)};if(r.unit)return i(o(r.unit),r.unit);for(var a,s=_createForOfIteratorHelperLoose(r.units);!(a=s()).done;){var c=a.value,l=o(c);if(Math.abs(l)>=1)return i(l,c)}return i(e>t?-0:0,r.units[r.units.length-1])}function lastOpts(e){var t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}var It=function(){function DateTime(e){var t=e.zone||de.defaultZone,r=e.invalid||(Number.isNaN(e.ts)?new J("invalid input"):null)||(t.isValid?null:unsupportedZone(t));this.ts=isUndefined(e.ts)?de.now():e.ts;var n=null,i=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];n=o[0],i=o[1]}else{var a=t.offset(this.ts);n=tsToObj(this.ts,a),n=(r=Number.isNaN(n.year)?new J("invalid input"):null)?null:n,i=r?null:a}this._zone=t,this.loc=e.loc||Te.create(),this.invalid=r,this.weekData=null,this.c=n,this.o=i,this.isLuxonDateTime=!0}DateTime.now=function now(){return new DateTime({})},DateTime.local=function local(){var e=lastOpts(arguments),t=e[0],r=e[1],n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],l=r[6];return quickDT({year:n,month:i,day:o,hour:a,minute:s,second:c,millisecond:l},t)},DateTime.utc=function utc(){var e=lastOpts(arguments),t=e[0],r=e[1],n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],l=r[6];return t.zone=oe.utcInstance,quickDT({year:n,month:i,day:o,hour:a,minute:s,second:c,millisecond:l},t)},DateTime.fromJSDate=function fromJSDate(e,t){void 0===t&&(t={});var r=function isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return DateTime.invalid("invalid input");var n=normalizeZone(t.zone,de.defaultZone);return n.isValid?new DateTime({ts:r,zone:n,loc:Te.fromObject(t)}):DateTime.invalid(unsupportedZone(n))},DateTime.fromMillis=function fromMillis(e,t){if(void 0===t&&(t={}),isNumber(e))return e<-bt||e>bt?DateTime.invalid("Timestamp out of range"):new DateTime({ts:e,zone:normalizeZone(t.zone,de.defaultZone),loc:Te.fromObject(t)});throw new c("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},DateTime.fromSeconds=function fromSeconds(e,t){if(void 0===t&&(t={}),isNumber(e))return new DateTime({ts:1e3*e,zone:normalizeZone(t.zone,de.defaultZone),loc:Te.fromObject(t)});throw new c("fromSeconds requires a numerical input")},DateTime.fromObject=function fromObject(e,t){void 0===t&&(t={}),e=e||{};var r=normalizeZone(t.zone,de.defaultZone);if(!r.isValid)return DateTime.invalid(unsupportedZone(r));var n=de.now(),i=isUndefined(t.specificOffset)?r.offset(n):t.specificOffset,o=normalizeObject(e,normalizeUnit),s=!isUndefined(o.ordinal),c=!isUndefined(o.year),l=!isUndefined(o.month)||!isUndefined(o.day),u=c||l,p=o.weekYear||o.weekNumber,d=Te.fromObject(t);if((u||s)&&p)throw new a("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new a("Can't mix ordinal dates with month/day");var h,g,y=p||o.weekday&&!u,m=tsToObj(n,i);y?(h=Ot,g=_t,m=gregorianToWeek(m)):s?(h=Rt,g=St,m=gregorianToOrdinal(m)):(h=Tt,g=Ct);for(var v,w=!1,b=_createForOfIteratorHelperLoose(h);!(v=b()).done;){var C=v.value;isUndefined(o[C])?o[C]=w?g[C]:m[C]:w=!0}var _=y?function hasInvalidWeekData(e){var t=isInteger(e.weekYear),r=integerBetween(e.weekNumber,1,weeksInWeekYear(e.weekYear)),n=integerBetween(e.weekday,1,7);return t?r?!n&&unitOutOfRange("weekday",e.weekday):unitOutOfRange("week",e.week):unitOutOfRange("weekYear",e.weekYear)}(o):s?function hasInvalidOrdinalData(e){var t=isInteger(e.year),r=integerBetween(e.ordinal,1,daysInYear(e.year));return t?!r&&unitOutOfRange("ordinal",e.ordinal):unitOutOfRange("year",e.year)}(o):hasInvalidGregorianData(o),S=_||hasInvalidTimeData(o);if(S)return DateTime.invalid(S);var T=objToTS(y?weekToGregorian(o):s?ordinalToGregorian(o):o,i,r),O=new DateTime({ts:T[0],zone:r,o:T[1],loc:d});return o.weekday&&u&&e.weekday!==O.weekday?DateTime.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+O.toISO()):O},DateTime.fromISO=function fromISO(e,t){void 0===t&&(t={});var r=function parseISODate(e){return parse(e,[Be,Ve],[Ue,Ge],[We,Ke],[qe,$e])}(e);return parseDataToDateTime(r[0],r[1],t,"ISO 8601",e)},DateTime.fromRFC2822=function fromRFC2822(e,t){void 0===t&&(t={});var r=function parseRFC2822Date(e){return parse(function preprocessRFC2822(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[xe,extractRFC2822])}(e);return parseDataToDateTime(r[0],r[1],t,"RFC 2822",e)},DateTime.fromHTTP=function fromHTTP(e,t){void 0===t&&(t={});var r=function parseHTTPDate(e){return parse(e,[Fe,extractRFC1123Or850],[Ne,extractRFC1123Or850],[ze,extractASCII])}(e);return parseDataToDateTime(r[0],r[1],t,"HTTP",t)},DateTime.fromFormat=function fromFormat(e,t,r){if(void 0===r&&(r={}),isUndefined(e)||isUndefined(t))throw new c("fromFormat requires an input string and a format");var n=r,i=n.locale,o=void 0===i?null:i,a=n.numberingSystem,s=void 0===a?null:a,l=function parseFromTokens(e,t,r){var n=explainFromTokens(e,t,r);return[n.result,n.zone,n.specificOffset,n.invalidReason]}(Te.fromOpts({locale:o,numberingSystem:s,defaultToEN:!0}),e,t),u=l[0],p=l[1],d=l[2],h=l[3];return h?DateTime.invalid(h):parseDataToDateTime(u,p,r,"format "+t,e,d)},DateTime.fromString=function fromString(e,t,r){return void 0===r&&(r={}),DateTime.fromFormat(e,t,r)},DateTime.fromSQL=function fromSQL(e,t){void 0===t&&(t={});var r=function parseSQL(e){return parse(e,[Je,Ye],[Ze,Qe])}(e);return parseDataToDateTime(r[0],r[1],t,"SQL",e)},DateTime.invalid=function invalid(e,t){if(void 0===t&&(t=null),!e)throw new c("need to specify a reason the DateTime is invalid");var invalid=e instanceof J?e:new J(e,t);if(de.throwOnInvalid)throw new n(invalid);return new DateTime({invalid})},DateTime.isDateTime=function isDateTime(e){return e&&e.isLuxonDateTime||!1};var e=DateTime.prototype;return e.get=function get(e){return this[e]},e.resolvedLocaleOptions=function resolvedLocaleOptions(e){void 0===e&&(e={});var t=H.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},e.toUTC=function toUTC(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(oe.instance(e),t)},e.toLocal=function toLocal(){return this.setZone(de.defaultZone)},e.setZone=function setZone(e,t){var r=void 0===t?{}:t,n=r.keepLocalTime,i=void 0!==n&&n,o=r.keepCalendarTime,a=void 0!==o&&o;if((e=normalizeZone(e,de.defaultZone)).equals(this.zone))return this;if(e.isValid){var s=this.ts;if(i||a){var c=e.offset(this.ts);s=objToTS(this.toObject(),c,e)[0]}return clone(this,{ts:s,zone:e})}return DateTime.invalid(unsupportedZone(e))},e.reconfigure=function reconfigure(e){var t=void 0===e?{}:e,r=t.locale,n=t.numberingSystem,i=t.outputCalendar;return clone(this,{loc:this.loc.clone({locale:r,numberingSystem:n,outputCalendar:i})})},e.setLocale=function setLocale(e){return this.reconfigure({locale:e})},e.set=function set(e){if(!this.isValid)return this;var t,r=normalizeObject(e,normalizeUnit),n=!isUndefined(r.weekYear)||!isUndefined(r.weekNumber)||!isUndefined(r.weekday),i=!isUndefined(r.ordinal),o=!isUndefined(r.year),s=!isUndefined(r.month)||!isUndefined(r.day),c=o||s,l=r.weekYear||r.weekNumber;if((c||i)&&l)throw new a("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new a("Can't mix ordinal dates with month/day");n?t=weekToGregorian(_extends({},gregorianToWeek(this.c),r)):isUndefined(r.ordinal)?(t=_extends({},this.toObject(),r),isUndefined(r.day)&&(t.day=Math.min(daysInMonth(t.year,t.month),t.day))):t=ordinalToGregorian(_extends({},gregorianToOrdinal(this.c),r));var u=objToTS(t,this.o,this.zone);return clone(this,{ts:u[0],o:u[1]})},e.plus=function plus(e){return this.isValid?clone(this,adjustTime(this,at.fromDurationLike(e))):this},e.minus=function minus(e){return this.isValid?clone(this,adjustTime(this,at.fromDurationLike(e).negate())):this},e.startOf=function startOf(e){if(!this.isValid)return this;var t={},r=at.normalizeUnit(e);switch(r){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===r&&(t.weekday=1),"quarters"===r){var n=Math.ceil(this.month/3);t.month=3*(n-1)+1}return this.set(t)},e.endOf=function endOf(e){var t;return this.isValid?this.plus((t={},t[e]=1,t)).startOf(e).minus(1):this},e.toFormat=function toFormat(e,t){return void 0===t&&(t={}),this.isValid?H.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):wt},e.toLocaleString=function toLocaleString(e,t){return void 0===e&&(e=h),void 0===t&&(t={}),this.isValid?H.create(this.loc.clone(t),e).formatDateTime(this):wt},e.toLocaleParts=function toLocaleParts(e){return void 0===e&&(e={}),this.isValid?H.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},e.toISO=function toISO(e){var t=void 0===e?{}:e,r=t.format,n=void 0===r?"extended":r,i=t.suppressSeconds,o=void 0!==i&&i,a=t.suppressMilliseconds,s=void 0!==a&&a,c=t.includeOffset,l=void 0===c||c;if(!this.isValid)return null;var u="extended"===n,p=_toISODate(this,u);return p+="T",p+=_toISOTime(this,u,o,s,l)},e.toISODate=function toISODate(e){var t=(void 0===e?{}:e).format,r=void 0===t?"extended":t;return this.isValid?_toISODate(this,"extended"===r):null},e.toISOWeekDate=function toISOWeekDate(){return toTechFormat(this,"kkkk-'W'WW-c")},e.toISOTime=function toISOTime(e){var t=void 0===e?{}:e,r=t.suppressMilliseconds,n=void 0!==r&&r,i=t.suppressSeconds,o=void 0!==i&&i,a=t.includeOffset,s=void 0===a||a,c=t.includePrefix,l=void 0!==c&&c,u=t.format,p=void 0===u?"extended":u;return this.isValid?(l?"T":"")+_toISOTime(this,"extended"===p,o,n,s):null},e.toRFC2822=function toRFC2822(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},e.toHTTP=function toHTTP(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},e.toSQLDate=function toSQLDate(){return this.isValid?_toISODate(this,!0):null},e.toSQLTime=function toSQLTime(e){var t=void 0===e?{}:e,r=t.includeOffset,n=void 0===r||r,i=t.includeZone,o=void 0!==i&&i,a="HH:mm:ss.SSS";return(o||n)&&(a+=" ",o?a+="z":n&&(a+="ZZ")),toTechFormat(this,a,!0)},e.toSQL=function toSQL(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},e.toString=function toString(){return this.isValid?this.toISO():wt},e.valueOf=function valueOf(){return this.toMillis()},e.toMillis=function toMillis(){return this.isValid?this.ts:NaN},e.toSeconds=function toSeconds(){return this.isValid?this.ts/1e3:NaN},e.toJSON=function toJSON(){return this.toISO()},e.toBSON=function toBSON(){return this.toJSDate()},e.toObject=function toObject(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=_extends({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},e.toJSDate=function toJSDate(){return new Date(this.isValid?this.ts:NaN)},e.diff=function diff(e,t,r){if(void 0===t&&(t="milliseconds"),void 0===r&&(r={}),!this.isValid||!e.isValid)return at.invalid("created by diffing an invalid DateTime");var n=_extends({locale:this.locale,numberingSystem:this.numberingSystem},r),i=function maybeArray(e){return Array.isArray(e)?e:[e]}(t).map(at.normalizeUnit),o=e.valueOf()>this.valueOf(),a=_diff(o?this:e,o?e:this,i,n);return o?a.negate():a},e.diffNow=function diffNow(e,t){return void 0===e&&(e="milliseconds"),void 0===t&&(t={}),this.diff(DateTime.now(),e,t)},e.until=function until(e){return this.isValid?ct.fromDateTimes(this,e):this},e.hasSame=function hasSame(e,t){if(!this.isValid)return!1;var r=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(t)<=r&&r<=n.endOf(t)},e.equals=function equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},e.toRelative=function toRelative(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=e.base||DateTime.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0,n=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(n=e.unit,i=void 0),diffRelative(t,this.plus(r),_extends({},e,{numeric:"always",units:n,unit:i}))},e.toRelativeCalendar=function toRelativeCalendar(e){return void 0===e&&(e={}),this.isValid?diffRelative(e.base||DateTime.fromObject({},{zone:this.zone}),this,_extends({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},DateTime.min=function min(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every(DateTime.isDateTime))throw new c("min requires all arguments be DateTimes");return bestBy(t,(function(e){return e.valueOf()}),Math.min)},DateTime.max=function max(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every(DateTime.isDateTime))throw new c("max requires all arguments be DateTimes");return bestBy(t,(function(e){return e.valueOf()}),Math.max)},DateTime.fromFormatExplain=function fromFormatExplain(e,t,r){void 0===r&&(r={});var n=r,i=n.locale,o=void 0===i?null:i,a=n.numberingSystem,s=void 0===a?null:a;return explainFromTokens(Te.fromOpts({locale:o,numberingSystem:s,defaultToEN:!0}),e,t)},DateTime.fromStringExplain=function fromStringExplain(e,t,r){return void 0===r&&(r={}),DateTime.fromFormatExplain(e,t,r)},_createClass(DateTime,[{key:"isValid",get:function get(){return null===this.invalid}},{key:"invalidReason",get:function get(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function get(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function get(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function get(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function get(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function get(){return this._zone}},{key:"zoneName",get:function get(){return this.isValid?this.zone.name:null}},{key:"year",get:function get(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function get(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function get(){return this.isValid?this.c.month:NaN}},{key:"day",get:function get(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function get(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function get(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function get(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function get(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN}},{key:"weekNumber",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN}},{key:"weekday",get:function get(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN}},{key:"ordinal",get:function get(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN}},{key:"monthShort",get:function get(){return this.isValid?lt.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function get(){return this.isValid?lt.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function get(){return this.isValid?lt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function get(){return this.isValid?lt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function get(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function get(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function get(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function get(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function get(){return!this.isOffsetFixed&&(this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function get(){return isLeapYear(this.year)}},{key:"daysInMonth",get:function get(){return daysInMonth(this.year,this.month)}},{key:"daysInYear",get:function get(){return this.isValid?daysInYear(this.year):NaN}},{key:"weeksInWeekYear",get:function get(){return this.isValid?weeksInWeekYear(this.weekYear):NaN}}],[{key:"DATE_SHORT",get:function get(){return h}},{key:"DATE_MED",get:function get(){return g}},{key:"DATE_MED_WITH_WEEKDAY",get:function get(){return y}},{key:"DATE_FULL",get:function get(){return m}},{key:"DATE_HUGE",get:function get(){return v}},{key:"TIME_SIMPLE",get:function get(){return w}},{key:"TIME_WITH_SECONDS",get:function get(){return b}},{key:"TIME_WITH_SHORT_OFFSET",get:function get(){return C}},{key:"TIME_WITH_LONG_OFFSET",get:function get(){return _}},{key:"TIME_24_SIMPLE",get:function get(){return S}},{key:"TIME_24_WITH_SECONDS",get:function get(){return T}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function get(){return O}},{key:"TIME_24_WITH_LONG_OFFSET",get:function get(){return R}},{key:"DATETIME_SHORT",get:function get(){return I}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function get(){return E}},{key:"DATETIME_MED",get:function get(){return L}},{key:"DATETIME_MED_WITH_SECONDS",get:function get(){return M}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function get(){return A}},{key:"DATETIME_FULL",get:function get(){return D}},{key:"DATETIME_FULL_WITH_SECONDS",get:function get(){return P}},{key:"DATETIME_HUGE",get:function get(){return j}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function get(){return k}}]),DateTime}();function friendlyDateTime(e){if(It.isDateTime(e))return e;if(e&&e.valueOf&&isNumber(e.valueOf()))return It.fromJSDate(e);if(e&&"object"==typeof e)return It.fromObject(e);throw new c("Unknown datetime argument: "+e+", of type "+typeof e)}t.DateTime=It,t.Duration=at,t.FixedOffsetZone=oe,t.IANAZone=ne,t.Info=lt,t.Interval=ct,t.InvalidZone=ae,t.Settings=de,t.SystemZone=Q,t.VERSION="2.3.0",t.Zone=Z},631:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=s&&c&&"function"==typeof c.get?c.get:null,u=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,g=Boolean.prototype.valueOf,y=Object.prototype.toString,m=Function.prototype.toString,v=String.prototype.match,w="function"==typeof BigInt?BigInt.prototype.valueOf:null,b=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,_="function"==typeof Symbol&&"object"==typeof Symbol.iterator,S=Object.prototype.propertyIsEnumerable,T=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),O=r(4654).custom,R=O&&isSymbol(O)?O:null,I="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function wrapQuotes(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function quote(e){return String(e).replace(/"/g,""")}function isArray(e){return!("[object Array]"!==toStr(e)||I&&"object"==typeof e&&I in e)}function isSymbol(e){if(_)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}e.exports=function inspect_(e,t,r,n){var i=t||{};if(has(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!has(i,"customInspect")||i.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return inspectString(e,i);if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);if("bigint"==typeof e)return String(e)+"n";var c=void 0===i.depth?5:i.depth;if(void 0===r&&(r=0),r>=c&&c>0&&"object"==typeof e)return isArray(e)?"[Array]":"[Object]";var y=function getIndent(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=Array(e.indent+1).join(" ")}return{base:r,prev:Array(t+1).join(r)}}(i,r);if(void 0===n)n=[];else if(indexOf(n,e)>=0)return"[Circular]";function inspect(e,t,o){if(t&&(n=n.slice()).push(t),o){var a={depth:i.depth};return has(i,"quoteStyle")&&(a.quoteStyle=i.quoteStyle),inspect_(e,a,r+1,n)}return inspect_(e,i,r+1,n)}if("function"==typeof e){var b=function nameOf(e){if(e.name)return e.name;var t=v.call(m.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(e),S=arrObjKeys(e,inspect);return"[Function"+(b?": "+b:" (anonymous)")+"]"+(S.length>0?" { "+S.join(", ")+" }":"")}if(isSymbol(e)){var O=_?String(e).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||_?O:markBoxed(O)}if(function isElement(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(e)){for(var E="<"+String(e.nodeName).toLowerCase(),L=e.attributes||[],M=0;M<L.length;M++)E+=" "+L[M].name+"="+wrapQuotes(quote(L[M].value),"double",i);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+String(e.nodeName).toLowerCase()+">"}if(isArray(e)){if(0===e.length)return"[]";var A=arrObjKeys(e,inspect);return y&&!function singleLineValues(e){for(var t=0;t<e.length;t++)if(indexOf(e[t],"\n")>=0)return!1;return!0}(A)?"["+indentedJoin(A,y)+"]":"[ "+A.join(", ")+" ]"}if(function isError(e){return!("[object Error]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e)){var D=arrObjKeys(e,inspect);return 0===D.length?"["+String(e)+"]":"{ ["+String(e)+"] "+D.join(", ")+" }"}if("object"==typeof e&&s){if(R&&"function"==typeof e[R])return e[R]();if("symbol"!==s&&"function"==typeof e.inspect)return e.inspect()}if(function isMap(e){if(!o||!e||"object"!=typeof e)return!1;try{o.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(e)){var P=[];return a.call(e,(function(t,r){P.push(inspect(r,e,!0)+" => "+inspect(t,e))})),collectionOf("Map",o.call(e),P,y)}if(function isSet(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{o.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(e)){var j=[];return u.call(e,(function(t){j.push(inspect(t,e))})),collectionOf("Set",l.call(e),j,y)}if(function isWeakMap(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(e))return weakCollectionOf("WeakMap");if(function isWeakSet(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(e))return weakCollectionOf("WeakSet");if(function isWeakRef(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(e))return weakCollectionOf("WeakRef");if(function isNumber(e){return!("[object Number]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e))return markBoxed(inspect(Number(e)));if(function isBigInt(e){if(!e||"object"!=typeof e||!w)return!1;try{return w.call(e),!0}catch(e){}return!1}(e))return markBoxed(inspect(w.call(e)));if(function isBoolean(e){return!("[object Boolean]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e))return markBoxed(g.call(e));if(function isString(e){return!("[object String]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e))return markBoxed(inspect(String(e)));if(!function isDate(e){return!("[object Date]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e)&&!function isRegExp(e){return!("[object RegExp]"!==toStr(e)||I&&"object"==typeof e&&I in e)}(e)){var k=arrObjKeys(e,inspect),x=T?T(e)===Object.prototype:e instanceof Object||e.constructor===Object,F=e instanceof Object?"":"null prototype",N=!x&&I&&Object(e)===e&&I in e?toStr(e).slice(8,-1):F?"Object":"",z=(x||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(N||F?"["+[].concat(N||[],F||[]).join(": ")+"] ":"");return 0===k.length?z+"{}":y?z+"{"+indentedJoin(k,y)+"}":z+"{ "+k.join(", ")+" }"}return String(e)};var E=Object.prototype.hasOwnProperty||function(e){return e in this};function has(e,t){return E.call(e,t)}function toStr(e){return y.call(e)}function indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function inspectString(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString(e.slice(0,t.maxStringLength),t)+n}return wrapQuotes(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,lowbyte),"single",t)}function lowbyte(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function markBoxed(e){return"Object("+e+")"}function weakCollectionOf(e){return e+" { ? }"}function collectionOf(e,t,r,n){return e+" ("+t+") {"+(n?indentedJoin(r,n):r.join(", "))+"}"}function indentedJoin(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+e.join(","+r)+"\n"+t.prev}function arrObjKeys(e,t){var r=isArray(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=has(e,i)?t(e[i],e):""}var o,a="function"==typeof b?b(e):[];if(_){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var c in e)has(e,c)&&(r&&String(Number(c))===c&&c<e.length||_&&o["$"+c]instanceof Symbol||(/[^\w$]/.test(c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if("function"==typeof b)for(var l=0;l<a.length;l++)S.call(e,a[l])&&n.push("["+t(a[l])+"]: "+t(e[a[l]],e));return n}},5798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC1738",i="RFC3986";e.exports={default:i,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:n,RFC3986:i}},129:(e,t,r)=>{"use strict";var n=r(8261),i=r(5235),o=r(5798);e.exports={formats:o,parse:i,stringify:n}},5235:(e,t,r)=>{"use strict";var n=r(2769),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},parseArrayValue=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s=function parseQueryStringKeys(e,t,r,n){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=s?o.slice(0,s.index):o,l=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var u=0;r.depth>0&&null!==(s=a.exec(o))&&u<r.depth;){if(u+=1,!r.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(s[1])}return s&&l.push("["+o.slice(s.index)+"]"),function(e,t,r,n){for(var i=n?t:parseArrayValue(t,r),o=e.length-1;o>=0;--o){var a,s=e[o];if("[]"===s&&r.parseArrays)a=[].concat(i);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&s!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(a=[])[l]=i:"__proto__"!==c&&(a[c]=i):a={0:i}}i=a}return i}(l,t,r,n)}};e.exports=function(e,t){var r=function normalizeParseOptions(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var c="string"==typeof e?function parseQueryStringValues(e,t){var r,s={},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,l=t.parameterLimit===1/0?void 0:t.parameterLimit,u=c.split(t.delimiter,l),p=-1,d=t.charset;if(t.charsetSentinel)for(r=0;r<u.length;++r)0===u[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===u[r]?d="utf-8":"utf8=%26%2310003%3B"===u[r]&&(d="iso-8859-1"),p=r,r=u.length);for(r=0;r<u.length;++r)if(r!==p){var h,g,y=u[r],m=y.indexOf("]="),v=-1===m?y.indexOf("="):m+1;-1===v?(h=t.decoder(y,a.decoder,d,"key"),g=t.strictNullHandling?null:""):(h=t.decoder(y.slice(0,v),a.decoder,d,"key"),g=n.maybeMap(parseArrayValue(y.slice(v+1),t),(function(e){return t.decoder(e,a.decoder,d,"value")}))),g&&t.interpretNumericEntities&&"iso-8859-1"===d&&(g=interpretNumericEntities(g)),y.indexOf("[]=")>-1&&(g=o(g)?[g]:g),i.call(s,h)?s[h]=n.combine(s[h],g):s[h]=g}return s}(e,r):e,l=r.plainObjects?Object.create(null):{},u=Object.keys(c),p=0;p<u.length;++p){var d=u[p],h=s(d,c[d],r,"string"==typeof e);l=n.merge(l,h,r)}return!0===r.allowSparse?l:n.compact(l)}},8261:(e,t,r)=>{"use strict";var n=r(7478),i=r(2769),o=r(5798),a=Object.prototype.hasOwnProperty,s={brackets:function brackets(e){return e+"[]"},comma:"comma",indices:function indices(e,t){return e+"["+t+"]"},repeat:function repeat(e){return e}},c=Array.isArray,l=String.prototype.split,u=Array.prototype.push,pushToArray=function(e,t){u.apply(e,c(t)?t:[t])},p=Date.prototype.toISOString,d=o.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:d,formatter:o.formatters[d],indices:!1,serializeDate:function serializeDate(e){return p.call(e)},skipNulls:!1,strictNullHandling:!1},g={},y=function stringify(e,t,r,o,a,s,u,p,d,y,m,v,w,b,C){for(var _=e,S=C,T=0,O=!1;void 0!==(S=S.get(g))&&!O;){var R=S.get(e);if(T+=1,void 0!==R){if(R===T)throw new RangeError("Cyclic object value");O=!0}void 0===S.get(g)&&(T=0)}if("function"==typeof u?_=u(t,_):_ instanceof Date?_=y(_):"comma"===r&&c(_)&&(_=i.maybeMap(_,(function(e){return e instanceof Date?y(e):e}))),null===_){if(o)return s&&!w?s(t,h.encoder,b,"key",m):t;_=""}if(function isNonNullishPrimitive(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e}(_)||i.isBuffer(_)){if(s){var I=w?t:s(t,h.encoder,b,"key",m);if("comma"===r&&w){for(var E=l.call(String(_),","),L="",M=0;M<E.length;++M)L+=(0===M?"":",")+v(s(E[M],h.encoder,b,"value",m));return[v(I)+"="+L]}return[v(I)+"="+v(s(_,h.encoder,b,"value",m))]}return[v(t)+"="+v(String(_))]}var A,D=[];if(void 0===_)return D;if("comma"===r&&c(_))A=[{value:_.length>0?_.join(",")||null:void 0}];else if(c(u))A=u;else{var P=Object.keys(_);A=p?P.sort(p):P}for(var j=0;j<A.length;++j){var k=A[j],x="object"==typeof k&&void 0!==k.value?k.value:_[k];if(!a||null!==x){var F=c(_)?"function"==typeof r?r(t,k):t:t+(d?"."+k:"["+k+"]");C.set(e,T);var N=n();N.set(g,C),pushToArray(D,stringify(x,F,r,o,a,s,u,p,d,y,m,v,w,b,N))}}return D};e.exports=function(e,t){var r,i=e,l=function normalizeStringifyOptions(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o.default;if(void 0!==e.format){if(!a.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=o.formatters[r],i=h.filter;return("function"==typeof e.filter||c(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof l.filter?i=(0,l.filter)("",i):c(l.filter)&&(r=l.filter);var u,p=[];if("object"!=typeof i||null===i)return"";u=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var d=s[u];r||(r=Object.keys(i)),l.sort&&r.sort(l.sort);for(var g=n(),m=0;m<r.length;++m){var v=r[m];l.skipNulls&&null===i[v]||pushToArray(p,y(i[v],v,d,l.strictNullHandling,l.skipNulls,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,g))}var w=p.join(l.delimiter),b=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),w.length>0?b+w:""}},2769:(e,t,r)=>{"use strict";var n=r(5798),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function arrayToObject(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:s,assign:function assignSingleSource(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function combine(e,t){return[].concat(e,t)},compact:function compact(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],a=i.obj[i.prop],s=Object.keys(a),c=0;c<s.length;++c){var l=s[c],u=a[l];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:a,prop:l}),r.push(u))}return function compactQueue(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function encode(e,t,r,i,o){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===r)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",l=0;l<s.length;++l){var u=s.charCodeAt(l);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===n.RFC1738&&(40===u||41===u)?c+=s.charAt(l):u<128?c+=a[u]:u<2048?c+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?c+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(l)),c+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return c},isBuffer:function isBuffer(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function isRegExp(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function maybeMap(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function merge(e,t,r){if(!t)return e;if("object"!=typeof t){if(o(e))e.push(t);else{if(!e||"object"!=typeof e)return[e,t];(r&&(r.plainObjects||r.allowPrototypes)||!i.call(Object.prototype,t))&&(e[t]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(t);var n=e;return o(e)&&!o(t)&&(n=s(e,r)),o(e)&&o(t)?(t.forEach((function(t,n){if(i.call(e,n)){var o=e[n];o&&"object"==typeof o&&t&&"object"==typeof t?e[n]=merge(o,t,r):e.push(t)}else e[n]=t})),e):Object.keys(t).reduce((function(e,n){var o=t[n];return i.call(e,n)?e[n]=merge(e[n],o,r):e[n]=o,e}),n)}}},8660:(e,t,r)=>{var n;!function(e){!function(t){var n="object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=makeExporter(e);function makeExporter(e,t){return function(r,n){"function"!=typeof e[r]&&Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0===n.Reflect?n.Reflect=e:i=makeExporter(n.Reflect,i),function(e){var t=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,c={create:o?function(){return MakeDictionary(Object.create(null))}:a?function(){return MakeDictionary({__proto__:null})}:function(){return MakeDictionary({})},has:s?function(e,r){return t.call(e,r)}:function(e,t){return t in e},get:s?function(e,r){return t.call(e,r)?e[r]:void 0}:function(e,t){return e[t]}},l=Object.getPrototypeOf(Function),u="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,p=u||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?CreateMapPolyfill():Map,d=u||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?CreateSetPolyfill():Set,h=new(u||"function"!=typeof WeakMap?CreateWeakMapPolyfill():WeakMap);function decorate(e,t,r,n){if(IsUndefined(r)){if(!IsArray(e))throw new TypeError;if(!IsConstructor(t))throw new TypeError;return DecorateConstructor(e,t)}if(!IsArray(e))throw new TypeError;if(!IsObject(t))throw new TypeError;if(!IsObject(n)&&!IsUndefined(n)&&!IsNull(n))throw new TypeError;return IsNull(n)&&(n=void 0),DecorateProperty(e,t,r=ToPropertyKey(r),n)}function metadata(e,t){function decorator(r,n){if(!IsObject(r))throw new TypeError;if(!IsUndefined(n)&&!IsPropertyKey(n))throw new TypeError;OrdinaryDefineOwnMetadata(e,t,r,n)}return decorator}function defineMetadata(e,t,r,n){if(!IsObject(r))throw new TypeError;return IsUndefined(n)||(n=ToPropertyKey(n)),OrdinaryDefineOwnMetadata(e,t,r,n)}function hasMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryHasMetadata(e,t,r)}function hasOwnMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryHasOwnMetadata(e,t,r)}function getMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryGetMetadata(e,t,r)}function getOwnMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryGetOwnMetadata(e,t,r)}function getMetadataKeys(e,t){if(!IsObject(e))throw new TypeError;return IsUndefined(t)||(t=ToPropertyKey(t)),OrdinaryMetadataKeys(e,t)}function getOwnMetadataKeys(e,t){if(!IsObject(e))throw new TypeError;return IsUndefined(t)||(t=ToPropertyKey(t)),OrdinaryOwnMetadataKeys(e,t)}function deleteMetadata(e,t,r){if(!IsObject(t))throw new TypeError;IsUndefined(r)||(r=ToPropertyKey(r));var n=GetOrCreateMetadataMap(t,r,!1);if(IsUndefined(n))return!1;if(!n.delete(e))return!1;if(n.size>0)return!0;var i=h.get(t);return i.delete(r),i.size>0||h.delete(t),!0}function DecorateConstructor(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!IsUndefined(n)&&!IsNull(n)){if(!IsConstructor(n))throw new TypeError;t=n}}return t}function DecorateProperty(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,r,n);if(!IsUndefined(o)&&!IsNull(o)){if(!IsObject(o))throw new TypeError;n=o}}return n}function GetOrCreateMetadataMap(e,t,r){var n=h.get(e);if(IsUndefined(n)){if(!r)return;n=new p,h.set(e,n)}var i=n.get(t);if(IsUndefined(i)){if(!r)return;i=new p,n.set(t,i)}return i}function OrdinaryHasMetadata(e,t,r){if(OrdinaryHasOwnMetadata(e,t,r))return!0;var n=OrdinaryGetPrototypeOf(t);return!IsNull(n)&&OrdinaryHasMetadata(e,n,r)}function OrdinaryHasOwnMetadata(e,t,r){var n=GetOrCreateMetadataMap(t,r,!1);return!IsUndefined(n)&&ToBoolean(n.has(e))}function OrdinaryGetMetadata(e,t,r){if(OrdinaryHasOwnMetadata(e,t,r))return OrdinaryGetOwnMetadata(e,t,r);var n=OrdinaryGetPrototypeOf(t);return IsNull(n)?void 0:OrdinaryGetMetadata(e,n,r)}function OrdinaryGetOwnMetadata(e,t,r){var n=GetOrCreateMetadataMap(t,r,!1);if(!IsUndefined(n))return n.get(e)}function OrdinaryDefineOwnMetadata(e,t,r,n){GetOrCreateMetadataMap(r,n,!0).set(e,t)}function OrdinaryMetadataKeys(e,t){var r=OrdinaryOwnMetadataKeys(e,t),n=OrdinaryGetPrototypeOf(e);if(null===n)return r;var i=OrdinaryMetadataKeys(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var o=new d,a=[],s=0,c=r;s<c.length;s++){var l=c[s];o.has(l)||(o.add(l),a.push(l))}for(var u=0,p=i;u<p.length;u++){l=p[u];o.has(l)||(o.add(l),a.push(l))}return a}function OrdinaryOwnMetadataKeys(e,t){var r=[],n=GetOrCreateMetadataMap(e,t,!1);if(IsUndefined(n))return r;for(var i=GetIterator(n.keys()),o=0;;){var a=IteratorStep(i);if(!a)return r.length=o,r;var s=IteratorValue(a);try{r[o]=s}catch(e){try{IteratorClose(i)}finally{throw e}}o++}}function Type(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function IsUndefined(e){return void 0===e}function IsNull(e){return null===e}function IsSymbol(e){return"symbol"==typeof e}function IsObject(e){return"object"==typeof e?null!==e:"function"==typeof e}function ToPrimitive(e,t){switch(Type(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",i=GetMethod(e,n);if(void 0!==i){var o=i.call(e,r);if(IsObject(o))throw new TypeError;return o}return OrdinaryToPrimitive(e,"default"===r?"number":r)}function OrdinaryToPrimitive(e,t){if("string"===t){var r=e.toString;if(IsCallable(r))if(!IsObject(i=r.call(e)))return i;if(IsCallable(n=e.valueOf))if(!IsObject(i=n.call(e)))return i}else{var n;if(IsCallable(n=e.valueOf))if(!IsObject(i=n.call(e)))return i;var i,o=e.toString;if(IsCallable(o))if(!IsObject(i=o.call(e)))return i}throw new TypeError}function ToBoolean(e){return!!e}function ToString(e){return""+e}function ToPropertyKey(e){var t=ToPrimitive(e,3);return IsSymbol(t)?t:ToString(t)}function IsArray(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function IsCallable(e){return"function"==typeof e}function IsConstructor(e){return"function"==typeof e}function IsPropertyKey(e){switch(Type(e)){case 3:case 4:return!0;default:return!1}}function GetMethod(e,t){var r=e[t];if(null!=r){if(!IsCallable(r))throw new TypeError;return r}}function GetIterator(e){var t=GetMethod(e,i);if(!IsCallable(t))throw new TypeError;var r=t.call(e);if(!IsObject(r))throw new TypeError;return r}function IteratorValue(e){return e.value}function IteratorStep(e){var t=e.next();return!t.done&&t}function IteratorClose(e){var t=e.return;t&&t.call(e)}function OrdinaryGetPrototypeOf(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===l)return t;if(t!==l)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var i=n.constructor;return"function"!=typeof i||i===e?t:i}function CreateMapPolyfill(){var e={},t=[],r=function(){function MapIterator(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return MapIterator.prototype["@@iterator"]=function(){return this},MapIterator.prototype[i]=function(){return this},MapIterator.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},MapIterator.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},MapIterator.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},MapIterator}();return function(){function Map(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(Map.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Map.prototype.has=function(e){return this._find(e,!1)>=0},Map.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},Map.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},Map.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},Map.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},Map.prototype.keys=function(){return new r(this._keys,this._values,getKey)},Map.prototype.values=function(){return new r(this._keys,this._values,getValue)},Map.prototype.entries=function(){return new r(this._keys,this._values,getEntry)},Map.prototype["@@iterator"]=function(){return this.entries()},Map.prototype[i]=function(){return this.entries()},Map.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},Map}();function getKey(e,t){return e}function getValue(e,t){return t}function getEntry(e,t){return[e,t]}}function CreateSetPolyfill(){return function(){function Set(){this._map=new p}return Object.defineProperty(Set.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),Set.prototype.has=function(e){return this._map.has(e)},Set.prototype.add=function(e){return this._map.set(e,e),this},Set.prototype.delete=function(e){return this._map.delete(e)},Set.prototype.clear=function(){this._map.clear()},Set.prototype.keys=function(){return this._map.keys()},Set.prototype.values=function(){return this._map.values()},Set.prototype.entries=function(){return this._map.entries()},Set.prototype["@@iterator"]=function(){return this.keys()},Set.prototype[i]=function(){return this.keys()},Set}()}function CreateWeakMapPolyfill(){var e=16,r=c.create(),n=CreateUniqueKey();return function(){function WeakMap(){this._key=CreateUniqueKey()}return WeakMap.prototype.has=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t&&c.has(t,this._key)},WeakMap.prototype.get=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t?c.get(t,this._key):void 0},WeakMap.prototype.set=function(e,t){return GetOrCreateWeakMapTable(e,!0)[this._key]=t,this},WeakMap.prototype.delete=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t&&delete t[this._key]},WeakMap.prototype.clear=function(){this._key=CreateUniqueKey()},WeakMap}();function CreateUniqueKey(){var e;do{e="@@WeakMap@@"+CreateUUID()}while(c.has(r,e));return r[e]=!0,e}function GetOrCreateWeakMapTable(e,r){if(!t.call(e,n)){if(!r)return;Object.defineProperty(e,n,{value:c.create()})}return e[n]}function FillRandomBytes(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function GenRandomBytes(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):FillRandomBytes(new Uint8Array(e),e):FillRandomBytes(new Array(e),e)}function CreateUUID(){var t=GenRandomBytes(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var r="",n=0;n<e;++n){var i=t[n];4!==n&&6!==n&&8!==n||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}function MakeDictionary(e){return e.__=void 0,delete e.__,e}e("decorate",decorate),e("metadata",metadata),e("defineMetadata",defineMetadata),e("hasMetadata",hasMetadata),e("hasOwnMetadata",hasOwnMetadata),e("getMetadata",getMetadata),e("getOwnMetadata",getOwnMetadata),e("getMetadataKeys",getMetadataKeys),e("getOwnMetadataKeys",getOwnMetadataKeys),e("deleteMetadata",deleteMetadata)}(i)}()}(n||(n={}))},7478:(e,t,r)=>{"use strict";var n=r(210),i=r(1924),o=r(631),a=n("%TypeError%"),s=n("%WeakMap%",!0),c=n("%Map%",!0),l=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),p=i("WeakMap.prototype.has",!0),d=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),g=i("Map.prototype.has",!0),listGetNode=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function getSideChannel(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new a("Side channel does not contain "+o(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return l(e,n)}else if(c){if(t)return d(t,n)}else if(r)return function(e,t){var r=listGetNode(e,t);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(c){if(t)return g(t,n)}else if(r)return function(e,t){return!!listGetNode(e,t)}(r,n);return!1},set:function(n,i){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),u(e,n,i)):c?(t||(t=new c),h(t,n,i)):(r||(r={key:{},next:null}),function(e,t,r){var n=listGetNode(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,i))}};return n}},3120:function(e,t){var r,n,i;!function(o,a){"use strict";n=[],void 0===(i="function"==typeof(r=function(){function _isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}function _capitalize(e){return e.charAt(0).toUpperCase()+e.substring(1)}function _getter(e){return function(){return this[e]}}var e=["isConstructor","isEval","isNative","isToplevel"],t=["columnNumber","lineNumber"],r=["fileName","functionName","source"],n=["args"],i=["evalOrigin"],o=e.concat(t,r,n,i);function StackFrame(e){if(e)for(var t=0;t<o.length;t++)void 0!==e[o[t]]&&this["set"+_capitalize(o[t])](e[o[t]])}StackFrame.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof StackFrame)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new StackFrame(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},StackFrame.fromString=function StackFrame$$fromString(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),i=e.substring(t+1,r).split(","),o=e.substring(r+1);if(0===o.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(o,""),s=a[1],c=a[2],l=a[3];return new StackFrame({functionName:n,args:i||void 0,fileName:s,lineNumber:c||void 0,columnNumber:l||void 0})};for(var a=0;a<e.length;a++)StackFrame.prototype["get"+_capitalize(e[a])]=_getter(e[a]),StackFrame.prototype["set"+_capitalize(e[a])]=function(e){return function(t){this[e]=Boolean(t)}}(e[a]);for(var s=0;s<t.length;s++)StackFrame.prototype["get"+_capitalize(t[s])]=_getter(t[s]),StackFrame.prototype["set"+_capitalize(t[s])]=function(e){return function(t){if(!_isNumber(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(t[s]);for(var c=0;c<r.length;c++)StackFrame.prototype["get"+_capitalize(r[c])]=_getter(r[c]),StackFrame.prototype["set"+_capitalize(r[c])]=function(e){return function(t){this[e]=String(t)}}(r[c]);return StackFrame})?r.apply(t,n):r)||(e.exports=i)}()},4595:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(3120)],n=function(e){return{backtrace:function StackGenerator$$backtrace(t){var r=[],n=10;"object"==typeof t&&"number"==typeof t.maxStackSize&&(n=t.maxStackSize);for(var i=arguments.callee;i&&r.length<n;){for(var o=new Array(i.arguments.length),a=0;a<o.length;++a)o[a]=i.arguments[a];/function(?:\s+([\w$]+))+\s*\(/.test(i.toString())?r.push(new e({functionName:RegExp.$1||void 0,args:o})):r.push(new e({args:o}));try{i=i.caller}catch(e){break}}return r}}},void 0===(o="function"==typeof n?n.apply(t,i):n)||(e.exports=o)}()},9829:function(e,t){var r,n,i;!function(o,a){"use strict";n=[],void 0===(i="function"==typeof(r=function(){function _isNumber(e){return!isNaN(parseFloat(e))&&isFinite(e)}function StackFrame(e,t,r,n,i,o){void 0!==e&&this.setFunctionName(e),void 0!==t&&this.setArgs(t),void 0!==r&&this.setFileName(r),void 0!==n&&this.setLineNumber(n),void 0!==i&&this.setColumnNumber(i),void 0!==o&&this.setSource(o)}return StackFrame.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(e){this.functionName=String(e)},getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getFileName:function(){return this.fileName},setFileName:function(e){this.fileName=String(e)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(e){if(!_isNumber(e))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(e)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(e){if(!_isNumber(e))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(e)},getSource:function(){return this.source},setSource:function(e){this.source=String(e)},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(_isNumber(this.getLineNumber())?":"+this.getLineNumber():"")+(_isNumber(this.getColumnNumber())?":"+this.getColumnNumber():"")}},StackFrame})?r.apply(t,n):r)||(e.exports=i)}()},9817:(e,t,r)=>{var n=r(9479),i=Object.prototype.hasOwnProperty;function ArraySet(){this._array=[],this._set=Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,t){for(var r=new ArraySet,n=0,i=e.length;n<i;n++)r.add(e[n],t);return r},ArraySet.prototype.size=function ArraySet_size(){return Object.getOwnPropertyNames(this._set).length},ArraySet.prototype.add=function ArraySet_add(e,t){var r=n.toSetString(e),o=i.call(this._set,r),a=this._array.length;o&&!t||this._array.push(e),o||(this._set[r]=a)},ArraySet.prototype.has=function ArraySet_has(e){var t=n.toSetString(e);return i.call(this._set,t)},ArraySet.prototype.indexOf=function ArraySet_indexOf(e){var t=n.toSetString(e);if(i.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()},t.I=ArraySet},647:(e,t,r)=>{var n=r(8855);t.encode=function base64VLQ_encode(e){var t,r="",i=function toVLQSigned(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&i,(i>>>=5)>0&&(t|=32),r+=n.encode(t)}while(i>0);return r},t.decode=function base64VLQ_decode(e,t,r){var i,o,a=e.length,s=0,c=0;do{if(t>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=n.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));i=!!(32&o),s+=(o&=31)<<c,c+=5}while(i);r.value=function fromVLQSigned(e){var t=e>>1;return 1==(1&e)?-t:t}(s),r.rest=t}},8855:(e,t)=>{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<r.length)return r[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},4274:(e,t)=>{function recursiveSearch(e,r,n,i,o,a){var s=Math.floor((r-e)/2)+e,c=o(n,i[s],!0);return 0===c?s:c>0?r-s>1?recursiveSearch(s,r,n,i,o,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:s:s-e>1?recursiveSearch(e,s,n,i,o,a):a==t.LEAST_UPPER_BOUND?s:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function search(e,r,n,i){if(0===r.length)return-1;var o=recursiveSearch(-1,r.length,e,r,n,i||t.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===n(r[o],r[o-1],!0);)--o;return o}},1027:(e,t,r)=>{var n=r(9479);function MappingList(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,t){this._array.forEach(e,t)},MappingList.prototype.add=function MappingList_add(e){!function generatedPositionAfter(e,t){var r=e.generatedLine,i=t.generatedLine,o=e.generatedColumn,a=t.generatedColumn;return i>r||i==r&&a>=o||n.compareByGeneratedPositionsInflated(e,t)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))},MappingList.prototype.toArray=function MappingList_toArray(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=MappingList},1956:(e,t)=>{function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function doQuickSort(e,t,r,n){if(r<n){var i=r-1;swap(e,function randomIntInRange(e,t){return Math.round(e+Math.random()*(t-e))}(r,n),n);for(var o=e[n],a=r;a<n;a++)t(e[a],o)<=0&&swap(e,i+=1,a);swap(e,i+1,a);var s=i+1;doQuickSort(e,t,r,s-1),doQuickSort(e,t,s+1,n)}}t.U=function(e,t){doQuickSort(e,t,0,e.length-1)}},5667:(e,t,r)=>{var n=r(9479),i=r(4274),o=r(9817).I,a=r(647),s=r(1956).U;function SourceMapConsumer(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new IndexedSourceMapConsumer(t):new BasicSourceMapConsumer(t)}function BasicSourceMapConsumer(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),i=n.getArg(t,"sources"),a=n.getArg(t,"names",[]),s=n.getArg(t,"sourceRoot",null),c=n.getArg(t,"sourcesContent",null),l=n.getArg(t,"mappings"),u=n.getArg(t,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);i=i.map(String).map(n.normalize).map((function(e){return s&&n.isAbsolute(s)&&n.isAbsolute(e)?n.relative(s,e):e})),this._names=o.fromArray(a.map(String),!0),this._sources=o.fromArray(i,!0),this.sourceRoot=s,this.sourcesContent=c,this._mappings=l,this.file=u}function Mapping(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function IndexedSourceMapConsumer(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=n.getArg(t,"version"),i=n.getArg(t,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new o,this._names=new o;var a={line:-1,column:0};this._sections=i.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=n.getArg(e,"offset"),r=n.getArg(t,"line"),i=n.getArg(t,"column");if(r<a.line||r===a.line&&i<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=t,{generatedOffset:{generatedLine:r+1,generatedColumn:i+1},consumer:new SourceMapConsumer(n.getArg(e,"map"))}}))}SourceMapConsumer.fromSourceMap=function(e){return BasicSourceMapConsumer.fromSourceMap(e)},SourceMapConsumer.prototype._version=3,SourceMapConsumer.prototype.__generatedMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),SourceMapConsumer.prototype.__originalMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,t){var r=e.charAt(t);return";"===r||","===r},SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,t){throw new Error("Subclasses must implement _parseMappings")},SourceMapConsumer.GENERATED_ORDER=1,SourceMapConsumer.ORIGINAL_ORDER=2,SourceMapConsumer.GREATEST_LOWER_BOUND=1,SourceMapConsumer.LEAST_UPPER_BOUND=2,SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,t,r){var i,o=t||null;switch(r||SourceMapConsumer.GENERATED_ORDER){case SourceMapConsumer.GENERATED_ORDER:i=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var a=this.sourceRoot;i.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=a&&(t=n.join(a,t)),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,o)},SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var t=n.getArg(e,"line"),r={source:n.getArg(e,"source"),originalLine:t,originalColumn:n.getArg(e,"column",0)};if(null!=this.sourceRoot&&(r.source=n.relative(this.sourceRoot,r.source)),!this._sources.has(r.source))return[];r.source=this._sources.indexOf(r.source);var o=[],a=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var s=this._originalMappings[a];if(void 0===e.column)for(var c=s.originalLine;s&&s.originalLine===c;)o.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)o.push({line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return o},t.SourceMapConsumer=SourceMapConsumer,BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer,BasicSourceMapConsumer.fromSourceMap=function SourceMapConsumer_fromSourceMap(e){var t=Object.create(BasicSourceMapConsumer.prototype),r=t._names=o.fromArray(e._names.toArray(),!0),i=t._sources=o.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),c=t.__generatedMappings=[],l=t.__originalMappings=[],u=0,p=a.length;u<p;u++){var d=a[u],h=new Mapping;h.generatedLine=d.generatedLine,h.generatedColumn=d.generatedColumn,d.source&&(h.source=i.indexOf(d.source),h.originalLine=d.originalLine,h.originalColumn=d.originalColumn,d.name&&(h.name=r.indexOf(d.name)),l.push(h)),c.push(h)}return s(t.__originalMappings,n.compareByOriginalPositions),t},BasicSourceMapConsumer.prototype._version=3,Object.defineProperty(BasicSourceMapConsumer.prototype,"sources",{get:function(){return this._sources.toArray().map((function(e){return null!=this.sourceRoot?n.join(this.sourceRoot,e):e}),this)}}),BasicSourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,t){for(var r,i,o,c,l,u=1,p=0,d=0,h=0,g=0,y=0,m=e.length,v=0,w={},b={},C=[],_=[];v<m;)if(";"===e.charAt(v))u++,v++,p=0;else if(","===e.charAt(v))v++;else{for((r=new Mapping).generatedLine=u,c=v;c<m&&!this._charIsMappingSeparator(e,c);c++);if(o=w[i=e.slice(v,c)])v+=i.length;else{for(o=[];v<c;)a.decode(e,v,b),l=b.value,v=b.rest,o.push(l);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");w[i]=o}r.generatedColumn=p+o[0],p=r.generatedColumn,o.length>1&&(r.source=g+o[1],g+=o[1],r.originalLine=d+o[2],d=r.originalLine,r.originalLine+=1,r.originalColumn=h+o[3],h=r.originalColumn,o.length>4&&(r.name=y+o[4],y+=o[4])),_.push(r),"number"==typeof r.originalLine&&C.push(r)}s(_,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=_,s(C,n.compareByOriginalPositions),this.__originalMappings=C},BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,t,r,n,o,a){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return i.search(e,t,o,a)},BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},BasicSourceMapConsumer.prototype.originalPositionFor=function SourceMapConsumer_originalPositionFor(e){var t={generatedLine:n.getArg(e,"line"),generatedColumn:n.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",n.compareByGeneratedPositionsDeflated,n.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(r>=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var o=n.getArg(i,"source",null);null!==o&&(o=this._sources.at(o),null!=this.sourceRoot&&(o=n.join(this.sourceRoot,o)));var a=n.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:o,line:n.getArg(i,"originalLine",null),column:n.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=n.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=n.urlParse(this.sourceRoot))){var i=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var t=n.getArg(e,"source");if(null!=this.sourceRoot&&(t=n.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var r={source:t=this._sources.indexOf(t),originalLine:n.getArg(e,"line"),originalColumn:n.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===r.source)return{line:n.getArg(o,"generatedLine",null),column:n.getArg(o,"generatedColumn",null),lastColumn:n.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},IndexedSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),IndexedSourceMapConsumer.prototype.constructor=SourceMapConsumer,IndexedSourceMapConsumer.prototype._version=3,Object.defineProperty(IndexedSourceMapConsumer.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),IndexedSourceMapConsumer.prototype.originalPositionFor=function IndexedSourceMapConsumer_originalPositionFor(e){var t={generatedLine:n.getArg(e,"line"),generatedColumn:n.getArg(e,"column")},r=i.search(t,this._sections,(function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn})),o=this._sections[r];return o?o.consumer.originalPositionFor({line:t.generatedLine-(o.generatedOffset.generatedLine-1),column:t.generatedColumn-(o.generatedOffset.generatedLine===t.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},IndexedSourceMapConsumer.prototype.hasContentsOfAllSources=function IndexedSourceMapConsumer_hasContentsOfAllSources(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},IndexedSourceMapConsumer.prototype.sourceContentFor=function IndexedSourceMapConsumer_sourceContentFor(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r].consumer.sourceContentFor(e,!0);if(n)return n}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},IndexedSourceMapConsumer.prototype.generatedPositionFor=function IndexedSourceMapConsumer_generatedPositionFor(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer.sources.indexOf(n.getArg(e,"source"))){var i=r.consumer.generatedPositionFor(e);if(i)return{line:i.line+(r.generatedOffset.generatedLine-1),column:i.column+(r.generatedOffset.generatedLine===i.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},IndexedSourceMapConsumer.prototype._parseMappings=function IndexedSourceMapConsumer_parseMappings(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var i=this._sections[r],o=i.consumer._generatedMappings,a=0;a<o.length;a++){var c=o[a],l=i.consumer._sources.at(c.source);null!==i.consumer.sourceRoot&&(l=n.join(i.consumer.sourceRoot,l)),this._sources.add(l),l=this._sources.indexOf(l);var u=i.consumer._names.at(c.name);this._names.add(u),u=this._names.indexOf(u);var p={source:l,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:u};this.__generatedMappings.push(p),"number"==typeof p.originalLine&&this.__originalMappings.push(p)}s(this.__generatedMappings,n.compareByGeneratedPositionsDeflated),s(this.__originalMappings,n.compareByOriginalPositions)}},8902:(e,t,r)=>{var n=r(647),i=r(9479),o=r(9817).I,a=r(1027).H;function SourceMapGenerator(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new o,this._names=new o,this._mappings=new a,this._sourcesContents=null}SourceMapGenerator.prototype._version=3,SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var t=e.sourceRoot,r=new SourceMapGenerator({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=i.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&r.setSourceContent(t,n)})),r},SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var t=i.getArg(e,"generated"),r=i.getArg(e,"original",null),n=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:o})},SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,t){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var a=this._sourceRoot;null!=a&&(n=i.relative(a,n));var s=new o,c=new o;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var o=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=o.source&&(t.source=o.source,null!=r&&(t.source=i.join(r,t.source)),null!=a&&(t.source=i.relative(a,t.source)),t.originalLine=o.line,t.originalColumn=o.column,null!=o.name&&(t.name=o.name))}var l=t.source;null==l||s.has(l)||s.add(l);var u=t.name;null==u||c.has(u)||c.add(u)}),this),this._sources=s,this._names=c,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=i.join(r,t)),null!=a&&(t=i.relative(a,t)),this.setSourceContent(t,n))}),this)},SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,t,r,n){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){for(var e,t,r,o,a=0,s=1,c=0,l=0,u=0,p=0,d="",h=this._mappings.toArray(),g=0,y=h.length;g<y;g++){if(e="",(t=h[g]).generatedLine!==s)for(a=0;t.generatedLine!==s;)e+=";",s++;else if(g>0){if(!i.compareByGeneratedPositionsInflated(t,h[g-1]))continue;e+=","}e+=n.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(o=this._sources.indexOf(t.source),e+=n.encode(o-p),p=o,e+=n.encode(t.originalLine-1-l),l=t.originalLine-1,e+=n.encode(t.originalColumn-c),c=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=n.encode(r-u),u=r)),d+=e}return d},SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=i.relative(t,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=SourceMapGenerator},5786:(e,t,r)=>{var n=r(8902).SourceMapGenerator,i=r(9479),o=/(\r?\n)/,a="$$$isSourceNode$$$";function SourceNode(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[a]=!0,null!=n&&this.add(n)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,t,r){var n=new SourceNode,a=e.split(o),shiftNextLine=function(){return a.shift()+(a.shift()||"")},s=1,c=0,l=null;return t.eachMapping((function(e){if(null!==l){if(!(s<e.generatedLine)){var t=(r=a[0]).substr(0,e.generatedColumn-c);return a[0]=r.substr(e.generatedColumn-c),c=e.generatedColumn,addMappingWithCode(l,t),void(l=e)}addMappingWithCode(l,shiftNextLine()),s++,c=0}for(;s<e.generatedLine;)n.add(shiftNextLine()),s++;if(c<e.generatedColumn){var r=a[0];n.add(r.substr(0,e.generatedColumn)),a[0]=r.substr(e.generatedColumn),c=e.generatedColumn}l=e}),this),a.length>0&&(l&&addMappingWithCode(l,shiftNextLine()),n.add(a.join(""))),t.sources.forEach((function(e){var o=t.sourceContentFor(e);null!=o&&(null!=r&&(e=i.join(r,e)),n.setSourceContent(e,o))})),n;function addMappingWithCode(e,t){if(null===e||void 0===e.source)n.add(t);else{var o=r?i.join(r,e.source):e.source;n.add(new SourceNode(e.originalLine,e.originalColumn,o,t,e.name))}}},SourceNode.prototype.add=function SourceNode_add(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},SourceNode.prototype.prepend=function SourceNode_prepend(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},SourceNode.prototype.walk=function SourceNode_walk(e){for(var t,r=0,n=this.children.length;r<n;r++)(t=this.children[r])[a]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},SourceNode.prototype.join=function SourceNode_join(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},SourceNode.prototype.replaceRight=function SourceNode_replaceRight(e,t){var r=this.children[this.children.length-1];return r[a]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},SourceNode.prototype.setSourceContent=function SourceNode_setSourceContent(e,t){this.sourceContents[i.toSetString(e)]=t},SourceNode.prototype.walkSourceContents=function SourceNode_walkSourceContents(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][a]&&this.children[t].walkSourceContents(e);var n=Object.keys(this.sourceContents);for(t=0,r=n.length;t<r;t++)e(i.fromSetString(n[t]),this.sourceContents[n[t]])},SourceNode.prototype.toString=function SourceNode_toString(){var e="";return this.walk((function(t){e+=t})),e},SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(e){var t={code:"",line:1,column:0},r=new n(e),i=!1,o=null,a=null,s=null,c=null;return this.walk((function(e,n){t.code+=e,null!==n.source&&null!==n.line&&null!==n.column?(o===n.source&&a===n.line&&s===n.column&&c===n.name||r.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:t.line,column:t.column},name:n.name}),o=n.source,a=n.line,s=n.column,c=n.name,i=!0):i&&(r.addMapping({generated:{line:t.line,column:t.column}}),o=null,i=!1);for(var l=0,u=e.length;l<u;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===u?(o=null,i=!1):i&&r.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:t.line,column:t.column},name:n.name})):t.column++})),this.walkSourceContents((function(e,t){r.setSourceContent(e,t)})),{code:t.code,map:r}},t.SourceNode=SourceNode},9479:(e,t)=>{t.getArg=function getArg(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,n=/^data:.+\,.+$/;function urlParse(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function urlGenerate(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function normalize(e){var r=e,n=urlParse(e);if(n){if(!n.path)return e;r=n.path}for(var i,o=t.isAbsolute(r),a=r.split(/\/+/),s=0,c=a.length-1;c>=0;c--)"."===(i=a[c])?a.splice(c,1):".."===i?s++:s>0&&(""===i?(a.splice(c+1,s),s=0):(a.splice(c,2),s--));return""===(r=a.join("/"))&&(r=o?"/":"."),n?(n.path=r,urlGenerate(n)):r}t.urlParse=urlParse,t.urlGenerate=urlGenerate,t.normalize=normalize,t.join=function join(e,t){""===e&&(e="."),""===t&&(t=".");var r=urlParse(t),i=urlParse(e);if(i&&(e=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),urlGenerate(r);if(r||t.match(n))return t;if(i&&!i.host&&!i.path)return i.host=t,urlGenerate(i);var o="/"===t.charAt(0)?t:normalize(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=o,urlGenerate(i)):o},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(r)},t.relative=function relative(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var i=!("__proto__"in Object.create(null));function identity(e){return e}function isProtoString(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function strcmp(e,t){return e===t?0:e>t?1:-1}t.toSetString=i?identity:function toSetString(e){return isProtoString(e)?"$"+e:e},t.fromSetString=i?identity:function fromSetString(e){return isProtoString(e)?e.slice(1):e},t.compareByOriginalPositions=function compareByOriginalPositions(e,t,r){var n=e.source-t.source;return 0!==n||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)||r||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=e.generatedLine-t.generatedLine)?n:e.name-t.name},t.compareByGeneratedPositionsDeflated=function compareByGeneratedPositionsDeflated(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||r||0!==(n=e.source-t.source)||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:e.name-t.name},t.compareByGeneratedPositionsInflated=function compareByGeneratedPositionsInflated(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=strcmp(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:strcmp(e.name,t.name)}},7252:(e,t,r)=>{t.SourceMapGenerator=r(8902).SourceMapGenerator,t.SourceMapConsumer=r(5667).SourceMapConsumer,t.SourceNode=r(5786).SourceNode},4358:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(7252),r(9829)],void 0===(o="function"==typeof(n=function(e,t){function _xdr(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.open("get",e),n.onerror=r,n.onreadystatechange=function onreadystatechange(){4===n.readyState&&(n.status>=200&&n.status<300?t(n.responseText):r(new Error("HTTP status: "+n.status+" retrieving "+e)))},n.send()}))}function _atob(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function _parseJson(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}function _findFunctionName(e,t){for(var r,n=/function\s+([^(]*?)\s*\(([^)]*)\)/,i=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,o=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,a=e.split("\n"),s="",c=Math.min(t,20),l=0;l<c;++l){var u=a[t-l-1],p=u.indexOf("//");if(p>=0&&(u=u.substr(0,p)),u){if(s=u+s,(r=i.exec(s))&&r[1])return r[1];if((r=n.exec(s))&&r[1])return r[1];if((r=o.exec(s))&&r[1])return r[1]}}}function _ensureSupportedEnvironment(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function _ensureStackFrameIsLegit(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function _findSourceMappingURL(e){var t=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/.exec(e);if(t&&t[1])return t[1];throw new Error("sourceMappingURL not found")}function _extractLocationInfoFromSourceMap(r,n,i){return new Promise((function(o,a){var s=new e.SourceMapConsumer(n),c=s.originalPositionFor({line:r.lineNumber,column:r.columnNumber});if(c.source){var l=s.sourceContentFor(c.source);l&&(i[c.source]=l),o(new t(c.name||r.functionName,r.args,c.source,c.line,c.column))}else a(new Error("Could not get original source for given stackframe and source map"))}))}return function StackTraceGPS(e){if(!(this instanceof StackTraceGPS))return new StackTraceGPS(e);e=e||{},this.sourceCache=e.sourceCache||{},this.ajax=e.ajax||_xdr,this._atob=e.atob||_atob,this._get=function _get(t){return new Promise(function(r,n){var i="data:"===t.substr(0,5);if(this.sourceCache[t])r(this.sourceCache[t]);else if(e.offline&&!i)n(new Error("Cannot make network requests in offline mode"));else if(i){var o=/^data:application\/json;([\w=:"-]+;)*base64,/,a=t.match(o);if(a){var s=a[0].length,c=t.substr(s),l=this._atob(c);this.sourceCache[t]=l,r(l)}else n(new Error("The encoding of the inline sourcemap is not supported"))}else{var u=this.ajax(t,{method:"get"});this.sourceCache[t]=u,u.then(r,n)}}.bind(this))},this.pinpoint=function StackTraceGPS$$pinpoint(e){return new Promise(function(t,r){this.getMappedLocation(e).then(function(e){function resolveMappedStackFrame(){t(e)}this.findFunctionName(e).then(t,resolveMappedStackFrame).catch(resolveMappedStackFrame)}.bind(this),r)}.bind(this))},this.findFunctionName=function StackTraceGPS$$findFunctionName(e){return new Promise(function(r,n){_ensureStackFrameIsLegit(e),this._get(e.fileName).then((function getSourceCallback(n){var i=e.lineNumber,o=e.columnNumber,a=_findFunctionName(n,i,o);r(a?new t(a,e.args,e.fileName,i,o):e)}),n).catch(n)}.bind(this))},this.getMappedLocation=function StackTraceGPS$$getMappedLocation(e){return new Promise(function(t,r){_ensureSupportedEnvironment(),_ensureStackFrameIsLegit(e);var n=this.sourceCache,i=e.fileName;this._get(i).then(function(o){var a=_findSourceMappingURL(o),s="data:"===a.substr(0,5),c=i.substring(0,i.lastIndexOf("/")+1);"/"===a[0]||s||/^https?:\/\/|^\/\//i.test(a)||(a=c+a),this._get(a).then((function(r){"string"==typeof r&&(r=_parseJson(r.replace(/^\)\]\}'/,""))),void 0===r.sourceRoot&&(r.sourceRoot=c),_extractLocationInfoFromSourceMap(e,r,n).then(t).catch((function(){t(e)}))}),r).catch(r)}.bind(this),r).catch(r)}.bind(this))}}})?n.apply(t,i):n)||(e.exports=o)}()},401:function(e,t,r){var n,i,o;!function(a,s){"use strict";i=[r(9180),r(4595),r(4358)],n=function StackTrace(e,t,r){var n={filter:function(e){return-1===(e.functionName||"").indexOf("StackTrace$$")&&-1===(e.functionName||"").indexOf("ErrorStackParser$$")&&-1===(e.functionName||"").indexOf("StackTraceGPS$$")&&-1===(e.functionName||"").indexOf("StackGenerator$$")},sourceCache:{}},i=function StackTrace$$GenerateError(){try{throw new Error}catch(e){return e}};function _merge(e,t){var r={};return[e,t].forEach((function(e){for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r})),r}function _isShapedLikeParsableError(e){return e.stack||e["opera#sourceloc"]}function _filtered(e,t){return"function"==typeof t?e.filter(t):e}return{get:function StackTrace$$get(e){var t=i();return _isShapedLikeParsableError(t)?this.fromError(t,e):this.generateArtificially(e)},getSync:function StackTrace$$getSync(r){r=_merge(n,r);var o=i();return _filtered(_isShapedLikeParsableError(o)?e.parse(o):t.backtrace(r),r.filter)},fromError:function StackTrace$$fromError(t,i){i=_merge(n,i);var o=new r(i);return new Promise(function(r){var n=_filtered(e.parse(t),i.filter);r(Promise.all(n.map((function(e){return new Promise((function(t){function resolveOriginal(){t(e)}o.pinpoint(e).then(t,resolveOriginal).catch(resolveOriginal)}))}))))}.bind(this))},generateArtificially:function StackTrace$$generateArtificially(e){e=_merge(n,e);var r=t.backtrace(e);return"function"==typeof e.filter&&(r=r.filter(e.filter)),Promise.resolve(r)},instrument:function StackTrace$$instrument(e,t,r,n){if("function"!=typeof e)throw new Error("Cannot instrument non-function object");if("function"==typeof e.__stacktraceOriginalFn)return e;var i=function StackTrace$$instrumented(){try{return this.get().then(t,r).catch(r),e.apply(n||this,arguments)}catch(e){throw _isShapedLikeParsableError(e)&&this.fromError(e).then(t,r).catch(r),e}}.bind(this);return i.__stacktraceOriginalFn=e,i},deinstrument:function StackTrace$$deinstrument(e){if("function"!=typeof e)throw new Error("Cannot de-instrument non-function object");return"function"==typeof e.__stacktraceOriginalFn?e.__stacktraceOriginalFn:e},report:function StackTrace$$report(e,t,r){return new Promise((function(n,i){var o=new XMLHttpRequest;o.onerror=i,o.onreadystatechange=function onreadystatechange(){4===o.readyState&&(o.status>=200&&o.status<400?n(o.responseText):i(new Error("POST to "+t+" failed with status: "+o.status)))},o.open("post",t),o.setRequestHeader("Content-Type","application/json");var a={stack:e};void 0!==r&&(a.message=r),o.send(JSON.stringify(a))}))}}},void 0===(o="function"==typeof n?n.apply(t,i):n)||(e.exports=o)}()},4714:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nameof=void 0;var n=r(6898);Object.defineProperty(t,"nameof",{enumerable:!0,get:function(){return n.nameof}})},6898:(e,t)=>{"use strict";function cleanseAssertionOperators(e){return e.replace(/[?!]/g,"")}Object.defineProperty(t,"__esModule",{value:!0}),t.nameof=void 0,t.nameof=function nameof(e,t){var r=e.toString();if(r.startsWith("class ")&&!r.startsWith("class =>"))return cleanseAssertionOperators(r.substring("class ".length,r.indexOf(" {")));if(r.includes("=>"))return cleanseAssertionOperators(r.substring(r.indexOf(".")+1));var n=r.match(/function\s*\(\w+\)\s*\{[\r\n\s]*return\s+\w+\.((\w+\.)*(\w+))/i);if(n)return t&&t.lastProp?n[3]:n[1];if(r.startsWith("function "))return cleanseAssertionOperators(r.substring("function ".length,r.indexOf("(")));throw new Error("ts-simple-nameof: Invalid function.")}},3315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2837),i=r(3533),o=r(1674),a=function(){function CategoryServiceControlImpl(){}return CategoryServiceControlImpl.prototype.help=function(){console.log(CategoryServiceControlImpl._help)},CategoryServiceControlImpl.prototype.example=function(){console.log(CategoryServiceControlImpl._example)},CategoryServiceControlImpl.prototype.showSettings=function(e){void 0===e&&(e="all");var t=new o.StringBuilder,r=CategoryServiceControlImpl._getCategoryService();CategoryServiceControlImpl._getCategories(e).forEach((function(e){CategoryServiceControlImpl._processCategory(r,e,t,0)})),console.log(t.toString())},CategoryServiceControlImpl.prototype.change=function(e){var t=CategoryServiceControlImpl._getCategoryService(),r=CategoryServiceControlImpl._getCategories(e.category),n=null,o=null,a=null,s=null,c=null,addResult=function(e){null!==c&&(c+=", "),null===c?c=e:c+=e};addResult("recursive="+e.recursive),"string"==typeof e.logLevel&&(n=i.LogLevel.fromString(e.logLevel),addResult("logLevel="+e.logLevel)),"string"==typeof e.logFormat&&(o=i.DateFormatEnum.fromString(e.logFormat),addResult("logFormat="+e.logFormat)),"boolean"==typeof e.showCategoryName&&(a=e.showCategoryName,addResult("showCategoryName="+e.showCategoryName)),"boolean"==typeof e.showTimestamp&&(s=e.showTimestamp,addResult("showTimestamp="+e.showTimestamp));var applyChanges=function(e){var r=t.getCategorySettings(e);null!==r&&(null!==n&&(r.logLevel=n),null!==o&&(r.logFormat.dateFormat.formatEnum=o),null!==s&&(r.logFormat.showTimeStamp=s),null!==a&&(r.logFormat.showCategoryName=a))};r.forEach((function(t){return CategoryServiceControlImpl._applyToCategory(t,e.recursive,applyChanges)})),console.log("Applied changes: "+c+" to categories '"+e.category+"'.")},CategoryServiceControlImpl.prototype.reset=function(e){void 0===e&&(e="all");var t=CategoryServiceControlImpl._getCategoryService(),r=CategoryServiceControlImpl._getCategories(e),applyChanges=function(e){var r=t.getCategorySettings(e),n=t.getOriginalCategorySettings(e);null!==r&&null!==n&&(r.logLevel=n.logLevel,r.logFormat.dateFormat.formatEnum=n.logFormat.dateFormat.formatEnum,r.logFormat.showTimeStamp=n.logFormat.showTimeStamp,r.logFormat.showCategoryName=n.logFormat.showCategoryName)};r.forEach((function(e){return CategoryServiceControlImpl._applyToCategory(e,!0,applyChanges)})),console.log("Applied reset to category: "+e+".")},CategoryServiceControlImpl._processCategory=function(e,t,r,n){var o=e.getCategorySettings(t);if(null!==o){if(r.append(" "+t.id+": "),n>0)for(var a=0;a<n;a++)r.append(" ");r.append(t.name+" ("+i.LogLevel[o.logLevel].toString()+"@"+i.LoggerType[o.loggerType].toString()+")\n"),t.children.length>0&&t.children.forEach((function(t){CategoryServiceControlImpl._processCategory(e,t,r,n+1)}))}},CategoryServiceControlImpl._applyToCategory=function(e,t,r){r(e),t&&e.children.forEach((function(e){CategoryServiceControlImpl._applyToCategory(e,t,r)}))},CategoryServiceControlImpl._getCategoryService=function(){return n.CategoryServiceImpl.getInstance()},CategoryServiceControlImpl._getCategories=function(e){var t=CategoryServiceControlImpl._getCategoryService(),r=[];if("all"===e)r=t.getRootCategories();else{var n=t.getCategoryById(e);if(null===n)throw new Error("Failed to find category with id "+e);r.push(n)}return r},CategoryServiceControlImpl._help='\n help(): void\n ** Shows this help.\n\n example(): void\n ** Shows an example on how to use this.\n\n showSettings(id: number | "all" = "all"): void\n ** Shows settings for a specific category, or for all. The id of categories can be found by calling this method without parameter.\n\n change(settings: CategoryServiceControlSettings): void\n ** Changes the current settings for one or all categories.\n **\n CategoryServiceControlSettings, properties of object:\n category: number | "all"\n ** Apply to specific category, or "all".\n ** Required\n\n recursive: boolean\n ** Apply to child categories (true) or not.\n ** Required\n\n logLevel: "Fatal" | "Error" | "Warn" | "Info" | "Debug" | "Trace" | undefined\n ** Set log level, undefined will not change the setting.\n ** Optional\n\n logFormat: "Default" | "YearMonthDayTime" | "YearDayMonthWithFullTime" | "YearDayMonthTime" | undefined\n ** Set the log format, undefined will not change the setting.\n ** Optional\n\n showTimestamp: boolean | undefined\n ** Whether to show timestamp, undefined will not change the setting.\n ** Optional\n\n showCategoryName: boolean | undefined\n ** Whether to show the category name, undefined will not change the setting.\n ** Optional\n\n reset(id: number | "all"): void\n ** Resets everything to original values, for one specific or for all categories.\n',CategoryServiceControlImpl._example='\n Examples:\n change({category: "all", recursive:true, logLevel: "Info"})\n ** Change loglevel to Info for all categories, apply to child categories as well.\n\n change({category: 1, recursive:false, logLevel: "Warn"})\n ** Change logLevel for category 1, do not recurse.\n\n change({category: "all", recursive:true, logLevel: "Debug", logFormat: "YearDayMonthTime", showTimestamp:false, showCategoryName:false})\n ** Change loglevel to Debug for all categories, apply format, do not show timestamp and category names - recursively to child categories.\n\n',CategoryServiceControlImpl}();t.CategoryServiceControlImpl=a},9791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=r(8225),o=r(1674),a=function(){function LoggerControlImpl(){}return LoggerControlImpl.prototype.help=function(){console.log(LoggerControlImpl._help)},LoggerControlImpl.prototype.listFactories=function(){var e=LoggerControlImpl._getRuntimeSettingsLoggerFactories(),t=new o.StringBuilder;t.appendLine("Registered LoggerFactories (index / name)");for(var r=0;r<e.length;r++){var n=e[r];t.append(" "+r).append(": "+n.getName()+"\n")}console.log(t.toString())},LoggerControlImpl.prototype.showSettings=function(e){void 0===e&&(e="all");var t=[];if("all"===e){var r=0;LoggerControlImpl._getRuntimeSettingsLoggerFactories().forEach((function(e){t.push(new o.TuplePair(r++,e))}))}else{var i=LoggerControlImpl._getRuntimeSettingsLoggerFactories();if(!(e>=0&&e<i.length))throw new Error("Requested number: "+e+" was not found.");t.push(new o.TuplePair(e,i[e]))}for(var a=0,s=t;a<s.length;a++){var c=s[a];console.log(" LoggerFactory: "+c.y.getName()+" (id="+c.x+")");for(var l=c.y.getLogGroupRuntimeSettings(),u=0;u<l.length;u++){var p=l[u];console.log(" LogGroup: (id="+u+")"),console.log(" RegExp: "+p.logGroupRule.regExp.source),console.log(" Level: "+n.LogLevel[p.level].toString()),console.log(" LoggerType: "+n.LoggerType[p.loggerType].toString())}}},LoggerControlImpl.prototype.reset=function(e){void 0===e&&(e="all");var t=LoggerControlImpl._getRuntimeSettingsLoggerFactories(),r=[];"all"===e?r=t:e>=0&&e<t.length&&r.push(t[e]),r.forEach((function(t){console.log("Reset all settings for factory "+e),new s(t).reset()}))},LoggerControlImpl.prototype.getLoggerFactoryControl=function(e){var t=LoggerControlImpl._getRuntimeSettingsLoggerFactories();if(e>=0&&e<t.length)return new s(t[e]);throw new Error("idFactory is invalid (less than 0) or non existing id.")},LoggerControlImpl._getRuntimeSettingsLoggerFactories=function(){return LoggerControlImpl._getSettings().getRuntimeSettingsForLoggerFactories()},LoggerControlImpl._getSettings=function(){return i.LFService.getRuntimeSettings()},LoggerControlImpl._help='\n help(): void\n ** Shows this help.\n\n listFactories(): void\n ** List all registered LoggerFactories with associated log groups with respective ids (ids can be used to target a factory and/or group).\n\n showSettings(idFactory: number | "all"): void\n ** Show log group settings for idFactory (use listFactories to find id for a LoggerFactory). If idFactory is "all" shows all factories.\n\n getLoggerFactoryControl(idFactory: number): LoggerFactoryControl\n ** Return LoggerFactoryControl when found for given idFactory or throws Error if invalid or null, get the id by using listFactories()\n\n reset(idFactory: number | "all"): void\n ** Resets given factory or all factories back to original values.\n',LoggerControlImpl}();t.LoggerControlImpl=a;var s=function(){function LoggerFactoryControlImpl(e){this._settings=e}return LoggerFactoryControlImpl.prototype.help=function(){console.log(LoggerFactoryControlImpl._help)},LoggerFactoryControlImpl.prototype.example=function(){console.log(LoggerFactoryControlImpl._example)},LoggerFactoryControlImpl.prototype.showSettings=function(e){void 0===e&&(e="all");var t=new o.StringBuilder,r=this._settings.getLogGroupRuntimeSettings();t.appendLine("Registered LogGroups (index / expression)");for(var i=0;i<r.length;i++){var a=r[i];t.appendLine(" "+i+": "+a.logGroupRule.regExp.source+", logLevel="+n.LogLevel[a.level].toString()+", showTimestamp="+a.logFormat.showTimeStamp+", showLoggerName="+a.logFormat.showLoggerName+", format="+n.DateFormatEnum[a.logFormat.dateFormat.formatEnum].toString())}console.log(t.toString())},LoggerFactoryControlImpl.prototype.change=function(e){var t=this._getLogGroupRunTimeSettingsFor(e.group),r=null,i=null,o=null,a=null,s=null,addResult=function(e){null!==s&&(s+=", "),null===s?s=e:s+=e};"string"==typeof e.logLevel&&(r=n.LogLevel.fromString(e.logLevel),addResult("logLevel="+e.logLevel)),"string"==typeof e.logFormat&&(i=n.DateFormatEnum.fromString(e.logFormat),addResult("logFormat="+e.logFormat)),"boolean"==typeof e.showLoggerName&&(o=e.showLoggerName,addResult("showLoggerName="+e.showLoggerName)),"boolean"==typeof e.showTimestamp&&(a=e.showTimestamp,addResult("showTimestamp="+e.showTimestamp)),t.forEach((function(e){null!==r&&(e.level=r),null!==i&&(e.logFormat.dateFormat.formatEnum=i),null!==a&&(e.logFormat.showTimeStamp=a),null!==o&&(e.logFormat.showLoggerName=o)})),console.log("Applied changes: "+s+" to log groups '"+e.group+"'.")},LoggerFactoryControlImpl.prototype.reset=function(e){void 0===e&&(e="all");for(var t=0,r=this._getLogGroupRunTimeSettingsFor(e);t<r.length;t++){var n=r[t];n.level=n.logGroupRule.level,n.logFormat.showTimeStamp=n.logGroupRule.logFormat.showTimeStamp,n.logFormat.showLoggerName=n.logGroupRule.logFormat.showLoggerName,n.logFormat.dateFormat.formatEnum=n.logGroupRule.logFormat.dateFormat.formatEnum}console.log("Reset all settings for group "+e)},LoggerFactoryControlImpl.prototype._getLogGroupRunTimeSettingsFor=function(e){var t=[];return"all"===e?t=this._settings.getLogGroupRuntimeSettings():(this._checkIndex(e),t.push(this._settings.getLogGroupRuntimeSettings()[e])),t},LoggerFactoryControlImpl.prototype._checkIndex=function(e){if(e<0||e>=this._settings.getLogGroupRuntimeSettings().length)throw new Error("Invalid index, use listLogGroups to find out a valid one.")},LoggerFactoryControlImpl._help='\n help(): void\n ** Shows this help.\n\n example(): void\n ** Shows an example of usage.\n\n showSettings(id: number | "all"): void\n ** Prints settings for given group id, "all" for all group.\n\n change(settings: LogGroupControlSettings): void\n ** Changes the current settings for one or all log groups.\n **\n LogGroupControlSettings, properties of object:\n group: number | "all"\n ** Apply to specific group, or "all".\n ** Required\n\n logLevel: "Fatal" | "Error" | "Warn" | "Info" | "Debug" | "Trace" | undefined\n ** Set log level, undefined will not change the setting.\n ** Optional\n\n logFormat: "Default" | "YearMonthDayTime" | "YearDayMonthWithFullTime" | "YearDayMonthTime" | undefined\n ** Set the log format, undefined will not change the setting.\n ** Optional\n\n showTimestamp: boolean | undefined\n ** Whether to show timestamp, undefined will not change the setting.\n ** Optional\n\n showLoggerName: boolean | undefined\n ** Whether to show the logger name, undefined will not change the setting.\n ** Optional\n\n reset(id: number | "all"): void\n ** Resets everything to original values, for one specific or for all groups.\n\n help():\n ** Shows this help.\n',LoggerFactoryControlImpl._example='\n Examples:\n change({group: "all", logLevel: "Info"})\n ** Change loglevel to Info for all groups.\n\n change({group: 1, recursive:false, logLevel: "Warn"})\n ** Change logLevel for group 1 to Warn.\n\n change({group: "all", logLevel: "Debug", logFormat: "YearDayMonthTime", showTimestamp:false, showLoggerName:false})\n ** Change loglevel to Debug for all groups, apply format, do not show timestamp and logger names.\n',LoggerFactoryControlImpl}()},7163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2837),i=r(3533),o=r(9014),a=function(){function ExtensionHelper(){}return ExtensionHelper.register=function(){if(!ExtensionHelper.registered){var listener=function(e){var t=e.data;null!==t&&ExtensionHelper.processMessageFromExtension(t)};"undefined"!=typeof window&&void 0!==window.removeEventListener&&void 0!==window.addEventListener&&(window.removeEventListener("message",listener),window.addEventListener("message",listener),ExtensionHelper.registered=!0)}},ExtensionHelper.processMessageFromExtension=function(e){if(ExtensionHelper.registered&&"tsl-extension"===e.from){var t=e.data;switch(t.type){case"register":ExtensionHelper.enableExtensionIntegration();break;case"request-change-loglevel":var r=t.value,n=ExtensionHelper.applyLogLevel(r.categoryId,r.logLevel,r.recursive);n.length>0&&ExtensionHelper.sendCategoriesRuntimeUpdateMessage(n);break;default:console.log("Unknown command to process message from extension, command was: "+t.type)}}},ExtensionHelper.sendCategoryLogMessage=function(e){if(ExtensionHelper.registered){var t={data:{type:"log-message",value:{categories:e.categories.map((function(e){return e.id})),errorAsStack:e.errorAsStack,formattedMessage:o.MessageFormatUtils.renderDefaultMessage(e,!1),logLevel:i.LogLevel[e.level].toString(),message:e.messageAsString,resolvedErrorMessage:e.isResolvedErrorMessage}},from:"tsl-logging"};ExtensionHelper.sendMessage(t)}},ExtensionHelper.sendCategoriesRuntimeUpdateMessage=function(e){if(ExtensionHelper.registered){var t=n.CategoryServiceImpl.getInstance(),r={categories:Array()};e.forEach((function(e){var n=t.getCategorySettings(e);null!=n&&r.categories.push({id:e.id,logLevel:i.LogLevel[n.logLevel].toString()})}));var o={data:{type:"categories-rt-update",value:r},from:"tsl-logging"};ExtensionHelper.sendMessage(o)}},ExtensionHelper.sendRootCategoriesToExtension=function(){if(ExtensionHelper.registered){var e={data:{type:"root-categories-tree",value:n.CategoryServiceImpl.getInstance().getRootCategories().map((function(e){return ExtensionHelper.getCategoryAsJSON(e)}))},from:"tsl-logging"};ExtensionHelper.sendMessage(e)}},ExtensionHelper.getCategoryAsJSON=function(e){return{children:e.children.map((function(e){return ExtensionHelper.getCategoryAsJSON(e)})),id:e.id,logLevel:i.LogLevel[e.logLevel].toString(),name:e.name,parentId:null!=e.parent?e.parent.id:null}},ExtensionHelper.applyLogLevel=function(e,t,r){var o=[],a=n.CategoryServiceImpl.getInstance().getCategoryById(e);return null!=a?ExtensionHelper._applyLogLevelRecursive(a,i.LogLevel.fromString(t),r,o):console.log("Could not change log level, failed to find category with id: "+e),o},ExtensionHelper._applyLogLevelRecursive=function(e,t,r,i){var o=n.CategoryServiceImpl.getInstance().getCategorySettings(e);null!=o&&(o.logLevel=t,i.push(e),r&&e.children.forEach((function(e){ExtensionHelper._applyLogLevelRecursive(e,t,r,i)})))},ExtensionHelper.getAllCategories=function(){var e=[],addCats=function(e,t){t.push(e),e.children.forEach((function(e){addCats(e,t)}))};return n.CategoryServiceImpl.getInstance().getRootCategories().forEach((function(t){addCats(t,e)})),e},ExtensionHelper.sendMessage=function(e){ExtensionHelper.registered&&"undefined"!=typeof window&&void 0!==window.postMessage&&window.postMessage(e,"*")},ExtensionHelper.enableExtensionIntegration=function(){if(ExtensionHelper.registered){n.CategoryServiceImpl.getInstance().enableExtensionIntegration(),ExtensionHelper.sendRootCategoriesToExtension();var e=ExtensionHelper.getAllCategories();ExtensionHelper.sendCategoriesRuntimeUpdateMessage(e)}},ExtensionHelper.registered=!1,ExtensionHelper}();t.ExtensionHelper=a},3533:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.Fatal=5]="Fatal"}(t.LogLevel||(t.LogLevel={})),function(e){e.fromString=function fromString(t){if(null==t)throw new Error("Argument must be set");switch(t.toLowerCase()){case"trace":return e.Trace;case"debug":return e.Debug;case"info":return e.Info;case"warn":return e.Warn;case"error":return e.Error;case"fatal":return e.Fatal;default:throw new Error("Unsupported value for conversion: "+t)}}}(t.LogLevel||(t.LogLevel={})),function(e){e[e.Console=0]="Console",e[e.MessageBuffer=1]="MessageBuffer",e[e.Custom=2]="Custom"}(t.LoggerType||(t.LoggerType={})),function(e){e[e.Default=0]="Default",e[e.YearMonthDayTime=1]="YearMonthDayTime",e[e.YearDayMonthWithFullTime=2]="YearDayMonthWithFullTime",e[e.YearDayMonthTime=3]="YearDayMonthTime"}(t.DateFormatEnum||(t.DateFormatEnum={})),function(e){e.fromString=function fromString(t){if(null==t)throw new Error("Argument must be set");switch(t.toLowerCase()){case"default":return e.Default;case"yearmonthdayTime":return e.YearMonthDayTime;case"yeardaymonthwithfulltime":return e.YearDayMonthWithFullTime;case"yeardaymonthtime":return e.YearDayMonthTime;default:throw new Error("Unsupported value for conversion: "+t)}}}(r=t.DateFormatEnum||(t.DateFormatEnum={}));var n=function(){function DateFormat(e,t){void 0===e&&(e=r.Default),void 0===t&&(t="-"),this._formatEnum=e,this._dateSeparator=t}return Object.defineProperty(DateFormat.prototype,"formatEnum",{get:function(){return this._formatEnum},set:function(e){this._formatEnum=e},enumerable:!0,configurable:!0}),Object.defineProperty(DateFormat.prototype,"dateSeparator",{get:function(){return this._dateSeparator},set:function(e){this._dateSeparator=e},enumerable:!0,configurable:!0}),DateFormat.prototype.copy=function(){return new DateFormat(this._formatEnum,this._dateSeparator)},DateFormat}();t.DateFormat=n;var i=function(){function LogFormat(e,t,r){void 0===e&&(e=new n),void 0===t&&(t=!0),void 0===r&&(r=!0),this._showTimeStamp=!0,this._showLoggerName=!0,this._dateFormat=e,this._showTimeStamp=t,this._showLoggerName=r}return Object.defineProperty(LogFormat.prototype,"dateFormat",{get:function(){return this._dateFormat},enumerable:!0,configurable:!0}),Object.defineProperty(LogFormat.prototype,"showTimeStamp",{get:function(){return this._showTimeStamp},set:function(e){this._showTimeStamp=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogFormat.prototype,"showLoggerName",{get:function(){return this._showLoggerName},set:function(e){this._showLoggerName=e},enumerable:!0,configurable:!0}),LogFormat}();t.LogFormat=i;var o=function(){function CategoryLogFormat(e,t,r){void 0===e&&(e=new n),void 0===t&&(t=!0),void 0===r&&(r=!0),this._dateFormat=e,this._showTimeStamp=t,this._showCategoryName=r}return Object.defineProperty(CategoryLogFormat.prototype,"dateFormat",{get:function(){return this._dateFormat},set:function(e){this._dateFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogFormat.prototype,"showTimeStamp",{get:function(){return this._showTimeStamp},set:function(e){this._showTimeStamp=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogFormat.prototype,"showCategoryName",{get:function(){return this._showCategoryName},set:function(e){this._showCategoryName=e},enumerable:!0,configurable:!0}),CategoryLogFormat.prototype.copy=function(){return new CategoryLogFormat(this._dateFormat.copy(),this._showTimeStamp,this._showCategoryName)},CategoryLogFormat}();t.CategoryLogFormat=o},8717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1674),i=r(9014),o=r(3533),a=function(){function CategoryLogMessageImpl(e,t,r,n,i,o,a){this._resolvedErrorMessage=!1,this._errorAsStack=null,this._message=e,this._error=t,this._categories=r,this._date=n,this._level=i,this._logFormat=o,this._ready=a}return Object.defineProperty(CategoryLogMessageImpl.prototype,"message",{get:function(){return this._message},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"error",{get:function(){return this._error},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"categories",{get:function(){return this._categories},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"date",{get:function(){return this._date},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"logFormat",{get:function(){return this._logFormat},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"isMessageLogData",{get:function(){return"string"!=typeof this._message},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"messageAsString",{get:function(){return"string"==typeof this._message?this._message:this._message.msg},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"logData",{get:function(){var e=null;return"string"!=typeof this._message&&(e=this.message),e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"isResolvedErrorMessage",{get:function(){return this._resolvedErrorMessage},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryLogMessageImpl.prototype,"errorAsStack",{get:function(){return this._errorAsStack},set:function(e){this._errorAsStack=e},enumerable:!0,configurable:!0}),CategoryLogMessageImpl.prototype.isReady=function(){return this._ready},CategoryLogMessageImpl.prototype.setReady=function(e){this._ready=e},Object.defineProperty(CategoryLogMessageImpl.prototype,"resolvedErrorMessage",{get:function(){return this._resolvedErrorMessage},set:function(e){this._resolvedErrorMessage=e},enumerable:!0,configurable:!0}),CategoryLogMessageImpl}(),s=function(){function AbstractCategoryLogger(e,t){this.allMessages=new n.LinkedList,this.rootCategory=e,this.runtimeSettings=t}return AbstractCategoryLogger.prototype.trace=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._log.apply(this,[o.LogLevel.Trace,e,null,!1].concat(t))},AbstractCategoryLogger.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._log.apply(this,[o.LogLevel.Debug,e,null,!1].concat(t))},AbstractCategoryLogger.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._log.apply(this,[o.LogLevel.Info,e,null,!1].concat(t))},AbstractCategoryLogger.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this._log.apply(this,[o.LogLevel.Warn,e,null,!1].concat(t))},AbstractCategoryLogger.prototype.error=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this._log.apply(this,[o.LogLevel.Error,e,t,!1].concat(r))},AbstractCategoryLogger.prototype.fatal=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this._log.apply(this,[o.LogLevel.Fatal,e,t,!1].concat(r))},AbstractCategoryLogger.prototype.resolved=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this._log.apply(this,[o.LogLevel.Error,e,t,!0].concat(r))},AbstractCategoryLogger.prototype.log=function(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];this._log.apply(this,[e,t,r,!1].concat(n))},AbstractCategoryLogger.prototype.getRootCategory=function(){return this.rootCategory},AbstractCategoryLogger.prototype.createDefaultLogMessage=function(e){return i.MessageFormatUtils.renderDefaultMessage(e,!0)},AbstractCategoryLogger.prototype._getMessageFormatter=function(){var e=this.runtimeSettings.getCategorySettings(this.rootCategory);if(null===e)throw new Error("Did not find CategorySettings for rootCategory: "+this.rootCategory.name);return e.formatterLogMessage},AbstractCategoryLogger.prototype._log=function(e,t,r,n){void 0===r&&(r=null),void 0===n&&(n=!1);for(var i=[],o=4;o<arguments.length;o++)i[o-4]=arguments[o];var functionMessage=function(){return"function"==typeof t?t():t},functionError=function(){return"function"==typeof r?r():r};this._logInternal.apply(this,[e,functionMessage,functionError,n].concat(i))},AbstractCategoryLogger.prototype._logInternal=function(e,t,r,n){for(var o=this,s=[],c=4;c<arguments.length;c++)s[c-4]=arguments[c];var l=[this.rootCategory];void 0!==s&&s.length>0&&(l=l.concat(s.filter((function(e){return e!==o.rootCategory}))));for(var _loop_1=function(s){var c=l[s];if(null===c)throw new Error("Cannot have a null element within categories, at index="+s);var p=u.runtimeSettings.getCategorySettings(c);if(null===p)throw new Error("Category with path: "+c.getCategoryPath()+" is not registered with this logger, maybe you registered it with a different root logger?");if(p.logLevel<=e){var d=null!==r?r():null;if(null===d){var h=new a(t(),d,l,new Date,e,p.logFormat,!0);h.resolvedErrorMessage=n,u.allMessages.addTail(h),u.processMessages()}else{var g=new a(t(),d,l,new Date,e,p.logFormat,!1);g.resolvedErrorMessage=n,u.allMessages.addTail(g),i.MessageFormatUtils.renderError(d).then((function(e){g.errorAsStack=e,g.setReady(!0),o.processMessages()})).catch((function(){g.errorAsStack="<UNKNOWN> unable to get stack.",g.setReady(!0),o.processMessages()}))}return"break"}},u=this,p=0;p<l.length;p++){var d=_loop_1(p);if("break"===d)break}},AbstractCategoryLogger.prototype.processMessages=function(){var e=this.allMessages;if(e.getSize()>0)do{var t=e.getHead();if(null!=t){if(!t.isReady())break;e.removeHead(),this.doLog(t)}}while(e.getSize()>0)},AbstractCategoryLogger}();t.AbstractCategoryLogger=s},1802:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=r(2837),o=function(){function Category(e,t){if(void 0===t&&(t=null),this._children=[],this._logLevel=n.LogLevel.Error,-1!==e.indexOf("#"))throw new Error("Cannot use # in a name of a Category");this._id=Category.nextId(),this._name=e,this._parent=t,null!==this._parent&&this._parent._children.push(this),i.CategoryServiceImpl.getInstance().registerCategory(this)}return Object.defineProperty(Category.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(Category.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(Category.prototype,"children",{get:function(){return this._children},enumerable:!0,configurable:!0}),Object.defineProperty(Category.prototype,"logLevel",{get:function(){return this._logLevel},enumerable:!0,configurable:!0}),Category.prototype.trace=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.loadCategoryLogger(),(t=this._logger).trace.apply(t,[e].concat(r))},Category.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.loadCategoryLogger(),(t=this._logger).debug.apply(t,[e].concat(r))},Category.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.loadCategoryLogger(),(t=this._logger).info.apply(t,[e].concat(r))},Category.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.loadCategoryLogger(),(t=this._logger).warn.apply(t,[e].concat(r))},Category.prototype.error=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.loadCategoryLogger(),(r=this._logger).error.apply(r,[e,t].concat(n))},Category.prototype.fatal=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.loadCategoryLogger(),(r=this._logger).fatal.apply(r,[e,t].concat(n))},Category.prototype.resolved=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.loadCategoryLogger(),(r=this._logger).resolved.apply(r,[e,t].concat(n))},Category.prototype.log=function(e,t,r){for(var n,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];this.loadCategoryLogger(),(n=this._logger).log.apply(n,[e,t,r].concat(i))},Category.prototype.getCategoryPath=function(){for(var e=this.name,t=this.parent;null!=t;)e=t.name+"#"+e,t=t.parent;return e},Object.defineProperty(Category.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Category.prototype.loadCategoryLogger=function(){if(this._logger||(this._logger=i.CategoryServiceImpl.getInstance().getLogger(this)),void 0===this._logger||null===this._logger)throw new Error("Failed to load a logger for category (should not happen): "+this.name)},Category.nextId=function(){return Category.currentId++},Category.currentId=1,Category}();t.Category=o},4182:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=function(){function CategoryConfiguration(e,t,r,i){if(void 0===e&&(e=n.LogLevel.Error),void 0===t&&(t=n.LoggerType.Console),void 0===r&&(r=new n.CategoryLogFormat),void 0===i&&(i=null),this._formatterLogMessage=null,this._logLevel=e,this._loggerType=t,this._logFormat=r,this._callBackLogger=i,this._loggerType===n.LoggerType.Custom&&null===this.callBackLogger)throw new Error("If you specify loggerType to be Custom, you must provide the callBackLogger argument")}return Object.defineProperty(CategoryConfiguration.prototype,"logLevel",{get:function(){return this._logLevel},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryConfiguration.prototype,"loggerType",{get:function(){return this._loggerType},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryConfiguration.prototype,"logFormat",{get:function(){return this._logFormat},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryConfiguration.prototype,"callBackLogger",{get:function(){return this._callBackLogger},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryConfiguration.prototype,"formatterLogMessage",{get:function(){return this._formatterLogMessage},set:function(e){if(null!==e&&this._loggerType===n.LoggerType.Custom)throw new Error("You cannot specify a formatter for log messages if your loggerType is Custom");this._formatterLogMessage=e},enumerable:!0,configurable:!0}),CategoryConfiguration.prototype.copy=function(){var e=new CategoryConfiguration(this.logLevel,this.loggerType,this.logFormat.copy(),this.callBackLogger);return e.formatterLogMessage=this.formatterLogMessage,e},CategoryConfiguration}();t.CategoryConfiguration=i},9939:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3533),a=function(e){function CategoryConsoleLoggerImpl(t,r){return e.call(this,t,r)||this}return i(CategoryConsoleLoggerImpl,e),CategoryConsoleLoggerImpl.prototype.doLog=function(e){if(void 0===console)throw new Error("Console is not defined, cannot log msg: "+e.messageAsString);var t=this._getMessageFormatter(),r=void 0;r=null===t?this.createDefaultLogMessage(e):t(e);var n=!1;switch(e.level){case o.LogLevel.Trace:case o.LogLevel.Debug:break;case o.LogLevel.Info:console.info&&(console.info(r),n=!0);break;case o.LogLevel.Warn:console.warn&&(console.warn(r),n=!0);break;case o.LogLevel.Error:case o.LogLevel.Fatal:console.error&&(console.error(r),n=!0);break;default:throw new Error("Unsupported level: "+e.level)}n||console.log(r)},CategoryConsoleLoggerImpl}(r(8717).AbstractCategoryLogger);t.CategoryConsoleLoggerImpl=a},8057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function CategoryDelegateLoggerImpl(e){this._delegate=e}return Object.defineProperty(CategoryDelegateLoggerImpl.prototype,"delegate",{get:function(){return this._delegate},set:function(e){this._delegate=e},enumerable:!0,configurable:!0}),CategoryDelegateLoggerImpl.prototype.trace=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=this._delegate).trace.apply(t,[e].concat(r))},CategoryDelegateLoggerImpl.prototype.debug=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=this._delegate).debug.apply(t,[e].concat(r))},CategoryDelegateLoggerImpl.prototype.info=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=this._delegate).info.apply(t,[e].concat(r))},CategoryDelegateLoggerImpl.prototype.warn=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=this._delegate).warn.apply(t,[e].concat(r))},CategoryDelegateLoggerImpl.prototype.error=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];(r=this._delegate).error.apply(r,[e,t].concat(n))},CategoryDelegateLoggerImpl.prototype.fatal=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];(r=this._delegate).fatal.apply(r,[e,t].concat(n))},CategoryDelegateLoggerImpl.prototype.resolved=function(e,t){for(var r,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];(r=this._delegate).resolved.apply(r,[e,t].concat(n))},CategoryDelegateLoggerImpl.prototype.log=function(e,t,r){for(var n,i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];(n=this._delegate).log.apply(n,[e,t,r].concat(i))},CategoryDelegateLoggerImpl}();t.CategoryDelegateLoggerImpl=r},4792:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(7163),a=function(e){function CategoryExtensionLoggerImpl(t,r){return e.call(this,t,r)||this}return i(CategoryExtensionLoggerImpl,e),CategoryExtensionLoggerImpl.prototype.doLog=function(e){"undefined"!=typeof window?o.ExtensionHelper.sendCategoryLogMessage(e):console.log("window is not available, you must be running in a browser for this. Dropped message.")},CategoryExtensionLoggerImpl}(r(8717).AbstractCategoryLogger);t.CategoryExtensionLoggerImpl=a},7329:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function CategoryMessageBufferLoggerImpl(){var t=null!==e&&e.apply(this,arguments)||this;return t.messages=[],t}return i(CategoryMessageBufferLoggerImpl,e),CategoryMessageBufferLoggerImpl.prototype.getMessages=function(){return this.messages},CategoryMessageBufferLoggerImpl.prototype.toString=function(){return this.messages.map((function(e){return e})).join("\n")},CategoryMessageBufferLoggerImpl.prototype.doLog=function(e){var t,r=this._getMessageFormatter();t=null===r?this.createDefaultLogMessage(e):r(e),this.messages.push(t)},CategoryMessageBufferLoggerImpl}(r(8717).AbstractCategoryLogger);t.CategoryMessageBufferLoggerImpl=o},4365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=function(){function CategoryRuntimeSettings(e,t,r,i,o,a){void 0===t&&(t=n.LogLevel.Error),void 0===r&&(r=n.LoggerType.Console),void 0===i&&(i=new n.CategoryLogFormat),void 0===o&&(o=null),void 0===a&&(a=null),this._formatterLogMessage=null,this._category=e,this._logLevel=t,this._loggerType=r,this._logFormat=i,this._callBackLogger=o,this._formatterLogMessage=a}return Object.defineProperty(CategoryRuntimeSettings.prototype,"category",{get:function(){return this._category},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){this._logLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"loggerType",{get:function(){return this._loggerType},set:function(e){this._loggerType=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"logFormat",{get:function(){return this._logFormat},set:function(e){this._logFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"callBackLogger",{get:function(){return this._callBackLogger},set:function(e){this._callBackLogger=e},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryRuntimeSettings.prototype,"formatterLogMessage",{get:function(){return this._formatterLogMessage},set:function(e){this._formatterLogMessage=e},enumerable:!0,configurable:!0}),CategoryRuntimeSettings}();t.CategoryRuntimeSettings=i},2837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1674),i=r(3533),o=r(9939),a=r(8057),s=r(4792),c=r(7329),l=r(7163),u=r(4365),p=r(4182),d=function(){function CategoryServiceImpl(){this._defaultConfig=new p.CategoryConfiguration,this._mapState=new n.SimpleMap,l.ExtensionHelper.register()}return CategoryServiceImpl.getInstance=function(){return null===CategoryServiceImpl._INSTANCE&&(CategoryServiceImpl._INSTANCE=new CategoryServiceImpl),CategoryServiceImpl._INSTANCE},CategoryServiceImpl.prototype.getLogger=function(e){return this.createOrGetCategoryState(e).logger},CategoryServiceImpl.prototype.clear=function(){this._mapState.clear(),this.setDefaultConfiguration(new p.CategoryConfiguration)},CategoryServiceImpl.prototype.getCategorySettings=function(e){return this.createOrGetCategoryState(e).currentRuntimeSettings},CategoryServiceImpl.prototype.getOriginalCategorySettings=function(e){return this.createOrGetCategoryState(e).originalRuntimeSettings},CategoryServiceImpl.prototype.setDefaultConfiguration=function(e,t){void 0===t&&(t=!0),this._defaultConfig=e,t&&this._mapState.forEachValue((function(t){t.updateSettings(e)}))},CategoryServiceImpl.prototype.setConfigurationCategory=function(e,t,r){var n=this;void 0===r&&(r=!1),this.createOrGetCategoryState(t).updateSettings(e),r&&t.children.forEach((function(t){n.setConfigurationCategory(e,t,r)}))},CategoryServiceImpl.prototype.registerCategory=function(e){if(null==e)throw new Error("Category CANNOT be null/undefined");if(this._mapState.exists(CategoryServiceImpl.getCategoryKey(e)))throw new Error("Cannot add this root category with name: "+e.name+", it already exists (same name in hierarchy).");this.createOrGetCategoryState(e)},CategoryServiceImpl.prototype.enableExtensionIntegration=function(){var e=this;this._mapState.forEachValue((function(t){return t.enableForExtension(e)}))},CategoryServiceImpl.prototype.getRootCategories=function(){return this._mapState.values().filter((function(e){return null==e.category.parent})).map((function(e){return e.category}))},CategoryServiceImpl.prototype.getCategoryById=function(e){var t=this._mapState.values().filter((function(t){return t.category.id===e})).map((function(e){return e.category}));return 1===t.length?t[0]:null},CategoryServiceImpl.prototype.createOrGetCategoryState=function(e){var t=CategoryServiceImpl.getCategoryKey(e),r=this._mapState.get(t);if(void 0!==r)return r;var n=this.createState(e);return this._mapState.put(t,n),n},CategoryServiceImpl.prototype.createState=function(e){var t=this;return new h(e,(function(){return t._defaultConfig}),(function(e,r){return t.createLogger(e,r)}))},CategoryServiceImpl.prototype.createLogger=function(e,t){switch(e.loggerType){case i.LoggerType.Console:return new o.CategoryConsoleLoggerImpl(t,this);case i.LoggerType.MessageBuffer:return new c.CategoryMessageBufferLoggerImpl(t,this);case i.LoggerType.Custom:if(null===e.callBackLogger)throw new Error("Cannot create custom logger, custom callback is null");return e.callBackLogger(t,this);default:throw new Error("Cannot create a Logger for LoggerType: "+e.loggerType)}},CategoryServiceImpl.getCategoryKey=function(e){return e.getCategoryPath()},CategoryServiceImpl._INSTANCE=null,CategoryServiceImpl}();t.CategoryServiceImpl=d;var h=function(){function CategoryState(e,t,r){this._category=e,this._lazyState=new g(e,t,r)}return Object.defineProperty(CategoryState.prototype,"category",{get:function(){return this._category},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryState.prototype,"logger",{get:function(){return this._lazyState.getLogger()},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryState.prototype,"originalRuntimeSettings",{get:function(){return this._lazyState.getOriginalRuntimeSettings()},enumerable:!0,configurable:!0}),Object.defineProperty(CategoryState.prototype,"currentRuntimeSettings",{get:function(){return this._lazyState.getCurrentRuntimeSettings()},enumerable:!0,configurable:!0}),CategoryState.prototype.enableForExtension=function(e){this._lazyState.enableForExtension(e)},CategoryState.prototype.updateSettings=function(e){this._lazyState.updateSettings(e)},CategoryState}(),g=function(){function LazyState(e,t,r){this._category=e,this._defaultConfig=t,this._createLogger=r}return LazyState.prototype.isLoaded=function(){return void 0!==this._logger},LazyState.prototype.getLogger=function(){return this.loadLoggerOnDemand(),this._delegateLogger},LazyState.prototype.getOriginalRuntimeSettings=function(){return this.loadLoggerOnDemand(),this._originalRuntimeSettings},LazyState.prototype.getCurrentRuntimeSettings=function(){return this.loadLoggerOnDemand(),this._currentRuntimeSettings},LazyState.prototype.enableForExtension=function(e){this.loadLoggerOnDemand(),this._wrappedLogger instanceof s.CategoryExtensionLoggerImpl||(console.log("Reconfiguring logger for extension for category: "+this._category.name),this._wrappedLogger=new s.CategoryExtensionLoggerImpl(this._category,e),this._delegateLogger.delegate=this._wrappedLogger)},LazyState.prototype.updateSettings=function(e){this.isLoaded()?(this._currentRuntimeSettings.logLevel=e.logLevel,this._currentRuntimeSettings.loggerType=e.loggerType,this._currentRuntimeSettings.logFormat=e.logFormat,this._currentRuntimeSettings.callBackLogger=e.callBackLogger,this._currentRuntimeSettings.formatterLogMessage=e.formatterLogMessage,this._logger=this._createLogger(e,this._category),this._wrappedLogger instanceof s.CategoryExtensionLoggerImpl||(this._wrappedLogger=this._logger),this._delegateLogger.delegate=this._wrappedLogger):this._defaultConfig=function(){return e}},LazyState.prototype.loadLoggerOnDemand=function(){this.isLoaded()||(this._logger=this._createLogger(this._defaultConfig(),this._category),this._wrappedLogger=this._logger,this._delegateLogger=new a.CategoryDelegateLoggerImpl(this._wrappedLogger),this._originalRuntimeSettings=this.initNewSettings(),this._currentRuntimeSettings=this.initNewSettings())},LazyState.prototype.initNewSettings=function(){var e=this._defaultConfig().copy();return new u.CategoryRuntimeSettings(this._category,e.logLevel,e.loggerType,e.logFormat,e.callBackLogger,e.formatterLogMessage)},LazyState}()},2399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2837),i=function(){function CategoryServiceFactory(){}return CategoryServiceFactory.getLogger=function(e){return n.CategoryServiceImpl.getInstance().getLogger(e)},CategoryServiceFactory.clear=function(){return n.CategoryServiceImpl.getInstance().clear()},CategoryServiceFactory.setDefaultConfiguration=function(e,t){void 0===t&&(t=!0),n.CategoryServiceImpl.getInstance().setDefaultConfiguration(e,t)},CategoryServiceFactory.setConfigurationCategory=function(e,t,r){void 0===r&&(r=!1),n.CategoryServiceImpl.getInstance().setConfigurationCategory(e,t,r)},CategoryServiceFactory}();t.CategoryServiceFactory=i},6843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=r(1674),o=r(9014),a=function(){function LogMessageInternalImpl(e,t,r,n,i,o,a,s){this._errorAsStack=null,this._error=null,this._loggerName=e,this._message=t,this._errorAsStack=r,this._error=n,this._logGroupRule=i,this._date=o,this._level=a,this._ready=s}return Object.defineProperty(LogMessageInternalImpl.prototype,"loggerName",{get:function(){return this._loggerName},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"message",{get:function(){return this._message},set:function(e){this._message=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"errorAsStack",{get:function(){return this._errorAsStack},set:function(e){this._errorAsStack=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"error",{get:function(){return this._error},set:function(e){this._error=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"logGroupRule",{get:function(){return this._logGroupRule},set:function(e){this._logGroupRule=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"date",{get:function(){return this._date},set:function(e){this._date=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"level",{get:function(){return this._level},set:function(e){this._level=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"isMessageLogData",{get:function(){return"string"!=typeof this._message},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"ready",{get:function(){return this._ready},set:function(e){this._ready=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"messageAsString",{get:function(){return"string"==typeof this._message?this._message:this._message.msg},enumerable:!0,configurable:!0}),Object.defineProperty(LogMessageInternalImpl.prototype,"logData",{get:function(){var e=null;return"string"!=typeof this._message&&(e=this.message),e},enumerable:!0,configurable:!0}),LogMessageInternalImpl}(),s=function(){function AbstractLogger(e,t){this._allMessages=new i.LinkedList,this._open=!0,this._name=e,this._logGroupRuntimeSettings=t}return Object.defineProperty(AbstractLogger.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),AbstractLogger.prototype.trace=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Trace,e,t)},AbstractLogger.prototype.debug=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Debug,e,t)},AbstractLogger.prototype.info=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Info,e,t)},AbstractLogger.prototype.warn=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Warn,e,t)},AbstractLogger.prototype.error=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Error,e,t)},AbstractLogger.prototype.fatal=function(e,t){void 0===t&&(t=null),this._log(n.LogLevel.Fatal,e,t)},AbstractLogger.prototype.isTraceEnabled=function(){return this._logGroupRuntimeSettings.level===n.LogLevel.Trace},AbstractLogger.prototype.isDebugEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Debug},AbstractLogger.prototype.isInfoEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Info},AbstractLogger.prototype.isWarnEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Warn},AbstractLogger.prototype.isErrorEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Error},AbstractLogger.prototype.isFatalEnabled=function(){return this._logGroupRuntimeSettings.level<=n.LogLevel.Fatal},AbstractLogger.prototype.getLogLevel=function(){return this._logGroupRuntimeSettings.level},AbstractLogger.prototype.isOpen=function(){return this._open},AbstractLogger.prototype.close=function(){this._open=!1,this._allMessages.clear()},AbstractLogger.prototype.createDefaultLogMessage=function(e){return o.MessageFormatUtils.renderDefaultLog4jMessage(e,!0)},AbstractLogger.prototype._getMessageFormatter=function(){return this._logGroupRuntimeSettings.formatterLogMessage},AbstractLogger.prototype._log=function(e,t,r){if(void 0===r&&(r=null),this._open&&this._logGroupRuntimeSettings.level<=e){this._allMessages.addTail(this.createMessage(e,(function(){return"function"==typeof t?t():t}),(function(){return"function"==typeof r?r():r}),new Date)),this.processMessages()}},AbstractLogger.prototype.createMessage=function(e,t,r,n){var i=this,s=r();if(null!==s){var c=new a(this._name,t(),null,s,this._logGroupRuntimeSettings.logGroupRule,n,e,!1);return o.MessageFormatUtils.renderError(s).then((function(e){c.errorAsStack=e,c.ready=!0,i.processMessages()})).catch((function(){c.errorAsStack="<UNKNOWN> unable to get stack.",c.ready=!0,i.processMessages()})),c}return new a(this._name,t(),null,s,this._logGroupRuntimeSettings.logGroupRule,n,e,!0)},AbstractLogger.prototype.processMessages=function(){var e=this._allMessages;if(e.getSize()>0)do{var t=e.getHead();if(null!=t){if(!t.ready)break;e.removeHead(),null!==t.message&&this.doLog(t)}}while(e.getSize()>0)},AbstractLogger}();t.AbstractLogger=s},6580:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6843),a=r(3533),s=function(e){function ConsoleLoggerImpl(t,r){return e.call(this,t,r)||this}return i(ConsoleLoggerImpl,e),ConsoleLoggerImpl.prototype.doLog=function(e){if(void 0===console)throw new Error("Console is not defined, cannot log msg: "+e.message);var t=!1,r=e.level,n=this._getMessageFormatter(),i=void 0;switch(i=null===n?this.createDefaultLogMessage(e):n(e),r){case a.LogLevel.Trace:case a.LogLevel.Debug:break;case a.LogLevel.Info:console.info&&(console.info(i),t=!0);break;case a.LogLevel.Warn:console.warn&&(console.warn(i),t=!0);break;case a.LogLevel.Error:case a.LogLevel.Fatal:console.error&&(console.error(i),t=!0);break;default:throw new Error("Log level not supported: "+r)}t||console.log(i)},ConsoleLoggerImpl}(o.AbstractLogger);t.ConsoleLoggerImpl=s},8225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1674),i=r(3533),o=r(8983),a=r(7163),s=r(6616),c=r(8594),l=function(){function LFServiceImpl(){this._nameCounter=1,this._mapFactories=new n.SimpleMap,a.ExtensionHelper.register()}return LFServiceImpl.getInstance=function(){return null===LFServiceImpl._INSTANCE&&(LFServiceImpl._INSTANCE=new LFServiceImpl),LFServiceImpl._INSTANCE},LFServiceImpl.prototype.createLoggerFactory=function(e){void 0===e&&(e=null);var t="LoggerFactory"+this._nameCounter++;return this.createNamedLoggerFactory(t,e)},LFServiceImpl.prototype.createNamedLoggerFactory=function(e,t){if(void 0===t&&(t=null),this._mapFactories.exists(e))throw new Error("LoggerFactory with name "+e+" already exists.");var r;return r=null!==t?new o.LoggerFactoryImpl(e,t):new o.LoggerFactoryImpl(e,LFServiceImpl.createDefaultOptions()),this._mapFactories.put(e,r),r},LFServiceImpl.prototype.closeLoggers=function(){this._mapFactories.values().forEach((function(e){e.closeLoggers()})),this._mapFactories.clear(),this._nameCounter=1},LFServiceImpl.prototype.getRuntimeSettingsForLoggerFactories=function(){var e=[];return this._mapFactories.forEachValue((function(t){return e.push(t)})),e},LFServiceImpl.prototype.getLogGroupSettings=function(e,t){var r=this._mapFactories.get(e);return void 0===r?null:r.getLogGroupRuntimeSettingsByIndex(t)},LFServiceImpl.prototype.getLoggerFactoryRuntimeSettingsByName=function(e){var t=this._mapFactories.get(e);return void 0===t?null:t},LFServiceImpl.createDefaultOptions=function(){return(new c.LoggerFactoryOptions).addLogGroupRule(new s.LogGroupRule(new RegExp(".+"),i.LogLevel.Info))},LFServiceImpl._INSTANCE=null,LFServiceImpl}(),u=function(){function LFService(){}return LFService.createLoggerFactory=function(e){return void 0===e&&(e=null),LFService.INSTANCE_SERVICE.createLoggerFactory(e)},LFService.createNamedLoggerFactory=function(e,t){if(void 0===t&&(t=null),e===LFService.DEFAULT_LOGGER_FACTORY_NAME)throw new Error("LoggerFactory name: "+LFService.DEFAULT_LOGGER_FACTORY_NAME+" is reserved and cannot be used.");return LFService.INSTANCE_SERVICE.createNamedLoggerFactory(e,t)},LFService.closeLoggers=function(){return LFService.INSTANCE_SERVICE.closeLoggers()},LFService.getRuntimeSettings=function(){return LFService.INSTANCE_SERVICE},Object.defineProperty(LFService,"DEFAULT",{get:function(){return LFService.getDefault()},enumerable:!0,configurable:!0}),LFService.getDefault=function(){return null===LFService.DEFAULT_LOGGER_FACTORY&&(LFService.DEFAULT_LOGGER_FACTORY=LFService.DEFAULT_LOGGER_FACTORY=LFService.INSTANCE_SERVICE.createNamedLoggerFactory(LFService.DEFAULT_LOGGER_FACTORY_NAME,(new c.LoggerFactoryOptions).addLogGroupRule(new s.LogGroupRule(new RegExp(".+"),i.LogLevel.Error)))),LFService.DEFAULT_LOGGER_FACTORY},LFService.DEFAULT_LOGGER_FACTORY_NAME="DEFAULT",LFService.INSTANCE_SERVICE=l.getInstance(),LFService.DEFAULT_LOGGER_FACTORY=null,LFService}();t.LFService=u},6616:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=function(){function LogGroupRule(e,t,r,i,o){void 0===r&&(r=new n.LogFormat),void 0===i&&(i=n.LoggerType.Console),void 0===o&&(o=null),this._formatterLogMessage=null,this._regExp=e,this._level=t,this._logFormat=r,this._loggerType=i,this._callBackLogger=o}return Object.defineProperty(LogGroupRule.prototype,"regExp",{get:function(){return this._regExp},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"loggerType",{get:function(){return this._loggerType},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"logFormat",{get:function(){return this._logFormat},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"callBackLogger",{get:function(){return this._callBackLogger},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRule.prototype,"formatterLogMessage",{get:function(){return this._formatterLogMessage},set:function(e){if(null!==e&&this._loggerType===n.LoggerType.Custom)throw new Error("You cannot specify a formatter for log messages if your loggerType is Custom");this._formatterLogMessage=e},enumerable:!0,configurable:!0}),LogGroupRule}();t.LogGroupRule=i},1902:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3533),i=function(){function LogGroupRuntimeSettings(e){this._formatterLogMessage=null,this._logGroupRule=e,this._level=e.level,this._loggerType=e.loggerType,this._logFormat=new n.LogFormat(new n.DateFormat(e.logFormat.dateFormat.formatEnum,e.logFormat.dateFormat.dateSeparator),e.logFormat.showTimeStamp,e.logFormat.showLoggerName),this._callBackLogger=e.callBackLogger,this._formatterLogMessage=e.formatterLogMessage}return Object.defineProperty(LogGroupRuntimeSettings.prototype,"logGroupRule",{get:function(){return this._logGroupRule},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"level",{get:function(){return this._level},set:function(e){this._level=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"loggerType",{get:function(){return this._loggerType},set:function(e){this._loggerType=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"logFormat",{get:function(){return this._logFormat},set:function(e){this._logFormat=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"callBackLogger",{get:function(){return this._callBackLogger},set:function(e){this._callBackLogger=e},enumerable:!0,configurable:!0}),Object.defineProperty(LogGroupRuntimeSettings.prototype,"formatterLogMessage",{get:function(){return this._formatterLogMessage},set:function(e){this._formatterLogMessage=e},enumerable:!0,configurable:!0}),LogGroupRuntimeSettings}();t.LogGroupRuntimeSettings=i},8983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1674),i=r(3533),o=r(6580),a=r(4570),s=r(6843),c=r(1902),l=function(){function LoggerFactoryImpl(e,t){this._loggers=new n.SimpleMap,this._logGroupRuntimeSettingsIndexed=[],this._loggerToLogGroupSettings=new n.SimpleMap,this._name=e,this.configure(t)}return LoggerFactoryImpl.prototype.configure=function(e){this._options=e,this.closeLoggers(),this._loggerToLogGroupSettings.clear(),this._logGroupRuntimeSettingsIndexed=[];for(var t=this._options.logGroupRules,r=0;r<t.length;r++)this._logGroupRuntimeSettingsIndexed.push(new c.LogGroupRuntimeSettings(t[r]))},LoggerFactoryImpl.prototype.getLogger=function(e){if(!this._options.enabled)throw new Error("LoggerFactory is not enabled, please check your options passed in");var t=this._loggers.get(e);return void 0!==t||(t=this.loadLogger(e),this._loggers.put(e,t)),t},LoggerFactoryImpl.prototype.isEnabled=function(){return this._options.enabled},LoggerFactoryImpl.prototype.closeLoggers=function(){this._loggers.forEachValue((function(e){e instanceof s.AbstractLogger&&e.close()})),this._loggers.clear()},LoggerFactoryImpl.prototype.getName=function(){return this._name},LoggerFactoryImpl.prototype.getLogGroupRuntimeSettingsByIndex=function(e){return e>=0&&e<this._logGroupRuntimeSettingsIndexed.length?this._logGroupRuntimeSettingsIndexed[e]:null},LoggerFactoryImpl.prototype.getLogGroupRuntimeSettingsByLoggerName=function(e){var t=this._loggerToLogGroupSettings.get(e);return void 0===t?null:t},LoggerFactoryImpl.prototype.getLogGroupRuntimeSettings=function(){return this._logGroupRuntimeSettingsIndexed.slice(0)},LoggerFactoryImpl.prototype.loadLogger=function(e){for(var t=this._options.logGroupRules,r=0;r<t.length;r++){var n=t[r];if(n.regExp.test(e)){var s=this._logGroupRuntimeSettingsIndexed[r],c=void 0;switch(n.loggerType){case i.LoggerType.Console:c=new o.ConsoleLoggerImpl(e,s);break;case i.LoggerType.MessageBuffer:c=new a.MessageBufferLoggerImpl(e,s);break;case i.LoggerType.Custom:if(null==n.callBackLogger)throw new Error("Cannot create a custom logger, custom callback is null");c=n.callBackLogger(e,s);break;default:throw new Error("Cannot create a Logger for LoggerType: "+n.loggerType)}return this._loggerToLogGroupSettings.put(e,s),c}}throw new Error("Failed to find a match to create a Logger for: "+e)},LoggerFactoryImpl}();t.LoggerFactoryImpl=l},8594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function LoggerFactoryOptions(){this._logGroupRules=[],this._enabled=!0}return LoggerFactoryOptions.prototype.addLogGroupRule=function(e){return this._logGroupRules.push(e),this},LoggerFactoryOptions.prototype.setEnabled=function(e){return this._enabled=e,this},Object.defineProperty(LoggerFactoryOptions.prototype,"logGroupRules",{get:function(){return this._logGroupRules},enumerable:!0,configurable:!0}),Object.defineProperty(LoggerFactoryOptions.prototype,"enabled",{get:function(){return this._enabled},enumerable:!0,configurable:!0}),LoggerFactoryOptions}();t.LoggerFactoryOptions=r},4570:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function MessageBufferLoggerImpl(t,r){var n=e.call(this,t,r)||this;return n.messages=[],n}return i(MessageBufferLoggerImpl,e),MessageBufferLoggerImpl.prototype.close=function(){this.messages=[],e.prototype.close.call(this)},MessageBufferLoggerImpl.prototype.getMessages=function(){return this.messages},MessageBufferLoggerImpl.prototype.toString=function(){return this.messages.map((function(e){return e})).join("\n")},MessageBufferLoggerImpl.prototype.doLog=function(e){var t,r=this._getMessageFormatter();t=null===r?this.createDefaultLogMessage(e):r(e),this.messages.push(t)},MessageBufferLoggerImpl}(r(6843).AbstractLogger);t.MessageBufferLoggerImpl=o},9290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9791),i=r(3315),o=r(7163);t.ExtensionHelper=o.ExtensionHelper;var a=r(8717);t.AbstractCategoryLogger=a.AbstractCategoryLogger;var s=r(9939);t.CategoryConsoleLoggerImpl=s.CategoryConsoleLoggerImpl;var c=r(8057);t.CategoryDelegateLoggerImpl=c.CategoryDelegateLoggerImpl;var l=r(1802);t.Category=l.Category;var u=r(4365);t.CategoryRuntimeSettings=u.CategoryRuntimeSettings;var p=r(4182);t.CategoryConfiguration=p.CategoryConfiguration;var d=r(7329);t.CategoryMessageBufferLoggerImpl=d.CategoryMessageBufferLoggerImpl;var h=r(2399);t.CategoryServiceFactory=h.CategoryServiceFactory;var g=r(8594);t.LoggerFactoryOptions=g.LoggerFactoryOptions;var y=r(6616);t.LogGroupRule=y.LogGroupRule;var m=r(8225);t.LFService=m.LFService;var v=r(6843);t.AbstractLogger=v.AbstractLogger;var w=r(6580);t.ConsoleLoggerImpl=w.ConsoleLoggerImpl;var b=r(4570);t.MessageBufferLoggerImpl=b.MessageBufferLoggerImpl;var C=r(3533);t.CategoryLogFormat=C.CategoryLogFormat,t.DateFormat=C.DateFormat,t.DateFormatEnum=C.DateFormatEnum,t.LogFormat=C.LogFormat,t.LoggerType=C.LoggerType,t.LogLevel=C.LogLevel;var _=r(1674);t.SimpleMap=_.SimpleMap,t.LinkedList=_.LinkedList,function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(6071));var S=r(9014);t.MessageFormatUtils=S.MessageFormatUtils,t.help=function help(){console.log("help()\n ** Shows this help\n\n getLogControl(): LoggerControl\n ** Returns LoggerControl Object, use to dynamically change loglevels for log4j logging.\n ** Call .help() on LoggerControl object for available options.\n\n getCategoryControl(): CategoryServiceControl\n ** Returns CategoryServiceControl Object, use to dynamically change loglevels for category logging.\n ** Call .help() on CategoryServiceControl object for available options.\n")},t.getLogControl=function getLogControl(){return new n.LoggerControlImpl},t.getCategoryControl=function getCategoryControl(){return new i.CategoryServiceControlImpl}},1674:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function LinkedNode(e){this._previous=null,this._next=null,this._value=e}return Object.defineProperty(LinkedNode.prototype,"previous",{get:function(){return this._previous},set:function(e){this._previous=e},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedNode.prototype,"next",{get:function(){return this._next},set:function(e){this._next=e},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedNode.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),LinkedNode}(),n=function(){function LinkedList(){this.head=null,this.size=0}return LinkedList.prototype.addHead=function(e){if(!this.createHeadIfNeeded(e)){if(null==this.head)throw new Error("This should never happen, list implementation broken");var t=this.head.next,n=new r(e);null!=t&&(t.previous=n,n.next=t),this.head=n}this.size++},LinkedList.prototype.addTail=function(e){if(!this.createHeadIfNeeded(e)){var t=this.getTailNode();if(null==t)throw new Error("List implementation broken");var n=new r(e);t.next=n,n.previous=t}this.size++},LinkedList.prototype.clear=function(){this.head=null,this.size=0},LinkedList.prototype.getHead=function(){return null!=this.head?this.head.value:null},LinkedList.prototype.removeHead=function(){if(null!=this.head){var e=this.head,t=e.value;return this.head=e.next,this.size--,t}return null},LinkedList.prototype.getTail=function(){var e=this.getTailNode();return null!=e?e.value:null},LinkedList.prototype.removeTail=function(){var e=this.getTailNode();if(null!=e){if(e===this.head)this.head=null;else{var t=e.previous;if(null==t)throw new Error("List implementation is broken");t.next=null}return this.size--,e.value}return null},LinkedList.prototype.getSize=function(){return this.size},LinkedList.prototype.filter=function(e){var recurse=function(e,t,r){e(t.value)&&r.push(t.value);var n=t.next;null!=n&&recurse(e,n,r)},t=[],r=this.head;return null!=r&&recurse(e,r,t),t},LinkedList.prototype.createHeadIfNeeded=function(e){return null==this.head&&(this.head=new r(e),!0)},LinkedList.prototype.getTailNode=function(){if(null==this.head)return null;for(var e=this.head;null!=e.next;)e=e.next;return e},LinkedList}();t.LinkedList=n;var i=function(){function SimpleMap(){this.array={}}return SimpleMap.prototype.put=function(e,t){this.array[e]=t},SimpleMap.prototype.get=function(e){return this.array[e]},SimpleMap.prototype.exists=function(e){return void 0!==this.array[e]},SimpleMap.prototype.remove=function(e){var t=this.array[e];return void 0!==t&&delete this.array[e],t},SimpleMap.prototype.keys=function(){var e=[];for(var t in this.array)this.array.hasOwnProperty(t)&&e.push(t);return e},SimpleMap.prototype.values=function(){var e=[];for(var t in this.array)this.array.hasOwnProperty(t)&&e.push(this.get(t));return e},SimpleMap.prototype.size=function(){return this.keys().length},SimpleMap.prototype.isEmpty=function(){return 0===this.size()},SimpleMap.prototype.clear=function(){this.array={}},SimpleMap.prototype.forEach=function(e){var t=0;for(var r in this.array){if(this.array.hasOwnProperty(r))e(r,this.array[r],t),t++}},SimpleMap.prototype.forEachValue=function(e){var t=0;for(var r in this.array){if(this.array.hasOwnProperty(r))e(this.array[r],t),t++}},SimpleMap}();t.SimpleMap=i;var o=function(){function TuplePair(e,t){this._x=e,this._y=t}return Object.defineProperty(TuplePair.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e},enumerable:!0,configurable:!0}),Object.defineProperty(TuplePair.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e},enumerable:!0,configurable:!0}),TuplePair}();t.TuplePair=o;var a=function(){function StringBuilder(){this.data=[]}return StringBuilder.prototype.append=function(e){if(void 0===e||null==e)throw new Error("String must be set, cannot append null or undefined");return this.data.push(e),this},StringBuilder.prototype.appendLine=function(e){return this.data.push(e+"\n"),this},StringBuilder.prototype.isEmpty=function(){return 0===this.data.length},StringBuilder.prototype.clear=function(){this.data=[]},StringBuilder.prototype.toString=function(e){return void 0===e&&(e=""),this.data.join(e)},StringBuilder}();t.StringBuilder=a},6071:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3533),a=r(1674),s=function(){function JSONTypeImpl(e){this._value=e}return JSONTypeImpl.prototype.getValue=function(){return this._value},JSONTypeImpl.prototype.toString=function(){var e=this.getValue();return null!=e?e.toString():"null"},JSONTypeImpl}(),c=function(e){function JSONBooleanType(t){return e.call(this,t)||this}return i(JSONBooleanType,e),JSONBooleanType}(s),l=function(e){function JSONNumberType(t){return e.call(this,t)||this}return i(JSONNumberType,e),JSONNumberType}(s),u=function(e){function JSONStringType(t){return e.call(this,t)||this}return i(JSONStringType,e),JSONStringType.prototype.toString=function(){var e=this.getValue();return null!=e?JSON.stringify(e.toString()):"null"},JSONStringType}(s),p=function(e){function JSONObjectType(t){return e.call(this,t)||this}return i(JSONObjectType,e),JSONObjectType}(s),d=function(e){function JSONArrayType(t){return e.call(this,t)||this}return i(JSONArrayType,e),JSONArrayType.prototype.toString=function(){var e=this.getValue();return null!=e?e.toString():"null"},JSONArrayType}(s),h=function(e){function JSONNullType(){return e.call(this,null)||this}return i(JSONNullType,e),JSONNullType.prototype.toString=function(){return"null"},JSONNullType}(s),g=function(){function JSONTypeConverter(){}return JSONTypeConverter.toJSONType=function(e){if(null===e)return new h;if("string"==typeof e)return new u(e);if("number"==typeof e)return new l(e);if("boolean"==typeof e)return new c(e);if(e instanceof y)return new p(e);throw new Error("Type not supported for value: "+e)},JSONTypeConverter}(),y=function(){function JSONObject(){this.values=new a.SimpleMap}return JSONObject.prototype.addBoolean=function(e,t){return this.checkName(e),JSONObject.checkValue(t),this.values.put(e,new c(t)),this},JSONObject.prototype.addNumber=function(e,t){return this.checkName(e),JSONObject.checkValue(t),this.values.put(e,new l(t)),this},JSONObject.prototype.addString=function(e,t){return this.checkName(e),JSONObject.checkValue(t),this.values.put(e,new u(t)),this},JSONObject.prototype.addNull=function(e){return this.checkName(e),this.values.put(e,new h),this},JSONObject.prototype.addArray=function(e,t){if(this.checkName(e),JSONObject.checkValue(t),null==t)throw new Error("Cannot add array as null");return this.values.put(e,new d(t)),this},JSONObject.prototype.addObject=function(e,t){if(this.checkName(e),JSONObject.checkValue(t),null==t)throw new Error("Cannot add object as null");return this.values.put(e,new p(t)),this},JSONObject.prototype.toString=function(e){var t=this;void 0===e&&(e=!1);var r=!1,n=new a.StringBuilder;return n.append("{"),this.values.keys().forEach((function(e){var i=t.values.get(e);null!=i&&(r&&n.append(","),n.append('"').append(e).append('":').append(i.toString()),r=!0)})),n.append("}"),n.toString()},JSONObject.prototype.checkName=function(e){if(null==e||void 0===e)throw new Error("Name is null or undefined");if(this.values.exists(e))throw new Error("Name "+e+" is already present for this object")},JSONObject.checkValue=function(e){if(void 0===e)throw new Error("Value is undefined")},JSONObject}();t.JSONObject=y;var m=function(){function JSONArray(){this.objects=[]}return JSONArray.prototype.add=function(e){if(void 0===e)throw new Error("Object is not allowed to be undefined");return this.objects.push(g.toJSONType(e)),this},JSONArray.prototype.toString=function(e){void 0===e&&(e=!1);var t=new a.StringBuilder;return t.append("["),this.objects.forEach((function(e,r){r>0&&t.append(","),t.append(e.toString())})),t.append("]"),t.toString()},JSONArray}();t.JSONArray=m;var v=function(){function JSONHelper(){}return JSONHelper.categoryToJSON=function(e,t){var r=new m;JSONHelper._categoryToJSON(e,r,t);var n=new y;return n.addArray("categories",r),n},JSONHelper._categoryToJSON=function(e,t,r){var n=new y;n.addNumber("id",e.id),n.addString("name",e.name),n.addString("logLevel",o.LogLevel[e.logLevel].toString()),null!=e.parent?n.addNumber("parent",e.parent.id):n.addNull("parent"),t.add(n),r&&e.children.forEach((function(e){JSONHelper._categoryToJSON(e,t,r)}))},JSONHelper}();t.JSONHelper=v},9014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(401),i=r(3533),o=function(){function MessageFormatUtils(){}return MessageFormatUtils.renderDate=function(e,t){var lpad=function(e,t,r){var n=t-e.length;if(n>0){for(var i="",o=0;o<n;o++)i+=r;return i+=e}return e},fullYear=function(e){return lpad(e.getFullYear().toString(),4,"0")},month=function(e){return lpad((e.getMonth()+1).toString(),2,"0")},day=function(e){return lpad(e.getDate().toString(),2,"0")},hours=function(e){return lpad(e.getHours().toString(),2,"0")},minutes=function(e){return lpad(e.getMinutes().toString(),2,"0")},seconds=function(e){return lpad(e.getSeconds().toString(),2,"0")},millis=function(e){return lpad(e.getMilliseconds().toString(),3,"0")},r=t.dateSeparator,n="";switch(t.formatEnum){case i.DateFormatEnum.Default:n=fullYear(e)+r+month(e)+r+day(e)+" "+hours(e)+":"+minutes(e)+":"+seconds(e)+","+millis(e);break;case i.DateFormatEnum.YearMonthDayTime:n=fullYear(e)+r+month(e)+r+day(e)+" "+hours(e)+":"+minutes(e)+":"+seconds(e);break;case i.DateFormatEnum.YearDayMonthWithFullTime:n=fullYear(e)+r+day(e)+r+month(e)+" "+hours(e)+":"+minutes(e)+":"+seconds(e)+","+millis(e);break;case i.DateFormatEnum.YearDayMonthTime:n=fullYear(e)+r+day(e)+r+month(e)+" "+hours(e)+":"+minutes(e)+":"+seconds(e);break;default:throw new Error("Unsupported date format enum: "+t.formatEnum)}return n},MessageFormatUtils.renderDefaultMessage=function(e,t){var r="",n=e.logFormat;n.showTimeStamp&&(r+=MessageFormatUtils.renderDate(e.date,n.dateFormat)+" "),r+=i.LogLevel[e.level].toUpperCase(),e.isResolvedErrorMessage&&(r+=" (resolved)"),r+=" ",n.showCategoryName&&(r+="[",e.categories.forEach((function(e,t){t>0&&(r+=", "),r+=e.name})),r+="]");var o="",a="",s=e.message;if("string"==typeof s)o=s;else{var c=s;o=c.msg,c.data&&(a=" [data]: "+(c.ds?c.ds(c.data):JSON.stringify(c.data)))}return r+=" "+o+a,t&&null!==e.errorAsStack&&(r+="\n"+e.errorAsStack),r},MessageFormatUtils.renderDefaultLog4jMessage=function(e,t){var r=e.logGroupRule.logFormat,n="";r.showTimeStamp&&(n+=MessageFormatUtils.renderDate(e.date,r.dateFormat)+" "),n+=i.LogLevel[e.level].toUpperCase()+" ",r.showLoggerName&&(n+="["+e.loggerName+"]");var o="",a="";if("string"==typeof e.message)o=e.message;else{var s=e.message;o=s.msg,s.data&&(a=" [data]: "+(s.ds?s.ds(s.data):JSON.stringify(s.data)))}return n+=" "+o+a,t&&null!==e.errorAsStack&&(n+="\n"+e.errorAsStack),n},MessageFormatUtils.renderError=function(e){var t=e.name+": "+e.message+"\n@";return new Promise((function(r){n.fromError(e,{offline:!0}).then((function(e){var n=e.map((function(e){return e.toString()})).join("\n ");r(t+="\n"+n)})).catch((function(){t="Unexpected error object was passed in. ";try{t+="Could not resolve it, stringified object: "+JSON.stringify(e)}catch(e){t+="Could not resolve it or stringify it."}r(t)}))}))},MessageFormatUtils}();t.MessageFormatUtils=o},1614:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{NIL:()=>_,parse:()=>y,stringify:()=>l,v1:()=>g,v3:()=>v,v4:()=>w,v5:()=>C,validate:()=>a,version:()=>S});var i=new Uint8Array(16);function rng(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function validate(e){return"string"==typeof e&&o.test(e)};for(var s=[],c=0;c<256;++c)s.push((c+256).toString(16).substr(1));const l=function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var u,p,d=0,h=0;const g=function v1(e,t,r){var n=t&&r||0,i=t||new Array(16),o=(e=e||{}).node||u,a=void 0!==e.clockseq?e.clockseq:p;if(null==o||null==a){var s=e.random||(e.rng||rng)();null==o&&(o=u=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=p=16383&(s[6]<<8|s[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),g=void 0!==e.nsecs?e.nsecs:h+1,y=c-d+(g-h)/1e4;if(y<0&&void 0===e.clockseq&&(a=a+1&16383),(y<0||c>d)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=c,h=g,p=a;var m=(1e4*(268435455&(c+=122192928e5))+g)%4294967296;i[n++]=m>>>24&255,i[n++]=m>>>16&255,i[n++]=m>>>8&255,i[n++]=255&m;var v=c/4294967296*1e4&268435455;i[n++]=v>>>8&255,i[n++]=255&v,i[n++]=v>>>24&15|16,i[n++]=v>>>16&255,i[n++]=a>>>8|128,i[n++]=255&a;for(var w=0;w<6;++w)i[n+w]=o[w];return t||l(i)};const y=function parse(e){if(!a(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function v35(e,t,r){function generateUUID(e,n,i,o){if("string"==typeof e&&(e=function stringToBytes(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=y(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),(a=r(a))[6]=15&a[6]|t,a[8]=63&a[8]|128,i){o=o||0;for(var s=0;s<16;++s)i[o+s]=a[s];return i}return l(a)}try{generateUUID.name=e}catch(e){}return generateUUID.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",generateUUID.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",generateUUID}function getOutputLength(e){return 14+(e+64>>>9<<4)+1}function safeAdd(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function md5cmn(e,t,r,n,i,o){return safeAdd(function bitRotateLeft(e,t){return e<<t|e>>>32-t}(safeAdd(safeAdd(t,e),safeAdd(n,o)),i),r)}function md5ff(e,t,r,n,i,o,a){return md5cmn(t&r|~t&n,e,t,i,o,a)}function md5gg(e,t,r,n,i,o,a){return md5cmn(t&n|r&~n,e,t,i,o,a)}function md5hh(e,t,r,n,i,o,a){return md5cmn(t^r^n,e,t,i,o,a)}function md5ii(e,t,r,n,i,o,a){return md5cmn(r^(t|~n),e,t,i,o,a)}const m=function md5(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function md5ToHexEncodedArray(e){for(var t=[],r=32*e.length,n="0123456789abcdef",i=0;i<r;i+=8){var o=e[i>>5]>>>i%32&255,a=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);t.push(a)}return t}(function wordsToMd5(e,t){e[t>>5]|=128<<t%32,e[getOutputLength(t)-1]=t;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,a=0;a<e.length;a+=16){var s=r,c=n,l=i,u=o;r=md5ff(r,n,i,o,e[a],7,-680876936),o=md5ff(o,r,n,i,e[a+1],12,-389564586),i=md5ff(i,o,r,n,e[a+2],17,606105819),n=md5ff(n,i,o,r,e[a+3],22,-1044525330),r=md5ff(r,n,i,o,e[a+4],7,-176418897),o=md5ff(o,r,n,i,e[a+5],12,1200080426),i=md5ff(i,o,r,n,e[a+6],17,-1473231341),n=md5ff(n,i,o,r,e[a+7],22,-45705983),r=md5ff(r,n,i,o,e[a+8],7,1770035416),o=md5ff(o,r,n,i,e[a+9],12,-1958414417),i=md5ff(i,o,r,n,e[a+10],17,-42063),n=md5ff(n,i,o,r,e[a+11],22,-1990404162),r=md5ff(r,n,i,o,e[a+12],7,1804603682),o=md5ff(o,r,n,i,e[a+13],12,-40341101),i=md5ff(i,o,r,n,e[a+14],17,-1502002290),r=md5gg(r,n=md5ff(n,i,o,r,e[a+15],22,1236535329),i,o,e[a+1],5,-165796510),o=md5gg(o,r,n,i,e[a+6],9,-1069501632),i=md5gg(i,o,r,n,e[a+11],14,643717713),n=md5gg(n,i,o,r,e[a],20,-373897302),r=md5gg(r,n,i,o,e[a+5],5,-701558691),o=md5gg(o,r,n,i,e[a+10],9,38016083),i=md5gg(i,o,r,n,e[a+15],14,-660478335),n=md5gg(n,i,o,r,e[a+4],20,-405537848),r=md5gg(r,n,i,o,e[a+9],5,568446438),o=md5gg(o,r,n,i,e[a+14],9,-1019803690),i=md5gg(i,o,r,n,e[a+3],14,-187363961),n=md5gg(n,i,o,r,e[a+8],20,1163531501),r=md5gg(r,n,i,o,e[a+13],5,-1444681467),o=md5gg(o,r,n,i,e[a+2],9,-51403784),i=md5gg(i,o,r,n,e[a+7],14,1735328473),r=md5hh(r,n=md5gg(n,i,o,r,e[a+12],20,-1926607734),i,o,e[a+5],4,-378558),o=md5hh(o,r,n,i,e[a+8],11,-2022574463),i=md5hh(i,o,r,n,e[a+11],16,1839030562),n=md5hh(n,i,o,r,e[a+14],23,-35309556),r=md5hh(r,n,i,o,e[a+1],4,-1530992060),o=md5hh(o,r,n,i,e[a+4],11,1272893353),i=md5hh(i,o,r,n,e[a+7],16,-155497632),n=md5hh(n,i,o,r,e[a+10],23,-1094730640),r=md5hh(r,n,i,o,e[a+13],4,681279174),o=md5hh(o,r,n,i,e[a],11,-358537222),i=md5hh(i,o,r,n,e[a+3],16,-722521979),n=md5hh(n,i,o,r,e[a+6],23,76029189),r=md5hh(r,n,i,o,e[a+9],4,-640364487),o=md5hh(o,r,n,i,e[a+12],11,-421815835),i=md5hh(i,o,r,n,e[a+15],16,530742520),r=md5ii(r,n=md5hh(n,i,o,r,e[a+2],23,-995338651),i,o,e[a],6,-198630844),o=md5ii(o,r,n,i,e[a+7],10,1126891415),i=md5ii(i,o,r,n,e[a+14],15,-1416354905),n=md5ii(n,i,o,r,e[a+5],21,-57434055),r=md5ii(r,n,i,o,e[a+12],6,1700485571),o=md5ii(o,r,n,i,e[a+3],10,-1894986606),i=md5ii(i,o,r,n,e[a+10],15,-1051523),n=md5ii(n,i,o,r,e[a+1],21,-2054922799),r=md5ii(r,n,i,o,e[a+8],6,1873313359),o=md5ii(o,r,n,i,e[a+15],10,-30611744),i=md5ii(i,o,r,n,e[a+6],15,-1560198380),n=md5ii(n,i,o,r,e[a+13],21,1309151649),r=md5ii(r,n,i,o,e[a+4],6,-145523070),o=md5ii(o,r,n,i,e[a+11],10,-1120210379),i=md5ii(i,o,r,n,e[a+2],15,718787259),n=md5ii(n,i,o,r,e[a+9],21,-343485551),r=safeAdd(r,s),n=safeAdd(n,c),i=safeAdd(i,l),o=safeAdd(o,u)}return[r,n,i,o]}(function bytesToWords(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(getOutputLength(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))};const v=v35("v3",48,m);const w=function v4(e,t,r){var n=(e=e||{}).random||(e.rng||rng)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return l(n)};function f(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function ROTL(e,t){return e<<t|e>>>32-t}const b=function sha1(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i<n.length;++i)e.push(n.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var o=e.length/4+2,a=Math.ceil(o/16),s=new Array(a),c=0;c<a;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=e[64*c+4*u]<<24|e[64*c+4*u+1]<<16|e[64*c+4*u+2]<<8|e[64*c+4*u+3];s[c]=l}s[a-1][14]=8*(e.length-1)/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=8*(e.length-1)&4294967295;for(var p=0;p<a;++p){for(var d=new Uint32Array(80),h=0;h<16;++h)d[h]=s[p][h];for(var g=16;g<80;++g)d[g]=ROTL(d[g-3]^d[g-8]^d[g-14]^d[g-16],1);for(var y=r[0],m=r[1],v=r[2],w=r[3],b=r[4],C=0;C<80;++C){var _=Math.floor(C/20),S=ROTL(y,5)+f(_,m,v,w)+b+t[_]+d[C]>>>0;b=w,w=v,v=ROTL(m,30)>>>0,m=y,y=S}r[0]=r[0]+y>>>0,r[1]=r[1]+m>>>0,r[2]=r[2]+v>>>0,r[3]=r[3]+w>>>0,r[4]=r[4]+b>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};const C=v35("v5",80,b),_="00000000-0000-0000-0000-000000000000";const S=function version(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},2890:e=>{"use strict";e.exports=NMSHDCrypto},194:e=>{"use strict";e.exports=TSServal},4654:()=>{},4901:(e,t,r)=>{"use strict";r.r(t),r.d(t,{JsonPatchError:()=>c,_areEquals:()=>_areEquals,applyOperation:()=>applyOperation,applyPatch:()=>applyPatch,applyReducer:()=>applyReducer,compare:()=>compare,deepClone:()=>_deepClone,default:()=>m,escapePathComponent:()=>escapePathComponent,generate:()=>generate,getValueByPointer:()=>getValueByPointer,observe:()=>observe,unescapePathComponent:()=>unescapePathComponent,unobserve:()=>unobserve,validate:()=>validate,validator:()=>validator});var n={};r.r(n),r.d(n,{JsonPatchError:()=>l,_areEquals:()=>_areEquals,applyOperation:()=>applyOperation,applyPatch:()=>applyPatch,applyReducer:()=>applyReducer,deepClone:()=>u,getValueByPointer:()=>getValueByPointer,validate:()=>validate,validator:()=>validator});var i={};r.r(i),r.d(i,{compare:()=>compare,generate:()=>generate,observe:()=>observe,unobserve:()=>unobserve});var o,a=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},o(e,t)},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),s=Object.prototype.hasOwnProperty;function helpers_hasOwnProperty(e,t){return s.call(e,t)}function _objectKeys(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);t=[];for(var n in e)helpers_hasOwnProperty(e,n)&&t.push(n);return t}function _deepClone(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function isInteger(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function escapePathComponent(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapePathComponent(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function hasUndefined(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(hasUndefined(e[t]))return!0}else if("object"==typeof e){var n=_objectKeys(e),i=n.length;for(t=0;t<i;t++)if(hasUndefined(e[n[t]]))return!0}return!1}function patchErrorMessageFormatter(e,t){var r=[e];for(var n in t){var i="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==i&&r.push(n+": "+i)}return r.join("\n")}var c=function(e){function PatchError(t,r,n,i,o){var a=this.constructor,s=e.call(this,patchErrorMessageFormatter(t,{name:r,index:n,operation:i,tree:o}))||this;return s.name=r,s.index=n,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=patchErrorMessageFormatter(t,{name:r,index:n,operation:i,tree:o}),s}return a(PatchError,e),PatchError}(Error),l=c,u=_deepClone,p={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=getValueByPointer(r,this.path);n&&(n=_deepClone(n));var i=applyOperation(r,{op:"remove",path:this.from}).removed;return applyOperation(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=getValueByPointer(r,this.from);return applyOperation(r,{op:"add",path:this.path,value:_deepClone(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:_areEquals(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},d={add:function(e,t,r){return isInteger(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:p.move,copy:p.copy,test:p.test,_get:p._get};function getValueByPointer(e,t){if(""==t)return e;var r={op:"_get",path:t};return applyOperation(e,r),r.value}function applyOperation(e,t,r,n,i,o){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=0),r&&("function"==typeof r?r(t,0,e,t.path):validator(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=getValueByPointer(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=_areEquals(e,t.value),!1===a.test)throw new l("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(r)throw new l("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}n||(e=_deepClone(e));var s=(t.path||"").split("/"),c=e,u=1,h=s.length,g=void 0,y=void 0,m=void 0;for(m="function"==typeof r?r:validator;;){if((y=s[u])&&-1!=y.indexOf("~")&&(y=unescapePathComponent(y)),i&&"__proto__"==y)throw new TypeError("JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===g&&(void 0===c[y]?g=s.slice(0,u).join("/"):u==h-1&&(g=t.path),void 0!==g&&m(t,0,e,g)),u++,Array.isArray(c)){if("-"===y)y=c.length;else{if(r&&!isInteger(y))throw new l("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);isInteger(y)&&(y=~~y)}if(u>=h){if(r&&"add"===t.op&&y>c.length)throw new l("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=d[t.op].call(t,c,y,e)).test)throw new l("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(u>=h){if(!1===(a=p[t.op].call(t,c,y,e)).test)throw new l("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(c=c[y],r&&u<h&&(!c||"object"!=typeof c))throw new l("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}function applyPatch(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!0),r&&!Array.isArray(t))throw new l("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=_deepClone(e));for(var o=new Array(t.length),a=0,s=t.length;a<s;a++)o[a]=applyOperation(e,t[a],r,!0,i,a),e=o[a].newDocument;return o.newDocument=e,o}function applyReducer(e,t,r){var n=applyOperation(e,t);if(!1===n.test)throw new l("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function validator(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new l("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!p[e.op])throw new l("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new l("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new l('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new l("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new l("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&hasUndefined(e.value))throw new l("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,o=n.split("/").length;if(i!==o+1&&i!==o)throw new l("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new l("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var a=validate([{op:"_get",path:e.from,value:void 0}],r);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new l("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function validate(e,t,r){try{if(!Array.isArray(e))throw new l("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)applyPatch(_deepClone(t),_deepClone(e),r||!0);else{r=r||validator;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof l)return e;throw e}}function _areEquals(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,i,o=Array.isArray(e),a=Array.isArray(t);if(o&&a){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!_areEquals(e[r],t[r]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(e);if((n=s.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(s[r]))return!1;for(r=n;0!=r--;)if(!_areEquals(e[i=s[r]],t[i]))return!1;return!0}return e!=e&&t!=t}var h=new WeakMap,g=function g(e){this.observers=new Map,this.obj=e},y=function y(e,t){this.callback=e,this.observer=t};function unobserve(e,t){t.unobserve()}function observe(e,t){var r,n=function getMirror(e){return h.get(e)}(e);if(n){var i=function getObserverFromMirror(e,t){return e.observers.get(t)}(n,t);r=i&&i.observer}else n=new g(e),h.set(e,n);if(r)return r;if(r={},n.value=_deepClone(e),t){r.callback=t,r.next=null;var dirtyCheck=function(){generate(r)},fastCheck=function(){clearTimeout(r.next),r.next=setTimeout(dirtyCheck)};"undefined"!=typeof window&&(window.addEventListener("mouseup",fastCheck),window.addEventListener("keyup",fastCheck),window.addEventListener("mousedown",fastCheck),window.addEventListener("keydown",fastCheck),window.addEventListener("change",fastCheck))}return r.patches=[],r.object=e,r.unobserve=function(){generate(r),clearTimeout(r.next),function removeObserverFromMirror(e,t){e.observers.delete(t.callback)}(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",fastCheck),window.removeEventListener("keyup",fastCheck),window.removeEventListener("mousedown",fastCheck),window.removeEventListener("keydown",fastCheck),window.removeEventListener("change",fastCheck))},n.observers.set(t,new y(t,r)),r}function generate(e,t){void 0===t&&(t=!1);var r=h.get(e.object);_generate(r.value,e.object,e.patches,"",t),e.patches.length&&applyPatch(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function _generate(e,t,r,n,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=_objectKeys(t),a=_objectKeys(e),s=!1,c=a.length-1;c>=0;c--){var l=e[p=a[c]];if(!helpers_hasOwnProperty(t,p)||void 0===t[p]&&void 0!==l&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&r.push({op:"test",path:n+"/"+escapePathComponent(p),value:_deepClone(l)}),r.push({op:"remove",path:n+"/"+escapePathComponent(p)}),s=!0):(i&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),!0);else{var u=t[p];"object"==typeof l&&null!=l&&"object"==typeof u&&null!=u&&Array.isArray(l)===Array.isArray(u)?_generate(l,u,r,n+"/"+escapePathComponent(p),i):l!==u&&(!0,i&&r.push({op:"test",path:n+"/"+escapePathComponent(p),value:_deepClone(l)}),r.push({op:"replace",path:n+"/"+escapePathComponent(p),value:_deepClone(u)}))}}if(s||o.length!=a.length)for(c=0;c<o.length;c++){var p;helpers_hasOwnProperty(e,p=o[c])||void 0===t[p]||r.push({op:"add",path:n+"/"+escapePathComponent(p),value:_deepClone(t[p])})}}}function compare(e,t,r){void 0===r&&(r=!1);var n=[];return _generate(e,t,n,"",r),n}const m=Object.assign({},n,i,{JsonPatchError:c,deepClone:_deepClone,escapePathComponent,unescapePathComponent})}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r=__webpack_require__(5590);NMSHDTransport=r})();
|
|
3
3
|
//# sourceMappingURL=nmshd.transport.min.js.map
|