@medplum/core 2.0.14 → 2.0.16

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.
Files changed (61) hide show
  1. package/dist/cjs/index.cjs +1244 -1101
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/index.min.cjs +1 -1
  4. package/dist/esm/base64.mjs +33 -0
  5. package/dist/esm/base64.mjs.map +1 -0
  6. package/dist/esm/cache.mjs +17 -23
  7. package/dist/esm/cache.mjs.map +1 -1
  8. package/dist/esm/client.mjs +500 -413
  9. package/dist/esm/client.mjs.map +1 -1
  10. package/dist/esm/eventtarget.mjs +6 -11
  11. package/dist/esm/eventtarget.mjs.map +1 -1
  12. package/dist/esm/fhirlexer/parse.mjs +15 -23
  13. package/dist/esm/fhirlexer/parse.mjs.map +1 -1
  14. package/dist/esm/fhirlexer/tokenize.mjs +190 -180
  15. package/dist/esm/fhirlexer/tokenize.mjs.map +1 -1
  16. package/dist/esm/fhirmapper/parse.mjs +264 -252
  17. package/dist/esm/fhirmapper/parse.mjs.map +1 -1
  18. package/dist/esm/fhirmapper/tokenize.mjs +0 -1
  19. package/dist/esm/fhirmapper/tokenize.mjs.map +1 -1
  20. package/dist/esm/fhirpath/atoms.mjs +0 -1
  21. package/dist/esm/fhirpath/atoms.mjs.map +1 -1
  22. package/dist/esm/fhirpath/parse.mjs +0 -1
  23. package/dist/esm/fhirpath/parse.mjs.map +1 -1
  24. package/dist/esm/fhirpath/tokenize.mjs +0 -1
  25. package/dist/esm/fhirpath/tokenize.mjs.map +1 -1
  26. package/dist/esm/filter/parse.mjs +0 -2
  27. package/dist/esm/filter/parse.mjs.map +1 -1
  28. package/dist/esm/filter/tokenize.mjs +0 -1
  29. package/dist/esm/filter/tokenize.mjs.map +1 -1
  30. package/dist/esm/format.mjs +24 -15
  31. package/dist/esm/format.mjs.map +1 -1
  32. package/dist/esm/index.min.mjs +1 -1
  33. package/dist/esm/index.mjs +2 -2
  34. package/dist/esm/jwt.mjs +2 -9
  35. package/dist/esm/jwt.mjs.map +1 -1
  36. package/dist/esm/outcomes.mjs +15 -1
  37. package/dist/esm/outcomes.mjs.map +1 -1
  38. package/dist/esm/readablepromise.mjs +18 -23
  39. package/dist/esm/readablepromise.mjs.map +1 -1
  40. package/dist/esm/schema.mjs +146 -123
  41. package/dist/esm/schema.mjs.map +1 -1
  42. package/dist/esm/search/match.mjs +0 -2
  43. package/dist/esm/search/match.mjs.map +1 -1
  44. package/dist/esm/search/search.mjs +15 -9
  45. package/dist/esm/search/search.mjs.map +1 -1
  46. package/dist/esm/storage.mjs +13 -19
  47. package/dist/esm/storage.mjs.map +1 -1
  48. package/dist/types/base64.d.ts +14 -0
  49. package/dist/types/cache.d.ts +3 -1
  50. package/dist/types/client.d.ts +153 -1
  51. package/dist/types/eventtarget.d.ts +1 -1
  52. package/dist/types/fhirlexer/parse.d.ts +5 -2
  53. package/dist/types/fhirlexer/tokenize.d.ts +28 -1
  54. package/dist/types/format.d.ts +3 -1
  55. package/dist/types/outcomes.d.ts +1 -0
  56. package/dist/types/readablepromise.d.ts +4 -1
  57. package/dist/types/schema.d.ts +33 -1
  58. package/dist/types/storage.d.ts +2 -2
  59. package/package.json +1 -1
  60. package/dist/esm/node_modules/tslib/tslib.es6.mjs +0 -30
  61. package/dist/esm/node_modules/tslib/tslib.es6.mjs.map +0 -1
@@ -315,6 +315,33 @@ export interface MailOptions {
315
315
  /** An array of attachment objects */
316
316
  readonly attachments?: MailAttachment[];
317
317
  }
318
+ /**
319
+ * OAuth 2.0 Grant Type Identifiers
320
+ * Standard identifiers defined here: https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-07#name-grant-types
321
+ * Token exchange extension defined here: https://datatracker.ietf.org/doc/html/rfc8693
322
+ */
323
+ export declare enum OAuthGrantType {
324
+ ClientCredentials = "client_credentials",
325
+ AuthorizationCode = "authorization_code",
326
+ RefreshToken = "refresh_token",
327
+ TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange"
328
+ }
329
+ /**
330
+ * OAuth 2.0 Token Type Identifiers
331
+ * See: https://datatracker.ietf.org/doc/html/rfc8693#name-token-type-identifiers
332
+ */
333
+ export declare enum OAuthTokenType {
334
+ /** Indicates that the token is an OAuth 2.0 access token issued by the given authorization server. */
335
+ AccessToken = "urn:ietf:params:oauth:token-type:access_token",
336
+ /** Indicates that the token is an OAuth 2.0 refresh token issued by the given authorization server. */
337
+ RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token",
338
+ /** Indicates that the token is an ID Token as defined in Section 2 of [OpenID.Core]. */
339
+ IdToken = "urn:ietf:params:oauth:token-type:id_token",
340
+ /** Indicates that the token is a base64url-encoded SAML 1.1 [OASIS.saml-core-1.1] assertion. */
341
+ Saml1Token = "urn:ietf:params:oauth:token-type:saml1",
342
+ /** Indicates that the token is a base64url-encoded SAML 2.0 [OASIS.saml-core-2.0-os] assertion. */
343
+ Saml2Token = "urn:ietf:params:oauth:token-type:saml2"
344
+ }
318
345
  /**
319
346
  * The MedplumClient class provides a client for the Medplum FHIR server.
320
347
  *
@@ -368,7 +395,29 @@ export interface MailOptions {
368
395
 
369
396
  */
370
397
  export declare class MedplumClient extends EventTarget {
371
- #private;
398
+ private readonly fetch;
399
+ private readonly createPdfImpl?;
400
+ private readonly storage;
401
+ private readonly requestCache;
402
+ private readonly cacheTime;
403
+ private readonly baseUrl;
404
+ private readonly fhirBaseUrl;
405
+ private readonly authorizeUrl;
406
+ private readonly tokenUrl;
407
+ private readonly logoutUrl;
408
+ private readonly onUnauthenticated?;
409
+ private readonly autoBatchTime;
410
+ private readonly autoBatchQueue;
411
+ private clientId?;
412
+ private clientSecret?;
413
+ private autoBatchTimerId?;
414
+ private accessToken?;
415
+ private refreshToken?;
416
+ private refreshPromise?;
417
+ private profilePromise?;
418
+ private profile?;
419
+ private config?;
420
+ private basicAuth?;
372
421
  constructor(options?: MedplumClientOptions);
373
422
  /**
374
423
  * Returns the current base URL for all API requests.
@@ -1252,6 +1301,8 @@ export declare class MedplumClient extends EventTarget {
1252
1301
  * @category Authentication
1253
1302
  */
1254
1303
  getLogins(): LoginState[];
1304
+ private addLogin;
1305
+ private refreshProfile;
1255
1306
  /**
1256
1307
  * @category Authentication
1257
1308
  */
@@ -1276,6 +1327,71 @@ export declare class MedplumClient extends EventTarget {
1276
1327
  * @returns Promise to the response body as a blob.
1277
1328
  */
1278
1329
  download(url: URL | string, options?: RequestInit): Promise<Blob>;
1330
+ /**
1331
+ * Returns the cache entry if available and not expired.
1332
+ * @param key The cache key to retrieve.
1333
+ * @param options Optional fetch options for cache settings.
1334
+ * @returns The cached entry if found.
1335
+ */
1336
+ private getCacheEntry;
1337
+ /**
1338
+ * Adds a readable promise to the cache.
1339
+ * @param key The cache key to store.
1340
+ * @param value The readable promise to store.
1341
+ */
1342
+ private setCacheEntry;
1343
+ /**
1344
+ * Adds a concrete value as the cache entry for the given resource.
1345
+ * This is used in cases where the resource is loaded indirectly.
1346
+ * For example, when a resource is loaded as part of a Bundle.
1347
+ * @param resource The resource to cache.
1348
+ */
1349
+ private cacheResource;
1350
+ /**
1351
+ * Deletes a cache entry.
1352
+ * @param key The cache key to delete.
1353
+ */
1354
+ private deleteCacheEntry;
1355
+ /**
1356
+ * Makes an HTTP request.
1357
+ * @param {string} method
1358
+ * @param {string} url
1359
+ * @param {string=} contentType
1360
+ * @param {Object=} body
1361
+ */
1362
+ private request;
1363
+ private fetchWithRetry;
1364
+ /**
1365
+ * Executes a batch of requests that were automatically batched together.
1366
+ */
1367
+ private executeAutoBatch;
1368
+ /**
1369
+ * Adds default options to the fetch options.
1370
+ * @param options The options to add defaults to.
1371
+ */
1372
+ private addFetchOptionsDefaults;
1373
+ /**
1374
+ * Sets the "Content-Type" header on fetch options.
1375
+ * @param options The fetch options.
1376
+ * @param contentType The new content type to set.
1377
+ */
1378
+ private setRequestContentType;
1379
+ /**
1380
+ * Sets the body on fetch options.
1381
+ * @param options The fetch options.
1382
+ * @param data The new content body.
1383
+ */
1384
+ private setRequestBody;
1385
+ /**
1386
+ * Handles an unauthenticated response from the server.
1387
+ * First, tries to refresh the access token and retry the request.
1388
+ * Otherwise, calls unauthenticated callbacks and rejects.
1389
+ * @param method The HTTP method of the original request.
1390
+ * @param url The URL of the original request.
1391
+ * @param contentType The content type of the original request.
1392
+ * @param body The body of the original request.
1393
+ */
1394
+ private handleUnauthenticated;
1279
1395
  /**
1280
1396
  * Starts a new PKCE flow.
1281
1397
  * These PKCE values are stateful, and must survive redirects and page refreshes.
@@ -1285,6 +1401,12 @@ export declare class MedplumClient extends EventTarget {
1285
1401
  codeChallengeMethod: string;
1286
1402
  codeChallenge: string;
1287
1403
  }>;
1404
+ /**
1405
+ * Redirects the user to the login screen for authorization.
1406
+ * Clears all auth state including local storage and session storage.
1407
+ * See: https://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint
1408
+ */
1409
+ private requestAuthorization;
1288
1410
  /**
1289
1411
  * Processes an OAuth authorization code.
1290
1412
  * See: https://openid.net/specs/openid-connect-core-1_0.html#TokenRequest
@@ -1293,6 +1415,11 @@ export declare class MedplumClient extends EventTarget {
1293
1415
  * @category Authentication
1294
1416
  */
1295
1417
  processCode(code: string, loginParams?: Partial<BaseLoginRequest>): Promise<ProfileResource>;
1418
+ /**
1419
+ * Tries to refresh the auth tokens.
1420
+ * See: https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokens
1421
+ */
1422
+ private refresh;
1296
1423
  /**
1297
1424
  * Starts a new OAuth2 client credentials flow.
1298
1425
  * See: https://datatracker.ietf.org/doc/html/rfc6749#section-4.4
@@ -1302,6 +1429,13 @@ export declare class MedplumClient extends EventTarget {
1302
1429
  * @returns Promise that resolves to the client profile.
1303
1430
  */
1304
1431
  startClientLogin(clientId: string, clientSecret: string): Promise<ProfileResource>;
1432
+ /**
1433
+ * Sets the client ID and secret for basic auth.
1434
+ * @category Authentication
1435
+ * @param clientId The client ID.
1436
+ * @param clientSecret The client secret.
1437
+ */
1438
+ setBasicAuth(clientId: string, clientSecret: string): void;
1305
1439
  /**
1306
1440
  * Invite a user to a project.
1307
1441
  * @param projectId The project ID.
@@ -1309,4 +1443,22 @@ export declare class MedplumClient extends EventTarget {
1309
1443
  * @returns Promise that returns an invite result or an operation outcome.
1310
1444
  */
1311
1445
  invite(projectId: string, body: InviteBody): Promise<InviteResult | OperationOutcome>;
1446
+ /**
1447
+ * Makes a POST request to the tokens endpoint.
1448
+ * See: https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
1449
+ * @param formBody Token parameters in URL encoded format.
1450
+ */
1451
+ private fetchTokens;
1452
+ /**
1453
+ * Verifies the tokens received from the auth server.
1454
+ * Validates the JWT against the JWKS.
1455
+ * See: https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
1456
+ * @param tokens
1457
+ */
1458
+ private verifyTokens;
1459
+ /**
1460
+ * Sets up a listener for window storage events.
1461
+ * This synchronizes state across browser windows and browser tabs.
1462
+ */
1463
+ private setupStorageListener;
1312
1464
  }
@@ -4,7 +4,7 @@ interface Event {
4
4
  }
5
5
  type EventListener = (e: Event) => void;
6
6
  export declare class EventTarget {
7
- #private;
7
+ private readonly listeners;
8
8
  constructor();
9
9
  addEventListener(type: string, callback: EventListener): void;
10
10
  removeEventListeneer(type: string, callback: EventListener): void;
@@ -26,7 +26,8 @@ export interface InfixParselet {
26
26
  parse?(parser: Parser, left: Atom, token: Token): Atom;
27
27
  }
28
28
  export declare class ParserBuilder {
29
- #private;
29
+ private readonly prefixParselets;
30
+ private readonly infixParselets;
30
31
  registerInfix(tokenType: string, parselet: InfixParselet): ParserBuilder;
31
32
  registerPrefix(tokenType: string, parselet: PrefixParselet): ParserBuilder;
32
33
  prefix(tokenType: string, precedence: number, builder: (token: Token, right: Atom) => Atom): ParserBuilder;
@@ -34,7 +35,9 @@ export declare class ParserBuilder {
34
35
  construct(input: Token[]): Parser;
35
36
  }
36
37
  export declare class Parser {
37
- #private;
38
+ private tokens;
39
+ private prefixParselets;
40
+ private infixParselets;
38
41
  constructor(tokens: Token[], prefixParselets: Record<string, PrefixParselet>, infixParselets: Record<string, InfixParselet>);
39
42
  hasMore(): boolean;
40
43
  match(expected: string): boolean;
@@ -12,7 +12,34 @@ export interface TokenizerOptions {
12
12
  symbolRegex?: RegExp;
13
13
  }
14
14
  export declare class Tokenizer {
15
- #private;
15
+ private readonly str;
16
+ private readonly keywords;
17
+ private readonly operators;
18
+ private readonly dateTimeLiterals;
19
+ private readonly symbolRegex;
20
+ private readonly result;
21
+ private readonly pos;
22
+ private readonly markStack;
16
23
  constructor(str: string, keywords: string[], operators: string[], options?: TokenizerOptions);
17
24
  tokenize(): Token[];
25
+ private prevToken;
26
+ private peekToken;
27
+ private consumeToken;
28
+ private consumeWhitespace;
29
+ private consumeMultiLineComment;
30
+ private consumeSingleLineComment;
31
+ private consumeString;
32
+ private consumeBacktickSymbol;
33
+ private consumeDateTime;
34
+ private consumeNumber;
35
+ private consumeSymbol;
36
+ private consumeOperator;
37
+ private consumeWhile;
38
+ private curr;
39
+ private prev;
40
+ private peek;
41
+ private mark;
42
+ private reset;
43
+ private advance;
44
+ private buildToken;
18
45
  }
@@ -85,8 +85,9 @@ export declare function formatPeriod(period: Period | undefined, locales?: Intl.
85
85
  */
86
86
  export declare function formatTiming(timing: Timing | undefined): string;
87
87
  /**
88
- * Returns a human-readable string for a FHIR Range datatype, taking into account comparators and one-sided ranges
88
+ * Returns a human-readable string for a FHIR Range datatype, taking into account one-sided ranges
89
89
  * @param range A FHIR Range element
90
+ * @param precision Number of decimal places to display in the rendered quantity values
90
91
  * @param exclusive If true, one-sided ranges will be rendered with the '>' or '<' bounds rather than '>=' or '<='
91
92
  * @returns A human-readable string representation of the Range
92
93
  */
@@ -94,6 +95,7 @@ export declare function formatRange(range: Range | undefined, precision?: number
94
95
  /**
95
96
  * Returns a human-readable string for a FHIR Quantity datatype, taking into account units and comparators
96
97
  * @param quantity A FHIR Quantity element
98
+ * @param precision Number of decimal places to display in the rendered quantity values
97
99
  * @returns A human-readable string representation of the Quantity
98
100
  */
99
101
  export declare function formatQuantity(quantity: Quantity | undefined, precision?: number): string;
@@ -7,6 +7,7 @@ export declare const unauthorized: OperationOutcome;
7
7
  export declare const forbidden: OperationOutcome;
8
8
  export declare const gone: OperationOutcome;
9
9
  export declare const tooManyRequests: OperationOutcome;
10
+ export declare const accepted: OperationOutcome;
10
11
  export declare function badRequest(details: string, expression?: string): OperationOutcome;
11
12
  export declare function validationError(details: string): OperationOutcome;
12
13
  export declare function isOperationOutcome(value: unknown): value is OperationOutcome;
@@ -4,8 +4,11 @@
4
4
  * See: https://github.com/ovieokeh/suspense-data-fetching/blob/master/lib/api/wrapPromise.js
5
5
  */
6
6
  export declare class ReadablePromise<T> implements Promise<T> {
7
- #private;
8
7
  readonly [Symbol.toStringTag]: string;
8
+ private suspender;
9
+ private status;
10
+ private response;
11
+ private error;
9
12
  constructor(requestPromise: Promise<T>);
10
13
  /**
11
14
  * Returns true if the promise is pending.
@@ -103,9 +103,41 @@ export declare function validateResourceType(resourceType: string): void;
103
103
  */
104
104
  export declare function validateResource<T extends Resource>(resource: T): void;
105
105
  export declare class FhirSchemaValidator<T extends Resource> {
106
- #private;
106
+ private readonly issues;
107
+ private readonly root;
107
108
  constructor(root: T);
108
109
  validate(): void;
110
+ private validateObject;
111
+ private checkProperties;
112
+ private checkProperty;
113
+ private checkPropertyValue;
114
+ private validatePrimitiveType;
115
+ private validateString;
116
+ private validateNumber;
117
+ private checkAdditionalProperties;
118
+ /**
119
+ * Checks if the given property is allowed on the given object.
120
+ * @param path The path of the current object.
121
+ * @param key The key of a property to check.
122
+ * @param typedValue The current object.
123
+ * @param propertyDefinitions The property definitions of the current object.
124
+ */
125
+ private checkAdditionalProperty;
126
+ /**
127
+ * Checks the element for a primitive.
128
+ *
129
+ * FHIR elements with primitive data types are represented in two parts:
130
+ * 1) A JSON property with the name of the element, which has a JSON type of number, boolean, or string
131
+ * 2) a JSON property with _ prepended to the name of the element, which, if present, contains the value's id and/or extensions
132
+ *
133
+ * See: https://hl7.org/fhir/json.html#primitive
134
+ *
135
+ * @param path The path to the property
136
+ * @param key
137
+ * @param typedValue
138
+ */
139
+ private checkPrimitiveElement;
140
+ private createIssue;
109
141
  }
110
142
  /**
111
143
  * Recursively checks for null values in an object.
@@ -6,7 +6,7 @@
6
6
  * When Using MedplumClient in the server, it will be backed by the MemoryStorage class.
7
7
  */
8
8
  export declare class ClientStorage {
9
- #private;
9
+ private readonly storage;
10
10
  constructor();
11
11
  clear(): void;
12
12
  getString(key: string): string | undefined;
@@ -18,7 +18,7 @@ export declare class ClientStorage {
18
18
  * The MemoryStorage class is a minimal in-memory implementation of the Storage interface.
19
19
  */
20
20
  export declare class MemoryStorage implements Storage {
21
- #private;
21
+ private data;
22
22
  constructor();
23
23
  /**
24
24
  * Returns the number of key/value pairs.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/core",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "description": "Medplum TS/JS Library",
5
5
  "author": "Medplum <hello@medplum.com>",
6
6
  "license": "Apache-2.0",
@@ -1,30 +0,0 @@
1
- /******************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
-
16
- function __classPrivateFieldGet(receiver, state, kind, f) {
17
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
18
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
19
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20
- }
21
-
22
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
23
- if (kind === "m") throw new TypeError("Private method is not writable");
24
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
25
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
26
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
27
- }
28
-
29
- export { __classPrivateFieldGet, __classPrivateFieldSet };
30
- //# sourceMappingURL=tslib.es6.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tslib.es6.mjs","sources":["../../../../../../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.push(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.push(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsQA;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE;AACjE,IAAI,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;AACjG,IAAI,IAAI,OAAO,KAAK,KAAK,UAAU,GAAG,QAAQ,KAAK,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,SAAS,CAAC,0EAA0E,CAAC,CAAC;AACvL,IAAI,OAAO,IAAI,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,KAAK,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAClG,CAAC;AACD;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE;AACxE,IAAI,IAAI,IAAI,KAAK,GAAG,EAAE,MAAM,IAAI,SAAS,CAAC,gCAAgC,CAAC,CAAC;AAC5E,IAAI,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,IAAI,SAAS,CAAC,+CAA+C,CAAC,CAAC;AACjG,IAAI,IAAI,OAAO,KAAK,KAAK,UAAU,GAAG,QAAQ,KAAK,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,SAAS,CAAC,yEAAyE,CAAC,CAAC;AACtL,IAAI,OAAO,CAAC,IAAI,KAAK,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;AAC9G;;;;","x_google_ignoreList":[0]}